@opencrvs/toolkit 1.8.1-rc.cacd557 → 1.8.1-rc.d3d858d

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 (31) hide show
  1. package/dist/commons/api/router.d.ts +391 -392
  2. package/dist/commons/conditionals/validate.d.ts +11 -2
  3. package/dist/commons/events/ActionConfig.d.ts +2004 -366
  4. package/dist/commons/events/ActionDocument.d.ts +736 -736
  5. package/dist/commons/events/ActionInput.d.ts +600 -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 +48 -48
  10. package/dist/commons/events/EventConfig.d.ts +673 -146
  11. package/dist/commons/events/EventDocument.d.ts +432 -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 +254 -43
  15. package/dist/commons/events/FieldTypeMapping.d.ts +16 -16
  16. package/dist/commons/events/FieldValue.d.ts +12 -12
  17. package/dist/commons/events/FormConfig.d.ts +1032 -246
  18. package/dist/commons/events/PageConfig.d.ts +264 -46
  19. package/dist/commons/events/WorkqueueConfig.d.ts +199 -164
  20. package/dist/commons/events/defineConfig.d.ts +127 -28
  21. package/dist/commons/events/event.d.ts +61 -7
  22. package/dist/commons/events/test.utils.d.ts +12 -12
  23. package/dist/commons/events/utils.d.ts +234 -58
  24. package/dist/conditionals/index.js +3 -2
  25. package/dist/events/index.js +224 -89
  26. package/package.json +1 -1
  27. package/tsconfig.json +1 -1
  28. package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
  29. package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
  30. package/dist/commons/conditionals/validate.test.d.ts +0 -2
  31. package/dist/commons/events/utils.test.d.ts +0 -2
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { TranslationConfig } from './TranslationConfig';
3
+ import { FieldConfig } from './FieldConfig';
3
4
  export declare const SearchQueryParams: z.ZodObject<{
4
5
  eventType: z.ZodOptional<z.ZodString>;
5
6
  }, "strip", z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString, z.ZodUnion<[z.ZodObject<{
@@ -137,16 +138,16 @@ export declare const SearchQueryParams: z.ZodObject<{
137
138
  surname: string;
138
139
  middlename?: string | undefined;
139
140
  }>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
140
- firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
- surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ firstname: z.ZodString;
142
+ surname: z.ZodString;
142
143
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
144
  }, "strip", z.ZodTypeAny, {
144
- firstname?: string | null | undefined;
145
- surname?: string | null | undefined;
145
+ firstname: string;
146
+ surname: string;
146
147
  middlename?: string | null | undefined;
147
148
  }, {
148
- firstname?: string | null | undefined;
149
- surname?: string | null | undefined;
149
+ firstname: string;
150
+ surname: string;
150
151
  middlename?: string | null | undefined;
151
152
  }>, z.ZodNull]>, z.ZodUndefined]>]>, z.objectOutputType<{
152
153
  eventType: z.ZodOptional<z.ZodString>;
@@ -285,16 +286,16 @@ export declare const SearchQueryParams: z.ZodObject<{
285
286
  surname: string;
286
287
  middlename?: string | undefined;
287
288
  }>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
288
- firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
- surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
+ firstname: z.ZodString;
290
+ surname: z.ZodString;
290
291
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
292
  }, "strip", z.ZodTypeAny, {
292
- firstname?: string | null | undefined;
293
- surname?: string | null | undefined;
293
+ firstname: string;
294
+ surname: string;
294
295
  middlename?: string | null | undefined;
295
296
  }, {
296
- firstname?: string | null | undefined;
297
- surname?: string | null | undefined;
297
+ firstname: string;
298
+ surname: string;
298
299
  middlename?: string | null | undefined;
299
300
  }>, z.ZodNull]>, z.ZodUndefined]>]>, "strip">, z.objectInputType<{
300
301
  eventType: z.ZodOptional<z.ZodString>;
@@ -433,16 +434,16 @@ export declare const SearchQueryParams: z.ZodObject<{
433
434
  surname: string;
434
435
  middlename?: string | undefined;
435
436
  }>, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
436
- firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
437
- surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
437
+ firstname: z.ZodString;
438
+ surname: z.ZodString;
438
439
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
439
440
  }, "strip", z.ZodTypeAny, {
440
- firstname?: string | null | undefined;
441
- surname?: string | null | undefined;
441
+ firstname: string;
442
+ surname: string;
442
443
  middlename?: string | null | undefined;
443
444
  }, {
444
- firstname?: string | null | undefined;
445
- surname?: string | null | undefined;
445
+ firstname: string;
446
+ surname: string;
446
447
  middlename?: string | null | undefined;
447
448
  }>, z.ZodNull]>, z.ZodUndefined]>]>, "strip">>;
