@regulaforensics/idv 3.2.26-beta → 3.2.68-beta

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.
Files changed (77) hide show
  1. package/README.md +2 -8
  2. package/RNIDV.podspec +3 -3
  3. package/android/CVDIDV.kt +3 -0
  4. package/android/build.gradle +2 -11
  5. package/android/cordova.gradle +2 -2
  6. package/android/src/main/java/com/regula/plugin/idv/JSONConstructor.kt +32 -0
  7. package/android/src/main/java/com/regula/plugin/idv/Main.kt +21 -1
  8. package/android/src/main/java/com/regula/plugin/idv/RNIDVModule.kt +3 -0
  9. package/examples/capacitor/android/build.gradle +1 -1
  10. package/examples/capacitor/index.tsx +5 -5
  11. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +4 -0
  12. package/examples/capacitor/package-lock.json +3350 -0
  13. package/examples/capacitor/package.json +7 -7
  14. package/examples/capacitor/src/main.html +9 -30
  15. package/examples/capacitor/src/main.tsx +115 -1
  16. package/examples/ionic/README.md +2 -2
  17. package/examples/ionic/config.xml +1 -0
  18. package/examples/ionic/index.tsx +5 -1
  19. package/examples/ionic/package-lock.json +16573 -0
  20. package/examples/ionic/package.json +19 -19
  21. package/examples/ionic/src/main.html +9 -30
  22. package/examples/ionic/src/main.tsx +115 -1
  23. package/examples/react_native/README.md +2 -2
  24. package/examples/react_native/index.html +5 -4
  25. package/examples/react_native/package-lock.json +8996 -0
  26. package/examples/react_native/package.json +7 -7
  27. package/examples/react_native/scripts/setup.sh +3 -0
  28. package/examples/react_native/src/main.html +9 -30
  29. package/examples/react_native/src/main.tsx +115 -1
  30. package/ios/CVDIDV.swift +24 -45
  31. package/ios/JSONConstructor.swift +24 -2
  32. package/ios/Main.swift +28 -12
  33. package/ios/RNIDV.m +11 -0
  34. package/ios/RNIDV.swift +30 -55
  35. package/ios/Utils.swift +0 -4
  36. package/package.json +1 -1
  37. package/plugin.xml +6 -5
  38. package/test/json.tsx +49 -0
  39. package/test/package-lock.json +1 -1
  40. package/test/test.tsx +14 -2
  41. package/www/capacitor/config/api_key_connection_config.js +32 -0
  42. package/www/capacitor/config/credentials_connection_config.js +32 -0
  43. package/www/capacitor/config/prepare_workflow_config.js +20 -0
  44. package/www/capacitor/config/send_data_config.js +28 -0
  45. package/www/capacitor/config/start_session_config.js +24 -0
  46. package/www/capacitor/config/start_workflow_config.js +24 -0
  47. package/www/capacitor/config/token_connection_config.js +20 -0
  48. package/www/capacitor/index.js +113 -1
  49. package/www/capacitor/internal/bridge.js +19 -8
  50. package/www/capacitor/model/workflow.js +28 -0
  51. package/www/capacitor/model/workflow_result.js +21 -0
  52. package/www/capacitor/model/workflow_step.js +19 -0
  53. package/www/cordova.js +559 -16
  54. package/www/react-native/config/api_key_connection_config.js +32 -0
  55. package/www/react-native/config/credentials_connection_config.js +32 -0
  56. package/www/react-native/config/prepare_workflow_config.js +20 -0
  57. package/www/react-native/config/send_data_config.js +28 -0
  58. package/www/react-native/config/start_session_config.js +24 -0
  59. package/www/react-native/config/start_workflow_config.js +24 -0
  60. package/www/react-native/config/token_connection_config.js +20 -0
  61. package/www/react-native/index.js +113 -1
  62. package/www/react-native/internal/bridge.js +19 -8
  63. package/www/react-native/model/workflow.js +28 -0
  64. package/www/react-native/model/workflow_result.js +21 -0
  65. package/www/react-native/model/workflow_step.js +19 -0
  66. package/www/types/config/api_key_connection_config.d.ts +6 -0
  67. package/www/types/config/credentials_connection_config.d.ts +6 -0
  68. package/www/types/config/prepare_workflow_config.d.ts +3 -0
  69. package/www/types/config/send_data_config.d.ts +5 -0
  70. package/www/types/config/start_session_config.d.ts +4 -0
  71. package/www/types/config/start_workflow_config.d.ts +4 -0
  72. package/www/types/config/token_connection_config.d.ts +3 -0
  73. package/www/types/index.d.ts +49 -0
  74. package/www/types/model/workflow.d.ts +9 -0
  75. package/www/types/model/workflow_result.d.ts +8 -0
  76. package/www/types/model/workflow_step.d.ts +6 -0
  77. package/ios/FlutterIDVPlugin.swift +0 -72
