@gatekeeperx/cordova-plugin-devicex 1.2.13 → 1.2.15
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.
- package/README.md +13 -4
- package/package.json +1 -1
- package/plugin.xml +3 -3
- package/src/android/com/gatekeeperx/cordova/DevicexPlugin.java +35 -34
- package/src/android/com/gatekeeperx/cordova/GatekeeperXClient.java +1 -1
- package/src/android/hooks/configure-gradle.js +2 -2
- package/www/devicex.js +7 -7
package/README.md
CHANGED
|
@@ -19,7 +19,19 @@ Para integrar este plugin, asegúrate de cumplir con los siguientes requisitos:
|
|
|
19
19
|
|
|
20
20
|
## 🔧 Instalación
|
|
21
21
|
|
|
22
|
-
|
|
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.
|
|
23
35
|
|
|
24
36
|
```bash
|
|
25
37
|
# Usando Ionic CLI (Recomendado)
|
|
@@ -88,9 +100,6 @@ Obtiene la versión del SDK nativo subyacente.
|
|
|
88
100
|
|
|
89
101
|
**Retorna:** `Promise<string>`
|
|
90
102
|
|
|
91
|
-
### 5. `Devicex.evaluateRisk(options)` (Beta)
|
|
92
|
-
Realiza una evaluación de riesgo específica enviando un payload al motor de decisión.
|
|
93
|
-
|
|
94
103
|
---
|
|
95
104
|
|
|
96
105
|
## 🚀 Uso Rápido (Ionic/Angular)
|
package/package.json
CHANGED
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.
|
|
4
|
+
xmlns:android="http://schemas.android.com/apk/res/android" version="1.2.15">
|
|
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
|
-
<
|
|
34
|
-
<
|
|
33
|
+
<lib-file src="src/android/libs/devicex-bridge.aar" arch="device" />
|
|
34
|
+
<lib-file src="src/android/libs/devicex-1.2.7.aar" arch="device" />
|
|
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
|
-
|
|
90
|
-
|
|
88
|
+
// case "evaluateRisk":
|
|
89
|
+
// evaluateRisk(args, callbackContext);
|
|
90
|
+
// return true;
|
|
91
91
|
default:
|
|
92
92
|
return false;
|
|
93
93
|
}
|
|
@@ -205,35 +205,36 @@ public class DevicexPlugin extends CordovaPlugin {
|
|
|
205
205
|
return list;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
private void evaluateRisk(JSONArray args, final CallbackContext cb) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
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
|
+
// }
|
|
239
240
|
}
|
|
@@ -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
|
-
|
|
40
|
+
private 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('
|
|
46
|
-
implementation files('
|
|
45
|
+
const depsBlock = ` implementation files('libs/devicex-bridge.aar')
|
|
46
|
+
implementation files('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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
// };
|