@opencrvs/toolkit 2.1.0-rc.d078d1a → 2.1.0-rc.d1b9774
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/build.sh +9 -1
- package/create-countryconfig/index.js +284 -62
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +4 -1
- package/dist/application-config/index.js +265 -209
- package/dist/authentication/index.d.ts +67 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +750 -0
- package/dist/cli.js +1744 -104
- package/dist/commons/api/router.d.ts +599 -69
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +13 -11
- package/dist/commons/events/ActionDocument.d.ts +4 -4
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
- package/dist/commons/events/AuditLog.d.ts +110 -0
- package/dist/commons/events/EventDocument.d.ts +470 -2
- package/dist/commons/events/EventIndex.d.ts +2 -2
- package/dist/commons/events/EventMetadata.d.ts +1 -11
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +78 -53
- package/dist/commons/events/FieldTypeMapping.d.ts +12 -12
- package/dist/commons/events/FieldValue.d.ts +2 -2
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/locations.d.ts +158 -26
- package/dist/commons/events/mocks.test.utils.d.ts +30 -0
- package/dist/commons/events/test.utils.d.ts +8 -4
- package/dist/commons/events/utils.d.ts +2 -2
- package/dist/commons/notification/UserNotifications.d.ts +28 -13
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +79 -57
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +10 -0
- package/dist/environment/logger.d.ts +15 -3
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/paths.d.ts +7 -0
- package/dist/environment/paths.d.ts.map +1 -0
- package/dist/environment/paths.js +72 -0
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +20 -14
- package/dist/environment/setup-environment.js +3 -2
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +2 -1
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +17 -5
- package/dist/environment/upgrade.d.ts +2 -0
- package/dist/environment/upgrade.d.ts.map +1 -0
- package/dist/environment/upgrade.js +82 -0
- package/dist/environment/users.js +11 -13
- package/dist/events/index.js +1079 -843
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +213 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +438 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +1058 -0
- package/dist/notification/index.js +1149 -1419
- package/dist/scopes/index.d.ts +102 -32
- package/dist/scopes/index.js +79 -57
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +39 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
- package/dist/templates/charts-values/opentelemetry/values.yaml +95 -0
- package/dist/templates/charts-values/traefik/values.yaml +23 -9
- package/dist/templates/inventory/inventory.template.yml +1 -3
- package/dist/translations/check.d.ts +19 -0
- package/dist/translations/check.d.ts.map +1 -0
- package/dist/translations/check.js +127 -0
- package/dist/verify/endpoints.d.ts +2 -0
- package/dist/verify/endpoints.d.ts.map +1 -0
- package/dist/verify/endpoints.js +345 -0
- package/opencrvs-toolkit-2.1.0-rc.d1b9774.tgz +0 -0
- package/package.json +12 -7
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/dist/templates/inventory/production.example.yml +0 -77
- package/dist/templates/inventory/qa.example.yml +0 -48
- package/opencrvs-toolkit-2.1.0-rc.d078d1a.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
package/dist/events/index.js
CHANGED
|
@@ -74,6 +74,8 @@ __export(events_exports, {
|
|
|
74
74
|
CertificateTemplateConfig: () => CertificateTemplateConfig,
|
|
75
75
|
CheckboxFieldValue: () => CheckboxFieldValue,
|
|
76
76
|
Clause: () => Clause,
|
|
77
|
+
ClientAdministrativeArea: () => ClientAdministrativeArea,
|
|
78
|
+
ClientLocation: () => ClientLocation,
|
|
77
79
|
ClientSpecificAction: () => ClientSpecificAction,
|
|
78
80
|
ComputedDefaultValue: () => ComputedDefaultValue,
|
|
79
81
|
Conditional: () => Conditional,
|
|
@@ -116,6 +118,7 @@ __export(events_exports, {
|
|
|
116
118
|
EnableConditional: () => EnableConditional,
|
|
117
119
|
EventConfig: () => EventConfig,
|
|
118
120
|
EventDocument: () => EventDocument,
|
|
121
|
+
EventDocumentOnlyLastAction: () => EventDocumentOnlyLastAction,
|
|
119
122
|
EventFieldConfigSchema: () => EventFieldConfigSchema,
|
|
120
123
|
EventFieldId: () => EventFieldId,
|
|
121
124
|
EventFieldIdInput: () => EventFieldIdInput,
|
|
@@ -159,6 +162,7 @@ __export(events_exports, {
|
|
|
159
162
|
HttpFieldValue: () => HttpFieldValue,
|
|
160
163
|
IdReaderFieldValue: () => IdReaderFieldValue,
|
|
161
164
|
ImageMimeType: () => ImageMimeType,
|
|
165
|
+
InfoBox: () => InfoBox,
|
|
162
166
|
InherentFlags: () => InherentFlags,
|
|
163
167
|
LanguageConfig: () => LanguageConfig,
|
|
164
168
|
LegalStatuses: () => LegalStatuses,
|
|
@@ -201,6 +205,7 @@ __export(events_exports, {
|
|
|
201
205
|
RequestCorrectionActionInput: () => RequestCorrectionActionInput,
|
|
202
206
|
SearchQuery: () => SearchQuery,
|
|
203
207
|
SearchQueryParams: () => SearchQueryParams,
|
|
208
|
+
SeededLocationVersions: () => SeededLocationVersions,
|
|
204
209
|
SelectDateRangeField: () => SelectDateRangeField,
|
|
205
210
|
SelectDateRangeOption: () => SelectDateRangeOption,
|
|
206
211
|
SelectDateRangeValue: () => SelectDateRangeValue,
|
|
@@ -227,6 +232,8 @@ __export(events_exports, {
|
|
|
227
232
|
UserAuditRecordInput: () => UserAuditRecordInput,
|
|
228
233
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS,
|
|
229
234
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP,
|
|
235
|
+
V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP: () => V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP,
|
|
236
|
+
V2_DEFAULT_MOCK_CLIENT_LOCATIONS_MAP: () => V2_DEFAULT_MOCK_CLIENT_LOCATIONS_MAP,
|
|
230
237
|
V2_DEFAULT_MOCK_LOCATIONS: () => V2_DEFAULT_MOCK_LOCATIONS,
|
|
231
238
|
V2_DEFAULT_MOCK_LOCATIONS_MAP: () => V2_DEFAULT_MOCK_LOCATIONS_MAP,
|
|
232
239
|
ValidationConfig: () => ValidationConfig,
|
|
@@ -344,6 +351,7 @@ __export(events_exports, {
|
|
|
344
351
|
getDeclarationPages: () => getDeclarationPages,
|
|
345
352
|
getEventConfigById: () => getEventConfigById,
|
|
346
353
|
getEventFlags: () => getEventFlags,
|
|
354
|
+
getEventValidatorContext: () => getEventValidatorContext,
|
|
347
355
|
getFilePathsFromEvent: () => getFilePathsFromEvent,
|
|
348
356
|
getLocationHierarchy: () => getLocationHierarchy,
|
|
349
357
|
getMixedPath: () => getMixedPath,
|
|
@@ -383,6 +391,7 @@ __export(events_exports, {
|
|
|
383
391
|
isFieldEnabled: () => isFieldEnabled,
|
|
384
392
|
isFieldGroupFieldType: () => isFieldGroupFieldType,
|
|
385
393
|
isFieldReference: () => isFieldReference,
|
|
394
|
+
isFieldSecured: () => isFieldSecured,
|
|
386
395
|
isFieldValue: () => isFieldValue,
|
|
387
396
|
isFieldValueWithoutTemplates: () => isFieldValueWithoutTemplates,
|
|
388
397
|
isFieldVisible: () => isFieldVisible,
|
|
@@ -416,6 +425,7 @@ __export(events_exports, {
|
|
|
416
425
|
isSearchFieldType: () => isSearchFieldType,
|
|
417
426
|
isSelectDateRangeFieldType: () => isSelectDateRangeFieldType,
|
|
418
427
|
isSelectFieldType: () => isSelectFieldType,
|
|
428
|
+
isSelectableAtAnchor: () => isSelectableAtAnchor,
|
|
419
429
|
isSignatureFieldType: () => isSignatureFieldType,
|
|
420
430
|
isTemplateVariable: () => isTemplateVariable,
|
|
421
431
|
isTextAreaFieldType: () => isTextAreaFieldType,
|
|
@@ -426,6 +436,7 @@ __export(events_exports, {
|
|
|
426
436
|
isVerificationPage: () => isVerificationPage,
|
|
427
437
|
isVerificationStatusType: () => isVerificationStatusType,
|
|
428
438
|
isWriteAction: () => isWriteAction,
|
|
439
|
+
locationVersion: () => locationVersion,
|
|
429
440
|
mandatoryColumns: () => mandatoryColumns,
|
|
430
441
|
mapFieldTypeToEmptyValue: () => mapFieldTypeToEmptyValue,
|
|
431
442
|
mapFieldTypeToZod: () => mapFieldTypeToZod,
|
|
@@ -443,7 +454,7 @@ __export(events_exports, {
|
|
|
443
454
|
precompileActionSchemas: () => precompileActionSchemas,
|
|
444
455
|
resolveDateOfEvent: () => resolveDateOfEvent,
|
|
445
456
|
resolveEventCustomFlags: () => resolveEventCustomFlags,
|
|
446
|
-
|
|
457
|
+
resolvePath: () => resolvePath,
|
|
447
458
|
resolvePlaceOfEvent: () => resolvePlaceOfEvent,
|
|
448
459
|
resolveVersion: () => resolveVersion,
|
|
449
460
|
runClientFunction: () => runClientFunction,
|
|
@@ -452,6 +463,9 @@ __export(events_exports, {
|
|
|
452
463
|
safeUnion: () => safeUnion,
|
|
453
464
|
status: () => status,
|
|
454
465
|
timePeriodToDateRange: () => timePeriodToDateRange,
|
|
466
|
+
toClientAdministrativeArea: () => toClientAdministrativeArea,
|
|
467
|
+
toClientLocation: () => toClientLocation,
|
|
468
|
+
toPlainDate: () => toPlainDate,
|
|
455
469
|
todayISO: () => todayISO,
|
|
456
470
|
user: () => user,
|
|
457
471
|
userCanAccessEventWithScopes: () => userCanAccessEventWithScopes,
|
|
@@ -464,14 +478,14 @@ __export(events_exports, {
|
|
|
464
478
|
module.exports = __toCommonJS(events_exports);
|
|
465
479
|
|
|
466
480
|
// ../commons/src/events/AuditLog.ts
|
|
467
|
-
var
|
|
481
|
+
var z9 = __toESM(require("zod/v4"));
|
|
468
482
|
|
|
469
483
|
// ../commons/src/authentication.ts
|
|
470
484
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
471
|
-
var
|
|
485
|
+
var z8 = __toESM(require("zod/v4"));
|
|
472
486
|
|
|
473
487
|
// ../commons/src/scopes.ts
|
|
474
|
-
var
|
|
488
|
+
var z7 = __toESM(require("zod/v4"));
|
|
475
489
|
var qs = __toESM(require("qs"));
|
|
476
490
|
|
|
477
491
|
// ../commons/src/uuid.ts
|
|
@@ -733,12 +747,22 @@ var ActionFlagConfig = z5.object({
|
|
|
733
747
|
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
734
748
|
});
|
|
735
749
|
|
|
750
|
+
// ../commons/src/events/EventStatus.ts
|
|
751
|
+
var z6 = __toESM(require("zod/v4"));
|
|
752
|
+
var EventStatus = z6.enum([
|
|
753
|
+
"CREATED",
|
|
754
|
+
"NOTIFIED",
|
|
755
|
+
"DECLARED",
|
|
756
|
+
"REGISTERED",
|
|
757
|
+
"ARCHIVED"
|
|
758
|
+
]);
|
|
759
|
+
|
|
736
760
|
// ../commons/src/scopes.ts
|
|
737
|
-
var JurisdictionFilter =
|
|
761
|
+
var JurisdictionFilter = z7.enum(["administrativeArea", "location", "all"]).describe(
|
|
738
762
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
739
763
|
);
|
|
740
|
-
var UserFilter =
|
|
741
|
-
var RecordScopeTypeV2 =
|
|
764
|
+
var UserFilter = z7.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
765
|
+
var RecordScopeTypeV2 = z7.enum([
|
|
742
766
|
"record.search",
|
|
743
767
|
"record.create",
|
|
744
768
|
"record.read",
|
|
@@ -756,12 +780,17 @@ var RecordScopeTypeV2 = z6.enum([
|
|
|
756
780
|
"record.unassign-others",
|
|
757
781
|
"record.custom-action"
|
|
758
782
|
]);
|
|
759
|
-
var PlainScopeType =
|
|
783
|
+
var PlainScopeType = z7.enum([
|
|
760
784
|
// Misc. system scopes
|
|
761
785
|
"bypassratelimit",
|
|
762
786
|
"record.reindex",
|
|
763
787
|
"user.data-seeding",
|
|
764
788
|
"integration.create",
|
|
789
|
+
// Reading an integration's audit log. Deliberately separate from
|
|
790
|
+
// 'integration.create' so read-only oversight can be granted on its own, and
|
|
791
|
+
// deliberately option-less: system clients have no office and no
|
|
792
|
+
// administrative area, so jurisdiction options would have nothing to bind to.
|
|
793
|
+
"integration.audit.read",
|
|
765
794
|
"record.import",
|
|
766
795
|
"config.update-all",
|
|
767
796
|
"location.edit",
|
|
@@ -776,15 +805,21 @@ var PlainScopeType = z6.enum([
|
|
|
776
805
|
"record.confirm-registration",
|
|
777
806
|
"record.reject-registration"
|
|
778
807
|
]);
|
|
779
|
-
var scopeByEvent =
|
|
808
|
+
var scopeByEvent = z7.preprocess(
|
|
780
809
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
781
|
-
|
|
810
|
+
z7.array(z7.string()).optional()
|
|
782
811
|
).describe("Event type, e.g. birth, death");
|
|
783
|
-
var
|
|
812
|
+
var scopeByStatus = z7.preprocess(
|
|
813
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
814
|
+
z7.array(EventStatus).optional()
|
|
815
|
+
).describe(
|
|
816
|
+
"Restricts the scope to records currently in one of these statuses."
|
|
817
|
+
);
|
|
818
|
+
var userRole = z7.preprocess(
|
|
784
819
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
785
|
-
|
|
820
|
+
z7.array(z7.string()).optional()
|
|
786
821
|
).describe("User role, e.g. admin, field agent");
|
|
787
|
-
var scopeOptionsPlaceEvent =
|
|
822
|
+
var scopeOptionsPlaceEvent = z7.object({
|
|
788
823
|
event: scopeByEvent,
|
|
789
824
|
placeOfEvent: JurisdictionFilter.optional()
|
|
790
825
|
}).describe("Options applicable to all record scopes.");
|
|
@@ -792,7 +827,8 @@ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
|
792
827
|
notifiedIn: JurisdictionFilter.optional(),
|
|
793
828
|
notifiedBy: UserFilter.optional(),
|
|
794
829
|
declaredIn: JurisdictionFilter.optional(),
|
|
795
|
-
declaredBy: UserFilter.optional()
|
|
830
|
+
declaredBy: UserFilter.optional(),
|
|
831
|
+
status: scopeByStatus
|
|
796
832
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
797
833
|
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
798
834
|
registeredIn: JurisdictionFilter.optional(),
|
|
@@ -802,31 +838,31 @@ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
|
802
838
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
803
839
|
);
|
|
804
840
|
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
805
|
-
customActionTypes:
|
|
841
|
+
customActionTypes: z7.preprocess(
|
|
806
842
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
807
|
-
|
|
843
|
+
z7.array(z7.string()).optional()
|
|
808
844
|
).describe("Allowed custom action types")
|
|
809
845
|
});
|
|
810
|
-
var AccessLevelOptions =
|
|
846
|
+
var AccessLevelOptions = z7.object({
|
|
811
847
|
accessLevel: JurisdictionFilter.optional()
|
|
812
848
|
});
|
|
813
849
|
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
814
850
|
role: userRole.optional()
|
|
815
851
|
});
|
|
816
|
-
var WorkqueueOrDashboardOptions =
|
|
817
|
-
ids:
|
|
852
|
+
var WorkqueueOrDashboardOptions = z7.object({
|
|
853
|
+
ids: z7.preprocess(
|
|
818
854
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
819
|
-
|
|
855
|
+
z7.array(z7.string())
|
|
820
856
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
821
857
|
});
|
|
822
|
-
var AllScopeOptions =
|
|
858
|
+
var AllScopeOptions = z7.object({
|
|
823
859
|
...AllRecordScopeOptions.shape,
|
|
824
860
|
...AccessLevelOptions.shape,
|
|
825
861
|
...AllUserScopeOptions.shape,
|
|
826
862
|
...WorkqueueOrDashboardOptions.shape
|
|
827
863
|
});
|
|
828
864
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
829
|
-
var ResolvedScopeOptionsPlaceEvent =
|
|
865
|
+
var ResolvedScopeOptionsPlaceEvent = z7.object({
|
|
830
866
|
event: scopeByEvent,
|
|
831
867
|
placeOfEvent: UUID.nullish()
|
|
832
868
|
}).describe(
|
|
@@ -834,15 +870,15 @@ var ResolvedScopeOptionsPlaceEvent = z6.object({
|
|
|
834
870
|
);
|
|
835
871
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
836
872
|
notifiedIn: UUID.nullish(),
|
|
837
|
-
notifiedBy:
|
|
873
|
+
notifiedBy: z7.string().optional(),
|
|
838
874
|
declaredIn: UUID.nullish(),
|
|
839
|
-
declaredBy:
|
|
875
|
+
declaredBy: z7.string().optional()
|
|
840
876
|
}).describe(
|
|
841
877
|
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
842
878
|
);
|
|
843
879
|
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
844
880
|
registeredIn: UUID.nullish(),
|
|
845
|
-
registeredBy:
|
|
881
|
+
registeredBy: z7.string().optional(),
|
|
846
882
|
flags: ContainsFlags.optional()
|
|
847
883
|
}).describe(
|
|
848
884
|
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
@@ -857,7 +893,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
857
893
|
"record.reject",
|
|
858
894
|
"record.archive",
|
|
859
895
|
"record.unarchive",
|
|
860
|
-
"record.review-duplicates",
|
|
861
896
|
"record.register"
|
|
862
897
|
]);
|
|
863
898
|
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
@@ -865,41 +900,42 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
865
900
|
"record.read",
|
|
866
901
|
"record.request-correction",
|
|
867
902
|
"record.correct",
|
|
868
|
-
"record.unassign-others"
|
|
903
|
+
"record.unassign-others",
|
|
904
|
+
"record.review-duplicates"
|
|
869
905
|
]);
|
|
870
906
|
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
871
|
-
templates:
|
|
907
|
+
templates: z7.preprocess(
|
|
872
908
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
873
|
-
|
|
909
|
+
z7.array(z7.string()).optional()
|
|
874
910
|
).describe(
|
|
875
911
|
"Template IDs for certified copies. Controls which certificate templates are returned to the client via the config service. Certificate printing is a client-side operation \u2014 this option is not validated when the printCertificate action is submitted."
|
|
876
912
|
)
|
|
877
913
|
});
|
|
878
|
-
var RecordScopeV2 =
|
|
879
|
-
|
|
914
|
+
var RecordScopeV2 = z7.discriminatedUnion("type", [
|
|
915
|
+
z7.object({
|
|
880
916
|
type: ScopesWithPlaceEventOptions,
|
|
881
917
|
options: scopeOptionsPlaceEvent.optional()
|
|
882
918
|
}),
|
|
883
|
-
|
|
919
|
+
z7.object({
|
|
884
920
|
type: ScopesWithDeclaredOptions,
|
|
885
921
|
options: scopeOptionsDeclaredOrNotified.optional()
|
|
886
922
|
}),
|
|
887
|
-
|
|
923
|
+
z7.object({
|
|
888
924
|
type: ScopesWithFullOptions,
|
|
889
925
|
options: AllRecordScopeOptions.optional()
|
|
890
926
|
}),
|
|
891
|
-
|
|
892
|
-
type:
|
|
927
|
+
z7.object({
|
|
928
|
+
type: z7.literal("record.custom-action"),
|
|
893
929
|
options: CustomActionScopeOptions.optional()
|
|
894
930
|
}),
|
|
895
|
-
|
|
896
|
-
type:
|
|
931
|
+
z7.object({
|
|
932
|
+
type: z7.literal("record.print-certified-copies"),
|
|
897
933
|
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
898
934
|
})
|
|
899
935
|
]).describe(
|
|
900
936
|
"Scopes used to check user's permission to perform actions on a record."
|
|
901
937
|
);
|
|
902
|
-
var SystemScopeType =
|
|
938
|
+
var SystemScopeType = z7.enum([
|
|
903
939
|
"organisation.read-locations",
|
|
904
940
|
"user.read",
|
|
905
941
|
"user.create",
|
|
@@ -913,12 +949,12 @@ var UserScopeType = SystemScopeType.extract([
|
|
|
913
949
|
"user.search"
|
|
914
950
|
]);
|
|
915
951
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
916
|
-
var UserScopeV2 =
|
|
917
|
-
|
|
952
|
+
var UserScopeV2 = z7.discriminatedUnion("type", [
|
|
953
|
+
z7.object({
|
|
918
954
|
type: ScopesWithRoleOption,
|
|
919
955
|
options: AllUserScopeOptions.optional()
|
|
920
956
|
}),
|
|
921
|
-
|
|
957
|
+
z7.object({
|
|
922
958
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
923
959
|
options: AccessLevelOptions.optional()
|
|
924
960
|
})
|
|
@@ -938,44 +974,44 @@ function scopeUsesPrintCertifiedCopiesOptions(scope) {
|
|
|
938
974
|
function isCustomActionScope(scope) {
|
|
939
975
|
return scope.type === "record.custom-action";
|
|
940
976
|
}
|
|
941
|
-
var ResolvedRecordScopeV2 =
|
|
942
|
-
|
|
977
|
+
var ResolvedRecordScopeV2 = z7.discriminatedUnion("type", [
|
|
978
|
+
z7.object({
|
|
943
979
|
type: ScopesWithPlaceEventOptions,
|
|
944
980
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
945
981
|
}),
|
|
946
|
-
|
|
982
|
+
z7.object({
|
|
947
983
|
type: ScopesWithDeclaredOptions,
|
|
948
984
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
949
985
|
}),
|
|
950
|
-
|
|
986
|
+
z7.object({
|
|
951
987
|
type: ScopesWithFullOptions,
|
|
952
988
|
options: ResolvedScopeOptionsFull.optional()
|
|
953
989
|
}),
|
|
954
|
-
|
|
955
|
-
type:
|
|
990
|
+
z7.object({
|
|
991
|
+
type: z7.literal("record.print-certified-copies"),
|
|
956
992
|
options: ResolvedScopeOptionsFull.extend({
|
|
957
|
-
templates:
|
|
993
|
+
templates: z7.array(z7.string()).optional()
|
|
958
994
|
}).optional()
|
|
959
995
|
})
|
|
960
996
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
961
|
-
var Scope =
|
|
962
|
-
|
|
997
|
+
var Scope = z7.discriminatedUnion("type", [
|
|
998
|
+
z7.object({ type: PlainScopeType }),
|
|
963
999
|
...RecordScopeV2.options,
|
|
964
1000
|
...UserScopeV2.options,
|
|
965
|
-
|
|
966
|
-
type:
|
|
1001
|
+
z7.object({
|
|
1002
|
+
type: z7.literal("organisation.read-locations"),
|
|
967
1003
|
options: AccessLevelOptions.optional()
|
|
968
1004
|
}),
|
|
969
|
-
|
|
970
|
-
type:
|
|
1005
|
+
z7.object({
|
|
1006
|
+
type: z7.literal("workqueue"),
|
|
971
1007
|
options: WorkqueueOrDashboardOptions
|
|
972
1008
|
}),
|
|
973
|
-
|
|
974
|
-
type:
|
|
1009
|
+
z7.object({
|
|
1010
|
+
type: z7.literal("dashboard.view"),
|
|
975
1011
|
options: WorkqueueOrDashboardOptions
|
|
976
1012
|
})
|
|
977
1013
|
]);
|
|
978
|
-
var ScopeType =
|
|
1014
|
+
var ScopeType = z7.enum([
|
|
979
1015
|
...SystemScopeType.options,
|
|
980
1016
|
...RecordScopeTypeV2.options,
|
|
981
1017
|
...PlainScopeType.options,
|
|
@@ -986,7 +1022,7 @@ var unflattenScope = (input) => {
|
|
|
986
1022
|
const { type, ...options } = input;
|
|
987
1023
|
return { type, options };
|
|
988
1024
|
};
|
|
989
|
-
var EncodedScope =
|
|
1025
|
+
var EncodedScope = z7.string().brand("EncodedScope");
|
|
990
1026
|
var decodedScopeCache = /* @__PURE__ */ new Map();
|
|
991
1027
|
var decodeScope = (encodedScope) => {
|
|
992
1028
|
if (decodedScopeCache.has(encodedScope)) {
|
|
@@ -1022,51 +1058,51 @@ function getAcceptedScopesByType({
|
|
|
1022
1058
|
}
|
|
1023
1059
|
|
|
1024
1060
|
// ../commons/src/authentication.ts
|
|
1025
|
-
var TokenUserType =
|
|
1026
|
-
var TokenWithBearer =
|
|
1061
|
+
var TokenUserType = z8.enum(["user", "system"]);
|
|
1062
|
+
var TokenWithBearer = z8.string().regex(/^Bearer\s/);
|
|
1027
1063
|
|
|
1028
1064
|
// ../commons/src/events/AuditLog.ts
|
|
1029
|
-
var AuditLogEntryBase =
|
|
1030
|
-
id:
|
|
1031
|
-
clientId:
|
|
1065
|
+
var AuditLogEntryBase = z9.object({
|
|
1066
|
+
id: z9.string(),
|
|
1067
|
+
clientId: z9.string(),
|
|
1032
1068
|
clientType: TokenUserType,
|
|
1033
|
-
createdAt:
|
|
1069
|
+
createdAt: z9.string()
|
|
1034
1070
|
});
|
|
1035
1071
|
var EventCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1036
|
-
operation:
|
|
1037
|
-
requestData:
|
|
1038
|
-
transactionId:
|
|
1039
|
-
type:
|
|
1040
|
-
createdAtLocation:
|
|
1072
|
+
operation: z9.literal("event.create"),
|
|
1073
|
+
requestData: z9.object({
|
|
1074
|
+
transactionId: z9.string(),
|
|
1075
|
+
type: z9.string(),
|
|
1076
|
+
createdAtLocation: z9.string().nullable()
|
|
1041
1077
|
}),
|
|
1042
|
-
responseSummary:
|
|
1043
|
-
eventId:
|
|
1044
|
-
trackingId:
|
|
1078
|
+
responseSummary: z9.object({
|
|
1079
|
+
eventId: z9.string(),
|
|
1080
|
+
trackingId: z9.string()
|
|
1045
1081
|
})
|
|
1046
1082
|
});
|
|
1047
1083
|
var EventGetEntrySchema = AuditLogEntryBase.extend({
|
|
1048
|
-
operation:
|
|
1049
|
-
requestData:
|
|
1050
|
-
responseSummary:
|
|
1051
|
-
eventType:
|
|
1052
|
-
trackingId:
|
|
1084
|
+
operation: z9.literal("event.get"),
|
|
1085
|
+
requestData: z9.object({ eventId: z9.string() }),
|
|
1086
|
+
responseSummary: z9.object({
|
|
1087
|
+
eventType: z9.string(),
|
|
1088
|
+
trackingId: z9.string()
|
|
1053
1089
|
})
|
|
1054
1090
|
});
|
|
1055
1091
|
var EventSearchEntrySchema = AuditLogEntryBase.extend({
|
|
1056
|
-
operation:
|
|
1057
|
-
clientType:
|
|
1058
|
-
requestData:
|
|
1059
|
-
query:
|
|
1060
|
-
limit:
|
|
1061
|
-
offset:
|
|
1092
|
+
operation: z9.literal("event.search"),
|
|
1093
|
+
clientType: z9.literal("system"),
|
|
1094
|
+
requestData: z9.object({
|
|
1095
|
+
query: z9.record(z9.string(), z9.unknown()).nullable(),
|
|
1096
|
+
limit: z9.number().nullable(),
|
|
1097
|
+
offset: z9.number().nullable()
|
|
1062
1098
|
}),
|
|
1063
|
-
responseSummary:
|
|
1064
|
-
total:
|
|
1065
|
-
eventIds:
|
|
1099
|
+
responseSummary: z9.object({
|
|
1100
|
+
total: z9.number(),
|
|
1101
|
+
eventIds: z9.array(z9.string())
|
|
1066
1102
|
})
|
|
1067
1103
|
});
|
|
1068
1104
|
var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
1069
|
-
operation:
|
|
1105
|
+
operation: z9.enum([
|
|
1070
1106
|
"event.actions.notify.request",
|
|
1071
1107
|
"event.actions.declare.request",
|
|
1072
1108
|
"event.actions.register.request",
|
|
@@ -1086,106 +1122,159 @@ var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
|
1086
1122
|
"event.actions.mark_as_duplicate.request",
|
|
1087
1123
|
"event.actions.mark_as_not_duplicate.request"
|
|
1088
1124
|
]),
|
|
1089
|
-
requestData:
|
|
1090
|
-
eventId:
|
|
1091
|
-
actionType:
|
|
1092
|
-
eventType:
|
|
1093
|
-
trackingId:
|
|
1094
|
-
transactionId:
|
|
1125
|
+
requestData: z9.object({
|
|
1126
|
+
eventId: z9.string(),
|
|
1127
|
+
actionType: z9.string(),
|
|
1128
|
+
eventType: z9.string(),
|
|
1129
|
+
trackingId: z9.string(),
|
|
1130
|
+
transactionId: z9.string()
|
|
1095
1131
|
})
|
|
1096
1132
|
});
|
|
1097
1133
|
var EventCustomActionEntrySchema = AuditLogEntryBase.extend({
|
|
1098
|
-
operation:
|
|
1099
|
-
requestData:
|
|
1100
|
-
eventId:
|
|
1101
|
-
actionType:
|
|
1102
|
-
customAction:
|
|
1103
|
-
eventType:
|
|
1104
|
-
trackingId:
|
|
1105
|
-
transactionId:
|
|
1134
|
+
operation: z9.literal("event.actions.custom.request"),
|
|
1135
|
+
requestData: z9.object({
|
|
1136
|
+
eventId: z9.string(),
|
|
1137
|
+
actionType: z9.literal(ActionType.CUSTOM),
|
|
1138
|
+
customAction: z9.string(),
|
|
1139
|
+
eventType: z9.string(),
|
|
1140
|
+
trackingId: z9.string(),
|
|
1141
|
+
transactionId: z9.string()
|
|
1106
1142
|
})
|
|
1107
1143
|
});
|
|
1108
1144
|
var IntegrationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1109
|
-
operation:
|
|
1110
|
-
requestData:
|
|
1111
|
-
responseSummary:
|
|
1145
|
+
operation: z9.literal("integrations.create"),
|
|
1146
|
+
requestData: z9.object({ name: z9.string(), scopes: z9.array(z9.string()) }),
|
|
1147
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
1112
1148
|
});
|
|
1113
1149
|
var IntegrationRefreshTokenEntrySchema = AuditLogEntryBase.extend({
|
|
1114
|
-
operation:
|
|
1115
|
-
requestData:
|
|
1116
|
-
responseSummary:
|
|
1150
|
+
operation: z9.literal("integrations.refreshToken"),
|
|
1151
|
+
requestData: z9.object({ clientId: z9.string() }),
|
|
1152
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
1117
1153
|
});
|
|
1118
1154
|
var IntegrationDeactivateEntrySchema = AuditLogEntryBase.extend({
|
|
1119
|
-
operation:
|
|
1120
|
-
requestData:
|
|
1121
|
-
responseSummary:
|
|
1155
|
+
operation: z9.literal("integrations.deactivate"),
|
|
1156
|
+
requestData: z9.object({ id: z9.string() }),
|
|
1157
|
+
responseSummary: z9.object({ id: z9.string(), status: z9.string() })
|
|
1122
1158
|
});
|
|
1123
1159
|
var IntegrationActivateEntrySchema = AuditLogEntryBase.extend({
|
|
1124
|
-
operation:
|
|
1125
|
-
requestData:
|
|
1126
|
-
responseSummary:
|
|
1160
|
+
operation: z9.literal("integrations.activate"),
|
|
1161
|
+
requestData: z9.object({ id: z9.string() }),
|
|
1162
|
+
responseSummary: z9.object({ id: z9.string(), status: z9.string() })
|
|
1127
1163
|
});
|
|
1128
1164
|
var IntegrationDeleteEntrySchema = AuditLogEntryBase.extend({
|
|
1129
|
-
operation:
|
|
1130
|
-
requestData:
|
|
1131
|
-
responseSummary:
|
|
1165
|
+
operation: z9.literal("integrations.delete"),
|
|
1166
|
+
requestData: z9.object({ id: z9.string() }),
|
|
1167
|
+
responseSummary: z9.object({ id: z9.string(), name: z9.string() })
|
|
1132
1168
|
});
|
|
1133
1169
|
var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
1134
|
-
operation:
|
|
1135
|
-
requestData:
|
|
1136
|
-
responseSummary:
|
|
1170
|
+
operation: z9.literal("integrations.refreshSecret"),
|
|
1171
|
+
requestData: z9.object({ id: z9.string() }),
|
|
1172
|
+
responseSummary: z9.object({ clientId: z9.string() })
|
|
1137
1173
|
});
|
|
1138
1174
|
var createdVersionFields = {
|
|
1139
|
-
id:
|
|
1140
|
-
versionId:
|
|
1141
|
-
name:
|
|
1142
|
-
externalId:
|
|
1143
|
-
effectiveFrom:
|
|
1144
|
-
status:
|
|
1175
|
+
id: z9.string(),
|
|
1176
|
+
versionId: z9.string(),
|
|
1177
|
+
name: z9.string(),
|
|
1178
|
+
externalId: z9.string().nullish(),
|
|
1179
|
+
effectiveFrom: z9.string(),
|
|
1180
|
+
status: z9.string()
|
|
1145
1181
|
};
|
|
1146
1182
|
var LocationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1147
|
-
operation:
|
|
1148
|
-
requestData:
|
|
1183
|
+
operation: z9.literal("locations.create"),
|
|
1184
|
+
requestData: z9.object({
|
|
1149
1185
|
...createdVersionFields,
|
|
1150
|
-
administrativeAreaId:
|
|
1151
|
-
locationType:
|
|
1186
|
+
administrativeAreaId: z9.string().nullish(),
|
|
1187
|
+
locationType: z9.string().nullish()
|
|
1152
1188
|
})
|
|
1153
1189
|
});
|
|
1154
1190
|
var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1155
|
-
operation:
|
|
1156
|
-
requestData:
|
|
1191
|
+
operation: z9.literal("administrativeAreas.create"),
|
|
1192
|
+
requestData: z9.object({
|
|
1157
1193
|
...createdVersionFields,
|
|
1158
|
-
parentId:
|
|
1194
|
+
parentId: z9.string().nullish()
|
|
1195
|
+
})
|
|
1196
|
+
});
|
|
1197
|
+
var ChangedStringField = z9.object({ from: z9.string(), to: z9.string() });
|
|
1198
|
+
var ChangedNullableStringField = z9.object({
|
|
1199
|
+
from: z9.string().nullable(),
|
|
1200
|
+
to: z9.string().nullable()
|
|
1201
|
+
});
|
|
1202
|
+
var updatedVersionRequestData = z9.object({
|
|
1203
|
+
id: z9.string(),
|
|
1204
|
+
versionId: z9.string(),
|
|
1205
|
+
name: z9.string(),
|
|
1206
|
+
externalId: z9.string().nullish(),
|
|
1207
|
+
status: z9.string(),
|
|
1208
|
+
effectiveFrom: z9.string(),
|
|
1209
|
+
lastVersionId: z9.string()
|
|
1210
|
+
});
|
|
1211
|
+
var updatedVersionResponseSummary = z9.object({
|
|
1212
|
+
previousVersionId: z9.string(),
|
|
1213
|
+
versionId: z9.string(),
|
|
1214
|
+
changed: z9.object({
|
|
1215
|
+
name: ChangedStringField.optional(),
|
|
1216
|
+
externalId: ChangedNullableStringField.optional(),
|
|
1217
|
+
status: ChangedStringField.optional()
|
|
1159
1218
|
})
|
|
1160
1219
|
});
|
|
1220
|
+
var LocationUpdateEntrySchema = AuditLogEntryBase.extend({
|
|
1221
|
+
operation: z9.literal("locations.update"),
|
|
1222
|
+
requestData: updatedVersionRequestData,
|
|
1223
|
+
responseSummary: updatedVersionResponseSummary
|
|
1224
|
+
});
|
|
1225
|
+
var AdministrativeAreaUpdateEntrySchema = AuditLogEntryBase.extend({
|
|
1226
|
+
operation: z9.literal("administrativeAreas.update"),
|
|
1227
|
+
requestData: updatedVersionRequestData,
|
|
1228
|
+
responseSummary: updatedVersionResponseSummary
|
|
1229
|
+
});
|
|
1230
|
+
var withdrawVersionRequestData = z9.object({
|
|
1231
|
+
id: z9.string(),
|
|
1232
|
+
versionId: z9.string()
|
|
1233
|
+
});
|
|
1234
|
+
var withdrawVersionResponseSummary = z9.object({
|
|
1235
|
+
effectiveFrom: z9.string(),
|
|
1236
|
+
name: z9.string(),
|
|
1237
|
+
externalId: z9.string().nullish(),
|
|
1238
|
+
status: z9.string()
|
|
1239
|
+
});
|
|
1240
|
+
var LocationWithdrawEntrySchema = AuditLogEntryBase.extend({
|
|
1241
|
+
operation: z9.literal("locations.withdrawVersion"),
|
|
1242
|
+
requestData: withdrawVersionRequestData,
|
|
1243
|
+
responseSummary: withdrawVersionResponseSummary
|
|
1244
|
+
});
|
|
1245
|
+
var AdministrativeAreaWithdrawEntrySchema = AuditLogEntryBase.extend({
|
|
1246
|
+
operation: z9.literal("administrativeAreas.withdrawVersion"),
|
|
1247
|
+
requestData: withdrawVersionRequestData,
|
|
1248
|
+
responseSummary: withdrawVersionResponseSummary
|
|
1249
|
+
});
|
|
1161
1250
|
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
1162
|
-
operation:
|
|
1163
|
-
requestData:
|
|
1164
|
-
transactionId:
|
|
1165
|
-
path:
|
|
1251
|
+
operation: z9.literal("attachments.upload"),
|
|
1252
|
+
requestData: z9.object({
|
|
1253
|
+
transactionId: z9.string(),
|
|
1254
|
+
path: z9.string().nullable()
|
|
1166
1255
|
}),
|
|
1167
|
-
responseSummary:
|
|
1256
|
+
responseSummary: z9.object({ fileUrl: z9.string() })
|
|
1168
1257
|
});
|
|
1169
|
-
var subjectOnly =
|
|
1170
|
-
var subjectWithReason =
|
|
1171
|
-
subjectId:
|
|
1172
|
-
reason:
|
|
1173
|
-
comment:
|
|
1258
|
+
var subjectOnly = z9.object({ subjectId: z9.string() });
|
|
1259
|
+
var subjectWithReason = z9.object({
|
|
1260
|
+
subjectId: z9.string(),
|
|
1261
|
+
reason: z9.string(),
|
|
1262
|
+
comment: z9.string().optional()
|
|
1174
1263
|
});
|
|
1175
1264
|
var UserCreateEntrySchema = AuditLogEntryBase.extend({
|
|
1176
|
-
operation:
|
|
1177
|
-
requestData:
|
|
1178
|
-
subjectId:
|
|
1179
|
-
role:
|
|
1180
|
-
primaryOfficeId:
|
|
1265
|
+
operation: z9.literal("user.create_user"),
|
|
1266
|
+
requestData: z9.object({
|
|
1267
|
+
subjectId: z9.string(),
|
|
1268
|
+
role: z9.string(),
|
|
1269
|
+
primaryOfficeId: z9.string()
|
|
1181
1270
|
})
|
|
1182
1271
|
});
|
|
1183
1272
|
var UserReasonEntrySchema = AuditLogEntryBase.extend({
|
|
1184
|
-
operation:
|
|
1273
|
+
operation: z9.enum(["user.deactivate", "user.reactivate"]),
|
|
1185
1274
|
requestData: subjectWithReason
|
|
1186
1275
|
});
|
|
1187
1276
|
var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
|
|
1188
|
-
operation:
|
|
1277
|
+
operation: z9.enum([
|
|
1189
1278
|
"user.edit_user",
|
|
1190
1279
|
"user.logged_in",
|
|
1191
1280
|
"user.logged_out",
|
|
@@ -1199,14 +1288,14 @@ var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
|
|
|
1199
1288
|
requestData: subjectOnly
|
|
1200
1289
|
});
|
|
1201
1290
|
var UserEmailChangedEntrySchema = AuditLogEntryBase.extend({
|
|
1202
|
-
operation:
|
|
1291
|
+
operation: z9.literal("user.email_address_changed"),
|
|
1203
1292
|
requestData: subjectOnly,
|
|
1204
|
-
responseSummary:
|
|
1293
|
+
responseSummary: z9.object({ email: z9.string() })
|
|
1205
1294
|
});
|
|
1206
1295
|
var UserPhoneChangedEntrySchema = AuditLogEntryBase.extend({
|
|
1207
|
-
operation:
|
|
1296
|
+
operation: z9.literal("user.phone_number_changed"),
|
|
1208
1297
|
requestData: subjectOnly,
|
|
1209
|
-
responseSummary:
|
|
1298
|
+
responseSummary: z9.object({ phoneNumber: z9.string() })
|
|
1210
1299
|
});
|
|
1211
1300
|
var userBaseOmit = {
|
|
1212
1301
|
id: true,
|
|
@@ -1214,14 +1303,14 @@ var userBaseOmit = {
|
|
|
1214
1303
|
clientType: true,
|
|
1215
1304
|
createdAt: true
|
|
1216
1305
|
};
|
|
1217
|
-
var UserAuditRecordInput =
|
|
1306
|
+
var UserAuditRecordInput = z9.discriminatedUnion("operation", [
|
|
1218
1307
|
UserCreateEntrySchema.omit(userBaseOmit),
|
|
1219
1308
|
UserReasonEntrySchema.omit(userBaseOmit),
|
|
1220
1309
|
UserSubjectOnlyEntrySchema.omit(userBaseOmit),
|
|
1221
1310
|
UserEmailChangedEntrySchema.omit(userBaseOmit),
|
|
1222
1311
|
UserPhoneChangedEntrySchema.omit(userBaseOmit)
|
|
1223
1312
|
]);
|
|
1224
|
-
var AuditLogEntrySchema =
|
|
1313
|
+
var AuditLogEntrySchema = z9.discriminatedUnion("operation", [
|
|
1225
1314
|
EventCreateEntrySchema,
|
|
1226
1315
|
EventGetEntrySchema,
|
|
1227
1316
|
EventSearchEntrySchema,
|
|
@@ -1234,6 +1323,10 @@ var AuditLogEntrySchema = z8.discriminatedUnion("operation", [
|
|
|
1234
1323
|
IntegrationDeleteEntrySchema,
|
|
1235
1324
|
IntegrationRefreshSecretEntrySchema,
|
|
1236
1325
|
LocationCreateEntrySchema,
|
|
1326
|
+
LocationUpdateEntrySchema,
|
|
1327
|
+
AdministrativeAreaUpdateEntrySchema,
|
|
1328
|
+
LocationWithdrawEntrySchema,
|
|
1329
|
+
AdministrativeAreaWithdrawEntrySchema,
|
|
1237
1330
|
AdministrativeAreaCreateEntrySchema,
|
|
1238
1331
|
AttachmentUploadEntrySchema,
|
|
1239
1332
|
UserCreateEntrySchema,
|
|
@@ -1248,13 +1341,13 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
|
1248
1341
|
var CHILD_ONBOARDING_EVENT = "child-onboarding";
|
|
1249
1342
|
|
|
1250
1343
|
// ../commons/src/events/ActionConfig.ts
|
|
1251
|
-
var
|
|
1344
|
+
var z25 = __toESM(require("zod/v4"));
|
|
1252
1345
|
|
|
1253
1346
|
// ../commons/src/events/FieldConfig.ts
|
|
1254
1347
|
var import_v43 = __toESM(require("zod/v4"));
|
|
1255
1348
|
|
|
1256
1349
|
// ../commons/src/events/FieldType.ts
|
|
1257
|
-
var
|
|
1350
|
+
var z10 = __toESM(require("zod/v4"));
|
|
1258
1351
|
var FieldType = {
|
|
1259
1352
|
NAME: "NAME",
|
|
1260
1353
|
PHONE: "PHONE",
|
|
@@ -1318,7 +1411,7 @@ var FieldType = {
|
|
|
1318
1411
|
*/
|
|
1319
1412
|
_EXPERIMENTAL_CUSTOM: "CUSTOM"
|
|
1320
1413
|
};
|
|
1321
|
-
var FileFieldType =
|
|
1414
|
+
var FileFieldType = z10.enum([
|
|
1322
1415
|
FieldType.FILE,
|
|
1323
1416
|
FieldType.FILE_WITH_OPTIONS,
|
|
1324
1417
|
FieldType.SIGNATURE
|
|
@@ -1354,22 +1447,22 @@ var HiddenFieldTypes = [
|
|
|
1354
1447
|
];
|
|
1355
1448
|
|
|
1356
1449
|
// ../commons/src/events/FieldValue.ts
|
|
1357
|
-
var
|
|
1450
|
+
var z14 = __toESM(require("zod/v4"));
|
|
1358
1451
|
|
|
1359
1452
|
// ../commons/src/documents.ts
|
|
1360
|
-
var
|
|
1361
|
-
var FullDocumentUrl =
|
|
1453
|
+
var z11 = __toESM(require("zod/v4"));
|
|
1454
|
+
var FullDocumentUrl = z11.string().brand("FullDocumentUrl").describe(
|
|
1362
1455
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio.opencrvs.com/bucket-name/document-id.jpg"
|
|
1363
1456
|
);
|
|
1364
|
-
var FullDocumentPath =
|
|
1457
|
+
var FullDocumentPath = z11.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
|
|
1365
1458
|
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
|
1366
1459
|
);
|
|
1367
|
-
var DocumentPath =
|
|
1460
|
+
var DocumentPath = z11.string().brand("DocumentPath").describe(
|
|
1368
1461
|
"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
|
|
1369
1462
|
);
|
|
1370
1463
|
|
|
1371
1464
|
// ../commons/src/events/CompositeFieldValue.ts
|
|
1372
|
-
var
|
|
1465
|
+
var z12 = __toESM(require("zod/v4"));
|
|
1373
1466
|
var GeographicalArea = {
|
|
1374
1467
|
URBAN: "URBAN",
|
|
1375
1468
|
RURAL: "RURAL"
|
|
@@ -1378,144 +1471,147 @@ var AddressType = {
|
|
|
1378
1471
|
DOMESTIC: "DOMESTIC",
|
|
1379
1472
|
INTERNATIONAL: "INTERNATIONAL"
|
|
1380
1473
|
};
|
|
1381
|
-
var FileFieldValue =
|
|
1474
|
+
var FileFieldValue = z12.object({
|
|
1382
1475
|
path: DocumentPath,
|
|
1383
|
-
originalFilename:
|
|
1384
|
-
type:
|
|
1385
|
-
});
|
|
1386
|
-
var NameFieldValue =
|
|
1387
|
-
firstname:
|
|
1388
|
-
surname:
|
|
1389
|
-
middlename:
|
|
1390
|
-
});
|
|
1391
|
-
var NameFieldUpdateValue =
|
|
1392
|
-
firstname:
|
|
1393
|
-
surname:
|
|
1394
|
-
middlename:
|
|
1395
|
-
}).or(
|
|
1396
|
-
var StreetLevelDetailsValue =
|
|
1397
|
-
var StreetLevelDetailsUpdateValue =
|
|
1398
|
-
var BaseAddressFieldValue =
|
|
1399
|
-
country:
|
|
1476
|
+
originalFilename: z12.string(),
|
|
1477
|
+
type: z12.string()
|
|
1478
|
+
});
|
|
1479
|
+
var NameFieldValue = z12.object({
|
|
1480
|
+
firstname: z12.string(),
|
|
1481
|
+
surname: z12.string(),
|
|
1482
|
+
middlename: z12.string().optional()
|
|
1483
|
+
});
|
|
1484
|
+
var NameFieldUpdateValue = z12.object({
|
|
1485
|
+
firstname: z12.string().nullish(),
|
|
1486
|
+
surname: z12.string().nullish(),
|
|
1487
|
+
middlename: z12.string().nullish()
|
|
1488
|
+
}).or(z12.null()).or(z12.undefined());
|
|
1489
|
+
var StreetLevelDetailsValue = z12.record(z12.string(), z12.string()).optional();
|
|
1490
|
+
var StreetLevelDetailsUpdateValue = z12.record(z12.string(), z12.string().nullable()).nullish();
|
|
1491
|
+
var BaseAddressFieldValue = z12.object({
|
|
1492
|
+
country: z12.string(),
|
|
1400
1493
|
streetLevelDetails: StreetLevelDetailsValue
|
|
1401
1494
|
});
|
|
1402
|
-
var BaseAddressFieldUpdateValue =
|
|
1403
|
-
country:
|
|
1495
|
+
var BaseAddressFieldUpdateValue = z12.object({
|
|
1496
|
+
country: z12.string().nullish(),
|
|
1404
1497
|
streetLevelDetails: StreetLevelDetailsUpdateValue
|
|
1405
1498
|
});
|
|
1406
1499
|
var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
|
|
1407
|
-
addressType:
|
|
1408
|
-
administrativeArea:
|
|
1500
|
+
addressType: z12.literal(AddressType.DOMESTIC),
|
|
1501
|
+
administrativeArea: z12.string().uuid()
|
|
1409
1502
|
});
|
|
1410
1503
|
var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
|
|
1411
|
-
addressType:
|
|
1504
|
+
addressType: z12.literal(AddressType.INTERNATIONAL)
|
|
1412
1505
|
});
|
|
1413
|
-
var AddressFieldValue =
|
|
1506
|
+
var AddressFieldValue = z12.discriminatedUnion("addressType", [
|
|
1414
1507
|
DomesticAddressFieldValue,
|
|
1415
1508
|
InternationalAddressFieldValue
|
|
1416
1509
|
]);
|
|
1417
1510
|
var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
|
|
1418
|
-
addressType:
|
|
1419
|
-
administrativeArea:
|
|
1511
|
+
addressType: z12.literal(AddressType.DOMESTIC),
|
|
1512
|
+
administrativeArea: z12.string().uuid().nullish()
|
|
1420
1513
|
/* Leaf level admin structure */
|
|
1421
1514
|
});
|
|
1422
1515
|
var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
|
|
1423
1516
|
{
|
|
1424
|
-
addressType:
|
|
1517
|
+
addressType: z12.literal(AddressType.INTERNATIONAL)
|
|
1425
1518
|
}
|
|
1426
1519
|
);
|
|
1427
|
-
var AddressFieldUpdateValue =
|
|
1520
|
+
var AddressFieldUpdateValue = z12.discriminatedUnion("addressType", [
|
|
1428
1521
|
DomesticAddressUpdateFieldValue,
|
|
1429
1522
|
InternationalAddressUpdateFieldValue
|
|
1430
1523
|
]).nullish();
|
|
1431
|
-
var FileFieldValueWithOption =
|
|
1524
|
+
var FileFieldValueWithOption = z12.object({
|
|
1432
1525
|
path: DocumentPath,
|
|
1433
|
-
originalFilename:
|
|
1434
|
-
type:
|
|
1435
|
-
option:
|
|
1436
|
-
});
|
|
1437
|
-
var FileFieldWithOptionValue =
|
|
1438
|
-
var HttpFieldValue =
|
|
1439
|
-
loading:
|
|
1440
|
-
error:
|
|
1441
|
-
data:
|
|
1442
|
-
});
|
|
1443
|
-
var HttpFieldUpdateValue =
|
|
1444
|
-
loading:
|
|
1445
|
-
error:
|
|
1446
|
-
data:
|
|
1447
|
-
}).or(
|
|
1448
|
-
var QueryParamReaderFieldValue =
|
|
1449
|
-
data:
|
|
1450
|
-
updatedAt:
|
|
1526
|
+
originalFilename: z12.string(),
|
|
1527
|
+
type: z12.string(),
|
|
1528
|
+
option: z12.string()
|
|
1529
|
+
});
|
|
1530
|
+
var FileFieldWithOptionValue = z12.array(FileFieldValueWithOption);
|
|
1531
|
+
var HttpFieldValue = z12.object({
|
|
1532
|
+
loading: z12.boolean(),
|
|
1533
|
+
error: z12.object({ statusCode: z12.number(), message: z12.string() }).nullish(),
|
|
1534
|
+
data: z12.any()
|
|
1535
|
+
});
|
|
1536
|
+
var HttpFieldUpdateValue = z12.object({
|
|
1537
|
+
loading: z12.boolean().nullish(),
|
|
1538
|
+
error: z12.object({ statusCode: z12.number(), message: z12.string() }).nullish(),
|
|
1539
|
+
data: z12.any().nullish()
|
|
1540
|
+
}).or(z12.null()).or(z12.undefined());
|
|
1541
|
+
var QueryParamReaderFieldValue = z12.object({
|
|
1542
|
+
data: z12.record(z12.string(), z12.string()),
|
|
1543
|
+
updatedAt: z12.iso.datetime()
|
|
1451
1544
|
}).nullish();
|
|
1452
|
-
var QueryParamReaderFieldUpdateValue =
|
|
1453
|
-
data:
|
|
1545
|
+
var QueryParamReaderFieldUpdateValue = z12.object({
|
|
1546
|
+
data: z12.record(z12.string(), z12.string())
|
|
1454
1547
|
});
|
|
1455
|
-
var ReadDataValue =
|
|
1456
|
-
data:
|
|
1548
|
+
var ReadDataValue = z12.object({
|
|
1549
|
+
data: z12.any()
|
|
1457
1550
|
});
|
|
1458
1551
|
var QrReaderFieldValue = ReadDataValue;
|
|
1459
1552
|
var IdReaderFieldValue = ReadDataValue;
|
|
1460
|
-
var NumberWithUnitFieldValue =
|
|
1461
|
-
numericValue:
|
|
1462
|
-
unit:
|
|
1553
|
+
var NumberWithUnitFieldValue = z12.object({
|
|
1554
|
+
numericValue: z12.number(),
|
|
1555
|
+
unit: z12.string()
|
|
1463
1556
|
});
|
|
1464
|
-
var NumberWithUnitFieldUpdateValue =
|
|
1465
|
-
numericValue:
|
|
1466
|
-
unit:
|
|
1557
|
+
var NumberWithUnitFieldUpdateValue = z12.object({
|
|
1558
|
+
numericValue: z12.number().optional(),
|
|
1559
|
+
unit: z12.string().optional()
|
|
1467
1560
|
});
|
|
1468
|
-
var CustomFieldValue =
|
|
1561
|
+
var CustomFieldValue = z12.unknown().brand("CustomFieldValue");
|
|
1469
1562
|
|
|
1470
1563
|
// ../commons/src/events/PlainDate.ts
|
|
1471
1564
|
var import_zod = require("zod");
|
|
1472
1565
|
var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date in the format YYYY-MM-DD");
|
|
1566
|
+
function toPlainDate(dateTime) {
|
|
1567
|
+
return dateTime.split("T")[0];
|
|
1568
|
+
}
|
|
1473
1569
|
function plainDateToLocalDate(date) {
|
|
1474
1570
|
const [year, month, day] = date.split("-").map(Number);
|
|
1475
1571
|
return new Date(year, month - 1, day);
|
|
1476
1572
|
}
|
|
1477
1573
|
|
|
1478
1574
|
// ../commons/src/events/FieldValue.ts
|
|
1479
|
-
var TextValue =
|
|
1480
|
-
var HiddenFieldValue =
|
|
1481
|
-
var NonEmptyTextValue =
|
|
1482
|
-
var DateValue =
|
|
1483
|
-
var AgeValue =
|
|
1484
|
-
age:
|
|
1485
|
-
asOfDateRef:
|
|
1575
|
+
var TextValue = z14.string();
|
|
1576
|
+
var HiddenFieldValue = z14.string();
|
|
1577
|
+
var NonEmptyTextValue = z14.string().trim().min(1);
|
|
1578
|
+
var DateValue = z14.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
1579
|
+
var AgeValue = z14.object({
|
|
1580
|
+
age: z14.number(),
|
|
1581
|
+
asOfDateRef: z14.string()
|
|
1486
1582
|
});
|
|
1487
1583
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
1488
|
-
var AutocompleteValue =
|
|
1489
|
-
label:
|
|
1490
|
-
value:
|
|
1584
|
+
var AutocompleteValue = z14.object({
|
|
1585
|
+
label: z14.string(),
|
|
1586
|
+
value: z14.string()
|
|
1491
1587
|
});
|
|
1492
1588
|
var AutocompleteUpdateValue = AutocompleteValue.optional().nullable();
|
|
1493
|
-
var TimeValue =
|
|
1494
|
-
var DatetimeValue =
|
|
1495
|
-
var SelectDateRangeValue =
|
|
1589
|
+
var TimeValue = z14.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
1590
|
+
var DatetimeValue = z14.iso.datetime();
|
|
1591
|
+
var SelectDateRangeValue = z14.enum([
|
|
1496
1592
|
"last7Days",
|
|
1497
1593
|
"last30Days",
|
|
1498
1594
|
"last90Days",
|
|
1499
1595
|
"last365Days"
|
|
1500
1596
|
]);
|
|
1501
|
-
var DateRangeFieldValue =
|
|
1597
|
+
var DateRangeFieldValue = z14.object({
|
|
1502
1598
|
start: PlainDate,
|
|
1503
1599
|
end: PlainDate
|
|
1504
1600
|
}).or(PlainDate).describe(
|
|
1505
1601
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
1506
1602
|
);
|
|
1507
|
-
var EmailValue =
|
|
1508
|
-
var CheckboxFieldValue =
|
|
1509
|
-
var NumberFieldValue =
|
|
1603
|
+
var EmailValue = z14.email();
|
|
1604
|
+
var CheckboxFieldValue = z14.boolean();
|
|
1605
|
+
var NumberFieldValue = z14.number();
|
|
1510
1606
|
var SignatureFieldValue = FileFieldValue;
|
|
1511
|
-
var ButtonFieldValue =
|
|
1512
|
-
var VerificationStatusValue =
|
|
1607
|
+
var ButtonFieldValue = z14.number();
|
|
1608
|
+
var VerificationStatusValue = z14.enum([
|
|
1513
1609
|
"verified",
|
|
1514
1610
|
"authenticated",
|
|
1515
1611
|
"failed",
|
|
1516
1612
|
"pending"
|
|
1517
1613
|
]);
|
|
1518
|
-
var LeafFieldValues =
|
|
1614
|
+
var LeafFieldValues = z14.union([
|
|
1519
1615
|
AddressFieldValue,
|
|
1520
1616
|
TextValue,
|
|
1521
1617
|
PlainDate,
|
|
@@ -1541,11 +1637,11 @@ var LeafFieldValues = z13.union([
|
|
|
1541
1637
|
AutocompleteValue,
|
|
1542
1638
|
AutocompleteUpdateValue
|
|
1543
1639
|
]);
|
|
1544
|
-
var FieldGroupValue =
|
|
1545
|
-
var DataFieldValue =
|
|
1546
|
-
data:
|
|
1640
|
+
var FieldGroupValue = z14.record(z14.string(), LeafFieldValues);
|
|
1641
|
+
var DataFieldValue = z14.object({
|
|
1642
|
+
data: z14.record(z14.string(), LeafFieldValues)
|
|
1547
1643
|
}).nullish();
|
|
1548
|
-
var FieldValue =
|
|
1644
|
+
var FieldValue = z14.union([
|
|
1549
1645
|
LeafFieldValues,
|
|
1550
1646
|
DataFieldValue,
|
|
1551
1647
|
FieldGroupValue
|
|
@@ -1579,7 +1675,7 @@ function safeUnion(schemas) {
|
|
|
1579
1675
|
const sortedSchemas = [...schemas].sort(
|
|
1580
1676
|
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
1581
1677
|
);
|
|
1582
|
-
return
|
|
1678
|
+
return z14.any().superRefine((val, ctx) => {
|
|
1583
1679
|
for (const schema of sortedSchemas) {
|
|
1584
1680
|
if (schema.safeParse(val).success) {
|
|
1585
1681
|
return;
|
|
@@ -1618,9 +1714,9 @@ var FieldUpdateValue = safeUnion([
|
|
|
1618
1714
|
]);
|
|
1619
1715
|
|
|
1620
1716
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
1621
|
-
var
|
|
1622
|
-
var SerializedUserField =
|
|
1623
|
-
$userField:
|
|
1717
|
+
var z15 = __toESM(require("zod/v4"));
|
|
1718
|
+
var SerializedUserField = z15.object({
|
|
1719
|
+
$userField: z15.enum([
|
|
1624
1720
|
"id",
|
|
1625
1721
|
"name",
|
|
1626
1722
|
"role",
|
|
@@ -1634,7 +1730,7 @@ var SerializedUserField = z14.object({
|
|
|
1634
1730
|
"primaryOfficeId",
|
|
1635
1731
|
"administrativeAreaId"
|
|
1636
1732
|
]),
|
|
1637
|
-
$location:
|
|
1733
|
+
$location: z15.string().optional()
|
|
1638
1734
|
});
|
|
1639
1735
|
function userSerializer(userField) {
|
|
1640
1736
|
return {
|
|
@@ -1657,25 +1753,25 @@ function userSerializer(userField) {
|
|
|
1657
1753
|
var import_v4 = require("zod/v4");
|
|
1658
1754
|
|
|
1659
1755
|
// ../commons/src/events/EventMetadata.ts
|
|
1660
|
-
var
|
|
1756
|
+
var z17 = __toESM(require("zod/v4"));
|
|
1661
1757
|
|
|
1662
1758
|
// ../commons/src/events/ActionDocument.ts
|
|
1663
|
-
var
|
|
1664
|
-
var ActionUpdate =
|
|
1759
|
+
var z16 = __toESM(require("zod/v4"));
|
|
1760
|
+
var ActionUpdate = z16.record(z16.string(), FieldUpdateValue).describe(
|
|
1665
1761
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
1666
1762
|
);
|
|
1667
|
-
var EventState =
|
|
1763
|
+
var EventState = z16.record(z16.string(), FieldValue).describe(
|
|
1668
1764
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
1669
1765
|
);
|
|
1670
|
-
var ActionBase =
|
|
1766
|
+
var ActionBase = z16.object({
|
|
1671
1767
|
id: UUID.describe("Unique identifier of the action."),
|
|
1672
|
-
transactionId:
|
|
1768
|
+
transactionId: z16.string().describe("Unique identifier of the transaction."),
|
|
1673
1769
|
createdByUserType: TokenUserType.describe(
|
|
1674
1770
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1675
1771
|
),
|
|
1676
|
-
createdAt:
|
|
1677
|
-
createdBy:
|
|
1678
|
-
createdByRole:
|
|
1772
|
+
createdAt: z16.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1773
|
+
createdBy: z16.string().describe("Identifier of the user who created the action."),
|
|
1774
|
+
createdByRole: z16.string().optional().describe("Role of the user who created the action."),
|
|
1679
1775
|
createdBySignature: DocumentPath.nullish().describe(
|
|
1680
1776
|
"Reference to the signature of the user who created the action."
|
|
1681
1777
|
),
|
|
@@ -1687,7 +1783,7 @@ var ActionBase = z15.object({
|
|
|
1687
1783
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1688
1784
|
),
|
|
1689
1785
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1690
|
-
status:
|
|
1786
|
+
status: z16.enum([
|
|
1691
1787
|
ActionStatus.Requested,
|
|
1692
1788
|
ActionStatus.Accepted,
|
|
1693
1789
|
ActionStatus.Rejected
|
|
@@ -1699,139 +1795,143 @@ var ActionBase = z15.object({
|
|
|
1699
1795
|
)
|
|
1700
1796
|
});
|
|
1701
1797
|
var AssignedAction = ActionBase.extend(
|
|
1702
|
-
|
|
1703
|
-
type:
|
|
1704
|
-
assignedTo:
|
|
1798
|
+
z16.object({
|
|
1799
|
+
type: z16.literal(ActionType.ASSIGN),
|
|
1800
|
+
assignedTo: z16.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1705
1801
|
// TODO move into 'content' property
|
|
1706
1802
|
}).shape
|
|
1707
1803
|
);
|
|
1708
1804
|
var UnassignedAction = ActionBase.extend(
|
|
1709
|
-
|
|
1710
|
-
type:
|
|
1805
|
+
z16.object({
|
|
1806
|
+
type: z16.literal(ActionType.UNASSIGN)
|
|
1711
1807
|
}).shape
|
|
1712
1808
|
);
|
|
1713
1809
|
var RegisterAction = ActionBase.extend(
|
|
1714
|
-
|
|
1715
|
-
type:
|
|
1716
|
-
registrationNumber:
|
|
1810
|
+
z16.object({
|
|
1811
|
+
type: z16.literal(ActionType.REGISTER),
|
|
1812
|
+
registrationNumber: z16.string().optional().describe(
|
|
1717
1813
|
"Registration number of the event. Always present for accepted registrations."
|
|
1718
1814
|
)
|
|
1719
1815
|
// TODO move into 'content' property
|
|
1720
1816
|
}).shape
|
|
1721
1817
|
);
|
|
1722
1818
|
var DeclareAction = ActionBase.extend(
|
|
1723
|
-
|
|
1724
|
-
type:
|
|
1819
|
+
z16.object({
|
|
1820
|
+
type: z16.literal(ActionType.DECLARE)
|
|
1725
1821
|
}).shape
|
|
1726
1822
|
);
|
|
1727
|
-
var ReasonContent =
|
|
1728
|
-
reason:
|
|
1823
|
+
var ReasonContent = z16.object({
|
|
1824
|
+
reason: z16.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
1729
1825
|
"Message describing the reason for rejecting or archiving the event."
|
|
1730
1826
|
)
|
|
1731
1827
|
});
|
|
1732
1828
|
var RejectAction = ActionBase.extend(
|
|
1733
|
-
|
|
1734
|
-
type:
|
|
1829
|
+
z16.object({
|
|
1830
|
+
type: z16.literal(ActionType.REJECT),
|
|
1735
1831
|
content: ReasonContent
|
|
1736
1832
|
}).shape
|
|
1737
1833
|
);
|
|
1738
|
-
var PotentialDuplicate =
|
|
1834
|
+
var PotentialDuplicate = z16.object({
|
|
1739
1835
|
id: UUID,
|
|
1740
|
-
trackingId:
|
|
1836
|
+
trackingId: z16.string()
|
|
1741
1837
|
});
|
|
1742
1838
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
1743
|
-
|
|
1744
|
-
type:
|
|
1745
|
-
content:
|
|
1746
|
-
duplicates:
|
|
1839
|
+
z16.object({
|
|
1840
|
+
type: z16.literal(ActionType.DUPLICATE_DETECTED),
|
|
1841
|
+
content: z16.object({
|
|
1842
|
+
duplicates: z16.array(PotentialDuplicate)
|
|
1747
1843
|
})
|
|
1748
1844
|
}).shape
|
|
1749
1845
|
);
|
|
1750
1846
|
var MarkNotDuplicateAction = ActionBase.extend(
|
|
1751
|
-
|
|
1752
|
-
type:
|
|
1847
|
+
z16.object({
|
|
1848
|
+
type: z16.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1753
1849
|
}).shape
|
|
1754
1850
|
);
|
|
1755
1851
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
1756
|
-
|
|
1757
|
-
type:
|
|
1758
|
-
content:
|
|
1852
|
+
z16.object({
|
|
1853
|
+
type: z16.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1854
|
+
content: z16.object({
|
|
1759
1855
|
duplicateOf: UUID
|
|
1760
1856
|
}).optional()
|
|
1761
1857
|
}).shape
|
|
1762
1858
|
);
|
|
1763
1859
|
var ArchiveAction = ActionBase.extend(
|
|
1764
|
-
|
|
1765
|
-
type:
|
|
1766
|
-
|
|
1860
|
+
z16.object({
|
|
1861
|
+
type: z16.literal(ActionType.ARCHIVE),
|
|
1862
|
+
/**
|
|
1863
|
+
* Archiving does not collect a reason on its own. Only the
|
|
1864
|
+
* "mark as duplicate" flow archives with a reason attached.
|
|
1865
|
+
*/
|
|
1866
|
+
content: ReasonContent.optional()
|
|
1767
1867
|
}).shape
|
|
1768
1868
|
);
|
|
1769
1869
|
var UnarchiveAction = ActionBase.extend(
|
|
1770
|
-
|
|
1771
|
-
type:
|
|
1870
|
+
z16.object({
|
|
1871
|
+
type: z16.literal(ActionType.UNARCHIVE)
|
|
1772
1872
|
}).shape
|
|
1773
1873
|
);
|
|
1774
1874
|
var CreatedAction = ActionBase.extend(
|
|
1775
|
-
|
|
1776
|
-
type:
|
|
1875
|
+
z16.object({
|
|
1876
|
+
type: z16.literal(ActionType.CREATE)
|
|
1777
1877
|
}).shape
|
|
1778
1878
|
);
|
|
1779
1879
|
var NotifiedAction = ActionBase.extend(
|
|
1780
|
-
|
|
1781
|
-
type:
|
|
1880
|
+
z16.object({
|
|
1881
|
+
type: z16.literal(ActionType.NOTIFY)
|
|
1782
1882
|
}).shape
|
|
1783
1883
|
);
|
|
1784
1884
|
var EditAction = ActionBase.extend(
|
|
1785
|
-
|
|
1786
|
-
type:
|
|
1885
|
+
z16.object({
|
|
1886
|
+
type: z16.literal(ActionType.EDIT),
|
|
1787
1887
|
/** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
|
|
1788
|
-
content:
|
|
1789
|
-
comment:
|
|
1888
|
+
content: z16.object({
|
|
1889
|
+
comment: z16.string().describe("Comment for the edit action.").optional()
|
|
1790
1890
|
}).optional()
|
|
1791
1891
|
}).shape
|
|
1792
1892
|
);
|
|
1793
|
-
var PrintContent =
|
|
1794
|
-
templateId:
|
|
1893
|
+
var PrintContent = z16.object({
|
|
1894
|
+
templateId: z16.string().optional()
|
|
1795
1895
|
});
|
|
1796
1896
|
var PrintCertificateAction = ActionBase.extend(
|
|
1797
|
-
|
|
1798
|
-
type:
|
|
1897
|
+
z16.object({
|
|
1898
|
+
type: z16.literal(ActionType.PRINT_CERTIFICATE),
|
|
1799
1899
|
content: PrintContent.optional().nullable()
|
|
1800
1900
|
}).shape
|
|
1801
1901
|
);
|
|
1802
1902
|
var RequestedCorrectionAction = ActionBase.extend(
|
|
1803
|
-
|
|
1804
|
-
type:
|
|
1903
|
+
z16.object({
|
|
1904
|
+
type: z16.literal(ActionType.REQUEST_CORRECTION)
|
|
1805
1905
|
}).shape
|
|
1806
1906
|
);
|
|
1807
1907
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1808
|
-
|
|
1809
|
-
type:
|
|
1810
|
-
requestId:
|
|
1908
|
+
z16.object({
|
|
1909
|
+
type: z16.literal(ActionType.APPROVE_CORRECTION),
|
|
1910
|
+
requestId: z16.string(),
|
|
1811
1911
|
// TODO move into 'content' property
|
|
1812
|
-
content:
|
|
1912
|
+
content: z16.object({ immediateCorrection: z16.boolean().optional() }).optional()
|
|
1813
1913
|
}).shape
|
|
1814
1914
|
);
|
|
1815
1915
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1816
|
-
|
|
1817
|
-
type:
|
|
1818
|
-
requestId:
|
|
1916
|
+
z16.object({
|
|
1917
|
+
type: z16.literal(ActionType.REJECT_CORRECTION),
|
|
1918
|
+
requestId: z16.string(),
|
|
1819
1919
|
// TODO move into 'content' property
|
|
1820
1920
|
content: ReasonContent
|
|
1821
1921
|
}).shape
|
|
1822
1922
|
);
|
|
1823
1923
|
var ReadAction = ActionBase.extend(
|
|
1824
|
-
|
|
1825
|
-
type:
|
|
1924
|
+
z16.object({
|
|
1925
|
+
type: z16.literal(ActionType.READ)
|
|
1826
1926
|
}).shape
|
|
1827
1927
|
);
|
|
1828
1928
|
var CustomAction = ActionBase.merge(
|
|
1829
|
-
|
|
1830
|
-
type:
|
|
1831
|
-
customActionType:
|
|
1929
|
+
z16.object({
|
|
1930
|
+
type: z16.literal(ActionType.CUSTOM),
|
|
1931
|
+
customActionType: z16.string()
|
|
1832
1932
|
})
|
|
1833
1933
|
);
|
|
1834
|
-
var ActionDocument =
|
|
1934
|
+
var ActionDocument = z16.discriminatedUnion("type", [
|
|
1835
1935
|
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1836
1936
|
RejectAction.meta({ id: "RejectAction" }),
|
|
1837
1937
|
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
@@ -1858,57 +1958,50 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1858
1958
|
declaration: true,
|
|
1859
1959
|
annotation: true
|
|
1860
1960
|
}).extend(
|
|
1861
|
-
|
|
1862
|
-
type:
|
|
1863
|
-
status:
|
|
1961
|
+
z16.object({
|
|
1962
|
+
type: z16.enum(ConfirmableActions),
|
|
1963
|
+
status: z16.literal(ActionStatus.Rejected)
|
|
1864
1964
|
}).shape
|
|
1865
1965
|
);
|
|
1866
|
-
var Action =
|
|
1966
|
+
var Action = z16.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1867
1967
|
|
|
1868
1968
|
// ../commons/src/events/EventMetadata.ts
|
|
1869
|
-
var
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
"
|
|
1873
|
-
"
|
|
1874
|
-
"ARCHIVED"
|
|
1875
|
-
]);
|
|
1876
|
-
var ZodDate = z16.iso.date();
|
|
1877
|
-
var ZodDateTime = z16.string().datetime();
|
|
1878
|
-
var ActionCreationMetadata = z16.object({
|
|
1879
|
-
createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1880
|
-
createdBy: z16.string().describe("ID of the user who created the action request."),
|
|
1969
|
+
var ZodDate = z17.iso.date();
|
|
1970
|
+
var ZodDateTime = z17.string().datetime();
|
|
1971
|
+
var ActionCreationMetadata = z17.object({
|
|
1972
|
+
createdAt: z17.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1973
|
+
createdBy: z17.string().describe("ID of the user who created the action request."),
|
|
1881
1974
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1882
1975
|
createdAtLocation: UUID.nullish().describe(
|
|
1883
1976
|
"Location of the user who created the action request."
|
|
1884
1977
|
),
|
|
1885
|
-
createdByUserType:
|
|
1886
|
-
acceptedAt:
|
|
1887
|
-
createdByRole:
|
|
1978
|
+
createdByUserType: z17.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1979
|
+
acceptedAt: z17.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1980
|
+
createdByRole: z17.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1888
1981
|
});
|
|
1889
1982
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1890
|
-
registrationNumber:
|
|
1983
|
+
registrationNumber: z17.string().describe(
|
|
1891
1984
|
"Registration number of the event. Always present for accepted registrations."
|
|
1892
1985
|
)
|
|
1893
1986
|
});
|
|
1894
|
-
var LegalStatuses =
|
|
1987
|
+
var LegalStatuses = z17.object({
|
|
1895
1988
|
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1896
1989
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1897
1990
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1898
1991
|
});
|
|
1899
|
-
var EventMetadata =
|
|
1992
|
+
var EventMetadata = z17.object({
|
|
1900
1993
|
id: UUID,
|
|
1901
|
-
type:
|
|
1994
|
+
type: z17.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1902
1995
|
status: EventStatus,
|
|
1903
1996
|
legalStatuses: LegalStatuses.describe(
|
|
1904
1997
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1905
1998
|
),
|
|
1906
|
-
createdAt:
|
|
1999
|
+
createdAt: z17.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1907
2000
|
dateOfEvent: ZodDate.nullish(),
|
|
1908
2001
|
placeOfEvent: UUID.nullish(),
|
|
1909
|
-
createdBy:
|
|
1910
|
-
createdByUserType:
|
|
1911
|
-
updatedByUserRole:
|
|
2002
|
+
createdBy: z17.string().describe("ID of the user who created the event."),
|
|
2003
|
+
createdByUserType: z17.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
2004
|
+
updatedByUserRole: z17.string().nullish().describe("Role of the user who last changed the status."),
|
|
1912
2005
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1913
2006
|
createdAtLocation: UUID.nullish().describe(
|
|
1914
2007
|
"Location of the user who created the event."
|
|
@@ -1916,18 +2009,18 @@ var EventMetadata = z16.object({
|
|
|
1916
2009
|
updatedAtLocation: UUID.nullish().describe(
|
|
1917
2010
|
"Location of the user who last changed the status."
|
|
1918
2011
|
),
|
|
1919
|
-
updatedAt:
|
|
2012
|
+
updatedAt: z17.iso.datetime().describe(
|
|
1920
2013
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1921
2014
|
),
|
|
1922
|
-
assignedTo:
|
|
1923
|
-
updatedBy:
|
|
1924
|
-
trackingId:
|
|
2015
|
+
assignedTo: z17.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
2016
|
+
updatedBy: z17.string().nullish().describe("ID of the user who last changed the status."),
|
|
2017
|
+
trackingId: z17.string().describe(
|
|
1925
2018
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1926
2019
|
),
|
|
1927
|
-
potentialDuplicates:
|
|
2020
|
+
potentialDuplicates: z17.array(PotentialDuplicate).describe(
|
|
1928
2021
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1929
2022
|
),
|
|
1930
|
-
flags:
|
|
2023
|
+
flags: z17.array(Flag)
|
|
1931
2024
|
});
|
|
1932
2025
|
var EventMetadataKeysArray = [
|
|
1933
2026
|
"id",
|
|
@@ -1948,7 +2041,7 @@ var EventMetadataKeysArray = [
|
|
|
1948
2041
|
"legalStatuses",
|
|
1949
2042
|
"flags"
|
|
1950
2043
|
];
|
|
1951
|
-
var EventMetadataKeys =
|
|
2044
|
+
var EventMetadataKeys = z17.enum(EventMetadataKeysArray);
|
|
1952
2045
|
var eventMetadataLabelMap = {
|
|
1953
2046
|
"event.assignedTo": {
|
|
1954
2047
|
id: "event.assignedTo.label",
|
|
@@ -2031,7 +2124,7 @@ var eventMetadataLabelMap = {
|
|
|
2031
2124
|
description: "Flags"
|
|
2032
2125
|
}
|
|
2033
2126
|
};
|
|
2034
|
-
var EventMetadataDateFieldIdInput =
|
|
2127
|
+
var EventMetadataDateFieldIdInput = z17.enum([
|
|
2035
2128
|
"createdAt",
|
|
2036
2129
|
"updatedAt",
|
|
2037
2130
|
"legalStatuses.NOTIFIED.createdAt",
|
|
@@ -2041,7 +2134,7 @@ var EventMetadataDateFieldIdInput = z16.enum([
|
|
|
2041
2134
|
"legalStatuses.REGISTERED.createdAt",
|
|
2042
2135
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
2043
2136
|
]);
|
|
2044
|
-
var EventMetadataDateFieldId =
|
|
2137
|
+
var EventMetadataDateFieldId = z17.enum([
|
|
2045
2138
|
"event.createdAt",
|
|
2046
2139
|
"event.updatedAt",
|
|
2047
2140
|
"event.legalStatuses.NOTIFIED.createdAt",
|
|
@@ -2332,8 +2425,8 @@ var BaseField = import_v43.default.object({
|
|
|
2332
2425
|
conditionals: import_v43.default.array(FieldConditional).default([]).optional().describe(
|
|
2333
2426
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
2334
2427
|
),
|
|
2335
|
-
secured: import_v43.default.boolean().default(false).optional().describe(
|
|
2336
|
-
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
2428
|
+
secured: import_v43.default.union([import_v43.default.boolean(), Conditional]).default(false).optional().describe(
|
|
2429
|
+
"Indicates whether the field is secured, either always (boolean) or conditionally, evaluated against the event (a JSONSchema conditional, e.g. flag('sealed')). Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
2337
2430
|
),
|
|
2338
2431
|
placeholder: TranslationConfig.optional(),
|
|
2339
2432
|
validation: import_v43.default.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
@@ -2731,7 +2824,16 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
2731
2824
|
configuration: import_v43.default.object({
|
|
2732
2825
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
2733
2826
|
type: AdministrativeAreas,
|
|
2734
|
-
allowedLocations: AllowedLocations
|
|
2827
|
+
allowedLocations: AllowedLocations,
|
|
2828
|
+
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2829
|
+
"List every historical name a location has had as a separate, selectable option."
|
|
2830
|
+
),
|
|
2831
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2832
|
+
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
2833
|
+
),
|
|
2834
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
2835
|
+
"Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that."
|
|
2836
|
+
)
|
|
2735
2837
|
}).describe("Administrative area options")
|
|
2736
2838
|
}).meta({
|
|
2737
2839
|
description: "Administrative area input field",
|
|
@@ -2742,7 +2844,16 @@ var LocationInput = BaseField.extend({
|
|
|
2742
2844
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2743
2845
|
configuration: import_v43.default.object({
|
|
2744
2846
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2745
|
-
allowedLocations: AllowedLocations
|
|
2847
|
+
allowedLocations: AllowedLocations,
|
|
2848
|
+
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2849
|
+
"List every historical name a location has had as a separate, selectable option."
|
|
2850
|
+
),
|
|
2851
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2852
|
+
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
2853
|
+
),
|
|
2854
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
2855
|
+
"Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that."
|
|
2856
|
+
)
|
|
2746
2857
|
}).optional()
|
|
2747
2858
|
}).meta({
|
|
2748
2859
|
description: "A field for selecting a location",
|
|
@@ -2768,12 +2879,22 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2768
2879
|
var Facility = BaseField.extend({
|
|
2769
2880
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
2770
2881
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2771
|
-
configuration: import_v43.default.object({
|
|
2882
|
+
configuration: import_v43.default.object({
|
|
2883
|
+
allowedLocations: AllowedLocations,
|
|
2884
|
+
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
2885
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
2886
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2887
|
+
}).optional()
|
|
2772
2888
|
}).describe("Input field for a facility");
|
|
2773
2889
|
var Office = BaseField.extend({
|
|
2774
2890
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
2775
2891
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2776
|
-
configuration: import_v43.default.object({
|
|
2892
|
+
configuration: import_v43.default.object({
|
|
2893
|
+
allowedLocations: AllowedLocations,
|
|
2894
|
+
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
2895
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
2896
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2897
|
+
}).optional()
|
|
2777
2898
|
}).describe("Input field for an office");
|
|
2778
2899
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
2779
2900
|
administrativeArea: import_v43.default.union([UUID, SerializedUserField]).optional()
|
|
@@ -2806,7 +2927,16 @@ var Address = BaseField.extend({
|
|
|
2806
2927
|
parent: FieldReference.optional()
|
|
2807
2928
|
})
|
|
2808
2929
|
).optional(),
|
|
2809
|
-
allowedLocations: AllowedLocations
|
|
2930
|
+
allowedLocations: AllowedLocations,
|
|
2931
|
+
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2932
|
+
"List every historical name a location has had as a separate, selectable option. Propagated to the embedded admin-area selectors."
|
|
2933
|
+
),
|
|
2934
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2935
|
+
"Offer only admin areas that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded. Propagated to the embedded admin-area selectors."
|
|
2936
|
+
),
|
|
2937
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
2938
|
+
"Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that. Propagated to the embedded admin-area selectors."
|
|
2939
|
+
)
|
|
2810
2940
|
}).optional(),
|
|
2811
2941
|
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
2812
2942
|
}).meta({
|
|
@@ -3107,18 +3237,18 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
3107
3237
|
]);
|
|
3108
3238
|
|
|
3109
3239
|
// ../commons/src/events/FormConfig.ts
|
|
3110
|
-
var
|
|
3240
|
+
var z23 = __toESM(require("zod/v4"));
|
|
3111
3241
|
|
|
3112
3242
|
// ../commons/src/events/PageConfig.ts
|
|
3113
|
-
var
|
|
3114
|
-
var PageTypes =
|
|
3115
|
-
var PageConfigBase =
|
|
3116
|
-
id:
|
|
3243
|
+
var z22 = __toESM(require("zod/v4"));
|
|
3244
|
+
var PageTypes = z22.enum(["FORM", "VERIFICATION"]);
|
|
3245
|
+
var PageConfigBase = z22.object({
|
|
3246
|
+
id: z22.string().describe("Unique identifier for the page"),
|
|
3117
3247
|
title: TranslationConfig.describe("Header title of the page"),
|
|
3118
|
-
requireCompletionToContinue:
|
|
3248
|
+
requireCompletionToContinue: z22.boolean().default(false).describe(
|
|
3119
3249
|
"If true, all required fields must be filled before continuing to the next page"
|
|
3120
3250
|
),
|
|
3121
|
-
fields:
|
|
3251
|
+
fields: z22.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
3122
3252
|
conditional: Conditional.optional().describe(
|
|
3123
3253
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
3124
3254
|
)
|
|
@@ -3127,13 +3257,13 @@ var PageConfigBase = z21.object({
|
|
|
3127
3257
|
id: "FormPageConfig"
|
|
3128
3258
|
});
|
|
3129
3259
|
var FormPageConfig = PageConfigBase.extend({
|
|
3130
|
-
type:
|
|
3260
|
+
type: z22.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
3131
3261
|
});
|
|
3132
|
-
var VerificationActionConfig =
|
|
3133
|
-
verify:
|
|
3134
|
-
cancel:
|
|
3262
|
+
var VerificationActionConfig = z22.object({
|
|
3263
|
+
verify: z22.object({ label: TranslationConfig }),
|
|
3264
|
+
cancel: z22.object({
|
|
3135
3265
|
label: TranslationConfig,
|
|
3136
|
-
confirmation:
|
|
3266
|
+
confirmation: z22.object({
|
|
3137
3267
|
title: TranslationConfig,
|
|
3138
3268
|
body: TranslationConfig
|
|
3139
3269
|
})
|
|
@@ -3143,34 +3273,34 @@ var VerificationActionConfig = z21.object({
|
|
|
3143
3273
|
id: "VerificationActionConfig"
|
|
3144
3274
|
});
|
|
3145
3275
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
3146
|
-
type:
|
|
3276
|
+
type: z22.literal(PageTypes.enum.VERIFICATION),
|
|
3147
3277
|
actions: VerificationActionConfig
|
|
3148
3278
|
});
|
|
3149
|
-
var PageConfig =
|
|
3279
|
+
var PageConfig = z22.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
3150
3280
|
id: "PageConfig",
|
|
3151
3281
|
description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
|
|
3152
3282
|
});
|
|
3153
3283
|
|
|
3154
3284
|
// ../commons/src/events/FormConfig.ts
|
|
3155
|
-
var DeclarationFormConfig =
|
|
3285
|
+
var DeclarationFormConfig = z23.object({
|
|
3156
3286
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
3157
|
-
pages:
|
|
3287
|
+
pages: z23.array(FormPageConfig)
|
|
3158
3288
|
}).meta({
|
|
3159
3289
|
id: "DeclarationFormConfig",
|
|
3160
3290
|
description: "Configuration of the declaration form."
|
|
3161
3291
|
});
|
|
3162
|
-
var ActionFormConfig =
|
|
3292
|
+
var ActionFormConfig = z23.object({
|
|
3163
3293
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
3164
|
-
pages:
|
|
3294
|
+
pages: z23.array(PageConfig)
|
|
3165
3295
|
}).describe(
|
|
3166
3296
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
3167
3297
|
);
|
|
3168
|
-
var FormConfig =
|
|
3298
|
+
var FormConfig = z23.union([DeclarationFormConfig, ActionFormConfig]);
|
|
3169
3299
|
|
|
3170
3300
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
3171
|
-
var
|
|
3172
|
-
var FieldReference2 =
|
|
3173
|
-
var Matcher =
|
|
3301
|
+
var z24 = __toESM(require("zod/v4"));
|
|
3302
|
+
var FieldReference2 = z24.string();
|
|
3303
|
+
var Matcher = z24.object({
|
|
3174
3304
|
/**
|
|
3175
3305
|
* Reference to the field used in matching.
|
|
3176
3306
|
*
|
|
@@ -3178,23 +3308,23 @@ var Matcher = z23.object({
|
|
|
3178
3308
|
* be used as the origin date to calculate the distance from.
|
|
3179
3309
|
*/
|
|
3180
3310
|
fieldId: FieldReference2,
|
|
3181
|
-
options:
|
|
3182
|
-
boost:
|
|
3311
|
+
options: z24.object({
|
|
3312
|
+
boost: z24.number().optional(),
|
|
3183
3313
|
matchAgainst: FieldReference2.optional()
|
|
3184
3314
|
}).optional().default({
|
|
3185
3315
|
boost: 1
|
|
3186
3316
|
})
|
|
3187
3317
|
});
|
|
3188
3318
|
var FuzzyMatcher = Matcher.extend({
|
|
3189
|
-
type:
|
|
3190
|
-
options:
|
|
3319
|
+
type: z24.literal("fuzzy"),
|
|
3320
|
+
options: z24.object({
|
|
3191
3321
|
/**
|
|
3192
3322
|
* Names of length 3 or less characters = 0 edits allowed
|
|
3193
3323
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
3194
3324
|
* Names of length >7 characters = 2 edits allowed
|
|
3195
3325
|
*/
|
|
3196
|
-
fuzziness:
|
|
3197
|
-
boost:
|
|
3326
|
+
fuzziness: z24.union([z24.string(), z24.number()]).optional().default("AUTO:4,7"),
|
|
3327
|
+
boost: z24.number().optional().default(1),
|
|
3198
3328
|
matchAgainst: FieldReference2.optional()
|
|
3199
3329
|
}).optional().default({
|
|
3200
3330
|
fuzziness: "AUTO:4,7",
|
|
@@ -3202,48 +3332,48 @@ var FuzzyMatcher = Matcher.extend({
|
|
|
3202
3332
|
})
|
|
3203
3333
|
});
|
|
3204
3334
|
var StrictMatcher = Matcher.extend({
|
|
3205
|
-
type:
|
|
3206
|
-
options:
|
|
3207
|
-
boost:
|
|
3335
|
+
type: z24.literal("strict"),
|
|
3336
|
+
options: z24.object({
|
|
3337
|
+
boost: z24.number().optional().default(1),
|
|
3208
3338
|
/**
|
|
3209
3339
|
* The constant value to be present in the field for both records
|
|
3210
3340
|
*/
|
|
3211
|
-
value:
|
|
3341
|
+
value: z24.string().optional(),
|
|
3212
3342
|
matchAgainst: FieldReference2.optional()
|
|
3213
3343
|
}).optional().default({
|
|
3214
3344
|
boost: 1
|
|
3215
3345
|
})
|
|
3216
3346
|
});
|
|
3217
3347
|
var DateRangeMatcher = Matcher.extend({
|
|
3218
|
-
type:
|
|
3219
|
-
options:
|
|
3348
|
+
type: z24.literal("dateRange"),
|
|
3349
|
+
options: z24.object({
|
|
3220
3350
|
/**
|
|
3221
3351
|
* The distance pivot in days. Distance from the origin (the value of
|
|
3222
3352
|
* fieldId) at which relevance scores receive half of the boost value
|
|
3223
3353
|
*/
|
|
3224
|
-
pivot:
|
|
3225
|
-
days:
|
|
3226
|
-
boost:
|
|
3354
|
+
pivot: z24.number().optional(),
|
|
3355
|
+
days: z24.number(),
|
|
3356
|
+
boost: z24.number().optional().default(1),
|
|
3227
3357
|
matchAgainst: FieldReference2.optional()
|
|
3228
3358
|
})
|
|
3229
3359
|
});
|
|
3230
|
-
var Not =
|
|
3231
|
-
type:
|
|
3360
|
+
var Not = z24.object({
|
|
3361
|
+
type: z24.literal("not"),
|
|
3232
3362
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3233
|
-
clause:
|
|
3363
|
+
clause: z24.lazy(() => Clause)
|
|
3234
3364
|
});
|
|
3235
|
-
var And =
|
|
3236
|
-
type:
|
|
3365
|
+
var And = z24.object({
|
|
3366
|
+
type: z24.literal("and"),
|
|
3237
3367
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3238
|
-
clauses:
|
|
3368
|
+
clauses: z24.lazy(() => Clause.array())
|
|
3239
3369
|
});
|
|
3240
|
-
var Or =
|
|
3241
|
-
type:
|
|
3370
|
+
var Or = z24.object({
|
|
3371
|
+
type: z24.literal("or"),
|
|
3242
3372
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3243
|
-
clauses:
|
|
3373
|
+
clauses: z24.lazy(() => Clause.array())
|
|
3244
3374
|
});
|
|
3245
|
-
var Clause =
|
|
3246
|
-
() =>
|
|
3375
|
+
var Clause = z24.lazy(
|
|
3376
|
+
() => z24.discriminatedUnion("type", [
|
|
3247
3377
|
Not,
|
|
3248
3378
|
And,
|
|
3249
3379
|
Or,
|
|
@@ -3254,8 +3384,8 @@ var Clause = z23.lazy(
|
|
|
3254
3384
|
).meta({
|
|
3255
3385
|
id: "Clause"
|
|
3256
3386
|
});
|
|
3257
|
-
var DeduplicationConfig =
|
|
3258
|
-
id:
|
|
3387
|
+
var DeduplicationConfig = z24.object({
|
|
3388
|
+
id: z24.string(),
|
|
3259
3389
|
label: TranslationConfig,
|
|
3260
3390
|
query: Clause
|
|
3261
3391
|
}).meta({
|
|
@@ -3264,15 +3394,15 @@ var DeduplicationConfig = z23.object({
|
|
|
3264
3394
|
});
|
|
3265
3395
|
|
|
3266
3396
|
// ../commons/src/events/ActionConfig.ts
|
|
3267
|
-
var DeclarationReviewConfig =
|
|
3397
|
+
var DeclarationReviewConfig = z25.object({
|
|
3268
3398
|
title: TranslationConfig.describe("Title of the review page"),
|
|
3269
|
-
fields:
|
|
3399
|
+
fields: z25.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
3270
3400
|
}).describe(
|
|
3271
3401
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
3272
3402
|
);
|
|
3273
|
-
var ActionConfigBase =
|
|
3403
|
+
var ActionConfigBase = z25.object({
|
|
3274
3404
|
label: TranslationConfig.describe("Human readable description of the action"),
|
|
3275
|
-
flags:
|
|
3405
|
+
flags: z25.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
|
|
3276
3406
|
supportingCopy: TranslationConfig.optional().describe(
|
|
3277
3407
|
"Text displayed on the confirmation dialog"
|
|
3278
3408
|
),
|
|
@@ -3283,84 +3413,84 @@ var ActionConfigBase = z24.object({
|
|
|
3283
3413
|
* "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."
|
|
3284
3414
|
* for EventConfig.d.ts.
|
|
3285
3415
|
*/
|
|
3286
|
-
icon:
|
|
3287
|
-
conditionals:
|
|
3416
|
+
icon: z25.string().describe("Icon representing the action").optional(),
|
|
3417
|
+
conditionals: z25.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
|
|
3288
3418
|
});
|
|
3289
3419
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
3290
3420
|
deduplication: DeduplicationConfig.optional()
|
|
3291
3421
|
});
|
|
3292
|
-
var actionConfirmationForm =
|
|
3422
|
+
var actionConfirmationForm = z25.array(FieldConfig).optional().describe(
|
|
3293
3423
|
"Fields rendered on the action confirmation dialog. Submitted values are stored in the action annotation and shown in the audit history."
|
|
3294
3424
|
);
|
|
3295
3425
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
3296
|
-
|
|
3297
|
-
type:
|
|
3426
|
+
z25.object({
|
|
3427
|
+
type: z25.literal(ActionType.READ),
|
|
3298
3428
|
review: DeclarationReviewConfig.describe(
|
|
3299
3429
|
"Configuration of the review page for read-only view."
|
|
3300
3430
|
),
|
|
3301
|
-
conditionals:
|
|
3431
|
+
conditionals: z25.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
3302
3432
|
}).shape
|
|
3303
3433
|
);
|
|
3304
3434
|
var NotifyConfig = ActionConfigBase.extend(
|
|
3305
|
-
|
|
3306
|
-
type:
|
|
3435
|
+
z25.object({
|
|
3436
|
+
type: z25.literal(ActionType.NOTIFY),
|
|
3307
3437
|
form: actionConfirmationForm
|
|
3308
3438
|
}).shape
|
|
3309
3439
|
);
|
|
3310
3440
|
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
3311
|
-
|
|
3312
|
-
type:
|
|
3313
|
-
label:
|
|
3441
|
+
z25.object({
|
|
3442
|
+
type: z25.literal(ActionType.DUPLICATE_DETECTED),
|
|
3443
|
+
label: z25.never().optional().describe(
|
|
3314
3444
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no label."
|
|
3315
3445
|
),
|
|
3316
|
-
supportingCopy:
|
|
3317
|
-
icon:
|
|
3446
|
+
supportingCopy: z25.never().optional(),
|
|
3447
|
+
icon: z25.never().optional().describe(
|
|
3318
3448
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no icon."
|
|
3319
3449
|
),
|
|
3320
|
-
conditionals:
|
|
3450
|
+
conditionals: z25.never().optional().describe(
|
|
3321
3451
|
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it cannot be disabled or hidden with conditionals."
|
|
3322
3452
|
)
|
|
3323
3453
|
}).shape
|
|
3324
3454
|
);
|
|
3325
3455
|
var MarkAsDuplicateConfig = ActionConfigBase.extend(
|
|
3326
|
-
|
|
3327
|
-
type:
|
|
3456
|
+
z25.object({
|
|
3457
|
+
type: z25.literal(ActionType.MARK_AS_DUPLICATE)
|
|
3328
3458
|
}).shape
|
|
3329
3459
|
);
|
|
3330
3460
|
var MarkAsNotDuplicateConfig = ActionConfigBase.extend(
|
|
3331
|
-
|
|
3332
|
-
type:
|
|
3461
|
+
z25.object({
|
|
3462
|
+
type: z25.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3333
3463
|
}).shape
|
|
3334
3464
|
);
|
|
3335
3465
|
var AssignConfig = ActionConfigBase.extend(
|
|
3336
|
-
|
|
3337
|
-
type:
|
|
3338
|
-
flags:
|
|
3466
|
+
z25.object({
|
|
3467
|
+
type: z25.literal(ActionType.ASSIGN),
|
|
3468
|
+
flags: z25.never().optional().describe(
|
|
3339
3469
|
"ASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
3340
3470
|
)
|
|
3341
3471
|
}).shape
|
|
3342
3472
|
);
|
|
3343
3473
|
var UnassignConfig = ActionConfigBase.extend(
|
|
3344
|
-
|
|
3345
|
-
type:
|
|
3346
|
-
flags:
|
|
3474
|
+
z25.object({
|
|
3475
|
+
type: z25.literal(ActionType.UNASSIGN),
|
|
3476
|
+
flags: z25.never().optional().describe(
|
|
3347
3477
|
"UNASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
3348
3478
|
)
|
|
3349
3479
|
}).shape
|
|
3350
3480
|
);
|
|
3351
3481
|
var DeleteConfig = ActionConfigBase.extend(
|
|
3352
|
-
|
|
3353
|
-
type:
|
|
3482
|
+
z25.object({
|
|
3483
|
+
type: z25.literal(ActionType.DELETE)
|
|
3354
3484
|
}).shape
|
|
3355
3485
|
);
|
|
3356
3486
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
3357
|
-
|
|
3358
|
-
type:
|
|
3487
|
+
z25.object({
|
|
3488
|
+
type: z25.literal(ActionType.DECLARE),
|
|
3359
3489
|
review: DeclarationReviewConfig.describe(
|
|
3360
3490
|
"Configuration of the review page fields."
|
|
3361
3491
|
),
|
|
3362
3492
|
form: actionConfirmationForm,
|
|
3363
|
-
dialogCopy:
|
|
3493
|
+
dialogCopy: z25.object({
|
|
3364
3494
|
notify: TranslationConfig.describe(
|
|
3365
3495
|
"Confirmation text for the notify action"
|
|
3366
3496
|
),
|
|
@@ -3374,20 +3504,20 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
3374
3504
|
}).shape
|
|
3375
3505
|
);
|
|
3376
3506
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
3377
|
-
|
|
3378
|
-
type:
|
|
3507
|
+
z25.object({
|
|
3508
|
+
type: z25.literal(ActionType.ARCHIVE),
|
|
3379
3509
|
form: actionConfirmationForm
|
|
3380
3510
|
}).shape
|
|
3381
3511
|
);
|
|
3382
3512
|
var UnarchiveConfig = ActionConfigBase.extend(
|
|
3383
|
-
|
|
3384
|
-
type:
|
|
3513
|
+
z25.object({
|
|
3514
|
+
type: z25.literal(ActionType.UNARCHIVE)
|
|
3385
3515
|
}).shape
|
|
3386
3516
|
);
|
|
3387
3517
|
var EditActionConfig = ActionConfigBase.extend(
|
|
3388
|
-
|
|
3389
|
-
type:
|
|
3390
|
-
dialogCopy:
|
|
3518
|
+
z25.object({
|
|
3519
|
+
type: z25.literal(ActionType.EDIT),
|
|
3520
|
+
dialogCopy: z25.object({
|
|
3391
3521
|
notify: TranslationConfig.describe(
|
|
3392
3522
|
"Confirmation text for the notify with edits action"
|
|
3393
3523
|
),
|
|
@@ -3401,45 +3531,45 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
3401
3531
|
}).shape
|
|
3402
3532
|
);
|
|
3403
3533
|
var RejectConfig = ActionConfigBase.extend(
|
|
3404
|
-
|
|
3405
|
-
type:
|
|
3534
|
+
z25.object({
|
|
3535
|
+
type: z25.literal(ActionType.REJECT),
|
|
3406
3536
|
form: actionConfirmationForm
|
|
3407
3537
|
}).shape
|
|
3408
3538
|
);
|
|
3409
3539
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
3410
|
-
|
|
3411
|
-
type:
|
|
3540
|
+
z25.object({
|
|
3541
|
+
type: z25.literal(ActionType.REGISTER),
|
|
3412
3542
|
form: actionConfirmationForm
|
|
3413
3543
|
}).shape
|
|
3414
3544
|
);
|
|
3415
3545
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
3416
|
-
|
|
3417
|
-
type:
|
|
3546
|
+
z25.object({
|
|
3547
|
+
type: z25.literal(ActionType.PRINT_CERTIFICATE),
|
|
3418
3548
|
printForm: ActionFormConfig
|
|
3419
3549
|
}).shape
|
|
3420
3550
|
);
|
|
3421
3551
|
var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
3422
|
-
|
|
3423
|
-
type:
|
|
3552
|
+
z25.object({
|
|
3553
|
+
type: z25.literal(ActionType.REQUEST_CORRECTION),
|
|
3424
3554
|
correctionForm: ActionFormConfig
|
|
3425
3555
|
}).shape
|
|
3426
3556
|
);
|
|
3427
3557
|
var ApproveCorrectionConfig = ActionConfigBase.extend(
|
|
3428
|
-
|
|
3429
|
-
type:
|
|
3558
|
+
z25.object({
|
|
3559
|
+
type: z25.literal(ActionType.APPROVE_CORRECTION)
|
|
3430
3560
|
}).shape
|
|
3431
3561
|
);
|
|
3432
3562
|
var RejectCorrectionConfig = ActionConfigBase.extend(
|
|
3433
|
-
|
|
3434
|
-
type:
|
|
3563
|
+
z25.object({
|
|
3564
|
+
type: z25.literal(ActionType.REJECT_CORRECTION)
|
|
3435
3565
|
}).shape
|
|
3436
3566
|
);
|
|
3437
3567
|
var CustomActionConfig = ActionConfigBase.extend(
|
|
3438
|
-
|
|
3439
|
-
type:
|
|
3440
|
-
customActionType:
|
|
3568
|
+
z25.object({
|
|
3569
|
+
type: z25.literal(ActionType.CUSTOM),
|
|
3570
|
+
customActionType: z25.string().describe("Type identifier of the custom action."),
|
|
3441
3571
|
/** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
|
|
3442
|
-
form:
|
|
3572
|
+
form: z25.array(FieldConfig).describe(
|
|
3443
3573
|
"Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
|
|
3444
3574
|
),
|
|
3445
3575
|
auditHistoryLabel: TranslationConfig.describe(
|
|
@@ -3447,7 +3577,7 @@ var CustomActionConfig = ActionConfigBase.extend(
|
|
|
3447
3577
|
)
|
|
3448
3578
|
}).shape
|
|
3449
3579
|
);
|
|
3450
|
-
var ActionConfig =
|
|
3580
|
+
var ActionConfig = z25.discriminatedUnion("type", [
|
|
3451
3581
|
/*
|
|
3452
3582
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
3453
3583
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -3534,89 +3664,225 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3534
3664
|
var actionConfigTypes = new Set(
|
|
3535
3665
|
ActionConfig.options.map((opt) => opt.shape.type.value)
|
|
3536
3666
|
);
|
|
3537
|
-
var DeclarationActionConfig =
|
|
3667
|
+
var DeclarationActionConfig = z25.discriminatedUnion("type", [
|
|
3538
3668
|
DeclareConfig,
|
|
3539
3669
|
RegisterConfig
|
|
3540
3670
|
]);
|
|
3541
3671
|
|
|
3542
3672
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
3543
|
-
var
|
|
3544
|
-
var FontFamily =
|
|
3545
|
-
normal:
|
|
3546
|
-
bold:
|
|
3547
|
-
italics:
|
|
3548
|
-
bolditalics:
|
|
3549
|
-
});
|
|
3550
|
-
var CertificateConfig =
|
|
3551
|
-
id:
|
|
3552
|
-
event:
|
|
3553
|
-
isV2Template:
|
|
3673
|
+
var z26 = __toESM(require("zod/v4"));
|
|
3674
|
+
var FontFamily = z26.object({
|
|
3675
|
+
normal: z26.string(),
|
|
3676
|
+
bold: z26.string(),
|
|
3677
|
+
italics: z26.string(),
|
|
3678
|
+
bolditalics: z26.string()
|
|
3679
|
+
});
|
|
3680
|
+
var CertificateConfig = z26.object({
|
|
3681
|
+
id: z26.string(),
|
|
3682
|
+
event: z26.string(),
|
|
3683
|
+
isV2Template: z26.boolean().optional(),
|
|
3554
3684
|
label: TranslationConfig,
|
|
3555
|
-
isDefault:
|
|
3556
|
-
fee:
|
|
3557
|
-
onTime:
|
|
3558
|
-
late:
|
|
3559
|
-
delayed:
|
|
3685
|
+
isDefault: z26.boolean(),
|
|
3686
|
+
fee: z26.object({
|
|
3687
|
+
onTime: z26.number(),
|
|
3688
|
+
late: z26.number(),
|
|
3689
|
+
delayed: z26.number()
|
|
3560
3690
|
}),
|
|
3561
|
-
svgUrl:
|
|
3562
|
-
fonts:
|
|
3563
|
-
conditionals:
|
|
3691
|
+
svgUrl: z26.string(),
|
|
3692
|
+
fonts: z26.record(z26.string(), FontFamily).optional(),
|
|
3693
|
+
conditionals: z26.array(ShowConditional).optional()
|
|
3564
3694
|
});
|
|
3565
3695
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
3566
|
-
hash:
|
|
3567
|
-
svg:
|
|
3696
|
+
hash: z26.string().optional(),
|
|
3697
|
+
svg: z26.string()
|
|
3568
3698
|
});
|
|
3569
3699
|
|
|
3570
3700
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
3571
|
-
var
|
|
3572
|
-
var LanguageConfig =
|
|
3573
|
-
lang:
|
|
3701
|
+
var z27 = __toESM(require("zod/v4"));
|
|
3702
|
+
var LanguageConfig = z27.object({
|
|
3703
|
+
lang: z27.string(),
|
|
3574
3704
|
/**
|
|
3575
3705
|
* client.csv contents
|
|
3576
3706
|
*/
|
|
3577
|
-
messages:
|
|
3707
|
+
messages: z27.record(z27.string(), z27.string())
|
|
3578
3708
|
});
|
|
3579
3709
|
|
|
3580
3710
|
// ../commons/src/events/EventConfig.ts
|
|
3581
|
-
var
|
|
3711
|
+
var z35 = __toESM(require("zod/v4"));
|
|
3582
3712
|
|
|
3583
3713
|
// ../commons/src/events/SummaryConfig.ts
|
|
3584
|
-
var
|
|
3585
|
-
|
|
3714
|
+
var z29 = __toESM(require("zod/v4"));
|
|
3715
|
+
|
|
3716
|
+
// ../commons/src/icons.ts
|
|
3717
|
+
var z28 = __toESM(require("zod/v4"));
|
|
3718
|
+
var AvailableIcons = z28.enum([
|
|
3719
|
+
"Archived",
|
|
3720
|
+
"Assigned",
|
|
3721
|
+
"Briefcase",
|
|
3722
|
+
"Certified",
|
|
3723
|
+
"Close",
|
|
3724
|
+
"Collapse",
|
|
3725
|
+
"Draft",
|
|
3726
|
+
"DuplicateYellow",
|
|
3727
|
+
"Expand",
|
|
3728
|
+
"ExternalValidate",
|
|
3729
|
+
"FilledCheck",
|
|
3730
|
+
"InReview",
|
|
3731
|
+
"Offline",
|
|
3732
|
+
"Registered",
|
|
3733
|
+
"RequiresUpdates",
|
|
3734
|
+
"Sent",
|
|
3735
|
+
"Validated",
|
|
3736
|
+
"WaitingApproval",
|
|
3737
|
+
"ChartActivity",
|
|
3738
|
+
"Activity",
|
|
3739
|
+
"Archive",
|
|
3740
|
+
"ArchiveTray",
|
|
3741
|
+
"ArrowLeft",
|
|
3742
|
+
"ArrowRight",
|
|
3743
|
+
"Buildings",
|
|
3744
|
+
"Circle",
|
|
3745
|
+
"CaretDown",
|
|
3746
|
+
"CaretLeft",
|
|
3747
|
+
"CaretRight",
|
|
3748
|
+
"ChartBar",
|
|
3749
|
+
"ChartLine",
|
|
3750
|
+
"ChatCircle",
|
|
3751
|
+
"CheckSquare",
|
|
3752
|
+
"Compass",
|
|
3753
|
+
"Check",
|
|
3754
|
+
"Copy",
|
|
3755
|
+
"Database",
|
|
3756
|
+
"DotsThreeVertical",
|
|
3757
|
+
"ArrowCounterClockwise",
|
|
3758
|
+
"MagnifyingGlassMinus",
|
|
3759
|
+
"MagnifyingGlassPlus",
|
|
3760
|
+
"Export",
|
|
3761
|
+
"Eye",
|
|
3762
|
+
"EyeSlash",
|
|
3763
|
+
"Envelope",
|
|
3764
|
+
"File",
|
|
3765
|
+
"FileLock",
|
|
3766
|
+
"FileSearch",
|
|
3767
|
+
"FileMinus",
|
|
3768
|
+
"FilePlus",
|
|
3769
|
+
"FileText",
|
|
3770
|
+
"FileX",
|
|
3771
|
+
"Handshake",
|
|
3772
|
+
"Gear",
|
|
3773
|
+
"GitBranch",
|
|
3774
|
+
"IdentificationCard",
|
|
3775
|
+
"List",
|
|
3776
|
+
"ListBullets",
|
|
3777
|
+
"Lock",
|
|
3778
|
+
"MagnifyingGlass",
|
|
3779
|
+
"MapPin",
|
|
3780
|
+
"Medal",
|
|
3781
|
+
"NotePencil",
|
|
3782
|
+
"Paperclip",
|
|
3783
|
+
"PaperPlaneTilt",
|
|
3784
|
+
"Pen",
|
|
3785
|
+
"PenNib",
|
|
3786
|
+
"Pencil",
|
|
3787
|
+
"PencilSimpleLine",
|
|
3788
|
+
"Phone",
|
|
3789
|
+
"Plus",
|
|
3790
|
+
"Printer",
|
|
3791
|
+
"SignOut",
|
|
3792
|
+
"Stamp",
|
|
3793
|
+
"Star",
|
|
3794
|
+
"Target",
|
|
3795
|
+
"TextT",
|
|
3796
|
+
"Trash",
|
|
3797
|
+
"UploadSimple",
|
|
3798
|
+
"User",
|
|
3799
|
+
"UserPlus",
|
|
3800
|
+
"Users",
|
|
3801
|
+
"WarningCircle",
|
|
3802
|
+
"X",
|
|
3803
|
+
"ChatText",
|
|
3804
|
+
"CircleWavyCheck",
|
|
3805
|
+
"CircleWavyQuestion",
|
|
3806
|
+
"ArchiveBox",
|
|
3807
|
+
"ArrowCircleDown",
|
|
3808
|
+
"FileArrowUp",
|
|
3809
|
+
"FileDotted",
|
|
3810
|
+
"Files",
|
|
3811
|
+
"PencilLine",
|
|
3812
|
+
"PencilCircle",
|
|
3813
|
+
"UserCircle",
|
|
3814
|
+
"Clock",
|
|
3815
|
+
"QrCode",
|
|
3816
|
+
"Webcam",
|
|
3817
|
+
"Sun",
|
|
3818
|
+
"DeviceTabletCamera",
|
|
3819
|
+
"Globe",
|
|
3820
|
+
"Fingerprint",
|
|
3821
|
+
"PushPin",
|
|
3822
|
+
"Timer"
|
|
3823
|
+
]);
|
|
3824
|
+
|
|
3825
|
+
// ../commons/src/events/SummaryConfig.ts
|
|
3826
|
+
var InfoBox = z29.object({
|
|
3827
|
+
type: z29.enum(["info", "positive", "warning", "negative"]).describe(
|
|
3828
|
+
"Semantic tint of the icon block: info (blue), positive (green), warning (orange), negative (red)."
|
|
3829
|
+
),
|
|
3830
|
+
background: z29.enum(["tinted", "white"]).default("tinted").optional().describe(
|
|
3831
|
+
"tinted reads as a recessed empty state; white reads as a standalone card."
|
|
3832
|
+
),
|
|
3833
|
+
icon: AvailableIcons.optional().describe(
|
|
3834
|
+
"Icon displayed inside the icon block. Defaults to FileSearch."
|
|
3835
|
+
),
|
|
3836
|
+
heading: TranslationConfig.describe(
|
|
3837
|
+
"Primary message. Short, sentence-case."
|
|
3838
|
+
),
|
|
3839
|
+
description: TranslationConfig.optional().describe(
|
|
3840
|
+
"Secondary copy displayed below the heading, typically a suggested next step."
|
|
3841
|
+
),
|
|
3842
|
+
conditionals: z29.array(ShowConditional).default([]).optional().describe(
|
|
3843
|
+
"Conditions under which the info box is shown. When omitted, it is always shown."
|
|
3844
|
+
)
|
|
3845
|
+
}).describe(
|
|
3846
|
+
"A compact icon-block + heading + description block displayed above the summary fields in the event overview."
|
|
3847
|
+
);
|
|
3848
|
+
var BaseField2 = z29.object({
|
|
3586
3849
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
3587
3850
|
"Default message displayed when the field value is empty."
|
|
3588
3851
|
),
|
|
3589
|
-
conditionals:
|
|
3852
|
+
conditionals: z29.array(ShowConditional).default([]).optional()
|
|
3590
3853
|
});
|
|
3591
3854
|
var ReferenceField = BaseField2.extend({
|
|
3592
|
-
fieldId:
|
|
3855
|
+
fieldId: z29.string(),
|
|
3593
3856
|
label: TranslationConfig.optional().describe(
|
|
3594
3857
|
"Overrides the default label from the referenced field when provided."
|
|
3595
3858
|
)
|
|
3596
3859
|
}).describe("Field referencing existing event data by field ID.");
|
|
3597
3860
|
var Field = BaseField2.extend({
|
|
3598
|
-
id:
|
|
3861
|
+
id: z29.string().describe("Identifier of the summary field."),
|
|
3599
3862
|
value: TranslationConfig.describe(
|
|
3600
3863
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
3601
3864
|
),
|
|
3602
3865
|
label: TranslationConfig
|
|
3603
3866
|
}).describe("Custom field defined for the summary view.");
|
|
3604
|
-
var SummaryConfig =
|
|
3605
|
-
|
|
3867
|
+
var SummaryConfig = z29.object({
|
|
3868
|
+
banners: z29.array(InfoBox).default([]).optional().describe(
|
|
3869
|
+
"Info boxes displayed above the summary fields in the event overview."
|
|
3870
|
+
),
|
|
3871
|
+
fields: z29.array(z29.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
3606
3872
|
}).meta({
|
|
3607
3873
|
id: "SummaryConfig",
|
|
3608
3874
|
description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
|
|
3609
3875
|
});
|
|
3610
3876
|
|
|
3611
3877
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
3612
|
-
var
|
|
3613
|
-
var MatchType =
|
|
3614
|
-
var BaseField3 =
|
|
3615
|
-
config:
|
|
3878
|
+
var z30 = __toESM(require("zod/v4"));
|
|
3879
|
+
var MatchType = z30.enum(["fuzzy", "exact", "range", "within"]);
|
|
3880
|
+
var BaseField3 = z30.object({
|
|
3881
|
+
config: z30.object({
|
|
3616
3882
|
type: MatchType.describe(
|
|
3617
3883
|
"Determines the search type of field. How to match value."
|
|
3618
3884
|
),
|
|
3619
|
-
searchFields:
|
|
3885
|
+
searchFields: z30.array(z30.string()).optional().describe(
|
|
3620
3886
|
`
|
|
3621
3887
|
Defines multiple form fields that should be searched when this field has a value.
|
|
3622
3888
|
All specified fields will be combined using OR logic.
|
|
@@ -3626,7 +3892,7 @@ var BaseField3 = z28.object({
|
|
|
3626
3892
|
`
|
|
3627
3893
|
)
|
|
3628
3894
|
}),
|
|
3629
|
-
type:
|
|
3895
|
+
type: z30.nativeEnum(FieldType).optional().describe(
|
|
3630
3896
|
`
|
|
3631
3897
|
Explicitly specify the field type for searchFields.
|
|
3632
3898
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -3640,7 +3906,7 @@ var BaseField3 = z28.object({
|
|
|
3640
3906
|
This is required when searchFields is defined.
|
|
3641
3907
|
`
|
|
3642
3908
|
),
|
|
3643
|
-
options:
|
|
3909
|
+
options: z30.array(SelectOption).optional(),
|
|
3644
3910
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
3645
3911
|
`
|
|
3646
3912
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -3661,7 +3927,7 @@ var BaseField3 = z28.object({
|
|
|
3661
3927
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
3662
3928
|
`
|
|
3663
3929
|
),
|
|
3664
|
-
conditionals:
|
|
3930
|
+
conditionals: z30.array(FieldConditional).optional().describe(
|
|
3665
3931
|
`
|
|
3666
3932
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
3667
3933
|
|
|
@@ -3675,23 +3941,23 @@ var BaseField3 = z28.object({
|
|
|
3675
3941
|
are always rendered in the advanced search form.
|
|
3676
3942
|
`
|
|
3677
3943
|
),
|
|
3678
|
-
validations:
|
|
3944
|
+
validations: z30.array(ValidationConfig).optional().describe(
|
|
3679
3945
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
3680
3946
|
),
|
|
3681
3947
|
allowedLocations: JurisdictionReference.optional().describe(
|
|
3682
3948
|
`Override the allowedLocations for a location field in advanced search. Use this when the declaration form's allowedLocations references a scope (e.g. record.create) that search-only users don't have \u2014 specify record.search scope instead.`
|
|
3683
3949
|
)
|
|
3684
3950
|
});
|
|
3685
|
-
var SearchQueryParams =
|
|
3686
|
-
eventType:
|
|
3951
|
+
var SearchQueryParams = z30.object({
|
|
3952
|
+
eventType: z30.string().optional().describe(
|
|
3687
3953
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
3688
3954
|
)
|
|
3689
3955
|
}).catchall(FieldValue);
|
|
3690
3956
|
var FieldConfigSchema = BaseField3.extend({
|
|
3691
|
-
fieldId:
|
|
3692
|
-
fieldType:
|
|
3957
|
+
fieldId: z30.string(),
|
|
3958
|
+
fieldType: z30.literal("field")
|
|
3693
3959
|
});
|
|
3694
|
-
var EventFieldIdInput =
|
|
3960
|
+
var EventFieldIdInput = z30.enum([
|
|
3695
3961
|
"trackingId",
|
|
3696
3962
|
"status",
|
|
3697
3963
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -3700,7 +3966,7 @@ var EventFieldIdInput = z28.enum([
|
|
|
3700
3966
|
"updatedAt"
|
|
3701
3967
|
]);
|
|
3702
3968
|
var METADATA_FIELD_PREFIX = "event.";
|
|
3703
|
-
var EventFieldId =
|
|
3969
|
+
var EventFieldId = z30.enum([
|
|
3704
3970
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
3705
3971
|
`${METADATA_FIELD_PREFIX}status`,
|
|
3706
3972
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -3710,162 +3976,53 @@ var EventFieldId = z28.enum([
|
|
|
3710
3976
|
]);
|
|
3711
3977
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
3712
3978
|
fieldId: EventFieldId,
|
|
3713
|
-
fieldType:
|
|
3979
|
+
fieldType: z30.literal("event")
|
|
3714
3980
|
});
|
|
3715
|
-
var AdvancedSearchField =
|
|
3981
|
+
var AdvancedSearchField = z30.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
3716
3982
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
3717
3983
|
if (!data.label) {
|
|
3718
3984
|
ctx.addIssue({
|
|
3719
|
-
code:
|
|
3985
|
+
code: z30.ZodIssueCode.custom,
|
|
3720
3986
|
message: "label is required when config.searchFields is defined.",
|
|
3721
3987
|
path: ["label"]
|
|
3722
3988
|
});
|
|
3723
3989
|
}
|
|
3724
3990
|
if (!data.type) {
|
|
3725
3991
|
ctx.addIssue({
|
|
3726
|
-
code:
|
|
3992
|
+
code: z30.ZodIssueCode.custom,
|
|
3727
3993
|
message: "type is required when config.searchFields is defined.",
|
|
3728
3994
|
path: ["type"]
|
|
3729
3995
|
});
|
|
3730
3996
|
}
|
|
3731
3997
|
}
|
|
3732
3998
|
});
|
|
3733
|
-
var AdvancedSearchConfig =
|
|
3999
|
+
var AdvancedSearchConfig = z30.object({
|
|
3734
4000
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3735
|
-
fields:
|
|
4001
|
+
fields: z30.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3736
4002
|
}).meta({
|
|
3737
4003
|
id: "AdvancedSearchConfig",
|
|
3738
4004
|
description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
|
|
3739
4005
|
});
|
|
3740
4006
|
|
|
3741
|
-
// ../commons/src/icons.ts
|
|
3742
|
-
var z29 = __toESM(require("zod/v4"));
|
|
3743
|
-
var AvailableIcons = z29.enum([
|
|
3744
|
-
"Archived",
|
|
3745
|
-
"Assigned",
|
|
3746
|
-
"Briefcase",
|
|
3747
|
-
"Certified",
|
|
3748
|
-
"Close",
|
|
3749
|
-
"Collapse",
|
|
3750
|
-
"Draft",
|
|
3751
|
-
"DuplicateYellow",
|
|
3752
|
-
"Expand",
|
|
3753
|
-
"ExternalValidate",
|
|
3754
|
-
"FilledCheck",
|
|
3755
|
-
"InReview",
|
|
3756
|
-
"Offline",
|
|
3757
|
-
"Registered",
|
|
3758
|
-
"RequiresUpdates",
|
|
3759
|
-
"Sent",
|
|
3760
|
-
"Validated",
|
|
3761
|
-
"WaitingApproval",
|
|
3762
|
-
"ChartActivity",
|
|
3763
|
-
"Activity",
|
|
3764
|
-
"Archive",
|
|
3765
|
-
"ArchiveTray",
|
|
3766
|
-
"ArrowLeft",
|
|
3767
|
-
"ArrowRight",
|
|
3768
|
-
"Buildings",
|
|
3769
|
-
"Circle",
|
|
3770
|
-
"CaretDown",
|
|
3771
|
-
"CaretLeft",
|
|
3772
|
-
"CaretRight",
|
|
3773
|
-
"ChartBar",
|
|
3774
|
-
"ChartLine",
|
|
3775
|
-
"ChatCircle",
|
|
3776
|
-
"CheckSquare",
|
|
3777
|
-
"Compass",
|
|
3778
|
-
"Check",
|
|
3779
|
-
"Copy",
|
|
3780
|
-
"Database",
|
|
3781
|
-
"DotsThreeVertical",
|
|
3782
|
-
"ArrowCounterClockwise",
|
|
3783
|
-
"MagnifyingGlassMinus",
|
|
3784
|
-
"MagnifyingGlassPlus",
|
|
3785
|
-
"Export",
|
|
3786
|
-
"Eye",
|
|
3787
|
-
"EyeSlash",
|
|
3788
|
-
"Envelope",
|
|
3789
|
-
"File",
|
|
3790
|
-
"FileLock",
|
|
3791
|
-
"FileSearch",
|
|
3792
|
-
"FileMinus",
|
|
3793
|
-
"FilePlus",
|
|
3794
|
-
"FileText",
|
|
3795
|
-
"FileX",
|
|
3796
|
-
"Handshake",
|
|
3797
|
-
"Gear",
|
|
3798
|
-
"GitBranch",
|
|
3799
|
-
"IdentificationCard",
|
|
3800
|
-
"List",
|
|
3801
|
-
"ListBullets",
|
|
3802
|
-
"Lock",
|
|
3803
|
-
"MagnifyingGlass",
|
|
3804
|
-
"MapPin",
|
|
3805
|
-
"Medal",
|
|
3806
|
-
"NotePencil",
|
|
3807
|
-
"Paperclip",
|
|
3808
|
-
"PaperPlaneTilt",
|
|
3809
|
-
"Pen",
|
|
3810
|
-
"PenNib",
|
|
3811
|
-
"Pencil",
|
|
3812
|
-
"PencilSimpleLine",
|
|
3813
|
-
"Phone",
|
|
3814
|
-
"Plus",
|
|
3815
|
-
"Printer",
|
|
3816
|
-
"SignOut",
|
|
3817
|
-
"Stamp",
|
|
3818
|
-
"Star",
|
|
3819
|
-
"Target",
|
|
3820
|
-
"TextT",
|
|
3821
|
-
"Trash",
|
|
3822
|
-
"UploadSimple",
|
|
3823
|
-
"User",
|
|
3824
|
-
"UserPlus",
|
|
3825
|
-
"Users",
|
|
3826
|
-
"WarningCircle",
|
|
3827
|
-
"X",
|
|
3828
|
-
"ChatText",
|
|
3829
|
-
"CircleWavyCheck",
|
|
3830
|
-
"CircleWavyQuestion",
|
|
3831
|
-
"ArchiveBox",
|
|
3832
|
-
"ArrowCircleDown",
|
|
3833
|
-
"FileArrowUp",
|
|
3834
|
-
"FileDotted",
|
|
3835
|
-
"Files",
|
|
3836
|
-
"PencilLine",
|
|
3837
|
-
"PencilCircle",
|
|
3838
|
-
"UserCircle",
|
|
3839
|
-
"Clock",
|
|
3840
|
-
"QrCode",
|
|
3841
|
-
"Webcam",
|
|
3842
|
-
"Sun",
|
|
3843
|
-
"DeviceTabletCamera",
|
|
3844
|
-
"Globe",
|
|
3845
|
-
"Fingerprint",
|
|
3846
|
-
"PushPin",
|
|
3847
|
-
"Timer"
|
|
3848
|
-
]);
|
|
3849
|
-
|
|
3850
4007
|
// ../commons/src/events/utils.ts
|
|
3851
4008
|
var import_lodash4 = require("lodash");
|
|
3852
4009
|
|
|
3853
4010
|
// ../commons/src/conditionals/validate.ts
|
|
3854
4011
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
3855
4012
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
3856
|
-
var
|
|
4013
|
+
var z34 = __toESM(require("zod/v4"));
|
|
3857
4014
|
var import_date_fns2 = require("date-fns");
|
|
3858
4015
|
|
|
3859
4016
|
// ../commons/src/events/FieldTypeMapping.ts
|
|
3860
|
-
var
|
|
4017
|
+
var z32 = __toESM(require("zod/v4"));
|
|
3861
4018
|
|
|
3862
4019
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
3863
|
-
var
|
|
4020
|
+
var z31 = __toESM(require("zod/v4"));
|
|
3864
4021
|
function getDynamicNameValue(field3) {
|
|
3865
4022
|
const nameConfiguration = field3.configuration?.name;
|
|
3866
4023
|
const firstnameRequired = nameConfiguration?.firstname?.required ?? field3.required;
|
|
3867
4024
|
const surnameRequired = nameConfiguration?.surname?.required ?? field3.required;
|
|
3868
|
-
return
|
|
4025
|
+
return z31.object({
|
|
3869
4026
|
firstname: firstnameRequired ? NonEmptyTextValue : TextValue,
|
|
3870
4027
|
surname: surnameRequired ? NonEmptyTextValue : TextValue,
|
|
3871
4028
|
middlename: nameConfiguration?.middlename?.required ? NonEmptyTextValue : TextValue.optional()
|
|
@@ -3896,7 +4053,7 @@ function mapFieldTypeToZod(field3, actionType) {
|
|
|
3896
4053
|
let schema;
|
|
3897
4054
|
switch (field3.type) {
|
|
3898
4055
|
case FieldType.FIELD_GROUP: {
|
|
3899
|
-
schema =
|
|
4056
|
+
schema = z32.object(
|
|
3900
4057
|
field3.fields.reduce((acc, subfield) => {
|
|
3901
4058
|
acc[subfield.id] = mapFieldTypeToZod(subfield, actionType);
|
|
3902
4059
|
return acc;
|
|
@@ -4221,7 +4378,7 @@ var isNonInteractiveFieldType = (field3) => {
|
|
|
4221
4378
|
var import_lodash3 = require("lodash");
|
|
4222
4379
|
|
|
4223
4380
|
// ../commons/src/utils.ts
|
|
4224
|
-
var
|
|
4381
|
+
var z33 = __toESM(require("zod/v4"));
|
|
4225
4382
|
var _ = __toESM(require("lodash"));
|
|
4226
4383
|
function getOrThrow(x, message) {
|
|
4227
4384
|
if (x === void 0 || x === null) {
|
|
@@ -4232,11 +4389,11 @@ function getOrThrow(x, message) {
|
|
|
4232
4389
|
function joinValues(values, separator = " ") {
|
|
4233
4390
|
return values.filter((value) => !!value).join(separator).trim();
|
|
4234
4391
|
}
|
|
4235
|
-
var FullNameV1 =
|
|
4236
|
-
|
|
4237
|
-
use:
|
|
4238
|
-
family:
|
|
4239
|
-
given:
|
|
4392
|
+
var FullNameV1 = z33.array(
|
|
4393
|
+
z33.object({
|
|
4394
|
+
use: z33.string(),
|
|
4395
|
+
family: z33.string(),
|
|
4396
|
+
given: z33.array(z33.string())
|
|
4240
4397
|
})
|
|
4241
4398
|
);
|
|
4242
4399
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -5460,9 +5617,9 @@ var ajv = new import__.default({
|
|
|
5460
5617
|
strict: false
|
|
5461
5618
|
// Allow minContains and other newer features
|
|
5462
5619
|
});
|
|
5463
|
-
var DataContext =
|
|
5464
|
-
rootData:
|
|
5465
|
-
$leafAdminStructureLocationIds:
|
|
5620
|
+
var DataContext = z34.object({
|
|
5621
|
+
rootData: z34.object({
|
|
5622
|
+
$leafAdminStructureLocationIds: z34.array(z34.object({ id: UUID }))
|
|
5466
5623
|
})
|
|
5467
5624
|
});
|
|
5468
5625
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -5500,18 +5657,14 @@ function compileClientFunction(code) {
|
|
|
5500
5657
|
}
|
|
5501
5658
|
(0, import_ajv_formats.default)(ajv);
|
|
5502
5659
|
function buildClientFunctionContext(input) {
|
|
5503
|
-
const flags = input.validatorContext?.event && input.validatorContext?.eventConfig ? getCurrentEventState(
|
|
5504
|
-
input.validatorContext?.event,
|
|
5505
|
-
input.validatorContext?.eventConfig
|
|
5506
|
-
)?.flags : [];
|
|
5507
5660
|
return {
|
|
5508
5661
|
$form: input.form,
|
|
5509
|
-
$flags: flags,
|
|
5662
|
+
$flags: input.validatorContext?.event?.state.flags ?? [],
|
|
5510
5663
|
$now: todayISO(),
|
|
5511
5664
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
5512
5665
|
$online: isOnline(),
|
|
5513
5666
|
$user: input.validatorContext?.user,
|
|
5514
|
-
$event: input.validatorContext?.event,
|
|
5667
|
+
$event: input.validatorContext?.event?.document,
|
|
5515
5668
|
$leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
|
|
5516
5669
|
user: input.systemVariables?.user,
|
|
5517
5670
|
$window: input.systemVariables?.$window,
|
|
@@ -5678,9 +5831,9 @@ function areConditionsMet(conditions, values, context, event2) {
|
|
|
5678
5831
|
(condition) => validate(condition.conditional, clientFunctionContext)
|
|
5679
5832
|
);
|
|
5680
5833
|
}
|
|
5681
|
-
function
|
|
5682
|
-
if (
|
|
5683
|
-
return
|
|
5834
|
+
function isFieldSecured(field3, event2, context = {}) {
|
|
5835
|
+
if (typeof field3.secured !== "object" || field3.secured === null) {
|
|
5836
|
+
return Boolean(field3.secured);
|
|
5684
5837
|
}
|
|
5685
5838
|
const clientFunctionContext = {
|
|
5686
5839
|
...buildClientFunctionContext({
|
|
@@ -5690,10 +5843,10 @@ function resolveEventIcon(iconConfig, event2, context) {
|
|
|
5690
5843
|
$flags: event2.flags,
|
|
5691
5844
|
$status: event2.status
|
|
5692
5845
|
};
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
return
|
|
5846
|
+
return validate(field3.secured, clientFunctionContext);
|
|
5847
|
+
}
|
|
5848
|
+
function getEventValidatorContext(document, config) {
|
|
5849
|
+
return { document, state: getCurrentEventState(document, config) };
|
|
5697
5850
|
}
|
|
5698
5851
|
function isFieldConditionMet(field3, form, conditionalType, context) {
|
|
5699
5852
|
const hasRule = (field3.conditionals ?? []).some(
|
|
@@ -6564,11 +6717,11 @@ function validateActionOrder(event2, ctx) {
|
|
|
6564
6717
|
}
|
|
6565
6718
|
|
|
6566
6719
|
// ../commons/src/events/EventConfig.ts
|
|
6567
|
-
var EventFieldReference =
|
|
6720
|
+
var EventFieldReference = z35.object({ $$event: EventMetadataDateFieldIdInput }).describe(
|
|
6568
6721
|
"Reference to a field defined in the event metadata, using the field id."
|
|
6569
6722
|
);
|
|
6570
|
-
var _EventConfigBase =
|
|
6571
|
-
id:
|
|
6723
|
+
var _EventConfigBase = z35.object({
|
|
6724
|
+
id: z35.string().describe(
|
|
6572
6725
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
6573
6726
|
),
|
|
6574
6727
|
dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
|
|
@@ -6587,25 +6740,25 @@ var _EventConfigBase = z34.object({
|
|
|
6587
6740
|
"Summary information displayed in the event overview."
|
|
6588
6741
|
),
|
|
6589
6742
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
6590
|
-
actions:
|
|
6743
|
+
actions: z35.array(ActionConfig).describe(
|
|
6591
6744
|
"Configuration of core and custom actions associated with the event."
|
|
6592
6745
|
),
|
|
6593
|
-
actionOrder:
|
|
6746
|
+
actionOrder: z35.array(z35.string()).optional().describe(
|
|
6594
6747
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
6595
6748
|
),
|
|
6596
6749
|
declaration: DeclarationFormConfig.describe(
|
|
6597
6750
|
"Configuration of the form used to gather event data."
|
|
6598
6751
|
),
|
|
6599
|
-
advancedSearch:
|
|
6752
|
+
advancedSearch: z35.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
6600
6753
|
"Configuration of fields available in the advanced search feature."
|
|
6601
6754
|
),
|
|
6602
|
-
flags:
|
|
6755
|
+
flags: z35.array(FlagConfig).optional().default([]).describe(
|
|
6603
6756
|
"Configuration of custom flags associated with the actions of this event type."
|
|
6604
6757
|
),
|
|
6605
|
-
analytics:
|
|
6758
|
+
analytics: z35.boolean().optional().default(true).describe(
|
|
6606
6759
|
"Indicates whether the records of this event type are included in analytics"
|
|
6607
6760
|
),
|
|
6608
|
-
icon:
|
|
6761
|
+
icon: z35.partialRecord(AvailableIcons, Conditional).optional().describe(
|
|
6609
6762
|
'Maps an icon name to a conditional. The icon of the first entry (in definition order) whose conditional matches the event is used when rendering it (e.g. in the "iconWithName"/"iconWithNameEvent" workqueue columns). Falls back to the default status-based icon when unset or when no conditional matches.'
|
|
6610
6763
|
)
|
|
6611
6764
|
});
|
|
@@ -6627,7 +6780,7 @@ var definePage = (page) => PageConfig.parse(page);
|
|
|
6627
6780
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
6628
6781
|
|
|
6629
6782
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
6630
|
-
var
|
|
6783
|
+
var z38 = __toESM(require("zod/v4"));
|
|
6631
6784
|
|
|
6632
6785
|
// ../commons/src/searchConfigs.ts
|
|
6633
6786
|
function createSearchConfig(baseField) {
|
|
@@ -6838,17 +6991,17 @@ var event = Object.assign(eventFn, {
|
|
|
6838
6991
|
});
|
|
6839
6992
|
|
|
6840
6993
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
6841
|
-
var
|
|
6994
|
+
var z36 = __toESM(require("zod/v4"));
|
|
6842
6995
|
var WorkqueueColumnKeysArray = [
|
|
6843
6996
|
...EventMetadataKeysArray,
|
|
6844
6997
|
"title",
|
|
6845
6998
|
"outbox"
|
|
6846
6999
|
];
|
|
6847
|
-
var WorkqueueColumnKeys =
|
|
6848
|
-
var WorkqueueColumnValue =
|
|
7000
|
+
var WorkqueueColumnKeys = z36.enum(WorkqueueColumnKeysArray);
|
|
7001
|
+
var WorkqueueColumnValue = z36.object({
|
|
6849
7002
|
$event: WorkqueueColumnKeys
|
|
6850
7003
|
});
|
|
6851
|
-
var WorkqueueColumn =
|
|
7004
|
+
var WorkqueueColumn = z36.object({
|
|
6852
7005
|
label: TranslationConfig,
|
|
6853
7006
|
value: WorkqueueColumnValue
|
|
6854
7007
|
}).meta({
|
|
@@ -6862,51 +7015,51 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
6862
7015
|
}
|
|
6863
7016
|
|
|
6864
7017
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
6865
|
-
var
|
|
6866
|
-
var SerializableExact =
|
|
6867
|
-
type:
|
|
6868
|
-
term:
|
|
6869
|
-
});
|
|
6870
|
-
var SerializableWithin =
|
|
6871
|
-
type:
|
|
6872
|
-
location:
|
|
6873
|
-
});
|
|
6874
|
-
var SerializedQueryExpression =
|
|
6875
|
-
eventType:
|
|
6876
|
-
status:
|
|
6877
|
-
createdAt:
|
|
6878
|
-
updatedAt:
|
|
6879
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
6880
|
-
"legalStatuses.DECLARED.createdByRole":
|
|
6881
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
6882
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
6883
|
-
"legalStatuses.REGISTERED.createdByRole":
|
|
6884
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
6885
|
-
createdAtLocation:
|
|
6886
|
-
|
|
7018
|
+
var z37 = __toESM(require("zod/v4"));
|
|
7019
|
+
var SerializableExact = z37.object({
|
|
7020
|
+
type: z37.literal("exact"),
|
|
7021
|
+
term: z37.union([z37.string(), SerializedUserField])
|
|
7022
|
+
});
|
|
7023
|
+
var SerializableWithin = z37.object({
|
|
7024
|
+
type: z37.literal("within"),
|
|
7025
|
+
location: z37.union([z37.string(), SerializedUserField])
|
|
7026
|
+
});
|
|
7027
|
+
var SerializedQueryExpression = z37.object({
|
|
7028
|
+
eventType: z37.string(),
|
|
7029
|
+
status: z37.optional(z37.union([AnyOfStatus, ExactStatus])),
|
|
7030
|
+
createdAt: z37.optional(DateCondition),
|
|
7031
|
+
updatedAt: z37.optional(DateCondition),
|
|
7032
|
+
"legalStatuses.DECLARED.createdAtLocation": z37.optional(SerializableWithin),
|
|
7033
|
+
"legalStatuses.DECLARED.createdByRole": z37.optional(AnyOf),
|
|
7034
|
+
"legalStatuses.REGISTERED.createdAt": z37.optional(DateCondition),
|
|
7035
|
+
"legalStatuses.REGISTERED.createdAtLocation": z37.optional(SerializableWithin),
|
|
7036
|
+
"legalStatuses.REGISTERED.createdByRole": z37.optional(AnyOf),
|
|
7037
|
+
"legalStatuses.REGISTERED.registrationNumber": z37.optional(Exact),
|
|
7038
|
+
createdAtLocation: z37.optional(
|
|
7039
|
+
z37.union([SerializableWithin, SerializableExact])
|
|
6887
7040
|
),
|
|
6888
|
-
updatedAtLocation:
|
|
6889
|
-
|
|
7041
|
+
updatedAtLocation: z37.optional(
|
|
7042
|
+
z37.union([SerializableWithin, SerializableExact])
|
|
6890
7043
|
),
|
|
6891
|
-
updatedByUserRole:
|
|
6892
|
-
assignedTo:
|
|
6893
|
-
createdBy:
|
|
7044
|
+
updatedByUserRole: z37.optional(SerializableExact),
|
|
7045
|
+
assignedTo: z37.optional(SerializableExact),
|
|
7046
|
+
createdBy: z37.optional(SerializableExact),
|
|
6894
7047
|
createdByUserType: ExactUserType,
|
|
6895
|
-
updatedBy:
|
|
6896
|
-
trackingId:
|
|
6897
|
-
flags:
|
|
7048
|
+
updatedBy: z37.optional(SerializableExact),
|
|
7049
|
+
trackingId: z37.optional(Exact),
|
|
7050
|
+
flags: z37.optional(ContainsFlags),
|
|
6898
7051
|
data: QueryInput
|
|
6899
7052
|
}).partial();
|
|
6900
|
-
var Or2 =
|
|
6901
|
-
type:
|
|
6902
|
-
clauses:
|
|
7053
|
+
var Or2 = z37.object({
|
|
7054
|
+
type: z37.literal("or"),
|
|
7055
|
+
clauses: z37.array(SerializedQueryExpression)
|
|
6903
7056
|
});
|
|
6904
|
-
var And2 =
|
|
6905
|
-
type:
|
|
6906
|
-
clauses:
|
|
7057
|
+
var And2 = z37.object({
|
|
7058
|
+
type: z37.literal("and"),
|
|
7059
|
+
clauses: z37.array(SerializedQueryExpression)
|
|
6907
7060
|
});
|
|
6908
|
-
var CountryConfigQueryType =
|
|
6909
|
-
var CountryConfigQueryInputType =
|
|
7061
|
+
var CountryConfigQueryType = z37.discriminatedUnion("type", [And2, Or2]);
|
|
7062
|
+
var CountryConfigQueryInputType = z37.union([
|
|
6910
7063
|
SerializedQueryExpression,
|
|
6911
7064
|
And2,
|
|
6912
7065
|
Or2
|
|
@@ -6931,16 +7084,16 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
6931
7084
|
value: event.field("updatedAt")
|
|
6932
7085
|
}
|
|
6933
7086
|
]);
|
|
6934
|
-
var WorkqueueConfig =
|
|
6935
|
-
slug:
|
|
7087
|
+
var WorkqueueConfig = z38.object({
|
|
7088
|
+
slug: z38.string().describe("Determines the url of the workqueue."),
|
|
6936
7089
|
name: TranslationConfig.describe(
|
|
6937
7090
|
"Title of the workflow (both in navigation and on the page)"
|
|
6938
7091
|
),
|
|
6939
7092
|
query: CountryConfigQueryType,
|
|
6940
|
-
action:
|
|
7093
|
+
action: z38.object({ type: WorkqueueActionType }).optional().describe(
|
|
6941
7094
|
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
6942
7095
|
),
|
|
6943
|
-
columns:
|
|
7096
|
+
columns: z38.array(WorkqueueColumn).default(mandatoryColumns),
|
|
6944
7097
|
icon: AvailableIcons,
|
|
6945
7098
|
emptyMessage: TranslationConfig.optional()
|
|
6946
7099
|
}).describe("Configuration for workqueue.");
|
|
@@ -6975,10 +7128,10 @@ function defineWorkqueues(workqueues) {
|
|
|
6975
7128
|
workqueues.forEach(warnOnConfigurationIssues);
|
|
6976
7129
|
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
|
6977
7130
|
}
|
|
6978
|
-
var WorkqueueCountInput =
|
|
6979
|
-
|
|
7131
|
+
var WorkqueueCountInput = z38.array(
|
|
7132
|
+
z38.object({ slug: z38.string(), query: QueryType })
|
|
6980
7133
|
);
|
|
6981
|
-
var WorkqueueCountOutput =
|
|
7134
|
+
var WorkqueueCountOutput = z38.record(z38.string(), z38.number());
|
|
6982
7135
|
|
|
6983
7136
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
6984
7137
|
var defaultWorkqueueColumns = [
|
|
@@ -7001,21 +7154,21 @@ var defaultWorkqueueColumns = [
|
|
|
7001
7154
|
];
|
|
7002
7155
|
|
|
7003
7156
|
// ../commons/src/events/Draft.ts
|
|
7004
|
-
var
|
|
7157
|
+
var z40 = __toESM(require("zod/v4"));
|
|
7005
7158
|
|
|
7006
7159
|
// ../commons/src/events/ActionInput.ts
|
|
7007
|
-
var
|
|
7008
|
-
var BaseActionInput =
|
|
7160
|
+
var z39 = __toESM(require("zod/v4"));
|
|
7161
|
+
var BaseActionInput = z39.object({
|
|
7009
7162
|
eventId: UUID,
|
|
7010
|
-
transactionId:
|
|
7163
|
+
transactionId: z39.string(),
|
|
7011
7164
|
declaration: ActionUpdate.default({}),
|
|
7012
7165
|
annotation: ActionUpdate.optional(),
|
|
7013
7166
|
originalActionId: UUID.optional(),
|
|
7014
7167
|
// should not be part of base action.
|
|
7015
|
-
keepAssignment:
|
|
7016
|
-
keepAssignmentIfAccepted:
|
|
7017
|
-
keepAssignmentIfRejected:
|
|
7018
|
-
waitFor:
|
|
7168
|
+
keepAssignment: z39.boolean().optional(),
|
|
7169
|
+
keepAssignmentIfAccepted: z39.boolean().optional(),
|
|
7170
|
+
keepAssignmentIfRejected: z39.boolean().optional(),
|
|
7171
|
+
waitFor: z39.boolean().default(true).describe(
|
|
7019
7172
|
"Whether action waits for the indexing before returning. Defaults to true. Setting this to to false completes faster but might lead to stale data in the client if the client tries to read the event immediately after performing the action. Use with care."
|
|
7020
7173
|
),
|
|
7021
7174
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
@@ -7025,8 +7178,8 @@ var BaseActionInput = z38.object({
|
|
|
7025
7178
|
)
|
|
7026
7179
|
});
|
|
7027
7180
|
var CreateActionInput = BaseActionInput.extend(
|
|
7028
|
-
|
|
7029
|
-
type:
|
|
7181
|
+
z39.object({
|
|
7182
|
+
type: z39.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
7030
7183
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
7031
7184
|
createdAtLocation: UUID.nullish().describe(
|
|
7032
7185
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
@@ -7034,14 +7187,14 @@ var CreateActionInput = BaseActionInput.extend(
|
|
|
7034
7187
|
}).shape
|
|
7035
7188
|
);
|
|
7036
7189
|
var RegisterActionInput = BaseActionInput.extend(
|
|
7037
|
-
|
|
7038
|
-
type:
|
|
7039
|
-
registrationNumber:
|
|
7190
|
+
z39.strictObject({
|
|
7191
|
+
type: z39.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
7192
|
+
registrationNumber: z39.string().optional()
|
|
7040
7193
|
}).shape
|
|
7041
7194
|
);
|
|
7042
7195
|
var NotifyActionInput = BaseActionInput.extend(
|
|
7043
|
-
|
|
7044
|
-
type:
|
|
7196
|
+
z39.object({
|
|
7197
|
+
type: z39.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
|
|
7045
7198
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
7046
7199
|
createdAtLocation: UUID.nullish().describe(
|
|
7047
7200
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
@@ -7057,103 +7210,107 @@ var NotifyActionInput = BaseActionInput.extend(
|
|
|
7057
7210
|
}
|
|
7058
7211
|
});
|
|
7059
7212
|
var DeclareActionInput = BaseActionInput.extend(
|
|
7060
|
-
|
|
7061
|
-
type:
|
|
7213
|
+
z39.object({
|
|
7214
|
+
type: z39.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
7062
7215
|
}).shape
|
|
7063
7216
|
);
|
|
7064
7217
|
var EditActionInput = BaseActionInput.extend(
|
|
7065
|
-
|
|
7066
|
-
type:
|
|
7218
|
+
z39.object({
|
|
7219
|
+
type: z39.literal(ActionType.EDIT).default(ActionType.EDIT)
|
|
7067
7220
|
}).shape
|
|
7068
7221
|
);
|
|
7069
7222
|
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
7070
|
-
|
|
7071
|
-
type:
|
|
7223
|
+
z39.object({
|
|
7224
|
+
type: z39.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
7072
7225
|
content: PrintContent.optional()
|
|
7073
7226
|
}).shape
|
|
7074
7227
|
);
|
|
7075
7228
|
var RejectDeclarationActionInput = BaseActionInput.extend(
|
|
7076
|
-
|
|
7077
|
-
type:
|
|
7229
|
+
z39.object({
|
|
7230
|
+
type: z39.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
7078
7231
|
content: ReasonContent
|
|
7079
7232
|
}).shape
|
|
7080
7233
|
);
|
|
7081
7234
|
var DuplicateDetectedActionInput = BaseActionInput.extend(
|
|
7082
|
-
|
|
7083
|
-
type:
|
|
7084
|
-
content:
|
|
7085
|
-
duplicates:
|
|
7235
|
+
z39.object({
|
|
7236
|
+
type: z39.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
7237
|
+
content: z39.object({
|
|
7238
|
+
duplicates: z39.array(PotentialDuplicate)
|
|
7086
7239
|
})
|
|
7087
7240
|
}).shape
|
|
7088
7241
|
);
|
|
7089
7242
|
var MarkAsDuplicateActionInput = BaseActionInput.extend(
|
|
7090
|
-
|
|
7091
|
-
type:
|
|
7092
|
-
content:
|
|
7243
|
+
z39.object({
|
|
7244
|
+
type: z39.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
7245
|
+
content: z39.object({
|
|
7093
7246
|
duplicateOf: UUID
|
|
7094
7247
|
}).optional()
|
|
7095
7248
|
}).shape
|
|
7096
7249
|
);
|
|
7097
7250
|
var MarkNotDuplicateActionInput = BaseActionInput.extend(
|
|
7098
|
-
|
|
7099
|
-
type:
|
|
7251
|
+
z39.object({
|
|
7252
|
+
type: z39.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
7100
7253
|
}).shape
|
|
7101
7254
|
);
|
|
7102
7255
|
var ArchiveActionInput = BaseActionInput.extend(
|
|
7103
|
-
|
|
7104
|
-
type:
|
|
7105
|
-
|
|
7256
|
+
z39.object({
|
|
7257
|
+
type: z39.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
7258
|
+
/**
|
|
7259
|
+
* Archiving does not collect a reason on its own. Only the
|
|
7260
|
+
* "mark as duplicate" flow archives with a reason attached.
|
|
7261
|
+
*/
|
|
7262
|
+
content: ReasonContent.optional()
|
|
7106
7263
|
}).shape
|
|
7107
7264
|
);
|
|
7108
7265
|
var UnarchiveActionInput = BaseActionInput.extend(
|
|
7109
|
-
|
|
7110
|
-
type:
|
|
7266
|
+
z39.object({
|
|
7267
|
+
type: z39.literal(ActionType.UNARCHIVE).default(ActionType.UNARCHIVE)
|
|
7111
7268
|
}).shape
|
|
7112
7269
|
);
|
|
7113
7270
|
var AssignActionInput = BaseActionInput.extend(
|
|
7114
|
-
|
|
7115
|
-
type:
|
|
7116
|
-
assignedTo:
|
|
7271
|
+
z39.object({
|
|
7272
|
+
type: z39.literal(ActionType.ASSIGN),
|
|
7273
|
+
assignedTo: z39.string()
|
|
7117
7274
|
}).shape
|
|
7118
7275
|
);
|
|
7119
7276
|
var UnassignActionInput = BaseActionInput.extend(
|
|
7120
|
-
|
|
7121
|
-
type:
|
|
7122
|
-
assignedTo:
|
|
7277
|
+
z39.object({
|
|
7278
|
+
type: z39.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
7279
|
+
assignedTo: z39.literal(null).default(null)
|
|
7123
7280
|
}).shape
|
|
7124
7281
|
);
|
|
7125
7282
|
var RequestCorrectionActionInput = BaseActionInput.extend(
|
|
7126
|
-
|
|
7127
|
-
type:
|
|
7283
|
+
z39.object({
|
|
7284
|
+
type: z39.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
7128
7285
|
}).shape
|
|
7129
7286
|
);
|
|
7130
7287
|
var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
7131
|
-
|
|
7132
|
-
requestId:
|
|
7133
|
-
type:
|
|
7288
|
+
z39.object({
|
|
7289
|
+
requestId: z39.string(),
|
|
7290
|
+
type: z39.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
7134
7291
|
content: ReasonContent
|
|
7135
7292
|
}).shape
|
|
7136
7293
|
);
|
|
7137
7294
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
7138
|
-
|
|
7139
|
-
requestId:
|
|
7140
|
-
type:
|
|
7141
|
-
content:
|
|
7295
|
+
z39.object({
|
|
7296
|
+
requestId: z39.string(),
|
|
7297
|
+
type: z39.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
7298
|
+
content: z39.object({ immediateCorrection: z39.boolean().optional() }).optional()
|
|
7142
7299
|
}).shape
|
|
7143
7300
|
);
|
|
7144
7301
|
var ReadActionInput = BaseActionInput.extend(
|
|
7145
|
-
|
|
7146
|
-
type:
|
|
7302
|
+
z39.object({
|
|
7303
|
+
type: z39.literal(ActionType.READ).default(ActionType.READ)
|
|
7147
7304
|
}).shape
|
|
7148
7305
|
);
|
|
7149
|
-
var DeleteActionInput =
|
|
7306
|
+
var DeleteActionInput = z39.object({ eventId: UUID });
|
|
7150
7307
|
var CustomActionInput = BaseActionInput.extend(
|
|
7151
|
-
|
|
7152
|
-
type:
|
|
7153
|
-
customActionType:
|
|
7308
|
+
z39.object({
|
|
7309
|
+
type: z39.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
|
|
7310
|
+
customActionType: z39.string().describe("Name of the custom action.")
|
|
7154
7311
|
}).shape
|
|
7155
7312
|
);
|
|
7156
|
-
var ActionInput =
|
|
7313
|
+
var ActionInput = z39.discriminatedUnion("type", [
|
|
7157
7314
|
CreateActionInput.meta({ id: "CreateActionInput" }),
|
|
7158
7315
|
RegisterActionInput.meta({ id: "RegisterActionInput" }),
|
|
7159
7316
|
NotifyActionInput.meta({ id: "NotifyActionInput" }),
|
|
@@ -7190,11 +7347,11 @@ var ActionInput = z38.discriminatedUnion("type", [
|
|
|
7190
7347
|
});
|
|
7191
7348
|
|
|
7192
7349
|
// ../commons/src/events/Draft.ts
|
|
7193
|
-
var Draft =
|
|
7350
|
+
var Draft = z40.object({
|
|
7194
7351
|
id: UUID,
|
|
7195
7352
|
eventId: UUID,
|
|
7196
|
-
transactionId:
|
|
7197
|
-
createdAt:
|
|
7353
|
+
transactionId: z40.string(),
|
|
7354
|
+
createdAt: z40.string().datetime(),
|
|
7198
7355
|
action: ActionBase.extend({
|
|
7199
7356
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE])
|
|
7200
7357
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -7203,7 +7360,7 @@ var Draft = z39.object({
|
|
|
7203
7360
|
);
|
|
7204
7361
|
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
7205
7362
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
7206
|
-
status:
|
|
7363
|
+
status: z40.enum([
|
|
7207
7364
|
ActionStatus.Requested,
|
|
7208
7365
|
ActionStatus.Accepted,
|
|
7209
7366
|
ActionStatus.Rejected
|
|
@@ -7211,30 +7368,33 @@ var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
|
7211
7368
|
});
|
|
7212
7369
|
|
|
7213
7370
|
// ../commons/src/events/EventInput.ts
|
|
7214
|
-
var
|
|
7371
|
+
var z41 = __toESM(require("zod/v4"));
|
|
7215
7372
|
var import_uuid11 = require("uuid");
|
|
7216
|
-
var EventInput =
|
|
7217
|
-
transactionId:
|
|
7218
|
-
type:
|
|
7373
|
+
var EventInput = z41.object({
|
|
7374
|
+
transactionId: z41.string(),
|
|
7375
|
+
type: z41.string(),
|
|
7219
7376
|
createdAtLocation: UUID.nullish().describe(
|
|
7220
7377
|
"Location where the event occurred. Required for system users."
|
|
7221
7378
|
)
|
|
7222
7379
|
}).meta({ default: { transactionId: (0, import_uuid11.v4)(), type: "birth" } });
|
|
7223
7380
|
|
|
7224
7381
|
// ../commons/src/events/EventDocument.ts
|
|
7225
|
-
var
|
|
7226
|
-
var EventDocument =
|
|
7382
|
+
var z42 = __toESM(require("zod/v4"));
|
|
7383
|
+
var EventDocument = z42.object({
|
|
7227
7384
|
id: UUID.describe("Unique identifier of the event."),
|
|
7228
|
-
type:
|
|
7229
|
-
createdAt:
|
|
7230
|
-
updatedAt:
|
|
7385
|
+
type: z42.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
7386
|
+
createdAt: z42.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
7387
|
+
updatedAt: z42.string().datetime().describe(
|
|
7231
7388
|
"Timestamp of the last update, excluding changes from actions."
|
|
7232
7389
|
),
|
|
7233
|
-
actions:
|
|
7234
|
-
trackingId:
|
|
7390
|
+
actions: z42.array(Action).describe("Ordered list of actions associated with the event."),
|
|
7391
|
+
trackingId: z42.string().describe(
|
|
7235
7392
|
"System-generated tracking identifier used to look up the event."
|
|
7236
7393
|
)
|
|
7237
7394
|
}).meta({ id: "EventDocument" });
|
|
7395
|
+
var EventDocumentOnlyLastAction = EventDocument.extend({
|
|
7396
|
+
actions: z42.array(Action).max(1).describe("Only the last action associated with the event.")
|
|
7397
|
+
}).brand("EventDocumentOnlyLastAction");
|
|
7238
7398
|
|
|
7239
7399
|
// ../commons/src/events/defineConfig.ts
|
|
7240
7400
|
var IGNORED_EVENT_TYPES = [
|
|
@@ -9693,9 +9853,9 @@ var digitalIdentityEvent = defineConfig({
|
|
|
9693
9853
|
});
|
|
9694
9854
|
|
|
9695
9855
|
// ../commons/src/events/test.utils.ts
|
|
9696
|
-
var
|
|
9856
|
+
var z43 = __toESM(require("zod/v4"));
|
|
9697
9857
|
var TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
|
9698
|
-
var TestUserRole =
|
|
9858
|
+
var TestUserRole = z43.enum([
|
|
9699
9859
|
"FIELD_AGENT",
|
|
9700
9860
|
"LOCAL_REGISTRAR",
|
|
9701
9861
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -9765,6 +9925,16 @@ function generateRegistrationNumber(rng) {
|
|
|
9765
9925
|
function generateRandomSignature(rng) {
|
|
9766
9926
|
return `${generateUuid(rng)}.png`;
|
|
9767
9927
|
}
|
|
9928
|
+
function locationVersion(overrides = {}, rng) {
|
|
9929
|
+
return {
|
|
9930
|
+
versionId: generateUuid(rng),
|
|
9931
|
+
effectiveFrom: "0001-01-01",
|
|
9932
|
+
name: "Location name",
|
|
9933
|
+
externalId: null,
|
|
9934
|
+
status: "active",
|
|
9935
|
+
...overrides
|
|
9936
|
+
};
|
|
9937
|
+
}
|
|
9768
9938
|
function mapFieldTypeToMockValue(field3, i, rng, administrativeHierarchy) {
|
|
9769
9939
|
const leafLevelAdministrativeAreas = administrativeHierarchy?.administrativeAreas.filter(
|
|
9770
9940
|
(aa) => administrativeHierarchy?.administrativeAreas.every(
|
|
@@ -10080,9 +10250,6 @@ function eventPayloadGenerator(rng, configuration = tennisClubMembershipEvent) {
|
|
|
10080
10250
|
declaration: {},
|
|
10081
10251
|
annotation: {},
|
|
10082
10252
|
eventId,
|
|
10083
|
-
content: {
|
|
10084
|
-
reason: `${ActionType.ARCHIVE}`
|
|
10085
|
-
},
|
|
10086
10253
|
...input
|
|
10087
10254
|
}),
|
|
10088
10255
|
unarchive: (eventId, input = {}) => ({
|
|
@@ -10553,49 +10720,94 @@ function isFieldConfigDefaultValue(value) {
|
|
|
10553
10720
|
var import_lodash6 = require("lodash");
|
|
10554
10721
|
|
|
10555
10722
|
// ../commons/src/events/locations.ts
|
|
10556
|
-
var
|
|
10557
|
-
var LocationTypeV1 =
|
|
10723
|
+
var z44 = __toESM(require("zod/v4"));
|
|
10724
|
+
var LocationTypeV1 = z44.enum([
|
|
10558
10725
|
"ADMIN_STRUCTURE",
|
|
10559
10726
|
"CRVS_OFFICE",
|
|
10560
10727
|
"HEALTH_FACILITY"
|
|
10561
10728
|
]);
|
|
10562
|
-
var LocationStatus =
|
|
10563
|
-
var LocationVersion =
|
|
10729
|
+
var LocationStatus = z44.enum(["active", "inactive"]);
|
|
10730
|
+
var LocationVersion = z44.object({
|
|
10564
10731
|
versionId: UUID,
|
|
10565
|
-
effectiveFrom:
|
|
10566
|
-
name:
|
|
10567
|
-
externalId:
|
|
10732
|
+
effectiveFrom: z44.iso.date(),
|
|
10733
|
+
name: z44.string(),
|
|
10734
|
+
externalId: z44.string().nullish(),
|
|
10568
10735
|
status: LocationStatus
|
|
10569
10736
|
});
|
|
10570
|
-
var AdministrativeArea =
|
|
10737
|
+
var AdministrativeArea = z44.object({
|
|
10571
10738
|
id: UUID,
|
|
10572
|
-
name:
|
|
10573
|
-
externalId:
|
|
10739
|
+
name: z44.string(),
|
|
10740
|
+
externalId: z44.string().nullish(),
|
|
10574
10741
|
parentId: UUID.nullable(),
|
|
10575
10742
|
status: LocationStatus,
|
|
10576
|
-
versions:
|
|
10743
|
+
versions: z44.array(LocationVersion)
|
|
10577
10744
|
});
|
|
10578
|
-
var Location =
|
|
10745
|
+
var Location = z44.object({
|
|
10579
10746
|
id: UUID,
|
|
10580
|
-
name:
|
|
10581
|
-
externalId:
|
|
10747
|
+
name: z44.string(),
|
|
10748
|
+
externalId: z44.string().nullish(),
|
|
10582
10749
|
administrativeAreaId: UUID.nullable(),
|
|
10583
|
-
locationType:
|
|
10750
|
+
locationType: z44.string().nullable(),
|
|
10584
10751
|
status: LocationStatus,
|
|
10585
|
-
versions:
|
|
10752
|
+
versions: z44.array(LocationVersion)
|
|
10753
|
+
});
|
|
10754
|
+
var ClientAdministrativeArea = AdministrativeArea.omit({
|
|
10755
|
+
name: true,
|
|
10756
|
+
status: true,
|
|
10757
|
+
externalId: true
|
|
10758
|
+
});
|
|
10759
|
+
var ClientLocation = Location.omit({
|
|
10760
|
+
name: true,
|
|
10761
|
+
status: true,
|
|
10762
|
+
externalId: true
|
|
10586
10763
|
});
|
|
10587
|
-
|
|
10764
|
+
function toClientLocation(location) {
|
|
10765
|
+
return {
|
|
10766
|
+
id: location.id,
|
|
10767
|
+
administrativeAreaId: location.administrativeAreaId,
|
|
10768
|
+
locationType: location.locationType,
|
|
10769
|
+
versions: location.versions
|
|
10770
|
+
};
|
|
10771
|
+
}
|
|
10772
|
+
function toClientAdministrativeArea(area) {
|
|
10773
|
+
return {
|
|
10774
|
+
id: area.id,
|
|
10775
|
+
parentId: area.parentId,
|
|
10776
|
+
versions: area.versions
|
|
10777
|
+
};
|
|
10778
|
+
}
|
|
10779
|
+
function validateAscendingDates(versions, ctx) {
|
|
10780
|
+
const ascending = versions.every(
|
|
10781
|
+
(version, index) => index === 0 || versions[index - 1].effectiveFrom < version.effectiveFrom
|
|
10782
|
+
);
|
|
10783
|
+
if (!ascending) {
|
|
10784
|
+
ctx.addIssue("versions must be strictly ascending by effectiveFrom");
|
|
10785
|
+
}
|
|
10786
|
+
}
|
|
10787
|
+
function validateUniqueIds(versions, ctx) {
|
|
10788
|
+
const versionIds = new Set(versions.map((version) => version.versionId));
|
|
10789
|
+
if (versionIds.size !== versions.length) {
|
|
10790
|
+
ctx.addIssue("versions must not repeat a versionId");
|
|
10791
|
+
}
|
|
10792
|
+
}
|
|
10793
|
+
var SeededLocationVersions = z44.array(LocationVersion).min(1).superRefine((versions, ctx) => {
|
|
10794
|
+
validateAscendingDates(versions, ctx);
|
|
10795
|
+
validateUniqueIds(versions, ctx);
|
|
10796
|
+
});
|
|
10797
|
+
var SetLocationPayload = z44.object({
|
|
10588
10798
|
id: UUID,
|
|
10589
|
-
name:
|
|
10590
|
-
externalId:
|
|
10799
|
+
name: z44.string(),
|
|
10800
|
+
externalId: z44.string().nullish(),
|
|
10591
10801
|
administrativeAreaId: UUID.nullable(),
|
|
10592
|
-
locationType:
|
|
10802
|
+
locationType: z44.string().nullable(),
|
|
10803
|
+
versions: SeededLocationVersions.optional()
|
|
10593
10804
|
});
|
|
10594
|
-
var SetAdministrativeAreaPayload =
|
|
10805
|
+
var SetAdministrativeAreaPayload = z44.object({
|
|
10595
10806
|
id: UUID,
|
|
10596
|
-
name:
|
|
10597
|
-
externalId:
|
|
10598
|
-
parentId: UUID.nullable()
|
|
10807
|
+
name: z44.string(),
|
|
10808
|
+
externalId: z44.string().nullish(),
|
|
10809
|
+
parentId: UUID.nullable(),
|
|
10810
|
+
versions: SeededLocationVersions.optional()
|
|
10599
10811
|
});
|
|
10600
10812
|
function resolveVersion(versions, anchor) {
|
|
10601
10813
|
let resolved = versions[0];
|
|
@@ -10606,6 +10818,9 @@ function resolveVersion(versions, anchor) {
|
|
|
10606
10818
|
}
|
|
10607
10819
|
return resolved;
|
|
10608
10820
|
}
|
|
10821
|
+
function isSelectableAtAnchor(versions, anchor) {
|
|
10822
|
+
return versions.some((version) => version.effectiveFrom <= anchor) && resolveVersion(versions, anchor).status === "active";
|
|
10823
|
+
}
|
|
10609
10824
|
function hasActiveExternalIdOnOrAfter(versions, externalId, anchor) {
|
|
10610
10825
|
const inEffectAtAnchor = resolveVersion(versions, anchor);
|
|
10611
10826
|
const laterVersions = versions.filter((v) => v.effectiveFrom > anchor);
|
|
@@ -10661,6 +10876,9 @@ function canAccessEventWithScope(event2, scope, user2, customActionType) {
|
|
|
10661
10876
|
}
|
|
10662
10877
|
if (scopeUsesDeclaredOptions(scope)) {
|
|
10663
10878
|
const { options } = scope;
|
|
10879
|
+
if (options?.status && (!event2.status || !options.status.includes(event2.status))) {
|
|
10880
|
+
return false;
|
|
10881
|
+
}
|
|
10664
10882
|
if (options?.notifiedBy === UserFilter.enum.user) {
|
|
10665
10883
|
if (event2.legalStatuses?.NOTIFIED?.createdBy !== user2.id) {
|
|
10666
10884
|
return false;
|
|
@@ -10804,6 +11022,16 @@ function getLocationHierarchy(selectedId, context) {
|
|
|
10804
11022
|
);
|
|
10805
11023
|
return hierarchy.reverse().map((area) => area.id);
|
|
10806
11024
|
}
|
|
11025
|
+
function resolvePath(locationId, anchor, context) {
|
|
11026
|
+
return getLocationHierarchy(locationId, context).flatMap((id) => {
|
|
11027
|
+
const node = context.locations.get(id) ?? context.administrativeAreas.get(id);
|
|
11028
|
+
if (!node) {
|
|
11029
|
+
return [];
|
|
11030
|
+
}
|
|
11031
|
+
const { name, status: status2 } = resolveVersion(node.versions, anchor);
|
|
11032
|
+
return [{ id, name, status: status2 }];
|
|
11033
|
+
});
|
|
11034
|
+
}
|
|
10807
11035
|
|
|
10808
11036
|
// ../commons/src/events/scopes.ts
|
|
10809
11037
|
var ACTION_SCOPE_MAP = {
|
|
@@ -11003,8 +11231,7 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
11003
11231
|
ActionType.READ,
|
|
11004
11232
|
ActionType.DECLARE,
|
|
11005
11233
|
ActionType.NOTIFY,
|
|
11006
|
-
ActionType.DELETE
|
|
11007
|
-
ActionType.CUSTOM
|
|
11234
|
+
ActionType.DELETE
|
|
11008
11235
|
],
|
|
11009
11236
|
[EventStatus.enum.NOTIFIED]: [
|
|
11010
11237
|
ActionType.READ,
|
|
@@ -11439,51 +11666,60 @@ var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
|
11439
11666
|
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
11440
11667
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
11441
11668
|
);
|
|
11669
|
+
var V2_DEFAULT_MOCK_CLIENT_LOCATIONS_MAP = new Map(
|
|
11670
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, toClientLocation(l)])
|
|
11671
|
+
);
|
|
11672
|
+
var V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
11673
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [
|
|
11674
|
+
a.id,
|
|
11675
|
+
toClientAdministrativeArea(a)
|
|
11676
|
+
])
|
|
11677
|
+
);
|
|
11442
11678
|
|
|
11443
11679
|
// ../commons/src/events/locationPayloads.ts
|
|
11444
|
-
var
|
|
11445
|
-
var CreateLocationPayload =
|
|
11680
|
+
var z45 = __toESM(require("zod/v4"));
|
|
11681
|
+
var CreateLocationPayload = z45.object({
|
|
11446
11682
|
id: UUID.optional(),
|
|
11447
11683
|
versionId: UUID.optional(),
|
|
11448
|
-
name:
|
|
11449
|
-
externalId:
|
|
11684
|
+
name: z45.string(),
|
|
11685
|
+
externalId: z45.string().nullish(),
|
|
11450
11686
|
administrativeAreaId: UUID.nullable(),
|
|
11451
|
-
locationType:
|
|
11452
|
-
effectiveFrom:
|
|
11687
|
+
locationType: z45.string().nullable(),
|
|
11688
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
11453
11689
|
status: LocationStatus.default("active")
|
|
11454
11690
|
});
|
|
11455
|
-
var UpdateLocationPayload =
|
|
11691
|
+
var UpdateLocationPayload = z45.strictObject({
|
|
11456
11692
|
id: UUID,
|
|
11457
11693
|
versionId: UUID.optional(),
|
|
11458
|
-
name:
|
|
11459
|
-
externalId:
|
|
11694
|
+
name: z45.string(),
|
|
11695
|
+
externalId: z45.string().nullish(),
|
|
11460
11696
|
status: LocationStatus,
|
|
11461
|
-
effectiveFrom:
|
|
11697
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
11462
11698
|
lastVersionId: UUID
|
|
11463
11699
|
});
|
|
11464
|
-
var WithdrawLocationVersionPayload =
|
|
11700
|
+
var WithdrawLocationVersionPayload = z45.object({
|
|
11465
11701
|
id: UUID,
|
|
11466
11702
|
versionId: UUID
|
|
11467
11703
|
});
|
|
11468
|
-
var CreateAdministrativeAreaPayload =
|
|
11704
|
+
var CreateAdministrativeAreaPayload = z45.object({
|
|
11469
11705
|
id: UUID.optional(),
|
|
11470
11706
|
versionId: UUID.optional(),
|
|
11471
|
-
name:
|
|
11472
|
-
externalId:
|
|
11707
|
+
name: z45.string(),
|
|
11708
|
+
externalId: z45.string().nullish(),
|
|
11473
11709
|
parentId: UUID.nullable(),
|
|
11474
|
-
effectiveFrom:
|
|
11710
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
11475
11711
|
status: LocationStatus.default("active")
|
|
11476
11712
|
});
|
|
11477
|
-
var UpdateAdministrativeAreaPayload =
|
|
11713
|
+
var UpdateAdministrativeAreaPayload = z45.strictObject({
|
|
11478
11714
|
id: UUID,
|
|
11479
11715
|
versionId: UUID.optional(),
|
|
11480
|
-
name:
|
|
11481
|
-
externalId:
|
|
11716
|
+
name: z45.string(),
|
|
11717
|
+
externalId: z45.string().nullish(),
|
|
11482
11718
|
status: LocationStatus,
|
|
11483
|
-
effectiveFrom:
|
|
11719
|
+
effectiveFrom: z45.iso.date().optional(),
|
|
11484
11720
|
lastVersionId: UUID
|
|
11485
11721
|
});
|
|
11486
|
-
var WithdrawAdministrativeAreaVersionPayload =
|
|
11722
|
+
var WithdrawAdministrativeAreaVersionPayload = z45.object({
|
|
11487
11723
|
id: UUID,
|
|
11488
11724
|
versionId: UUID
|
|
11489
11725
|
});
|