@opencrvs/toolkit 1.8.1-rc.4fba37a → 1.8.1-rc.5130256

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 (33) hide show
  1. package/dist/commons/api/router.d.ts +395 -412
  2. package/dist/commons/conditionals/conditionals.test.d.ts +2 -0
  3. package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
  4. package/dist/commons/conditionals/validate.d.ts +2 -11
  5. package/dist/commons/conditionals/validate.test.d.ts +2 -0
  6. package/dist/commons/events/ActionConfig.d.ts +9396 -8676
  7. package/dist/commons/events/ActionDocument.d.ts +716 -1252
  8. package/dist/commons/events/ActionInput.d.ts +600 -626
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +65 -83
  10. package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
  11. package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
  12. package/dist/commons/events/Draft.d.ts +56 -56
  13. package/dist/commons/events/EventConfig.d.ts +2213 -1443
  14. package/dist/commons/events/EventDocument.d.ts +432 -451
  15. package/dist/commons/events/EventIndex.d.ts +62 -184
  16. package/dist/commons/events/EventMetadata.d.ts +9 -9
  17. package/dist/commons/events/FieldConfig.d.ts +251 -944
  18. package/dist/commons/events/FieldType.d.ts +2 -6
  19. package/dist/commons/events/FieldTypeMapping.d.ts +25 -18
  20. package/dist/commons/events/FieldValue.d.ts +12 -12
  21. package/dist/commons/events/FormConfig.d.ts +3874 -3574
  22. package/dist/commons/events/PageConfig.d.ts +544 -524
  23. package/dist/commons/events/WorkqueueConfig.d.ts +164 -288
  24. package/dist/commons/events/defineConfig.d.ts +327 -183
  25. package/dist/commons/events/event.d.ts +6 -68
  26. package/dist/commons/events/field.d.ts +0 -14
  27. package/dist/commons/events/test.utils.d.ts +13 -14
  28. package/dist/commons/events/utils.d.ts +701 -351
  29. package/dist/commons/events/utils.test.d.ts +2 -0
  30. package/dist/conditionals/index.js +2 -3
  31. package/dist/events/index.js +881 -1101
  32. package/package.json +1 -1
  33. package/tsconfig.json +1 -1
@@ -1,4 +1,3 @@
1
- import { z } from 'zod';
2
1
  export declare const FieldType: {
3
2
  readonly NAME: "NAME";
4
3
  readonly PHONE: "PHONE";
@@ -28,12 +27,9 @@ export declare const FieldType: {
28
27
  readonly OFFICE: "OFFICE";
29
28
  readonly SIGNATURE: "SIGNATURE";
30
29
  readonly DATA: "DATA";
30
+ readonly PRINT_BUTTON: "PRINT_BUTTON";
31
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"]>;
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
+ 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" | "PRINT_BUTTON")[];
37
33
  export type FieldType = (typeof fieldTypes)[number];
38
34
  /**
39
35
  * 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, DataField, NameField, PhoneField, IdField, DateRangeField, SelectDateRangeField, TimeField } 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, TimeField, PrintButton } from './FieldConfig';
3
3
  import { FieldType } from './FieldType';
4
4
  import { FieldValue, FieldUpdateValueSchema, DateRangeFieldValue, SelectDateRangeValue } from './FieldValue';
5
5
  import { FullDocumentPath } from '../documents';
@@ -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.ZodString;
60
- surname: z.ZodString;
59
+ firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
+ surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
61
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
62
  }, "strip", z.ZodTypeAny, {
63
- firstname: string;
64
- surname: string;
63
+ firstname?: string | null | undefined;
64
+ surname?: string | null | undefined;
65
65
  middlename?: string | null | undefined;
66
66
  }, {
67
- firstname: string;
68
- surname: string;
67
+ firstname?: string | null | undefined;
68
+ surname?: string | null | undefined;
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.ZodString;
84
- surname: z.ZodString;
83
+ firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
+ surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
85
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
86
  }, "strip", z.ZodTypeAny, {
87
- firstname: string;
88
- surname: string;
87
+ firstname?: string | null | undefined;
88
+ surname?: string | null | undefined;
89
89
  middlename?: string | null | undefined;
90
90
  }, {
91
- firstname: string;
92
- surname: string;
91
+ firstname?: string | null | undefined;
92
+ surname?: string | null | undefined;
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;
337
- surname: string;
336
+ firstname?: string | null | undefined;
337
+ surname?: string | null | undefined;
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;
387
- surname: string;
386
+ firstname?: string | null | undefined;
387
+ surname?: string | null | undefined;
388
388
  middlename?: string | null | undefined;
389
389
  } | {
390
390
  country: string;
@@ -641,7 +641,14 @@ export declare const isDataFieldType: (field: {
641
641
  value: undefined;
642
642
  config: DataField;
643
643
  };
644
- export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField;
644
+ export declare const isPrintButtonFieldType: (field: {
645
+ config: FieldConfig;
646
+ value: FieldValue;
647
+ }) => field is {
648
+ value: undefined;
649
+ config: PrintButton;
650
+ };
651
+ export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField | PrintButton;
645
652
  export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
646
653
  export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
647
654
  export {};
@@ -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.ZodString;
178
- surname: z.ZodString;
177
+ firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
+ surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
179
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
180
  }, "strip", z.ZodTypeAny, {
181
- firstname: string;
182
- surname: string;
181
+ firstname?: string | null | undefined;
182
+ surname?: string | null | undefined;
183
183
  middlename?: string | null | undefined;
184
184
  }, {
185
- firstname: string;
186
- surname: string;
185
+ firstname?: string | null | undefined;
186
+ surname?: string | null | undefined;
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.ZodString;
314
- surname: z.ZodString;
313
+ firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
+ surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
315
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
316
316
  }, "strip", z.ZodTypeAny, {
317
- firstname: string;
318
- surname: string;
317
+ firstname?: string | null | undefined;
318
+ surname?: string | null | undefined;
319
319
  middlename?: string | null | undefined;
320
320
  }, {
321
- firstname: string;
322
- surname: string;
321
+ firstname?: string | null | undefined;
322
+ surname?: string | null | undefined;
323
323
  middlename?: string | null | undefined;
324
324
  }>, z.ZodNull]>, z.ZodUndefined]>]>;
325
325
  export type FieldUpdateValue = z.infer<typeof FieldUpdateValue>;