@opencrvs/toolkit 1.8.0-rc.fc43738 → 1.8.0-rc.fc76588
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 +17499 -10858
- package/dist/commons/conditionals/conditionals.d.ts +39 -8
- package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
- package/dist/commons/conditionals/validate.d.ts +50 -22
- package/dist/commons/conditionals/validate.test.d.ts +2 -0
- package/dist/commons/events/ActionConfig.d.ts +116822 -2084
- package/dist/commons/events/ActionDocument.d.ts +12597 -1492
- package/dist/commons/events/ActionInput.d.ts +8325 -2272
- 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 +445 -0
- 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 +2 -0
- package/dist/commons/events/Draft.d.ts +631 -217
- package/dist/commons/events/EventConfig.d.ts +56160 -1824
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +5979 -1899
- package/dist/commons/events/EventIndex.d.ts +1595 -27
- package/dist/commons/events/EventMetadata.d.ts +304 -45
- package/dist/commons/events/FieldConfig.d.ts +5822 -969
- package/dist/commons/events/FieldType.d.ts +10 -2
- package/dist/commons/events/FieldTypeMapping.d.ts +335 -51
- package/dist/commons/events/FieldValue.d.ts +177 -65
- package/dist/commons/events/FormConfig.d.ts +49317 -90
- package/dist/commons/events/PageConfig.d.ts +12337 -0
- package/dist/commons/events/SummaryConfig.d.ts +93 -42
- package/dist/commons/events/TemplateConfig.d.ts +38 -0
- 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 +4803 -20
- package/dist/commons/events/defineConfig.d.ts +9111 -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 +11 -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 +262 -259
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +13481 -70
- 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 +4955 -1910
- 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,18 +1,24 @@
|
|
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
|
-
import {
|
4
|
+
import { FieldValue, FieldUpdateValueSchema } from './FieldValue';
|
5
|
+
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue } from './CompositeFieldValue';
|
5
6
|
/**
|
6
7
|
* FieldTypeMapping.ts should include functions that map field types to different formats dynamically.
|
7
8
|
* File is separated from FieldType and FieldConfig to avoid circular dependencies.
|
8
9
|
*
|
9
10
|
* We can move the specific mapFieldTypeTo* functions where they are used once the core fields are implemented.
|
10
11
|
*/
|
12
|
+
/**
|
13
|
+
* Optionality of a field is defined in FieldConfig, not in FieldValue.
|
14
|
+
* Allows for nullishness of a field value during validations based on FieldConfig.
|
15
|
+
*/
|
16
|
+
type NullishFieldValueSchema = z.ZodOptional<z.ZodNullable<FieldUpdateValueSchema>>;
|
11
17
|
/**
|
12
18
|
* Mapping of field types to Zod schema.
|
13
19
|
* Useful for building dynamic validations against FieldConfig
|
14
20
|
*/
|
15
|
-
export declare function mapFieldTypeToZod(type: FieldType, required?: boolean): z.ZodOptional<z.ZodString
|
21
|
+
export declare function mapFieldTypeToZod(type: FieldType, required?: boolean): z.ZodString | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodObject<{
|
16
22
|
filename: z.ZodString;
|
17
23
|
originalFilename: z.ZodString;
|
18
24
|
type: z.ZodString;
|
@@ -24,57 +30,153 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
24
30
|
type: string;
|
25
31
|
filename: string;
|
26
32
|
originalFilename: string;
|
27
|
-
}
|
33
|
+
}> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
34
|
+
filename: z.ZodString;
|
35
|
+
originalFilename: z.ZodString;
|
36
|
+
type: z.ZodString;
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
38
|
+
type: string;
|
39
|
+
filename: string;
|
40
|
+
originalFilename: string;
|
41
|
+
}, {
|
42
|
+
type: string;
|
43
|
+
filename: string;
|
44
|
+
originalFilename: string;
|
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<{
|
28
94
|
country: z.ZodString;
|
95
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
29
96
|
province: z.ZodString;
|
30
97
|
district: z.ZodString;
|
31
98
|
}, {
|
32
99
|
urbanOrRural: z.ZodLiteral<"URBAN">;
|
33
|
-
town: z.ZodOptional<z.ZodString
|
34
|
-
residentialArea: z.ZodOptional<z.ZodString
|
35
|
-
street: z.ZodOptional<z.ZodString
|
36
|
-
number: z.ZodOptional<z.ZodString
|
37
|
-
zipCode: z.ZodOptional<z.ZodString
|
100
|
+
town: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
101
|
+
residentialArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
102
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
103
|
+
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
104
|
+
zipCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
38
105
|
}>, "strip", z.ZodTypeAny, {
|
39
106
|
country: string;
|
40
107
|
district: string;
|
108
|
+
addressType: "DOMESTIC";
|
41
109
|
province: string;
|
42
110
|
urbanOrRural: "URBAN";
|
43
|
-
number?: string | undefined;
|
44
|
-
town?: string | undefined;
|
45
|
-
residentialArea?: string | undefined;
|
46
|
-
street?: string | undefined;
|
47
|
-
zipCode?: string | undefined;
|
111
|
+
number?: string | null | undefined;
|
112
|
+
town?: string | null | undefined;
|
113
|
+
residentialArea?: string | null | undefined;
|
114
|
+
street?: string | null | undefined;
|
115
|
+
zipCode?: string | null | undefined;
|
48
116
|
}, {
|
49
117
|
country: string;
|
50
118
|
district: string;
|
119
|
+
addressType: "DOMESTIC";
|
51
120
|
province: string;
|
52
121
|
urbanOrRural: "URBAN";
|
53
|
-
number?: string | undefined;
|
54
|
-
town?: string | undefined;
|
55
|
-
residentialArea?: string | undefined;
|
56
|
-
street?: string | undefined;
|
57
|
-
zipCode?: string | undefined;
|
122
|
+
number?: string | null | undefined;
|
123
|
+
town?: string | null | undefined;
|
124
|
+
residentialArea?: string | null | undefined;
|
125
|
+
street?: string | null | undefined;
|
126
|
+
zipCode?: string | null | undefined;
|
58
127
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
59
128
|
country: z.ZodString;
|
129
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
60
130
|
province: z.ZodString;
|
61
131
|
district: z.ZodString;
|
62
132
|
}, {
|
63
133
|
urbanOrRural: z.ZodLiteral<"RURAL">;
|
64
|
-
village: z.ZodOptional<z.ZodString
|
134
|
+
village: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
65
135
|
}>, "strip", z.ZodTypeAny, {
|
66
136
|
country: string;
|
67
137
|
district: string;
|
138
|
+
addressType: "DOMESTIC";
|
68
139
|
province: string;
|
69
140
|
urbanOrRural: "RURAL";
|
70
|
-
village?: string | undefined;
|
141
|
+
village?: string | null | undefined;
|
71
142
|
}, {
|
72
143
|
country: string;
|
73
144
|
district: string;
|
145
|
+
addressType: "DOMESTIC";
|
74
146
|
province: string;
|
75
147
|
urbanOrRural: "RURAL";
|
76
|
-
village?: string | undefined;
|
77
|
-
}>]
|
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;
|
179
|
+
}>]> | z.ZodArray<z.ZodObject<{
|
78
180
|
filename: z.ZodString;
|
79
181
|
originalFilename: z.ZodString;
|
80
182
|
type: z.ZodString;
|
@@ -89,8 +191,109 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
89
191
|
option: string;
|
90
192
|
filename: string;
|
91
193
|
originalFilename: string;
|
92
|
-
}>, "many"
|
93
|
-
|
194
|
+
}>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
195
|
+
filename: z.ZodString;
|
196
|
+
originalFilename: z.ZodString;
|
197
|
+
type: z.ZodString;
|
198
|
+
option: z.ZodString;
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
200
|
+
type: string;
|
201
|
+
option: string;
|
202
|
+
filename: string;
|
203
|
+
originalFilename: string;
|
204
|
+
}, {
|
205
|
+
type: string;
|
206
|
+
option: string;
|
207
|
+
filename: string;
|
208
|
+
originalFilename: string;
|
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">;
|
212
|
+
province: z.ZodString;
|
213
|
+
district: z.ZodString;
|
214
|
+
}, {
|
215
|
+
urbanOrRural: z.ZodLiteral<"URBAN">;
|
216
|
+
town: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
217
|
+
residentialArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
218
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
219
|
+
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
220
|
+
zipCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
221
|
+
}>, "strip", z.ZodTypeAny, {
|
222
|
+
country: string;
|
223
|
+
district: string;
|
224
|
+
addressType: "DOMESTIC";
|
225
|
+
province: string;
|
226
|
+
urbanOrRural: "URBAN";
|
227
|
+
number?: string | null | undefined;
|
228
|
+
town?: string | null | undefined;
|
229
|
+
residentialArea?: string | null | undefined;
|
230
|
+
street?: string | null | undefined;
|
231
|
+
zipCode?: string | null | undefined;
|
232
|
+
}, {
|
233
|
+
country: string;
|
234
|
+
district: string;
|
235
|
+
addressType: "DOMESTIC";
|
236
|
+
province: string;
|
237
|
+
urbanOrRural: "URBAN";
|
238
|
+
number?: string | null | undefined;
|
239
|
+
town?: string | null | undefined;
|
240
|
+
residentialArea?: string | null | undefined;
|
241
|
+
street?: string | null | undefined;
|
242
|
+
zipCode?: string | null | undefined;
|
243
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
244
|
+
country: z.ZodString;
|
245
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
246
|
+
province: z.ZodString;
|
247
|
+
district: z.ZodString;
|
248
|
+
}, {
|
249
|
+
urbanOrRural: z.ZodLiteral<"RURAL">;
|
250
|
+
village: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
251
|
+
}>, "strip", z.ZodTypeAny, {
|
252
|
+
country: string;
|
253
|
+
district: string;
|
254
|
+
addressType: "DOMESTIC";
|
255
|
+
province: string;
|
256
|
+
urbanOrRural: "RURAL";
|
257
|
+
village?: string | null | undefined;
|
258
|
+
}, {
|
259
|
+
country: string;
|
260
|
+
district: string;
|
261
|
+
addressType: "DOMESTIC";
|
262
|
+
province: string;
|
263
|
+
urbanOrRural: "RURAL";
|
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;
|
295
|
+
}>]>>>;
|
296
|
+
export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
|
94
297
|
[x: string]: string | number | boolean | {
|
95
298
|
type: string;
|
96
299
|
filename: string;
|
@@ -98,25 +301,45 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
98
301
|
} | {
|
99
302
|
country: string;
|
100
303
|
district: string;
|
304
|
+
addressType: "DOMESTIC";
|
101
305
|
province: string;
|
102
306
|
urbanOrRural: "URBAN";
|
103
|
-
number?: string | undefined;
|
104
|
-
town?: string | undefined;
|
105
|
-
residentialArea?: string | undefined;
|
106
|
-
street?: string | undefined;
|
107
|
-
zipCode?: string | undefined;
|
307
|
+
number?: string | null | undefined;
|
308
|
+
town?: string | null | undefined;
|
309
|
+
residentialArea?: string | null | undefined;
|
310
|
+
street?: string | null | undefined;
|
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;
|
108
320
|
} | {
|
109
321
|
country: string;
|
110
322
|
district: string;
|
323
|
+
addressType: "DOMESTIC";
|
111
324
|
province: string;
|
112
325
|
urbanOrRural: "RURAL";
|
113
|
-
village?: string | undefined;
|
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;
|
114
337
|
} | {
|
115
338
|
type: string;
|
116
339
|
option: string;
|
117
340
|
filename: string;
|
118
341
|
originalFilename: string;
|
119
|
-
}[] | undefined;
|
342
|
+
}[] | [string, string] | null | undefined;
|
120
343
|
}, {
|
121
344
|
[x: string]: string | number | boolean | {
|
122
345
|
type: string;
|
@@ -125,39 +348,60 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
125
348
|
} | {
|
126
349
|
country: string;
|
127
350
|
district: string;
|
351
|
+
addressType: "DOMESTIC";
|
128
352
|
province: string;
|
129
353
|
urbanOrRural: "URBAN";
|
130
|
-
number?: string | undefined;
|
131
|
-
town?: string | undefined;
|
132
|
-
residentialArea?: string | undefined;
|
133
|
-
street?: string | undefined;
|
134
|
-
zipCode?: string | undefined;
|
354
|
+
number?: string | null | undefined;
|
355
|
+
town?: string | null | undefined;
|
356
|
+
residentialArea?: string | null | undefined;
|
357
|
+
street?: string | null | undefined;
|
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;
|
135
367
|
} | {
|
136
368
|
country: string;
|
137
369
|
district: string;
|
370
|
+
addressType: "DOMESTIC";
|
138
371
|
province: string;
|
139
372
|
urbanOrRural: "RURAL";
|
140
|
-
village?: string | undefined;
|
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;
|
141
384
|
} | {
|
142
385
|
type: string;
|
143
386
|
option: string;
|
144
387
|
filename: string;
|
145
388
|
originalFilename: string;
|
146
|
-
}[] | undefined;
|
389
|
+
}[] | [string, string] | null | undefined;
|
147
390
|
}>;
|
148
391
|
/**
|
149
|
-
*
|
392
|
+
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
150
393
|
*/
|
151
|
-
export declare function
|
152
|
-
country:
|
153
|
-
|
154
|
-
|
394
|
+
export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
|
395
|
+
country: null;
|
396
|
+
addressType: "DOMESTIC";
|
397
|
+
province: null;
|
398
|
+
district: null;
|
155
399
|
urbanOrRural: string;
|
156
|
-
town:
|
157
|
-
residentialArea:
|
158
|
-
street:
|
159
|
-
number:
|
160
|
-
zipCode:
|
400
|
+
town: null;
|
401
|
+
residentialArea: null;
|
402
|
+
street: null;
|
403
|
+
number: null;
|
404
|
+
zipCode: null;
|
161
405
|
filename?: undefined;
|
162
406
|
originalFilename?: undefined;
|
163
407
|
type?: undefined;
|
@@ -166,6 +410,7 @@ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number):
|
|
166
410
|
originalFilename: string;
|
167
411
|
type: string;
|
168
412
|
country?: undefined;
|
413
|
+
addressType?: undefined;
|
169
414
|
province?: undefined;
|
170
415
|
district?: undefined;
|
171
416
|
urbanOrRural?: undefined;
|
@@ -189,6 +434,13 @@ export declare const isDateFieldType: (field: {
|
|
189
434
|
value: string;
|
190
435
|
config: DateField;
|
191
436
|
};
|
437
|
+
export declare const isDateRangeFieldType: (field: {
|
438
|
+
config: FieldConfig;
|
439
|
+
value: FieldValue;
|
440
|
+
}) => field is {
|
441
|
+
value: string;
|
442
|
+
config: DateField;
|
443
|
+
};
|
192
444
|
export declare const isPageHeaderFieldType: (field: {
|
193
445
|
config: FieldConfig;
|
194
446
|
value: FieldValue;
|
@@ -210,6 +462,27 @@ export declare const isNumberFieldType: (field: {
|
|
210
462
|
value: number;
|
211
463
|
config: NumberField;
|
212
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
|
+
};
|
213
486
|
export declare const isTextAreaFieldType: (field: {
|
214
487
|
config: FieldConfig;
|
215
488
|
value: FieldValue;
|
@@ -219,9 +492,9 @@ export declare const isTextAreaFieldType: (field: {
|
|
219
492
|
};
|
220
493
|
export declare const isSignatureFieldType: (field: {
|
221
494
|
config: FieldConfig;
|
222
|
-
value: FieldValue;
|
495
|
+
value: FieldValue | undefined;
|
223
496
|
}) => field is {
|
224
|
-
value:
|
497
|
+
value: FileFieldValue | undefined;
|
225
498
|
config: SignatureField;
|
226
499
|
};
|
227
500
|
export declare const isEmailFieldType: (field: {
|
@@ -322,4 +595,15 @@ export declare const isOfficeFieldType: (field: {
|
|
322
595
|
value: string;
|
323
596
|
config: Office;
|
324
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;
|
608
|
+
export {};
|
325
609
|
//# sourceMappingURL=FieldTypeMapping.d.ts.map
|