448
449
  export type SearchQueryParams = z.infer<typeof SearchQueryParams>;
@@ -568,7 +569,22 @@ export declare const FieldConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
568
569
  alternateFieldIds?: string[] | undefined;
569
570
  excludeInSearchQuery?: boolean | undefined;
570
571
  }>;
571
- export declare const EventFieldId: z.ZodEnum<["trackingId", "status", "legalStatuses.REGISTERED.acceptedAt", "legalStatuses.REGISTERED.createdAtLocation", "updatedAt"]>;
572
+ /**
573
+ * The event fields that are available for advanced search. These are the values
574
+ * that can be passed to the `event` function to create a field config.
575
+ */
576
+ export declare const EventFieldIdInput: z.ZodEnum<["trackingId", "status", "legalStatuses.REGISTERED.acceptedAt", "legalStatuses.REGISTERED.createdAtLocation", "updatedAt"]>;
577
+ /**
578
+ * Represent the prefix used to differentiate event metadata fields from
579
+ * the declaration ones in advanced search form.
580
+ */
581
+ export declare const METADATA_FIELD_PREFIX = "event.";
582
+ /**
583
+ * The field IDs that are actually used in the advanced search. The `event`
584
+ * function prefixes the `EventFieldIdInput` values with METADATA_FIELD_PREFIX.
585
+ */
586
+ export declare const EventFieldId: z.ZodEnum<["event.trackingId", "event.status", "event.legalStatuses.REGISTERED.acceptedAt", "event.legalStatuses.REGISTERED.createdAtLocation", "event.updatedAt"]>;
587
+ export type EventFieldIdInput = z.infer<typeof EventFieldIdInput>;
572
588
  export type EventFieldId = z.infer<typeof EventFieldId>;
573
589
  export declare const EventFieldConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
574
590
  config: z.ZodObject<{
@@ -621,13 +637,13 @@ export declare const EventFieldConfigSchema: z.ZodObject<z.objectUtil.extendShap
621
637
  validator: import(".").JSONSchema;
622
638
  }>, "many">>>;
