@opencrvs/toolkit 1.8.0-rc.fcd89ec → 1.8.0-rc.fcf7cb3
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 +8046 -8610
- package/dist/commons/conditionals/conditionals.d.ts +8 -15
- package/dist/commons/conditionals/validate.d.ts +14 -0
- package/dist/commons/events/ActionConfig.d.ts +68541 -36072
- package/dist/commons/events/ActionDocument.d.ts +3961 -1227
- package/dist/commons/events/ActionInput.d.ts +3138 -966
- package/dist/commons/events/ActionType.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +414 -71
- package/dist/commons/events/CompositeFieldValue.d.ts +37 -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 +1 -2
- package/dist/commons/events/Draft.d.ts +271 -93
- package/dist/commons/events/EventConfig.d.ts +33783 -18386
- package/dist/commons/events/EventDocument.d.ts +2522 -816
- package/dist/commons/events/EventIndex.d.ts +1411 -313
- package/dist/commons/events/EventInput.d.ts +0 -13
- package/dist/commons/events/EventMetadata.d.ts +113 -76
- package/dist/commons/events/FieldConfig.d.ts +4017 -1558
- package/dist/commons/events/FieldType.d.ts +10 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +149 -75
- package/dist/commons/events/FieldValue.d.ts +87 -20
- package/dist/commons/events/FormConfig.d.ts +18663 -8055
- package/dist/commons/events/PageConfig.d.ts +4601 -1945
- package/dist/commons/events/SummaryConfig.d.ts +0 -5
- package/dist/commons/events/User.d.ts +34 -7
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +7802 -308
- package/dist/commons/events/defineConfig.d.ts +3535 -860
- package/dist/commons/events/event.d.ts +21 -21
- package/dist/commons/events/field.d.ts +36 -10
- package/dist/commons/events/index.d.ts +5 -0
- package/dist/commons/events/scopes.d.ts +1 -2
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +206 -52
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +14324 -1570
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +70 -62
- package/dist/events/index.js +3527 -1656
- package/dist/scopes/index.d.ts +96 -7
- package/dist/scopes/index.js +105 -26
- package/package.json +3 -3
- package/tsconfig.json +1 -1
- package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
- package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
- package/dist/commons/conditionals/validate.test.d.ts +0 -2
- package/dist/commons/events/utils.test.d.ts +0 -2
@@ -1,4 +1,8 @@
|
|
1
|
+
import { z } from 'zod';
|
1
2
|
export declare const FieldType: {
|
3
|
+
readonly NAME: "NAME";
|
4
|
+
readonly PHONE: "PHONE";
|
5
|
+
readonly ID: "ID";
|
2
6
|
readonly ADDRESS: "ADDRESS";
|
3
7
|
readonly TEXT: "TEXT";
|
4
8
|
readonly NUMBER: "NUMBER";
|
@@ -6,6 +10,7 @@ export declare const FieldType: {
|
|
6
10
|
readonly EMAIL: "EMAIL";
|
7
11
|
readonly DATE: "DATE";
|
8
12
|
readonly DATE_RANGE: "DATE_RANGE";
|
13
|
+
readonly SELECT_DATE_RANGE: "SELECT_DATE_RANGE";
|
9
14
|
readonly PARAGRAPH: "PARAGRAPH";
|
10
15
|
readonly PAGE_HEADER: "PAGE_HEADER";
|
11
16
|
readonly RADIO_GROUP: "RADIO_GROUP";
|
@@ -23,7 +28,11 @@ export declare const FieldType: {
|
|
23
28
|
readonly SIGNATURE: "SIGNATURE";
|
24
29
|
readonly DATA: "DATA";
|
25
30
|
};
|
26
|
-
|
31
|
+
/**
|
32
|
+
* Union of types that handle files. Using common type should help with compiler to know where to add new cases.
|
33
|
+
*/
|
34
|
+
export declare const FileFieldType: z.ZodEnum<["FILE", "FILE_WITH_OPTIONS", "SIGNATURE"]>;
|
35
|
+
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
36
|
export type FieldType = (typeof fieldTypes)[number];
|
28
37
|
/**
|
29
38
|
* Composite field types are field types that consist of multiple field values.
|
@@ -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.ZodString;
|
60
|
+
surname: z.ZodString;
|
61
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
63
|
+
firstname: string;
|
64
|
+
surname: string;
|
65
|
+
middlename?: string | null | undefined;
|
66
|
+
}, {
|
67
|
+
firstname: string;
|
68
|
+
surname: string;
|
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.ZodString;
|
84
|
+
surname: z.ZodString;
|
85
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
87
|
+
firstname: string;
|
88
|
+
surname: string;
|
89
|
+
middlename?: string | null | undefined;
|
90
|
+
}, {
|
91
|
+
firstname: string;
|
92
|
+
surname: string;
|
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;
|
337
|
+
surname: string;
|
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;
|
387
|
+
surname: string;
|
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 | string[] | 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;
|
@@ -420,8 +463,15 @@ export declare const isDateRangeFieldType: (field: {
|
|
420
463
|
config: FieldConfig;
|
421
464
|
value: FieldValue;
|
422
465
|
}) => field is {
|
423
|
-
value:
|
424
|
-
config:
|
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;
|
425
475
|
};
|
426
476
|
export declare const isPageHeaderFieldType: (field: {
|
427
477
|
config: FieldConfig;
|
@@ -444,6 +494,27 @@ export declare const isNumberFieldType: (field: {
|
|
444
494
|
value: number;
|
445
495
|
config: NumberField;
|
446
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
|
+
};
|
447
518
|
export declare const isTextAreaFieldType: (field: {
|
448
519
|
config: FieldConfig;
|
449
520
|
value: FieldValue;
|
@@ -453,9 +524,9 @@ export declare const isTextAreaFieldType: (field: {
|
|
453
524
|
};
|
454
525
|
export declare const isSignatureFieldType: (field: {
|
455
526
|
config: FieldConfig;
|
456
|
-
value: FieldValue;
|
527
|
+
value: FieldValue | undefined;
|
457
528
|
}) => field is {
|
458
|
-
value:
|
529
|
+
value: FileFieldValue | undefined;
|
459
530
|
config: SignatureField;
|
460
531
|
};
|
461
532
|
export declare const isEmailFieldType: (field: {
|
@@ -563,5 +634,8 @@ export declare const isDataFieldType: (field: {
|
|
563
634
|
value: undefined;
|
564
635
|
config: DataField;
|
565
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;
|
566
640
|
export {};
|
567
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).
|
@@ -16,8 +16,19 @@ export declare const TextValue: z.ZodString;
|
|
16
16
|
export declare const NonEmptyTextValue: z.ZodString;
|
17
17
|
export declare const DateValue: z.ZodString;
|
18
18
|
export declare const DatetimeValue: z.ZodString;
|
19
|
-
export declare const
|
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]>;
|
20
30
|
export type DateRangeFieldValue = z.infer<typeof DateRangeFieldValue>;
|
31
|
+
export type SelectDateRangeValue = z.infer<typeof SelectDateRangeValue>;
|
21
32
|
export declare const EmailValue: z.ZodString;
|
22
33
|
export declare const CheckboxFieldValue: z.ZodBoolean;
|
23
34
|
export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
|
@@ -25,32 +36,43 @@ export declare const NumberFieldValue: z.ZodNumber;
|
|
25
36
|
export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
|
26
37
|
export declare const DataFieldValue: z.ZodUndefined;
|
27
38
|
export type DataFieldValue = z.infer<typeof DataFieldValue>;
|
28
|
-
export declare const
|
29
|
-
|
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>;
|
30
52
|
originalFilename: z.ZodString;
|
31
53
|
type: z.ZodString;
|
32
54
|
}, "strip", z.ZodTypeAny, {
|
33
55
|
type: string;
|
34
|
-
|
56
|
+
path: string;
|
35
57
|
originalFilename: string;
|
36
58
|
}, {
|
37
59
|
type: string;
|
38
|
-
|
60
|
+
path: string;
|
39
61
|
originalFilename: string;
|
40
62
|
}>, z.ZodArray<z.ZodObject<{
|
41
|
-
|
63
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
42
64
|
originalFilename: z.ZodString;
|
43
65
|
type: z.ZodString;
|
44
66
|
option: z.ZodString;
|
45
67
|
}, "strip", z.ZodTypeAny, {
|
46
68
|
type: string;
|
47
69
|
option: string;
|
48
|
-
|
70
|
+
path: string;
|
49
71
|
originalFilename: string;
|
50
72
|
}, {
|
51
73
|
type: string;
|
52
74
|
option: string;
|
53
|
-
|
75
|
+
path: string;
|
54
76
|
originalFilename: string;
|
55
77
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
56
78
|
country: z.ZodString;
|
@@ -138,34 +160,67 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnio
|
|
138
160
|
addressLine2?: string | undefined;
|
139
161
|
addressLine3?: string | undefined;
|
140
162
|
postcodeOrZip?: string | undefined;
|
141
|
-
}
|
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.ZodString;
|
177
|
+
surname: z.ZodString;
|
178
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
180
|
+
firstname: string;
|
181
|
+
surname: string;
|
182
|
+
middlename?: string | null | undefined;
|
183
|
+
}, {
|
184
|
+
firstname: string;
|
185
|
+
surname: string;
|
186
|
+
middlename?: string | null | undefined;
|
187
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
142
188
|
export type FieldValue = z.infer<typeof FieldValue>;
|
143
|
-
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.
|
144
|
-
|
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>;
|
145
200
|
originalFilename: z.ZodString;
|
146
201
|
type: z.ZodString;
|
147
202
|
}, "strip", z.ZodTypeAny, {
|
148
203
|
type: string;
|
149
|
-
|
204
|
+
path: string;
|
150
205
|
originalFilename: string;
|
151
206
|
}, {
|
152
207
|
type: string;
|
153
|
-
|
208
|
+
path: string;
|
154
209
|
originalFilename: string;
|
155
210
|
}>, z.ZodArray<z.ZodObject<{
|
156
|
-
|
211
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
157
212
|
originalFilename: z.ZodString;
|
158
213
|
type: z.ZodString;
|
159
214
|
option: z.ZodString;
|
160
215
|
}, "strip", z.ZodTypeAny, {
|
161
216
|
type: string;
|
162
217
|
option: string;
|
163
|
-
|
218
|
+
path: string;
|
164
219
|
originalFilename: string;
|
165
220
|
}, {
|
166
221
|
type: string;
|
167
222
|
option: string;
|
168
|
-
|
223
|
+
path: string;
|
169
224
|
originalFilename: string;
|
170
225
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
171
226
|
country: z.ZodString;
|
@@ -253,16 +308,28 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
253
308
|
addressLine2?: string | null | undefined;
|
254
309
|
addressLine3?: string | null | undefined;
|
255
310
|
postcodeOrZip?: string | null | undefined;
|
256
|
-
}
|
311
|
+
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
312
|
+
firstname: z.ZodString;
|
313
|
+
surname: z.ZodString;
|
314
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
315
|
+
}, "strip", z.ZodTypeAny, {
|
316
|
+
firstname: string;
|
317
|
+
surname: string;
|
318
|
+
middlename?: string | null | undefined;
|
319
|
+
}, {
|
320
|
+
firstname: string;
|
321
|
+
surname: string;
|
322
|
+
middlename?: string | null | undefined;
|
323
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
257
324
|
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
258
325
|
/**
|
259
326
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
260
327
|
* */
|
261
|
-
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;
|
262
329
|
/**
|
263
330
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
264
331
|
*
|
265
332
|
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
266
333
|
* */
|
267
|
-
export type FieldUpdateValueSchema = typeof DateRangeFieldValue | 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;
|
268
335
|
//# sourceMappingURL=FieldValue.d.ts.map
|