package/www/cordova.js CHANGED
@@ -2,15 +2,297 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ "./src/internal/bridge.js":
5
+ /***/ "./src/config/api_key_connection_config.js"
6
+ /*!*************************************************!*\
7
+ !*** ./src/config/api_key_connection_config.js ***!
8
+ \*************************************************/
9
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10
+
11
+ __webpack_require__.r(__webpack_exports__);
12
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
+ /* harmony export */ ApiKeyConnectionConfig: () => (/* binding */ ApiKeyConnectionConfig)
14
+ /* harmony export */ });
15
+ class ApiKeyConnectionConfig {
16
+ baseUrl
17
+ apiKey
18
+ ttl
19
+ httpTimeoutMs
20
+
21
+ constructor(params) {
22
+ this.baseUrl = params?.baseUrl
23
+ this.apiKey = params?.apiKey
24
+ this.ttl = params?.ttl
25
+ this.httpTimeoutMs = params?.httpTimeoutMs
26
+ }
27
+
28
+ static fromJson(jsonObject) {
29
+ if (jsonObject == null) return null
30
+ const result = new ApiKeyConnectionConfig()
31
+ result.baseUrl = jsonObject["baseUrl"]
32
+ result.apiKey = jsonObject["apiKey"]
33
+ result.ttl = jsonObject["ttl"]
34
+ result.httpTimeoutMs = jsonObject["httpTimeoutMs"]
35
+ return result
36
+ }
37
+
38
+ toJson() {
39
+ return {
40
+ "baseUrl": this.baseUrl,
41
+ "apiKey": this.apiKey,
42
+ "ttl": this.ttl,
43
+ "httpTimeoutMs": this.httpTimeoutMs,
44
+ }
45
+ }
46
+ }
47
+
48
+
49
+ /***/ },
50
+
51
+ /***/ "./src/config/credentials_connection_config.js"
52
+ /*!*****************************************************!*\
53
+ !*** ./src/config/credentials_connection_config.js ***!
54
+ \*****************************************************/
55
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
56
+
57
+ __webpack_require__.r(__webpack_exports__);
58
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
59
+ /* harmony export */ CredentialsConnectionConfig: () => (/* binding */ CredentialsConnectionConfig)
60
+ /* harmony export */ });
61
+ class CredentialsConnectionConfig {
62
+ baseUrl
63
+ userName
64
+ password
65
+ httpTimeoutMs
66
+
67
+ constructor(params) {
68
+ this.baseUrl = params?.baseUrl
69
+ this.userName = params?.userName
70
+ this.password = params?.password
71
+ this.httpTimeoutMs = params?.httpTimeoutMs
72
+ }
73
+
74
+ static fromJson(jsonObject) {
75
+ if (jsonObject == null) return null
76
+ const result = new CredentialsConnectionConfig()
77
+ result.baseUrl = jsonObject["baseUrl"]
78
+ result.userName = jsonObject["userName"]
79
+ result.password = jsonObject["password"]
80
+ result.httpTimeoutMs = jsonObject["httpTimeoutMs"]
81
+ return result
82
+ }
83
+
84
+ toJson() {
85
+ return {
86
+ "baseUrl": this.baseUrl,
87
+ "userName": this.userName,
88
+ "password": this.password,
89
+ "httpTimeoutMs": this.httpTimeoutMs,
90
+ }
91
+ }
92
+ }
93
+
94
+
95
+ /***/ },
96
+
97
+ /***/ "./src/config/prepare_workflow_config.js"
98
+ /*!***********************************************!*\
99
+ !*** ./src/config/prepare_workflow_config.js ***!
100
+ \***********************************************/
101
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
102
+
103
+ __webpack_require__.r(__webpack_exports__);
104
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
105
+ /* harmony export */ PrepareWorkflowConfig: () => (/* binding */ PrepareWorkflowConfig)
106
+ /* harmony export */ });
107
+ class PrepareWorkflowConfig {
108
+ workflowId
109
+
110
+ constructor(params) {
111
+ this.workflowId = params?.workflowId
112
+ }
113
+
114
+ static fromJson(jsonObject) {
115
+ if (jsonObject == null) return null
116
+ const result = new PrepareWorkflowConfig()
117
+ result.workflowId = jsonObject["workflowId"]
118
+ return result
119
+ }
120
+
121
+ toJson() {
122
+ return {
123
+ "workflowId": this.workflowId,
124
+ }
125
+ }
126
+ }
127
+
128
+
129
+ /***/ },
130
+
131
+ /***/ "./src/config/send_data_config.js"
132
+ /*!****************************************!*\
133
+ !*** ./src/config/send_data_config.js ***!
134
+ \****************************************/
135
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
136
+
137
+ __webpack_require__.r(__webpack_exports__);
138
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
139
+ /* harmony export */ SendDataConfig: () => (/* binding */ SendDataConfig)
140
+ /* harmony export */ });
141
+ class SendDataConfig {
142
+ sessionId
143
+ step
144
+ data
145
+
146
+ constructor(params) {
147
+ this.sessionId = params?.sessionId
148
+ this.step = params?.step
149
+ this.data = params?.data
150
+ }
151
+
152
+ static fromJson(jsonObject) {
153
+ if (jsonObject == null) return null
154
+ const result = new SendDataConfig()
155
+ result.sessionId = jsonObject["sessionId"]
156
+ result.step = jsonObject["step"]
157
+ result.data = jsonObject["data"]
158
+ return result
159
+ }
160
+
161
+ toJson() {
162
+ return {
163
+ "sessionId": this.sessionId,
164
+ "step": this.step,
165
+ "data": this.data,
166
+ }
167
+ }
168
+ }
169
+
170
+
171
+ /***/ },
172
+
173
+ /***/ "./src/config/start_session_config.js"
174
+ /*!********************************************!*\
175
+ !*** ./src/config/start_session_config.js ***!
176
+ \********************************************/
177
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
178
+
179
+ __webpack_require__.r(__webpack_exports__);
180
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
181
+ /* harmony export */ StartSessionConfig: () => (/* binding */ StartSessionConfig)
182
+ /* harmony export */ });
183
+ class StartSessionConfig {
184
+ workflowId
185
+ metadata
186
+
187
+ constructor(params) {
188
+ this.workflowId = params?.workflowId
189
+ this.metadata = params?.metadata
190
+ }
191
+
192
+ static fromJson(jsonObject) {
193
+ if (jsonObject == null) return null
194
+ const result = new StartSessionConfig()
195
+ result.workflowId = jsonObject["workflowId"]
196
+ result.metadata = jsonObject["metadata"]
197
+ return result
198
+ }
199
+
200
+ toJson() {
201
+ return {
202
+ "workflowId": this.workflowId,
203
+ "metadata": this.metadata,
204
+ }
205
+ }
206
+ }
207
+
208
+
209
+ /***/ },
210
+
211
+ /***/ "./src/config/start_workflow_config.js"
212
+ /*!*********************************************!*\
213
+ !*** ./src/config/start_workflow_config.js ***!
214
+ \*********************************************/
215
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
216
+
217
+ __webpack_require__.r(__webpack_exports__);
218
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
219
+ /* harmony export */ StartWorkflowConfig: () => (/* binding */ StartWorkflowConfig)
220
+ /* harmony export */ });
221
+ class StartWorkflowConfig {
222
+ locale
223
+ metadata
224
+
225
+ constructor(params) {
226
+ this.locale = params?.locale
227
+ this.metadata = params?.metadata
228
+ }
229
+
230
+ static fromJson(jsonObject) {
231
+ if (jsonObject == null) return null
232
+ const result = new StartWorkflowConfig()
233
+ result.locale = jsonObject["locale"]
234
+ result.metadata = jsonObject["metadata"]
235
+ return result
236
+ }
237
+
238
+ toJson() {
239
+ return {
240
+ "locale": this.locale,
241
+ "metadata": this.metadata,
242
+ }
243
+ }
244
+ }
245
+
246
+
247
+ /***/ },
248
+
249
+ /***/ "./src/config/token_connection_config.js"
250
+ /*!***********************************************!*\
251
+ !*** ./src/config/token_connection_config.js ***!
252
+ \***********************************************/
253
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
254
+
255
+ __webpack_require__.r(__webpack_exports__);
256
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
257
+ /* harmony export */ TokenConnectionConfig: () => (/* binding */ TokenConnectionConfig)
258
+ /* harmony export */ });
259
+ class TokenConnectionConfig {
260
+ url
261
+
262
+ constructor(params) {
263
+ this.url = params?.url
264
+ }
265
+
266
+ static fromJson(jsonObject) {
267
+ if (jsonObject == null) return null
268
+ const result = new TokenConnectionConfig()
269
+ result.url = jsonObject["url"]
270
+ return result
271
+ }
272
+
273
+ toJson() {
274
+ return {
275
+ "url": this.url,
276
+ }
277
+ }
278
+ }
279
+
280
+
281
+ /***/ },
282
+
283
+ /***/ "./src/internal/bridge.js"
6
284
  /*!********************************!*\
7
285
  !*** ./src/internal/bridge.js ***!
8
286
  \********************************/
