@opencrvs/toolkit 1.8.0-rc.fc43738 → 1.8.0-rc.fca3e39
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 +7518 -2532
- package/dist/commons/conditionals/conditionals.d.ts +3 -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 +3196 -1113
- package/dist/commons/events/ActionInput.d.ts +4796 -1760
- package/dist/commons/events/ActionType.d.ts +6 -1
- package/dist/commons/events/CompositeFieldValue.d.ts +414 -0
- package/dist/commons/events/Draft.d.ts +440 -155
- package/dist/commons/events/EventConfig.d.ts +4 -28
- package/dist/commons/events/EventDocument.d.ts +3845 -1325
- 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 +64 -1
- package/dist/commons/events/FieldType.d.ts +4 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +252 -38
- package/dist/commons/events/FieldValue.d.ts +133 -64
- 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 +219 -69
- package/dist/commons/events/utils.d.ts +123 -3
- package/dist/conditionals/index.js +17 -0
- package/dist/events/index.js +780 -487
- 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,9 @@ 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<{
|
3053
|
+
defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
3051
3054
|
country: z.ZodString;
|
3055
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
3052
3056
|
province: z.ZodString;
|
3053
3057
|
district: z.ZodString;
|
3054
3058
|
}, {
|
@@ -3061,6 +3065,7 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3061
3065
|
}>, "strip", z.ZodTypeAny, {
|
3062
3066
|
country: string;
|
3063
3067
|
district: string;
|
3068
|
+
addressType: "DOMESTIC";
|
3064
3069
|
province: string;
|
3065
3070
|
urbanOrRural: "URBAN";
|
3066
3071
|
number?: string | undefined;
|
@@ -3071,6 +3076,7 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3071
3076
|
}, {
|
3072
3077
|
country: string;
|
3073
3078
|
district: string;
|
3079
|
+
addressType: "DOMESTIC";
|
3074
3080
|
province: string;
|
3075
3081
|
urbanOrRural: "URBAN";
|
3076
3082
|
number?: string | undefined;
|
@@ -3080,6 +3086,7 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3080
3086
|
zipCode?: string | undefined;
|
3081
3087
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
3082
3088
|
country: z.ZodString;
|
3089
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
3083
3090
|
province: z.ZodString;
|
3084
3091
|
district: z.ZodString;
|
3085
3092
|
}, {
|
@@ -3088,15 +3095,47 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3088
3095
|
}>, "strip", z.ZodTypeAny, {
|
3089
3096
|
country: string;
|
3090
3097
|
district: string;
|
3098
|
+
addressType: "DOMESTIC";
|
3091
3099
|
province: string;
|
3092
3100
|
urbanOrRural: "RURAL";
|
3093
3101
|
village?: string | undefined;
|
3094
3102
|
}, {
|
3095
3103
|
country: string;
|
3096
3104
|
district: string;
|
3105
|
+
addressType: "DOMESTIC";
|
3097
3106
|
province: string;
|
3098
3107
|
urbanOrRural: "RURAL";
|
3099
3108
|
village?: string | undefined;
|
3109
|
+
}>]>, z.ZodObject<{
|
3110
|
+
country: z.ZodString;
|
3111
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
3112
|
+
state: z.ZodString;
|
3113
|
+
district2: z.ZodString;
|
3114
|
+
cityOrTown: z.ZodOptional<z.ZodString>;
|
3115
|
+
addressLine1: z.ZodOptional<z.ZodString>;
|
3116
|
+
addressLine2: z.ZodOptional<z.ZodString>;
|
3117
|
+
addressLine3: z.ZodOptional<z.ZodString>;
|
3118
|
+
postcodeOrZip: z.ZodOptional<z.ZodString>;
|
3119
|
+
}, "strip", z.ZodTypeAny, {
|
3120
|
+
country: string;
|
3121
|
+
state: string;
|
3122
|
+
addressType: "INTERNATIONAL";
|
3123
|
+
district2: string;
|
3124
|
+
cityOrTown?: string | undefined;
|
3125
|
+
addressLine1?: string | undefined;
|
3126
|
+
addressLine2?: string | undefined;
|
3127
|
+
addressLine3?: string | undefined;
|
3128
|
+
postcodeOrZip?: string | undefined;
|
3129
|
+
}, {
|
3130
|
+
country: string;
|
3131
|
+
state: string;
|
3132
|
+
addressType: "INTERNATIONAL";
|
3133
|
+
district2: string;
|
3134
|
+
cityOrTown?: string | undefined;
|
3135
|
+
addressLine1?: string | undefined;
|
3136
|
+
addressLine2?: string | undefined;
|
3137
|
+
addressLine3?: string | undefined;
|
3138
|
+
postcodeOrZip?: string | undefined;
|
3100
3139
|
}>]>>;
|
3101
3140
|
}>, "strip", z.ZodTypeAny, {
|
3102
3141
|
type: "ADDRESS";
|
@@ -3111,6 +3150,7 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3111
3150
|
defaultValue?: {
|
3112
3151
|
country: string;
|
3113
3152
|
district: string;
|
3153
|
+
addressType: "DOMESTIC";
|
3114
3154
|
province: string;
|
3115
3155
|
urbanOrRural: "URBAN";
|
3116
3156
|
number?: string | undefined;
|
@@ -3121,9 +3161,20 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3121
3161
|
} | {
|
3122
3162
|
country: string;
|
3123
3163
|
district: string;
|
3164
|
+
addressType: "DOMESTIC";
|
3124
3165
|
province: string;
|
3125
3166
|
urbanOrRural: "RURAL";
|
3126
3167
|
village?: string | undefined;
|
3168
|
+
} | {
|
3169
|
+
country: string;
|
3170
|
+
state: string;
|
3171
|
+
addressType: "INTERNATIONAL";
|
3172
|
+
district2: string;
|
3173
|
+
cityOrTown?: string | undefined;
|
3174
|
+
addressLine1?: string | undefined;
|
3175
|
+
addressLine2?: string | undefined;
|
3176
|
+
addressLine3?: string | undefined;
|
3177
|
+
postcodeOrZip?: string | undefined;
|
3127
3178
|
} | undefined;
|
3128
3179
|
conditionals?: ({
|
3129
3180
|
type: "SHOW";
|
@@ -3157,6 +3208,7 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3157
3208
|
defaultValue?: {
|
3158
3209
|
country: string;
|
3159
3210
|
district: string;
|
3211
|
+
addressType: "DOMESTIC";
|
3160
3212
|
province: string;
|
3161
3213
|
urbanOrRural: "URBAN";
|
3162
3214
|
number?: string | undefined;
|
@@ -3167,9 +3219,20 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3167
3219
|
} | {
|
3168
3220
|
country: string;
|
3169
3221
|
district: string;
|
3222
|
+
addressType: "DOMESTIC";
|
3170
3223
|
province: string;
|
3171
3224
|
urbanOrRural: "RURAL";
|
3172
3225
|
village?: string | undefined;
|
3226
|
+
} | {
|
3227
|
+
country: string;
|
3228
|
+
state: string;
|
3229
|
+
addressType: "INTERNATIONAL";
|
3230
|
+
district2: string;
|
3231
|
+
cityOrTown?: string | undefined;
|
3232
|
+
addressLine1?: string | undefined;
|
3233
|
+
addressLine2?: string | undefined;
|
3234
|
+
addressLine3?: string | undefined;
|
3235
|
+
postcodeOrZip?: string | undefined;
|
3173
3236
|
} | undefined;
|
3174
3237
|
conditionals?: ({
|
3175
3238
|
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,24 @@
|
|
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<{
|
16
22
|
filename: z.ZodString;
|
17
23
|
originalFilename: z.ZodString;
|
18
24
|
type: z.ZodString;
|
@@ -24,57 +30,120 @@ 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.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
28
46
|
country: z.ZodString;
|
47
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
29
48
|
province: z.ZodString;
|
30
49
|
district: z.ZodString;
|
31
50
|
}, {
|
32
51
|
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
|
52
|
+
town: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
53
|
+
residentialArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
54
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
55
|
+
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
56
|
+
zipCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
38
57
|
}>, "strip", z.ZodTypeAny, {
|
39
58
|
country: string;
|
40
59
|
district: string;
|
60
|
+
addressType: "DOMESTIC";
|
41
61
|
province: string;
|
42
62
|
urbanOrRural: "URBAN";
|
43
|
-
number?: string | undefined;
|
44
|
-
town?: string | undefined;
|
45
|
-
residentialArea?: string | undefined;
|
46
|
-
street?: string | undefined;
|
47
|
-
zipCode?: string | undefined;
|
63
|
+
number?: string | null | undefined;
|
64
|
+
town?: string | null | undefined;
|
65
|
+
residentialArea?: string | null | undefined;
|
66
|
+
street?: string | null | undefined;
|
67
|
+
zipCode?: string | null | undefined;
|
48
68
|
}, {
|
49
69
|
country: string;
|
50
70
|
district: string;
|
71
|
+
addressType: "DOMESTIC";
|
51
72
|
province: string;
|
52
73
|
urbanOrRural: "URBAN";
|
53
|
-
number?: string | undefined;
|
54
|
-
town?: string | undefined;
|
55
|
-
residentialArea?: string | undefined;
|
56
|
-
street?: string | undefined;
|
57
|
-
zipCode?: string | undefined;
|
74
|
+
number?: string | null | undefined;
|
75
|
+
town?: string | null | undefined;
|
76
|
+
residentialArea?: string | null | undefined;
|
77
|
+
street?: string | null | undefined;
|
78
|
+
zipCode?: string | null | undefined;
|
58
79
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
59
80
|
country: z.ZodString;
|
81
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
60
82
|
province: z.ZodString;
|
61
83
|
district: z.ZodString;
|
62
84
|
}, {
|
63
85
|
urbanOrRural: z.ZodLiteral<"RURAL">;
|
64
|
-
village: z.ZodOptional<z.ZodString
|
86
|
+
village: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
65
87
|
}>, "strip", z.ZodTypeAny, {
|
66
88
|
country: string;
|
67
89
|
district: string;
|
90
|
+
addressType: "DOMESTIC";
|
68
91
|
province: string;
|
69
92
|
urbanOrRural: "RURAL";
|
70
|
-
village?: string | undefined;
|
93
|
+
village?: string | null | undefined;
|
71
94
|
}, {
|
72
95
|
country: string;
|
73
96
|
district: string;
|
97
|
+
addressType: "DOMESTIC";
|
74
98
|
province: string;
|
75
99
|
urbanOrRural: "RURAL";
|
76
|
-
village?: string | undefined;
|
77
|
-
}>]
|
100
|
+
village?: string | null | undefined;
|
101
|
+
}>]>, z.ZodObject<{
|
102
|
+
country: z.ZodString;
|
103
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
104
|
+
state: z.ZodString;
|
105
|
+
district2: z.ZodString;
|
106
|
+
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
107
|
+
addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
108
|
+
addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
109
|
+
addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
110
|
+
postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
112
|
+
country: string;
|
113
|
+
state: string;
|
114
|
+
addressType: "INTERNATIONAL";
|
115
|
+
district2: string;
|
116
|
+
cityOrTown?: string | null | undefined;
|
117
|
+
addressLine1?: string | null | undefined;
|
118
|
+
addressLine2?: string | null | undefined;
|
119
|
+
addressLine3?: string | null | undefined;
|
120
|
+
postcodeOrZip?: string | null | undefined;
|
121
|
+
}, {
|
122
|
+
country: string;
|
123
|
+
state: string;
|
124
|
+
addressType: "INTERNATIONAL";
|
125
|
+
district2: string;
|
126
|
+
cityOrTown?: string | null | undefined;
|
127
|
+
addressLine1?: string | null | undefined;
|
128
|
+
addressLine2?: string | null | undefined;
|
129
|
+
addressLine3?: string | null | undefined;
|
130
|
+
postcodeOrZip?: string | null | undefined;
|
131
|
+
}>]> | z.ZodArray<z.ZodObject<{
|
132
|
+
filename: z.ZodString;
|
133
|
+
originalFilename: z.ZodString;
|
134
|
+
type: z.ZodString;
|
135
|
+
option: z.ZodString;
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
137
|
+
type: string;
|
138
|
+
option: string;
|
139
|
+
filename: string;
|
140
|
+
originalFilename: string;
|
141
|
+
}, {
|
142
|
+
type: string;
|
143
|
+
option: string;
|
144
|
+
filename: string;
|
145
|
+
originalFilename: string;
|
146
|
+
}>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
78
147
|
filename: z.ZodString;
|
79
148
|
originalFilename: z.ZodString;
|
80
149
|
type: z.ZodString;
|
@@ -89,8 +158,94 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
89
158
|
option: string;
|
90
159
|
filename: string;
|
91
160
|
originalFilename: string;
|
92
|
-
}>, "many"
|
93
|
-
|
161
|
+
}>, "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<{
|
162
|
+
country: z.ZodString;
|
163
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
164
|
+
province: z.ZodString;
|
165
|
+
district: z.ZodString;
|
166
|
+
}, {
|
167
|
+
urbanOrRural: z.ZodLiteral<"URBAN">;
|
168
|
+
town: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
169
|
+
residentialArea: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
170
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
171
|
+
number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
172
|
+
zipCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
173
|
+
}>, "strip", z.ZodTypeAny, {
|
174
|
+
country: string;
|
175
|
+
district: string;
|
176
|
+
addressType: "DOMESTIC";
|
177
|
+
province: string;
|
178
|
+
urbanOrRural: "URBAN";
|
179
|
+
number?: string | null | undefined;
|
180
|
+
town?: string | null | undefined;
|
181
|
+
residentialArea?: string | null | undefined;
|
182
|
+
street?: string | null | undefined;
|
183
|
+
zipCode?: string | null | undefined;
|
184
|
+
}, {
|
185
|
+
country: string;
|
186
|
+
district: string;
|
187
|
+
addressType: "DOMESTIC";
|
188
|
+
province: string;
|
189
|
+
urbanOrRural: "URBAN";
|
190
|
+
number?: string | null | undefined;
|
191
|
+
town?: string | null | undefined;
|
192
|
+
residentialArea?: string | null | undefined;
|
193
|
+
street?: string | null | undefined;
|
194
|
+
zipCode?: string | null | undefined;
|
195
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
196
|
+
country: z.ZodString;
|
197
|
+
addressType: z.ZodLiteral<"DOMESTIC">;
|
198
|
+
province: z.ZodString;
|
199
|
+
district: z.ZodString;
|
200
|
+
}, {
|
201
|
+
urbanOrRural: z.ZodLiteral<"RURAL">;
|
202
|
+
village: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
203
|
+
}>, "strip", z.ZodTypeAny, {
|
204
|
+
country: string;
|
205
|
+
district: string;
|
206
|
+
addressType: "DOMESTIC";
|
207
|
+
province: string;
|
208
|
+
urbanOrRural: "RURAL";
|
209
|
+
village?: string | null | undefined;
|
210
|
+
}, {
|
211
|
+
country: string;
|
212
|
+
district: string;
|
213
|
+
addressType: "DOMESTIC";
|
214
|
+
province: string;
|
215
|
+
urbanOrRural: "RURAL";
|
216
|
+
village?: string | null | undefined;
|
217
|
+
}>]>, z.ZodObject<{
|
218
|
+
country: z.ZodString;
|
219
|
+
addressType: z.ZodLiteral<"INTERNATIONAL">;
|
220
|
+
state: z.ZodString;
|
221
|
+
district2: z.ZodString;
|
222
|
+
cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
223
|
+
addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
224
|
+
addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
225
|
+
addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
226
|
+
postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
228
|
+
country: string;
|
229
|
+
state: string;
|
230
|
+
addressType: "INTERNATIONAL";
|
231
|
+
district2: string;
|
232
|
+
cityOrTown?: string | null | undefined;
|
233
|
+
addressLine1?: string | null | undefined;
|
234
|
+
addressLine2?: string | null | undefined;
|
235
|
+
addressLine3?: string | null | undefined;
|
236
|
+
postcodeOrZip?: string | null | undefined;
|
237
|
+
}, {
|
238
|
+
country: string;
|
239
|
+
state: string;
|
240
|
+
addressType: "INTERNATIONAL";
|
241
|
+
district2: string;
|
242
|
+
cityOrTown?: string | null | undefined;
|
243
|
+
addressLine1?: string | null | undefined;
|
244
|
+
addressLine2?: string | null | undefined;
|
245
|
+
addressLine3?: string | null | undefined;
|
246
|
+
postcodeOrZip?: string | null | undefined;
|
247
|
+
}>]>>>;
|
248
|
+
export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
|
94
249
|
[x: string]: string | number | boolean | {
|
95
250
|
type: string;
|
96
251
|
filename: string;
|
@@ -98,25 +253,37 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
98
253
|
} | {
|
99
254
|
country: string;
|
100
255
|
district: string;
|
256
|
+
addressType: "DOMESTIC";
|
101
257
|
province: string;
|
102
258
|
urbanOrRural: "URBAN";
|
103
|
-
number?: string | undefined;
|
104
|
-
town?: string | undefined;
|
105
|
-
residentialArea?: string | undefined;
|
106
|
-
street?: string | undefined;
|
107
|
-
zipCode?: string | undefined;
|
259
|
+
number?: string | null | undefined;
|
260
|
+
town?: string | null | undefined;
|
261
|
+
residentialArea?: string | null | undefined;
|
262
|
+
street?: string | null | undefined;
|
263
|
+
zipCode?: string | null | undefined;
|
108
264
|
} | {
|
109
265
|
country: string;
|
110
266
|
district: string;
|
267
|
+
addressType: "DOMESTIC";
|
111
268
|
province: string;
|
112
269
|
urbanOrRural: "RURAL";
|
113
|
-
village?: string | undefined;
|
270
|
+
village?: string | null | undefined;
|
271
|
+
} | {
|
272
|
+
country: string;
|
273
|
+
state: string;
|
274
|
+
addressType: "INTERNATIONAL";
|
275
|
+
district2: string;
|
276
|
+
cityOrTown?: string | null | undefined;
|
277
|
+
addressLine1?: string | null | undefined;
|
278
|
+
addressLine2?: string | null | undefined;
|
279
|
+
addressLine3?: string | null | undefined;
|
280
|
+
postcodeOrZip?: string | null | undefined;
|
114
281
|
} | {
|
115
282
|
type: string;
|
116
283
|
option: string;
|
117
284
|
filename: string;
|
118
285
|
originalFilename: string;
|
119
|
-
}[] | undefined;
|
286
|
+
}[] | null | undefined;
|
120
287
|
}, {
|
121
288
|
[x: string]: string | number | boolean | {
|
122
289
|
type: string;
|
@@ -125,31 +292,44 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
|
|
125
292
|
} | {
|
126
293
|
country: string;
|
127
294
|
district: string;
|
295
|
+
addressType: "DOMESTIC";
|
128
296
|
province: string;
|
129
297
|
urbanOrRural: "URBAN";
|
130
|
-
number?: string | undefined;
|
131
|
-
town?: string | undefined;
|
132
|
-
residentialArea?: string | undefined;
|
133
|
-
street?: string | undefined;
|
134
|
-
zipCode?: string | undefined;
|
298
|
+
number?: string | null | undefined;
|
299
|
+
town?: string | null | undefined;
|
300
|
+
residentialArea?: string | null | undefined;
|
301
|
+
street?: string | null | undefined;
|
302
|
+
zipCode?: string | null | undefined;
|
135
303
|
} | {
|
136
304
|
country: string;
|
137
305
|
district: string;
|
306
|
+
addressType: "DOMESTIC";
|
138
307
|
province: string;
|
139
308
|
urbanOrRural: "RURAL";
|
140
|
-
village?: string | undefined;
|
309
|
+
village?: string | null | undefined;
|
310
|
+
} | {
|
311
|
+
country: string;
|
312
|
+
state: string;
|
313
|
+
addressType: "INTERNATIONAL";
|
314
|
+
district2: string;
|
315
|
+
cityOrTown?: string | null | undefined;
|
316
|
+
addressLine1?: string | null | undefined;
|
317
|
+
addressLine2?: string | null | undefined;
|
318
|
+
addressLine3?: string | null | undefined;
|
319
|
+
postcodeOrZip?: string | null | undefined;
|
141
320
|
} | {
|
142
321
|
type: string;
|
143
322
|
option: string;
|
144
323
|
filename: string;
|
145
324
|
originalFilename: string;
|
146
|
-
}[] | undefined;
|
325
|
+
}[] | null | undefined;
|
147
326
|
}>;
|
148
327
|
/**
|
149
328
|
* Quick-and-dirty mock data generator for event actions.
|
150
329
|
*/
|
151
330
|
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number): string | true | 19 | {
|
152
331
|
country: string;
|
332
|
+
addressType: "DOMESTIC";
|
153
333
|
province: string;
|
154
334
|
district: string;
|
155
335
|
urbanOrRural: string;
|
@@ -166,6 +346,39 @@ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number):
|
|
166
346
|
originalFilename: string;
|
167
347
|
type: string;
|
168
348
|
country?: undefined;
|
349
|
+
addressType?: undefined;
|
350
|
+
province?: undefined;
|
351
|
+
district?: undefined;
|
352
|
+
urbanOrRural?: undefined;
|
353
|
+
town?: undefined;
|
354
|
+
residentialArea?: undefined;
|
355
|
+
street?: undefined;
|
356
|
+
number?: undefined;
|
357
|
+
zipCode?: undefined;
|
358
|
+
} | null;
|
359
|
+
/**
|
360
|
+
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
361
|
+
*/
|
362
|
+
export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
|
363
|
+
country: null;
|
364
|
+
addressType: "DOMESTIC";
|
365
|
+
province: null;
|
366
|
+
district: null;
|
367
|
+
urbanOrRural: string;
|
368
|
+
town: null;
|
369
|
+
residentialArea: null;
|
370
|
+
street: null;
|
371
|
+
number: null;
|
372
|
+
zipCode: null;
|
373
|
+
filename?: undefined;
|
374
|
+
originalFilename?: undefined;
|
375
|
+
type?: undefined;
|
376
|
+
} | {
|
377
|
+
filename: string;
|
378
|
+
originalFilename: string;
|
379
|
+
type: string;
|
380
|
+
country?: undefined;
|
381
|
+
addressType?: undefined;
|
169
382
|
province?: undefined;
|
170
383
|
district?: undefined;
|
171
384
|
urbanOrRural?: undefined;
|
@@ -322,4 +535,5 @@ export declare const isOfficeFieldType: (field: {
|
|
322
535
|
value: string;
|
323
536
|
config: Office;
|
324
537
|
};
|
538
|
+
export {};
|
325
539
|
//# sourceMappingURL=FieldTypeMapping.d.ts.map
|