From 53213bb57ab8ef2896504f2d21231276cf3eb6b6 Mon Sep 17 00:00:00 2001 From: Srinidhi Date: Fri, 28 Feb 2020 23:26:54 +0530 Subject: [PATCH] feat(unvired-cordova-sdk): add new functions to lock and unlock sending of data (#3329) * 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 * feat(unvired-cordova-sdk): add method to get log file path * feat(unvired-cordova-sdk): test push notifications * fix(unvired-cordova-sdk): define return for logRead * doc(unvired-cordova-sdk): remove mobile only restriction for some apis * feat(unvired-cordova-sdk): add new property containing HTTP status code. * feat(unvired-cordova-sdk): add new functions to lock & unlock sending of data * fix(unvired-cordova-sdk): update the return type for lock and unlock functions. * fix(unvired-cordova-sdk): change the return type for lockDataSender api --- .../plugins/unvired-cordova-sdk/index.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts b/src/@ionic-native/plugins/unvired-cordova-sdk/index.ts index ca1fc7a13..80ddb3f96 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'; +/** + * Outbox Lock Result States + */ +export enum OutboxLockStatus { + LockApplied = 0, + DataBeingSent = 1, + DataNotInQueue = 2 +} + /** * Log levels supported in the sdk. */ @@ -243,6 +252,10 @@ export class UnviredResult { errorDetail: string; } +export class OutboxLockResult extends UnviredResult { + type: OutboxLockStatus; +} + export class LogResult extends UnviredResult { type: ResultType; data: LogLevel; @@ -1328,4 +1341,23 @@ export class UnviredCordovaSDK extends IonicNativePlugin { testPushNotification(): Promise { return; } + + /** + * Mobile Platform only. + * Lock sending of data for this BE. + * @param beLid LID of the Business Entity + */ + @Cordova() + lockDataSender(beLid: string): Promise { + return; + } + + /** + * Mobile Platform only. + * Release any locks applied for sending data (DataSender Thread) to the server. + */ + @Cordova() + unlockDataSender(): Promise { + return; + } }