@opencrvs/toolkit 1.8.0-rc.fb2e700 → 1.8.0-rc.fb5b9fe

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 (41) hide show
  1. package/dist/commons/api/router.d.ts +12023 -4357
  2. package/dist/commons/conditionals/conditionals.d.ts +10 -6
  3. package/dist/commons/conditionals/validate.d.ts +4 -6
  4. package/dist/commons/events/ActionConfig.d.ts +105057 -1720
  5. package/dist/commons/events/ActionDocument.d.ts +970 -452
  6. package/dist/commons/events/ActionInput.d.ts +443 -363
  7. package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
  8. package/dist/commons/events/CompositeFieldValue.d.ts +3 -0
  9. package/dist/commons/events/Constants.d.ts +2 -0
  10. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  11. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  12. package/dist/commons/events/Draft.d.ts +57 -39
  13. package/dist/commons/events/EventConfig.d.ts +50483 -1345
  14. package/dist/commons/events/EventDocument.d.ts +630 -330
  15. package/dist/commons/events/EventIndex.d.ts +1344 -18
  16. package/dist/commons/events/EventMetadata.d.ts +302 -16
  17. package/dist/commons/events/FieldConfig.d.ts +4358 -786
  18. package/dist/commons/events/FieldType.d.ts +3 -3
  19. package/dist/commons/events/FieldTypeMapping.d.ts +16 -6
  20. package/dist/commons/events/FieldValue.d.ts +9 -4
  21. package/dist/commons/events/FormConfig.d.ts +43885 -439
  22. package/dist/commons/events/PageConfig.d.ts +10930 -204
  23. package/dist/commons/events/SummaryConfig.d.ts +95 -39
  24. package/dist/commons/events/User.d.ts +31 -2
  25. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  26. package/dist/commons/events/WorkqueueConfig.d.ts +4525 -20
  27. package/dist/commons/events/defineConfig.d.ts +8017 -28
  28. package/dist/commons/events/event.d.ts +54 -0
  29. package/dist/commons/events/field.d.ts +73 -0
  30. package/dist/commons/events/index.d.ts +7 -0
  31. package/dist/commons/events/scopes.d.ts +45 -0
  32. package/dist/commons/events/serializer.d.ts +2 -0
  33. package/dist/commons/events/test.utils.d.ts +35 -51
  34. package/dist/commons/events/transactions.d.ts +1 -1
  35. package/dist/commons/events/utils.d.ts +3706 -71
  36. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  37. package/dist/conditionals/index.js +58 -35
  38. package/dist/events/index.js +3152 -1166
  39. package/dist/scopes/index.d.ts +94 -6
  40. package/dist/scopes/index.js +42 -21
  41. 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;
@@ -446,9 +453,9 @@ export declare const isTextAreaFieldType: (field: {
446
453
  };
447
454
  export declare const isSignatureFieldType: (field: {
448
455
  config: FieldConfig;
449
- value: FieldValue;
456
+ value: FieldValue | undefined;
450
457
  }) => field is {
451
- value: string;
458
+ value: FileFieldValue | undefined;
452
459
  config: SignatureField;
453
460
  };
454
461
  export declare const isEmailFieldType: (field: {
@@ -556,5 +563,8 @@ export declare const isDataFieldType: (field: {
556
563
  value: undefined;
557
564
  config: DataField;
558
565
  };
566
+ export type NonInteractiveFieldType = Divider | PageHeader | Paragraph | BulletList | DataField;
567
+ export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
568
+ export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
559
569
  export {};
560
570
  //# sourceMappingURL=FieldTypeMapping.d.ts.map
@@ -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,9 @@ 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 SignatureFieldValue: z.ZodString;
29
+ export type SignatureFieldValue = z.infer<typeof SignatureFieldValue>;
30
+ 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
31
  filename: z.ZodString;
27
32
  originalFilename: z.ZodString;
28
33
  type: z.ZodString;
@@ -137,7 +142,7 @@ export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBool
137
142
  postcodeOrZip?: string | undefined;
138
143
  }>]>;
139
144
  export type FieldValue = z.infer<typeof FieldValue>;
140
- export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
145
+ 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
146
  filename: z.ZodString;
142
147
  originalFilename: z.ZodString;
143
148
  type: z.ZodString;
@@ -261,5 +266,5 @@ export type FieldValueSchema = typeof FileFieldValue | typeof FileFieldWithOptio
261
266
  *
262
267
  * FieldValueInputSchema uses Input types which have set optional values as nullish
263
268
  * */
264
- export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
269
+ export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean;
265
270
  //# sourceMappingURL=FieldValue.d.ts.map