@opencrvs/toolkit 2.1.0-rc.d7bd264 → 2.1.0-rc.d987aec
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.
- package/README.md +3 -12
- package/build.sh +9 -1
- package/create-countryconfig/index.js +412 -59
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +4 -1
- package/dist/application-config/index.js +266 -212
- package/dist/authentication/index.d.ts +67 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +750 -0
- package/dist/cli.js +1786 -120
- package/dist/commons/api/router.d.ts +691 -76
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +15 -5
- package/dist/commons/events/ActionConfig.d.ts +0 -21
- package/dist/commons/events/ActionDocument.d.ts +4 -4
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/AdvancedSearchConfig.d.ts +18 -0
- package/dist/commons/events/AuditLog.d.ts +147 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +0 -18
- package/dist/commons/events/EventConfig.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +470 -2
- package/dist/commons/events/EventIndex.d.ts +2 -6
- package/dist/commons/events/EventMetadata.d.ts +1 -12
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +84 -53
- package/dist/commons/events/FieldTypeMapping.d.ts +15 -15
- package/dist/commons/events/FieldValue.d.ts +2 -2
- package/dist/commons/events/Flag.d.ts +0 -6
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +5 -17
- package/dist/commons/events/event.d.ts +12 -0
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +169 -26
- package/dist/commons/events/mocks.test.utils.d.ts +30 -0
- package/dist/commons/events/test.utils.d.ts +25 -4
- package/dist/commons/events/utils.d.ts +13 -2
- package/dist/commons/notification/UserNotifications.d.ts +28 -13
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +81 -59
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +10 -0
- package/dist/environment/logger.d.ts +15 -3
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/manage-users.js +1 -1
- package/dist/environment/paths.d.ts +7 -0
- package/dist/environment/paths.d.ts.map +1 -0
- package/dist/environment/paths.js +72 -0
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +20 -14
- package/dist/environment/setup-environment.js +28 -7
- package/dist/environment/templates.d.ts +0 -1
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +5 -9
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +17 -5
- package/dist/environment/upgrade.d.ts +2 -0
- package/dist/environment/upgrade.d.ts.map +1 -0
- package/dist/environment/upgrade.js +82 -0
- package/dist/environment/users.js +11 -13
- package/dist/events/index.js +2905 -2463
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +213 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +438 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +1058 -0
- package/dist/notification/index.js +1317 -1475
- package/dist/scopes/index.d.ts +104 -59
- package/dist/scopes/index.js +81 -59
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +39 -0
- package/dist/templates/charts-values/dependencies/values.yaml +2 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
- package/dist/templates/charts-values/opentelemetry/values.yaml +95 -0
- package/dist/templates/charts-values/traefik/values.yaml +23 -9
- package/dist/templates/inventory/inventory.template.yml +1 -3
- package/dist/translations/check.d.ts +21 -0
- package/dist/translations/check.d.ts.map +1 -0
- package/dist/translations/check.js +132 -0
- package/dist/verify/endpoints.d.ts +2 -0
- package/dist/verify/endpoints.d.ts.map +1 -0
- package/dist/verify/endpoints.js +345 -0
- package/opencrvs-toolkit-2.1.0-rc.d987aec.tgz +0 -0
- package/package.json +12 -6
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/dist/templates/inventory/production.example.yml +0 -77
- package/dist/templates/inventory/qa.example.yml +0 -48
- package/opencrvs-toolkit-2.1.0-rc.d7bd264.tgz +0 -0
- 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
|
|
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
|
|
500
|
+
var z16 = __toESM(require("zod/v4"));
|
|
501
501
|
|
|
502
502
|
// ../commons/src/events/ActionDocument.ts
|
|
503
|
-
var
|
|
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
|
|
615
|
+
var z14 = __toESM(require("zod/v4"));
|
|
616
616
|
|
|
617
617
|
// ../commons/src/scopes.ts
|
|
618
|
-
var
|
|
618
|
+
var z13 = __toESM(require("zod/v4"));
|
|
619
619
|
var qs = __toESM(require("qs"));
|
|
620
620
|
|
|
621
621
|
// ../commons/src/events/ActionStatus.ts
|
|
@@ -638,8 +638,7 @@ var InherentFlags = {
|
|
|
638
638
|
*
|
|
639
639
|
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
640
640
|
*/
|
|
641
|
-
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
642
|
-
SEALED: "sealed"
|
|
641
|
+
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
643
642
|
};
|
|
644
643
|
var actionFlagPattern;
|
|
645
644
|
function getActionFlagPattern() {
|
|
@@ -689,12 +688,22 @@ var ActionFlagConfig = z11.object({
|
|
|
689
688
|
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
690
689
|
});
|
|
691
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
|
+
|
|
692
701
|
// ../commons/src/scopes.ts
|
|
693
|
-
var JurisdictionFilter =
|
|
702
|
+
var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
|
|
694
703
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
695
704
|
);
|
|
696
|
-
var UserFilter =
|
|
697
|
-
var RecordScopeTypeV2 =
|
|
705
|
+
var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
706
|
+
var RecordScopeTypeV2 = z13.enum([
|
|
698
707
|
"record.search",
|
|
699
708
|
"record.create",
|
|
700
709
|
"record.read",
|
|
@@ -712,14 +721,20 @@ var RecordScopeTypeV2 = z12.enum([
|
|
|
712
721
|
"record.unassign-others",
|
|
713
722
|
"record.custom-action"
|
|
714
723
|
]);
|
|
715
|
-
var PlainScopeType =
|
|
724
|
+
var PlainScopeType = z13.enum([
|
|
716
725
|
// Misc. system scopes
|
|
717
726
|
"bypassratelimit",
|
|
718
727
|
"record.reindex",
|
|
719
728
|
"user.data-seeding",
|
|
720
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",
|
|
721
735
|
"record.import",
|
|
722
736
|
"config.update-all",
|
|
737
|
+
"location.edit",
|
|
723
738
|
"attachment.upload",
|
|
724
739
|
"profile.electronic-signature",
|
|
725
740
|
"user.read-only-my-audit",
|
|
@@ -731,15 +746,21 @@ var PlainScopeType = z12.enum([
|
|
|
731
746
|
"record.confirm-registration",
|
|
732
747
|
"record.reject-registration"
|
|
733
748
|
]);
|
|
734
|
-
var scopeByEvent =
|
|
749
|
+
var scopeByEvent = z13.preprocess(
|
|
735
750
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
736
|
-
|
|
751
|
+
z13.array(z13.string()).optional()
|
|
737
752
|
).describe("Event type, e.g. birth, death");
|
|
738
|
-
var
|
|
753
|
+
var scopeByStatus = z13.preprocess(
|
|
739
754
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
740
|
-
|
|
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 =
|
|
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:
|
|
782
|
+
customActionTypes: z13.preprocess(
|
|
761
783
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
762
|
-
|
|
784
|
+
z13.array(z13.string()).optional()
|
|
763
785
|
).describe("Allowed custom action types")
|
|
764
786
|
});
|
|
765
|
-
var AccessLevelOptions =
|
|
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 =
|
|
772
|
-
ids:
|
|
793
|
+
var WorkqueueOrDashboardOptions = z13.object({
|
|
794
|
+
ids: z13.preprocess(
|
|
773
795
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
774
|
-
|
|
796
|
+
z13.array(z13.string())
|
|
775
797
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
776
798
|
});
|
|
777
|
-
var AllScopeOptions =
|
|
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 =
|
|
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:
|
|
814
|
+
notifiedBy: z13.string().optional(),
|
|
793
815
|
declaredIn: UUID.nullish(),
|
|
794
|
-
declaredBy:
|
|
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:
|
|
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:
|
|
848
|
+
templates: z13.preprocess(
|
|
827
849
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
828
|
-
|
|
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 =
|
|
834
|
-
|
|
855
|
+
var RecordScopeV2 = z13.discriminatedUnion("type", [
|
|
856
|
+
z13.object({
|
|
835
857
|
type: ScopesWithPlaceEventOptions,
|
|
836
858
|
options: scopeOptionsPlaceEvent.optional()
|
|
837
859
|
}),
|
|
838
|
-
|
|
860
|
+
z13.object({
|
|
839
861
|
type: ScopesWithDeclaredOptions,
|
|
840
862
|
options: scopeOptionsDeclaredOrNotified.optional()
|
|
841
863
|
}),
|
|
842
|
-
|
|
864
|
+
z13.object({
|
|
843
865
|
type: ScopesWithFullOptions,
|
|
844
866
|
options: AllRecordScopeOptions.optional()
|
|
845
867
|
}),
|
|
846
|
-
|
|
847
|
-
type:
|
|
868
|
+
z13.object({
|
|
869
|
+
type: z13.literal("record.custom-action"),
|
|
848
870
|
options: CustomActionScopeOptions.optional()
|
|
849
871
|
}),
|
|
850
|
-
|
|
851
|
-
type:
|
|
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 =
|
|
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 =
|
|
872
|
-
|
|
893
|
+
var UserScopeV2 = z13.discriminatedUnion("type", [
|
|
894
|
+
z13.object({
|
|
873
895
|
type: ScopesWithRoleOption,
|
|
874
896
|
options: AllUserScopeOptions.optional()
|
|
875
897
|
}),
|
|
876
|
-
|
|
898
|
+
z13.object({
|
|
877
899
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
878
900
|
options: AccessLevelOptions.optional()
|
|
879
901
|
})
|
|
880
902
|
]);
|
|
881
|
-
var ResolvedRecordScopeV2 =
|
|
882
|
-
|
|
903
|
+
var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
|
|
904
|
+
z13.object({
|
|
883
905
|
type: ScopesWithPlaceEventOptions,
|
|
884
906
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
885
907
|
}),
|
|
886
|
-
|
|
908
|
+
z13.object({
|
|
887
909
|
type: ScopesWithDeclaredOptions,
|
|
888
910
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
889
911
|
}),
|
|
890
|
-
|
|
912
|
+
z13.object({
|
|
891
913
|
type: ScopesWithFullOptions,
|
|
892
914
|
options: ResolvedScopeOptionsFull.optional()
|
|
893
915
|
}),
|
|
894
|
-
|
|
895
|
-
type:
|
|
916
|
+
z13.object({
|
|
917
|
+
type: z13.literal("record.print-certified-copies"),
|
|
896
918
|
options: ResolvedScopeOptionsFull.extend({
|
|
897
|
-
templates:
|
|
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 =
|
|
902
|
-
|
|
923
|
+
var Scope = z13.discriminatedUnion("type", [
|
|
924
|
+
z13.object({ type: PlainScopeType }),
|
|
903
925
|
...RecordScopeV2.options,
|
|
904
926
|
...UserScopeV2.options,
|
|
905
|
-
|
|
906
|
-
type:
|
|
927
|
+
z13.object({
|
|
928
|
+
type: z13.literal("organisation.read-locations"),
|
|
907
929
|
options: AccessLevelOptions.optional()
|
|
908
930
|
}),
|
|
909
|
-
|
|
910
|
-
type:
|
|
931
|
+
z13.object({
|
|
932
|
+
type: z13.literal("workqueue"),
|
|
911
933
|
options: WorkqueueOrDashboardOptions
|
|
912
934
|
}),
|
|
913
|
-
|
|
914
|
-
type:
|
|
935
|
+
z13.object({
|
|
936
|
+
type: z13.literal("dashboard.view"),
|
|
915
937
|
options: WorkqueueOrDashboardOptions
|
|
916
938
|
})
|
|
917
939
|
]);
|
|
918
|
-
var ScopeType =
|
|
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 =
|
|
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 =
|
|
936
|
-
var TokenWithBearer =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
967
|
+
var ActionBase = z15.object({
|
|
946
968
|
id: UUID.describe("Unique identifier of the action."),
|
|
947
|
-
transactionId:
|
|
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:
|
|
952
|
-
createdBy:
|
|
953
|
-
createdByRole:
|
|
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:
|
|
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
|
-
|
|
978
|
-
type:
|
|
979
|
-
assignedTo:
|
|
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
|
-
|
|
985
|
-
type:
|
|
1006
|
+
z15.object({
|
|
1007
|
+
type: z15.literal(ActionType.UNASSIGN)
|
|
986
1008
|
}).shape
|
|
987
1009
|
);
|
|
988
1010
|
var RegisterAction = ActionBase.extend(
|
|
989
|
-
|
|
990
|
-
type:
|
|
991
|
-
registrationNumber:
|
|
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
|
-
|
|
999
|
-
type:
|
|
1020
|
+
z15.object({
|
|
1021
|
+
type: z15.literal(ActionType.DECLARE)
|
|
1000
1022
|
}).shape
|
|
1001
1023
|
);
|
|
1002
|
-
var ReasonContent =
|
|
1003
|
-
reason:
|
|
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
|
-
|
|
1009
|
-
type:
|
|
1030
|
+
z15.object({
|
|
1031
|
+
type: z15.literal(ActionType.REJECT),
|
|
1010
1032
|
content: ReasonContent
|
|
1011
1033
|
}).shape
|
|
1012
1034
|
);
|
|
1013
|
-
var PotentialDuplicate =
|
|
1035
|
+
var PotentialDuplicate = z15.object({
|
|
1014
1036
|
id: UUID,
|
|
1015
|
-
trackingId:
|
|
1037
|
+
trackingId: z15.string()
|
|
1016
1038
|
});
|
|
1017
1039
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
1018
|
-
|
|
1019
|
-
type:
|
|
1020
|
-
content:
|
|
1021
|
-
duplicates:
|
|
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
|
-
|
|
1027
|
-
type:
|
|
1048
|
+
z15.object({
|
|
1049
|
+
type: z15.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1028
1050
|
}).shape
|
|
1029
1051
|
);
|
|
1030
1052
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
1031
|
-
|
|
1032
|
-
type:
|
|
1033
|
-
content:
|
|
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
|
-
|
|
1040
|
-
type:
|
|
1041
|
-
|
|
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
|
-
|
|
1046
|
-
type:
|
|
1071
|
+
z15.object({
|
|
1072
|
+
type: z15.literal(ActionType.UNARCHIVE)
|
|
1047
1073
|
}).shape
|
|
1048
1074
|
);
|
|
1049
1075
|
var CreatedAction = ActionBase.extend(
|
|
1050
|
-
|
|
1051
|
-
type:
|
|
1076
|
+
z15.object({
|
|
1077
|
+
type: z15.literal(ActionType.CREATE)
|
|
1052
1078
|
}).shape
|
|
1053
1079
|
);
|
|
1054
1080
|
var NotifiedAction = ActionBase.extend(
|
|
1055
|
-
|
|
1056
|
-
type:
|
|
1081
|
+
z15.object({
|
|
1082
|
+
type: z15.literal(ActionType.NOTIFY)
|
|
1057
1083
|
}).shape
|
|
1058
1084
|
);
|
|
1059
1085
|
var EditAction = ActionBase.extend(
|
|
1060
|
-
|
|
1061
|
-
type:
|
|
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:
|
|
1064
|
-
comment:
|
|
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 =
|
|
1069
|
-
templateId:
|
|
1094
|
+
var PrintContent = z15.object({
|
|
1095
|
+
templateId: z15.string().optional()
|
|
1070
1096
|
});
|
|
1071
1097
|
var PrintCertificateAction = ActionBase.extend(
|
|
1072
|
-
|
|
1073
|
-
type:
|
|
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
|
-
|
|
1079
|
-
type:
|
|
1104
|
+
z15.object({
|
|
1105
|
+
type: z15.literal(ActionType.REQUEST_CORRECTION)
|
|
1080
1106
|
}).shape
|
|
1081
1107
|
);
|
|
1082
1108
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1083
|
-
|
|
1084
|
-
type:
|
|
1085
|
-
requestId:
|
|
1109
|
+
z15.object({
|
|
1110
|
+
type: z15.literal(ActionType.APPROVE_CORRECTION),
|
|
1111
|
+
requestId: z15.string(),
|
|
1086
1112
|
// TODO move into 'content' property
|
|
1087
|
-
content:
|
|
1113
|
+
content: z15.object({ immediateCorrection: z15.boolean().optional() }).optional()
|
|
1088
1114
|
}).shape
|
|
1089
1115
|
);
|
|
1090
1116
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1091
|
-
|
|
1092
|
-
type:
|
|
1093
|
-
requestId:
|
|
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
|
-
|
|
1100
|
-
type:
|
|
1125
|
+
z15.object({
|
|
1126
|
+
type: z15.literal(ActionType.READ)
|
|
1101
1127
|
}).shape
|
|
1102
1128
|
);
|
|
1103
1129
|
var CustomAction = ActionBase.merge(
|
|
1104
|
-
|
|
1105
|
-
type:
|
|
1106
|
-
customActionType:
|
|
1130
|
+
z15.object({
|
|
1131
|
+
type: z15.literal(ActionType.CUSTOM),
|
|
1132
|
+
customActionType: z15.string()
|
|
1107
1133
|
})
|
|
1108
1134
|
);
|
|
1109
|
-
var ActionDocument =
|
|
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
|
-
|
|
1137
|
-
type:
|
|
1138
|
-
status:
|
|
1162
|
+
z15.object({
|
|
1163
|
+
type: z15.enum(ConfirmableActions),
|
|
1164
|
+
status: z15.literal(ActionStatus.Rejected)
|
|
1139
1165
|
}).shape
|
|
1140
1166
|
);
|
|
1141
|
-
var Action =
|
|
1167
|
+
var Action = z15.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1142
1168
|
|
|
1143
1169
|
// ../commons/src/events/EventMetadata.ts
|
|
1144
|
-
var
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
"
|
|
1148
|
-
"
|
|
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:
|
|
1161
|
-
acceptedAt:
|
|
1162
|
-
createdByRole:
|
|
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:
|
|
1184
|
+
registrationNumber: z16.string().describe(
|
|
1166
1185
|
"Registration number of the event. Always present for accepted registrations."
|
|
1167
1186
|
)
|
|
1168
1187
|
});
|
|
1169
|
-
var LegalStatuses =
|
|
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 =
|
|
1193
|
+
var EventMetadata = z16.object({
|
|
1175
1194
|
id: UUID,
|
|
1176
|
-
type:
|
|
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:
|
|
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:
|
|
1185
|
-
createdByUserType:
|
|
1186
|
-
updatedByUserRole:
|
|
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:
|
|
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:
|
|
1198
|
-
updatedBy:
|
|
1199
|
-
trackingId:
|
|
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:
|
|
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:
|
|
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 =
|
|
1227
|
-
var EventMetadataDateFieldIdInput =
|
|
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 =
|
|
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,13 @@ 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
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1916
|
+
"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."
|
|
1917
|
+
),
|
|
1918
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
1919
|
+
"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."
|
|
1920
|
+
)
|
|
1896
1921
|
}).describe("Administrative area options")
|
|
1897
1922
|
}).meta({
|
|
1898
1923
|
description: "Administrative area input field",
|
|
@@ -1903,7 +1928,13 @@ var LocationInput = BaseField.extend({
|
|
|
1903
1928
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1904
1929
|
configuration: import_v43.default.object({
|
|
1905
1930
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1906
|
-
allowedLocations: AllowedLocations
|
|
1931
|
+
allowedLocations: AllowedLocations,
|
|
1932
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1933
|
+
"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."
|
|
1934
|
+
),
|
|
1935
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
1936
|
+
"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."
|
|
1937
|
+
)
|
|
1907
1938
|
}).optional()
|
|
1908
1939
|
}).meta({
|
|
1909
1940
|
description: "A field for selecting a location",
|
|
@@ -1929,12 +1960,20 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1929
1960
|
var Facility = BaseField.extend({
|
|
1930
1961
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1931
1962
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1932
|
-
configuration: import_v43.default.object({
|
|
1963
|
+
configuration: import_v43.default.object({
|
|
1964
|
+
allowedLocations: AllowedLocations,
|
|
1965
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
1966
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
1967
|
+
}).optional()
|
|
1933
1968
|
}).describe("Input field for a facility");
|
|
1934
1969
|
var Office = BaseField.extend({
|
|
1935
1970
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1936
1971
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1937
|
-
configuration: import_v43.default.object({
|
|
1972
|
+
configuration: import_v43.default.object({
|
|
1973
|
+
allowedLocations: AllowedLocations,
|
|
1974
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
1975
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
1976
|
+
}).optional()
|
|
1938
1977
|
}).describe("Input field for an office");
|
|
1939
1978
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1940
1979
|
administrativeArea: import_v43.default.union([UUID, SerializedUserField]).optional()
|
|
@@ -1967,7 +2006,13 @@ var Address = BaseField.extend({
|
|
|
1967
2006
|
parent: FieldReference.optional()
|
|
1968
2007
|
})
|
|
1969
2008
|
).optional(),
|
|
1970
|
-
allowedLocations: AllowedLocations
|
|
2009
|
+
allowedLocations: AllowedLocations,
|
|
2010
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2011
|
+
"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."
|
|
2012
|
+
),
|
|
2013
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
2014
|
+
"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."
|
|
2015
|
+
)
|
|
1971
2016
|
}).optional(),
|
|
1972
2017
|
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1973
2018
|
}).meta({
|
|
@@ -2022,10 +2067,19 @@ var ButtonField = BaseField.extend({
|
|
|
2022
2067
|
description: "A generic button that can be used to trigger an action",
|
|
2023
2068
|
id: "ButtonField"
|
|
2024
2069
|
});
|
|
2070
|
+
var FieldGroupConfiguration = import_v43.default.object({
|
|
2071
|
+
separator: import_v43.default.string().optional().describe(
|
|
2072
|
+
'Joins the subfield values when the group is rendered as output, e.g. ", ". Defaults to one subfield per line.'
|
|
2073
|
+
),
|
|
2074
|
+
hideEmptyFields: import_v43.default.boolean().default(false).optional().describe(
|
|
2075
|
+
"Leaves subfields without a value out of the output. Pair it with a separator so the separator does not double up around the gaps."
|
|
2076
|
+
)
|
|
2077
|
+
});
|
|
2025
2078
|
var FieldGroup = BaseField.extend({
|
|
2026
2079
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2027
2080
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2028
|
-
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2081
|
+
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig)),
|
|
2082
|
+
configuration: FieldGroupConfiguration.optional()
|
|
2029
2083
|
}).meta({
|
|
2030
2084
|
description: "A group of fields that are displayed together",
|
|
2031
2085
|
id: "FieldGroup"
|
|
@@ -2268,7 +2322,7 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
2268
2322
|
]);
|
|
2269
2323
|
|
|
2270
2324
|
// ../commons/src/application-config.ts
|
|
2271
|
-
var SearchCriteria =
|
|
2325
|
+
var SearchCriteria = z21.enum([
|
|
2272
2326
|
"TRACKING_ID",
|
|
2273
2327
|
"REGISTRATION_NUMBER",
|
|
2274
2328
|
"NATIONAL_ID",
|
|
@@ -2276,69 +2330,69 @@ var SearchCriteria = z20.enum([
|
|
|
2276
2330
|
"PHONE_NUMBER",
|
|
2277
2331
|
"EMAIL"
|
|
2278
2332
|
]);
|
|
2279
|
-
var ApplicationConfig =
|
|
2280
|
-
APPLICATION_NAME:
|
|
2281
|
-
COUNTRY_LOGO:
|
|
2282
|
-
fileName:
|
|
2283
|
-
file:
|
|
2333
|
+
var ApplicationConfig = z21.object({
|
|
2334
|
+
APPLICATION_NAME: z21.string(),
|
|
2335
|
+
COUNTRY_LOGO: z21.object({
|
|
2336
|
+
fileName: z21.string(),
|
|
2337
|
+
file: z21.string()
|
|
2284
2338
|
}),
|
|
2285
|
-
SYSTEM_IANA_TIMEZONE:
|
|
2286
|
-
CURRENCY:
|
|
2287
|
-
languagesAndCountry:
|
|
2288
|
-
isoCode:
|
|
2339
|
+
SYSTEM_IANA_TIMEZONE: z21.string(),
|
|
2340
|
+
CURRENCY: z21.object({
|
|
2341
|
+
languagesAndCountry: z21.array(z21.string()),
|
|
2342
|
+
isoCode: z21.string()
|
|
2289
2343
|
}),
|
|
2290
|
-
ADMIN_STRUCTURE:
|
|
2291
|
-
|
|
2292
|
-
id:
|
|
2344
|
+
ADMIN_STRUCTURE: z21.array(
|
|
2345
|
+
z21.object({
|
|
2346
|
+
id: z21.string(),
|
|
2293
2347
|
label: TranslationConfig
|
|
2294
2348
|
})
|
|
2295
2349
|
),
|
|
2296
|
-
PHONE_NUMBER_PATTERN:
|
|
2297
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2298
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2350
|
+
PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
|
|
2351
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2352
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2299
2353
|
SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
|
|
2300
|
-
ADDITIONAL_USER_FIELDS:
|
|
2354
|
+
ADDITIONAL_USER_FIELDS: z21.array(FieldConfig).optional().default([])
|
|
2301
2355
|
});
|
|
2302
2356
|
var defineApplicationConfig = (config) => {
|
|
2303
2357
|
return ApplicationConfig.parse(config);
|
|
2304
2358
|
};
|
|
2305
|
-
var BackgroundConfig =
|
|
2306
|
-
backgroundColor:
|
|
2307
|
-
backgroundImage:
|
|
2308
|
-
imageFit:
|
|
2359
|
+
var BackgroundConfig = z21.object({
|
|
2360
|
+
backgroundColor: z21.string().optional(),
|
|
2361
|
+
backgroundImage: z21.string().optional(),
|
|
2362
|
+
imageFit: z21.string().optional()
|
|
2309
2363
|
}).refine(
|
|
2310
2364
|
(data) => !!(data.backgroundColor || data.backgroundImage),
|
|
2311
2365
|
"backgroundColor and backgroundImage cannot be empty at the same time"
|
|
2312
2366
|
);
|
|
2313
|
-
var LoginConfig =
|
|
2314
|
-
COUNTRY:
|
|
2315
|
-
LANGUAGES:
|
|
2316
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2317
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2318
|
-
PHONE_NUMBER_PATTERN:
|
|
2367
|
+
var LoginConfig = z21.object({
|
|
2368
|
+
COUNTRY: z21.string(),
|
|
2369
|
+
LANGUAGES: z21.array(z21.string()),
|
|
2370
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2371
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2372
|
+
PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
|
|
2319
2373
|
LOGIN_BACKGROUND: BackgroundConfig,
|
|
2320
|
-
SENTRY:
|
|
2374
|
+
SENTRY: z21.string().optional()
|
|
2321
2375
|
});
|
|
2322
2376
|
var defineLoginConfig = (config) => {
|
|
2323
2377
|
return LoginConfig.parse(config);
|
|
2324
2378
|
};
|
|
2325
|
-
var ClientConfig =
|
|
2326
|
-
COUNTRY:
|
|
2327
|
-
LANGUAGES:
|
|
2328
|
-
SENTRY:
|
|
2329
|
-
LOGIN_URL:
|
|
2379
|
+
var ClientConfig = z21.object({
|
|
2380
|
+
COUNTRY: z21.string(),
|
|
2381
|
+
LANGUAGES: z21.array(z21.string()),
|
|
2382
|
+
SENTRY: z21.string().optional(),
|
|
2383
|
+
LOGIN_URL: z21.string().optional(),
|
|
2330
2384
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2331
|
-
DASHBOARDS:
|
|
2332
|
-
|
|
2333
|
-
id:
|
|
2385
|
+
DASHBOARDS: z21.array(
|
|
2386
|
+
z21.object({
|
|
2387
|
+
id: z21.string(),
|
|
2334
2388
|
title: TranslationConfig,
|
|
2335
|
-
url:
|
|
2336
|
-
context:
|
|
2337
|
-
auth:
|
|
2389
|
+
url: z21.string(),
|
|
2390
|
+
context: z21.object({
|
|
2391
|
+
auth: z21.literal("REQUEST_AUTH_TOKEN")
|
|
2338
2392
|
}).optional()
|
|
2339
2393
|
})
|
|
2340
2394
|
),
|
|
2341
|
-
FEATURES:
|
|
2395
|
+
FEATURES: z21.object({ V2_EVENTS: z21.boolean().optional().default(true) }).optional().default({ V2_EVENTS: true })
|
|
2342
2396
|
});
|
|
2343
2397
|
var defineClientConfig = (config) => {
|
|
2344
2398
|
return ClientConfig.parse(config);
|