9
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
287
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10
288
 
11
289
  __webpack_require__.r(__webpack_exports__);
12
290
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
- /* harmony export */ exec: () => (/* binding */ exec)
291
+ /* harmony export */ exec: () => (/* binding */ exec),
292
+ /* harmony export */ setDidContinueRemoteSessionCompletion: () => (/* binding */ setDidContinueRemoteSessionCompletion),
293
+ /* harmony export */ setDidEndSessionCompletion: () => (/* binding */ setDidEndSessionCompletion),
294
+ /* harmony export */ setDidStartRestoreSessionCompletion: () => (/* binding */ setDidStartRestoreSessionCompletion),
295
+ /* harmony export */ setDidStartSessionCompletion: () => (/* binding */ setDidStartSessionCompletion)
14
296
  /* harmony export */ });
15
297
  /* harmony import */ var _cordova__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cordova */ "./src/internal/cordova.js");
16
298
 
@@ -22,25 +304,36 @@ async function exec(name, params) {
22
304
  return RNIDV.exec(name, params)
23
305
  }
24
306
 
25
- function _setEvent(id, completion, fromJson) {
307
+ function setEvent(id, completion, transform) {
26
308
  eventManager.removeAllListeners(id)
27
- if (completion == null) return
28
- if (fromJson == null) eventManager.addListener(id, completion)
29
- else eventManager.addListener(id, data => {
30
- data = fromJson(data)
31
- if (data !== null && typeof data[Symbol.iterator] === 'function') completion(...data)
32
- else completion(data)
33
- })
309
+ if (transform === undefined) transform = func => func
310
+ if (completion !== undefined) eventManager.addListener(id, transform(completion))
311
+ }
312
+
313
+ function setDidStartSessionCompletion(completion) {
314
+ setEvent('didStartSessionEvent', completion)
315
+ }
316
+
317
+ function setDidEndSessionCompletion(completion) {
318
+ setEvent('didEndSessionEvent', completion)
319
+ }
320
+
321
+ function setDidStartRestoreSessionCompletion(completion) {
322
+ setEvent('didStartRestoreSessionEvent', completion)
323
+ }
324
+
325
+ function setDidContinueRemoteSessionCompletion(completion) {
326
+ setEvent('didContinueRemoteSessionEvent', completion)
34
327
  }
35
328
 
36
329
 
37
- /***/ }),
330
+ /***/ },
38
331
 
