@regulaforensics/idv 3.2.26-beta → 3.2.59-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 (59) hide show
  1. package/README.md +2 -8
  2. package/RNIDV.podspec +2 -2
  3. package/android/build.gradle +1 -10
  4. package/android/cordova.gradle +1 -1
  5. package/examples/capacitor/android/build.gradle +1 -1
  6. package/examples/capacitor/package-lock.json +3350 -0
  7. package/examples/capacitor/package.json +4 -4
  8. package/examples/capacitor/src/main.html +8 -29
  9. package/examples/capacitor/src/main.tsx +115 -1
  10. package/examples/ionic/README.md +2 -2
  11. package/examples/ionic/config.xml +1 -0
  12. package/examples/ionic/package-lock.json +14261 -0
  13. package/examples/ionic/package.json +7 -7
  14. package/examples/ionic/src/main.html +8 -29
  15. package/examples/ionic/src/main.tsx +115 -1
  16. package/examples/react_native/README.md +2 -2
  17. package/examples/react_native/package-lock.json +8996 -0
  18. package/examples/react_native/package.json +4 -4
  19. package/examples/react_native/scripts/setup.sh +3 -0
  20. package/examples/react_native/src/main.html +8 -29
  21. package/examples/react_native/src/main.tsx +115 -1
  22. package/ios/CVDIDV.swift +6 -50
  23. package/ios/RNIDV.swift +4 -52
  24. package/package.json +1 -1
  25. package/plugin.xml +5 -4
  26. package/test/json.tsx +40 -0
  27. package/test/package-lock.json +1 -1
  28. package/test/test.tsx +12 -2
  29. package/www/capacitor/config/api_key_connection_config.js +32 -0
  30. package/www/capacitor/config/credentials_connection_config.js +32 -0
  31. package/www/capacitor/config/prepare_workflow_config.js +20 -0
  32. package/www/capacitor/config/start_workflow_config.js +24 -0
  33. package/www/capacitor/config/token_connection_config.js +20 -0
  34. package/www/capacitor/index.js +105 -1
  35. package/www/capacitor/internal/bridge.js +19 -8
  36. package/www/capacitor/model/workflow.js +28 -0
  37. package/www/capacitor/model/workflow_result.js +21 -0
  38. package/www/capacitor/model/workflow_step.js +19 -0
  39. package/www/cordova.js +455 -10
  40. package/www/react-native/config/api_key_connection_config.js +32 -0
  41. package/www/react-native/config/credentials_connection_config.js +32 -0
  42. package/www/react-native/config/prepare_workflow_config.js +20 -0
  43. package/www/react-native/config/start_workflow_config.js +24 -0
  44. package/www/react-native/config/token_connection_config.js +20 -0
  45. package/www/react-native/index.js +105 -1
  46. package/www/react-native/internal/bridge.js +19 -8
  47. package/www/react-native/model/workflow.js +28 -0
  48. package/www/react-native/model/workflow_result.js +21 -0
  49. package/www/react-native/model/workflow_step.js +19 -0
  50. package/www/types/config/api_key_connection_config.d.ts +6 -0
  51. package/www/types/config/credentials_connection_config.d.ts +6 -0
  52. package/www/types/config/prepare_workflow_config.d.ts +3 -0
  53. package/www/types/config/start_workflow_config.d.ts +4 -0
  54. package/www/types/config/token_connection_config.d.ts +3 -0
  55. package/www/types/index.d.ts +50 -0
  56. package/www/types/model/workflow.d.ts +9 -0
  57. package/www/types/model/workflow_result.d.ts +8 -0
  58. package/www/types/model/workflow_step.d.ts +6 -0
  59. package/ios/FlutterIDVPlugin.swift +0 -72
