@gatekeeperx/cordova-plugin-devicex 1.2.12 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @gatekeeperx/cordova-plugin-devicex might be problematic. Click here for more details.

package/README.md CHANGED
@@ -19,19 +19,7 @@ Para integrar este plugin, asegúrate de cumplir con los siguientes requisitos:
19
19
 
20
20
  ## 🔧 Instalación
21
21
 
22
-
23
- ### Prerequisitos
24
-
25
- Asegúrate de tener instalado Node.js y npm en tu máquina. ejecuta este comando para instalar el plugin:
26
-
27
-
28
- ```bash
29
- npm i @gatekeeperx/cordova-plugin-devicex
30
- ```
31
-
32
- ### Instalación
33
-
34
- Instala el plugin utilizando el CLI de Cordova o Ionic. Esto configurará automáticamente las dependencias nativas en tu proyecto.
22
+ Instala el plugin utilizando el CLI de Cordova o Ionic. Esto descargará el paquete de npm y configurará automáticamente las dependencias nativas en tu proyecto.
35
23
 
36
24
  ```bash
37
25
  # Usando Ionic CLI (Recomendado)
@@ -100,6 +88,9 @@ Obtiene la versión del SDK nativo subyacente.
100
88
 
101
89
  **Retorna:** `Promise<string>`
102
90
 
91
+ ### 5. `Devicex.evaluateRisk(options)` (Beta)
92
+ Realiza una evaluación de riesgo específica enviando un payload al motor de decisión.
93
+
103
94
  ---
104
95
 
105
96
  ## 🚀 Uso Rápido (Ionic/Angular)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gatekeeperx/cordova-plugin-devicex",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "description": "GatekeeperX Device Intelligence Cordova plugin (Android)",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
package/plugin.xml CHANGED
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <plugin id="@gatekeeperx/cordova-plugin-devicex"
3
3
  xmlns="http://apache.org/cordova/ns/plugins/1.0"
4
- xmlns:android="http://schemas.android.com/apk/res/android" version="1.2.8">
4
+ xmlns:android="http://schemas.android.com/apk/res/android" version="1.2.13">
5
5
  <name>Devicex</name>
6
6
  <description>GatekeeperX Device Intelligence Cordova plugin (Android)</description>
7
7
  <license>Apache-2.0</license>
@@ -30,8 +30,8 @@
30
30
  <framework src="io.ktor:ktor-client-content-negotiation:2.3.7" />
31
31
  <framework src="io.ktor:ktor-serialization-kotlinx-json:2.3.7" />
32
32
  <!-- AARs locales -->
33
- <lib-file src="src/android/libs/devicex-bridge.aar" arch="device" />
34
- <lib-file src="src/android/libs/devicex-1.2.6.aar" arch="device" />
33
+ <resource-file src="src/android/libs/devicex-bridge.aar" target="libs/devicex-bridge.aar" />
34
+ <resource-file src="src/android/libs/devicex-1.2.7.aar" target="libs/devicex-1.2.7.aar" />
35
35
 
36
36
  <!-- Hook para configurar Gradle -->
37
37
  <hook type="after_plugin_install" src="src/android/hooks/configure-gradle.js" />
@@ -85,9 +85,9 @@ public class DevicexPlugin extends CordovaPlugin {
85
85
  callbackContext.error(e.getMessage());
86
86
  }
87
87
  return true;
88
- // case "evaluateRisk":
89
- // evaluateRisk(args, callbackContext);
90
- // return true;
88
+ case "evaluateRisk":
89
+ evaluateRisk(args, callbackContext);
90
+ return true;
91
91
  default:
92
92
  return false;
93
93
  }
@@ -205,36 +205,35 @@ public class DevicexPlugin extends CordovaPlugin {
205
205
  return list;
206
206
  }
207
207
 
208
- // private void evaluateRisk(JSONArray args, final CallbackContext cb) {
209
- // try {
210
- // JSONObject obj = args.optJSONObject(0);
211
- // if (obj == null)
212
- // obj = new JSONObject();
213
-
214
- // String apiUrl = obj.optString("apiUrl", "");
215
- // String orgId = obj.optString("organizationId", "");
216
- // String apiKey = obj.optString("apiKey", "");
217
- // JSONObject payload = obj.optJSONObject("payload");
218
-
219
- // if (apiUrl.isEmpty() || orgId.isEmpty() || payload == null) {
220
- // cb.error("apiUrl, organizationId and payload are required");
221
- // return;
222
- // }
223
-
224
- // GatekeeperXClient.evaluateRisk(apiUrl, orgId, apiKey, payload, new
225
- // GatekeeperXClient.Callback() {
226
- // @Override
227
- // public void onSuccess(JSONObject response) {
228
- // cb.success(response);
229
- // }
230
-
231
- // @Override
232
- // public void onError(String error) {
233
- // cb.error(error);
234
- // }
235
- // });
236
- // } catch (Exception e) {
237
- // cb.error(e.getMessage());
238
- // }
239
- // }
208
+ private void evaluateRisk(JSONArray args, final CallbackContext cb) {
209
+ try {
210
+ JSONObject obj = args.optJSONObject(0);
211
+ if (obj == null)
212
+ obj = new JSONObject();
213
+
214
+ String apiUrl = obj.optString("apiUrl", "");
215
+ String orgId = obj.optString("organizationId", "");
216
+ String apiKey = obj.optString("apiKey", "");
217
+ JSONObject payload = obj.optJSONObject("payload");
218
+
219
+ if (apiUrl.isEmpty() || orgId.isEmpty() || payload == null) {
220
+ cb.error("apiUrl, organizationId and payload are required");
221
+ return;
222
+ }
223
+
224
+ GatekeeperXClient.evaluateRisk(apiUrl, orgId, apiKey, payload, new GatekeeperXClient.Callback() {
225
+ @Override
226
+ public void onSuccess(JSONObject response) {
227
+ cb.success(response);
228
+ }
229
+
230
+ @Override
231
+ public void onError(String error) {
232
+ cb.error(error);
233
+ }
234
+ });
235
+ } catch (Exception e) {
236
+ cb.error(e.getMessage());
237
+ }
238
+ }
240
239
  }
@@ -37,7 +37,7 @@ public class GatekeeperXClient {
37
37
  * @param payload JSON con los datos del evento
38
38
  * @param callback Callback para manejar respuesta/error
39
39
  */
40
- private static void evaluateRisk(
40
+ public static void evaluateRisk(
41
41
  final String apiUrl,
42
42
  final String organizationId,
43
43
  final String apiKey,
@@ -42,8 +42,8 @@ repositories {
42
42
 
43
43
  // Agregar dependencias de AARs después de fileTree si no existen
44
44
  if (buildGradle.indexOf('devicex-bridge') === -1) {
45
- const depsBlock = ` implementation files('libs/devicex-bridge.aar')
46
- implementation files('libs/devicex-1.2.6.aar')
45
+ const depsBlock = ` implementation files('src/main/libs/devicex-bridge.aar')
46
+ implementation files('src/main/libs/devicex-1.2.7.aar')
47
47
 
48
48
  // Dependencias del SDK Devicex
49
49
  implementation 'io.ktor:ktor-client-core:2.3.7'
package/www/devicex.js CHANGED
@@ -27,10 +27,10 @@ exports.getVersion = function () {
27
27
  return call('getVersion', []).then(function (res) { return (res && res.value) || ''; });
28
28
  };
29
29
 
30
- // exports.evaluateRisk = function (options) {
31
- // if (!options || !options.apiUrl || !options.organizationId || !options.payload) {
32
- // return Promise.reject('apiUrl, organizationId and payload are required');
33
- // }
34
- // // apiKey es opcional
35
- // return call('evaluateRisk', [options]);
36
- // };
30
+ exports.evaluateRisk = function (options) {
31
+ if (!options || !options.apiUrl || !options.organizationId || !options.payload) {
32
+ return Promise.reject('apiUrl, organizationId and payload are required');
33
+ }
34
+ // apiKey es opcional
35
+ return call('evaluateRisk', [options]);
36
+ };
Binary file