@opencrvs/toolkit 1.8.0-rc.f466807 → 1.8.0-rc.f7e8fb5
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 +445 -697
- package/dist/commons/conditionals/validate.d.ts +0 -27
- package/dist/commons/events/ActionConfig.d.ts +142 -4410
- package/dist/commons/events/ActionDocument.d.ts +103 -103
- package/dist/commons/events/ActionInput.d.ts +156 -156
- package/dist/commons/events/Draft.d.ts +16 -16
- package/dist/commons/events/EventConfig.d.ts +112 -1680
- package/dist/commons/events/EventConfigInput.d.ts +2 -2
- package/dist/commons/events/EventDocument.d.ts +150 -150
- package/dist/commons/events/FieldConfig.d.ts +2 -158
- package/dist/commons/events/FieldType.d.ts +1 -2
- package/dist/commons/events/FieldTypeMapping.d.ts +2 -52
- package/dist/commons/events/FieldValue.d.ts +4 -6
- package/dist/commons/events/FormConfig.d.ts +23 -361
- package/dist/commons/events/defineConfig.d.ts +28 -280
- package/dist/commons/events/test.utils.d.ts +13 -15
- package/dist/commons/events/utils.d.ts +11 -84
- package/dist/events/index.js +57 -466
- package/package.json +1 -1
- package/dist/commons/conditionals/validate.test.d.ts +0 -2
@@ -3190,166 +3190,10 @@ declare const Address: z.ZodObject<z.objectUtil.extendShape<{
|
|
3190
3190
|
} | undefined;
|
3191
3191
|
hideLabel?: boolean | undefined;
|
3192
3192
|
}>;
|
3193
|
-
declare const DataField: z.ZodObject<z.objectUtil.extendShape<{
|
3194
|
-
id: z.ZodString;
|
3195
|
-
defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
3196
|
-
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
3197
|
-
expression: z.ZodString;
|
3198
|
-
}, "strip", z.ZodTypeAny, {
|
3199
|
-
dependsOn: string[];
|
3200
|
-
expression: string;
|
3201
|
-
}, {
|
3202
|
-
expression: string;
|
3203
|
-
dependsOn?: string[] | undefined;
|
3204
|
-
}>]>>;
|
3205
|
-
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").AllActionConditionalFields[]>, "many">>>;
|
3206
|
-
required: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
3207
|
-
disabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
3208
|
-
hidden: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
3209
|
-
placeholder: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
3210
|
-
id: string;
|
3211
|
-
description: string;
|
3212
|
-
defaultMessage: string;
|
3213
|
-
}>>;
|
3214
|
-
validation: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
3215
|
-
validator: z.ZodType<import(".").JSONSchema, z.ZodTypeDef, import(".").JSONSchema>;
|
3216
|
-
message: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
3217
|
-
id: string;
|
3218
|
-
description: string;
|
3219
|
-
defaultMessage: string;
|
3220
|
-
}>;
|
3221
|
-
}, "strip", z.ZodTypeAny, {
|
3222
|
-
message: TranslationConfig;
|
3223
|
-
validator: import(".").JSONSchema;
|
3224
|
-
}, {
|
3225
|
-
message: {
|
3226
|
-
id: string;
|
3227
|
-
description: string;
|
3228
|
-
defaultMessage: string;
|
3229
|
-
};
|
3230
|
-
validator: import(".").JSONSchema;
|
3231
|
-
}>, "many">>>;
|
3232
|
-
dependsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
3233
|
-
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
3234
|
-
id: string;
|
3235
|
-
description: string;
|
3236
|
-
defaultMessage: string;
|
3237
|
-
}>;
|
3238
|
-
hideLabel: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
3239
|
-
}, {
|
3240
|
-
type: z.ZodLiteral<"DATA">;
|
3241
|
-
configuration: z.ZodObject<{
|
3242
|
-
subtitle: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
3243
|
-
id: string;
|
3244
|
-
description: string;
|
3245
|
-
defaultMessage: string;
|
3246
|
-
}>>;
|
3247
|
-
data: z.ZodArray<z.ZodObject<{
|
3248
|
-
fieldId: z.ZodString;
|
3249
|
-
}, "strip", z.ZodTypeAny, {
|
3250
|
-
fieldId: string;
|
3251
|
-
}, {
|
3252
|
-
fieldId: string;
|
3253
|
-
}>, "many">;
|
3254
|
-
}, "strip", z.ZodTypeAny, {
|
3255
|
-
data: {
|
3256
|
-
fieldId: string;
|
3257
|
-
}[];
|
3258
|
-
subtitle?: TranslationConfig | undefined;
|
3259
|
-
}, {
|
3260
|
-
data: {
|
3261
|
-
fieldId: string;
|
3262
|
-
}[];
|
3263
|
-
subtitle?: {
|
3264
|
-
id: string;
|
3265
|
-
description: string;
|
3266
|
-
defaultMessage: string;
|
3267
|
-
} | undefined;
|
3268
|
-
}>;
|
3269
|
-
}>, "strip", z.ZodTypeAny, {
|
3270
|
-
type: "DATA";
|
3271
|
-
id: string;
|
3272
|
-
label: TranslationConfig;
|
3273
|
-
configuration: {
|
3274
|
-
data: {
|
3275
|
-
fieldId: string;
|
3276
|
-
}[];
|
3277
|
-
subtitle?: TranslationConfig | undefined;
|
3278
|
-
};
|
3279
|
-
validation?: {
|
3280
|
-
message: TranslationConfig;
|
3281
|
-
validator: import(".").JSONSchema;
|
3282
|
-
}[] | undefined;
|
3283
|
-
required?: boolean | undefined;
|
3284
|
-
dependsOn?: string[] | undefined;
|
3285
|
-
defaultValue?: string | number | boolean | {
|
3286
|
-
dependsOn: string[];
|
3287
|
-
expression: string;
|
3288
|
-
} | undefined;
|
3289
|
-
conditionals?: ({
|
3290
|
-
type: "SHOW";
|
3291
|
-
conditional: import(".").JSONSchema;
|
3292
|
-
} | {
|
3293
|
-
type: "ENABLE";
|
3294
|
-
conditional: import(".").JSONSchema;
|
3295
|
-
})[] | undefined;
|
3296
|
-
disabled?: boolean | undefined;
|
3297
|
-
hidden?: boolean | undefined;
|
3298
|
-
placeholder?: TranslationConfig | undefined;
|
3299
|
-
hideLabel?: boolean | undefined;
|
3300
|
-
}, {
|
3301
|
-
type: "DATA";
|
3302
|
-
id: string;
|
3303
|
-
label: {
|
3304
|
-
id: string;
|
3305
|
-
description: string;
|
3306
|
-
defaultMessage: string;
|
3307
|
-
};
|
3308
|
-
configuration: {
|
3309
|
-
data: {
|
3310
|
-
fieldId: string;
|
3311
|
-
}[];
|
3312
|
-
subtitle?: {
|
3313
|
-
id: string;
|
3314
|
-
description: string;
|
3315
|
-
defaultMessage: string;
|
3316
|
-
} | undefined;
|
3317
|
-
};
|
3318
|
-
validation?: {
|
3319
|
-
message: {
|
3320
|
-
id: string;
|
3321
|
-
description: string;
|
3322
|
-
defaultMessage: string;
|
3323
|
-
};
|
3324
|
-
validator: import(".").JSONSchema;
|
3325
|
-
}[] | undefined;
|
3326
|
-
required?: boolean | undefined;
|
3327
|
-
dependsOn?: string[] | undefined;
|
3328
|
-
defaultValue?: string | number | boolean | {
|
3329
|
-
expression: string;
|
3330
|
-
dependsOn?: string[] | undefined;
|
3331
|
-
} | undefined;
|
3332
|
-
conditionals?: ({
|
3333
|
-
type: "SHOW";
|
3334
|
-
conditional: import(".").JSONSchema;
|
3335
|
-
} | {
|
3336
|
-
type: "ENABLE";
|
3337
|
-
conditional: import(".").JSONSchema;
|
3338
|
-
})[] | undefined;
|
3339
|
-
disabled?: boolean | undefined;
|
3340
|
-
hidden?: boolean | undefined;
|
3341
|
-
placeholder?: {
|
3342
|
-
id: string;
|
3343
|
-
description: string;
|
3344
|
-
defaultMessage: string;
|
3345
|
-
} | undefined;
|
3346
|
-
hideLabel?: boolean | undefined;
|
3347
|
-
}>;
|
3348
|
-
export type DataField = z.infer<typeof DataField>;
|
3349
3193
|
/** @knipignore */
|
3350
|
-
export type AllFields = typeof Address | typeof TextField | typeof NumberField | typeof TextAreaField | typeof DateField | typeof Paragraph | typeof RadioGroup | typeof BulletList | typeof PageHeader | typeof Select | typeof Checkbox | typeof File | typeof Country | typeof AdministrativeArea | typeof Divider | typeof Location | typeof Facility | typeof Office | typeof SignatureField | typeof EmailField | typeof FileUploadWithOptions
|
3194
|
+
export type AllFields = typeof Address | typeof TextField | typeof NumberField | typeof TextAreaField | typeof DateField | typeof Paragraph | typeof RadioGroup | typeof BulletList | typeof PageHeader | typeof Select | typeof Checkbox | typeof File | typeof Country | typeof AdministrativeArea | typeof Divider | typeof Location | typeof Facility | typeof Office | typeof SignatureField | typeof EmailField | typeof FileUploadWithOptions;
|
3351
3195
|
/** @knipignore */
|
3352
|
-
export type Inferred = z.infer<typeof Address> | z.infer<typeof TextField> | z.infer<typeof NumberField> | z.infer<typeof TextAreaField> | z.infer<typeof DateField> | z.infer<typeof Paragraph> | z.infer<typeof RadioGroup> | z.infer<typeof BulletList> | z.infer<typeof PageHeader> | z.infer<typeof Select> | z.infer<typeof Checkbox> | z.infer<typeof File> | z.infer<typeof FileUploadWithOptions> | z.infer<typeof Country> | z.infer<typeof AdministrativeArea> | z.infer<typeof Divider> | z.infer<typeof Location> | z.infer<typeof Facility> | z.infer<typeof Office> | z.infer<typeof SignatureField> | z.infer<typeof EmailField
|
3196
|
+
export type Inferred = z.infer<typeof Address> | z.infer<typeof TextField> | z.infer<typeof NumberField> | z.infer<typeof TextAreaField> | z.infer<typeof DateField> | z.infer<typeof Paragraph> | z.infer<typeof RadioGroup> | z.infer<typeof BulletList> | z.infer<typeof PageHeader> | z.infer<typeof Select> | z.infer<typeof Checkbox> | z.infer<typeof File> | z.infer<typeof FileUploadWithOptions> | z.infer<typeof Country> | z.infer<typeof AdministrativeArea> | z.infer<typeof Divider> | z.infer<typeof Location> | z.infer<typeof Facility> | z.infer<typeof Office> | z.infer<typeof SignatureField> | z.infer<typeof EmailField>;
|
3353
3197
|
export declare const FieldConfig: z.ZodType<Inferred, any, Inferred>;
|
3354
3198
|
export type SelectField = z.infer<typeof Select>;
|
3355
3199
|
export type LocationField = z.infer<typeof Location>;
|
@@ -21,9 +21,8 @@ export declare const FieldType: {
|
|
21
21
|
readonly FACILITY: "FACILITY";
|
22
22
|
readonly OFFICE: "OFFICE";
|
23
23
|
readonly SIGNATURE: "SIGNATURE";
|
24
|
-
readonly DATA: "DATA";
|
25
24
|
};
|
26
|
-
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"
|
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")[];
|
27
26
|
export type FieldType = (typeof fieldTypes)[number];
|
28
27
|
/**
|
29
28
|
* Composite field types are field types that consist of multiple field values.
|
@@ -1,5 +1,5 @@
|
|
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
|
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
4
|
import { FieldValue, FieldUpdateValueSchema } from './FieldValue';
|
5
5
|
import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue } from './CompositeFieldValue';
|
@@ -122,7 +122,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
|
|
122
122
|
option: string;
|
123
123
|
filename: string;
|
124
124
|
originalFilename: string;
|
125
|
-
}>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.
|
125
|
+
}>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
|
126
126
|
country: z.ZodString;
|
127
127
|
province: z.ZodString;
|
128
128
|
district: z.ZodString;
|
@@ -257,49 +257,6 @@ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number):
|
|
257
257
|
street?: undefined;
|
258
258
|
number?: undefined;
|
259
259
|
zipCode?: undefined;
|
260
|
-
} | {
|
261
|
-
country?: undefined;
|
262
|
-
province?: undefined;
|
263
|
-
district?: undefined;
|
264
|
-
urbanOrRural?: undefined;
|
265
|
-
town?: undefined;
|
266
|
-
residentialArea?: undefined;
|
267
|
-
street?: undefined;
|
268
|
-
number?: undefined;
|
269
|
-
zipCode?: undefined;
|
270
|
-
filename?: undefined;
|
271
|
-
originalFilename?: undefined;
|
272
|
-
type?: undefined;
|
273
|
-
} | null;
|
274
|
-
/**
|
275
|
-
* Maps complex or nested field types, such as Address fields, to their corresponding empty values.
|
276
|
-
*/
|
277
|
-
export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
|
278
|
-
country: null;
|
279
|
-
province: null;
|
280
|
-
district: null;
|
281
|
-
urbanOrRural: string;
|
282
|
-
town: null;
|
283
|
-
residentialArea: null;
|
284
|
-
street: null;
|
285
|
-
number: null;
|
286
|
-
zipCode: null;
|
287
|
-
filename?: undefined;
|
288
|
-
originalFilename?: undefined;
|
289
|
-
type?: undefined;
|
290
|
-
} | {
|
291
|
-
filename: string;
|
292
|
-
originalFilename: string;
|
293
|
-
type: string;
|
294
|
-
country?: undefined;
|
295
|
-
province?: undefined;
|
296
|
-
district?: undefined;
|
297
|
-
urbanOrRural?: undefined;
|
298
|
-
town?: undefined;
|
299
|
-
residentialArea?: undefined;
|
300
|
-
street?: undefined;
|
301
|
-
number?: undefined;
|
302
|
-
zipCode?: undefined;
|
303
260
|
} | null;
|
304
261
|
export declare const isParagraphFieldType: (field: {
|
305
262
|
config: FieldConfig;
|
@@ -448,12 +405,5 @@ export declare const isOfficeFieldType: (field: {
|
|
448
405
|
value: string;
|
449
406
|
config: Office;
|
450
407
|
};
|
451
|
-
export declare const isDataFieldType: (field: {
|
452
|
-
config: FieldConfig;
|
453
|
-
value: FieldValue;
|
454
|
-
}) => field is {
|
455
|
-
value: undefined;
|
456
|
-
config: DataField;
|
457
|
-
};
|
458
408
|
export {};
|
459
409
|
//# sourceMappingURL=FieldTypeMapping.d.ts.map
|
@@ -20,8 +20,6 @@ export declare const CheckboxFieldValue: z.ZodBoolean;
|
|
20
20
|
export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
|
21
21
|
export declare const NumberFieldValue: z.ZodNumber;
|
22
22
|
export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
|
23
|
-
export declare const DataFieldValue: z.ZodUndefined;
|
24
|
-
export type DataFieldValue = z.infer<typeof DataFieldValue>;
|
25
23
|
export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
26
24
|
filename: z.ZodString;
|
27
25
|
originalFilename: z.ZodString;
|
@@ -99,7 +97,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
|
|
99
97
|
province: string;
|
100
98
|
urbanOrRural: "RURAL";
|
101
99
|
village?: string | undefined;
|
102
|
-
}
|
100
|
+
}>]>;
|
103
101
|
export type FieldValue = z.infer<typeof FieldValue>;
|
104
102
|
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
|
105
103
|
filename: z.ZodString;
|
@@ -178,16 +176,16 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
|
|
178
176
|
province: string;
|
179
177
|
urbanOrRural: "RURAL";
|
180
178
|
village?: string | null | undefined;
|
181
|
-
}
|
179
|
+
}>]>;
|
182
180
|
export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;
|
183
181
|
/**
|
184
182
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
185
183
|
* */
|
186
|
-
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue |
|
184
|
+
export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldValue | typeof NumberFieldValue | z.ZodString | z.ZodBoolean;
|
187
185
|
/**
|
188
186
|
* NOTE: This is an exception. We need schema as a type in order to generate schema dynamically.
|
189
187
|
*
|
190
188
|
* FieldValueInputSchema uses Input types which have set optional values as nullish
|
191
189
|
* */
|
192
|
-
export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue |
|
190
|
+
export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | z.ZodString | z.ZodBoolean;
|
193
191
|
//# sourceMappingURL=FieldValue.d.ts.map
|