package/www/cordova.js CHANGED
@@ -2,6 +2,204 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
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/start_workflow_config.js":
132
+ /*!*********************************************!*\
133
+ !*** ./src/config/start_workflow_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 */ StartWorkflowConfig: () => (/* binding */ StartWorkflowConfig)
140
+ /* harmony export */ });
141
+ class StartWorkflowConfig {
142
+ locale
143
+ metadata
144
+
145
+ constructor(params) {
146
+ this.locale = params?.locale
147
+ this.metadata = params?.metadata
148
+ }
149
+
150
+ static fromJson(jsonObject) {
151
+ if (jsonObject == null) return null
152
+ const result = new StartWorkflowConfig()
153
+ result.locale = jsonObject["locale"]
154
+ result.metadata = jsonObject["metadata"]
155
+ return result
156
+ }
157
+
158
+ toJson() {
159
+ return {
160
+ "locale": this.locale,
161
+ "metadata": this.metadata,
162
+ }
163
+ }
164
+ }
165
+
166
+
167
+ /***/ }),
168
+
169
+ /***/ "./src/config/token_connection_config.js":
170
+ /*!***********************************************!*\
171
+ !*** ./src/config/token_connection_config.js ***!
172
+ \***********************************************/
173
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
174
+
175
+ __webpack_require__.r(__webpack_exports__);
176
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
177
+ /* harmony export */ TokenConnectionConfig: () => (/* binding */ TokenConnectionConfig)
178
+ /* harmony export */ });
179
+ class TokenConnectionConfig {
180
+ url
181
+
182
+ constructor(params) {
183
+ this.url = params?.url
184
+ }
185
+
186
+ static fromJson(jsonObject) {
187
+ if (jsonObject == null) return null
188
+ const result = new TokenConnectionConfig()
189
+ result.url = jsonObject["url"]
190
+ return result
191
+ }
192
+
193
+ toJson() {
194
+ return {
195
+ "url": this.url,
196
+ }
197
+ }
198
+ }
199
+
200
+
201
+ /***/ }),
202
+
5
203
  /***/ "./src/internal/bridge.js":
6
204
  /*!********************************!*\
7
205
  !*** ./src/internal/bridge.js ***!
@@ -10,7 +208,11 @@
10
208
 
11
209
  __webpack_require__.r(__webpack_exports__);
12
210
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
- /* harmony export */ exec: () => (/* binding */ exec)
211
+ /* harmony export */ exec: () => (/* binding */ exec),
212
+ /* harmony export */ setDidContinueRemoteSessionCompletion: () => (/* binding */ setDidContinueRemoteSessionCompletion),
213
+ /* harmony export */ setDidEndSessionCompletion: () => (/* binding */ setDidEndSessionCompletion),
214
+ /* harmony export */ setDidStartRestoreSessionCompletion: () => (/* binding */ setDidStartRestoreSessionCompletion),
215
+ /* harmony export */ setDidStartSessionCompletion: () => (/* binding */ setDidStartSessionCompletion)
14
216
  /* harmony export */ });
15
217
  /* harmony import */ var _cordova__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cordova */ "./src/internal/cordova.js");
16
218
 
@@ -22,15 +224,26 @@ async function exec(name, params) {
22
224
  return RNIDV.exec(name, params)
23
225
  }
24
226
 
25
- function _setEvent(id, completion, fromJson) {
227
+ function setEvent(id, completion, transform) {
26
228
  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
- })
229
+ if (transform === undefined) transform = func => func
230
+ if (completion !== undefined) eventManager.addListener(id, transform(completion))
231
+ }
232
+
233
+ function setDidStartSessionCompletion(completion) {
234
+ setEvent('didStartSessionEvent', completion)
235
+ }
236
+
237
+ function setDidEndSessionCompletion(completion) {
238
+ setEvent('didEndSessionEvent', completion)
239
+ }
240
+
241
+ function setDidStartRestoreSessionCompletion(completion) {
242
+ setEvent('didStartRestoreSessionEvent', completion)
243
+ }
244
+
245
+ function setDidContinueRemoteSessionCompletion(completion) {
246
+ setEvent('didContinueRemoteSessionEvent', completion)
34
247
  }
35
248
 
36
249
 
@@ -65,6 +278,117 @@ class NativeEventEmitter {
65
278
  }
66
279
  }
67
280
 
