Skip to content

Commit 50d9110

Browse files
srinidhiraoSrinidhi Anand Rao
andauthored
feat(unvired-cordova-sdk): add ability to receive the JWT token (#3671)
* 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 * fix(unvired-cordova-sdk): fix the data type for ResultType and OutboxLockStatus * doc(unvired-cordova-sdk): Update doc * doc(unvired-cordova-sdk): Update doc * feat(unvired-cordova-sdk): Added new notification type * feat(unvired-cordova-sdk): delete outbox item based on lid * fix(unvired-cordova-sdk): Update doc * doc(unvired-cordova-sdk): Update doc for userSettings() * feat(unvired-cordova-sdk): add new discovery api * fix(unvired-cordova-sdk): rename the property * doc(unvired-cordova-sdk): Doc update * fix(unvired-cordova-sdk): Update the return type for startDiscoveryService api * doc(unvired-cordova-sdk): Rename the loginParameter languageCode to loginLanguage. * changes after doing npm install * feat(unvired-cordova-sdk): Add a new login parameter to send jwt options. * feat(unvired-cordova-sdk): add new function to cache website data * feat(unvired-cordova-sdk): new function to export the database for browser platform * fix(unvired-cordova-sdk): fix method names * feat(unvired-cordova-sdk): add new function 'setClientCredentials' * doc(unvired-cordova-sdk): Update doc * fix(unvired-cordova-sdk): Create a new Credential object and pass that as an input to the setClientCredentials() function. * fix(unvired-cordova-sdk): Fix the typo in the function parameter. * fix(unvired-cordova-sdk): Changed the type of port to string. * feat(unvired-cordova-sdk): add methods to encrypt and decrypt the string. * Delete package-lock.json removed the package-locj.json from the PR Co-authored-by: Srinidhi Anand Rao <[email protected]>
1 parent b206b42 commit 50d9110

File tree

1 file changed

+81
-2
lines changed
  • src/@ionic-native/plugins/unvired-cordova-sdk

1 file changed

+81
-2
lines changed

src/@ionic-native/plugins/unvired-cordova-sdk/index.ts

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ export enum LoginType {
114114
* Set the type to email to login based on email id.
115115
*/
116116
email = 'EMAIL',
117+
/**
118+
* SAML 2.0 Login Type
119+
*/
120+
saml2 = 'SAML2',
117121
/**
118122
* TODO:
119123
*/
@@ -207,6 +211,10 @@ export enum NotificationListenerType {
207211
* Notify when the sent item count changes.
208212
*/
209213
SentItemChanged = 11,
214+
/**
215+
* Notify that the JWT token is received
216+
*/
217+
JWTTokenReceived = 12
210218
}
211219

212220
export enum AttachmentItemStatus {
@@ -390,8 +398,7 @@ export class LoginParameters {
390398
persistWebDb: boolean;
391399

392400
/*
393-
* Optional jwt token parameter. Please check with your Unvired Admin for this value.
394-
* For Example:
401+
* JWT options.
395402
* loginParameters.jwtOptions = {"app": "myapp"};
396403
*/
397404
jwtOptions: object;
@@ -401,6 +408,18 @@ export class LoginParameters {
401408
* The default value of this is 'en'.
402409
*/
403410
loginLanguage: string;
411+
412+
/**
413+
* Applicable for browser only. Set this flag to indicate that saved data should be reloaded upon launch.
414+
*/
415+
cacheWebData: boolean;
416+
417+
/**
418+
* Set this value if you the login process requires client credentials to be set.
419+
* You can pass the client credentials with the method: |unviredSDK.setClientCredentials(credentials)|
420+
* The passed credentials will be used based on this flag.
421+
*/
422+
requireClientCredentials: boolean;
404423
}
405424
export class LoginResult extends UnviredResult {
406425
type: LoginListenerType;
@@ -414,6 +433,12 @@ export class AuthenticateLocalResult extends UnviredResult {
414433
type: AuthenticateLocalResultType;
415434
}
416435

436+
export class UnviredCredential {
437+
user: string;
438+
password: string;
439+
port: string;
440+
}
441+
417442
/**
418443
* @name Unvired Cordova SDK
419444
* @description
@@ -1055,6 +1080,24 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
10551080
return;
10561081
}
10571082

1083+
/**
1084+
* Browser platform only. Call this function to save the WebData. This function can be used to preserve a large data that is downloaded.
1085+
* If you set the loginParameter flag, |cacheWebData|, then the plugin loads this data.
1086+
*/
1087+
@Cordova()
1088+
dbSaveWebData(): Promise<any> {
1089+
return;
1090+
}
1091+
1092+
/**
1093+
* Browser platform only. Call this function to export the Webdata.
1094+
* Call this function to export the Web
1095+
*/
1096+
@Cordova()
1097+
dbExportWebData(): Promise<any> {
1098+
return;
1099+
}
1100+
10581101
/**
10591102
* Supported in Android & Windows only.
10601103
* Launch a file from a file path
@@ -1513,4 +1556,40 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
15131556
startDiscoveryService(): Promise<UnviredResult> {
15141557
return;
15151558
}
1559+
1560+
/**
1561+
* Use this function to set the SAP credentials to be sent to UMP.
1562+
* @param credentials Array of |Credential| objects.
1563+
*/
1564+
@Cordova()
1565+
setClientCredentials(credentials: UnviredCredential[]) {
1566+
return;
1567+
}
1568+
1569+
/**
1570+
* Check for client credentials.
1571+
* @returns Returns true if client credentials are set
1572+
*/
1573+
@Cordova()
1574+
isClientCredentialsSet(): Promise<UnviredResult> {
1575+
return;
1576+
}
1577+
1578+
/**
1579+
* Encrypt a string with the key stored by the Unvired SDK.
1580+
* @returns UnviredResult.data which should contains the encrypted string.
1581+
*/
1582+
@Cordova()
1583+
encrypt(stringToBeEncrypted: string): Promise<UnviredResult> {
1584+
return;
1585+
}
1586+
1587+
/**
1588+
* Decrypt a string with the string encrypted with the key (key stored by the Unvired SDK)
1589+
* @returns UnviredResult.data which should contains the decrypted string.
1590+
*/
1591+
@Cordova()
1592+
decrypt(stringToBeDecrypted: string): Promise<UnviredResult> {
1593+
return;
1594+
}
15161595
}

0 commit comments

Comments
 (0)