@opencrvs/toolkit 2.1.0-rc.f29a266 → 2.1.0-rc.f5ea803

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 (54) hide show
  1. package/build.sh +9 -1
  2. package/create-countryconfig/index.js +176 -2
  3. package/dist/application-config/index.js +211 -201
  4. package/dist/authentication/index.d.ts +67 -0
  5. package/dist/authentication/index.d.ts.map +1 -0
  6. package/dist/authentication/index.js +750 -0
  7. package/dist/cli.js +1587 -69
  8. package/dist/commons/api/router.d.ts +4 -4
  9. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  10. package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
  11. package/dist/commons/events/EventDocument.d.ts +468 -0
  12. package/dist/commons/events/EventMetadata.d.ts +1 -11
  13. package/dist/commons/events/EventStatus.d.ts +19 -0
  14. package/dist/commons/events/FieldConfig.d.ts +5 -0
  15. package/dist/commons/events/FieldTypeMapping.d.ts +15 -15
  16. package/dist/commons/events/locations.d.ts +2 -2
  17. package/dist/commons/notification/UserNotifications.d.ts +0 -13
  18. package/dist/commons/notification/dispatch.d.ts +10 -0
  19. package/dist/commons/notification/index.d.ts +1 -0
  20. package/dist/conditionals/index.js +74 -57
  21. package/dist/csv.d.ts +25 -0
  22. package/dist/csv.d.ts.map +1 -0
  23. package/dist/csv.js +120 -0
  24. package/dist/events/index.js +760 -743
  25. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
  26. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
  27. package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
  28. package/dist/migrations/v2.1/add-translations.d.ts +9 -0
  29. package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
  30. package/dist/migrations/v2.1/add-translations.js +213 -0
  31. package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
  32. package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
  33. package/dist/migrations/v2.1/enable-telemetry.js +438 -0
  34. package/dist/migrations/v2.1/index.d.ts.map +1 -1
  35. package/dist/migrations/v2.1/index.js +1058 -0
  36. package/dist/notification/index.js +855 -815
  37. package/dist/scopes/index.d.ts +74 -6
  38. package/dist/scopes/index.js +74 -57
  39. package/dist/telemetry/index.d.ts +45 -0
  40. package/dist/telemetry/index.d.ts.map +1 -0
  41. package/dist/telemetry/index.js +39 -0
  42. package/dist/translations/check.d.ts +19 -0
  43. package/dist/translations/check.d.ts.map +1 -0
  44. package/dist/translations/check.js +127 -0
  45. package/dist/verify/endpoints.d.ts +2 -0
  46. package/dist/verify/endpoints.d.ts.map +1 -0
  47. package/dist/verify/endpoints.js +345 -0
  48. package/opencrvs-toolkit-2.1.0-rc.f5ea803.tgz +0 -0
  49. package/package.json +8 -3
  50. package/tsconfig.build.json +11 -0
  51. package/tsconfig.build.tsbuildinfo +1 -0
  52. package/tsconfig.json +3 -0
  53. package/opencrvs-toolkit-2.1.0-rc.f29a266.tgz +0 -0
  54. package/tsconfig.tsbuildinfo +0 -1