623
639
  }, {
624
- fieldId: z.ZodEnum<["trackingId", "status", "legalStatuses.REGISTERED.acceptedAt", "legalStatuses.REGISTERED.createdAtLocation", "updatedAt"]>;
640
+ fieldId: z.ZodEnum<["event.trackingId", "event.status", "event.legalStatuses.REGISTERED.acceptedAt", "event.legalStatuses.REGISTERED.createdAtLocation", "event.updatedAt"]>;
625
641
  fieldType: z.ZodLiteral<"event">;
626
642
  }>, "strip", z.ZodTypeAny, {
627
643
  config: {
628
644
  type: "exact" | "fuzzy" | "range" | "within";
629
645
  };
630
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
646
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
631
647
  fieldType: "event";
632
648
  options?: {
633
649
  value: string;
@@ -652,7 +668,7 @@ export declare const EventFieldConfigSchema: z.ZodObject<z.objectUtil.extendShap
652
668
  config: {
653
669
  type: "exact" | "fuzzy" | "range" | "within";
654
670
  };
655
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
671
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
656
672
  fieldType: "event";
657
673
  options?: {
658
674
  value: string;
@@ -858,13 +874,13 @@ export declare const SearchField: z.ZodDiscriminatedUnion<"fieldType", [z.ZodObj
858
874
  validator: import(".").JSONSchema;
859
875
  }>, "many">>>;
860
876
  }, {
861
- fieldId: z.ZodEnum<["trackingId", "status", "legalStatuses.REGISTERED.acceptedAt", "legalStatuses.REGISTERED.createdAtLocation", "updatedAt"]>;
877
+ fieldId: z.ZodEnum<["event.trackingId", "event.status", "event.legalStatuses.REGISTERED.acceptedAt", "event.legalStatuses.REGISTERED.createdAtLocation", "event.updatedAt"]>;
862
878
  fieldType: z.ZodLiteral<"event">;
863
879
  }>, "strip", z.ZodTypeAny, {
864
880
  config: {
865
881
  type: "exact" | "fuzzy" | "range" | "within";
866
882
  };
867
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
883
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
868
884
  fieldType: "event";
869
885
  options?: {
870
886
  value: string;
@@ -889,7 +905,7 @@ export declare const SearchField: z.ZodDiscriminatedUnion<"fieldType", [z.ZodObj
889
905
  config: {
890
906
  type: "exact" | "fuzzy" | "range" | "within";
891
907
  };
892
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
908
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
893
909
  fieldType: "event";
894
910
  options?: {
895
911
  value: string;
@@ -1102,13 +1118,13 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
1102
1118
  validator: import(".").JSONSchema;
1103
1119
  }>, "many">>>;
1104
1120
  }, {
1105
- fieldId: z.ZodEnum<["trackingId", "status", "legalStatuses.REGISTERED.acceptedAt", "legalStatuses.REGISTERED.createdAtLocation", "updatedAt"]>;
1121
+ fieldId: z.ZodEnum<["event.trackingId", "event.status", "event.legalStatuses.REGISTERED.acceptedAt", "event.legalStatuses.REGISTERED.createdAtLocation", "event.updatedAt"]>;
1106
1122
  fieldType: z.ZodLiteral<"event">;
1107
1123
  }>, "strip", z.ZodTypeAny, {
1108
1124
  config: {
1109
1125
  type: "exact" | "fuzzy" | "range" | "within";
1110
1126
  };
1111
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
1127
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
1112
1128
  fieldType: "event";
1113
1129
  options?: {
1114
1130
  value: string;
@@ -1133,7 +1149,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
1133
1149
  config: {
1134
1150
  type: "exact" | "fuzzy" | "range" | "within";
1135
1151
  };
1136
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
1152
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
1137
1153
  fieldType: "event";
1138
1154
  options?: {
1139
1155
  value: string;
@@ -1200,7 +1216,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
1200
1216
  config: {
1201
1217
  type: "exact" | "fuzzy" | "range" | "within";
1202
1218
  };
1203
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
1219
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
1204
1220
  fieldType: "event";
1205
1221
  options?: {
1206
1222
  value: string;
@@ -1271,7 +1287,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
1271
1287
  config: {
1272
1288
  type: "exact" | "fuzzy" | "range" | "within";
1273
1289
  };
1274
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
1290
+ fieldId: "event.status" | "event.updatedAt" | "event.trackingId" | "event.legalStatuses.REGISTERED.acceptedAt" | "event.legalStatuses.REGISTERED.createdAtLocation";
1275
1291
  fieldType: "event";
1276
1292
  options?: {
1277
1293
  value: string;
@@ -1306,6 +1322,8 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
1306
1322
  }[] | undefined;
1307
1323
  })[];
1308
1324
  }>;
1309
- export type AdvancedSearchConfigInput = z.infer<typeof AdvancedSearchConfig>;
1310
1325
  export type AdvancedSearchConfig = z.infer<typeof AdvancedSearchConfig>;
1326
+ export type AdvancedSearchConfigWithFieldsResolved = Omit<AdvancedSearchConfig, 'fields'> & {
1327
+ fields: FieldConfig[];
1328
+ };
1311
1329
  //# sourceMappingURL=AdvancedSearchConfig.d.ts.map
@@ -131,16 +131,16 @@ export declare const NameFieldValue: z.ZodObject<{
131
131
  middlename?: string | undefined;
132
132
  }>;
133
133
  export declare const NameFieldUpdateValue: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
134
- firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
- surname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
+ firstname: z.ZodString;
135
+ surname: z.ZodString;
136
136
  middlename: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
137
  }, "strip", z.ZodTypeAny, {
138
- firstname?: string | null | undefined;
139
- surname?: string | null | undefined;
138
+ firstname: string;
139
+ surname: string;
140
140
  middlename?: string | null | undefined;
141
141
  }, {
142
- firstname?: string | null | undefined;
143
- surname?: string | null | undefined;
142
+ firstname: string;
143
+ surname: string;
144
144
  middlename?: string | null | undefined;
145
145
  }>, z.ZodNull]>, z.ZodUndefined]>;
146
146
  export type NameFieldValue = z.infer<typeof NameFieldValue>;