@opencrvs/toolkit 2.1.0-rc.7c41a07 → 2.1.0-rc.7c723fe
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 +3 -12
- package/build.sh +22 -4
- package/create-countryconfig/index.js +441 -59
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +4 -1
- package/dist/application-config/index.js +361 -284
- package/dist/authentication/index.d.ts +66 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +765 -0
- package/dist/cli.js +3751 -1232
- package/dist/commons/api/router.d.ts +880 -374
- 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 +5 -14
- package/dist/commons/events/ActionDocument.d.ts +35 -15
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +42 -12
- package/dist/commons/events/AuditLog.d.ts +130 -5
- package/dist/commons/events/Draft.d.ts +1 -21
- package/dist/commons/events/EventConfig.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +472 -4
- package/dist/commons/events/EventIndex.d.ts +3 -26
- 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 +104 -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 +17 -14
- package/dist/commons/events/event.d.ts +12 -0
- package/dist/commons/events/locations.d.ts +162 -26
- package/dist/commons/events/mocks.test.utils.d.ts +30 -0
- package/dist/commons/events/scopes.d.ts +21 -1
- package/dist/commons/events/test.utils.d.ts +78 -25
- package/dist/commons/events/utils.d.ts +39 -4
- 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 +348 -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/index.d.ts +1 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +12 -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/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.d.ts +1 -1
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +594 -562
- 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 +5 -9
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +21 -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/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 +7202 -6657
- 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 +149 -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 +1952 -0
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +14 -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 +8 -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/notification/index.js +1863 -1481
- package/dist/scopes/index.d.ts +612 -36
- package/dist/scopes/index.js +350 -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 +23 -9
- 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.1.0-rc.7c723fe.tgz +0 -0
- package/package.json +13 -6
- 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.7c41a07.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"));
|
|
@@ -612,16 +613,98 @@ var META_ACTIONS = [
|
|
|
612
613
|
|
|
613
614
|
// ../commons/src/authentication.ts
|
|
614
615
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
615
|
-
var
|
|
616
|
+
var z14 = __toESM(require("zod/v4"));
|
|
616
617
|
|
|
617
618
|
// ../commons/src/scopes.ts
|
|
618
|
-
var
|
|
619
|
+
var z13 = __toESM(require("zod/v4"));
|
|
619
620
|
var qs = __toESM(require("qs"));
|
|
620
|
-
|
|
621
|
+
|
|
622
|
+
// ../commons/src/events/ActionStatus.ts
|
|
623
|
+
var ActionStatus = {
|
|
624
|
+
Requested: "Requested",
|
|
625
|
+
Accepted: "Accepted",
|
|
626
|
+
Rejected: "Rejected"
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
// ../commons/src/events/Flag.ts
|
|
630
|
+
var z11 = __toESM(require("zod/v4"));
|
|
631
|
+
var InherentFlags = {
|
|
632
|
+
INCOMPLETE: "incomplete",
|
|
633
|
+
REJECTED: "rejected",
|
|
634
|
+
CORRECTION_REQUESTED: "correction-requested",
|
|
635
|
+
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
636
|
+
/**
|
|
637
|
+
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
638
|
+
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
639
|
+
*
|
|
640
|
+
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
641
|
+
*/
|
|
642
|
+
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
643
|
+
};
|
|
644
|
+
var actionFlagPattern;
|
|
645
|
+
function getActionFlagPattern() {
|
|
646
|
+
actionFlagPattern ??= new RegExp(
|
|
647
|
+
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
648
|
+
ActionStatus
|
|
649
|
+
).join("|").toLowerCase()})$`
|
|
650
|
+
);
|
|
651
|
+
return actionFlagPattern;
|
|
652
|
+
}
|
|
653
|
+
var ActionFlag = z11.string().refine((value) => getActionFlagPattern().test(value), {
|
|
654
|
+
message: "Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
655
|
+
});
|
|
656
|
+
var CustomFlag = z11.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
657
|
+
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
658
|
+
InherentFlags
|
|
659
|
+
).join(", ")}`
|
|
660
|
+
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
661
|
+
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
662
|
+
}).describe("Custom flag identifier defined by the country config.");
|
|
663
|
+
var Flag = ActionFlag.or(z11.enum(InherentFlags)).or(CustomFlag);
|
|
664
|
+
var ContainsFlags = z11.object({
|
|
665
|
+
anyOf: z11.array(Flag).optional(),
|
|
666
|
+
noneOf: z11.array(Flag).optional(),
|
|
667
|
+
allOf: z11.array(Flag).optional()
|
|
668
|
+
}).meta({
|
|
669
|
+
id: "ContainsFlags"
|
|
670
|
+
});
|
|
671
|
+
var FlagConfig = z11.object({
|
|
672
|
+
id: CustomFlag,
|
|
673
|
+
requiresAction: z11.boolean().describe(
|
|
674
|
+
"Indicates if this flag expects an action to be performed to be cleared."
|
|
675
|
+
),
|
|
676
|
+
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
677
|
+
}).meta({
|
|
678
|
+
id: "FlagConfig",
|
|
679
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
680
|
+
});
|
|
681
|
+
var ActionFlagConfig = z11.object({
|
|
682
|
+
id: Flag,
|
|
683
|
+
operation: z11.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
684
|
+
conditional: Conditional.optional().describe(
|
|
685
|
+
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
686
|
+
)
|
|
687
|
+
}).meta({
|
|
688
|
+
id: "ActionFlagConfig",
|
|
689
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
// ../commons/src/events/EventStatus.ts
|
|
693
|
+
var z12 = __toESM(require("zod/v4"));
|
|
694
|
+
var EventStatus = z12.enum([
|
|
695
|
+
"CREATED",
|
|
696
|
+
"NOTIFIED",
|
|
697
|
+
"DECLARED",
|
|
698
|
+
"REGISTERED",
|
|
699
|
+
"ARCHIVED"
|
|
700
|
+
]);
|
|
701
|
+
|
|
702
|
+
// ../commons/src/scopes.ts
|
|
703
|
+
var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
|
|
621
704
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
622
705
|
);
|
|
623
|
-
var UserFilter =
|
|
624
|
-
var RecordScopeTypeV2 =
|
|
706
|
+
var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
707
|
+
var RecordScopeTypeV2 = z13.enum([
|
|
625
708
|
"record.search",
|
|
626
709
|
"record.create",
|
|
627
710
|
"record.read",
|
|
@@ -637,14 +720,21 @@ var RecordScopeTypeV2 = z11.enum([
|
|
|
637
720
|
"record.request-correction",
|
|
638
721
|
"record.correct",
|
|
639
722
|
"record.unassign-others",
|
|
640
|
-
"record.custom-action"
|
|
723
|
+
"record.custom-action",
|
|
724
|
+
"record.action.accept",
|
|
725
|
+
"record.action.reject"
|
|
641
726
|
]);
|
|
642
|
-
var PlainScopeType =
|
|
727
|
+
var PlainScopeType = z13.enum([
|
|
643
728
|
// Misc. system scopes
|
|
644
729
|
"bypassratelimit",
|
|
645
730
|
"record.reindex",
|
|
646
731
|
"user.data-seeding",
|
|
647
732
|
"integration.create",
|
|
733
|
+
// Reading an integration's audit log. Deliberately separate from
|
|
734
|
+
// 'integration.create' so read-only oversight can be granted on its own, and
|
|
735
|
+
// deliberately option-less: system clients have no office and no
|
|
736
|
+
// administrative area, so jurisdiction options would have nothing to bind to.
|
|
737
|
+
"integration.audit.read",
|
|
648
738
|
"record.import",
|
|
649
739
|
"config.update-all",
|
|
650
740
|
"location.edit",
|
|
@@ -654,77 +744,87 @@ var PlainScopeType = z11.enum([
|
|
|
654
744
|
// Performance dashboard
|
|
655
745
|
"performance.read",
|
|
656
746
|
"performance.read-dashboards",
|
|
657
|
-
"performance.vital-statistics-export"
|
|
658
|
-
// Scopes used exclusively by countryconfig integration token
|
|
659
|
-
"record.confirm-registration",
|
|
660
|
-
"record.reject-registration"
|
|
747
|
+
"performance.vital-statistics-export"
|
|
661
748
|
]);
|
|
662
|
-
var scopeByEvent =
|
|
749
|
+
var scopeByEvent = z13.preprocess(
|
|
663
750
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
664
|
-
|
|
751
|
+
z13.array(z13.string()).optional()
|
|
665
752
|
).describe("Event type, e.g. birth, death");
|
|
666
|
-
var
|
|
753
|
+
var scopeByStatus = z13.preprocess(
|
|
754
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
755
|
+
z13.array(EventStatus).optional()
|
|
756
|
+
).describe(
|
|
757
|
+
"Restricts the scope to records currently in one of these statuses."
|
|
758
|
+
);
|
|
759
|
+
var userRole = z13.preprocess(
|
|
667
760
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
668
|
-
|
|
761
|
+
z13.array(z13.string()).optional()
|
|
669
762
|
).describe("User role, e.g. admin, field agent");
|
|
670
|
-
var scopeOptionsPlaceEvent =
|
|
763
|
+
var scopeOptionsPlaceEvent = z13.object({
|
|
671
764
|
event: scopeByEvent,
|
|
672
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
765
|
+
placeOfEvent: JurisdictionFilter.optional(),
|
|
766
|
+
createdBy: UserFilter.optional(),
|
|
767
|
+
createdIn: JurisdictionFilter.optional()
|
|
673
768
|
}).describe("Options applicable to all record scopes.");
|
|
674
769
|
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
675
770
|
notifiedIn: JurisdictionFilter.optional(),
|
|
676
771
|
notifiedBy: UserFilter.optional(),
|
|
677
772
|
declaredIn: JurisdictionFilter.optional(),
|
|
678
|
-
declaredBy: UserFilter.optional()
|
|
773
|
+
declaredBy: UserFilter.optional(),
|
|
774
|
+
status: scopeByStatus
|
|
679
775
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
680
776
|
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
681
777
|
registeredIn: JurisdictionFilter.optional(),
|
|
682
|
-
registeredBy: UserFilter.optional()
|
|
778
|
+
registeredBy: UserFilter.optional(),
|
|
779
|
+
flags: ContainsFlags.optional()
|
|
683
780
|
}).describe(
|
|
684
781
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
685
782
|
);
|
|
686
783
|
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
687
|
-
customActionTypes:
|
|
784
|
+
customActionTypes: z13.preprocess(
|
|
688
785
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
689
|
-
|
|
786
|
+
z13.array(z13.string()).optional()
|
|
690
787
|
).describe("Allowed custom action types")
|
|
691
788
|
});
|
|
692
|
-
var AccessLevelOptions =
|
|
789
|
+
var AccessLevelOptions = z13.object({
|
|
693
790
|
accessLevel: JurisdictionFilter.optional()
|
|
694
791
|
});
|
|
695
792
|
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
696
793
|
role: userRole.optional()
|
|
697
794
|
});
|
|
698
|
-
var WorkqueueOrDashboardOptions =
|
|
699
|
-
ids:
|
|
795
|
+
var WorkqueueOrDashboardOptions = z13.object({
|
|
796
|
+
ids: z13.preprocess(
|
|
700
797
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
701
|
-
|
|
798
|
+
z13.array(z13.string())
|
|
702
799
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
703
800
|
});
|
|
704
|
-
var AllScopeOptions =
|
|
801
|
+
var AllScopeOptions = z13.object({
|
|
705
802
|
...AllRecordScopeOptions.shape,
|
|
706
803
|
...AccessLevelOptions.shape,
|
|
707
804
|
...AllUserScopeOptions.shape,
|
|
708
805
|
...WorkqueueOrDashboardOptions.shape
|
|
709
806
|
});
|
|
710
807
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
711
|
-
var ResolvedScopeOptionsPlaceEvent =
|
|
808
|
+
var ResolvedScopeOptionsPlaceEvent = z13.object({
|
|
712
809
|
event: scopeByEvent,
|
|
713
|
-
placeOfEvent: UUID.nullish()
|
|
810
|
+
placeOfEvent: UUID.nullish(),
|
|
811
|
+
createdBy: z13.string().optional(),
|
|
812
|
+
createdIn: UUID.nullish()
|
|
714
813
|
}).describe(
|
|
715
814
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
716
815
|
);
|
|
717
816
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
718
817
|
notifiedIn: UUID.nullish(),
|
|
719
|
-
notifiedBy:
|
|
818
|
+
notifiedBy: z13.string().optional(),
|
|
720
819
|
declaredIn: UUID.nullish(),
|
|
721
|
-
declaredBy:
|
|
820
|
+
declaredBy: z13.string().optional()
|
|
722
821
|
}).describe(
|
|
723
822
|
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
724
823
|
);
|
|
725
824
|
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
726
825
|
registeredIn: UUID.nullish(),
|
|
727
|
-
registeredBy:
|
|
826
|
+
registeredBy: z13.string().optional(),
|
|
827
|
+
flags: ContainsFlags.optional()
|
|
728
828
|
}).describe(
|
|
729
829
|
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
730
830
|
);
|
|
@@ -738,7 +838,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
738
838
|
"record.reject",
|
|
739
839
|
"record.archive",
|
|
740
840
|
"record.unarchive",
|
|
741
|
-
"record.review-duplicates",
|
|
742
841
|
"record.register"
|
|
743
842
|
]);
|
|
744
843
|
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
@@ -746,41 +845,53 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
746
845
|
"record.read",
|
|
747
846
|
"record.request-correction",
|
|
748
847
|
"record.correct",
|
|
749
|
-
"record.unassign-others"
|
|
848
|
+
"record.unassign-others",
|
|
849
|
+
"record.review-duplicates"
|
|
750
850
|
]);
|
|
751
851
|
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
752
|
-
templates:
|
|
852
|
+
templates: z13.preprocess(
|
|
753
853
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
754
|
-
|
|
854
|
+
z13.array(z13.string()).optional()
|
|
755
855
|
).describe(
|
|
756
856
|
"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."
|
|
757
857
|
)
|
|
758
858
|
});
|
|
759
|
-
var
|
|
760
|
-
|
|
859
|
+
var ActionConfirmationScopeType = RecordScopeTypeV2.extract([
|
|
860
|
+
"record.action.accept",
|
|
861
|
+
"record.action.reject"
|
|
862
|
+
]);
|
|
863
|
+
var ActionConfirmationScopeOptions = AllRecordScopeOptions.describe(
|
|
864
|
+
"Options for confirming (accepting or rejecting) an action."
|
|
865
|
+
);
|
|
866
|
+
var RecordScopeV2 = z13.discriminatedUnion("type", [
|
|
867
|
+
z13.object({
|
|
761
868
|
type: ScopesWithPlaceEventOptions,
|
|
762
869
|
options: scopeOptionsPlaceEvent.optional()
|
|
763
870
|
}),
|
|
764
|
-
|
|
871
|
+
z13.object({
|
|
765
872
|
type: ScopesWithDeclaredOptions,
|
|
766
873
|
options: scopeOptionsDeclaredOrNotified.optional()
|
|
767
874
|
}),
|
|
768
|
-
|
|
875
|
+
z13.object({
|
|
769
876
|
type: ScopesWithFullOptions,
|
|
770
877
|
options: AllRecordScopeOptions.optional()
|
|
771
878
|
}),
|
|
772
|
-
|
|
773
|
-
type:
|
|
879
|
+
z13.object({
|
|
880
|
+
type: z13.literal("record.custom-action"),
|
|
774
881
|
options: CustomActionScopeOptions.optional()
|
|
775
882
|
}),
|
|
776
|
-
|
|
777
|
-
type:
|
|
883
|
+
z13.object({
|
|
884
|
+
type: z13.literal("record.print-certified-copies"),
|
|
778
885
|
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
886
|
+
}),
|
|
887
|
+
z13.object({
|
|
888
|
+
type: ActionConfirmationScopeType,
|
|
889
|
+
options: ActionConfirmationScopeOptions.optional()
|
|
779
890
|
})
|
|
780
891
|
]).describe(
|
|
781
892
|
"Scopes used to check user's permission to perform actions on a record."
|
|
782
893
|
);
|
|
783
|
-
var SystemScopeType =
|
|
894
|
+
var SystemScopeType = z13.enum([
|
|
784
895
|
"organisation.read-locations",
|
|
785
896
|
"user.read",
|
|
786
897
|
"user.create",
|
|
@@ -794,61 +905,61 @@ var UserScopeType = SystemScopeType.extract([
|
|
|
794
905
|
"user.search"
|
|
795
906
|
]);
|
|
796
907
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
797
|
-
var UserScopeV2 =
|
|
798
|
-
|
|
908
|
+
var UserScopeV2 = z13.discriminatedUnion("type", [
|
|
909
|
+
z13.object({
|
|
799
910
|
type: ScopesWithRoleOption,
|
|
800
911
|
options: AllUserScopeOptions.optional()
|
|
801
912
|
}),
|
|
802
|
-
|
|
913
|
+
z13.object({
|
|
803
914
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
804
915
|
options: AccessLevelOptions.optional()
|
|
805
916
|
})
|
|
806
917
|
]);
|
|
807
|
-
var ResolvedRecordScopeV2 =
|
|
808
|
-
|
|
918
|
+
var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
|
|
919
|
+
z13.object({
|
|
809
920
|
type: ScopesWithPlaceEventOptions,
|
|
810
921
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
811
922
|
}),
|
|
812
|
-
|
|
923
|
+
z13.object({
|
|
813
924
|
type: ScopesWithDeclaredOptions,
|
|
814
925
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
815
926
|
}),
|
|
816
|
-
|
|
927
|
+
z13.object({
|
|
817
928
|
type: ScopesWithFullOptions,
|
|
818
929
|
options: ResolvedScopeOptionsFull.optional()
|
|
819
930
|
}),
|
|
820
|
-
|
|
821
|
-
type:
|
|
931
|
+
z13.object({
|
|
932
|
+
type: z13.literal("record.print-certified-copies"),
|
|
822
933
|
options: ResolvedScopeOptionsFull.extend({
|
|
823
|
-
templates:
|
|
934
|
+
templates: z13.array(z13.string()).optional()
|
|
824
935
|
}).optional()
|
|
825
936
|
})
|
|
826
937
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
827
|
-
var Scope =
|
|
828
|
-
|
|
938
|
+
var Scope = z13.discriminatedUnion("type", [
|
|
939
|
+
z13.object({ type: PlainScopeType }),
|
|
829
940
|
...RecordScopeV2.options,
|
|
830
941
|
...UserScopeV2.options,
|
|
831
|
-
|
|
832
|
-
type:
|
|
942
|
+
z13.object({
|
|
943
|
+
type: z13.literal("organisation.read-locations"),
|
|
833
944
|
options: AccessLevelOptions.optional()
|
|
834
945
|
}),
|
|
835
|
-
|
|
836
|
-
type:
|
|
946
|
+
z13.object({
|
|
947
|
+
type: z13.literal("workqueue"),
|
|
837
948
|
options: WorkqueueOrDashboardOptions
|
|
838
949
|
}),
|
|
839
|
-
|
|
840
|
-
type:
|
|
950
|
+
z13.object({
|
|
951
|
+
type: z13.literal("dashboard.view"),
|
|
841
952
|
options: WorkqueueOrDashboardOptions
|
|
842
953
|
})
|
|
843
954
|
]);
|
|
844
|
-
var ScopeType =
|
|
955
|
+
var ScopeType = z13.enum([
|
|
845
956
|
...SystemScopeType.options,
|
|
846
957
|
...RecordScopeTypeV2.options,
|
|
847
958
|
...PlainScopeType.options,
|
|
848
959
|
"workqueue",
|
|
849
960
|
"dashboard.view"
|
|
850
961
|
]);
|
|
851
|
-
var EncodedScope =
|
|
962
|
+
var EncodedScope = z13.string().brand("EncodedScope");
|
|
852
963
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
853
964
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
854
965
|
accessLevel: JurisdictionFilter.enum.all,
|
|
@@ -858,30 +969,25 @@ var DEFAULT_SCOPE_OPTIONS = {
|
|
|
858
969
|
};
|
|
859
970
|
|
|
860
971
|
// ../commons/src/authentication.ts
|
|
861
|
-
var TokenUserType =
|
|
862
|
-
var TokenWithBearer =
|
|
972
|
+
var TokenUserType = z14.enum(["user", "system"]);
|
|
973
|
+
var TokenWithBearer = z14.string().regex(/^Bearer\s/);
|
|
863
974
|
|
|
864
975
|
// ../commons/src/events/ActionDocument.ts
|
|
865
|
-
var ActionUpdate =
|
|
976
|
+
var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
|
|
866
977
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
867
978
|
);
|
|
868
|
-
var EventState =
|
|
979
|
+
var EventState = z15.record(z15.string(), FieldValue).describe(
|
|
869
980
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
870
981
|
);
|
|
871
|
-
var
|
|
872
|
-
Requested: "Requested",
|
|
873
|
-
Accepted: "Accepted",
|
|
874
|
-
Rejected: "Rejected"
|
|
875
|
-
};
|
|
876
|
-
var ActionBase = z13.object({
|
|
982
|
+
var ActionBase = z15.object({
|
|
877
983
|
id: UUID.describe("Unique identifier of the action."),
|
|
878
|
-
transactionId:
|
|
984
|
+
transactionId: z15.string().describe("Unique identifier of the transaction."),
|
|
879
985
|
createdByUserType: TokenUserType.describe(
|
|
880
986
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
881
987
|
),
|
|
882
|
-
createdAt:
|
|
883
|
-
createdBy:
|
|
884
|
-
createdByRole:
|
|
988
|
+
createdAt: z15.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
989
|
+
createdBy: z15.string().describe("Identifier of the user who created the action."),
|
|
990
|
+
createdByRole: z15.string().optional().describe("Role of the user who created the action."),
|
|
885
991
|
createdBySignature: DocumentPath.nullish().describe(
|
|
886
992
|
"Reference to the signature of the user who created the action."
|
|
887
993
|
),
|
|
@@ -893,7 +999,7 @@ var ActionBase = z13.object({
|
|
|
893
999
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
894
1000
|
),
|
|
895
1001
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
896
|
-
status:
|
|
1002
|
+
status: z15.enum([
|
|
897
1003
|
ActionStatus.Requested,
|
|
898
1004
|
ActionStatus.Accepted,
|
|
899
1005
|
ActionStatus.Rejected
|
|
@@ -905,139 +1011,143 @@ var ActionBase = z13.object({
|
|
|
905
1011
|
)
|
|
906
1012
|
});
|
|
907
1013
|
var AssignedAction = ActionBase.extend(
|
|
908
|
-
|
|
909
|
-
type:
|
|
910
|
-
assignedTo:
|
|
1014
|
+
z15.object({
|
|
1015
|
+
type: z15.literal(ActionType.ASSIGN),
|
|
1016
|
+
assignedTo: z15.string().describe("Identifier of the user to whom the action is assigned.")
|
|
911
1017
|
// TODO move into 'content' property
|
|
912
1018
|
}).shape
|
|
913
1019
|
);
|
|
914
1020
|
var UnassignedAction = ActionBase.extend(
|
|
915
|
-
|
|
916
|
-
type:
|
|
1021
|
+
z15.object({
|
|
1022
|
+
type: z15.literal(ActionType.UNASSIGN)
|
|
917
1023
|
}).shape
|
|
918
1024
|
);
|
|
919
1025
|
var RegisterAction = ActionBase.extend(
|
|
920
|
-
|
|
921
|
-
type:
|
|
922
|
-
registrationNumber:
|
|
1026
|
+
z15.object({
|
|
1027
|
+
type: z15.literal(ActionType.REGISTER),
|
|
1028
|
+
registrationNumber: z15.string().optional().describe(
|
|
923
1029
|
"Registration number of the event. Always present for accepted registrations."
|
|
924
1030
|
)
|
|
925
1031
|
// TODO move into 'content' property
|
|
926
1032
|
}).shape
|
|
927
1033
|
);
|
|
928
1034
|
var DeclareAction = ActionBase.extend(
|
|
929
|
-
|
|
930
|
-
type:
|
|
1035
|
+
z15.object({
|
|
1036
|
+
type: z15.literal(ActionType.DECLARE)
|
|
931
1037
|
}).shape
|
|
932
1038
|
);
|
|
933
|
-
var ReasonContent =
|
|
934
|
-
reason:
|
|
1039
|
+
var ReasonContent = z15.object({
|
|
1040
|
+
reason: z15.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
935
1041
|
"Message describing the reason for rejecting or archiving the event."
|
|
936
1042
|
)
|
|
937
1043
|
});
|
|
938
1044
|
var RejectAction = ActionBase.extend(
|
|
939
|
-
|
|
940
|
-
type:
|
|
1045
|
+
z15.object({
|
|
1046
|
+
type: z15.literal(ActionType.REJECT),
|
|
941
1047
|
content: ReasonContent
|
|
942
1048
|
}).shape
|
|
943
1049
|
);
|
|
944
|
-
var PotentialDuplicate =
|
|
1050
|
+
var PotentialDuplicate = z15.object({
|
|
945
1051
|
id: UUID,
|
|
946
|
-
trackingId:
|
|
1052
|
+
trackingId: z15.string()
|
|
947
1053
|
});
|
|
948
1054
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
949
|
-
|
|
950
|
-
type:
|
|
951
|
-
content:
|
|
952
|
-
duplicates:
|
|
1055
|
+
z15.object({
|
|
1056
|
+
type: z15.literal(ActionType.DUPLICATE_DETECTED),
|
|
1057
|
+
content: z15.object({
|
|
1058
|
+
duplicates: z15.array(PotentialDuplicate)
|
|
953
1059
|
})
|
|
954
1060
|
}).shape
|
|
955
1061
|
);
|
|
956
1062
|
var MarkNotDuplicateAction = ActionBase.extend(
|
|
957
|
-
|
|
958
|
-
type:
|
|
1063
|
+
z15.object({
|
|
1064
|
+
type: z15.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
959
1065
|
}).shape
|
|
960
1066
|
);
|
|
961
1067
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
962
|
-
|
|
963
|
-
type:
|
|
964
|
-
content:
|
|
1068
|
+
z15.object({
|
|
1069
|
+
type: z15.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1070
|
+
content: z15.object({
|
|
965
1071
|
duplicateOf: UUID
|
|
966
1072
|
}).optional()
|
|
967
1073
|
}).shape
|
|
968
1074
|
);
|
|
969
1075
|
var ArchiveAction = ActionBase.extend(
|
|
970
|
-
|
|
971
|
-
type:
|
|
972
|
-
|
|
1076
|
+
z15.object({
|
|
1077
|
+
type: z15.literal(ActionType.ARCHIVE),
|
|
1078
|
+
/**
|
|
1079
|
+
* Archiving does not collect a reason on its own. Only the
|
|
1080
|
+
* "mark as duplicate" flow archives with a reason attached.
|
|
1081
|
+
*/
|
|
1082
|
+
content: ReasonContent.optional()
|
|
973
1083
|
}).shape
|
|
974
1084
|
);
|
|
975
1085
|
var UnarchiveAction = ActionBase.extend(
|
|
976
|
-
|
|
977
|
-
type:
|
|
1086
|
+
z15.object({
|
|
1087
|
+
type: z15.literal(ActionType.UNARCHIVE)
|
|
978
1088
|
}).shape
|
|
979
1089
|
);
|
|
980
1090
|
var CreatedAction = ActionBase.extend(
|
|
981
|
-
|
|
982
|
-
type:
|
|
1091
|
+
z15.object({
|
|
1092
|
+
type: z15.literal(ActionType.CREATE)
|
|
983
1093
|
}).shape
|
|
984
1094
|
);
|
|
985
1095
|
var NotifiedAction = ActionBase.extend(
|
|
986
|
-
|
|
987
|
-
type:
|
|
1096
|
+
z15.object({
|
|
1097
|
+
type: z15.literal(ActionType.NOTIFY)
|
|
988
1098
|
}).shape
|
|
989
1099
|
);
|
|
990
1100
|
var EditAction = ActionBase.extend(
|
|
991
|
-
|
|
992
|
-
type:
|
|
1101
|
+
z15.object({
|
|
1102
|
+
type: z15.literal(ActionType.EDIT),
|
|
993
1103
|
/** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
|
|
994
|
-
content:
|
|
995
|
-
comment:
|
|
1104
|
+
content: z15.object({
|
|
1105
|
+
comment: z15.string().describe("Comment for the edit action.").optional()
|
|
996
1106
|
}).optional()
|
|
997
1107
|
}).shape
|
|
998
1108
|
);
|
|
999
|
-
var PrintContent =
|
|
1000
|
-
templateId:
|
|
1109
|
+
var PrintContent = z15.object({
|
|
1110
|
+
templateId: z15.string().optional()
|
|
1001
1111
|
});
|
|
1002
1112
|
var PrintCertificateAction = ActionBase.extend(
|
|
1003
|
-
|
|
1004
|
-
type:
|
|
1113
|
+
z15.object({
|
|
1114
|
+
type: z15.literal(ActionType.PRINT_CERTIFICATE),
|
|
1005
1115
|
content: PrintContent.optional().nullable()
|
|
1006
1116
|
}).shape
|
|
1007
1117
|
);
|
|
1008
1118
|
var RequestedCorrectionAction = ActionBase.extend(
|
|
1009
|
-
|
|
1010
|
-
type:
|
|
1119
|
+
z15.object({
|
|
1120
|
+
type: z15.literal(ActionType.REQUEST_CORRECTION)
|
|
1011
1121
|
}).shape
|
|
1012
1122
|
);
|
|
1013
1123
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1014
|
-
|
|
1015
|
-
type:
|
|
1016
|
-
requestId:
|
|
1124
|
+
z15.object({
|
|
1125
|
+
type: z15.literal(ActionType.APPROVE_CORRECTION),
|
|
1126
|
+
requestId: UUID,
|
|
1017
1127
|
// TODO move into 'content' property
|
|
1018
|
-
content:
|
|
1128
|
+
content: z15.object({ immediateCorrection: z15.boolean().optional() }).optional()
|
|
1019
1129
|
}).shape
|
|
1020
1130
|
);
|
|
1021
1131
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1022
|
-
|
|
1023
|
-
type:
|
|
1024
|
-
requestId:
|
|
1132
|
+
z15.object({
|
|
1133
|
+
type: z15.literal(ActionType.REJECT_CORRECTION),
|
|
1134
|
+
requestId: UUID,
|
|
1025
1135
|
// TODO move into 'content' property
|
|
1026
1136
|
content: ReasonContent
|
|
1027
1137
|
}).shape
|
|
1028
1138
|
);
|
|
1029
1139
|
var ReadAction = ActionBase.extend(
|
|
1030
|
-
|
|
1031
|
-
type:
|
|
1140
|
+
z15.object({
|
|
1141
|
+
type: z15.literal(ActionType.READ)
|
|
1032
1142
|
}).shape
|
|
1033
1143
|
);
|
|
1034
1144
|
var CustomAction = ActionBase.merge(
|
|
1035
|
-
|
|
1036
|
-
type:
|
|
1037
|
-
customActionType:
|
|
1145
|
+
z15.object({
|
|
1146
|
+
type: z15.literal(ActionType.CUSTOM),
|
|
1147
|
+
customActionType: z15.string()
|
|
1038
1148
|
})
|
|
1039
1149
|
);
|
|
1040
|
-
var ActionDocument =
|
|
1150
|
+
var ActionDocument = z15.discriminatedUnion("type", [
|
|
1041
1151
|
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1042
1152
|
RejectAction.meta({ id: "RejectAction" }),
|
|
1043
1153
|
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
@@ -1064,109 +1174,50 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1064
1174
|
declaration: true,
|
|
1065
1175
|
annotation: true
|
|
1066
1176
|
}).extend(
|
|
1067
|
-
|
|
1068
|
-
type:
|
|
1069
|
-
status:
|
|
1177
|
+
z15.object({
|
|
1178
|
+
type: z15.enum(ConfirmableActions),
|
|
1179
|
+
status: z15.literal(ActionStatus.Rejected)
|
|
1070
1180
|
}).shape
|
|
1071
1181
|
);
|
|
1072
|
-
var Action =
|
|
1073
|
-
|
|
1074
|
-
// ../commons/src/events/Flag.ts
|
|
1075
|
-
var z14 = __toESM(require("zod/v4"));
|
|
1076
|
-
var InherentFlags = {
|
|
1077
|
-
INCOMPLETE: "incomplete",
|
|
1078
|
-
REJECTED: "rejected",
|
|
1079
|
-
CORRECTION_REQUESTED: "correction-requested",
|
|
1080
|
-
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
1081
|
-
/**
|
|
1082
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1083
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1084
|
-
*
|
|
1085
|
-
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
1086
|
-
*/
|
|
1087
|
-
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1088
|
-
};
|
|
1089
|
-
var ActionFlag = z14.string().regex(
|
|
1090
|
-
new RegExp(
|
|
1091
|
-
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1092
|
-
ActionStatus
|
|
1093
|
-
).join("|").toLowerCase()})$`
|
|
1094
|
-
),
|
|
1095
|
-
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1096
|
-
);
|
|
1097
|
-
var CustomFlag = z14.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
1098
|
-
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
1099
|
-
InherentFlags
|
|
1100
|
-
).join(", ")}`
|
|
1101
|
-
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
1102
|
-
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1103
|
-
}).describe("Custom flag identifier defined by the country config.");
|
|
1104
|
-
var Flag = ActionFlag.or(z14.enum(InherentFlags)).or(CustomFlag);
|
|
1105
|
-
var FlagConfig = z14.object({
|
|
1106
|
-
id: CustomFlag,
|
|
1107
|
-
requiresAction: z14.boolean().describe(
|
|
1108
|
-
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1109
|
-
),
|
|
1110
|
-
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1111
|
-
}).meta({
|
|
1112
|
-
id: "FlagConfig",
|
|
1113
|
-
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1114
|
-
});
|
|
1115
|
-
var ActionFlagConfig = z14.object({
|
|
1116
|
-
id: Flag,
|
|
1117
|
-
operation: z14.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1118
|
-
conditional: Conditional.optional().describe(
|
|
1119
|
-
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1120
|
-
)
|
|
1121
|
-
}).meta({
|
|
1122
|
-
id: "ActionFlagConfig",
|
|
1123
|
-
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1124
|
-
});
|
|
1182
|
+
var Action = z15.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1125
1183
|
|
|
1126
1184
|
// ../commons/src/events/EventMetadata.ts
|
|
1127
|
-
var
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
"
|
|
1131
|
-
"
|
|
1132
|
-
"ARCHIVED"
|
|
1133
|
-
]);
|
|
1134
|
-
var ZodDate = z15.iso.date();
|
|
1135
|
-
var ZodDateTime = z15.string().datetime();
|
|
1136
|
-
var ActionCreationMetadata = z15.object({
|
|
1137
|
-
createdAt: z15.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1138
|
-
createdBy: z15.string().describe("ID of the user who created the action request."),
|
|
1185
|
+
var ZodDate = z16.iso.date();
|
|
1186
|
+
var ZodDateTime = z16.string().datetime();
|
|
1187
|
+
var ActionCreationMetadata = z16.object({
|
|
1188
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1189
|
+
createdBy: z16.string().describe("ID of the user who created the action request."),
|
|
1139
1190
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1140
1191
|
createdAtLocation: UUID.nullish().describe(
|
|
1141
1192
|
"Location of the user who created the action request."
|
|
1142
1193
|
),
|
|
1143
|
-
createdByUserType:
|
|
1144
|
-
acceptedAt:
|
|
1145
|
-
createdByRole:
|
|
1194
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1195
|
+
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1196
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1146
1197
|
});
|
|
1147
1198
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1148
|
-
registrationNumber:
|
|
1199
|
+
registrationNumber: z16.string().describe(
|
|
1149
1200
|
"Registration number of the event. Always present for accepted registrations."
|
|
1150
1201
|
)
|
|
1151
1202
|
});
|
|
1152
|
-
var LegalStatuses =
|
|
1203
|
+
var LegalStatuses = z16.object({
|
|
1153
1204
|
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1154
1205
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1155
1206
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1156
1207
|
});
|
|
1157
|
-
var EventMetadata =
|
|
1208
|
+
var EventMetadata = z16.object({
|
|
1158
1209
|
id: UUID,
|
|
1159
|
-
type:
|
|
1210
|
+
type: z16.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1160
1211
|
status: EventStatus,
|
|
1161
1212
|
legalStatuses: LegalStatuses.describe(
|
|
1162
1213
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1163
1214
|
),
|
|
1164
|
-
createdAt:
|
|
1215
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1165
1216
|
dateOfEvent: ZodDate.nullish(),
|
|
1166
1217
|
placeOfEvent: UUID.nullish(),
|
|
1167
|
-
createdBy:
|
|
1168
|
-
createdByUserType:
|
|
1169
|
-
updatedByUserRole:
|
|
1218
|
+
createdBy: z16.string().describe("ID of the user who created the event."),
|
|
1219
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1220
|
+
updatedByUserRole: z16.string().nullish().describe("Role of the user who last changed the status."),
|
|
1170
1221
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1171
1222
|
createdAtLocation: UUID.nullish().describe(
|
|
1172
1223
|
"Location of the user who created the event."
|
|
@@ -1174,18 +1225,18 @@ var EventMetadata = z15.object({
|
|
|
1174
1225
|
updatedAtLocation: UUID.nullish().describe(
|
|
1175
1226
|
"Location of the user who last changed the status."
|
|
1176
1227
|
),
|
|
1177
|
-
updatedAt:
|
|
1228
|
+
updatedAt: z16.iso.datetime().describe(
|
|
1178
1229
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1179
1230
|
),
|
|
1180
|
-
assignedTo:
|
|
1181
|
-
updatedBy:
|
|
1182
|
-
trackingId:
|
|
1231
|
+
assignedTo: z16.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1232
|
+
updatedBy: z16.string().nullish().describe("ID of the user who last changed the status."),
|
|
1233
|
+
trackingId: z16.string().describe(
|
|
1183
1234
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1184
1235
|
),
|
|
1185
|
-
potentialDuplicates:
|
|
1236
|
+
potentialDuplicates: z16.array(PotentialDuplicate).describe(
|
|
1186
1237
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1187
1238
|
),
|
|
1188
|
-
flags:
|
|
1239
|
+
flags: z16.array(Flag)
|
|
1189
1240
|
});
|
|
1190
1241
|
var EventMetadataKeysArray = [
|
|
1191
1242
|
"id",
|
|
@@ -1206,8 +1257,8 @@ var EventMetadataKeysArray = [
|
|
|
1206
1257
|
"legalStatuses",
|
|
1207
1258
|
"flags"
|
|
1208
1259
|
];
|
|
1209
|
-
var EventMetadataKeys =
|
|
1210
|
-
var EventMetadataDateFieldIdInput =
|
|
1260
|
+
var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
1261
|
+
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1211
1262
|
"createdAt",
|
|
1212
1263
|
"updatedAt",
|
|
1213
1264
|
"legalStatuses.NOTIFIED.createdAt",
|
|
@@ -1217,7 +1268,7 @@ var EventMetadataDateFieldIdInput = z15.enum([
|
|
|
1217
1268
|
"legalStatuses.REGISTERED.createdAt",
|
|
1218
1269
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
1219
1270
|
]);
|
|
1220
|
-
var EventMetadataDateFieldId =
|
|
1271
|
+
var EventMetadataDateFieldId = z16.enum([
|
|
1221
1272
|
"event.createdAt",
|
|
1222
1273
|
"event.updatedAt",
|
|
1223
1274
|
"event.legalStatuses.NOTIFIED.createdAt",
|
|
@@ -1282,13 +1333,6 @@ var Range = import_v4.z.object({
|
|
|
1282
1333
|
}).meta({
|
|
1283
1334
|
id: "Range"
|
|
1284
1335
|
});
|
|
1285
|
-
var ContainsFlags = import_v4.z.object({
|
|
1286
|
-
anyOf: import_v4.z.array(Flag).optional(),
|
|
1287
|
-
noneOf: import_v4.z.array(Flag).optional(),
|
|
1288
|
-
allOf: import_v4.z.array(Flag).optional()
|
|
1289
|
-
}).meta({
|
|
1290
|
-
id: "ContainsFlags"
|
|
1291
|
-
});
|
|
1292
1336
|
var Within = import_v4.z.object({ type: import_v4.z.literal("within"), location: import_v4.z.string() }).meta({
|
|
1293
1337
|
id: "Within"
|
|
1294
1338
|
});
|
|
@@ -1483,8 +1527,8 @@ var BaseField = import_v43.default.object({
|
|
|
1483
1527
|
conditionals: import_v43.default.array(FieldConditional).default([]).optional().describe(
|
|
1484
1528
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1485
1529
|
),
|
|
1486
|
-
secured: import_v43.default.boolean().default(false).optional().describe(
|
|
1487
|
-
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1530
|
+
secured: import_v43.default.union([import_v43.default.boolean(), Conditional]).default(false).optional().describe(
|
|
1531
|
+
"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."
|
|
1488
1532
|
),
|
|
1489
1533
|
placeholder: TranslationConfig.optional(),
|
|
1490
1534
|
validation: import_v43.default.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
@@ -1882,7 +1926,13 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
1882
1926
|
configuration: import_v43.default.object({
|
|
1883
1927
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
1884
1928
|
type: AdministrativeAreas,
|
|
1885
|
-
allowedLocations: AllowedLocations
|
|
1929
|
+
allowedLocations: AllowedLocations,
|
|
1930
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1931
|
+
"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."
|
|
1932
|
+
),
|
|
1933
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
1934
|
+
"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."
|
|
1935
|
+
)
|
|
1886
1936
|
}).describe("Administrative area options")
|
|
1887
1937
|
}).meta({
|
|
1888
1938
|
description: "Administrative area input field",
|
|
@@ -1893,7 +1943,13 @@ var LocationInput = BaseField.extend({
|
|
|
1893
1943
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1894
1944
|
configuration: import_v43.default.object({
|
|
1895
1945
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1896
|
-
allowedLocations: AllowedLocations
|
|
1946
|
+
allowedLocations: AllowedLocations,
|
|
1947
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1948
|
+
"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."
|
|
1949
|
+
),
|
|
1950
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
1951
|
+
"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."
|
|
1952
|
+
)
|
|
1897
1953
|
}).optional()
|
|
1898
1954
|
}).meta({
|
|
1899
1955
|
description: "A field for selecting a location",
|
|
@@ -1919,12 +1975,20 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1919
1975
|
var Facility = BaseField.extend({
|
|
1920
1976
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1921
1977
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1922
|
-
configuration: import_v43.default.object({
|
|
1978
|
+
configuration: import_v43.default.object({
|
|
1979
|
+
allowedLocations: AllowedLocations,
|
|
1980
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
1981
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
1982
|
+
}).optional()
|
|
1923
1983
|
}).describe("Input field for a facility");
|
|
1924
1984
|
var Office = BaseField.extend({
|
|
1925
1985
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1926
1986
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1927
|
-
configuration: import_v43.default.object({
|
|
1987
|
+
configuration: import_v43.default.object({
|
|
1988
|
+
allowedLocations: AllowedLocations,
|
|
1989
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
1990
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
1991
|
+
}).optional()
|
|
1928
1992
|
}).describe("Input field for an office");
|
|
1929
1993
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1930
1994
|
administrativeArea: import_v43.default.union([UUID, SerializedUserField]).optional()
|
|
@@ -1957,7 +2021,13 @@ var Address = BaseField.extend({
|
|
|
1957
2021
|
parent: FieldReference.optional()
|
|
1958
2022
|
})
|
|
1959
2023
|
).optional(),
|
|
1960
|
-
allowedLocations: AllowedLocations
|
|
2024
|
+
allowedLocations: AllowedLocations,
|
|
2025
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2026
|
+
"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."
|
|
2027
|
+
),
|
|
2028
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
2029
|
+
"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."
|
|
2030
|
+
)
|
|
1961
2031
|
}).optional(),
|
|
1962
2032
|
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1963
2033
|
}).meta({
|
|
@@ -2012,10 +2082,19 @@ var ButtonField = BaseField.extend({
|
|
|
2012
2082
|
description: "A generic button that can be used to trigger an action",
|
|
2013
2083
|
id: "ButtonField"
|
|
2014
2084
|
});
|
|
2085
|
+
var FieldGroupConfiguration = import_v43.default.object({
|
|
2086
|
+
separator: import_v43.default.string().optional().describe(
|
|
2087
|
+
'Joins the subfield values when the group is rendered as output, e.g. ", ". Defaults to one subfield per line.'
|
|
2088
|
+
),
|
|
2089
|
+
hideEmptyFields: import_v43.default.boolean().default(false).optional().describe(
|
|
2090
|
+
"Leaves subfields without a value out of the output. Pair it with a separator so the separator does not double up around the gaps."
|
|
2091
|
+
)
|
|
2092
|
+
});
|
|
2015
2093
|
var FieldGroup = BaseField.extend({
|
|
2016
2094
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2017
2095
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2018
|
-
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2096
|
+
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig)),
|
|
2097
|
+
configuration: FieldGroupConfiguration.optional()
|
|
2019
2098
|
}).meta({
|
|
2020
2099
|
description: "A group of fields that are displayed together",
|
|
2021
2100
|
id: "FieldGroup"
|
|
@@ -2258,7 +2337,7 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
2258
2337
|
]);
|
|
2259
2338
|
|
|
2260
2339
|
// ../commons/src/application-config.ts
|
|
2261
|
-
var SearchCriteria =
|
|
2340
|
+
var SearchCriteria = z21.enum([
|
|
2262
2341
|
"TRACKING_ID",
|
|
2263
2342
|
"REGISTRATION_NUMBER",
|
|
2264
2343
|
"NATIONAL_ID",
|
|
@@ -2266,69 +2345,67 @@ var SearchCriteria = z20.enum([
|
|
|
2266
2345
|
"PHONE_NUMBER",
|
|
2267
2346
|
"EMAIL"
|
|
2268
2347
|
]);
|
|
2269
|
-
var ApplicationConfig =
|
|
2270
|
-
APPLICATION_NAME:
|
|
2271
|
-
COUNTRY_LOGO:
|
|
2272
|
-
fileName:
|
|
2273
|
-
file:
|
|
2348
|
+
var ApplicationConfig = z21.object({
|
|
2349
|
+
APPLICATION_NAME: z21.string(),
|
|
2350
|
+
COUNTRY_LOGO: z21.object({
|
|
2351
|
+
fileName: z21.string(),
|
|
2352
|
+
file: z21.string()
|
|
2274
2353
|
}),
|
|
2275
|
-
SYSTEM_IANA_TIMEZONE:
|
|
2276
|
-
CURRENCY:
|
|
2277
|
-
languagesAndCountry:
|
|
2278
|
-
isoCode:
|
|
2354
|
+
SYSTEM_IANA_TIMEZONE: z21.string(),
|
|
2355
|
+
CURRENCY: z21.object({
|
|
2356
|
+
languagesAndCountry: z21.array(z21.string()),
|
|
2357
|
+
isoCode: z21.string()
|
|
2279
2358
|
}),
|
|
2280
|
-
ADMIN_STRUCTURE:
|
|
2281
|
-
|
|
2282
|
-
id:
|
|
2359
|
+
ADMIN_STRUCTURE: z21.array(
|
|
2360
|
+
z21.object({
|
|
2361
|
+
id: z21.string(),
|
|
2283
2362
|
label: TranslationConfig
|
|
2284
2363
|
})
|
|
2285
2364
|
),
|
|
2286
|
-
PHONE_NUMBER_PATTERN:
|
|
2287
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2288
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2365
|
+
PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
|
|
2366
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2367
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2289
2368
|
SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
|
|
2290
|
-
ADDITIONAL_USER_FIELDS:
|
|
2369
|
+
ADDITIONAL_USER_FIELDS: z21.array(FieldConfig).optional().default([])
|
|
2291
2370
|
});
|
|
2292
2371
|
var defineApplicationConfig = (config) => {
|
|
2293
2372
|
return ApplicationConfig.parse(config);
|
|
2294
2373
|
};
|
|
2295
|
-
var BackgroundConfig =
|
|
2296
|
-
backgroundColor:
|
|
2297
|
-
backgroundImage:
|
|
2298
|
-
imageFit:
|
|
2374
|
+
var BackgroundConfig = z21.object({
|
|
2375
|
+
backgroundColor: z21.string().optional(),
|
|
2376
|
+
backgroundImage: z21.string().optional(),
|
|
2377
|
+
imageFit: z21.string().optional()
|
|
2299
2378
|
}).refine(
|
|
2300
2379
|
(data) => !!(data.backgroundColor || data.backgroundImage),
|
|
2301
2380
|
"backgroundColor and backgroundImage cannot be empty at the same time"
|
|
2302
2381
|
);
|
|
2303
|
-
var LoginConfig =
|
|
2304
|
-
COUNTRY:
|
|
2305
|
-
LANGUAGES:
|
|
2306
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2307
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2308
|
-
PHONE_NUMBER_PATTERN:
|
|
2309
|
-
LOGIN_BACKGROUND: BackgroundConfig
|
|
2310
|
-
SENTRY: z20.string().optional()
|
|
2382
|
+
var LoginConfig = z21.object({
|
|
2383
|
+
COUNTRY: z21.string(),
|
|
2384
|
+
LANGUAGES: z21.array(z21.string()),
|
|
2385
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2386
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2387
|
+
PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
|
|
2388
|
+
LOGIN_BACKGROUND: BackgroundConfig
|
|
2311
2389
|
});
|
|
2312
2390
|
var defineLoginConfig = (config) => {
|
|
2313
2391
|
return LoginConfig.parse(config);
|
|
2314
2392
|
};
|
|
2315
|
-
var ClientConfig =
|
|
2316
|
-
COUNTRY:
|
|
2317
|
-
LANGUAGES:
|
|
2318
|
-
|
|
2319
|
-
LOGIN_URL: z20.string().optional(),
|
|
2393
|
+
var ClientConfig = z21.object({
|
|
2394
|
+
COUNTRY: z21.string(),
|
|
2395
|
+
LANGUAGES: z21.array(z21.string()),
|
|
2396
|
+
LOGIN_URL: z21.string().optional(),
|
|
2320
2397
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2321
|
-
DASHBOARDS:
|
|
2322
|
-
|
|
2323
|
-
id:
|
|
2398
|
+
DASHBOARDS: z21.array(
|
|
2399
|
+
z21.object({
|
|
2400
|
+
id: z21.string(),
|
|
2324
2401
|
title: TranslationConfig,
|
|
2325
|
-
url:
|
|
2326
|
-
context:
|
|
2327
|
-
auth:
|
|
2402
|
+
url: z21.string(),
|
|
2403
|
+
context: z21.object({
|
|
2404
|
+
auth: z21.literal("REQUEST_AUTH_TOKEN")
|
|
2328
2405
|
}).optional()
|
|
2329
2406
|
})
|
|
2330
2407
|
),
|
|
2331
|
-
FEATURES:
|
|
2408
|
+
FEATURES: z21.object({ V2_EVENTS: z21.boolean().optional().default(true) }).optional().default({ V2_EVENTS: true })
|
|
2332
2409
|
});
|
|
2333
2410
|
var defineClientConfig = (config) => {
|
|
2334
2411
|
return ClientConfig.parse(config);
|