@@ -42,7 +42,7 @@ __export(application_config_exports, {
42
42
  module.exports = __toCommonJS(application_config_exports);
43
43
 
44
44
  // ../commons/src/application-config.ts
45
- var z20 = __toESM(require("zod/v4"));
45
+ var z21 = __toESM(require("zod/v4"));
46
46
 
47
47
  // ../commons/src/events/FieldConfig.ts
48
48
  var import_v43 = __toESM(require("zod/v4"));
@@ -497,10 +497,10 @@ var SerializedUserField = z9.object({
497
497
  var import_v4 = require("zod/v4");
498
498
 
499
499
  // ../commons/src/events/EventMetadata.ts
500
- var z15 = __toESM(require("zod/v4"));
500
+ var z16 = __toESM(require("zod/v4"));
501
501
 
502
502
  // ../commons/src/events/ActionDocument.ts
503
- var z14 = __toESM(require("zod/v4"));
503
+ var z15 = __toESM(require("zod/v4"));
504
504
 
505
505
  // ../commons/src/events/ActionType.ts
506
506
  var z10 = __toESM(require("zod/v4"));
@@ -612,10 +612,10 @@ var META_ACTIONS = [
612
612
 
613
613
  // ../commons/src/authentication.ts
614
614
  var import_jwt_decode = __toESM(require("jwt-decode"));
615
- var z13 = __toESM(require("zod/v4"));
615
+ var z14 = __toESM(require("zod/v4"));
616
616
 
617
617
  // ../commons/src/scopes.ts
618
- var z12 = __toESM(require("zod/v4"));
618
+ var z13 = __toESM(require("zod/v4"));
619
619
  var qs = __toESM(require("qs"));
620
620
 
621
621
  // ../commons/src/events/ActionStatus.ts
@@ -688,12 +688,22 @@ var ActionFlagConfig = z11.object({
688
688
  description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
689
689
  });
690
690
 
691
+ // ../commons/src/events/EventStatus.ts
692
+ var z12 = __toESM(require("zod/v4"));
693
+ var EventStatus = z12.enum([
694
+ "CREATED",
695
+ "NOTIFIED",
696
+ "DECLARED",
697
+ "REGISTERED",
698
+ "ARCHIVED"
699
+ ]);
700
+
691
701
  // ../commons/src/scopes.ts
692
- var JurisdictionFilter = z12.enum(["administrativeArea", "location", "all"]).describe(
702
+ var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
693
703
  "Filters based on user jurisdiction relative to their office location in hierarchy."
694
704
  );
695
- var UserFilter = z12.enum(["user"]).describe("Filters based on the user. Limits to self.");
696
- var RecordScopeTypeV2 = z12.enum([
705
+ var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
706
+ var RecordScopeTypeV2 = z13.enum([
697
707
  "record.search",
698
708
  "record.create",
699
709
  "record.read",
@@ -711,7 +721,7 @@ var RecordScopeTypeV2 = z12.enum([
711
721
  "record.unassign-others",
712
722
  "record.custom-action"
713
723
  ]);
714
- var PlainScopeType = z12.enum([
724
+ var PlainScopeType = z13.enum([
715
725
  // Misc. system scopes
716
726
  "bypassratelimit",
717
727
  "record.reindex",
@@ -736,15 +746,21 @@ var PlainScopeType = z12.enum([
736
746
  "record.confirm-registration",
737
747
  "record.reject-registration"
738
748
  ]);
739
- var scopeByEvent = z12.preprocess(
749
+ var scopeByEvent = z13.preprocess(
740
750
  (val) => val === void 0 ? void 0 : [val].flat(),
741
- z12.array(z12.string()).optional()
751
+ z13.array(z13.string()).optional()
742
752
  ).describe("Event type, e.g. birth, death");
743
- var userRole = z12.preprocess(
753
+ var scopeByStatus = z13.preprocess(
754
+ (val) => val === void 0 ? void 0 : [val].flat(),
755
+ z13.array(EventStatus).optional()
756
+ ).describe(
757
+ "Restricts the scope to records currently in one of these statuses."
758
+ );
759
+ var userRole = z13.preprocess(
744
760
  (val) => val === void 0 ? void 0 : [val].flat(),
745
- z12.array(z12.string()).optional()
761
+ z13.array(z13.string()).optional()
746
762
  ).describe("User role, e.g. admin, field agent");
747
- var scopeOptionsPlaceEvent = z12.object({
763
+ var scopeOptionsPlaceEvent = z13.object({
748
764
  event: scopeByEvent,
749
765
  placeOfEvent: JurisdictionFilter.optional()
750
766
  }).describe("Options applicable to all record scopes.");
@@ -752,7 +768,8 @@ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
752
768
  notifiedIn: JurisdictionFilter.optional(),
753
769
  notifiedBy: UserFilter.optional(),
754
770
  declaredIn: JurisdictionFilter.optional(),
755
- declaredBy: UserFilter.optional()
771
+ declaredBy: UserFilter.optional(),
772
+ status: scopeByStatus
756
773
  }).describe("Options applicable to actions that may take place after DECLARE");
757
774
  var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
758
775
  registeredIn: JurisdictionFilter.optional(),
@@ -762,31 +779,31 @@ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
762
779
  "Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
763
780
  );
764
781
  var CustomActionScopeOptions = AllRecordScopeOptions.extend({
765
- customActionTypes: z12.preprocess(
782
+ customActionTypes: z13.preprocess(
766
783
  (val) => val === void 0 ? void 0 : [val].flat(),
767
- z12.array(z12.string()).optional()
784
+ z13.array(z13.string()).optional()
768
785
  ).describe("Allowed custom action types")
769
786
  });
770
- var AccessLevelOptions = z12.object({
787
+ var AccessLevelOptions = z13.object({
771
788
  accessLevel: JurisdictionFilter.optional()
772
789
  });
773
790
  var AllUserScopeOptions = AccessLevelOptions.extend({
774
791
  role: userRole.optional()
775
792
  });
776
- var WorkqueueOrDashboardOptions = z12.object({
777
- ids: z12.preprocess(
793
+ var WorkqueueOrDashboardOptions = z13.object({
794
+ ids: z13.preprocess(
778
795
  (val) => val === void 0 ? void 0 : [val].flat(),
779
- z12.array(z12.string())
796
+ z13.array(z13.string())
780
797
  ).describe("Must contain a list of workqueue or dashboard ids.")
781
798
  });
782
- var AllScopeOptions = z12.object({
799
+ var AllScopeOptions = z13.object({
783
800
  ...AllRecordScopeOptions.shape,
784
801
  ...AccessLevelOptions.shape,
785
802
  ...AllUserScopeOptions.shape,
786
803
  ...WorkqueueOrDashboardOptions.shape
787
804
  });
788
805
  var ScopeOptionKey = AllScopeOptions.keyof();
789
- var ResolvedScopeOptionsPlaceEvent = z12.object({
806
+ var ResolvedScopeOptionsPlaceEvent = z13.object({
790
807
  event: scopeByEvent,
791
808
  placeOfEvent: UUID.nullish()
792
809
  }).describe(
@@ -794,15 +811,15 @@ var ResolvedScopeOptionsPlaceEvent = z12.object({
794
811
  );
795
812
  var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
796
813
  notifiedIn: UUID.nullish(),
797
- notifiedBy: z12.string().optional(),
814
+ notifiedBy: z13.string().optional(),
798
815
  declaredIn: UUID.nullish(),
799
- declaredBy: z12.string().optional()
816
+ declaredBy: z13.string().optional()
800
817
  }).describe(
801
818
  "Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
802
819
  );
803
820
  var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
804
821
  registeredIn: UUID.nullish(),
805
- registeredBy: z12.string().optional(),
822
+ registeredBy: z13.string().optional(),
806
823
  flags: ContainsFlags.optional()
807
824
  }).describe(
808
825
  "Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
@@ -817,7 +834,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
817
834
  "record.reject",
818
835
  "record.archive",
819
836
  "record.unarchive",
820
- "record.review-duplicates",
821
837
  "record.register"
822
838
  ]);
823
839
  var ScopesWithFullOptions = RecordScopeTypeV2.extract([
@@ -825,41 +841,42 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
825
841
  "record.read",
826
842
  "record.request-correction",
827
843
  "record.correct",
828
- "record.unassign-others"
844
+ "record.unassign-others",
845
+ "record.review-duplicates"
829
846
  ]);
830
847
  var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
831
- templates: z12.preprocess(
848
+ templates: z13.preprocess(
832
849
  (val) => val === void 0 ? void 0 : [val].flat(),
833
- z12.array(z12.string()).optional()
850
+ z13.array(z13.string()).optional()
834
851
  ).describe(
835
852
  "Template IDs for certified copies. Controls which certificate templates are returned to the client via the config service. Certificate printing is a client-side operation \u2014 this option is not validated when the printCertificate action is submitted."
836
853
  )
837
854
  });
838
- var RecordScopeV2 = z12.discriminatedUnion("type", [
839
- z12.object({
855
+ var RecordScopeV2 = z13.discriminatedUnion("type", [
856
+ z13.object({
840
857
  type: ScopesWithPlaceEventOptions,
841
858
  options: scopeOptionsPlaceEvent.optional()
842
859
  }),
843
- z12.object({
860
+ z13.object({
844
861
  type: ScopesWithDeclaredOptions,
845
862
  options: scopeOptionsDeclaredOrNotified.optional()
846
863
  }),
847
- z12.object({
864
+ z13.object({
848
865
  type: ScopesWithFullOptions,
849
866
  options: AllRecordScopeOptions.optional()
850
867
  }),
851
- z12.object({
852
- type: z12.literal("record.custom-action"),
868
+ z13.object({
869
+ type: z13.literal("record.custom-action"),
853
870
  options: CustomActionScopeOptions.optional()
854
871
  }),
855
- z12.object({
856
- type: z12.literal("record.print-certified-copies"),
872
+ z13.object({
873
+ type: z13.literal("record.print-certified-copies"),
857
874
  options: ScopeOptionsPrintCertifiedCopies.optional()
858
875
  })
859
876
  ]).describe(
860
877
  "Scopes used to check user's permission to perform actions on a record."
861
878
  );
862
- var SystemScopeType = z12.enum([
879
+ var SystemScopeType = z13.enum([
863
880
  "organisation.read-locations",
864
881
  "user.read",
865
882
  "user.create",
@@ -873,61 +890,61 @@ var UserScopeType = SystemScopeType.extract([
873
890
  "user.search"
874
891
  ]);
875
892
  var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
876
- var UserScopeV2 = z12.discriminatedUnion("type", [
877
- z12.object({
893
+ var UserScopeV2 = z13.discriminatedUnion("type", [
894
+ z13.object({
878
895
  type: ScopesWithRoleOption,
879
896
  options: AllUserScopeOptions.optional()
880
897
  }),
881
- z12.object({
898
+ z13.object({
882
899
  type: UserScopeType.extract(["user.read", "user.search"]),
883
900
  options: AccessLevelOptions.optional()
884
901
  })
885
902
  ]);
886
- var ResolvedRecordScopeV2 = z12.discriminatedUnion("type", [
887
- z12.object({
903
+ var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
904
+ z13.object({
888
905
  type: ScopesWithPlaceEventOptions,
889
906
  options: ResolvedScopeOptionsPlaceEvent.optional()
890
907
  }),
891
- z12.object({
908
+ z13.object({
892
909
  type: ScopesWithDeclaredOptions,
893
910
  options: ResolvedScopeOptionsDeclared.optional()
894
911
  }),
895
- z12.object({
912
+ z13.object({
896
913
  type: ScopesWithFullOptions,
897
914
  options: ResolvedScopeOptionsFull.optional()
898
915
  }),
899
- z12.object({
900
- type: z12.literal("record.print-certified-copies"),
916
+ z13.object({
917
+ type: z13.literal("record.print-certified-copies"),
901
918
  options: ResolvedScopeOptionsFull.extend({
902
- templates: z12.array(z12.string()).optional()
919
+ templates: z13.array(z13.string()).optional()
903
920
  }).optional()
904
921
  })
905
922
  ]).describe("Resolved scope with location/user IDs instead of filters.");
906
- var Scope = z12.discriminatedUnion("type", [
907
- z12.object({ type: PlainScopeType }),
923
+ var Scope = z13.discriminatedUnion("type", [
924
+ z13.object({ type: PlainScopeType }),
908
925
  ...RecordScopeV2.options,
909
926
  ...UserScopeV2.options,
910
- z12.object({
911
- type: z12.literal("organisation.read-locations"),
927
+ z13.object({
928
+ type: z13.literal("organisation.read-locations"),
912
929
  options: AccessLevelOptions.optional()
913
930
  }),
914
- z12.object({
915
- type: z12.literal("workqueue"),
931
+ z13.object({
932
+ type: z13.literal("workqueue"),
916
933
  options: WorkqueueOrDashboardOptions
917
934
  }),
918
- z12.object({
919
- type: z12.literal("dashboard.view"),
935
+ z13.object({
936
+ type: z13.literal("dashboard.view"),
920
937
  options: WorkqueueOrDashboardOptions
921
938
  })
922
939
  ]);
923
- var ScopeType = z12.enum([
940
+ var ScopeType = z13.enum([
924
941
  ...SystemScopeType.options,
925
942
  ...RecordScopeTypeV2.options,
926
943
  ...PlainScopeType.options,
927
944
  "workqueue",
928
945
  "dashboard.view"
929
946
  ]);
930
- var EncodedScope = z12.string().brand("EncodedScope");
947
+ var EncodedScope = z13.string().brand("EncodedScope");
931
948
  var DEFAULT_SCOPE_OPTIONS = {
932
949
  placeOfEvent: JurisdictionFilter.enum.all,
933
950
  accessLevel: JurisdictionFilter.enum.all,
@@ -937,25 +954,25 @@ var DEFAULT_SCOPE_OPTIONS = {
937
954
  };
938
955
 
939
956
  // ../commons/src/authentication.ts
940
- var TokenUserType = z13.enum(["user", "system"]);
941
- var TokenWithBearer = z13.string().regex(/^Bearer\s/);
957
+ var TokenUserType = z14.enum(["user", "system"]);
958
+ var TokenWithBearer = z14.string().regex(/^Bearer\s/);
942
959
 
943
960
  // ../commons/src/events/ActionDocument.ts
944
- var ActionUpdate = z14.record(z14.string(), FieldUpdateValue).describe(
961
+ var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
945
962
  "Record of field-level changes made by an action. Supports partial updates and nullable values."
946
963
  );
947
- var EventState = z14.record(z14.string(), FieldValue).describe(
964
+ var EventState = z15.record(z15.string(), FieldValue).describe(
948
965
  "Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
949
966
  );
950
- var ActionBase = z14.object({
967
+ var ActionBase = z15.object({
951
968
  id: UUID.describe("Unique identifier of the action."),
952
- transactionId: z14.string().describe("Unique identifier of the transaction."),
969
+ transactionId: z15.string().describe("Unique identifier of the transaction."),
953
970
  createdByUserType: TokenUserType.describe(
954
971
  "Indicates whether the action was created by a human-user or by a system-user."
955
972
  ),
956
- createdAt: z14.string().datetime().describe("Timestamp indicating when the action was created."),
957
- createdBy: z14.string().describe("Identifier of the user who created the action."),
958
- createdByRole: z14.string().optional().describe("Role of the user who created the action."),
973
+ createdAt: z15.string().datetime().describe("Timestamp indicating when the action was created."),
974
+ createdBy: z15.string().describe("Identifier of the user who created the action."),
975
+ createdByRole: z15.string().optional().describe("Role of the user who created the action."),
959
976
  createdBySignature: DocumentPath.nullish().describe(
960
977
  "Reference to the signature of the user who created the action."
961
978
  ),
@@ -967,7 +984,7 @@ var ActionBase = z14.object({
967
984
  "Declaration data defined by the ActionConfig. Supports partial updates."
968
985
  ),
969
986
  annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
970
- status: z14.enum([
987
+ status: z15.enum([
971
988
  ActionStatus.Requested,
972
989
  ActionStatus.Accepted,
973
990
  ActionStatus.Rejected
@@ -979,70 +996,70 @@ var ActionBase = z14.object({
979
996
  )
980
997
  });
981
998
  var AssignedAction = ActionBase.extend(
982
- z14.object({
983
- type: z14.literal(ActionType.ASSIGN),
984
- assignedTo: z14.string().describe("Identifier of the user to whom the action is assigned.")
999
+ z15.object({
1000
+ type: z15.literal(ActionType.ASSIGN),
1001
+ assignedTo: z15.string().describe("Identifier of the user to whom the action is assigned.")
985
1002
  // TODO move into 'content' property
986
1003
  }).shape
987
1004
  );
988
1005
  var UnassignedAction = ActionBase.extend(
989
- z14.object({
990
- type: z14.literal(ActionType.UNASSIGN)
1006
+ z15.object({
1007
+ type: z15.literal(ActionType.UNASSIGN)
991
1008
  }).shape
992
1009
  );
993
1010
  var RegisterAction = ActionBase.extend(
994
- z14.object({
995
- type: z14.literal(ActionType.REGISTER),
996
- registrationNumber: z14.string().optional().describe(
1011
+ z15.object({
1012
+ type: z15.literal(ActionType.REGISTER),
1013
+ registrationNumber: z15.string().optional().describe(
997
1014
  "Registration number of the event. Always present for accepted registrations."
998
1015
  )
999
1016
  // TODO move into 'content' property
1000
1017
  }).shape
1001
1018
  );
1002
1019
  var DeclareAction = ActionBase.extend(
1003
- z14.object({
1004
- type: z14.literal(ActionType.DECLARE)
1020
+ z15.object({
1021
+ type: z15.literal(ActionType.DECLARE)
1005
1022
  }).shape
1006
1023
  );
1007
- var ReasonContent = z14.object({
1008
- reason: z14.string().min(1, { error: "Message cannot be empty" }).describe(
1024
+ var ReasonContent = z15.object({
1025
+ reason: z15.string().min(1, { error: "Message cannot be empty" }).describe(
1009
1026
  "Message describing the reason for rejecting or archiving the event."
1010
1027
  )
1011
1028
  });
1012
1029
  var RejectAction = ActionBase.extend(
1013
- z14.object({
1014
- type: z14.literal(ActionType.REJECT),
1030
+ z15.object({
1031
+ type: z15.literal(ActionType.REJECT),
1015
1032
  content: ReasonContent
1016
1033
  }).shape
1017
1034
  );
1018
- var PotentialDuplicate = z14.object({
1035
+ var PotentialDuplicate = z15.object({
1019
1036
  id: UUID,
1020
- trackingId: z14.string()
1037
+ trackingId: z15.string()
1021
1038
  });
1022
1039
  var DuplicateDetectedAction = ActionBase.extend(
1023
- z14.object({
1024
- type: z14.literal(ActionType.DUPLICATE_DETECTED),
1025
- content: z14.object({
1026
- duplicates: z14.array(PotentialDuplicate)
1040
+ z15.object({
1041
+ type: z15.literal(ActionType.DUPLICATE_DETECTED),
1042
+ content: z15.object({
1043
+ duplicates: z15.array(PotentialDuplicate)
1027
1044
  })
1028
1045
  }).shape
1029
1046
  );
1030
1047
  var MarkNotDuplicateAction = ActionBase.extend(
1031
- z14.object({
1032
- type: z14.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1048
+ z15.object({
1049
+ type: z15.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1033
1050
  }).shape
1034
1051
  );
1035
1052
  var MarkAsDuplicateAction = ActionBase.extend(
1036
- z14.object({
1037
- type: z14.literal(ActionType.MARK_AS_DUPLICATE),
1038
- content: z14.object({
1053
+ z15.object({
1054
+ type: z15.literal(ActionType.MARK_AS_DUPLICATE),
1055
+ content: z15.object({
1039
1056
  duplicateOf: UUID
1040
1057
  }).optional()
1041
1058
  }).shape
1042
1059
  );
1043
1060
  var ArchiveAction = ActionBase.extend(
1044
- z14.object({
1045
- type: z14.literal(ActionType.ARCHIVE),
1061
+ z15.object({
1062
+ type: z15.literal(ActionType.ARCHIVE),
1046
1063
  /**
1047
1064
  * Archiving does not collect a reason on its own. Only the
1048
1065
  * "mark as duplicate" flow archives with a reason attached.
@@ -1051,71 +1068,71 @@ var ArchiveAction = ActionBase.extend(
1051
1068
  }).shape
1052
1069
  );
1053
1070
  var UnarchiveAction = ActionBase.extend(
1054
- z14.object({
1055
- type: z14.literal(ActionType.UNARCHIVE)
1071
+ z15.object({
1072
+ type: z15.literal(ActionType.UNARCHIVE)
1056
1073
  }).shape
1057
1074
  );
1058
1075
  var CreatedAction = ActionBase.extend(
1059
- z14.object({
1060
- type: z14.literal(ActionType.CREATE)
1076
+ z15.object({
1077
+ type: z15.literal(ActionType.CREATE)
1061
1078
  }).shape
1062
1079
  );
1063
1080
  var NotifiedAction = ActionBase.extend(
1064
- z14.object({
1065
- type: z14.literal(ActionType.NOTIFY)
1081
+ z15.object({
1082
+ type: z15.literal(ActionType.NOTIFY)
1066
1083
  }).shape
1067
1084
  );
1068
1085
  var EditAction = ActionBase.extend(
1069
- z14.object({
1070
- type: z14.literal(ActionType.EDIT),
1086
+ z15.object({
1087
+ type: z15.literal(ActionType.EDIT),
1071
1088
  /** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
1072
- content: z14.object({
1073
- comment: z14.string().describe("Comment for the edit action.").optional()
1089
+ content: z15.object({
1090
+ comment: z15.string().describe("Comment for the edit action.").optional()
1074
1091
  }).optional()
1075
1092
  }).shape
1076
1093
  );
1077
- var PrintContent = z14.object({
1078
- templateId: z14.string().optional()
1094
+ var PrintContent = z15.object({
1095
+ templateId: z15.string().optional()
1079
1096
  });
1080
1097
  var PrintCertificateAction = ActionBase.extend(
1081
- z14.object({
1082
- type: z14.literal(ActionType.PRINT_CERTIFICATE),
1098
+ z15.object({
1099
+ type: z15.literal(ActionType.PRINT_CERTIFICATE),
1083
1100
  content: PrintContent.optional().nullable()
1084
1101
  }).shape
1085
1102
  );
1086
1103
  var RequestedCorrectionAction = ActionBase.extend(
1087
- z14.object({
1088
- type: z14.literal(ActionType.REQUEST_CORRECTION)
1104
+ z15.object({
1105
+ type: z15.literal(ActionType.REQUEST_CORRECTION)
1089
1106
  }).shape
1090
1107
  );
1091
1108
  var ApprovedCorrectionAction = ActionBase.extend(
1092
- z14.object({
1093
- type: z14.literal(ActionType.APPROVE_CORRECTION),
1094
- requestId: z14.string(),
1109
+ z15.object({
1110
+ type: z15.literal(ActionType.APPROVE_CORRECTION),
1111
+ requestId: z15.string(),
1095
1112
  // TODO move into 'content' property
1096
- content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
1113
+ content: z15.object({ immediateCorrection: z15.boolean().optional() }).optional()
1097
1114
  }).shape
1098
1115
  );
1099
1116
  var RejectedCorrectionAction = ActionBase.extend(
1100
- z14.object({
1101
- type: z14.literal(ActionType.REJECT_CORRECTION),
1102
- requestId: z14.string(),
1117
+ z15.object({
1118
+ type: z15.literal(ActionType.REJECT_CORRECTION),
1119
+ requestId: z15.string(),
1103
1120
  // TODO move into 'content' property
1104
1121
  content: ReasonContent
1105
1122
  }).shape
1106
1123
  );
1107
1124
  var ReadAction = ActionBase.extend(
1108
- z14.object({
1109
- type: z14.literal(ActionType.READ)
1125
+ z15.object({
1126
+ type: z15.literal(ActionType.READ)
1110
1127
  }).shape
1111
1128
  );
1112
1129
  var CustomAction = ActionBase.merge(
1113
- z14.object({
1114
- type: z14.literal(ActionType.CUSTOM),
1115
- customActionType: z14.string()
1130
+ z15.object({
1131
+ type: z15.literal(ActionType.CUSTOM),
1132
+ customActionType: z15.string()
1116
1133
  })
1117
1134
  );
1118
- var ActionDocument = z14.discriminatedUnion("type", [
1135
+ var ActionDocument = z15.discriminatedUnion("type", [
1119
1136
  CreatedAction.meta({ id: "CreatedAction" }),
1120
1137
  RejectAction.meta({ id: "RejectAction" }),
1121
1138
  DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
@@ -1142,57 +1159,50 @@ var AsyncRejectActionDocument = ActionBase.omit({
1142
1159
  declaration: true,
1143
1160
  annotation: true
1144
1161
  }).extend(
1145
- z14.object({
1146
- type: z14.enum(ConfirmableActions),
1147
- status: z14.literal(ActionStatus.Rejected)
1162
+ z15.object({
1163
+ type: z15.enum(ConfirmableActions),
1164
+ status: z15.literal(ActionStatus.Rejected)
1148
1165
  }).shape
1149
1166
  );
1150
- var Action = z14.union([ActionDocument, AsyncRejectActionDocument]);
1167
+ var Action = z15.union([ActionDocument, AsyncRejectActionDocument]);
1151
1168
 
1152
1169
  // ../commons/src/events/EventMetadata.ts
1153
- var EventStatus = z15.enum([
1154
- "CREATED",
1155
- "NOTIFIED",
1156
- "DECLARED",
1157
- "REGISTERED",
1158
- "ARCHIVED"
1159
- ]);
1160
- var ZodDate = z15.iso.date();
1161
- var ZodDateTime = z15.string().datetime();
1162
- var ActionCreationMetadata = z15.object({
1163
- createdAt: z15.iso.datetime().describe("The timestamp when the action request was created."),
1164
- createdBy: z15.string().describe("ID of the user who created the action request."),
1170
+ var ZodDate = z16.iso.date();
1171
+ var ZodDateTime = z16.string().datetime();
1172
+ var ActionCreationMetadata = z16.object({
1173
+ createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
1174
+ createdBy: z16.string().describe("ID of the user who created the action request."),
1165
1175
  // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1166
1176
  createdAtLocation: UUID.nullish().describe(
1167
1177
  "Location of the user who created the action request."
1168
1178
  ),
1169
- createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1170
- acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
1171
- createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
1179
+ createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1180
+ acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
1181
+ createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
1172
1182
  });
1173
1183
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1174
- registrationNumber: z15.string().describe(
1184
+ registrationNumber: z16.string().describe(
1175
1185
  "Registration number of the event. Always present for accepted registrations."
1176
1186
  )
1177
1187
  });
1178
- var LegalStatuses = z15.object({
1188
+ var LegalStatuses = z16.object({
1179
1189
  [EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
1180
1190
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
1181
1191
  [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
1182
1192
  });
1183
- var EventMetadata = z15.object({
1193
+ var EventMetadata = z16.object({
1184
1194
  id: UUID,
1185
- type: z15.string().describe("The type of event, such as birth, death, or marriage."),
1195
+ type: z16.string().describe("The type of event, such as birth, death, or marriage."),
1186
1196
  status: EventStatus,
1187
1197
  legalStatuses: LegalStatuses.describe(
1188
1198
  "Metadata related to the legal registration of the event, such as who registered it and when."
1189
1199
  ),
1190
- createdAt: z15.iso.datetime().describe("The timestamp when the event was first created and saved."),
1200
+ createdAt: z16.iso.datetime().describe("The timestamp when the event was first created and saved."),
1191
1201
  dateOfEvent: ZodDate.nullish(),
1192
1202
  placeOfEvent: UUID.nullish(),
1193
- createdBy: z15.string().describe("ID of the user who created the event."),
1194
- createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1195
- updatedByUserRole: z15.string().nullish().describe("Role of the user who last changed the status."),
1203
+ createdBy: z16.string().describe("ID of the user who created the event."),
1204
+ createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1205
+ updatedByUserRole: z16.string().nullish().describe("Role of the user who last changed the status."),
1196
1206
  // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1197
1207
  createdAtLocation: UUID.nullish().describe(
1198
1208
  "Location of the user who created the event."
@@ -1200,18 +1210,18 @@ var EventMetadata = z15.object({
1200
1210
  updatedAtLocation: UUID.nullish().describe(
1201
1211
  "Location of the user who last changed the status."
1202
1212
  ),
1203
- updatedAt: z15.iso.datetime().describe(
1213
+ updatedAt: z16.iso.datetime().describe(
1204
1214
  "Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
1205
1215
  ),
1206
- assignedTo: z15.string().nullish().describe("ID of the user currently assigned to the event."),
1207
- updatedBy: z15.string().nullish().describe("ID of the user who last changed the status."),
1208
- trackingId: z15.string().describe(
1216
+ assignedTo: z16.string().nullish().describe("ID of the user currently assigned to the event."),
1217
+ updatedBy: z16.string().nullish().describe("ID of the user who last changed the status."),
1218
+ trackingId: z16.string().describe(
1209
1219
  "System-generated tracking ID used by informants or registrars to look up the event."
1210
1220
  ),
1211
- potentialDuplicates: z15.array(PotentialDuplicate).describe(
1221
+ potentialDuplicates: z16.array(PotentialDuplicate).describe(
1212
1222
  "List of event IDs and their tracking IDs that this event could be a duplicate of."
1213
1223
  ),
1214
- flags: z15.array(Flag)
1224
+ flags: z16.array(Flag)
1215
1225
  });
1216
1226
  var EventMetadataKeysArray = [
1217
1227
  "id",
@@ -1232,8 +1242,8 @@ var EventMetadataKeysArray = [
1232
1242
  "legalStatuses",
1233
1243
  "flags"
1234
1244
  ];
1235
- var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
1236
- var EventMetadataDateFieldIdInput = z15.enum([
1245
+ var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
1246
+ var EventMetadataDateFieldIdInput = z16.enum([
1237
1247
  "createdAt",
1238
1248
  "updatedAt",
1239
1249
  "legalStatuses.NOTIFIED.createdAt",
@@ -1243,7 +1253,7 @@ var EventMetadataDateFieldIdInput = z15.enum([
1243
1253
  "legalStatuses.REGISTERED.createdAt",
1244
1254
  "legalStatuses.REGISTERED.acceptedAt"
1245
1255
  ]);
1246
- var EventMetadataDateFieldId = z15.enum([
1256
+ var EventMetadataDateFieldId = z16.enum([
1247
1257
  "event.createdAt",
1248
1258
  "event.updatedAt",
1249
1259
  "event.legalStatuses.NOTIFIED.createdAt",
@@ -2314,7 +2324,7 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
2314
2324
  ]);
2315
2325
 
2316
2326
  // ../commons/src/application-config.ts
2317
- var SearchCriteria = z20.enum([
2327
+ var SearchCriteria = z21.enum([
2318
2328
  "TRACKING_ID",
2319
2329
  "REGISTRATION_NUMBER",
2320
2330
  "NATIONAL_ID",
@@ -2322,69 +2332,69 @@ var SearchCriteria = z20.enum([
2322
2332
  "PHONE_NUMBER",
2323
2333
  "EMAIL"
2324
2334
  ]);
2325
- var ApplicationConfig = z20.object({
2326
- APPLICATION_NAME: z20.string(),
2327
- COUNTRY_LOGO: z20.object({
2328
- fileName: z20.string(),
2329
- file: z20.string()
2335
+ var ApplicationConfig = z21.object({
2336
+ APPLICATION_NAME: z21.string(),
2337
+ COUNTRY_LOGO: z21.object({
2338
+ fileName: z21.string(),
2339
+ file: z21.string()
2330
2340
  }),
2331
- SYSTEM_IANA_TIMEZONE: z20.string(),
2332
- CURRENCY: z20.object({
2333
- languagesAndCountry: z20.array(z20.string()),
2334
- isoCode: z20.string()
2341
+ SYSTEM_IANA_TIMEZONE: z21.string(),
2342
+ CURRENCY: z21.object({
2343
+ languagesAndCountry: z21.array(z21.string()),
2344
+ isoCode: z21.string()
2335
2345
  }),
2336
- ADMIN_STRUCTURE: z20.array(
2337
- z20.object({
2338
- id: z20.string(),
2346
+ ADMIN_STRUCTURE: z21.array(
2347
+ z21.object({
2348
+ id: z21.string(),
2339
2349
  label: TranslationConfig
2340
2350
  })
2341
2351
  ),
2342
- PHONE_NUMBER_PATTERN: z20.string().or(z20.instanceof(RegExp)),
2343
- USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2344
- INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2352
+ PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
2353
+ USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
2354
+ INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
2345
2355
  SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
2346
- ADDITIONAL_USER_FIELDS: z20.array(FieldConfig).optional().default([])
2356
+ ADDITIONAL_USER_FIELDS: z21.array(FieldConfig).optional().default([])
2347
2357
  });
2348
2358
  var defineApplicationConfig = (config) => {
2349
2359
  return ApplicationConfig.parse(config);
2350
2360
  };
2351
- var BackgroundConfig = z20.object({
2352
- backgroundColor: z20.string().optional(),
2353
- backgroundImage: z20.string().optional(),
2354
- imageFit: z20.string().optional()
2361
+ var BackgroundConfig = z21.object({
2362
+ backgroundColor: z21.string().optional(),
2363
+ backgroundImage: z21.string().optional(),
2364
+ imageFit: z21.string().optional()
2355
2365
  }).refine(
2356
2366
  (data) => !!(data.backgroundColor || data.backgroundImage),
2357
2367
  "backgroundColor and backgroundImage cannot be empty at the same time"
2358
2368
  );
2359
- var LoginConfig = z20.object({
2360
- COUNTRY: z20.string(),
2361
- LANGUAGES: z20.array(z20.string()),
2362
- USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2363
- INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2364
- PHONE_NUMBER_PATTERN: z20.string().or(z20.instanceof(RegExp)),
2369
+ var LoginConfig = z21.object({
2370
+ COUNTRY: z21.string(),
2371
+ LANGUAGES: z21.array(z21.string()),
2372
+ USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
2373
+ INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
2374
+ PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
2365
2375
  LOGIN_BACKGROUND: BackgroundConfig,
2366
- SENTRY: z20.string().optional()
2376
+ SENTRY: z21.string().optional()
2367
2377
  });
2368
2378
  var defineLoginConfig = (config) => {
2369
2379
  return LoginConfig.parse(config);
2370
2380
  };
2371
- var ClientConfig = z20.object({
2372
- COUNTRY: z20.string(),
2373
- LANGUAGES: z20.array(z20.string()),
2374
- SENTRY: z20.string().optional(),
2375
- LOGIN_URL: z20.string().optional(),
2381
+ var ClientConfig = z21.object({
2382
+ COUNTRY: z21.string(),
2383
+ LANGUAGES: z21.array(z21.string()),
2384
+ SENTRY: z21.string().optional(),
2385
+ LOGIN_URL: z21.string().optional(),
2376
2386
  REGISTER_BACKGROUND: BackgroundConfig,
2377
- DASHBOARDS: z20.array(
2378
- z20.object({
2379
- id: z20.string(),
2387
+ DASHBOARDS: z21.array(
2388
+ z21.object({
2389
+ id: z21.string(),
2380
2390
  title: TranslationConfig,
2381
- url: z20.string(),
2382
- context: z20.object({
2383
- auth: z20.literal("REQUEST_AUTH_TOKEN")
2391
+ url: z21.string(),
2392
+ context: z21.object({
2393
+ auth: z21.literal("REQUEST_AUTH_TOKEN")
2384
2394
  }).optional()
2385
2395
  })
2386
2396
  ),
2387
- FEATURES: z20.object({ V2_EVENTS: z20.boolean().optional().default(true) }).optional().default({ V2_EVENTS: true })
2397
+ FEATURES: z21.object({ V2_EVENTS: z21.boolean().optional().default(true) }).optional().default({ V2_EVENTS: true })
2388
2398
  });
2389
2399
  var defineClientConfig = (config) => {
2390
2400
  return ClientConfig.parse(config);