Skip to content

Commit b2361e6

Browse files
authored
feat(cordova-plugin-unvired-sdk): added new function (#5051)
* feat(cordova-plugin-unvired-sdk): added new properties into loginparameters class and new function. * feat(cordova-plugin-unvired-sdk): added a new property.
1 parent 2e50067 commit b2361e6

File tree

1 file changed

+86
-0
lines changed
  • src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk

1 file changed

+86
-0
lines changed

src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,21 @@ export class LoginParameters {
420420
* The passed credentials will be used based on this flag.
421421
*/
422422
requireClientCredentials: boolean;
423+
424+
/**
425+
* Applicable for SAML SSO login. Set token which is retrieved from the SAML SSO login to this parameter.
426+
*/
427+
jwtToken: string;
428+
429+
/**
430+
* Specify the application version.
431+
*/
432+
appVersion: string;
433+
434+
/**
435+
*
436+
*/
437+
redirectURL: string;
423438
}
424439
export class LoginResult extends UnviredResult {
425440
type: LoginListenerType;
@@ -439,6 +454,18 @@ export class UnviredCredential {
439454
port: string;
440455
}
441456

457+
export class InitialDataDownloadRequest {
458+
name: string;
459+
input: any;
460+
}
461+
462+
export class UMPRequestConfig {
463+
url: string;
464+
headers: {
465+
Authorization: string;
466+
};
467+
}
468+
442469
/**
443470
* @name Unvired Cordova SDK
444471
* @description
@@ -1346,6 +1373,42 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin {
13461373
return;
13471374
}
13481375

1376+
/**
1377+
* Make an Initial Data Download (IDL) request to UMP.
1378+
* This method triggers the initial data download process by making a request to UMP for the specified Process Agent (PA) functions.
1379+
*
1380+
* Example 1: Request IDL for all marked PA functions
1381+
* ```
1382+
* await this.unviredSDK.sendInitialDataDownloadRequest([])
1383+
* ```
1384+
*
1385+
* Example 2: Request IDL for specific PA functions with input
1386+
* ```
1387+
* const initialDataInput = new InitialDataInput();
1388+
* initialDataInput.name = "PA_GET_CUSTOMER_DETAILS";
1389+
* initialDataInput.input = {
1390+
* "BE_NAME": [
1391+
* {
1392+
* "NAME_OF_HEADER": {
1393+
* "FIELD1": "FIELD_1_VALUE",
1394+
* "FIELD2": "FIELD_2_VALUE"
1395+
* }
1396+
* }
1397+
* ]
1398+
* };
1399+
* await this.unviredSDK.sendInitialDataDownloadRequest([initialDataInput]);
1400+
* ```
1401+
*
1402+
* @param functions Array of objects, each containing:
1403+
* - paName: string - Name of the Process Agent function.
1404+
* - input: any - Input data to be sent for the PA function.
1405+
* Pass an empty array to request initial data for all marked PA functions.
1406+
*/
1407+
@Cordova()
1408+
sendInitialDataDownloadRequest(functions: InitialDataDownloadRequest[]): Promise<void> {
1409+
return;
1410+
}
1411+
13491412
/**
13501413
* Returns an observable containing the state of the synchronisation along with count (if applicable). Possible values are as follows:
13511414
* 1. Sending (count) // Ex: sending(3), there are 3 items in outbox and device is online. i.e datasender thread running
@@ -1672,4 +1735,27 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin {
16721735
refreshJWTToken(): Promise<any> {
16731736
return;
16741737
}
1738+
1739+
/**
1740+
* Get UMP request configuration with authentication headers
1741+
* @param {string} endpoint - The API endpoint
1742+
* @param {Object} [options] - Optional configuration object
1743+
* @param {string} [options.customUrl] - Optional custom base URL to override server URL
1744+
* @returns UMPRequestConfig which contails url and auth header
1745+
* Example -
1746+
*
1747+
* // with auth api
1748+
* await this.unviredSDK.getUMPRequestConfig("/auth/getmodel/tenex/tenex_model.json");
1749+
*
1750+
* // with rest api end point
1751+
* // variation: 1
1752+
* await this.unviredSDK.getUMPRequestConfig("/api/v1/users");
1753+
*
1754+
* // variation: 2
1755+
* await this.unviredSDK.getUMPRequestConfig("/UMP/api/v1/users");
1756+
*/
1757+
@Cordova()
1758+
getUMPRequestConfig(): Promise<UMPRequestConfig> {
1759+
return;
1760+
}
16751761
}

0 commit comments

Comments
 (0)