@opencrvs/toolkit 1.8.0-rc.fd16d13 → 1.8.0-rc.fd16dc2
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 +12875 -13596
- package/dist/commons/conditionals/conditionals.d.ts +31 -12
- package/dist/commons/conditionals/validate.d.ts +18 -17
- package/dist/commons/events/ActionConfig.d.ts +124475 -2015
- package/dist/commons/events/ActionDocument.d.ts +11605 -921
- package/dist/commons/events/ActionInput.d.ts +5999 -1302
- package/dist/commons/events/ActionType.d.ts +30 -11
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1260 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +92 -21
- 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 +4132 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +408 -130
- package/dist/commons/events/EventConfig.d.ts +59982 -1782
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +4029 -1116
- package/dist/commons/events/EventIndex.d.ts +2226 -24
- package/dist/commons/events/EventMetadata.d.ts +343 -42
- package/dist/commons/events/FieldConfig.d.ts +6364 -1008
- package/dist/commons/events/FieldType.d.ts +8 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +193 -63
- package/dist/commons/events/FieldValue.d.ts +118 -28
- package/dist/commons/events/FormConfig.d.ts +52557 -90
- package/dist/commons/events/PageConfig.d.ts +13129 -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 +34 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +8116 -20
- package/dist/commons/events/defineConfig.d.ts +9801 -301
- package/dist/commons/events/event.d.ts +46 -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 +227 -292
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +16184 -103
- package/dist/commons/events/utils.test.d.ts +2 -0
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +211 -115
- package/dist/events/index.js +5652 -2368
- package/dist/scopes/index.d.ts +247 -1
- package/dist/scopes/index.js +231 -1
- package/package.json +4 -3
@@ -1,16 +1,20 @@
|
|
1
1
|
export declare const FieldType: {
|
2
|
+
readonly NAME: "NAME";
|
3
|
+
readonly PHONE: "PHONE";
|
4
|
+
readonly ID: "ID";
|
2
5
|
readonly ADDRESS: "ADDRESS";
|
3
6
|
readonly TEXT: "TEXT";
|
4
7
|
readonly NUMBER: "NUMBER";
|
5
8
|
readonly TEXTAREA: "TEXTAREA";
|
6
9
|
readonly EMAIL: "EMAIL";
|
7
10
|
readonly DATE: "DATE";
|
11
|
+
readonly DATE_RANGE: "DATE_RANGE";
|
12
|
+
readonly SELECT_DATE_RANGE: "SELECT_DATE_RANGE";
|
8
13
|
readonly PARAGRAPH: "PARAGRAPH";
|
9
14
|
readonly PAGE_HEADER: "PAGE_HEADER";
|
10
15
|
readonly RADIO_GROUP: "RADIO_GROUP";
|
11
16
|
readonly FILE: "FILE";
|
12
17
|
readonly FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS";
|
13
|
-
readonly HIDDEN: "HIDDEN";
|
14
18
|
readonly BULLET_LIST: "BULLET_LIST";
|
15
19
|
readonly CHECKBOX: "CHECKBOX";
|
16
20
|
readonly SELECT: "SELECT";
|
@@ -21,11 +25,12 @@ export declare const FieldType: {
|
|
21
25
|
readonly FACILITY: "FACILITY";
|
22
26
|
readonly OFFICE: "OFFICE";
|
23
27
|
readonly SIGNATURE: "SIGNATURE";
|
28
|
+
readonly DATA: "DATA";
|
24
29
|
};
|
25
|
-
export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "
|
30
|
+
export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[];
|
26
31
|
export type FieldType = (typeof fieldTypes)[number];
|
27
32
|
/**
|
28
33
|
* Composite field types are field types that consist of multiple field values.
|
29
34
|
*/
|
30
|
-
export declare const compositeFieldTypes: ("ADDRESS" | "FILE" | "FILE_WITH_OPTIONS")[];
|
35
|
+
export declare const compositeFieldTypes: ("ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS")[];
|
31
36
|
//# sourceMappingURL=FieldType.d.ts.map
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField } from './FieldConfig';
|
2
|
+
import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField } from './FieldConfig';
|
3
3
|
import { FieldType } from './FieldType';
|
4
|
-
import { FieldValue, FieldUpdateValueSchema } from './FieldValue';
|
5
|
-
import {
|
4
|
+
import { FieldValue, FieldUpdateValueSchema, DateRangeFieldValue, SelectDateRangeValue } from './FieldValue';
|
5
|
+
import { FullDocumentPath } from '../documents';
|
6
|
+
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue, NameFieldValue } from './CompositeFieldValue';
|
6
7
|
/**
|
7
8
|
* FieldTypeMapping.ts should include functions that map field types to different formats dynamically.
|
8
9
|
* File is separated from FieldType and FieldConfig to avoid circular dependencies.
|
@@ -19,31 +20,80 @@ type NullishFieldValueSchema = z.ZodOptional<z.ZodNullable<FieldUpdateValueSchem
|
|
19
20
|
* Useful for building dynamic validations against FieldConfig
|
20
21
|
*/
|
21
22
|
export declare function mapFieldTypeToZod(type: FieldType, required?: boolean): z.ZodString | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodObject<{
|
22
|
-
|
23
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
23
24
|
originalFilename: z.ZodString;
|
24
25
|
type: z.ZodString;
|
25
26
|
}, "strip", z.ZodTypeAny, {
|
26
27
|
type: string;
|
27
|
-
|
28
|
+
path: string;
|
28
29
|
originalFilename: string;
|
29
30
|
}, {
|
30
31
|
type: string;
|
31
|
-
|
32
|
+
path: string;
|
32
33
|
originalFilename: string;
|
33
34
|
}> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
34
|
-
|
35
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
35
36
|
originalFilename: z.ZodString;
|
36
37
|
type: z.ZodString;
|
37
38
|
}, "strip", z.ZodTypeAny, {
|
38
39
|
type: string;
|
39
|
-
|
40
|
+
path: string;
|
40
41
|
originalFilename: string;
|
41
42
|
}, {
|
42
43
|
type: string;
|
43
|
-
|
44
|
+
path: string;
|
44
45
|
originalFilename: string;
|
45
|
-
}>>> | z.
|
46
|
-
|
46
|
+
}>>> | z.ZodObject<{
|
47
|
+
firstname: z.ZodString;
|
48
|
+
surname: z.ZodString;
|
49
|
+
middlename: z.ZodOptional<z.ZodString>;
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
51
|
+
firstname: string;
|
52
|
+
surname: string;
|
53
|
+
middlename?: string | undefined;
|
54
|
+
}, {
|
55
|
+
firstname: string;
|
56
|
+
surname: string;
|
57
|
+
middlename?: string | undefined;
|
58
|
+
}> | z.ZodUndefined | z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
59
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
60
|
+
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
61
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
63
|
+
firstname?: string | null | undefined;
|
64
|
+
surname?: string | null | undefined;
|
65
|
+
middlename?: string | null | undefined;
|
66
|
+
}, {
|
67
|
+
firstname?: string | null | undefined;
|
68
|
+
surname?: string | null | undefined;
|
69
|
+
middlename?: string | null | undefined;
|
70
|
+
}>, z.ZodNull]>, z.ZodUndefined]> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
71
|
+
firstname: z.ZodString;
|
72
|
+
surname: z.ZodString;
|
73
|
+
middlename: z.ZodOptional<z.ZodString>;
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
75
|
+
firstname: string;
|
76
|
+
surname: string;
|
77
|
+
middlename?: string | undefined;
|
78
|
+
}, {
|
79
|
+
firstname: string;
|
80
|
+
surname: string;
|
81
|
+
middlename?: string | undefined;
|
82
|
+
}>>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
83
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
84
|
+
surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
85
|
+
middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
87
|
+
firstname?: string | null | undefined;
|
88
|
+
surname?: string | null | undefined;
|
89
|
+
middlename?: string | null | undefined;
|
90
|
+
}, {
|
91
|
+
firstname?: string | null | undefined;
|
92
|
+
surname?: string | null | undefined;
|
93
|
+
middlename?: string | null | undefined;
|
94
|
+
}>, z.ZodNull]>, z.ZodUndefined]>>> | z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
95
|
+
country: z.ZodString;
|
96
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
47
97
|
province: z.ZodString;
|
48
98
|
district: z.ZodString;
|
49
99
|
}, {
|
@@ -56,6 +106,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
56
106
|
}>, "strip", z.ZodTypeAny, {
|
57
107
|
country: string;
|
58
108
|
district: string;
|
109
|
+
addressType: "DOMESTIC";
|
59
110
|
province: string;
|
60
111
|
urbanOrRural: "URBAN";
|
61
112
|
number?: string | null | undefined;
|
@@ -66,6 +117,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
66
117
|
}, {
|
67
118
|
country: string;
|
68
119
|
district: string;
|
120
|
+
addressType: "DOMESTIC";
|
69
121
|
province: string;
|
70
122
|
urbanOrRural: "URBAN";
|
71
123
|
number?: string | null | undefined;
|
@@ -74,7 +126,8 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
74
126
|
street?: string | null | undefined;
|
75
127
|
zipCode?: string | null | undefined;
|
76
128
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
77
|
-
country: z.
|
129
|
+
country: z.ZodString;
|
130
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
78
131
|
province: z.ZodString;
|
79
132
|
district: z.ZodString;
|
80
133
|
}, {
|
@@ -83,17 +136,20 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
83
136
|
}>, "strip", z.ZodTypeAny, {
|
84
137
|
country: string;
|
85
138
|
district: string;
|
139
|
+
addressType: "DOMESTIC";
|
86
140
|
province: string;
|
87
141
|
urbanOrRural: "RURAL";
|
88
142
|
village?: string | null | undefined;
|
89
143
|
}, {
|
90
144
|
country: string;
|
91
145
|
district: string;
|
146
|
+
addressType: "DOMESTIC";
|
92
147
|
province: string;
|
93
148
|
urbanOrRural: "RURAL";
|
94
149
|
village?: string | null | undefined;
|
95
150
|
}>]>, z.ZodObject<{
|
96
|
-
country: z.
|
151
|
+
country: z.ZodString;
|
152
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
97
153
|
state: z.ZodString;
|
98
154
|
district2: z.ZodString;
|
99
155
|
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
@@ -104,6 +160,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
104
160
|
}, "strip", z.ZodTypeAny, {
|
105
161
|
country: string;
|
106
162
|
state: string;
|
163
|
+
addressType: "INTERNATIONAL";
|
107
164
|
district2: string;
|
108
165
|
cityOrTown?: string | null | undefined;
|
109
166
|
addressLine1?: string | null | undefined;
|
@@ -113,6 +170,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
113
170
|
}, {
|
114
171
|
country: string;
|
115
172
|
state: string;
|
173
|
+
addressType: "INTERNATIONAL";
|
116
174
|
district2: string;
|
117
175
|
cityOrTown?: string | null | undefined;
|
118
176
|
addressLine1?: string | null | undefined;
|
@@ -120,37 +178,56 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
120
178
|
addressLine3?: string | null | undefined;
|
121
179
|
postcodeOrZip?: string | null | undefined;
|
122
180
|
}>]> | z.ZodArray<z.ZodObject<{
|
123
|
-
|
181
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
124
182
|
originalFilename: z.ZodString;
|
125
183
|
type: z.ZodString;
|
126
184
|
option: z.ZodString;
|
127
185
|
}, "strip", z.ZodTypeAny, {
|
128
186
|
type: string;
|
129
187
|
option: string;
|
130
|
-
|
188
|
+
path: string;
|
131
189
|
originalFilename: string;
|
132
190
|
}, {
|
133
191
|
type: string;
|
134
192
|
option: string;
|
135
|
-
|
193
|
+
path: string;
|
136
194
|
originalFilename: string;
|
137
195
|
}>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
138
|
-
|
196
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
139
197
|
originalFilename: z.ZodString;
|
140
198
|
type: z.ZodString;
|
141
199
|
option: z.ZodString;
|
142
200
|
}, "strip", z.ZodTypeAny, {
|
143
201
|
type: string;
|
144
202
|
option: string;
|
145
|
-
|
203
|
+
path: string;
|
146
204
|
originalFilename: string;
|
147
205
|
}, {
|
148
206
|
type: string;
|
149
207
|
option: string;
|
150
|
-
|
208
|
+
path: string;
|
151
209
|
originalFilename: string;
|
152
|
-
}>, "many">>> | z.
|
153
|
-
|
210
|
+
}>, "many">>> | z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]> | z.ZodUnion<[z.ZodObject<{
|
211
|
+
start: z.ZodString;
|
212
|
+
end: z.ZodString;
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
214
|
+
start: string;
|
215
|
+
end: string;
|
216
|
+
}, {
|
217
|
+
start: string;
|
218
|
+
end: string;
|
219
|
+
}>, z.ZodString]> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
|
220
|
+
start: z.ZodString;
|
221
|
+
end: z.ZodString;
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
223
|
+
start: string;
|
224
|
+
end: string;
|
225
|
+
}, {
|
226
|
+
start: string;
|
227
|
+
end: string;
|
228
|
+
}>, z.ZodString]>>> | z.ZodOptional<z.ZodNullable<z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
229
|
+
country: z.ZodString;
|
230
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
154
231
|
province: z.ZodString;
|
155
232
|
district: z.ZodString;
|
156
233
|
}, {
|
@@ -163,6 +240,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
163
240
|
}>, "strip", z.ZodTypeAny, {
|
164
241
|
country: string;
|
165
242
|
district: string;
|
243
|
+
addressType: "DOMESTIC";
|
166
244
|
province: string;
|
167
245
|
urbanOrRural: "URBAN";
|
168
246
|
number?: string | null | undefined;
|
@@ -173,6 +251,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
173
251
|
}, {
|
174
252
|
country: string;
|
175
253
|
district: string;
|
254
|
+
addressType: "DOMESTIC";
|
176
255
|
province: string;
|
177
256
|
urbanOrRural: "URBAN";
|
178
257
|
number?: string | null | undefined;
|
@@ -181,7 +260,8 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
181
260
|
street?: string | null | undefined;
|
182
261
|
zipCode?: string | null | undefined;
|
183
262
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
184
|
-
country: z.
|
263
|
+
country: z.ZodString;
|
264
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
185
265
|
province: z.ZodString;
|
186
266
|
district: z.ZodString;
|
187
267
|
}, {
|
@@ -190,17 +270,20 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
190
270
|
}>, "strip", z.ZodTypeAny, {
|
191
271
|
country: string;
|
192
272
|
district: string;
|
273
|
+
addressType: "DOMESTIC";
|
193
274
|
province: string;
|
194
275
|
urbanOrRural: "RURAL";
|
195
276
|
village?: string | null | undefined;
|
196
277
|
}, {
|
197
278
|
country: string;
|
198
279
|
district: string;
|
280
|
+
addressType: "DOMESTIC";
|
199
281
|
province: string;
|
200
282
|
urbanOrRural: "RURAL";
|
201
283
|
village?: string | null | undefined;
|
202
284
|
}>]>, z.ZodObject<{
|
203
|
-
country: z.
|
285
|
+
country: z.ZodString;
|
286
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
204
287
|
state: z.ZodString;
|
205
288
|
district2: z.ZodString;
|
206
289
|
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
@@ -211,6 +294,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
211
294
|
}, "strip", z.ZodTypeAny, {
|
212
295
|
country: string;
|
213
296
|
state: string;
|
297
|
+
addressType: "INTERNATIONAL";
|
214
298
|
district2: string;
|
215
299
|
cityOrTown?: string | null | undefined;
|
216
300
|
addressLine1?: string | null | undefined;
|
@@ -220,6 +304,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
220
304
|
}, {
|
221
305
|
country: string;
|
222
306
|
state: string;
|
307
|
+
addressType: "INTERNATIONAL";
|
223
308
|
district2: string;
|
224
309
|
cityOrTown?: string | null | undefined;
|
225
310
|
addressLine1?: string | null | undefined;
|
@@ -230,11 +315,12 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
230
315
|
export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
|
231
316
|
[x: string]: string | number | boolean | {
|
232
317
|
type: string;
|
233
|
-
|
318
|
+
path: string;
|
234
319
|
originalFilename: string;
|
235
320
|
} | {
|
236
321
|
country: string;
|
237
322
|
district: string;
|
323
|
+
addressType: "DOMESTIC";
|
238
324
|
province: string;
|
239
325
|
urbanOrRural: "URBAN";
|
240
326
|
number?: string | null | undefined;
|
@@ -242,15 +328,25 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
242
328
|
residentialArea?: string | null | undefined;
|
243
329
|
street?: string | null | undefined;
|
244
330
|
zipCode?: string | null | undefined;
|
331
|
+
} | {
|
332
|
+
firstname: string;
|
333
|
+
surname: string;
|
334
|
+
middlename?: string | undefined;
|
335
|
+
} | {
|
336
|
+
firstname?: string | null | undefined;
|
337
|
+
surname?: string | null | undefined;
|
338
|
+
middlename?: string | null | undefined;
|
245
339
|
} | {
|
246
340
|
country: string;
|
247
341
|
district: string;
|
342
|
+
addressType: "DOMESTIC";
|
248
343
|
province: string;
|
249
344
|
urbanOrRural: "RURAL";
|
250
345
|
village?: string | null | undefined;
|
251
346
|
} | {
|
252
347
|
country: string;
|
253
348
|
state: string;
|
349
|
+
addressType: "INTERNATIONAL";
|
254
350
|
district2: string;
|
255
351
|
cityOrTown?: string | null | undefined;
|
256
352
|
addressLine1?: string | null | undefined;
|
@@ -260,17 +356,21 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
260
356
|
} | {
|
261
357
|
type: string;
|
262
358
|
option: string;
|
263
|
-
|
359
|
+
path: string;
|
264
360
|
originalFilename: string;
|
265
|
-
}[] |
|
361
|
+
}[] | {
|
362
|
+
start: string;
|
363
|
+
end: string;
|
364
|
+
} | null | undefined;
|
266
365
|
}, {
|
267
366
|
[x: string]: string | number | boolean | {
|
268
367
|
type: string;
|
269
|
-
|
368
|
+
path: string;
|
270
369
|
originalFilename: string;
|
271
370
|
} | {
|
272
371
|
country: string;
|
273
372
|
district: string;
|
373
|
+
addressType: "DOMESTIC";
|
274
374
|
province: string;
|
275
375
|
urbanOrRural: "URBAN";
|
276
376
|
number?: string | null | undefined;
|
@@ -278,15 +378,25 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
278
378
|
residentialArea?: string | null | undefined;
|
279
379
|
street?: string | null | undefined;
|
280
380
|
zipCode?: string | null | undefined;
|
381
|
+
} | {
|
382
|
+
firstname: string;
|
383
|
+
surname: string;
|
384
|
+
middlename?: string | undefined;
|
385
|
+
} | {
|
386
|
+
firstname?: string | null | undefined;
|
387
|
+
surname?: string | null | undefined;
|
388
|
+
middlename?: string | null | undefined;
|
281
389
|
} | {
|
282
390
|
country: string;
|
283
391
|
district: string;
|
392
|
+
addressType: "DOMESTIC";
|
284
393
|
province: string;
|
285
394
|
urbanOrRural: "RURAL";
|
286
395
|
village?: string | null | undefined;
|
287
396
|
} | {
|
288
397
|
country: string;
|
289
398
|
state: string;
|
399
|
+
addressType: "INTERNATIONAL";
|
290
400
|
district2: string;
|
291
401
|
cityOrTown?: string | null | undefined;
|
292
402
|
addressLine1?: string | null | undefined;
|
@@ -296,45 +406,19 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
296
406
|
} | {
|
297
407
|
type: string;
|
298
408
|
option: string;
|
299
|
-
|
409
|
+
path: string;
|
300
410
|
originalFilename: string;
|
301
|
-
}[] |
|
411
|
+
}[] | {
|
412
|
+
start: string;
|
413
|
+
end: string;
|
414
|
+
} | null | undefined;
|
302
415
|
}>;
|
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
416
|
/**
|
334
417
|
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
335
418
|
*/
|
336
419
|
export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
|
337
420
|
country: null;
|
421
|
+
addressType: "DOMESTIC";
|
338
422
|
province: null;
|
339
423
|
district: null;
|
340
424
|
urbanOrRural: string;
|
@@ -343,14 +427,15 @@ export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] |
|
|
343
427
|
street: null;
|
344
428
|
number: null;
|
345
429
|
zipCode: null;
|
346
|
-
|
430
|
+
path?: undefined;
|
347
431
|
originalFilename?: undefined;
|
348
432
|
type?: undefined;
|
349
433
|
} | {
|
350
|
-
|
434
|
+
path: FullDocumentPath;
|
351
435
|
originalFilename: string;
|
352
436
|
type: string;
|
353
437
|
country?: undefined;
|
438
|
+
addressType?: undefined;
|
354
439
|
province?: undefined;
|
355
440
|
district?: undefined;
|
356
441
|
urbanOrRural?: undefined;
|
@@ -374,6 +459,20 @@ export declare const isDateFieldType: (field: {
|
|
374
459
|
value: string;
|
375
460
|
config: DateField;
|
376
461
|
};
|
462
|
+
export declare const isDateRangeFieldType: (field: {
|
463
|
+
config: FieldConfig;
|
464
|
+
value: FieldValue;
|
465
|
+
}) => field is {
|
466
|
+
value: DateRangeFieldValue;
|
467
|
+
config: DateRangeField;
|
468
|
+
};
|
469
|
+
export declare const isSelectDateRangeFieldType: (field: {
|
470
|
+
config: FieldConfig;
|
471
|
+
value: FieldValue;
|
472
|
+
}) => field is {
|
473
|
+
value: SelectDateRangeValue;
|
474
|
+
config: SelectDateRangeField;
|
475
|
+
};
|
377
476
|
export declare const isPageHeaderFieldType: (field: {
|
378
477
|
config: FieldConfig;
|
379
478
|
value: FieldValue;
|
@@ -395,6 +494,27 @@ export declare const isNumberFieldType: (field: {
|
|
395
494
|
value: number;
|
396
495
|
config: NumberField;
|
397
496
|
};
|
497
|
+
export declare const isNameFieldType: (field: {
|
498
|
+
config: FieldConfig;
|
499
|
+
value: FieldValue;
|
500
|
+
}) => field is {
|
501
|
+
value: NameFieldValue;
|
502
|
+
config: NameField;
|
503
|
+
};
|
504
|
+
export declare const isPhoneFieldType: (field: {
|
505
|
+
config: FieldConfig;
|
506
|
+
value: FieldValue;
|
507
|
+
}) => field is {
|
508
|
+
value: string;
|
509
|
+
config: PhoneField;
|
510
|
+
};
|
511
|
+
export declare const isIdFieldType: (field: {
|
512
|
+
config: FieldConfig;
|
513
|
+
value: FieldValue;
|
514
|
+
}) => field is {
|
515
|
+
value: string;
|
516
|
+
config: IdField;
|
517
|
+
};
|
398
518
|
export declare const isTextAreaFieldType: (field: {
|
399
519
|
config: FieldConfig;
|
400
520
|
value: FieldValue;
|
@@ -404,9 +524,9 @@ export declare const isTextAreaFieldType: (field: {
|
|
404
524
|
};
|
405
525
|
export declare const isSignatureFieldType: (field: {
|
406
526
|
config: FieldConfig;
|
407
|
-
value: FieldValue;
|
527
|
+
value: FieldValue | undefined;
|
408
528
|
}) => field is {
|
409
|
-
value:
|
529
|
+
value: FileFieldValue | undefined;
|
410
530
|
config: SignatureField;
|
411
531
|
};
|
412
532
|
export declare const isEmailFieldType: (field: {
|
@@ -507,5 +627,15 @@ export declare const isOfficeFieldType: (field: {
|
|
507
627
|
value: string;
|
508
628
|
config: Office;
|
509
629
|
};
|
630
|
+
export declare const isDataFieldType: (field: {
|
631
|
+
config: FieldConfig;
|
632
|
+
value: FieldValue;
|
633
|
+
}) => field is {
|
634
|
+
value: undefined;
|
635
|
+
config: DataField;
|
636
|
+
};
|
637
|
+
export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField;
|
638
|
+
export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
|
639
|
+
export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
|
510
640
|
export {};
|
511
641
|
//# sourceMappingURL=FieldTypeMapping.d.ts.map
|