@opencrvs/toolkit 2.1.0-rc.f29a266 → 2.1.0-rc.f5ea803
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.sh +9 -1
- package/create-countryconfig/index.js +176 -2
- package/dist/application-config/index.js +211 -201
- 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 +1587 -69
- package/dist/commons/api/router.d.ts +4 -4
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
- package/dist/commons/events/EventDocument.d.ts +468 -0
- 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 +5 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +15 -15
- package/dist/commons/events/locations.d.ts +2 -2
- package/dist/commons/notification/UserNotifications.d.ts +0 -13
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +74 -57
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/events/index.js +760 -743
- 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 +855 -815
- package/dist/scopes/index.d.ts +74 -6
- package/dist/scopes/index.js +74 -57
- 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/translations/check.d.ts +19 -0
- package/dist/translations/check.d.ts.map +1 -0
- package/dist/translations/check.js +127 -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.f5ea803.tgz +0 -0
- package/package.json +8 -3
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/opencrvs-toolkit-2.1.0-rc.f29a266.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
package/dist/events/index.js
CHANGED
|
@@ -118,6 +118,7 @@ __export(events_exports, {
|
|
|
118
118
|
EnableConditional: () => EnableConditional,
|
|
119
119
|
EventConfig: () => EventConfig,
|
|
120
120
|
EventDocument: () => EventDocument,
|
|
121
|
+
EventDocumentOnlyLastAction: () => EventDocumentOnlyLastAction,
|
|
121
122
|
EventFieldConfigSchema: () => EventFieldConfigSchema,
|
|
122
123
|
EventFieldId: () => EventFieldId,
|
|
123
124
|
EventFieldIdInput: () => EventFieldIdInput,
|
|
@@ -477,14 +478,14 @@ __export(events_exports, {
|
|
|
477
478
|
module.exports = __toCommonJS(events_exports);
|
|
478
479
|
|
|
479
480
|
// ../commons/src/events/AuditLog.ts
|
|
480
|
-
var
|
|
481
|
+
var z9 = __toESM(require("zod/v4"));
|
|
481
482
|
|
|
482
483
|
// ../commons/src/authentication.ts
|
|
483
484
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
484
|
-
var
|
|
485
|
+
var z8 = __toESM(require("zod/v4"));
|
|
485
486
|
|
|
486
487
|
// ../commons/src/scopes.ts
|
|
487
|
-
var
|
|
488
|
+
var z7 = __toESM(require("zod/v4"));
|
|
488
489
|
var qs = __toESM(require("qs"));
|
|
489
490
|
|
|
490
491
|
// ../commons/src/uuid.ts
|
|
@@ -746,12 +747,22 @@ var ActionFlagConfig = z5.object({
|
|
|
746
747
|
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
747
748
|
});
|
|
748
749
|
|
|
750
|
+
// ../commons/src/events/EventStatus.ts
|
|
751
|
+
var z6 = __toESM(require("zod/v4"));
|
|
752
|
+
var EventStatus = z6.enum([
|
|
753
|
+
"CREATED",
|
|
754
|
+
"NOTIFIED",
|
|
755
|
+
"DECLARED",
|
|
756
|
+
"REGISTERED",
|
|
757
|
+
"ARCHIVED"
|
|
758
|
+
]);
|
|
759
|
+
|
|
749
760
|
// ../commons/src/scopes.ts
|
|
750
|
-
var JurisdictionFilter =
|
|
761
|
+
var JurisdictionFilter = z7.enum(["administrativeArea", "location", "all"]).describe(
|
|
751
762
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
752
763
|
);
|
|
753
|
-
var UserFilter =
|
|
754
|
-
var RecordScopeTypeV2 =
|
|
764
|
+
var UserFilter = z7.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
765
|
+
var RecordScopeTypeV2 = z7.enum([
|
|
755
766
|
"record.search",
|
|
756
767
|
"record.create",
|
|
757
768
|
"record.read",
|
|
@@ -769,7 +780,7 @@ var RecordScopeTypeV2 = z6.enum([
|
|
|
769
780
|
"record.unassign-others",
|
|
770
781
|
"record.custom-action"
|
|
771
782
|
]);
|
|
772
|
-
var PlainScopeType =
|
|
783
|
+
var PlainScopeType = z7.enum([
|
|
773
784
|
// Misc. system scopes
|
|
774
785
|
"bypassratelimit",
|
|
775
786
|
"record.reindex",
|
|
@@ -794,15 +805,21 @@ var PlainScopeType = z6.enum([
|
|
|
794
805
|
"record.confirm-registration",
|
|
795
806
|
"record.reject-registration"
|
|
796
807
|
]);
|
|
797
|
-
var scopeByEvent =
|
|
808
|
+
var scopeByEvent = z7.preprocess(
|
|
798
809
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
799
|
-
|
|
810
|
+
z7.array(z7.string()).optional()
|
|
800
811
|
).describe("Event type, e.g. birth, death");
|
|
801
|
-
var
|
|
812
|
+
var scopeByStatus = z7.preprocess(
|
|
802
813
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
803
|
-
|
|
814
|
+
z7.array(EventStatus).optional()
|
|
815
|
+
).describe(
|
|
816
|
+
"Restricts the scope to records currently in one of these statuses."
|
|
817
|
+
);
|
|
818
|
+
var userRole = z7.preprocess(
|
|
819
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
820
|
+
z7.array(z7.string()).optional()
|
|
804
821
|
).describe("User role, e.g. admin, field agent");
|
|
805
|
-
var scopeOptionsPlaceEvent =
|
|
822
|
+
var scopeOptionsPlaceEvent = z7.object({
|
|
806
823
|
event: scopeByEvent,
|
|
807
824
|
placeOfEvent: JurisdictionFilter.optional()
|
|
808
825
|
}).describe("Options applicable to all record scopes.");
|
|
@@ -810,7 +827,8 @@ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
|
810
827
|
notifiedIn: JurisdictionFilter.optional(),
|
|
811
828
|
notifiedBy: UserFilter.optional(),
|
|
812
829
|
declaredIn: JurisdictionFilter.optional(),
|
|
813
|
-
declaredBy: UserFilter.optional()
|
|
830
|
+
declaredBy: UserFilter.optional(),
|
|
831
|
+
status: scopeByStatus
|
|
814
832
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
815
833
|
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
816
834
|
registeredIn: JurisdictionFilter.optional(),
|
|
@@ -820,31 +838,31 @@ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
|
820
838
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
821
839
|
);
|
|
822
840
|
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
823
|
-
customActionTypes:
|
|
841
|
+
customActionTypes: z7.preprocess(
|
|
824
842
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
825
|
-
|
|
843
|
+
z7.array(z7.string()).optional()
|
|
826
844
|
).describe("Allowed custom action types")
|
|
827
845
|
});
|
|
828
|
-
var AccessLevelOptions =
|
|
846
|
+
var AccessLevelOptions = z7.object({
|
|
829
847
|
accessLevel: JurisdictionFilter.optional()
|
|
830
848
|
});
|
|
831
849
|
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
832
850
|
role: userRole.optional()
|
|
833
851
|
});
|
|
834
|
-
var WorkqueueOrDashboardOptions =
|
|
835
|
-
ids:
|
|
852
|
+
var WorkqueueOrDashboardOptions = z7.object({
|
|
853
|
+
ids: z7.preprocess(
|
|
836
854
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
837
|
-
|
|
855
|
+
z7.array(z7.string())
|
|
838
856
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
839
857
|
});
|
|
840
|
-
var AllScopeOptions =
|
|
858
|
+
var AllScopeOptions = z7.object({
|
|
841
859
|
...AllRecordScopeOptions.shape,
|
|
842
860
|
...AccessLevelOptions.shape,
|
|
843
861
|
...AllUserScopeOptions.shape,
|
|
844
862
|
...WorkqueueOrDashboardOptions.shape
|
|
845
863
|
});
|
|
846
864
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
847
|
-
var ResolvedScopeOptionsPlaceEvent =
|
|
865
|
+
var ResolvedScopeOptionsPlaceEvent = z7.object({
|
|
848
866
|
event: scopeByEvent,
|
|
849
867
|
placeOfEvent: UUID.nullish()
|
|
850
868
|
}).describe(
|
|
@@ -852,15 +870,15 @@ var ResolvedScopeOptionsPlaceEvent = z6.object({
|
|
|
852
870
|
);
|
|
853
871
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
854
872
|
notifiedIn: UUID.nullish(),
|
|
855
|
-
notifiedBy:
|
|
873
|
+
notifiedBy: z7.string().optional(),
|
|
856
874
|
declaredIn: UUID.nullish(),
|
|
857
|
-
declaredBy:
|
|
875
|
+
declaredBy: z7.string().optional()
|
|
858
876
|
}).describe(
|
|
859
877
|
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
860
878
|
);
|
|
861
879
|
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
862
880
|
registeredIn: UUID.nullish(),
|
|
863
|
-
registeredBy:
|
|
881
|
+
registeredBy: z7.string().optional(),
|
|
864
882
|
flags: ContainsFlags.optional()
|
|
865
883
|
}).describe(
|
|
866
884
|
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
@@ -875,7 +893,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
875
893
|
"record.reject",
|
|
876
894
|
"record.archive",
|
|
877
895
|
"record.unarchive",
|
|
878
|
-
"record.review-duplicates",
|
|
879
896
|
"record.register"
|
|
880
897
|
]);
|
|
881
898
|
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
@@ -883,41 +900,42 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
883
900
|
"record.read",
|
|
884
901
|
"record.request-correction",
|
|
885
902
|
"record.correct",
|
|
886
|
-
"record.unassign-others"
|
|
903
|
+
"record.unassign-others",
|
|
904
|
+
"record.review-duplicates"
|
|
887
905
|
]);
|
|
888
906
|
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
889
|
-
templates:
|
|
907
|
+
templates: z7.preprocess(
|
|
890
908
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
891
|
-
|
|
909
|
+
z7.array(z7.string()).optional()
|
|
892
910
|
).describe(
|
|
893
911
|
"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."
|
|
894
912
|
)
|
|
895
913
|
});
|
|
896
|
-
var RecordScopeV2 =
|
|
897
|
-
|
|
914
|
+
var RecordScopeV2 = z7.discriminatedUnion("type", [
|
|
915
|
+
z7.object({
|
|
898
916
|
type: ScopesWithPlaceEventOptions,
|
|
899
917
|
options: scopeOptionsPlaceEvent.optional()
|
|
900
918
|
}),
|
|
901
|
-
|
|
919
|
+
z7.object({
|
|
902
920
|
type: ScopesWithDeclaredOptions,
|
|
903
921
|
options: scopeOptionsDeclaredOrNotified.optional()
|
|
904
922
|
}),
|
|
905
|
-
|
|
923
|
+
z7.object({
|
|
906
924
|
type: ScopesWithFullOptions,
|
|
907
925
|
options: AllRecordScopeOptions.optional()
|
|
908
926
|
}),
|
|
909
|
-
|
|
910
|
-
type:
|
|
927
|
+
z7.object({
|
|
928
|
+
type: z7.literal("record.custom-action"),
|
|
911
929
|
options: CustomActionScopeOptions.optional()
|
|
912
930
|
}),
|
|
913
|
-
|
|
914
|
-
type:
|
|
931
|
+
z7.object({
|
|
932
|
+
type: z7.literal("record.print-certified-copies"),
|
|
915
933
|
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
916
934
|
})
|
|
917
935
|
]).describe(
|
|
918
936
|
"Scopes used to check user's permission to perform actions on a record."
|
|
919
937
|
);
|
|
920
|
-
var SystemScopeType =
|
|
938
|
+
var SystemScopeType = z7.enum([
|
|
921
939
|
"organisation.read-locations",
|
|
922
940
|
"user.read",
|
|
923
941
|
"user.create",
|
|
@@ -931,12 +949,12 @@ var UserScopeType = SystemScopeType.extract([
|
|
|
931
949
|
"user.search"
|
|
932
950
|
]);
|
|
933
951
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
934
|
-
var UserScopeV2 =
|
|
935
|
-
|
|
952
|
+
var UserScopeV2 = z7.discriminatedUnion("type", [
|
|
953
|
+
z7.object({
|
|
936
954
|
type: ScopesWithRoleOption,
|
|
937
955
|
options: AllUserScopeOptions.optional()
|
|
938
956
|
}),
|
|
939
|
-
|
|
957
|
+
z7.object({
|
|
940
958
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
941
959
|
options: AccessLevelOptions.optional()
|
|
942
960
|
})
|
|
@@ -956,44 +974,44 @@ function scopeUsesPrintCertifiedCopiesOptions(scope) {
|
|
|
956
974
|
function isCustomActionScope(scope) {
|
|
957
975
|
return scope.type === "record.custom-action";
|
|
958
976
|
}
|
|
959
|
-
var ResolvedRecordScopeV2 =
|
|
960
|
-
|
|
977
|
+
var ResolvedRecordScopeV2 = z7.discriminatedUnion("type", [
|
|
978
|
+
z7.object({
|
|
961
979
|
type: ScopesWithPlaceEventOptions,
|
|
962
980
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
963
981
|
}),
|
|
964
|
-
|
|
982
|
+
z7.object({
|
|
965
983
|
type: ScopesWithDeclaredOptions,
|
|
966
984
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
967
985
|
}),
|
|
968
|
-
|
|
986
|
+
z7.object({
|
|
969
987
|
type: ScopesWithFullOptions,
|
|
970
988
|
options: ResolvedScopeOptionsFull.optional()
|
|
971
989
|
}),
|
|
972
|
-
|
|
973
|
-
type:
|
|
990
|
+
z7.object({
|
|
991
|
+
type: z7.literal("record.print-certified-copies"),
|
|
974
992
|
options: ResolvedScopeOptionsFull.extend({
|
|
975
|
-
templates:
|
|
993
|
+
templates: z7.array(z7.string()).optional()
|
|
976
994
|
}).optional()
|
|
977
995
|
})
|
|
978
996
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
979
|
-
var Scope =
|
|
980
|
-
|
|
997
|
+
var Scope = z7.discriminatedUnion("type", [
|
|
998
|
+
z7.object({ type: PlainScopeType }),
|
|
981
999
|
...RecordScopeV2.options,
|
|
982
1000
|
...UserScopeV2.options,
|
|
983
|
-
|
|
984
|
-
type:
|
|
1001
|
+
z7.object({
|
|
1002
|
+
type: z7.literal("organisation.read-locations"),
|
|
985
1003
|
options: AccessLevelOptions.optional()
|
|
986
1004
|
}),
|
|
987
|
-
|
|
988
|
-
type:
|
|
1005
|
+
z7.object({
|
|
1006
|
+
type: z7.literal("workqueue"),
|
|
989
1007
|
options: WorkqueueOrDashboardOptions
|
|
990
1008
|
}),
|
|
991
|
-
|
|
992
|
-
type:
|
|
1009
|
+
z7.object({
|
|
1010
|
+
type: z7.literal("dashboard.view"),
|
|
993
1011
|
options: WorkqueueOrDashboardOptions
|
|
994
1012
|
})
|
|
995
1013
|
]);
|
|
996
|
-
var ScopeType =
|
|
1014
|
+
var ScopeType = z7.enum([
|
|
997
1015
|
...SystemScopeType.options,
|
|
998
1016
|
...RecordScopeTypeV2.options,
|
|
999
1017
|
...PlainScopeType.options,
|
|
@@ -1004,7 +1022,7 @@ var unflattenScope = (input) => {
|
|
|
1004
1022
|
const { type, ...options } = input;
|
|
1005
1023
|
return { type, options };
|
|
1006
1024
|
};
|
|
1007
|
-
var EncodedScope =
|
|
1025
|
+
var EncodedScope = z7.string().brand("EncodedScope");
|
|
1008
1026
|
var decodedScopeCache = /* @__PURE__ */ new Map();
|
|
1009
1027
|
var decodeScope = (encodedScope) => {
|
|
1010
1028
|
if (decodedScopeCache.has(encodedScope)) {
|
|
@@ -1040,51 +1058,51 @@ function getAcceptedScopesByType({
|
|
|
1040
1058
|
}
|
|
1041
1059
|
|
|
1042
1060
|
// ../commons/src/authentication.ts
|
|
1043
|
-
var TokenUserType =
|
|
1044
|
-
var TokenWithBearer =
|
|
1061
|
+
var TokenUserType = z8.enum(["user", "system"]);
|
|
1062
|
+
var TokenWithBearer = z8.string().regex(/^Bearer\s/);
|
|
1045
1063
|
|
|
1046
1064
|
// ../commons/src/events/AuditLog.ts
|
|
1047
|
-
var AuditLogEntryBase =
|
|
1048
|
-
id:
|
|
1049
|
-
clientId:
|
|
1065
|
+
var AuditLogEntryBase = z9.object({
|
|
1066
|
+
id: z9.string(),
|
|
1067
|
+
clientId: z9.string(),
|
|
1050
1068
|
clientType: TokenUserType,
|
|
1051
|
-
createdAt:
|
|
1069
|
+
createdAt: z9.string()
|
|
1052
1070
|
});
|
|
1053
1071
|
var EventCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1054
|
-
operation:
|
|
1055
|
-
requestData:
|
|
1056
|
-
transactionId:
|
|
1057
|
-
type:
|
|
1058
|
-
createdAtLocation:
|
|
1072
|
+
operation: z9.literal("event.create"),
|
|
1073
|
+
requestData: z9.object({
|
|
1074
|
+
transactionId: z9.string(),
|
|
1075
|
+
type: z9.string(),
|
|
1076
|
+
createdAtLocation: z9.string().nullable()
|
|
1059
1077
|
}),
|
|
1060
|
-
responseSummary:
|
|
1061
|
-
eventId:
|
|
1062
|
-
trackingId:
|
|
1078
|
+
responseSummary: z9.object({
|
|
1079
|
+
eventId: z9.string(),
|
|
1080
|
+
trackingId: z9.string()
|
|
1063
1081
|
})
|
|
1064
1082
|
});
|
|
1065
1083
|
var EventGetEntrySchema = AuditLogEntryBase.extend({
|
|
1066
|
-
operation:
|
|
1067
|
-
requestData:
|
|
1068
|
-
responseSummary:
|
|
1069
|
-
eventType:
|
|
1070
|
-
trackingId:
|
|
1084
|
+
operation: z9.literal("event.get"),
|
|
1085
|
+
requestData: z9.object({ eventId: z9.string() }),
|
|
1086
|
+
responseSummary: z9.object({
|
|
1087
|
+
eventType: z9.string(),
|
|
1088
|
+
trackingId: z9.string()
|
|
1071
1089
|
})
|
|
1072
1090
|
});
|
|
1073
1091
|
var EventSearchEntrySchema = AuditLogEntryBase.extend({
|
|
1074
|
-
operation:
|
|
1075
|
-
clientType:
|
|
1076
|
-
requestData:
|
|
1077
|
-
query:
|
|
1078
|
-
limit:
|
|
1079
|
-
offset:
|
|
1092
|
+
operation: z9.literal("event.search"),
|
|
1093
|
+
clientType: z9.literal("system"),
|
|
1094
|
+
requestData: z9.object({
|
|
1095
|
+
query: z9.record(z9.string(), z9.unknown()).nullable(),
|
|
1096
|
+
limit: z9.number().nullable(),
|
|
1097
|
+
offset: z9.number().nullable()
|
|
1080
1098
|
}),
|
|
1081
|
-
responseSummary:
|
|
1082
|
-
total:
|
|
1083
|
-
eventIds:
|
|
1099
|
+
responseSummary: z9.object({
|
|
1100
|
+
total: z9.number(),
|
|
1101
|
+
eventIds: z9.array(z9.string())
|
|
1084
1102
|
})
|
|
1085
1103
|
});
|
|
1086
1104
|
var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
1087
|
-
operation:
|
|
1105
|
+
operation: z9.enum([
|
|
1088
1106
|
"event.actions.notify.request",
|
|
1089
1107
|
"event.actions.declare.request",
|
|
1090
1108
|
"event.actions.register.request",
|
|
@@ -1104,159 +1122,159 @@ var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
|
1104
1122
|
"event.actions.mark_as_duplicate.request",
|
|
1105
1123
|
"event.actions.mark_as_not_duplicate.request"
|
|
1106
1124
|
]),
|
|
1107
|
-
requestData:
|
|
1108
|
-
eventId:
|
|
1109
|
-
actionType:
|
|
1110
|
-
eventType:
|
|
1111
|
-
trackingId:
|
|
1112
|
-
transactionId:
|
|
1125
|
+
requestData: z9.object({
|
|
1126
|
+
eventId: z9.string(),
|
|
1127
|
+
actionType: z9.string(),
|
|
1128
|
+
eventType: z9.string(),
|
|
1129
|
+
trackingId: z9.string(),
|
|
1130
|
+
transactionId: z9.string()
|
|
1113
1131
|
})
|
|
1114
1132
|
});
|
|
1115
1133
|
var EventCustomActionEntrySchema = AuditLogEntryBase.extend({
|
|
1116
|
-
operation:
|
|
1117
|
-
requestData:
|
|
1118
|
-
eventId:
|
|
1119
|
-
actionType:
|
|
1120
|
-
customAction:
|
|
1121
|
-
eventType:
|
|
1122
|
-
trackingId:
|
|
1123
|
-
transactionId:
|
|
1134
|
+
operation: z9.literal("event.actions.custom.request"),
|
|
1135
|
+
requestData: z9.object({
|
|
1136
|
+
eventId: z9.string(),
|
|
1137
|
+
actionType: z9.literal(ActionType.CUSTOM),
|
|
1138
|
+
customAction: z9.string(),
|
|
1139
|
+
eventType: z9.string(),
|
|
1140
|
+
trackingId: z9.string(),
|
|
1141
|
+
transactionId: z9.string()
|
|
1124
1142
|
})
|
|
1125
1143
|
});
|
|
1126
1144
|
var IntegrationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1127
|
-
operation:
|
|
1128
|
-
requestData:
|
|
1129
|
-
responseSummary:
|
|
1145
|
+
operation: z9.literal("integrations.create"),
|
|
1146
|
+
requestData: z9.object({ name: z9.string(), scopes: z9.array(z9.string()) }),
|
|
1147
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
1130
1148
|
});
|
|
1131
1149
|
var IntegrationRefreshTokenEntrySchema = AuditLogEntryBase.extend({
|
|
1132
|
-
operation:
|
|
1133
|
-
requestData:
|
|
1134
|
-
responseSummary:
|
|
1150
|
+
operation: z9.literal("integrations.refreshToken"),
|
|
1151
|
+
requestData: z9.object({ clientId: z9.string() }),
|
|
1152
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
1135
1153
|
});
|
|
1136
1154
|
var IntegrationDeactivateEntrySchema = AuditLogEntryBase.extend({
|
|
1137
|
-
operation:
|
|
1138
|
-
requestData:
|
|
1139
|
-
responseSummary:
|
|
1155
|
+
operation: z9.literal("integrations.deactivate"),
|
|
1156
|
+
requestData: z9.object({ id: z9.string() }),
|
|
1157
|
+
responseSummary: z9.object({ id: z9.string(), status: z9.string() })
|
|
1140
1158
|
});
|
|
1141
1159
|
var IntegrationActivateEntrySchema = AuditLogEntryBase.extend({
|
|
1142
|
-
operation:
|
|
1143
|
-
requestData:
|
|
1144
|
-
responseSummary:
|
|
1160
|
+
operation: z9.literal("integrations.activate"),
|
|
1161
|
+
requestData: z9.object({ id: z9.string() }),
|
|
1162
|
+
responseSummary: z9.object({ id: z9.string(), status: z9.string() })
|
|
1145
1163
|
});
|
|
1146
1164
|
var IntegrationDeleteEntrySchema = AuditLogEntryBase.extend({
|
|
1147
|
-
operation:
|
|
1148
|
-
requestData:
|
|
1149
|
-
responseSummary:
|
|
1165
|
+
operation: z9.literal("integrations.delete"),
|
|
1166
|
+
requestData: z9.object({ id: z9.string() }),
|
|
1167
|
+
responseSummary: z9.object({ id: z9.string(), name: z9.string() })
|
|
1150
1168
|
});
|
|
1151
1169
|
var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
1152
|
-
operation:
|
|
1153
|
-
requestData:
|
|
1154
|
-
responseSummary:
|
|
1170
|
+
operation: z9.literal("integrations.refreshSecret"),
|
|
1171
|
+
requestData: z9.object({ id: z9.string() }),
|
|
1172
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
1155
1173
|
});
|
|
1156
1174
|
var createdVersionFields = {
|
|
1157
|
-
id:
|
|
1158
|
-
versionId:
|
|
1159
|
-
name:
|
|
1160
|
-
externalId:
|
|
1161
|
-
effectiveFrom:
|
|
1162
|
-
status:
|
|
1175
|
+
id: z9.string(),
|
|
1176
|
+
versionId: z9.string(),
|
|
1177
|
+
name: z9.string(),
|
|
1178
|
+
externalId: z9.string().nullish(),
|
|
1179
|
+
effectiveFrom: z9.string(),
|
|
1180
|
+
status: z9.string()
|
|
1163
1181
|
};
|
|
1164
1182
|
var LocationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1165
|
-
operation:
|
|
1166
|
-
requestData:
|
|
1183
|
+
operation: z9.literal("locations.create"),
|
|
1184
|
+
requestData: z9.object({
|
|
1167
1185
|
...createdVersionFields,
|
|
1168
|
-
administrativeAreaId:
|
|
1169
|
-
locationType:
|
|
1186
|
+
administrativeAreaId: z9.string().nullish(),
|
|
1187
|
+
locationType: z9.string().nullish()
|
|
1170
1188
|
})
|
|
1171
1189
|
});
|
|
1172
1190
|
var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1173
|
-
operation:
|
|
1174
|
-
requestData:
|
|
1191
|
+
operation: z9.literal("administrativeAreas.create"),
|
|
1192
|
+
requestData: z9.object({
|
|
1175
1193
|
...createdVersionFields,
|
|
1176
|
-
parentId:
|
|
1194
|
+
parentId: z9.string().nullish()
|
|
1177
1195
|
})
|
|
1178
1196
|
});
|
|
1179
|
-
var ChangedStringField =
|
|
1180
|
-
var ChangedNullableStringField =
|
|
1181
|
-
from:
|
|
1182
|
-
to:
|
|
1183
|
-
});
|
|
1184
|
-
var updatedVersionRequestData =
|
|
1185
|
-
id:
|
|
1186
|
-
versionId:
|
|
1187
|
-
name:
|
|
1188
|
-
externalId:
|
|
1189
|
-
status:
|
|
1190
|
-
effectiveFrom:
|
|
1191
|
-
lastVersionId:
|
|
1192
|
-
});
|
|
1193
|
-
var updatedVersionResponseSummary =
|
|
1194
|
-
previousVersionId:
|
|
1195
|
-
versionId:
|
|
1196
|
-
changed:
|
|
1197
|
+
var ChangedStringField = z9.object({ from: z9.string(), to: z9.string() });
|
|
1198
|
+
var ChangedNullableStringField = z9.object({
|
|
1199
|
+
from: z9.string().nullable(),
|
|
1200
|
+
to: z9.string().nullable()
|
|
1201
|
+
});
|
|
1202
|
+
var updatedVersionRequestData = z9.object({
|
|
1203
|
+
id: z9.string(),
|
|
1204
|
+
versionId: z9.string(),
|
|
1205
|
+
name: z9.string(),
|
|
1206
|
+
externalId: z9.string().nullish(),
|
|
1207
|
+
status: z9.string(),
|
|
1208
|
+
effectiveFrom: z9.string(),
|
|
1209
|
+
lastVersionId: z9.string()
|
|
1210
|
+
});
|
|
1211
|
+
var updatedVersionResponseSummary = z9.object({
|
|
1212
|
+
previousVersionId: z9.string(),
|
|
1213
|
+
versionId: z9.string(),
|
|
1214
|
+
changed: z9.object({
|
|
1197
1215
|
name: ChangedStringField.optional(),
|
|
1198
1216
|
externalId: ChangedNullableStringField.optional(),
|
|
1199
1217
|
status: ChangedStringField.optional()
|
|
1200
1218
|
})
|
|
1201
1219
|
});
|
|
1202
1220
|
var LocationUpdateEntrySchema = AuditLogEntryBase.extend({
|
|
1203
|
-
operation:
|
|
1221
|
+
operation: z9.literal("locations.update"),
|
|
1204
1222
|
requestData: updatedVersionRequestData,
|
|
1205
1223
|
responseSummary: updatedVersionResponseSummary
|
|
1206
1224
|
});
|
|
1207
1225
|
var AdministrativeAreaUpdateEntrySchema = AuditLogEntryBase.extend({
|
|
1208
|
-
operation:
|
|
1226
|
+
operation: z9.literal("administrativeAreas.update"),
|
|
1209
1227
|
requestData: updatedVersionRequestData,
|
|
1210
1228
|
responseSummary: updatedVersionResponseSummary
|
|
1211
1229
|
});
|
|
1212
|
-
var withdrawVersionRequestData =
|
|
1213
|
-
id:
|
|
1214
|
-
versionId:
|
|
1230
|
+
var withdrawVersionRequestData = z9.object({
|
|
1231
|
+
id: z9.string(),
|
|
1232
|
+
versionId: z9.string()
|
|
1215
1233
|
});
|
|
1216
|
-
var withdrawVersionResponseSummary =
|
|
1217
|
-
effectiveFrom:
|
|
1218
|
-
name:
|
|
1219
|
-
externalId:
|
|
1220
|
-
status:
|
|
1234
|
+
var withdrawVersionResponseSummary = z9.object({
|
|
1235
|
+
effectiveFrom: z9.string(),
|
|
1236
|
+
name: z9.string(),
|
|
1237
|
+
externalId: z9.string().nullish(),
|
|
1238
|
+
status: z9.string()
|
|
1221
1239
|
});
|
|
1222
1240
|
var LocationWithdrawEntrySchema = AuditLogEntryBase.extend({
|
|
1223
|
-
operation:
|
|
1241
|
+
operation: z9.literal("locations.withdrawVersion"),
|
|
1224
1242
|
requestData: withdrawVersionRequestData,
|
|
1225
1243
|
responseSummary: withdrawVersionResponseSummary
|
|
1226
1244
|
});
|
|
1227
1245
|
var AdministrativeAreaWithdrawEntrySchema = AuditLogEntryBase.extend({
|
|
1228
|
-
operation:
|
|
1246
|
+
operation: z9.literal("administrativeAreas.withdrawVersion"),
|
|
1229
1247
|
requestData: withdrawVersionRequestData,
|
|
1230
1248
|
responseSummary: withdrawVersionResponseSummary
|
|
1231
1249
|
});
|
|
1232
1250
|
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
1233
|
-
operation:
|
|
1234
|
-
requestData:
|
|
1235
|
-
transactionId:
|
|
1236
|
-
path:
|
|
1251
|
+
operation: z9.literal("attachments.upload"),
|
|
1252
|
+
requestData: z9.object({
|
|
1253
|
+
transactionId: z9.string(),
|
|
1254
|
+
path: z9.string().nullable()
|
|
1237
1255
|
}),
|
|
1238
|
-
responseSummary:
|
|
1256
|
+
responseSummary: z9.object({ fileUrl: z9.string() })
|
|
1239
1257
|
});
|
|
1240
|
-
var subjectOnly =
|
|
1241
|
-
var subjectWithReason =
|
|
1242
|
-
subjectId:
|
|
1243
|
-
reason:
|
|
1244
|
-
comment:
|
|
1258
|
+
var subjectOnly = z9.object({ subjectId: z9.string() });
|
|
1259
|
+
var subjectWithReason = z9.object({
|
|
1260
|
+
subjectId: z9.string(),
|
|
1261
|
+
reason: z9.string(),
|
|
1262
|
+
comment: z9.string().optional()
|
|
1245
1263
|
});
|
|
1246
1264
|
var UserCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1247
|
-
operation:
|
|
1248
|
-
requestData:
|
|
1249
|
-
subjectId:
|
|
1250
|
-
role:
|
|
1251
|
-
primaryOfficeId:
|
|
1265
|
+
operation: z9.literal("user.create_user"),
|
|
1266
|
+
requestData: z9.object({
|
|
1267
|
+
subjectId: z9.string(),
|
|
1268
|
+
role: z9.string(),
|
|
1269
|
+
primaryOfficeId: z9.string()
|
|
1252
1270
|
})
|
|
1253
1271
|
});
|
|
1254
1272
|
var UserReasonEntrySchema = AuditLogEntryBase.extend({
|
|
1255
|
-
operation:
|
|
1273
|
+
operation: z9.enum(["user.deactivate", "user.reactivate"]),
|
|
1256
1274
|
requestData: subjectWithReason
|
|
1257
1275
|
});
|
|
1258
1276
|
var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
|
|
1259
|
-
operation:
|
|
1277
|
+
operation: z9.enum([
|
|
1260
1278
|
"user.edit_user",
|
|
1261
1279
|
"user.logged_in",
|
|
1262
1280
|
"user.logged_out",
|
|
@@ -1270,14 +1288,14 @@ var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
|
|
|
1270
1288
|
requestData: subjectOnly
|
|
1271
1289
|
});
|
|
1272
1290
|
var UserEmailChangedEntrySchema = AuditLogEntryBase.extend({
|
|
1273
|
-
operation:
|
|
1291
|
+
operation: z9.literal("user.email_address_changed"),
|
|
1274
1292
|
requestData: subjectOnly,
|
|
1275
|
-
responseSummary:
|
|
1293
|
+
responseSummary: z9.object({ email: z9.string() })
|
|
1276
1294
|
});
|
|
1277
1295
|
var UserPhoneChangedEntrySchema = AuditLogEntryBase.extend({
|
|
1278
|
-
operation:
|
|
1296
|
+
operation: z9.literal("user.phone_number_changed"),
|
|
1279
1297
|
requestData: subjectOnly,
|
|
1280
|
-
responseSummary:
|
|
1298
|
+
responseSummary: z9.object({ phoneNumber: z9.string() })
|
|
1281
1299
|
});
|
|
1282
1300
|
var userBaseOmit = {
|
|
1283
1301
|
id: true,
|
|
@@ -1285,14 +1303,14 @@ var userBaseOmit = {
|
|
|
1285
1303
|
clientType: true,
|
|
1286
1304
|
createdAt: true
|
|
1287
1305
|
};
|
|
1288
|
-
var UserAuditRecordInput =
|
|
1306
|
+
var UserAuditRecordInput = z9.discriminatedUnion("operation", [
|
|
1289
1307
|
UserCreateEntrySchema.omit(userBaseOmit),
|
|
1290
1308
|
UserReasonEntrySchema.omit(userBaseOmit),
|
|
1291
1309
|
UserSubjectOnlyEntrySchema.omit(userBaseOmit),
|
|
1292
1310
|
UserEmailChangedEntrySchema.omit(userBaseOmit),
|
|
1293
1311
|
UserPhoneChangedEntrySchema.omit(userBaseOmit)
|
|
1294
1312
|
]);
|
|
1295
|
-
var AuditLogEntrySchema =
|
|
1313
|
+
var AuditLogEntrySchema = z9.discriminatedUnion("operation", [
|
|
1296
1314
|
EventCreateEntrySchema,
|
|
1297
1315
|
EventGetEntrySchema,
|
|
1298
1316
|
EventSearchEntrySchema,
|
|
@@ -1323,13 +1341,13 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
|
1323
1341
|
var CHILD_ONBOARDING_EVENT = "child-onboarding";
|
|
1324
1342
|
|
|
1325
1343
|
// ../commons/src/events/ActionConfig.ts
|
|
1326
|
-
var
|
|
1344
|
+
var z25 = __toESM(require("zod/v4"));
|
|
1327
1345
|
|
|
1328
1346
|
// ../commons/src/events/FieldConfig.ts
|
|
1329
1347
|
var import_v43 = __toESM(require("zod/v4"));
|
|
1330
1348
|
|
|
1331
1349
|
// ../commons/src/events/FieldType.ts
|
|
1332
|
-
var
|
|
1350
|
+
var z10 = __toESM(require("zod/v4"));
|
|
1333
1351
|
var FieldType = {
|
|
1334
1352
|
NAME: "NAME",
|
|
1335
1353
|
PHONE: "PHONE",
|
|
@@ -1393,7 +1411,7 @@ var FieldType = {
|
|
|
1393
1411
|
*/
|
|
1394
1412
|
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
1395
1413
|
};
|
|
1396
|
-
var FileFieldType =
|
|
1414
|
+
var FileFieldType = z10.enum([
|
|
1397
1415
|
FieldType.FILE,
|
|
1398
1416
|
FieldType.FILE_WITH_OPTIONS,
|
|
1399
1417
|
FieldType.SIGNATURE
|
|
@@ -1429,22 +1447,22 @@ var HiddenFieldTypes = [
|
|
|
1429
1447
|
];
|
|
1430
1448
|
|
|
1431
1449
|
// ../commons/src/events/FieldValue.ts
|
|
1432
|
-
var
|
|
1450
|
+
var z14 = __toESM(require("zod/v4"));
|
|
1433
1451
|
|
|
1434
1452
|
// ../commons/src/documents.ts
|
|
1435
|
-
var
|
|
1436
|
-
var FullDocumentUrl =
|
|
1453
|
+
var z11 = __toESM(require("zod/v4"));
|
|
1454
|
+
var FullDocumentUrl = z11.string().brand("FullDocumentUrl").describe(
|
|
1437
1455
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio.opencrvs.com/bucket-name/document-id.jpg"
|
|
1438
1456
|
);
|
|
1439
|
-
var FullDocumentPath =
|
|
1457
|
+
var FullDocumentPath = z11.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
|
|
1440
1458
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
1441
1459
|
);
|
|
1442
|
-
var DocumentPath =
|
|
1460
|
+
var DocumentPath = z11.string().brand("DocumentPath").describe(
|
|
1443
1461
|
"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
|
|
1444
1462
|
);
|
|
1445
1463
|
|
|
1446
1464
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
1447
|
-
var
|
|
1465
|
+
var z12 = __toESM(require("zod/v4"));
|
|
1448
1466
|
var GeographicalArea = {
|
|
1449
1467
|
URBAN: "URBAN",
|
|
1450
1468
|
RURAL: "RURAL"
|
|
@@ -1453,94 +1471,94 @@ var AddressType = {
|
|
|
1453
1471
|
DOMESTIC: "DOMESTIC",
|
|
1454
1472
|
INTERNATIONAL: "INTERNATIONAL"
|
|
1455
1473
|
};
|
|
1456
|
-
var FileFieldValue =
|
|
1474
|
+
var FileFieldValue = z12.object({
|
|
1457
1475
|
path: DocumentPath,
|
|
1458
|
-
originalFilename:
|
|
1459
|
-
type:
|
|
1460
|
-
});
|
|
1461
|
-
var NameFieldValue =
|
|
1462
|
-
firstname:
|
|
1463
|
-
surname:
|
|
1464
|
-
middlename:
|
|
1465
|
-
});
|
|
1466
|
-
var NameFieldUpdateValue =
|
|
1467
|
-
firstname:
|
|
1468
|
-
surname:
|
|
1469
|
-
middlename:
|
|
1470
|
-
}).or(
|
|
1471
|
-
var StreetLevelDetailsValue =
|
|
1472
|
-
var StreetLevelDetailsUpdateValue =
|
|
1473
|
-
var BaseAddressFieldValue =
|
|
1474
|
-
country:
|
|
1476
|
+
originalFilename: z12.string(),
|
|
1477
|
+
type: z12.string()
|
|
1478
|
+
});
|
|
1479
|
+
var NameFieldValue = z12.object({
|
|
1480
|
+
firstname: z12.string(),
|
|
1481
|
+
surname: z12.string(),
|
|
1482
|
+
middlename: z12.string().optional()
|
|
1483
|
+
});
|
|
1484
|
+
var NameFieldUpdateValue = z12.object({
|
|
1485
|
+
firstname: z12.string().nullish(),
|
|
1486
|
+
surname: z12.string().nullish(),
|
|
1487
|
+
middlename: z12.string().nullish()
|
|
1488
|
+
}).or(z12.null()).or(z12.undefined());
|
|
1489
|
+
var StreetLevelDetailsValue = z12.record(z12.string(), z12.string()).optional();
|
|
1490
|
+
var StreetLevelDetailsUpdateValue = z12.record(z12.string(), z12.string().nullable()).nullish();
|
|
1491
|
+
var BaseAddressFieldValue = z12.object({
|
|
1492
|
+
country: z12.string(),
|
|
1475
1493
|
streetLevelDetails: StreetLevelDetailsValue
|
|
1476
1494
|
});
|
|
1477
|
-
var BaseAddressFieldUpdateValue =
|
|
1478
|
-
country:
|
|
1495
|
+
var BaseAddressFieldUpdateValue = z12.object({
|
|
1496
|
+
country: z12.string().nullish(),
|
|
1479
1497
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
1480
1498
|
});
|
|
1481
1499
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
1482
|
-
addressType:
|
|
1483
|
-
administrativeArea:
|
|
1500
|
+
addressType: z12.literal(AddressType.DOMESTIC),
|
|
1501
|
+
administrativeArea: z12.string().uuid()
|
|
1484
1502
|
});
|
|
1485
1503
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
1486
|
-
addressType:
|
|
1504
|
+
addressType: z12.literal(AddressType.INTERNATIONAL)
|
|
1487
1505
|
});
|
|
1488
|
-
var AddressFieldValue =
|
|
1506
|
+
var AddressFieldValue = z12.discriminatedUnion("addressType", [
|
|
1489
1507
|
DomesticAddressFieldValue,
|
|
1490
1508
|
InternationalAddressFieldValue
|
|
1491
1509
|
]);
|
|
1492
1510
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
1493
|
-
addressType:
|
|
1494
|
-
administrativeArea:
|
|
1511
|
+
addressType: z12.literal(AddressType.DOMESTIC),
|
|
1512
|
+
administrativeArea: z12.string().uuid().nullish()
|
|
1495
1513
|
/* Leaf level admin structure */
|
|
1496
1514
|
});
|
|
1497
1515
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
1498
1516
|
{
|
|
1499
|
-
addressType:
|
|
1517
|
+
addressType: z12.literal(AddressType.INTERNATIONAL)
|
|
1500
1518
|
}
|
|
1501
1519
|
);
|
|
1502
|
-
var AddressFieldUpdateValue =
|
|
1520
|
+
var AddressFieldUpdateValue = z12.discriminatedUnion("addressType", [
|
|
1503
1521
|
DomesticAddressUpdateFieldValue,
|
|
1504
1522
|
InternationalAddressUpdateFieldValue
|
|
1505
1523
|
]).nullish();
|
|
1506
|
-
var FileFieldValueWithOption =
|
|
1524
|
+
var FileFieldValueWithOption = z12.object({
|
|
1507
1525
|
path: DocumentPath,
|
|
1508
|
-
originalFilename:
|
|
1509
|
-
type:
|
|
1510
|
-
option:
|
|
1511
|
-
});
|
|
1512
|
-
var FileFieldWithOptionValue =
|
|
1513
|
-
var HttpFieldValue =
|
|
1514
|
-
loading:
|
|
1515
|
-
error:
|
|
1516
|
-
data:
|
|
1517
|
-
});
|
|
1518
|
-
var HttpFieldUpdateValue =
|
|
1519
|
-
loading:
|
|
1520
|
-
error:
|
|
1521
|
-
data:
|
|
1522
|
-
}).or(
|
|
1523
|
-
var QueryParamReaderFieldValue =
|
|
1524
|
-
data:
|
|
1525
|
-
updatedAt:
|
|
1526
|
+
originalFilename: z12.string(),
|
|
1527
|
+
type: z12.string(),
|
|
1528
|
+
option: z12.string()
|
|
1529
|
+
});
|
|
1530
|
+
var FileFieldWithOptionValue = z12.array(FileFieldValueWithOption);
|
|
1531
|
+
var HttpFieldValue = z12.object({
|
|
1532
|
+
loading: z12.boolean(),
|
|
1533
|
+
error: z12.object({ statusCode: z12.number(), message: z12.string() }).nullish(),
|
|
1534
|
+
data: z12.any()
|
|
1535
|
+
});
|
|
1536
|
+
var HttpFieldUpdateValue = z12.object({
|
|
1537
|
+
loading: z12.boolean().nullish(),
|
|
1538
|
+
error: z12.object({ statusCode: z12.number(), message: z12.string() }).nullish(),
|
|
1539
|
+
data: z12.any().nullish()
|
|
1540
|
+
}).or(z12.null()).or(z12.undefined());
|
|
1541
|
+
var QueryParamReaderFieldValue = z12.object({
|
|
1542
|
+
data: z12.record(z12.string(), z12.string()),
|
|
1543
|
+
updatedAt: z12.iso.datetime()
|
|
1526
1544
|
}).nullish();
|
|
1527
|
-
var QueryParamReaderFieldUpdateValue =
|
|
1528
|
-
data:
|
|
1545
|
+
var QueryParamReaderFieldUpdateValue = z12.object({
|
|
1546
|
+
data: z12.record(z12.string(), z12.string())
|
|
1529
1547
|
});
|
|
1530
|
-
var ReadDataValue =
|
|
1531
|
-
data:
|
|
1548
|
+
var ReadDataValue = z12.object({
|
|
1549
|
+
data: z12.any()
|
|
1532
1550
|
});
|
|
1533
1551
|
var QrReaderFieldValue = ReadDataValue;
|
|
1534
1552
|
var IdReaderFieldValue = ReadDataValue;
|
|
1535
|
-
var NumberWithUnitFieldValue =
|
|
1536
|
-
numericValue:
|
|
1537
|
-
unit:
|
|
1553
|
+
var NumberWithUnitFieldValue = z12.object({
|
|
1554
|
+
numericValue: z12.number(),
|
|
1555
|
+
unit: z12.string()
|
|
1538
1556
|
});
|
|
1539
|
-
var NumberWithUnitFieldUpdateValue =
|
|
1540
|
-
numericValue:
|
|
1541
|
-
unit:
|
|
1557
|
+
var NumberWithUnitFieldUpdateValue = z12.object({
|
|
1558
|
+
numericValue: z12.number().optional(),
|
|
1559
|
+
unit: z12.string().optional()
|
|
1542
1560
|
});
|
|
1543
|
-
var CustomFieldValue =
|
|
1561
|
+
var CustomFieldValue = z12.unknown().brand("CustomFieldValue");
|
|
1544
1562
|
|
|
1545
1563
|
// ../commons/src/events/PlainDate.ts
|
|
1546
1564
|
var import_zod = require("zod");
|
|
@@ -1554,46 +1572,46 @@ function plainDateToLocalDate(date) {
|
|
|
1554
1572
|
}
|
|
1555
1573
|
|
|
1556
1574
|
// ../commons/src/events/FieldValue.ts
|
|
1557
|
-
var TextValue =
|
|
1558
|
-
var HiddenFieldValue =
|
|
1559
|
-
var NonEmptyTextValue =
|
|
1560
|
-
var DateValue =
|
|
1561
|
-
var AgeValue =
|
|
1562
|
-
age:
|
|
1563
|
-
asOfDateRef:
|
|
1575
|
+
var TextValue = z14.string();
|
|
1576
|
+
var HiddenFieldValue = z14.string();
|
|
1577
|
+
var NonEmptyTextValue = z14.string().trim().min(1);
|
|
1578
|
+
var DateValue = z14.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
1579
|
+
var AgeValue = z14.object({
|
|
1580
|
+
age: z14.number(),
|
|
1581
|
+
asOfDateRef: z14.string()
|
|
1564
1582
|
});
|
|
1565
1583
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
1566
|
-
var AutocompleteValue =
|
|
1567
|
-
label:
|
|
1568
|
-
value:
|
|
1584
|
+
var AutocompleteValue = z14.object({
|
|
1585
|
+
label: z14.string(),
|
|
1586
|
+
value: z14.string()
|
|
1569
1587
|
});
|
|
1570
1588
|
var AutocompleteUpdateValue = AutocompleteValue.optional().nullable();
|
|
1571
|
-
var TimeValue =
|
|
1572
|
-
var DatetimeValue =
|
|
1573
|
-
var SelectDateRangeValue =
|
|
1589
|
+
var TimeValue = z14.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
1590
|
+
var DatetimeValue = z14.iso.datetime();
|
|
1591
|
+
var SelectDateRangeValue = z14.enum([
|
|
1574
1592
|
"last7Days",
|
|
1575
1593
|
"last30Days",
|
|
1576
1594
|
"last90Days",
|
|
1577
1595
|
"last365Days"
|
|
1578
1596
|
]);
|
|
1579
|
-
var DateRangeFieldValue =
|
|
1597
|
+
var DateRangeFieldValue = z14.object({
|
|
1580
1598
|
start: PlainDate,
|
|
1581
1599
|
end: PlainDate
|
|
1582
1600
|
}).or(PlainDate).describe(
|
|
1583
1601
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
1584
1602
|
);
|
|
1585
|
-
var EmailValue =
|
|
1586
|
-
var CheckboxFieldValue =
|
|
1587
|
-
var NumberFieldValue =
|
|
1603
|
+
var EmailValue = z14.email();
|
|
1604
|
+
var CheckboxFieldValue = z14.boolean();
|
|
1605
|
+
var NumberFieldValue = z14.number();
|
|
1588
1606
|
var SignatureFieldValue = FileFieldValue;
|
|
1589
|
-
var ButtonFieldValue =
|
|
1590
|
-
var VerificationStatusValue =
|
|
1607
|
+
var ButtonFieldValue = z14.number();
|
|
1608
|
+
var VerificationStatusValue = z14.enum([
|
|
1591
1609
|
"verified",
|
|
1592
1610
|
"authenticated",
|
|
1593
1611
|
"failed",
|
|
1594
1612
|
"pending"
|
|
1595
1613
|
]);
|
|
1596
|
-
var LeafFieldValues =
|
|
1614
|
+
var LeafFieldValues = z14.union([
|
|
1597
1615
|
AddressFieldValue,
|
|
1598
1616
|
TextValue,
|
|
1599
1617
|
PlainDate,
|
|
@@ -1619,11 +1637,11 @@ var LeafFieldValues = z13.union([
|
|
|
1619
1637
|
AutocompleteValue,
|
|
1620
1638
|
AutocompleteUpdateValue
|
|
1621
1639
|
]);
|
|
1622
|
-
var FieldGroupValue =
|
|
1623
|
-
var DataFieldValue =
|
|
1624
|
-
data:
|
|
1640
|
+
var FieldGroupValue = z14.record(z14.string(), LeafFieldValues);
|
|
1641
|
+
var DataFieldValue = z14.object({
|
|
1642
|
+
data: z14.record(z14.string(), LeafFieldValues)
|
|
1625
1643
|
}).nullish();
|
|
1626
|
-
var FieldValue =
|
|
1644
|
+
var FieldValue = z14.union([
|
|
1627
1645
|
LeafFieldValues,
|
|
1628
1646
|
DataFieldValue,
|
|
1629
1647
|
FieldGroupValue
|
|
@@ -1657,7 +1675,7 @@ function safeUnion(schemas) {
|
|
|
1657
1675
|
const sortedSchemas = [...schemas].sort(
|
|
1658
1676
|
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
1659
1677
|
);
|
|
1660
|
-
return
|
|
1678
|
+
return z14.any().superRefine((val, ctx) => {
|
|
1661
1679
|
for (const schema of sortedSchemas) {
|
|
1662
1680
|
if (schema.safeParse(val).success) {
|
|
1663
1681
|
return;
|
|
@@ -1696,9 +1714,9 @@ var FieldUpdateValue = safeUnion([
|
|
|
1696
1714
|
]);
|
|
1697
1715
|
|
|
1698
1716
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
1699
|
-
var
|
|
1700
|
-
var SerializedUserField =
|
|
1701
|
-
$userField:
|
|
1717
|
+
var z15 = __toESM(require("zod/v4"));
|
|
1718
|
+
var SerializedUserField = z15.object({
|
|
1719
|
+
$userField: z15.enum([
|
|
1702
1720
|
"id",
|
|
1703
1721
|
"name",
|
|
1704
1722
|
"role",
|
|
@@ -1712,7 +1730,7 @@ var SerializedUserField = z14.object({
|
|
|
1712
1730
|
"primaryOfficeId",
|
|
1713
1731
|
"administrativeAreaId"
|
|
1714
1732
|
]),
|
|
1715
|
-
$location:
|
|
1733
|
+
$location: z15.string().optional()
|
|
1716
1734
|
});
|
|
1717
1735
|
function userSerializer(userField) {
|
|
1718
1736
|
return {
|
|
@@ -1735,25 +1753,25 @@ function userSerializer(userField) {
|
|
|
1735
1753
|
var import_v4 = require("zod/v4");
|
|
1736
1754
|
|
|
1737
1755
|
// ../commons/src/events/EventMetadata.ts
|
|
1738
|
-
var
|
|
1756
|
+
var z17 = __toESM(require("zod/v4"));
|
|
1739
1757
|
|
|
1740
1758
|
// ../commons/src/events/ActionDocument.ts
|
|
1741
|
-
var
|
|
1742
|
-
var ActionUpdate =
|
|
1759
|
+
var z16 = __toESM(require("zod/v4"));
|
|
1760
|
+
var ActionUpdate = z16.record(z16.string(), FieldUpdateValue).describe(
|
|
1743
1761
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
1744
1762
|
);
|
|
1745
|
-
var EventState =
|
|
1763
|
+
var EventState = z16.record(z16.string(), FieldValue).describe(
|
|
1746
1764
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
1747
1765
|
);
|
|
1748
|
-
var ActionBase =
|
|
1766
|
+
var ActionBase = z16.object({
|
|
1749
1767
|
id: UUID.describe("Unique identifier of the action."),
|
|
1750
|
-
transactionId:
|
|
1768
|
+
transactionId: z16.string().describe("Unique identifier of the transaction."),
|
|
1751
1769
|
createdByUserType: TokenUserType.describe(
|
|
1752
1770
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1753
1771
|
),
|
|
1754
|
-
createdAt:
|
|
1755
|
-
createdBy:
|
|
1756
|
-
createdByRole:
|
|
1772
|
+
createdAt: z16.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1773
|
+
createdBy: z16.string().describe("Identifier of the user who created the action."),
|
|
1774
|
+
createdByRole: z16.string().optional().describe("Role of the user who created the action."),
|
|
1757
1775
|
createdBySignature: DocumentPath.nullish().describe(
|
|
1758
1776
|
"Reference to the signature of the user who created the action."
|
|
1759
1777
|
),
|
|
@@ -1765,7 +1783,7 @@ var ActionBase = z15.object({
|
|
|
1765
1783
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1766
1784
|
),
|
|
1767
1785
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1768
|
-
status:
|
|
1786
|
+
status: z16.enum([
|
|
1769
1787
|
ActionStatus.Requested,
|
|
1770
1788
|
ActionStatus.Accepted,
|
|
1771
1789
|
ActionStatus.Rejected
|
|
@@ -1777,70 +1795,70 @@ var ActionBase = z15.object({
|
|
|
1777
1795
|
)
|
|
1778
1796
|
});
|
|
1779
1797
|
var AssignedAction = ActionBase.extend(
|
|
1780
|
-
|
|
1781
|
-
type:
|
|
1782
|
-
assignedTo:
|
|
1798
|
+
z16.object({
|
|
1799
|
+
type: z16.literal(ActionType.ASSIGN),
|
|
1800
|
+
assignedTo: z16.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1783
1801
|
// TODO move into 'content' property
|
|
1784
1802
|
}).shape
|
|
1785
1803
|
);
|
|
1786
1804
|
var UnassignedAction = ActionBase.extend(
|
|
1787
|
-
|
|
1788
|
-
type:
|
|
1805
|
+
z16.object({
|
|
1806
|
+
type: z16.literal(ActionType.UNASSIGN)
|
|
1789
1807
|
}).shape
|
|
1790
1808
|
);
|
|
1791
1809
|
var RegisterAction = ActionBase.extend(
|
|
1792
|
-
|
|
1793
|
-
type:
|
|
1794
|
-
registrationNumber:
|
|
1810
|
+
z16.object({
|
|
1811
|
+
type: z16.literal(ActionType.REGISTER),
|
|
1812
|
+
registrationNumber: z16.string().optional().describe(
|
|
1795
1813
|
"Registration number of the event. Always present for accepted registrations."
|
|
1796
1814
|
)
|
|
1797
1815
|
// TODO move into 'content' property
|
|
1798
1816
|
}).shape
|
|
1799
1817
|
);
|
|
1800
1818
|
var DeclareAction = ActionBase.extend(
|
|
1801
|
-
|
|
1802
|
-
type:
|
|
1819
|
+
z16.object({
|
|
1820
|
+
type: z16.literal(ActionType.DECLARE)
|
|
1803
1821
|
}).shape
|
|
1804
1822
|
);
|
|
1805
|
-
var ReasonContent =
|
|
1806
|
-
reason:
|
|
1823
|
+
var ReasonContent = z16.object({
|
|
1824
|
+
reason: z16.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
1807
1825
|
"Message describing the reason for rejecting or archiving the event."
|
|
1808
1826
|
)
|
|
1809
1827
|
});
|
|
1810
1828
|
var RejectAction = ActionBase.extend(
|
|
1811
|
-
|
|
1812
|
-
type:
|
|
1829
|
+
z16.object({
|
|
1830
|
+
type: z16.literal(ActionType.REJECT),
|
|
1813
1831
|
content: ReasonContent
|
|
1814
1832
|
}).shape
|
|
1815
1833
|
);
|
|
1816
|
-
var PotentialDuplicate =
|
|
1834
|
+
var PotentialDuplicate = z16.object({
|
|
1817
1835
|
id: UUID,
|
|
1818
|
-
trackingId:
|
|
1836
|
+
trackingId: z16.string()
|
|
1819
1837
|
});
|
|
1820
1838
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
1821
|
-
|
|
1822
|
-
type:
|
|
1823
|
-
content:
|
|
1824
|
-
duplicates:
|
|
1839
|
+
z16.object({
|
|
1840
|
+
type: z16.literal(ActionType.DUPLICATE_DETECTED),
|
|
1841
|
+
content: z16.object({
|
|
1842
|
+
duplicates: z16.array(PotentialDuplicate)
|
|
1825
1843
|
})
|
|
1826
1844
|
}).shape
|
|
1827
1845
|
);
|
|
1828
1846
|
var MarkNotDuplicateAction = ActionBase.extend(
|
|
1829
|
-
|
|
1830
|
-
type:
|
|
1847
|
+
z16.object({
|
|
1848
|
+
type: z16.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1831
1849
|
}).shape
|
|
1832
1850
|
);
|
|
1833
1851
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
1834
|
-
|
|
1835
|
-
type:
|
|
1836
|
-
content:
|
|
1852
|
+
z16.object({
|
|
1853
|
+
type: z16.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1854
|
+
content: z16.object({
|
|
1837
1855
|
duplicateOf: UUID
|
|
1838
1856
|
}).optional()
|
|
1839
1857
|
}).shape
|
|
1840
1858
|
);
|
|
1841
1859
|
var ArchiveAction = ActionBase.extend(
|
|
1842
|
-
|
|
1843
|
-
type:
|
|
1860
|
+
z16.object({
|
|
1861
|
+
type: z16.literal(ActionType.ARCHIVE),
|
|
1844
1862
|
/**
|
|
1845
1863
|
* Archiving does not collect a reason on its own. Only the
|
|
1846
1864
|
* "mark as duplicate" flow archives with a reason attached.
|
|
@@ -1849,71 +1867,71 @@ var ArchiveAction = ActionBase.extend(
|
|
|
1849
1867
|
}).shape
|
|
1850
1868
|
);
|
|
1851
1869
|
var UnarchiveAction = ActionBase.extend(
|
|
1852
|
-
|
|
1853
|
-
type:
|
|
1870
|
+
z16.object({
|
|
1871
|
+
type: z16.literal(ActionType.UNARCHIVE)
|
|
1854
1872
|
}).shape
|
|
1855
1873
|
);
|
|
1856
1874
|
var CreatedAction = ActionBase.extend(
|
|
1857
|
-
|
|
1858
|
-
type:
|
|
1875
|
+
z16.object({
|
|
1876
|
+
type: z16.literal(ActionType.CREATE)
|
|
1859
1877
|
}).shape
|
|
1860
1878
|
);
|
|
1861
1879
|
var NotifiedAction = ActionBase.extend(
|
|
1862
|
-
|
|
1863
|
-
type:
|
|
1880
|
+
z16.object({
|
|
1881
|
+
type: z16.literal(ActionType.NOTIFY)
|
|
1864
1882
|
}).shape
|
|
1865
1883
|
);
|
|
1866
1884
|
var EditAction = ActionBase.extend(
|
|
1867
|
-
|
|
1868
|
-
type:
|
|
1885
|
+
z16.object({
|
|
1886
|
+
type: z16.literal(ActionType.EDIT),
|
|
1869
1887
|
/** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
|
|
1870
|
-
content:
|
|
1871
|
-
comment:
|
|
1888
|
+
content: z16.object({
|
|
1889
|
+
comment: z16.string().describe("Comment for the edit action.").optional()
|
|
1872
1890
|
}).optional()
|
|
1873
1891
|
}).shape
|
|
1874
1892
|
);
|
|
1875
|
-
var PrintContent =
|
|
1876
|
-
templateId:
|
|
1893
|
+
var PrintContent = z16.object({
|
|
1894
|
+
templateId: z16.string().optional()
|
|
1877
1895
|
});
|
|
1878
1896
|
var PrintCertificateAction = ActionBase.extend(
|
|
1879
|
-
|
|
1880
|
-
type:
|
|
1897
|
+
z16.object({
|
|
1898
|
+
type: z16.literal(ActionType.PRINT_CERTIFICATE),
|
|
1881
1899
|
content: PrintContent.optional().nullable()
|
|
1882
1900
|
}).shape
|
|
1883
1901
|
);
|
|
1884
1902
|
var RequestedCorrectionAction = ActionBase.extend(
|
|
1885
|
-
|
|
1886
|
-
type:
|
|
1903
|
+
z16.object({
|
|
1904
|
+
type: z16.literal(ActionType.REQUEST_CORRECTION)
|
|
1887
1905
|
}).shape
|
|
1888
1906
|
);
|
|
1889
1907
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1890
|
-
|
|
1891
|
-
type:
|
|
1892
|
-
requestId:
|
|
1908
|
+
z16.object({
|
|
1909
|
+
type: z16.literal(ActionType.APPROVE_CORRECTION),
|
|
1910
|
+
requestId: z16.string(),
|
|
1893
1911
|
// TODO move into 'content' property
|
|
1894
|
-
content:
|
|
1912
|
+
content: z16.object({ immediateCorrection: z16.boolean().optional() }).optional()
|
|
1895
1913
|
}).shape
|
|
1896
1914
|
);
|
|
1897
1915
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1898
|
-
|
|
1899
|
-
type:
|
|
1900
|
-
requestId:
|
|
1916
|
+
z16.object({
|
|
1917
|
+
type: z16.literal(ActionType.REJECT_CORRECTION),
|
|
1918
|
+
requestId: z16.string(),
|
|
1901
1919
|
// TODO move into 'content' property
|
|
1902
1920
|
content: ReasonContent
|
|
1903
1921
|
}).shape
|
|
1904
1922
|
);
|
|
1905
1923
|
var ReadAction = ActionBase.extend(
|
|
1906
|
-
|
|
1907
|
-
type:
|
|
1924
|
+
z16.object({
|
|
1925
|
+
type: z16.literal(ActionType.READ)
|
|
1908
1926
|
}).shape
|
|
1909
1927
|
);
|
|
1910
1928
|
var CustomAction = ActionBase.merge(
|
|
1911
|
-
|
|
1912
|
-
type:
|
|
1913
|
-
customActionType:
|
|
1929
|
+
z16.object({
|
|
1930
|
+
type: z16.literal(ActionType.CUSTOM),
|
|
1931
|
+
customActionType: z16.string()
|
|
1914
1932
|
})
|
|
1915
1933
|
);
|
|
1916
|
-
var ActionDocument =
|
|
1934
|
+
var ActionDocument = z16.discriminatedUnion("type", [
|
|
1917
1935
|
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1918
1936
|
RejectAction.meta({ id: "RejectAction" }),
|
|
1919
1937
|
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
@@ -1940,57 +1958,50 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1940
1958
|
declaration: true,
|
|
1941
1959
|
annotation: true
|
|
1942
1960
|
}).extend(
|
|
1943
|
-
|
|
1944
|
-
type:
|
|
1945
|
-
status:
|
|
1961
|
+
z16.object({
|
|
1962
|
+
type: z16.enum(ConfirmableActions),
|
|
1963
|
+
status: z16.literal(ActionStatus.Rejected)
|
|
1946
1964
|
}).shape
|
|
1947
1965
|
);
|
|
1948
|
-
var Action =
|
|
1966
|
+
var Action = z16.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1949
1967
|
|
|
1950
1968
|
// ../commons/src/events/EventMetadata.ts
|
|
1951
|
-
var
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
"
|
|
1955
|
-
"
|
|
1956
|
-
"ARCHIVED"
|
|
1957
|
-
]);
|
|
1958
|
-
var ZodDate = z16.iso.date();
|
|
1959
|
-
var ZodDateTime = z16.string().datetime();
|
|
1960
|
-
var ActionCreationMetadata = z16.object({
|
|
1961
|
-
createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1962
|
-
createdBy: z16.string().describe("ID of the user who created the action request."),
|
|
1969
|
+
var ZodDate = z17.iso.date();
|
|
1970
|
+
var ZodDateTime = z17.string().datetime();
|
|
1971
|
+
var ActionCreationMetadata = z17.object({
|
|
1972
|
+
createdAt: z17.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1973
|
+
createdBy: z17.string().describe("ID of the user who created the action request."),
|
|
1963
1974
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1964
1975
|
createdAtLocation: UUID.nullish().describe(
|
|
1965
1976
|
"Location of the user who created the action request."
|
|
1966
1977
|
),
|
|
1967
|
-
createdByUserType:
|
|
1968
|
-
acceptedAt:
|
|
1969
|
-
createdByRole:
|
|
1978
|
+
createdByUserType: z17.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1979
|
+
acceptedAt: z17.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1980
|
+
createdByRole: z17.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1970
1981
|
});
|
|
1971
1982
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1972
|
-
registrationNumber:
|
|
1983
|
+
registrationNumber: z17.string().describe(
|
|
1973
1984
|
"Registration number of the event. Always present for accepted registrations."
|
|
1974
1985
|
)
|
|
1975
1986
|
});
|
|
1976
|
-
var LegalStatuses =
|
|
1987
|
+
var LegalStatuses = z17.object({
|
|
1977
1988
|
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1978
1989
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1979
1990
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1980
1991
|
});
|
|
1981
|
-
var EventMetadata =
|
|
1992
|
+
var EventMetadata = z17.object({
|
|
1982
1993
|
id: UUID,
|
|
1983
|
-
type:
|
|
1994
|
+
type: z17.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1984
1995
|
status: EventStatus,
|
|
1985
1996
|
legalStatuses: LegalStatuses.describe(
|
|
1986
1997
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1987
1998
|
),
|
|
1988
|
-
createdAt:
|
|
1999
|
+
createdAt: z17.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1989
2000
|
dateOfEvent: ZodDate.nullish(),
|
|
1990
2001
|
placeOfEvent: UUID.nullish(),
|
|
1991
|
-
createdBy:
|
|
1992
|
-
createdByUserType:
|
|
1993
|
-
updatedByUserRole:
|
|
2002
|
+
createdBy: z17.string().describe("ID of the user who created the event."),
|
|
2003
|
+
createdByUserType: z17.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
2004
|
+
updatedByUserRole: z17.string().nullish().describe("Role of the user who last changed the status."),
|
|
1994
2005
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1995
2006
|
createdAtLocation: UUID.nullish().describe(
|
|
1996
2007
|
"Location of the user who created the event."
|
|
@@ -1998,18 +2009,18 @@ var EventMetadata = z16.object({
|
|
|
1998
2009
|
updatedAtLocation: UUID.nullish().describe(
|
|
1999
2010
|
"Location of the user who last changed the status."
|
|
2000
2011
|
),
|
|
2001
|
-
updatedAt:
|
|
2012
|
+
updatedAt: z17.iso.datetime().describe(
|
|
2002
2013
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
2003
2014
|
),
|
|
2004
|
-
assignedTo:
|
|
2005
|
-
updatedBy:
|
|
2006
|
-
trackingId:
|
|
2015
|
+
assignedTo: z17.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
2016
|
+
updatedBy: z17.string().nullish().describe("ID of the user who last changed the status."),
|
|
2017
|
+
trackingId: z17.string().describe(
|
|
2007
2018
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
2008
2019
|
),
|
|
2009
|
-
potentialDuplicates:
|
|
2020
|
+
potentialDuplicates: z17.array(PotentialDuplicate).describe(
|
|
2010
2021
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
2011
2022
|
),
|
|
2012
|
-
flags:
|
|
2023
|
+
flags: z17.array(Flag)
|
|
2013
2024
|
});
|
|
2014
2025
|
var EventMetadataKeysArray = [
|
|
2015
2026
|
"id",
|
|
@@ -2030,7 +2041,7 @@ var EventMetadataKeysArray = [
|
|
|
2030
2041
|
"legalStatuses",
|
|
2031
2042
|
"flags"
|
|
2032
2043
|
];
|
|
2033
|
-
var EventMetadataKeys =
|
|
2044
|
+
var EventMetadataKeys = z17.enum(EventMetadataKeysArray);
|
|
2034
2045
|
var eventMetadataLabelMap = {
|
|
2035
2046
|
"event.assignedTo": {
|
|
2036
2047
|
id: "event.assignedTo.label",
|
|
@@ -2113,7 +2124,7 @@ var eventMetadataLabelMap = {
|
|
|
2113
2124
|
description: "Flags"
|
|
2114
2125
|
}
|
|
2115
2126
|
};
|
|
2116
|
-
var EventMetadataDateFieldIdInput =
|
|
2127
|
+
var EventMetadataDateFieldIdInput = z17.enum([
|
|
2117
2128
|
"createdAt",
|
|
2118
2129
|
"updatedAt",
|
|
2119
2130
|
"legalStatuses.NOTIFIED.createdAt",
|
|
@@ -2123,7 +2134,7 @@ var EventMetadataDateFieldIdInput = z16.enum([
|
|
|
2123
2134
|
"legalStatuses.REGISTERED.createdAt",
|
|
2124
2135
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
2125
2136
|
]);
|
|
2126
|
-
var EventMetadataDateFieldId =
|
|
2137
|
+
var EventMetadataDateFieldId = z17.enum([
|
|
2127
2138
|
"event.createdAt",
|
|
2128
2139
|
"event.updatedAt",
|
|
2129
2140
|
"event.legalStatuses.NOTIFIED.createdAt",
|
|
@@ -3226,18 +3237,18 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
3226
3237
|
]);
|
|
3227
3238
|
|
|
3228
3239
|
// ../commons/src/events/FormConfig.ts
|
|
3229
|
-
var
|
|
3240
|
+
var z23 = __toESM(require("zod/v4"));
|
|
3230
3241
|
|
|
3231
3242
|
// ../commons/src/events/PageConfig.ts
|
|
3232
|
-
var
|
|
3233
|
-
var PageTypes =
|
|
3234
|
-
var PageConfigBase =
|
|
3235
|
-
id:
|
|
3243
|
+
var z22 = __toESM(require("zod/v4"));
|
|
3244
|
+
var PageTypes = z22.enum(["FORM", "VERIFICATION"]);
|
|
3245
|
+
var PageConfigBase = z22.object({
|
|
3246
|
+
id: z22.string().describe("Unique identifier for the page"),
|
|
3236
3247
|
title: TranslationConfig.describe("Header title of the page"),
|
|
3237
|
-
requireCompletionToContinue:
|
|
3248
|
+
requireCompletionToContinue: z22.boolean().default(false).describe(
|
|
3238
3249
|
"If true, all required fields must be filled before continuing to the next page"
|
|
3239
3250
|
),
|
|
3240
|
-
fields:
|
|
3251
|
+
fields: z22.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
3241
3252
|
conditional: Conditional.optional().describe(
|
|
3242
3253
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
3243
3254
|
)
|
|
@@ -3246,13 +3257,13 @@ var PageConfigBase = z21.object({
|
|
|
3246
3257
|
id: "FormPageConfig"
|
|
3247
3258
|
});
|
|
3248
3259
|
var FormPageConfig = PageConfigBase.extend({
|
|
3249
|
-
type:
|
|
3260
|
+
type: z22.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
3250
3261
|
});
|
|
3251
|
-
var VerificationActionConfig =
|
|
3252
|
-
verify:
|
|
3253
|
-
cancel:
|
|
3262
|
+
var VerificationActionConfig = z22.object({
|
|
3263
|
+
verify: z22.object({ label: TranslationConfig }),
|
|
3264
|
+
cancel: z22.object({
|
|
3254
3265
|
label: TranslationConfig,
|
|
3255
|
-
confirmation:
|
|
3266
|
+
confirmation: z22.object({
|
|
3256
3267
|
title: TranslationConfig,
|
|
3257
3268
|
body: TranslationConfig
|
|
3258
3269
|
})
|
|
@@ -3262,34 +3273,34 @@ var VerificationActionConfig = z21.object({
|
|
|
3262
3273
|
id: "VerificationActionConfig"
|
|
3263
3274
|
});
|
|
3264
3275
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
3265
|
-
type:
|
|
3276
|
+
type: z22.literal(PageTypes.enum.VERIFICATION),
|
|
3266
3277
|
actions: VerificationActionConfig
|
|
3267
3278
|
});
|
|
3268
|
-
var PageConfig =
|
|
3279
|
+
var PageConfig = z22.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
3269
3280
|
id: "PageConfig",
|
|
3270
3281
|
description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
|
|
3271
3282
|
});
|
|
3272
3283
|
|
|
3273
3284
|
// ../commons/src/events/FormConfig.ts
|
|
3274
|
-
var DeclarationFormConfig =
|
|
3285
|
+
var DeclarationFormConfig = z23.object({
|
|
3275
3286
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
3276
|
-
pages:
|
|
3287
|
+
pages: z23.array(FormPageConfig)
|
|
3277
3288
|
}).meta({
|
|
3278
3289
|
id: "DeclarationFormConfig",
|
|
3279
3290
|
description: "Configuration of the declaration form."
|
|
3280
3291
|
});
|
|
3281
|
-
var ActionFormConfig =
|
|
3292
|
+
var ActionFormConfig = z23.object({
|
|
3282
3293
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
3283
|
-
pages:
|
|
3294
|
+
pages: z23.array(PageConfig)
|
|
3284
3295
|
}).describe(
|
|
3285
3296
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
3286
3297
|
);
|
|
3287
|
-
var FormConfig =
|
|
3298
|
+
var FormConfig = z23.union([DeclarationFormConfig, ActionFormConfig]);
|
|
3288
3299
|
|
|
3289
3300
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
3290
|
-
var
|
|
3291
|
-
var FieldReference2 =
|
|
3292
|
-
var Matcher =
|
|
3301
|
+
var z24 = __toESM(require("zod/v4"));
|
|
3302
|
+
var FieldReference2 = z24.string();
|
|
3303
|
+
var Matcher = z24.object({
|
|
3293
3304
|
/**
|
|
3294
3305
|
* Reference to the field used in matching.
|
|
3295
3306
|
*
|
|
@@ -3297,23 +3308,23 @@ var Matcher = z23.object({
|
|
|
3297
3308
|
* be used as the origin date to calculate the distance from.
|
|
3298
3309
|
*/
|
|
3299
3310
|
fieldId: FieldReference2,
|
|
3300
|
-
options:
|
|
3301
|
-
boost:
|
|
3311
|
+
options: z24.object({
|
|
3312
|
+
boost: z24.number().optional(),
|
|
3302
3313
|
matchAgainst: FieldReference2.optional()
|
|
3303
3314
|
}).optional().default({
|
|
3304
3315
|
boost: 1
|
|
3305
3316
|
})
|
|
3306
3317
|
});
|
|
3307
3318
|
var FuzzyMatcher = Matcher.extend({
|
|
3308
|
-
type:
|
|
3309
|
-
options:
|
|
3319
|
+
type: z24.literal("fuzzy"),
|
|
3320
|
+
options: z24.object({
|
|
3310
3321
|
/**
|
|
3311
3322
|
* Names of length 3 or less characters = 0 edits allowed
|
|
3312
3323
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
3313
3324
|
* Names of length >7 characters = 2 edits allowed
|
|
3314
3325
|
*/
|
|
3315
|
-
fuzziness:
|
|
3316
|
-
boost:
|
|
3326
|
+
fuzziness: z24.union([z24.string(), z24.number()]).optional().default("AUTO:4,7"),
|
|
3327
|
+
boost: z24.number().optional().default(1),
|
|
3317
3328
|
matchAgainst: FieldReference2.optional()
|
|
3318
3329
|
}).optional().default({
|
|
3319
3330
|
fuzziness: "AUTO:4,7",
|
|
@@ -3321,48 +3332,48 @@ var FuzzyMatcher = Matcher.extend({
|
|
|
3321
3332
|
})
|
|
3322
3333
|
});
|
|
3323
3334
|
var StrictMatcher = Matcher.extend({
|
|
3324
|
-
type:
|
|
3325
|
-
options:
|
|
3326
|
-
boost:
|
|
3335
|
+
type: z24.literal("strict"),
|
|
3336
|
+
options: z24.object({
|
|
3337
|
+
boost: z24.number().optional().default(1),
|
|
3327
3338
|
/**
|
|
3328
3339
|
* The constant value to be present in the field for both records
|
|
3329
3340
|
*/
|
|
3330
|
-
value:
|
|
3341
|
+
value: z24.string().optional(),
|
|
3331
3342
|
matchAgainst: FieldReference2.optional()
|
|
3332
3343
|
}).optional().default({
|
|
3333
3344
|
boost: 1
|
|
3334
3345
|
})
|
|
3335
3346
|
});
|
|
3336
3347
|
var DateRangeMatcher = Matcher.extend({
|
|
3337
|
-
type:
|
|
3338
|
-
options:
|
|
3348
|
+
type: z24.literal("dateRange"),
|
|
3349
|
+
options: z24.object({
|
|
3339
3350
|
/**
|
|
3340
3351
|
* The distance pivot in days. Distance from the origin (the value of
|
|
3341
3352
|
* fieldId) at which relevance scores receive half of the boost value
|
|
3342
3353
|
*/
|
|
3343
|
-
pivot:
|
|
3344
|
-
days:
|
|
3345
|
-
boost:
|
|
3354
|
+
pivot: z24.number().optional(),
|
|
3355
|
+
days: z24.number(),
|
|
3356
|
+
boost: z24.number().optional().default(1),
|
|
3346
3357
|
matchAgainst: FieldReference2.optional()
|
|
3347
3358
|
})
|
|
3348
3359
|
});
|
|
3349
|
-
var Not =
|
|
3350
|
-
type:
|
|
3360
|
+
var Not = z24.object({
|
|
3361
|
+
type: z24.literal("not"),
|
|
3351
3362
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3352
|
-
clause:
|
|
3363
|
+
clause: z24.lazy(() => Clause)
|
|
3353
3364
|
});
|
|
3354
|
-
var And =
|
|
3355
|
-
type:
|
|
3365
|
+
var And = z24.object({
|
|
3366
|
+
type: z24.literal("and"),
|
|
3356
3367
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3357
|
-
clauses:
|
|
3368
|
+
clauses: z24.lazy(() => Clause.array())
|
|
3358
3369
|
});
|
|
3359
|
-
var Or =
|
|
3360
|
-
type:
|
|
3370
|
+
var Or = z24.object({
|
|
3371
|
+
type: z24.literal("or"),
|
|
3361
3372
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3362
|
-
clauses:
|
|
3373
|
+
clauses: z24.lazy(() => Clause.array())
|
|
3363
3374
|
});
|
|
3364
|
-
var Clause =
|
|
3365
|
-
() =>
|
|
3375
|
+
var Clause = z24.lazy(
|
|
3376
|
+
() => z24.discriminatedUnion("type", [
|
|
3366
3377
|
Not,
|
|
3367
3378
|
And,
|
|
3368
3379
|
Or,
|
|
@@ -3373,8 +3384,8 @@ var Clause = z23.lazy(
|
|
|
3373
3384
|
).meta({
|
|
3374
3385
|
id: "Clause"
|
|
3375
3386
|
});
|
|
3376
|
-
var DeduplicationConfig =
|
|
3377
|
-
id:
|
|
3387
|
+
var DeduplicationConfig = z24.object({
|
|
3388
|
+
id: z24.string(),
|
|
3378
3389
|
label: TranslationConfig,
|
|
3379
3390
|
query: Clause
|
|
3380
3391
|
}).meta({
|
|
@@ -3383,15 +3394,15 @@ var DeduplicationConfig = z23.object({
|
|
|
3383
3394
|
});
|
|
3384
3395
|
|
|
3385
3396
|
// ../commons/src/events/ActionConfig.ts
|
|
3386
|
-
var DeclarationReviewConfig =
|
|
3397
|
+
var DeclarationReviewConfig = z25.object({
|
|
3387
3398
|
title: TranslationConfig.describe("Title of the review page"),
|
|
3388
|
-
fields:
|
|
3399
|
+
fields: z25.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
3389
3400
|
}).describe(
|
|
3390
3401
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
3391
3402
|
);
|
|
3392
|
-
var ActionConfigBase =
|
|
3403
|
+
var ActionConfigBase = z25.object({
|
|
3393
3404
|
label: TranslationConfig.describe("Human readable description of the action"),
|
|
3394
|
-
flags:
|
|
3405
|
+
flags: z25.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
3395
3406
|
supportingCopy: TranslationConfig.optional().describe(
|
|
3396
3407
|
"Text displayed on the confirmation dialog"
|
|
3397
3408
|
),
|
|
@@ -3402,84 +3413,84 @@ var ActionConfigBase = z24.object({
|
|
|
3402
3413
|
* "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."
|
|
3403
3414
|
* for EventConfig.d.ts.
|
|
3404
3415
|
*/
|
|
3405
|
-
icon:
|
|
3406
|
-
conditionals:
|
|
3416
|
+
icon: z25.string().describe("Icon representing the action").optional(),
|
|
3417
|
+
conditionals: z25.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
3407
3418
|
});
|
|
3408
3419
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
3409
3420
|
deduplication: DeduplicationConfig.optional()
|
|
3410
3421
|
});
|
|
3411
|
-
var actionConfirmationForm =
|
|
3422
|
+
var actionConfirmationForm = z25.array(FieldConfig).optional().describe(
|
|
3412
3423
|
"Fields rendered on the action confirmation dialog. Submitted values are stored in the action annotation and shown in the audit history."
|
|
3413
3424
|
);
|
|
3414
3425
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
3415
|
-
|
|
3416
|
-
type:
|
|
3426
|
+
z25.object({
|
|
3427
|
+
type: z25.literal(ActionType.READ),
|
|
3417
3428
|
review: DeclarationReviewConfig.describe(
|
|
3418
3429
|
"Configuration of the review page for read-only view."
|
|
3419
3430
|
),
|
|
3420
|
-
conditionals:
|
|
3431
|
+
conditionals: z25.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
3421
3432
|
}).shape
|
|
3422
3433
|
);
|
|
3423
3434
|
var NotifyConfig = ActionConfigBase.extend(
|
|
3424
|
-
|
|
3425
|
-
type:
|
|
3435
|
+
z25.object({
|
|
3436
|
+
type: z25.literal(ActionType.NOTIFY),
|
|
3426
3437
|
form: actionConfirmationForm
|
|
3427
3438
|
}).shape
|
|
3428
3439
|
);
|
|
3429
3440
|
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
3430
|
-
|
|
3431
|
-
type:
|
|
3432
|
-
label:
|
|
3441
|
+
z25.object({
|
|
3442
|
+
type: z25.literal(ActionType.DUPLICATE_DETECTED),
|
|
3443
|
+
label: z25.never().optional().describe(
|
|
3433
3444
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no label."
|
|
3434
3445
|
),
|
|
3435
|
-
supportingCopy:
|
|
3436
|
-
icon:
|
|
3446
|
+
supportingCopy: z25.never().optional(),
|
|
3447
|
+
icon: z25.never().optional().describe(
|
|
3437
3448
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no icon."
|
|
3438
3449
|
),
|
|
3439
|
-
conditionals:
|
|
3450
|
+
conditionals: z25.never().optional().describe(
|
|
3440
3451
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it cannot be disabled or hidden with conditionals."
|
|
3441
3452
|
)
|
|
3442
3453
|
}).shape
|
|
3443
3454
|
);
|
|
3444
3455
|
var MarkAsDuplicateConfig = ActionConfigBase.extend(
|
|
3445
|
-
|
|
3446
|
-
type:
|
|
3456
|
+
z25.object({
|
|
3457
|
+
type: z25.literal(ActionType.MARK_AS_DUPLICATE)
|
|
3447
3458
|
}).shape
|
|
3448
3459
|
);
|
|
3449
3460
|
var MarkAsNotDuplicateConfig = ActionConfigBase.extend(
|
|
3450
|
-
|
|
3451
|
-
type:
|
|
3461
|
+
z25.object({
|
|
3462
|
+
type: z25.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3452
3463
|
}).shape
|
|
3453
3464
|
);
|
|
3454
3465
|
var AssignConfig = ActionConfigBase.extend(
|
|
3455
|
-
|
|
3456
|
-
type:
|
|
3457
|
-
flags:
|
|
3466
|
+
z25.object({
|
|
3467
|
+
type: z25.literal(ActionType.ASSIGN),
|
|
3468
|
+
flags: z25.never().optional().describe(
|
|
3458
3469
|
"ASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
3459
3470
|
)
|
|
3460
3471
|
}).shape
|
|
3461
3472
|
);
|
|
3462
3473
|
var UnassignConfig = ActionConfigBase.extend(
|
|
3463
|
-
|
|
3464
|
-
type:
|
|
3465
|
-
flags:
|
|
3474
|
+
z25.object({
|
|
3475
|
+
type: z25.literal(ActionType.UNASSIGN),
|
|
3476
|
+
flags: z25.never().optional().describe(
|
|
3466
3477
|
"UNASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
3467
3478
|
)
|
|
3468
3479
|
}).shape
|
|
3469
3480
|
);
|
|
3470
3481
|
var DeleteConfig = ActionConfigBase.extend(
|
|
3471
|
-
|
|
3472
|
-
type:
|
|
3482
|
+
z25.object({
|
|
3483
|
+
type: z25.literal(ActionType.DELETE)
|
|
3473
3484
|
}).shape
|
|
3474
3485
|
);
|
|
3475
3486
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
3476
|
-
|
|
3477
|
-
type:
|
|
3487
|
+
z25.object({
|
|
3488
|
+
type: z25.literal(ActionType.DECLARE),
|
|
3478
3489
|
review: DeclarationReviewConfig.describe(
|
|
3479
3490
|
"Configuration of the review page fields."
|
|
3480
3491
|
),
|
|
3481
3492
|
form: actionConfirmationForm,
|
|
3482
|
-
dialogCopy:
|
|
3493
|
+
dialogCopy: z25.object({
|
|
3483
3494
|
notify: TranslationConfig.describe(
|
|
3484
3495
|
"Confirmation text for the notify action"
|
|
3485
3496
|
),
|
|
@@ -3493,20 +3504,20 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
3493
3504
|
}).shape
|
|
3494
3505
|
);
|
|
3495
3506
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
3496
|
-
|
|
3497
|
-
type:
|
|
3507
|
+
z25.object({
|
|
3508
|
+
type: z25.literal(ActionType.ARCHIVE),
|
|
3498
3509
|
form: actionConfirmationForm
|
|
3499
3510
|
}).shape
|
|
3500
3511
|
);
|
|
3501
3512
|
var UnarchiveConfig = ActionConfigBase.extend(
|
|
3502
|
-
|
|
3503
|
-
type:
|
|
3513
|
+
z25.object({
|
|
3514
|
+
type: z25.literal(ActionType.UNARCHIVE)
|
|
3504
3515
|
}).shape
|
|
3505
3516
|
);
|
|
3506
3517
|
var EditActionConfig = ActionConfigBase.extend(
|
|
3507
|
-
|
|
3508
|
-
type:
|
|
3509
|
-
dialogCopy:
|
|
3518
|
+
z25.object({
|
|
3519
|
+
type: z25.literal(ActionType.EDIT),
|
|
3520
|
+
dialogCopy: z25.object({
|
|
3510
3521
|
notify: TranslationConfig.describe(
|
|
3511
3522
|
"Confirmation text for the notify with edits action"
|
|
3512
3523
|
),
|
|
@@ -3520,45 +3531,45 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
3520
3531
|
}).shape
|
|
3521
3532
|
);
|
|
3522
3533
|
var RejectConfig = ActionConfigBase.extend(
|
|
3523
|
-
|
|
3524
|
-
type:
|
|
3534
|
+
z25.object({
|
|
3535
|
+
type: z25.literal(ActionType.REJECT),
|
|
3525
3536
|
form: actionConfirmationForm
|
|
3526
3537
|
}).shape
|
|
3527
3538
|
);
|
|
3528
3539
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
3529
|
-
|
|
3530
|
-
type:
|
|
3540
|
+
z25.object({
|
|
3541
|
+
type: z25.literal(ActionType.REGISTER),
|
|
3531
3542
|
form: actionConfirmationForm
|
|
3532
3543
|
}).shape
|
|
3533
3544
|
);
|
|
3534
3545
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
3535
|
-
|
|
3536
|
-
type:
|
|
3546
|
+
z25.object({
|
|
3547
|
+
type: z25.literal(ActionType.PRINT_CERTIFICATE),
|
|
3537
3548
|
printForm: ActionFormConfig
|
|
3538
3549
|
}).shape
|
|
3539
3550
|
);
|
|
3540
3551
|
var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
3541
|
-
|
|
3542
|
-
type:
|
|
3552
|
+
z25.object({
|
|
3553
|
+
type: z25.literal(ActionType.REQUEST_CORRECTION),
|
|
3543
3554
|
correctionForm: ActionFormConfig
|
|
3544
3555
|
}).shape
|
|
3545
3556
|
);
|
|
3546
3557
|
var ApproveCorrectionConfig = ActionConfigBase.extend(
|
|
3547
|
-
|
|
3548
|
-
type:
|
|
3558
|
+
z25.object({
|
|
3559
|
+
type: z25.literal(ActionType.APPROVE_CORRECTION)
|
|
3549
3560
|
}).shape
|
|
3550
3561
|
);
|
|
3551
3562
|
var RejectCorrectionConfig = ActionConfigBase.extend(
|
|
3552
|
-
|
|
3553
|
-
type:
|
|
3563
|
+
z25.object({
|
|
3564
|
+
type: z25.literal(ActionType.REJECT_CORRECTION)
|
|
3554
3565
|
}).shape
|
|
3555
3566
|
);
|
|
3556
3567
|
var CustomActionConfig = ActionConfigBase.extend(
|
|
3557
|
-
|
|
3558
|
-
type:
|
|
3559
|
-
customActionType:
|
|
3568
|
+
z25.object({
|
|
3569
|
+
type: z25.literal(ActionType.CUSTOM),
|
|
3570
|
+
customActionType: z25.string().describe("Type identifier of the custom action."),
|
|
3560
3571
|
/** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
|
|
3561
|
-
form:
|
|
3572
|
+
form: z25.array(FieldConfig).describe(
|
|
3562
3573
|
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
3563
3574
|
),
|
|
3564
3575
|
auditHistoryLabel: TranslationConfig.describe(
|
|
@@ -3566,7 +3577,7 @@ var CustomActionConfig = ActionConfigBase.extend(
|
|
|
3566
3577
|
)
|
|
3567
3578
|
}).shape
|
|
3568
3579
|
);
|
|
3569
|
-
var ActionConfig =
|
|
3580
|
+
var ActionConfig = z25.discriminatedUnion("type", [
|
|
3570
3581
|
/*
|
|
3571
3582
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
3572
3583
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -3653,58 +3664,58 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3653
3664
|
var actionConfigTypes = new Set(
|
|
3654
3665
|
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
3655
3666
|
);
|
|
3656
|
-
var DeclarationActionConfig =
|
|
3667
|
+
var DeclarationActionConfig = z25.discriminatedUnion("type", [
|
|
3657
3668
|
DeclareConfig,
|
|
3658
3669
|
RegisterConfig
|
|
3659
3670
|
]);
|
|
3660
3671
|
|
|
3661
3672
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
3662
|
-
var
|
|
3663
|
-
var FontFamily =
|
|
3664
|
-
normal:
|
|
3665
|
-
bold:
|
|
3666
|
-
italics:
|
|
3667
|
-
bolditalics:
|
|
3668
|
-
});
|
|
3669
|
-
var CertificateConfig =
|
|
3670
|
-
id:
|
|
3671
|
-
event:
|
|
3672
|
-
isV2Template:
|
|
3673
|
+
var z26 = __toESM(require("zod/v4"));
|
|
3674
|
+
var FontFamily = z26.object({
|
|
3675
|
+
normal: z26.string(),
|
|
3676
|
+
bold: z26.string(),
|
|
3677
|
+
italics: z26.string(),
|
|
3678
|
+
bolditalics: z26.string()
|
|
3679
|
+
});
|
|
3680
|
+
var CertificateConfig = z26.object({
|
|
3681
|
+
id: z26.string(),
|
|
3682
|
+
event: z26.string(),
|
|
3683
|
+
isV2Template: z26.boolean().optional(),
|
|
3673
3684
|
label: TranslationConfig,
|
|
3674
|
-
isDefault:
|
|
3675
|
-
fee:
|
|
3676
|
-
onTime:
|
|
3677
|
-
late:
|
|
3678
|
-
delayed:
|
|
3685
|
+
isDefault: z26.boolean(),
|
|
3686
|
+
fee: z26.object({
|
|
3687
|
+
onTime: z26.number(),
|
|
3688
|
+
late: z26.number(),
|
|
3689
|
+
delayed: z26.number()
|
|
3679
3690
|
}),
|
|
3680
|
-
svgUrl:
|
|
3681
|
-
fonts:
|
|
3682
|
-
conditionals:
|
|
3691
|
+
svgUrl: z26.string(),
|
|
3692
|
+
fonts: z26.record(z26.string(), FontFamily).optional(),
|
|
3693
|
+
conditionals: z26.array(ShowConditional).optional()
|
|
3683
3694
|
});
|
|
3684
3695
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
3685
|
-
hash:
|
|
3686
|
-
svg:
|
|
3696
|
+
hash: z26.string().optional(),
|
|
3697
|
+
svg: z26.string()
|
|
3687
3698
|
});
|
|
3688
3699
|
|
|
3689
3700
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
3690
|
-
var
|
|
3691
|
-
var LanguageConfig =
|
|
3692
|
-
lang:
|
|
3701
|
+
var z27 = __toESM(require("zod/v4"));
|
|
3702
|
+
var LanguageConfig = z27.object({
|
|
3703
|
+
lang: z27.string(),
|
|
3693
3704
|
/**
|
|
3694
3705
|
* client.csv contents
|
|
3695
3706
|
*/
|
|
3696
|
-
messages:
|
|
3707
|
+
messages: z27.record(z27.string(), z27.string())
|
|
3697
3708
|
});
|
|
3698
3709
|
|
|
3699
3710
|
// ../commons/src/events/EventConfig.ts
|
|
3700
|
-
var
|
|
3711
|
+
var z35 = __toESM(require("zod/v4"));
|
|
3701
3712
|
|
|
3702
3713
|
// ../commons/src/events/SummaryConfig.ts
|
|
3703
|
-
var
|
|
3714
|
+
var z29 = __toESM(require("zod/v4"));
|
|
3704
3715
|
|
|
3705
3716
|
// ../commons/src/icons.ts
|
|
3706
|
-
var
|
|
3707
|
-
var AvailableIcons =
|
|
3717
|
+
var z28 = __toESM(require("zod/v4"));
|
|
3718
|
+
var AvailableIcons = z28.enum([
|
|
3708
3719
|
"Archived",
|
|
3709
3720
|
"Assigned",
|
|
3710
3721
|
"Briefcase",
|
|
@@ -3812,11 +3823,11 @@ var AvailableIcons = z27.enum([
|
|
|
3812
3823
|
]);
|
|
3813
3824
|
|
|
3814
3825
|
// ../commons/src/events/SummaryConfig.ts
|
|
3815
|
-
var InfoBox =
|
|
3816
|
-
type:
|
|
3826
|
+
var InfoBox = z29.object({
|
|
3827
|
+
type: z29.enum(["info", "positive", "warning", "negative"]).describe(
|
|
3817
3828
|
"Semantic tint of the icon block: info (blue), positive (green), warning (orange), negative (red)."
|
|
3818
3829
|
),
|
|
3819
|
-
background:
|
|
3830
|
+
background: z29.enum(["tinted", "white"]).default("tinted").optional().describe(
|
|
3820
3831
|
"tinted reads as a recessed empty state; white reads as a standalone card."
|
|
3821
3832
|
),
|
|
3822
3833
|
icon: AvailableIcons.optional().describe(
|
|
@@ -3828,50 +3839,50 @@ var InfoBox = z28.object({
|
|
|
3828
3839
|
description: TranslationConfig.optional().describe(
|
|
3829
3840
|
"Secondary copy displayed below the heading, typically a suggested next step."
|
|
3830
3841
|
),
|
|
3831
|
-
conditionals:
|
|
3842
|
+
conditionals: z29.array(ShowConditional).default([]).optional().describe(
|
|
3832
3843
|
"Conditions under which the info box is shown. When omitted, it is always shown."
|
|
3833
3844
|
)
|
|
3834
3845
|
}).describe(
|
|
3835
3846
|
"A compact icon-block + heading + description block displayed above the summary fields in the event overview."
|
|
3836
3847
|
);
|
|
3837
|
-
var BaseField2 =
|
|
3848
|
+
var BaseField2 = z29.object({
|
|
3838
3849
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
3839
3850
|
"Default message displayed when the field value is empty."
|
|
3840
3851
|
),
|
|
3841
|
-
conditionals:
|
|
3852
|
+
conditionals: z29.array(ShowConditional).default([]).optional()
|
|
3842
3853
|
});
|
|
3843
3854
|
var ReferenceField = BaseField2.extend({
|
|
3844
|
-
fieldId:
|
|
3855
|
+
fieldId: z29.string(),
|
|
3845
3856
|
label: TranslationConfig.optional().describe(
|
|
3846
3857
|
"Overrides the default label from the referenced field when provided."
|
|
3847
3858
|
)
|
|
3848
3859
|
}).describe("Field referencing existing event data by field ID.");
|
|
3849
3860
|
var Field = BaseField2.extend({
|
|
3850
|
-
id:
|
|
3861
|
+
id: z29.string().describe("Identifier of the summary field."),
|
|
3851
3862
|
value: TranslationConfig.describe(
|
|
3852
3863
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
3853
3864
|
),
|
|
3854
3865
|
label: TranslationConfig
|
|
3855
3866
|
}).describe("Custom field defined for the summary view.");
|
|
3856
|
-
var SummaryConfig =
|
|
3857
|
-
banners:
|
|
3867
|
+
var SummaryConfig = z29.object({
|
|
3868
|
+
banners: z29.array(InfoBox).default([]).optional().describe(
|
|
3858
3869
|
"Info boxes displayed above the summary fields in the event overview."
|
|
3859
3870
|
),
|
|
3860
|
-
fields:
|
|
3871
|
+
fields: z29.array(z29.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
3861
3872
|
}).meta({
|
|
3862
3873
|
id: "SummaryConfig",
|
|
3863
3874
|
description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
|
|
3864
3875
|
});
|
|
3865
3876
|
|
|
3866
3877
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
3867
|
-
var
|
|
3868
|
-
var MatchType =
|
|
3869
|
-
var BaseField3 =
|
|
3870
|
-
config:
|
|
3878
|
+
var z30 = __toESM(require("zod/v4"));
|
|
3879
|
+
var MatchType = z30.enum(["fuzzy", "exact", "range", "within"]);
|
|
3880
|
+
var BaseField3 = z30.object({
|
|
3881
|
+
config: z30.object({
|
|
3871
3882
|
type: MatchType.describe(
|
|
3872
3883
|
"Determines the search type of field. How to match value."
|
|
3873
3884
|
),
|
|
3874
|
-
searchFields:
|
|
3885
|
+
searchFields: z30.array(z30.string()).optional().describe(
|
|
3875
3886
|
`
|
|
3876
3887
|
Defines multiple form fields that should be searched when this field has a value.
|
|
3877
3888
|
All specified fields will be combined using OR logic.
|
|
@@ -3881,7 +3892,7 @@ var BaseField3 = z29.object({
|
|
|
3881
3892
|
`
|
|
3882
3893
|
)
|
|
3883
3894
|
}),
|
|
3884
|
-
type:
|
|
3895
|
+
type: z30.nativeEnum(FieldType).optional().describe(
|
|
3885
3896
|
`
|
|
3886
3897
|
Explicitly specify the field type for searchFields.
|
|
3887
3898
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -3895,7 +3906,7 @@ var BaseField3 = z29.object({
|
|
|
3895
3906
|
This is required when searchFields is defined.
|
|
3896
3907
|
`
|
|
3897
3908
|
),
|
|
3898
|
-
options:
|
|
3909
|
+
options: z30.array(SelectOption).optional(),
|
|
3899
3910
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
3900
3911
|
`
|
|
3901
3912
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -3916,7 +3927,7 @@ var BaseField3 = z29.object({
|
|
|
3916
3927
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
3917
3928
|
`
|
|
3918
3929
|
),
|
|
3919
|
-
conditionals:
|
|
3930
|
+
conditionals: z30.array(FieldConditional).optional().describe(
|
|
3920
3931
|
`
|
|
3921
3932
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
3922
3933
|
|
|
@@ -3930,23 +3941,23 @@ var BaseField3 = z29.object({
|
|
|
3930
3941
|
are always rendered in the advanced search form.
|
|
3931
3942
|
`
|
|
3932
3943
|
),
|
|
3933
|
-
validations:
|
|
3944
|
+
validations: z30.array(ValidationConfig).optional().describe(
|
|
3934
3945
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
3935
3946
|
),
|
|
3936
3947
|
allowedLocations: JurisdictionReference.optional().describe(
|
|
3937
3948
|
`Override the allowedLocations for a location field in advanced search. Use this when the declaration form's allowedLocations references a scope (e.g. record.create) that search-only users don't have \u2014 specify record.search scope instead.`
|
|
3938
3949
|
)
|
|
3939
3950
|
});
|
|
3940
|
-
var SearchQueryParams =
|
|
3941
|
-
eventType:
|
|
3951
|
+
var SearchQueryParams = z30.object({
|
|
3952
|
+
eventType: z30.string().optional().describe(
|
|
3942
3953
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
3943
3954
|
)
|
|
3944
3955
|
}).catchall(FieldValue);
|
|
3945
3956
|
var FieldConfigSchema = BaseField3.extend({
|
|
3946
|
-
fieldId:
|
|
3947
|
-
fieldType:
|
|
3957
|
+
fieldId: z30.string(),
|
|
3958
|
+
fieldType: z30.literal("field")
|
|
3948
3959
|
});
|
|
3949
|
-
var EventFieldIdInput =
|
|
3960
|
+
var EventFieldIdInput = z30.enum([
|
|
3950
3961
|
"trackingId",
|
|
3951
3962
|
"status",
|
|
3952
3963
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -3955,7 +3966,7 @@ var EventFieldIdInput = z29.enum([
|
|
|
3955
3966
|
"updatedAt"
|
|
3956
3967
|
]);
|
|
3957
3968
|
var METADATA_FIELD_PREFIX = "event.";
|
|
3958
|
-
var EventFieldId =
|
|
3969
|
+
var EventFieldId = z30.enum([
|
|
3959
3970
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
3960
3971
|
`${METADATA_FIELD_PREFIX}status`,
|
|
3961
3972
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -3965,29 +3976,29 @@ var EventFieldId = z29.enum([
|
|
|
3965
3976
|
]);
|
|
3966
3977
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
3967
3978
|
fieldId: EventFieldId,
|
|
3968
|
-
fieldType:
|
|
3979
|
+
fieldType: z30.literal("event")
|
|
3969
3980
|
});
|
|
3970
|
-
var AdvancedSearchField =
|
|
3981
|
+
var AdvancedSearchField = z30.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
3971
3982
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
3972
3983
|
if (!data.label) {
|
|
3973
3984
|
ctx.addIssue({
|
|
3974
|
-
code:
|
|
3985
|
+
code: z30.ZodIssueCode.custom,
|
|
3975
3986
|
message: "label is required when config.searchFields is defined.",
|
|
3976
3987
|
path: ["label"]
|
|
3977
3988
|
});
|
|
3978
3989
|
}
|
|
3979
3990
|
if (!data.type) {
|
|
3980
3991
|
ctx.addIssue({
|
|
3981
|
-
code:
|
|
3992
|
+
code: z30.ZodIssueCode.custom,
|
|
3982
3993
|
message: "type is required when config.searchFields is defined.",
|
|
3983
3994
|
path: ["type"]
|
|
3984
3995
|
});
|
|
3985
3996
|
}
|
|
3986
3997
|
}
|
|
3987
3998
|
});
|
|
3988
|
-
var AdvancedSearchConfig =
|
|
3999
|
+
var AdvancedSearchConfig = z30.object({
|
|
3989
4000
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3990
|
-
fields:
|
|
4001
|
+
fields: z30.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3991
4002
|
}).meta({
|
|
3992
4003
|
id: "AdvancedSearchConfig",
|
|
3993
4004
|
description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
|
|
@@ -3999,19 +4010,19 @@ var import_lodash4 = require("lodash");
|
|
|
3999
4010
|
// ../commons/src/conditionals/validate.ts
|
|
4000
4011
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
4001
4012
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
4002
|
-
var
|
|
4013
|
+
var z34 = __toESM(require("zod/v4"));
|
|
4003
4014
|
var import_date_fns2 = require("date-fns");
|
|
4004
4015
|
|
|
4005
4016
|
// ../commons/src/events/FieldTypeMapping.ts
|
|
4006
|
-
var
|
|
4017
|
+
var z32 = __toESM(require("zod/v4"));
|
|
4007
4018
|
|
|
4008
4019
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
4009
|
-
var
|
|
4020
|
+
var z31 = __toESM(require("zod/v4"));
|
|
4010
4021
|
function getDynamicNameValue(field3) {
|
|
4011
4022
|
const nameConfiguration = field3.configuration?.name;
|
|
4012
4023
|
const firstnameRequired = nameConfiguration?.firstname?.required ?? field3.required;
|
|
4013
4024
|
const surnameRequired = nameConfiguration?.surname?.required ?? field3.required;
|
|
4014
|
-
return
|
|
4025
|
+
return z31.object({
|
|
4015
4026
|
firstname: firstnameRequired ? NonEmptyTextValue : TextValue,
|
|
4016
4027
|
surname: surnameRequired ? NonEmptyTextValue : TextValue,
|
|
4017
4028
|
middlename: nameConfiguration?.middlename?.required ? NonEmptyTextValue : TextValue.optional()
|
|
@@ -4042,7 +4053,7 @@ function mapFieldTypeToZod(field3, actionType) {
|
|
|
4042
4053
|
let schema;
|
|
4043
4054
|
switch (field3.type) {
|
|
4044
4055
|
case FieldType.FIELD_GROUP: {
|
|
4045
|
-
schema =
|
|
4056
|
+
schema = z32.object(
|
|
4046
4057
|
field3.fields.reduce((acc, subfield) => {
|
|
4047
4058
|
acc[subfield.id] = mapFieldTypeToZod(subfield, actionType);
|
|
4048
4059
|
return acc;
|
|
@@ -4367,7 +4378,7 @@ var isNonInteractiveFieldType = (field3) => {
|
|
|
4367
4378
|
var import_lodash3 = require("lodash");
|
|
4368
4379
|
|
|
4369
4380
|
// ../commons/src/utils.ts
|
|
4370
|
-
var
|
|
4381
|
+
var z33 = __toESM(require("zod/v4"));
|
|
4371
4382
|
var _ = __toESM(require("lodash"));
|
|
4372
4383
|
function getOrThrow(x, message) {
|
|
4373
4384
|
if (x === void 0 || x === null) {
|
|
@@ -4378,11 +4389,11 @@ function getOrThrow(x, message) {
|
|
|
4378
4389
|
function joinValues(values, separator = " ") {
|
|
4379
4390
|
return values.filter((value) => !!value).join(separator).trim();
|
|
4380
4391
|
}
|
|
4381
|
-
var FullNameV1 =
|
|
4382
|
-
|
|
4383
|
-
use:
|
|
4384
|
-
family:
|
|
4385
|
-
given:
|
|
4392
|
+
var FullNameV1 = z33.array(
|
|
4393
|
+
z33.object({
|
|
4394
|
+
use: z33.string(),
|
|
4395
|
+
family: z33.string(),
|
|
4396
|
+
given: z33.array(z33.string())
|
|
4386
4397
|
})
|
|
4387
4398
|
);
|
|
4388
4399
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -5606,9 +5617,9 @@ var ajv = new import__.default({
|
|
|
5606
5617
|
strict: false
|
|
5607
5618
|
// Allow minContains and other newer features
|
|
5608
5619
|
});
|
|
5609
|
-
var DataContext =
|
|
5610
|
-
rootData:
|
|
5611
|
-
$leafAdminStructureLocationIds:
|
|
5620
|
+
var DataContext = z34.object({
|
|
5621
|
+
rootData: z34.object({
|
|
5622
|
+
$leafAdminStructureLocationIds: z34.array(z34.object({ id: UUID }))
|
|
5612
5623
|
})
|
|
5613
5624
|
});
|
|
5614
5625
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -6706,11 +6717,11 @@ function validateActionOrder(event2, ctx) {
|
|
|
6706
6717
|
}
|
|
6707
6718
|
|
|
6708
6719
|
// ../commons/src/events/EventConfig.ts
|
|
6709
|
-
var EventFieldReference =
|
|
6720
|
+
var EventFieldReference = z35.object({ $$event: EventMetadataDateFieldIdInput }).describe(
|
|
6710
6721
|
"Reference to a field defined in the event metadata, using the field id."
|
|
6711
6722
|
);
|
|
6712
|
-
var _EventConfigBase =
|
|
6713
|
-
id:
|
|
6723
|
+
var _EventConfigBase = z35.object({
|
|
6724
|
+
id: z35.string().describe(
|
|
6714
6725
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
6715
6726
|
),
|
|
6716
6727
|
dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
|
|
@@ -6729,25 +6740,25 @@ var _EventConfigBase = z34.object({
|
|
|
6729
6740
|
"Summary information displayed in the event overview."
|
|
6730
6741
|
),
|
|
6731
6742
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
6732
|
-
actions:
|
|
6743
|
+
actions: z35.array(ActionConfig).describe(
|
|
6733
6744
|
"Configuration of core and custom actions associated with the event."
|
|
6734
6745
|
),
|
|
6735
|
-
actionOrder:
|
|
6746
|
+
actionOrder: z35.array(z35.string()).optional().describe(
|
|
6736
6747
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
6737
6748
|
),
|
|
6738
6749
|
declaration: DeclarationFormConfig.describe(
|
|
6739
6750
|
"Configuration of the form used to gather event data."
|
|
6740
6751
|
),
|
|
6741
|
-
advancedSearch:
|
|
6752
|
+
advancedSearch: z35.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
6742
6753
|
"Configuration of fields available in the advanced search feature."
|
|
6743
6754
|
),
|
|
6744
|
-
flags:
|
|
6755
|
+
flags: z35.array(FlagConfig).optional().default([]).describe(
|
|
6745
6756
|
"Configuration of custom flags associated with the actions of this event type."
|
|
6746
6757
|
),
|
|
6747
|
-
analytics:
|
|
6758
|
+
analytics: z35.boolean().optional().default(true).describe(
|
|
6748
6759
|
"Indicates whether the records of this event type are included in analytics"
|
|
6749
6760
|
),
|
|
6750
|
-
icon:
|
|
6761
|
+
icon: z35.partialRecord(AvailableIcons, Conditional).optional().describe(
|
|
6751
6762
|
'Maps an icon name to a conditional. The icon of the first entry (in definition order) whose conditional matches the event is used when rendering it (e.g. in the "iconWithName"/"iconWithNameEvent" workqueue columns). Falls back to the default status-based icon when unset or when no conditional matches.'
|
|
6752
6763
|
)
|
|
6753
6764
|
});
|
|
@@ -6769,7 +6780,7 @@ var definePage = (page) => PageConfig.parse(page);
|
|
|
6769
6780
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
6770
6781
|
|
|
6771
6782
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
6772
|
-
var
|
|
6783
|
+
var z38 = __toESM(require("zod/v4"));
|
|
6773
6784
|
|
|
6774
6785
|
// ../commons/src/searchConfigs.ts
|
|
6775
6786
|
function createSearchConfig(baseField) {
|
|
@@ -6980,17 +6991,17 @@ var event = Object.assign(eventFn, {
|
|
|
6980
6991
|
});
|
|
6981
6992
|
|
|
6982
6993
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
6983
|
-
var
|
|
6994
|
+
var z36 = __toESM(require("zod/v4"));
|
|
6984
6995
|
var WorkqueueColumnKeysArray = [
|
|
6985
6996
|
...EventMetadataKeysArray,
|
|
6986
6997
|
"title",
|
|
6987
6998
|
"outbox"
|
|
6988
6999
|
];
|
|
6989
|
-
var WorkqueueColumnKeys =
|
|
6990
|
-
var WorkqueueColumnValue =
|
|
7000
|
+
var WorkqueueColumnKeys = z36.enum(WorkqueueColumnKeysArray);
|
|
7001
|
+
var WorkqueueColumnValue = z36.object({
|
|
6991
7002
|
$event: WorkqueueColumnKeys
|
|
6992
7003
|
});
|
|
6993
|
-
var WorkqueueColumn =
|
|
7004
|
+
var WorkqueueColumn = z36.object({
|
|
6994
7005
|
label: TranslationConfig,
|
|
6995
7006
|
value: WorkqueueColumnValue
|
|
6996
7007
|
}).meta({
|
|
@@ -7004,51 +7015,51 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
7004
7015
|
}
|
|
7005
7016
|
|
|
7006
7017
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
7007
|
-
var
|
|
7008
|
-
var SerializableExact =
|
|
7009
|
-
type:
|
|
7010
|
-
term:
|
|
7011
|
-
});
|
|
7012
|
-
var SerializableWithin =
|
|
7013
|
-
type:
|
|
7014
|
-
location:
|
|
7015
|
-
});
|
|
7016
|
-
var SerializedQueryExpression =
|
|
7017
|
-
eventType:
|
|
7018
|
-
status:
|
|
7019
|
-
createdAt:
|
|
7020
|
-
updatedAt:
|
|
7021
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
7022
|
-
"legalStatuses.DECLARED.createdByRole":
|
|
7023
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
7024
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
7025
|
-
"legalStatuses.REGISTERED.createdByRole":
|
|
7026
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
7027
|
-
createdAtLocation:
|
|
7028
|
-
|
|
7018
|
+
var z37 = __toESM(require("zod/v4"));
|
|
7019
|
+
var SerializableExact = z37.object({
|
|
7020
|
+
type: z37.literal("exact"),
|
|
7021
|
+
term: z37.union([z37.string(), SerializedUserField])
|
|
7022
|
+
});
|
|
7023
|
+
var SerializableWithin = z37.object({
|
|
7024
|
+
type: z37.literal("within"),
|
|
7025
|
+
location: z37.union([z37.string(), SerializedUserField])
|
|
7026
|
+
});
|
|
7027
|
+
var SerializedQueryExpression = z37.object({
|
|
7028
|
+
eventType: z37.string(),
|
|
7029
|
+
status: z37.optional(z37.union([AnyOfStatus, ExactStatus])),
|
|
7030
|
+
createdAt: z37.optional(DateCondition),
|
|
7031
|
+
updatedAt: z37.optional(DateCondition),
|
|
7032
|
+
"legalStatuses.DECLARED.createdAtLocation": z37.optional(SerializableWithin),
|
|
7033
|
+
"legalStatuses.DECLARED.createdByRole": z37.optional(AnyOf),
|
|
7034
|
+
"legalStatuses.REGISTERED.createdAt": z37.optional(DateCondition),
|
|
7035
|
+
"legalStatuses.REGISTERED.createdAtLocation": z37.optional(SerializableWithin),
|
|
7036
|
+
"legalStatuses.REGISTERED.createdByRole": z37.optional(AnyOf),
|
|
7037
|
+
"legalStatuses.REGISTERED.registrationNumber": z37.optional(Exact),
|
|
7038
|
+
createdAtLocation: z37.optional(
|
|
7039
|
+
z37.union([SerializableWithin, SerializableExact])
|
|
7029
7040
|
),
|
|
7030
|
-
updatedAtLocation:
|
|
7031
|
-
|
|
7041
|
+
updatedAtLocation: z37.optional(
|
|
7042
|
+
z37.union([SerializableWithin, SerializableExact])
|
|
7032
7043
|
),
|
|
7033
|
-
updatedByUserRole:
|
|
7034
|
-
assignedTo:
|
|
7035
|
-
createdBy:
|
|
7044
|
+
updatedByUserRole: z37.optional(SerializableExact),
|
|
7045
|
+
assignedTo: z37.optional(SerializableExact),
|
|
7046
|
+
createdBy: z37.optional(SerializableExact),
|
|
7036
7047
|
createdByUserType: ExactUserType,
|
|
7037
|
-
updatedBy:
|
|
7038
|
-
trackingId:
|
|
7039
|
-
flags:
|
|
7048
|
+
updatedBy: z37.optional(SerializableExact),
|
|
7049
|
+
trackingId: z37.optional(Exact),
|
|
7050
|
+
flags: z37.optional(ContainsFlags),
|
|
7040
7051
|
data: QueryInput
|
|
7041
7052
|
}).partial();
|
|
7042
|
-
var Or2 =
|
|
7043
|
-
type:
|
|
7044
|
-
clauses:
|
|
7053
|
+
var Or2 = z37.object({
|
|
7054
|
+
type: z37.literal("or"),
|
|
7055
|
+
clauses: z37.array(SerializedQueryExpression)
|
|
7045
7056
|
});
|
|
7046
|
-
var And2 =
|
|
7047
|
-
type:
|
|
7048
|
-
clauses:
|
|
7057
|
+
var And2 = z37.object({
|
|
7058
|
+
type: z37.literal("and"),
|
|
7059
|
+
clauses: z37.array(SerializedQueryExpression)
|
|
7049
7060
|
});
|
|
7050
|
-
var CountryConfigQueryType =
|
|
7051
|
-
var CountryConfigQueryInputType =
|
|
7061
|
+
var CountryConfigQueryType = z37.discriminatedUnion("type", [And2, Or2]);
|
|
7062
|
+
var CountryConfigQueryInputType = z37.union([
|
|
7052
7063
|
SerializedQueryExpression,
|
|
7053
7064
|
And2,
|
|
7054
7065
|
Or2
|
|
@@ -7073,16 +7084,16 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
7073
7084
|
value: event.field("updatedAt")
|
|
7074
7085
|
}
|
|
7075
7086
|
]);
|
|
7076
|
-
var WorkqueueConfig =
|
|
7077
|
-
slug:
|
|
7087
|
+
var WorkqueueConfig = z38.object({
|
|
7088
|
+
slug: z38.string().describe("Determines the url of the workqueue."),
|
|
7078
7089
|
name: TranslationConfig.describe(
|
|
7079
7090
|
"Title of the workflow (both in navigation and on the page)"
|
|
7080
7091
|
),
|
|
7081
7092
|
query: CountryConfigQueryType,
|
|
7082
|
-
action:
|
|
7093
|
+
action: z38.object({ type: WorkqueueActionType }).optional().describe(
|
|
7083
7094
|
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
7084
7095
|
),
|
|
7085
|
-
columns:
|
|
7096
|
+
columns: z38.array(WorkqueueColumn).default(mandatoryColumns),
|
|
7086
7097
|
icon: AvailableIcons,
|
|
7087
7098
|
emptyMessage: TranslationConfig.optional()
|
|
7088
7099
|
}).describe("Configuration for workqueue.");
|
|
@@ -7117,10 +7128,10 @@ function defineWorkqueues(workqueues) {
|
|
|
7117
7128
|
workqueues.forEach(warnOnConfigurationIssues);
|
|
7118
7129
|
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
|
7119
7130
|
}
|
|
7120
|
-
var WorkqueueCountInput =
|
|
7121
|
-
|
|
7131
|
+
var WorkqueueCountInput = z38.array(
|
|
7132
|
+
z38.object({ slug: z38.string(), query: QueryType })
|
|
7122
7133
|
);
|
|
7123
|
-
var WorkqueueCountOutput =
|
|
7134
|
+
var WorkqueueCountOutput = z38.record(z38.string(), z38.number());
|
|
7124
7135
|
|
|
7125
7136
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
7126
7137
|
var defaultWorkqueueColumns = [
|
|
@@ -7143,21 +7154,21 @@ var defaultWorkqueueColumns = [
|
|
|
7143
7154
|
];
|
|
7144
7155
|
|
|
7145
7156
|
// ../commons/src/events/Draft.ts
|
|
7146
|
-
var
|
|
7157
|
+
var z40 = __toESM(require("zod/v4"));
|
|
7147
7158
|
|
|
7148
7159
|
// ../commons/src/events/ActionInput.ts
|
|
7149
|
-
var
|
|
7150
|
-
var BaseActionInput =
|
|
7160
|
+
var z39 = __toESM(require("zod/v4"));
|
|
7161
|
+
var BaseActionInput = z39.object({
|
|
7151
7162
|
eventId: UUID,
|
|
7152
|
-
transactionId:
|
|
7163
|
+
transactionId: z39.string(),
|
|
7153
7164
|
declaration: ActionUpdate.default({}),
|
|
7154
7165
|
annotation: ActionUpdate.optional(),
|
|
7155
7166
|
originalActionId: UUID.optional(),
|
|
7156
7167
|
// should not be part of base action.
|
|
7157
|
-
keepAssignment:
|
|
7158
|
-
keepAssignmentIfAccepted:
|
|
7159
|
-
keepAssignmentIfRejected:
|
|
7160
|
-
waitFor:
|
|
7168
|
+
keepAssignment: z39.boolean().optional(),
|
|
7169
|
+
keepAssignmentIfAccepted: z39.boolean().optional(),
|
|
7170
|
+
keepAssignmentIfRejected: z39.boolean().optional(),
|
|
7171
|
+
waitFor: z39.boolean().default(true).describe(
|
|
7161
7172
|
"Whether action waits for the indexing before returning. Defaults to true. Setting this to to false completes faster but might lead to stale data in the client if the client tries to read the event immediately after performing the action. Use with care."
|
|
7162
7173
|
),
|
|
7163
7174
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
@@ -7167,8 +7178,8 @@ var BaseActionInput = z38.object({
|
|
|
7167
7178
|
)
|
|
7168
7179
|
});
|
|
7169
7180
|
var CreateActionInput = BaseActionInput.extend(
|
|
7170
|
-
|
|
7171
|
-
type:
|
|
7181
|
+
z39.object({
|
|
7182
|
+
type: z39.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
7172
7183
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
7173
7184
|
createdAtLocation: UUID.nullish().describe(
|
|
7174
7185
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
@@ -7176,14 +7187,14 @@ var CreateActionInput = BaseActionInput.extend(
|
|
|
7176
7187
|
}).shape
|
|
7177
7188
|
);
|
|
7178
7189
|
var RegisterActionInput = BaseActionInput.extend(
|
|
7179
|
-
|
|
7180
|
-
type:
|
|
7181
|
-
registrationNumber:
|
|
7190
|
+
z39.strictObject({
|
|
7191
|
+
type: z39.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
7192
|
+
registrationNumber: z39.string().optional()
|
|
7182
7193
|
}).shape
|
|
7183
7194
|
);
|
|
7184
7195
|
var NotifyActionInput = BaseActionInput.extend(
|
|
7185
|
-
|
|
7186
|
-
type:
|
|
7196
|
+
z39.object({
|
|
7197
|
+
type: z39.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
|
|
7187
7198
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
7188
7199
|
createdAtLocation: UUID.nullish().describe(
|
|
7189
7200
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
@@ -7199,51 +7210,51 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
7199
7210
|
}
|
|
7200
7211
|
});
|
|
7201
7212
|
var DeclareActionInput = BaseActionInput.extend(
|
|
7202
|
-
|
|
7203
|
-
type:
|
|
7213
|
+
z39.object({
|
|
7214
|
+
type: z39.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
7204
7215
|
}).shape
|
|
7205
7216
|
);
|
|
7206
7217
|
var EditActionInput = BaseActionInput.extend(
|
|
7207
|
-
|
|
7208
|
-
type:
|
|
7218
|
+
z39.object({
|
|
7219
|
+
type: z39.literal(ActionType.EDIT).default(ActionType.EDIT)
|
|
7209
7220
|
}).shape
|
|
7210
7221
|
);
|
|
7211
7222
|
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
7212
|
-
|
|
7213
|
-
type:
|
|
7223
|
+
z39.object({
|
|
7224
|
+
type: z39.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
7214
7225
|
content: PrintContent.optional()
|
|
7215
7226
|
}).shape
|
|
7216
7227
|
);
|
|
7217
7228
|
var RejectDeclarationActionInput = BaseActionInput.extend(
|
|
7218
|
-
|
|
7219
|
-
type:
|
|
7229
|
+
z39.object({
|
|
7230
|
+
type: z39.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
7220
7231
|
content: ReasonContent
|
|
7221
7232
|
}).shape
|
|
7222
7233
|
);
|
|
7223
7234
|
var DuplicateDetectedActionInput = BaseActionInput.extend(
|
|
7224
|
-
|
|
7225
|
-
type:
|
|
7226
|
-
content:
|
|
7227
|
-
duplicates:
|
|
7235
|
+
z39.object({
|
|
7236
|
+
type: z39.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
7237
|
+
content: z39.object({
|
|
7238
|
+
duplicates: z39.array(PotentialDuplicate)
|
|
7228
7239
|
})
|
|
7229
7240
|
}).shape
|
|
7230
7241
|
);
|
|
7231
7242
|
var MarkAsDuplicateActionInput = BaseActionInput.extend(
|
|
7232
|
-
|
|
7233
|
-
type:
|
|
7234
|
-
content:
|
|
7243
|
+
z39.object({
|
|
7244
|
+
type: z39.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
7245
|
+
content: z39.object({
|
|
7235
7246
|
duplicateOf: UUID
|
|
7236
7247
|
}).optional()
|
|
7237
7248
|
}).shape
|
|
7238
7249
|
);
|
|
7239
7250
|
var MarkNotDuplicateActionInput = BaseActionInput.extend(
|
|
7240
|
-
|
|
7241
|
-
type:
|
|
7251
|
+
z39.object({
|
|
7252
|
+
type: z39.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
7242
7253
|
}).shape
|
|
7243
7254
|
);
|
|
7244
7255
|
var ArchiveActionInput = BaseActionInput.extend(
|
|
7245
|
-
|
|
7246
|
-
type:
|
|
7256
|
+
z39.object({
|
|
7257
|
+
type: z39.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
7247
7258
|
/**
|
|
7248
7259
|
* Archiving does not collect a reason on its own. Only the
|
|
7249
7260
|
* "mark as duplicate" flow archives with a reason attached.
|
|
@@ -7252,54 +7263,54 @@ var ArchiveActionInput = BaseActionInput.extend(
|
|
|
7252
7263
|
}).shape
|
|
7253
7264
|
);
|
|
7254
7265
|
var UnarchiveActionInput = BaseActionInput.extend(
|
|
7255
|
-
|
|
7256
|
-
type:
|
|
7266
|
+
z39.object({
|
|
7267
|
+
type: z39.literal(ActionType.UNARCHIVE).default(ActionType.UNARCHIVE)
|
|
7257
7268
|
}).shape
|
|
7258
7269
|
);
|
|
7259
7270
|
var AssignActionInput = BaseActionInput.extend(
|
|
7260
|
-
|
|
7261
|
-
type:
|
|
7262
|
-
assignedTo:
|
|
7271
|
+
z39.object({
|
|
7272
|
+
type: z39.literal(ActionType.ASSIGN),
|
|
7273
|
+
assignedTo: z39.string()
|
|
7263
7274
|
}).shape
|
|
7264
7275
|
);
|
|
7265
7276
|
var UnassignActionInput = BaseActionInput.extend(
|
|
7266
|
-
|
|
7267
|
-
type:
|
|
7268
|
-
assignedTo:
|
|
7277
|
+
z39.object({
|
|
7278
|
+
type: z39.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
7279
|
+
assignedTo: z39.literal(null).default(null)
|
|
7269
7280
|
}).shape
|
|
7270
7281
|
);
|
|
7271
7282
|
var RequestCorrectionActionInput = BaseActionInput.extend(
|
|
7272
|
-
|
|
7273
|
-
type:
|
|
7283
|
+
z39.object({
|
|
7284
|
+
type: z39.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
7274
7285
|
}).shape
|
|
7275
7286
|
);
|
|
7276
7287
|
var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
7277
|
-
|
|
7278
|
-
requestId:
|
|
7279
|
-
type:
|
|
7288
|
+
z39.object({
|
|
7289
|
+
requestId: z39.string(),
|
|
7290
|
+
type: z39.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
7280
7291
|
content: ReasonContent
|
|
7281
7292
|
}).shape
|
|
7282
7293
|
);
|
|
7283
7294
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
7284
|
-
|
|
7285
|
-
requestId:
|
|
7286
|
-
type:
|
|
7287
|
-
content:
|
|
7295
|
+
z39.object({
|
|
7296
|
+
requestId: z39.string(),
|
|
7297
|
+
type: z39.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
7298
|
+
content: z39.object({ immediateCorrection: z39.boolean().optional() }).optional()
|
|
7288
7299
|
}).shape
|
|
7289
7300
|
);
|
|
7290
7301
|
var ReadActionInput = BaseActionInput.extend(
|
|
7291
|
-
|
|
7292
|
-
type:
|
|
7302
|
+
z39.object({
|
|
7303
|
+
type: z39.literal(ActionType.READ).default(ActionType.READ)
|
|
7293
7304
|
}).shape
|
|
7294
7305
|
);
|
|
7295
|
-
var DeleteActionInput =
|
|
7306
|
+
var DeleteActionInput = z39.object({ eventId: UUID });
|
|
7296
7307
|
var CustomActionInput = BaseActionInput.extend(
|
|
7297
|
-
|
|
7298
|
-
type:
|
|
7299
|
-
customActionType:
|
|
7308
|
+
z39.object({
|
|
7309
|
+
type: z39.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
|
|
7310
|
+
customActionType: z39.string().describe("Name of the custom action.")
|
|
7300
7311
|
}).shape
|
|
7301
7312
|
);
|
|
7302
|
-
var ActionInput =
|
|
7313
|
+
var ActionInput = z39.discriminatedUnion("type", [
|
|
7303
7314
|
CreateActionInput.meta({ id: "CreateActionInput" }),
|
|
7304
7315
|
RegisterActionInput.meta({ id: "RegisterActionInput" }),
|
|
7305
7316
|
NotifyActionInput.meta({ id: "NotifyActionInput" }),
|
|
@@ -7336,11 +7347,11 @@ var ActionInput = z38.discriminatedUnion("type", [
|
|
|
7336
7347
|
});
|
|
7337
7348
|
|
|
7338
7349
|
// ../commons/src/events/Draft.ts
|
|
7339
|
-
var Draft =
|
|
7350
|
+
var Draft = z40.object({
|
|
7340
7351
|
id: UUID,
|
|
7341
7352
|
eventId: UUID,
|
|
7342
|
-
transactionId:
|
|
7343
|
-
createdAt:
|
|
7353
|
+
transactionId: z40.string(),
|
|
7354
|
+
createdAt: z40.string().datetime(),
|
|
7344
7355
|
action: ActionBase.extend({
|
|
7345
7356
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE])
|
|
7346
7357
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -7349,7 +7360,7 @@ var Draft = z39.object({
|
|
|
7349
7360
|
);
|
|
7350
7361
|
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
7351
7362
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
7352
|
-
status:
|
|
7363
|
+
status: z40.enum([
|
|
7353
7364
|
ActionStatus.Requested,
|
|
7354
7365
|
ActionStatus.Accepted,
|
|
7355
7366
|
ActionStatus.Rejected
|
|
@@ -7357,30 +7368,33 @@ var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
|
7357
7368
|
});
|
|
7358
7369
|
|
|
7359
7370
|
// ../commons/src/events/EventInput.ts
|
|
7360
|
-
var
|
|
7371
|
+
var z41 = __toESM(require("zod/v4"));
|
|
7361
7372
|
var import_uuid11 = require("uuid");
|
|
7362
|
-
var EventInput =
|
|
7363
|
-
transactionId:
|
|
7364
|
-
type:
|
|
7373
|
+
var EventInput = z41.object({
|
|
7374
|
+
transactionId: z41.string(),
|
|
7375
|
+
type: z41.string(),
|
|
7365
7376
|
createdAtLocation: UUID.nullish().describe(
|
|
7366
7377
|
"Location where the event occurred. Required for system users."
|
|
7367
7378
|
)
|
|
7368
7379
|
}).meta({ default: { transactionId: (0, import_uuid11.v4)(), type: "birth" } });
|
|
7369
7380
|
|
|
7370
7381
|
// ../commons/src/events/EventDocument.ts
|
|
7371
|
-
var
|
|
7372
|
-
var EventDocument =
|
|
7382
|
+
var z42 = __toESM(require("zod/v4"));
|
|
7383
|
+
var EventDocument = z42.object({
|
|
7373
7384
|
id: UUID.describe("Unique identifier of the event."),
|
|
7374
|
-
type:
|
|
7375
|
-
createdAt:
|
|
7376
|
-
updatedAt:
|
|
7385
|
+
type: z42.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
7386
|
+
createdAt: z42.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
7387
|
+
updatedAt: z42.string().datetime().describe(
|
|
7377
7388
|
"Timestamp of the last update, excluding changes from actions."
|
|
7378
7389
|
),
|
|
7379
|
-
actions:
|
|
7380
|
-
trackingId:
|
|
7390
|
+
actions: z42.array(Action).describe("Ordered list of actions associated with the event."),
|
|
7391
|
+
trackingId: z42.string().describe(
|
|
7381
7392
|
"System-generated tracking identifier used to look up the event."
|
|
7382
7393
|
)
|
|
7383
7394
|
}).meta({ id: "EventDocument" });
|
|
7395
|
+
var EventDocumentOnlyLastAction = EventDocument.extend({
|
|
7396
|
+
actions: z42.array(Action).max(1).describe("Only the last action associated with the event.")
|
|
7397
|
+
}).brand("EventDocumentOnlyLastAction");
|
|
7384
7398
|
|
|
7385
7399
|
// ../commons/src/events/defineConfig.ts
|
|
7386
7400
|
var IGNORED_EVENT_TYPES = [
|
|
@@ -9839,9 +9853,9 @@ var digitalIdentityEvent = defineConfig({
|
|
|
9839
9853
|
});
|
|
9840
9854
|
|
|
9841
9855
|
// ../commons/src/events/test.utils.ts
|
|
9842
|
-
var
|
|
9856
|
+
var z43 = __toESM(require("zod/v4"));
|
|
9843
9857
|
var TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
|
9844
|
-
var TestUserRole =
|
|
9858
|
+
var TestUserRole = z43.enum([
|
|
9845
9859
|
"FIELD_AGENT",
|
|
9846
9860
|
"LOCAL_REGISTRAR",
|
|
9847
9861
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -10706,36 +10720,36 @@ function isFieldConfigDefaultValue(value) {
|
|
|
10706
10720
|
var import_lodash6 = require("lodash");
|
|
10707
10721
|
|
|
10708
10722
|
// ../commons/src/events/locations.ts
|
|
10709
|
-
var
|
|
10710
|
-
var LocationTypeV1 =
|
|
10723
|
+
var z44 = __toESM(require("zod/v4"));
|
|
10724
|
+
var LocationTypeV1 = z44.enum([
|
|
10711
10725
|
"ADMIN_STRUCTURE",
|
|
10712
10726
|
"CRVS_OFFICE",
|
|
10713
10727
|
"HEALTH_FACILITY"
|
|
10714
10728
|
]);
|
|
10715
|
-
var LocationStatus =
|
|
10716
|
-
var LocationVersion =
|
|
10729
|
+
var LocationStatus = z44.enum(["active", "inactive"]);
|
|
10730
|
+
var LocationVersion = z44.object({
|
|
10717
10731
|
versionId: UUID,
|
|
10718
|
-
effectiveFrom:
|
|
10719
|
-
name:
|
|
10720
|
-
externalId:
|
|
10732
|
+
effectiveFrom: z44.iso.date(),
|
|
10733
|
+
name: z44.string(),
|
|
10734
|
+
externalId: z44.string().nullish(),
|
|
10721
10735
|
status: LocationStatus
|
|
10722
10736
|
});
|
|
10723
|
-
var AdministrativeArea =
|
|
10737
|
+
var AdministrativeArea = z44.object({
|
|
10724
10738
|
id: UUID,
|
|
10725
|
-
name:
|
|
10726
|
-
externalId:
|
|
10739
|
+
name: z44.string(),
|
|
10740
|
+
externalId: z44.string().nullish(),
|
|
10727
10741
|
parentId: UUID.nullable(),
|
|
10728
10742
|
status: LocationStatus,
|
|
10729
|
-
versions:
|
|
10743
|
+
versions: z44.array(LocationVersion)
|
|
10730
10744
|
});
|
|
10731
|
-
var Location =
|
|
10745
|
+
var Location = z44.object({
|
|
10732
10746
|
id: UUID,
|
|
10733
|
-
name:
|
|
10734
|
-
externalId:
|
|
10747
|
+
name: z44.string(),
|
|
10748
|
+
externalId: z44.string().nullish(),
|
|
10735
10749
|
administrativeAreaId: UUID.nullable(),
|
|
10736
|
-
locationType:
|
|
10750
|
+
locationType: z44.string().nullable(),
|
|
10737
10751
|
status: LocationStatus,
|
|
10738
|
-
versions:
|
|
10752
|
+
versions: z44.array(LocationVersion)
|
|
10739
10753
|
});
|
|
10740
10754
|
var ClientAdministrativeArea = AdministrativeArea.omit({
|
|
10741
10755
|
name: true,
|
|
@@ -10776,22 +10790,22 @@ function validateUniqueIds(versions, ctx) {
|
|
|
10776
10790
|
ctx.addIssue("versions must not repeat a versionId");
|
|
10777
10791
|
}
|
|
10778
10792
|
}
|
|
10779
|
-
var SeededLocationVersions =
|
|
10793
|
+
var SeededLocationVersions = z44.array(LocationVersion).min(1).superRefine((versions, ctx) => {
|
|
10780
10794
|
validateAscendingDates(versions, ctx);
|
|
10781
10795
|
validateUniqueIds(versions, ctx);
|
|
10782
10796
|
});
|
|
10783
|
-
var SetLocationPayload =
|
|
10797
|
+
var SetLocationPayload = z44.object({
|
|
10784
10798
|
id: UUID,
|
|
10785
|
-
name:
|
|
10786
|
-
externalId:
|
|
10799
|
+
name: z44.string(),
|
|
10800
|
+
externalId: z44.string().nullish(),
|
|
10787
10801
|
administrativeAreaId: UUID.nullable(),
|
|
10788
|
-
locationType:
|
|
10802
|
+
locationType: z44.string().nullable(),
|
|
10789
10803
|
versions: SeededLocationVersions.optional()
|
|
10790
10804
|
});
|
|
10791
|
-
var SetAdministrativeAreaPayload =
|
|
10805
|
+
var SetAdministrativeAreaPayload = z44.object({
|
|
10792
10806
|
id: UUID,
|
|
10793
|
-
name:
|
|
10794
|
-
externalId:
|
|
10807
|
+
name: z44.string(),
|
|
10808
|
+
externalId: z44.string().nullish(),
|
|
10795
10809
|
parentId: UUID.nullable(),
|
|
10796
10810
|
versions: SeededLocationVersions.optional()
|
|
10797
10811
|
});
|
|
@@ -10862,6 +10876,9 @@ function canAccessEventWithScope(event2, scope, user2, customActionType) {
|
|
|
10862
10876
|
}
|
|
10863
10877
|
if (scopeUsesDeclaredOptions(scope)) {
|
|
10864
10878
|
const { options } = scope;
|
|
10879
|
+
if (options?.status && (!event2.status || !options.status.includes(event2.status))) {
|
|
10880
|
+
return false;
|
|
10881
|
+
}
|
|
10865
10882
|
if (options?.notifiedBy === UserFilter.enum.user) {
|
|
10866
10883
|
if (event2.legalStatuses?.NOTIFIED?.createdBy !== user2.id) {
|
|
10867
10884
|
return false;
|
|
@@ -11660,49 +11677,49 @@ var V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
|
11660
11677
|
);
|
|
11661
11678
|
|
|
11662
11679
|
// ../commons/src/events/locationPayloads.ts
|
|
11663
|
-
var
|
|
11664
|
-
var CreateLocationPayload =
|
|
11680
|
+
var z45 = __toESM(require("zod/v4"));
|
|
11681
|
+
var CreateLocationPayload = z45.object({
|
|
11665
11682
|
id: UUID.optional(),
|
|
11666
11683
|
versionId: UUID.optional(),
|
|
11667
|
-
name:
|
|
11668
|
-
externalId:
|
|
11684
|
+
name: z45.string(),
|
|
11685
|
+
externalId: z45.string().nullish(),
|
|
11669
11686
|
administrativeAreaId: UUID.nullable(),
|
|
11670
|
-
locationType:
|
|
11671
|
-
effectiveFrom:
|
|
11687
|
+
locationType: z45.string().nullable(),
|
|
11688
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
11672
11689
|
status: LocationStatus.default("active")
|
|
11673
11690
|
});
|
|
11674
|
-
var UpdateLocationPayload =
|
|
11691
|
+
var UpdateLocationPayload = z45.strictObject({
|
|
11675
11692
|
id: UUID,
|
|
11676
11693
|
versionId: UUID.optional(),
|
|
11677
|
-
name:
|
|
11678
|
-
externalId:
|
|
11694
|
+
name: z45.string(),
|
|
11695
|
+
externalId: z45.string().nullish(),
|
|
11679
11696
|
status: LocationStatus,
|
|
11680
|
-
effectiveFrom:
|
|
11697
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
11681
11698
|
lastVersionId: UUID
|
|
11682
11699
|
});
|
|
11683
|
-
var WithdrawLocationVersionPayload =
|
|
11700
|
+
var WithdrawLocationVersionPayload = z45.object({
|
|
11684
11701
|
id: UUID,
|
|
11685
11702
|
versionId: UUID
|
|
11686
11703
|
});
|
|
11687
|
-
var CreateAdministrativeAreaPayload =
|
|
11704
|
+
var CreateAdministrativeAreaPayload = z45.object({
|
|
11688
11705
|
id: UUID.optional(),
|
|
11689
11706
|
versionId: UUID.optional(),
|
|
11690
|
-
name:
|
|
11691
|
-
externalId:
|
|
11707
|
+
name: z45.string(),
|
|
11708
|
+
externalId: z45.string().nullish(),
|
|
11692
11709
|
parentId: UUID.nullable(),
|
|
11693
|
-
effectiveFrom:
|
|
11710
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
11694
11711
|
status: LocationStatus.default("active")
|
|
11695
11712
|
});
|
|
11696
|
-
var UpdateAdministrativeAreaPayload =
|
|
11713
|
+
var UpdateAdministrativeAreaPayload = z45.strictObject({
|
|
11697
11714
|
id: UUID,
|
|
11698
11715
|
versionId: UUID.optional(),
|
|
11699
|
-
name:
|
|
11700
|
-
externalId:
|
|
11716
|
+
name: z45.string(),
|
|
11717
|
+
externalId: z45.string().nullish(),
|
|
11701
11718
|
status: LocationStatus,
|
|
11702
|
-
effectiveFrom:
|
|
11719
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
11703
11720
|
lastVersionId: UUID
|
|
11704
11721
|
});
|
|
11705
|
-
var WithdrawAdministrativeAreaVersionPayload =
|
|
11722
|
+
var WithdrawAdministrativeAreaVersionPayload = z45.object({
|
|
11706
11723
|
id: UUID,
|
|
11707
11724
|
versionId: UUID
|
|
11708
11725
|
});
|