39
- /***/ "./src/internal/cordova.js":
332
+ /***/ "./src/internal/cordova.js"
40
333
  /*!*********************************!*\
41
334
  !*** ./src/internal/cordova.js ***!
42
335
  \*********************************/
43
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
336
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
44
337
 
45
338
  __webpack_require__.r(__webpack_exports__);
46
339
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -65,7 +358,118 @@ class NativeEventEmitter {
65
358
  }
66
359
  }
67
360
 
68
- /***/ })
361
+ /***/ },
362
+
363
+ /***/ "./src/model/workflow.js"
364
+ /*!*******************************!*\
365
+ !*** ./src/model/workflow.js ***!
366
+ \*******************************/
367
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
368
+
369
+ __webpack_require__.r(__webpack_exports__);
370
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
371
+ /* harmony export */ Workflow: () => (/* binding */ Workflow)
372
+ /* harmony export */ });
373
+ class Workflow {
374
+ id
375
+ name
376
+ description
377
+ version
378
+ defaultLocale
379
+
380
+ static fromJson(jsonObject) {
381
+ if (jsonObject == null) return null
382
+ const result = new Workflow()
383
+ result.id = jsonObject["id"]
384
+ result.name = jsonObject["name"]
385
+ result.description = jsonObject["description"]
386
+ result.version = jsonObject["version"]
387
+ result.defaultLocale = jsonObject["defaultLocale"]
388
+ return result
389
+ }
390
+
391
+ toJson() {
392
+ return {
393
+ "id": this.id,
394
+ "name": this.name,
395
+ "description": this.description,
396
+ "version": this.version,
397
+ "defaultLocale": this.defaultLocale,
398
+ }
399
+ }
400
+ }
401
+
402
+
403
+ /***/ },
404
+
405
+ /***/ "./src/model/workflow_result.js"
406
+ /*!**************************************!*\
407
+ !*** ./src/model/workflow_result.js ***!
408
+ \**************************************/
409
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
410
+
411
+ __webpack_require__.r(__webpack_exports__);
412
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
413
+ /* harmony export */ WorkflowResult: () => (/* binding */ WorkflowResult)
414
+ /* harmony export */ });
415
+ /* harmony import */ var _workflow_step__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./workflow_step */ "./src/model/workflow_step.js");
416
+
417
+
418
+ class WorkflowResult {
419
+ sessionId
420
+ finalStep
421
+
422
+ static fromJson(jsonObject) {
423
+ if (jsonObject == null) return null
424
+ const result = new WorkflowResult()
425
+ result.sessionId = jsonObject["sessionId"]
426
+ result.finalStep = _workflow_step__WEBPACK_IMPORTED_MODULE_0__.WorkflowStep.fromJson(jsonObject["finalStep"])
427
+ return result
428
+ }
429
+
430
+ toJson() {
431
+ return {
432
+ "sessionId": this.sessionId,
433
+ "finalStep": this.finalStep?.toJson(),
434
+ }
435
+ }
436
+ }
437
+
438
+
439
+ /***/ },
440
+
441
+ /***/ "./src/model/workflow_step.js"
442
+ /*!************************************!*\
443
+ !*** ./src/model/workflow_step.js ***!
444
+ \************************************/
445
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
446
+
447
+ __webpack_require__.r(__webpack_exports__);
448
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
449
+ /* harmony export */ WorkflowStep: () => (/* binding */ WorkflowStep)
450
+ /* harmony export */ });
451
+ class WorkflowStep {
452
+ id
453
+ name
454
+
455
+ static fromJson(jsonObject) {
456
+ if (jsonObject == null) return null
457
+ const result = new WorkflowStep()
458
+ result.id = jsonObject["id"]
459
+ result.name = jsonObject["name"]
460
+ return result
461
+ }
462
+
463
+ toJson() {
464
+ return {
465
+ "id": this.id,
466
+ "name": this.name,
467
+ }
468
+ }
469
+ }
470
+
471
+
472
+ /***/ }
69
473
 
