From 042e36de08e8b101cd95fc5fca6d511295535a1a Mon Sep 17 00:00:00 2001 From: Srinidhi Date: Wed, 30 Oct 2019 21:24:54 +0530 Subject: [PATCH] feat(unvired-cordova-sdk): add methods to get and set log level and other functions. (#3207) * feat(unvired-cordova-sdk): support login via email * fix(unvired-cordova-sdk): return typed promise object for user settings * fix(unvired-cordova-sdk): change return type to string for guid() * doc(unvired-cordova-sdk): doc update * doc(unvired-cordova-sdk): update doc * feat(unvired-cordova-sdk): add support for metadata JSON * doc(unvired-cordova-sdk): update doc * doc(unvired-cordova-sdk): update doc * feat(unvired-cordova-sdk): add methods to get and set log level * fix(unvired-cordova-sdk): update the return type for getLog() * feat(unvired-cordova-sdk): return platform name --- .../plugins/unvired-cordova-sdk/index.ts | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts b/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts index 076f9da6b..9bd06934f 100644 --- a/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts +++ b/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts @@ -2,6 +2,15 @@ import { Injectable } from '@angular/core'; import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; +/** + * Log levels supported in the sdk. + */ +export enum LogLevel { + important = 7, + error = 8, + debug = 9 +} + /** * AuthenticateAndActivateResultType Some Documentation */ @@ -229,6 +238,11 @@ export class UnviredResult { errorDetail: string; } +export class LogResult extends UnviredResult { + type: ResultType; + data: LogLevel; +} + export class NotifResult extends UnviredResult { type: NotificationListenerType; } @@ -578,6 +592,23 @@ export class UnviredCordovaSDK extends IonicNativePlugin { return; } + /** + * Returns the current log level. + */ + @Cordova() + getLogLevel(): Promise { + return; + } + + /** + * Set the log level of the app. + * @param logLevel The log level to set + */ + @Cordova() + setLogLevel(logLevel: LogLevel): Promise { + return; + } + /** * This api initializes the Unvired Application. * @param loginParameters Set of parameters to be passed the login() @@ -1071,6 +1102,21 @@ export class UnviredCordovaSDK extends IonicNativePlugin { return; } + /** + * Returns an observable containing the state of the synchronisation along with count (if applicable). Possible values are as follows: + * 1. Sending (count) // Ex: sending(3), there are 3 items in outbox and device is online. i.e datasender thread running + * 2. Receiving // There are items to be received from server & device is online + * 3. Processing (count) // Ex: processing (5), there are 5 items in inbox and they are being processed. + * 4. Waiting to connect // The device is offline & there are items in outbox + * 5. Idle // there is no synchronisation activity going on. + */ + @Cordova({ + observable: true + }) + getSynchronizationState(): Observable { + return; + } + /** * For Browser platform only. * Reinitialize web db. Use this api to initialize db from persisted local storage db @@ -1205,7 +1251,35 @@ export class UnviredCordovaSDK extends IonicNativePlugin { * For Browser platform only * Helps in updating application database without reauthenticating with server which requires to drop both app and framework database. */ + @Cordova() reCreateAppDB(): Promise { return; } + + /** + * For Mobile platform only + * Starts Inbox handler if there are items in inbox. + */ + @Cordova() + startInboxHandler(): Promise { + return; + } + + /** + * For Mobile platform only + * Starts DataSender if there are items in outbox. + */ + @Cordova() + startDataSender(): Promise { + return; + } + + /** + * Returns platform name + * Ex: ios, android, windows, browser + */ + @Cordova() + platform(): Promise { + return; + } }