@opencrvs/toolkit 1.8.0-rc.feaeeb7 → 1.8.0-rc.fec1d5d
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/README.md +1 -1
- package/dist/commons/api/router.d.ts +21731 -10342
- package/dist/commons/conditionals/conditionals.d.ts +37 -6
- package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
- package/dist/commons/conditionals/validate.d.ts +45 -17
- package/dist/commons/conditionals/validate.test.d.ts +2 -0
- package/dist/commons/events/ActionConfig.d.ts +119422 -2084
- package/dist/commons/events/ActionDocument.d.ts +11499 -401
- package/dist/commons/events/ActionInput.d.ts +6662 -609
- package/dist/commons/events/ActionType.d.ts +31 -12
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1029 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +183 -2
- package/dist/commons/events/Conditional.d.ts +21 -5
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
- package/dist/commons/events/Draft.d.ts +476 -62
- package/dist/commons/events/EventConfig.d.ts +57486 -1824
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +4653 -573
- package/dist/commons/events/EventIndex.d.ts +1600 -22
- package/dist/commons/events/EventMetadata.d.ts +299 -40
- package/dist/commons/events/FieldConfig.d.ts +5984 -974
- package/dist/commons/events/FieldType.d.ts +10 -2
- package/dist/commons/events/FieldTypeMapping.d.ts +218 -18
- package/dist/commons/events/FieldValue.d.ts +123 -8
- package/dist/commons/events/FormConfig.d.ts +50409 -90
- package/dist/commons/events/PageConfig.d.ts +12597 -0
- package/dist/commons/events/SummaryConfig.d.ts +93 -42
- package/dist/commons/events/TemplateConfig.d.ts +30 -10
- package/dist/commons/events/User.d.ts +31 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +4812 -20
- package/dist/commons/events/defineConfig.d.ts +9397 -307
- package/dist/commons/events/event.d.ts +54 -0
- package/dist/commons/events/field.d.ts +77 -0
- package/dist/commons/events/index.d.ts +9 -1
- 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 +220 -224
- package/dist/commons/events/utils.d.ts +13896 -69
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +233 -108
- package/dist/events/index.js +4868 -1923
- package/dist/scopes/index.d.ts +158 -1
- package/dist/scopes/index.js +152 -1
- package/package.json +3 -2
@@ -1,16 +1,19 @@
|
|
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";
|
8
12
|
readonly PARAGRAPH: "PARAGRAPH";
|
9
13
|
readonly PAGE_HEADER: "PAGE_HEADER";
|
10
14
|
readonly RADIO_GROUP: "RADIO_GROUP";
|
11
15
|
readonly FILE: "FILE";
|
12
16
|
readonly FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS";
|
13
|
-
readonly HIDDEN: "HIDDEN";
|
14
17
|
readonly BULLET_LIST: "BULLET_LIST";
|
15
18
|
readonly CHECKBOX: "CHECKBOX";
|
16
19
|
readonly SELECT: "SELECT";
|
@@ -21,7 +24,12 @@ export declare const FieldType: {
|
|
21
24
|
readonly FACILITY: "FACILITY";
|
22
25
|
readonly OFFICE: "OFFICE";
|
23
26
|
readonly SIGNATURE: "SIGNATURE";
|
27
|
+
readonly DATA: "DATA";
|
24
28
|
};
|
25
|
-
export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "
|
29
|
+
export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[];
|
26
30
|
export type FieldType = (typeof fieldTypes)[number];
|
31
|
+
/**
|
32
|
+
* Composite field types are field types that consist of multiple field values.
|
33
|
+
*/
|
34
|
+
export declare const compositeFieldTypes: ("ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS")[];
|
27
35
|
//# sourceMappingURL=FieldType.d.ts.map
|
@@ -1,8 +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 } 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 } from './FieldConfig';
|
3
3
|
import { FieldType } from './FieldType';
|
4
4
|
import { FieldValue, FieldUpdateValueSchema } from './FieldValue';
|
5
|
-
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue } from './CompositeFieldValue';
|
5
|
+
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue } from './CompositeFieldValue';
|
6
6
|
/**
|
7
7
|
* FieldTypeMapping.ts should include functions that map field types to different formats dynamically.
|
8
8
|
* File is separated from FieldType and FieldConfig to avoid circular dependencies.
|
@@ -42,8 +42,57 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
42
42
|
type: string;
|
43
43
|
filename: string;
|
44
44
|
originalFilename: string;
|
45
|
-
}>>> | z.
|
45
|
+
}>>> | z.ZodObject<{
|
46
|
+
firstname: z.ZodString;
|
47
|
+
surname: z.ZodString;
|
48
|
+
middlename: z.ZodOptional<z.ZodString>;
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
50
|
+
firstname: string;
|
51
|
+
surname: string;
|
52
|
+
middlename?: string | undefined;
|
53
|
+
}, {
|
54
|
+
firstname: string;
|
55
|
+
surname: string;
|
56
|
+
middlename?: string | undefined;
|
57
|
+
}> | z.ZodUndefined | z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
58
|
+
firstname: z.ZodString;
|
59
|
+
surname: z.ZodString;
|
60
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
62
|
+
firstname: string;
|
63
|
+
surname: string;
|
64
|
+
middlename?: string | null | undefined;
|
65
|
+
}, {
|
66
|
+
firstname: string;
|
67
|
+
surname: string;
|
68
|
+
middlename?: string | null | undefined;
|
69
|
+
}>, z.ZodNull]>, z.ZodUndefined]> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
70
|
+
firstname: z.ZodString;
|
71
|
+
surname: z.ZodString;
|
72
|
+
middlename: z.ZodOptional<z.ZodString>;
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
74
|
+
firstname: string;
|
75
|
+
surname: string;
|
76
|
+
middlename?: string | undefined;
|
77
|
+
}, {
|
78
|
+
firstname: string;
|
79
|
+
surname: string;
|
80
|
+
middlename?: string | undefined;
|
81
|
+
}>>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
82
|
+
firstname: z.ZodString;
|
83
|
+
surname: z.ZodString;
|
84
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
86
|
+
firstname: string;
|
87
|
+
surname: string;
|
88
|
+
middlename?: string | null | undefined;
|
89
|
+
}, {
|
90
|
+
firstname: string;
|
91
|
+
surname: string;
|
92
|
+
middlename?: string | null | undefined;
|
93
|
+
}>, z.ZodNull]>, z.ZodUndefined]>>> | z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
46
94
|
country: z.ZodString;
|
95
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
47
96
|
province: z.ZodString;
|
48
97
|
district: z.ZodString;
|
49
98
|
}, {
|
@@ -56,6 +105,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
56
105
|
}>, "strip", z.ZodTypeAny, {
|
57
106
|
country: string;
|
58
107
|
district: string;
|
108
|
+
addressType: "DOMESTIC";
|
59
109
|
province: string;
|
60
110
|
urbanOrRural: "URBAN";
|
61
111
|
number?: string | null | undefined;
|
@@ -66,6 +116,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
66
116
|
}, {
|
67
117
|
country: string;
|
68
118
|
district: string;
|
119
|
+
addressType: "DOMESTIC";
|
69
120
|
province: string;
|
70
121
|
urbanOrRural: "URBAN";
|
71
122
|
number?: string | null | undefined;
|
@@ -75,6 +126,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
75
126
|
zipCode?: string | null | undefined;
|
76
127
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
77
128
|
country: z.ZodString;
|
129
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
78
130
|
province: z.ZodString;
|
79
131
|
district: z.ZodString;
|
80
132
|
}, {
|
@@ -83,15 +135,47 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
83
135
|
}>, "strip", z.ZodTypeAny, {
|
84
136
|
country: string;
|
85
137
|
district: string;
|
138
|
+
addressType: "DOMESTIC";
|
86
139
|
province: string;
|
87
140
|
urbanOrRural: "RURAL";
|
88
141
|
village?: string | null | undefined;
|
89
142
|
}, {
|
90
143
|
country: string;
|
91
144
|
district: string;
|
145
|
+
addressType: "DOMESTIC";
|
92
146
|
province: string;
|
93
147
|
urbanOrRural: "RURAL";
|
94
148
|
village?: string | null | undefined;
|
149
|
+
}>]>, z.ZodObject<{
|
150
|
+
country: z.ZodString;
|
151
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
152
|
+
state: z.ZodString;
|
153
|
+
district2: z.ZodString;
|
154
|
+
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
155
|
+
addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
156
|
+
addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
157
|
+
addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
158
|
+
postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
160
|
+
country: string;
|
161
|
+
state: string;
|
162
|
+
addressType: "INTERNATIONAL";
|
163
|
+
district2: string;
|
164
|
+
cityOrTown?: string | null | undefined;
|
165
|
+
addressLine1?: string | null | undefined;
|
166
|
+
addressLine2?: string | null | undefined;
|
167
|
+
addressLine3?: string | null | undefined;
|
168
|
+
postcodeOrZip?: string | null | undefined;
|
169
|
+
}, {
|
170
|
+
country: string;
|
171
|
+
state: string;
|
172
|
+
addressType: "INTERNATIONAL";
|
173
|
+
district2: string;
|
174
|
+
cityOrTown?: string | null | undefined;
|
175
|
+
addressLine1?: string | null | undefined;
|
176
|
+
addressLine2?: string | null | undefined;
|
177
|
+
addressLine3?: string | null | undefined;
|
178
|
+
postcodeOrZip?: string | null | undefined;
|
95
179
|
}>]> | z.ZodArray<z.ZodObject<{
|
96
180
|
filename: z.ZodString;
|
97
181
|
originalFilename: z.ZodString;
|
@@ -122,8 +206,9 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
122
206
|
option: string;
|
123
207
|
filename: string;
|
124
208
|
originalFilename: string;
|
125
|
-
}>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
209
|
+
}>, "many">>> | z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>> | 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<{
|
126
210
|
country: z.ZodString;
|
211
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
127
212
|
province: z.ZodString;
|
128
213
|
district: z.ZodString;
|
129
214
|
}, {
|
@@ -136,6 +221,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
136
221
|
}>, "strip", z.ZodTypeAny, {
|
137
222
|
country: string;
|
138
223
|
district: string;
|
224
|
+
addressType: "DOMESTIC";
|
139
225
|
province: string;
|
140
226
|
urbanOrRural: "URBAN";
|
141
227
|
number?: string | null | undefined;
|
@@ -146,6 +232,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
146
232
|
}, {
|
147
233
|
country: string;
|
148
234
|
district: string;
|
235
|
+
addressType: "DOMESTIC";
|
149
236
|
province: string;
|
150
237
|
urbanOrRural: "URBAN";
|
151
238
|
number?: string | null | undefined;
|
@@ -155,6 +242,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
155
242
|
zipCode?: string | null | undefined;
|
156
243
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
157
244
|
country: z.ZodString;
|
245
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
158
246
|
province: z.ZodString;
|
159
247
|
district: z.ZodString;
|
160
248
|
}, {
|
@@ -163,15 +251,47 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
163
251
|
}>, "strip", z.ZodTypeAny, {
|
164
252
|
country: string;
|
165
253
|
district: string;
|
254
|
+
addressType: "DOMESTIC";
|
166
255
|
province: string;
|
167
256
|
urbanOrRural: "RURAL";
|
168
257
|
village?: string | null | undefined;
|
169
258
|
}, {
|
170
259
|
country: string;
|
171
260
|
district: string;
|
261
|
+
addressType: "DOMESTIC";
|
172
262
|
province: string;
|
173
263
|
urbanOrRural: "RURAL";
|
174
264
|
village?: string | null | undefined;
|
265
|
+
}>]>, z.ZodObject<{
|
266
|
+
country: z.ZodString;
|
267
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
268
|
+
state: z.ZodString;
|
269
|
+
district2: z.ZodString;
|
270
|
+
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
271
|
+
addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
272
|
+
addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
273
|
+
addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
274
|
+
postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
276
|
+
country: string;
|
277
|
+
state: string;
|
278
|
+
addressType: "INTERNATIONAL";
|
279
|
+
district2: string;
|
280
|
+
cityOrTown?: string | null | undefined;
|
281
|
+
addressLine1?: string | null | undefined;
|
282
|
+
addressLine2?: string | null | undefined;
|
283
|
+
addressLine3?: string | null | undefined;
|
284
|
+
postcodeOrZip?: string | null | undefined;
|
285
|
+
}, {
|
286
|
+
country: string;
|
287
|
+
state: string;
|
288
|
+
addressType: "INTERNATIONAL";
|
289
|
+
district2: string;
|
290
|
+
cityOrTown?: string | null | undefined;
|
291
|
+
addressLine1?: string | null | undefined;
|
292
|
+
addressLine2?: string | null | undefined;
|
293
|
+
addressLine3?: string | null | undefined;
|
294
|
+
postcodeOrZip?: string | null | undefined;
|
175
295
|
}>]>>>;
|
176
296
|
export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
|
177
297
|
[x: string]: string | number | boolean | {
|
@@ -181,6 +301,7 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
181
301
|
} | {
|
182
302
|
country: string;
|
183
303
|
district: string;
|
304
|
+
addressType: "DOMESTIC";
|
184
305
|
province: string;
|
185
306
|
urbanOrRural: "URBAN";
|
186
307
|
number?: string | null | undefined;
|
@@ -188,18 +309,37 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
188
309
|
residentialArea?: string | null | undefined;
|
189
310
|
street?: string | null | undefined;
|
190
311
|
zipCode?: string | null | undefined;
|
312
|
+
} | {
|
313
|
+
firstname: string;
|
314
|
+
surname: string;
|
315
|
+
middlename?: string | undefined;
|
316
|
+
} | {
|
317
|
+
firstname: string;
|
318
|
+
surname: string;
|
319
|
+
middlename?: string | null | undefined;
|
191
320
|
} | {
|
192
321
|
country: string;
|
193
322
|
district: string;
|
323
|
+
addressType: "DOMESTIC";
|
194
324
|
province: string;
|
195
325
|
urbanOrRural: "RURAL";
|
196
326
|
village?: string | null | undefined;
|
327
|
+
} | {
|
328
|
+
country: string;
|
329
|
+
state: string;
|
330
|
+
addressType: "INTERNATIONAL";
|
331
|
+
district2: string;
|
332
|
+
cityOrTown?: string | null | undefined;
|
333
|
+
addressLine1?: string | null | undefined;
|
334
|
+
addressLine2?: string | null | undefined;
|
335
|
+
addressLine3?: string | null | undefined;
|
336
|
+
postcodeOrZip?: string | null | undefined;
|
197
337
|
} | {
|
198
338
|
type: string;
|
199
339
|
option: string;
|
200
340
|
filename: string;
|
201
341
|
originalFilename: string;
|
202
|
-
}[] | null | undefined;
|
342
|
+
}[] | [string, string] | null | undefined;
|
203
343
|
}, {
|
204
344
|
[x: string]: string | number | boolean | {
|
205
345
|
type: string;
|
@@ -208,6 +348,7 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
208
348
|
} | {
|
209
349
|
country: string;
|
210
350
|
district: string;
|
351
|
+
addressType: "DOMESTIC";
|
211
352
|
province: string;
|
212
353
|
urbanOrRural: "URBAN";
|
213
354
|
number?: string | null | undefined;
|
@@ -215,32 +356,52 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
215
356
|
residentialArea?: string | null | undefined;
|
216
357
|
street?: string | null | undefined;
|
217
358
|
zipCode?: string | null | undefined;
|
359
|
+
} | {
|
360
|
+
firstname: string;
|
361
|
+
surname: string;
|
362
|
+
middlename?: string | undefined;
|
363
|
+
} | {
|
364
|
+
firstname: string;
|
365
|
+
surname: string;
|
366
|
+
middlename?: string | null | undefined;
|
218
367
|
} | {
|
219
368
|
country: string;
|
220
369
|
district: string;
|
370
|
+
addressType: "DOMESTIC";
|
221
371
|
province: string;
|
222
372
|
urbanOrRural: "RURAL";
|
223
373
|
village?: string | null | undefined;
|
374
|
+
} | {
|
375
|
+
country: string;
|
376
|
+
state: string;
|
377
|
+
addressType: "INTERNATIONAL";
|
378
|
+
district2: string;
|
379
|
+
cityOrTown?: string | null | undefined;
|
380
|
+
addressLine1?: string | null | undefined;
|
381
|
+
addressLine2?: string | null | undefined;
|
382
|
+
addressLine3?: string | null | undefined;
|
383
|
+
postcodeOrZip?: string | null | undefined;
|
224
384
|
} | {
|
225
385
|
type: string;
|
226
386
|
option: string;
|
227
387
|
filename: string;
|
228
388
|
originalFilename: string;
|
229
|
-
}[] | null | undefined;
|
389
|
+
}[] | [string, string] | null | undefined;
|
230
390
|
}>;
|
231
391
|
/**
|
232
|
-
*
|
392
|
+
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
233
393
|
*/
|
234
|
-
export declare function
|
235
|
-
country:
|
236
|
-
|
237
|
-
|
394
|
+
export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
|
395
|
+
country: null;
|
396
|
+
addressType: "DOMESTIC";
|
397
|
+
province: null;
|
398
|
+
district: null;
|
238
399
|
urbanOrRural: string;
|
239
|
-
town:
|
240
|
-
residentialArea:
|
241
|
-
street:
|
242
|
-
number:
|
243
|
-
zipCode:
|
400
|
+
town: null;
|
401
|
+
residentialArea: null;
|
402
|
+
street: null;
|
403
|
+
number: null;
|
404
|
+
zipCode: null;
|
244
405
|
filename?: undefined;
|
245
406
|
originalFilename?: undefined;
|
246
407
|
type?: undefined;
|
@@ -249,6 +410,7 @@ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number):
|
|
249
410
|
originalFilename: string;
|
250
411
|
type: string;
|
251
412
|
country?: undefined;
|
413
|
+
addressType?: undefined;
|
252
414
|
province?: undefined;
|
253
415
|
district?: undefined;
|
254
416
|
urbanOrRural?: undefined;
|
@@ -272,6 +434,13 @@ export declare const isDateFieldType: (field: {
|
|
272
434
|
value: string;
|
273
435
|
config: DateField;
|
274
436
|
};
|
437
|
+
export declare const isDateRangeFieldType: (field: {
|
438
|
+
config: FieldConfig;
|
439
|
+
value: FieldValue;
|
440
|
+
}) => field is {
|
441
|
+
value: string;
|
442
|
+
config: DateField;
|
443
|
+
};
|
275
444
|
export declare const isPageHeaderFieldType: (field: {
|
276
445
|
config: FieldConfig;
|
277
446
|
value: FieldValue;
|
@@ -293,6 +462,27 @@ export declare const isNumberFieldType: (field: {
|
|
293
462
|
value: number;
|
294
463
|
config: NumberField;
|
295
464
|
};
|
465
|
+
export declare const isNameFieldType: (field: {
|
466
|
+
config: FieldConfig;
|
467
|
+
value: FieldValue;
|
468
|
+
}) => field is {
|
469
|
+
value: NameFieldValue;
|
470
|
+
config: NameField;
|
471
|
+
};
|
472
|
+
export declare const isPhoneFieldType: (field: {
|
473
|
+
config: FieldConfig;
|
474
|
+
value: FieldValue;
|
475
|
+
}) => field is {
|
476
|
+
value: string;
|
477
|
+
config: PhoneField;
|
478
|
+
};
|
479
|
+
export declare const isIdFieldType: (field: {
|
480
|
+
config: FieldConfig;
|
481
|
+
value: FieldValue;
|
482
|
+
}) => field is {
|
483
|
+
value: string;
|
484
|
+
config: IdField;
|
485
|
+
};
|
296
486
|
export declare const isTextAreaFieldType: (field: {
|
297
487
|
config: FieldConfig;
|
298
488
|
value: FieldValue;
|
@@ -302,9 +492,9 @@ export declare const isTextAreaFieldType: (field: {
|
|
302
492
|
};
|
303
493
|
export declare const isSignatureFieldType: (field: {
|
304
494
|
config: FieldConfig;
|
305
|
-
value: FieldValue;
|
495
|
+
value: FieldValue | undefined;
|
306
496
|
}) => field is {
|
307
|
-
value:
|
497
|
+
value: FileFieldValue | undefined;
|
308
498
|
config: SignatureField;
|
309
499
|
};
|
310
500
|
export declare const isEmailFieldType: (field: {
|
@@ -405,5 +595,15 @@ export declare const isOfficeFieldType: (field: {
|
|
405
595
|
value: string;
|
406
596
|
config: Office;
|
407
597
|
};
|
598
|
+
export declare const isDataFieldType: (field: {
|
599
|
+
config: FieldConfig;
|
600
|
+
value: FieldValue;
|
601
|
+
}) => field is {
|
602
|
+
value: undefined;
|
603
|
+
config: DataField;
|
604
|
+
};
|
605
|
+
export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField;
|
606
|
+
export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
|
607
|
+
export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
|
408
608
|
export {};
|
409
609
|
//# 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,14 +13,21 @@ 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 DateRangeFieldValue: z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
|
20
|
+
export type DateRangeFieldValue = z.infer<typeof DateRangeFieldValue>;
|
18
21
|
export declare const EmailValue: z.ZodString;
|
19
22
|
export declare const CheckboxFieldValue: z.ZodBoolean;
|
20
23
|
export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
|
21
24
|
export declare const NumberFieldValue: z.ZodNumber;
|
22
25
|
export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
|
23
|
-
export declare const
|
26
|
+
export declare const DataFieldValue: z.ZodUndefined;
|
27
|
+
export type DataFieldValue = z.infer<typeof DataFieldValue>;
|
28
|
+
export declare const SignatureFieldValue: z.ZodString;
|
29
|
+
export type SignatureFieldValue = z.infer<typeof SignatureFieldValue>;
|
30
|
+
export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
24
31
|
filename: z.ZodString;
|
25
32
|
originalFilename: z.ZodString;
|
26
33
|
type: z.ZodString;
|
@@ -49,6 +56,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
49
56
|
originalFilename: string;
|
50
57
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
51
58
|
country: z.ZodString;
|
59
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
52
60
|
province: z.ZodString;
|
53
61
|
district: z.ZodString;
|
54
62
|
}, {
|
@@ -61,6 +69,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
61
69
|
}>, "strip", z.ZodTypeAny, {
|
62
70
|
country: string;
|
63
71
|
district: string;
|
72
|
+
addressType: "DOMESTIC";
|
64
73
|
province: string;
|
65
74
|
urbanOrRural: "URBAN";
|
66
75
|
number?: string | undefined;
|
@@ -71,6 +80,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
71
80
|
}, {
|
72
81
|
country: string;
|
73
82
|
district: string;
|
83
|
+
addressType: "DOMESTIC";
|
74
84
|
province: string;
|
75
85
|
urbanOrRural: "URBAN";
|
76
86
|
number?: string | undefined;
|
@@ -80,6 +90,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
80
90
|
zipCode?: string | undefined;
|
81
91
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
82
92
|
country: z.ZodString;
|
93
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
83
94
|
province: z.ZodString;
|
84
95
|
district: z.ZodString;
|
85
96
|
}, {
|
@@ -88,18 +99,74 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
88
99
|
}>, "strip", z.ZodTypeAny, {
|
89
100
|
country: string;
|
90
101
|
district: string;
|
102
|
+
addressType: "DOMESTIC";
|
91
103
|
province: string;
|
92
104
|
urbanOrRural: "RURAL";
|
93
105
|
village?: string | undefined;
|
94
106
|
}, {
|
95
107
|
country: string;
|
96
108
|
district: string;
|
109
|
+
addressType: "DOMESTIC";
|
97
110
|
province: string;
|
98
111
|
urbanOrRural: "RURAL";
|
99
112
|
village?: string | undefined;
|
100
|
-
}
|
113
|
+
}>, z.ZodUndefined, z.ZodObject<{
|
114
|
+
country: z.ZodString;
|
115
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
116
|
+
state: z.ZodString;
|
117
|
+
district2: z.ZodString;
|
118
|
+
cityOrTown: z.ZodOptional<z.ZodString>;
|
119
|
+
addressLine1: z.ZodOptional<z.ZodString>;
|
120
|
+
addressLine2: z.ZodOptional<z.ZodString>;
|
121
|
+
addressLine3: z.ZodOptional<z.ZodString>;
|
122
|
+
postcodeOrZip: z.ZodOptional<z.ZodString>;
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
124
|
+
country: string;
|
125
|
+
state: string;
|
126
|
+
addressType: "INTERNATIONAL";
|
127
|
+
district2: string;
|
128
|
+
cityOrTown?: string | undefined;
|
129
|
+
addressLine1?: string | undefined;
|
130
|
+
addressLine2?: string | undefined;
|
131
|
+
addressLine3?: string | undefined;
|
132
|
+
postcodeOrZip?: string | undefined;
|
133
|
+
}, {
|
134
|
+
country: string;
|
135
|
+
state: string;
|
136
|
+
addressType: "INTERNATIONAL";
|
137
|
+
district2: string;
|
138
|
+
cityOrTown?: string | undefined;
|
139
|
+
addressLine1?: string | undefined;
|
140
|
+
addressLine2?: string | undefined;
|
141
|
+
addressLine3?: string | undefined;
|
142
|
+
postcodeOrZip?: string | undefined;
|
143
|
+
}>, z.ZodObject<{
|
144
|
+
firstname: z.ZodString;
|
145
|
+
surname: z.ZodString;
|
146
|
+
middlename: z.ZodOptional<z.ZodString>;
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
148
|
+
firstname: string;
|
149
|
+
surname: string;
|
150
|
+
middlename?: string | undefined;
|
151
|
+
}, {
|
152
|
+
firstname: string;
|
153
|
+
surname: string;
|
154
|
+
middlename?: string | undefined;
|
155
|
+
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
156
|
+
firstname: z.ZodString;
|
157
|
+
surname: z.ZodString;
|
158
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
160
|
+
firstname: string;
|
161
|
+
surname: string;
|
162
|
+
middlename?: string | null | undefined;
|
163
|
+
}, {
|
164
|
+
firstname: string;
|
165
|
+
surname: string;
|
166
|
+
middlename?: string | null | undefined;
|
167
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
101
168
|
export type FieldValue = z.infer<typeof FieldValue>;
|
102
|
-
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
169
|
+
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
103
170
|
filename: z.ZodString;
|
104
171
|
originalFilename: z.ZodString;
|
105
172
|
type: z.ZodString;
|
@@ -128,6 +195,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
128
195
|
originalFilename: string;
|
129
196
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
130
197
|
country: z.ZodString;
|
198
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
131
199
|
province: z.ZodString;
|
132
200
|
district: z.ZodString;
|
133
201
|
}, {
|
@@ -140,6 +208,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
140
208
|
}>, "strip", z.ZodTypeAny, {
|
141
209
|
country: string;
|
142
210
|
district: string;
|
211
|
+
addressType: "DOMESTIC";
|
143
212
|
province: string;
|
144
213
|
urbanOrRural: "URBAN";
|
145
214
|
number?: string | null | undefined;
|
@@ -150,6 +219,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
150
219
|
}, {
|
151
220
|
country: string;
|
152
221
|
district: string;
|
222
|
+
addressType: "DOMESTIC";
|
153
223
|
province: string;
|
154
224
|
urbanOrRural: "URBAN";
|
155
225
|
number?: string | null | undefined;
|
@@ -159,6 +229,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
159
229
|
zipCode?: string | null | undefined;
|
160
230
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
161
231
|
country: z.ZodString;
|
232
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
162
233
|
province: z.ZodString;
|
163
234
|
district: z.ZodString;
|
164
235
|
}, {
|
@@ -167,25 +238,69 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
167
238
|
}>, "strip", z.ZodTypeAny, {
|
168
239
|
country: string;
|
169
240
|
district: string;
|
241
|
+
addressType: "DOMESTIC";
|
170
242
|
province: string;
|
171
243
|
urbanOrRural: "RURAL";
|
172
244
|
village?: string | null | undefined;
|
173
245
|
}, {
|
174
246
|
country: string;
|
175
247
|
district: string;
|
248
|
+
addressType: "DOMESTIC";
|
176
249
|
province: string;
|
177
250
|
urbanOrRural: "RURAL";
|
178
251
|
village?: string | null | undefined;
|
179
|
-
}
|
252
|
+
}>, z.ZodUndefined, z.ZodObject<{
|
253
|
+
country: z.ZodString;
|
254
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
255
|
+
state: z.ZodString;
|
256
|
+
district2: z.ZodString;
|
257
|
+
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
258
|
+
addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
259
|
+
addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
260
|
+
addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
261
|
+
postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
263
|
+
country: string;
|
264
|
+
state: string;
|
265
|
+
addressType: "INTERNATIONAL";
|
266
|
+
district2: string;
|
267
|
+
cityOrTown?: string | null | undefined;
|
268
|
+
addressLine1?: string | null | undefined;
|
269
|
+
addressLine2?: string | null | undefined;
|
270
|
+
addressLine3?: string | null | undefined;
|
271
|
+
postcodeOrZip?: string | null | undefined;
|
272
|
+
}, {
|
273
|
+
country: string;
|
274
|
+
state: string;
|
275
|
+
addressType: "INTERNATIONAL";
|
276
|
+
district2: string;
|
277
|
+
cityOrTown?: string | null | undefined;
|
278
|
+
addressLine1?: string | null | undefined;
|
279
|
+
addressLine2?: string | null | undefined;
|
280
|
+
addressLine3?: string | null | undefined;
|
281
|
+
postcodeOrZip?: string | null | undefined;
|
282
|
+
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
283
|
+
firstname: z.ZodString;
|
284
|
+
surname: z.ZodString;
|
285
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
287
|
+
firstname: string;
|
288
|
+
surname: string;
|
289
|
+
middlename?: string | null | undefined;
|
290
|
+
}, {
|
291
|
+
firstname: string;
|
292
|
+
surname: string;
|
293
|
+
middlename?: string | null | undefined;
|
294
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
180
295
|
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
181
296
|
/**
|
182
297
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
183
298
|
* */
|
184
|
-
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | z.ZodString | z.ZodBoolean;
|
299
|
+
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | z.ZodString | z.ZodBoolean;
|
185
300
|
/**
|
186
301
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
187
302
|
*
|
188
303
|
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
189
304
|
* */
|
190
|
-
export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | z.ZodString | z.ZodBoolean;
|
305
|
+
export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | typeof NameFieldValue | typeof NameFieldUpdateValue | z.ZodString | z.ZodBoolean;
|
191
306
|
//# sourceMappingURL=FieldValue.d.ts.map
|