@opencrvs/toolkit 1.8.0-rc.fd16d13 → 1.8.0-rc.fd1df48
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 +11807 -13412
- package/dist/commons/conditionals/conditionals.d.ts +37 -6
- package/dist/commons/conditionals/validate.d.ts +18 -17
- package/dist/commons/events/ActionConfig.d.ts +119425 -2069
- package/dist/commons/events/ActionDocument.d.ts +10215 -575
- package/dist/commons/events/ActionInput.d.ts +4578 -781
- package/dist/commons/events/ActionType.d.ts +30 -11
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1233 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +83 -12
- 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 +3730 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +288 -82
- package/dist/commons/events/EventConfig.d.ts +57613 -1795
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +2974 -709
- package/dist/commons/events/EventIndex.d.ts +2007 -24
- package/dist/commons/events/EventMetadata.d.ts +343 -42
- package/dist/commons/events/FieldConfig.d.ts +5992 -1009
- package/dist/commons/events/FieldType.d.ts +7 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +142 -44
- package/dist/commons/events/FieldValue.d.ts +77 -16
- 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 +5 -5
- 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 +7300 -20
- package/dist/commons/events/defineConfig.d.ts +9405 -301
- package/dist/commons/events/event.d.ts +54 -0
- package/dist/commons/events/field.d.ts +82 -0
- package/dist/commons/events/index.d.ts +10 -1
- 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 +191 -280
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +13821 -96
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +243 -115
- package/dist/events/index.js +5353 -2193
- package/dist/scopes/index.d.ts +161 -1
- package/dist/scopes/index.js +202 -1
- package/package.json +4 -3
@@ -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,11 +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];
|
27
31
|
/**
|
28
32
|
* Composite field types are field types that consist of multiple field values.
|
29
33
|
*/
|
30
|
-
export declare const compositeFieldTypes: ("ADDRESS" | "FILE" | "FILE_WITH_OPTIONS")[];
|
34
|
+
export declare const compositeFieldTypes: ("ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS")[];
|
31
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.
|
46
|
-
|
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.ZodOptional<z.ZodNullable<z.ZodString>>;
|
59
|
+
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
60
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
62
|
+
firstname?: string | null | undefined;
|
63
|
+
surname?: string | null | undefined;
|
64
|
+
middlename?: string | null | undefined;
|
65
|
+
}, {
|
66
|
+
firstname?: string | null | undefined;
|
67
|
+
surname?: string | null | undefined;
|
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.ZodOptional<z.ZodNullable<z.ZodString>>;
|
83
|
+
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
84
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
86
|
+
firstname?: string | null | undefined;
|
87
|
+
surname?: string | null | undefined;
|
88
|
+
middlename?: string | null | undefined;
|
89
|
+
}, {
|
90
|
+
firstname?: string | null | undefined;
|
91
|
+
surname?: string | null | undefined;
|
92
|
+
middlename?: string | null | undefined;
|
93
|
+
}>, z.ZodNull]>, z.ZodUndefined]>>> | z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
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;
|
@@ -74,7 +125,8 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
74
125
|
street?: string | null | undefined;
|
75
126
|
zipCode?: string | null | undefined;
|
76
127
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
77
|
-
country: z.
|
128
|
+
country: z.ZodString;
|
129
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
78
130
|
province: z.ZodString;
|
79
131
|
district: z.ZodString;
|
80
132
|
}, {
|
@@ -83,17 +135,20 @@ 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;
|
95
149
|
}>]>, z.ZodObject<{
|
96
|
-
country: z.
|
150
|
+
country: z.ZodString;
|
151
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
97
152
|
state: z.ZodString;
|
98
153
|
district2: z.ZodString;
|
99
154
|
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
@@ -104,6 +159,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
104
159
|
}, "strip", z.ZodTypeAny, {
|
105
160
|
country: string;
|
106
161
|
state: string;
|
162
|
+
addressType: "INTERNATIONAL";
|
107
163
|
district2: string;
|
108
164
|
cityOrTown?: string | null | undefined;
|
109
165
|
addressLine1?: string | null | undefined;
|
@@ -113,6 +169,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
113
169
|
}, {
|
114
170
|
country: string;
|
115
171
|
state: string;
|
172
|
+
addressType: "INTERNATIONAL";
|
116
173
|
district2: string;
|
117
174
|
cityOrTown?: string | null | undefined;
|
118
175
|
addressLine1?: string | null | undefined;
|
@@ -149,8 +206,9 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
149
206
|
option: string;
|
150
207
|
filename: string;
|
151
208
|
originalFilename: string;
|
152
|
-
}>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
153
|
-
country: z.
|
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<{
|
210
|
+
country: z.ZodString;
|
211
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
154
212
|
province: z.ZodString;
|
155
213
|
district: z.ZodString;
|
156
214
|
}, {
|
@@ -163,6 +221,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
163
221
|
}>, "strip", z.ZodTypeAny, {
|
164
222
|
country: string;
|
165
223
|
district: string;
|
224
|
+
addressType: "DOMESTIC";
|
166
225
|
province: string;
|
167
226
|
urbanOrRural: "URBAN";
|
168
227
|
number?: string | null | undefined;
|
@@ -173,6 +232,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
173
232
|
}, {
|
174
233
|
country: string;
|
175
234
|
district: string;
|
235
|
+
addressType: "DOMESTIC";
|
176
236
|
province: string;
|
177
237
|
urbanOrRural: "URBAN";
|
178
238
|
number?: string | null | undefined;
|
@@ -181,7 +241,8 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
181
241
|
street?: string | null | undefined;
|
182
242
|
zipCode?: string | null | undefined;
|
183
243
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
184
|
-
country: z.
|
244
|
+
country: z.ZodString;
|
245
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
185
246
|
province: z.ZodString;
|
186
247
|
district: z.ZodString;
|
187
248
|
}, {
|
@@ -190,17 +251,20 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
190
251
|
}>, "strip", z.ZodTypeAny, {
|
191
252
|
country: string;
|
192
253
|
district: string;
|
254
|
+
addressType: "DOMESTIC";
|
193
255
|
province: string;
|
194
256
|
urbanOrRural: "RURAL";
|
195
257
|
village?: string | null | undefined;
|
196
258
|
}, {
|
197
259
|
country: string;
|
198
260
|
district: string;
|
261
|
+
addressType: "DOMESTIC";
|
199
262
|
province: string;
|
200
263
|
urbanOrRural: "RURAL";
|
201
264
|
village?: string | null | undefined;
|
202
265
|
}>]>, z.ZodObject<{
|
203
|
-
country: z.
|
266
|
+
country: z.ZodString;
|
267
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
204
268
|
state: z.ZodString;
|
205
269
|
district2: z.ZodString;
|
206
270
|
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
@@ -211,6 +275,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
211
275
|
}, "strip", z.ZodTypeAny, {
|
212
276
|
country: string;
|
213
277
|
state: string;
|
278
|
+
addressType: "INTERNATIONAL";
|
214
279
|
district2: string;
|
215
280
|
cityOrTown?: string | null | undefined;
|
216
281
|
addressLine1?: string | null | undefined;
|
@@ -220,6 +285,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
220
285
|
}, {
|
221
286
|
country: string;
|
222
287
|
state: string;
|
288
|
+
addressType: "INTERNATIONAL";
|
223
289
|
district2: string;
|
224
290
|
cityOrTown?: string | null | undefined;
|
225
291
|
addressLine1?: string | null | undefined;
|
@@ -235,6 +301,7 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
235
301
|
} | {
|
236
302
|
country: string;
|
237
303
|
district: string;
|
304
|
+
addressType: "DOMESTIC";
|
238
305
|
province: string;
|
239
306
|
urbanOrRural: "URBAN";
|
240
307
|
number?: string | null | undefined;
|
@@ -242,15 +309,25 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
242
309
|
residentialArea?: string | null | undefined;
|
243
310
|
street?: string | null | undefined;
|
244
311
|
zipCode?: string | null | undefined;
|
312
|
+
} | {
|
313
|
+
firstname: string;
|
314
|
+
surname: string;
|
315
|
+
middlename?: string | undefined;
|
316
|
+
} | {
|
317
|
+
firstname?: string | null | undefined;
|
318
|
+
surname?: string | null | undefined;
|
319
|
+
middlename?: string | null | undefined;
|
245
320
|
} | {
|
246
321
|
country: string;
|
247
322
|
district: string;
|
323
|
+
addressType: "DOMESTIC";
|
248
324
|
province: string;
|
249
325
|
urbanOrRural: "RURAL";
|
250
326
|
village?: string | null | undefined;
|
251
327
|
} | {
|
252
328
|
country: string;
|
253
329
|
state: string;
|
330
|
+
addressType: "INTERNATIONAL";
|
254
331
|
district2: string;
|
255
332
|
cityOrTown?: string | null | undefined;
|
256
333
|
addressLine1?: string | null | undefined;
|
@@ -262,7 +339,7 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
262
339
|
option: string;
|
263
340
|
filename: string;
|
264
341
|
originalFilename: string;
|
265
|
-
}[] | null | undefined;
|
342
|
+
}[] | [string, string] | null | undefined;
|
266
343
|
}, {
|
267
344
|
[x: string]: string | number | boolean | {
|
268
345
|
type: string;
|
@@ -271,6 +348,7 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
271
348
|
} | {
|
272
349
|
country: string;
|
273
350
|
district: string;
|
351
|
+
addressType: "DOMESTIC";
|
274
352
|
province: string;
|
275
353
|
urbanOrRural: "URBAN";
|
276
354
|
number?: string | null | undefined;
|
@@ -278,15 +356,25 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
278
356
|
residentialArea?: string | null | undefined;
|
279
357
|
street?: string | null | undefined;
|
280
358
|
zipCode?: string | null | undefined;
|
359
|
+
} | {
|
360
|
+
firstname: string;
|
361
|
+
surname: string;
|
362
|
+
middlename?: string | undefined;
|
363
|
+
} | {
|
364
|
+
firstname?: string | null | undefined;
|
365
|
+
surname?: string | null | undefined;
|
366
|
+
middlename?: string | null | undefined;
|
281
367
|
} | {
|
282
368
|
country: string;
|
283
369
|
district: string;
|
370
|
+
addressType: "DOMESTIC";
|
284
371
|
province: string;
|
285
372
|
urbanOrRural: "RURAL";
|
286
373
|
village?: string | null | undefined;
|
287
374
|
} | {
|
288
375
|
country: string;
|
289
376
|
state: string;
|
377
|
+
addressType: "INTERNATIONAL";
|
290
378
|
district2: string;
|
291
379
|
cityOrTown?: string | null | undefined;
|
292
380
|
addressLine1?: string | null | undefined;
|
@@ -298,43 +386,14 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
298
386
|
option: string;
|
299
387
|
filename: string;
|
300
388
|
originalFilename: string;
|
301
|
-
}[] | null | undefined;
|
389
|
+
}[] | [string, string] | null | undefined;
|
302
390
|
}>;
|
303
|
-
/**
|
304
|
-
* Quick-and-dirty mock data generator for event actions.
|
305
|
-
*/
|
306
|
-
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number): string | true | 19 | {
|
307
|
-
country: string;
|
308
|
-
province: string;
|
309
|
-
district: string;
|
310
|
-
urbanOrRural: string;
|
311
|
-
town: string;
|
312
|
-
residentialArea: string;
|
313
|
-
street: string;
|
314
|
-
number: string;
|
315
|
-
zipCode: string;
|
316
|
-
filename?: undefined;
|
317
|
-
originalFilename?: undefined;
|
318
|
-
type?: undefined;
|
319
|
-
} | {
|
320
|
-
filename: string;
|
321
|
-
originalFilename: string;
|
322
|
-
type: string;
|
323
|
-
country?: undefined;
|
324
|
-
province?: undefined;
|
325
|
-
district?: undefined;
|
326
|
-
urbanOrRural?: undefined;
|
327
|
-
town?: undefined;
|
328
|
-
residentialArea?: undefined;
|
329
|
-
street?: undefined;
|
330
|
-
number?: undefined;
|
331
|
-
zipCode?: undefined;
|
332
|
-
} | null;
|
333
391
|
/**
|
334
392
|
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
335
393
|
*/
|
336
394
|
export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
|
337
395
|
country: null;
|
396
|
+
addressType: "DOMESTIC";
|
338
397
|
province: null;
|
339
398
|
district: null;
|
340
399
|
urbanOrRural: string;
|
@@ -351,6 +410,7 @@ export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] |
|
|
351
410
|
originalFilename: string;
|
352
411
|
type: string;
|
353
412
|
country?: undefined;
|
413
|
+
addressType?: undefined;
|
354
414
|
province?: undefined;
|
355
415
|
district?: undefined;
|
356
416
|
urbanOrRural?: undefined;
|
@@ -374,6 +434,13 @@ export declare const isDateFieldType: (field: {
|
|
374
434
|
value: string;
|
375
435
|
config: DateField;
|
376
436
|
};
|
437
|
+
export declare const isDateRangeFieldType: (field: {
|
438
|
+
config: FieldConfig;
|
439
|
+
value: FieldValue;
|
440
|
+
}) => field is {
|
441
|
+
value: string;
|
442
|
+
config: DateField;
|
443
|
+
};
|
377
444
|
export declare const isPageHeaderFieldType: (field: {
|
378
445
|
config: FieldConfig;
|
379
446
|
value: FieldValue;
|
@@ -395,6 +462,27 @@ export declare const isNumberFieldType: (field: {
|
|
395
462
|
value: number;
|
396
463
|
config: NumberField;
|
397
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
|
+
};
|
398
486
|
export declare const isTextAreaFieldType: (field: {
|
399
487
|
config: FieldConfig;
|
400
488
|
value: FieldValue;
|
@@ -404,9 +492,9 @@ export declare const isTextAreaFieldType: (field: {
|
|
404
492
|
};
|
405
493
|
export declare const isSignatureFieldType: (field: {
|
406
494
|
config: FieldConfig;
|
407
|
-
value: FieldValue;
|
495
|
+
value: FieldValue | undefined;
|
408
496
|
}) => field is {
|
409
|
-
value:
|
497
|
+
value: FileFieldValue | undefined;
|
410
498
|
config: SignatureField;
|
411
499
|
};
|
412
500
|
export declare const isEmailFieldType: (field: {
|
@@ -507,5 +595,15 @@ export declare const isOfficeFieldType: (field: {
|
|
507
595
|
value: string;
|
508
596
|
config: Office;
|
509
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;
|
510
608
|
export {};
|
511
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;
|
@@ -48,7 +55,8 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
48
55
|
filename: string;
|
49
56
|
originalFilename: string;
|
50
57
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
51
|
-
country: z.
|
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;
|
@@ -79,7 +89,8 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
79
89
|
street?: string | undefined;
|
80
90
|
zipCode?: string | undefined;
|
81
91
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
82
|
-
country: z.
|
92
|
+
country: z.ZodString;
|
93
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
83
94
|
province: z.ZodString;
|
84
95
|
district: z.ZodString;
|
85
96
|
}, {
|
@@ -88,17 +99,20 @@ 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
|
-
}>, z.ZodObject<{
|
101
|
-
country: z.
|
113
|
+
}>, z.ZodUndefined, z.ZodObject<{
|
114
|
+
country: z.ZodString;
|
115
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
102
116
|
state: z.ZodString;
|
103
117
|
district2: z.ZodString;
|
104
118
|
cityOrTown: z.ZodOptional<z.ZodString>;
|
@@ -109,6 +123,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
109
123
|
}, "strip", z.ZodTypeAny, {
|
110
124
|
country: string;
|
111
125
|
state: string;
|
126
|
+
addressType: "INTERNATIONAL";
|
112
127
|
district2: string;
|
113
128
|
cityOrTown?: string | undefined;
|
114
129
|
addressLine1?: string | undefined;
|
@@ -118,15 +133,40 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
118
133
|
}, {
|
119
134
|
country: string;
|
120
135
|
state: string;
|
136
|
+
addressType: "INTERNATIONAL";
|
121
137
|
district2: string;
|
122
138
|
cityOrTown?: string | undefined;
|
123
139
|
addressLine1?: string | undefined;
|
124
140
|
addressLine2?: string | undefined;
|
125
141
|
addressLine3?: string | undefined;
|
126
142
|
postcodeOrZip?: string | undefined;
|
127
|
-
}
|
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.ZodOptional<z.ZodNullable<z.ZodString>>;
|
157
|
+
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
158
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
160
|
+
firstname?: string | null | undefined;
|
161
|
+
surname?: string | null | undefined;
|
162
|
+
middlename?: string | null | undefined;
|
163
|
+
}, {
|
164
|
+
firstname?: string | null | undefined;
|
165
|
+
surname?: string | null | undefined;
|
166
|
+
middlename?: string | null | undefined;
|
167
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
128
168
|
export type FieldValue = z.infer<typeof FieldValue>;
|
129
|
-
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<{
|
130
170
|
filename: z.ZodString;
|
131
171
|
originalFilename: z.ZodString;
|
132
172
|
type: z.ZodString;
|
@@ -154,7 +194,8 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
154
194
|
filename: string;
|
155
195
|
originalFilename: string;
|
156
196
|
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{
|
157
|
-
country: z.
|
197
|
+
country: z.ZodString;
|
198
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
158
199
|
province: z.ZodString;
|
159
200
|
district: z.ZodString;
|
160
201
|
}, {
|
@@ -167,6 +208,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
167
208
|
}>, "strip", z.ZodTypeAny, {
|
168
209
|
country: string;
|
169
210
|
district: string;
|
211
|
+
addressType: "DOMESTIC";
|
170
212
|
province: string;
|
171
213
|
urbanOrRural: "URBAN";
|
172
214
|
number?: string | null | undefined;
|
@@ -177,6 +219,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
177
219
|
}, {
|
178
220
|
country: string;
|
179
221
|
district: string;
|
222
|
+
addressType: "DOMESTIC";
|
180
223
|
province: string;
|
181
224
|
urbanOrRural: "URBAN";
|
182
225
|
number?: string | null | undefined;
|
@@ -185,7 +228,8 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
185
228
|
street?: string | null | undefined;
|
186
229
|
zipCode?: string | null | undefined;
|
187
230
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
188
|
-
country: z.
|
231
|
+
country: z.ZodString;
|
232
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
189
233
|
province: z.ZodString;
|
190
234
|
district: z.ZodString;
|
191
235
|
}, {
|
@@ -194,17 +238,20 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
194
238
|
}>, "strip", z.ZodTypeAny, {
|
195
239
|
country: string;
|
196
240
|
district: string;
|
241
|
+
addressType: "DOMESTIC";
|
197
242
|
province: string;
|
198
243
|
urbanOrRural: "RURAL";
|
199
244
|
village?: string | null | undefined;
|
200
245
|
}, {
|
201
246
|
country: string;
|
202
247
|
district: string;
|
248
|
+
addressType: "DOMESTIC";
|
203
249
|
province: string;
|
204
250
|
urbanOrRural: "RURAL";
|
205
251
|
village?: string | null | undefined;
|
206
|
-
}>, z.ZodObject<{
|
207
|
-
country: z.
|
252
|
+
}>, z.ZodUndefined, z.ZodObject<{
|
253
|
+
country: z.ZodString;
|
254
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
208
255
|
state: z.ZodString;
|
209
256
|
district2: z.ZodString;
|
210
257
|
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
@@ -215,6 +262,7 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
215
262
|
}, "strip", z.ZodTypeAny, {
|
216
263
|
country: string;
|
217
264
|
state: string;
|
265
|
+
addressType: "INTERNATIONAL";
|
218
266
|
district2: string;
|
219
267
|
cityOrTown?: string | null | undefined;
|
220
268
|
addressLine1?: string | null | undefined;
|
@@ -224,22 +272,35 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
224
272
|
}, {
|
225
273
|
country: string;
|
226
274
|
state: string;
|
275
|
+
addressType: "INTERNATIONAL";
|
227
276
|
district2: string;
|
228
277
|
cityOrTown?: string | null | undefined;
|
229
278
|
addressLine1?: string | null | undefined;
|
230
279
|
addressLine2?: string | null | undefined;
|
231
280
|
addressLine3?: string | null | undefined;
|
232
281
|
postcodeOrZip?: string | null | undefined;
|
233
|
-
}
|
282
|
+
}>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
283
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
284
|
+
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
285
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
287
|
+
firstname?: string | null | undefined;
|
288
|
+
surname?: string | null | undefined;
|
289
|
+
middlename?: string | null | undefined;
|
290
|
+
}, {
|
291
|
+
firstname?: string | null | undefined;
|
292
|
+
surname?: string | null | undefined;
|
293
|
+
middlename?: string | null | undefined;
|
294
|
+
}>, z.ZodNull]>, z.ZodUndefined]>]>;
|
234
295
|
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
235
296
|
/**
|
236
297
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
237
298
|
* */
|
238
|
-
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;
|
239
300
|
/**
|
240
301
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
241
302
|
*
|
242
303
|
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
243
304
|
* */
|
244
|
-
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;
|
245
306
|
//# sourceMappingURL=FieldValue.d.ts.map
|