@opencrvs/toolkit 2.1.0-rc.5135dc7 → 2.1.0-rc.517ffcd
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/build.sh +3 -0
- package/create-countryconfig/index.js +114 -66
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +4 -1
- package/dist/application-config/index.js +242 -207
- package/dist/cli.js +556 -81
- package/dist/commons/api/router.d.ts +407 -50
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +6 -2
- 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 +12 -0
- package/dist/commons/events/EventDocument.d.ts +470 -2
- package/dist/commons/events/EventMetadata.d.ts +1 -11
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +18 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +15 -15
- package/dist/commons/events/locations.d.ts +59 -10
- package/dist/commons/events/test.utils.d.ts +8 -4
- package/dist/commons/events/utils.d.ts +2 -2
- package/dist/commons/notification/UserNotifications.d.ts +28 -13
- package/dist/commons/notification/dispatch.d.ts +15 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +77 -55
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +20 -14
- package/dist/environment/setup-environment.js +1 -1
- package/dist/events/index.js +839 -775
- 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 +530 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +469 -0
- package/dist/notification/index.js +911 -1359
- package/dist/scopes/index.d.ts +71 -1
- package/dist/scopes/index.js +77 -55
- package/dist/telemetry/index.d.ts +48 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +42 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +1 -1
- package/dist/templates/charts-values/opentelemetry/values.yaml +22 -0
- package/dist/templates/charts-values/traefik/values.yaml +23 -9
- package/dist/templates/inventory/inventory.template.yml +1 -3
- package/opencrvs-toolkit-2.1.0-rc.517ffcd.tgz +0 -0
- package/package.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- 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.5135dc7.tgz +0 -0
|
@@ -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
|
|
@@ -688,12 +688,22 @@ var ActionFlagConfig = z11.object({
|
|
|
688
688
|
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
689
689
|
});
|
|
690
690
|
|
|
691
|
+
// ../commons/src/events/EventStatus.ts
|
|
692
|
+
var z12 = __toESM(require("zod/v4"));
|
|
693
|
+
var EventStatus = z12.enum([
|
|
694
|
+
"CREATED",
|
|
695
|
+
"NOTIFIED",
|
|
696
|
+
"DECLARED",
|
|
697
|
+
"REGISTERED",
|
|
698
|
+
"ARCHIVED"
|
|
699
|
+
]);
|
|
700
|
+
|
|
691
701
|
// ../commons/src/scopes.ts
|
|
692
|
-
var JurisdictionFilter =
|
|
702
|
+
var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
|
|
693
703
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
694
704
|
);
|
|
695
|
-
var UserFilter =
|
|
696
|
-
var RecordScopeTypeV2 =
|
|
705
|
+
var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
706
|
+
var RecordScopeTypeV2 = z13.enum([
|
|
697
707
|
"record.search",
|
|
698
708
|
"record.create",
|
|
699
709
|
"record.read",
|
|
@@ -711,12 +721,17 @@ var RecordScopeTypeV2 = z12.enum([
|
|
|
711
721
|
"record.unassign-others",
|
|
712
722
|
"record.custom-action"
|
|
713
723
|
]);
|
|
714
|
-
var PlainScopeType =
|
|
724
|
+
var PlainScopeType = z13.enum([
|
|
715
725
|
// Misc. system scopes
|
|
716
726
|
"bypassratelimit",
|
|
717
727
|
"record.reindex",
|
|
718
728
|
"user.data-seeding",
|
|
719
729
|
"integration.create",
|
|
730
|
+
// Reading an integration's audit log. Deliberately separate from
|
|
731
|
+
// 'integration.create' so read-only oversight can be granted on its own, and
|
|
732
|
+
// deliberately option-less: system clients have no office and no
|
|
733
|
+
// administrative area, so jurisdiction options would have nothing to bind to.
|
|
734
|
+
"integration.audit.read",
|
|
720
735
|
"record.import",
|
|
721
736
|
"config.update-all",
|
|
722
737
|
"location.edit",
|
|
@@ -731,15 +746,21 @@ var PlainScopeType = z12.enum([
|
|
|
731
746
|
"record.confirm-registration",
|
|
732
747
|
"record.reject-registration"
|
|
733
748
|
]);
|
|
734
|
-
var scopeByEvent =
|
|
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."
|
|
@@ -823,38 +845,38 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
823
845
|
"record.unassign-others"
|
|
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",
|
|
@@ -1894,10 +1913,13 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
1894
1913
|
type: AdministrativeAreas,
|
|
1895
1914
|
allowedLocations: AllowedLocations,
|
|
1896
1915
|
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
1897
|
-
"
|
|
1916
|
+
"List every historical name a location has had as a separate, selectable option."
|
|
1898
1917
|
),
|
|
1899
1918
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1900
|
-
"
|
|
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."
|
|
1901
1923
|
)
|
|
1902
1924
|
}).describe("Administrative area options")
|
|
1903
1925
|
}).meta({
|
|
@@ -1911,7 +1933,13 @@ var LocationInput = BaseField.extend({
|
|
|
1911
1933
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1912
1934
|
allowedLocations: AllowedLocations,
|
|
1913
1935
|
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
1914
|
-
"
|
|
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."
|
|
1915
1943
|
)
|
|
1916
1944
|
}).optional()
|
|
1917
1945
|
}).meta({
|
|
@@ -1940,7 +1968,9 @@ var Facility = BaseField.extend({
|
|
|
1940
1968
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1941
1969
|
configuration: import_v43.default.object({
|
|
1942
1970
|
allowedLocations: AllowedLocations,
|
|
1943
|
-
listHistoricalNames: import_v43.default.boolean().optional()
|
|
1971
|
+
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
1972
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
1973
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
1944
1974
|
}).optional()
|
|
1945
1975
|
}).describe("Input field for a facility");
|
|
1946
1976
|
var Office = BaseField.extend({
|
|
@@ -1948,7 +1978,9 @@ var Office = BaseField.extend({
|
|
|
1948
1978
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1949
1979
|
configuration: import_v43.default.object({
|
|
1950
1980
|
allowedLocations: AllowedLocations,
|
|
1951
|
-
listHistoricalNames: import_v43.default.boolean().optional()
|
|
1981
|
+
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
1982
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
1983
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
1952
1984
|
}).optional()
|
|
1953
1985
|
}).describe("Input field for an office");
|
|
1954
1986
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -1984,10 +2016,13 @@ var Address = BaseField.extend({
|
|
|
1984
2016
|
).optional(),
|
|
1985
2017
|
allowedLocations: AllowedLocations,
|
|
1986
2018
|
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
1987
|
-
"
|
|
2019
|
+
"List every historical name a location has had as a separate, selectable option. Propagated to the embedded admin-area selectors."
|
|
1988
2020
|
),
|
|
1989
2021
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1990
|
-
"
|
|
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."
|
|
1991
2026
|
)
|
|
1992
2027
|
}).optional(),
|
|
1993
2028
|
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
@@ -2289,7 +2324,7 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
2289
2324
|
]);
|
|
2290
2325
|
|
|
2291
2326
|
// ../commons/src/application-config.ts
|
|
2292
|
-
var SearchCriteria =
|
|
2327
|
+
var SearchCriteria = z21.enum([
|
|
2293
2328
|
"TRACKING_ID",
|
|
2294
2329
|
"REGISTRATION_NUMBER",
|
|
2295
2330
|
"NATIONAL_ID",
|
|
@@ -2297,69 +2332,69 @@ var SearchCriteria = z20.enum([
|
|
|
2297
2332
|
"PHONE_NUMBER",
|
|
2298
2333
|
"EMAIL"
|
|
2299
2334
|
]);
|
|
2300
|
-
var ApplicationConfig =
|
|
2301
|
-
APPLICATION_NAME:
|
|
2302
|
-
COUNTRY_LOGO:
|
|
2303
|
-
fileName:
|
|
2304
|
-
file:
|
|
2335
|
+
var ApplicationConfig = z21.object({
|
|
2336
|
+
APPLICATION_NAME: z21.string(),
|
|
2337
|
+
COUNTRY_LOGO: z21.object({
|
|
2338
|
+
fileName: z21.string(),
|
|
2339
|
+
file: z21.string()
|
|
2305
2340
|
}),
|
|
2306
|
-
SYSTEM_IANA_TIMEZONE:
|
|
2307
|
-
CURRENCY:
|
|
2308
|
-
languagesAndCountry:
|
|
2309
|
-
isoCode:
|
|
2341
|
+
SYSTEM_IANA_TIMEZONE: z21.string(),
|
|
2342
|
+
CURRENCY: z21.object({
|
|
2343
|
+
languagesAndCountry: z21.array(z21.string()),
|
|
2344
|
+
isoCode: z21.string()
|
|
2310
2345
|
}),
|
|
2311
|
-
ADMIN_STRUCTURE:
|
|
2312
|
-
|
|
2313
|
-
id:
|
|
2346
|
+
ADMIN_STRUCTURE: z21.array(
|
|
2347
|
+
z21.object({
|
|
2348
|
+
id: z21.string(),
|
|
2314
2349
|
label: TranslationConfig
|
|
2315
2350
|
})
|
|
2316
2351
|
),
|
|
2317
|
-
PHONE_NUMBER_PATTERN:
|
|
2318
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2319
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
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"]),
|
|
2320
2355
|
SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
|
|
2321
|
-
ADDITIONAL_USER_FIELDS:
|
|
2356
|
+
ADDITIONAL_USER_FIELDS: z21.array(FieldConfig).optional().default([])
|
|
2322
2357
|
});
|
|
2323
2358
|
var defineApplicationConfig = (config) => {
|
|
2324
2359
|
return ApplicationConfig.parse(config);
|
|
2325
2360
|
};
|
|
2326
|
-
var BackgroundConfig =
|
|
2327
|
-
backgroundColor:
|
|
2328
|
-
backgroundImage:
|
|
2329
|
-
imageFit:
|
|
2361
|
+
var BackgroundConfig = z21.object({
|
|
2362
|
+
backgroundColor: z21.string().optional(),
|
|
2363
|
+
backgroundImage: z21.string().optional(),
|
|
2364
|
+
imageFit: z21.string().optional()
|
|
2330
2365
|
}).refine(
|
|
2331
2366
|
(data) => !!(data.backgroundColor || data.backgroundImage),
|
|
2332
2367
|
"backgroundColor and backgroundImage cannot be empty at the same time"
|
|
2333
2368
|
);
|
|
2334
|
-
var LoginConfig =
|
|
2335
|
-
COUNTRY:
|
|
2336
|
-
LANGUAGES:
|
|
2337
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2338
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2339
|
-
PHONE_NUMBER_PATTERN:
|
|
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)),
|
|
2340
2375
|
LOGIN_BACKGROUND: BackgroundConfig,
|
|
2341
|
-
SENTRY:
|
|
2376
|
+
SENTRY: z21.string().optional()
|
|
2342
2377
|
});
|
|
2343
2378
|
var defineLoginConfig = (config) => {
|
|
2344
2379
|
return LoginConfig.parse(config);
|
|
2345
2380
|
};
|
|
2346
|
-
var ClientConfig =
|
|
2347
|
-
COUNTRY:
|
|
2348
|
-
LANGUAGES:
|
|
2349
|
-
SENTRY:
|
|
2350
|
-
LOGIN_URL:
|
|
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(),
|
|
2351
2386
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2352
|
-
DASHBOARDS:
|
|
2353
|
-
|
|
2354
|
-
id:
|
|
2387
|
+
DASHBOARDS: z21.array(
|
|
2388
|
+
z21.object({
|
|
2389
|
+
id: z21.string(),
|
|
2355
2390
|
title: TranslationConfig,
|
|
2356
|
-
url:
|
|
2357
|
-
context:
|
|
2358
|
-
auth:
|
|
2391
|
+
url: z21.string(),
|
|
2392
|
+
context: z21.object({
|
|
2393
|
+
auth: z21.literal("REQUEST_AUTH_TOKEN")
|
|
2359
2394
|
}).optional()
|
|
2360
2395
|
})
|
|
2361
2396
|
),
|
|
2362
|
-
FEATURES:
|
|
2397
|
+
FEATURES: z21.object({ V2_EVENTS: z21.boolean().optional().default(true) }).optional().default({ V2_EVENTS: true })
|
|
2363
2398
|
});
|
|
2364
2399
|
var defineClientConfig = (config) => {
|
|
2365
2400
|
return ClientConfig.parse(config);
|