@opencrvs/toolkit 1.8.0-rc.ffb4f66 → 1.8.0-rc.ffd355c
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 +7113 -1422
- package/dist/commons/conditionals/conditionals.d.ts +9 -13
- package/dist/commons/conditionals/validate.d.ts +10 -6
- package/dist/commons/events/ActionConfig.d.ts +125119 -1726
- package/dist/commons/events/ActionDocument.d.ts +4319 -1254
- package/dist/commons/events/ActionInput.d.ts +3205 -1025
- package/dist/commons/events/ActionType.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1260 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +40 -9
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4132 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +288 -97
- package/dist/commons/events/EventConfig.d.ts +60211 -1356
- package/dist/commons/events/EventDocument.d.ts +2719 -832
- package/dist/commons/events/EventIndex.d.ts +2226 -27
- package/dist/commons/events/EventMetadata.d.ts +343 -45
- package/dist/commons/events/FieldConfig.d.ts +5993 -1044
- package/dist/commons/events/FieldType.d.ts +7 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +154 -73
- package/dist/commons/events/FieldValue.d.ts +90 -20
- package/dist/commons/events/FormConfig.d.ts +52392 -510
- package/dist/commons/events/PageConfig.d.ts +13003 -209
- package/dist/commons/events/SummaryConfig.d.ts +93 -42
- package/dist/commons/events/User.d.ts +34 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +8116 -20
- package/dist/commons/events/defineConfig.d.ts +9683 -58
- package/dist/commons/events/event.d.ts +46 -0
- package/dist/commons/events/field.d.ts +82 -0
- package/dist/commons/events/index.d.ts +8 -0
- package/dist/commons/events/scopes.d.ts +44 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +206 -90
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +16154 -88
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +65 -54
- package/dist/events/index.js +4517 -1748
- package/dist/scopes/index.d.ts +247 -1
- package/dist/scopes/index.js +231 -1
- package/package.json +4 -3
@@ -1,16 +1,20 @@
|
|
1
1
|
export declare const FieldType: {
|
2
|
+
readonly NAME: "NAME";
|
3
|
+
readonly PHONE: "PHONE";
|
4
|
+
readonly ID: "ID";
|
2
5
|
readonly ADDRESS: "ADDRESS";
|
3
6
|
readonly TEXT: "TEXT";
|
4
7
|
readonly NUMBER: "NUMBER";
|
5
8
|
readonly TEXTAREA: "TEXTAREA";
|
6
9
|
readonly EMAIL: "EMAIL";
|
7
10
|
readonly DATE: "DATE";
|
11
|
+
readonly DATE_RANGE: "DATE_RANGE";
|
12
|
+
readonly SELECT_DATE_RANGE: "SELECT_DATE_RANGE";
|
8
13
|
readonly PARAGRAPH: "PARAGRAPH";
|
9
14
|
readonly PAGE_HEADER: "PAGE_HEADER";
|
10
15
|
readonly RADIO_GROUP: "RADIO_GROUP";
|
11
16
|
readonly FILE: "FILE";
|
12
17
|
readonly FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS";
|
13
|
-
readonly HIDDEN: "HIDDEN";
|
14
18
|
readonly BULLET_LIST: "BULLET_LIST";
|
15
19
|
readonly CHECKBOX: "CHECKBOX";
|
16
20
|
readonly SELECT: "SELECT";
|
@@ -23,10 +27,10 @@ export declare const FieldType: {
|
|
23
27
|
readonly SIGNATURE: "SIGNATURE";
|
24
28
|
readonly DATA: "DATA";
|
25
29
|
};
|
26
|
-
export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "
|
30
|
+
export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[];
|
27
31
|
export type FieldType = (typeof fieldTypes)[number];
|
28
32
|
/**
|
29
33
|
* Composite field types are field types that consist of multiple field values.
|
30
34
|
*/
|
31
|
-
export declare const compositeFieldTypes: ("ADDRESS" | "FILE" | "FILE_WITH_OPTIONS")[];
|
35
|
+
export declare const compositeFieldTypes: ("ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS")[];
|
32
36
|
//# sourceMappingURL=FieldType.d.ts.map
|
@@ -1,8 +1,9 @@
|
|
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 } from './FieldConfig';
|
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, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField } from './FieldConfig';
|
3
3
|
import { FieldType } from './FieldType';
|
4
|
-
import { FieldValue, FieldUpdateValueSchema } from './FieldValue';
|
5
|
-
import {
|
4
|
+
import { FieldValue, FieldUpdateValueSchema, DateRangeFieldValue, SelectDateRangeValue } from './FieldValue';
|
5
|
+
import { FullDocumentPath } from '../documents';
|
6
|
+
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue } from './CompositeFieldValue';
|
6
7
|
/**
|
7
8
|
* FieldTypeMapping.ts should include functions that map field types to different formats dynamically.
|
8
9
|
* File is separated from FieldType and FieldConfig to avoid circular dependencies.
|
@@ -19,30 +20,78 @@ type NullishFieldValueSchema = z.ZodOptional<z.ZodNullable<FieldUpdateValueSchem
|
|
19
20
|
* Useful for building dynamic validations against FieldConfig
|
20
21
|
*/
|
21
22
|
export declare function mapFieldTypeToZod(type: FieldType, required?: boolean): z.ZodString | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodObject<{
|
22
|
-
|
23
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
23
24
|
originalFilename: z.ZodString;
|
24
25
|
type: z.ZodString;
|
25
26
|
}, "strip", z.ZodTypeAny, {
|
26
27
|
type: string;
|
27
|
-
|
28
|
+
path: string;
|
28
29
|
originalFilename: string;
|
29
30
|
}, {
|
30
31
|
type: string;
|
31
|
-
|
32
|
+
path: string;
|
32
33
|
originalFilename: string;
|
33
34
|
}> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
34
|
-
|
35
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
35
36
|
originalFilename: z.ZodString;
|
36
37
|
type: z.ZodString;
|
37
38
|
}, "strip", z.ZodTypeAny, {
|
38
39
|
type: string;
|
39
|
-
|
40
|
+
path: string;
|
40
41
|
originalFilename: string;
|
41
42
|
}, {
|
42
43
|
type: string;
|
43
|
-
|
44
|
+
path: string;
|
44
45
|
originalFilename: string;
|
45
|
-
}>>> | z.
|
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<{
|
46
95
|
country: z.ZodString;
|
47
96
|
addressType: z.ZodLiteral<"DOMESTIC">;
|
48
97
|
province: z.ZodString;
|
@@ -129,36 +178,54 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
129
178
|
addressLine3?: string | null | undefined;
|
130
179
|
postcodeOrZip?: string | null | undefined;
|
131
180
|
}>]> | z.ZodArray<z.ZodObject<{
|
132
|
-
|
181
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
133
182
|
originalFilename: z.ZodString;
|
134
183
|
type: z.ZodString;
|
135
184
|
option: z.ZodString;
|
136
185
|
}, "strip", z.ZodTypeAny, {
|
137
186
|
type: string;
|
138
187
|
option: string;
|
139
|
-
|
188
|
+
path: string;
|
140
189
|
originalFilename: string;
|
141
190
|
}, {
|
142
191
|
type: string;
|
143
192
|
option: string;
|
144
|
-
|
193
|
+
path: string;
|
145
194
|
originalFilename: string;
|
146
195
|
}>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
147
|
-
|
196
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
148
197
|
originalFilename: z.ZodString;
|
149
198
|
type: z.ZodString;
|
150
199
|
option: z.ZodString;
|
151
200
|
}, "strip", z.ZodTypeAny, {
|
152
201
|
type: string;
|
153
202
|
option: string;
|
154
|
-
|
203
|
+
path: string;
|
155
204
|
originalFilename: string;
|
156
205
|
}, {
|
157
206
|
type: string;
|
158
207
|
option: string;
|
159
|
-
|
208
|
+
path: string;
|
160
209
|
originalFilename: string;
|
161
|
-
}>, "many">>> | z.
|
210
|
+
}>, "many">>> | z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]> | z.ZodUnion<[z.ZodObject<{
|
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<{
|
162
229
|
country: z.ZodString;
|
163
230
|
addressType: z.ZodLiteral<"DOMESTIC">;
|
164
231
|
province: z.ZodString;
|
@@ -248,7 +315,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
248
315
|
export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
|
249
316
|
[x: string]: string | number | boolean | {
|
250
317
|
type: string;
|
251
|
-
|
318
|
+
path: string;
|
252
319
|
originalFilename: string;
|
253
320
|
} | {
|
254
321
|
country: string;
|
@@ -261,6 +328,14 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
261
328
|
residentialArea?: string | null | undefined;
|
262
329
|
street?: string | null | undefined;
|
263
330
|
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;
|
264
339
|
} | {
|
265
340
|
country: string;
|
266
341
|
district: string;
|
@@ -281,13 +356,16 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
281
356
|
} | {
|
282
357
|
type: string;
|
283
358
|
option: string;
|
284
|
-
|
359
|
+
path: string;
|
285
360
|
originalFilename: string;
|
286
|
-
}[] |
|
361
|
+
}[] | {
|
362
|
+
start: string;
|
363
|
+
end: string;
|
364
|
+
} | null | undefined;
|
287
365
|
}, {
|
288
366
|
[x: string]: string | number | boolean | {
|
289
367
|
type: string;
|
290
|
-
|
368
|
+
path: string;
|
291
369
|
originalFilename: string;
|
292
370
|
} | {
|
293
371
|
country: string;
|
@@ -300,6 +378,14 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
300
378
|
residentialArea?: string | null | undefined;
|
301
379
|
street?: string | null | undefined;
|
302
380
|
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;
|
303
389
|
} | {
|
304
390
|
country: string;
|
305
391
|
district: string;
|
@@ -320,56 +406,13 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
320
406
|
} | {
|
321
407
|
type: string;
|
322
408
|
option: string;
|
323
|
-
|
409
|
+
path: string;
|
324
410
|
originalFilename: string;
|
325
|
-
}[] |
|
411
|
+
}[] | {
|
412
|
+
start: string;
|
413
|
+
end: string;
|
414
|
+
} | null | undefined;
|
326
415
|
}>;
|
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;
|
373
416
|
/**
|
374
417
|
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
375
418
|
*/
|
@@ -384,11 +427,11 @@ export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] |
|
|
384
427
|
street: null;
|
385
428
|
number: null;
|
386
429
|
zipCode: null;
|
387
|
-
|
430
|
+
path?: undefined;
|
388
431
|
originalFilename?: undefined;
|
389
432
|
type?: undefined;
|
390
433
|
} | {
|
391
|
-
|
434
|
+
path: FullDocumentPath;
|
392
435
|
originalFilename: string;
|
393
436
|
type: string;
|
394
437
|
country?: undefined;
|
@@ -416,6 +459,20 @@ export declare const isDateFieldType: (field: {
|
|
416
459
|
value: string;
|
417
460
|
config: DateField;
|
418
461
|
};
|
462
|
+
export declare const isDateRangeFieldType: (field: {
|
463
|
+
config: FieldConfig;
|
464
|
+
value: FieldValue;
|
465
|
+
}) => field is {
|
466
|
+
value: DateRangeFieldValue;
|
467
|
+
config: DateRangeField;
|
468
|
+
};
|
469
|
+
export declare const isSelectDateRangeFieldType: (field: {
|
470
|
+
config: FieldConfig;
|
471
|
+
value: FieldValue;
|
472
|
+
}) => field is {
|
473
|
+
value: SelectDateRangeValue;
|
474
|
+
config: SelectDateRangeField;
|
475
|
+
};
|
419
476
|
export declare const isPageHeaderFieldType: (field: {
|
420
477
|
config: FieldConfig;
|
421
478
|
value: FieldValue;
|
@@ -437,6 +494,27 @@ export declare const isNumberFieldType: (field: {
|
|
437
494
|
value: number;
|
438
495
|
config: NumberField;
|
439
496
|
};
|
497
|
+
export declare const isNameFieldType: (field: {
|
498
|
+
config: FieldConfig;
|
499
|
+
value: FieldValue;
|
500
|
+
}) => field is {
|
501
|
+
value: NameFieldValue;
|
502
|
+
config: NameField;
|
503
|
+
};
|
504
|
+
export declare const isPhoneFieldType: (field: {
|
505
|
+
config: FieldConfig;
|
506
|
+
value: FieldValue;
|
507
|
+
}) => field is {
|
508
|
+
value: string;
|
509
|
+
config: PhoneField;
|
510
|
+
};
|
511
|
+
export declare const isIdFieldType: (field: {
|
512
|
+
config: FieldConfig;
|
513
|
+
value: FieldValue;
|
514
|
+
}) => field is {
|
515
|
+
value: string;
|
516
|
+
config: IdField;
|
517
|
+
};
|
440
518
|
export declare const isTextAreaFieldType: (field: {
|
441
519
|
config: FieldConfig;
|
442
520
|
value: FieldValue;
|
@@ -446,9 +524,9 @@ export declare const isTextAreaFieldType: (field: {
|
|
446
524
|
};
|
447
525
|
export declare const isSignatureFieldType: (field: {
|
448
526
|
config: FieldConfig;
|
449
|
-
value: FieldValue;
|
527
|
+
value: FieldValue | undefined;
|
450
528
|
}) => field is {
|
451
|
-
value:
|
529
|
+
value: FileFieldValue | undefined;
|
452
530
|
config: SignatureField;
|
453
531
|
};
|
454
532
|
export declare const isEmailFieldType: (field: {
|
@@ -556,5 +634,8 @@ export declare const isDataFieldType: (field: {
|
|
556
634
|
value: undefined;
|
557
635
|
config: DataField;
|
558
636
|
};
|
637
|
+
export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField;
|
638
|
+
export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
|
639
|
+
export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
|
559
640
|
export {};
|
560
641
|
//# sourceMappingURL=FieldTypeMapping.d.ts.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue } from './CompositeFieldValue';
|
2
|
+
import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue, NameFieldUpdateValue } 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,8 +13,22 @@ 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 NonEmptyTextValue: z.ZodString;
|
17
17
|
export declare const DateValue: z.ZodString;
|
18
|
+
export declare const DatetimeValue: z.ZodString;
|
19
|
+
export declare const SelectDateRangeValue: z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>;
|
20
|
+
export declare const DateRangeFieldValue: z.ZodUnion<[z.ZodObject<{
|
21
|
+
start: z.ZodString;
|
22
|
+
end: z.ZodString;
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
24
|
+
start: string;
|
25
|
+
end: string;
|
26
|
+
}, {
|
27
|
+
start: string;
|
28
|
+
end: string;
|
29
|
+
}>, z.ZodString]>;
|
30
|
+
export type DateRangeFieldValue = z.infer<typeof DateRangeFieldValue>;
|
31
|
+
export type SelectDateRangeValue = z.infer<typeof SelectDateRangeValue>;
|
18
32
|
export declare const EmailValue: z.ZodString;
|
19
33
|
export declare const CheckboxFieldValue: z.ZodBoolean;
|
20
34
|
export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
|
@@ -22,32 +36,43 @@ export declare const NumberFieldValue: z.ZodNumber;
|
|
22
36
|
export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
|
23
37
|
export declare const DataFieldValue: z.ZodUndefined;
|
24
38
|
export type DataFieldValue = z.infer<typeof DataFieldValue>;
|
25
|
-
export declare const
|
26
|
-
|
39
|
+
export declare const SignatureFieldValue: z.ZodString;
|
40
|
+
export type SignatureFieldValue = z.infer<typeof SignatureFieldValue>;
|
41
|
+
export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
|
42
|
+
start: z.ZodString;
|
43
|
+
end: z.ZodString;
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
45
|
+
start: string;
|
46
|
+
end: string;
|
47
|
+
}, {
|
48
|
+
start: string;
|
49
|
+
end: string;
|
50
|
+
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
51
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
27
52
|
originalFilename: z.ZodString;
|
28
53
|
type: z.ZodString;
|
29
54
|
}, "strip", z.ZodTypeAny, {
|
30
55
|
type: string;
|
31
|
-
|
56
|
+
path: string;
|
32
57
|
originalFilename: string;
|
33
58
|
}, {
|
34
59
|
type: string;
|
35
|
-
|
60
|
+
path: string;
|
36
61
|
originalFilename: string;
|
37
62
|
}>, z.ZodArray<z.ZodObject<{
|
38
|
-
|
63
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
39
64
|
originalFilename: z.ZodString;
|
40
65
|
type: z.ZodString;
|
41
66
|
option: z.ZodString;
|
42
67
|
}, "strip", z.ZodTypeAny, {
|
43
68
|
type: string;
|
44
69
|
option: string;
|
45
|
-
|
70
|
+
path: string;
|
46
71
|
originalFilename: string;
|
47
72
|
}, {
|
48
73
|
type: string;
|
49
74
|
option: string;
|
50
|
-
|
75
|
+
path: string;
|
51
76
|
originalFilename: string;
|
52
77
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
53
78
|
country: z.ZodString;
|
@@ -135,34 +160,67 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
135
160
|
addressLine2?: string | undefined;
|
136
161
|
addressLine3?: string | undefined;
|
137
162
|
postcodeOrZip?: string | undefined;
|
138
|
-
}
|
163
|
+
}>, z.ZodObject<{
|
164
|
+
firstname: z.ZodString;
|
165
|
+
surname: z.ZodString;
|
166
|
+
middlename: z.ZodOptional<z.ZodString>;
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
168
|
+
firstname: string;
|
169
|
+
surname: string;
|
170
|
+
middlename?: string | undefined;
|
171
|
+
}, {
|
172
|
+
firstname: string;
|
173
|
+
surname: string;
|
174
|
+
middlename?: string | undefined;
|
175
|
+
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
176
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
177
|
+
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
178
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
180
|
+
firstname?: string | null | undefined;
|
181
|
+
surname?: string | null | undefined;
|
182
|
+
middlename?: string | null | undefined;
|
183
|
+
}, {
|
184
|
+
firstname?: string | null | undefined;
|
185
|
+
surname?: string | null | undefined;
|
186
|
+
middlename?: string | null | undefined;
|
187
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
139
188
|
export type FieldValue = z.infer<typeof FieldValue>;
|
140
|
-
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.
|
141
|
-
|
189
|
+
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
|
190
|
+
start: z.ZodString;
|
191
|
+
end: z.ZodString;
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
193
|
+
start: string;
|
194
|
+
end: string;
|
195
|
+
}, {
|
196
|
+
start: string;
|
197
|
+
end: string;
|
198
|
+
}>, z.ZodString]>, z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
199
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
142
200
|
originalFilename: z.ZodString;
|
143
201
|
type: z.ZodString;
|
144
202
|
}, "strip", z.ZodTypeAny, {
|
145
203
|
type: string;
|
146
|
-
|
204
|
+
path: string;
|
147
205
|
originalFilename: string;
|
148
206
|
}, {
|
149
207
|
type: string;
|
150
|
-
|
208
|
+
path: string;
|
151
209
|
originalFilename: string;
|
152
210
|
}>, z.ZodArray<z.ZodObject<{
|
153
|
-
|
211
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
154
212
|
originalFilename: z.ZodString;
|
155
213
|
type: z.ZodString;
|
156
214
|
option: z.ZodString;
|
157
215
|
}, "strip", z.ZodTypeAny, {
|
158
216
|
type: string;
|
159
217
|
option: string;
|
160
|
-
|
218
|
+
path: string;
|
161
219
|
originalFilename: string;
|
162
220
|
}, {
|
163
221
|
type: string;
|
164
222
|
option: string;
|
165
|
-
|
223
|
+
path: string;
|
166
224
|
originalFilename: string;
|
167
225
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
168
226
|
country: z.ZodString;
|
@@ -250,16 +308,28 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
250
308
|
addressLine2?: string | null | undefined;
|
251
309
|
addressLine3?: string | null | undefined;
|
252
310
|
postcodeOrZip?: string | null | undefined;
|
253
|
-
}
|
311
|
+
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
312
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
313
|
+
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
314
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
315
|
+
}, "strip", z.ZodTypeAny, {
|
316
|
+
firstname?: string | null | undefined;
|
317
|
+
surname?: string | null | undefined;
|
318
|
+
middlename?: string | null | undefined;
|
319
|
+
}, {
|
320
|
+
firstname?: string | null | undefined;
|
321
|
+
surname?: string | null | undefined;
|
322
|
+
middlename?: string | null | undefined;
|
323
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
254
324
|
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
255
325
|
/**
|
256
326
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
257
327
|
* */
|
258
|
-
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
|
328
|
+
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | z.ZodString | z.ZodBoolean;
|
259
329
|
/**
|
260
330
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
261
331
|
*
|
262
332
|
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
263
333
|
* */
|
264
|
-
export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
|
334
|
+
export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof SelectDateRangeValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | typeof NameFieldUpdateValue | z.ZodString | z.ZodBoolean;
|
265
335
|
//# sourceMappingURL=FieldValue.d.ts.map
|