@opencrvs/toolkit 2.1.0-rc.628e5ce → 2.1.0-rc.65b5bdf

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 (102) hide show
  1. package/README.md +1 -0
  2. package/build.sh +9 -1
  3. package/create-countryconfig/index.js +412 -59
  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 +340 -274
  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 +1780 -113
  11. package/dist/commons/api/router.d.ts +600 -70
  12. package/dist/commons/conditionals/conditionals.d.ts +6 -6
  13. package/dist/commons/conditionals/validate.d.ts +16 -5
  14. package/dist/commons/events/ActionDocument.d.ts +5 -11
  15. package/dist/commons/events/ActionInput.d.ts +4 -4
  16. package/dist/commons/events/ActionStatus.d.ts +14 -0
  17. package/dist/commons/events/AdvancedSearchConfig.d.ts +18 -0
  18. package/dist/commons/events/AuditLog.d.ts +110 -0
  19. package/dist/commons/events/EventConfig.d.ts +3 -0
  20. package/dist/commons/events/EventDocument.d.ts +470 -2
  21. package/dist/commons/events/EventIndex.d.ts +3 -26
  22. package/dist/commons/events/EventMetadata.d.ts +1 -11
  23. package/dist/commons/events/EventStatus.d.ts +19 -0
  24. package/dist/commons/events/FieldConfig.d.ts +83 -53
  25. package/dist/commons/events/FieldTypeMapping.d.ts +27 -27
  26. package/dist/commons/events/FieldValue.d.ts +2 -2
  27. package/dist/commons/events/Flag.d.ts +42 -0
  28. package/dist/commons/events/PlainDate.d.ts +8 -0
  29. package/dist/commons/events/SummaryConfig.d.ts +249 -0
  30. package/dist/commons/events/WorkqueueConfig.d.ts +17 -14
  31. package/dist/commons/events/event.d.ts +12 -0
  32. package/dist/commons/events/locations.d.ts +162 -26
  33. package/dist/commons/events/mocks.test.utils.d.ts +30 -0
  34. package/dist/commons/events/test.utils.d.ts +25 -4
  35. package/dist/commons/events/utils.d.ts +13 -2
  36. package/dist/commons/notification/UserNotifications.d.ts +28 -13
  37. package/dist/commons/notification/dispatch.d.ts +10 -0
  38. package/dist/commons/notification/index.d.ts +1 -0
  39. package/dist/conditionals/index.js +327 -58
  40. package/dist/csv.d.ts +25 -0
  41. package/dist/csv.d.ts.map +1 -0
  42. package/dist/csv.js +120 -0
  43. package/dist/environment/index.d.ts +1 -0
  44. package/dist/environment/index.d.ts.map +1 -1
  45. package/dist/environment/index.js +10 -0
  46. package/dist/environment/logger.d.ts +15 -3
  47. package/dist/environment/logger.d.ts.map +1 -1
  48. package/dist/environment/paths.d.ts +7 -0
  49. package/dist/environment/paths.d.ts.map +1 -0
  50. package/dist/environment/paths.js +72 -0
  51. package/dist/environment/questions.d.ts.map +1 -1
  52. package/dist/environment/questions.js +20 -14
  53. package/dist/environment/setup-environment.js +28 -7
  54. package/dist/environment/templates.d.ts.map +1 -1
  55. package/dist/environment/templates.js +2 -1
  56. package/dist/environment/update-workflows.d.ts.map +1 -1
  57. package/dist/environment/update-workflows.js +17 -5
  58. package/dist/environment/upgrade.d.ts +2 -0
  59. package/dist/environment/upgrade.d.ts.map +1 -0
  60. package/dist/environment/upgrade.js +82 -0
  61. package/dist/environment/users.js +11 -13
  62. package/dist/events/index.js +7490 -7094
  63. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
  64. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  65. package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
  66. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
  67. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
  68. package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
  69. package/dist/migrations/v2.1/add-translations.d.ts +9 -0
  70. package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
  71. package/dist/migrations/v2.1/add-translations.js +213 -0
  72. package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
  73. package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
  74. package/dist/migrations/v2.1/enable-telemetry.js +438 -0
  75. package/dist/migrations/v2.1/index.d.ts.map +1 -1
  76. package/dist/migrations/v2.1/index.js +1058 -0
  77. package/dist/notification/index.js +1780 -1447
  78. package/dist/scopes/index.d.ts +325 -32
  79. package/dist/scopes/index.js +328 -58
  80. package/dist/telemetry/index.d.ts +45 -0
  81. package/dist/telemetry/index.d.ts.map +1 -0
  82. package/dist/telemetry/index.js +39 -0
  83. package/dist/templates/charts-values/dependencies/values.yaml +2 -0
  84. package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
  85. package/dist/templates/charts-values/opentelemetry/values.yaml +95 -0
  86. package/dist/templates/charts-values/traefik/values.yaml +23 -9
  87. package/dist/templates/inventory/inventory.template.yml +1 -3
  88. package/dist/translations/check.d.ts +19 -0
  89. package/dist/translations/check.d.ts.map +1 -0
  90. package/dist/translations/check.js +127 -0
  91. package/dist/verify/endpoints.d.ts +2 -0
  92. package/dist/verify/endpoints.d.ts.map +1 -0
  93. package/dist/verify/endpoints.js +345 -0
  94. package/opencrvs-toolkit-2.1.0-rc.65b5bdf.tgz +0 -0
  95. package/package.json +12 -7
  96. package/tsconfig.build.json +11 -0
  97. package/tsconfig.build.tsbuildinfo +1 -0
  98. package/tsconfig.json +3 -0
  99. package/dist/templates/inventory/production.example.yml +0 -77
  100. package/dist/templates/inventory/qa.example.yml +0 -48
  101. package/opencrvs-toolkit-2.1.0-rc.628e5ce.tgz +0 -0
  102. 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 z13 = __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,16 +612,98 @@ var META_ACTIONS = [
612
612
 
613
613
  // ../commons/src/authentication.ts
614
614
  var import_jwt_decode = __toESM(require("jwt-decode"));
615
- var z12 = __toESM(require("zod/v4"));
615
+ var z14 = __toESM(require("zod/v4"));
616
616
 
617
617
  // ../commons/src/scopes.ts
618
- var z11 = __toESM(require("zod/v4"));
618
+ var z13 = __toESM(require("zod/v4"));
619
619
  var qs = __toESM(require("qs"));
620
- var JurisdictionFilter = z11.enum(["administrativeArea", "location", "all"]).describe(
620
+
621
+ // ../commons/src/events/ActionStatus.ts
622
+ var ActionStatus = {
623
+ Requested: "Requested",
624
+ Accepted: "Accepted",
625
+ Rejected: "Rejected"
626
+ };
627
+
628
+ // ../commons/src/events/Flag.ts
629
+ var z11 = __toESM(require("zod/v4"));
630
+ var InherentFlags = {
631
+ INCOMPLETE: "incomplete",
632
+ REJECTED: "rejected",
633
+ CORRECTION_REQUESTED: "correction-requested",
634
+ POTENTIAL_DUPLICATE: "potential-duplicate",
635
+ /**
636
+ * This flag is set by the Edit-action and removed after the declaration or registration.
637
+ * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
638
+ *
639
+ * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
640
+ */
641
+ EDIT_IN_PROGRESS: "edit-in-progress"
642
+ };
643
+ var actionFlagPattern;
644
+ function getActionFlagPattern() {
645
+ actionFlagPattern ??= new RegExp(
646
+ `^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
647
+ ActionStatus
648
+ ).join("|").toLowerCase()})$`
649
+ );
650
+ return actionFlagPattern;
651
+ }
652
+ var ActionFlag = z11.string().refine((value) => getActionFlagPattern().test(value), {
653
+ message: "Flag must be in the format ActionType:ActionStatus (lowerCase)"
654
+ });
655
+ var CustomFlag = z11.string().refine((val) => !Object.values(InherentFlags).includes(val), {
656
+ message: `Custom flag cannot be one of the inherent flags: ${Object.values(
657
+ InherentFlags
658
+ ).join(", ")}`
659
+ }).refine((val) => !ActionFlag.safeParse(val).success, {
660
+ message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
661
+ }).describe("Custom flag identifier defined by the country config.");
662
+ var Flag = ActionFlag.or(z11.enum(InherentFlags)).or(CustomFlag);
663
+ var ContainsFlags = z11.object({
664
+ anyOf: z11.array(Flag).optional(),
665
+ noneOf: z11.array(Flag).optional(),
666
+ allOf: z11.array(Flag).optional()
667
+ }).meta({
668
+ id: "ContainsFlags"
669
+ });
670
+ var FlagConfig = z11.object({
671
+ id: CustomFlag,
672
+ requiresAction: z11.boolean().describe(
673
+ "Indicates if this flag expects an action to be performed to be cleared."
674
+ ),
675
+ label: TranslationConfig.describe("Human readable label of the flag.")
676
+ }).meta({
677
+ id: "FlagConfig",
678
+ description: "Configuration for a custom flag that can be added to or removed from records by event actions."
679
+ });
680
+ var ActionFlagConfig = z11.object({
681
+ id: Flag,
682
+ operation: z11.enum(["add", "remove"]).describe("Operation to perform on the flag."),
683
+ conditional: Conditional.optional().describe(
684
+ "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
685
+ )
686
+ }).meta({
687
+ id: "ActionFlagConfig",
688
+ description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
689
+ });
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
+
701
+ // ../commons/src/scopes.ts
702
+ var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
621
703
  "Filters based on user jurisdiction relative to their office location in hierarchy."
622
704
  );
623
- var UserFilter = z11.enum(["user"]).describe("Filters based on the user. Limits to self.");
624
- var RecordScopeTypeV2 = z11.enum([
705
+ var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
706
+ var RecordScopeTypeV2 = z13.enum([
625
707
  "record.search",
626
708
  "record.create",
627
709
  "record.read",
@@ -639,12 +721,17 @@ var RecordScopeTypeV2 = z11.enum([
639
721
  "record.unassign-others",
640
722
  "record.custom-action"
641
723
  ]);
642
- var PlainScopeType = z11.enum([
724
+ var PlainScopeType = z13.enum([
643
725
  // Misc. system scopes
644
726
  "bypassratelimit",
645
727
  "record.reindex",
646
728
  "user.data-seeding",
647
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",
648
735
  "record.import",
649
736
  "config.update-all",
650
737
  "location.edit",
@@ -659,15 +746,21 @@ var PlainScopeType = z11.enum([
659
746
  "record.confirm-registration",
660
747
  "record.reject-registration"
661
748
  ]);
662
- var scopeByEvent = z11.preprocess(
749
+ var scopeByEvent = z13.preprocess(
663
750
  (val) => val === void 0 ? void 0 : [val].flat(),
664
- z11.array(z11.string()).optional()
751
+ z13.array(z13.string()).optional()
665
752
  ).describe("Event type, e.g. birth, death");
666
- var userRole = z11.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(
667
760
  (val) => val === void 0 ? void 0 : [val].flat(),
668
- z11.array(z11.string()).optional()
761
+ z13.array(z13.string()).optional()
669
762
  ).describe("User role, e.g. admin, field agent");
670
- var scopeOptionsPlaceEvent = z11.object({
763
+ var scopeOptionsPlaceEvent = z13.object({
671
764
  event: scopeByEvent,
672
765
  placeOfEvent: JurisdictionFilter.optional()
673
766
  }).describe("Options applicable to all record scopes.");
@@ -675,40 +768,42 @@ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
675
768
  notifiedIn: JurisdictionFilter.optional(),
676
769
  notifiedBy: UserFilter.optional(),
677
770
  declaredIn: JurisdictionFilter.optional(),
678
- declaredBy: UserFilter.optional()
771
+ declaredBy: UserFilter.optional(),
772
+ status: scopeByStatus
679
773
  }).describe("Options applicable to actions that may take place after DECLARE");
680
774
  var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
681
775
  registeredIn: JurisdictionFilter.optional(),
682
- registeredBy: UserFilter.optional()
776
+ registeredBy: UserFilter.optional(),
777
+ flags: ContainsFlags.optional()
683
778
  }).describe(
684
779
  "Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
685
780
  );
686
781
  var CustomActionScopeOptions = AllRecordScopeOptions.extend({
687
- customActionTypes: z11.preprocess(
782
+ customActionTypes: z13.preprocess(
688
783
  (val) => val === void 0 ? void 0 : [val].flat(),
689
- z11.array(z11.string()).optional()
784
+ z13.array(z13.string()).optional()
690
785
  ).describe("Allowed custom action types")
691
786
  });
692
- var AccessLevelOptions = z11.object({
787
+ var AccessLevelOptions = z13.object({
693
788
  accessLevel: JurisdictionFilter.optional()
694
789
  });
695
790
  var AllUserScopeOptions = AccessLevelOptions.extend({
696
791
  role: userRole.optional()
697
792
  });
698
- var WorkqueueOrDashboardOptions = z11.object({
699
- ids: z11.preprocess(
793
+ var WorkqueueOrDashboardOptions = z13.object({
794
+ ids: z13.preprocess(
700
795
  (val) => val === void 0 ? void 0 : [val].flat(),
701
- z11.array(z11.string())
796
+ z13.array(z13.string())
702
797
  ).describe("Must contain a list of workqueue or dashboard ids.")
703
798
  });
704
- var AllScopeOptions = z11.object({
799
+ var AllScopeOptions = z13.object({
705
800
  ...AllRecordScopeOptions.shape,
706
801
  ...AccessLevelOptions.shape,
707
802
  ...AllUserScopeOptions.shape,
708
803
  ...WorkqueueOrDashboardOptions.shape
709
804
  });
710
805
  var ScopeOptionKey = AllScopeOptions.keyof();
711
- var ResolvedScopeOptionsPlaceEvent = z11.object({
806
+ var ResolvedScopeOptionsPlaceEvent = z13.object({
712
807
  event: scopeByEvent,
713
808
  placeOfEvent: UUID.nullish()
714
809
  }).describe(
@@ -716,15 +811,16 @@ var ResolvedScopeOptionsPlaceEvent = z11.object({
716
811
  );
717
812
  var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
718
813
  notifiedIn: UUID.nullish(),
719
- notifiedBy: z11.string().optional(),
814
+ notifiedBy: z13.string().optional(),
720
815
  declaredIn: UUID.nullish(),
721
- declaredBy: z11.string().optional()
816
+ declaredBy: z13.string().optional()
722
817
  }).describe(
723
818
  "Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
724
819
  );
725
820
  var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
726
821
  registeredIn: UUID.nullish(),
727
- registeredBy: z11.string().optional()
822
+ registeredBy: z13.string().optional(),
823
+ flags: ContainsFlags.optional()
728
824
  }).describe(
729
825
  "Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
730
826
  );
@@ -738,7 +834,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
738
834
  "record.reject",
739
835
  "record.archive",
740
836
  "record.unarchive",
741
- "record.review-duplicates",
742
837
  "record.register"
743
838
  ]);
744
839
  var ScopesWithFullOptions = RecordScopeTypeV2.extract([
@@ -746,41 +841,42 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
746
841
  "record.read",
747
842
  "record.request-correction",
748
843
  "record.correct",
749
- "record.unassign-others"
844
+ "record.unassign-others",
845
+ "record.review-duplicates"
750
846
  ]);
751
847
  var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
752
- templates: z11.preprocess(
848
+ templates: z13.preprocess(
753
849
  (val) => val === void 0 ? void 0 : [val].flat(),
754
- z11.array(z11.string()).optional()
850
+ z13.array(z13.string()).optional()
755
851
  ).describe(
756
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."
757
853
  )
758
854
  });
759
- var RecordScopeV2 = z11.discriminatedUnion("type", [
760
- z11.object({
855
+ var RecordScopeV2 = z13.discriminatedUnion("type", [
856
+ z13.object({
761
857
  type: ScopesWithPlaceEventOptions,
762
858
  options: scopeOptionsPlaceEvent.optional()
763
859
  }),
764
- z11.object({
860
+ z13.object({
765
861
  type: ScopesWithDeclaredOptions,
766
862
  options: scopeOptionsDeclaredOrNotified.optional()
767
863
  }),
768
- z11.object({
864
+ z13.object({
769
865
  type: ScopesWithFullOptions,
770
866
  options: AllRecordScopeOptions.optional()
771
867
  }),
772
- z11.object({
773
- type: z11.literal("record.custom-action"),
868
+ z13.object({
869
+ type: z13.literal("record.custom-action"),
774
870
  options: CustomActionScopeOptions.optional()
775
871
  }),
776
- z11.object({
777
- type: z11.literal("record.print-certified-copies"),
872
+ z13.object({
873
+ type: z13.literal("record.print-certified-copies"),
778
874
  options: ScopeOptionsPrintCertifiedCopies.optional()
779
875
  })
780
876
  ]).describe(
781
877
  "Scopes used to check user's permission to perform actions on a record."
782
878
  );
783
- var SystemScopeType = z11.enum([
879
+ var SystemScopeType = z13.enum([
784
880
  "organisation.read-locations",
785
881
  "user.read",
786
882
  "user.create",
@@ -794,61 +890,61 @@ var UserScopeType = SystemScopeType.extract([
794
890
  "user.search"
795
891
  ]);
796
892
  var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
797
- var UserScopeV2 = z11.discriminatedUnion("type", [
798
- z11.object({
893
+ var UserScopeV2 = z13.discriminatedUnion("type", [
894
+ z13.object({
799
895
  type: ScopesWithRoleOption,
800
896
  options: AllUserScopeOptions.optional()
801
897
  }),
802
- z11.object({
898
+ z13.object({
803
899
  type: UserScopeType.extract(["user.read", "user.search"]),
804
900
  options: AccessLevelOptions.optional()
805
901
  })
806
902
  ]);
807
- var ResolvedRecordScopeV2 = z11.discriminatedUnion("type", [
808
- z11.object({
903
+ var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
904
+ z13.object({
809
905
  type: ScopesWithPlaceEventOptions,
810
906
  options: ResolvedScopeOptionsPlaceEvent.optional()
811
907
  }),
812
- z11.object({
908
+ z13.object({
813
909
  type: ScopesWithDeclaredOptions,
814
910
  options: ResolvedScopeOptionsDeclared.optional()
815
911
  }),
816
- z11.object({
912
+ z13.object({
817
913
  type: ScopesWithFullOptions,
818
914
  options: ResolvedScopeOptionsFull.optional()
819
915
  }),
820
- z11.object({
821
- type: z11.literal("record.print-certified-copies"),
916
+ z13.object({
917
+ type: z13.literal("record.print-certified-copies"),
822
918
  options: ResolvedScopeOptionsFull.extend({
823
- templates: z11.array(z11.string()).optional()
919
+ templates: z13.array(z13.string()).optional()
824
920
  }).optional()
825
921
  })
826
922
  ]).describe("Resolved scope with location/user IDs instead of filters.");
827
- var Scope = z11.discriminatedUnion("type", [
828
- z11.object({ type: PlainScopeType }),
923
+ var Scope = z13.discriminatedUnion("type", [
924
+ z13.object({ type: PlainScopeType }),
829
925
  ...RecordScopeV2.options,
830
926
  ...UserScopeV2.options,
831
- z11.object({
832
- type: z11.literal("organisation.read-locations"),
927
+ z13.object({
928
+ type: z13.literal("organisation.read-locations"),
833
929
  options: AccessLevelOptions.optional()
834
930
  }),
835
- z11.object({
836
- type: z11.literal("workqueue"),
931
+ z13.object({
932
+ type: z13.literal("workqueue"),
837
933
  options: WorkqueueOrDashboardOptions
838
934
  }),
839
- z11.object({
840
- type: z11.literal("dashboard.view"),
935
+ z13.object({
936
+ type: z13.literal("dashboard.view"),
841
937
  options: WorkqueueOrDashboardOptions
842
938
  })
843
939
  ]);
844
- var ScopeType = z11.enum([
940
+ var ScopeType = z13.enum([
845
941
  ...SystemScopeType.options,
846
942
  ...RecordScopeTypeV2.options,
847
943
  ...PlainScopeType.options,
848
944
  "workqueue",
849
945
  "dashboard.view"
850
946
  ]);
851
- var EncodedScope = z11.string().brand("EncodedScope");
947
+ var EncodedScope = z13.string().brand("EncodedScope");
852
948
  var DEFAULT_SCOPE_OPTIONS = {
853
949
  placeOfEvent: JurisdictionFilter.enum.all,
854
950
  accessLevel: JurisdictionFilter.enum.all,
@@ -858,30 +954,25 @@ var DEFAULT_SCOPE_OPTIONS = {
858
954
  };
859
955
 
860
956
  // ../commons/src/authentication.ts
861
- var TokenUserType = z12.enum(["user", "system"]);
862
- var TokenWithBearer = z12.string().regex(/^Bearer\s/);
957
+ var TokenUserType = z14.enum(["user", "system"]);
958
+ var TokenWithBearer = z14.string().regex(/^Bearer\s/);
863
959
 
864
960
  // ../commons/src/events/ActionDocument.ts
865
- var ActionUpdate = z13.record(z13.string(), FieldUpdateValue).describe(
961
+ var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
866
962
  "Record of field-level changes made by an action. Supports partial updates and nullable values."
867
963
  );
868
- var EventState = z13.record(z13.string(), FieldValue).describe(
964
+ var EventState = z15.record(z15.string(), FieldValue).describe(
869
965
  "Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
870
966
  );
871
- var ActionStatus = {
872
- Requested: "Requested",
873
- Accepted: "Accepted",
874
- Rejected: "Rejected"
875
- };
876
- var ActionBase = z13.object({
967
+ var ActionBase = z15.object({
877
968
  id: UUID.describe("Unique identifier of the action."),
878
- transactionId: z13.string().describe("Unique identifier of the transaction."),
969
+ transactionId: z15.string().describe("Unique identifier of the transaction."),
879
970
  createdByUserType: TokenUserType.describe(
880
971
  "Indicates whether the action was created by a human-user or by a system-user."
881
972
  ),
882
- createdAt: z13.string().datetime().describe("Timestamp indicating when the action was created."),
883
- createdBy: z13.string().describe("Identifier of the user who created the action."),
884
- createdByRole: z13.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."),
885
976
  createdBySignature: DocumentPath.nullish().describe(
886
977
  "Reference to the signature of the user who created the action."
887
978
  ),
@@ -893,7 +984,7 @@ var ActionBase = z13.object({
893
984
  "Declaration data defined by the ActionConfig. Supports partial updates."
894
985
  ),
895
986
  annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
896
- status: z13.enum([
987
+ status: z15.enum([
897
988
  ActionStatus.Requested,
898
989
  ActionStatus.Accepted,
899
990
  ActionStatus.Rejected
@@ -905,139 +996,143 @@ var ActionBase = z13.object({
905
996
  )
906
997
  });
907
998
  var AssignedAction = ActionBase.extend(
908
- z13.object({
909
- type: z13.literal(ActionType.ASSIGN),
910
- assignedTo: z13.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.")
911
1002
  // TODO move into 'content' property
912
1003
  }).shape
913
1004
  );
914
1005
  var UnassignedAction = ActionBase.extend(
915
- z13.object({
916
- type: z13.literal(ActionType.UNASSIGN)
1006
+ z15.object({
1007
+ type: z15.literal(ActionType.UNASSIGN)
917
1008
  }).shape
918
1009
  );
919
1010
  var RegisterAction = ActionBase.extend(
920
- z13.object({
921
- type: z13.literal(ActionType.REGISTER),
922
- registrationNumber: z13.string().optional().describe(
1011
+ z15.object({
1012
+ type: z15.literal(ActionType.REGISTER),
1013
+ registrationNumber: z15.string().optional().describe(
923
1014
  "Registration number of the event. Always present for accepted registrations."
924
1015
  )
925
1016
  // TODO move into 'content' property
926
1017
  }).shape
927
1018
  );
928
1019
  var DeclareAction = ActionBase.extend(
929
- z13.object({
930
- type: z13.literal(ActionType.DECLARE)
1020
+ z15.object({
1021
+ type: z15.literal(ActionType.DECLARE)
931
1022
  }).shape
932
1023
  );
933
- var ReasonContent = z13.object({
934
- reason: z13.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(
935
1026
  "Message describing the reason for rejecting or archiving the event."
936
1027
  )
937
1028
  });
938
1029
  var RejectAction = ActionBase.extend(
939
- z13.object({
940
- type: z13.literal(ActionType.REJECT),
1030
+ z15.object({
1031
+ type: z15.literal(ActionType.REJECT),
941
1032
  content: ReasonContent
942
1033
  }).shape
943
1034
  );
944
- var PotentialDuplicate = z13.object({
1035
+ var PotentialDuplicate = z15.object({
945
1036
  id: UUID,
946
- trackingId: z13.string()
1037
+ trackingId: z15.string()
947
1038
  });
948
1039
  var DuplicateDetectedAction = ActionBase.extend(
949
- z13.object({
950
- type: z13.literal(ActionType.DUPLICATE_DETECTED),
951
- content: z13.object({
952
- duplicates: z13.array(PotentialDuplicate)
1040
+ z15.object({
1041
+ type: z15.literal(ActionType.DUPLICATE_DETECTED),
1042
+ content: z15.object({
1043
+ duplicates: z15.array(PotentialDuplicate)
953
1044
  })
954
1045
  }).shape
955
1046
  );
956
1047
  var MarkNotDuplicateAction = ActionBase.extend(
957
- z13.object({
958
- type: z13.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1048
+ z15.object({
1049
+ type: z15.literal(ActionType.MARK_AS_NOT_DUPLICATE)
959
1050
  }).shape
960
1051
  );
961
1052
  var MarkAsDuplicateAction = ActionBase.extend(
962
- z13.object({
963
- type: z13.literal(ActionType.MARK_AS_DUPLICATE),
964
- content: z13.object({
1053
+ z15.object({
1054
+ type: z15.literal(ActionType.MARK_AS_DUPLICATE),
1055
+ content: z15.object({
965
1056
  duplicateOf: UUID
966
1057
  }).optional()
967
1058
  }).shape
968
1059
  );
969
1060
  var ArchiveAction = ActionBase.extend(
970
- z13.object({
971
- type: z13.literal(ActionType.ARCHIVE),
972
- 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()
973
1068
  }).shape
974
1069
  );
975
1070
  var UnarchiveAction = ActionBase.extend(
976
- z13.object({
977
- type: z13.literal(ActionType.UNARCHIVE)
1071
+ z15.object({
1072
+ type: z15.literal(ActionType.UNARCHIVE)
978
1073
  }).shape
979
1074
  );
980
1075
  var CreatedAction = ActionBase.extend(
981
- z13.object({
982
- type: z13.literal(ActionType.CREATE)
1076
+ z15.object({
1077
+ type: z15.literal(ActionType.CREATE)
983
1078
  }).shape
984
1079
  );
985
1080
  var NotifiedAction = ActionBase.extend(
986
- z13.object({
987
- type: z13.literal(ActionType.NOTIFY)
1081
+ z15.object({
1082
+ type: z15.literal(ActionType.NOTIFY)
988
1083
  }).shape
989
1084
  );
990
1085
  var EditAction = ActionBase.extend(
991
- z13.object({
992
- type: z13.literal(ActionType.EDIT),
1086
+ z15.object({
1087
+ type: z15.literal(ActionType.EDIT),
993
1088
  /** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
994
- content: z13.object({
995
- comment: z13.string().describe("Comment for the edit action.").optional()
1089
+ content: z15.object({
1090
+ comment: z15.string().describe("Comment for the edit action.").optional()
996
1091
  }).optional()
997
1092
  }).shape
998
1093
  );
999
- var PrintContent = z13.object({
1000
- templateId: z13.string().optional()
1094
+ var PrintContent = z15.object({
1095
+ templateId: z15.string().optional()
1001
1096
  });
1002
1097
  var PrintCertificateAction = ActionBase.extend(
1003
- z13.object({
1004
- type: z13.literal(ActionType.PRINT_CERTIFICATE),
1098
+ z15.object({
1099
+ type: z15.literal(ActionType.PRINT_CERTIFICATE),
1005
1100
  content: PrintContent.optional().nullable()
1006
1101
  }).shape
1007
1102
  );
1008
1103
  var RequestedCorrectionAction = ActionBase.extend(
1009
- z13.object({
1010
- type: z13.literal(ActionType.REQUEST_CORRECTION)
1104
+ z15.object({
1105
+ type: z15.literal(ActionType.REQUEST_CORRECTION)
1011
1106
  }).shape
1012
1107
  );
1013
1108
  var ApprovedCorrectionAction = ActionBase.extend(
1014
- z13.object({
1015
- type: z13.literal(ActionType.APPROVE_CORRECTION),
1016
- requestId: z13.string(),
1109
+ z15.object({
1110
+ type: z15.literal(ActionType.APPROVE_CORRECTION),
1111
+ requestId: z15.string(),
1017
1112
  // TODO move into 'content' property
1018
- content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
1113
+ content: z15.object({ immediateCorrection: z15.boolean().optional() }).optional()
1019
1114
  }).shape
1020
1115
  );
1021
1116
  var RejectedCorrectionAction = ActionBase.extend(
1022
- z13.object({
1023
- type: z13.literal(ActionType.REJECT_CORRECTION),
1024
- requestId: z13.string(),
1117
+ z15.object({
1118
+ type: z15.literal(ActionType.REJECT_CORRECTION),
1119
+ requestId: z15.string(),
1025
1120
  // TODO move into 'content' property
1026
1121
  content: ReasonContent
1027
1122
  }).shape
1028
1123
  );
1029
1124
  var ReadAction = ActionBase.extend(
1030
- z13.object({
1031
- type: z13.literal(ActionType.READ)
1125
+ z15.object({
1126
+ type: z15.literal(ActionType.READ)
1032
1127
  }).shape
1033
1128
  );
1034
1129
  var CustomAction = ActionBase.merge(
1035
- z13.object({
1036
- type: z13.literal(ActionType.CUSTOM),
1037
- customActionType: z13.string()
1130
+ z15.object({
1131
+ type: z15.literal(ActionType.CUSTOM),
1132
+ customActionType: z15.string()
1038
1133
  })
1039
1134
  );
1040
- var ActionDocument = z13.discriminatedUnion("type", [
1135
+ var ActionDocument = z15.discriminatedUnion("type", [
1041
1136
  CreatedAction.meta({ id: "CreatedAction" }),
1042
1137
  RejectAction.meta({ id: "RejectAction" }),
1043
1138
  DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
@@ -1064,109 +1159,50 @@ var AsyncRejectActionDocument = ActionBase.omit({
1064
1159
  declaration: true,
1065
1160
  annotation: true
1066
1161
  }).extend(
1067
- z13.object({
1068
- type: z13.enum(ConfirmableActions),
1069
- status: z13.literal(ActionStatus.Rejected)
1162
+ z15.object({
1163
+ type: z15.enum(ConfirmableActions),
1164
+ status: z15.literal(ActionStatus.Rejected)
1070
1165
  }).shape
1071
1166
  );
1072
- var Action = z13.union([ActionDocument, AsyncRejectActionDocument]);
1073
-
1074
- // ../commons/src/events/Flag.ts
1075
- var z14 = __toESM(require("zod/v4"));
1076
- var InherentFlags = {
1077
- INCOMPLETE: "incomplete",
1078
- REJECTED: "rejected",
1079
- CORRECTION_REQUESTED: "correction-requested",
1080
- POTENTIAL_DUPLICATE: "potential-duplicate",
1081
- /**
1082
- * This flag is set by the Edit-action and removed after the declaration or registration.
1083
- * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
1084
- *
1085
- * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
1086
- */
1087
- EDIT_IN_PROGRESS: "edit-in-progress"
1088
- };
1089
- var ActionFlag = z14.string().regex(
1090
- new RegExp(
1091
- `^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
1092
- ActionStatus
1093
- ).join("|").toLowerCase()})$`
1094
- ),
1095
- "Flag must be in the format ActionType:ActionStatus (lowerCase)"
1096
- );
1097
- var CustomFlag = z14.string().refine((val) => !Object.values(InherentFlags).includes(val), {
1098
- message: `Custom flag cannot be one of the inherent flags: ${Object.values(
1099
- InherentFlags
1100
- ).join(", ")}`
1101
- }).refine((val) => !ActionFlag.safeParse(val).success, {
1102
- message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
1103
- }).describe("Custom flag identifier defined by the country config.");
1104
- var Flag = ActionFlag.or(z14.enum(InherentFlags)).or(CustomFlag);
1105
- var FlagConfig = z14.object({
1106
- id: CustomFlag,
1107
- requiresAction: z14.boolean().describe(
1108
- "Indicates if this flag expects an action to be performed to be cleared."
1109
- ),
1110
- label: TranslationConfig.describe("Human readable label of the flag.")
1111
- }).meta({
1112
- id: "FlagConfig",
1113
- description: "Configuration for a custom flag that can be added to or removed from records by event actions."
1114
- });
1115
- var ActionFlagConfig = z14.object({
1116
- id: Flag,
1117
- operation: z14.enum(["add", "remove"]).describe("Operation to perform on the flag."),
1118
- conditional: Conditional.optional().describe(
1119
- "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1120
- )
1121
- }).meta({
1122
- id: "ActionFlagConfig",
1123
- description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
1124
- });
1167
+ var Action = z15.union([ActionDocument, AsyncRejectActionDocument]);
1125
1168
 
1126
1169
  // ../commons/src/events/EventMetadata.ts
1127
- var EventStatus = z15.enum([
1128
- "CREATED",
1129
- "NOTIFIED",
1130
- "DECLARED",
1131
- "REGISTERED",
1132
- "ARCHIVED"
1133
- ]);
1134
- var ZodDate = z15.iso.date();
1135
- var ZodDateTime = z15.string().datetime();
1136
- var ActionCreationMetadata = z15.object({
1137
- createdAt: z15.iso.datetime().describe("The timestamp when the action request was created."),
1138
- 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."),
1139
1175
  // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1140
1176
  createdAtLocation: UUID.nullish().describe(
1141
1177
  "Location of the user who created the action request."
1142
1178
  ),
1143
- createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1144
- acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
1145
- 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.")
1146
1182
  });
1147
1183
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1148
- registrationNumber: z15.string().describe(
1184
+ registrationNumber: z16.string().describe(
1149
1185
  "Registration number of the event. Always present for accepted registrations."
1150
1186
  )
1151
1187
  });
1152
- var LegalStatuses = z15.object({
1188
+ var LegalStatuses = z16.object({
1153
1189
  [EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
1154
1190
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
1155
1191
  [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
1156
1192
  });
1157
- var EventMetadata = z15.object({
1193
+ var EventMetadata = z16.object({
1158
1194
  id: UUID,
1159
- 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."),
1160
1196
  status: EventStatus,
1161
1197
  legalStatuses: LegalStatuses.describe(
1162
1198
  "Metadata related to the legal registration of the event, such as who registered it and when."
1163
1199
  ),
1164
- 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."),
1165
1201
  dateOfEvent: ZodDate.nullish(),
1166
1202
  placeOfEvent: UUID.nullish(),
1167
- createdBy: z15.string().describe("ID of the user who created the event."),
1168
- createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1169
- 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."),
1170
1206
  // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1171
1207
  createdAtLocation: UUID.nullish().describe(
1172
1208
  "Location of the user who created the event."
@@ -1174,18 +1210,18 @@ var EventMetadata = z15.object({
1174
1210
  updatedAtLocation: UUID.nullish().describe(
1175
1211
  "Location of the user who last changed the status."
1176
1212
  ),
1177
- updatedAt: z15.iso.datetime().describe(
1213
+ updatedAt: z16.iso.datetime().describe(
1178
1214
  "Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
1179
1215
  ),
1180
- assignedTo: z15.string().nullish().describe("ID of the user currently assigned to the event."),
1181
- updatedBy: z15.string().nullish().describe("ID of the user who last changed the status."),
1182
- 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(
1183
1219
  "System-generated tracking ID used by informants or registrars to look up the event."
1184
1220
  ),
1185
- potentialDuplicates: z15.array(PotentialDuplicate).describe(
1221
+ potentialDuplicates: z16.array(PotentialDuplicate).describe(
1186
1222
  "List of event IDs and their tracking IDs that this event could be a duplicate of."
1187
1223
  ),
1188
- flags: z15.array(Flag)
1224
+ flags: z16.array(Flag)
1189
1225
  });
1190
1226
  var EventMetadataKeysArray = [
1191
1227
  "id",
@@ -1206,8 +1242,8 @@ var EventMetadataKeysArray = [
1206
1242
  "legalStatuses",
1207
1243
  "flags"
1208
1244
  ];
1209
- var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
1210
- var EventMetadataDateFieldIdInput = z15.enum([
1245
+ var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
1246
+ var EventMetadataDateFieldIdInput = z16.enum([
1211
1247
  "createdAt",
1212
1248
  "updatedAt",
1213
1249
  "legalStatuses.NOTIFIED.createdAt",
@@ -1217,7 +1253,7 @@ var EventMetadataDateFieldIdInput = z15.enum([
1217
1253
  "legalStatuses.REGISTERED.createdAt",
1218
1254
  "legalStatuses.REGISTERED.acceptedAt"
1219
1255
  ]);
1220
- var EventMetadataDateFieldId = z15.enum([
1256
+ var EventMetadataDateFieldId = z16.enum([
1221
1257
  "event.createdAt",
1222
1258
  "event.updatedAt",
1223
1259
  "event.legalStatuses.NOTIFIED.createdAt",
@@ -1282,13 +1318,6 @@ var Range = import_v4.z.object({
1282
1318
  }).meta({
1283
1319
  id: "Range"
1284
1320
  });
1285
- var ContainsFlags = import_v4.z.object({
1286
- anyOf: import_v4.z.array(Flag).optional(),
1287
- noneOf: import_v4.z.array(Flag).optional(),
1288
- allOf: import_v4.z.array(Flag).optional()
1289
- }).meta({
1290
- id: "ContainsFlags"
1291
- });
1292
1321
  var Within = import_v4.z.object({ type: import_v4.z.literal("within"), location: import_v4.z.string() }).meta({
1293
1322
  id: "Within"
1294
1323
  });
@@ -1483,8 +1512,8 @@ var BaseField = import_v43.default.object({
1483
1512
  conditionals: import_v43.default.array(FieldConditional).default([]).optional().describe(
1484
1513
  "Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
1485
1514
  ),
1486
- secured: import_v43.default.boolean().default(false).optional().describe(
1487
- "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."
1488
1517
  ),
1489
1518
  placeholder: TranslationConfig.optional(),
1490
1519
  validation: import_v43.default.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
@@ -1882,7 +1911,16 @@ var AdministrativeAreaField = BaseField.extend({
1882
1911
  configuration: import_v43.default.object({
1883
1912
  partOf: FieldReference.optional().describe("Parent location"),
1884
1913
  type: AdministrativeAreas,
1885
- 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
+ )
1886
1924
  }).describe("Administrative area options")
1887
1925
  }).meta({
1888
1926
  description: "Administrative area input field",
@@ -1893,7 +1931,16 @@ var LocationInput = BaseField.extend({
1893
1931
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1894
1932
  configuration: import_v43.default.object({
1895
1933
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
1896
- 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
+ )
1897
1944
  }).optional()
1898
1945
  }).meta({
1899
1946
  description: "A field for selecting a location",
@@ -1919,12 +1966,22 @@ var FileUploadWithOptions = BaseField.extend({
1919
1966
  var Facility = BaseField.extend({
1920
1967
  type: import_v43.default.literal(FieldType.FACILITY),
1921
1968
  defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1922
- 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()
1923
1975
  }).describe("Input field for a facility");
1924
1976
  var Office = BaseField.extend({
1925
1977
  type: import_v43.default.literal(FieldType.OFFICE),
1926
1978
  defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1927
- 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()
1928
1985
  }).describe("Input field for an office");
1929
1986
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
1930
1987
  administrativeArea: import_v43.default.union([UUID, SerializedUserField]).optional()
@@ -1957,7 +2014,16 @@ var Address = BaseField.extend({
1957
2014
  parent: FieldReference.optional()
1958
2015
  })
1959
2016
  ).optional(),
1960
- 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
+ )
1961
2027
  }).optional(),
1962
2028
  defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
1963
2029
  }).meta({
@@ -2258,7 +2324,7 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
2258
2324
  ]);
2259
2325
 
2260
2326
  // ../commons/src/application-config.ts
2261
- var SearchCriteria = z20.enum([
2327
+ var SearchCriteria = z21.enum([
2262
2328
  "TRACKING_ID",
2263
2329
  "REGISTRATION_NUMBER",
2264
2330
  "NATIONAL_ID",
@@ -2266,69 +2332,69 @@ var SearchCriteria = z20.enum([
2266
2332
  "PHONE_NUMBER",
2267
2333
  "EMAIL"
2268
2334
  ]);
2269
- var ApplicationConfig = z20.object({
2270
- APPLICATION_NAME: z20.string(),
2271
- COUNTRY_LOGO: z20.object({
2272
- fileName: z20.string(),
2273
- 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()
2274
2340
  }),
2275
- SYSTEM_IANA_TIMEZONE: z20.string(),
2276
- CURRENCY: z20.object({
2277
- languagesAndCountry: z20.array(z20.string()),
2278
- isoCode: z20.string()
2341
+ SYSTEM_IANA_TIMEZONE: z21.string(),
2342
+ CURRENCY: z21.object({
2343
+ languagesAndCountry: z21.array(z21.string()),
2344
+ isoCode: z21.string()
2279
2345
  }),
2280
- ADMIN_STRUCTURE: z20.array(
2281
- z20.object({
2282
- id: z20.string(),
2346
+ ADMIN_STRUCTURE: z21.array(
2347
+ z21.object({
2348
+ id: z21.string(),
2283
2349
  label: TranslationConfig
2284
2350
  })
2285
2351
  ),
2286
- PHONE_NUMBER_PATTERN: z20.string().or(z20.instanceof(RegExp)),
2287
- USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2288
- 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"]),
2289
2355
  SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
2290
- ADDITIONAL_USER_FIELDS: z20.array(FieldConfig).optional().default([])
2356
+ ADDITIONAL_USER_FIELDS: z21.array(FieldConfig).optional().default([])
2291
2357
  });
2292
2358
  var defineApplicationConfig = (config) => {
2293
2359
  return ApplicationConfig.parse(config);
2294
2360
  };
2295
- var BackgroundConfig = z20.object({
2296
- backgroundColor: z20.string().optional(),
2297
- backgroundImage: z20.string().optional(),
2298
- imageFit: z20.string().optional()
2361
+ var BackgroundConfig = z21.object({
2362
+ backgroundColor: z21.string().optional(),
2363
+ backgroundImage: z21.string().optional(),
2364
+ imageFit: z21.string().optional()
2299
2365
  }).refine(
2300
2366
  (data) => !!(data.backgroundColor || data.backgroundImage),
2301
2367
  "backgroundColor and backgroundImage cannot be empty at the same time"
2302
2368
  );
2303
- var LoginConfig = z20.object({
2304
- COUNTRY: z20.string(),
2305
- LANGUAGES: z20.array(z20.string()),
2306
- USER_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2307
- INFORMANT_NOTIFICATION_DELIVERY_METHOD: z20.enum(["email", "sms"]),
2308
- 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)),
2309
2375
  LOGIN_BACKGROUND: BackgroundConfig,
2310
- SENTRY: z20.string().optional()
2376
+ SENTRY: z21.string().optional()
2311
2377
  });
2312
2378
  var defineLoginConfig = (config) => {
2313
2379
  return LoginConfig.parse(config);
2314
2380
  };
2315
- var ClientConfig = z20.object({
2316
- COUNTRY: z20.string(),
2317
- LANGUAGES: z20.array(z20.string()),
2318
- SENTRY: z20.string().optional(),
2319
- 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(),
2320
2386
  REGISTER_BACKGROUND: BackgroundConfig,
2321
- DASHBOARDS: z20.array(
2322
- z20.object({
2323
- id: z20.string(),
2387
+ DASHBOARDS: z21.array(
2388
+ z21.object({
2389
+ id: z21.string(),
2324
2390
  title: TranslationConfig,
2325
- url: z20.string(),
2326
- context: z20.object({
2327
- auth: z20.literal("REQUEST_AUTH_TOKEN")
2391
+ url: z21.string(),
2392
+ context: z21.object({
2393
+ auth: z21.literal("REQUEST_AUTH_TOKEN")
2328
2394
  }).optional()
2329
2395
  })
2330
2396
  ),
2331
- 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 })
2332
2398
  });
2333
2399
  var defineClientConfig = (config) => {
2334
2400
  return ClientConfig.parse(config);