70
474
  /******/ });
71
475
  /************************************************************************/
@@ -79,6 +483,12 @@ class NativeEventEmitter {
79
483
  /******/ if (cachedModule !== undefined) {
80
484
  /******/ return cachedModule.exports;
81
485
  /******/ }
486
+ /******/ // Check if module exists (development only)
487
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
488
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
489
+ /******/ e.code = 'MODULE_NOT_FOUND';
490
+ /******/ throw e;
491
+ /******/ }
82
492
  /******/ // Create a new module (and put it into the cache)
83
493
  /******/ var module = __webpack_module_cache__[moduleId] = {
84
494
  /******/ // no module.id needed
@@ -131,14 +541,147 @@ var __webpack_exports__ = {};
131
541
  \**********************/
132
542
  __webpack_require__.r(__webpack_exports__);
133
543
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
134
- /* harmony export */ IDV: () => (/* binding */ IDV)
544
+ /* harmony export */ ApiKeyConnectionConfig: () => (/* reexport safe */ _config_api_key_connection_config__WEBPACK_IMPORTED_MODULE_3__.ApiKeyConnectionConfig),
545
+ /* harmony export */ CredentialsConnectionConfig: () => (/* reexport safe */ _config_credentials_connection_config__WEBPACK_IMPORTED_MODULE_2__.CredentialsConnectionConfig),
546
+ /* harmony export */ IDV: () => (/* binding */ IDV),
547
+ /* harmony export */ PrepareWorkflowConfig: () => (/* reexport safe */ _config_prepare_workflow_config__WEBPACK_IMPORTED_MODULE_4__.PrepareWorkflowConfig),
548
+ /* harmony export */ SendDataConfig: () => (/* reexport safe */ _config_send_data_config__WEBPACK_IMPORTED_MODULE_7__.SendDataConfig),
549
+ /* harmony export */ SessionRestoreMode: () => (/* binding */ SessionRestoreMode),
550
+ /* harmony export */ StartSessionConfig: () => (/* reexport safe */ _config_start_session_config__WEBPACK_IMPORTED_MODULE_6__.StartSessionConfig),
551
+ /* harmony export */ StartWorkflowConfig: () => (/* reexport safe */ _config_start_workflow_config__WEBPACK_IMPORTED_MODULE_5__.StartWorkflowConfig),
552
+ /* harmony export */ TokenConnectionConfig: () => (/* reexport safe */ _config_token_connection_config__WEBPACK_IMPORTED_MODULE_1__.TokenConnectionConfig),
553
+ /* harmony export */ Workflow: () => (/* reexport safe */ _model_workflow__WEBPACK_IMPORTED_MODULE_8__.Workflow),
554
+ /* harmony export */ WorkflowResult: () => (/* reexport safe */ _model_workflow_result__WEBPACK_IMPORTED_MODULE_9__.WorkflowResult),
555
+ /* harmony export */ WorkflowStep: () => (/* reexport safe */ _model_workflow_step__WEBPACK_IMPORTED_MODULE_10__.WorkflowStep)
135
556
  /* harmony export */ });
