From 38931f4d6e0f0b59a39a46e0cf8af1adbd3e34f9 Mon Sep 17 00:00:00 2001 From: Sumama Waheed Date: Wed, 1 Feb 2017 18:10:05 -0500 Subject: [PATCH 1/2] feat(CouchbaseLite): add CouchbaseLite cordova plugin --- src/index.ts | 3 +++ src/plugins/couchbase-lite.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/plugins/couchbase-lite.ts diff --git a/src/index.ts b/src/index.ts index 470cca1814..beb8c71b74 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,6 +29,7 @@ import { CardIO } from './plugins/card-io'; import { Clipboard } from './plugins/clipboard'; import { CodePush } from './plugins/code-push'; import { Contacts } from './plugins/contacts'; +import { CouchbaseLite } from './plugins/couchbase-lite'; import { Crop } from './plugins/crop'; import { DatePicker } from './plugins/datepicker'; import { DBMeter } from './plugins/dbmeter'; @@ -151,6 +152,7 @@ export * from './plugins/card-io'; export * from './plugins/clipboard'; export * from './plugins/code-push'; export * from './plugins/contacts'; +export * from './plugins/couchbase-lite'; export * from './plugins/crop'; export * from './plugins/datepicker'; export * from './plugins/dbmeter'; @@ -275,6 +277,7 @@ window['IonicNative'] = { Clipboard, CodePush, Contacts, + CouchbaseLite, Crop, DatePicker, DBMeter, diff --git a/src/plugins/couchbase-lite.ts b/src/plugins/couchbase-lite.ts new file mode 100644 index 0000000000..2f678ad8e3 --- /dev/null +++ b/src/plugins/couchbase-lite.ts @@ -0,0 +1,35 @@ +import { Plugin, Cordova } from './plugin'; + +/** + * @name Couchbase Lite + * @description + * Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android + * + * @usage + * ``` + * import { CouchbaseLite } from 'ionic-native'; + * + * CouchbaseLite.getURL() + * .then((url: any) => console.log(url)) + * .catch((error: any) => console.log(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'Couchbase Lite', + plugin: '', + pluginRef: 'cblite', + repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin', +}) +export class CouchbaseLite { + + /** + * Get the database url + * @return {Promise} Returns a promise that resolves with the local database url + */ + @Cordova({ + callbackStyle: 'node' + }) + static getURL(): Promise { return; } + +} From 27c8d1556262fbb55c47de17d59cc6abae90e49a Mon Sep 17 00:00:00 2001 From: Sumama Waheed Date: Thu, 2 Feb 2017 10:07:15 -0500 Subject: [PATCH 2/2] add plugin url --- src/plugins/couchbase-lite.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/couchbase-lite.ts b/src/plugins/couchbase-lite.ts index 2f678ad8e3..39d9873442 100644 --- a/src/plugins/couchbase-lite.ts +++ b/src/plugins/couchbase-lite.ts @@ -16,8 +16,8 @@ import { Plugin, Cordova } from './plugin'; * ``` */ @Plugin({ - pluginName: 'Couchbase Lite', - plugin: '', + pluginName: 'CouchbaseLite', + plugin: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin', pluginRef: 'cblite', repo: 'https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin', })