281
+ /***/ }),
282
+
283
+ /***/ "./src/model/workflow.js":
284
+ /*!*******************************!*\
285
+ !*** ./src/model/workflow.js ***!
286
+ \*******************************/
287
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
288
+
289
+ __webpack_require__.r(__webpack_exports__);
290
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
291
+ /* harmony export */ Workflow: () => (/* binding */ Workflow)
292
+ /* harmony export */ });
293
+ class Workflow {
294
+ id
295
+ name
296
+ description
297
+ version
298
+ defaultLocale
299
+
300
+ static fromJson(jsonObject) {
301
+ if (jsonObject == null) return null
302
+ const result = new Workflow()
303
+ result.id = jsonObject["id"]
304
+ result.name = jsonObject["name"]
305
+ result.description = jsonObject["description"]
306
+ result.version = jsonObject["version"]
307
+ result.defaultLocale = jsonObject["defaultLocale"]
308
+ return result
309
+ }
310
+
311
+ toJson() {
312
+ return {
313
+ "id": this.id,
314
+ "name": this.name,
315
+ "description": this.description,
316
+ "version": this.version,
317
+ "defaultLocale": this.defaultLocale,
318
+ }
319
+ }
320
+ }
321
+
322
+
323
+ /***/ }),
324
+
325
+ /***/ "./src/model/workflow_result.js":
326
+ /*!**************************************!*\
327
+ !*** ./src/model/workflow_result.js ***!
328
+ \**************************************/
329
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
330
+
331
+ __webpack_require__.r(__webpack_exports__);
332
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
333
+ /* harmony export */ WorkflowResult: () => (/* binding */ WorkflowResult)
334
+ /* harmony export */ });
335
+ /* harmony import */ var _workflow_step__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./workflow_step */ "./src/model/workflow_step.js");
336
+
337
+
338
+ class WorkflowResult {
339
+ sessionId
340
+ finalStep
341
+
342
+ static fromJson(jsonObject) {
343
+ if (jsonObject == null) return null
344
+ const result = new WorkflowResult()
345
+ result.sessionId = jsonObject["sessionId"]
346
+ result.finalStep = _workflow_step__WEBPACK_IMPORTED_MODULE_0__.WorkflowStep.fromJson(jsonObject["finalStep"])
347
+ return result
348
+ }
349
+
350
+ toJson() {
351
+ return {
352
+ "sessionId": this.sessionId,
353
+ "finalStep": this.finalStep?.toJson(),
354
+ }
355
+ }
356
+ }
357
+
358
+
359
+ /***/ }),
360
+
361
+ /***/ "./src/model/workflow_step.js":
362
+ /*!************************************!*\
363
+ !*** ./src/model/workflow_step.js ***!
364
+ \************************************/
365
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
366
+
367
+ __webpack_require__.r(__webpack_exports__);
368
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
369
+ /* harmony export */ WorkflowStep: () => (/* binding */ WorkflowStep)
370
+ /* harmony export */ });
371
+ class WorkflowStep {
372
+ id
373
+ name
374
+
375
+ static fromJson(jsonObject) {
376
+ if (jsonObject == null) return null
377
+ const result = new WorkflowStep()
378
+ result.id = jsonObject["id"]
379
+ result.name = jsonObject["name"]
380
+ return result
381
+ }
382
+
383
+ toJson() {
384
+ return {
385
+ "id": this.id,
386
+ "name": this.name,
387
+ }
388
+ }
389
+ }
390
+
391
+
68
392
  /***/ })
69
393
 
70
394
  /******/ });
@@ -131,14 +455,135 @@ var __webpack_exports__ = {};
131
455
  \**********************/
132
456
  __webpack_require__.r(__webpack_exports__);
