From b09503bf9011c06d38b0fe73d5c693c7d2095a39 Mon Sep 17 00:00:00 2001 From: Srinidhi Rao Date: Mon, 29 Aug 2022 18:06:47 +0530 Subject: [PATCH 1/8] feat(unvired-cordova-sdk): Add new function to regenrate the JWT Token --- .../plugins/unvired-cordova-sdk/index.ts | 9 +++++++++ 1 file changed, 9 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 ae2d739ad8..1752668581 100644 --- a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts +++ b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts @@ -1663,4 +1663,13 @@ export class UnviredCordovaSDK extends AwesomeCordovaNativePlugin { registerForPushNotification(): Promise { return; } + + /** + * Regenerates the JWT token used for communicating with the UMP server. + * The updated token will be available via the registered NotificationListener's callback |JWTTokenReceived| + */ + @Cordova() + refreshJWTToken(): Promise { + return; + } } From 99c0333d6b1cfec9a5a7cb6286102a592a6181ee Mon Sep 17 00:00:00 2001 From: Srinidhi Rao Date: Thu, 9 Feb 2023 15:56:18 +0530 Subject: [PATCH 2/8] feat(unvired-cordova-sdk): Add couple of properties to login parameters. --- .../plugins/unvired-cordova-sdk/index.ts | 11 +++++++++++ 1 file changed, 11 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 1752668581..c78700a289 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,17 @@ export class LoginParameters { * The passed credentials will be used based on this flag. */ requireClientCredentials: boolean; + + /** + * Required for SAML-SSO login. This should be the redirect URL as configured in UMP under Application Properties. + * Instead of a hard-coded value, consider deribing this URL value the base UMP URL. + */ + redirectURL: string; + + /** + * Send the version number of the app which needs to be propagated to UMP. You should be able to view this under the devices section in UMP Admin Cockpit. + */ + appVersion: string; } export class LoginResult extends UnviredResult { type: LoginListenerType; From e5fa7827648f505034ea5b37062cbd3421ad3fb3 Mon Sep 17 00:00:00 2001 From: Srinidhi Rao Date: Fri, 21 Jul 2023 18:05:52 +0530 Subject: [PATCH 3/8] feat(cordova-plugin-firebase-model): Add new plugin for downloading and processing ML model hosted in Firebase. --- .../plugins/firebase-model/index.ts | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 src/@awesome-cordova-plugins/plugins/firebase-model/index.ts diff --git a/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts b/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts new file mode 100644 index 0000000000..d84441bfbe --- /dev/null +++ b/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts @@ -0,0 +1,122 @@ +import { Injectable } from '@angular/core'; +import { + Plugin, + Cordova, + CordovaProperty, + CordovaInstance, + InstanceProperty, + IonicNativePlugin, +} from '@ionic-native/core'; +import { Observable } from 'rxjs'; + +export enum FirebaseModelStatus { + downloading = 'downloading', + completed = 'completed', +} + +export enum FirebaseModelInputType { + path = 'path', + base64string = 'base64string', + blob = 'blob', +} + +export class FirebaseModelConfigResult { + /** + * Returns the current status of the model. + */ + status: FirebaseModelStatus; + /** + * Returns the current progress of the downloading model. + */ + progress: number; +} + +export class FirebaseModelClassifyResult { + /** + * Return the identified image label name. + */ + label: string; + /** + * Returns the confidence score of the identified image. + */ + score: number; +} + +export class FirebaseModelInput { + /** + * Set the one of the input types defined in FirebaseModelInputType enum. + */ + inputType: FirebaseModelInputType; + /** + * Set the input as string | Blob based on the `inputType` + */ + input: string | Blob; +} + +/** + * @name Firebase Model + * @description This plugin downloads the TensorFlow model from firebase and classify the images. + * + * ```typescript + * import { FirebaseModel } from '@ionic-native/ionic-native-firebase-model'; + * + * + * constructor(private firebaseModel: FirebaseModel) { } + * + * ... + * + * + * this.firebaseModel.configure('Sample_Model') + * .subscribe((res: FirebaseModelConfigResult) => console.log(res.status + " - " + res.progress)) + * .catch((error: any) => console.error(error)); + * + * + * try { + * var result:FirebaseModelClassifyResult = await this.firebaseModel.classify("/Documents/input_image.png") + * console.log(result.label + " - " + result.score) + * + * } + * catch (e) { + * console.log(e) + * } + * + * + * ``` + */ +@Plugin({ + pluginName: 'FirebaseModel', + plugin: 'cordova-plugin-firebase-model', // npm package name, example: cordova-plugin-camera + pluginRef: 'FirebaseModel', // the variable reference to call the plugin, example: navigator.geolocation + repo: '', // the github repository URL for the plugin + install: 'ionic cordova plugin add cordova-plugin-firebase-model', // OPTIONAL install command, in case the plugin requires variables + installVariables: [], // OPTIONAL the plugin requires variables + platforms: ['iOS'], // Array of platforms supported, example: ['Android', 'iOS'] +}) +@Injectable() +export class FirebaseModel extends IonicNativePlugin { + /** + * This function configure the Firebase TFLite model and downloads. + * @param {string} arg1 Name of the TFLite model which is uploaded in the Firebase console + * @returns {Observable} Returns a observable that gives the callback for downloading progress and status. + * + */ + @Cordova({ + successIndex: 1, + errorIndex: 2, + observable: true, + }) + configure(arg1: string): Observable { + return; + } + + /** + * This function identify the image using the Firebase TFLite model which is configured. + * @param {FirebaseModelInput} arg1 Base64 string of the input image or . + * @returns {Promise} Returns a promise that resolves the classification result. + * + */ + @Cordova() + classify(arg1: FirebaseModelInput): Promise { + return; + } +} From f0989f36130ec09803c248bdf615a885c0a85944 Mon Sep 17 00:00:00 2001 From: Srinidhi Rao Date: Fri, 21 Jul 2023 18:13:38 +0530 Subject: [PATCH 4/8] fix(cordova-plugin-unvired-sdk): revert last set of changes. --- .../plugins/unvired-cordova-sdk/index.ts | 11 ----------- 1 file changed, 11 deletions(-) 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 c78700a289..1752668581 100644 --- a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts +++ b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts @@ -420,17 +420,6 @@ export class LoginParameters { * The passed credentials will be used based on this flag. */ requireClientCredentials: boolean; - - /** - * Required for SAML-SSO login. This should be the redirect URL as configured in UMP under Application Properties. - * Instead of a hard-coded value, consider deribing this URL value the base UMP URL. - */ - redirectURL: string; - - /** - * Send the version number of the app which needs to be propagated to UMP. You should be able to view this under the devices section in UMP Admin Cockpit. - */ - appVersion: string; } export class LoginResult extends UnviredResult { type: LoginListenerType; From a79f31e12e1025b9fdde736e4933ee3a749c18bb Mon Sep 17 00:00:00 2001 From: Srinidhi Rao Date: Fri, 21 Jul 2023 18:15:40 +0530 Subject: [PATCH 5/8] fix(cordova-plugin-unvired-sdk): Add two new login properties. --- .../plugins/unvired-cordova-sdk/index.ts | 11 +++++++++++ 1 file changed, 11 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 1752668581..c78700a289 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,17 @@ export class LoginParameters { * The passed credentials will be used based on this flag. */ requireClientCredentials: boolean; + + /** + * Required for SAML-SSO login. This should be the redirect URL as configured in UMP under Application Properties. + * Instead of a hard-coded value, consider deribing this URL value the base UMP URL. + */ + redirectURL: string; + + /** + * Send the version number of the app which needs to be propagated to UMP. You should be able to view this under the devices section in UMP Admin Cockpit. + */ + appVersion: string; } export class LoginResult extends UnviredResult { type: LoginListenerType; From 86f39dc7e83d82a707c74034a1384602531b34e9 Mon Sep 17 00:00:00 2001 From: Srinidhi Rao Date: Fri, 21 Jul 2023 18:18:03 +0530 Subject: [PATCH 6/8] fix(cordova-plugin-firebase-model): Delete the previously added plugin. --- .../plugins/firebase-model/index.ts | 122 ------------------ 1 file changed, 122 deletions(-) delete mode 100644 src/@awesome-cordova-plugins/plugins/firebase-model/index.ts diff --git a/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts b/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts deleted file mode 100644 index d84441bfbe..0000000000 --- a/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { Injectable } from '@angular/core'; -import { - Plugin, - Cordova, - CordovaProperty, - CordovaInstance, - InstanceProperty, - IonicNativePlugin, -} from '@ionic-native/core'; -import { Observable } from 'rxjs'; - -export enum FirebaseModelStatus { - downloading = 'downloading', - completed = 'completed', -} - -export enum FirebaseModelInputType { - path = 'path', - base64string = 'base64string', - blob = 'blob', -} - -export class FirebaseModelConfigResult { - /** - * Returns the current status of the model. - */ - status: FirebaseModelStatus; - /** - * Returns the current progress of the downloading model. - */ - progress: number; -} - -export class FirebaseModelClassifyResult { - /** - * Return the identified image label name. - */ - label: string; - /** - * Returns the confidence score of the identified image. - */ - score: number; -} - -export class FirebaseModelInput { - /** - * Set the one of the input types defined in FirebaseModelInputType enum. - */ - inputType: FirebaseModelInputType; - /** - * Set the input as string | Blob based on the `inputType` - */ - input: string | Blob; -} - -/** - * @name Firebase Model - * @description This plugin downloads the TensorFlow model from firebase and classify the images. - * - * ```typescript - * import { FirebaseModel } from '@ionic-native/ionic-native-firebase-model'; - * - * - * constructor(private firebaseModel: FirebaseModel) { } - * - * ... - * - * - * this.firebaseModel.configure('Sample_Model') - * .subscribe((res: FirebaseModelConfigResult) => console.log(res.status + " - " + res.progress)) - * .catch((error: any) => console.error(error)); - * - * - * try { - * var result:FirebaseModelClassifyResult = await this.firebaseModel.classify("/Documents/input_image.png") - * console.log(result.label + " - " + result.score) - * - * } - * catch (e) { - * console.log(e) - * } - * - * - * ``` - */ -@Plugin({ - pluginName: 'FirebaseModel', - plugin: 'cordova-plugin-firebase-model', // npm package name, example: cordova-plugin-camera - pluginRef: 'FirebaseModel', // the variable reference to call the plugin, example: navigator.geolocation - repo: '', // the github repository URL for the plugin - install: 'ionic cordova plugin add cordova-plugin-firebase-model', // OPTIONAL install command, in case the plugin requires variables - installVariables: [], // OPTIONAL the plugin requires variables - platforms: ['iOS'], // Array of platforms supported, example: ['Android', 'iOS'] -}) -@Injectable() -export class FirebaseModel extends IonicNativePlugin { - /** - * This function configure the Firebase TFLite model and downloads. - * @param {string} arg1 Name of the TFLite model which is uploaded in the Firebase console - * @returns {Observable} Returns a observable that gives the callback for downloading progress and status. - * - */ - @Cordova({ - successIndex: 1, - errorIndex: 2, - observable: true, - }) - configure(arg1: string): Observable { - return; - } - - /** - * This function identify the image using the Firebase TFLite model which is configured. - * @param {FirebaseModelInput} arg1 Base64 string of the input image or . - * @returns {Promise} Returns a promise that resolves the classification result. - * - */ - @Cordova() - classify(arg1: FirebaseModelInput): Promise { - return; - } -} From 68022fad035058453c1ce00bc60c10b71fa41834 Mon Sep 17 00:00:00 2001 From: Srinidhi Rao Date: Fri, 21 Jul 2023 18:20:03 +0530 Subject: [PATCH 7/8] Revert "fix(cordova-plugin-firebase-model): Delete the previously added plugin." This reverts commit 86f39dc7e83d82a707c74034a1384602531b34e9. --- .../plugins/firebase-model/index.ts | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 src/@awesome-cordova-plugins/plugins/firebase-model/index.ts diff --git a/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts b/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts new file mode 100644 index 0000000000..d84441bfbe --- /dev/null +++ b/src/@awesome-cordova-plugins/plugins/firebase-model/index.ts @@ -0,0 +1,122 @@ +import { Injectable } from '@angular/core'; +import { + Plugin, + Cordova, + CordovaProperty, + CordovaInstance, + InstanceProperty, + IonicNativePlugin, +} from '@ionic-native/core'; +import { Observable } from 'rxjs'; + +export enum FirebaseModelStatus { + downloading = 'downloading', + completed = 'completed', +} + +export enum FirebaseModelInputType { + path = 'path', + base64string = 'base64string', + blob = 'blob', +} + +export class FirebaseModelConfigResult { + /** + * Returns the current status of the model. + */ + status: FirebaseModelStatus; + /** + * Returns the current progress of the downloading model. + */ + progress: number; +} + +export class FirebaseModelClassifyResult { + /** + * Return the identified image label name. + */ + label: string; + /** + * Returns the confidence score of the identified image. + */ + score: number; +} + +export class FirebaseModelInput { + /** + * Set the one of the input types defined in FirebaseModelInputType enum. + */ + inputType: FirebaseModelInputType; + /** + * Set the input as string | Blob based on the `inputType` + */ + input: string | Blob; +} + +/** + * @name Firebase Model + * @description This plugin downloads the TensorFlow model from firebase and classify the images. + * + * ```typescript + * import { FirebaseModel } from '@ionic-native/ionic-native-firebase-model'; + * + * + * constructor(private firebaseModel: FirebaseModel) { } + * + * ... + * + * + * this.firebaseModel.configure('Sample_Model') + * .subscribe((res: FirebaseModelConfigResult) => console.log(res.status + " - " + res.progress)) + * .catch((error: any) => console.error(error)); + * + * + * try { + * var result:FirebaseModelClassifyResult = await this.firebaseModel.classify("/Documents/input_image.png") + * console.log(result.label + " - " + result.score) + * + * } + * catch (e) { + * console.log(e) + * } + * + * + * ``` + */ +@Plugin({ + pluginName: 'FirebaseModel', + plugin: 'cordova-plugin-firebase-model', // npm package name, example: cordova-plugin-camera + pluginRef: 'FirebaseModel', // the variable reference to call the plugin, example: navigator.geolocation + repo: '', // the github repository URL for the plugin + install: 'ionic cordova plugin add cordova-plugin-firebase-model', // OPTIONAL install command, in case the plugin requires variables + installVariables: [], // OPTIONAL the plugin requires variables + platforms: ['iOS'], // Array of platforms supported, example: ['Android', 'iOS'] +}) +@Injectable() +export class FirebaseModel extends IonicNativePlugin { + /** + * This function configure the Firebase TFLite model and downloads. + * @param {string} arg1 Name of the TFLite model which is uploaded in the Firebase console + * @returns {Observable} Returns a observable that gives the callback for downloading progress and status. + * + */ + @Cordova({ + successIndex: 1, + errorIndex: 2, + observable: true, + }) + configure(arg1: string): Observable { + return; + } + + /** + * This function identify the image using the Firebase TFLite model which is configured. + * @param {FirebaseModelInput} arg1 Base64 string of the input image or . + * @returns {Promise} Returns a promise that resolves the classification result. + * + */ + @Cordova() + classify(arg1: FirebaseModelInput): Promise { + return; + } +} From 20e317babc1ec8b324557bd0207870228423e112 Mon Sep 17 00:00:00 2001 From: Srinidhi Rao Date: Fri, 21 Jul 2023 18:20:22 +0530 Subject: [PATCH 8/8] Revert "fix(cordova-plugin-unvired-sdk): Add two new login properties." This reverts commit a79f31e12e1025b9fdde736e4933ee3a749c18bb. --- .../plugins/unvired-cordova-sdk/index.ts | 11 ----------- 1 file changed, 11 deletions(-) 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 c78700a289..1752668581 100644 --- a/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts +++ b/src/@awesome-cordova-plugins/plugins/unvired-cordova-sdk/index.ts @@ -420,17 +420,6 @@ export class LoginParameters { * The passed credentials will be used based on this flag. */ requireClientCredentials: boolean; - - /** - * Required for SAML-SSO login. This should be the redirect URL as configured in UMP under Application Properties. - * Instead of a hard-coded value, consider deribing this URL value the base UMP URL. - */ - redirectURL: string; - - /** - * Send the version number of the app which needs to be propagated to UMP. You should be able to view this under the devices section in UMP Admin Cockpit. - */ - appVersion: string; } export class LoginResult extends UnviredResult { type: LoginListenerType;