@opencrvs/toolkit 1.8.1-rc.a372970 → 1.8.1-rc.bbbfede
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 +6318 -5078
- package/dist/commons/conditionals/conditionals.d.ts +9 -13
- package/dist/commons/conditionals/validate.d.ts +17 -7
- package/dist/commons/events/ActionConfig.d.ts +119326 -1729
- package/dist/commons/events/ActionDocument.d.ts +5481 -1268
- package/dist/commons/events/ActionInput.d.ts +3745 -1025
- package/dist/commons/events/ActionType.d.ts +10 -1
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1282 -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 +332 -97
- package/dist/commons/events/EventConfig.d.ts +54363 -1357
- package/dist/commons/events/EventDocument.d.ts +3136 -833
- package/dist/commons/events/EventIndex.d.ts +2234 -29
- package/dist/commons/events/EventMetadata.d.ts +353 -47
- package/dist/commons/events/FieldConfig.d.ts +6756 -1260
- package/dist/commons/events/FieldType.d.ts +8 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +161 -73
- package/dist/commons/events/FieldValue.d.ts +91 -20
- package/dist/commons/events/FormConfig.d.ts +55770 -522
- package/dist/commons/events/PageConfig.d.ts +13825 -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 +8529 -77
- package/dist/commons/events/event.d.ts +100 -0
- package/dist/commons/events/field.d.ts +94 -0
- package/dist/commons/events/index.d.ts +8 -0
- package/dist/commons/events/scopes.d.ts +45 -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 +15440 -88
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +66 -56
- package/dist/events/index.js +4755 -1788
- package/dist/scopes/index.d.ts +184 -7
- package/dist/scopes/index.js +140 -40
- package/package.json +4 -3
@@ -1,16 +1,21 @@
|
|
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";
|
13
|
+
readonly TIME: "TIME";
|
8
14
|
readonly PARAGRAPH: "PARAGRAPH";
|
9
15
|
readonly PAGE_HEADER: "PAGE_HEADER";
|
10
16
|
readonly RADIO_GROUP: "RADIO_GROUP";
|
11
17
|
readonly FILE: "FILE";
|
12
18
|
readonly FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS";
|
13
|
-
readonly HIDDEN: "HIDDEN";
|
14
19
|
readonly BULLET_LIST: "BULLET_LIST";
|
15
20
|
readonly CHECKBOX: "CHECKBOX";
|
16
21
|
readonly SELECT: "SELECT";
|
@@ -23,10 +28,10 @@ export declare const FieldType: {
|
|
23
28
|
readonly SIGNATURE: "SIGNATURE";
|
24
29
|
readonly DATA: "DATA";
|
25
30
|
};
|
26
|
-
export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "
|
31
|
+
export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[];
|
27
32
|
export type FieldType = (typeof fieldTypes)[number];
|
28
33
|
/**
|
29
34
|
* Composite field types are field types that consist of multiple field values.
|
30
35
|
*/
|
31
|
-
export declare const compositeFieldTypes: ("ADDRESS" | "FILE" | "FILE_WITH_OPTIONS")[];
|
36
|
+
export declare const compositeFieldTypes: ("ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS")[];
|
32
37
|
//# 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, TimeField } 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,27 @@ export declare const isDateFieldType: (field: {
|
|
416
459
|
value: string;
|
417
460
|
config: DateField;
|
418
461
|
};
|
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
|
+
};
|
419
483
|
export declare const isPageHeaderFieldType: (field: {
|
420
484
|
config: FieldConfig;
|
421
485
|
value: FieldValue;
|
@@ -437,6 +501,27 @@ export declare const isNumberFieldType: (field: {
|
|
437
501
|
value: number;
|
438
502
|
config: NumberField;
|
439
503
|
};
|
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
|
+
};
|
440
525
|
export declare const isTextAreaFieldType: (field: {
|
441
526
|
config: FieldConfig;
|
442
527
|
value: FieldValue;
|
@@ -446,9 +531,9 @@ export declare const isTextAreaFieldType: (field: {
|
|
446
531
|
};
|
447
532
|
export declare const isSignatureFieldType: (field: {
|
448
533
|
config: FieldConfig;
|
449
|
-
value: FieldValue;
|
534
|
+
value: FieldValue | undefined;
|
450
535
|
}) => field is {
|
451
|
-
value:
|
536
|
+
value: FileFieldValue | undefined;
|
452
537
|
config: SignatureField;
|
453
538
|
};
|
454
539
|
export declare const isEmailFieldType: (field: {
|
@@ -556,5 +641,8 @@ export declare const isDataFieldType: (field: {
|
|
556
641
|
value: undefined;
|
557
642
|
config: DataField;
|
558
643
|
};
|
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;
|
559
647
|
export {};
|
560
648
|
//# 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,23 @@ 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 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>;
|
18
33
|
export declare const EmailValue: z.ZodString;
|
19
34
|
export declare const CheckboxFieldValue: z.ZodBoolean;
|
20
35
|
export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
|
@@ -22,32 +37,43 @@ export declare const NumberFieldValue: z.ZodNumber;
|
|
22
37
|
export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
|
23
38
|
export declare const DataFieldValue: z.ZodUndefined;
|
24
39
|
export type DataFieldValue = z.infer<typeof DataFieldValue>;
|
25
|
-
export declare const
|
26
|
-
|
40
|
+
export declare const SignatureFieldValue: z.ZodString;
|
41
|
+
export type SignatureFieldValue = z.infer<typeof SignatureFieldValue>;
|
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>;
|
27
53
|
originalFilename: z.ZodString;
|
28
54
|
type: z.ZodString;
|
29
55
|
}, "strip", z.ZodTypeAny, {
|
30
56
|
type: string;
|
31
|
-
|
57
|
+
path: string;
|
32
58
|
originalFilename: string;
|
33
59
|
}, {
|
34
60
|
type: string;
|
35
|
-
|
61
|
+
path: string;
|
36
62
|
originalFilename: string;
|
37
63
|
}>, z.ZodArray<z.ZodObject<{
|
38
|
-
|
64
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
39
65
|
originalFilename: z.ZodString;
|
40
66
|
type: z.ZodString;
|
41
67
|
option: z.ZodString;
|
42
68
|
}, "strip", z.ZodTypeAny, {
|
43
69
|
type: string;
|
44
70
|
option: string;
|
45
|
-
|
71
|
+
path: string;
|
46
72
|
originalFilename: string;
|
47
73
|
}, {
|
48
74
|
type: string;
|
49
75
|
option: string;
|
50
|
-
|
76
|
+
path: string;
|
51
77
|
originalFilename: string;
|
52
78
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
53
79
|
country: z.ZodString;
|
@@ -135,34 +161,67 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
135
161
|
addressLine2?: string | undefined;
|
136
162
|
addressLine3?: string | undefined;
|
137
163
|
postcodeOrZip?: string | undefined;
|
138
|
-
}
|
164
|
+
}>, z.ZodObject<{
|
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]>]>;
|
139
189
|
export type FieldValue = z.infer<typeof FieldValue>;
|
140
|
-
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.
|
141
|
-
|
190
|
+
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
|
191
|
+
start: z.ZodString;
|
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>;
|
142
201
|
originalFilename: z.ZodString;
|
143
202
|
type: z.ZodString;
|
144
203
|
}, "strip", z.ZodTypeAny, {
|
145
204
|
type: string;
|
146
|
-
|
205
|
+
path: string;
|
147
206
|
originalFilename: string;
|
148
207
|
}, {
|
149
208
|
type: string;
|
150
|
-
|
209
|
+
path: string;
|
151
210
|
originalFilename: string;
|
152
211
|
}>, z.ZodArray<z.ZodObject<{
|
153
|
-
|
212
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
154
213
|
originalFilename: z.ZodString;
|
155
214
|
type: z.ZodString;
|
156
215
|
option: z.ZodString;
|
157
216
|
}, "strip", z.ZodTypeAny, {
|
158
217
|
type: string;
|
159
218
|
option: string;
|
160
|
-
|
219
|
+
path: string;
|
161
220
|
originalFilename: string;
|
162
221
|
}, {
|
163
222
|
type: string;
|
164
223
|
option: string;
|
165
|
-
|
224
|
+
path: string;
|
166
225
|
originalFilename: string;
|
167
226
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
168
227
|
country: z.ZodString;
|
@@ -250,16 +309,28 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
250
309
|
addressLine2?: string | null | undefined;
|
251
310
|
addressLine3?: string | null | undefined;
|
252
311
|
postcodeOrZip?: string | null | undefined;
|
253
|
-
}
|
312
|
+
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
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]>]>;
|
254
325
|
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
255
326
|
/**
|
256
327
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
257
328
|
* */
|
258
|
-
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
|
329
|
+
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | z.ZodString | z.ZodBoolean;
|
259
330
|
/**
|
260
331
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
261
332
|
*
|
262
333
|
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
263
334
|
* */
|
264
|
-
export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
|
335
|
+
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
336
|
//# sourceMappingURL=FieldValue.d.ts.map
|