133
457
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
134
- /* harmony export */ IDV: () => (/* binding */ IDV)
458
+ /* harmony export */ ApiKeyConnectionConfig: () => (/* reexport safe */ _config_api_key_connection_config__WEBPACK_IMPORTED_MODULE_3__.ApiKeyConnectionConfig),
459
+ /* harmony export */ CredentialsConnectionConfig: () => (/* reexport safe */ _config_credentials_connection_config__WEBPACK_IMPORTED_MODULE_2__.CredentialsConnectionConfig),
460
+ /* harmony export */ IDV: () => (/* binding */ IDV),
461
+ /* harmony export */ PrepareWorkflowConfig: () => (/* reexport safe */ _config_prepare_workflow_config__WEBPACK_IMPORTED_MODULE_4__.PrepareWorkflowConfig),
462
+ /* harmony export */ SessionRestoreMode: () => (/* binding */ SessionRestoreMode),
463
+ /* harmony export */ StartWorkflowConfig: () => (/* reexport safe */ _config_start_workflow_config__WEBPACK_IMPORTED_MODULE_5__.StartWorkflowConfig),
464
+ /* harmony export */ TokenConnectionConfig: () => (/* reexport safe */ _config_token_connection_config__WEBPACK_IMPORTED_MODULE_1__.TokenConnectionConfig),
465
+ /* harmony export */ Workflow: () => (/* reexport safe */ _model_workflow__WEBPACK_IMPORTED_MODULE_6__.Workflow),
466
+ /* harmony export */ WorkflowResult: () => (/* reexport safe */ _model_workflow_result__WEBPACK_IMPORTED_MODULE_7__.WorkflowResult),
467
+ /* harmony export */ WorkflowStep: () => (/* reexport safe */ _model_workflow_step__WEBPACK_IMPORTED_MODULE_8__.WorkflowStep)
135
468
  /* harmony export */ });
136
469
  /* harmony import */ var _internal_bridge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./internal/bridge */ "./src/internal/bridge.js");
470
+ /* harmony import */ var _config_token_connection_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config/token_connection_config */ "./src/config/token_connection_config.js");
471
+ /* harmony import */ var _config_credentials_connection_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config/credentials_connection_config */ "./src/config/credentials_connection_config.js");
472
+ /* 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");
473
+ /* harmony import */ var _config_prepare_workflow_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config/prepare_workflow_config */ "./src/config/prepare_workflow_config.js");
474
+ /* harmony import */ var _config_start_workflow_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config/start_workflow_config */ "./src/config/start_workflow_config.js");
475
+ /* harmony import */ var _model_workflow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model/workflow */ "./src/model/workflow.js");
476
+ /* harmony import */ var _model_workflow_result__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./model/workflow_result */ "./src/model/workflow_result.js");
477
+ /* harmony import */ var _model_workflow_step__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./model/workflow_step */ "./src/model/workflow_step.js");
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
137
495
 
138
496
 
