@forgerock/davinci-client 0.0.0-beta-20251124184351 → 0.0.0-beta-20251222204813

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 (85) hide show
  1. package/dist/src/index.d.ts +4 -0
  2. package/dist/src/index.d.ts.map +1 -0
  3. package/dist/src/index.js +10 -0
  4. package/dist/src/index.js.map +1 -0
  5. package/dist/src/lib/client.store.d.ts +352 -0
  6. package/dist/src/lib/client.store.d.ts.map +1 -0
  7. package/dist/src/lib/client.store.js +308 -0
  8. package/dist/src/lib/client.store.js.map +1 -0
  9. package/dist/src/lib/client.store.utils.d.ts +74 -0
  10. package/dist/src/lib/client.store.utils.d.ts.map +1 -0
  11. package/dist/src/lib/client.store.utils.js +48 -0
  12. package/dist/src/lib/client.store.utils.js.map +1 -0
  13. package/dist/src/lib/client.types.d.ts +71 -0
  14. package/dist/src/lib/client.types.d.ts.map +1 -0
  15. package/dist/src/lib/client.types.js +2 -0
  16. package/dist/src/lib/client.types.js.map +1 -0
  17. package/dist/src/lib/collector.types.d.ts +448 -0
  18. package/dist/src/lib/collector.types.d.ts.map +1 -0
  19. package/dist/src/lib/collector.types.js +8 -0
  20. package/dist/src/lib/collector.types.js.map +1 -0
  21. package/dist/src/lib/collector.utils.d.ts +154 -0
  22. package/dist/src/lib/collector.utils.d.ts.map +1 -0
  23. package/dist/src/lib/collector.utils.js +651 -0
  24. package/dist/src/lib/collector.utils.js.map +1 -0
  25. package/dist/src/lib/config.slice.d.ts +42 -0
  26. package/dist/src/lib/config.slice.d.ts.map +1 -0
  27. package/dist/src/lib/config.slice.js +59 -0
  28. package/dist/src/lib/config.slice.js.map +1 -0
  29. package/dist/src/lib/config.types.d.ts +12 -0
  30. package/dist/src/lib/config.types.d.ts.map +1 -0
  31. package/dist/src/lib/config.types.js +2 -0
  32. package/dist/src/lib/config.types.js.map +1 -0
  33. package/dist/src/lib/davinci.api.d.ts +31 -0
  34. package/dist/src/lib/davinci.api.d.ts.map +1 -0
  35. package/dist/src/lib/davinci.api.js +347 -0
  36. package/dist/src/lib/davinci.api.js.map +1 -0
  37. package/dist/src/lib/davinci.types.d.ts +328 -0
  38. package/dist/src/lib/davinci.types.d.ts.map +1 -0
  39. package/dist/src/lib/davinci.types.js +11 -0
  40. package/dist/src/lib/davinci.types.js.map +1 -0
  41. package/dist/src/lib/davinci.utils.d.ts +22 -0
  42. package/dist/src/lib/davinci.utils.d.ts.map +1 -0
  43. package/dist/src/lib/davinci.utils.js +170 -0
  44. package/dist/src/lib/davinci.utils.js.map +1 -0
  45. package/dist/src/lib/fido/fido.d.ts +27 -0
  46. package/dist/src/lib/fido/fido.d.ts.map +1 -0
  47. package/dist/src/lib/fido/fido.js +108 -0
  48. package/dist/src/lib/fido/fido.js.map +1 -0
  49. package/dist/src/lib/fido/fido.utils.d.ts +31 -0
  50. package/dist/src/lib/fido/fido.utils.d.ts.map +1 -0
  51. package/dist/src/lib/fido/fido.utils.js +115 -0
  52. package/dist/src/lib/fido/fido.utils.js.map +1 -0
  53. package/dist/src/lib/index.d.ts +3 -0
  54. package/dist/src/lib/index.d.ts.map +1 -0
  55. package/dist/src/lib/index.js +9 -0
  56. package/dist/src/lib/index.js.map +1 -0
  57. package/dist/src/lib/node.reducer.d.ts +27 -0
  58. package/dist/src/lib/node.reducer.d.ts.map +1 -0
  59. package/dist/src/lib/node.reducer.js +230 -0
  60. package/dist/src/lib/node.reducer.js.map +1 -0
  61. package/dist/src/lib/node.slice.d.ts +181 -0
  62. package/dist/src/lib/node.slice.d.ts.map +1 -0
  63. package/dist/src/lib/node.slice.js +261 -0
  64. package/dist/src/lib/node.slice.js.map +1 -0
  65. package/dist/src/lib/node.types.d.ts +119 -0
  66. package/dist/src/lib/node.types.d.ts.map +1 -0
  67. package/dist/src/lib/node.types.js +2 -0
  68. package/dist/src/lib/node.types.js.map +1 -0
  69. package/dist/src/lib/node.utils.d.ts +4 -0
  70. package/dist/src/lib/node.utils.d.ts.map +1 -0
  71. package/dist/src/lib/node.utils.js +32 -0
  72. package/dist/src/lib/node.utils.js.map +1 -0
  73. package/dist/src/lib/wellknown.api.d.ts +5 -0
  74. package/dist/src/lib/wellknown.api.d.ts.map +1 -0
  75. package/dist/src/lib/wellknown.api.js +22 -0
  76. package/dist/src/lib/wellknown.api.js.map +1 -0
  77. package/dist/src/lib/wellknown.types.d.ts +38 -0
  78. package/dist/src/lib/wellknown.types.d.ts.map +1 -0
  79. package/dist/src/lib/wellknown.types.js +2 -0
  80. package/dist/src/lib/wellknown.types.js.map +1 -0
  81. package/dist/src/types.d.ts +45 -0
  82. package/dist/src/types.d.ts.map +1 -0
  83. package/dist/src/types.js +7 -0
  84. package/dist/src/types.js.map +1 -0
  85. package/package.json +6 -6
