@opencrvs/toolkit 1.8.0-rc.fca3e39 → 1.8.0-rc.fcb9386

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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +12639 -14167
  3. package/dist/commons/conditionals/conditionals.d.ts +32 -6
  4. package/dist/commons/conditionals/validate.d.ts +12 -17
  5. package/dist/commons/events/ActionConfig.d.ts +92869 -2005
  6. package/dist/commons/events/ActionDocument.d.ts +8019 -401
  7. package/dist/commons/events/ActionInput.d.ts +2365 -548
  8. package/dist/commons/events/ActionType.d.ts +26 -16
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +957 -22
  10. package/dist/commons/events/CompositeFieldValue.d.ts +3 -0
  11. package/dist/commons/events/Conditional.d.ts +21 -5
  12. package/dist/commons/events/Constants.d.ts +2 -0
  13. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  14. package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
  15. package/dist/commons/events/Draft.d.ts +93 -60
  16. package/dist/commons/events/EventConfig.d.ts +42302 -1760
  17. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  18. package/dist/commons/events/EventDocument.d.ts +1225 -529
  19. package/dist/commons/events/EventIndex.d.ts +1328 -13
  20. package/dist/commons/events/EventMetadata.d.ts +270 -11
  21. package/dist/commons/events/FieldConfig.d.ts +4704 -786
  22. package/dist/commons/events/FieldType.d.ts +4 -3
  23. package/dist/commons/events/FieldTypeMapping.d.ts +33 -5
  24. package/dist/commons/events/FieldValue.d.ts +12 -7
  25. package/dist/commons/events/FormConfig.d.ts +43810 -73
  26. package/dist/commons/events/PageConfig.d.ts +10991 -0
  27. package/dist/commons/events/SummaryConfig.d.ts +95 -39
  28. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  29. package/dist/commons/events/User.d.ts +31 -2
  30. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  31. package/dist/commons/events/WorkqueueConfig.d.ts +4525 -20
  32. package/dist/commons/events/defineConfig.d.ts +6560 -223
  33. package/dist/commons/events/event.d.ts +54 -0
  34. package/dist/commons/events/field.d.ts +82 -0
  35. package/dist/commons/events/index.d.ts +9 -1
  36. package/dist/commons/events/scopes.d.ts +45 -0
  37. package/dist/commons/events/serializer.d.ts +2 -0
  38. package/dist/commons/events/test.utils.d.ts +93 -327
  39. package/dist/commons/events/utils.d.ts +3701 -96
  40. package/dist/commons/events/utils.test.d.ts +2 -0
  41. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  42. package/dist/conditionals/index.js +210 -122
  43. package/dist/events/index.js +4464 -1981
  44. package/dist/scopes/index.d.ts +158 -1
  45. package/dist/scopes/index.js +152 -1
  46. package/package.json +3 -2
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ export declare const CreatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3
+ //# sourceMappingURL=CreatedAtLocation.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { ActionType } from './ActionType';
3
2
  export declare const Draft: z.ZodObject<{
4
3
  id: z.ZodString;
5
4
  eventId: z.ZodString;
@@ -7,9 +6,13 @@ export declare const Draft: z.ZodObject<{
7
6
  createdAt: z.ZodString;
8
7
  action: z.ZodObject<Omit<z.objectUtil.extendShape<{
9
8
  id: z.ZodString;
9
+ transactionId: z.ZodString;
10
10
  createdAt: z.ZodString;
11
11
  createdBy: z.ZodString;
12
- data: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
12
+ createdByRole: z.ZodString;
13
+ createdBySignature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ declaration: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
13
16
  filename: z.ZodString;
14
17
  originalFilename: z.ZodString;
15
18
  type: z.ZodString;
@@ -92,7 +95,7 @@ export declare const Draft: z.ZodObject<{
92
95
  province: string;
93
96
  urbanOrRural: "RURAL";
94
97
  village?: string | null | undefined;
95
- }>, z.ZodObject<{
98
+ }>, z.ZodUndefined, z.ZodObject<{
96
99
  country: z.ZodString;
97
100
  addressType: z.ZodLiteral<"INTERNATIONAL">;
98
101
  state: z.ZodString;
@@ -123,7 +126,7 @@ export declare const Draft: z.ZodObject<{
123
126
  addressLine3?: string | null | undefined;
124
127
  postcodeOrZip?: string | null | undefined;
125
128
  }>]>>;
126
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
129
+ annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
127
130
  filename: z.ZodString;
128
131
  originalFilename: z.ZodString;
129
132
  type: z.ZodString;
@@ -206,7 +209,7 @@ export declare const Draft: z.ZodObject<{
206
209
  province: string;
207
210
  urbanOrRural: "RURAL";
208
211
  village?: string | null | undefined;
209
- }>, z.ZodObject<{
212
+ }>, z.ZodUndefined, z.ZodObject<{
210
213
  country: z.ZodString;
211
214
  addressType: z.ZodLiteral<"INTERNATIONAL">;
212
215
  state: z.ZodString;
@@ -237,12 +240,18 @@ export declare const Draft: z.ZodObject<{
237
240
  addressLine3?: string | null | undefined;
238
241
  postcodeOrZip?: string | null | undefined;
239
242
  }>]>>>;
240
- createdAtLocation: z.ZodString;
243
+ status: z.ZodEnum<["Requested", "Accepted", "Rejected"]>;
244
+ originalActionId: z.ZodOptional<z.ZodString>;
241
245
  }, {
242
- type: z.ZodEnum<[ActionType, ...ActionType[]]>;
246
+ type: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
243
247
  }>, "id">, "strip", z.ZodTypeAny, {
244
- type: ActionType;
245
- data: Record<string, string | number | boolean | {
248
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
249
+ status: "Rejected" | "Requested" | "Accepted";
250
+ transactionId: string;
251
+ createdAt: string;
252
+ createdBy: string;
253
+ createdByRole: string;
254
+ declaration: Record<string, string | number | boolean | {
246
255
  type: string;
247
256
  filename: string;
248
257
  originalFilename: string;
@@ -279,11 +288,10 @@ export declare const Draft: z.ZodObject<{
279
288
  option: string;
280
289
  filename: string;
281
290
  originalFilename: string;
282
- }[]>;
283
- createdAt: string;
284
- createdBy: string;
285
- createdAtLocation: string;
286
- metadata?: Record<string, string | number | boolean | {
291
+ }[] | [string, string] | undefined>;
292
+ createdBySignature?: string | null | undefined;
293
+ createdAtLocation?: string | null | undefined;
294
+ annotation?: Record<string, string | number | boolean | {
287
295
  type: string;
288
296
  filename: string;
289
297
  originalFilename: string;
@@ -320,10 +328,16 @@ export declare const Draft: z.ZodObject<{
320
328
  option: string;
321
329
  filename: string;
322
330
  originalFilename: string;
323
- }[]> | undefined;
331
+ }[] | [string, string] | undefined> | undefined;
332
+ originalActionId?: string | undefined;
324
333
  }, {
325
- type: ActionType;
326
- data: Record<string, string | number | boolean | {
334
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
335
+ status: "Rejected" | "Requested" | "Accepted";
336
+ transactionId: string;
337
+ createdAt: string;
338
+ createdBy: string;
339
+ createdByRole: string;
340
+ declaration: Record<string, string | number | boolean | {
327
341
  type: string;
328
342
  filename: string;
329
343
  originalFilename: string;
@@ -360,11 +374,10 @@ export declare const Draft: z.ZodObject<{
360
374
  option: string;
361
375
  filename: string;
362
376
  originalFilename: string;
363
- }[]>;
364
- createdAt: string;
365
- createdBy: string;
366
- createdAtLocation: string;
367
- metadata?: Record<string, string | number | boolean | {
377
+ }[] | [string, string] | undefined>;
378
+ createdBySignature?: string | null | undefined;
379
+ createdAtLocation?: string | null | undefined;
380
+ annotation?: Record<string, string | number | boolean | {
368
381
  type: string;
369
382
  filename: string;
370
383
  originalFilename: string;
@@ -401,16 +414,22 @@ export declare const Draft: z.ZodObject<{
401
414
  option: string;
402
415
  filename: string;
403
416
  originalFilename: string;
404
- }[]> | undefined;
417
+ }[] | [string, string] | undefined> | undefined;
418
+ originalActionId?: string | undefined;
405
419
  }>;
406
420
  }, "strip", z.ZodTypeAny, {
407
421
  id: string;
422
+ transactionId: string;
408
423
  createdAt: string;
409
424
  eventId: string;
410
- transactionId: string;
411
425
  action: {
412
- type: ActionType;
413
- data: Record<string, string | number | boolean | {
426
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
427
+ status: "Rejected" | "Requested" | "Accepted";
428
+ transactionId: string;
429
+ createdAt: string;
430
+ createdBy: string;
431
+ createdByRole: string;
432
+ declaration: Record<string, string | number | boolean | {
414
433
  type: string;
415
434
  filename: string;
416
435
  originalFilename: string;
@@ -447,11 +466,10 @@ export declare const Draft: z.ZodObject<{
447
466
  option: string;
448
467
  filename: string;
449
468
  originalFilename: string;
450
- }[]>;
451
- createdAt: string;
452
- createdBy: string;
453
- createdAtLocation: string;
454
- metadata?: Record<string, string | number | boolean | {
469
+ }[] | [string, string] | undefined>;
470
+ createdBySignature?: string | null | undefined;
471
+ createdAtLocation?: string | null | undefined;
472
+ annotation?: Record<string, string | number | boolean | {
455
473
  type: string;
456
474
  filename: string;
457
475
  originalFilename: string;
@@ -488,16 +506,22 @@ export declare const Draft: z.ZodObject<{
488
506
  option: string;
489
507
  filename: string;
490
508
  originalFilename: string;
491
- }[]> | undefined;
509
+ }[] | [string, string] | undefined> | undefined;
510
+ originalActionId?: string | undefined;
492
511
  };
493
512
  }, {
494
513
  id: string;
514
+ transactionId: string;
495
515
  createdAt: string;
496
516
  eventId: string;
497
- transactionId: string;
498
517
  action: {
499
- type: ActionType;
500
- data: Record<string, string | number | boolean | {
518
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
519
+ status: "Rejected" | "Requested" | "Accepted";
520
+ transactionId: string;
521
+ createdAt: string;
522
+ createdBy: string;
523
+ createdByRole: string;
524
+ declaration: Record<string, string | number | boolean | {
501
525
  type: string;
502
526
  filename: string;
503
527
  originalFilename: string;
@@ -534,11 +558,10 @@ export declare const Draft: z.ZodObject<{
534
558
  option: string;
535
559
  filename: string;
536
560
  originalFilename: string;
537
- }[]>;
538
- createdAt: string;
539
- createdBy: string;
540
- createdAtLocation: string;
541
- metadata?: Record<string, string | number | boolean | {
561
+ }[] | [string, string] | undefined>;
562
+ createdBySignature?: string | null | undefined;
563
+ createdAtLocation?: string | null | undefined;
564
+ annotation?: Record<string, string | number | boolean | {
542
565
  type: string;
543
566
  filename: string;
544
567
  originalFilename: string;
@@ -575,13 +598,14 @@ export declare const Draft: z.ZodObject<{
575
598
  option: string;
576
599
  filename: string;
577
600
  originalFilename: string;
578
- }[]> | undefined;
601
+ }[] | [string, string] | undefined> | undefined;
602
+ originalActionId?: string | undefined;
579
603
  };
580
604
  }>;
581
605
  export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
582
606
  eventId: z.ZodString;
583
607
  transactionId: z.ZodString;
584
- data: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
608
+ declaration: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
585
609
  filename: z.ZodString;
586
610
  originalFilename: z.ZodString;
587
611
  type: z.ZodString;
@@ -664,7 +688,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
664
688
  province: string;
665
689
  urbanOrRural: "RURAL";
666
690
  village?: string | null | undefined;
667
- }>, z.ZodObject<{
691
+ }>, z.ZodUndefined, z.ZodObject<{
668
692
  country: z.ZodString;
669
693
  addressType: z.ZodLiteral<"INTERNATIONAL">;
670
694
  state: z.ZodString;
@@ -694,8 +718,8 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
694
718
  addressLine2?: string | null | undefined;
695
719
  addressLine3?: string | null | undefined;
696
720
  postcodeOrZip?: string | null | undefined;
697
- }>]>>;
698
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
721
+ }>]>>>;
722
+ annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
699
723
  filename: z.ZodString;
700
724
  originalFilename: z.ZodString;
701
725
  type: z.ZodString;
@@ -778,7 +802,7 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
778
802
  province: string;
779
803
  urbanOrRural: "RURAL";
780
804
  village?: string | null | undefined;
781
- }>, z.ZodObject<{
805
+ }>, z.ZodUndefined, z.ZodObject<{
782
806
  country: z.ZodString;
783
807
  addressType: z.ZodLiteral<"INTERNATIONAL">;
784
808
  state: z.ZodString;
@@ -809,11 +833,16 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
809
833
  addressLine3?: string | null | undefined;
810
834
  postcodeOrZip?: string | null | undefined;
811
835
  }>]>>>;
836
+ originalActionId: z.ZodOptional<z.ZodString>;
837
+ keepAssignment: z.ZodOptional<z.ZodBoolean>;
812
838
  }, {
813
- type: z.ZodEnum<[ActionType, ...ActionType[]]>;
839
+ type: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>;
840
+ status: z.ZodEnum<["Requested", "Accepted", "Rejected"]>;
814
841
  }>, "strip", z.ZodTypeAny, {
815
- type: ActionType;
816
- data: Record<string, string | number | boolean | {
842
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
843
+ status: "Rejected" | "Requested" | "Accepted";
844
+ transactionId: string;
845
+ declaration: Record<string, string | number | boolean | {
817
846
  type: string;
818
847
  filename: string;
819
848
  originalFilename: string;
@@ -850,10 +879,9 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
850
879
  option: string;
851
880
  filename: string;
852
881
  originalFilename: string;
853
- }[]>;
882
+ }[] | [string, string] | undefined>;
854
883
  eventId: string;
855
- transactionId: string;
856
- metadata?: Record<string, string | number | boolean | {
884
+ annotation?: Record<string, string | number | boolean | {
857
885
  type: string;
858
886
  filename: string;
859
887
  originalFilename: string;
@@ -890,10 +918,15 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
890
918
  option: string;
891
919
  filename: string;
892
920
  originalFilename: string;
893
- }[]> | undefined;
921
+ }[] | [string, string] | undefined> | undefined;
922
+ originalActionId?: string | undefined;
923
+ keepAssignment?: boolean | undefined;
894
924
  }, {
895
- type: ActionType;
896
- data: Record<string, string | number | boolean | {
925
+ type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
926
+ status: "Rejected" | "Requested" | "Accepted";
927
+ transactionId: string;
928
+ eventId: string;
929
+ declaration?: Record<string, string | number | boolean | {
897
930
  type: string;
898
931
  filename: string;
899
932
  originalFilename: string;
@@ -930,10 +963,8 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
930
963
  option: string;
931
964
  filename: string;
932
965
  originalFilename: string;
933
- }[]>;
934
- eventId: string;
935
- transactionId: string;
936
- metadata?: Record<string, string | number | boolean | {
966
+ }[] | [string, string] | undefined> | undefined;
967
+ annotation?: Record<string, string | number | boolean | {
937
968
  type: string;
938
969
  filename: string;
939
970
  originalFilename: string;
@@ -970,7 +1001,9 @@ export declare const DraftInput: z.ZodObject<z.objectUtil.extendShape<{
970
1001
  option: string;
971
1002
  filename: string;
972
1003
  originalFilename: string;
973
- }[]> | undefined;
1004
+ }[] | [string, string] | undefined> | undefined;
1005
+ originalActionId?: string | undefined;
1006
+ keepAssignment?: boolean | undefined;
974
1007
  }>;
975
1008
  export type Draft = z.infer<typeof Draft>;
976
1009
  export type DraftInput = z.infer<typeof DraftInput>;