@opencrvs/toolkit 2.1.0-rc.d078d1a → 2.1.0-rc.d1b9774

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 (96) hide show
  1. package/README.md +1 -0
  2. package/build.sh +9 -1
  3. package/create-countryconfig/index.js +284 -62
  4. package/create-countryconfig/node_modules/.bin/degit +21 -0
  5. package/create-countryconfig/package.json +4 -1
  6. package/dist/application-config/index.js +265 -209
  7. package/dist/authentication/index.d.ts +67 -0
  8. package/dist/authentication/index.d.ts.map +1 -0
  9. package/dist/authentication/index.js +750 -0
  10. package/dist/cli.js +1744 -104
  11. package/dist/commons/api/router.d.ts +599 -69
  12. package/dist/commons/conditionals/conditionals.d.ts +6 -6
  13. package/dist/commons/conditionals/validate.d.ts +13 -11
  14. package/dist/commons/events/ActionDocument.d.ts +4 -4
  15. package/dist/commons/events/ActionInput.d.ts +4 -4
  16. package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
  17. package/dist/commons/events/AuditLog.d.ts +110 -0
  18. package/dist/commons/events/EventDocument.d.ts +470 -2
  19. package/dist/commons/events/EventIndex.d.ts +2 -2
  20. package/dist/commons/events/EventMetadata.d.ts +1 -11
  21. package/dist/commons/events/EventStatus.d.ts +19 -0
  22. package/dist/commons/events/FieldConfig.d.ts +78 -53
  23. package/dist/commons/events/FieldTypeMapping.d.ts +12 -12
  24. package/dist/commons/events/FieldValue.d.ts +2 -2
  25. package/dist/commons/events/PlainDate.d.ts +8 -0
  26. package/dist/commons/events/SummaryConfig.d.ts +249 -0
  27. package/dist/commons/events/locations.d.ts +158 -26
  28. package/dist/commons/events/mocks.test.utils.d.ts +30 -0
  29. package/dist/commons/events/test.utils.d.ts +8 -4
  30. package/dist/commons/events/utils.d.ts +2 -2
  31. package/dist/commons/notification/UserNotifications.d.ts +28 -13
  32. package/dist/commons/notification/dispatch.d.ts +10 -0
  33. package/dist/commons/notification/index.d.ts +1 -0
  34. package/dist/conditionals/index.js +79 -57
  35. package/dist/csv.d.ts +25 -0
  36. package/dist/csv.d.ts.map +1 -0
  37. package/dist/csv.js +120 -0
  38. package/dist/environment/index.d.ts +1 -0
  39. package/dist/environment/index.d.ts.map +1 -1
  40. package/dist/environment/index.js +10 -0
  41. package/dist/environment/logger.d.ts +15 -3
  42. package/dist/environment/logger.d.ts.map +1 -1
  43. package/dist/environment/paths.d.ts +7 -0
  44. package/dist/environment/paths.d.ts.map +1 -0
  45. package/dist/environment/paths.js +72 -0
  46. package/dist/environment/questions.d.ts.map +1 -1
  47. package/dist/environment/questions.js +20 -14
  48. package/dist/environment/setup-environment.js +3 -2
  49. package/dist/environment/templates.d.ts.map +1 -1
  50. package/dist/environment/templates.js +2 -1
  51. package/dist/environment/update-workflows.d.ts.map +1 -1
  52. package/dist/environment/update-workflows.js +17 -5
  53. package/dist/environment/upgrade.d.ts +2 -0
  54. package/dist/environment/upgrade.d.ts.map +1 -0
  55. package/dist/environment/upgrade.js +82 -0
  56. package/dist/environment/users.js +11 -13
  57. package/dist/events/index.js +1079 -843
  58. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
  59. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  60. package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
  61. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
  62. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
  63. package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
  64. package/dist/migrations/v2.1/add-translations.d.ts +9 -0
  65. package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
  66. package/dist/migrations/v2.1/add-translations.js +213 -0
  67. package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
  68. package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
  69. package/dist/migrations/v2.1/enable-telemetry.js +438 -0
  70. package/dist/migrations/v2.1/index.d.ts.map +1 -1
  71. package/dist/migrations/v2.1/index.js +1058 -0
  72. package/dist/notification/index.js +1149 -1419
  73. package/dist/scopes/index.d.ts +102 -32
  74. package/dist/scopes/index.js +79 -57
  75. package/dist/telemetry/index.d.ts +45 -0
  76. package/dist/telemetry/index.d.ts.map +1 -0
  77. package/dist/telemetry/index.js +39 -0
  78. package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
  79. package/dist/templates/charts-values/opentelemetry/values.yaml +95 -0
  80. package/dist/templates/charts-values/traefik/values.yaml +23 -9
  81. package/dist/templates/inventory/inventory.template.yml +1 -3
  82. package/dist/translations/check.d.ts +19 -0
  83. package/dist/translations/check.d.ts.map +1 -0
  84. package/dist/translations/check.js +127 -0
  85. package/dist/verify/endpoints.d.ts +2 -0
  86. package/dist/verify/endpoints.d.ts.map +1 -0
  87. package/dist/verify/endpoints.js +345 -0
  88. package/opencrvs-toolkit-2.1.0-rc.d1b9774.tgz +0 -0
  89. package/package.json +12 -7
  90. package/tsconfig.build.json +11 -0
  91. package/tsconfig.build.tsbuildinfo +1 -0
  92. package/tsconfig.json +3 -0
  93. package/dist/templates/inventory/production.example.yml +0 -77
  94. package/dist/templates/inventory/qa.example.yml +0 -48
  95. package/opencrvs-toolkit-2.1.0-rc.d078d1a.tgz +0 -0
  96. 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,12 +721,17 @@ 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",