136
557
  /* harmony import */ var _internal_bridge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./internal/bridge */ "./src/internal/bridge.js");
558
+ /* harmony import */ var _config_token_connection_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config/token_connection_config */ "./src/config/token_connection_config.js");
559
+ /* harmony import */ var _config_credentials_connection_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config/credentials_connection_config */ "./src/config/credentials_connection_config.js");
560
+ /* harmony import */ var _config_api_key_connection_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config/api_key_connection_config */ "./src/config/api_key_connection_config.js");
561
+ /* harmony import */ var _config_prepare_workflow_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config/prepare_workflow_config */ "./src/config/prepare_workflow_config.js");
562
+ /* harmony import */ var _config_start_workflow_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config/start_workflow_config */ "./src/config/start_workflow_config.js");
563
+ /* harmony import */ var _config_start_session_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./config/start_session_config */ "./src/config/start_session_config.js");
564
+ /* harmony import */ var _config_send_data_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./config/send_data_config */ "./src/config/send_data_config.js");
565
+ /* harmony import */ var _model_workflow__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./model/workflow */ "./src/model/workflow.js");
566
+ /* harmony import */ var _model_workflow_result__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./model/workflow_result */ "./src/model/workflow_result.js");
567
+ /* harmony import */ var _model_workflow_step__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./model/workflow_step */ "./src/model/workflow_step.js");
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
137
581
 