@@ -0,0 +1,651 @@
1
+ /**
2
+ * @function returnActionCollector - Creates an ActionCollector object based on the provided field and index.
3
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
4
+ * @param {number} idx - The index to be used in the id of the ActionCollector.
5
+ * @param {ActionCollectorTypes} [collectorType] - Optional type of the ActionCollector.
6
+ * @returns {ActionCollector} The constructed ActionCollector object.
7
+ */
8
+ export function returnActionCollector(field, idx, collectorType) {
9
+ let error = '';
10
+ if (!('label' in field)) {
11
+ error = `${error}Label is not found in the field object. `;
12
+ }
13
+ if (!('type' in field)) {
14
+ error = `${error}Type is not found in the field object. `;
15
+ }
16
+ if (collectorType === 'IdpCollector') {
17
+ let link;
18
+ if (!('links' in field)) {
19
+ error = `${error}Links property is not found in the field object. `;
20
+ link = null;
21
+ }
22
+ else {
23
+ link = field.links?.['authenticate']?.href || null;
24
+ }
25
+ return {
26
+ category: 'ActionCollector',
27
+ error: error || null,
28
+ type: collectorType,
29
+ id: `${field.key || field.type}-${idx}`,
30
+ name: field.key || field.type,
31
+ output: {
32
+ key: `${field.key || field.type}-${idx}`,
33
+ label: field.label,
34
+ type: field.type,
35
+ url: link,
36
+ },
37
+ };
38
+ }
39
+ else {
40
+ if (!('key' in field)) {
41
+ error = `${error}Key is not found in the field object. `;
42
+ }
43
+ return {
44
+ category: 'ActionCollector',
45
+ error: error || null,
46
+ type: collectorType || 'ActionCollector',
47
+ id: `${field.key}-${idx}`,
48
+ name: field.key,
49
+ output: {
50
+ key: field.key,
51
+ label: field.label,
52
+ type: field.type,
53
+ },
54
+ };
55
+ }
56
+ }
57
+ /**
58
+ * @function returnFlowCollector - Returns a flow collector object
59
+ * @param {DaVinciField} field - The field representing the flow button
60
+ * @param {number} idx - The index of the field in the form
61
+ * @returns {FlowCollector} - The flow collector object
62
+ */
63
+ export function returnFlowCollector(field, idx) {
64
+ return returnActionCollector(field, idx, 'FlowCollector');
65
+ }
66
+ /**
67
+ * @function returnIdpCollector - Returns a social login collector object
68
+ * @param {DaVinciField} field - The field representing the social login button
69
+ * @param {number} idx - The index of the field in the form
70
+ * @returns {SocialLoginCollector} - The social login collector object
71
+ */
72
+ export function returnIdpCollector(field, idx) {
73
+ return returnActionCollector(field, idx, 'IdpCollector');
74
+ }
75
+ /**
76
+ * @function returnSubmitCollector - Returns a submit collector object
77
+ * @param {DaVinciField} field - The field representing the submit button
78
+ * @param {number} idx - The index of the field in the form
79
+ * @returns {ActionCollector} - The submit collector object
80
+ */
81
+ export function returnSubmitCollector(field, idx) {
82
+ return returnActionCollector(field, idx, 'SubmitCollector');
83
+ }
84
+ /**
85
+ * @function returnSingleValueCollector - Creates a SingleValueCollector object based on the provided field, index, and optional collector type.
86
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
87
+ * @param {number} idx - The index to be used in the id of the SingleValueCollector.
88
+ * @param {SingleValueCollectorTypes} [collectorType] - Optional type of the SingleValueCollector.
89
+ * @returns {SingleValueCollector} The constructed SingleValueCollector object.
90
+ */
91
+ export function returnSingleValueCollector(field, idx, collectorType, data) {
92
+ let error = '';
93
+ if (!('key' in field)) {
94
+ error = `${error}Key is not found in the field object. `;
95
+ }
96
+ if (!('label' in field)) {
97
+ error = `${error}Label is not found in the field object. `;
98
+ }
99
+ if (!('type' in field)) {
100
+ error = `${error}Type is not found in the field object. `;
101
+ }
102
+ if (collectorType === 'PasswordCollector') {
103
+ return {
104
+ category: 'SingleValueCollector',
105
+ error: error || null,
106
+ type: collectorType,
107
+ id: `${field?.key}-${idx}`,
108
+ name: field.key,
109
+ input: {
110
+ key: field.key,
111
+ value: '',
112
+ type: field.type,
113
+ },
114
+ output: {
115
+ key: field.key,
116
+ label: field.label,
117
+ type: field.type,
118
+ // No default or existing value is passed
119
+ },
120
+ };
121
+ }
122
+ else if (collectorType === 'SingleSelectCollector') {
123
+ /**
124
+ * Check if options are present in the field object first
125
+ * If found, return existing error, which should be ''
126
+ * If not found, add additional message to error string
127
+ */
128
+ const err = 'options' in field ? error : `${error}Options are not found in the field object. `;
129
+ const options = 'options' in field ? field.options : []; // Fallback to ensure type consistency
130
+ return {
131
+ category: 'SingleValueCollector',
132
+ error: err || null,
133
+ type: collectorType,
134
+ id: `${field.key}-${idx}`,
135
+ name: field.key,
136
+ input: {
137
+ key: field.key,
138
+ value: '',
139
+ type: field.type,
140
+ },
141
+ output: {
142
+ key: field.key,
143
+ label: field.label,
144
+ type: field.type,
145
+ value: data || '',
146
+ options: options,
147
+ },
148
+ };
149
+ }
150
+ else if ('validation' in field || 'required' in field) {
151
+ const validationArray = [];
152
+ if ('validation' in field) {
153
+ validationArray.push({
154
+ type: 'regex',
155
+ message: field.validation?.errorMessage || '',
156
+ rule: field.validation?.regex || '',
157
+ });
158
+ }
159
+ if ('required' in field && field.required === true) {
160
+ validationArray.push({
161
+ type: 'required',
162
+ message: 'Value cannot be empty',
163
+ rule: true,
164
+ });
165
+ }
166
+ return {
167
+ category: 'ValidatedSingleValueCollector',
168
+ error: error || null,
169
+ type: 'TextCollector',
170
+ id: `${field.key}-${idx}`,
171
+ name: field.key,
172
+ input: {
173
+ key: field.key,
174
+ value: data || '',
175
+ type: field.type,
176
+ validation: validationArray,
177
+ },
178
+ output: {
179
+ key: field.key,
180
+ label: field.label,
181
+ type: field.type,
182
+ value: data || '',
183
+ },
184
+ };
185
+ }
186
+ else {
187
+ return {
188
+ category: 'SingleValueCollector',
189
+ error: error || null,
190
+ type: collectorType || 'SingleValueCollector',
191
+ id: `${field.key}-${idx}`,
192
+ name: field.key,
193
+ input: {
194
+ key: field.key,
195
+ value: '',
196
+ type: field.type,
197
+ },
198
+ output: {
199
+ key: field.key,
200
+ label: field.label,
201
+ type: field.type,
202
+ value: data || '',
203
+ },
204
+ };
205
+ }
206
+ }
207
+ /**
208
+ * @function returnSingleValueAutoCollector - Creates a SingleValueAutoCollector object based on the provided field, index, and optional collector type.
209
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
210
+ * @param {number} idx - The index to be used in the id of the AutoCollector.
211
+ * @param {SingleValueAutoCollectorTypes} [collectorType] - Optional type of the AutoCollector.
212
+ * @returns {AutoCollector} The constructed AutoCollector object.
213
+ */
214
+ export function returnSingleValueAutoCollector(field, idx, collectorType) {
215
+ let error = '';
216
+ if (!('key' in field)) {
217
+ error = `${error}Key is not found in the field object. `;
218
+ }
219
+ if (!('type' in field)) {
220
+ error = `${error}Type is not found in the field object. `;
221
+ }
222
+ if (collectorType === 'ProtectCollector') {
223
+ return {
224
+ category: 'SingleValueAutoCollector',
225
+ error: error || null,
226
+ type: collectorType,
227
+ id: `${field?.key}-${idx}`,
228
+ name: field.key,
229
+ input: {
230
+ key: field.key,
231
+ value: '',
232
+ type: field.type,
233
+ },
234
+ output: {
235
+ key: field.key,
236
+ type: field.type,
237
+ config: {
238
+ behavioralDataCollection: field.behavioralDataCollection,
239
+ universalDeviceIdentification: field.universalDeviceIdentification,
240
+ },
241
+ },
242
+ };
243
+ }
244
+ else {
245
+ return {
246
+ category: 'SingleValueAutoCollector',
247
+ error: error || null,
248
+ type: collectorType || 'SingleValueAutoCollector',
249
+ id: `${field.key}-${idx}`,
250
+ name: field.key,
251
+ input: {
252
+ key: field.key,
253
+ value: '',
254
+ type: field.type,
255
+ },
256
+ output: {
257
+ key: field.key,
258
+ type: field.type,
259
+ },
260
+ };
261
+ }
262
+ }
263
+ /**
264
+ * @function returnObjectValueAutoCollector - Creates an ObjectValueAutoCollector object based on the provided field, index, and optional collector type.
265
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
266
+ * @param {number} idx - The index to be used in the id of the AutoCollector.
267
+ * @param {ObjectValueAutoCollectorTypes} [collectorType] - Optional type of the AutoCollector.
268
+ * @returns {AutoCollector} The constructed AutoCollector object.
269
+ */
270
+ export function returnObjectValueAutoCollector(field, idx, collectorType) {
271
+ let error = '';
272
+ if (!('key' in field)) {
273
+ error = `${error}Key is not found in the field object. `;
274
+ }
275
+ if (!('type' in field)) {
276
+ error = `${error}Type is not found in the field object. `;
277
+ }
278
+ const validationArray = [];
279
+ if ('required' in field && field.required === true) {
280
+ validationArray.push({
281
+ type: 'required',
282
+ message: 'Value cannot be empty',
283
+ rule: true,
284
+ });
285
+ }
286
+ if (field.action === 'REGISTER') {
287
+ return {
288
+ category: 'ObjectValueAutoCollector',
289
+ error: error || null,
290
+ type: collectorType,
291
+ id: `${field?.key}-${idx}`,
292
+ name: field.key,
293
+ input: {
294
+ key: field.key,
295
+ value: {},
296
+ type: field.type,
297
+ validation: validationArray.length ? validationArray : null,
298
+ },
299
+ output: {
300
+ key: field.key,
301
+ type: field.type,
302
+ config: {
303
+ publicKeyCredentialCreationOptions: field.publicKeyCredentialCreationOptions,
304
+ action: field.action,
305
+ trigger: field.trigger,
306
+ },
307
+ },
308
+ };
309
+ }
310
+ else {
311
+ return {
312
+ category: 'ObjectValueAutoCollector',
313
+ error: error || null,
314
+ type: collectorType,
315
+ id: `${field?.key}-${idx}`,
316
+ name: field.key,
317
+ input: {
318
+ key: field.key,
319
+ value: {},
320
+ type: field.type,
321
+ validation: validationArray.length ? validationArray : null,
322
+ },
323
+ output: {
324
+ key: field.key,
325
+ type: field.type,
326
+ config: {
327
+ publicKeyCredentialRequestOptions: field.publicKeyCredentialRequestOptions,
328
+ action: field.action,
329
+ trigger: field.trigger,
330
+ },
331
+ },
332
+ };
333
+ }
334
+ }
335
+ /**
336
+ * @function returnPasswordCollector - Creates a PasswordCollector object based on the provided field and index.
337
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
338
+ * @param {number} idx - The index to be used in the id of the PasswordCollector.
339
+ * @returns {PasswordCollector} The constructed PasswordCollector object.
340
+ */
341
+ export function returnPasswordCollector(field, idx) {
342
+ return returnSingleValueCollector(field, idx, 'PasswordCollector');
343
+ }
344
+ /**
345
+ * @function returnTextCollector - Creates a TextCollector object based on the provided field and index.
346
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
347
+ * @param {number} idx - The index to be used in the id of the TextCollector.
348
+ * @returns {TextCollector} The constructed TextCollector object.
349
+ */
350
+ export function returnTextCollector(field, idx, data) {
351
+ return returnSingleValueCollector(field, idx, 'TextCollector', data);
352
+ }
353
+ /**
354
+ * @function returnSingleSelectCollector - Creates a SingleCollector object based on the provided field and index.
355
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
356
+ * @param {number} idx - The index to be used in the id of the SingleCollector.
357
+ * @returns {SingleValueCollector} The constructed SingleCollector object.
358
+ */
359
+ export function returnSingleSelectCollector(field, idx, data) {
360
+ return returnSingleValueCollector(field, idx, 'SingleSelectCollector', data);
361
+ }
362
+ /**
363
+ * @function returnProtectCollector - Creates a ProtectCollector object based on the provided field and index.
364
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
365
+ * @param {number} idx - The index to be used in the id of the ProtectCollector.
366
+ * @returns {ProtectCollector} The constructed ProtectCollector object.
367
+ */
368
+ export function returnProtectCollector(field, idx) {
369
+ return returnSingleValueAutoCollector(field, idx, 'ProtectCollector');
370
+ }
371
+ /**
372
+ * @function returnFidoRegistrationCollector - Creates a FidoRegistrationCollector object based on the provided field and index.
373
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
374
+ * @param {number} idx - The index to be used in the id of the FidoRegistrationCollector.
375
+ * @returns {FidoRegistrationCollector} The constructed FidoRegistrationCollector object.
376
+ */
377
+ export function returnFidoRegistrationCollector(field, idx) {
378
+ return returnObjectValueAutoCollector(field, idx, 'FidoRegistrationCollector');
379
+ }
380
+ /**
381
+ * @function returnFidoAuthenticationCollector - Creates a FidoAuthenticationCollector object based on the provided field and index.
382
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
383
+ * @param {number} idx - The index to be used in the id of the FidoAuthenticationCollector.
384
+ * @returns {FidoAuthenticationCollector} The constructed FidoAuthenticationCollector object.
385
+ */
386
+ export function returnFidoAuthenticationCollector(field, idx) {
387
+ return returnObjectValueAutoCollector(field, idx, 'FidoAuthenticationCollector');
388
+ }
389
+ /**
390
+ * @function returnMultiValueCollector - Creates a MultiValueCollector object based on the provided field, index, and optional collector type.
391
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
392
+ * @param {number} idx - The index to be used in the id of the MultiValueCollector.
393
+ * @param {MultiValueCollectorTypes} [collectorType] - Optional type of the MultiValueCollector.
394
+ * @returns {MultiValueCollector} The constructed MultiValueCollector object.
395
+ */
396
+ export function returnMultiValueCollector(field, idx, collectorType, data) {
397
+ let error = '';
398
+ if (!('key' in field)) {
399
+ error = `${error}Key is not found in the field object. `;
400
+ }
401
+ if (!('label' in field)) {
402
+ error = `${error}Label is not found in the field object. `;
403
+ }
404
+ if (!('type' in field)) {
405
+ error = `${error}Type is not found in the field object. `;
406
+ }
407
+ if (!('options' in field)) {
408
+ error = `${error}Options are not found in the field object. `;
409
+ }
410
+ const validationArray = [];
411
+ if ('required' in field && field.required === true) {
412
+ validationArray.push({
413
+ type: 'required',
414
+ message: 'Value cannot be empty',
415
+ rule: true,
416
+ });
417
+ }
418
+ return {
419
+ category: 'MultiValueCollector',
420
+ error: error || null,
421
+ type: collectorType || 'MultiValueCollector',
422
+ id: `${field.key}-${idx}`,
423
+ name: field.key,
424
+ input: {
425
+ key: field.key,
426
+ value: data || [],
427
+ type: field.type,
428
+ validation: validationArray.length ? validationArray : null,
429
+ },
430
+ output: {
431
+ key: field.key,
432
+ label: field.label,
433
+ type: field.type,
434
+ value: data || [],
435
+ options: field.options || [],
436
+ },
437
+ };
438
+ }
439
+ /**
440
+ * @function returnMultiSelectCollector - Creates a DropDownCollector object based on the provided field and index.
441
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
442
+ * @param {number} idx - The index to be used in the id of the DropDownCollector.
443
+ * @returns {SingleValueCollector} The constructed DropDownCollector object.
444
+ */
445
+ export function returnMultiSelectCollector(field, idx, data) {
446
+ return returnMultiValueCollector(field, idx, 'MultiSelectCollector', data);
447
+ }
448
+ /**
449
+ * @function returnObjectCollector - Creates a ObjectCollector object based on the provided field, index, and optional collector type.
450
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
451
+ * @param {number} idx - The index to be used in the id of the ObjectCollector.
452
+ * @param {ObjectValueCollectorTypes} [collectorType] - Optional type of the ObjectCollector.
453
+ * @returns {ObjectCollector} The constructed ObjectCollector object.
454
+ */
455
+ export function returnObjectCollector(field, idx, collectorType, prefillData) {
456
+ let error = '';
457
+ if (!('key' in field)) {
458
+ error = `${error}Key is not found in the field object. `;
459
+ }
460
+ if (!('label' in field)) {
461
+ error = `${error}Label is not found in the field object. `;
462
+ }
463
+ if (!('type' in field)) {
464
+ error = `${error}Type is not found in the field object. `;
465
+ }
466
+ const validationArray = [];
467
+ if ('required' in field && field.required === true) {
468
+ validationArray.push({
469
+ type: 'required',
470
+ message: 'Value cannot be empty',
471
+ rule: true,
472
+ });
473
+ }
474
+ let options;
475
+ let defaultValue;
476
+ if (field.type === 'DEVICE_AUTHENTICATION') {
477
+ if (!('options' in field)) {
478
+ error = `${error}Device options are not found in the field object. `;
479
+ }
480
+ if (Array.isArray(field.options) && field.options.length === 0) {
481
+ error = `${error}Device options are not an array or is empty. `;
482
+ }
483
+ const unmappedDefault = field.options?.find((device) => device.default);
484
+ defaultValue = {
485
+ type: unmappedDefault ? unmappedDefault.type : '',
486
+ value: unmappedDefault ? unmappedDefault.description : '',
487
+ id: unmappedDefault ? unmappedDefault.id : '',
488
+ };
489
+ // Map DaVinci spec to normalized SDK API
490
+ options =
491
+ field.options?.map((device) => ({
492
+ type: device.type,
493
+ label: device.title,
494
+ content: device.description,
495
+ value: device.id,
496
+ key: device.id,
497
+ default: device.default,
498
+ })) ?? [];
499
+ }
500
+ else if (field.type === 'DEVICE_REGISTRATION') {
501
+ if (!('options' in field)) {
502
+ error = `${error}Device options are not found in the field object. `;
503
+ }
504
+ if (Array.isArray(field.options) && field.options.length === 0) {
505
+ error = `${error}Device options are not an array or is empty. `;
506
+ }
507
+ defaultValue = '';
508
+ // Map DaVinci spec to normalized SDK API
509
+ options =
510
+ field.options?.map((device, idx) => ({
511
+ type: device.type,
512
+ label: device.title,
513
+ content: device.description,
514
+ value: device.type,
515
+ key: `${device.type}-${idx}`,
516
+ })) ?? [];
517
+ }
518
+ else if (field.type === 'PHONE_NUMBER') {
519
+ if ('validatePhoneNumber' in field && field.validatePhoneNumber === true) {
520
+ validationArray.push({
521
+ type: 'validatePhoneNumber',
522
+ message: 'Phone number should be validated',
523
+ rule: true,
524
+ });
525
+ }
526
+ const prefilledCountryCode = prefillData?.countryCode;
527
+ const prefilledPhone = prefillData?.phoneNumber;
528
+ defaultValue = {
529
+ countryCode: prefilledCountryCode ? prefilledCountryCode : field.defaultCountryCode || '',
530
+ phoneNumber: prefilledPhone || '',
531
+ };
532
+ }
533
+ return {
534
+ category: 'ObjectValueCollector',
535
+ error: error || null,
536
+ type: collectorType || 'ObjectValueCollector',
537
+ id: `${field.key}-${idx}`,
538
+ name: field.key,
539
+ input: {
540
+ key: field.key,
541
+ value: defaultValue,
542
+ type: field.type,
543
+ validation: validationArray.length ? validationArray : null,
544
+ },
545
+ output: {
546
+ key: field.key,
547
+ label: field.label,
548
+ type: field.type,
549
+ ...(options && { options: options || [] }),
550
+ ...(defaultValue && { value: defaultValue }),
551
+ },
552
+ };
553
+ }
554
+ /**
555
+ * @function returnObjectSelectCollector - Creates a DropDownCollector object based on the provided field and index.
556
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
557
+ * @param {number} idx - The index to be used in the id of the DropDownCollector.
558
+ * @returns {SingleValueCollector} The constructed DropDownCollector object.
559
+ */
560
+ export function returnObjectSelectCollector(field, idx) {
561
+ return returnObjectCollector(field, idx, field.type === 'DEVICE_AUTHENTICATION'
562
+ ? 'DeviceAuthenticationCollector'
563
+ : 'DeviceRegistrationCollector');
564
+ }
565
+ export function returnObjectValueCollector(field, idx, prefillData) {
566
+ return returnObjectCollector(field, idx, 'PhoneNumberCollector', prefillData);
567
+ }
568
+ /**
569
+ * @function returnNoValueCollector - Creates a NoValueCollector object based on the provided field, index, and optional collector type.
570
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
571
+ * @param {number} idx - The index to be used in the id of the NoValueCollector.
572
+ * @param {NoValueCollectorTypes} [collectorType] - Optional type of the NoValueCollector.
573
+ * @returns {NoValueCollector} The constructed NoValueCollector object.
574
+ */
575
+ export function returnNoValueCollector(field, idx, collectorType) {
576
+ let error = '';
577
+ if (!('content' in field)) {
578
+ error = `${error}Content is not found in the field object. `;
579
+ }
580
+ if (!('type' in field)) {
581
+ error = `${error}Type is not found in the field object. `;
582
+ }
583
+ return {
584
+ category: 'NoValueCollector',
585
+ error: error || null,
586
+ type: collectorType || 'NoValueCollector',
587
+ id: `${field.key || field.type}-${idx}`,
588
+ name: `${field.key || field.type}-${idx}`,
589
+ output: {
590
+ key: `${field.key || field.type}-${idx}`,
591
+ label: field.content,
592
+ type: field.type,
593
+ },
594
+ };
595
+ }
596
+ /**
597
+ * @function returnReadOnlyCollector - Creates a ReadOnlyCollector object based on the provided field and index.
598
+ * @param {DaVinciField} field - The field object containing key, label, type, and links.
599
+ * @param {number} idx - The index to be used in the id of the ReadOnlyCollector.
600
+ * @returns {ReadOnlyCollector} The constructed ReadOnlyCollector object.
601
+ */
602
+ export function returnReadOnlyCollector(field, idx) {
603
+ return returnNoValueCollector(field, idx, 'ReadOnlyCollector');
604
+ }
605
+ /**
606
+ * @function returnValidator - Creates a validator function based on the provided collector
607
+ * @param {ValidatedTextCollector | ObjectValueCollectors | MultiValueCollectors | AutoCollectors} collector - The collector to which the value will be validated
608
+ * @returns {function} - A "validator" function that validates the input value
609
+ */
610
+ export function returnValidator(collector) {
611
+ const rules = collector.input.validation;
612
+ return (value) => {
613
+ return (rules?.reduce((acc, next) => {
614
+ if (next.type === 'required') {
615
+ if (!value ||
616
+ (Array.isArray(value) && !value.length) ||
617
+ (typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length)) {
618
+ acc.push(next.message);
619
+ }
620
+ }
621
+ else if (next.type === 'regex' && typeof value === 'string') {
622
+ try {
623
+ const result = new RegExp(next.rule).test(value);
624
+ if (!result) {
625
+ acc.push(next.message);
626
+ }
627
+ }
628
+ catch (err) {
629
+ const error = err;
630
+ acc.push(error.message);
631
+ }
632
+ }
633
+ return acc;
634
+ }, []) ?? []);
635
+ };
636
+ }
637
+ export function returnUnknownCollector(field, idx) {
638
+ return {
639
+ category: 'UnknownCollector',
640
+ error: 'Detected an unknown or unsupported collector type',
641
+ type: field['type'],
642
+ id: `${field['key'] || field['type']}-${idx}`,
643
+ name: field['key'] || field['type'],
644
+ output: {
645
+ key: `${field['key'] || field['type']}-${idx}`,
646
+ label: field['label'] || field['content'],
647
+ type: field['type'],
648
+ },
649
+ };
650
+ }
651
+ //# sourceMappingURL=collector.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collector.utils.js","sourceRoot":"","sources":["../../../src/lib/collector.utils.ts"],"names":[],"mappings":"AA+CA;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAoC,EACpC,GAAW,EACX,aAA4B;IAE5B,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC;QACxB,KAAK,GAAG,GAAG,KAAK,0CAA0C,CAAC;IAC7D,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,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