@opencrvs/toolkit 1.8.1-rc.8c25e85 → 1.8.1-rc.a372970
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/commons/api/router.d.ts +5078 -5910
- package/dist/commons/conditionals/conditionals.d.ts +13 -9
- package/dist/commons/conditionals/validate.d.ts +6 -15
- package/dist/commons/events/ActionConfig.d.ts +1718 -119315
- package/dist/commons/events/ActionDocument.d.ts +1325 -4879
- package/dist/commons/events/ActionInput.d.ts +1025 -3205
- package/dist/commons/events/ActionType.d.ts +1 -10
- package/dist/commons/events/AdvancedSearchConfig.d.ts +22 -1282
- package/dist/commons/events/CompositeFieldValue.d.ts +9 -40
- package/dist/commons/events/Draft.d.ts +97 -288
- package/dist/commons/events/EventConfig.d.ts +1359 -54365
- package/dist/commons/events/EventDocument.d.ts +833 -2720
- package/dist/commons/events/EventIndex.d.ts +29 -2228
- package/dist/commons/events/EventMetadata.d.ts +47 -347
- package/dist/commons/events/FieldConfig.d.ts +1250 -6746
- package/dist/commons/events/FieldType.d.ts +3 -8
- package/dist/commons/events/FieldTypeMapping.d.ts +73 -161
- package/dist/commons/events/FieldValue.d.ts +20 -91
- package/dist/commons/events/FormConfig.d.ts +533 -55781
- package/dist/commons/events/PageConfig.d.ts +208 -13824
- package/dist/commons/events/SummaryConfig.d.ts +42 -93
- package/dist/commons/events/User.d.ts +2 -34
- package/dist/commons/events/WorkqueueConfig.d.ts +20 -8116
- package/dist/commons/events/defineConfig.d.ts +99 -8551
- package/dist/commons/events/index.d.ts +0 -8
- package/dist/commons/events/test.utils.d.ts +90 -206
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +94 -15442
- package/dist/conditionals/index.js +56 -66
- package/dist/events/index.js +1835 -4707
- package/dist/scopes/index.d.ts +7 -184
- package/dist/scopes/index.js +40 -140
- package/package.json +3 -4
- package/dist/commons/events/Constants.d.ts +0 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +0 -4132
- package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +0 -53
- package/dist/commons/events/event.d.ts +0 -46
- package/dist/commons/events/field.d.ts +0 -94
- package/dist/commons/events/scopes.d.ts +0 -45
- package/dist/commons/events/serializer.d.ts +0 -2
- package/dist/commons/events/workqueueDefaultColumns.d.ts +0 -3
@@ -1,21 +1,16 @@
|
|
1
1
|
export declare const FieldType: {
|
2
|
-
readonly NAME: "NAME";
|
3
|
-
readonly PHONE: "PHONE";
|
4
|
-
readonly ID: "ID";
|
5
2
|
readonly ADDRESS: "ADDRESS";
|
6
3
|
readonly TEXT: "TEXT";
|
7
4
|
readonly NUMBER: "NUMBER";
|
8
5
|
readonly TEXTAREA: "TEXTAREA";
|
9
6
|
readonly EMAIL: "EMAIL";
|
10
7
|
readonly DATE: "DATE";
|
11
|
-
readonly DATE_RANGE: "DATE_RANGE";
|
12
|
-
readonly SELECT_DATE_RANGE: "SELECT_DATE_RANGE";
|
13
|
-
readonly TIME: "TIME";
|
14
8
|
readonly PARAGRAPH: "PARAGRAPH";
|
15
9
|
readonly PAGE_HEADER: "PAGE_HEADER";
|
16
10
|
readonly RADIO_GROUP: "RADIO_GROUP";
|
17
11
|
readonly FILE: "FILE";
|
18
12
|
readonly FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS";
|
13
|
+
readonly HIDDEN: "HIDDEN";
|
19
14
|
readonly BULLET_LIST: "BULLET_LIST";
|
20
15
|
readonly CHECKBOX: "CHECKBOX";
|
21
16
|
readonly SELECT: "SELECT";
|
@@ -28,10 +23,10 @@ export declare const FieldType: {
|
|
28
23
|
readonly SIGNATURE: "SIGNATURE";
|
29
24
|
readonly DATA: "DATA";
|
30
25
|
};
|
31
|
-
export declare const fieldTypes: ("
|
26
|
+
export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "HIDDEN" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[];
|
32
27
|
export type FieldType = (typeof fieldTypes)[number];
|
33
28
|
/**
|
34
29
|
* Composite field types are field types that consist of multiple field values.
|
35
30
|
*/
|
36
|
-
export declare const compositeFieldTypes: ("ADDRESS" | "
|
31
|
+
export declare const compositeFieldTypes: ("ADDRESS" | "FILE" | "FILE_WITH_OPTIONS")[];
|
37
32
|
//# sourceMappingURL=FieldType.d.ts.map
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField
|
2
|
+
import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField } from './FieldConfig';
|
3
3
|
import { FieldType } from './FieldType';
|
4
|
-
import { FieldValue, FieldUpdateValueSchema
|
5
|
-
import {
|
6
|
-
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue } from './CompositeFieldValue';
|
4
|
+
import { FieldValue, FieldUpdateValueSchema } from './FieldValue';
|
5
|
+
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue } from './CompositeFieldValue';
|
7
6
|
/**
|
8
7
|
* FieldTypeMapping.ts should include functions that map field types to different formats dynamically.
|
9
8
|
* File is separated from FieldType and FieldConfig to avoid circular dependencies.
|
@@ -20,78 +19,30 @@ type NullishFieldValueSchema = z.ZodOptional<z.ZodNullable<FieldUpdateValueSchem
|
|
20
19
|
* Useful for building dynamic validations against FieldConfig
|
21
20
|
*/
|
22
21
|
export declare function mapFieldTypeToZod(type: FieldType, required?: boolean): z.ZodString | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodObject<{
|
23
|
-
|
22
|
+
filename: z.ZodString;
|
24
23
|
originalFilename: z.ZodString;
|
25
24
|
type: z.ZodString;
|
26
25
|
}, "strip", z.ZodTypeAny, {
|
27
26
|
type: string;
|
28
|
-
|
27
|
+
filename: string;
|
29
28
|
originalFilename: string;
|
30
29
|
}, {
|
31
30
|
type: string;
|
32
|
-
|
31
|
+
filename: string;
|
33
32
|
originalFilename: string;
|
34
33
|
}> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
35
|
-
|
34
|
+
filename: z.ZodString;
|
36
35
|
originalFilename: z.ZodString;
|
37
36
|
type: z.ZodString;
|
38
37
|
}, "strip", z.ZodTypeAny, {
|
39
38
|
type: string;
|
40
|
-
|
39
|
+
filename: string;
|
41
40
|
originalFilename: string;
|
42
41
|
}, {
|
43
42
|
type: string;
|
44
|
-
|
43
|
+
filename: string;
|
45
44
|
originalFilename: string;
|
46
|
-
}>>> | z.ZodObject<{
|
47
|
-
firstname: z.ZodString;
|
48
|
-
surname: z.ZodString;
|
49
|
-
middlename: z.ZodOptional<z.ZodString>;
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
51
|
-
firstname: string;
|
52
|
-
surname: string;
|
53
|
-
middlename?: string | undefined;
|
54
|
-
}, {
|
55
|
-
firstname: string;
|
56
|
-
surname: string;
|
57
|
-
middlename?: string | undefined;
|
58
|
-
}> | z.ZodUndefined | z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
59
|
-
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
60
|
-
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
61
|
-
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
62
|
-
}, "strip", z.ZodTypeAny, {
|
63
|
-
firstname?: string | null | undefined;
|
64
|
-
surname?: string | null | undefined;
|
65
|
-
middlename?: string | null | undefined;
|
66
|
-
}, {
|
67
|
-
firstname?: string | null | undefined;
|
68
|
-
surname?: string | null | undefined;
|
69
|
-
middlename?: string | null | undefined;
|
70
|
-
}>, z.ZodNull]>, z.ZodUndefined]> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
71
|
-
firstname: z.ZodString;
|
72
|
-
surname: z.ZodString;
|
73
|
-
middlename: z.ZodOptional<z.ZodString>;
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
75
|
-
firstname: string;
|
76
|
-
surname: string;
|
77
|
-
middlename?: string | undefined;
|
78
|
-
}, {
|
79
|
-
firstname: string;
|
80
|
-
surname: string;
|
81
|
-
middlename?: string | undefined;
|
82
|
-
}>>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
83
|
-
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
84
|
-
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
85
|
-
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
86
|
-
}, "strip", z.ZodTypeAny, {
|
87
|
-
firstname?: string | null | undefined;
|
88
|
-
surname?: string | null | undefined;
|
89
|
-
middlename?: string | null | undefined;
|
90
|
-
}, {
|
91
|
-
firstname?: string | null | undefined;
|
92
|
-
surname?: string | null | undefined;
|
93
|
-
middlename?: string | null | undefined;
|
94
|
-
}>, z.ZodNull]>, z.ZodUndefined]>>> | z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
45
|
+
}>>> | z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
95
46
|
country: z.ZodString;
|
96
47
|
addressType: z.ZodLiteral<"DOMESTIC">;
|
97
48
|
province: z.ZodString;
|
@@ -178,54 +129,36 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
178
129
|
addressLine3?: string | null | undefined;
|
179
130
|
postcodeOrZip?: string | null | undefined;
|
180
131
|
}>]> | z.ZodArray<z.ZodObject<{
|
181
|
-
|
132
|
+
filename: z.ZodString;
|
182
133
|
originalFilename: z.ZodString;
|
183
134
|
type: z.ZodString;
|
184
135
|
option: z.ZodString;
|
185
136
|
}, "strip", z.ZodTypeAny, {
|
186
137
|
type: string;
|
187
138
|
option: string;
|
188
|
-
|
139
|
+
filename: string;
|
189
140
|
originalFilename: string;
|
190
141
|
}, {
|
191
142
|
type: string;
|
192
143
|
option: string;
|
193
|
-
|
144
|
+
filename: string;
|
194
145
|
originalFilename: string;
|
195
146
|
}>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
196
|
-
|
147
|
+
filename: z.ZodString;
|
197
148
|
originalFilename: z.ZodString;
|
198
149
|
type: z.ZodString;
|
199
150
|
option: z.ZodString;
|
200
151
|
}, "strip", z.ZodTypeAny, {
|
201
152
|
type: string;
|
202
153
|
option: string;
|
203
|
-
|
154
|
+
filename: string;
|
204
155
|
originalFilename: string;
|
205
156
|
}, {
|
206
157
|
type: string;
|
207
158
|
option: string;
|
208
|
-
|
159
|
+
filename: string;
|
209
160
|
originalFilename: string;
|
210
|
-
}>, "many">>> | z.
|
211
|
-
start: z.ZodString;
|
212
|
-
end: z.ZodString;
|
213
|
-
}, "strip", z.ZodTypeAny, {
|
214
|
-
start: string;
|
215
|
-
end: string;
|
216
|
-
}, {
|
217
|
-
start: string;
|
218
|
-
end: string;
|
219
|
-
}>, z.ZodString]> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
|
220
|
-
start: z.ZodString;
|
221
|
-
end: z.ZodString;
|
222
|
-
}, "strip", z.ZodTypeAny, {
|
223
|
-
start: string;
|
224
|
-
end: string;
|
225
|
-
}, {
|
226
|
-
start: string;
|
227
|
-
end: string;
|
228
|
-
}>, z.ZodString]>>> | z.ZodOptional<z.ZodNullable<z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
161
|
+
}>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodUndefined | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
229
162
|
country: z.ZodString;
|
230
163
|
addressType: z.ZodLiteral<"DOMESTIC">;
|
231
164
|
province: z.ZodString;
|
@@ -315,7 +248,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
315
248
|
export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
|
316
249
|
[x: string]: string | number | boolean | {
|
317
250
|
type: string;
|
318
|
-
|
251
|
+
filename: string;
|
319
252
|
originalFilename: string;
|
320
253
|
} | {
|
321
254
|
country: string;
|
@@ -328,14 +261,6 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
328
261
|
residentialArea?: string | null | undefined;
|
329
262
|
street?: string | null | undefined;
|
330
263
|
zipCode?: string | null | undefined;
|
331
|
-
} | {
|
332
|
-
firstname: string;
|
333
|
-
surname: string;
|
334
|
-
middlename?: string | undefined;
|
335
|
-
} | {
|
336
|
-
firstname?: string | null | undefined;
|
337
|
-
surname?: string | null | undefined;
|
338
|
-
middlename?: string | null | undefined;
|
339
264
|
} | {
|
340
265
|
country: string;
|
341
266
|
district: string;
|
@@ -356,16 +281,13 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
356
281
|
} | {
|
357
282
|
type: string;
|
358
283
|
option: string;
|
359
|
-
|
284
|
+
filename: string;
|
360
285
|
originalFilename: string;
|
361
|
-
}[] |
|
362
|
-
start: string;
|
363
|
-
end: string;
|
364
|
-
} | null | undefined;
|
286
|
+
}[] | null | undefined;
|
365
287
|
}, {
|
366
288
|
[x: string]: string | number | boolean | {
|
367
289
|
type: string;
|
368
|
-
|
290
|
+
filename: string;
|
369
291
|
originalFilename: string;
|
370
292
|
} | {
|
371
293
|
country: string;
|
@@ -378,14 +300,6 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
378
300
|
residentialArea?: string | null | undefined;
|
379
301
|
street?: string | null | undefined;
|
380
302
|
zipCode?: string | null | undefined;
|
381
|
-
} | {
|
382
|
-
firstname: string;
|
383
|
-
surname: string;
|
384
|
-
middlename?: string | undefined;
|
385
|
-
} | {
|
386
|
-
firstname?: string | null | undefined;
|
387
|
-
surname?: string | null | undefined;
|
388
|
-
middlename?: string | null | undefined;
|
389
303
|
} | {
|
390
304
|
country: string;
|
391
305
|
district: string;
|
@@ -406,13 +320,56 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
406
320
|
} | {
|
407
321
|
type: string;
|
408
322
|
option: string;
|
409
|
-
|
323
|
+
filename: string;
|
410
324
|
originalFilename: string;
|
411
|
-
}[] |
|
412
|
-
start: string;
|
413
|
-
end: string;
|
414
|
-
} | null | undefined;
|
325
|
+
}[] | null | undefined;
|
415
326
|
}>;
|
327
|
+
/**
|
328
|
+
* Quick-and-dirty mock data generator for event actions.
|
329
|
+
*/
|
330
|
+
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number): string | true | 19 | {
|
331
|
+
country: string;
|
332
|
+
addressType: "DOMESTIC";
|
333
|
+
province: string;
|
334
|
+
district: string;
|
335
|
+
urbanOrRural: string;
|
336
|
+
town: string;
|
337
|
+
residentialArea: string;
|
338
|
+
street: string;
|
339
|
+
number: string;
|
340
|
+
zipCode: string;
|
341
|
+
filename?: undefined;
|
342
|
+
originalFilename?: undefined;
|
343
|
+
type?: undefined;
|
344
|
+
} | {
|
345
|
+
filename: string;
|
346
|
+
originalFilename: string;
|
347
|
+
type: string;
|
348
|
+
country?: undefined;
|
349
|
+
addressType?: undefined;
|
350
|
+
province?: undefined;
|
351
|
+
district?: undefined;
|
352
|
+
urbanOrRural?: undefined;
|
353
|
+
town?: undefined;
|
354
|
+
residentialArea?: undefined;
|
355
|
+
street?: undefined;
|
356
|
+
number?: undefined;
|
357
|
+
zipCode?: undefined;
|
358
|
+
} | {
|
359
|
+
country?: undefined;
|
360
|
+
addressType?: undefined;
|
361
|
+
province?: undefined;
|
362
|
+
district?: undefined;
|
363
|
+
urbanOrRural?: undefined;
|
364
|
+
town?: undefined;
|
365
|
+
residentialArea?: undefined;
|
366
|
+
street?: undefined;
|
367
|
+
number?: undefined;
|
368
|
+
zipCode?: undefined;
|
369
|
+
filename?: undefined;
|
370
|
+
originalFilename?: undefined;
|
371
|
+
type?: undefined;
|
372
|
+
} | null;
|
416
373
|
/**
|
417
374
|
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
418
375
|
*/
|
@@ -427,11 +384,11 @@ export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] |
|
|
427
384
|
street: null;
|
428
385
|
number: null;
|
429
386
|
zipCode: null;
|
430
|
-
|
387
|
+
filename?: undefined;
|
431
388
|
originalFilename?: undefined;
|
432
389
|
type?: undefined;
|
433
390
|
} | {
|
434
|
-
|
391
|
+
filename: string;
|
435
392
|
originalFilename: string;
|
436
393
|
type: string;
|
437
394
|
country?: undefined;
|
@@ -459,27 +416,6 @@ export declare const isDateFieldType: (field: {
|
|
459
416
|
value: string;
|
460
417
|
config: DateField;
|
461
418
|
};
|
462
|
-
export declare const isTimeFieldType: (field: {
|
463
|
-
config: FieldConfig;
|
464
|
-
value: FieldValue;
|
465
|
-
}) => field is {
|
466
|
-
value: string;
|
467
|
-
config: TimeField;
|
468
|
-
};
|
469
|
-
export declare const isDateRangeFieldType: (field: {
|
470
|
-
config: FieldConfig;
|
471
|
-
value: FieldValue;
|
472
|
-
}) => field is {
|
473
|
-
value: DateRangeFieldValue;
|
474
|
-
config: DateRangeField;
|
475
|
-
};
|
476
|
-
export declare const isSelectDateRangeFieldType: (field: {
|
477
|
-
config: FieldConfig;
|
478
|
-
value: FieldValue;
|
479
|
-
}) => field is {
|
480
|
-
value: SelectDateRangeValue;
|
481
|
-
config: SelectDateRangeField;
|
482
|
-
};
|
483
419
|
export declare const isPageHeaderFieldType: (field: {
|
484
420
|
config: FieldConfig;
|
485
421
|
value: FieldValue;
|
@@ -501,27 +437,6 @@ export declare const isNumberFieldType: (field: {
|
|
501
437
|
value: number;
|
502
438
|
config: NumberField;
|
503
439
|
};
|
504
|
-
export declare const isNameFieldType: (field: {
|
505
|
-
config: FieldConfig;
|
506
|
-
value: FieldValue;
|
507
|
-
}) => field is {
|
508
|
-
value: NameFieldValue;
|
509
|
-
config: NameField;
|
510
|
-
};
|
511
|
-
export declare const isPhoneFieldType: (field: {
|
512
|
-
config: FieldConfig;
|
513
|
-
value: FieldValue;
|
514
|
-
}) => field is {
|
515
|
-
value: string;
|
516
|
-
config: PhoneField;
|
517
|
-
};
|
518
|
-
export declare const isIdFieldType: (field: {
|
519
|
-
config: FieldConfig;
|
520
|
-
value: FieldValue;
|
521
|
-
}) => field is {
|
522
|
-
value: string;
|
523
|
-
config: IdField;
|
524
|
-
};
|
525
440
|
export declare const isTextAreaFieldType: (field: {
|
526
441
|
config: FieldConfig;
|
527
442
|
value: FieldValue;
|
@@ -531,9 +446,9 @@ export declare const isTextAreaFieldType: (field: {
|
|
531
446
|
};
|
532
447
|
export declare const isSignatureFieldType: (field: {
|
533
448
|
config: FieldConfig;
|
534
|
-
value: FieldValue
|
449
|
+
value: FieldValue;
|
535
450
|
}) => field is {
|
536
|
-
value:
|
451
|
+
value: string;
|
537
452
|
config: SignatureField;
|
538
453
|
};
|
539
454
|
export declare const isEmailFieldType: (field: {
|
@@ -641,8 +556,5 @@ export declare const isDataFieldType: (field: {
|
|
641
556
|
value: undefined;
|
642
557
|
config: DataField;
|
643
558
|
};
|
644
|
-
export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField;
|
645
|
-
export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
|
646
|
-
export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
|
647
559
|
export {};
|
648
560
|
//# sourceMappingURL=FieldTypeMapping.d.ts.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue
|
2
|
+
import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue } from './CompositeFieldValue';
|
3
3
|
/**
|
4
4
|
* FieldValues defined in this file are primitive field values.
|
5
5
|
* FieldValues defined in CompositeFieldValue.ts are composed of multiple primitive field values (Address, File etc).
|
@@ -13,23 +13,8 @@ import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWi
|
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
export declare const TextValue: z.ZodString;
|
16
|
-
export declare const
|
16
|
+
export declare const RequiredTextValue: z.ZodString;
|
17
17
|
export declare const DateValue: z.ZodString;
|
18
|
-
export declare const TimeValue: z.ZodString;
|
19
|
-
export declare const DatetimeValue: z.ZodString;
|
20
|
-
export declare const SelectDateRangeValue: z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>;
|
21
|
-
export declare const DateRangeFieldValue: z.ZodUnion<[z.ZodObject<{
|
22
|
-
start: z.ZodString;
|
23
|
-
end: z.ZodString;
|
24
|
-
}, "strip", z.ZodTypeAny, {
|
25
|
-
start: string;
|
26
|
-
end: string;
|
27
|
-
}, {
|
28
|
-
start: string;
|
29
|
-
end: string;
|
30
|
-
}>, z.ZodString]>;
|
31
|
-
export type DateRangeFieldValue = z.infer<typeof DateRangeFieldValue>;
|
32
|
-
export type SelectDateRangeValue = z.infer<typeof SelectDateRangeValue>;
|
33
18
|
export declare const EmailValue: z.ZodString;
|
34
19
|
export declare const CheckboxFieldValue: z.ZodBoolean;
|
35
20
|
export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
|
@@ -37,43 +22,32 @@ export declare const NumberFieldValue: z.ZodNumber;
|
|
37
22
|
export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
|
38
23
|
export declare const DataFieldValue: z.ZodUndefined;
|
39
24
|
export type DataFieldValue = z.infer<typeof DataFieldValue>;
|
40
|
-
export declare const
|
41
|
-
|
42
|
-
export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
|
43
|
-
start: z.ZodString;
|
44
|
-
end: z.ZodString;
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
46
|
-
start: string;
|
47
|
-
end: string;
|
48
|
-
}, {
|
49
|
-
start: string;
|
50
|
-
end: string;
|
51
|
-
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
52
|
-
path: z.ZodEffects<z.ZodString, string, string>;
|
25
|
+
export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
26
|
+
filename: z.ZodString;
|
53
27
|
originalFilename: z.ZodString;
|
54
28
|
type: z.ZodString;
|
55
29
|
}, "strip", z.ZodTypeAny, {
|
56
30
|
type: string;
|
57
|
-
|
31
|
+
filename: string;
|
58
32
|
originalFilename: string;
|
59
33
|
}, {
|
60
34
|
type: string;
|
61
|
-
|
35
|
+
filename: string;
|
62
36
|
originalFilename: string;
|
63
37
|
}>, z.ZodArray<z.ZodObject<{
|
64
|
-
|
38
|
+
filename: z.ZodString;
|
65
39
|
originalFilename: z.ZodString;
|
66
40
|
type: z.ZodString;
|
67
41
|
option: z.ZodString;
|
68
42
|
}, "strip", z.ZodTypeAny, {
|
69
43
|
type: string;
|
70
44
|
option: string;
|
71
|
-
|
45
|
+
filename: string;
|
72
46
|
originalFilename: string;
|
73
47
|
}, {
|
74
48
|
type: string;
|
75
49
|
option: string;
|
76
|
-
|
50
|
+
filename: string;
|
77
51
|
originalFilename: string;
|
78
52
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
79
53
|
country: z.ZodString;
|
@@ -161,67 +135,34 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodStri
|
|
161
135
|
addressLine2?: string | undefined;
|
162
136
|
addressLine3?: string | undefined;
|
163
137
|
postcodeOrZip?: string | undefined;
|
164
|
-
}
|
165
|
-
firstname: z.ZodString;
|
166
|
-
surname: z.ZodString;
|
167
|
-
middlename: z.ZodOptional<z.ZodString>;
|
168
|
-
}, "strip", z.ZodTypeAny, {
|
169
|
-
firstname: string;
|
170
|
-
surname: string;
|
171
|
-
middlename?: string | undefined;
|
172
|
-
}, {
|
173
|
-
firstname: string;
|
174
|
-
surname: string;
|
175
|
-
middlename?: string | undefined;
|
176
|
-
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
177
|
-
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
178
|
-
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
179
|
-
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
180
|
-
}, "strip", z.ZodTypeAny, {
|
181
|
-
firstname?: string | null | undefined;
|
182
|
-
surname?: string | null | undefined;
|
183
|
-
middlename?: string | null | undefined;
|
184
|
-
}, {
|
185
|
-
firstname?: string | null | undefined;
|
186
|
-
surname?: string | null | undefined;
|
187
|
-
middlename?: string | null | undefined;
|
188
|
-
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
138
|
+
}>]>;
|
189
139
|
export type FieldValue = z.infer<typeof FieldValue>;
|
190
|
-
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.
|
191
|
-
|
192
|
-
end: z.ZodString;
|
193
|
-
}, "strip", z.ZodTypeAny, {
|
194
|
-
start: string;
|
195
|
-
end: string;
|
196
|
-
}, {
|
197
|
-
start: string;
|
198
|
-
end: string;
|
199
|
-
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
200
|
-
path: z.ZodEffects<z.ZodString, string, string>;
|
140
|
+
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
141
|
+
filename: z.ZodString;
|
201
142
|
originalFilename: z.ZodString;
|
202
143
|
type: z.ZodString;
|
203
144
|
}, "strip", z.ZodTypeAny, {
|
204
145
|
type: string;
|
205
|
-
|
146
|
+
filename: string;
|
206
147
|
originalFilename: string;
|
207
148
|
}, {
|
208
149
|
type: string;
|
209
|
-
|
150
|
+
filename: string;
|
210
151
|
originalFilename: string;
|
211
152
|
}>, z.ZodArray<z.ZodObject<{
|
212
|
-
|
153
|
+
filename: z.ZodString;
|
213
154
|
originalFilename: z.ZodString;
|
214
155
|
type: z.ZodString;
|
215
156
|
option: z.ZodString;
|
216
157
|
}, "strip", z.ZodTypeAny, {
|
217
158
|
type: string;
|
218
159
|
option: string;
|
219
|
-
|
160
|
+
filename: string;
|
220
161
|
originalFilename: string;
|
221
162
|
}, {
|
222
163
|
type: string;
|
223
164
|
option: string;
|
224
|
-
|
165
|
+
filename: string;
|
225
166
|
originalFilename: string;
|
226
167
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
227
168
|
country: z.ZodString;
|
@@ -309,28 +250,16 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
309
250
|
addressLine2?: string | null | undefined;
|
310
251
|
addressLine3?: string | null | undefined;
|
311
252
|
postcodeOrZip?: string | null | undefined;
|
312
|
-
}
|
313
|
-
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
314
|
-
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
315
|
-
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
316
|
-
}, "strip", z.ZodTypeAny, {
|
317
|
-
firstname?: string | null | undefined;
|
318
|
-
surname?: string | null | undefined;
|
319
|
-
middlename?: string | null | undefined;
|
320
|
-
}, {
|
321
|
-
firstname?: string | null | undefined;
|
322
|
-
surname?: string | null | undefined;
|
323
|
-
middlename?: string | null | undefined;
|
324
|
-
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
253
|
+
}>]>;
|
325
254
|
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
326
255
|
/**
|
327
256
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
328
257
|
* */
|
329
|
-
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue |
|
258
|
+
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
|
330
259
|
/**
|
331
260
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
332
261
|
*
|
333
262
|
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
334
263
|
* */
|
335
|
-
export type FieldUpdateValueSchema = typeof
|
264
|
+
export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
|
336
265
|
//# sourceMappingURL=FieldValue.d.ts.map
|