718
728
  "user.data-seeding",
719
729
  "integration.create",
730
+ // Reading an integration's audit log. Deliberately separate from
731
+ // 'integration.create' so read-only oversight can be granted on its own, and
732
+ // deliberately option-less: system clients have no office and no
733
+ // administrative area, so jurisdiction options would have nothing to bind to.
734
+ "integration.audit.read",
720
735
  "record.import",
721
736
  "config.update-all",
722
737
  "location.edit",
@@ -731,15 +746,21 @@ var PlainScopeType = z12.enum([
731
746
  "record.confirm-registration",
732
747
  "record.reject-registration"
733
748
  ]);
734
- var scopeByEvent = z12.preprocess(
749
+ var scopeByEvent = z13.preprocess(
735
750
  (val) => val === void 0 ? void 0 : [val].flat(),
736
- z12.array(z12.string()).optional()
751
+ z13.array(z13.string()).optional()
737
752
  ).describe("Event type, e.g. birth, death");
738
- var userRole = z12.preprocess(
753
+ var scopeByStatus = z13.preprocess(
739
754
  (val) => val === void 0 ? void 0 : [val].flat(),
740
- z12.array(z12.string()).optional()
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(
760
+ (val) => val === void 0 ? void 0 : [val].flat(),
761
+ z13.array(z13.string()).optional()
741
762
  ).describe("User role, e.g. admin, field agent");
742
- var scopeOptionsPlaceEvent = z12.object({
763
+ var scopeOptionsPlaceEvent = z13.object({
743
764
  event: scopeByEvent,
744
765
  placeOfEvent: JurisdictionFilter.optional()
745
766
  }).describe("Options applicable to all record scopes.");
@@ -747,7 +768,8 @@ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
747
768
  notifiedIn: JurisdictionFilter.optional(),
748
769
  notifiedBy: UserFilter.optional(),
749
770
  declaredIn: JurisdictionFilter.optional(),
750
- declaredBy: UserFilter.optional()
771
+ declaredBy: UserFilter.optional(),
772
+ status: scopeByStatus
751
773
  }).describe("Options applicable to actions that may take place after DECLARE");
752
774
  var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
753
775
  registeredIn: JurisdictionFilter.optional(),
@@ -757,31 +779,31 @@ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
757
779
  "Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
758
780
  );
759
781
  var CustomActionScopeOptions = AllRecordScopeOptions.extend({
760
- customActionTypes: z12.preprocess(
782
+ customActionTypes: z13.preprocess(
761
783
  (val) => val === void 0 ? void 0 : [val].flat(),
762
- z12.array(z12.string()).optional()
784
+ z13.array(z13.string()).optional()
763
785
  ).describe("Allowed custom action types")
764
786
  });
765
- var AccessLevelOptions = z12.object({
787
+ var AccessLevelOptions = z13.object({
766
788
  accessLevel: JurisdictionFilter.optional()
767
789
  });
768
790
  var AllUserScopeOptions = AccessLevelOptions.extend({
769
791
  role: userRole.optional()
770
792
  });
771
- var WorkqueueOrDashboardOptions = z12.object({
772
- ids: z12.preprocess(
793
+ var WorkqueueOrDashboardOptions = z13.object({
794
+ ids: z13.preprocess(
773
795
  (val) => val === void 0 ? void 0 : [val].flat(),
774
- z12.array(z12.string())
796
+ z13.array(z13.string())
775
797
  ).describe("Must contain a list of workqueue or dashboard ids.")
776
798
  });
777
- var AllScopeOptions = z12.object({
799
+ var AllScopeOptions = z13.object({
778
800
  ...AllRecordScopeOptions.shape,
779
801
  ...AccessLevelOptions.shape,
780
802
  ...AllUserScopeOptions.shape,
781
803
  ...WorkqueueOrDashboardOptions.shape
782
804
  });
783
805
  var ScopeOptionKey = AllScopeOptions.keyof();
784
- var ResolvedScopeOptionsPlaceEvent = z12.object({
806
+ var ResolvedScopeOptionsPlaceEvent = z13.object({
785
807
  event: scopeByEvent,
786
808
  placeOfEvent: UUID.nullish()
787
809
  }).describe(
@@ -789,15 +811,15 @@ var ResolvedScopeOptionsPlaceEvent = z12.object({
789
811
  );
790
812
  var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
791
813
  notifiedIn: UUID.nullish(),
792
- notifiedBy: z12.string().optional(),
814
+ notifiedBy: z13.string().optional(),
793
815
  declaredIn: UUID.nullish(),
794
- declaredBy: z12.string().optional()
816
+ declaredBy: z13.string().optional()
795
817
  }).describe(
796
818
  "Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
797
819
  );
798
820
  var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
799
821
  registeredIn: UUID.nullish(),
800
- registeredBy: z12.string().optional(),
822
+ registeredBy: z13.string().optional(),
801
823
  flags: ContainsFlags.optional()
802
824
  }).describe(
803
825
  "Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
@@ -812,7 +834,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
812
834
  "record.reject",
813
835
  "record.archive",
814
836
  "record.unarchive",
815
- "record.review-duplicates",
816
837
  "record.register"
817
838
  ]);
818
839
  var ScopesWithFullOptions = RecordScopeTypeV2.extract([
@@ -820,41 +841,42 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
820
841
  "record.read",
821
842
  "record.request-correction",
822
843
  "record.correct",
823
- "record.unassign-others"
844
+ "record.unassign-others",
845
+ "record.review-duplicates"
824
846
  ]);
825
847
  var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
826
- templates: z12.preprocess(
848
+ templates: z13.preprocess(
827
849
  (val) => val === void 0 ? void 0 : [val].flat(),
828
- z12.array(z12.string()).optional()
850
+ z13.array(z13.string()).optional()
829
851
  ).describe(
830
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."
831
853
  )
832
854
  });
833
- var RecordScopeV2 = z12.discriminatedUnion("type", [
834
- z12.object({
855
+ var RecordScopeV2 = z13.discriminatedUnion("type", [
856
+ z13.object({
835
857
  type: ScopesWithPlaceEventOptions,
836
858
  options: scopeOptionsPlaceEvent.optional()
837
859
  }),
838
- z12.object({
860
+ z13.object({
839
861
  type: ScopesWithDeclaredOptions,
840
862
  options: scopeOptionsDeclaredOrNotified.optional()
841
863
  }),
842
- z12.object({
864
+ z13.object({
843
865
  type: ScopesWithFullOptions,
844
866
  options: AllRecordScopeOptions.optional()
845
867
  }),
846
- z12.object({
847
- type: z12.literal("record.custom-action"),
868
+ z13.object({
869
+ type: z13.literal("record.custom-action"),
848
870
  options: CustomActionScopeOptions.optional()
849
871
  }),
850
- z12.object({
851
- type: z12.literal("record.print-certified-copies"),
872
+ z13.object({
873
+ type: z13.literal("record.print-certified-copies"),
852
874
  options: ScopeOptionsPrintCertifiedCopies.optional()
853
875
  })
854
876
  ]).describe(
855
877
  "Scopes used to check user's permission to perform actions on a record."
856
878
  );
857
- var SystemScopeType = z12.enum([
879
+ var SystemScopeType = z13.enum([
858
880
  "organisation.read-locations",
859
881
  "user.read",
860
882
  "user.create",
@@ -868,61 +890,61 @@ var UserScopeType = SystemScopeType.extract([
868
890
  "user.search"
869
891
  ]);
870
892
  var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
871
- var UserScopeV2 = z12.discriminatedUnion("type", [
872
- z12.object({
893
+ var UserScopeV2 = z13.discriminatedUnion("type", [
894
+ z13.object({
873
895
  type: ScopesWithRoleOption,
874
896
  options: AllUserScopeOptions.optional()
875
897
  }),
876
- z12.object({
898
+ z13.object({
877
899
  type: UserScopeType.extract(["user.read", "user.search"]),
878
900
  options: AccessLevelOptions.optional()
879
901
  })
880
902
  ]);
881
- var ResolvedRecordScopeV2 = z12.discriminatedUnion("type", [
882
- z12.object({
903
+ var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
904
+ z13.object({
883
905
  type: ScopesWithPlaceEventOptions,
884
906
  options: ResolvedScopeOptionsPlaceEvent.optional()
885
907
  }),
886
- z12.object({
908
+ z13.object({
887
909
  type: ScopesWithDeclaredOptions,
888
910
  options: ResolvedScopeOptionsDeclared.optional()
889
911
  }),
890
- z12.object({
912
+ z13.object({
891
913
  type: ScopesWithFullOptions,
892
914
  options: ResolvedScopeOptionsFull.optional()
893
915
  }),
894
- z12.object({
895
- type: z12.literal("record.print-certified-copies"),
916
+ z13.object({
917
+ type: z13.literal("record.print-certified-copies"),
896
918
  options: ResolvedScopeOptionsFull.extend({
897
- templates: z12.array(z12.string()).optional()
919
+ templates: z13.array(z13.string()).optional()
898
920
  }).optional()
899
921
  })
900
922
  ]).describe("Resolved scope with location/user IDs instead of filters.");
901
- var Scope = z12.discriminatedUnion("type", [
902
- z12.object({ type: PlainScopeType }),
923
+ var Scope = z13.discriminatedUnion("type", [
924
+ z13.object({ type: PlainScopeType }),
903
925
  ...RecordScopeV2.options,
904
926
  ...UserScopeV2.options,
905
- z12.object({
906
- type: z12.literal("organisation.read-locations"),
927
+ z13.object({
928
+ type: z13.literal("organisation.read-locations"),
907
929
  options: AccessLevelOptions.optional()
908
930
  }),
909
- z12.object({
910
- type: z12.literal("workqueue"),
931
+ z13.object({
932
+ type: z13.literal("workqueue"),
911
933
  options: WorkqueueOrDashboardOptions
912
934
  }),
913
- z12.object({
914
- type: z12.literal("dashboard.view"),
935
+ z13.object({
936
+ type: z13.literal("dashboard.view"),
915
937
  options: WorkqueueOrDashboardOptions
916
938
  })
917
939
  ]);
918
- var ScopeType = z12.enum([
940
+ var ScopeType = z13.enum([
919
941
  ...SystemScopeType.options,
920
942
  ...RecordScopeTypeV2.options,
921
943
  ...PlainScopeType.options,
922
944
  "workqueue",
923
945
  "dashboard.view"
924
946
  ]);
925
- var EncodedScope = z12.string().brand("EncodedScope");
947
+ var EncodedScope = z13.string().brand("EncodedScope");
926
948
  var DEFAULT_SCOPE_OPTIONS = {
927
949
  placeOfEvent: JurisdictionFilter.enum.all,
928
950
  accessLevel: JurisdictionFilter.enum.all,
@@ -932,25 +954,25 @@ var DEFAULT_SCOPE_OPTIONS = {
932
954
  };
933
955
 
934
956
  // ../commons/src/authentication.ts
935
- var TokenUserType = z13.enum(["user", "system"]);
936
- var TokenWithBearer = z13.string().regex(/^Bearer\s/);
957
+ var TokenUserType = z14.enum(["user", "system"]);
958
+ var TokenWithBearer = z14.string().regex(/^Bearer\s/);
937
959
 
938
960
  // ../commons/src/events/ActionDocument.ts
939
- var ActionUpdate = z14.record(z14.string(), FieldUpdateValue).describe(
961
+ var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
940
962
  "Record of field-level changes made by an action. Supports partial updates and nullable values."
941
963
  );
942
- var EventState = z14.record(z14.string(), FieldValue).describe(
964
+ var EventState = z15.record(z15.string(), FieldValue).describe(
943
965
  "Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
944
966
  );
945
- var ActionBase = z14.object({
967
+ var ActionBase = z15.object({
946
968
  id: UUID.describe("Unique identifier of the action."),
947
- transactionId: z14.string().describe("Unique identifier of the transaction."),
969
+ transactionId: z15.string().describe("Unique identifier of the transaction."),
948
970
  createdByUserType: TokenUserType.describe(
949
971
  "Indicates whether the action was created by a human-user or by a system-user."
950
972
  ),
951
- createdAt: z14.string().datetime().describe("Timestamp indicating when the action was created."),
952
- createdBy: z14.string().describe("Identifier of the user who created the action."),
953
- 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."),
954
976
  createdBySignature: DocumentPath.nullish().describe(
955
977
  "Reference to the signature of the user who created the action."
956
978
  ),
@@ -962,7 +984,7 @@ var ActionBase = z14.object({
962
984
  "Declaration data defined by the ActionConfig. Supports partial updates."
963
985
  ),
964
986
  annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
965
- status: z14.enum([
987
+ status: z15.enum([
966
988
  ActionStatus.Requested,
967
989
  ActionStatus.Accepted,
968
990
  ActionStatus.Rejected
@@ -974,139 +996,143 @@ var ActionBase = z14.object({
974
996
  )
975
997
  });
976
998
  var AssignedAction = ActionBase.extend(
977
- z14.object({
978
- type: z14.literal(ActionType.ASSIGN),
979
- 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.")
980
1002
  // TODO move into 'content' property
981
1003
  }).shape
982
1004
  );
983
1005
  var UnassignedAction = ActionBase.extend(
984
- z14.object({
985
- type: z14.literal(ActionType.UNASSIGN)
1006
+ z15.object({
1007
+ type: z15.literal(ActionType.UNASSIGN)
986
1008
  }).shape
987
1009
  );
988
1010
  var RegisterAction = ActionBase.extend(
989
- z14.object({
990
- type: z14.literal(ActionType.REGISTER),
991
- registrationNumber: z14.string().optional().describe(
1011
+ z15.object({
1012
+ type: z15.literal(ActionType.REGISTER),
1013
+ registrationNumber: z15.string().optional().describe(
992
1014
  "Registration number of the event. Always present for accepted registrations."
993
1015
  )
994
1016
  // TODO move into 'content' property
995
1017
  }).shape
996
1018
  );
997
1019
  var DeclareAction = ActionBase.extend(
998
- z14.object({
999
- type: z14.literal(ActionType.DECLARE)
1020
+ z15.object({
1021
+ type: z15.literal(ActionType.DECLARE)
1000
1022
  }).shape
1001
1023
  );
1002
- var ReasonContent = z14.object({
1003
- 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(
1004
1026
  "Message describing the reason for rejecting or archiving the event."
1005
1027
  )
1006
1028
  });
1007
1029
  var RejectAction = ActionBase.extend(
1008
- z14.object({
1009
- type: z14.literal(ActionType.REJECT),
1030
+ z15.object({
1031
+ type: z15.literal(ActionType.REJECT),
1010
1032
  content: ReasonContent
1011
1033
  }).shape
1012
1034
  );
1013
- var PotentialDuplicate = z14.object({
1035
+ var PotentialDuplicate = z15.object({
1014
1036
  id: UUID,
1015
- trackingId: z14.string()
1037
+ trackingId: z15.string()
1016
1038
  });
1017
1039
  var DuplicateDetectedAction = ActionBase.extend(
1018
- z14.object({
1019
- type: z14.literal(ActionType.DUPLICATE_DETECTED),
1020
- content: z14.object({
1021
- duplicates: z14.array(PotentialDuplicate)
1040
+ z15.object({
1041
+ type: z15.literal(ActionType.DUPLICATE_DETECTED),
1042
+ content: z15.object({
1043
+ duplicates: z15.array(PotentialDuplicate)
1022
1044
  })
1023
1045
  }).shape
1024
1046
  );
1025
1047
  var MarkNotDuplicateAction = ActionBase.extend(
1026
- z14.object({
1027
- type: z14.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1048
+ z15.object({
1049
+ type: z15.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1028
1050
  }).shape
1029
1051
  );
1030
1052
  var MarkAsDuplicateAction = ActionBase.extend(
1031
- z14.object({
1032
- type: z14.literal(ActionType.MARK_AS_DUPLICATE),
1033
- content: z14.object({
1053
+ z15.object({
1054
+ type: z15.literal(ActionType.MARK_AS_DUPLICATE),
1055
+ content: z15.object({
1034
1056
  duplicateOf: UUID
1035
1057
  }).optional()
1036
1058
  }).shape
1037
1059
  );
1038
1060
  var ArchiveAction = ActionBase.extend(
1039
- z14.object({
1040
- type: z14.literal(ActionType.ARCHIVE),
1041
- content: ReasonContent
1061
+ z15.object({
1062
+ type: z15.literal(ActionType.ARCHIVE),
1063
+ /**
1064
+ * Archiving does not collect a reason on its own. Only the
1065
+ * "mark as duplicate" flow archives with a reason attached.
1066
+ */
1067
+ content: ReasonContent.optional()
1042
1068
  }).shape
1043
1069
  );
1044
1070
  var UnarchiveAction = ActionBase.extend(
1045
- z14.object({
1046
- type: z14.literal(ActionType.UNARCHIVE)
1071
+ z15.object({
1072
+ type: z15.literal(ActionType.UNARCHIVE)
1047
1073
  }).shape
1048
1074
  );
1049
1075
  var CreatedAction = ActionBase.extend(
1050
- z14.object({
1051
- type: z14.literal(ActionType.CREATE)
1076
+ z15.object({
1077
+ type: z15.literal(ActionType.CREATE)
1052
1078
  }).shape
1053
1079
  );
1054
1080
  var NotifiedAction = ActionBase.extend(
1055
- z14.object({
1056
- type: z14.literal(ActionType.NOTIFY)
1081
+ z15.object({
1082
+ type: z15.literal(ActionType.NOTIFY)
1057
1083
  }).shape
1058
1084
  );
1059
1085
  var EditAction = ActionBase.extend(
1060
- z14.object({
1061
- type: z14.literal(ActionType.EDIT),
1086
+ z15.object({
1087
+ type: z15.literal(ActionType.EDIT),
1062
1088
  /** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
1063
- content: z14.object({
1064
- 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()
1065
1091
  }).optional()
1066
1092
  }).shape
1067
1093
  );
1068
- var PrintContent = z14.object({
1069
- templateId: z14.string().optional()
1094
+ var PrintContent = z15.object({
1095
+ templateId: z15.string().optional()
1070
1096
  });
1071
1097
  var PrintCertificateAction = ActionBase.extend(
1072
- z14.object({
1073
- type: z14.literal(ActionType.PRINT_CERTIFICATE),
1098
+ z15.object({
1099
+ type: z15.literal(ActionType.PRINT_CERTIFICATE),
1074
1100
  content: PrintContent.optional().nullable()
1075
1101
  }).shape
1076
1102
  );
1077
1103
  var RequestedCorrectionAction = ActionBase.extend(
1078
- z14.object({
1079
- type: z14.literal(ActionType.REQUEST_CORRECTION)
1104
+ z15.object({
1105
+ type: z15.literal(ActionType.REQUEST_CORRECTION)
1080
1106
  }).shape
1081
1107
  );
1082
1108
  var ApprovedCorrectionAction = ActionBase.extend(
1083
- z14.object({
1084
- type: z14.literal(ActionType.APPROVE_CORRECTION),
1085
- requestId: z14.string(),
1109
+ z15.object({
1110
+ type: z15.literal(ActionType.APPROVE_CORRECTION),
1111
+ requestId: z15.string(),
1086
1112
  // TODO move into 'content' property
1087
- content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
1113
+ content: z15.object({ immediateCorrection: z15.boolean().optional() }).optional()
1088
1114
  }).shape
1089
1115
  );
1090
1116
  var RejectedCorrectionAction = ActionBase.extend(
1091
- z14.object({
1092
- type: z14.literal(ActionType.REJECT_CORRECTION),
1093
- requestId: z14.string(),
1117
+ z15.object({
1118
+ type: z15.literal(ActionType.REJECT_CORRECTION),
1119
+ requestId: z15.string(),
1094
1120
  // TODO move into 'content' property
1095
1121
  content: ReasonContent
1096
1122
  }).shape
1097
1123
  );
1098
1124
  var ReadAction = ActionBase.extend(
1099
- z14.object({
1100
- type: z14.literal(ActionType.READ)
1125
+ z15.object({
1126
+ type: z15.literal(ActionType.READ)
1101
1127
  }).shape
1102
1128
  );
1103
1129
  var CustomAction = ActionBase.merge(
1104
- z14.object({
1105
- type: z14.literal(ActionType.CUSTOM),
1106
- customActionType: z14.string()
1130
+ z15.object({
1131
+ type: z15.literal(ActionType.CUSTOM),
1132
+ customActionType: z15.string()
1107
1133
  })
1108
1134
  );
1109
- var ActionDocument = z14.discriminatedUnion("type", [
1135
+ var ActionDocument = z15.discriminatedUnion("type", [
1110
1136
  CreatedAction.meta({ id: "CreatedAction" }),
1111
1137
  RejectAction.meta({ id: "RejectAction" }),
1112
1138
  DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
@@ -1133,57 +1159,50 @@ var AsyncRejectActionDocument = ActionBase.omit({
1133
1159
  declaration: true,
1134
1160
  annotation: true
1135
1161
  }).extend(
1136
- z14.object({
1137
- type: z14.enum(ConfirmableActions),
1138
- status: z14.literal(ActionStatus.Rejected)
1162
+ z15.object({
1163
+ type: z15.enum(ConfirmableActions),
1164
+ status: z15.literal(ActionStatus.Rejected)
1139
1165
  }).shape
1140
1166
  );
1141
- var Action = z14.union([ActionDocument, AsyncRejectActionDocument]);
1167
+ var Action = z15.union([ActionDocument, AsyncRejectActionDocument]);
1142
1168
 
1143
1169
  // ../commons/src/events/EventMetadata.ts
1144
- var EventStatus = z15.enum([
1145
- "CREATED",
1146
- "NOTIFIED",
1147
- "DECLARED",
1148
- "REGISTERED",
1149
- "ARCHIVED"
1150
- ]);
1151
- var ZodDate = z15.iso.date();
1152
- var ZodDateTime = z15.string().datetime();
1153
- var ActionCreationMetadata = z15.object({
1154
- createdAt: z15.iso.datetime().describe("The timestamp when the action request was created."),
1155
- 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."),
1156
1175
  // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1157
1176
  createdAtLocation: UUID.nullish().describe(
1158
1177
  "Location of the user who created the action request."
1159
1178
  ),
1160
- createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1161
- acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
1162
- 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.")
1163
1182
  });
1164
1183
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1165
- registrationNumber: z15.string().describe(
1184
+ registrationNumber: z16.string().describe(
1166
1185
  "Registration number of the event. Always present for accepted registrations."
1167
1186
  )
1168
1187
  });
1169
- var LegalStatuses = z15.object({
1188
+ var LegalStatuses = z16.object({
1170
1189
  [EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
1171
1190
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
1172
1191
  [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
1173
1192
  });
1174
- var EventMetadata = z15.object({
1193
+ var EventMetadata = z16.object({
1175
1194
  id: UUID,
1176
- 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."),
1177
1196
  status: EventStatus,
1178
1197
  legalStatuses: LegalStatuses.describe(
1179
1198
  "Metadata related to the legal registration of the event, such as who registered it and when."
1180
1199
  ),
1181
- 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."),
1182
1201
  dateOfEvent: ZodDate.nullish(),
1183
1202
  placeOfEvent: UUID.nullish(),
1184
- createdBy: z15.string().describe("ID of the user who created the event."),
1185
- createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1186
- 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."),
1187
1206
  // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1188
1207
  createdAtLocation: UUID.nullish().describe(
1189
1208
  "Location of the user who created the event."
@@ -1191,18 +1210,18 @@ var EventMetadata = z15.object({
1191
1210
  updatedAtLocation: UUID.nullish().describe(
1192
1211
  "Location of the user who last changed the status."
1193
1212
  ),
1194
- updatedAt: z15.iso.datetime().describe(
1213
+ updatedAt: z16.iso.datetime().describe(
1195
1214
  "Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
1196
1215
  ),
1197
- assignedTo: z15.string().nullish().describe("ID of the user currently assigned to the event."),
1198
- updatedBy: z15.string().nullish().describe("ID of the user who last changed the status."),
1199
- 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(
1200
1219
  "System-generated tracking ID used by informants or registrars to look up the event."
1201
1220
  ),
1202
- potentialDuplicates: z15.array(PotentialDuplicate).describe(
1221
+ potentialDuplicates: z16.array(PotentialDuplicate).describe(
1203
1222
  "List of event IDs and their tracking IDs that this event could be a duplicate of."
1204
1223
  ),
1205
- flags: z15.array(Flag)
1224
+ flags: z16.array(Flag)
1206
1225
  });
1207
1226
  var EventMetadataKeysArray = [
1208
1227
  "id",
@@ -1223,8 +1242,8 @@ var EventMetadataKeysArray = [
1223
1242
  "legalStatuses",
1224
1243
  "flags"
1225
1244
  ];
1226
- var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
1227
- var EventMetadataDateFieldIdInput = z15.enum([
1245
+ var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
1246
+ var EventMetadataDateFieldIdInput = z16.enum([
1228
1247
  "createdAt",
1229
1248
  "updatedAt",
1230
1249
  "legalStatuses.NOTIFIED.createdAt",
@@ -1234,7 +1253,7 @@ var EventMetadataDateFieldIdInput = z15.enum([
1234
1253
  "legalStatuses.REGISTERED.createdAt",
1235
1254
  "legalStatuses.REGISTERED.acceptedAt"
1236
1255
  ]);
1237
- var EventMetadataDateFieldId = z15.enum([
1256
+ var EventMetadataDateFieldId = z16.enum([
1238
1257
  "event.createdAt",
1239
1258
  "event.updatedAt",
1240
1259
  "event.legalStatuses.NOTIFIED.createdAt",
@@ -1493,8 +1512,8 @@ var BaseField = import_v43.default.object({
1493
1512
  conditionals: import_v43.default.array(FieldConditional).default([]).optional().describe(
1494
1513
  "Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
1495
1514
  ),
1496
- secured: import_v43.default.boolean().default(false).optional().describe(
1497
- "Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
1515
+ secured: import_v43.default.union([import_v43.default.boolean(), Conditional]).default(false).optional().describe(
1516
+ "Indicates whether the field is secured, either always (boolean) or conditionally, evaluated against the event (a JSONSchema conditional, e.g. flag('sealed')). Secured fields are not indexed for search and are only visible when explicitly assigned."
1498
1517
  ),
1499
1518
  placeholder: TranslationConfig.optional(),
1500
1519
  validation: import_v43.default.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
@@ -1892,7 +1911,16 @@ var AdministrativeAreaField = BaseField.extend({
1892
1911
  configuration: import_v43.default.object({
1893
1912
  partOf: FieldReference.optional().describe("Parent location"),
1894
1913
  type: AdministrativeAreas,
1895
- allowedLocations: AllowedLocations
1914
+ allowedLocations: AllowedLocations,
1915
+ listHistoricalNames: import_v43.default.boolean().optional().describe(
1916
+ "List every historical name a location has had as a separate, selectable option."
1917
+ ),
1918
+ activeOnly: import_v43.default.boolean().optional().describe(
1919
+ "Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
1920
+ ),
1921
+ anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
1922
+ "Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that."
1923
+ )
1896
1924
  }).describe("Administrative area options")
1897
1925
  }).meta({
1898
1926
  description: "Administrative area input field",
@@ -1903,7 +1931,16 @@ var LocationInput = BaseField.extend({
1903
1931
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1904
1932
  configuration: import_v43.default.object({
1905
1933
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
1906
- allowedLocations: AllowedLocations
1934
+ allowedLocations: AllowedLocations,
1935
+ listHistoricalNames: import_v43.default.boolean().optional().describe(
1936
+ "List every historical name a location has had as a separate, selectable option."
1937
+ ),
1938
+ activeOnly: import_v43.default.boolean().optional().describe(
1939
+ "Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
1940
+ ),
1941
+ anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
1942
+ "Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that."
1943
+ )
1907
1944
  }).optional()
1908
1945
  }).meta({
1909
1946
  description: "A field for selecting a location",
@@ -1929,12 +1966,22 @@ var FileUploadWithOptions = BaseField.extend({
1929
1966
  var Facility = BaseField.extend({
1930
1967
  type: import_v43.default.literal(FieldType.FACILITY),
1931
1968
  defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1932
- configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
1969
+ configuration: import_v43.default.object({
1970
+ allowedLocations: AllowedLocations,
1971
+ listHistoricalNames: import_v43.default.boolean().optional(),
1972
+ activeOnly: import_v43.default.boolean().optional(),
1973
+ anchorToDateOfEvent: import_v43.default.boolean().optional()
1974
+ }).optional()
1933
1975
  }).describe("Input field for a facility");
1934
1976
  var Office = BaseField.extend({
1935
1977
  type: import_v43.default.literal(FieldType.OFFICE),
1936
1978
  defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1937
- configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
1979
+ configuration: import_v43.default.object({
1980
+ allowedLocations: AllowedLocations,
1981
+ listHistoricalNames: import_v43.default.boolean().optional(),
1982
+ activeOnly: import_v43.default.boolean().optional(),
1983
+ anchorToDateOfEvent: import_v43.default.boolean().optional()
1984
+ }).optional()
1938
1985
  }).describe("Input field for an office");
1939
1986
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
1940
1987
  administrativeArea: import_v43.default.union([UUID, SerializedUserField]).optional()
@@ -1967,7 +2014,16 @@ var Address = BaseField.extend({
1967
2014
  parent: FieldReference.optional()
1968
2015
  })
1969
2016
  ).optional(),
1970
- allowedLocations: AllowedLocations
2017
+ allowedLocations: AllowedLocations,
2018
+ listHistoricalNames: import_v43.default.boolean().optional().describe(
2019
+ "List every historical name a location has had as a separate, selectable option. Propagated to the embedded admin-area selectors."
2020
+ ),
2021
+ activeOnly: import_v43.default.boolean().optional().describe(
2022
+ "Offer only admin areas that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded. Propagated to the embedded admin-area selectors."
2023
+ ),
2024
+ anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
2025
+ "Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that. Propagated to the embedded admin-area selectors."
2026
+ )
1971
2027
  }).optional(),
1972
2028
  defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
1973
2029
  }).meta({
@@ -2268,7 +2324,7 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
2268
2324
  ]);
2269
2325
 
2270
2326
  // ../commons/src/application-config.ts
2271
- var SearchCriteria = z20.enum([
2327
+ var SearchCriteria = z21.enum([
2272
2328
  "TRACKING_ID",
2273
2329
  "REGISTRATION_NUMBER",
2274
2330
  "NATIONAL_ID",
@@ -2276,69 +2332,69 @@ var SearchCriteria = z20.enum([
2276
2332
  "PHONE_NUMBER",
2277
2333
  "EMAIL"
2278
2334
  ]);
2279
- var ApplicationConfig = z20.object({
2280
- APPLICATION_NAME: z20.string(),
2281
- COUNTRY_LOGO: z20.object({
2282
- fileName: z20.string(),
2283
- 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()
2284
2340
  }),
2285
- SYSTEM_IANA_TIMEZONE: z20.string(),
2286
- CURRENCY: z20.object({
2287
- languagesAndCountry: z20.array(z20.string()),
2288
- isoCode: z20.string()
2341
+ SYSTEM_IANA_TIMEZONE: z21.string(),
2342
+ CURRENCY: z21.object({
2343
+ languagesAndCountry: z21.array(z21.string()),
2344
+ isoCode: z21.string()
2289
2345
  }),
2290
- ADMIN_STRUCTURE: z20.array(
2291
- z20.object({
2292
- id: z20.string(),
2346
+ ADMIN_STRUCTURE: z21.array(
2347
+ z21.object({
2348
+ id: z21.string(),
2293
2349
  label: TranslationConfig
2294
2350
  })
2295
2351
  ),
2296
- PHONE_NUMBER_PATTERN: z20.string().or(z20.instanceof(RegExp)),
2297
- USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2298
- 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"]),
2299
2355
  SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
2300
- ADDITIONAL_USER_FIELDS: z20.array(FieldConfig).optional().default([])
2356
+ ADDITIONAL_USER_FIELDS: z21.array(FieldConfig).optional().default([])
2301
2357
  });
2302
2358
  var defineApplicationConfig = (config) => {
2303
2359
  return ApplicationConfig.parse(config);
2304
2360
  };
2305
- var BackgroundConfig = z20.object({
2306
- backgroundColor: z20.string().optional(),
2307
- backgroundImage: z20.string().optional(),
2308
- imageFit: z20.string().optional()
2361
+ var BackgroundConfig = z21.object({
2362
+ backgroundColor: z21.string().optional(),
2363
+ backgroundImage: z21.string().optional(),
2364
+ imageFit: z21.string().optional()
2309
2365
  }).refine(
2310
2366
  (data) => !!(data.backgroundColor || data.backgroundImage),
2311
2367
  "backgroundColor and backgroundImage cannot be empty at the same time"
2312
2368
  );
2313
- var LoginConfig = z20.object({
2314
- COUNTRY: z20.string(),
2315
- LANGUAGES: z20.array(z20.string()),
2316
- USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2317
- INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2318
- 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)),
2319
2375
  LOGIN_BACKGROUND: BackgroundConfig,
2320
- SENTRY: z20.string().optional()
2376
+ SENTRY: z21.string().optional()
2321
2377
  });
2322
2378
  var defineLoginConfig = (config) => {
2323
2379
  return LoginConfig.parse(config);
2324
2380
  };
2325
- var ClientConfig = z20.object({
2326
- COUNTRY: z20.string(),
2327
- LANGUAGES: z20.array(z20.string()),
2328
- SENTRY: z20.string().optional(),
2329
- 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(),
2330
2386
  REGISTER_BACKGROUND: BackgroundConfig,
2331
- DASHBOARDS: z20.array(
2332
- z20.object({
2333
- id: z20.string(),
2387
+ DASHBOARDS: z21.array(
2388
+ z21.object({
2389
+ id: z21.string(),
2334
2390
  title: TranslationConfig,
2335
- url: z20.string(),
2336
- context: z20.object({
2337
- auth: z20.literal("REQUEST_AUTH_TOKEN")
2391
+ url: z21.string(),
2392
+ context: z21.object({
2393
+ auth: z21.literal("REQUEST_AUTH_TOKEN")
2338
2394
  }).optional()
2339
2395
  })
2340
2396
  ),
2341
- 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 })
2342
2398
  });
2343
2399
  var defineClientConfig = (config) => {
2344
2400
  return ClientConfig.parse(config);