@opencrvs/toolkit 1.8.0-rc.fc43738 → 1.8.0-rc.fd16d13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commons/api/router.d.ts +6267 -2532
- package/dist/commons/conditionals/conditionals.d.ts +2 -2
- package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
- package/dist/commons/conditionals/validate.d.ts +33 -6
- package/dist/commons/conditionals/validate.test.d.ts +2 -0
- package/dist/commons/events/ActionConfig.d.ts +6 -24
- package/dist/commons/events/ActionDocument.d.ts +2747 -1183
- package/dist/commons/events/ActionInput.d.ts +4120 -1864
- package/dist/commons/events/ActionType.d.ts +1 -1
- package/dist/commons/events/CompositeFieldValue.d.ts +374 -0
- package/dist/commons/events/Draft.d.ts +376 -163
- package/dist/commons/events/EventConfig.d.ts +4 -28
- package/dist/commons/events/EventDocument.d.ts +3275 -1385
- package/dist/commons/events/EventIndex.d.ts +3 -3
- package/dist/commons/events/EventMetadata.d.ts +3 -3
- package/dist/commons/events/FieldConfig.d.ts +51 -3
- package/dist/commons/events/FieldType.d.ts +4 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +226 -40
- package/dist/commons/events/FieldValue.d.ts +119 -68
- package/dist/commons/events/TemplateConfig.d.ts +38 -0
- package/dist/commons/events/defineConfig.d.ts +1 -7
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +183 -69
- package/dist/commons/events/utils.d.ts +114 -3
- package/dist/events/index.js +750 -489
- package/package.json +1 -1
@@ -16,7 +16,7 @@ export declare const EventIndex: z.ZodObject<z.objectUtil.extendShape<{
|
|
16
16
|
createdBy: z.ZodString;
|
17
17
|
createdAtLocation: z.ZodString;
|
18
18
|
modifiedAt: z.ZodString;
|
19
|
-
assignedTo: z.ZodNullable<z.ZodString
|
19
|
+
assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
20
20
|
updatedBy: z.ZodString;
|
21
21
|
trackingId: z.ZodString;
|
22
22
|
}, {
|
@@ -29,10 +29,10 @@ export declare const EventIndex: z.ZodObject<z.objectUtil.extendShape<{
|
|
29
29
|
createdAt: string;
|
30
30
|
createdBy: string;
|
31
31
|
createdAtLocation: string;
|
32
|
-
assignedTo: string | null;
|
33
32
|
trackingId: string;
|
34
33
|
modifiedAt: string;
|
35
34
|
updatedBy: string;
|
35
|
+
assignedTo?: string | null | undefined;
|
36
36
|
}, {
|
37
37
|
type: string;
|
38
38
|
id: string;
|
@@ -41,10 +41,10 @@ export declare const EventIndex: z.ZodObject<z.objectUtil.extendShape<{
|
|
41
41
|
createdAt: string;
|
42
42
|
createdBy: string;
|
43
43
|
createdAtLocation: string;
|
44
|
-
assignedTo: string | null;
|
45
44
|
trackingId: string;
|
46
45
|
modifiedAt: string;
|
47
46
|
updatedBy: string;
|
47
|
+
assignedTo?: string | null | undefined;
|
48
48
|
}>;
|
49
49
|
export declare const EventSearchIndex: z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{
|
50
50
|
type: z.ZodString;
|
@@ -47,7 +47,7 @@ export declare const EventMetadata: z.ZodObject<{
|
|
47
47
|
createdBy: z.ZodString;
|
48
48
|
createdAtLocation: z.ZodString;
|
49
49
|
modifiedAt: z.ZodString;
|
50
|
-
assignedTo: z.ZodNullable<z.ZodString
|
50
|
+
assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
51
51
|
updatedBy: z.ZodString;
|
52
52
|
trackingId: z.ZodString;
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
@@ -57,10 +57,10 @@ export declare const EventMetadata: z.ZodObject<{
|
|
57
57
|
createdAt: string;
|
58
58
|
createdBy: string;
|
59
59
|
createdAtLocation: string;
|
60
|
-
assignedTo: string | null;
|
61
60
|
trackingId: string;
|
62
61
|
modifiedAt: string;
|
63
62
|
updatedBy: string;
|
63
|
+
assignedTo?: string | null | undefined;
|
64
64
|
}, {
|
65
65
|
type: string;
|
66
66
|
id: string;
|
@@ -68,10 +68,10 @@ export declare const EventMetadata: z.ZodObject<{
|
|
68
68
|
createdAt: string;
|
69
69
|
createdBy: string;
|
70
70
|
createdAtLocation: string;
|
71
|
-
assignedTo: string | null;
|
72
71
|
trackingId: string;
|
73
72
|
modifiedAt: string;
|
74
73
|
updatedBy: string;
|
74
|
+
assignedTo?: string | null | undefined;
|
75
75
|
}>;
|
76
76
|
export type EventMetadata = z.infer<typeof EventMetadata>;
|
77
77
|
export type EventMetadataKeys = `event.${keyof EventMetadata}`;
|
@@ -1170,6 +1170,8 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
1170
1170
|
} | undefined;
|
1171
1171
|
}>;
|
1172
1172
|
export type DateField = z.infer<typeof DateField>;
|
1173
|
+
declare const HtmlFontVariant: z.ZodEnum<["reg12", "reg14", "reg16", "reg18", "h4", "h3", "h2", "h1"]>;
|
1174
|
+
export type HtmlFontVariant = z.infer<typeof HtmlFontVariant>;
|
1173
1175
|
declare const Paragraph: z.ZodObject<z.objectUtil.extendShape<{
|
1174
1176
|
id: z.ZodString;
|
1175
1177
|
defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
@@ -2317,6 +2319,7 @@ declare const Country: z.ZodObject<z.objectUtil.extendShape<{
|
|
2317
2319
|
hideLabel?: boolean | undefined;
|
2318
2320
|
}>;
|
2319
2321
|
export type Country = z.infer<typeof Country>;
|
2322
|
+
export declare const AdministrativeAreas: z.ZodEnum<["ADMIN_STRUCTURE", "HEALTH_FACILITY", "CRVS_OFFICE"]>;
|
2320
2323
|
declare const AdministrativeAreaConfiguration: z.ZodObject<{
|
2321
2324
|
partOf: z.ZodOptional<z.ZodObject<{
|
2322
2325
|
$data: z.ZodString;
|
@@ -3047,8 +3050,8 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3047
3050
|
hideLabel: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
3048
3051
|
}, {
|
3049
3052
|
type: z.ZodLiteral<"ADDRESS">;
|
3050
|
-
defaultValue: z.ZodOptional<z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
3051
|
-
country: z.
|
3053
|
+
defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
3054
|
+
country: z.ZodLiteral<string>;
|
3052
3055
|
province: z.ZodString;
|
3053
3056
|
district: z.ZodString;
|
3054
3057
|
}, {
|
@@ -3079,7 +3082,7 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3079
3082
|
street?: string | undefined;
|
3080
3083
|
zipCode?: string | undefined;
|
3081
3084
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
3082
|
-
country: z.
|
3085
|
+
country: z.ZodLiteral<string>;
|
3083
3086
|
province: z.ZodString;
|
3084
3087
|
district: z.ZodString;
|
3085
3088
|
}, {
|
@@ -3097,6 +3100,33 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3097
3100
|
province: string;
|
3098
3101
|
urbanOrRural: "RURAL";
|
3099
3102
|
village?: string | undefined;
|
3103
|
+
}>]>, z.ZodObject<{
|
3104
|
+
country: z.ZodEffects<z.ZodString, string, string>;
|
3105
|
+
state: z.ZodString;
|
3106
|
+
district2: z.ZodString;
|
3107
|
+
cityOrTown: z.ZodOptional<z.ZodString>;
|
3108
|
+
addressLine1: z.ZodOptional<z.ZodString>;
|
3109
|
+
addressLine2: z.ZodOptional<z.ZodString>;
|
3110
|
+
addressLine3: z.ZodOptional<z.ZodString>;
|
3111
|
+
postcodeOrZip: z.ZodOptional<z.ZodString>;
|
3112
|
+
}, "strip", z.ZodTypeAny, {
|
3113
|
+
country: string;
|
3114
|
+
state: string;
|
3115
|
+
district2: string;
|
3116
|
+
cityOrTown?: string | undefined;
|
3117
|
+
addressLine1?: string | undefined;
|
3118
|
+
addressLine2?: string | undefined;
|
3119
|
+
addressLine3?: string | undefined;
|
3120
|
+
postcodeOrZip?: string | undefined;
|
3121
|
+
}, {
|
3122
|
+
country: string;
|
3123
|
+
state: string;
|
3124
|
+
district2: string;
|
3125
|
+
cityOrTown?: string | undefined;
|
3126
|
+
addressLine1?: string | undefined;
|
3127
|
+
addressLine2?: string | undefined;
|
3128
|
+
addressLine3?: string | undefined;
|
3129
|
+
postcodeOrZip?: string | undefined;
|
3100
3130
|
}>]>>;
|
3101
3131
|
}>, "strip", z.ZodTypeAny, {
|
3102
3132
|
type: "ADDRESS";
|
@@ -3124,6 +3154,15 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3124
3154
|
province: string;
|
3125
3155
|
urbanOrRural: "RURAL";
|
3126
3156
|
village?: string | undefined;
|
3157
|
+
} | {
|
3158
|
+
country: string;
|
3159
|
+
state: string;
|
3160
|
+
district2: string;
|
3161
|
+
cityOrTown?: string | undefined;
|
3162
|
+
addressLine1?: string | undefined;
|
3163
|
+
addressLine2?: string | undefined;
|
3164
|
+
addressLine3?: string | undefined;
|
3165
|
+
postcodeOrZip?: string | undefined;
|
3127
3166
|
} | undefined;
|
3128
3167
|
conditionals?: ({
|
3129
3168
|
type: "SHOW";
|
@@ -3170,6 +3209,15 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3170
3209
|
province: string;
|
3171
3210
|
urbanOrRural: "RURAL";
|
3172
3211
|
village?: string | undefined;
|
3212
|
+
} | {
|
3213
|
+
country: string;
|
3214
|
+
state: string;
|
3215
|
+
district2: string;
|
3216
|
+
cityOrTown?: string | undefined;
|
3217
|
+
addressLine1?: string | undefined;
|
3218
|
+
addressLine2?: string | undefined;
|
3219
|
+
addressLine3?: string | undefined;
|
3220
|
+
postcodeOrZip?: string | undefined;
|
3173
3221
|
} | undefined;
|
3174
3222
|
conditionals?: ({
|
3175
3223
|
type: "SHOW";
|
@@ -24,4 +24,8 @@ export declare const FieldType: {
|
|
24
24
|
};
|
25
25
|
export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "HIDDEN" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE")[];
|
26
26
|
export type FieldType = (typeof fieldTypes)[number];
|
27
|
+
/**
|
28
|
+
* Composite field types are field types that consist of multiple field values.
|
29
|
+
*/
|
30
|
+
export declare const compositeFieldTypes: ("ADDRESS" | "FILE" | "FILE_WITH_OPTIONS")[];
|
27
31
|
//# sourceMappingURL=FieldType.d.ts.map
|
@@ -1,18 +1,36 @@
|
|
1
1
|
import { z } from 'zod';
|
2
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';
|
3
3
|
import { FieldType } from './FieldType';
|
4
|
-
import {
|
4
|
+
import { FieldValue, FieldUpdateValueSchema } from './FieldValue';
|
5
|
+
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue } 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<{
|
22
|
+
filename: z.ZodString;
|
23
|
+
originalFilename: z.ZodString;
|
24
|
+
type: z.ZodString;
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
26
|
+
type: string;
|
27
|
+
filename: string;
|
28
|
+
originalFilename: string;
|
29
|
+
}, {
|
30
|
+
type: string;
|
31
|
+
filename: string;
|
32
|
+
originalFilename: string;
|
33
|
+
}> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
16
34
|
filename: z.ZodString;
|
17
35
|
originalFilename: z.ZodString;
|
18
36
|
type: z.ZodString;
|
@@ -24,57 +42,99 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
24
42
|
type: string;
|
25
43
|
filename: string;
|
26
44
|
originalFilename: string;
|
27
|
-
}
|
28
|
-
country: z.
|
45
|
+
}>>> | z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
46
|
+
country: z.ZodLiteral<string>;
|
29
47
|
province: z.ZodString;
|
30
48
|
district: z.ZodString;
|
31
49
|
}, {
|
32
50
|
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
|
51
|
+
town: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
52
|
+
residentialArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
53
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
54
|
+
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
55
|
+
zipCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
38
56
|
}>, "strip", z.ZodTypeAny, {
|
39
57
|
country: string;
|
40
58
|
district: string;
|
41
59
|
province: string;
|
42
60
|
urbanOrRural: "URBAN";
|
43
|
-
number?: string | undefined;
|
44
|
-
town?: string | undefined;
|
45
|
-
residentialArea?: string | undefined;
|
46
|
-
street?: string | undefined;
|
47
|
-
zipCode?: string | undefined;
|
61
|
+
number?: string | null | undefined;
|
62
|
+
town?: string | null | undefined;
|
63
|
+
residentialArea?: string | null | undefined;
|
64
|
+
street?: string | null | undefined;
|
65
|
+
zipCode?: string | null | undefined;
|
48
66
|
}, {
|
49
67
|
country: string;
|
50
68
|
district: string;
|
51
69
|
province: string;
|
52
70
|
urbanOrRural: "URBAN";
|
53
|
-
number?: string | undefined;
|
54
|
-
town?: string | undefined;
|
55
|
-
residentialArea?: string | undefined;
|
56
|
-
street?: string | undefined;
|
57
|
-
zipCode?: string | undefined;
|
71
|
+
number?: string | null | undefined;
|
72
|
+
town?: string | null | undefined;
|
73
|
+
residentialArea?: string | null | undefined;
|
74
|
+
street?: string | null | undefined;
|
75
|
+
zipCode?: string | null | undefined;
|
58
76
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
59
|
-
country: z.
|
77
|
+
country: z.ZodLiteral<string>;
|
60
78
|
province: z.ZodString;
|
61
79
|
district: z.ZodString;
|
62
80
|
}, {
|
63
81
|
urbanOrRural: z.ZodLiteral<"RURAL">;
|
64
|
-
village: z.ZodOptional<z.ZodString
|
82
|
+
village: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
65
83
|
}>, "strip", z.ZodTypeAny, {
|
66
84
|
country: string;
|
67
85
|
district: string;
|
68
86
|
province: string;
|
69
87
|
urbanOrRural: "RURAL";
|
70
|
-
village?: string | undefined;
|
88
|
+
village?: string | null | undefined;
|
71
89
|
}, {
|
72
90
|
country: string;
|
73
91
|
district: string;
|
74
92
|
province: string;
|
75
93
|
urbanOrRural: "RURAL";
|
76
|
-
village?: string | undefined;
|
77
|
-
}>]
|
94
|
+
village?: string | null | undefined;
|
95
|
+
}>]>, z.ZodObject<{
|
96
|
+
country: z.ZodEffects<z.ZodString, string, string>;
|
97
|
+
state: z.ZodString;
|
98
|
+
district2: z.ZodString;
|
99
|
+
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
100
|
+
addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
101
|
+
addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
102
|
+
addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
103
|
+
postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
105
|
+
country: string;
|
106
|
+
state: string;
|
107
|
+
district2: string;
|
108
|
+
cityOrTown?: string | null | undefined;
|
109
|
+
addressLine1?: string | null | undefined;
|
110
|
+
addressLine2?: string | null | undefined;
|
111
|
+
addressLine3?: string | null | undefined;
|
112
|
+
postcodeOrZip?: string | null | undefined;
|
113
|
+
}, {
|
114
|
+
country: string;
|
115
|
+
state: string;
|
116
|
+
district2: string;
|
117
|
+
cityOrTown?: string | null | undefined;
|
118
|
+
addressLine1?: string | null | undefined;
|
119
|
+
addressLine2?: string | null | undefined;
|
120
|
+
addressLine3?: string | null | undefined;
|
121
|
+
postcodeOrZip?: string | null | undefined;
|
122
|
+
}>]> | z.ZodArray<z.ZodObject<{
|
123
|
+
filename: z.ZodString;
|
124
|
+
originalFilename: z.ZodString;
|
125
|
+
type: z.ZodString;
|
126
|
+
option: z.ZodString;
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
128
|
+
type: string;
|
129
|
+
option: string;
|
130
|
+
filename: string;
|
131
|
+
originalFilename: string;
|
132
|
+
}, {
|
133
|
+
type: string;
|
134
|
+
option: string;
|
135
|
+
filename: string;
|
136
|
+
originalFilename: string;
|
137
|
+
}>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
78
138
|
filename: z.ZodString;
|
79
139
|
originalFilename: z.ZodString;
|
80
140
|
type: z.ZodString;
|
@@ -89,8 +149,85 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
89
149
|
option: string;
|
90
150
|
filename: string;
|
91
151
|
originalFilename: string;
|
92
|
-
}>, "many"
|
93
|
-
|
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.ZodLiteral<string>;
|
154
|
+
province: z.ZodString;
|
155
|
+
district: z.ZodString;
|
156
|
+
}, {
|
157
|
+
urbanOrRural: z.ZodLiteral<"URBAN">;
|
158
|
+
town: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
159
|
+
residentialArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
160
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
161
|
+
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
162
|
+
zipCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
163
|
+
}>, "strip", z.ZodTypeAny, {
|
164
|
+
country: string;
|
165
|
+
district: string;
|
166
|
+
province: string;
|
167
|
+
urbanOrRural: "URBAN";
|
168
|
+
number?: string | null | undefined;
|
169
|
+
town?: string | null | undefined;
|
170
|
+
residentialArea?: string | null | undefined;
|
171
|
+
street?: string | null | undefined;
|
172
|
+
zipCode?: string | null | undefined;
|
173
|
+
}, {
|
174
|
+
country: string;
|
175
|
+
district: string;
|
176
|
+
province: string;
|
177
|
+
urbanOrRural: "URBAN";
|
178
|
+
number?: string | null | undefined;
|
179
|
+
town?: string | null | undefined;
|
180
|
+
residentialArea?: string | null | undefined;
|
181
|
+
street?: string | null | undefined;
|
182
|
+
zipCode?: string | null | undefined;
|
183
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
184
|
+
country: z.ZodLiteral<string>;
|
185
|
+
province: z.ZodString;
|
186
|
+
district: z.ZodString;
|
187
|
+
}, {
|
188
|
+
urbanOrRural: z.ZodLiteral<"RURAL">;
|
189
|
+
village: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
190
|
+
}>, "strip", z.ZodTypeAny, {
|
191
|
+
country: string;
|
192
|
+
district: string;
|
193
|
+
province: string;
|
194
|
+
urbanOrRural: "RURAL";
|
195
|
+
village?: string | null | undefined;
|
196
|
+
}, {
|
197
|
+
country: string;
|
198
|
+
district: string;
|
199
|
+
province: string;
|
200
|
+
urbanOrRural: "RURAL";
|
201
|
+
village?: string | null | undefined;
|
202
|
+
}>]>, z.ZodObject<{
|
203
|
+
country: z.ZodEffects<z.ZodString, string, string>;
|
204
|
+
state: z.ZodString;
|
205
|
+
district2: z.ZodString;
|
206
|
+
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
207
|
+
addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
208
|
+
addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
209
|
+
addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
210
|
+
postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
211
|
+
}, "strip", z.ZodTypeAny, {
|
212
|
+
country: string;
|
213
|
+
state: string;
|
214
|
+
district2: string;
|
215
|
+
cityOrTown?: string | null | undefined;
|
216
|
+
addressLine1?: string | null | undefined;
|
217
|
+
addressLine2?: string | null | undefined;
|
218
|
+
addressLine3?: string | null | undefined;
|
219
|
+
postcodeOrZip?: string | null | undefined;
|
220
|
+
}, {
|
221
|
+
country: string;
|
222
|
+
state: string;
|
223
|
+
district2: string;
|
224
|
+
cityOrTown?: string | null | undefined;
|
225
|
+
addressLine1?: string | null | undefined;
|
226
|
+
addressLine2?: string | null | undefined;
|
227
|
+
addressLine3?: string | null | undefined;
|
228
|
+
postcodeOrZip?: string | null | undefined;
|
229
|
+
}>]>>>;
|
230
|
+
export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
|
94
231
|
[x: string]: string | number | boolean | {
|
95
232
|
type: string;
|
96
233
|
filename: string;
|
@@ -100,23 +237,32 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
100
237
|
district: string;
|
101
238
|
province: string;
|
102
239
|
urbanOrRural: "URBAN";
|
103
|
-
number?: string | undefined;
|
104
|
-
town?: string | undefined;
|
105
|
-
residentialArea?: string | undefined;
|
106
|
-
street?: string | undefined;
|
107
|
-
zipCode?: string | undefined;
|
240
|
+
number?: string | null | undefined;
|
241
|
+
town?: string | null | undefined;
|
242
|
+
residentialArea?: string | null | undefined;
|
243
|
+
street?: string | null | undefined;
|
244
|
+
zipCode?: string | null | undefined;
|
108
245
|
} | {
|
109
246
|
country: string;
|
110
247
|
district: string;
|
111
248
|
province: string;
|
112
249
|
urbanOrRural: "RURAL";
|
113
|
-
village?: string | undefined;
|
250
|
+
village?: string | null | undefined;
|
251
|
+
} | {
|
252
|
+
country: string;
|
253
|
+
state: string;
|
254
|
+
district2: string;
|
255
|
+
cityOrTown?: string | null | undefined;
|
256
|
+
addressLine1?: string | null | undefined;
|
257
|
+
addressLine2?: string | null | undefined;
|
258
|
+
addressLine3?: string | null | undefined;
|
259
|
+
postcodeOrZip?: string | null | undefined;
|
114
260
|
} | {
|
115
261
|
type: string;
|
116
262
|
option: string;
|
117
263
|
filename: string;
|
118
264
|
originalFilename: string;
|
119
|
-
}[] | undefined;
|
265
|
+
}[] | null | undefined;
|
120
266
|
}, {
|
121
267
|
[x: string]: string | number | boolean | {
|
122
268
|
type: string;
|
@@ -127,23 +273,32 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
127
273
|
district: string;
|
128
274
|
province: string;
|
129
275
|
urbanOrRural: "URBAN";
|
130
|
-
number?: string | undefined;
|
131
|
-
town?: string | undefined;
|
132
|
-
residentialArea?: string | undefined;
|
133
|
-
street?: string | undefined;
|
134
|
-
zipCode?: string | undefined;
|
276
|
+
number?: string | null | undefined;
|
277
|
+
town?: string | null | undefined;
|
278
|
+
residentialArea?: string | null | undefined;
|
279
|
+
street?: string | null | undefined;
|
280
|
+
zipCode?: string | null | undefined;
|
135
281
|
} | {
|
136
282
|
country: string;
|
137
283
|
district: string;
|
138
284
|
province: string;
|
139
285
|
urbanOrRural: "RURAL";
|
140
|
-
village?: string | undefined;
|
286
|
+
village?: string | null | undefined;
|
287
|
+
} | {
|
288
|
+
country: string;
|
289
|
+
state: string;
|
290
|
+
district2: string;
|
291
|
+
cityOrTown?: string | null | undefined;
|
292
|
+
addressLine1?: string | null | undefined;
|
293
|
+
addressLine2?: string | null | undefined;
|
294
|
+
addressLine3?: string | null | undefined;
|
295
|
+
postcodeOrZip?: string | null | undefined;
|
141
296
|
} | {
|
142
297
|
type: string;
|
143
298
|
option: string;
|
144
299
|
filename: string;
|
145
300
|
originalFilename: string;
|
146
|
-
}[] | undefined;
|
301
|
+
}[] | null | undefined;
|
147
302
|
}>;
|
148
303
|
/**
|
149
304
|
* Quick-and-dirty mock data generator for event actions.
|
@@ -175,6 +330,36 @@ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number):
|
|
175
330
|
number?: undefined;
|
176
331
|
zipCode?: undefined;
|
177
332
|
} | null;
|
333
|
+
/**
|
334
|
+
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
335
|
+
*/
|
336
|
+
export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
|
337
|
+
country: null;
|
338
|
+
province: null;
|
339
|
+
district: null;
|
340
|
+
urbanOrRural: string;
|
341
|
+
town: null;
|
342
|
+
residentialArea: null;
|
343
|
+
street: null;
|
344
|
+
number: null;
|
345
|
+
zipCode: null;
|
346
|
+
filename?: undefined;
|
347
|
+
originalFilename?: undefined;
|
348
|
+
type?: undefined;
|
349
|
+
} | {
|
350
|
+
filename: string;
|
351
|
+
originalFilename: string;
|
352
|
+
type: string;
|
353
|
+
country?: undefined;
|
354
|
+
province?: undefined;
|
355
|
+
district?: undefined;
|
356
|
+
urbanOrRural?: undefined;
|
357
|
+
town?: undefined;
|
358
|
+
residentialArea?: undefined;
|
359
|
+
street?: undefined;
|
360
|
+
number?: undefined;
|
361
|
+
zipCode?: undefined;
|
362
|
+
} | null;
|
178
363
|
export declare const isParagraphFieldType: (field: {
|
179
364
|
config: FieldConfig;
|
180
365
|
value: FieldValue;
|
@@ -322,4 +507,5 @@ export declare const isOfficeFieldType: (field: {
|
|
322
507
|
value: string;
|
323
508
|
config: Office;
|
324
509
|
};
|
510
|
+
export {};
|
325
511
|
//# sourceMappingURL=FieldTypeMapping.d.ts.map
|