@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
|
@@ -47,7 +47,7 @@ __export(conditionals_exports, {
|
|
|
47
47
|
user: () => user
|
|
48
48
|
});
|
|
49
49
|
module.exports = __toCommonJS(conditionals_exports);
|
|
50
|
-
var
|
|
50
|
+
var z13 = __toESM(require("zod/v4"));
|
|
51
51
|
|
|
52
52
|
// ../commons/src/conditionals/conditionals.ts
|
|
53
53
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -124,7 +124,7 @@ function todayDateTimeValueSerializer() {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
// ../commons/src/scopes.ts
|
|
127
|
-
var
|
|
127
|
+
var z11 = __toESM(require("zod/v4"));
|
|
128
128
|
var qs = __toESM(require("qs"));
|
|
129
129
|
|
|
130
130
|
// ../commons/src/uuid.ts
|
|
@@ -138,12 +138,276 @@ var z5 = __toESM(require("zod/v4"));
|
|
|
138
138
|
var TokenUserType = z5.enum(["user", "system"]);
|
|
139
139
|
var TokenWithBearer = z5.string().regex(/^Bearer\s/);
|
|
140
140
|
|
|
141
|
+
// ../commons/src/events/ActionType.ts
|
|
142
|
+
var z6 = __toESM(require("zod/v4"));
|
|
143
|
+
var ActionType = {
|
|
144
|
+
// Pre-declaration actions
|
|
145
|
+
DELETE: "DELETE",
|
|
146
|
+
CREATE: "CREATE",
|
|
147
|
+
NOTIFY: "NOTIFY",
|
|
148
|
+
// Declaration actions
|
|
149
|
+
DECLARE: "DECLARE",
|
|
150
|
+
REGISTER: "REGISTER",
|
|
151
|
+
EDIT: "EDIT",
|
|
152
|
+
// Declaration system actions. Non-configurable.
|
|
153
|
+
DUPLICATE_DETECTED: "DUPLICATE_DETECTED",
|
|
154
|
+
REJECT: "REJECT",
|
|
155
|
+
// REJECT_DECLARATION
|
|
156
|
+
MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE",
|
|
157
|
+
MARK_AS_NOT_DUPLICATE: "MARK_AS_NOT_DUPLICATE",
|
|
158
|
+
ARCHIVE: "ARCHIVE",
|
|
159
|
+
UNARCHIVE: "UNARCHIVE",
|
|
160
|
+
// Record actions
|
|
161
|
+
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
|
162
|
+
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
|
163
|
+
REJECT_CORRECTION: "REJECT_CORRECTION",
|
|
164
|
+
APPROVE_CORRECTION: "APPROVE_CORRECTION",
|
|
165
|
+
REVOKE_REGISTRATION: "REVOKE_REGISTRATION",
|
|
166
|
+
REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION",
|
|
167
|
+
// General actions
|
|
168
|
+
READ: "READ",
|
|
169
|
+
ASSIGN: "ASSIGN",
|
|
170
|
+
UNASSIGN: "UNASSIGN",
|
|
171
|
+
// Custom action
|
|
172
|
+
CUSTOM: "CUSTOM"
|
|
173
|
+
};
|
|
174
|
+
var ConfirmableActions = [
|
|
175
|
+
ActionType.NOTIFY,
|
|
176
|
+
ActionType.DECLARE,
|
|
177
|
+
ActionType.EDIT,
|
|
178
|
+
ActionType.REGISTER,
|
|
179
|
+
ActionType.REJECT,
|
|
180
|
+
ActionType.ARCHIVE,
|
|
181
|
+
ActionType.UNARCHIVE,
|
|
182
|
+
ActionType.PRINT_CERTIFICATE,
|
|
183
|
+
ActionType.REQUEST_CORRECTION,
|
|
184
|
+
ActionType.APPROVE_CORRECTION,
|
|
185
|
+
ActionType.REJECT_CORRECTION,
|
|
186
|
+
ActionType.REVOKE_REGISTRATION,
|
|
187
|
+
ActionType.REINSTATE_REGISTRATION,
|
|
188
|
+
ActionType.CUSTOM
|
|
189
|
+
];
|
|
190
|
+
var ActionTypes = z6.enum([
|
|
191
|
+
"DELETE",
|
|
192
|
+
"CREATE",
|
|
193
|
+
"NOTIFY",
|
|
194
|
+
"DECLARE",
|
|
195
|
+
"EDIT",
|
|
196
|
+
"REGISTER",
|
|
197
|
+
"DUPLICATE_DETECTED",
|
|
198
|
+
"REJECT",
|
|
199
|
+
"MARK_AS_DUPLICATE",
|
|
200
|
+
"MARK_AS_NOT_DUPLICATE",
|
|
201
|
+
"ARCHIVE",
|
|
202
|
+
"UNARCHIVE",
|
|
203
|
+
"PRINT_CERTIFICATE",
|
|
204
|
+
"REQUEST_CORRECTION",
|
|
205
|
+
"REJECT_CORRECTION",
|
|
206
|
+
"APPROVE_CORRECTION",
|
|
207
|
+
"REVOKE_REGISTRATION",
|
|
208
|
+
"REINSTATE_REGISTRATION",
|
|
209
|
+
"READ",
|
|
210
|
+
"ASSIGN",
|
|
211
|
+
"UNASSIGN",
|
|
212
|
+
"CUSTOM"
|
|
213
|
+
]);
|
|
214
|
+
var declarationActionValues = [
|
|
215
|
+
ActionTypes.enum.DECLARE,
|
|
216
|
+
ActionTypes.enum.EDIT,
|
|
217
|
+
ActionTypes.enum.REGISTER,
|
|
218
|
+
ActionTypes.enum.NOTIFY,
|
|
219
|
+
ActionTypes.enum.DUPLICATE_DETECTED
|
|
220
|
+
];
|
|
221
|
+
var DeclarationActions = ActionTypes.extract(declarationActionValues);
|
|
222
|
+
var declarationUpdateActionValues = [
|
|
223
|
+
...declarationActionValues,
|
|
224
|
+
ActionTypes.enum.REQUEST_CORRECTION
|
|
225
|
+
];
|
|
226
|
+
var DeclarationUpdateActions = ActionTypes.extract(
|
|
227
|
+
declarationUpdateActionValues
|
|
228
|
+
);
|
|
229
|
+
var annotationActions = ActionTypes.exclude(declarationActionValues);
|
|
230
|
+
var writeActions = ActionTypes.exclude([
|
|
231
|
+
ActionType.CREATE,
|
|
232
|
+
ActionType.READ,
|
|
233
|
+
ActionType.ASSIGN,
|
|
234
|
+
ActionType.UNASSIGN
|
|
235
|
+
]);
|
|
236
|
+
var WorkqueueActionType = ActionTypes.extract([
|
|
237
|
+
ActionType.READ,
|
|
238
|
+
ActionType.DELETE,
|
|
239
|
+
ActionType.DECLARE,
|
|
240
|
+
ActionType.REGISTER,
|
|
241
|
+
ActionType.EDIT,
|
|
242
|
+
ActionType.REJECT,
|
|
243
|
+
ActionType.MARK_AS_DUPLICATE,
|
|
244
|
+
ActionType.ARCHIVE,
|
|
245
|
+
ActionType.UNARCHIVE,
|
|
246
|
+
ActionType.PRINT_CERTIFICATE,
|
|
247
|
+
ActionType.REQUEST_CORRECTION,
|
|
248
|
+
ActionType.REVOKE_REGISTRATION,
|
|
249
|
+
ActionType.REINSTATE_REGISTRATION
|
|
250
|
+
]);
|
|
251
|
+
var META_ACTIONS = [
|
|
252
|
+
ActionType.ASSIGN,
|
|
253
|
+
ActionType.UNASSIGN,
|
|
254
|
+
ActionType.READ
|
|
255
|
+
];
|
|
256
|
+
|
|
257
|
+
// ../commons/src/events/ActionStatus.ts
|
|
258
|
+
var ActionStatus = {
|
|
259
|
+
Requested: "Requested",
|
|
260
|
+
Accepted: "Accepted",
|
|
261
|
+
Rejected: "Rejected"
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
// ../commons/src/events/Flag.ts
|
|
265
|
+
var z9 = __toESM(require("zod/v4"));
|
|
266
|
+
|
|
267
|
+
// ../commons/src/events/TranslationConfig.ts
|
|
268
|
+
var z7 = __toESM(require("zod/v4"));
|
|
269
|
+
var TranslationConfig = z7.object({
|
|
270
|
+
id: z7.string().describe(
|
|
271
|
+
"The identifier of the translation referred in translation CSV files"
|
|
272
|
+
),
|
|
273
|
+
defaultMessage: z7.string().describe("Default translation message"),
|
|
274
|
+
description: z7.string().describe(
|
|
275
|
+
"Describe the translation for a translator to be able to identify it."
|
|
276
|
+
)
|
|
277
|
+
}).meta({
|
|
278
|
+
description: "Translation configuration",
|
|
279
|
+
id: "TranslationConfig"
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// ../commons/src/events/Conditional.ts
|
|
283
|
+
var z8 = __toESM(require("zod/v4"));
|
|
284
|
+
var Conditional = z8.any().describe("JSONSchema").meta({
|
|
285
|
+
description: "JSON schema conditional configuration",
|
|
286
|
+
id: "Conditional"
|
|
287
|
+
});
|
|
288
|
+
var ConditionalType = {
|
|
289
|
+
SHOW: "SHOW",
|
|
290
|
+
ENABLE: "ENABLE",
|
|
291
|
+
DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
|
|
292
|
+
};
|
|
293
|
+
var ShowConditional = z8.object({
|
|
294
|
+
type: z8.literal(ConditionalType.SHOW),
|
|
295
|
+
conditional: Conditional
|
|
296
|
+
}).describe(
|
|
297
|
+
"If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
|
|
298
|
+
);
|
|
299
|
+
var EnableConditional = z8.object({
|
|
300
|
+
type: z8.literal(ConditionalType.ENABLE),
|
|
301
|
+
conditional: Conditional
|
|
302
|
+
}).describe(
|
|
303
|
+
"If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
|
|
304
|
+
);
|
|
305
|
+
var ActionConditional = z8.discriminatedUnion("type", [
|
|
306
|
+
// Action can be shown / hidden
|
|
307
|
+
ShowConditional,
|
|
308
|
+
// Action can be shown to the user in the list but as disabled
|
|
309
|
+
EnableConditional
|
|
310
|
+
]).meta({
|
|
311
|
+
id: "ActionConditional",
|
|
312
|
+
description: "Conditional gating whether an action is shown (SHOW) or enabled (ENABLE). When omitted from an action, the action is shown and enabled for everyone."
|
|
313
|
+
});
|
|
314
|
+
var DisplayOnReviewConditional = z8.object({
|
|
315
|
+
type: z8.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
316
|
+
conditional: Conditional
|
|
317
|
+
}).describe(
|
|
318
|
+
"If 'DISPLAY_ON_REVIEW' conditional is defined, the component is shown on the review page only if both the 'DISPLAY_ON_REVIEW' and 'SHOW' conditions are met. This should only be used for fields within declaration forms, as they are the only ones with review pages."
|
|
319
|
+
);
|
|
320
|
+
var FieldConditional = z8.discriminatedUnion("type", [
|
|
321
|
+
// Field input can be shown / hidden
|
|
322
|
+
ShowConditional,
|
|
323
|
+
// Field input can be shown to the user but as disabled
|
|
324
|
+
EnableConditional,
|
|
325
|
+
// Field output can be shown / hidden on the review page
|
|
326
|
+
DisplayOnReviewConditional
|
|
327
|
+
]).meta({
|
|
328
|
+
id: "FieldConditional",
|
|
329
|
+
description: "Conditional gating whether a form field is shown (SHOW), enabled (ENABLE), or displayed on the review page (DISPLAY_ON_REVIEW). When omitted, the field is shown and enabled for everyone, and is displayed on review whenever it has a value."
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
// ../commons/src/events/Flag.ts
|
|
333
|
+
var InherentFlags = {
|
|
334
|
+
INCOMPLETE: "incomplete",
|
|
335
|
+
REJECTED: "rejected",
|
|
336
|
+
CORRECTION_REQUESTED: "correction-requested",
|
|
337
|
+
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
338
|
+
/**
|
|
339
|
+
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
340
|
+
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
341
|
+
*
|
|
342
|
+
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
343
|
+
*/
|
|
344
|
+
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
345
|
+
};
|
|
346
|
+
var actionFlagPattern;
|
|
347
|
+
function getActionFlagPattern() {
|
|
348
|
+
actionFlagPattern ??= new RegExp(
|
|
349
|
+
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
350
|
+
ActionStatus
|
|
351
|
+
).join("|").toLowerCase()})$`
|
|
352
|
+
);
|
|
353
|
+
return actionFlagPattern;
|
|
354
|
+
}
|
|
355
|
+
var ActionFlag = z9.string().refine((value) => getActionFlagPattern().test(value), {
|
|
356
|
+
message: "Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
357
|
+
});
|
|
358
|
+
var CustomFlag = z9.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
359
|
+
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
360
|
+
InherentFlags
|
|
361
|
+
).join(", ")}`
|
|
362
|
+
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
363
|
+
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
364
|
+
}).describe("Custom flag identifier defined by the country config.");
|
|
365
|
+
var Flag = ActionFlag.or(z9.enum(InherentFlags)).or(CustomFlag);
|
|
366
|
+
var ContainsFlags = z9.object({
|
|
367
|
+
anyOf: z9.array(Flag).optional(),
|
|
368
|
+
noneOf: z9.array(Flag).optional(),
|
|
369
|
+
allOf: z9.array(Flag).optional()
|
|
370
|
+
}).meta({
|
|
371
|
+
id: "ContainsFlags"
|
|
372
|
+
});
|
|
373
|
+
var FlagConfig = z9.object({
|
|
374
|
+
id: CustomFlag,
|
|
375
|
+
requiresAction: z9.boolean().describe(
|
|
376
|
+
"Indicates if this flag expects an action to be performed to be cleared."
|
|
377
|
+
),
|
|
378
|
+
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
379
|
+
}).meta({
|
|
380
|
+
id: "FlagConfig",
|
|
381
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
382
|
+
});
|
|
383
|
+
var ActionFlagConfig = z9.object({
|
|
384
|
+
id: Flag,
|
|
385
|
+
operation: z9.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
386
|
+
conditional: Conditional.optional().describe(
|
|
387
|
+
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
388
|
+
)
|
|
389
|
+
}).meta({
|
|
390
|
+
id: "ActionFlagConfig",
|
|
391
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
// ../commons/src/events/EventStatus.ts
|
|
395
|
+
var z10 = __toESM(require("zod/v4"));
|
|
396
|
+
var EventStatus = z10.enum([
|
|
397
|
+
"CREATED",
|
|
398
|
+
"NOTIFIED",
|
|
399
|
+
"DECLARED",
|
|
400
|
+
"REGISTERED",
|
|
401
|
+
"REVOKED",
|
|
402
|
+
"ARCHIVED"
|
|
403
|
+
]);
|
|
404
|
+
|
|
141
405
|
// ../commons/src/scopes.ts
|
|
142
|
-
var JurisdictionFilter =
|
|
406
|
+
var JurisdictionFilter = z11.enum(["administrativeArea", "location", "all"]).describe(
|
|
143
407
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
144
408
|
);
|
|
145
|
-
var UserFilter =
|
|
146
|
-
var RecordScopeTypeV2 =
|
|
409
|
+
var UserFilter = z11.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
410
|
+
var RecordScopeTypeV2 = z11.enum([
|
|
147
411
|
"record.search",
|
|
148
412
|
"record.create",
|
|
149
413
|
"record.read",
|
|
@@ -158,94 +422,114 @@ var RecordScopeTypeV2 = z6.enum([
|
|
|
158
422
|
"record.print-certified-copies",
|
|
159
423
|
"record.request-correction",
|
|
160
424
|
"record.correct",
|
|
425
|
+
"record.revoke-registration",
|
|
426
|
+
"record.reinstate-registration",
|
|
161
427
|
"record.unassign-others",
|
|
162
|
-
"record.custom-action"
|
|
428
|
+
"record.custom-action",
|
|
429
|
+
"record.action.accept",
|
|
430
|
+
"record.action.reject"
|
|
163
431
|
]);
|
|
164
|
-
var PlainScopeType =
|
|
432
|
+
var PlainScopeType = z11.enum([
|
|
165
433
|
// Misc. system scopes
|
|
166
434
|
"bypassratelimit",
|
|
167
435
|
"record.reindex",
|
|
168
436
|
"user.data-seeding",
|
|
169
437
|
"integration.create",
|
|
438
|
+
// Reading an integration's audit log. Deliberately separate from
|
|
439
|
+
// 'integration.create' so read-only oversight can be granted on its own, and
|
|
440
|
+
// deliberately option-less: system clients have no office and no
|
|
441
|
+
// administrative area, so jurisdiction options would have nothing to bind to.
|
|
442
|
+
"integration.audit.read",
|
|
170
443
|
"record.import",
|
|
171
444
|
"config.update-all",
|
|
445
|
+
"location.edit",
|
|
172
446
|
"attachment.upload",
|
|
173
447
|
"profile.electronic-signature",
|
|
174
448
|
"user.read-only-my-audit",
|
|
175
449
|
// Performance dashboard
|
|
176
450
|
"performance.read",
|
|
177
451
|
"performance.read-dashboards",
|
|
178
|
-
"performance.vital-statistics-export"
|
|
179
|
-
// Scopes used exclusively by countryconfig integration token
|
|
180
|
-
"record.confirm-registration",
|
|
181
|
-
"record.reject-registration"
|
|
452
|
+
"performance.vital-statistics-export"
|
|
182
453
|
]);
|
|
183
|
-
var scopeByEvent =
|
|
454
|
+
var scopeByEvent = z11.preprocess(
|
|
184
455
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
185
|
-
|
|
456
|
+
z11.array(z11.string()).optional()
|
|
186
457
|
).describe("Event type, e.g. birth, death");
|
|
187
|
-
var
|
|
458
|
+
var scopeByStatus = z11.preprocess(
|
|
459
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
460
|
+
z11.array(EventStatus).optional()
|
|
461
|
+
).describe(
|
|
462
|
+
"Restricts the scope to records currently in one of these statuses."
|
|
463
|
+
);
|
|
464
|
+
var userRole = z11.preprocess(
|
|
188
465
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
189
|
-
|
|
466
|
+
z11.array(z11.string()).optional()
|
|
190
467
|
).describe("User role, e.g. admin, field agent");
|
|
191
|
-
var scopeOptionsPlaceEvent =
|
|
468
|
+
var scopeOptionsPlaceEvent = z11.object({
|
|
192
469
|
event: scopeByEvent,
|
|
193
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
470
|
+
placeOfEvent: JurisdictionFilter.optional(),
|
|
471
|
+
createdBy: UserFilter.optional(),
|
|
472
|
+
createdIn: JurisdictionFilter.optional()
|
|
194
473
|
}).describe("Options applicable to all record scopes.");
|
|
195
474
|
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
196
475
|
notifiedIn: JurisdictionFilter.optional(),
|
|
197
476
|
notifiedBy: UserFilter.optional(),
|
|
198
477
|
declaredIn: JurisdictionFilter.optional(),
|
|
199
|
-
declaredBy: UserFilter.optional()
|
|
478
|
+
declaredBy: UserFilter.optional(),
|
|
479
|
+
status: scopeByStatus
|
|
200
480
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
201
481
|
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
202
482
|
registeredIn: JurisdictionFilter.optional(),
|
|
203
|
-
registeredBy: UserFilter.optional()
|
|
483
|
+
registeredBy: UserFilter.optional(),
|
|
484
|
+
flags: ContainsFlags.optional()
|
|
204
485
|
}).describe(
|
|
205
486
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
206
487
|
);
|
|
207
488
|
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
208
|
-
customActionTypes:
|
|
489
|
+
customActionTypes: z11.preprocess(
|
|
209
490
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
210
|
-
|
|
491
|
+
z11.array(z11.string()).optional()
|
|
211
492
|
).describe("Allowed custom action types")
|
|
212
493
|
});
|
|
213
|
-
var AccessLevelOptions =
|
|
494
|
+
var AccessLevelOptions = z11.object({
|
|
214
495
|
accessLevel: JurisdictionFilter.optional()
|
|
215
496
|
});
|
|
216
497
|
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
217
498
|
role: userRole.optional()
|
|
218
499
|
});
|
|
219
|
-
var WorkqueueOrDashboardOptions =
|
|
220
|
-
ids:
|
|
500
|
+
var WorkqueueOrDashboardOptions = z11.object({
|
|
501
|
+
ids: z11.preprocess(
|
|
221
502
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
222
|
-
|
|
503
|
+
z11.array(z11.string())
|
|
223
504
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
224
505
|
});
|
|
225
|
-
var AllScopeOptions =
|
|
506
|
+
var AllScopeOptions = z11.object({
|
|
226
507
|
...AllRecordScopeOptions.shape,
|
|
227
508
|
...AccessLevelOptions.shape,
|
|
228
509
|
...AllUserScopeOptions.shape,
|
|
229
510
|
...WorkqueueOrDashboardOptions.shape
|
|
230
511
|
});
|
|
231
512
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
232
|
-
var ResolvedScopeOptionsPlaceEvent =
|
|
513
|
+
var ResolvedScopeOptionsPlaceEvent = z11.object({
|
|
233
514
|
event: scopeByEvent,
|
|
234
|
-
placeOfEvent: UUID.nullish()
|
|
515
|
+
placeOfEvent: UUID.nullish(),
|
|
516
|
+
createdBy: z11.string().optional(),
|
|
517
|
+
createdIn: UUID.nullish()
|
|
235
518
|
}).describe(
|
|
236
519
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
237
520
|
);
|
|
238
521
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
239
522
|
notifiedIn: UUID.nullish(),
|
|
240
|
-
notifiedBy:
|
|
523
|
+
notifiedBy: z11.string().optional(),
|
|
241
524
|
declaredIn: UUID.nullish(),
|
|
242
|
-
declaredBy:
|
|
525
|
+
declaredBy: z11.string().optional()
|
|
243
526
|
}).describe(
|
|
244
527
|
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
245
528
|
);
|
|
246
529
|
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
247
530
|
registeredIn: UUID.nullish(),
|
|
248
|
-
registeredBy:
|
|
531
|
+
registeredBy: z11.string().optional(),
|
|
532
|
+
flags: ContainsFlags.optional()
|
|
249
533
|
}).describe(
|
|
250
534
|
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
251
535
|
);
|
|
@@ -259,7 +543,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
259
543
|
"record.reject",
|
|
260
544
|
"record.archive",
|
|
261
545
|
"record.unarchive",
|
|
262
|
-
"record.review-duplicates",
|
|
263
546
|
"record.register"
|
|
264
547
|
]);
|
|
265
548
|
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
@@ -267,41 +550,55 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
267
550
|
"record.read",
|
|
268
551
|
"record.request-correction",
|
|
269
552
|
"record.correct",
|
|
270
|
-
"record.
|
|
553
|
+
"record.revoke-registration",
|
|
554
|
+
"record.reinstate-registration",
|
|
555
|
+
"record.unassign-others",
|
|
556
|
+
"record.review-duplicates"
|
|
271
557
|
]);
|
|
272
558
|
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
273
|
-
templates:
|
|
559
|
+
templates: z11.preprocess(
|
|
274
560
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
275
|
-
|
|
561
|
+
z11.array(z11.string()).optional()
|
|
276
562
|
).describe(
|
|
277
563
|
"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."
|
|
278
564
|
)
|
|
279
565
|
});
|
|
280
|
-
var
|
|
281
|
-
|
|
566
|
+
var ActionConfirmationScopeType = RecordScopeTypeV2.extract([
|
|
567
|
+
"record.action.accept",
|
|
568
|
+
"record.action.reject"
|
|
569
|
+
]);
|
|
570
|
+
var ActionConfirmationScopeOptions = AllRecordScopeOptions.describe(
|
|
571
|
+
"Options for confirming (accepting or rejecting) an action."
|
|
572
|
+
);
|
|
573
|
+
var RecordScopeV2 = z11.discriminatedUnion("type", [
|
|
574
|
+
z11.object({
|
|
282
575
|
type: ScopesWithPlaceEventOptions,
|
|
283
576
|
options: scopeOptionsPlaceEvent.optional()
|
|
284
577
|
}),
|
|
285
|
-
|
|
578
|
+
z11.object({
|
|
286
579
|
type: ScopesWithDeclaredOptions,
|
|
287
580
|
options: scopeOptionsDeclaredOrNotified.optional()
|
|
288
581
|
}),
|
|
289
|
-
|
|
582
|
+
z11.object({
|
|
290
583
|
type: ScopesWithFullOptions,
|
|
291
584
|
options: AllRecordScopeOptions.optional()
|
|
292
585
|
}),
|
|
293
|
-
|
|
294
|
-
type:
|
|
586
|
+
z11.object({
|
|
587
|
+
type: z11.literal("record.custom-action"),
|
|
295
588
|
options: CustomActionScopeOptions.optional()
|
|
296
589
|
}),
|
|
297
|
-
|
|
298
|
-
type:
|
|
590
|
+
z11.object({
|
|
591
|
+
type: z11.literal("record.print-certified-copies"),
|
|
299
592
|
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
593
|
+
}),
|
|
594
|
+
z11.object({
|
|
595
|
+
type: ActionConfirmationScopeType,
|
|
596
|
+
options: ActionConfirmationScopeOptions.optional()
|
|
300
597
|
})
|
|
301
598
|
]).describe(
|
|
302
599
|
"Scopes used to check user's permission to perform actions on a record."
|
|
303
600
|
);
|
|
304
|
-
var SystemScopeType =
|
|
601
|
+
var SystemScopeType = z11.enum([
|
|
305
602
|
"organisation.read-locations",
|
|
306
603
|
"user.read",
|
|
307
604
|
"user.create",
|
|
@@ -315,61 +612,61 @@ var UserScopeType = SystemScopeType.extract([
|
|
|
315
612
|
"user.search"
|
|
316
613
|
]);
|
|
317
614
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
318
|
-
var UserScopeV2 =
|
|
319
|
-
|
|
615
|
+
var UserScopeV2 = z11.discriminatedUnion("type", [
|
|
616
|
+
z11.object({
|
|
320
617
|
type: ScopesWithRoleOption,
|
|
321
618
|
options: AllUserScopeOptions.optional()
|
|
322
619
|
}),
|
|
323
|
-
|
|
620
|
+
z11.object({
|
|
324
621
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
325
622
|
options: AccessLevelOptions.optional()
|
|
326
623
|
})
|
|
327
624
|
]);
|
|
328
|
-
var ResolvedRecordScopeV2 =
|
|
329
|
-
|
|
625
|
+
var ResolvedRecordScopeV2 = z11.discriminatedUnion("type", [
|
|
626
|
+
z11.object({
|
|
330
627
|
type: ScopesWithPlaceEventOptions,
|
|
331
628
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
332
629
|
}),
|
|
333
|
-
|
|
630
|
+
z11.object({
|
|
334
631
|
type: ScopesWithDeclaredOptions,
|
|
335
632
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
336
633
|
}),
|
|
337
|
-
|
|
634
|
+
z11.object({
|
|
338
635
|
type: ScopesWithFullOptions,
|
|
339
636
|
options: ResolvedScopeOptionsFull.optional()
|
|
340
637
|
}),
|
|
341
|
-
|
|
342
|
-
type:
|
|
638
|
+
z11.object({
|
|
639
|
+
type: z11.literal("record.print-certified-copies"),
|
|
343
640
|
options: ResolvedScopeOptionsFull.extend({
|
|
344
|
-
templates:
|
|
641
|
+
templates: z11.array(z11.string()).optional()
|
|
345
642
|
}).optional()
|
|
346
643
|
})
|
|
347
644
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
348
|
-
var Scope2 =
|
|
349
|
-
|
|
645
|
+
var Scope2 = z11.discriminatedUnion("type", [
|
|
646
|
+
z11.object({ type: PlainScopeType }),
|
|
350
647
|
...RecordScopeV2.options,
|
|
351
648
|
...UserScopeV2.options,
|
|
352
|
-
|
|
353
|
-
type:
|
|
649
|
+
z11.object({
|
|
650
|
+
type: z11.literal("organisation.read-locations"),
|
|
354
651
|
options: AccessLevelOptions.optional()
|
|
355
652
|
}),
|
|
356
|
-
|
|
357
|
-
type:
|
|
653
|
+
z11.object({
|
|
654
|
+
type: z11.literal("workqueue"),
|
|
358
655
|
options: WorkqueueOrDashboardOptions
|
|
359
656
|
}),
|
|
360
|
-
|
|
361
|
-
type:
|
|
657
|
+
z11.object({
|
|
658
|
+
type: z11.literal("dashboard.view"),
|
|
362
659
|
options: WorkqueueOrDashboardOptions
|
|
363
660
|
})
|
|
364
661
|
]);
|
|
365
|
-
var ScopeType2 =
|
|
662
|
+
var ScopeType2 = z11.enum([
|
|
366
663
|
...SystemScopeType.options,
|
|
367
664
|
...RecordScopeTypeV2.options,
|
|
368
665
|
...PlainScopeType.options,
|
|
369
666
|
"workqueue",
|
|
370
667
|
"dashboard.view"
|
|
371
668
|
]);
|
|
372
|
-
var EncodedScope2 =
|
|
669
|
+
var EncodedScope2 = z11.string().brand("EncodedScope");
|
|
373
670
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
374
671
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
375
672
|
accessLevel: JurisdictionFilter.enum.all,
|
|
@@ -1064,4 +1361,4 @@ function createFieldConditionals(fieldId) {
|
|
|
1064
1361
|
}
|
|
1065
1362
|
|
|
1066
1363
|
// src/conditionals/index.ts
|
|
1067
|
-
|
|
1364
|
+
z13.globalRegistry.clear();
|
package/dist/csv.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type CsvFile = {
|
|
2
|
+
header: string;
|
|
3
|
+
body: string[];
|
|
4
|
+
/** Preserved so a file written on Windows stays written on Windows. */
|
|
5
|
+
newline: string;
|
|
6
|
+
trailingNewline: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function parseCsvLine(line: string): string[];
|
|
9
|
+
export declare function toCsvLine(values: string[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* The id of a row, which is its first column. Translation ids never contain a
|
|
12
|
+
* comma or a quote, so this does not need the parser.
|
|
13
|
+
*/
|
|
14
|
+
export declare function idOf(line: string): string;
|
|
15
|
+
export declare function readCsvFile(path: string): CsvFile | undefined;
|
|
16
|
+
export declare function writeCsvFile(path: string, file: CsvFile): void;
|
|
17
|
+
/**
|
|
18
|
+
* Adds the rows the file does not already have an id for, in place. Rows go in
|
|
19
|
+
* sorted position when the file is sorted by id, and at the end when it is not,
|
|
20
|
+
* so a country config that keeps its own order keeps it.
|
|
21
|
+
*
|
|
22
|
+
* Returns the ids that were added.
|
|
23
|
+
*/
|
|
24
|
+
export declare function addRows(file: CsvFile, rows: string[]): string[];
|
|
25
|
+
//# sourceMappingURL=csv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../src/csv.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAiCnD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAMlD;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKzC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAe7D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAM9D;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA4B/D"}
|