@opencrvs/toolkit 1.8.0-rc.fef85f2 → 1.8.0-rc.ff0a1b5

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 +7684 -4215
  2. package/dist/commons/conditionals/conditionals.d.ts +9 -6
  3. package/dist/commons/events/ActionConfig.d.ts +90025 -1680
  4. package/dist/commons/events/ActionDocument.d.ts +542 -211
  5. package/dist/commons/events/ActionInput.d.ts +248 -240
  6. package/dist/commons/events/AdvancedSearchConfig.d.ts +369 -25
  7. package/dist/commons/events/Draft.d.ts +33 -20
  8. package/dist/commons/events/EventConfig.d.ts +42730 -1400
  9. package/dist/commons/events/EventDocument.d.ts +337 -159
  10. package/dist/commons/events/EventIndex.d.ts +1462 -16
  11. package/dist/commons/events/EventInput.d.ts +13 -0
  12. package/dist/commons/events/EventMetadata.d.ts +273 -14
  13. package/dist/commons/events/FieldConfig.d.ts +3682 -714
  14. package/dist/commons/events/FieldType.d.ts +3 -3
  15. package/dist/commons/events/FieldTypeMapping.d.ts +11 -4
  16. package/dist/commons/events/FieldValue.d.ts +7 -4
  17. package/dist/commons/events/FormConfig.d.ts +40417 -439
  18. package/dist/commons/events/PageConfig.d.ts +10077 -203
  19. package/dist/commons/events/SummaryConfig.d.ts +17 -47
  20. package/dist/commons/events/WorkqueueConfig.d.ts +1257 -19
  21. package/dist/commons/events/defineConfig.d.ts +6952 -32
  22. package/dist/commons/events/event.d.ts +27 -0
  23. package/dist/commons/events/field.d.ts +68 -0
  24. package/dist/commons/events/index.d.ts +2 -0
  25. package/dist/commons/events/scopes.d.ts +1 -0
  26. package/dist/commons/events/test.utils.d.ts +7 -44
  27. package/dist/commons/events/utils.d.ts +3550 -67
  28. package/dist/conditionals/index.js +36 -33
  29. package/dist/events/index.js +1446 -949
  30. package/dist/scopes/index.d.ts +70 -1
  31. package/dist/scopes/index.js +130 -0
  32. package/package.json +3 -2
@@ -5,12 +5,12 @@ export declare const FieldType: {
5
5
  readonly TEXTAREA: "TEXTAREA";
6
6
  readonly EMAIL: "EMAIL";
7
7
  readonly DATE: "DATE";
8
+ readonly DATE_RANGE: "DATE_RANGE";
8
9
  readonly PARAGRAPH: "PARAGRAPH";
9
10
  readonly PAGE_HEADER: "PAGE_HEADER";
10
11
  readonly RADIO_GROUP: "RADIO_GROUP";
11
12
  readonly FILE: "FILE";
12
13
  readonly FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS";
13
- readonly HIDDEN: "HIDDEN";
14
14
  readonly BULLET_LIST: "BULLET_LIST";
15
15
  readonly CHECKBOX: "CHECKBOX";
16
16
  readonly SELECT: "SELECT";
@@ -23,10 +23,10 @@ export declare const FieldType: {
23
23
  readonly SIGNATURE: "SIGNATURE";
24
24
  readonly DATA: "DATA";
25
25
  };
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" | "DATA")[];
26
+ export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[];
27
27
  export type FieldType = (typeof fieldTypes)[number];
28
28
  /**
29
29
  * Composite field types are field types that consist of multiple field values.
30
30
  */
31
- export declare const compositeFieldTypes: ("ADDRESS" | "FILE" | "FILE_WITH_OPTIONS")[];
31
+ export declare const compositeFieldTypes: ("ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS")[];
32
32
  //# sourceMappingURL=FieldType.d.ts.map
@@ -158,7 +158,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
158
158
  option: string;
159
159
  filename: string;
160
160
  originalFilename: string;
161
- }>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodUndefined | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
161
+ }>, "many">>> | z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodUndefined | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
162
162
  country: z.ZodString;
163
163
  addressType: z.ZodLiteral<"DOMESTIC">;
164
164
  province: z.ZodString;
@@ -283,7 +283,7 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
283
283
  option: string;
284
284
  filename: string;
285
285
  originalFilename: string;
286
- }[] | null | undefined;
286
+ }[] | [string, string] | null | undefined;
287
287
  }, {
288
288
  [x: string]: string | number | boolean | {
289
289
  type: string;
@@ -322,12 +322,12 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
322
322
  option: string;
323
323
  filename: string;
324
324
  originalFilename: string;
325
- }[] | null | undefined;
325
+ }[] | [string, string] | null | undefined;
326
326
  }>;
327
327
  /**
328
328
  * Quick-and-dirty mock data generator for event actions.
329
329
  */
330
- export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number): string | true | 19 | {
330
+ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number): string | true | string[] | 19 | {
331
331
  country: string;
332
332
  addressType: "DOMESTIC";
333
333
  province: string;
@@ -416,6 +416,13 @@ export declare const isDateFieldType: (field: {
416
416
  value: string;
417
417
  config: DateField;
418
418
  };
419
+ export declare const isDateRangeFieldType: (field: {
420
+ config: FieldConfig;
421
+ value: FieldValue;
422
+ }) => field is {
423
+ value: string;
424
+ config: DateField;
425
+ };
419
426
  export declare const isPageHeaderFieldType: (field: {
420
427
  config: FieldConfig;
421
428
  value: FieldValue;
@@ -13,8 +13,11 @@ import { AddressFieldValue, AddressFieldUpdateValue, FileFieldValue, FileFieldWi
13
13
  *
14
14
  */
15
15
  export declare const TextValue: z.ZodString;
16
- export declare const RequiredTextValue: z.ZodString;
16
+ export declare const NonEmptyTextValue: z.ZodString;
17
17
  export declare const DateValue: z.ZodString;
18
+ export declare const DatetimeValue: z.ZodString;
19
+ export declare const DateRangeFieldValue: z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
20
+ export type DateRangeFieldValue = z.infer<typeof DateRangeFieldValue>;
18
21
  export declare const EmailValue: z.ZodString;
19
22
  export declare const CheckboxFieldValue: z.ZodBoolean;
20
23
  export type CheckboxFieldValue = z.infer<typeof CheckboxFieldValue>;
@@ -22,7 +25,7 @@ export declare const NumberFieldValue: z.ZodNumber;
22
25
  export type NumberFieldValue = z.infer<typeof NumberFieldValue>;
23
26
  export declare const DataFieldValue: z.ZodUndefined;
24
27
  export type DataFieldValue = z.infer<typeof DataFieldValue>;
25
- export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
28
+ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
26
29
  filename: z.ZodString;
27
30
  originalFilename: z.ZodString;
28
31
  type: z.ZodString;
@@ -137,7 +140,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
137
140
  postcodeOrZip?: string | undefined;
138
141
  }>]>;
139
142
  export type FieldValue = z.infer<typeof FieldValue>;
140
- export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
143
+ export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
141
144
  filename: z.ZodString;
142
145
  originalFilename: z.ZodString;
143
146
  type: z.ZodString;
@@ -261,5 +264,5 @@ export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptio
261
264
  *
262
265
  * FieldValueInputSchema uses Input types which have set optional values as nullish
263
266
  * */
264
- export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
267
+ export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
265
268
  //# sourceMappingURL=FieldValue.d.ts.map