@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.
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +10 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/client.store.d.ts +352 -0
- package/dist/src/lib/client.store.d.ts.map +1 -0
- package/dist/src/lib/client.store.js +308 -0
- package/dist/src/lib/client.store.js.map +1 -0
- package/dist/src/lib/client.store.utils.d.ts +74 -0
- package/dist/src/lib/client.store.utils.d.ts.map +1 -0
- package/dist/src/lib/client.store.utils.js +48 -0
- package/dist/src/lib/client.store.utils.js.map +1 -0
- package/dist/src/lib/client.types.d.ts +71 -0
- package/dist/src/lib/client.types.d.ts.map +1 -0
- package/dist/src/lib/client.types.js +2 -0
- package/dist/src/lib/client.types.js.map +1 -0
- package/dist/src/lib/collector.types.d.ts +448 -0
- package/dist/src/lib/collector.types.d.ts.map +1 -0
- package/dist/src/lib/collector.types.js +8 -0
- package/dist/src/lib/collector.types.js.map +1 -0
- package/dist/src/lib/collector.utils.d.ts +154 -0
- package/dist/src/lib/collector.utils.d.ts.map +1 -0
- package/dist/src/lib/collector.utils.js +651 -0
- package/dist/src/lib/collector.utils.js.map +1 -0
- package/dist/src/lib/config.slice.d.ts +42 -0
- package/dist/src/lib/config.slice.d.ts.map +1 -0
- package/dist/src/lib/config.slice.js +59 -0
- package/dist/src/lib/config.slice.js.map +1 -0
- package/dist/src/lib/config.types.d.ts +12 -0
- package/dist/src/lib/config.types.d.ts.map +1 -0
- package/dist/src/lib/config.types.js +2 -0
- package/dist/src/lib/config.types.js.map +1 -0
- package/dist/src/lib/davinci.api.d.ts +31 -0
- package/dist/src/lib/davinci.api.d.ts.map +1 -0
- package/dist/src/lib/davinci.api.js +347 -0
- package/dist/src/lib/davinci.api.js.map +1 -0
- package/dist/src/lib/davinci.types.d.ts +328 -0
- package/dist/src/lib/davinci.types.d.ts.map +1 -0
- package/dist/src/lib/davinci.types.js +11 -0
- package/dist/src/lib/davinci.types.js.map +1 -0
- package/dist/src/lib/davinci.utils.d.ts +22 -0
- package/dist/src/lib/davinci.utils.d.ts.map +1 -0
- package/dist/src/lib/davinci.utils.js +170 -0
- package/dist/src/lib/davinci.utils.js.map +1 -0
- package/dist/src/lib/fido/fido.d.ts +27 -0
- package/dist/src/lib/fido/fido.d.ts.map +1 -0
- package/dist/src/lib/fido/fido.js +108 -0
- package/dist/src/lib/fido/fido.js.map +1 -0
- package/dist/src/lib/fido/fido.utils.d.ts +31 -0
- package/dist/src/lib/fido/fido.utils.d.ts.map +1 -0
- package/dist/src/lib/fido/fido.utils.js +115 -0
- package/dist/src/lib/fido/fido.utils.js.map +1 -0
- package/dist/src/lib/index.d.ts +3 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/src/lib/index.js +9 -0
- package/dist/src/lib/index.js.map +1 -0
- package/dist/src/lib/node.reducer.d.ts +27 -0
- package/dist/src/lib/node.reducer.d.ts.map +1 -0
- package/dist/src/lib/node.reducer.js +230 -0
- package/dist/src/lib/node.reducer.js.map +1 -0
- package/dist/src/lib/node.slice.d.ts +181 -0
- package/dist/src/lib/node.slice.d.ts.map +1 -0
- package/dist/src/lib/node.slice.js +261 -0
- package/dist/src/lib/node.slice.js.map +1 -0
- package/dist/src/lib/node.types.d.ts +119 -0
- package/dist/src/lib/node.types.d.ts.map +1 -0
- package/dist/src/lib/node.types.js +2 -0
- package/dist/src/lib/node.types.js.map +1 -0
- package/dist/src/lib/node.utils.d.ts +4 -0
- package/dist/src/lib/node.utils.d.ts.map +1 -0
- package/dist/src/lib/node.utils.js +32 -0
- package/dist/src/lib/node.utils.js.map +1 -0
- package/dist/src/lib/wellknown.api.d.ts +5 -0
- package/dist/src/lib/wellknown.api.d.ts.map +1 -0
- package/dist/src/lib/wellknown.api.js +22 -0
- package/dist/src/lib/wellknown.api.js.map +1 -0
- package/dist/src/lib/wellknown.types.d.ts +38 -0
- package/dist/src/lib/wellknown.types.d.ts.map +1 -0
- package/dist/src/lib/wellknown.types.js +2 -0
- package/dist/src/lib/wellknown.types.js.map +1 -0
- package/dist/src/types.d.ts +45 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +7 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
import type { FidoAuthenticationOptions, FidoRegistrationOptions } from './davinci.types.js';
|
|
2
|
+
/** *********************************************************************
|
|
3
|
+
* SINGLE-VALUE COLLECTORS
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @interface SingleValueCollector - Represents a request to collect a single value from the user, like email or password.
|
|
7
|
+
*/
|
|
8
|
+
export type SingleValueCollectorTypes = 'PasswordCollector' | 'SingleValueCollector' | 'SingleSelectCollector' | 'SingleSelectObjectCollector' | 'TextCollector' | 'ValidatedTextCollector';
|
|
9
|
+
interface SelectorOption {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
interface ValidationRequired {
|
|
14
|
+
type: 'required';
|
|
15
|
+
message: string;
|
|
16
|
+
rule: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface ValidationRegex {
|
|
19
|
+
type: 'regex';
|
|
20
|
+
message: string;
|
|
21
|
+
rule: string;
|
|
22
|
+
}
|
|
23
|
+
interface ValidationPhoneNumber {
|
|
24
|
+
type: 'validatePhoneNumber';
|
|
25
|
+
message: string;
|
|
26
|
+
rule: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface SingleValueCollectorWithValue<T extends SingleValueCollectorTypes> {
|
|
29
|
+
category: 'SingleValueCollector';
|
|
30
|
+
error: string | null;
|
|
31
|
+
type: T;
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
input: {
|
|
35
|
+
key: string;
|
|
36
|
+
value: string | number | boolean;
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
output: {
|
|
40
|
+
key: string;
|
|
41
|
+
label: string;
|
|
42
|
+
type: string;
|
|
43
|
+
value: string | number | boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface ValidatedSingleValueCollectorWithValue<T extends SingleValueCollectorTypes> {
|
|
47
|
+
category: 'ValidatedSingleValueCollector';
|
|
48
|
+
error: string | null;
|
|
49
|
+
type: T;
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
input: {
|
|
53
|
+
key: string;
|
|
54
|
+
value: string | number | boolean;
|
|
55
|
+
type: string;
|
|
56
|
+
validation: (ValidationRequired | ValidationRegex)[];
|
|
57
|
+
};
|
|
58
|
+
output: {
|
|
59
|
+
key: string;
|
|
60
|
+
label: string;
|
|
61
|
+
type: string;
|
|
62
|
+
value: string | number | boolean;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface SingleSelectCollectorWithValue<T extends SingleValueCollectorTypes> {
|
|
66
|
+
category: 'SingleValueCollector';
|
|
67
|
+
error: string | null;
|
|
68
|
+
type: T;
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
input: {
|
|
72
|
+
key: string;
|
|
73
|
+
value: string | number | boolean;
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
output: {
|
|
77
|
+
key: string;
|
|
78
|
+
label: string;
|
|
79
|
+
type: string;
|
|
80
|
+
value: string | number | boolean;
|
|
81
|
+
options: SelectorOption[];
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface SingleValueCollectorNoValue<T extends SingleValueCollectorTypes> {
|
|
85
|
+
category: 'SingleValueCollector';
|
|
86
|
+
error: string | null;
|
|
87
|
+
type: T;
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
input: {
|
|
91
|
+
key: string;
|
|
92
|
+
value: string | number | boolean;
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
output: {
|
|
96
|
+
key: string;
|
|
97
|
+
label: string;
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export interface SingleSelectCollectorNoValue<T extends SingleValueCollectorTypes> {
|
|
102
|
+
category: 'SingleValueCollector';
|
|
103
|
+
error: string | null;
|
|
104
|
+
type: T;
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
input: {
|
|
108
|
+
key: string;
|
|
109
|
+
value: string | number | boolean;
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
output: {
|
|
113
|
+
key: string;
|
|
114
|
+
label: string;
|
|
115
|
+
type: string;
|
|
116
|
+
options: SelectorOption[];
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Type to help infer the collector based on the collector type
|
|
121
|
+
* Used specifically in the returnSingleValueCollector wrapper function.
|
|
122
|
+
* When given a type, it can narrow which type it is returning
|
|
123
|
+
*
|
|
124
|
+
* Note: You can see this type in action in the test file or in the collector.utils file.
|
|
125
|
+
*/
|
|
126
|
+
export type InferSingleValueCollectorType<T extends SingleValueCollectorTypes> = T extends 'TextCollector' ? TextCollector : T extends 'SingleSelectCollector' ? SingleSelectCollector : T extends 'ValidatedTextCollector' ? ValidatedTextCollector : T extends 'PasswordCollector' ? PasswordCollector : SingleValueCollectorWithValue<'SingleValueCollector'> | SingleValueCollectorNoValue<'SingleValueCollector'>;
|
|
127
|
+
/**
|
|
128
|
+
* SINGLE-VALUE COLLECTOR TYPES
|
|
129
|
+
*/
|
|
130
|
+
export type SingleValueCollector<T extends SingleValueCollectorTypes> = SingleValueCollectorWithValue<T> | SingleValueCollectorNoValue<T>;
|
|
131
|
+
export type SingleValueCollectors = SingleValueCollectorNoValue<'PasswordCollector'> | SingleSelectCollectorWithValue<'SingleSelectCollector'> | SingleValueCollectorWithValue<'SingleValueCollector'> | SingleValueCollectorWithValue<'TextCollector'> | ValidatedSingleValueCollectorWithValue<'TextCollector'>;
|
|
132
|
+
export type PasswordCollector = SingleValueCollectorNoValue<'PasswordCollector'>;
|
|
133
|
+
export type TextCollector = SingleValueCollectorWithValue<'TextCollector'>;
|
|
134
|
+
export type SingleSelectCollector = SingleSelectCollectorWithValue<'SingleSelectCollector'>;
|
|
135
|
+
export type ValidatedTextCollector = ValidatedSingleValueCollectorWithValue<'TextCollector'>;
|
|
136
|
+
/** *********************************************************************
|
|
137
|
+
* MULTI-VALUE COLLECTORS
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* @interface MultiValueCollector - Represents a request to collect multiple values from the user.
|
|
141
|
+
*/
|
|
142
|
+
export type MultiValueCollectorTypes = 'MultiSelectCollector' | 'MultiValueCollector';
|
|
143
|
+
export interface MultiValueCollectorWithValue<T extends MultiValueCollectorTypes> {
|
|
144
|
+
category: 'MultiValueCollector';
|
|
145
|
+
error: string | null;
|
|
146
|
+
type: T;
|
|
147
|
+
id: string;
|
|
148
|
+
name: string;
|
|
149
|
+
input: {
|
|
150
|
+
key: string;
|
|
151
|
+
value: string[];
|
|
152
|
+
type: string;
|
|
153
|
+
validation: ValidationRequired[] | null;
|
|
154
|
+
};
|
|
155
|
+
output: {
|
|
156
|
+
key: string;
|
|
157
|
+
label: string;
|
|
158
|
+
type: string;
|
|
159
|
+
value: string[];
|
|
160
|
+
options: SelectorOption[];
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
export interface MultiValueCollectorNoValue<T extends MultiValueCollectorTypes> {
|
|
164
|
+
category: 'MultiValueCollector';
|
|
165
|
+
error: string | null;
|
|
166
|
+
type: T;
|
|
167
|
+
id: string;
|
|
168
|
+
name: string;
|
|
169
|
+
input: {
|
|
170
|
+
key: string;
|
|
171
|
+
value: string[];
|
|
172
|
+
type: string;
|
|
173
|
+
validation: ValidationRequired[] | null;
|
|
174
|
+
};
|
|
175
|
+
output: {
|
|
176
|
+
key: string;
|
|
177
|
+
label: string;
|
|
178
|
+
type: string;
|
|
179
|
+
options: SelectorOption[];
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Type to help infer the collector based on the collector type
|
|
184
|
+
* Used specifically in the returnMultiValueCollector wrapper function.
|
|
185
|
+
* When given a type, it can narrow which type it is returning
|
|
186
|
+
*
|
|
187
|
+
* Note: You can see this type in action in the test file or in the collector.utils file.
|
|
188
|
+
*/
|
|
189
|
+
export type InferMultiValueCollectorType<T extends MultiValueCollectorTypes> = T extends 'MultiSelectCollector' ? MultiValueCollectorWithValue<'MultiSelectCollector'> : MultiValueCollectorWithValue<'MultiValueCollector'> | MultiValueCollectorNoValue<'MultiValueCollector'>;
|
|
190
|
+
export type MultiValueCollectors = MultiValueCollectorWithValue<'MultiValueCollector'> | MultiValueCollectorWithValue<'MultiSelectCollector'>;
|
|
191
|
+
export type MultiValueCollector<T extends MultiValueCollectorTypes> = MultiValueCollectorWithValue<T> | MultiValueCollectorNoValue<T>;
|
|
192
|
+
export type MultiSelectCollector = MultiValueCollectorWithValue<'MultiSelectCollector'>;
|
|
193
|
+
/** *********************************************************************
|
|
194
|
+
* OBJECT COLLECTORS
|
|
195
|
+
*/
|
|
196
|
+
export type ObjectValueCollectorTypes = 'DeviceAuthenticationCollector' | 'DeviceRegistrationCollector' | 'PhoneNumberCollector' | 'ObjectOptionsCollector' | 'ObjectValueCollector' | 'ObjectSelectCollector';
|
|
197
|
+
interface DeviceOptionWithDefault {
|
|
198
|
+
type: string;
|
|
199
|
+
label: string;
|
|
200
|
+
content: string;
|
|
201
|
+
default: boolean;
|
|
202
|
+
value: string;
|
|
203
|
+
key: string;
|
|
204
|
+
}
|
|
205
|
+
interface DeviceOptionNoDefault {
|
|
206
|
+
type: string;
|
|
207
|
+
label: string;
|
|
208
|
+
content: string;
|
|
209
|
+
value: string;
|
|
210
|
+
key: string;
|
|
211
|
+
}
|
|
212
|
+
export interface DeviceValue {
|
|
213
|
+
type: string;
|
|
214
|
+
id: string;
|
|
215
|
+
value: string;
|
|
216
|
+
}
|
|
217
|
+
export interface PhoneNumberInputValue {
|
|
218
|
+
countryCode: string;
|
|
219
|
+
phoneNumber: string;
|
|
220
|
+
}
|
|
221
|
+
export interface PhoneNumberOutputValue {
|
|
222
|
+
countryCode?: string;
|
|
223
|
+
phoneNumber?: string;
|
|
224
|
+
}
|
|
225
|
+
export interface ObjectOptionsCollectorWithStringValue<T extends ObjectValueCollectorTypes, V = string> {
|
|
226
|
+
category: 'ObjectValueCollector';
|
|
227
|
+
error: string | null;
|
|
228
|
+
type: T;
|
|
229
|
+
id: string;
|
|
230
|
+
name: string;
|
|
231
|
+
input: {
|
|
232
|
+
key: string;
|
|
233
|
+
value: V;
|
|
234
|
+
type: string;
|
|
235
|
+
validation: ValidationRequired[] | null;
|
|
236
|
+
};
|
|
237
|
+
output: {
|
|
238
|
+
key: string;
|
|
239
|
+
label: string;
|
|
240
|
+
type: string;
|
|
241
|
+
options: DeviceOptionNoDefault[];
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
export interface ObjectOptionsCollectorWithObjectValue<T extends ObjectValueCollectorTypes, V = Record<string, string>, D = Record<string, string>> {
|
|
245
|
+
category: 'ObjectValueCollector';
|
|
246
|
+
error: string | null;
|
|
247
|
+
type: T;
|
|
248
|
+
id: string;
|
|
249
|
+
name: string;
|
|
250
|
+
input: {
|
|
251
|
+
key: string;
|
|
252
|
+
value: V;
|
|
253
|
+
type: string;
|
|
254
|
+
validation: ValidationRequired[] | null;
|
|
255
|
+
};
|
|
256
|
+
output: {
|
|
257
|
+
key: string;
|
|
258
|
+
label: string;
|
|
259
|
+
type: string;
|
|
260
|
+
options: DeviceOptionWithDefault[];
|
|
261
|
+
value?: D | null;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
export interface ObjectValueCollectorWithObjectValue<T extends ObjectValueCollectorTypes, IV = Record<string, string>, OV = Record<string, string>> {
|
|
265
|
+
category: 'ObjectValueCollector';
|
|
266
|
+
error: string | null;
|
|
267
|
+
type: T;
|
|
268
|
+
id: string;
|
|
269
|
+
name: string;
|
|
270
|
+
input: {
|
|
271
|
+
key: string;
|
|
272
|
+
value: IV;
|
|
273
|
+
type: string;
|
|
274
|
+
validation: (ValidationRequired | ValidationPhoneNumber)[] | null;
|
|
275
|
+
};
|
|
276
|
+
output: {
|
|
277
|
+
key: string;
|
|
278
|
+
label: string;
|
|
279
|
+
type: string;
|
|
280
|
+
value?: OV | null;
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
export type InferValueObjectCollectorType<T extends ObjectValueCollectorTypes> = T extends 'DeviceAuthenticationCollector' ? DeviceAuthenticationCollector : T extends 'DeviceRegistrationCollector' ? DeviceRegistrationCollector : T extends 'PhoneNumberCollector' ? PhoneNumberCollector : ObjectOptionsCollectorWithObjectValue<'ObjectValueCollector'> | ObjectOptionsCollectorWithStringValue<'ObjectValueCollector'>;
|
|
284
|
+
export type ObjectValueCollectors = DeviceAuthenticationCollector | DeviceRegistrationCollector | PhoneNumberCollector | ObjectOptionsCollectorWithObjectValue<'ObjectSelectCollector'> | ObjectOptionsCollectorWithStringValue<'ObjectSelectCollector'>;
|
|
285
|
+
export type ObjectValueCollector<T extends ObjectValueCollectorTypes> = ObjectOptionsCollectorWithObjectValue<T> | ObjectOptionsCollectorWithStringValue<T> | ObjectValueCollectorWithObjectValue<T>;
|
|
286
|
+
export type DeviceRegistrationCollector = ObjectOptionsCollectorWithStringValue<'DeviceRegistrationCollector', string>;
|
|
287
|
+
export type DeviceAuthenticationCollector = ObjectOptionsCollectorWithObjectValue<'DeviceAuthenticationCollector', DeviceValue>;
|
|
288
|
+
export type PhoneNumberCollector = ObjectValueCollectorWithObjectValue<'PhoneNumberCollector', PhoneNumberInputValue, PhoneNumberOutputValue>;
|
|
289
|
+
/** *********************************************************************
|
|
290
|
+
* ACTION COLLECTORS
|
|
291
|
+
*/
|
|
292
|
+
/**
|
|
293
|
+
* @interface ActionCollector - Represents a user option to perform an action, like submitting a form or choosing another flow.
|
|
294
|
+
*/
|
|
295
|
+
export type ActionCollectorTypes = 'FlowCollector' | 'SubmitCollector' | 'IdpCollector' | 'ActionCollector';
|
|
296
|
+
export interface ActionCollectorNoUrl<T extends ActionCollectorTypes> {
|
|
297
|
+
category: 'ActionCollector';
|
|
298
|
+
error: string | null;
|
|
299
|
+
type: T;
|
|
300
|
+
id: string;
|
|
301
|
+
name: string;
|
|
302
|
+
output: {
|
|
303
|
+
key: string;
|
|
304
|
+
label: string;
|
|
305
|
+
type: string;
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
export interface ActionCollectorWithUrl<T extends ActionCollectorTypes> {
|
|
309
|
+
category: 'ActionCollector';
|
|
310
|
+
error: string | null;
|
|
311
|
+
type: T;
|
|
312
|
+
id: string;
|
|
313
|
+
name: string;
|
|
314
|
+
output: {
|
|
315
|
+
key: string;
|
|
316
|
+
label: string;
|
|
317
|
+
type: string;
|
|
318
|
+
url?: string | null;
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
export type ActionCollector<T extends ActionCollectorTypes> = ActionCollectorNoUrl<T> | ActionCollectorWithUrl<T>;
|
|
322
|
+
export type InferActionCollectorType<T extends ActionCollectorTypes> = T extends 'IdpCollector' ? IdpCollector : T extends 'SubmitCollector' ? SubmitCollector : T extends 'FlowCollector' ? FlowCollector : ActionCollectorWithUrl<'ActionCollector'> | ActionCollectorNoUrl<'ActionCollector'>;
|
|
323
|
+
export type ActionCollectors = ActionCollectorWithUrl<'IdpCollector'> | ActionCollectorNoUrl<'ActionCollector'> | ActionCollectorNoUrl<'FlowCollector'> | ActionCollectorNoUrl<'SubmitCollector'>;
|
|
324
|
+
export type FlowCollector = ActionCollectorNoUrl<'FlowCollector'>;
|
|
325
|
+
export type IdpCollector = ActionCollectorWithUrl<'IdpCollector'>;
|
|
326
|
+
export type SubmitCollector = ActionCollectorNoUrl<'SubmitCollector'>;
|
|
327
|
+
/** *********************************************************************
|
|
328
|
+
* NO VALUE COLLECTORS
|
|
329
|
+
*/
|
|
330
|
+
/**
|
|
331
|
+
* @interface NoValueCollector - Represents a collector that collects no value; text only for display.
|
|
332
|
+
*/
|
|
333
|
+
export type NoValueCollectorTypes = 'ReadOnlyCollector' | 'NoValueCollector';
|
|
334
|
+
export interface NoValueCollectorBase<T extends NoValueCollectorTypes> {
|
|
335
|
+
category: 'NoValueCollector';
|
|
336
|
+
error: string | null;
|
|
337
|
+
type: T;
|
|
338
|
+
id: string;
|
|
339
|
+
name: string;
|
|
340
|
+
output: {
|
|
341
|
+
key: string;
|
|
342
|
+
label: string;
|
|
343
|
+
type: string;
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Type to help infer the collector based on the collector type
|
|
348
|
+
* Used specifically in the returnNoValueCollector wrapper function.
|
|
349
|
+
* When given a type, it can narrow which type it is returning
|
|
350
|
+
*
|
|
351
|
+
* Note: You can see this type in action in the test file or in the collector.utils file.
|
|
352
|
+
*/
|
|
353
|
+
export type InferNoValueCollectorType<T extends NoValueCollectorTypes> = T extends 'ReadOnlyCollector' ? NoValueCollectorBase<'ReadOnlyCollector'> : NoValueCollectorBase<'NoValueCollector'>;
|
|
354
|
+
export type NoValueCollectors = NoValueCollectorBase<'NoValueCollector'> | NoValueCollectorBase<'ReadOnlyCollector'>;
|
|
355
|
+
export type NoValueCollector<T extends NoValueCollectorTypes> = NoValueCollectorBase<T>;
|
|
356
|
+
export type ReadOnlyCollector = NoValueCollectorBase<'ReadOnlyCollector'>;
|
|
357
|
+
export type UnknownCollector = {
|
|
358
|
+
category: 'UnknownCollector';
|
|
359
|
+
error: string | null;
|
|
360
|
+
type: 'UnknownCollector';
|
|
361
|
+
id: string;
|
|
362
|
+
name: string;
|
|
363
|
+
output: {
|
|
364
|
+
key: string;
|
|
365
|
+
label: string;
|
|
366
|
+
type: string;
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
/** *********************************************************************
|
|
370
|
+
* AUTOMATED COLLECTORS
|
|
371
|
+
*/
|
|
372
|
+
/**
|
|
373
|
+
* @interface AutoCollector - Represents a collector that collects a value programmatically without user intervention.
|
|
374
|
+
*/
|
|
375
|
+
export interface ProtectOutputValue {
|
|
376
|
+
behavioralDataCollection: boolean;
|
|
377
|
+
universalDeviceIdentification: boolean;
|
|
378
|
+
}
|
|
379
|
+
export interface AttestationValue extends Omit<PublicKeyCredential, 'rawId' | 'response' | 'getClientExtensionResults' | 'toJSON'> {
|
|
380
|
+
rawId: string;
|
|
381
|
+
response: {
|
|
382
|
+
clientDataJSON: string;
|
|
383
|
+
attestationObject: string;
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
export interface FidoRegistrationInputValue {
|
|
387
|
+
attestationValue?: AttestationValue;
|
|
388
|
+
}
|
|
389
|
+
export interface FidoRegistrationOutputValue {
|
|
390
|
+
publicKeyCredentialCreationOptions: FidoRegistrationOptions;
|
|
391
|
+
action: 'REGISTER';
|
|
392
|
+
trigger: string;
|
|
393
|
+
}
|
|
394
|
+
export interface AssertionValue extends Omit<PublicKeyCredential, 'rawId' | 'response' | 'getClientExtensionResults' | 'toJSON'> {
|
|
395
|
+
rawId: string;
|
|
396
|
+
response: {
|
|
397
|
+
clientDataJSON: string;
|
|
398
|
+
authenticatorData: string;
|
|
399
|
+
signature: string;
|
|
400
|
+
userHandle: string | null;
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
export interface FidoAuthenticationInputValue {
|
|
404
|
+
assertionValue?: AssertionValue;
|
|
405
|
+
}
|
|
406
|
+
export interface FidoAuthenticationOutputValue {
|
|
407
|
+
publicKeyCredentialRequestOptions: FidoAuthenticationOptions;
|
|
408
|
+
action: 'AUTHENTICATE';
|
|
409
|
+
trigger: string;
|
|
410
|
+
}
|
|
411
|
+
export type AutoCollectorCategories = 'SingleValueAutoCollector' | 'ObjectValueAutoCollector';
|
|
412
|
+
export type SingleValueAutoCollectorTypes = 'SingleValueAutoCollector' | 'ProtectCollector';
|
|
413
|
+
export type ObjectValueAutoCollectorTypes = 'ObjectValueAutoCollector' | 'FidoRegistrationCollector' | 'FidoAuthenticationCollector';
|
|
414
|
+
export type AutoCollectorTypes = SingleValueAutoCollectorTypes | ObjectValueAutoCollectorTypes;
|
|
415
|
+
export interface AutoCollector<C extends AutoCollectorCategories, T extends AutoCollectorTypes, IV = string, OV = Record<string, unknown>> {
|
|
416
|
+
category: C;
|
|
417
|
+
error: string | null;
|
|
418
|
+
type: T;
|
|
419
|
+
id: string;
|
|
420
|
+
name: string;
|
|
421
|
+
input: {
|
|
422
|
+
key: string;
|
|
423
|
+
value: IV;
|
|
424
|
+
type: string;
|
|
425
|
+
validation?: ValidationRequired[] | null;
|
|
426
|
+
};
|
|
427
|
+
output: {
|
|
428
|
+
key: string;
|
|
429
|
+
type: string;
|
|
430
|
+
config: OV;
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
export type ProtectCollector = AutoCollector<'SingleValueAutoCollector', 'ProtectCollector', string, ProtectOutputValue>;
|
|
434
|
+
export type FidoRegistrationCollector = AutoCollector<'ObjectValueAutoCollector', 'FidoRegistrationCollector', FidoRegistrationInputValue, FidoRegistrationOutputValue>;
|
|
435
|
+
export type FidoAuthenticationCollector = AutoCollector<'ObjectValueAutoCollector', 'FidoAuthenticationCollector', FidoAuthenticationInputValue, FidoAuthenticationOutputValue>;
|
|
436
|
+
export type SingleValueAutoCollector = AutoCollector<'SingleValueAutoCollector', 'SingleValueAutoCollector', string>;
|
|
437
|
+
export type ObjectValueAutoCollector = AutoCollector<'ObjectValueAutoCollector', 'ObjectValueAutoCollector', Record<string, unknown>>;
|
|
438
|
+
export type AutoCollectors = ProtectCollector | FidoRegistrationCollector | FidoAuthenticationCollector | SingleValueAutoCollector | ObjectValueAutoCollector;
|
|
439
|
+
/**
|
|
440
|
+
* Type to help infer the collector based on the collector type
|
|
441
|
+
* Used specifically in the returnAutoCollector wrapper function.
|
|
442
|
+
* When given a type, it can narrow which type it is returning
|
|
443
|
+
*
|
|
444
|
+
* Note: You can see this type in action in the test file or in the collector.utils file.
|
|
445
|
+
*/
|
|
446
|
+
export type InferAutoCollectorType<T extends AutoCollectorTypes> = T extends 'ProtectCollector' ? ProtectCollector : T extends 'FidoRegistrationCollector' ? FidoRegistrationCollector : T extends 'FidoAuthenticationCollector' ? FidoAuthenticationCollector : T extends 'ObjectValueAutoCollector' ? ObjectValueAutoCollector : SingleValueAutoCollector;
|
|
447
|
+
export {};
|
|
448
|
+
//# sourceMappingURL=collector.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector.types.d.ts","sourceRoot":"","sources":["../../../src/lib/collector.types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7F;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,yBAAyB,GACjC,mBAAmB,GACnB,sBAAsB,GACtB,uBAAuB,GACvB,6BAA6B,GAC7B,eAAe,GACf,wBAAwB,CAAC;AAE7B,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC,SAAS,yBAAyB;IAChF,QAAQ,EAAE,sBAAsB,CAAC;IACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,EAAE,MAAM,CAA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,yBAAyB,GAAG,aAAa,CACnD,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,CAC5B,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG,aAAa,CACrD,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,CAC9B,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAClD,0BAA0B,EAC1B,0BAA0B,EAC1B,MAAM,CACP,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAClD,0BAA0B,EAC1B,0BAA0B,EAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CACxB,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,yBAAyB,GACzB,2BAA2B,GAC3B,wBAAwB,GACxB,wBAAwB,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,kBAAkB,IAAI,CAAC,SAAS,kBAAkB,GAC3F,gBAAgB,GAChB,CAAC,SAAS,2BAA2B,GACnC,yBAAyB,GACzB,CAAC,SAAS,6BAA6B,GACrC,2BAA2B,GAC3B,CAAC,SAAS,0BAA0B,GAClC,wBAAwB,GAKxB,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector.types.js","sourceRoot":"","sources":["../../../src/lib/collector.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import the required types
|
|
3
|
+
*/
|
|
4
|
+
import type { ActionCollectors, ActionCollectorTypes, InferSingleValueCollectorType, InferMultiValueCollectorType, SingleValueCollectorTypes, MultiValueCollectorTypes, NoValueCollectorTypes, InferNoValueCollectorType, ValidatedSingleValueCollectorWithValue, ValidatedTextCollector, InferValueObjectCollectorType, ObjectValueCollectorTypes, UnknownCollector, InferAutoCollectorType, PhoneNumberOutputValue, MultiValueCollectors, ObjectValueCollectors, AutoCollectors, SingleValueAutoCollectorTypes, ObjectValueAutoCollectorTypes } from './collector.types.js';
|
|
5
|
+
import type { DeviceAuthenticationField, DeviceRegistrationField, FidoAuthenticationField, FidoRegistrationField, MultiSelectField, PhoneNumberField, ProtectField, ReadOnlyField, RedirectField, SingleSelectField, StandardField, ValidatedField } from './davinci.types.js';
|
|
6
|
+
/**
|
|
7
|
+
* @function returnActionCollector - Creates an ActionCollector object based on the provided field and index.
|
|
8
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
9
|
+
* @param {number} idx - The index to be used in the id of the ActionCollector.
|
|
10
|
+
* @param {ActionCollectorTypes} [collectorType] - Optional type of the ActionCollector.
|
|
11
|
+
* @returns {ActionCollector} The constructed ActionCollector object.
|
|
12
|
+
*/
|
|
13
|
+
export declare function returnActionCollector<CollectorType extends ActionCollectorTypes>(field: RedirectField | StandardField, idx: number, collectorType: CollectorType): ActionCollectors;
|
|
14
|
+
/**
|
|
15
|
+
* @function returnFlowCollector - Returns a flow collector object
|
|
16
|
+
* @param {DaVinciField} field - The field representing the flow button
|
|
17
|
+
* @param {number} idx - The index of the field in the form
|
|
18
|
+
* @returns {FlowCollector} - The flow collector object
|
|
19
|
+
*/
|
|
20
|
+
export declare function returnFlowCollector(field: StandardField, idx: number): ActionCollectors;
|
|
21
|
+
/**
|
|
22
|
+
* @function returnIdpCollector - Returns a social login collector object
|
|
23
|
+
* @param {DaVinciField} field - The field representing the social login button
|
|
24
|
+
* @param {number} idx - The index of the field in the form
|
|
25
|
+
* @returns {SocialLoginCollector} - The social login collector object
|
|
26
|
+
*/
|
|
27
|
+
export declare function returnIdpCollector(field: RedirectField, idx: number): ActionCollectors;
|
|
28
|
+
/**
|
|
29
|
+
* @function returnSubmitCollector - Returns a submit collector object
|
|
30
|
+
* @param {DaVinciField} field - The field representing the submit button
|
|
31
|
+
* @param {number} idx - The index of the field in the form
|
|
32
|
+
* @returns {ActionCollector} - The submit collector object
|
|
33
|
+
*/
|
|
34
|
+
export declare function returnSubmitCollector(field: StandardField, idx: number): ActionCollectors;
|
|
35
|
+
/**
|
|
36
|
+
* @function returnSingleValueCollector - Creates a SingleValueCollector object based on the provided field, index, and optional collector type.
|
|
37
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
38
|
+
* @param {number} idx - The index to be used in the id of the SingleValueCollector.
|
|
39
|
+
* @param {SingleValueCollectorTypes} [collectorType] - Optional type of the SingleValueCollector.
|
|
40
|
+
* @returns {SingleValueCollector} The constructed SingleValueCollector object.
|
|
41
|
+
*/
|
|
42
|
+
export declare function returnSingleValueCollector<Field extends StandardField | SingleSelectField | ValidatedField, CollectorType extends SingleValueCollectorTypes = 'SingleValueCollector'>(field: Field, idx: number, collectorType: CollectorType, data?: string): import("./collector.types.js").SingleSelectCollector | ValidatedSingleValueCollectorWithValue<"TextCollector"> | InferSingleValueCollectorType<CollectorType>;
|
|
43
|
+
/**
|
|
44
|
+
* @function returnSingleValueAutoCollector - Creates a SingleValueAutoCollector object based on the provided field, index, and optional collector type.
|
|
45
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
46
|
+
* @param {number} idx - The index to be used in the id of the AutoCollector.
|
|
47
|
+
* @param {SingleValueAutoCollectorTypes} [collectorType] - Optional type of the AutoCollector.
|
|
48
|
+
* @returns {AutoCollector} The constructed AutoCollector object.
|
|
49
|
+
*/
|
|
50
|
+
export declare function returnSingleValueAutoCollector<Field extends ProtectField, CollectorType extends SingleValueAutoCollectorTypes = 'SingleValueAutoCollector'>(field: Field, idx: number, collectorType: CollectorType): import("./collector.types.js").ProtectCollector | InferAutoCollectorType<CollectorType>;
|
|
51
|
+
/**
|
|
52
|
+
* @function returnObjectValueAutoCollector - Creates an ObjectValueAutoCollector object based on the provided field, index, and optional collector type.
|
|
53
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
54
|
+
* @param {number} idx - The index to be used in the id of the AutoCollector.
|
|
55
|
+
* @param {ObjectValueAutoCollectorTypes} [collectorType] - Optional type of the AutoCollector.
|
|
56
|
+
* @returns {AutoCollector} The constructed AutoCollector object.
|
|
57
|
+
*/
|
|
58
|
+
export declare function returnObjectValueAutoCollector<Field extends FidoRegistrationField | FidoAuthenticationField, CollectorType extends ObjectValueAutoCollectorTypes = 'ObjectValueAutoCollector'>(field: Field, idx: number, collectorType: CollectorType): import("./collector.types.js").FidoRegistrationCollector | import("./collector.types.js").FidoAuthenticationCollector;
|
|
59
|
+
/**
|
|
60
|
+
* @function returnPasswordCollector - Creates a PasswordCollector object based on the provided field and index.
|
|
61
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
62
|
+
* @param {number} idx - The index to be used in the id of the PasswordCollector.
|
|
63
|
+
* @returns {PasswordCollector} The constructed PasswordCollector object.
|
|
64
|
+
*/
|
|
65
|
+
export declare function returnPasswordCollector(field: StandardField, idx: number): import("./collector.types.js").SingleSelectCollector | import("./collector.types.js").PasswordCollector | ValidatedSingleValueCollectorWithValue<"TextCollector">;
|
|
66
|
+
/**
|
|
67
|
+
* @function returnTextCollector - Creates a TextCollector object based on the provided field and index.
|
|
68
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
69
|
+
* @param {number} idx - The index to be used in the id of the TextCollector.
|
|
70
|
+
* @returns {TextCollector} The constructed TextCollector object.
|
|
71
|
+
*/
|
|
72
|
+
export declare function returnTextCollector(field: StandardField, idx: number, data: string): import("./collector.types.js").TextCollector | import("./collector.types.js").SingleSelectCollector | ValidatedSingleValueCollectorWithValue<"TextCollector">;
|
|
73
|
+
/**
|
|
74
|
+
* @function returnSingleSelectCollector - Creates a SingleCollector object based on the provided field and index.
|
|
75
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
76
|
+
* @param {number} idx - The index to be used in the id of the SingleCollector.
|
|
77
|
+
* @returns {SingleValueCollector} The constructed SingleCollector object.
|
|
78
|
+
*/
|
|
79
|
+
export declare function returnSingleSelectCollector(field: SingleSelectField, idx: number, data: string): import("./collector.types.js").SingleSelectCollector | ValidatedSingleValueCollectorWithValue<"TextCollector">;
|
|
80
|
+
/**
|
|
81
|
+
* @function returnProtectCollector - Creates a ProtectCollector object based on the provided field and index.
|
|
82
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
83
|
+
* @param {number} idx - The index to be used in the id of the ProtectCollector.
|
|
84
|
+
* @returns {ProtectCollector} The constructed ProtectCollector object.
|
|
85
|
+
*/
|
|
86
|
+
export declare function returnProtectCollector(field: ProtectField, idx: number): import("./collector.types.js").ProtectCollector;
|
|
87
|
+
/**
|
|
88
|
+
* @function returnFidoRegistrationCollector - Creates a FidoRegistrationCollector object based on the provided field and index.
|
|
89
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
90
|
+
* @param {number} idx - The index to be used in the id of the FidoRegistrationCollector.
|
|
91
|
+
* @returns {FidoRegistrationCollector} The constructed FidoRegistrationCollector object.
|
|
92
|
+
*/
|
|
93
|
+
export declare function returnFidoRegistrationCollector(field: FidoRegistrationField, idx: number): import("./collector.types.js").FidoRegistrationCollector | import("./collector.types.js").FidoAuthenticationCollector;
|
|
94
|
+
/**
|
|
95
|
+
* @function returnFidoAuthenticationCollector - Creates a FidoAuthenticationCollector object based on the provided field and index.
|
|
96
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
97
|
+
* @param {number} idx - The index to be used in the id of the FidoAuthenticationCollector.
|
|
98
|
+
* @returns {FidoAuthenticationCollector} The constructed FidoAuthenticationCollector object.
|
|
99
|
+
*/
|
|
100
|
+
export declare function returnFidoAuthenticationCollector(field: FidoAuthenticationField, idx: number): import("./collector.types.js").FidoRegistrationCollector | import("./collector.types.js").FidoAuthenticationCollector;
|
|
101
|
+
/**
|
|
102
|
+
* @function returnMultiValueCollector - Creates a MultiValueCollector object based on the provided field, index, and optional collector type.
|
|
103
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
104
|
+
* @param {number} idx - The index to be used in the id of the MultiValueCollector.
|
|
105
|
+
* @param {MultiValueCollectorTypes} [collectorType] - Optional type of the MultiValueCollector.
|
|
106
|
+
* @returns {MultiValueCollector} The constructed MultiValueCollector object.
|
|
107
|
+
*/
|
|
108
|
+
export declare function returnMultiValueCollector<Field extends MultiSelectField, CollectorType extends MultiValueCollectorTypes = 'MultiValueCollector'>(field: Field, idx: number, collectorType: CollectorType, data?: string[]): InferMultiValueCollectorType<CollectorType>;
|
|
109
|
+
/**
|
|
110
|
+
* @function returnMultiSelectCollector - Creates a DropDownCollector object based on the provided field and index.
|
|
111
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
112
|
+
* @param {number} idx - The index to be used in the id of the DropDownCollector.
|
|
113
|
+
* @returns {SingleValueCollector} The constructed DropDownCollector object.
|
|
114
|
+
*/
|
|
115
|
+
export declare function returnMultiSelectCollector(field: MultiSelectField, idx: number, data: string[]): import("./collector.types.js").MultiValueCollectorWithValue<"MultiSelectCollector">;
|
|
116
|
+
/**
|
|
117
|
+
* @function returnObjectCollector - Creates a ObjectCollector object based on the provided field, index, and optional collector type.
|
|
118
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
119
|
+
* @param {number} idx - The index to be used in the id of the ObjectCollector.
|
|
120
|
+
* @param {ObjectValueCollectorTypes} [collectorType] - Optional type of the ObjectCollector.
|
|
121
|
+
* @returns {ObjectCollector} The constructed ObjectCollector object.
|
|
122
|
+
*/
|
|
123
|
+
export declare function returnObjectCollector<Field extends DeviceAuthenticationField | DeviceRegistrationField | PhoneNumberField, CollectorType extends ObjectValueCollectorTypes = 'ObjectValueCollector'>(field: Field, idx: number, collectorType: CollectorType, prefillData?: PhoneNumberOutputValue): InferValueObjectCollectorType<CollectorType>;
|
|
124
|
+
/**
|
|
125
|
+
* @function returnObjectSelectCollector - Creates a DropDownCollector object based on the provided field and index.
|
|
126
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
127
|
+
* @param {number} idx - The index to be used in the id of the DropDownCollector.
|
|
128
|
+
* @returns {SingleValueCollector} The constructed DropDownCollector object.
|
|
129
|
+
*/
|
|
130
|
+
export declare function returnObjectSelectCollector(field: DeviceAuthenticationField | DeviceRegistrationField, idx: number): import("./collector.types.js").DeviceAuthenticationCollector | import("./collector.types.js").DeviceRegistrationCollector;
|
|
131
|
+
export declare function returnObjectValueCollector(field: PhoneNumberField, idx: number, prefillData: PhoneNumberOutputValue): import("./collector.types.js").PhoneNumberCollector;
|
|
132
|
+
/**
|
|
133
|
+
* @function returnNoValueCollector - Creates a NoValueCollector object based on the provided field, index, and optional collector type.
|
|
134
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
135
|
+
* @param {number} idx - The index to be used in the id of the NoValueCollector.
|
|
136
|
+
* @param {NoValueCollectorTypes} [collectorType] - Optional type of the NoValueCollector.
|
|
137
|
+
* @returns {NoValueCollector} The constructed NoValueCollector object.
|
|
138
|
+
*/
|
|
139
|
+
export declare function returnNoValueCollector<Field extends ReadOnlyField, CollectorType extends NoValueCollectorTypes = 'NoValueCollector'>(field: Field, idx: number, collectorType: CollectorType): InferNoValueCollectorType<CollectorType>;
|
|
140
|
+
/**
|
|
141
|
+
* @function returnReadOnlyCollector - Creates a ReadOnlyCollector object based on the provided field and index.
|
|
142
|
+
* @param {DaVinciField} field - The field object containing key, label, type, and links.
|
|
143
|
+
* @param {number} idx - The index to be used in the id of the ReadOnlyCollector.
|
|
144
|
+
* @returns {ReadOnlyCollector} The constructed ReadOnlyCollector object.
|
|
145
|
+
*/
|
|
146
|
+
export declare function returnReadOnlyCollector(field: ReadOnlyField, idx: number): import("./collector.types.js").NoValueCollectorBase<"ReadOnlyCollector">;
|
|
147
|
+
/**
|
|
148
|
+
* @function returnValidator - Creates a validator function based on the provided collector
|
|
149
|
+
* @param {ValidatedTextCollector | ObjectValueCollectors | MultiValueCollectors | AutoCollectors} collector - The collector to which the value will be validated
|
|
150
|
+
* @returns {function} - A "validator" function that validates the input value
|
|
151
|
+
*/
|
|
152
|
+
export declare function returnValidator(collector: ValidatedTextCollector | ObjectValueCollectors | MultiValueCollectors | AutoCollectors): (value: string | string[] | Record<string, unknown>) => string[];
|
|
153
|
+
export declare function returnUnknownCollector(field: Record<string, unknown>, idx: number): UnknownCollector;
|
|
154
|
+
//# sourceMappingURL=collector.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector.utils.d.ts","sourceRoot":"","sources":["../../../src/lib/collector.utils.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EAExB,qBAAqB,EACrB,yBAAyB,EACzB,sCAAsC,EACtC,sBAAsB,EACtB,6BAA6B,EAC7B,yBAAyB,EACzB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,SAAS,oBAAoB,EAC9E,KAAK,EAAE,aAAa,GAAG,aAAa,EACpC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,aAAa,GAC3B,gBAAgB,CA+ClB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,oBAEpE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,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