138
582
 
139
583
  class IDV {
140
584
  static get instance() { return IDV._instance }
141
585
  static _instance = new IDV()
586
+
587
+ setListener(options) {
588
+ const value = options ?? {}
589
+ ;(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.setDidStartSessionCompletion)(value.didStartSession)
590
+ ;(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.setDidEndSessionCompletion)(value.didEndSession)
591
+ ;(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.setDidStartRestoreSessionCompletion)(value.didStartRestoreSession)
592
+ ;(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.setDidContinueRemoteSessionCompletion)(value.didContinueRemoteSession)
593
+ }
594
+
595
+ set sessionRestoreMode(val) {
596
+ (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('setSessionRestoreMode', [val])
597
+ }
598
+
599
+ async getCurrentSessionId() {
600
+ return await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('getCurrentSessionId', [])
601
+ }
602
+
603
+ async initialize() {
604
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('initialize', [])
605
+ return completionFromResponse(response)
606
+ }
607
+
608
+ async deinitialize() {
609
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('deinitialize', [])
610
+ return completionFromResponse(response)
611
+ }
612
+
613
+ async configureWithToken(config) {
614
+ config = ensureInstance(config, _config_token_connection_config__WEBPACK_IMPORTED_MODULE_1__.TokenConnectionConfig)
615
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('configureWithToken', [config?.toJson()])
616
+ return completionFromResponse(response, success => success?.map(item => String(item)))
617
+ }
618
+
619
+ async configureWithCredentials(config) {
620
+ config = ensureInstance(config, _config_credentials_connection_config__WEBPACK_IMPORTED_MODULE_2__.CredentialsConnectionConfig)
621
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('configureWithCredentials', [config?.toJson()])
622
+ return completionFromResponse(response)
623
+ }
624
+
625
+ async configureWithApiKey(config) {
626
+ config = ensureInstance(config, _config_api_key_connection_config__WEBPACK_IMPORTED_MODULE_3__.ApiKeyConnectionConfig)
627
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('configureWithApiKey', [config?.toJson()])
628
+ return completionFromResponse(response)
629
+ }
630
+
631
+ async prepareWorkflow(config) {
632
+ config = ensureInstance(config, _config_prepare_workflow_config__WEBPACK_IMPORTED_MODULE_4__.PrepareWorkflowConfig)
633
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('prepareWorkflow', [config?.toJson()])
634
+ return completionFromResponse(response, json => _model_workflow__WEBPACK_IMPORTED_MODULE_8__.Workflow.fromJson(json))
635
+ }
636
+
637
+ async startWorkflow(config) {
638
+ config = ensureInstance(config, _config_start_workflow_config__WEBPACK_IMPORTED_MODULE_5__.StartWorkflowConfig)
639
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('startWorkflow', [config?.toJson()])
640
+ return completionFromResponse(response, json => _model_workflow_result__WEBPACK_IMPORTED_MODULE_9__.WorkflowResult.fromJson(json))
641
+ }
642
+
643
+ async getWorkflows() {
644
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('getWorkflows', [])
645
+ return completionFromResponse(response, json => {
646
+ const result = []
647
+ if (json != null) for (const item of json) {
648
+ const workflow = _model_workflow__WEBPACK_IMPORTED_MODULE_8__.Workflow.fromJson(item)
649
+ if (workflow != null) result.push(workflow)
650
+ }
651
+ return result
652
+ })
653
+ }
654
+
655
+ async startSession(config) {
656
+ config = ensureInstance(config, _config_start_session_config__WEBPACK_IMPORTED_MODULE_6__.StartSessionConfig)
657
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('startSession', [config.toJson()])
658
+ return completionFromResponse(response)
659
+ }
660
+
661
+ async sendData(config) {
662
+ config = ensureInstance(config, _config_send_data_config__WEBPACK_IMPORTED_MODULE_7__.SendDataConfig)
663
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('sendData', [config.toJson()])
664
+ return completionFromResponse(response)
665
+ }
666
+ }
667
+
668
+ const SessionRestoreMode = {
669
+ ENABLED: 0,
670
+ DISABLED: 1,
671
+ }
672
+
673
+ function completionFromResponse(response, transform) {
674
+ const jsonObject = JSON.parse(response)
675
+ let success = jsonObject['success']
676
+ const error = jsonObject['error']
677
+ if (transform != null && success != null) success = transform(success)
678
+ return [success, error]
679
+ }
680
+
681
+ function ensureInstance(value, ctor) {
682
+ if (value == null) return null
683
+ if (value instanceof ctor) return value
684
+ return new ctor(value)
142
685
  }
143
686
 
144
687
  })();
