From b2361e682052b32ecf9fd3362d1acc260a0c47e1 Mon Sep 17 00:00:00 2001 From: Venkadesh P <51443616+venkadesh-p@users.noreply.github.com> Date: Fri, 8 Aug 2025 15:59:39 +0530 Subject: [PATCH] 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. --- .../plugins/unvired-cordova-sdk/index.ts | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts index 175266858..f72643e15 100644 --- a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts +++ b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts @@ -420,6 +420,21 @@ export class LoginParameters { * The passed credentials will be used based on this flag. */ requireClientCredentials: boolean; + + /** + * Applicable for SAML SSO login. Set token which is retrieved from the SAML SSO login to this parameter. + */ + jwtToken: string; + + /** + * Specify the application version. + */ + appVersion: string; + + /** + * + */ + redirectURL: string; } export class LoginResult extends UnviredResult { type: LoginListenerType; @@ -439,6 +454,18 @@ export class UnviredCredential { port: string; } +export class InitialDataDownloadRequest { + name: string; + input: any; +} + +export class UMPRequestConfig { + url: string; + headers: { + Authorization: string; + }; +} + /** * @name Unvired Cordova SDK * @description @@ -1346,6 +1373,42 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin { return; } + /** + * Make an Initial Data Download (IDL) request to UMP. + * This method triggers the initial data download process by making a request to UMP for the specified Process Agent (PA) functions. + * + * Example 1: Request IDL for all marked PA functions + * ``` + * await this.unviredSDK.sendInitialDataDownloadRequest([]) + * ``` + * + * Example 2: Request IDL for specific PA functions with input + * ``` + * const initialDataInput = new InitialDataInput(); + * initialDataInput.name = "PA_GET_CUSTOMER_DETAILS"; + * initialDataInput.input = { + * "BE_NAME": [ + * { + * "NAME_OF_HEADER": { + * "FIELD1": "FIELD_1_VALUE", + * "FIELD2": "FIELD_2_VALUE" + * } + * } + * ] + * }; + * await this.unviredSDK.sendInitialDataDownloadRequest([initialDataInput]); + * ``` + * + * @param functions Array of objects, each containing: + * - paName: string - Name of the Process Agent function. + * - input: any - Input data to be sent for the PA function. + * Pass an empty array to request initial data for all marked PA functions. + */ + @Cordova() + sendInitialDataDownloadRequest(functions: InitialDataDownloadRequest[]): Promise { + 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 @@ -1672,4 +1735,27 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin { refreshJWTToken(): Promise { return; } + + /** + * Get UMP request configuration with authentication headers + * @param {string} endpoint - The API endpoint + * @param {Object} [options] - Optional configuration object + * @param {string} [options.customUrl] - Optional custom base URL to override server URL + * @returns UMPRequestConfig which contails url and auth header + * Example - + * + * // with auth api + * await this.unviredSDK.getUMPRequestConfig("/auth/getmodel/tenex/tenex_model.json"); + * + * // with rest api end point + * // variation: 1 + * await this.unviredSDK.getUMPRequestConfig("/api/v1/users"); + * + * // variation: 2 + * await this.unviredSDK.getUMPRequestConfig("/UMP/api/v1/users"); + */ + @Cordova() + getUMPRequestConfig(): Promise { + return; + } }