@nira-opencrvs/toolkit 1.9.13-rc.cdfd84c → 1.9.13-rc.ce5957d
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/dist/commons/api/router.d.ts +8 -7
- package/dist/commons/events/ActionConfig.d.ts +36 -36
- package/dist/commons/events/AdvancedSearchConfig.d.ts +30 -24
- package/dist/commons/events/DeduplicationConfig.d.ts +2 -2
- package/dist/commons/events/EventConfig.d.ts +50 -48
- package/dist/commons/events/EventIndex.d.ts +3 -0
- package/dist/commons/events/FieldConfig.d.ts +381 -132
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +87 -1
- package/dist/commons/events/FieldValue.d.ts +70 -3
- package/dist/commons/events/Icd11.d.ts +52 -0
- package/dist/commons/events/defineConfig.d.ts +7 -7
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/utils.d.ts +7 -7
- package/dist/events/index.js +873 -779
- package/dist/notification/index.js +840 -798
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
|
@@ -140,6 +140,8 @@ __export(events_exports, {
|
|
|
140
140
|
GeographicalArea: () => GeographicalArea,
|
|
141
141
|
HttpFieldUpdateValue: () => HttpFieldUpdateValue,
|
|
142
142
|
HttpFieldValue: () => HttpFieldValue,
|
|
143
|
+
Icd11FieldUpdateValue: () => Icd11FieldUpdateValue,
|
|
144
|
+
Icd11FieldValue: () => Icd11FieldValue,
|
|
143
145
|
IdReaderFieldValue: () => IdReaderFieldValue,
|
|
144
146
|
ImageMimeType: () => ImageMimeType,
|
|
145
147
|
InherentFlags: () => InherentFlags,
|
|
@@ -255,6 +257,7 @@ __export(events_exports, {
|
|
|
255
257
|
eventMetadataLabelMap: () => eventMetadataLabelMap,
|
|
256
258
|
eventPayloadGenerator: () => eventPayloadGenerator,
|
|
257
259
|
eventQueryDataGenerator: () => eventQueryDataGenerator,
|
|
260
|
+
extractIcd11LabelFromMatchingPV: () => extractIcd11LabelFromMatchingPV,
|
|
258
261
|
extractPotentialDuplicatesFromActions: () => extractPotentialDuplicatesFromActions,
|
|
259
262
|
field: () => field,
|
|
260
263
|
fieldConfigsToActionPayload: () => fieldConfigsToActionPayload,
|
|
@@ -265,6 +268,7 @@ __export(events_exports, {
|
|
|
265
268
|
findRecordActionPages: () => findRecordActionPages,
|
|
266
269
|
flattenFieldReference: () => flattenFieldReference,
|
|
267
270
|
flattenFormState: () => flattenFormState,
|
|
271
|
+
formatIcd11Value: () => formatIcd11Value,
|
|
268
272
|
generateActionDeclarationInput: () => generateActionDeclarationInput,
|
|
269
273
|
generateActionDocument: () => generateActionDocument,
|
|
270
274
|
generateActionDuplicateDeclarationInput: () => generateActionDuplicateDeclarationInput,
|
|
@@ -334,6 +338,7 @@ __export(events_exports, {
|
|
|
334
338
|
isFileFieldType: () => isFileFieldType,
|
|
335
339
|
isFileFieldWithOptionType: () => isFileFieldWithOptionType,
|
|
336
340
|
isHttpFieldType: () => isHttpFieldType,
|
|
341
|
+
isIcd11FieldType: () => isIcd11FieldType,
|
|
337
342
|
isIdFieldType: () => isIdFieldType,
|
|
338
343
|
isIdReaderFieldType: () => isIdReaderFieldType,
|
|
339
344
|
isLinkButtonFieldType: () => isLinkButtonFieldType,
|
|
@@ -378,11 +383,13 @@ __export(events_exports, {
|
|
|
378
383
|
omitHiddenFields: () => omitHiddenFields,
|
|
379
384
|
omitHiddenPaginatedFields: () => omitHiddenPaginatedFields,
|
|
380
385
|
or: () => or,
|
|
386
|
+
parseIcd11SearchResponse: () => parseIcd11SearchResponse,
|
|
381
387
|
plainDateToLocalDate: () => plainDateToLocalDate,
|
|
382
388
|
resolveDateOfEvent: () => resolveDateOfEvent,
|
|
383
389
|
runFieldValidations: () => runFieldValidations,
|
|
384
390
|
runStructuralValidations: () => runStructuralValidations,
|
|
385
391
|
safeUnion: () => safeUnion,
|
|
392
|
+
stripIcd11Html: () => stripIcd11Html,
|
|
386
393
|
timePeriodToDateRange: () => timePeriodToDateRange,
|
|
387
394
|
user: () => user,
|
|
388
395
|
validate: () => validate,
|
|
@@ -399,7 +406,7 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
|
399
406
|
var BIRTH_EVENT = "birth";
|
|
400
407
|
|
|
401
408
|
// ../commons/src/events/ActionConfig.ts
|
|
402
|
-
var
|
|
409
|
+
var import_zod22 = require("zod");
|
|
403
410
|
|
|
404
411
|
// ../commons/src/events/TranslationConfig.ts
|
|
405
412
|
var import_zod = require("zod");
|
|
@@ -525,7 +532,7 @@ function isMetaAction(actionType) {
|
|
|
525
532
|
}
|
|
526
533
|
|
|
527
534
|
// ../commons/src/events/FieldConfig.ts
|
|
528
|
-
var
|
|
535
|
+
var import_zod18 = require("zod");
|
|
529
536
|
|
|
530
537
|
// ../commons/src/events/Conditional.ts
|
|
531
538
|
var import_zod3 = require("zod");
|
|
@@ -621,7 +628,8 @@ var FieldType = {
|
|
|
621
628
|
QUERY_PARAM_READER: "QUERY_PARAM_READER",
|
|
622
629
|
QR_READER: "QR_READER",
|
|
623
630
|
ID_READER: "ID_READER",
|
|
624
|
-
LOADER: "LOADER"
|
|
631
|
+
LOADER: "LOADER",
|
|
632
|
+
ICD11: "ICD11"
|
|
625
633
|
};
|
|
626
634
|
var FileFieldType = import_zod4.z.enum([
|
|
627
635
|
FieldType.FILE,
|
|
@@ -651,7 +659,7 @@ var FieldTypesToHideInReview = [
|
|
|
651
659
|
];
|
|
652
660
|
|
|
653
661
|
// ../commons/src/events/FieldValue.ts
|
|
654
|
-
var
|
|
662
|
+
var import_zod9 = require("zod");
|
|
655
663
|
|
|
656
664
|
// ../commons/src/documents.ts
|
|
657
665
|
var import_zod5 = require("zod");
|
|
@@ -764,48 +772,92 @@ var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
|
|
|
764
772
|
unit: import_zod6.z.string().optional()
|
|
765
773
|
});
|
|
766
774
|
|
|
767
|
-
// ../commons/src/events/
|
|
775
|
+
// ../commons/src/events/Icd11.ts
|
|
768
776
|
var import_zod7 = require("zod");
|
|
769
|
-
var
|
|
777
|
+
var Icd11FieldValue = import_zod7.z.object({
|
|
778
|
+
code: import_zod7.z.string(),
|
|
779
|
+
label: import_zod7.z.string()
|
|
780
|
+
});
|
|
781
|
+
var Icd11FieldUpdateValue = import_zod7.z.object({
|
|
782
|
+
code: import_zod7.z.string().optional(),
|
|
783
|
+
label: import_zod7.z.string().optional()
|
|
784
|
+
});
|
|
785
|
+
function stripIcd11Html(raw) {
|
|
786
|
+
return raw.replace(/<[^>]*>/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/�?39;/g, "'").replace(/'/g, "'").replace(/ /g, " ").trim();
|
|
787
|
+
}
|
|
788
|
+
function extractIcd11LabelFromMatchingPV(rawLabel) {
|
|
789
|
+
const withoutTags = stripIcd11Html(rawLabel);
|
|
790
|
+
const bracketMatch = /\[([^\]]+)]/.exec(withoutTags);
|
|
791
|
+
return (bracketMatch ? bracketMatch[1] : withoutTags).trim();
|
|
792
|
+
}
|
|
793
|
+
function toIcd11SearchResult(entity) {
|
|
794
|
+
const code = entity.theCode;
|
|
795
|
+
if (!code) {
|
|
796
|
+
return void 0;
|
|
797
|
+
}
|
|
798
|
+
const cleanTitle = entity.title ? stripIcd11Html(entity.title) : "";
|
|
799
|
+
const rawFallback = entity.matchingPVs?.[0]?.label;
|
|
800
|
+
const label = cleanTitle || (rawFallback ? extractIcd11LabelFromMatchingPV(rawFallback) : void 0);
|
|
801
|
+
if (!label) {
|
|
802
|
+
return void 0;
|
|
803
|
+
}
|
|
804
|
+
return { code, label };
|
|
805
|
+
}
|
|
806
|
+
function parseIcd11SearchResponse(response) {
|
|
807
|
+
if (typeof response !== "object" || response === null || !("destinationEntities" in response) || !Array.isArray(
|
|
808
|
+
response.destinationEntities
|
|
809
|
+
)) {
|
|
810
|
+
return [];
|
|
811
|
+
}
|
|
812
|
+
const entities = response.destinationEntities;
|
|
813
|
+
return entities.map(toIcd11SearchResult).filter((result) => result !== void 0);
|
|
814
|
+
}
|
|
815
|
+
function formatIcd11Value(value) {
|
|
816
|
+
return `${value.code} - ${value.label}`;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
// ../commons/src/events/PlainDate.ts
|
|
820
|
+
var import_zod8 = require("zod");
|
|
821
|
+
var PlainDate = import_zod8.z.string().date().brand("PlainDate").describe("Date in the format YYYY-MM-DD");
|
|
770
822
|
function plainDateToLocalDate(date) {
|
|
771
823
|
const [year, month, day] = date.split("-").map(Number);
|
|
772
824
|
return new Date(year, month - 1, day);
|
|
773
825
|
}
|
|
774
826
|
|
|
775
827
|
// ../commons/src/events/FieldValue.ts
|
|
776
|
-
var TextValue =
|
|
828
|
+
var TextValue = import_zod9.z.string();
|
|
777
829
|
var NonEmptyTextValue = TextValue.min(1);
|
|
778
|
-
var AgeValue =
|
|
779
|
-
age:
|
|
780
|
-
asOfDateRef:
|
|
830
|
+
var AgeValue = import_zod9.z.object({
|
|
831
|
+
age: import_zod9.z.number(),
|
|
832
|
+
asOfDateRef: import_zod9.z.string()
|
|
781
833
|
});
|
|
782
834
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
783
|
-
var TimeValue =
|
|
784
|
-
var DatetimeValue =
|
|
785
|
-
var SelectDateRangeValue =
|
|
835
|
+
var TimeValue = import_zod9.z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
836
|
+
var DatetimeValue = import_zod9.z.string().datetime();
|
|
837
|
+
var SelectDateRangeValue = import_zod9.z.enum([
|
|
786
838
|
"last7Days",
|
|
787
839
|
"last30Days",
|
|
788
840
|
"last90Days",
|
|
789
841
|
"last365Days"
|
|
790
842
|
]);
|
|
791
|
-
var DateRangeFieldValue =
|
|
843
|
+
var DateRangeFieldValue = import_zod9.z.object({
|
|
792
844
|
start: PlainDate,
|
|
793
845
|
end: PlainDate
|
|
794
846
|
}).or(PlainDate).describe(
|
|
795
847
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
796
848
|
);
|
|
797
|
-
var EmailValue =
|
|
798
|
-
var CheckboxFieldValue =
|
|
799
|
-
var NumberFieldValue =
|
|
800
|
-
var SignatureFieldValue =
|
|
801
|
-
var ButtonFieldValue =
|
|
802
|
-
var VerificationStatusValue =
|
|
849
|
+
var EmailValue = import_zod9.z.string().email();
|
|
850
|
+
var CheckboxFieldValue = import_zod9.z.boolean();
|
|
851
|
+
var NumberFieldValue = import_zod9.z.number();
|
|
852
|
+
var SignatureFieldValue = import_zod9.z.string();
|
|
853
|
+
var ButtonFieldValue = import_zod9.z.number();
|
|
854
|
+
var VerificationStatusValue = import_zod9.z.enum([
|
|
803
855
|
"verified",
|
|
804
856
|
"authenticated",
|
|
805
857
|
"failed",
|
|
806
858
|
"pending"
|
|
807
859
|
]);
|
|
808
|
-
var LeafFieldValues =
|
|
860
|
+
var LeafFieldValues = import_zod9.z.union([
|
|
809
861
|
AddressFieldValue,
|
|
810
862
|
TextValue,
|
|
811
863
|
PlainDate,
|
|
@@ -826,13 +878,15 @@ var LeafFieldValues = import_zod8.z.union([
|
|
|
826
878
|
QrReaderFieldValue,
|
|
827
879
|
IdReaderFieldValue,
|
|
828
880
|
NumberWithUnitFieldValue,
|
|
829
|
-
NumberWithUnitFieldUpdateValue
|
|
881
|
+
NumberWithUnitFieldUpdateValue,
|
|
882
|
+
Icd11FieldValue,
|
|
883
|
+
Icd11FieldUpdateValue
|
|
830
884
|
]);
|
|
831
|
-
var FieldGroupValue =
|
|
832
|
-
var DataFieldValue =
|
|
833
|
-
data:
|
|
885
|
+
var FieldGroupValue = import_zod9.z.record(import_zod9.z.string(), LeafFieldValues);
|
|
886
|
+
var DataFieldValue = import_zod9.z.object({
|
|
887
|
+
data: import_zod9.z.record(import_zod9.z.string(), LeafFieldValues)
|
|
834
888
|
}).nullish();
|
|
835
|
-
var FieldValue =
|
|
889
|
+
var FieldValue = import_zod9.z.union([
|
|
836
890
|
LeafFieldValues,
|
|
837
891
|
DataFieldValue,
|
|
838
892
|
FieldGroupValue
|
|
@@ -860,7 +914,7 @@ function schemaPriority(schema) {
|
|
|
860
914
|
return idx === -1 ? 9999 : idx;
|
|
861
915
|
}
|
|
862
916
|
function safeUnion(schemas) {
|
|
863
|
-
return
|
|
917
|
+
return import_zod9.z.custom((val) => {
|
|
864
918
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
865
919
|
if (successful.length === 1) {
|
|
866
920
|
return true;
|
|
@@ -890,7 +944,8 @@ var FieldUpdateValue = safeUnion([
|
|
|
890
944
|
FieldGroupValue.describe("GroupFieldValue"),
|
|
891
945
|
NameFieldUpdateValue.describe("NameFieldUpdateValue"),
|
|
892
946
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
893
|
-
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
947
|
+
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
|
|
948
|
+
Icd11FieldUpdateValue.describe("Icd11FieldUpdateValue")
|
|
894
949
|
]);
|
|
895
950
|
|
|
896
951
|
// ../commons/src/events/FieldConfig.ts
|
|
@@ -898,16 +953,16 @@ var import_zod_openapi6 = require("zod-openapi");
|
|
|
898
953
|
|
|
899
954
|
// ../commons/src/uuid.ts
|
|
900
955
|
var import_uuid = require("uuid");
|
|
901
|
-
var
|
|
902
|
-
var UUID =
|
|
956
|
+
var import_zod10 = require("zod");
|
|
957
|
+
var UUID = import_zod10.z.string().uuid().brand("UUID");
|
|
903
958
|
function getUUID() {
|
|
904
959
|
return (0, import_uuid.v4)();
|
|
905
960
|
}
|
|
906
961
|
|
|
907
962
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
908
|
-
var
|
|
909
|
-
var SerializedUserField =
|
|
910
|
-
$userField:
|
|
963
|
+
var import_zod11 = require("zod");
|
|
964
|
+
var SerializedUserField = import_zod11.z.object({
|
|
965
|
+
$userField: import_zod11.z.enum([
|
|
911
966
|
"id",
|
|
912
967
|
"name",
|
|
913
968
|
"role",
|
|
@@ -922,7 +977,7 @@ var SerializedUserField = import_zod10.z.object({
|
|
|
922
977
|
"mobile",
|
|
923
978
|
"email"
|
|
924
979
|
]),
|
|
925
|
-
$location:
|
|
980
|
+
$location: import_zod11.z.string().optional()
|
|
926
981
|
});
|
|
927
982
|
function userSerializer(userField) {
|
|
928
983
|
return {
|
|
@@ -940,8 +995,8 @@ function userSerializer(userField) {
|
|
|
940
995
|
}
|
|
941
996
|
};
|
|
942
997
|
}
|
|
943
|
-
var SerializedUserDataField =
|
|
944
|
-
$userDataField:
|
|
998
|
+
var SerializedUserDataField = import_zod11.z.object({
|
|
999
|
+
$userDataField: import_zod11.z.string()
|
|
945
1000
|
});
|
|
946
1001
|
function userDataSerializer(key) {
|
|
947
1002
|
return {
|
|
@@ -953,13 +1008,13 @@ function userDataSerializer(key) {
|
|
|
953
1008
|
}
|
|
954
1009
|
|
|
955
1010
|
// ../commons/src/events/EventIndex.ts
|
|
956
|
-
var
|
|
1011
|
+
var import_zod16 = require("zod");
|
|
957
1012
|
|
|
958
1013
|
// ../commons/src/events/EventMetadata.ts
|
|
959
|
-
var
|
|
1014
|
+
var import_zod15 = require("zod");
|
|
960
1015
|
|
|
961
1016
|
// ../commons/src/events/ActionDocument.ts
|
|
962
|
-
var
|
|
1017
|
+
var import_zod14 = require("zod");
|
|
963
1018
|
var import_zod_openapi4 = require("zod-openapi");
|
|
964
1019
|
|
|
965
1020
|
// ../commons/src/events/CreatedAtLocation.ts
|
|
@@ -967,10 +1022,10 @@ var CreatedAtLocation = UUID.nullish();
|
|
|
967
1022
|
|
|
968
1023
|
// ../commons/src/authentication.ts
|
|
969
1024
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
970
|
-
var
|
|
1025
|
+
var import_zod13 = require("zod");
|
|
971
1026
|
|
|
972
1027
|
// ../commons/src/scopes.ts
|
|
973
|
-
var
|
|
1028
|
+
var import_zod12 = require("zod");
|
|
974
1029
|
var SCOPES = {
|
|
975
1030
|
// TODO v1.8 legacy scopes
|
|
976
1031
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -1049,91 +1104,91 @@ var SCOPES = {
|
|
|
1049
1104
|
// data seeding
|
|
1050
1105
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
1051
1106
|
};
|
|
1052
|
-
var LegacyScopes =
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1107
|
+
var LegacyScopes = import_zod12.z.union([
|
|
1108
|
+
import_zod12.z.literal(SCOPES.BYPASSRATELIMIT),
|
|
1109
|
+
import_zod12.z.literal(SCOPES.REGISTER),
|
|
1110
|
+
import_zod12.z.literal(SCOPES.DEMO),
|
|
1111
|
+
import_zod12.z.literal(SCOPES.CONFIG)
|
|
1057
1112
|
]);
|
|
1058
|
-
var IntegrationScopes =
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1113
|
+
var IntegrationScopes = import_zod12.z.union([
|
|
1114
|
+
import_zod12.z.literal(SCOPES.WEBHOOK),
|
|
1115
|
+
import_zod12.z.literal(SCOPES.NATIONALID),
|
|
1116
|
+
import_zod12.z.literal(SCOPES.NOTIFICATION_API),
|
|
1117
|
+
import_zod12.z.literal(SCOPES.RECORDSEARCH)
|
|
1063
1118
|
]);
|
|
1064
|
-
var InternalOperationsScopes =
|
|
1065
|
-
|
|
1066
|
-
|
|
1119
|
+
var InternalOperationsScopes = import_zod12.z.union([
|
|
1120
|
+
import_zod12.z.literal(SCOPES.RECORD_REINDEX),
|
|
1121
|
+
import_zod12.z.literal(SCOPES.RECORD_IMPORT)
|
|
1067
1122
|
]);
|
|
1068
|
-
var DeclareScopes =
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1123
|
+
var DeclareScopes = import_zod12.z.union([
|
|
1124
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
1125
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
1126
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
1127
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
1128
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
1129
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
1130
|
+
import_zod12.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
1131
|
+
import_zod12.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
1077
1132
|
]);
|
|
1078
|
-
var UnassignScope =
|
|
1079
|
-
var ValidateScopes =
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1133
|
+
var UnassignScope = import_zod12.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
1134
|
+
var ValidateScopes = import_zod12.z.union([
|
|
1135
|
+
import_zod12.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
1136
|
+
import_zod12.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
1137
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
1138
|
+
import_zod12.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
1139
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
1140
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
1086
1141
|
]);
|
|
1087
|
-
var RegisterScope =
|
|
1088
|
-
var CorrectionScopes =
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1142
|
+
var RegisterScope = import_zod12.z.literal(SCOPES.RECORD_REGISTER);
|
|
1143
|
+
var CorrectionScopes = import_zod12.z.union([
|
|
1144
|
+
import_zod12.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
1145
|
+
import_zod12.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
1146
|
+
import_zod12.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
1147
|
+
import_zod12.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
1093
1148
|
]);
|
|
1094
|
-
var SearchScopes =
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1149
|
+
var SearchScopes = import_zod12.z.union([
|
|
1150
|
+
import_zod12.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
1151
|
+
import_zod12.z.literal(SCOPES.SEARCH_BIRTH),
|
|
1152
|
+
import_zod12.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
1153
|
+
import_zod12.z.literal(SCOPES.SEARCH_DEATH),
|
|
1154
|
+
import_zod12.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
1155
|
+
import_zod12.z.literal(SCOPES.SEARCH_MARRIAGE)
|
|
1101
1156
|
]);
|
|
1102
|
-
var AuditScopes =
|
|
1103
|
-
var PerformanceScopes =
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1157
|
+
var AuditScopes = import_zod12.z.literal(SCOPES.RECORD_READ);
|
|
1158
|
+
var PerformanceScopes = import_zod12.z.union([
|
|
1159
|
+
import_zod12.z.literal(SCOPES.PERFORMANCE_READ),
|
|
1160
|
+
import_zod12.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
1161
|
+
import_zod12.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
1107
1162
|
]);
|
|
1108
|
-
var OrganisationScopes =
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1163
|
+
var OrganisationScopes = import_zod12.z.union([
|
|
1164
|
+
import_zod12.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
1165
|
+
import_zod12.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
1166
|
+
import_zod12.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
1112
1167
|
]);
|
|
1113
|
-
var UserScopes =
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1168
|
+
var UserScopes = import_zod12.z.union([
|
|
1169
|
+
import_zod12.z.literal(SCOPES.USER_READ),
|
|
1170
|
+
import_zod12.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
1171
|
+
import_zod12.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
1172
|
+
import_zod12.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
1173
|
+
import_zod12.z.literal(SCOPES.USER_CREATE),
|
|
1174
|
+
import_zod12.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
1175
|
+
import_zod12.z.literal(SCOPES.USER_UPDATE),
|
|
1176
|
+
import_zod12.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
1122
1177
|
]);
|
|
1123
|
-
var ConfigScope =
|
|
1124
|
-
var DataSeedingScope =
|
|
1125
|
-
var LiteralScopes =
|
|
1178
|
+
var ConfigScope = import_zod12.z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
1179
|
+
var DataSeedingScope = import_zod12.z.literal(SCOPES.USER_DATA_SEEDING);
|
|
1180
|
+
var LiteralScopes = import_zod12.z.union([
|
|
1126
1181
|
LegacyScopes,
|
|
1127
1182
|
IntegrationScopes,
|
|
1128
1183
|
UnassignScope,
|
|
1129
1184
|
DeclareScopes,
|
|
1130
1185
|
ValidateScopes,
|
|
1131
1186
|
RegisterScope,
|
|
1132
|
-
|
|
1187
|
+
import_zod12.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
1133
1188
|
CorrectionScopes,
|
|
1134
1189
|
SearchScopes,
|
|
1135
1190
|
AuditScopes,
|
|
1136
|
-
|
|
1191
|
+
import_zod12.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
1137
1192
|
PerformanceScopes,
|
|
1138
1193
|
OrganisationScopes,
|
|
1139
1194
|
UserScopes,
|
|
@@ -1142,42 +1197,42 @@ var LiteralScopes = import_zod11.z.union([
|
|
|
1142
1197
|
InternalOperationsScopes
|
|
1143
1198
|
]);
|
|
1144
1199
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
1145
|
-
var rawConfigurableScope =
|
|
1146
|
-
var CreateUserScope =
|
|
1147
|
-
type:
|
|
1148
|
-
options:
|
|
1149
|
-
role:
|
|
1200
|
+
var rawConfigurableScope = import_zod12.z.string().regex(rawConfigurableScopeRegex);
|
|
1201
|
+
var CreateUserScope = import_zod12.z.object({
|
|
1202
|
+
type: import_zod12.z.literal("user.create"),
|
|
1203
|
+
options: import_zod12.z.object({
|
|
1204
|
+
role: import_zod12.z.array(import_zod12.z.string())
|
|
1150
1205
|
})
|
|
1151
1206
|
});
|
|
1152
|
-
var EditUserScope =
|
|
1153
|
-
type:
|
|
1154
|
-
options:
|
|
1155
|
-
role:
|
|
1207
|
+
var EditUserScope = import_zod12.z.object({
|
|
1208
|
+
type: import_zod12.z.literal("user.edit"),
|
|
1209
|
+
options: import_zod12.z.object({
|
|
1210
|
+
role: import_zod12.z.array(import_zod12.z.string())
|
|
1156
1211
|
})
|
|
1157
1212
|
});
|
|
1158
|
-
var WorkqueueScope =
|
|
1159
|
-
type:
|
|
1160
|
-
options:
|
|
1161
|
-
id:
|
|
1213
|
+
var WorkqueueScope = import_zod12.z.object({
|
|
1214
|
+
type: import_zod12.z.literal("workqueue"),
|
|
1215
|
+
options: import_zod12.z.object({
|
|
1216
|
+
id: import_zod12.z.array(import_zod12.z.string())
|
|
1162
1217
|
})
|
|
1163
1218
|
});
|
|
1164
|
-
var SearchScope =
|
|
1165
|
-
type:
|
|
1166
|
-
options:
|
|
1167
|
-
event:
|
|
1168
|
-
access:
|
|
1219
|
+
var SearchScope = import_zod12.z.object({
|
|
1220
|
+
type: import_zod12.z.literal("search"),
|
|
1221
|
+
options: import_zod12.z.object({
|
|
1222
|
+
event: import_zod12.z.array(import_zod12.z.string()).length(1),
|
|
1223
|
+
access: import_zod12.z.array(import_zod12.z.enum(["my-jurisdiction", "all"])).length(1)
|
|
1169
1224
|
})
|
|
1170
1225
|
});
|
|
1171
|
-
var PrintCertifiedCopiesScope =
|
|
1172
|
-
type:
|
|
1173
|
-
options:
|
|
1174
|
-
event:
|
|
1175
|
-
templates:
|
|
1226
|
+
var PrintCertifiedCopiesScope = import_zod12.z.object({
|
|
1227
|
+
type: import_zod12.z.literal("record.registered.print-certified-copies"),
|
|
1228
|
+
options: import_zod12.z.object({
|
|
1229
|
+
event: import_zod12.z.array(import_zod12.z.string()).describe("Event type, e.g. birth, death"),
|
|
1230
|
+
templates: import_zod12.z.array(import_zod12.z.string()).optional().describe(
|
|
1176
1231
|
"Template IDs for certified copies. If not provided, all templates will be used."
|
|
1177
1232
|
)
|
|
1178
1233
|
})
|
|
1179
1234
|
});
|
|
1180
|
-
var RecordScopeType =
|
|
1235
|
+
var RecordScopeType = import_zod12.z.enum([
|
|
1181
1236
|
"record.create",
|
|
1182
1237
|
"record.read",
|
|
1183
1238
|
"record.declare",
|
|
@@ -1191,15 +1246,15 @@ var RecordScopeType = import_zod11.z.enum([
|
|
|
1191
1246
|
"record.registered.correct",
|
|
1192
1247
|
"record.unassign-others"
|
|
1193
1248
|
]);
|
|
1194
|
-
var RecordScope =
|
|
1249
|
+
var RecordScope = import_zod12.z.object({
|
|
1195
1250
|
type: RecordScopeType,
|
|
1196
|
-
options:
|
|
1197
|
-
event:
|
|
1251
|
+
options: import_zod12.z.object({
|
|
1252
|
+
event: import_zod12.z.array(import_zod12.z.string()).describe("Event type, e.g. birth, death")
|
|
1198
1253
|
})
|
|
1199
1254
|
}).describe(
|
|
1200
1255
|
"Scopes used to check user's permission to perform actions on a record."
|
|
1201
1256
|
);
|
|
1202
|
-
var ConfigurableRawScopes =
|
|
1257
|
+
var ConfigurableRawScopes = import_zod12.z.discriminatedUnion("type", [
|
|
1203
1258
|
SearchScope,
|
|
1204
1259
|
PrintCertifiedCopiesScope,
|
|
1205
1260
|
CreateUserScope,
|
|
@@ -1262,11 +1317,11 @@ function getAuthorizedEventsFromScopes(scopes2) {
|
|
|
1262
1317
|
}).filter((event2) => event2 !== void 0).filter((event2, index, self) => self.indexOf(event2) === index);
|
|
1263
1318
|
}
|
|
1264
1319
|
var scopes = Object.values(SCOPES);
|
|
1265
|
-
var ActionScopes =
|
|
1320
|
+
var ActionScopes = import_zod12.z.union([
|
|
1266
1321
|
DeclareScopes,
|
|
1267
1322
|
ValidateScopes,
|
|
1268
1323
|
RegisterScope,
|
|
1269
|
-
|
|
1324
|
+
import_zod12.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
1270
1325
|
CorrectionScopes
|
|
1271
1326
|
]);
|
|
1272
1327
|
|
|
@@ -1400,15 +1455,15 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
|
1400
1455
|
]
|
|
1401
1456
|
}
|
|
1402
1457
|
];
|
|
1403
|
-
var TokenUserType =
|
|
1404
|
-
var TokenWithBearer =
|
|
1458
|
+
var TokenUserType = import_zod13.z.enum(["user", "system"]);
|
|
1459
|
+
var TokenWithBearer = import_zod13.z.string().regex(/^Bearer\s/);
|
|
1405
1460
|
|
|
1406
1461
|
// ../commons/src/events/ActionDocument.ts
|
|
1407
|
-
(0, import_zod_openapi4.extendZodWithOpenApi)(
|
|
1408
|
-
var ActionUpdate =
|
|
1462
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod14.z);
|
|
1463
|
+
var ActionUpdate = import_zod14.z.record(import_zod14.z.string(), FieldUpdateValue).describe(
|
|
1409
1464
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
1410
1465
|
);
|
|
1411
|
-
var EventState =
|
|
1466
|
+
var EventState = import_zod14.z.record(import_zod14.z.string(), FieldValue).describe(
|
|
1412
1467
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
1413
1468
|
);
|
|
1414
1469
|
var ActionStatus = {
|
|
@@ -1416,16 +1471,16 @@ var ActionStatus = {
|
|
|
1416
1471
|
Accepted: "Accepted",
|
|
1417
1472
|
Rejected: "Rejected"
|
|
1418
1473
|
};
|
|
1419
|
-
var ActionBase =
|
|
1474
|
+
var ActionBase = import_zod14.z.object({
|
|
1420
1475
|
id: UUID.describe("Unique identifier of the action."),
|
|
1421
|
-
transactionId:
|
|
1476
|
+
transactionId: import_zod14.z.string().describe("Unique identifier of the transaction."),
|
|
1422
1477
|
createdByUserType: TokenUserType.describe(
|
|
1423
1478
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1424
1479
|
),
|
|
1425
|
-
createdAt:
|
|
1426
|
-
createdBy:
|
|
1427
|
-
createdByRole:
|
|
1428
|
-
createdBySignature:
|
|
1480
|
+
createdAt: import_zod14.z.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1481
|
+
createdBy: import_zod14.z.string().describe("Identifier of the user who created the action."),
|
|
1482
|
+
createdByRole: import_zod14.z.string().describe("Role of the user who created the action."),
|
|
1483
|
+
createdBySignature: import_zod14.z.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
1429
1484
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1430
1485
|
"Reference to the location of the user who created the action."
|
|
1431
1486
|
),
|
|
@@ -1433,7 +1488,7 @@ var ActionBase = import_zod13.z.object({
|
|
|
1433
1488
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1434
1489
|
),
|
|
1435
1490
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1436
|
-
status:
|
|
1491
|
+
status: import_zod14.z.enum([
|
|
1437
1492
|
ActionStatus.Requested,
|
|
1438
1493
|
ActionStatus.Accepted,
|
|
1439
1494
|
ActionStatus.Rejected
|
|
@@ -1445,129 +1500,129 @@ var ActionBase = import_zod13.z.object({
|
|
|
1445
1500
|
)
|
|
1446
1501
|
});
|
|
1447
1502
|
var AssignedAction = ActionBase.merge(
|
|
1448
|
-
|
|
1449
|
-
type:
|
|
1450
|
-
assignedTo:
|
|
1503
|
+
import_zod14.z.object({
|
|
1504
|
+
type: import_zod14.z.literal(ActionType.ASSIGN),
|
|
1505
|
+
assignedTo: import_zod14.z.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1451
1506
|
// TODO move into 'content' property
|
|
1452
1507
|
})
|
|
1453
1508
|
);
|
|
1454
1509
|
var UnassignedAction = ActionBase.merge(
|
|
1455
|
-
|
|
1456
|
-
type:
|
|
1510
|
+
import_zod14.z.object({
|
|
1511
|
+
type: import_zod14.z.literal(ActionType.UNASSIGN)
|
|
1457
1512
|
})
|
|
1458
1513
|
);
|
|
1459
1514
|
var RegisterAction = ActionBase.merge(
|
|
1460
|
-
|
|
1461
|
-
type:
|
|
1462
|
-
registrationNumber:
|
|
1515
|
+
import_zod14.z.object({
|
|
1516
|
+
type: import_zod14.z.literal(ActionType.REGISTER),
|
|
1517
|
+
registrationNumber: import_zod14.z.string().optional().describe(
|
|
1463
1518
|
"Registration number of the event. Always present for accepted registrations."
|
|
1464
1519
|
)
|
|
1465
1520
|
// TODO move into 'content' property
|
|
1466
1521
|
})
|
|
1467
1522
|
);
|
|
1468
1523
|
var DeclareAction = ActionBase.merge(
|
|
1469
|
-
|
|
1470
|
-
type:
|
|
1524
|
+
import_zod14.z.object({
|
|
1525
|
+
type: import_zod14.z.literal(ActionType.DECLARE)
|
|
1471
1526
|
})
|
|
1472
1527
|
);
|
|
1473
1528
|
var ValidateAction = ActionBase.merge(
|
|
1474
|
-
|
|
1475
|
-
type:
|
|
1529
|
+
import_zod14.z.object({
|
|
1530
|
+
type: import_zod14.z.literal(ActionType.VALIDATE)
|
|
1476
1531
|
})
|
|
1477
1532
|
);
|
|
1478
|
-
var ReasonContent =
|
|
1479
|
-
reason:
|
|
1533
|
+
var ReasonContent = import_zod14.z.object({
|
|
1534
|
+
reason: import_zod14.z.string().min(1, { message: "Message cannot be empty" }).describe(
|
|
1480
1535
|
"Message describing the reason for rejecting or archiving the event."
|
|
1481
1536
|
)
|
|
1482
1537
|
});
|
|
1483
1538
|
var EscalateAction = ActionBase.merge(
|
|
1484
|
-
|
|
1485
|
-
type:
|
|
1539
|
+
import_zod14.z.object({
|
|
1540
|
+
type: import_zod14.z.literal(ActionType.ESCALATE),
|
|
1486
1541
|
content: ReasonContent
|
|
1487
1542
|
})
|
|
1488
1543
|
);
|
|
1489
1544
|
var RejectAction = ActionBase.merge(
|
|
1490
|
-
|
|
1491
|
-
type:
|
|
1545
|
+
import_zod14.z.object({
|
|
1546
|
+
type: import_zod14.z.literal(ActionType.REJECT),
|
|
1492
1547
|
content: ReasonContent
|
|
1493
1548
|
})
|
|
1494
1549
|
);
|
|
1495
|
-
var PotentialDuplicate =
|
|
1550
|
+
var PotentialDuplicate = import_zod14.z.object({
|
|
1496
1551
|
id: UUID,
|
|
1497
|
-
trackingId:
|
|
1552
|
+
trackingId: import_zod14.z.string()
|
|
1498
1553
|
});
|
|
1499
1554
|
var DuplicateDetectedAction = ActionBase.merge(
|
|
1500
|
-
|
|
1501
|
-
type:
|
|
1502
|
-
content:
|
|
1503
|
-
duplicates:
|
|
1555
|
+
import_zod14.z.object({
|
|
1556
|
+
type: import_zod14.z.literal(ActionType.DUPLICATE_DETECTED),
|
|
1557
|
+
content: import_zod14.z.object({
|
|
1558
|
+
duplicates: import_zod14.z.array(PotentialDuplicate)
|
|
1504
1559
|
})
|
|
1505
1560
|
})
|
|
1506
1561
|
);
|
|
1507
1562
|
var MarkNotDuplicateAction = ActionBase.merge(
|
|
1508
|
-
|
|
1509
|
-
type:
|
|
1563
|
+
import_zod14.z.object({
|
|
1564
|
+
type: import_zod14.z.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1510
1565
|
})
|
|
1511
1566
|
);
|
|
1512
1567
|
var MarkAsDuplicateAction = ActionBase.merge(
|
|
1513
|
-
|
|
1514
|
-
type:
|
|
1515
|
-
content:
|
|
1568
|
+
import_zod14.z.object({
|
|
1569
|
+
type: import_zod14.z.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1570
|
+
content: import_zod14.z.object({
|
|
1516
1571
|
duplicateOf: UUID
|
|
1517
1572
|
}).optional()
|
|
1518
1573
|
})
|
|
1519
1574
|
);
|
|
1520
1575
|
var ArchiveAction = ActionBase.merge(
|
|
1521
|
-
|
|
1522
|
-
type:
|
|
1576
|
+
import_zod14.z.object({
|
|
1577
|
+
type: import_zod14.z.literal(ActionType.ARCHIVE),
|
|
1523
1578
|
content: ReasonContent
|
|
1524
1579
|
})
|
|
1525
1580
|
);
|
|
1526
1581
|
var CreatedAction = ActionBase.merge(
|
|
1527
|
-
|
|
1528
|
-
type:
|
|
1582
|
+
import_zod14.z.object({
|
|
1583
|
+
type: import_zod14.z.literal(ActionType.CREATE)
|
|
1529
1584
|
})
|
|
1530
1585
|
);
|
|
1531
1586
|
var NotifiedAction = ActionBase.merge(
|
|
1532
|
-
|
|
1533
|
-
type:
|
|
1587
|
+
import_zod14.z.object({
|
|
1588
|
+
type: import_zod14.z.literal(ActionType.NOTIFY)
|
|
1534
1589
|
})
|
|
1535
1590
|
);
|
|
1536
|
-
var PrintContent =
|
|
1537
|
-
templateId:
|
|
1591
|
+
var PrintContent = import_zod14.z.object({
|
|
1592
|
+
templateId: import_zod14.z.string().optional()
|
|
1538
1593
|
});
|
|
1539
1594
|
var PrintCertificateAction = ActionBase.merge(
|
|
1540
|
-
|
|
1541
|
-
type:
|
|
1595
|
+
import_zod14.z.object({
|
|
1596
|
+
type: import_zod14.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
1542
1597
|
content: PrintContent.optional().nullable()
|
|
1543
1598
|
})
|
|
1544
1599
|
);
|
|
1545
1600
|
var RequestedCorrectionAction = ActionBase.merge(
|
|
1546
|
-
|
|
1547
|
-
type:
|
|
1601
|
+
import_zod14.z.object({
|
|
1602
|
+
type: import_zod14.z.literal(ActionType.REQUEST_CORRECTION)
|
|
1548
1603
|
})
|
|
1549
1604
|
);
|
|
1550
1605
|
var ApprovedCorrectionAction = ActionBase.merge(
|
|
1551
|
-
|
|
1552
|
-
type:
|
|
1553
|
-
requestId:
|
|
1606
|
+
import_zod14.z.object({
|
|
1607
|
+
type: import_zod14.z.literal(ActionType.APPROVE_CORRECTION),
|
|
1608
|
+
requestId: import_zod14.z.string()
|
|
1554
1609
|
// TODO move into 'content' property
|
|
1555
1610
|
})
|
|
1556
1611
|
);
|
|
1557
1612
|
var RejectedCorrectionAction = ActionBase.merge(
|
|
1558
|
-
|
|
1559
|
-
type:
|
|
1560
|
-
requestId:
|
|
1613
|
+
import_zod14.z.object({
|
|
1614
|
+
type: import_zod14.z.literal(ActionType.REJECT_CORRECTION),
|
|
1615
|
+
requestId: import_zod14.z.string(),
|
|
1561
1616
|
// TODO move into 'content' property
|
|
1562
1617
|
content: ReasonContent
|
|
1563
1618
|
})
|
|
1564
1619
|
);
|
|
1565
1620
|
var ReadAction = ActionBase.merge(
|
|
1566
|
-
|
|
1567
|
-
type:
|
|
1621
|
+
import_zod14.z.object({
|
|
1622
|
+
type: import_zod14.z.literal(ActionType.READ)
|
|
1568
1623
|
})
|
|
1569
1624
|
);
|
|
1570
|
-
var ActionDocument =
|
|
1625
|
+
var ActionDocument = import_zod14.z.discriminatedUnion("type", [
|
|
1571
1626
|
CreatedAction.openapi({ ref: "CreatedAction" }),
|
|
1572
1627
|
ValidateAction.openapi({ ref: "ValidateAction" }),
|
|
1573
1628
|
EscalateAction.openapi({ ref: "EscalateAction" }),
|
|
@@ -1593,15 +1648,15 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1593
1648
|
declaration: true,
|
|
1594
1649
|
annotation: true
|
|
1595
1650
|
}).merge(
|
|
1596
|
-
|
|
1597
|
-
type:
|
|
1598
|
-
status:
|
|
1651
|
+
import_zod14.z.object({
|
|
1652
|
+
type: import_zod14.z.enum(ConfirmableActions),
|
|
1653
|
+
status: import_zod14.z.literal(ActionStatus.Rejected)
|
|
1599
1654
|
})
|
|
1600
1655
|
);
|
|
1601
|
-
var Action =
|
|
1656
|
+
var Action = import_zod14.z.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1602
1657
|
|
|
1603
1658
|
// ../commons/src/events/EventMetadata.ts
|
|
1604
|
-
var EventStatus =
|
|
1659
|
+
var EventStatus = import_zod15.z.enum([
|
|
1605
1660
|
"CREATED",
|
|
1606
1661
|
"NOTIFIED",
|
|
1607
1662
|
"DECLARED",
|
|
@@ -1617,7 +1672,7 @@ var InherentFlags = {
|
|
|
1617
1672
|
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
1618
1673
|
ESCALATED: "escalated"
|
|
1619
1674
|
};
|
|
1620
|
-
var ActionFlag =
|
|
1675
|
+
var ActionFlag = import_zod15.z.string().regex(
|
|
1621
1676
|
new RegExp(
|
|
1622
1677
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1623
1678
|
ActionStatus
|
|
@@ -1625,60 +1680,60 @@ var ActionFlag = import_zod14.z.string().regex(
|
|
|
1625
1680
|
),
|
|
1626
1681
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1627
1682
|
);
|
|
1628
|
-
var Flag = ActionFlag.or(
|
|
1629
|
-
var ZodDate =
|
|
1630
|
-
var ZodDateTime =
|
|
1631
|
-
var ActionCreationMetadata =
|
|
1632
|
-
createdAt:
|
|
1633
|
-
createdBy:
|
|
1683
|
+
var Flag = ActionFlag.or(import_zod15.z.nativeEnum(InherentFlags));
|
|
1684
|
+
var ZodDate = import_zod15.z.string().date();
|
|
1685
|
+
var ZodDateTime = import_zod15.z.string().datetime();
|
|
1686
|
+
var ActionCreationMetadata = import_zod15.z.object({
|
|
1687
|
+
createdAt: import_zod15.z.string().datetime().describe("The timestamp when the action request was created."),
|
|
1688
|
+
createdBy: import_zod15.z.string().describe("ID of the user who created the action request."),
|
|
1634
1689
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1635
1690
|
"Location of the user who created the action request."
|
|
1636
1691
|
),
|
|
1637
|
-
createdByUserType:
|
|
1638
|
-
acceptedAt:
|
|
1639
|
-
createdByRole:
|
|
1640
|
-
createdBySignature:
|
|
1692
|
+
createdByUserType: import_zod15.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1693
|
+
acceptedAt: import_zod15.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
|
1694
|
+
createdByRole: import_zod15.z.string().describe("Role of the user at the time of action request creation."),
|
|
1695
|
+
createdBySignature: import_zod15.z.string().nullish().describe("Signature of the user who created the action request.")
|
|
1641
1696
|
});
|
|
1642
1697
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1643
|
-
registrationNumber:
|
|
1698
|
+
registrationNumber: import_zod15.z.string().describe(
|
|
1644
1699
|
"Registration number of the event. Always present for accepted registrations."
|
|
1645
1700
|
)
|
|
1646
1701
|
});
|
|
1647
|
-
var LegalStatuses =
|
|
1702
|
+
var LegalStatuses = import_zod15.z.object({
|
|
1648
1703
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1649
1704
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1650
1705
|
});
|
|
1651
|
-
var EventMetadata =
|
|
1706
|
+
var EventMetadata = import_zod15.z.object({
|
|
1652
1707
|
id: UUID,
|
|
1653
|
-
type:
|
|
1708
|
+
type: import_zod15.z.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1654
1709
|
status: EventStatus,
|
|
1655
1710
|
legalStatuses: LegalStatuses.describe(
|
|
1656
1711
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1657
1712
|
),
|
|
1658
|
-
createdAt:
|
|
1713
|
+
createdAt: import_zod15.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
|
1659
1714
|
dateOfEvent: ZodDate.nullish(),
|
|
1660
|
-
createdBy:
|
|
1661
|
-
createdByUserType:
|
|
1662
|
-
updatedByUserRole:
|
|
1715
|
+
createdBy: import_zod15.z.string().describe("ID of the user who created the event."),
|
|
1716
|
+
createdByUserType: import_zod15.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1717
|
+
updatedByUserRole: import_zod15.z.string().describe("Role of the user who last changed the status."),
|
|
1663
1718
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1664
1719
|
"Location of the user who created the event."
|
|
1665
1720
|
),
|
|
1666
|
-
createdBySignature:
|
|
1721
|
+
createdBySignature: import_zod15.z.string().nullish().describe("Signature of the user who created the event."),
|
|
1667
1722
|
updatedAtLocation: UUID.nullish().describe(
|
|
1668
1723
|
"Location of the user who last changed the status."
|
|
1669
1724
|
),
|
|
1670
|
-
updatedAt:
|
|
1725
|
+
updatedAt: import_zod15.z.string().datetime().describe(
|
|
1671
1726
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1672
1727
|
),
|
|
1673
|
-
assignedTo:
|
|
1674
|
-
updatedBy:
|
|
1675
|
-
trackingId:
|
|
1728
|
+
assignedTo: import_zod15.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1729
|
+
updatedBy: import_zod15.z.string().nullish().describe("ID of the user who last changed the status."),
|
|
1730
|
+
trackingId: import_zod15.z.string().describe(
|
|
1676
1731
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1677
1732
|
),
|
|
1678
|
-
potentialDuplicates:
|
|
1733
|
+
potentialDuplicates: import_zod15.z.array(PotentialDuplicate).describe(
|
|
1679
1734
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1680
1735
|
),
|
|
1681
|
-
flags:
|
|
1736
|
+
flags: import_zod15.z.array(Flag)
|
|
1682
1737
|
});
|
|
1683
1738
|
var EventMetadataKeysArray = [
|
|
1684
1739
|
"id",
|
|
@@ -1698,7 +1753,7 @@ var EventMetadataKeysArray = [
|
|
|
1698
1753
|
"legalStatuses",
|
|
1699
1754
|
"flags"
|
|
1700
1755
|
];
|
|
1701
|
-
var EventMetadataKeys =
|
|
1756
|
+
var EventMetadataKeys = import_zod15.z.enum(EventMetadataKeysArray);
|
|
1702
1757
|
var eventMetadataLabelMap = {
|
|
1703
1758
|
"event.assignedTo": {
|
|
1704
1759
|
id: "event.assignedTo.label",
|
|
@@ -1776,7 +1831,7 @@ var eventMetadataLabelMap = {
|
|
|
1776
1831
|
description: "Flags"
|
|
1777
1832
|
}
|
|
1778
1833
|
};
|
|
1779
|
-
var EventMetadataDateFieldIdInput =
|
|
1834
|
+
var EventMetadataDateFieldIdInput = import_zod15.z.enum([
|
|
1780
1835
|
"createdAt",
|
|
1781
1836
|
"updatedAt",
|
|
1782
1837
|
"legalStatuses.DECLARED.createdAt",
|
|
@@ -1784,7 +1839,7 @@ var EventMetadataDateFieldIdInput = import_zod14.z.enum([
|
|
|
1784
1839
|
"legalStatuses.REGISTERED.createdAt",
|
|
1785
1840
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
1786
1841
|
]);
|
|
1787
|
-
var EventMetadataDateFieldId =
|
|
1842
|
+
var EventMetadataDateFieldId = import_zod15.z.enum([
|
|
1788
1843
|
"event.createdAt",
|
|
1789
1844
|
"event.updatedAt",
|
|
1790
1845
|
"event.legalStatuses.DECLARED.createdAt",
|
|
@@ -1795,116 +1850,116 @@ var EventMetadataDateFieldId = import_zod14.z.enum([
|
|
|
1795
1850
|
|
|
1796
1851
|
// ../commons/src/events/EventIndex.ts
|
|
1797
1852
|
var import_zod_openapi5 = require("zod-openapi");
|
|
1798
|
-
(0, import_zod_openapi5.extendZodWithOpenApi)(
|
|
1853
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod16.z);
|
|
1799
1854
|
var EventIndex = EventMetadata.extend({
|
|
1800
1855
|
declaration: EventState
|
|
1801
1856
|
}).openapi({
|
|
1802
1857
|
ref: "EventIndex"
|
|
1803
1858
|
});
|
|
1804
|
-
var EventSearchIndex =
|
|
1805
|
-
|
|
1806
|
-
type:
|
|
1859
|
+
var EventSearchIndex = import_zod16.z.record(import_zod16.z.string(), import_zod16.z.any()).and(
|
|
1860
|
+
import_zod16.z.object({
|
|
1861
|
+
type: import_zod16.z.string()
|
|
1807
1862
|
// Ensures "type" (event-id) exists and is a string
|
|
1808
1863
|
})
|
|
1809
1864
|
).openapi({
|
|
1810
1865
|
ref: "EventSearchIndex"
|
|
1811
1866
|
});
|
|
1812
|
-
var Fuzzy =
|
|
1867
|
+
var Fuzzy = import_zod16.z.object({ type: import_zod16.z.literal("fuzzy"), term: import_zod16.z.string() }).openapi({
|
|
1813
1868
|
ref: "Fuzzy"
|
|
1814
1869
|
});
|
|
1815
|
-
var Exact =
|
|
1870
|
+
var Exact = import_zod16.z.object({ type: import_zod16.z.literal("exact"), term: import_zod16.z.string() }).openapi({
|
|
1816
1871
|
ref: "Exact"
|
|
1817
1872
|
});
|
|
1818
|
-
var ExactStatus =
|
|
1819
|
-
type:
|
|
1873
|
+
var ExactStatus = import_zod16.z.object({
|
|
1874
|
+
type: import_zod16.z.literal("exact"),
|
|
1820
1875
|
term: EventStatus
|
|
1821
1876
|
}).openapi({
|
|
1822
1877
|
ref: "ExactStatus"
|
|
1823
1878
|
});
|
|
1824
|
-
var ExactUserType =
|
|
1825
|
-
type:
|
|
1879
|
+
var ExactUserType = import_zod16.z.object({
|
|
1880
|
+
type: import_zod16.z.literal("exact"),
|
|
1826
1881
|
term: TokenUserType
|
|
1827
1882
|
}).openapi({
|
|
1828
1883
|
ref: "ExactUserType"
|
|
1829
1884
|
});
|
|
1830
|
-
var AnyOf =
|
|
1831
|
-
type:
|
|
1832
|
-
terms:
|
|
1885
|
+
var AnyOf = import_zod16.z.object({
|
|
1886
|
+
type: import_zod16.z.literal("anyOf"),
|
|
1887
|
+
terms: import_zod16.z.array(import_zod16.z.string())
|
|
1833
1888
|
}).openapi({
|
|
1834
1889
|
ref: "AnyOf"
|
|
1835
1890
|
});
|
|
1836
|
-
var AnyOfStatus =
|
|
1837
|
-
type:
|
|
1838
|
-
terms:
|
|
1891
|
+
var AnyOfStatus = import_zod16.z.object({
|
|
1892
|
+
type: import_zod16.z.literal("anyOf"),
|
|
1893
|
+
terms: import_zod16.z.array(EventStatus)
|
|
1839
1894
|
}).openapi({
|
|
1840
1895
|
ref: "AnyOfStatus"
|
|
1841
1896
|
});
|
|
1842
|
-
var Range =
|
|
1843
|
-
type:
|
|
1844
|
-
gte:
|
|
1845
|
-
lte:
|
|
1897
|
+
var Range = import_zod16.z.object({
|
|
1898
|
+
type: import_zod16.z.literal("range"),
|
|
1899
|
+
gte: import_zod16.z.string(),
|
|
1900
|
+
lte: import_zod16.z.string()
|
|
1846
1901
|
}).openapi({
|
|
1847
1902
|
ref: "Range"
|
|
1848
1903
|
});
|
|
1849
|
-
var ContainsFlags =
|
|
1850
|
-
anyOf:
|
|
1851
|
-
noneOf:
|
|
1904
|
+
var ContainsFlags = import_zod16.z.object({
|
|
1905
|
+
anyOf: import_zod16.z.array(Flag).optional(),
|
|
1906
|
+
noneOf: import_zod16.z.array(Flag).optional()
|
|
1852
1907
|
}).openapi({
|
|
1853
1908
|
ref: "ContainsFlags"
|
|
1854
1909
|
});
|
|
1855
|
-
var Within =
|
|
1910
|
+
var Within = import_zod16.z.object({ type: import_zod16.z.literal("within"), location: import_zod16.z.string() }).openapi({
|
|
1856
1911
|
ref: "Within"
|
|
1857
1912
|
});
|
|
1858
|
-
var RangeDate =
|
|
1859
|
-
type:
|
|
1860
|
-
gte:
|
|
1861
|
-
lte:
|
|
1913
|
+
var RangeDate = import_zod16.z.object({
|
|
1914
|
+
type: import_zod16.z.literal("range"),
|
|
1915
|
+
gte: import_zod16.z.string().date().or(import_zod16.z.string().datetime()),
|
|
1916
|
+
lte: import_zod16.z.string().date().or(import_zod16.z.string().datetime())
|
|
1862
1917
|
}).openapi({ ref: "RangeDate" });
|
|
1863
1918
|
var ExactDate = Exact.extend({
|
|
1864
|
-
term:
|
|
1919
|
+
term: import_zod16.z.string().date().or(import_zod16.z.string().datetime())
|
|
1865
1920
|
}).openapi({
|
|
1866
1921
|
ref: "ExactDate"
|
|
1867
1922
|
});
|
|
1868
|
-
var TimePeriod =
|
|
1869
|
-
type:
|
|
1923
|
+
var TimePeriod = import_zod16.z.object({
|
|
1924
|
+
type: import_zod16.z.literal("timePeriod"),
|
|
1870
1925
|
term: SelectDateRangeValue
|
|
1871
1926
|
}).openapi({
|
|
1872
1927
|
ref: "TimePeriod"
|
|
1873
1928
|
});
|
|
1874
|
-
var DateCondition =
|
|
1929
|
+
var DateCondition = import_zod16.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
|
|
1875
1930
|
ref: "DateCondition"
|
|
1876
1931
|
});
|
|
1877
|
-
var QueryInput =
|
|
1878
|
-
() =>
|
|
1879
|
-
|
|
1880
|
-
|
|
1932
|
+
var QueryInput = import_zod16.z.lazy(
|
|
1933
|
+
() => import_zod16.z.union([
|
|
1934
|
+
import_zod16.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
|
1935
|
+
import_zod16.z.record(import_zod16.z.string(), QueryInput)
|
|
1881
1936
|
])
|
|
1882
1937
|
).openapi({
|
|
1883
1938
|
ref: "QueryInput"
|
|
1884
1939
|
});
|
|
1885
|
-
var QueryExpression =
|
|
1886
|
-
id:
|
|
1887
|
-
eventType:
|
|
1888
|
-
status:
|
|
1889
|
-
createdAt:
|
|
1890
|
-
updatedAt:
|
|
1891
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
|
1892
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
1893
|
-
|
|
1940
|
+
var QueryExpression = import_zod16.z.object({
|
|
1941
|
+
id: import_zod16.z.optional(import_zod16.z.string()),
|
|
1942
|
+
eventType: import_zod16.z.string(),
|
|
1943
|
+
status: import_zod16.z.optional(import_zod16.z.union([AnyOfStatus, ExactStatus])),
|
|
1944
|
+
createdAt: import_zod16.z.optional(DateCondition),
|
|
1945
|
+
updatedAt: import_zod16.z.optional(DateCondition),
|
|
1946
|
+
"legalStatuses.REGISTERED.acceptedAt": import_zod16.z.optional(DateCondition),
|
|
1947
|
+
"legalStatuses.DECLARED.createdAtLocation": import_zod16.z.optional(
|
|
1948
|
+
import_zod16.z.union([Within, Exact])
|
|
1894
1949
|
),
|
|
1895
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
1896
|
-
|
|
1950
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod16.z.optional(
|
|
1951
|
+
import_zod16.z.union([Within, Exact])
|
|
1897
1952
|
),
|
|
1898
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
1899
|
-
createdAtLocation:
|
|
1900
|
-
updatedAtLocation:
|
|
1901
|
-
assignedTo:
|
|
1902
|
-
createdByUserType:
|
|
1903
|
-
updatedByUserRole:
|
|
1904
|
-
createdBy:
|
|
1905
|
-
updatedBy:
|
|
1906
|
-
trackingId:
|
|
1907
|
-
flags:
|
|
1953
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod16.z.optional(Exact),
|
|
1954
|
+
createdAtLocation: import_zod16.z.optional(import_zod16.z.union([Within, Exact])),
|
|
1955
|
+
updatedAtLocation: import_zod16.z.optional(import_zod16.z.union([Within, Exact])),
|
|
1956
|
+
assignedTo: import_zod16.z.optional(Exact),
|
|
1957
|
+
createdByUserType: import_zod16.z.optional(ExactUserType),
|
|
1958
|
+
updatedByUserRole: import_zod16.z.optional(Exact),
|
|
1959
|
+
createdBy: import_zod16.z.optional(Exact),
|
|
1960
|
+
updatedBy: import_zod16.z.optional(Exact),
|
|
1961
|
+
trackingId: import_zod16.z.optional(Exact),
|
|
1962
|
+
flags: import_zod16.z.optional(ContainsFlags),
|
|
1908
1963
|
// @todo: The type for this comes out as "any"
|
|
1909
1964
|
data: QueryInput
|
|
1910
1965
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
@@ -1912,10 +1967,10 @@ var QueryExpression = import_zod15.z.object({
|
|
|
1912
1967
|
}).openapi({
|
|
1913
1968
|
ref: "QueryExpression"
|
|
1914
1969
|
});
|
|
1915
|
-
var QueryType =
|
|
1916
|
-
() =>
|
|
1917
|
-
type:
|
|
1918
|
-
clauses:
|
|
1970
|
+
var QueryType = import_zod16.z.lazy(
|
|
1971
|
+
() => import_zod16.z.object({
|
|
1972
|
+
type: import_zod16.z.literal("and").or(import_zod16.z.literal("or")).openapi({ default: "and" }),
|
|
1973
|
+
clauses: import_zod16.z.array(import_zod16.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").openapi({
|
|
1919
1974
|
default: [
|
|
1920
1975
|
{
|
|
1921
1976
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1942,8 +1997,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1942
1997
|
}
|
|
1943
1998
|
return val;
|
|
1944
1999
|
}
|
|
1945
|
-
var SearchQuery =
|
|
1946
|
-
query:
|
|
2000
|
+
var SearchQuery = import_zod16.z.object({
|
|
2001
|
+
query: import_zod16.z.preprocess(parseStringifiedQueryField, QueryType).openapi({
|
|
1947
2002
|
default: {
|
|
1948
2003
|
type: "and",
|
|
1949
2004
|
clauses: [
|
|
@@ -1963,17 +2018,20 @@ var SearchQuery = import_zod15.z.object({
|
|
|
1963
2018
|
]
|
|
1964
2019
|
}
|
|
1965
2020
|
}),
|
|
1966
|
-
limit:
|
|
1967
|
-
offset:
|
|
1968
|
-
sort:
|
|
2021
|
+
limit: import_zod16.z.number().optional().default(100),
|
|
2022
|
+
offset: import_zod16.z.number().optional().default(0),
|
|
2023
|
+
sort: import_zod16.z.preprocess(
|
|
1969
2024
|
parseStringifiedQueryField,
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
field:
|
|
1973
|
-
direction:
|
|
2025
|
+
import_zod16.z.array(
|
|
2026
|
+
import_zod16.z.object({
|
|
2027
|
+
field: import_zod16.z.string(),
|
|
2028
|
+
direction: import_zod16.z.enum(["asc", "desc"]).default("asc")
|
|
1974
2029
|
})
|
|
1975
2030
|
)
|
|
1976
|
-
).optional()
|
|
2031
|
+
).optional(),
|
|
2032
|
+
excludeDrafts: import_zod16.z.boolean().optional().describe(
|
|
2033
|
+
'When true, undeclared drafts (events in status CREATED) are excluded from the results. Used by workqueues so that drafts only appear in the dedicated "My Draft" view, while explicit searches (e.g. by tracking ID) can still find them.'
|
|
2034
|
+
)
|
|
1977
2035
|
}).openapi({
|
|
1978
2036
|
ref: "SearchQuery"
|
|
1979
2037
|
});
|
|
@@ -1983,17 +2041,17 @@ var SearchScopeAccessLevels = {
|
|
|
1983
2041
|
};
|
|
1984
2042
|
|
|
1985
2043
|
// ../commons/src/events/serializers/date/serializer.ts
|
|
1986
|
-
var
|
|
1987
|
-
var SerializedNowDateTime =
|
|
1988
|
-
$$now:
|
|
2044
|
+
var import_zod17 = require("zod");
|
|
2045
|
+
var SerializedNowDateTime = import_zod17.z.object({
|
|
2046
|
+
$$now: import_zod17.z.literal(true)
|
|
1989
2047
|
});
|
|
1990
2048
|
function todayDateTimeValueSerializer() {
|
|
1991
2049
|
return { $$now: true };
|
|
1992
2050
|
}
|
|
1993
2051
|
|
|
1994
2052
|
// ../commons/src/events/FieldConfig.ts
|
|
1995
|
-
(0, import_zod_openapi6.extendZodWithOpenApi)(
|
|
1996
|
-
var FieldId =
|
|
2053
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod18.z);
|
|
2054
|
+
var FieldId = import_zod18.z.string().refine(
|
|
1997
2055
|
/*
|
|
1998
2056
|
* Disallow underscores '_' in field ids.
|
|
1999
2057
|
* Why? Theres two reasons:
|
|
@@ -2006,163 +2064,163 @@ var FieldId = import_zod17.z.string().refine(
|
|
|
2006
2064
|
message: `id: '${val}' must not contain underscores '_'`
|
|
2007
2065
|
})
|
|
2008
2066
|
).describe("Unique identifier for the field");
|
|
2009
|
-
var FieldReference =
|
|
2067
|
+
var FieldReference = import_zod18.z.object({
|
|
2010
2068
|
$$field: FieldId,
|
|
2011
|
-
$$subfield:
|
|
2069
|
+
$$subfield: import_zod18.z.array(import_zod18.z.string()).optional().default([]).describe(
|
|
2012
2070
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
2013
2071
|
)
|
|
2014
2072
|
}).describe("Reference to a field by its ID");
|
|
2015
|
-
var ValidationConfig =
|
|
2073
|
+
var ValidationConfig = import_zod18.z.object({
|
|
2016
2074
|
validator: Conditional,
|
|
2017
2075
|
message: TranslationConfig
|
|
2018
2076
|
});
|
|
2019
|
-
var requiredSchema =
|
|
2020
|
-
|
|
2021
|
-
|
|
2077
|
+
var requiredSchema = import_zod18.z.union([
|
|
2078
|
+
import_zod18.z.boolean(),
|
|
2079
|
+
import_zod18.z.object({
|
|
2022
2080
|
message: TranslationConfig.describe("Custom required validation message")
|
|
2023
2081
|
})
|
|
2024
2082
|
]).default(false).optional();
|
|
2025
|
-
var BaseField =
|
|
2083
|
+
var BaseField = import_zod18.z.object({
|
|
2026
2084
|
id: FieldId.describe("Unique identifier of the field."),
|
|
2027
2085
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
2028
|
-
parent: FieldReference.or(
|
|
2086
|
+
parent: FieldReference.or(import_zod18.z.array(FieldReference)).optional().describe(
|
|
2029
2087
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
2030
2088
|
),
|
|
2031
2089
|
required: requiredSchema.describe(
|
|
2032
2090
|
"Indicates whether the field is mandatory."
|
|
2033
2091
|
),
|
|
2034
|
-
conditionals:
|
|
2092
|
+
conditionals: import_zod18.z.array(FieldConditional).default([]).optional().describe(
|
|
2035
2093
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
2036
2094
|
),
|
|
2037
|
-
secured:
|
|
2095
|
+
secured: import_zod18.z.boolean().default(false).optional().describe(
|
|
2038
2096
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
2039
2097
|
),
|
|
2040
2098
|
placeholder: TranslationConfig.optional(),
|
|
2041
|
-
validation:
|
|
2099
|
+
validation: import_zod18.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
2042
2100
|
helperText: TranslationConfig.optional(),
|
|
2043
|
-
hideLabel:
|
|
2044
|
-
uncorrectable:
|
|
2101
|
+
hideLabel: import_zod18.z.boolean().default(false).optional(),
|
|
2102
|
+
uncorrectable: import_zod18.z.boolean().default(false).optional().describe(
|
|
2045
2103
|
"Indicates whether the field can be modified during record correction."
|
|
2046
2104
|
),
|
|
2047
|
-
value: FieldReference.or(
|
|
2105
|
+
value: FieldReference.or(import_zod18.z.array(FieldReference)).optional().describe(
|
|
2048
2106
|
"Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
|
|
2049
2107
|
),
|
|
2050
|
-
analytics:
|
|
2108
|
+
analytics: import_zod18.z.boolean().default(false).optional().describe(
|
|
2051
2109
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
2052
2110
|
),
|
|
2053
|
-
persistWhenHidden:
|
|
2111
|
+
persistWhenHidden: import_zod18.z.boolean().default(false).optional().describe(
|
|
2054
2112
|
"Preserves field value during hidden field cleanup."
|
|
2055
2113
|
)
|
|
2056
2114
|
}).describe("Common properties shared across all field types.");
|
|
2057
2115
|
var Divider = BaseField.extend({
|
|
2058
|
-
type:
|
|
2116
|
+
type: import_zod18.z.literal(FieldType.DIVIDER)
|
|
2059
2117
|
});
|
|
2060
2118
|
var TextField = BaseField.extend({
|
|
2061
|
-
type:
|
|
2062
|
-
defaultValue:
|
|
2063
|
-
configuration:
|
|
2064
|
-
maxLength:
|
|
2065
|
-
type:
|
|
2119
|
+
type: import_zod18.z.literal(FieldType.TEXT),
|
|
2120
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional(),
|
|
2121
|
+
configuration: import_zod18.z.object({
|
|
2122
|
+
maxLength: import_zod18.z.number().optional().describe("Maximum length of the text"),
|
|
2123
|
+
type: import_zod18.z.enum(["text", "password"]).optional(),
|
|
2066
2124
|
prefix: TranslationConfig.optional(),
|
|
2067
2125
|
postfix: TranslationConfig.optional()
|
|
2068
2126
|
}).default({ type: "text" }).optional()
|
|
2069
2127
|
}).describe("Text input");
|
|
2070
2128
|
var NumberField = BaseField.extend({
|
|
2071
|
-
type:
|
|
2129
|
+
type: import_zod18.z.literal(FieldType.NUMBER),
|
|
2072
2130
|
defaultValue: NumberFieldValue.optional(),
|
|
2073
|
-
configuration:
|
|
2074
|
-
min:
|
|
2075
|
-
max:
|
|
2131
|
+
configuration: import_zod18.z.object({
|
|
2132
|
+
min: import_zod18.z.number().optional().describe("Minimum value"),
|
|
2133
|
+
max: import_zod18.z.number().optional().describe("Maximum value"),
|
|
2076
2134
|
prefix: TranslationConfig.optional(),
|
|
2077
2135
|
postfix: TranslationConfig.optional()
|
|
2078
2136
|
}).optional()
|
|
2079
2137
|
}).describe("Number input");
|
|
2080
2138
|
var TextAreaField = BaseField.extend({
|
|
2081
|
-
type:
|
|
2139
|
+
type: import_zod18.z.literal(FieldType.TEXTAREA),
|
|
2082
2140
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2083
|
-
configuration:
|
|
2084
|
-
maxLength:
|
|
2085
|
-
rows:
|
|
2086
|
-
cols:
|
|
2141
|
+
configuration: import_zod18.z.object({
|
|
2142
|
+
maxLength: import_zod18.z.number().optional().describe("Maximum length of the text"),
|
|
2143
|
+
rows: import_zod18.z.number().optional().describe("Number of visible text lines"),
|
|
2144
|
+
cols: import_zod18.z.number().optional().describe("Number of visible columns"),
|
|
2087
2145
|
prefix: TranslationConfig.optional(),
|
|
2088
2146
|
postfix: TranslationConfig.optional()
|
|
2089
2147
|
}).default({ rows: 4 }).optional()
|
|
2090
2148
|
}).describe("Multiline text input");
|
|
2091
|
-
var ImageMimeType =
|
|
2149
|
+
var ImageMimeType = import_zod18.z.enum([
|
|
2092
2150
|
"image/png",
|
|
2093
2151
|
"image/jpg",
|
|
2094
2152
|
"image/jpeg",
|
|
2095
2153
|
"image/svg+xml"
|
|
2096
2154
|
]);
|
|
2097
|
-
var DocumentMimeType =
|
|
2155
|
+
var DocumentMimeType = import_zod18.z.enum([
|
|
2098
2156
|
"application/pdf",
|
|
2099
2157
|
"application/msword",
|
|
2100
2158
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2101
2159
|
"application/vnd.oasis.opendocument.text"
|
|
2102
2160
|
]);
|
|
2103
|
-
var MimeType =
|
|
2161
|
+
var MimeType = import_zod18.z.enum([
|
|
2104
2162
|
...ImageMimeType.options,
|
|
2105
2163
|
...DocumentMimeType.options
|
|
2106
2164
|
]);
|
|
2107
2165
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
2108
2166
|
var SignatureField = BaseField.extend({
|
|
2109
|
-
type:
|
|
2167
|
+
type: import_zod18.z.literal(FieldType.SIGNATURE),
|
|
2110
2168
|
signaturePromptLabel: TranslationConfig.describe(
|
|
2111
2169
|
"Title of the signature modal"
|
|
2112
2170
|
),
|
|
2113
2171
|
defaultValue: SignatureFieldValue.optional(),
|
|
2114
|
-
configuration:
|
|
2115
|
-
maxFileSize:
|
|
2172
|
+
configuration: import_zod18.z.object({
|
|
2173
|
+
maxFileSize: import_zod18.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2116
2174
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
2117
2175
|
}).default({
|
|
2118
2176
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2119
2177
|
})
|
|
2120
2178
|
}).describe("Signature input field");
|
|
2121
2179
|
var EmailField = BaseField.extend({
|
|
2122
|
-
type:
|
|
2123
|
-
configuration:
|
|
2124
|
-
maxLength:
|
|
2180
|
+
type: import_zod18.z.literal(FieldType.EMAIL),
|
|
2181
|
+
configuration: import_zod18.z.object({
|
|
2182
|
+
maxLength: import_zod18.z.number().optional().describe("Maximum length of the text")
|
|
2125
2183
|
}).default({ maxLength: 10 }).optional(),
|
|
2126
|
-
defaultValue:
|
|
2184
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField]).optional()
|
|
2127
2185
|
});
|
|
2128
2186
|
var DateField = BaseField.extend({
|
|
2129
|
-
type:
|
|
2187
|
+
type: import_zod18.z.literal(FieldType.DATE),
|
|
2130
2188
|
defaultValue: SerializedNowDateTime.or(PlainDate).optional().openapi({ effectType: "input", type: "string" }).describe("Default date value(yyyy-MM-dd)"),
|
|
2131
|
-
configuration:
|
|
2189
|
+
configuration: import_zod18.z.object({
|
|
2132
2190
|
notice: TranslationConfig.describe(
|
|
2133
2191
|
"Text to display above the date input"
|
|
2134
2192
|
).optional()
|
|
2135
2193
|
}).optional()
|
|
2136
2194
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
2137
2195
|
var AgeField = BaseField.extend({
|
|
2138
|
-
type:
|
|
2196
|
+
type: import_zod18.z.literal(FieldType.AGE),
|
|
2139
2197
|
defaultValue: NumberFieldValue.optional(),
|
|
2140
|
-
configuration:
|
|
2198
|
+
configuration: import_zod18.z.object({
|
|
2141
2199
|
asOfDate: FieldReference,
|
|
2142
2200
|
prefix: TranslationConfig.optional(),
|
|
2143
2201
|
postfix: TranslationConfig.optional()
|
|
2144
2202
|
})
|
|
2145
2203
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
2146
2204
|
var TimeField = BaseField.extend({
|
|
2147
|
-
type:
|
|
2205
|
+
type: import_zod18.z.literal(FieldType.TIME),
|
|
2148
2206
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default time value (HH-mm)"),
|
|
2149
|
-
configuration:
|
|
2150
|
-
use12HourFormat:
|
|
2207
|
+
configuration: import_zod18.z.object({
|
|
2208
|
+
use12HourFormat: import_zod18.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
2151
2209
|
notice: TranslationConfig.describe(
|
|
2152
2210
|
"Text to display above the time input"
|
|
2153
2211
|
).optional()
|
|
2154
2212
|
}).optional()
|
|
2155
2213
|
}).describe("A single date input (HH-mm)");
|
|
2156
2214
|
var DateRangeField = BaseField.extend({
|
|
2157
|
-
type:
|
|
2215
|
+
type: import_zod18.z.literal(FieldType.DATE_RANGE),
|
|
2158
2216
|
defaultValue: DateRangeFieldValue.optional(),
|
|
2159
|
-
configuration:
|
|
2217
|
+
configuration: import_zod18.z.object({
|
|
2160
2218
|
notice: TranslationConfig.describe(
|
|
2161
2219
|
"Text to display above the date input"
|
|
2162
2220
|
).optional()
|
|
2163
2221
|
}).optional()
|
|
2164
2222
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
2165
|
-
var HtmlFontVariant =
|
|
2223
|
+
var HtmlFontVariant = import_zod18.z.enum([
|
|
2166
2224
|
"reg12",
|
|
2167
2225
|
"reg14",
|
|
2168
2226
|
"reg16",
|
|
@@ -2172,32 +2230,32 @@ var HtmlFontVariant = import_zod17.z.enum([
|
|
|
2172
2230
|
"h2",
|
|
2173
2231
|
"h1"
|
|
2174
2232
|
]);
|
|
2175
|
-
var ParagraphConfiguration =
|
|
2176
|
-
styles:
|
|
2233
|
+
var ParagraphConfiguration = import_zod18.z.object({
|
|
2234
|
+
styles: import_zod18.z.object({
|
|
2177
2235
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
2178
2236
|
"Font variant to use for the paragraph text"
|
|
2179
2237
|
),
|
|
2180
|
-
hint:
|
|
2238
|
+
hint: import_zod18.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
2181
2239
|
}).optional()
|
|
2182
2240
|
}).default({});
|
|
2183
2241
|
var Paragraph = BaseField.extend({
|
|
2184
|
-
type:
|
|
2242
|
+
type: import_zod18.z.literal(FieldType.PARAGRAPH),
|
|
2185
2243
|
configuration: ParagraphConfiguration
|
|
2186
2244
|
}).describe("A read-only HTML <p> paragraph");
|
|
2187
2245
|
var PageHeader = BaseField.extend({
|
|
2188
|
-
type:
|
|
2246
|
+
type: import_zod18.z.literal(FieldType.PAGE_HEADER)
|
|
2189
2247
|
}).describe("A read-only header component for form pages");
|
|
2190
2248
|
var File = BaseField.extend({
|
|
2191
|
-
type:
|
|
2249
|
+
type: import_zod18.z.literal(FieldType.FILE),
|
|
2192
2250
|
defaultValue: FileFieldValue.optional(),
|
|
2193
|
-
configuration:
|
|
2194
|
-
maxFileSize:
|
|
2251
|
+
configuration: import_zod18.z.object({
|
|
2252
|
+
maxFileSize: import_zod18.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2195
2253
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
2196
|
-
maxImageSize:
|
|
2197
|
-
targetSize:
|
|
2254
|
+
maxImageSize: import_zod18.z.object({
|
|
2255
|
+
targetSize: import_zod18.z.object({ width: import_zod18.z.number(), height: import_zod18.z.number() })
|
|
2198
2256
|
}).optional(),
|
|
2199
|
-
style:
|
|
2200
|
-
width:
|
|
2257
|
+
style: import_zod18.z.object({
|
|
2258
|
+
width: import_zod18.z.enum(["full", "auto"]).optional().describe(
|
|
2201
2259
|
"Whether the file upload button should take the full width of the container or not"
|
|
2202
2260
|
)
|
|
2203
2261
|
}).optional(),
|
|
@@ -2206,46 +2264,46 @@ var File = BaseField.extend({
|
|
|
2206
2264
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2207
2265
|
})
|
|
2208
2266
|
}).describe("File upload");
|
|
2209
|
-
var SelectOption =
|
|
2210
|
-
value:
|
|
2211
|
-
label:
|
|
2212
|
-
conditionals:
|
|
2267
|
+
var SelectOption = import_zod18.z.object({
|
|
2268
|
+
value: import_zod18.z.string().describe("The value of the option"),
|
|
2269
|
+
label: import_zod18.z.union([import_zod18.z.string(), TranslationConfig]).describe("The label of the option"),
|
|
2270
|
+
conditionals: import_zod18.z.array(ActionConditional).default([]).optional()
|
|
2213
2271
|
});
|
|
2214
2272
|
var NumberWithUnitField = BaseField.extend({
|
|
2215
|
-
type:
|
|
2273
|
+
type: import_zod18.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
2216
2274
|
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
2217
|
-
options:
|
|
2218
|
-
configuration:
|
|
2219
|
-
min:
|
|
2220
|
-
max:
|
|
2275
|
+
options: import_zod18.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
2276
|
+
configuration: import_zod18.z.object({
|
|
2277
|
+
min: import_zod18.z.number().optional().describe("Minimum value of the number field"),
|
|
2278
|
+
max: import_zod18.z.number().optional().describe("Maximum value of the number field"),
|
|
2221
2279
|
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
2222
2280
|
"Placeholder for the number field"
|
|
2223
2281
|
)
|
|
2224
2282
|
}).optional()
|
|
2225
2283
|
}).describe("Number with unit input");
|
|
2226
2284
|
var RadioGroup = BaseField.extend({
|
|
2227
|
-
type:
|
|
2285
|
+
type: import_zod18.z.literal(FieldType.RADIO_GROUP),
|
|
2228
2286
|
defaultValue: TextValue.optional(),
|
|
2229
|
-
options:
|
|
2230
|
-
configuration:
|
|
2231
|
-
styles:
|
|
2232
|
-
size:
|
|
2287
|
+
options: import_zod18.z.array(SelectOption).describe("A list of options"),
|
|
2288
|
+
configuration: import_zod18.z.object({
|
|
2289
|
+
styles: import_zod18.z.object({
|
|
2290
|
+
size: import_zod18.z.enum(["NORMAL", "LARGE"]).optional()
|
|
2233
2291
|
}).optional()
|
|
2234
2292
|
}).optional()
|
|
2235
2293
|
}).describe("Grouped radio options");
|
|
2236
2294
|
var BulletList = BaseField.extend({
|
|
2237
|
-
type:
|
|
2238
|
-
items:
|
|
2239
|
-
configuration:
|
|
2240
|
-
styles:
|
|
2295
|
+
type: import_zod18.z.literal(FieldType.BULLET_LIST),
|
|
2296
|
+
items: import_zod18.z.array(TranslationConfig).describe("A list of items"),
|
|
2297
|
+
configuration: import_zod18.z.object({
|
|
2298
|
+
styles: import_zod18.z.object({
|
|
2241
2299
|
fontVariant: HtmlFontVariant.optional()
|
|
2242
2300
|
}).optional()
|
|
2243
2301
|
}).default({})
|
|
2244
2302
|
}).describe("A list of bullet points");
|
|
2245
2303
|
var Select = BaseField.extend({
|
|
2246
|
-
type:
|
|
2247
|
-
defaultValue:
|
|
2248
|
-
options:
|
|
2304
|
+
type: import_zod18.z.literal(FieldType.SELECT),
|
|
2305
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserDataField]).optional(),
|
|
2306
|
+
options: import_zod18.z.array(SelectOption).describe("A list of options"),
|
|
2249
2307
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
2250
2308
|
`
|
|
2251
2309
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -2257,37 +2315,37 @@ var Select = BaseField.extend({
|
|
|
2257
2315
|
`
|
|
2258
2316
|
)
|
|
2259
2317
|
}).describe("Select input");
|
|
2260
|
-
var SelectDateRangeOption =
|
|
2318
|
+
var SelectDateRangeOption = import_zod18.z.object({
|
|
2261
2319
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
2262
2320
|
label: TranslationConfig.describe("The label of the option")
|
|
2263
2321
|
});
|
|
2264
2322
|
var SelectDateRangeField = BaseField.extend({
|
|
2265
|
-
type:
|
|
2323
|
+
type: import_zod18.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
2266
2324
|
defaultValue: SelectDateRangeValue.optional(),
|
|
2267
|
-
options:
|
|
2325
|
+
options: import_zod18.z.array(SelectDateRangeOption).describe("A list of options")
|
|
2268
2326
|
}).describe("Select input with date range options");
|
|
2269
|
-
var NameConfig =
|
|
2270
|
-
firstname:
|
|
2271
|
-
middlename:
|
|
2272
|
-
surname:
|
|
2327
|
+
var NameConfig = import_zod18.z.object({
|
|
2328
|
+
firstname: import_zod18.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
2329
|
+
middlename: import_zod18.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
2330
|
+
surname: import_zod18.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
2273
2331
|
});
|
|
2274
2332
|
var NameField = BaseField.extend({
|
|
2275
|
-
type:
|
|
2276
|
-
defaultValue:
|
|
2333
|
+
type: import_zod18.z.literal(FieldType.NAME),
|
|
2334
|
+
defaultValue: import_zod18.z.object({
|
|
2277
2335
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
2278
2336
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
2279
2337
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
2280
2338
|
}).optional(),
|
|
2281
|
-
configuration:
|
|
2339
|
+
configuration: import_zod18.z.object({
|
|
2282
2340
|
name: NameConfig.default({
|
|
2283
2341
|
firstname: { required: true },
|
|
2284
2342
|
surname: { required: true }
|
|
2285
2343
|
}).optional(),
|
|
2286
|
-
order:
|
|
2287
|
-
maxLength:
|
|
2344
|
+
order: import_zod18.z.array(import_zod18.z.enum(["firstname", "middlename", "surname"])).optional(),
|
|
2345
|
+
maxLength: import_zod18.z.number().optional().describe("Maximum length of the text"),
|
|
2288
2346
|
prefix: TranslationConfig.optional(),
|
|
2289
2347
|
postfix: TranslationConfig.optional(),
|
|
2290
|
-
showParentFieldError:
|
|
2348
|
+
showParentFieldError: import_zod18.z.boolean().default(false).optional().describe(
|
|
2291
2349
|
`If true, shows the parent field error and hides the subfield error`
|
|
2292
2350
|
)
|
|
2293
2351
|
}).default({
|
|
@@ -2298,53 +2356,53 @@ var NameField = BaseField.extend({
|
|
|
2298
2356
|
}).optional()
|
|
2299
2357
|
}).describe("Name input field");
|
|
2300
2358
|
var PhoneField = BaseField.extend({
|
|
2301
|
-
defaultValue:
|
|
2302
|
-
type:
|
|
2359
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2360
|
+
type: import_zod18.z.literal(FieldType.PHONE)
|
|
2303
2361
|
}).describe("Phone input field");
|
|
2304
2362
|
var IdField = BaseField.extend({
|
|
2305
|
-
defaultValue:
|
|
2306
|
-
type:
|
|
2363
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserDataField]).optional(),
|
|
2364
|
+
type: import_zod18.z.literal(FieldType.ID)
|
|
2307
2365
|
}).describe("ID input field");
|
|
2308
2366
|
var Checkbox = BaseField.extend({
|
|
2309
|
-
type:
|
|
2367
|
+
type: import_zod18.z.literal(FieldType.CHECKBOX),
|
|
2310
2368
|
defaultValue: CheckboxFieldValue.default(false)
|
|
2311
2369
|
}).describe("Boolean checkbox field");
|
|
2312
2370
|
var Country = BaseField.extend({
|
|
2313
|
-
type:
|
|
2371
|
+
type: import_zod18.z.literal(FieldType.COUNTRY),
|
|
2314
2372
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2315
|
-
optionOverrides:
|
|
2373
|
+
optionOverrides: import_zod18.z.array(SelectOption.omit({ label: true })).optional().describe(
|
|
2316
2374
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2317
2375
|
)
|
|
2318
2376
|
}).describe("Country select field");
|
|
2319
|
-
var AdministrativeAreas =
|
|
2377
|
+
var AdministrativeAreas = import_zod18.z.enum([
|
|
2320
2378
|
"ADMIN_STRUCTURE",
|
|
2321
2379
|
"HEALTH_FACILITY",
|
|
2322
2380
|
"CRVS_OFFICE"
|
|
2323
2381
|
]);
|
|
2324
|
-
var AdministrativeAreaConfiguration =
|
|
2382
|
+
var AdministrativeAreaConfiguration = import_zod18.z.object({
|
|
2325
2383
|
partOf: FieldReference.optional(),
|
|
2326
2384
|
type: AdministrativeAreas
|
|
2327
2385
|
}).describe("Administrative area options");
|
|
2328
2386
|
var AdministrativeArea = BaseField.extend({
|
|
2329
|
-
type:
|
|
2330
|
-
defaultValue:
|
|
2387
|
+
type: import_zod18.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2388
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2331
2389
|
configuration: AdministrativeAreaConfiguration
|
|
2332
2390
|
}).describe("Administrative area input field e.g. facility, office");
|
|
2333
2391
|
var LocationInput = BaseField.extend({
|
|
2334
|
-
type:
|
|
2392
|
+
type: import_zod18.z.literal(FieldType.LOCATION),
|
|
2335
2393
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2336
|
-
configuration:
|
|
2337
|
-
searchableResource:
|
|
2394
|
+
configuration: import_zod18.z.object({
|
|
2395
|
+
searchableResource: import_zod18.z.array(import_zod18.z.enum(["locations", "facilities", "offices"]))
|
|
2338
2396
|
})
|
|
2339
2397
|
}).describe("Input field for a location");
|
|
2340
2398
|
var FileUploadWithOptions = BaseField.extend({
|
|
2341
|
-
type:
|
|
2342
|
-
options:
|
|
2399
|
+
type: import_zod18.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2400
|
+
options: import_zod18.z.array(SelectOption).describe("A list of options"),
|
|
2343
2401
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
2344
|
-
configuration:
|
|
2345
|
-
maxFileSize:
|
|
2346
|
-
maxImageSize:
|
|
2347
|
-
targetSize:
|
|
2402
|
+
configuration: import_zod18.z.object({
|
|
2403
|
+
maxFileSize: import_zod18.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2404
|
+
maxImageSize: import_zod18.z.object({
|
|
2405
|
+
targetSize: import_zod18.z.object({ width: import_zod18.z.number(), height: import_zod18.z.number() })
|
|
2348
2406
|
}).optional(),
|
|
2349
2407
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
2350
2408
|
}).default({
|
|
@@ -2352,15 +2410,15 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2352
2410
|
})
|
|
2353
2411
|
});
|
|
2354
2412
|
var Facility = BaseField.extend({
|
|
2355
|
-
type:
|
|
2356
|
-
defaultValue:
|
|
2413
|
+
type: import_zod18.z.literal(FieldType.FACILITY),
|
|
2414
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional()
|
|
2357
2415
|
}).describe("Input field for a facility");
|
|
2358
2416
|
var Office = BaseField.extend({
|
|
2359
|
-
type:
|
|
2417
|
+
type: import_zod18.z.literal(FieldType.OFFICE),
|
|
2360
2418
|
defaultValue: NonEmptyTextValue.optional()
|
|
2361
2419
|
}).describe("Input field for an office");
|
|
2362
2420
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
2363
|
-
administrativeArea:
|
|
2421
|
+
administrativeArea: import_zod18.z.union([UUID, SerializedUserField]).optional()
|
|
2364
2422
|
});
|
|
2365
2423
|
var commonDomesticFieldProps = {
|
|
2366
2424
|
id: true,
|
|
@@ -2376,86 +2434,86 @@ var DomesticAddressField = Country.partial().pick({
|
|
|
2376
2434
|
AdministrativeArea.partial().pick(commonDomesticFieldProps).required({ id: true, type: true })
|
|
2377
2435
|
);
|
|
2378
2436
|
var Address = BaseField.extend({
|
|
2379
|
-
type:
|
|
2380
|
-
configuration:
|
|
2381
|
-
lineSeparator:
|
|
2382
|
-
fields:
|
|
2383
|
-
streetAddressForm:
|
|
2384
|
-
|
|
2385
|
-
id:
|
|
2437
|
+
type: import_zod18.z.literal(FieldType.ADDRESS),
|
|
2438
|
+
configuration: import_zod18.z.object({
|
|
2439
|
+
lineSeparator: import_zod18.z.string().optional(),
|
|
2440
|
+
fields: import_zod18.z.array(DomesticAddressField).optional(),
|
|
2441
|
+
streetAddressForm: import_zod18.z.array(
|
|
2442
|
+
import_zod18.z.object({
|
|
2443
|
+
id: import_zod18.z.string(),
|
|
2386
2444
|
required: requiredSchema,
|
|
2387
2445
|
label: TranslationConfig,
|
|
2388
|
-
type:
|
|
2389
|
-
conditionals:
|
|
2446
|
+
type: import_zod18.z.literal(FieldType.TEXT),
|
|
2447
|
+
conditionals: import_zod18.z.array(FieldConditional).default([]).optional(),
|
|
2390
2448
|
parent: FieldReference.optional()
|
|
2391
2449
|
})
|
|
2392
2450
|
).optional()
|
|
2393
2451
|
}).optional(),
|
|
2394
2452
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
2395
2453
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
2396
|
-
var StaticDataEntry =
|
|
2397
|
-
id:
|
|
2454
|
+
var StaticDataEntry = import_zod18.z.object({
|
|
2455
|
+
id: import_zod18.z.string().describe("ID for the data entry."),
|
|
2398
2456
|
label: TranslationConfig,
|
|
2399
|
-
value: TranslationConfig.or(
|
|
2457
|
+
value: TranslationConfig.or(import_zod18.z.string()).or(FieldReference)
|
|
2400
2458
|
}).describe("Static data entry");
|
|
2401
|
-
var DataEntry =
|
|
2459
|
+
var DataEntry = import_zod18.z.union([StaticDataEntry, import_zod18.z.object({ fieldId: import_zod18.z.string() })]).describe(
|
|
2402
2460
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
2403
2461
|
);
|
|
2404
2462
|
var DataField = BaseField.extend({
|
|
2405
|
-
type:
|
|
2406
|
-
configuration:
|
|
2463
|
+
type: import_zod18.z.literal(FieldType.DATA),
|
|
2464
|
+
configuration: import_zod18.z.object({
|
|
2407
2465
|
subtitle: TranslationConfig.optional(),
|
|
2408
|
-
data:
|
|
2466
|
+
data: import_zod18.z.array(DataEntry)
|
|
2409
2467
|
})
|
|
2410
2468
|
}).describe("Data field for displaying read-only data");
|
|
2411
2469
|
var ButtonField = BaseField.extend({
|
|
2412
|
-
type:
|
|
2470
|
+
type: import_zod18.z.literal(FieldType.BUTTON),
|
|
2413
2471
|
defaultValue: ButtonFieldValue.optional(),
|
|
2414
|
-
configuration:
|
|
2415
|
-
icon:
|
|
2472
|
+
configuration: import_zod18.z.object({
|
|
2473
|
+
icon: import_zod18.z.string().optional().describe(
|
|
2416
2474
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
2417
2475
|
),
|
|
2418
|
-
loading:
|
|
2476
|
+
loading: import_zod18.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
2419
2477
|
text: TranslationConfig.describe("Text to display on the button")
|
|
2420
2478
|
})
|
|
2421
2479
|
}).describe("Generic button without any built-in functionality");
|
|
2422
2480
|
var FieldGroup = BaseField.extend({
|
|
2423
|
-
type:
|
|
2481
|
+
type: import_zod18.z.literal(FieldType.FIELD_GROUP),
|
|
2424
2482
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2425
|
-
fields:
|
|
2483
|
+
fields: import_zod18.z.lazy(() => import_zod18.z.array(FieldConfig))
|
|
2426
2484
|
});
|
|
2427
2485
|
var AlphaPrintButton = BaseField.extend({
|
|
2428
|
-
type:
|
|
2429
|
-
configuration:
|
|
2430
|
-
template:
|
|
2486
|
+
type: import_zod18.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
2487
|
+
configuration: import_zod18.z.object({
|
|
2488
|
+
template: import_zod18.z.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
2431
2489
|
buttonLabel: TranslationConfig.optional().describe(
|
|
2432
2490
|
"Label for the print button"
|
|
2433
2491
|
)
|
|
2434
2492
|
})
|
|
2435
2493
|
}).describe("Print button field for printing certificates");
|
|
2436
2494
|
var HttpField = BaseField.extend({
|
|
2437
|
-
type:
|
|
2495
|
+
type: import_zod18.z.literal(FieldType.HTTP),
|
|
2438
2496
|
defaultValue: HttpFieldValue.optional(),
|
|
2439
|
-
configuration:
|
|
2497
|
+
configuration: import_zod18.z.object({
|
|
2440
2498
|
trigger: FieldReference,
|
|
2441
|
-
url:
|
|
2442
|
-
method:
|
|
2443
|
-
headers:
|
|
2444
|
-
body:
|
|
2445
|
-
errorValue:
|
|
2446
|
-
params:
|
|
2447
|
-
timeout:
|
|
2499
|
+
url: import_zod18.z.string().describe("URL to send the HTTP request to"),
|
|
2500
|
+
method: import_zod18.z.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
2501
|
+
headers: import_zod18.z.record(import_zod18.z.string()).optional(),
|
|
2502
|
+
body: import_zod18.z.record(import_zod18.z.any()).optional(),
|
|
2503
|
+
errorValue: import_zod18.z.any().optional().describe("Value to set if the request fails"),
|
|
2504
|
+
params: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.union([import_zod18.z.string(), FieldReference])).optional(),
|
|
2505
|
+
timeout: import_zod18.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2448
2506
|
})
|
|
2449
2507
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
2450
2508
|
var SearchField = HttpField.extend({
|
|
2451
|
-
type:
|
|
2509
|
+
type: import_zod18.z.literal(FieldType.SEARCH),
|
|
2452
2510
|
configuration: SearchQuery.pick({
|
|
2453
2511
|
query: true,
|
|
2454
2512
|
limit: true,
|
|
2455
2513
|
offset: true
|
|
2456
2514
|
}).extend({
|
|
2457
2515
|
validation: ValidationConfig,
|
|
2458
|
-
indicators:
|
|
2516
|
+
indicators: import_zod18.z.object({
|
|
2459
2517
|
loading: TranslationConfig.optional().describe(
|
|
2460
2518
|
"Text to display while the search is in progress"
|
|
2461
2519
|
),
|
|
@@ -2470,7 +2528,7 @@ var SearchField = HttpField.extend({
|
|
|
2470
2528
|
),
|
|
2471
2529
|
confirmButton: TranslationConfig.optional(),
|
|
2472
2530
|
clearButton: TranslationConfig.optional(),
|
|
2473
|
-
clearModal:
|
|
2531
|
+
clearModal: import_zod18.z.object({
|
|
2474
2532
|
title: TranslationConfig.optional(),
|
|
2475
2533
|
description: TranslationConfig.optional(),
|
|
2476
2534
|
cancel: TranslationConfig.optional(),
|
|
@@ -2480,18 +2538,34 @@ var SearchField = HttpField.extend({
|
|
|
2480
2538
|
}).optional()
|
|
2481
2539
|
})
|
|
2482
2540
|
});
|
|
2541
|
+
var Icd11Field = BaseField.extend({
|
|
2542
|
+
type: import_zod18.z.literal(FieldType.ICD11),
|
|
2543
|
+
defaultValue: Icd11FieldValue.optional(),
|
|
2544
|
+
configuration: import_zod18.z.object({
|
|
2545
|
+
url: import_zod18.z.string().describe(
|
|
2546
|
+
"URL of the ICD-11 search endpoint. Should point at a countryconfig-hosted proxy route rather than the WHO API directly, since the WHO access token must stay server-side."
|
|
2547
|
+
),
|
|
2548
|
+
apiVersion: import_zod18.z.string().default("v2").describe("Value sent as the WHO ICD-11 API `api-version` header"),
|
|
2549
|
+
chapterFilter: import_zod18.z.string().optional().describe(
|
|
2550
|
+
"Semicolon-separated list of ICD-11 chapters to restrict the search to, forwarded as-is to the WHO API `chapterFilter` parameter"
|
|
2551
|
+
),
|
|
2552
|
+
timeout: import_zod18.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2553
|
+
}).describe("ICD-11 search field configuration")
|
|
2554
|
+
}).describe(
|
|
2555
|
+
"Debounced, searchable ICD-11 diagnosis code field backed by the WHO ICD-11 search API"
|
|
2556
|
+
);
|
|
2483
2557
|
var LinkButtonField = BaseField.extend({
|
|
2484
|
-
type:
|
|
2485
|
-
configuration:
|
|
2486
|
-
url:
|
|
2558
|
+
type: import_zod18.z.literal(FieldType.LINK_BUTTON),
|
|
2559
|
+
configuration: import_zod18.z.object({
|
|
2560
|
+
url: import_zod18.z.string().describe("URL to open"),
|
|
2487
2561
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2488
|
-
icon:
|
|
2562
|
+
icon: import_zod18.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2489
2563
|
})
|
|
2490
2564
|
}).describe("Button that opens a link");
|
|
2491
2565
|
var VerificationStatus = BaseField.extend({
|
|
2492
|
-
type:
|
|
2566
|
+
type: import_zod18.z.literal(FieldType.VERIFICATION_STATUS),
|
|
2493
2567
|
defaultValue: VerificationStatusValue.optional(),
|
|
2494
|
-
configuration:
|
|
2568
|
+
configuration: import_zod18.z.object({
|
|
2495
2569
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2496
2570
|
description: TranslationConfig.describe(
|
|
2497
2571
|
"Explaining text on the banner in form."
|
|
@@ -2499,38 +2573,38 @@ var VerificationStatus = BaseField.extend({
|
|
|
2499
2573
|
})
|
|
2500
2574
|
});
|
|
2501
2575
|
var QueryParamReaderField = BaseField.extend({
|
|
2502
|
-
type:
|
|
2503
|
-
configuration:
|
|
2504
|
-
pickParams:
|
|
2576
|
+
type: import_zod18.z.literal(FieldType.QUERY_PARAM_READER),
|
|
2577
|
+
configuration: import_zod18.z.object({
|
|
2578
|
+
pickParams: import_zod18.z.array(import_zod18.z.string()).describe("List of query parameters to read from the URL")
|
|
2505
2579
|
})
|
|
2506
2580
|
}).describe(
|
|
2507
2581
|
"A field that maps URL query params into form values and clears them afterward"
|
|
2508
2582
|
);
|
|
2509
2583
|
var QrReaderField = BaseField.extend({
|
|
2510
|
-
type:
|
|
2584
|
+
type: import_zod18.z.literal(FieldType.QR_READER),
|
|
2511
2585
|
defaultValue: QrReaderFieldValue.optional(),
|
|
2512
|
-
configuration:
|
|
2513
|
-
validator:
|
|
2586
|
+
configuration: import_zod18.z.object({
|
|
2587
|
+
validator: import_zod18.z.custom(
|
|
2514
2588
|
(val) => typeof val === "object" && val !== null
|
|
2515
2589
|
)
|
|
2516
2590
|
}).optional()
|
|
2517
2591
|
});
|
|
2518
2592
|
var IdReaderField = BaseField.extend({
|
|
2519
|
-
type:
|
|
2593
|
+
type: import_zod18.z.literal(FieldType.ID_READER),
|
|
2520
2594
|
defaultValue: IdReaderFieldValue.optional(),
|
|
2521
|
-
methods:
|
|
2522
|
-
|
|
2595
|
+
methods: import_zod18.z.array(
|
|
2596
|
+
import_zod18.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2523
2597
|
)
|
|
2524
2598
|
});
|
|
2525
2599
|
var LoaderField = BaseField.extend({
|
|
2526
|
-
type:
|
|
2527
|
-
configuration:
|
|
2600
|
+
type: import_zod18.z.literal(FieldType.LOADER),
|
|
2601
|
+
configuration: import_zod18.z.object({
|
|
2528
2602
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2529
2603
|
})
|
|
2530
2604
|
}).describe(
|
|
2531
2605
|
"A non-interactive field that indicates an in progress operation in form"
|
|
2532
2606
|
);
|
|
2533
|
-
var FieldConfig =
|
|
2607
|
+
var FieldConfig = import_zod18.z.discriminatedUnion("type", [
|
|
2534
2608
|
FieldGroup,
|
|
2535
2609
|
Address,
|
|
2536
2610
|
TextField,
|
|
@@ -2571,32 +2645,33 @@ var FieldConfig = import_zod17.z.discriminatedUnion("type", [
|
|
|
2571
2645
|
IdReaderField,
|
|
2572
2646
|
QueryParamReaderField,
|
|
2573
2647
|
LoaderField,
|
|
2574
|
-
SearchField
|
|
2648
|
+
SearchField,
|
|
2649
|
+
Icd11Field
|
|
2575
2650
|
]).openapi({
|
|
2576
2651
|
description: "Form field configuration",
|
|
2577
2652
|
ref: "FieldConfig"
|
|
2578
2653
|
});
|
|
2579
|
-
var AnyFileField =
|
|
2654
|
+
var AnyFileField = import_zod18.z.discriminatedUnion("type", [
|
|
2580
2655
|
SignatureField,
|
|
2581
2656
|
File,
|
|
2582
2657
|
FileUploadWithOptions
|
|
2583
2658
|
]);
|
|
2584
2659
|
|
|
2585
2660
|
// ../commons/src/events/FormConfig.ts
|
|
2586
|
-
var
|
|
2661
|
+
var import_zod20 = require("zod");
|
|
2587
2662
|
|
|
2588
2663
|
// ../commons/src/events/PageConfig.ts
|
|
2589
|
-
var
|
|
2664
|
+
var import_zod19 = require("zod");
|
|
2590
2665
|
var import_zod_openapi7 = require("zod-openapi");
|
|
2591
|
-
(0, import_zod_openapi7.extendZodWithOpenApi)(
|
|
2592
|
-
var PageTypes =
|
|
2593
|
-
var PageConfigBase =
|
|
2594
|
-
id:
|
|
2666
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod19.z);
|
|
2667
|
+
var PageTypes = import_zod19.z.enum(["FORM", "VERIFICATION"]);
|
|
2668
|
+
var PageConfigBase = import_zod19.z.object({
|
|
2669
|
+
id: import_zod19.z.string().describe("Unique identifier for the page"),
|
|
2595
2670
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2596
|
-
requireCompletionToContinue:
|
|
2671
|
+
requireCompletionToContinue: import_zod19.z.boolean().default(false).describe(
|
|
2597
2672
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2598
2673
|
),
|
|
2599
|
-
fields:
|
|
2674
|
+
fields: import_zod19.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2600
2675
|
conditional: Conditional.optional().describe(
|
|
2601
2676
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2602
2677
|
)
|
|
@@ -2605,13 +2680,13 @@ var PageConfigBase = import_zod18.z.object({
|
|
|
2605
2680
|
ref: "FormPageConfig"
|
|
2606
2681
|
});
|
|
2607
2682
|
var FormPageConfig = PageConfigBase.extend({
|
|
2608
|
-
type:
|
|
2683
|
+
type: import_zod19.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2609
2684
|
});
|
|
2610
|
-
var VerificationActionConfig =
|
|
2611
|
-
verify:
|
|
2612
|
-
cancel:
|
|
2685
|
+
var VerificationActionConfig = import_zod19.z.object({
|
|
2686
|
+
verify: import_zod19.z.object({ label: TranslationConfig }),
|
|
2687
|
+
cancel: import_zod19.z.object({
|
|
2613
2688
|
label: TranslationConfig,
|
|
2614
|
-
confirmation:
|
|
2689
|
+
confirmation: import_zod19.z.object({
|
|
2615
2690
|
title: TranslationConfig,
|
|
2616
2691
|
body: TranslationConfig
|
|
2617
2692
|
})
|
|
@@ -2621,33 +2696,33 @@ var VerificationActionConfig = import_zod18.z.object({
|
|
|
2621
2696
|
ref: "VerificationActionConfig"
|
|
2622
2697
|
});
|
|
2623
2698
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2624
|
-
type:
|
|
2699
|
+
type: import_zod19.z.literal(PageTypes.enum.VERIFICATION),
|
|
2625
2700
|
actions: VerificationActionConfig
|
|
2626
2701
|
});
|
|
2627
|
-
var PageConfig =
|
|
2702
|
+
var PageConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2628
2703
|
FormPageConfig,
|
|
2629
2704
|
VerificationPageConfig
|
|
2630
2705
|
]);
|
|
2631
2706
|
|
|
2632
2707
|
// ../commons/src/events/FormConfig.ts
|
|
2633
|
-
var DeclarationFormConfig =
|
|
2708
|
+
var DeclarationFormConfig = import_zod20.z.object({
|
|
2634
2709
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2635
|
-
pages:
|
|
2710
|
+
pages: import_zod20.z.array(FormPageConfig)
|
|
2636
2711
|
}).describe("Configuration of the declaration form.");
|
|
2637
|
-
var ActionFormConfig =
|
|
2712
|
+
var ActionFormConfig = import_zod20.z.object({
|
|
2638
2713
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2639
|
-
pages:
|
|
2714
|
+
pages: import_zod20.z.array(PageConfig)
|
|
2640
2715
|
}).describe(
|
|
2641
2716
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2642
2717
|
);
|
|
2643
|
-
var FormConfig =
|
|
2718
|
+
var FormConfig = import_zod20.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2644
2719
|
|
|
2645
2720
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2646
|
-
var
|
|
2721
|
+
var import_zod21 = require("zod");
|
|
2647
2722
|
var import_zod_openapi8 = require("zod-openapi");
|
|
2648
|
-
(0, import_zod_openapi8.extendZodWithOpenApi)(
|
|
2649
|
-
var FieldReference2 =
|
|
2650
|
-
var Matcher =
|
|
2723
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod21.z);
|
|
2724
|
+
var FieldReference2 = import_zod21.z.string();
|
|
2725
|
+
var Matcher = import_zod21.z.object({
|
|
2651
2726
|
/**
|
|
2652
2727
|
* Reference to the field used in matching.
|
|
2653
2728
|
*
|
|
@@ -2655,23 +2730,23 @@ var Matcher = import_zod20.z.object({
|
|
|
2655
2730
|
* be used as the origin date to calculate the distance from.
|
|
2656
2731
|
*/
|
|
2657
2732
|
fieldId: FieldReference2,
|
|
2658
|
-
options:
|
|
2659
|
-
boost:
|
|
2733
|
+
options: import_zod21.z.object({
|
|
2734
|
+
boost: import_zod21.z.number().optional(),
|
|
2660
2735
|
matchAgainst: FieldReference2.optional()
|
|
2661
2736
|
}).optional().default({
|
|
2662
2737
|
boost: 1
|
|
2663
2738
|
})
|
|
2664
2739
|
});
|
|
2665
2740
|
var FuzzyMatcher = Matcher.extend({
|
|
2666
|
-
type:
|
|
2667
|
-
options:
|
|
2741
|
+
type: import_zod21.z.literal("fuzzy"),
|
|
2742
|
+
options: import_zod21.z.object({
|
|
2668
2743
|
/**
|
|
2669
2744
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2670
2745
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2671
2746
|
* Names of length >7 characters = 2 edits allowed
|
|
2672
2747
|
*/
|
|
2673
|
-
fuzziness:
|
|
2674
|
-
boost:
|
|
2748
|
+
fuzziness: import_zod21.z.union([import_zod21.z.string(), import_zod21.z.number()]).optional().default("AUTO:4,7"),
|
|
2749
|
+
boost: import_zod21.z.number().optional().default(1),
|
|
2675
2750
|
matchAgainst: FieldReference2.optional()
|
|
2676
2751
|
}).optional().default({
|
|
2677
2752
|
fuzziness: "AUTO:4,7",
|
|
@@ -2679,48 +2754,48 @@ var FuzzyMatcher = Matcher.extend({
|
|
|
2679
2754
|
})
|
|
2680
2755
|
});
|
|
2681
2756
|
var StrictMatcher = Matcher.extend({
|
|
2682
|
-
type:
|
|
2683
|
-
options:
|
|
2684
|
-
boost:
|
|
2757
|
+
type: import_zod21.z.literal("strict"),
|
|
2758
|
+
options: import_zod21.z.object({
|
|
2759
|
+
boost: import_zod21.z.number().optional().default(1),
|
|
2685
2760
|
/**
|
|
2686
2761
|
* The constant value to be present in the field for both records
|
|
2687
2762
|
*/
|
|
2688
|
-
value:
|
|
2763
|
+
value: import_zod21.z.string().optional(),
|
|
2689
2764
|
matchAgainst: FieldReference2.optional()
|
|
2690
2765
|
}).optional().default({
|
|
2691
2766
|
boost: 1
|
|
2692
2767
|
})
|
|
2693
2768
|
});
|
|
2694
2769
|
var DateRangeMatcher = Matcher.extend({
|
|
2695
|
-
type:
|
|
2696
|
-
options:
|
|
2770
|
+
type: import_zod21.z.literal("dateRange"),
|
|
2771
|
+
options: import_zod21.z.object({
|
|
2697
2772
|
/**
|
|
2698
2773
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2699
2774
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2700
2775
|
*/
|
|
2701
|
-
pivot:
|
|
2702
|
-
days:
|
|
2703
|
-
boost:
|
|
2776
|
+
pivot: import_zod21.z.number().optional(),
|
|
2777
|
+
days: import_zod21.z.number(),
|
|
2778
|
+
boost: import_zod21.z.number().optional().default(1),
|
|
2704
2779
|
matchAgainst: FieldReference2.optional()
|
|
2705
2780
|
})
|
|
2706
2781
|
});
|
|
2707
|
-
var Not =
|
|
2708
|
-
type:
|
|
2782
|
+
var Not = import_zod21.z.object({
|
|
2783
|
+
type: import_zod21.z.literal("not"),
|
|
2709
2784
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2710
|
-
clause:
|
|
2785
|
+
clause: import_zod21.z.lazy(() => Clause)
|
|
2711
2786
|
});
|
|
2712
|
-
var And =
|
|
2713
|
-
type:
|
|
2787
|
+
var And = import_zod21.z.object({
|
|
2788
|
+
type: import_zod21.z.literal("and"),
|
|
2714
2789
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2715
|
-
clauses:
|
|
2790
|
+
clauses: import_zod21.z.lazy(() => Clause.array())
|
|
2716
2791
|
});
|
|
2717
|
-
var Or =
|
|
2718
|
-
type:
|
|
2792
|
+
var Or = import_zod21.z.object({
|
|
2793
|
+
type: import_zod21.z.literal("or"),
|
|
2719
2794
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2720
|
-
clauses:
|
|
2795
|
+
clauses: import_zod21.z.lazy(() => Clause.array())
|
|
2721
2796
|
});
|
|
2722
|
-
var Clause =
|
|
2723
|
-
() =>
|
|
2797
|
+
var Clause = import_zod21.z.lazy(
|
|
2798
|
+
() => import_zod21.z.discriminatedUnion("type", [
|
|
2724
2799
|
Not,
|
|
2725
2800
|
And,
|
|
2726
2801
|
Or,
|
|
@@ -2731,22 +2806,22 @@ var Clause = import_zod20.z.lazy(
|
|
|
2731
2806
|
).openapi({
|
|
2732
2807
|
ref: "Clause"
|
|
2733
2808
|
});
|
|
2734
|
-
var DeduplicationConfig =
|
|
2735
|
-
id:
|
|
2809
|
+
var DeduplicationConfig = import_zod21.z.object({
|
|
2810
|
+
id: import_zod21.z.string(),
|
|
2736
2811
|
label: TranslationConfig,
|
|
2737
2812
|
query: Clause
|
|
2738
2813
|
});
|
|
2739
2814
|
|
|
2740
2815
|
// ../commons/src/events/ActionConfig.ts
|
|
2741
2816
|
var import_zod_openapi9 = require("zod-openapi");
|
|
2742
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(
|
|
2743
|
-
var DeclarationReviewConfig =
|
|
2817
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod22.z);
|
|
2818
|
+
var DeclarationReviewConfig = import_zod22.z.object({
|
|
2744
2819
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2745
|
-
fields:
|
|
2820
|
+
fields: import_zod22.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2746
2821
|
}).describe(
|
|
2747
2822
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2748
2823
|
);
|
|
2749
|
-
var ActionConfigBase =
|
|
2824
|
+
var ActionConfigBase = import_zod22.z.object({
|
|
2750
2825
|
label: TranslationConfig.describe("Human readable description of the action")
|
|
2751
2826
|
});
|
|
2752
2827
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
@@ -2754,71 +2829,71 @@ var DeclarationActionBase = ActionConfigBase.extend({
|
|
|
2754
2829
|
deduplication: DeduplicationConfig.optional()
|
|
2755
2830
|
});
|
|
2756
2831
|
var ReadActionConfig = ActionConfigBase.merge(
|
|
2757
|
-
|
|
2758
|
-
type:
|
|
2832
|
+
import_zod22.z.object({
|
|
2833
|
+
type: import_zod22.z.literal(ActionType.READ),
|
|
2759
2834
|
review: DeclarationReviewConfig.describe(
|
|
2760
2835
|
"Configuration of the review page for read-only view."
|
|
2761
2836
|
)
|
|
2762
2837
|
})
|
|
2763
2838
|
);
|
|
2764
2839
|
var DeclareConfig = DeclarationActionBase.merge(
|
|
2765
|
-
|
|
2766
|
-
type:
|
|
2840
|
+
import_zod22.z.object({
|
|
2841
|
+
type: import_zod22.z.literal(ActionType.DECLARE)
|
|
2767
2842
|
})
|
|
2768
2843
|
);
|
|
2769
2844
|
var ValidateConfig = DeclarationActionBase.merge(
|
|
2770
|
-
|
|
2771
|
-
type:
|
|
2845
|
+
import_zod22.z.object({
|
|
2846
|
+
type: import_zod22.z.literal(ActionType.VALIDATE)
|
|
2772
2847
|
})
|
|
2773
2848
|
);
|
|
2774
2849
|
var EscalateConfig = DeclarationActionBase.merge(
|
|
2775
|
-
|
|
2776
|
-
type:
|
|
2850
|
+
import_zod22.z.object({
|
|
2851
|
+
type: import_zod22.z.literal(ActionType.ESCALATE)
|
|
2777
2852
|
})
|
|
2778
2853
|
);
|
|
2779
2854
|
var RegisterConfig = DeclarationActionBase.merge(
|
|
2780
|
-
|
|
2781
|
-
type:
|
|
2855
|
+
import_zod22.z.object({
|
|
2856
|
+
type: import_zod22.z.literal(ActionType.REGISTER)
|
|
2782
2857
|
})
|
|
2783
2858
|
);
|
|
2784
2859
|
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2785
|
-
|
|
2786
|
-
type:
|
|
2860
|
+
import_zod22.z.object({
|
|
2861
|
+
type: import_zod22.z.literal(ActionType.REJECT)
|
|
2787
2862
|
})
|
|
2788
2863
|
);
|
|
2789
2864
|
var ArchiveConfig = ActionConfigBase.merge(
|
|
2790
|
-
|
|
2791
|
-
type:
|
|
2865
|
+
import_zod22.z.object({
|
|
2866
|
+
type: import_zod22.z.literal(ActionType.ARCHIVE)
|
|
2792
2867
|
})
|
|
2793
2868
|
);
|
|
2794
2869
|
var DeleteConfig = ActionConfigBase.merge(
|
|
2795
|
-
|
|
2796
|
-
type:
|
|
2870
|
+
import_zod22.z.object({
|
|
2871
|
+
type: import_zod22.z.literal(ActionType.DELETE)
|
|
2797
2872
|
})
|
|
2798
2873
|
);
|
|
2799
2874
|
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2800
|
-
|
|
2801
|
-
type:
|
|
2875
|
+
import_zod22.z.object({
|
|
2876
|
+
type: import_zod22.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2802
2877
|
printForm: ActionFormConfig
|
|
2803
2878
|
})
|
|
2804
2879
|
);
|
|
2805
2880
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2806
|
-
|
|
2807
|
-
type:
|
|
2881
|
+
import_zod22.z.object({
|
|
2882
|
+
type: import_zod22.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2808
2883
|
correctionForm: ActionFormConfig
|
|
2809
2884
|
})
|
|
2810
2885
|
);
|
|
2811
2886
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2812
|
-
|
|
2813
|
-
type:
|
|
2887
|
+
import_zod22.z.object({
|
|
2888
|
+
type: import_zod22.z.literal(ActionType.REJECT_CORRECTION)
|
|
2814
2889
|
})
|
|
2815
2890
|
);
|
|
2816
2891
|
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2817
|
-
|
|
2818
|
-
type:
|
|
2892
|
+
import_zod22.z.object({
|
|
2893
|
+
type: import_zod22.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2819
2894
|
})
|
|
2820
2895
|
);
|
|
2821
|
-
var ActionConfig =
|
|
2896
|
+
var ActionConfig = import_zod22.z.discriminatedUnion("type", [
|
|
2822
2897
|
/*
|
|
2823
2898
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2824
2899
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -2840,7 +2915,7 @@ var ActionConfig = import_zod21.z.discriminatedUnion("type", [
|
|
|
2840
2915
|
]).describe(
|
|
2841
2916
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2842
2917
|
).openapi({ ref: "ActionConfig" });
|
|
2843
|
-
var DeclarationActionConfig =
|
|
2918
|
+
var DeclarationActionConfig = import_zod22.z.discriminatedUnion("type", [
|
|
2844
2919
|
DeclareConfig,
|
|
2845
2920
|
ValidateConfig,
|
|
2846
2921
|
EscalateConfig,
|
|
@@ -2848,80 +2923,87 @@ var DeclarationActionConfig = import_zod21.z.discriminatedUnion("type", [
|
|
|
2848
2923
|
]);
|
|
2849
2924
|
|
|
2850
2925
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2851
|
-
var
|
|
2852
|
-
var FontFamily =
|
|
2853
|
-
normal:
|
|
2854
|
-
bold:
|
|
2855
|
-
italics:
|
|
2856
|
-
bolditalics:
|
|
2857
|
-
});
|
|
2858
|
-
var CertificateConfig =
|
|
2859
|
-
id:
|
|
2860
|
-
event:
|
|
2861
|
-
isV2Template:
|
|
2926
|
+
var import_zod23 = require("zod");
|
|
2927
|
+
var FontFamily = import_zod23.z.object({
|
|
2928
|
+
normal: import_zod23.z.string(),
|
|
2929
|
+
bold: import_zod23.z.string(),
|
|
2930
|
+
italics: import_zod23.z.string(),
|
|
2931
|
+
bolditalics: import_zod23.z.string()
|
|
2932
|
+
});
|
|
2933
|
+
var CertificateConfig = import_zod23.z.object({
|
|
2934
|
+
id: import_zod23.z.string(),
|
|
2935
|
+
event: import_zod23.z.string(),
|
|
2936
|
+
isV2Template: import_zod23.z.boolean().optional(),
|
|
2862
2937
|
label: TranslationConfig,
|
|
2863
|
-
isDefault:
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2938
|
+
isDefault: import_zod23.z.boolean(),
|
|
2939
|
+
/**
|
|
2940
|
+
* Whether the `record.registered.print-certified-copies` scope is required to
|
|
2941
|
+
* receive this template. Defaults to `true` when omitted (backward compatible).
|
|
2942
|
+
* Set to `false` for templates that must be available without the print
|
|
2943
|
+
* permission, e.g. Notification Records printed from the declaration review page.
|
|
2944
|
+
*/
|
|
2945
|
+
requiresPrintPermission: import_zod23.z.boolean().optional(),
|
|
2946
|
+
fee: import_zod23.z.object({
|
|
2947
|
+
onTime: import_zod23.z.number(),
|
|
2948
|
+
late: import_zod23.z.number(),
|
|
2949
|
+
delayed: import_zod23.z.number()
|
|
2868
2950
|
}),
|
|
2869
|
-
svgUrl:
|
|
2870
|
-
fonts:
|
|
2871
|
-
conditionals:
|
|
2951
|
+
svgUrl: import_zod23.z.string(),
|
|
2952
|
+
fonts: import_zod23.z.record(FontFamily).optional(),
|
|
2953
|
+
conditionals: import_zod23.z.array(ShowConditional).optional()
|
|
2872
2954
|
});
|
|
2873
2955
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2874
|
-
hash:
|
|
2875
|
-
svg:
|
|
2956
|
+
hash: import_zod23.z.string().optional(),
|
|
2957
|
+
svg: import_zod23.z.string()
|
|
2876
2958
|
});
|
|
2877
2959
|
|
|
2878
2960
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2879
|
-
var
|
|
2880
|
-
var LanguageConfig =
|
|
2881
|
-
lang:
|
|
2961
|
+
var import_zod24 = require("zod");
|
|
2962
|
+
var LanguageConfig = import_zod24.z.object({
|
|
2963
|
+
lang: import_zod24.z.string(),
|
|
2882
2964
|
/**
|
|
2883
2965
|
* client.csv contents
|
|
2884
2966
|
*/
|
|
2885
|
-
messages:
|
|
2967
|
+
messages: import_zod24.z.record(import_zod24.z.string())
|
|
2886
2968
|
});
|
|
2887
2969
|
|
|
2888
2970
|
// ../commons/src/events/EventConfig.ts
|
|
2889
|
-
var
|
|
2971
|
+
var import_zod30 = require("zod");
|
|
2890
2972
|
|
|
2891
2973
|
// ../commons/src/events/SummaryConfig.ts
|
|
2892
|
-
var
|
|
2893
|
-
var BaseField2 =
|
|
2974
|
+
var import_zod25 = require("zod");
|
|
2975
|
+
var BaseField2 = import_zod25.z.object({
|
|
2894
2976
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2895
2977
|
"Default message displayed when the field value is empty."
|
|
2896
2978
|
),
|
|
2897
|
-
conditionals:
|
|
2979
|
+
conditionals: import_zod25.z.array(ShowConditional).default([]).optional()
|
|
2898
2980
|
});
|
|
2899
2981
|
var ReferenceField = BaseField2.extend({
|
|
2900
|
-
fieldId:
|
|
2982
|
+
fieldId: import_zod25.z.string(),
|
|
2901
2983
|
label: TranslationConfig.optional().describe(
|
|
2902
2984
|
"Overrides the default label from the referenced field when provided."
|
|
2903
2985
|
)
|
|
2904
2986
|
}).describe("Field referencing existing event data by field ID.");
|
|
2905
2987
|
var Field = BaseField2.extend({
|
|
2906
|
-
id:
|
|
2988
|
+
id: import_zod25.z.string().describe("Identifier of the summary field."),
|
|
2907
2989
|
value: TranslationConfig.describe(
|
|
2908
2990
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2909
2991
|
),
|
|
2910
2992
|
label: TranslationConfig
|
|
2911
2993
|
}).describe("Custom field defined for the summary view.");
|
|
2912
|
-
var SummaryConfig =
|
|
2913
|
-
fields:
|
|
2994
|
+
var SummaryConfig = import_zod25.z.object({
|
|
2995
|
+
fields: import_zod25.z.array(import_zod25.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2914
2996
|
}).describe("Configuration of the event summary section.");
|
|
2915
2997
|
|
|
2916
2998
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2917
|
-
var
|
|
2918
|
-
var MatchType =
|
|
2919
|
-
var BaseField3 =
|
|
2920
|
-
config:
|
|
2999
|
+
var import_zod26 = require("zod");
|
|
3000
|
+
var MatchType = import_zod26.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
3001
|
+
var BaseField3 = import_zod26.z.object({
|
|
3002
|
+
config: import_zod26.z.object({
|
|
2921
3003
|
type: MatchType.describe(
|
|
2922
3004
|
"Determines the search type of field. How to match value."
|
|
2923
3005
|
),
|
|
2924
|
-
searchFields:
|
|
3006
|
+
searchFields: import_zod26.z.array(import_zod26.z.string()).optional().describe(
|
|
2925
3007
|
`
|
|
2926
3008
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2927
3009
|
All specified fields will be combined using OR logic.
|
|
@@ -2931,7 +3013,7 @@ var BaseField3 = import_zod25.z.object({
|
|
|
2931
3013
|
`
|
|
2932
3014
|
)
|
|
2933
3015
|
}),
|
|
2934
|
-
type:
|
|
3016
|
+
type: import_zod26.z.nativeEnum(FieldType).optional().describe(
|
|
2935
3017
|
`
|
|
2936
3018
|
Explicitly specify the field type for searchFields.
|
|
2937
3019
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2945,7 +3027,7 @@ var BaseField3 = import_zod25.z.object({
|
|
|
2945
3027
|
This is required when searchFields is defined.
|
|
2946
3028
|
`
|
|
2947
3029
|
),
|
|
2948
|
-
options:
|
|
3030
|
+
options: import_zod26.z.array(SelectOption).optional(),
|
|
2949
3031
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2950
3032
|
`
|
|
2951
3033
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2966,7 +3048,7 @@ var BaseField3 = import_zod25.z.object({
|
|
|
2966
3048
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2967
3049
|
`
|
|
2968
3050
|
),
|
|
2969
|
-
conditionals:
|
|
3051
|
+
conditionals: import_zod26.z.array(FieldConditional).default([]).optional().describe(
|
|
2970
3052
|
`
|
|
2971
3053
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2972
3054
|
|
|
@@ -2980,20 +3062,20 @@ var BaseField3 = import_zod25.z.object({
|
|
|
2980
3062
|
are always rendered in the advanced search form.
|
|
2981
3063
|
`
|
|
2982
3064
|
),
|
|
2983
|
-
validations:
|
|
3065
|
+
validations: import_zod26.z.array(ValidationConfig).default([]).optional().describe(
|
|
2984
3066
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2985
3067
|
)
|
|
2986
3068
|
});
|
|
2987
|
-
var SearchQueryParams =
|
|
2988
|
-
eventType:
|
|
3069
|
+
var SearchQueryParams = import_zod26.z.object({
|
|
3070
|
+
eventType: import_zod26.z.string().optional().describe(
|
|
2989
3071
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2990
3072
|
)
|
|
2991
3073
|
}).catchall(FieldValue);
|
|
2992
3074
|
var FieldConfigSchema = BaseField3.extend({
|
|
2993
|
-
fieldId:
|
|
2994
|
-
fieldType:
|
|
3075
|
+
fieldId: import_zod26.z.string(),
|
|
3076
|
+
fieldType: import_zod26.z.literal("field")
|
|
2995
3077
|
});
|
|
2996
|
-
var EventFieldIdInput =
|
|
3078
|
+
var EventFieldIdInput = import_zod26.z.enum([
|
|
2997
3079
|
"trackingId",
|
|
2998
3080
|
"status",
|
|
2999
3081
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -3002,7 +3084,7 @@ var EventFieldIdInput = import_zod25.z.enum([
|
|
|
3002
3084
|
"updatedAt"
|
|
3003
3085
|
]);
|
|
3004
3086
|
var METADATA_FIELD_PREFIX = "event.";
|
|
3005
|
-
var EventFieldId =
|
|
3087
|
+
var EventFieldId = import_zod26.z.enum([
|
|
3006
3088
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
3007
3089
|
`${METADATA_FIELD_PREFIX}status`,
|
|
3008
3090
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -3012,29 +3094,29 @@ var EventFieldId = import_zod25.z.enum([
|
|
|
3012
3094
|
]);
|
|
3013
3095
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
3014
3096
|
fieldId: EventFieldId,
|
|
3015
|
-
fieldType:
|
|
3097
|
+
fieldType: import_zod26.z.literal("event")
|
|
3016
3098
|
});
|
|
3017
|
-
var AdvancedSearchField =
|
|
3099
|
+
var AdvancedSearchField = import_zod26.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
3018
3100
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
3019
3101
|
if (!data.label) {
|
|
3020
3102
|
ctx.addIssue({
|
|
3021
|
-
code:
|
|
3103
|
+
code: import_zod26.z.ZodIssueCode.custom,
|
|
3022
3104
|
message: "label is required when config.searchFields is defined.",
|
|
3023
3105
|
path: ["label"]
|
|
3024
3106
|
});
|
|
3025
3107
|
}
|
|
3026
3108
|
if (!data.type) {
|
|
3027
3109
|
ctx.addIssue({
|
|
3028
|
-
code:
|
|
3110
|
+
code: import_zod26.z.ZodIssueCode.custom,
|
|
3029
3111
|
message: "type is required when config.searchFields is defined.",
|
|
3030
3112
|
path: ["type"]
|
|
3031
3113
|
});
|
|
3032
3114
|
}
|
|
3033
3115
|
}
|
|
3034
3116
|
});
|
|
3035
|
-
var AdvancedSearchConfig =
|
|
3117
|
+
var AdvancedSearchConfig = import_zod26.z.object({
|
|
3036
3118
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3037
|
-
fields:
|
|
3119
|
+
fields: import_zod26.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3038
3120
|
});
|
|
3039
3121
|
|
|
3040
3122
|
// ../commons/src/events/utils.ts
|
|
@@ -3043,17 +3125,17 @@ var import_lodash = require("lodash");
|
|
|
3043
3125
|
// ../commons/src/conditionals/validate.ts
|
|
3044
3126
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
3045
3127
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
3046
|
-
var
|
|
3128
|
+
var import_zod29 = require("zod");
|
|
3047
3129
|
var import_date_fns = require("date-fns");
|
|
3048
3130
|
|
|
3049
3131
|
// ../commons/src/events/FieldTypeMapping.ts
|
|
3050
|
-
var
|
|
3132
|
+
var import_zod28 = require("zod");
|
|
3051
3133
|
|
|
3052
3134
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
3053
|
-
var
|
|
3135
|
+
var import_zod27 = require("zod");
|
|
3054
3136
|
function getDynamicNameValue(field3) {
|
|
3055
3137
|
const nameConfiguration = field3.configuration?.name;
|
|
3056
|
-
return
|
|
3138
|
+
return import_zod27.z.object({
|
|
3057
3139
|
firstname: nameConfiguration?.firstname?.required ? NonEmptyTextValue : TextValue,
|
|
3058
3140
|
surname: nameConfiguration?.surname?.required ? NonEmptyTextValue : TextValue,
|
|
3059
3141
|
middlename: nameConfiguration?.middlename?.required ? NonEmptyTextValue : TextValue.optional()
|
|
@@ -3081,7 +3163,7 @@ function mapFieldTypeToZod(field3, actionType) {
|
|
|
3081
3163
|
let schema;
|
|
3082
3164
|
switch (field3.type) {
|
|
3083
3165
|
case FieldType.FIELD_GROUP: {
|
|
3084
|
-
schema =
|
|
3166
|
+
schema = import_zod28.z.object(
|
|
3085
3167
|
field3.fields.reduce((acc, subfield) => {
|
|
3086
3168
|
acc[subfield.id] = mapFieldTypeToZod(subfield, actionType);
|
|
3087
3169
|
return acc;
|
|
@@ -3171,6 +3253,9 @@ function mapFieldTypeToZod(field3, actionType) {
|
|
|
3171
3253
|
case FieldType.ID_READER:
|
|
3172
3254
|
schema = IdReaderFieldValue;
|
|
3173
3255
|
break;
|
|
3256
|
+
case FieldType.ICD11:
|
|
3257
|
+
schema = Icd11FieldValue;
|
|
3258
|
+
break;
|
|
3174
3259
|
}
|
|
3175
3260
|
return field3.required ? schema : schema.nullish();
|
|
3176
3261
|
}
|
|
@@ -3221,6 +3306,7 @@ function mapFieldTypeToEmptyValue(field3) {
|
|
|
3221
3306
|
case FieldType.QR_READER:
|
|
3222
3307
|
case FieldType.ID_READER:
|
|
3223
3308
|
case FieldType.LOADER:
|
|
3309
|
+
case FieldType.ICD11:
|
|
3224
3310
|
return null;
|
|
3225
3311
|
case FieldType.ADDRESS:
|
|
3226
3312
|
return {
|
|
@@ -3363,6 +3449,9 @@ var isIdReaderFieldType = (field3) => {
|
|
|
3363
3449
|
var isLoaderFieldType = (field3) => {
|
|
3364
3450
|
return field3.config.type === FieldType.LOADER;
|
|
3365
3451
|
};
|
|
3452
|
+
var isIcd11FieldType = (field3) => {
|
|
3453
|
+
return field3.config.type === FieldType.ICD11;
|
|
3454
|
+
};
|
|
3366
3455
|
var isNonInteractiveFieldType = (field3) => {
|
|
3367
3456
|
return field3.type === FieldType.DIVIDER || field3.type === FieldType.PAGE_HEADER || field3.type === FieldType.PARAGRAPH || field3.type === FieldType.BULLET_LIST || field3.type === FieldType.DATA || field3.type === FieldType.ALPHA_PRINT_BUTTON || field3.type === FieldType.HTTP || field3.type === FieldType.LINK_BUTTON || field3.type === FieldType.QUERY_PARAM_READER || field3.type === FieldType.LOADER;
|
|
3368
3457
|
};
|
|
@@ -3374,9 +3463,9 @@ var ajv = new import__.default({
|
|
|
3374
3463
|
strict: false
|
|
3375
3464
|
// Allow minContains and other newer features
|
|
3376
3465
|
});
|
|
3377
|
-
var DataContext =
|
|
3378
|
-
rootData:
|
|
3379
|
-
$leafAdminStructureLocationIds:
|
|
3466
|
+
var DataContext = import_zod29.z.object({
|
|
3467
|
+
rootData: import_zod29.z.object({
|
|
3468
|
+
$leafAdminStructureLocationIds: import_zod29.z.array(import_zod29.z.object({ id: UUID }))
|
|
3380
3469
|
})
|
|
3381
3470
|
});
|
|
3382
3471
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -3770,7 +3859,7 @@ function areCertificateConditionsMet(conditions, values) {
|
|
|
3770
3859
|
}
|
|
3771
3860
|
|
|
3772
3861
|
// ../commons/src/utils.ts
|
|
3773
|
-
var
|
|
3862
|
+
var z30 = __toESM(require("zod"));
|
|
3774
3863
|
var _ = __toESM(require("lodash"));
|
|
3775
3864
|
function getOrThrow(x, message) {
|
|
3776
3865
|
if (x === void 0 || x === null) {
|
|
@@ -3781,11 +3870,11 @@ function getOrThrow(x, message) {
|
|
|
3781
3870
|
function joinValues(values, separator = " ") {
|
|
3782
3871
|
return values.filter((value) => !!value).join(separator).trim();
|
|
3783
3872
|
}
|
|
3784
|
-
var FullNameV1 =
|
|
3785
|
-
|
|
3786
|
-
use:
|
|
3787
|
-
family:
|
|
3788
|
-
given:
|
|
3873
|
+
var FullNameV1 = z30.array(
|
|
3874
|
+
z30.object({
|
|
3875
|
+
use: z30.string(),
|
|
3876
|
+
family: z30.string(),
|
|
3877
|
+
given: z30.array(z30.string())
|
|
3789
3878
|
})
|
|
3790
3879
|
);
|
|
3791
3880
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -4772,12 +4861,12 @@ function createFieldConditionals(fieldId) {
|
|
|
4772
4861
|
}
|
|
4773
4862
|
|
|
4774
4863
|
// ../commons/src/events/EventConfig.ts
|
|
4775
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(
|
|
4776
|
-
var EventFieldReference =
|
|
4864
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod30.z);
|
|
4865
|
+
var EventFieldReference = import_zod30.z.object({ $$event: EventMetadataDateFieldIdInput }).describe(
|
|
4777
4866
|
"Reference to a field defined in the event metadata, using the field id."
|
|
4778
4867
|
);
|
|
4779
|
-
var EventConfig =
|
|
4780
|
-
id:
|
|
4868
|
+
var EventConfig = import_zod30.z.object({
|
|
4869
|
+
id: import_zod30.z.string().describe(
|
|
4781
4870
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
4782
4871
|
),
|
|
4783
4872
|
dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
|
|
@@ -4795,13 +4884,13 @@ var EventConfig = import_zod29.z.object({
|
|
|
4795
4884
|
label: TranslationConfig.describe(
|
|
4796
4885
|
"Human-readable label for the event type."
|
|
4797
4886
|
),
|
|
4798
|
-
actions:
|
|
4887
|
+
actions: import_zod30.z.array(ActionConfig).describe(
|
|
4799
4888
|
"Configuration of system-defined actions associated with the event."
|
|
4800
4889
|
),
|
|
4801
4890
|
declaration: DeclarationFormConfig.describe(
|
|
4802
4891
|
"Configuration of the form used to gather event data."
|
|
4803
4892
|
),
|
|
4804
|
-
advancedSearch:
|
|
4893
|
+
advancedSearch: import_zod30.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
4805
4894
|
"Configuration of fields available in the advanced search feature."
|
|
4806
4895
|
)
|
|
4807
4896
|
}).superRefine((event2, ctx) => {
|
|
@@ -4866,7 +4955,7 @@ var definePage = (page) => PageConfig.parse(page);
|
|
|
4866
4955
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
4867
4956
|
|
|
4868
4957
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
4869
|
-
var
|
|
4958
|
+
var import_zod34 = require("zod");
|
|
4870
4959
|
|
|
4871
4960
|
// ../commons/src/searchConfigs.ts
|
|
4872
4961
|
function createSearchConfig(baseField) {
|
|
@@ -5067,17 +5156,17 @@ var event = Object.assign(eventFn, {
|
|
|
5067
5156
|
});
|
|
5068
5157
|
|
|
5069
5158
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
5070
|
-
var
|
|
5159
|
+
var import_zod31 = require("zod");
|
|
5071
5160
|
var WorkqueueColumnKeysArray = [
|
|
5072
5161
|
...EventMetadataKeysArray,
|
|
5073
5162
|
"title",
|
|
5074
5163
|
"outbox"
|
|
5075
5164
|
];
|
|
5076
|
-
var WorkqueueColumnKeys =
|
|
5077
|
-
var WorkqueueColumnValue =
|
|
5165
|
+
var WorkqueueColumnKeys = import_zod31.z.enum(WorkqueueColumnKeysArray);
|
|
5166
|
+
var WorkqueueColumnValue = import_zod31.z.object({
|
|
5078
5167
|
$event: WorkqueueColumnKeys
|
|
5079
5168
|
});
|
|
5080
|
-
var WorkqueueColumn =
|
|
5169
|
+
var WorkqueueColumn = import_zod31.z.object({
|
|
5081
5170
|
label: TranslationConfig,
|
|
5082
5171
|
value: WorkqueueColumnValue
|
|
5083
5172
|
});
|
|
@@ -5088,58 +5177,58 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
5088
5177
|
}
|
|
5089
5178
|
|
|
5090
5179
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
5091
|
-
var
|
|
5092
|
-
var SerializableExact =
|
|
5093
|
-
type:
|
|
5094
|
-
term:
|
|
5095
|
-
});
|
|
5096
|
-
var SerializableWithin =
|
|
5097
|
-
type:
|
|
5098
|
-
location:
|
|
5099
|
-
});
|
|
5100
|
-
var SerializedQueryExpression =
|
|
5101
|
-
eventType:
|
|
5102
|
-
status:
|
|
5103
|
-
createdAt:
|
|
5104
|
-
updatedAt:
|
|
5105
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
5106
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
5107
|
-
|
|
5180
|
+
var import_zod32 = require("zod");
|
|
5181
|
+
var SerializableExact = import_zod32.z.object({
|
|
5182
|
+
type: import_zod32.z.literal("exact"),
|
|
5183
|
+
term: import_zod32.z.union([import_zod32.z.string(), SerializedUserField])
|
|
5184
|
+
});
|
|
5185
|
+
var SerializableWithin = import_zod32.z.object({
|
|
5186
|
+
type: import_zod32.z.literal("within"),
|
|
5187
|
+
location: import_zod32.z.union([import_zod32.z.string(), SerializedUserField])
|
|
5188
|
+
});
|
|
5189
|
+
var SerializedQueryExpression = import_zod32.z.object({
|
|
5190
|
+
eventType: import_zod32.z.string(),
|
|
5191
|
+
status: import_zod32.z.optional(import_zod32.z.union([AnyOfStatus, ExactStatus])),
|
|
5192
|
+
createdAt: import_zod32.z.optional(DateCondition),
|
|
5193
|
+
updatedAt: import_zod32.z.optional(DateCondition),
|
|
5194
|
+
"legalStatuses.REGISTERED.createdAt": import_zod32.z.optional(DateCondition),
|
|
5195
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod32.z.optional(
|
|
5196
|
+
import_zod32.z.union([Within, Exact])
|
|
5108
5197
|
),
|
|
5109
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
5110
|
-
createdAtLocation:
|
|
5111
|
-
|
|
5198
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod32.z.optional(Exact),
|
|
5199
|
+
createdAtLocation: import_zod32.z.optional(
|
|
5200
|
+
import_zod32.z.union([SerializableWithin, SerializableExact])
|
|
5112
5201
|
),
|
|
5113
|
-
updatedAtLocation:
|
|
5114
|
-
|
|
5202
|
+
updatedAtLocation: import_zod32.z.optional(
|
|
5203
|
+
import_zod32.z.union([SerializableWithin, SerializableExact])
|
|
5115
5204
|
),
|
|
5116
|
-
updatedByUserRole:
|
|
5117
|
-
assignedTo:
|
|
5118
|
-
createdBy:
|
|
5205
|
+
updatedByUserRole: import_zod32.z.optional(SerializableExact),
|
|
5206
|
+
assignedTo: import_zod32.z.optional(SerializableExact),
|
|
5207
|
+
createdBy: import_zod32.z.optional(SerializableExact),
|
|
5119
5208
|
createdByUserType: ExactUserType,
|
|
5120
|
-
updatedBy:
|
|
5121
|
-
trackingId:
|
|
5122
|
-
flags:
|
|
5209
|
+
updatedBy: import_zod32.z.optional(SerializableExact),
|
|
5210
|
+
trackingId: import_zod32.z.optional(Exact),
|
|
5211
|
+
flags: import_zod32.z.optional(ContainsFlags),
|
|
5123
5212
|
data: QueryInput
|
|
5124
5213
|
}).partial();
|
|
5125
|
-
var Or2 =
|
|
5126
|
-
type:
|
|
5127
|
-
clauses:
|
|
5214
|
+
var Or2 = import_zod32.z.object({
|
|
5215
|
+
type: import_zod32.z.literal("or"),
|
|
5216
|
+
clauses: import_zod32.z.array(SerializedQueryExpression)
|
|
5128
5217
|
});
|
|
5129
|
-
var And2 =
|
|
5130
|
-
type:
|
|
5131
|
-
clauses:
|
|
5218
|
+
var And2 = import_zod32.z.object({
|
|
5219
|
+
type: import_zod32.z.literal("and"),
|
|
5220
|
+
clauses: import_zod32.z.array(SerializedQueryExpression)
|
|
5132
5221
|
});
|
|
5133
|
-
var CountryConfigQueryType =
|
|
5134
|
-
var CountryConfigQueryInputType =
|
|
5222
|
+
var CountryConfigQueryType = import_zod32.z.discriminatedUnion("type", [And2, Or2]);
|
|
5223
|
+
var CountryConfigQueryInputType = import_zod32.z.union([
|
|
5135
5224
|
SerializedQueryExpression,
|
|
5136
5225
|
And2,
|
|
5137
5226
|
Or2
|
|
5138
5227
|
]);
|
|
5139
5228
|
|
|
5140
5229
|
// ../commons/src/icons.ts
|
|
5141
|
-
var
|
|
5142
|
-
var AvailableIcons =
|
|
5230
|
+
var import_zod33 = require("zod");
|
|
5231
|
+
var AvailableIcons = import_zod33.z.enum([
|
|
5143
5232
|
"Archived",
|
|
5144
5233
|
"Assigned",
|
|
5145
5234
|
"Certified",
|
|
@@ -5260,23 +5349,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
5260
5349
|
value: event.field("updatedAt")
|
|
5261
5350
|
}
|
|
5262
5351
|
]);
|
|
5263
|
-
var WorkqueueActionsWithDefault =
|
|
5352
|
+
var WorkqueueActionsWithDefault = import_zod34.z.enum([
|
|
5264
5353
|
...workqueueActions.options,
|
|
5265
5354
|
"DEFAULT"
|
|
5266
5355
|
]);
|
|
5267
|
-
var WorkqueueConfig =
|
|
5268
|
-
slug:
|
|
5356
|
+
var WorkqueueConfig = import_zod34.z.object({
|
|
5357
|
+
slug: import_zod34.z.string().describe("Determines the url of the workqueue."),
|
|
5269
5358
|
name: TranslationConfig.describe(
|
|
5270
5359
|
"Title of the workflow (both in navigation and on the page)"
|
|
5271
5360
|
),
|
|
5272
5361
|
query: CountryConfigQueryType,
|
|
5273
|
-
actions:
|
|
5274
|
-
|
|
5362
|
+
actions: import_zod34.z.array(
|
|
5363
|
+
import_zod34.z.object({
|
|
5275
5364
|
type: WorkqueueActionsWithDefault,
|
|
5276
|
-
conditionals:
|
|
5365
|
+
conditionals: import_zod34.z.array(Conditional).optional()
|
|
5277
5366
|
})
|
|
5278
5367
|
),
|
|
5279
|
-
columns:
|
|
5368
|
+
columns: import_zod34.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
5280
5369
|
icon: AvailableIcons,
|
|
5281
5370
|
emptyMessage: TranslationConfig.optional()
|
|
5282
5371
|
}).describe("Configuration for workqueue.");
|
|
@@ -5284,19 +5373,19 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
5284
5373
|
query: true,
|
|
5285
5374
|
columns: true
|
|
5286
5375
|
});
|
|
5287
|
-
var WorkqueueConfigInput =
|
|
5288
|
-
slug:
|
|
5376
|
+
var WorkqueueConfigInput = import_zod34.z.object({
|
|
5377
|
+
slug: import_zod34.z.string().describe("Determines the url of the workqueue."),
|
|
5289
5378
|
name: TranslationConfig.describe(
|
|
5290
5379
|
"Title of the workflow (both in navigation and on the page)"
|
|
5291
5380
|
),
|
|
5292
5381
|
query: CountryConfigQueryInputType,
|
|
5293
|
-
actions:
|
|
5294
|
-
|
|
5382
|
+
actions: import_zod34.z.array(
|
|
5383
|
+
import_zod34.z.object({
|
|
5295
5384
|
type: WorkqueueActionsWithDefault,
|
|
5296
|
-
conditionals:
|
|
5385
|
+
conditionals: import_zod34.z.array(Conditional).optional()
|
|
5297
5386
|
})
|
|
5298
5387
|
),
|
|
5299
|
-
columns:
|
|
5388
|
+
columns: import_zod34.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
5300
5389
|
icon: AvailableIcons,
|
|
5301
5390
|
emptyMessage: TranslationConfig.optional()
|
|
5302
5391
|
});
|
|
@@ -5308,10 +5397,10 @@ function defineWorkqueue(workqueueInput) {
|
|
|
5308
5397
|
function defineWorkqueues(workqueues) {
|
|
5309
5398
|
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
|
5310
5399
|
}
|
|
5311
|
-
var WorkqueueCountInput =
|
|
5312
|
-
|
|
5400
|
+
var WorkqueueCountInput = import_zod34.z.array(
|
|
5401
|
+
import_zod34.z.object({ slug: import_zod34.z.string(), query: QueryType })
|
|
5313
5402
|
);
|
|
5314
|
-
var WorkqueueCountOutput =
|
|
5403
|
+
var WorkqueueCountOutput = import_zod34.z.record(import_zod34.z.string(), import_zod34.z.number());
|
|
5315
5404
|
|
|
5316
5405
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
5317
5406
|
var defaultWorkqueueColumns = [
|
|
@@ -5334,53 +5423,53 @@ var defaultWorkqueueColumns = [
|
|
|
5334
5423
|
];
|
|
5335
5424
|
|
|
5336
5425
|
// ../commons/src/events/Draft.ts
|
|
5337
|
-
var
|
|
5426
|
+
var import_zod36 = require("zod");
|
|
5338
5427
|
|
|
5339
5428
|
// ../commons/src/events/ActionInput.ts
|
|
5340
|
-
var
|
|
5429
|
+
var import_zod35 = require("zod");
|
|
5341
5430
|
var import_zod_openapi11 = require("zod-openapi");
|
|
5342
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(
|
|
5343
|
-
var BaseActionInput =
|
|
5431
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod35.z);
|
|
5432
|
+
var BaseActionInput = import_zod35.z.object({
|
|
5344
5433
|
eventId: UUID,
|
|
5345
|
-
transactionId:
|
|
5434
|
+
transactionId: import_zod35.z.string(),
|
|
5346
5435
|
declaration: ActionUpdate.default({}),
|
|
5347
5436
|
annotation: ActionUpdate.optional(),
|
|
5348
5437
|
originalActionId: UUID.optional(),
|
|
5349
5438
|
// should not be part of base action.
|
|
5350
|
-
keepAssignment:
|
|
5351
|
-
keepAssignmentIfAccepted:
|
|
5352
|
-
keepAssignmentIfRejected:
|
|
5439
|
+
keepAssignment: import_zod35.z.boolean().optional(),
|
|
5440
|
+
keepAssignmentIfAccepted: import_zod35.z.boolean().optional(),
|
|
5441
|
+
keepAssignmentIfRejected: import_zod35.z.boolean().optional(),
|
|
5353
5442
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
5354
5443
|
createdAtLocation: CreatedAtLocation.describe(
|
|
5355
5444
|
"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."
|
|
5356
5445
|
)
|
|
5357
5446
|
});
|
|
5358
5447
|
var CreateActionInput = BaseActionInput.merge(
|
|
5359
|
-
|
|
5360
|
-
type:
|
|
5448
|
+
import_zod35.z.object({
|
|
5449
|
+
type: import_zod35.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
5361
5450
|
createdAtLocation: CreatedAtLocation
|
|
5362
5451
|
})
|
|
5363
5452
|
);
|
|
5364
5453
|
var RegisterActionInput = BaseActionInput.merge(
|
|
5365
|
-
|
|
5366
|
-
type:
|
|
5367
|
-
registrationNumber:
|
|
5454
|
+
import_zod35.z.object({
|
|
5455
|
+
type: import_zod35.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
5456
|
+
registrationNumber: import_zod35.z.string().optional()
|
|
5368
5457
|
})
|
|
5369
5458
|
).strict();
|
|
5370
5459
|
var ValidateActionInput = BaseActionInput.merge(
|
|
5371
|
-
|
|
5372
|
-
type:
|
|
5460
|
+
import_zod35.z.object({
|
|
5461
|
+
type: import_zod35.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
5373
5462
|
})
|
|
5374
5463
|
);
|
|
5375
5464
|
var EscalateActionInput = BaseActionInput.merge(
|
|
5376
|
-
|
|
5377
|
-
type:
|
|
5465
|
+
import_zod35.z.object({
|
|
5466
|
+
type: import_zod35.z.literal(ActionType.ESCALATE).default(ActionType.ESCALATE),
|
|
5378
5467
|
content: ReasonContent
|
|
5379
5468
|
})
|
|
5380
5469
|
);
|
|
5381
5470
|
var NotifyActionInput = BaseActionInput.merge(
|
|
5382
|
-
|
|
5383
|
-
type:
|
|
5471
|
+
import_zod35.z.object({
|
|
5472
|
+
type: import_zod35.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
5384
5473
|
})
|
|
5385
5474
|
).openapi({
|
|
5386
5475
|
default: {
|
|
@@ -5392,86 +5481,86 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
5392
5481
|
}
|
|
5393
5482
|
});
|
|
5394
5483
|
var DeclareActionInput = BaseActionInput.merge(
|
|
5395
|
-
|
|
5396
|
-
type:
|
|
5484
|
+
import_zod35.z.object({
|
|
5485
|
+
type: import_zod35.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
5397
5486
|
})
|
|
5398
5487
|
);
|
|
5399
5488
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
5400
|
-
|
|
5401
|
-
type:
|
|
5489
|
+
import_zod35.z.object({
|
|
5490
|
+
type: import_zod35.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
5402
5491
|
content: PrintContent.optional()
|
|
5403
5492
|
})
|
|
5404
5493
|
);
|
|
5405
5494
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
5406
|
-
|
|
5407
|
-
type:
|
|
5495
|
+
import_zod35.z.object({
|
|
5496
|
+
type: import_zod35.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
5408
5497
|
content: ReasonContent
|
|
5409
5498
|
})
|
|
5410
5499
|
);
|
|
5411
5500
|
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
5412
|
-
|
|
5413
|
-
type:
|
|
5414
|
-
content:
|
|
5415
|
-
duplicates:
|
|
5501
|
+
import_zod35.z.object({
|
|
5502
|
+
type: import_zod35.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
5503
|
+
content: import_zod35.z.object({
|
|
5504
|
+
duplicates: import_zod35.z.array(PotentialDuplicate)
|
|
5416
5505
|
})
|
|
5417
5506
|
})
|
|
5418
5507
|
);
|
|
5419
5508
|
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
5420
|
-
|
|
5421
|
-
type:
|
|
5422
|
-
content:
|
|
5509
|
+
import_zod35.z.object({
|
|
5510
|
+
type: import_zod35.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
5511
|
+
content: import_zod35.z.object({
|
|
5423
5512
|
duplicateOf: UUID
|
|
5424
5513
|
}).optional()
|
|
5425
5514
|
})
|
|
5426
5515
|
);
|
|
5427
5516
|
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
5428
|
-
|
|
5429
|
-
type:
|
|
5517
|
+
import_zod35.z.object({
|
|
5518
|
+
type: import_zod35.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
5430
5519
|
})
|
|
5431
5520
|
);
|
|
5432
5521
|
var ArchiveActionInput = BaseActionInput.merge(
|
|
5433
|
-
|
|
5434
|
-
type:
|
|
5522
|
+
import_zod35.z.object({
|
|
5523
|
+
type: import_zod35.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
5435
5524
|
content: ReasonContent
|
|
5436
5525
|
})
|
|
5437
5526
|
);
|
|
5438
5527
|
var AssignActionInput = BaseActionInput.merge(
|
|
5439
|
-
|
|
5440
|
-
type:
|
|
5441
|
-
assignedTo:
|
|
5528
|
+
import_zod35.z.object({
|
|
5529
|
+
type: import_zod35.z.literal(ActionType.ASSIGN),
|
|
5530
|
+
assignedTo: import_zod35.z.string()
|
|
5442
5531
|
})
|
|
5443
5532
|
);
|
|
5444
5533
|
var UnassignActionInput = BaseActionInput.merge(
|
|
5445
|
-
|
|
5446
|
-
type:
|
|
5447
|
-
assignedTo:
|
|
5534
|
+
import_zod35.z.object({
|
|
5535
|
+
type: import_zod35.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
5536
|
+
assignedTo: import_zod35.z.literal(null).default(null)
|
|
5448
5537
|
})
|
|
5449
5538
|
);
|
|
5450
5539
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
5451
|
-
|
|
5452
|
-
type:
|
|
5540
|
+
import_zod35.z.object({
|
|
5541
|
+
type: import_zod35.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
5453
5542
|
})
|
|
5454
5543
|
);
|
|
5455
5544
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
5456
|
-
|
|
5457
|
-
requestId:
|
|
5458
|
-
type:
|
|
5545
|
+
import_zod35.z.object({
|
|
5546
|
+
requestId: import_zod35.z.string(),
|
|
5547
|
+
type: import_zod35.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
5459
5548
|
content: ReasonContent
|
|
5460
5549
|
})
|
|
5461
5550
|
);
|
|
5462
5551
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
5463
|
-
|
|
5464
|
-
requestId:
|
|
5465
|
-
type:
|
|
5552
|
+
import_zod35.z.object({
|
|
5553
|
+
requestId: import_zod35.z.string(),
|
|
5554
|
+
type: import_zod35.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
5466
5555
|
})
|
|
5467
5556
|
);
|
|
5468
5557
|
var ReadActionInput = BaseActionInput.merge(
|
|
5469
|
-
|
|
5470
|
-
type:
|
|
5558
|
+
import_zod35.z.object({
|
|
5559
|
+
type: import_zod35.z.literal(ActionType.READ).default(ActionType.READ)
|
|
5471
5560
|
})
|
|
5472
5561
|
);
|
|
5473
|
-
var DeleteActionInput =
|
|
5474
|
-
var ActionInput =
|
|
5562
|
+
var DeleteActionInput = import_zod35.z.object({ eventId: UUID });
|
|
5563
|
+
var ActionInput = import_zod35.z.discriminatedUnion("type", [
|
|
5475
5564
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
5476
5565
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
5477
5566
|
EscalateActionInput.openapi({ ref: "EscalateActionInput" }),
|
|
@@ -5507,11 +5596,11 @@ var ActionInput = import_zod34.z.discriminatedUnion("type", [
|
|
|
5507
5596
|
});
|
|
5508
5597
|
|
|
5509
5598
|
// ../commons/src/events/Draft.ts
|
|
5510
|
-
var Draft =
|
|
5599
|
+
var Draft = import_zod36.z.object({
|
|
5511
5600
|
id: UUID,
|
|
5512
5601
|
eventId: UUID,
|
|
5513
|
-
transactionId:
|
|
5514
|
-
createdAt:
|
|
5602
|
+
transactionId: import_zod36.z.string(),
|
|
5603
|
+
createdAt: import_zod36.z.string().datetime(),
|
|
5515
5604
|
action: ActionBase.extend({
|
|
5516
5605
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
5517
5606
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -5520,7 +5609,7 @@ var Draft = import_zod35.z.object({
|
|
|
5520
5609
|
);
|
|
5521
5610
|
var DraftInput = BaseActionInput.extend({
|
|
5522
5611
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
5523
|
-
status:
|
|
5612
|
+
status: import_zod36.z.enum([
|
|
5524
5613
|
ActionStatus.Requested,
|
|
5525
5614
|
ActionStatus.Accepted,
|
|
5526
5615
|
ActionStatus.Rejected
|
|
@@ -5528,26 +5617,26 @@ var DraftInput = BaseActionInput.extend({
|
|
|
5528
5617
|
});
|
|
5529
5618
|
|
|
5530
5619
|
// ../commons/src/events/EventInput.ts
|
|
5531
|
-
var
|
|
5620
|
+
var import_zod37 = require("zod");
|
|
5532
5621
|
var import_uuid10 = require("uuid");
|
|
5533
|
-
var EventInput =
|
|
5534
|
-
transactionId:
|
|
5535
|
-
type:
|
|
5622
|
+
var EventInput = import_zod37.z.object({
|
|
5623
|
+
transactionId: import_zod37.z.string(),
|
|
5624
|
+
type: import_zod37.z.string()
|
|
5536
5625
|
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
5537
5626
|
|
|
5538
5627
|
// ../commons/src/events/EventDocument.ts
|
|
5539
|
-
var
|
|
5628
|
+
var import_zod38 = require("zod");
|
|
5540
5629
|
var import_zod_openapi12 = require("zod-openapi");
|
|
5541
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(
|
|
5542
|
-
var EventDocument =
|
|
5630
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod38.z);
|
|
5631
|
+
var EventDocument = import_zod38.z.object({
|
|
5543
5632
|
id: UUID.describe("Unique identifier of the event."),
|
|
5544
|
-
type:
|
|
5545
|
-
createdAt:
|
|
5546
|
-
updatedAt:
|
|
5633
|
+
type: import_zod38.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
5634
|
+
createdAt: import_zod38.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
5635
|
+
updatedAt: import_zod38.z.string().datetime().describe(
|
|
5547
5636
|
"Timestamp of the last update, excluding changes from actions."
|
|
5548
5637
|
),
|
|
5549
|
-
actions:
|
|
5550
|
-
trackingId:
|
|
5638
|
+
actions: import_zod38.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
5639
|
+
trackingId: import_zod38.z.string().describe(
|
|
5551
5640
|
"System-generated tracking identifier used to look up the event."
|
|
5552
5641
|
)
|
|
5553
5642
|
}).openapi({ ref: "EventDocument" });
|
|
@@ -8452,9 +8541,9 @@ var digitalIdentityEvent = defineConfig({
|
|
|
8452
8541
|
});
|
|
8453
8542
|
|
|
8454
8543
|
// ../commons/src/events/test.utils.ts
|
|
8455
|
-
var
|
|
8544
|
+
var import_zod39 = require("zod");
|
|
8456
8545
|
var TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
|
8457
|
-
var TestUserRole =
|
|
8546
|
+
var TestUserRole = import_zod39.z.enum([
|
|
8458
8547
|
"FIELD_AGENT",
|
|
8459
8548
|
"LOCAL_REGISTRAR",
|
|
8460
8549
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -8629,6 +8718,11 @@ function mapFieldTypeToMockValue(field3, i, rng) {
|
|
|
8629
8718
|
return /* @__PURE__ */ Object.create(null);
|
|
8630
8719
|
case FieldType.ID_READER:
|
|
8631
8720
|
return /* @__PURE__ */ Object.create(null);
|
|
8721
|
+
case FieldType.ICD11:
|
|
8722
|
+
return {
|
|
8723
|
+
code: "BC80.20",
|
|
8724
|
+
label: "Sick sinus syndrome"
|
|
8725
|
+
};
|
|
8632
8726
|
}
|
|
8633
8727
|
}
|
|
8634
8728
|
function fieldConfigsToActionPayload(fields, rng) {
|
|
@@ -9522,16 +9616,16 @@ function getFilePathsFromEvent(event2) {
|
|
|
9522
9616
|
}
|
|
9523
9617
|
|
|
9524
9618
|
// ../commons/src/events/locations.ts
|
|
9525
|
-
var
|
|
9526
|
-
var LocationType =
|
|
9619
|
+
var import_zod40 = require("zod");
|
|
9620
|
+
var LocationType = import_zod40.z.enum([
|
|
9527
9621
|
"ADMIN_STRUCTURE",
|
|
9528
9622
|
"CRVS_OFFICE",
|
|
9529
9623
|
"HEALTH_FACILITY"
|
|
9530
9624
|
]);
|
|
9531
|
-
var Location =
|
|
9625
|
+
var Location = import_zod40.z.object({
|
|
9532
9626
|
id: UUID,
|
|
9533
|
-
name:
|
|
9627
|
+
name: import_zod40.z.string(),
|
|
9534
9628
|
parentId: UUID.nullable(),
|
|
9535
|
-
validUntil:
|
|
9629
|
+
validUntil: import_zod40.z.string().datetime().nullable(),
|
|
9536
9630
|
locationType: LocationType.nullable()
|
|
9537
9631
|
});
|