@@ -0,0 +1,32 @@
1
+ export class ApiKeyConnectionConfig {
2
+ baseUrl
3
+ apiKey
4
+ ttl
5
+ httpTimeoutMs
6
+
7
+ constructor(params) {
8
+ this.baseUrl = params?.baseUrl
9
+ this.apiKey = params?.apiKey
10
+ this.ttl = params?.ttl
11
+ this.httpTimeoutMs = params?.httpTimeoutMs
12
+ }
13
+
14
+ static fromJson(jsonObject) {
15
+ if (jsonObject == null) return null
16
+ const result = new ApiKeyConnectionConfig()
17
+ result.baseUrl = jsonObject["baseUrl"]
18
+ result.apiKey = jsonObject["apiKey"]
19
+ result.ttl = jsonObject["ttl"]
20
+ result.httpTimeoutMs = jsonObject["httpTimeoutMs"]
21
+ return result
22
+ }
23
+
24
+ toJson() {
25
+ return {
26
+ "baseUrl": this.baseUrl,
27
+ "apiKey": this.apiKey,
28
+ "ttl": this.ttl,
29
+ "httpTimeoutMs": this.httpTimeoutMs,
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,32 @@
1
+ export class CredentialsConnectionConfig {
2
+ baseUrl
3
+ userName
4
+ password
5
+ httpTimeoutMs
6
+
7
+ constructor(params) {
8
+ this.baseUrl = params?.baseUrl
9
+ this.userName = params?.userName
10
+ this.password = params?.password
11
+ this.httpTimeoutMs = params?.httpTimeoutMs
12
+ }
13
+
14
+ static fromJson(jsonObject) {
15
+ if (jsonObject == null) return null
16
+ const result = new CredentialsConnectionConfig()
17
+ result.baseUrl = jsonObject["baseUrl"]
18
+ result.userName = jsonObject["userName"]
19
+ result.password = jsonObject["password"]
20
+ result.httpTimeoutMs = jsonObject["httpTimeoutMs"]
21
+ return result
22
+ }
23
+
24
+ toJson() {
25
+ return {
26
+ "baseUrl": this.baseUrl,
27
+ "userName": this.userName,
28
+ "password": this.password,
29
+ "httpTimeoutMs": this.httpTimeoutMs,
30
+ }
31
+ }
32
+ }