@opencrvs/toolkit 1.8.1-rc.c6281e8 → 1.8.1-rc.c7fcaa3

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.
Files changed (32) hide show
  1. package/dist/commons/api/router.d.ts +412 -395
  2. package/dist/commons/conditionals/validate.d.ts +11 -2
  3. package/dist/commons/events/ActionConfig.d.ts +3924 -642
  4. package/dist/commons/events/ActionDocument.d.ts +1252 -716
  5. package/dist/commons/events/ActionInput.d.ts +626 -600
  6. package/dist/commons/events/AdvancedSearchConfig.d.ts +49 -31
  7. package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
  8. package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
  9. package/dist/commons/events/Draft.d.ts +56 -56
  10. package/dist/commons/events/EventConfig.d.ts +1259 -240
  11. package/dist/commons/events/EventDocument.d.ts +451 -432
  12. package/dist/commons/events/EventIndex.d.ts +62 -62
  13. package/dist/commons/events/EventMetadata.d.ts +9 -9
  14. package/dist/commons/events/FieldConfig.d.ts +1064 -71
  15. package/dist/commons/events/FieldType.d.ts +5 -0
  16. package/dist/commons/events/FieldTypeMapping.d.ts +16 -16
  17. package/dist/commons/events/FieldValue.d.ts +12 -12
  18. package/dist/commons/events/FormConfig.d.ts +1956 -378
  19. package/dist/commons/events/PageConfig.d.ts +524 -82
  20. package/dist/commons/events/WorkqueueConfig.d.ts +199 -164
  21. package/dist/commons/events/defineConfig.d.ts +181 -46
  22. package/dist/commons/events/event.d.ts +61 -7
  23. package/dist/commons/events/test.utils.d.ts +14 -13
  24. package/dist/commons/events/utils.d.ts +341 -195
  25. package/dist/conditionals/index.js +3 -2
  26. package/dist/events/index.js +1084 -858
  27. package/package.json +1 -1
  28. package/tsconfig.json +1 -1
  29. package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
  30. package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
  31. package/dist/commons/conditionals/validate.test.d.ts +0 -2
  32. package/dist/commons/events/utils.test.d.ts +0 -2
@@ -1,3 +1,4 @@
1
+ import { z } from 'zod';
1
2
  export declare const FieldType: {
2
3
  readonly NAME: "NAME";
3
4
  readonly PHONE: "PHONE";
@@ -28,6 +29,10 @@ export declare const FieldType: {
28
29
  readonly SIGNATURE: "SIGNATURE";
29
30
  readonly DATA: "DATA";
30
31
  };
32
+ /**
33
+ * Union of types that handle files. Using common type should help with compiler to know where to add new cases.
34
+ */
35
+ export declare const FileFieldType: z.ZodEnum<["FILE", "FILE_WITH_OPTIONS", "SIGNATURE"]>;
31
36
  export declare const fieldTypes: ("ID" | "NAME" | "PHONE" | "ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "SELECT_DATE_RANGE" | "TIME" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[];
32
37
  export type FieldType = (typeof fieldTypes)[number];
33
38
  /**
@@ -56,16 +56,16 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
56
56
  surname: string;
57
57
  middlename?: string | undefined;
58
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>>;
59
+ firstname: z.ZodString;
60
+ surname: z.ZodString;
61
61
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
62
  }, "strip", z.ZodTypeAny, {
63
- firstname?: string | null | undefined;
64
- surname?: string | null | undefined;
63
+ firstname: string;
64
+ surname: string;
65
65
  middlename?: string | null | undefined;
66
66
  }, {
67
- firstname?: string | null | undefined;
68
- surname?: string | null | undefined;
67
+ firstname: string;
68
+ surname: string;
69
69
  middlename?: string | null | undefined;
70
70
  }>, z.ZodNull]>, z.ZodUndefined]> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
71
71
  firstname: z.ZodString;
@@ -80,16 +80,16 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
80
80
  surname: string;
81
81
  middlename?: string | undefined;
82
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>>;
83
+ firstname: z.ZodString;
84
+ surname: z.ZodString;
85
85
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
86
  }, "strip", z.ZodTypeAny, {
87
- firstname?: string | null | undefined;
88
- surname?: string | null | undefined;
87
+ firstname: string;
88
+ surname: string;
89
89
  middlename?: string | null | undefined;
90
90
  }, {
91
- firstname?: string | null | undefined;
92
- surname?: string | null | undefined;
91
+ firstname: string;
92
+ surname: string;
93
93
  middlename?: string | null | undefined;
94
94
  }>, z.ZodNull]>, z.ZodUndefined]>>> | z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
95
95
  country: z.ZodString;
@@ -333,8 +333,8 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
333
333
  surname: string;
334
334
  middlename?: string | undefined;
335
335
  } | {
336
- firstname?: string | null | undefined;
337
- surname?: string | null | undefined;
336
+ firstname: string;
337
+ surname: string;
338
338
  middlename?: string | null | undefined;
339
339
  } | {
340
340
  country: string;
@@ -383,8 +383,8 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
383
383
  surname: string;
384
384
  middlename?: string | undefined;
385
385
  } | {
386
- firstname?: string | null | undefined;
387
- surname?: string | null | undefined;
386
+ firstname: string;
387
+ surname: string;
388
388
  middlename?: string | null | undefined;
389
389
  } | {
390
390
  country: string;
@@ -174,16 +174,16 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodStri
174
174
  surname: string;
175
175
  middlename?: string | undefined;
176
176
  }>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
177
- firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
- surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
177
+ firstname: z.ZodString;
178
+ surname: z.ZodString;
179
179
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
180
  }, "strip", z.ZodTypeAny, {
181
- firstname?: string | null | undefined;
182
- surname?: string | null | undefined;
181
+ firstname: string;
182
+ surname: string;
183
183
  middlename?: string | null | undefined;
184
184
  }, {
185
- firstname?: string | null | undefined;
186
- surname?: string | null | undefined;
185
+ firstname: string;
186
+ surname: string;
187
187
  middlename?: string | null | undefined;
188
188
  }>, z.ZodNull]>, z.ZodUndefined]>]>;
189
189
  export type FieldValue = z.infer<typeof FieldValue>;
@@ -310,16 +310,16 @@ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.Z
310
310
  addressLine3?: string | null | undefined;
311
311
  postcodeOrZip?: string | null | undefined;
312
312
  }>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
313
- firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
- surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
+ firstname: z.ZodString;
314
+ surname: z.ZodString;
315
315
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
316
316
  }, "strip", z.ZodTypeAny, {
317
- firstname?: string | null | undefined;
318
- surname?: string | null | undefined;
317
+ firstname: string;
318
+ surname: string;
319
319
  middlename?: string | null | undefined;
320
320
  }, {
321
- firstname?: string | null | undefined;
322
- surname?: string | null | undefined;
321
+ firstname: string;
322
+ surname: string;
323
323
  middlename?: string | null | undefined;
324
324
  }>, z.ZodNull]>, z.ZodUndefined]>]>;
325
325
  export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;