@opencrvs/toolkit 2.1.0-rc.ffe0b7f → 2.2.0-rc.9042a13
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 +2 -12
- package/build.sh +23 -5
- package/create-countryconfig/index.js +441 -59
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +5 -2
- package/dist/application-config/index.js +391 -286
- package/dist/authentication/index.d.ts +66 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +778 -0
- package/dist/cli.js +2041 -1311
- package/dist/commons/api/router.d.ts +2359 -485
- package/dist/commons/application-config/index.d.ts +0 -2
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +34 -8
- package/dist/commons/events/ActionConfig.d.ts +131 -7
- package/dist/commons/events/ActionDocument.d.ts +123 -15
- package/dist/commons/events/ActionInput.d.ts +56 -4
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/ActionType.d.ts +11 -1
- package/dist/commons/events/AdvancedSearchConfig.d.ts +60 -12
- package/dist/commons/events/AuditLog.d.ts +152 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +132 -0
- package/dist/commons/events/Draft.d.ts +3 -21
- package/dist/commons/events/EventConfig.d.ts +29 -6
- package/dist/commons/events/EventDocument.d.ts +560 -4
- package/dist/commons/events/EventIndex.d.ts +23 -26
- package/dist/commons/events/EventMetadata.d.ts +24 -11
- package/dist/commons/events/EventStatus.d.ts +20 -0
- package/dist/commons/events/FieldConfig.d.ts +119 -63
- package/dist/commons/events/FieldTypeMapping.d.ts +17 -17
- package/dist/commons/events/FieldValue.d.ts +3 -2
- package/dist/commons/events/Flag.d.ts +42 -0
- package/dist/commons/events/FormConfig.d.ts +6 -0
- package/dist/commons/events/PageConfig.d.ts +4 -0
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +167 -20
- package/dist/commons/events/event.d.ts +12 -0
- package/dist/commons/events/eventConfigValidation.d.ts +17 -1
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +169 -26
- package/dist/commons/events/mocks.test.utils.d.ts +30 -0
- package/dist/commons/events/scopes.d.ts +23 -1
- package/dist/commons/events/state/index.d.ts +10 -2
- package/dist/commons/events/state/utils.d.ts +11 -1
- package/dist/commons/events/test.utils.d.ts +106 -26
- package/dist/commons/events/utils.d.ts +81 -18
- 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 +362 -65
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/derived-variables.d.ts +18 -0
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +22 -1
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +2 -1
- package/dist/environment/logger.d.ts +15 -3
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/manage-users.js +1 -1
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +20 -14
- package/dist/environment/setup-environment.d.ts +1 -1
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +610 -560
- package/dist/environment/swarm-to-k8s.js +3 -4
- package/dist/environment/templates.d.ts +0 -1
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +3 -8
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +4 -0
- package/dist/environment/utils.d.ts +0 -12
- package/dist/environment/utils.d.ts.map +1 -1
- package/dist/environment/utils.js +1 -28
- package/dist/events/index.js +7909 -7056
- package/dist/migrations/add-translations.d.ts +15 -0
- package/dist/migrations/add-translations.d.ts.map +1 -0
- package/dist/migrations/add-translations.js +151 -0
- 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.0/rename-api-paths.d.ts → v2.1/enable-telemetry.d.ts} +1 -1
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +455 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +47 -215
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +17 -0
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +1 -0
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.js +348 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +2 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +1 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.js +161 -0
- package/dist/migrations/{v2.0/migrate-scopes.d.ts → v2.1/remove-sentry.d.ts} +1 -1
- package/dist/migrations/v2.1/remove-sentry.d.ts.map +1 -0
- package/dist/migrations/v2.1/remove-sentry.js +354 -0
- package/dist/migrations/{v2.0/create-events-index.d.ts → v2.1/rename-trigger-paths.d.ts} +1 -1
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +1 -0
- package/dist/migrations/{v2.0/rename-api-paths.js → v2.1/rename-trigger-paths.js} +69 -40
- package/dist/migrations/v2.1/template-files.d.ts +8 -0
- package/dist/migrations/v2.1/template-files.d.ts.map +1 -0
- package/dist/migrations/v2.1/template-files.js +49 -0
- package/dist/migrations/v2.1/upgrade-tilt.d.ts +11 -0
- package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +1 -0
- package/dist/migrations/v2.1/upgrade-tilt.js +139 -0
- package/dist/migrations/v2.2/index.d.ts +6 -0
- package/dist/migrations/v2.2/index.d.ts.map +1 -0
- package/dist/migrations/v2.2/index.js +456 -0
- package/dist/migrations/v2.2/read-declaration-through-helper.d.ts +39 -0
- package/dist/migrations/v2.2/read-declaration-through-helper.d.ts.map +1 -0
- package/dist/migrations/v2.2/read-declaration-through-helper.js +257 -0
- package/dist/notification/index.js +2090 -1456
- package/dist/scopes/index.d.ts +637 -36
- package/dist/scopes/index.js +364 -65
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +43 -0
- package/dist/templates/charts-values/dependencies/values.yaml +8 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +10 -3
- package/dist/templates/charts-values/opentelemetry/values.yaml +102 -0
- package/dist/templates/charts-values/traefik/values.yaml +25 -12
- package/dist/templates/countryconfig-template/.tiltignore +1 -0
- package/dist/templates/countryconfig-template/Dockerfile.assets +7 -0
- package/dist/templates/countryconfig-template/Tiltfile +112 -0
- package/dist/templates/countryconfig-template/assets/README.md +1 -0
- package/dist/templates/countryconfig-template/assets/clear-all-data-dev.sh +61 -0
- package/dist/templates/countryconfig-template/assets/deployment/deploy.sh +455 -0
- package/dist/templates/countryconfig-template/assets/deployment/reindex.sh +168 -0
- package/dist/templates/countryconfig-template/assets/deployment/validate-required-variables-in-compose-files.ts +67 -0
- package/dist/templates/countryconfig-template/assets/elasticsearch/reindex.sh +168 -0
- package/dist/templates/countryconfig-template/assets/metabase/README.md +34 -0
- package/dist/templates/countryconfig-template/assets/metabase/environment-configuration.sql +36 -0
- package/dist/templates/countryconfig-template/assets/metabase/initialize-database.sh +46 -0
- package/dist/templates/countryconfig-template/assets/metabase/metabase.init.db.sql +27737 -0
- package/dist/templates/countryconfig-template/assets/metabase/open-shell.sh +21 -0
- package/dist/templates/countryconfig-template/assets/metabase/package.json +13 -0
- package/dist/templates/countryconfig-template/assets/metabase/run-dev.sh +108 -0
- package/dist/templates/countryconfig-template/assets/metabase/run.sh +120 -0
- package/dist/templates/countryconfig-template/assets/metabase/update-database.sh +40 -0
- package/dist/templates/countryconfig-template/assets/postgres/setup-analytics.sh +135 -0
- package/dist/templates/countryconfig-template/assets/postgres/setup-reference-data.sh +108 -0
- package/dist/templates/countryconfig-template/tilt/clear-all-data.ps1 +50 -0
- package/dist/templates/countryconfig-template/tilt/clear-all-data.sh +35 -0
- package/dist/templates/countryconfig-template/tilt/common.tilt +145 -0
- package/dist/templates/countryconfig-template/tilt/examples/dependencies/values.yaml +15 -0
- package/dist/templates/countryconfig-template/tilt/examples/opencrvs-services/values.yaml +56 -0
- package/dist/templates/countryconfig-template/tilt/examples/traefik/values-minikube.yaml +21 -0
- package/dist/templates/countryconfig-template/tilt/examples/traefik/values.yaml +38 -0
- package/dist/templates/countryconfig-template/tilt/helm/dependencies/values.yaml +17 -0
- package/dist/templates/countryconfig-template/tilt/helm/opencrvs-services/values.yaml +16 -0
- package/dist/templates/countryconfig-template/tilt/lib.tilt +95 -0
- package/dist/templates/countryconfig-template/tilt/opencrvs.tilt +136 -0
- package/dist/templates/inventory/inventory.template.yml +1 -3
- package/dist/translations/template.d.ts +11 -0
- package/dist/translations/template.d.ts.map +1 -0
- package/dist/translations/template.js +100 -0
- package/dist/verify/endpoints.d.ts +2 -0
- package/dist/verify/endpoints.d.ts.map +1 -0
- package/dist/verify/endpoints.js +510 -0
- package/opencrvs-toolkit-2.2.0-rc.9042a13.tgz +0 -0
- package/package.json +13 -7
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -429
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +0 -3
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-resend-invite-notification.js +0 -373
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +0 -22
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +0 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +0 -146
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -838
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -158
- package/dist/migrations/v2.0/create-events-index.d.ts.map +0 -1
- package/dist/migrations/v2.0/create-events-index.js +0 -325
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +0 -11
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +0 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +0 -123
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +0 -3
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +0 -1
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +0 -110
- package/dist/migrations/v2.0/index.d.ts +0 -13
- package/dist/migrations/v2.0/index.d.ts.map +0 -1
- package/dist/migrations/v2.0/index.js +0 -103
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -432
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +0 -13
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +0 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +0 -222
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-application-config-url.js +0 -343
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-scopes.js +0 -305
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -267
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +0 -317
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +0 -156
- package/dist/migrations/v2.0/remove-demo-scope.d.ts +0 -3
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +0 -74
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -96
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +0 -3
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-fhir-url-helpers.js +0 -163
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +0 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +0 -87
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +0 -3
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-old-statistics-service.js +0 -356
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -109
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -163
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +0 -3
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-unused-environment-variables.js +0 -186
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +0 -180
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +0 -3
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +0 -1
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +0 -195
- package/dist/migrations/v2.0/update-package-json.d.ts +0 -3
- package/dist/migrations/v2.0/update-package-json.d.ts.map +0 -1
- package/dist/migrations/v2.0/update-package-json.js +0 -105
- 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.ffe0b7f.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -42,7 +42,7 @@ __export(application_config_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(application_config_exports);
|
|
43
43
|
|
|
44
44
|
// ../commons/src/application-config.ts
|
|
45
|
-
var
|
|
45
|
+
var z21 = __toESM(require("zod/v4"));
|
|
46
46
|
|
|
47
47
|
// ../commons/src/events/FieldConfig.ts
|
|
48
48
|
var import_v43 = __toESM(require("zod/v4"));
|
|
@@ -331,8 +331,9 @@ var TextValue = z7.string();
|
|
|
331
331
|
var HiddenFieldValue = z7.string();
|
|
332
332
|
var NonEmptyTextValue = z7.string().trim().min(1);
|
|
333
333
|
var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
334
|
+
var AGE_MAX_VALUE = 999;
|
|
334
335
|
var AgeValue = z7.object({
|
|
335
|
-
age: z7.number(),
|
|
336
|
+
age: z7.number().int().min(0).max(AGE_MAX_VALUE),
|
|
336
337
|
asOfDateRef: z7.string()
|
|
337
338
|
});
|
|
338
339
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
@@ -497,10 +498,10 @@ var SerializedUserField = z9.object({
|
|
|
497
498
|
var import_v4 = require("zod/v4");
|
|
498
499
|
|
|
499
500
|
// ../commons/src/events/EventMetadata.ts
|
|
500
|
-
var
|
|
501
|
+
var z16 = __toESM(require("zod/v4"));
|
|
501
502
|
|
|
502
503
|
// ../commons/src/events/ActionDocument.ts
|
|
503
|
-
var
|
|
504
|
+
var z15 = __toESM(require("zod/v4"));
|
|
504
505
|
|
|
505
506
|
// ../commons/src/events/ActionType.ts
|
|
506
507
|
var z10 = __toESM(require("zod/v4"));
|
|
@@ -526,6 +527,8 @@ var ActionType = {
|
|
|
526
527
|
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
|
527
528
|
REJECT_CORRECTION: "REJECT_CORRECTION",
|
|
528
529
|
APPROVE_CORRECTION: "APPROVE_CORRECTION",
|
|
530
|
+
REVOKE_REGISTRATION: "REVOKE_REGISTRATION",
|
|
531
|
+
REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION",
|
|
529
532
|
// General actions
|
|
530
533
|
READ: "READ",
|
|
531
534
|
ASSIGN: "ASSIGN",
|
|
@@ -545,6 +548,8 @@ var ConfirmableActions = [
|
|
|
545
548
|
ActionType.REQUEST_CORRECTION,
|
|
546
549
|
ActionType.APPROVE_CORRECTION,
|
|
547
550
|
ActionType.REJECT_CORRECTION,
|
|
551
|
+
ActionType.REVOKE_REGISTRATION,
|
|
552
|
+
ActionType.REINSTATE_REGISTRATION,
|
|
548
553
|
ActionType.CUSTOM
|
|
549
554
|
];
|
|
550
555
|
var ActionTypes = z10.enum([
|
|
@@ -564,6 +569,8 @@ var ActionTypes = z10.enum([
|
|
|
564
569
|
"REQUEST_CORRECTION",
|
|
565
570
|
"REJECT_CORRECTION",
|
|
566
571
|
"APPROVE_CORRECTION",
|
|
572
|
+
"REVOKE_REGISTRATION",
|
|
573
|
+
"REINSTATE_REGISTRATION",
|
|
567
574
|
"READ",
|
|
568
575
|
"ASSIGN",
|
|
569
576
|
"UNASSIGN",
|
|
@@ -602,7 +609,9 @@ var WorkqueueActionType = ActionTypes.extract([
|
|
|
602
609
|
ActionType.ARCHIVE,
|
|
603
610
|
ActionType.UNARCHIVE,
|
|
604
611
|
ActionType.PRINT_CERTIFICATE,
|
|
605
|
-
ActionType.REQUEST_CORRECTION
|
|
612
|
+
ActionType.REQUEST_CORRECTION,
|
|
613
|
+
ActionType.REVOKE_REGISTRATION,
|
|
614
|
+
ActionType.REINSTATE_REGISTRATION
|
|
606
615
|
]);
|
|
607
616
|
var META_ACTIONS = [
|
|
608
617
|
ActionType.ASSIGN,
|
|
@@ -612,16 +621,99 @@ var META_ACTIONS = [
|
|
|
612
621
|
|
|
613
622
|
// ../commons/src/authentication.ts
|
|
614
623
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
615
|
-
var
|
|
624
|
+
var z14 = __toESM(require("zod/v4"));
|
|
616
625
|
|
|
617
626
|
// ../commons/src/scopes.ts
|
|
618
|
-
var
|
|
627
|
+
var z13 = __toESM(require("zod/v4"));
|
|
619
628
|
var qs = __toESM(require("qs"));
|
|
620
|
-
|
|
629
|
+
|
|
630
|
+
// ../commons/src/events/ActionStatus.ts
|
|
631
|
+
var ActionStatus = {
|
|
632
|
+
Requested: "Requested",
|
|
633
|
+
Accepted: "Accepted",
|
|
634
|
+
Rejected: "Rejected"
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
// ../commons/src/events/Flag.ts
|
|
638
|
+
var z11 = __toESM(require("zod/v4"));
|
|
639
|
+
var InherentFlags = {
|
|
640
|
+
INCOMPLETE: "incomplete",
|
|
641
|
+
REJECTED: "rejected",
|
|
642
|
+
CORRECTION_REQUESTED: "correction-requested",
|
|
643
|
+
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
644
|
+
/**
|
|
645
|
+
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
646
|
+
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
647
|
+
*
|
|
648
|
+
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
649
|
+
*/
|
|
650
|
+
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
651
|
+
};
|
|
652
|
+
var actionFlagPattern;
|
|
653
|
+
function getActionFlagPattern() {
|
|
654
|
+
actionFlagPattern ??= new RegExp(
|
|
655
|
+
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
656
|
+
ActionStatus
|
|
657
|
+
).join("|").toLowerCase()})$`
|
|
658
|
+
);
|
|
659
|
+
return actionFlagPattern;
|
|
660
|
+
}
|
|
661
|
+
var ActionFlag = z11.string().refine((value) => getActionFlagPattern().test(value), {
|
|
662
|
+
message: "Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
663
|
+
});
|
|
664
|
+
var CustomFlag = z11.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
665
|
+
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
666
|
+
InherentFlags
|
|
667
|
+
).join(", ")}`
|
|
668
|
+
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
669
|
+
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
670
|
+
}).describe("Custom flag identifier defined by the country config.");
|
|
671
|
+
var Flag = ActionFlag.or(z11.enum(InherentFlags)).or(CustomFlag);
|
|
672
|
+
var ContainsFlags = z11.object({
|
|
673
|
+
anyOf: z11.array(Flag).optional(),
|
|
674
|
+
noneOf: z11.array(Flag).optional(),
|
|
675
|
+
allOf: z11.array(Flag).optional()
|
|
676
|
+
}).meta({
|
|
677
|
+
id: "ContainsFlags"
|
|
678
|
+
});
|
|
679
|
+
var FlagConfig = z11.object({
|
|
680
|
+
id: CustomFlag,
|
|
681
|
+
requiresAction: z11.boolean().describe(
|
|
682
|
+
"Indicates if this flag expects an action to be performed to be cleared."
|
|
683
|
+
),
|
|
684
|
+
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
685
|
+
}).meta({
|
|
686
|
+
id: "FlagConfig",
|
|
687
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
688
|
+
});
|
|
689
|
+
var ActionFlagConfig = z11.object({
|
|
690
|
+
id: Flag,
|
|
691
|
+
operation: z11.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
692
|
+
conditional: Conditional.optional().describe(
|
|
693
|
+
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
694
|
+
)
|
|
695
|
+
}).meta({
|
|
696
|
+
id: "ActionFlagConfig",
|
|
697
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
// ../commons/src/events/EventStatus.ts
|
|
701
|
+
var z12 = __toESM(require("zod/v4"));
|
|
702
|
+
var EventStatus = z12.enum([
|
|
703
|
+
"CREATED",
|
|
704
|
+
"NOTIFIED",
|
|
705
|
+
"DECLARED",
|
|
706
|
+
"REGISTERED",
|
|
707
|
+
"REVOKED",
|
|
708
|
+
"ARCHIVED"
|
|
709
|
+
]);
|
|
710
|
+
|
|
711
|
+
// ../commons/src/scopes.ts
|
|
712
|
+
var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
|
|
621
713
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
622
714
|
);
|
|
623
|
-
var UserFilter =
|
|
624
|
-
var RecordScopeTypeV2 =
|
|
715
|
+
var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
716
|
+
var RecordScopeTypeV2 = z13.enum([
|
|
625
717
|
"record.search",
|
|
626
718
|
"record.create",
|
|
627
719
|
"record.read",
|
|
@@ -636,94 +728,114 @@ var RecordScopeTypeV2 = z11.enum([
|
|
|
636
728
|
"record.print-certified-copies",
|
|
637
729
|
"record.request-correction",
|
|
638
730
|
"record.correct",
|
|
731
|
+
"record.revoke-registration",
|
|
732
|
+
"record.reinstate-registration",
|
|
639
733
|
"record.unassign-others",
|
|
640
|
-
"record.custom-action"
|
|
734
|
+
"record.custom-action",
|
|
735
|
+
"record.action.accept",
|
|
736
|
+
"record.action.reject"
|
|
641
737
|
]);
|
|
642
|
-
var PlainScopeType =
|
|
738
|
+
var PlainScopeType = z13.enum([
|
|
643
739
|
// Misc. system scopes
|
|
644
740
|
"bypassratelimit",
|
|
645
741
|
"record.reindex",
|
|
646
742
|
"user.data-seeding",
|
|
647
743
|
"integration.create",
|
|
744
|
+
// Reading an integration's audit log. Deliberately separate from
|
|
745
|
+
// 'integration.create' so read-only oversight can be granted on its own, and
|
|
746
|
+
// deliberately option-less: system clients have no office and no
|
|
747
|
+
// administrative area, so jurisdiction options would have nothing to bind to.
|
|
748
|
+
"integration.audit.read",
|
|
648
749
|
"record.import",
|
|
649
750
|
"config.update-all",
|
|
751
|
+
"location.edit",
|
|
650
752
|
"attachment.upload",
|
|
651
753
|
"profile.electronic-signature",
|
|
652
754
|
"user.read-only-my-audit",
|
|
653
755
|
// Performance dashboard
|
|
654
756
|
"performance.read",
|
|
655
757
|
"performance.read-dashboards",
|
|
656
|
-
"performance.vital-statistics-export"
|
|
657
|
-
// Scopes used exclusively by countryconfig integration token
|
|
658
|
-
"record.confirm-registration",
|
|
659
|
-
"record.reject-registration"
|
|
758
|
+
"performance.vital-statistics-export"
|
|
660
759
|
]);
|
|
661
|
-
var scopeByEvent =
|
|
760
|
+
var scopeByEvent = z13.preprocess(
|
|
662
761
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
663
|
-
|
|
762
|
+
z13.array(z13.string()).optional()
|
|
664
763
|
).describe("Event type, e.g. birth, death");
|
|
665
|
-
var
|
|
764
|
+
var scopeByStatus = z13.preprocess(
|
|
666
765
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
667
|
-
|
|
766
|
+
z13.array(EventStatus).optional()
|
|
767
|
+
).describe(
|
|
768
|
+
"Restricts the scope to records currently in one of these statuses."
|
|
769
|
+
);
|
|
770
|
+
var userRole = z13.preprocess(
|
|
771
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
772
|
+
z13.array(z13.string()).optional()
|
|
668
773
|
).describe("User role, e.g. admin, field agent");
|
|
669
|
-
var scopeOptionsPlaceEvent =
|
|
774
|
+
var scopeOptionsPlaceEvent = z13.object({
|
|
670
775
|
event: scopeByEvent,
|
|
671
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
776
|
+
placeOfEvent: JurisdictionFilter.optional(),
|
|
777
|
+
createdBy: UserFilter.optional(),
|
|
778
|
+
createdIn: JurisdictionFilter.optional()
|
|
672
779
|
}).describe("Options applicable to all record scopes.");
|
|
673
780
|
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
674
781
|
notifiedIn: JurisdictionFilter.optional(),
|
|
675
782
|
notifiedBy: UserFilter.optional(),
|
|
676
783
|
declaredIn: JurisdictionFilter.optional(),
|
|
677
|
-
declaredBy: UserFilter.optional()
|
|
784
|
+
declaredBy: UserFilter.optional(),
|
|
785
|
+
status: scopeByStatus
|
|
678
786
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
679
787
|
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
680
788
|
registeredIn: JurisdictionFilter.optional(),
|
|
681
|
-
registeredBy: UserFilter.optional()
|
|
789
|
+
registeredBy: UserFilter.optional(),
|
|
790
|
+
flags: ContainsFlags.optional()
|
|
682
791
|
}).describe(
|
|
683
792
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
684
793
|
);
|
|
685
794
|
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
686
|
-
customActionTypes:
|
|
795
|
+
customActionTypes: z13.preprocess(
|
|
687
796
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
688
|
-
|
|
797
|
+
z13.array(z13.string()).optional()
|
|
689
798
|
).describe("Allowed custom action types")
|
|
690
799
|
});
|
|
691
|
-
var AccessLevelOptions =
|
|
800
|
+
var AccessLevelOptions = z13.object({
|
|
692
801
|
accessLevel: JurisdictionFilter.optional()
|
|
693
802
|
});
|
|
694
803
|
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
695
804
|
role: userRole.optional()
|
|
696
805
|
});
|
|
697
|
-
var WorkqueueOrDashboardOptions =
|
|
698
|
-
ids:
|
|
806
|
+
var WorkqueueOrDashboardOptions = z13.object({
|
|
807
|
+
ids: z13.preprocess(
|
|
699
808
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
700
|
-
|
|
809
|
+
z13.array(z13.string())
|
|
701
810
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
702
811
|
});
|
|
703
|
-
var AllScopeOptions =
|
|
812
|
+
var AllScopeOptions = z13.object({
|
|
704
813
|
...AllRecordScopeOptions.shape,
|
|
705
814
|
...AccessLevelOptions.shape,
|
|
706
815
|
...AllUserScopeOptions.shape,
|
|
707
816
|
...WorkqueueOrDashboardOptions.shape
|
|
708
817
|
});
|
|
709
818
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
710
|
-
var ResolvedScopeOptionsPlaceEvent =
|
|
819
|
+
var ResolvedScopeOptionsPlaceEvent = z13.object({
|
|
711
820
|
event: scopeByEvent,
|
|
712
|
-
placeOfEvent: UUID.nullish()
|
|
821
|
+
placeOfEvent: UUID.nullish(),
|
|
822
|
+
createdBy: z13.string().optional(),
|
|
823
|
+
createdIn: UUID.nullish()
|
|
713
824
|
}).describe(
|
|
714
825
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
715
826
|
);
|
|
716
827
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
717
828
|
notifiedIn: UUID.nullish(),
|
|
718
|
-
notifiedBy:
|
|
829
|
+
notifiedBy: z13.string().optional(),
|
|
719
830
|
declaredIn: UUID.nullish(),
|
|
720
|
-
declaredBy:
|
|
831
|
+
declaredBy: z13.string().optional()
|
|
721
832
|
}).describe(
|
|
722
833
|
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
723
834
|
);
|
|
724
835
|
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
725
836
|
registeredIn: UUID.nullish(),
|
|
726
|
-
registeredBy:
|
|
837
|
+
registeredBy: z13.string().optional(),
|
|
838
|
+
flags: ContainsFlags.optional()
|
|
727
839
|
}).describe(
|
|
728
840
|
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
729
841
|
);
|
|
@@ -737,7 +849,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
737
849
|
"record.reject",
|
|
738
850
|
"record.archive",
|
|
739
851
|
"record.unarchive",
|
|
740
|
-
"record.review-duplicates",
|
|
741
852
|
"record.register"
|
|
742
853
|
]);
|
|
743
854
|
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
@@ -745,41 +856,55 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
745
856
|
"record.read",
|
|
746
857
|
"record.request-correction",
|
|
747
858
|
"record.correct",
|
|
748
|
-
"record.
|
|
859
|
+
"record.revoke-registration",
|
|
860
|
+
"record.reinstate-registration",
|
|
861
|
+
"record.unassign-others",
|
|
862
|
+
"record.review-duplicates"
|
|
749
863
|
]);
|
|
750
864
|
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
751
|
-
templates:
|
|
865
|
+
templates: z13.preprocess(
|
|
752
866
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
753
|
-
|
|
867
|
+
z13.array(z13.string()).optional()
|
|
754
868
|
).describe(
|
|
755
869
|
"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."
|
|
756
870
|
)
|
|
757
871
|
});
|
|
758
|
-
var
|
|
759
|
-
|
|
872
|
+
var ActionConfirmationScopeType = RecordScopeTypeV2.extract([
|
|
873
|
+
"record.action.accept",
|
|
874
|
+
"record.action.reject"
|
|
875
|
+
]);
|
|
876
|
+
var ActionConfirmationScopeOptions = AllRecordScopeOptions.describe(
|
|
877
|
+
"Options for confirming (accepting or rejecting) an action."
|
|
878
|
+
);
|
|
879
|
+
var RecordScopeV2 = z13.discriminatedUnion("type", [
|
|
880
|
+
z13.object({
|
|
760
881
|
type: ScopesWithPlaceEventOptions,
|
|
761
882
|
options: scopeOptionsPlaceEvent.optional()
|
|
762
883
|
}),
|
|
763
|
-
|
|
884
|
+
z13.object({
|
|
764
885
|
type: ScopesWithDeclaredOptions,
|
|
765
886
|
options: scopeOptionsDeclaredOrNotified.optional()
|
|
766
887
|
}),
|
|
767
|
-
|
|
888
|
+
z13.object({
|
|
768
889
|
type: ScopesWithFullOptions,
|
|
769
890
|
options: AllRecordScopeOptions.optional()
|
|
770
891
|
}),
|
|
771
|
-
|
|
772
|
-
type:
|
|
892
|
+
z13.object({
|
|
893
|
+
type: z13.literal("record.custom-action"),
|
|
773
894
|
options: CustomActionScopeOptions.optional()
|
|
774
895
|
}),
|
|
775
|
-
|
|
776
|
-
type:
|
|
896
|
+
z13.object({
|
|
897
|
+
type: z13.literal("record.print-certified-copies"),
|
|
777
898
|
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
899
|
+
}),
|
|
900
|
+
z13.object({
|
|
901
|
+
type: ActionConfirmationScopeType,
|
|
902
|
+
options: ActionConfirmationScopeOptions.optional()
|
|
778
903
|
})
|
|
779
904
|
]).describe(
|
|
780
905
|
"Scopes used to check user's permission to perform actions on a record."
|
|
781
906
|
);
|
|
782
|
-
var SystemScopeType =
|
|
907
|
+
var SystemScopeType = z13.enum([
|
|
783
908
|
"organisation.read-locations",
|
|
784
909
|
"user.read",
|
|
785
910
|
"user.create",
|
|
@@ -793,61 +918,61 @@ var UserScopeType = SystemScopeType.extract([
|
|
|
793
918
|
"user.search"
|
|
794
919
|
]);
|
|
795
920
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
796
|
-
var UserScopeV2 =
|
|
797
|
-
|
|
921
|
+
var UserScopeV2 = z13.discriminatedUnion("type", [
|
|
922
|
+
z13.object({
|
|
798
923
|
type: ScopesWithRoleOption,
|
|
799
924
|
options: AllUserScopeOptions.optional()
|
|
800
925
|
}),
|
|
801
|
-
|
|
926
|
+
z13.object({
|
|
802
927
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
803
928
|
options: AccessLevelOptions.optional()
|
|
804
929
|
})
|
|
805
930
|
]);
|
|
806
|
-
var ResolvedRecordScopeV2 =
|
|
807
|
-
|
|
931
|
+
var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
|
|
932
|
+
z13.object({
|
|
808
933
|
type: ScopesWithPlaceEventOptions,
|
|
809
934
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
810
935
|
}),
|
|
811
|
-
|
|
936
|
+
z13.object({
|
|
812
937
|
type: ScopesWithDeclaredOptions,
|
|
813
938
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
814
939
|
}),
|
|
815
|
-
|
|
940
|
+
z13.object({
|
|
816
941
|
type: ScopesWithFullOptions,
|
|
817
942
|
options: ResolvedScopeOptionsFull.optional()
|
|
818
943
|
}),
|
|
819
|
-
|
|
820
|
-
type:
|
|
944
|
+
z13.object({
|
|
945
|
+
type: z13.literal("record.print-certified-copies"),
|
|
821
946
|
options: ResolvedScopeOptionsFull.extend({
|
|
822
|
-
templates:
|
|
947
|
+
templates: z13.array(z13.string()).optional()
|
|
823
948
|
}).optional()
|
|
824
949
|
})
|
|
825
950
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
826
|
-
var Scope =
|
|
827
|
-
|
|
951
|
+
var Scope = z13.discriminatedUnion("type", [
|
|
952
|
+
z13.object({ type: PlainScopeType }),
|
|
828
953
|
...RecordScopeV2.options,
|
|
829
954
|
...UserScopeV2.options,
|
|
830
|
-
|
|
831
|
-
type:
|
|
955
|
+
z13.object({
|
|
956
|
+
type: z13.literal("organisation.read-locations"),
|
|
832
957
|
options: AccessLevelOptions.optional()
|
|
833
958
|
}),
|
|
834
|
-
|
|
835
|
-
type:
|
|
959
|
+
z13.object({
|
|
960
|
+
type: z13.literal("workqueue"),
|
|
836
961
|
options: WorkqueueOrDashboardOptions
|
|
837
962
|
}),
|
|
838
|
-
|
|
839
|
-
type:
|
|
963
|
+
z13.object({
|
|
964
|
+
type: z13.literal("dashboard.view"),
|
|
840
965
|
options: WorkqueueOrDashboardOptions
|
|
841
966
|
})
|
|
842
967
|
]);
|
|
843
|
-
var ScopeType =
|
|
968
|
+
var ScopeType = z13.enum([
|
|
844
969
|
...SystemScopeType.options,
|
|
845
970
|
...RecordScopeTypeV2.options,
|
|
846
971
|
...PlainScopeType.options,
|
|
847
972
|
"workqueue",
|
|
848
973
|
"dashboard.view"
|
|
849
974
|
]);
|
|
850
|
-
var EncodedScope =
|
|
975
|
+
var EncodedScope = z13.string().brand("EncodedScope");
|
|
851
976
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
852
977
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
853
978
|
accessLevel: JurisdictionFilter.enum.all,
|
|
@@ -857,30 +982,25 @@ var DEFAULT_SCOPE_OPTIONS = {
|
|
|
857
982
|
};
|
|
858
983
|
|
|
859
984
|
// ../commons/src/authentication.ts
|
|
860
|
-
var TokenUserType =
|
|
861
|
-
var TokenWithBearer =
|
|
985
|
+
var TokenUserType = z14.enum(["user", "system"]);
|
|
986
|
+
var TokenWithBearer = z14.string().regex(/^Bearer\s/);
|
|
862
987
|
|
|
863
988
|
// ../commons/src/events/ActionDocument.ts
|
|
864
|
-
var ActionUpdate =
|
|
989
|
+
var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
|
|
865
990
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
866
991
|
);
|
|
867
|
-
var EventState =
|
|
992
|
+
var EventState = z15.record(z15.string(), FieldValue).describe(
|
|
868
993
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
869
994
|
);
|
|
870
|
-
var
|
|
871
|
-
Requested: "Requested",
|
|
872
|
-
Accepted: "Accepted",
|
|
873
|
-
Rejected: "Rejected"
|
|
874
|
-
};
|
|
875
|
-
var ActionBase = z13.object({
|
|
995
|
+
var ActionBase = z15.object({
|
|
876
996
|
id: UUID.describe("Unique identifier of the action."),
|
|
877
|
-
transactionId:
|
|
997
|
+
transactionId: z15.string().describe("Unique identifier of the transaction."),
|
|
878
998
|
createdByUserType: TokenUserType.describe(
|
|
879
999
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
880
1000
|
),
|
|
881
|
-
createdAt:
|
|
882
|
-
createdBy:
|
|
883
|
-
createdByRole:
|
|
1001
|
+
createdAt: z15.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1002
|
+
createdBy: z15.string().describe("Identifier of the user who created the action."),
|
|
1003
|
+
createdByRole: z15.string().optional().describe("Role of the user who created the action."),
|
|
884
1004
|
createdBySignature: DocumentPath.nullish().describe(
|
|
885
1005
|
"Reference to the signature of the user who created the action."
|
|
886
1006
|
),
|
|
@@ -892,7 +1012,7 @@ var ActionBase = z13.object({
|
|
|
892
1012
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
893
1013
|
),
|
|
894
1014
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
895
|
-
status:
|
|
1015
|
+
status: z15.enum([
|
|
896
1016
|
ActionStatus.Requested,
|
|
897
1017
|
ActionStatus.Accepted,
|
|
898
1018
|
ActionStatus.Rejected
|
|
@@ -904,139 +1024,153 @@ var ActionBase = z13.object({
|
|
|
904
1024
|
)
|
|
905
1025
|
});
|
|
906
1026
|
var AssignedAction = ActionBase.extend(
|
|
907
|
-
|
|
908
|
-
type:
|
|
909
|
-
assignedTo:
|
|
1027
|
+
z15.object({
|
|
1028
|
+
type: z15.literal(ActionType.ASSIGN),
|
|
1029
|
+
assignedTo: z15.string().describe("Identifier of the user to whom the action is assigned.")
|
|
910
1030
|
// TODO move into 'content' property
|
|
911
1031
|
}).shape
|
|
912
1032
|
);
|
|
913
1033
|
var UnassignedAction = ActionBase.extend(
|
|
914
|
-
|
|
915
|
-
type:
|
|
1034
|
+
z15.object({
|
|
1035
|
+
type: z15.literal(ActionType.UNASSIGN)
|
|
916
1036
|
}).shape
|
|
917
1037
|
);
|
|
918
1038
|
var RegisterAction = ActionBase.extend(
|
|
919
|
-
|
|
920
|
-
type:
|
|
921
|
-
registrationNumber:
|
|
1039
|
+
z15.object({
|
|
1040
|
+
type: z15.literal(ActionType.REGISTER),
|
|
1041
|
+
registrationNumber: z15.string().optional().describe(
|
|
922
1042
|
"Registration number of the event. Always present for accepted registrations."
|
|
923
1043
|
)
|
|
924
1044
|
// TODO move into 'content' property
|
|
925
1045
|
}).shape
|
|
926
1046
|
);
|
|
927
1047
|
var DeclareAction = ActionBase.extend(
|
|
928
|
-
|
|
929
|
-
type:
|
|
1048
|
+
z15.object({
|
|
1049
|
+
type: z15.literal(ActionType.DECLARE)
|
|
930
1050
|
}).shape
|
|
931
1051
|
);
|
|
932
|
-
var ReasonContent =
|
|
933
|
-
reason:
|
|
1052
|
+
var ReasonContent = z15.object({
|
|
1053
|
+
reason: z15.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
934
1054
|
"Message describing the reason for rejecting or archiving the event."
|
|
935
1055
|
)
|
|
936
1056
|
});
|
|
937
1057
|
var RejectAction = ActionBase.extend(
|
|
938
|
-
|
|
939
|
-
type:
|
|
1058
|
+
z15.object({
|
|
1059
|
+
type: z15.literal(ActionType.REJECT),
|
|
940
1060
|
content: ReasonContent
|
|
941
1061
|
}).shape
|
|
942
1062
|
);
|
|
943
|
-
var PotentialDuplicate =
|
|
1063
|
+
var PotentialDuplicate = z15.object({
|
|
944
1064
|
id: UUID,
|
|
945
|
-
trackingId:
|
|
1065
|
+
trackingId: z15.string()
|
|
946
1066
|
});
|
|
947
1067
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
948
|
-
|
|
949
|
-
type:
|
|
950
|
-
content:
|
|
951
|
-
duplicates:
|
|
1068
|
+
z15.object({
|
|
1069
|
+
type: z15.literal(ActionType.DUPLICATE_DETECTED),
|
|
1070
|
+
content: z15.object({
|
|
1071
|
+
duplicates: z15.array(PotentialDuplicate)
|
|
952
1072
|
})
|
|
953
1073
|
}).shape
|
|
954
1074
|
);
|
|
955
1075
|
var MarkNotDuplicateAction = ActionBase.extend(
|
|
956
|
-
|
|
957
|
-
type:
|
|
1076
|
+
z15.object({
|
|
1077
|
+
type: z15.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
958
1078
|
}).shape
|
|
959
1079
|
);
|
|
960
1080
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
961
|
-
|
|
962
|
-
type:
|
|
963
|
-
content:
|
|
1081
|
+
z15.object({
|
|
1082
|
+
type: z15.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1083
|
+
content: z15.object({
|
|
964
1084
|
duplicateOf: UUID
|
|
965
1085
|
}).optional()
|
|
966
1086
|
}).shape
|
|
967
1087
|
);
|
|
968
1088
|
var ArchiveAction = ActionBase.extend(
|
|
969
|
-
|
|
970
|
-
type:
|
|
971
|
-
|
|
1089
|
+
z15.object({
|
|
1090
|
+
type: z15.literal(ActionType.ARCHIVE),
|
|
1091
|
+
/**
|
|
1092
|
+
* Archiving does not collect a reason on its own. Only the
|
|
1093
|
+
* "mark as duplicate" flow archives with a reason attached.
|
|
1094
|
+
*/
|
|
1095
|
+
content: ReasonContent.optional()
|
|
972
1096
|
}).shape
|
|
973
1097
|
);
|
|
974
1098
|
var UnarchiveAction = ActionBase.extend(
|
|
975
|
-
|
|
976
|
-
type:
|
|
1099
|
+
z15.object({
|
|
1100
|
+
type: z15.literal(ActionType.UNARCHIVE)
|
|
1101
|
+
}).shape
|
|
1102
|
+
);
|
|
1103
|
+
var RevokeRegistrationAction = ActionBase.extend(
|
|
1104
|
+
z15.object({
|
|
1105
|
+
type: z15.literal(ActionType.REVOKE_REGISTRATION)
|
|
1106
|
+
}).shape
|
|
1107
|
+
);
|
|
1108
|
+
var ReinstateRegistrationAction = ActionBase.extend(
|
|
1109
|
+
z15.object({
|
|
1110
|
+
type: z15.literal(ActionType.REINSTATE_REGISTRATION)
|
|
977
1111
|
}).shape
|
|
978
1112
|
);
|
|
979
1113
|
var CreatedAction = ActionBase.extend(
|
|
980
|
-
|
|
981
|
-
type:
|
|
1114
|
+
z15.object({
|
|
1115
|
+
type: z15.literal(ActionType.CREATE)
|
|
982
1116
|
}).shape
|
|
983
1117
|
);
|
|
984
1118
|
var NotifiedAction = ActionBase.extend(
|
|
985
|
-
|
|
986
|
-
type:
|
|
1119
|
+
z15.object({
|
|
1120
|
+
type: z15.literal(ActionType.NOTIFY)
|
|
987
1121
|
}).shape
|
|
988
1122
|
);
|
|
989
1123
|
var EditAction = ActionBase.extend(
|
|
990
|
-
|
|
991
|
-
type:
|
|
1124
|
+
z15.object({
|
|
1125
|
+
type: z15.literal(ActionType.EDIT),
|
|
992
1126
|
/** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
|
|
993
|
-
content:
|
|
994
|
-
comment:
|
|
1127
|
+
content: z15.object({
|
|
1128
|
+
comment: z15.string().describe("Comment for the edit action.").optional()
|
|
995
1129
|
}).optional()
|
|
996
1130
|
}).shape
|
|
997
1131
|
);
|
|
998
|
-
var PrintContent =
|
|
999
|
-
templateId:
|
|
1132
|
+
var PrintContent = z15.object({
|
|
1133
|
+
templateId: z15.string().optional()
|
|
1000
1134
|
});
|
|
1001
1135
|
var PrintCertificateAction = ActionBase.extend(
|
|
1002
|
-
|
|
1003
|
-
type:
|
|
1136
|
+
z15.object({
|
|
1137
|
+
type: z15.literal(ActionType.PRINT_CERTIFICATE),
|
|
1004
1138
|
content: PrintContent.optional().nullable()
|
|
1005
1139
|
}).shape
|
|
1006
1140
|
);
|
|
1007
1141
|
var RequestedCorrectionAction = ActionBase.extend(
|
|
1008
|
-
|
|
1009
|
-
type:
|
|
1142
|
+
z15.object({
|
|
1143
|
+
type: z15.literal(ActionType.REQUEST_CORRECTION)
|
|
1010
1144
|
}).shape
|
|
1011
1145
|
);
|
|
1012
1146
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1013
|
-
|
|
1014
|
-
type:
|
|
1015
|
-
requestId:
|
|
1147
|
+
z15.object({
|
|
1148
|
+
type: z15.literal(ActionType.APPROVE_CORRECTION),
|
|
1149
|
+
requestId: UUID,
|
|
1016
1150
|
// TODO move into 'content' property
|
|
1017
|
-
content:
|
|
1151
|
+
content: z15.object({ immediateCorrection: z15.boolean().optional() }).optional()
|
|
1018
1152
|
}).shape
|
|
1019
1153
|
);
|
|
1020
1154
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1021
|
-
|
|
1022
|
-
type:
|
|
1023
|
-
requestId:
|
|
1155
|
+
z15.object({
|
|
1156
|
+
type: z15.literal(ActionType.REJECT_CORRECTION),
|
|
1157
|
+
requestId: UUID,
|
|
1024
1158
|
// TODO move into 'content' property
|
|
1025
1159
|
content: ReasonContent
|
|
1026
1160
|
}).shape
|
|
1027
1161
|
);
|
|
1028
1162
|
var ReadAction = ActionBase.extend(
|
|
1029
|
-
|
|
1030
|
-
type:
|
|
1163
|
+
z15.object({
|
|
1164
|
+
type: z15.literal(ActionType.READ)
|
|
1031
1165
|
}).shape
|
|
1032
1166
|
);
|
|
1033
1167
|
var CustomAction = ActionBase.merge(
|
|
1034
|
-
|
|
1035
|
-
type:
|
|
1036
|
-
customActionType:
|
|
1168
|
+
z15.object({
|
|
1169
|
+
type: z15.literal(ActionType.CUSTOM),
|
|
1170
|
+
customActionType: z15.string()
|
|
1037
1171
|
})
|
|
1038
1172
|
);
|
|
1039
|
-
var ActionDocument =
|
|
1173
|
+
var ActionDocument = z15.discriminatedUnion("type", [
|
|
1040
1174
|
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1041
1175
|
RejectAction.meta({ id: "RejectAction" }),
|
|
1042
1176
|
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
@@ -1044,6 +1178,8 @@ var ActionDocument = z13.discriminatedUnion("type", [
|
|
|
1044
1178
|
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1045
1179
|
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1046
1180
|
UnarchiveAction.meta({ id: "UnarchiveAction" }),
|
|
1181
|
+
RevokeRegistrationAction.meta({ id: "RevokeRegistrationAction" }),
|
|
1182
|
+
ReinstateRegistrationAction.meta({ id: "ReinstateRegistrationAction" }),
|
|
1047
1183
|
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1048
1184
|
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1049
1185
|
DeclareAction.meta({ id: "DeclareAction" }),
|
|
@@ -1063,109 +1199,51 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1063
1199
|
declaration: true,
|
|
1064
1200
|
annotation: true
|
|
1065
1201
|
}).extend(
|
|
1066
|
-
|
|
1067
|
-
type:
|
|
1068
|
-
status:
|
|
1202
|
+
z15.object({
|
|
1203
|
+
type: z15.enum(ConfirmableActions),
|
|
1204
|
+
status: z15.literal(ActionStatus.Rejected)
|
|
1069
1205
|
}).shape
|
|
1070
1206
|
);
|
|
1071
|
-
var Action =
|
|
1072
|
-
|
|
1073
|
-
// ../commons/src/events/Flag.ts
|
|
1074
|
-
var z14 = __toESM(require("zod/v4"));
|
|
1075
|
-
var InherentFlags = {
|
|
1076
|
-
INCOMPLETE: "incomplete",
|
|
1077
|
-
REJECTED: "rejected",
|
|
1078
|
-
CORRECTION_REQUESTED: "correction-requested",
|
|
1079
|
-
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
1080
|
-
/**
|
|
1081
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1082
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1083
|
-
*
|
|
1084
|
-
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
1085
|
-
*/
|
|
1086
|
-
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1087
|
-
};
|
|
1088
|
-
var ActionFlag = z14.string().regex(
|
|
1089
|
-
new RegExp(
|
|
1090
|
-
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1091
|
-
ActionStatus
|
|
1092
|
-
).join("|").toLowerCase()})$`
|
|
1093
|
-
),
|
|
1094
|
-
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1095
|
-
);
|
|
1096
|
-
var CustomFlag = z14.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
1097
|
-
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
1098
|
-
InherentFlags
|
|
1099
|
-
).join(", ")}`
|
|
1100
|
-
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
1101
|
-
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1102
|
-
}).describe("Custom flag identifier defined by the country config.");
|
|
1103
|
-
var Flag = ActionFlag.or(z14.enum(InherentFlags)).or(CustomFlag);
|
|
1104
|
-
var FlagConfig = z14.object({
|
|
1105
|
-
id: CustomFlag,
|
|
1106
|
-
requiresAction: z14.boolean().describe(
|
|
1107
|
-
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1108
|
-
),
|
|
1109
|
-
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1110
|
-
}).meta({
|
|
1111
|
-
id: "FlagConfig",
|
|
1112
|
-
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1113
|
-
});
|
|
1114
|
-
var ActionFlagConfig = z14.object({
|
|
1115
|
-
id: Flag,
|
|
1116
|
-
operation: z14.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1117
|
-
conditional: Conditional.optional().describe(
|
|
1118
|
-
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1119
|
-
)
|
|
1120
|
-
}).meta({
|
|
1121
|
-
id: "ActionFlagConfig",
|
|
1122
|
-
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1123
|
-
});
|
|
1207
|
+
var Action = z15.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1124
1208
|
|
|
1125
1209
|
// ../commons/src/events/EventMetadata.ts
|
|
1126
|
-
var
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
"
|
|
1130
|
-
"
|
|
1131
|
-
"ARCHIVED"
|
|
1132
|
-
]);
|
|
1133
|
-
var ZodDate = z15.iso.date();
|
|
1134
|
-
var ZodDateTime = z15.string().datetime();
|
|
1135
|
-
var ActionCreationMetadata = z15.object({
|
|
1136
|
-
createdAt: z15.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1137
|
-
createdBy: z15.string().describe("ID of the user who created the action request."),
|
|
1210
|
+
var ZodDate = z16.iso.date();
|
|
1211
|
+
var ZodDateTime = z16.string().datetime();
|
|
1212
|
+
var ActionCreationMetadata = z16.object({
|
|
1213
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1214
|
+
createdBy: z16.string().describe("ID of the user who created the action request."),
|
|
1138
1215
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1139
1216
|
createdAtLocation: UUID.nullish().describe(
|
|
1140
1217
|
"Location of the user who created the action request."
|
|
1141
1218
|
),
|
|
1142
|
-
createdByUserType:
|
|
1143
|
-
acceptedAt:
|
|
1144
|
-
createdByRole:
|
|
1219
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1220
|
+
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1221
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1145
1222
|
});
|
|
1146
1223
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1147
|
-
registrationNumber:
|
|
1224
|
+
registrationNumber: z16.string().describe(
|
|
1148
1225
|
"Registration number of the event. Always present for accepted registrations."
|
|
1149
1226
|
)
|
|
1150
1227
|
});
|
|
1151
|
-
var LegalStatuses =
|
|
1228
|
+
var LegalStatuses = z16.object({
|
|
1152
1229
|
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1153
1230
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1154
|
-
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1231
|
+
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish(),
|
|
1232
|
+
[EventStatus.enum.REVOKED]: ActionCreationMetadata.nullish()
|
|
1155
1233
|
});
|
|
1156
|
-
var EventMetadata =
|
|
1234
|
+
var EventMetadata = z16.object({
|
|
1157
1235
|
id: UUID,
|
|
1158
|
-
type:
|
|
1236
|
+
type: z16.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1159
1237
|
status: EventStatus,
|
|
1160
1238
|
legalStatuses: LegalStatuses.describe(
|
|
1161
1239
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1162
1240
|
),
|
|
1163
|
-
createdAt:
|
|
1241
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1164
1242
|
dateOfEvent: ZodDate.nullish(),
|
|
1165
1243
|
placeOfEvent: UUID.nullish(),
|
|
1166
|
-
createdBy:
|
|
1167
|
-
createdByUserType:
|
|
1168
|
-
updatedByUserRole:
|
|
1244
|
+
createdBy: z16.string().describe("ID of the user who created the event."),
|
|
1245
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1246
|
+
updatedByUserRole: z16.string().nullish().describe("Role of the user who last changed the status."),
|
|
1169
1247
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1170
1248
|
createdAtLocation: UUID.nullish().describe(
|
|
1171
1249
|
"Location of the user who created the event."
|
|
@@ -1173,18 +1251,18 @@ var EventMetadata = z15.object({
|
|
|
1173
1251
|
updatedAtLocation: UUID.nullish().describe(
|
|
1174
1252
|
"Location of the user who last changed the status."
|
|
1175
1253
|
),
|
|
1176
|
-
updatedAt:
|
|
1254
|
+
updatedAt: z16.iso.datetime().describe(
|
|
1177
1255
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1178
1256
|
),
|
|
1179
|
-
assignedTo:
|
|
1180
|
-
updatedBy:
|
|
1181
|
-
trackingId:
|
|
1257
|
+
assignedTo: z16.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1258
|
+
updatedBy: z16.string().nullish().describe("ID of the user who last changed the status."),
|
|
1259
|
+
trackingId: z16.string().describe(
|
|
1182
1260
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1183
1261
|
),
|
|
1184
|
-
potentialDuplicates:
|
|
1262
|
+
potentialDuplicates: z16.array(PotentialDuplicate).describe(
|
|
1185
1263
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1186
1264
|
),
|
|
1187
|
-
flags:
|
|
1265
|
+
flags: z16.array(Flag)
|
|
1188
1266
|
});
|
|
1189
1267
|
var EventMetadataKeysArray = [
|
|
1190
1268
|
"id",
|
|
@@ -1205,8 +1283,8 @@ var EventMetadataKeysArray = [
|
|
|
1205
1283
|
"legalStatuses",
|
|
1206
1284
|
"flags"
|
|
1207
1285
|
];
|
|
1208
|
-
var EventMetadataKeys =
|
|
1209
|
-
var EventMetadataDateFieldIdInput =
|
|
1286
|
+
var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
1287
|
+
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1210
1288
|
"createdAt",
|
|
1211
1289
|
"updatedAt",
|
|
1212
1290
|
"legalStatuses.NOTIFIED.createdAt",
|
|
@@ -1216,7 +1294,7 @@ var EventMetadataDateFieldIdInput = z15.enum([
|
|
|
1216
1294
|
"legalStatuses.REGISTERED.createdAt",
|
|
1217
1295
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
1218
1296
|
]);
|
|
1219
|
-
var EventMetadataDateFieldId =
|
|
1297
|
+
var EventMetadataDateFieldId = z16.enum([
|
|
1220
1298
|
"event.createdAt",
|
|
1221
1299
|
"event.updatedAt",
|
|
1222
1300
|
"event.legalStatuses.NOTIFIED.createdAt",
|
|
@@ -1281,13 +1359,6 @@ var Range = import_v4.z.object({
|
|
|
1281
1359
|
}).meta({
|
|
1282
1360
|
id: "Range"
|
|
1283
1361
|
});
|
|
1284
|
-
var ContainsFlags = import_v4.z.object({
|
|
1285
|
-
anyOf: import_v4.z.array(Flag).optional(),
|
|
1286
|
-
noneOf: import_v4.z.array(Flag).optional(),
|
|
1287
|
-
allOf: import_v4.z.array(Flag).optional()
|
|
1288
|
-
}).meta({
|
|
1289
|
-
id: "ContainsFlags"
|
|
1290
|
-
});
|
|
1291
1362
|
var Within = import_v4.z.object({ type: import_v4.z.literal("within"), location: import_v4.z.string() }).meta({
|
|
1292
1363
|
id: "Within"
|
|
1293
1364
|
});
|
|
@@ -1330,6 +1401,7 @@ var QueryExpression = import_v4.z.object({
|
|
|
1330
1401
|
"legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1331
1402
|
"legalStatuses.REGISTERED.createdByRole": import_v4.z.optional(AnyOf),
|
|
1332
1403
|
"legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
|
|
1404
|
+
"legalStatuses.REVOKED.createdAtLocation": import_v4.z.optional(Within).nullable(),
|
|
1333
1405
|
createdAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
|
|
1334
1406
|
updatedAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
|
|
1335
1407
|
assignedTo: import_v4.z.optional(Exact),
|
|
@@ -1482,8 +1554,8 @@ var BaseField = import_v43.default.object({
|
|
|
1482
1554
|
conditionals: import_v43.default.array(FieldConditional).default([]).optional().describe(
|
|
1483
1555
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1484
1556
|
),
|
|
1485
|
-
secured: import_v43.default.boolean().default(false).optional().describe(
|
|
1486
|
-
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1557
|
+
secured: import_v43.default.union([import_v43.default.boolean(), Conditional]).default(false).optional().describe(
|
|
1558
|
+
"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."
|
|
1487
1559
|
),
|
|
1488
1560
|
placeholder: TranslationConfig.optional(),
|
|
1489
1561
|
validation: import_v43.default.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
@@ -1881,7 +1953,13 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
1881
1953
|
configuration: import_v43.default.object({
|
|
1882
1954
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
1883
1955
|
type: AdministrativeAreas,
|
|
1884
|
-
allowedLocations: AllowedLocations
|
|
1956
|
+
allowedLocations: AllowedLocations,
|
|
1957
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1958
|
+
"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."
|
|
1959
|
+
),
|
|
1960
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
1961
|
+
"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."
|
|
1962
|
+
)
|
|
1885
1963
|
}).describe("Administrative area options")
|
|
1886
1964
|
}).meta({
|
|
1887
1965
|
description: "Administrative area input field",
|
|
@@ -1892,7 +1970,13 @@ var LocationInput = BaseField.extend({
|
|
|
1892
1970
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1893
1971
|
configuration: import_v43.default.object({
|
|
1894
1972
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1895
|
-
allowedLocations: AllowedLocations
|
|
1973
|
+
allowedLocations: AllowedLocations,
|
|
1974
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1975
|
+
"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."
|
|
1976
|
+
),
|
|
1977
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
1978
|
+
"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."
|
|
1979
|
+
)
|
|
1896
1980
|
}).optional()
|
|
1897
1981
|
}).meta({
|
|
1898
1982
|
description: "A field for selecting a location",
|
|
@@ -1918,12 +2002,20 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1918
2002
|
var Facility = BaseField.extend({
|
|
1919
2003
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1920
2004
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1921
|
-
configuration: import_v43.default.object({
|
|
2005
|
+
configuration: import_v43.default.object({
|
|
2006
|
+
allowedLocations: AllowedLocations,
|
|
2007
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
2008
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2009
|
+
}).optional()
|
|
1922
2010
|
}).describe("Input field for a facility");
|
|
1923
2011
|
var Office = BaseField.extend({
|
|
1924
2012
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1925
2013
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1926
|
-
configuration: import_v43.default.object({
|
|
2014
|
+
configuration: import_v43.default.object({
|
|
2015
|
+
allowedLocations: AllowedLocations,
|
|
2016
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
2017
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2018
|
+
}).optional()
|
|
1927
2019
|
}).describe("Input field for an office");
|
|
1928
2020
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1929
2021
|
administrativeArea: import_v43.default.union([UUID, SerializedUserField]).optional()
|
|
@@ -1956,7 +2048,13 @@ var Address = BaseField.extend({
|
|
|
1956
2048
|
parent: FieldReference.optional()
|
|
1957
2049
|
})
|
|
1958
2050
|
).optional(),
|
|
1959
|
-
allowedLocations: AllowedLocations
|
|
2051
|
+
allowedLocations: AllowedLocations,
|
|
2052
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2053
|
+
"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."
|
|
2054
|
+
),
|
|
2055
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
2056
|
+
"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."
|
|
2057
|
+
)
|
|
1960
2058
|
}).optional(),
|
|
1961
2059
|
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1962
2060
|
}).meta({
|
|
@@ -2011,10 +2109,19 @@ var ButtonField = BaseField.extend({
|
|
|
2011
2109
|
description: "A generic button that can be used to trigger an action",
|
|
2012
2110
|
id: "ButtonField"
|
|
2013
2111
|
});
|
|
2112
|
+
var FieldGroupConfiguration = import_v43.default.object({
|
|
2113
|
+
separator: import_v43.default.string().optional().describe(
|
|
2114
|
+
'Joins the subfield values when the group is rendered as output, e.g. ", ". Defaults to one subfield per line.'
|
|
2115
|
+
),
|
|
2116
|
+
hideEmptyFields: import_v43.default.boolean().default(false).optional().describe(
|
|
2117
|
+
"Leaves subfields without a value out of the output. Pair it with a separator so the separator does not double up around the gaps."
|
|
2118
|
+
)
|
|
2119
|
+
});
|
|
2014
2120
|
var FieldGroup = BaseField.extend({
|
|
2015
2121
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2016
2122
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2017
|
-
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2123
|
+
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig)),
|
|
2124
|
+
configuration: FieldGroupConfiguration.optional()
|
|
2018
2125
|
}).meta({
|
|
2019
2126
|
description: "A group of fields that are displayed together",
|
|
2020
2127
|
id: "FieldGroup"
|
|
@@ -2257,7 +2364,7 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
2257
2364
|
]);
|
|
2258
2365
|
|
|
2259
2366
|
// ../commons/src/application-config.ts
|
|
2260
|
-
var SearchCriteria =
|
|
2367
|
+
var SearchCriteria = z21.enum([
|
|
2261
2368
|
"TRACKING_ID",
|
|
2262
2369
|
"REGISTRATION_NUMBER",
|
|
2263
2370
|
"NATIONAL_ID",
|
|
@@ -2265,69 +2372,67 @@ var SearchCriteria = z20.enum([
|
|
|
2265
2372
|
"PHONE_NUMBER",
|
|
2266
2373
|
"EMAIL"
|
|
2267
2374
|
]);
|
|
2268
|
-
var ApplicationConfig =
|
|
2269
|
-
APPLICATION_NAME:
|
|
2270
|
-
COUNTRY_LOGO:
|
|
2271
|
-
fileName:
|
|
2272
|
-
file:
|
|
2375
|
+
var ApplicationConfig = z21.object({
|
|
2376
|
+
APPLICATION_NAME: z21.string(),
|
|
2377
|
+
COUNTRY_LOGO: z21.object({
|
|
2378
|
+
fileName: z21.string(),
|
|
2379
|
+
file: z21.string()
|
|
2273
2380
|
}),
|
|
2274
|
-
SYSTEM_IANA_TIMEZONE:
|
|
2275
|
-
CURRENCY:
|
|
2276
|
-
languagesAndCountry:
|
|
2277
|
-
isoCode:
|
|
2381
|
+
SYSTEM_IANA_TIMEZONE: z21.string(),
|
|
2382
|
+
CURRENCY: z21.object({
|
|
2383
|
+
languagesAndCountry: z21.array(z21.string()),
|
|
2384
|
+
isoCode: z21.string()
|
|
2278
2385
|
}),
|
|
2279
|
-
ADMIN_STRUCTURE:
|
|
2280
|
-
|
|
2281
|
-
id:
|
|
2386
|
+
ADMIN_STRUCTURE: z21.array(
|
|
2387
|
+
z21.object({
|
|
2388
|
+
id: z21.string(),
|
|
2282
2389
|
label: TranslationConfig
|
|
2283
2390
|
})
|
|
2284
2391
|
),
|
|
2285
|
-
PHONE_NUMBER_PATTERN:
|
|
2286
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2287
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2392
|
+
PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
|
|
2393
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2394
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2288
2395
|
SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
|
|
2289
|
-
ADDITIONAL_USER_FIELDS:
|
|
2396
|
+
ADDITIONAL_USER_FIELDS: z21.array(FieldConfig).optional().default([])
|
|
2290
2397
|
});
|
|
2291
2398
|
var defineApplicationConfig = (config) => {
|
|
2292
2399
|
return ApplicationConfig.parse(config);
|
|
2293
2400
|
};
|
|
2294
|
-
var BackgroundConfig =
|
|
2295
|
-
backgroundColor:
|
|
2296
|
-
backgroundImage:
|
|
2297
|
-
imageFit:
|
|
2401
|
+
var BackgroundConfig = z21.object({
|
|
2402
|
+
backgroundColor: z21.string().optional(),
|
|
2403
|
+
backgroundImage: z21.string().optional(),
|
|
2404
|
+
imageFit: z21.string().optional()
|
|
2298
2405
|
}).refine(
|
|
2299
2406
|
(data) => !!(data.backgroundColor || data.backgroundImage),
|
|
2300
2407
|
"backgroundColor and backgroundImage cannot be empty at the same time"
|
|
2301
2408
|
);
|
|
2302
|
-
var LoginConfig =
|
|
2303
|
-
COUNTRY:
|
|
2304
|
-
LANGUAGES:
|
|
2305
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2306
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2307
|
-
PHONE_NUMBER_PATTERN:
|
|
2308
|
-
LOGIN_BACKGROUND: BackgroundConfig
|
|
2309
|
-
SENTRY: z20.string().optional()
|
|
2409
|
+
var LoginConfig = z21.object({
|
|
2410
|
+
COUNTRY: z21.string(),
|
|
2411
|
+
LANGUAGES: z21.array(z21.string()),
|
|
2412
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2413
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2414
|
+
PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
|
|
2415
|
+
LOGIN_BACKGROUND: BackgroundConfig
|
|
2310
2416
|
});
|
|
2311
2417
|
var defineLoginConfig = (config) => {
|
|
2312
2418
|
return LoginConfig.parse(config);
|
|
2313
2419
|
};
|
|
2314
|
-
var ClientConfig =
|
|
2315
|
-
COUNTRY:
|
|
2316
|
-
LANGUAGES:
|
|
2317
|
-
|
|
2318
|
-
LOGIN_URL: z20.string().optional(),
|
|
2420
|
+
var ClientConfig = z21.object({
|
|
2421
|
+
COUNTRY: z21.string(),
|
|
2422
|
+
LANGUAGES: z21.array(z21.string()),
|
|
2423
|
+
LOGIN_URL: z21.string().optional(),
|
|
2319
2424
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2320
|
-
DASHBOARDS:
|
|
2321
|
-
|
|
2322
|
-
id:
|
|
2425
|
+
DASHBOARDS: z21.array(
|
|
2426
|
+
z21.object({
|
|
2427
|
+
id: z21.string(),
|
|
2323
2428
|
title: TranslationConfig,
|
|
2324
|
-
url:
|
|
2325
|
-
context:
|
|
2326
|
-
auth:
|
|
2429
|
+
url: z21.string(),
|
|
2430
|
+
context: z21.object({
|
|
2431
|
+
auth: z21.literal("REQUEST_AUTH_TOKEN")
|
|
2327
2432
|
}).optional()
|
|
2328
2433
|
})
|
|
2329
2434
|
),
|
|
2330
|
-
FEATURES:
|
|
2435
|
+
FEATURES: z21.object({ V2_EVENTS: z21.boolean().optional().default(true) }).optional().default({ V2_EVENTS: true })
|
|
2331
2436
|
});
|
|
2332
2437
|
var defineClientConfig = (config) => {
|
|
2333
2438
|
return ClientConfig.parse(config);
|