139
497
  class IDV {
140
498
  static get instance() { return IDV._instance }
141
499
  static _instance = new IDV()
500
+
501
+ setListener(options) {
502
+ const value = options ?? {}
503
+ ;(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.setDidStartSessionCompletion)(value.didStartSession)
504
+ ;(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.setDidEndSessionCompletion)(value.didEndSession)
505
+ ;(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.setDidStartRestoreSessionCompletion)(value.didStartRestoreSession)
506
+ ;(0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.setDidContinueRemoteSessionCompletion)(value.didContinueRemoteSession)
507
+ }
508
+
509
+ set sessionRestoreMode(val) {
510
+ (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('setSessionRestoreMode', [val])
511
+ }
512
+
513
+ async getCurrentSessionId() {
514
+ return await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('getCurrentSessionId', [])
515
+ }
516
+
517
+ async initialize() {
518
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('initialize', [])
519
+ return completionFromResponse(response)
520
+ }
521
+
522
+ async deinitialize() {
523
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('deinitialize', [])
524
+ return completionFromResponse(response)
525
+ }
526
+
527
+ async configureWithToken(config) {
528
+ config = ensureInstance(config, _config_token_connection_config__WEBPACK_IMPORTED_MODULE_1__.TokenConnectionConfig)
529
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('configureWithToken', [config?.toJson()])
530
+ return completionFromResponse(response, success => success?.map(item => String(item)))
531
+ }
532
+
533
+ async configureWithCredentials(config) {
534
+ config = ensureInstance(config, _config_credentials_connection_config__WEBPACK_IMPORTED_MODULE_2__.CredentialsConnectionConfig)
535
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('configureWithCredentials', [config?.toJson()])
536
+ return completionFromResponse(response)
537
+ }
538
+
539
+ async configureWithApiKey(config) {
540
+ config = ensureInstance(config, _config_api_key_connection_config__WEBPACK_IMPORTED_MODULE_3__.ApiKeyConnectionConfig)
541
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('configureWithApiKey', [config?.toJson()])
542
+ return completionFromResponse(response)
543
+ }
544
+
545
+ async prepareWorkflow(config) {
546
+ config = ensureInstance(config, _config_prepare_workflow_config__WEBPACK_IMPORTED_MODULE_4__.PrepareWorkflowConfig)
547
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('prepareWorkflow', [config?.toJson()])
548
+ return completionFromResponse(response, json => _model_workflow__WEBPACK_IMPORTED_MODULE_6__.Workflow.fromJson(json))
549
+ }
550
+
551
+ async startWorkflow(config) {
552
+ config = ensureInstance(config, _config_start_workflow_config__WEBPACK_IMPORTED_MODULE_5__.StartWorkflowConfig)
553
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('startWorkflow', [config?.toJson()])
554
+ return completionFromResponse(response, json => _model_workflow_result__WEBPACK_IMPORTED_MODULE_7__.WorkflowResult.fromJson(json))
555
+ }
556
+
557
+ async getWorkflows() {
558
+ const response = await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)('getWorkflows', [])
559
+ return completionFromResponse(response, json => {
560
+ const result = []
561
+ if (json != null) for (const item of json) {
562
+ const workflow = _model_workflow__WEBPACK_IMPORTED_MODULE_6__.Workflow.fromJson(item)
563
+ if (workflow != null) result.push(workflow)
564
+ }
565
+ return result
566
+ })
567
+ }
568
+ }
569
+
570
+ const SessionRestoreMode = {
571
+ ENABLED: 0,
572
+ DISABLED: 1,
573
+ }
574
+
575
+ function completionFromResponse(response, transform) {
576
+ const jsonObject = JSON.parse(response)
577
+ let success = jsonObject['success']
578
+ const error = jsonObject['error']
579
+ if (transform != null && success != null) success = transform(success)
580
+ return [success, error]
581
+ }
582
+
583
+ function ensureInstance(value, ctor) {
584
+ if (value == null) return null
585
+ if (value instanceof ctor) return value
586
+ return new ctor(value)
142
587
  }
143
588
 
144
589
  })();
@@ -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
+ }
@@ -0,0 +1,20 @@
1
+ export class PrepareWorkflowConfig {
2
+ workflowId
3
+
4
+ constructor(params) {
5
+ this.workflowId = params?.workflowId
6
+ }
7
+
8
+ static fromJson(jsonObject) {
9
+ if (jsonObject == null) return null
10
+ const result = new PrepareWorkflowConfig()
11
+ result.workflowId = jsonObject["workflowId"]
12
+ return result
13
+ }
14
+
15
+ toJson() {
16
+ return {
17
+ "workflowId": this.workflowId,
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,24 @@
1
+ export class StartWorkflowConfig {
2
+ locale
3
+ metadata
4
+
5
+ constructor(params) {
6
+ this.locale = params?.locale
7
+ this.metadata = params?.metadata
8
+ }
9
+
10
+ static fromJson(jsonObject) {
11
+ if (jsonObject == null) return null
12
+ const result = new StartWorkflowConfig()
13
+ result.locale = jsonObject["locale"]
14
+ result.metadata = jsonObject["metadata"]
15
+ return result
16
+ }
17
+
18
+ toJson() {
19
+ return {
20
+ "locale": this.locale,
21
+ "metadata": this.metadata,
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,20 @@
1
+ export class TokenConnectionConfig {
2
+ url
3
+
4
+ constructor(params) {
5
+ this.url = params?.url
6
+ }
7
+
8
+ static fromJson(jsonObject) {
9
+ if (jsonObject == null) return null
10
+ const result = new TokenConnectionConfig()
11
+ result.url = jsonObject["url"]
12
+ return result
13
+ }
14
+
15
+ toJson() {
16
+ return {
17
+ "url": this.url,
18
+ }
19
+ }
20
+ }