@opencrvs/toolkit 1.9.12-rc.eae3bc3 → 1.9.12-rc.eca3bde
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/build.sh +8 -0
- package/dist/application-config/index.js +2045 -41
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2422 -0
- package/dist/commons/api/router.d.ts +337 -118
- package/dist/commons/application-config/index.d.ts +13 -16
- package/dist/commons/conditionals/conditionals.d.ts +8 -8
- package/dist/commons/events/ActionDocument.d.ts +196 -196
- package/dist/commons/events/ActionInput.d.ts +113 -113
- package/dist/commons/events/ActionType.d.ts +3 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
- package/dist/commons/events/AuditLog.d.ts +345 -163
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/CountryConfigQueryInput.d.ts +461 -190
- package/dist/commons/events/Draft.d.ts +9 -9
- package/dist/commons/events/DynamicFieldValue.d.ts +37 -19
- package/dist/commons/events/EventDocument.d.ts +80 -80
- package/dist/commons/events/EventIndex.d.ts +35 -27
- package/dist/commons/events/EventInput.d.ts +1 -1
- package/dist/commons/events/EventMetadata.d.ts +19 -19
- package/dist/commons/events/FieldConfig.d.ts +285 -69
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +98 -72
- package/dist/commons/events/FieldValue.d.ts +54 -26
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +7 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +443 -199
- package/dist/commons/events/defineConfig.d.ts +0 -4
- package/dist/commons/events/locations.d.ts +4 -4
- package/dist/commons/events/scopes.d.ts +3 -2
- package/dist/commons/events/state/index.d.ts +2 -2
- package/dist/commons/events/state/utils.d.ts +1 -1
- package/dist/commons/events/test.utils.d.ts +2 -2
- package/dist/commons/events/utils.d.ts +3 -175
- package/dist/commons/notification/UserNotifications.d.ts +6 -1
- package/dist/conditionals/index.js +74 -359
- package/dist/events/index.js +1194 -1261
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +753 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
- package/dist/migrations/v2.0/index.d.ts +7 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -0
- package/dist/migrations/v2.0/index.js +2361 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-scopes.js +281 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-api-paths.js +188 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
- package/dist/notification/index.js +1002 -1133
- package/dist/scopes/index.d.ts +389 -152
- package/dist/scopes/index.js +128 -322
- package/opencrvs-toolkit-1.9.12-rc.eca3bde.tgz +0 -0
- package/package.json +11 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-1.9.12-rc.eae3bc3.tgz +0 -0
|
@@ -46,7 +46,7 @@ __export(conditionals_exports, {
|
|
|
46
46
|
user: () => user
|
|
47
47
|
});
|
|
48
48
|
module.exports = __toCommonJS(conditionals_exports);
|
|
49
|
-
var
|
|
49
|
+
var z8 = __toESM(require("zod/v4"));
|
|
50
50
|
|
|
51
51
|
// ../commons/src/conditionals/conditionals.ts
|
|
52
52
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -131,210 +131,13 @@ var import_uuid = require("uuid");
|
|
|
131
131
|
var z4 = __toESM(require("zod/v4"));
|
|
132
132
|
var UUID = z4.uuid().brand("UUID");
|
|
133
133
|
|
|
134
|
-
// ../commons/src/
|
|
134
|
+
// ../commons/src/authentication.ts
|
|
135
|
+
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
135
136
|
var z5 = __toESM(require("zod/v4"));
|
|
136
|
-
var
|
|
137
|
-
var
|
|
138
|
-
var SearchScope = z5.object({
|
|
139
|
-
type: z5.literal("search"),
|
|
140
|
-
options: z5.object({
|
|
141
|
-
event: z5.array(z5.string()).length(1),
|
|
142
|
-
access: z5.array(z5.enum(["my-jurisdiction", "all"])).length(1)
|
|
143
|
-
})
|
|
144
|
-
});
|
|
145
|
-
var CreateUserScope = z5.object({
|
|
146
|
-
type: z5.literal("user.create"),
|
|
147
|
-
options: z5.object({
|
|
148
|
-
role: z5.array(z5.string())
|
|
149
|
-
})
|
|
150
|
-
});
|
|
151
|
-
var EditUserScope = z5.object({
|
|
152
|
-
type: z5.literal("user.edit"),
|
|
153
|
-
options: z5.object({
|
|
154
|
-
role: z5.array(z5.string())
|
|
155
|
-
})
|
|
156
|
-
});
|
|
157
|
-
var WorkqueueScope = z5.object({
|
|
158
|
-
type: z5.literal("workqueue"),
|
|
159
|
-
options: z5.object({
|
|
160
|
-
id: z5.array(z5.string())
|
|
161
|
-
})
|
|
162
|
-
});
|
|
163
|
-
var PrintCertifiedCopiesScope = z5.object({
|
|
164
|
-
type: z5.literal("record.registered.print-certified-copies"),
|
|
165
|
-
options: z5.object({
|
|
166
|
-
event: z5.array(z5.string()).describe("Event type, e.g. birth, death"),
|
|
167
|
-
templates: z5.array(z5.string()).optional().describe(
|
|
168
|
-
"Template IDs for certified copies. If not provided, all templates will be used."
|
|
169
|
-
)
|
|
170
|
-
})
|
|
171
|
-
});
|
|
172
|
-
var LegacyRecordScope = z5.object({
|
|
173
|
-
type: z5.enum([
|
|
174
|
-
"record.create",
|
|
175
|
-
"record.read",
|
|
176
|
-
"record.declare",
|
|
177
|
-
"record.notify",
|
|
178
|
-
"record.declared.edit",
|
|
179
|
-
"record.declared.validate",
|
|
180
|
-
"record.declared.reject",
|
|
181
|
-
"record.declared.archive",
|
|
182
|
-
"record.declared.review-duplicates",
|
|
183
|
-
"record.register",
|
|
184
|
-
"record.registered.request-correction",
|
|
185
|
-
"record.registered.correct",
|
|
186
|
-
"record.unassign-others"
|
|
187
|
-
]),
|
|
188
|
-
options: z5.object({
|
|
189
|
-
event: z5.array(z5.string()).describe("Event type, e.g. birth, death")
|
|
190
|
-
})
|
|
191
|
-
}).describe(
|
|
192
|
-
"Scopes used to check user's permission to perform actions on a record."
|
|
193
|
-
);
|
|
194
|
-
var ConfigurableRawScopes = z5.discriminatedUnion("type", [
|
|
195
|
-
SearchScope,
|
|
196
|
-
LegacyRecordScope,
|
|
197
|
-
PrintCertifiedCopiesScope,
|
|
198
|
-
CreateUserScope,
|
|
199
|
-
EditUserScope,
|
|
200
|
-
WorkqueueScope
|
|
201
|
-
]);
|
|
137
|
+
var TokenUserType = z5.enum(["user", "system"]);
|
|
138
|
+
var TokenWithBearer = z5.string().regex(/^Bearer\s/);
|
|
202
139
|
|
|
203
140
|
// ../commons/src/scopes.ts
|
|
204
|
-
var SCOPES = {
|
|
205
|
-
// TODO v1.8 legacy scopes
|
|
206
|
-
BYPASSRATELIMIT: "bypassratelimit",
|
|
207
|
-
REGISTER: "register",
|
|
208
|
-
DEMO: "demo",
|
|
209
|
-
CONFIG: "config",
|
|
210
|
-
// systems / integrations
|
|
211
|
-
WEBHOOK: "webhook",
|
|
212
|
-
NATIONALID: "nationalId",
|
|
213
|
-
NOTIFICATION_API: "notification-api",
|
|
214
|
-
RECORDSEARCH: "recordsearch",
|
|
215
|
-
RECORD_IMPORT: "record.import",
|
|
216
|
-
RECORD_EXPORT: "record.export",
|
|
217
|
-
RECORD_REINDEX: "record.reindex",
|
|
218
|
-
INTEGRATION_CREATE: "integration.create",
|
|
219
|
-
// declare
|
|
220
|
-
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
|
221
|
-
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
|
222
|
-
RECORD_DECLARE_DEATH: "record.declare-death",
|
|
223
|
-
RECORD_DECLARE_DEATH_MY_JURISDICTION: "record.declare-death:my-jurisdiction",
|
|
224
|
-
RECORD_DECLARE_MARRIAGE: "record.declare-marriage",
|
|
225
|
-
RECORD_DECLARE_MARRIAGE_MY_JURISDICTION: "record.declare-marriage:my-jurisdiction",
|
|
226
|
-
RECORD_SUBMIT_INCOMPLETE: "record.declaration-submit-incomplete",
|
|
227
|
-
// @todo: should this record be removed from events v2?
|
|
228
|
-
RECORD_SUBMIT_FOR_REVIEW: "record.declaration-submit-for-review",
|
|
229
|
-
RECORD_UNASSIGN_OTHERS: "record.unassign-others",
|
|
230
|
-
// validate
|
|
231
|
-
RECORD_SUBMIT_FOR_APPROVAL: "record.declaration-submit-for-approval",
|
|
232
|
-
RECORD_SUBMIT_FOR_UPDATES: "record.declaration-submit-for-updates",
|
|
233
|
-
RECORD_DECLARATION_EDIT: "record.declaration-edit",
|
|
234
|
-
RECORD_REVIEW_DUPLICATES: "record.review-duplicates",
|
|
235
|
-
RECORD_DECLARATION_ARCHIVE: "record.declaration-archive",
|
|
236
|
-
RECORD_DECLARATION_REINSTATE: "record.declaration-reinstate",
|
|
237
|
-
// register
|
|
238
|
-
RECORD_REGISTER: "record.register",
|
|
239
|
-
/**
|
|
240
|
-
* This scope is used to **print and **issue certified copies of a record
|
|
241
|
-
* after it has been registered. Previously Registrars had this permission.
|
|
242
|
-
*/
|
|
243
|
-
RECORD_PRINT_ISSUE_CERTIFIED_COPIES: "record.registration-print&issue-certified-copies",
|
|
244
|
-
// correct
|
|
245
|
-
RECORD_REGISTRATION_REQUEST_CORRECTION: "record.registration-request-correction",
|
|
246
|
-
RECORD_REGISTRATION_CORRECT: "record.registration-correct",
|
|
247
|
-
RECORD_CONFIRM_REGISTRATION: "record.confirm-registration",
|
|
248
|
-
RECORD_REJECT_REGISTRATION: "record.reject-registration",
|
|
249
|
-
// search
|
|
250
|
-
SEARCH_BIRTH_MY_JURISDICTION: "search.birth:my-jurisdiction",
|
|
251
|
-
SEARCH_BIRTH: "search.birth",
|
|
252
|
-
SEARCH_DEATH_MY_JURISDICTION: "search.death:my-jurisdiction",
|
|
253
|
-
SEARCH_DEATH: "search.death",
|
|
254
|
-
SEARCH_MARRIAGE_MY_JURISDICTION: "search.marriage:my-jurisdiction",
|
|
255
|
-
SEARCH_MARRIAGE: "search.marriage",
|
|
256
|
-
// audit v1.8
|
|
257
|
-
RECORD_READ: "record.read",
|
|
258
|
-
// profile
|
|
259
|
-
PROFILE_ELECTRONIC_SIGNATURE: "profile.electronic-signature",
|
|
260
|
-
// performance
|
|
261
|
-
PERFORMANCE_READ: "performance.read",
|
|
262
|
-
PERFORMANCE_READ_DASHBOARDS: "performance.read-dashboards",
|
|
263
|
-
PERFORMANCE_EXPORT_VITAL_STATISTICS: "performance.vital-statistics-export",
|
|
264
|
-
// organisation
|
|
265
|
-
ORGANISATION_READ_LOCATIONS: "organisation.read-locations:all",
|
|
266
|
-
ORGANISATION_READ_LOCATIONS_MY_OFFICE: "organisation.read-locations:my-office",
|
|
267
|
-
ORGANISATION_READ_LOCATIONS_MY_JURISDICTION: "organisation.read-locations:my-jurisdiction",
|
|
268
|
-
// user
|
|
269
|
-
USER_READ: "user.read:all",
|
|
270
|
-
USER_READ_MY_OFFICE: "user.read:my-office",
|
|
271
|
-
USER_READ_MY_JURISDICTION: "user.read:my-jurisdiction",
|
|
272
|
-
USER_READ_ONLY_MY_AUDIT: "user.read:only-my-audit",
|
|
273
|
-
//v1.8
|
|
274
|
-
USER_CREATE: "user.create:all",
|
|
275
|
-
USER_CREATE_MY_JURISDICTION: "user.create:my-jurisdiction",
|
|
276
|
-
USER_UPDATE: "user.update:all",
|
|
277
|
-
USER_UPDATE_MY_JURISDICTION: "user.update:my-jurisdiction",
|
|
278
|
-
// config
|
|
279
|
-
CONFIG_UPDATE_ALL: "config.update:all",
|
|
280
|
-
// data seeding
|
|
281
|
-
USER_DATA_SEEDING: "user.data-seeding",
|
|
282
|
-
// attachment
|
|
283
|
-
ATTACHMENT_UPLOAD: "attachment.upload"
|
|
284
|
-
};
|
|
285
|
-
var LegacyScopes = z6.union([
|
|
286
|
-
z6.literal(SCOPES.BYPASSRATELIMIT),
|
|
287
|
-
z6.literal(SCOPES.REGISTER),
|
|
288
|
-
z6.literal(SCOPES.DEMO),
|
|
289
|
-
z6.literal(SCOPES.CONFIG)
|
|
290
|
-
]);
|
|
291
|
-
var IntegrationScopes = z6.union([
|
|
292
|
-
z6.literal(SCOPES.WEBHOOK),
|
|
293
|
-
z6.literal(SCOPES.NATIONALID),
|
|
294
|
-
z6.literal(SCOPES.NOTIFICATION_API),
|
|
295
|
-
z6.literal(SCOPES.RECORDSEARCH),
|
|
296
|
-
z6.literal(SCOPES.INTEGRATION_CREATE)
|
|
297
|
-
]);
|
|
298
|
-
var InternalOperationsScopes = z6.union([
|
|
299
|
-
z6.literal(SCOPES.RECORD_REINDEX),
|
|
300
|
-
z6.literal(SCOPES.RECORD_IMPORT)
|
|
301
|
-
]);
|
|
302
|
-
var PerformanceScopes = z6.union([
|
|
303
|
-
z6.literal(SCOPES.PERFORMANCE_READ),
|
|
304
|
-
z6.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
305
|
-
z6.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
306
|
-
]);
|
|
307
|
-
var OrganisationScopes = z6.union([
|
|
308
|
-
z6.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
309
|
-
z6.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
310
|
-
z6.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
311
|
-
]);
|
|
312
|
-
var UserScopes = z6.union([
|
|
313
|
-
z6.literal(SCOPES.USER_READ),
|
|
314
|
-
z6.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
315
|
-
z6.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
316
|
-
z6.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
317
|
-
z6.literal(SCOPES.USER_CREATE),
|
|
318
|
-
z6.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
319
|
-
z6.literal(SCOPES.USER_UPDATE),
|
|
320
|
-
z6.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
321
|
-
]);
|
|
322
|
-
var ConfigScope = z6.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
323
|
-
var DataSeedingScope = z6.literal(SCOPES.USER_DATA_SEEDING);
|
|
324
|
-
var AttachmentScope = z6.literal(SCOPES.ATTACHMENT_UPLOAD);
|
|
325
|
-
var LiteralScopes = z6.union([
|
|
326
|
-
LegacyScopes,
|
|
327
|
-
IntegrationScopes,
|
|
328
|
-
z6.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
329
|
-
z6.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
330
|
-
PerformanceScopes,
|
|
331
|
-
OrganisationScopes,
|
|
332
|
-
UserScopes,
|
|
333
|
-
ConfigScope,
|
|
334
|
-
DataSeedingScope,
|
|
335
|
-
InternalOperationsScopes,
|
|
336
|
-
AttachmentScope
|
|
337
|
-
]);
|
|
338
141
|
var JurisdictionFilter = z6.enum(["administrativeArea", "location", "all"]).describe(
|
|
339
142
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
340
143
|
);
|
|
@@ -356,6 +159,25 @@ var RecordScopeTypeV2 = z6.enum([
|
|
|
356
159
|
"record.unassign-others",
|
|
357
160
|
"record.custom-action"
|
|
358
161
|
]);
|
|
162
|
+
var PlainScopeType = z6.enum([
|
|
163
|
+
// Misc. system scopes
|
|
164
|
+
"bypassratelimit",
|
|
165
|
+
"record.reindex",
|
|
166
|
+
"user.data-seeding",
|
|
167
|
+
"integration.create",
|
|
168
|
+
"record.import",
|
|
169
|
+
"config.update-all",
|
|
170
|
+
"attachment.upload",
|
|
171
|
+
"profile.electronic-signature",
|
|
172
|
+
"user.read-only-my-audit",
|
|
173
|
+
// Performance dashboard
|
|
174
|
+
"performance.read",
|
|
175
|
+
"performance.read-dashboards",
|
|
176
|
+
"performance.vital-statistics-export",
|
|
177
|
+
// Scopes used exclusively by countryconfig integration token
|
|
178
|
+
"record.confirm-registration",
|
|
179
|
+
"record.reject-registration"
|
|
180
|
+
]);
|
|
359
181
|
var scopeByEvent = z6.preprocess(
|
|
360
182
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
361
183
|
z6.array(z6.string()).optional()
|
|
@@ -368,19 +190,33 @@ var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
|
368
190
|
declaredIn: JurisdictionFilter.optional(),
|
|
369
191
|
declaredBy: UserFilter.optional()
|
|
370
192
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
371
|
-
var
|
|
193
|
+
var AllRecordScopeOptions = scopeOptionsDeclared.extend({
|
|
372
194
|
registeredIn: JurisdictionFilter.optional(),
|
|
373
195
|
registeredBy: UserFilter.optional()
|
|
374
196
|
}).describe(
|
|
375
197
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
376
198
|
);
|
|
377
|
-
var CustomActionScopeOptions =
|
|
199
|
+
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
378
200
|
customActionTypes: z6.preprocess(
|
|
379
201
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
380
202
|
z6.array(z6.string()).optional()
|
|
381
203
|
).describe("Allowed custom action types")
|
|
382
204
|
});
|
|
383
|
-
var
|
|
205
|
+
var AccessLevelOptions = z6.object({
|
|
206
|
+
accessLevel: JurisdictionFilter.optional()
|
|
207
|
+
});
|
|
208
|
+
var WorkqueueOrDashboardOptions = z6.object({
|
|
209
|
+
ids: z6.preprocess(
|
|
210
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
211
|
+
z6.array(z6.string())
|
|
212
|
+
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
213
|
+
});
|
|
214
|
+
var AllScopeOptions = z6.object({
|
|
215
|
+
...AllRecordScopeOptions.shape,
|
|
216
|
+
...AccessLevelOptions.shape,
|
|
217
|
+
...WorkqueueOrDashboardOptions.shape
|
|
218
|
+
});
|
|
219
|
+
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
384
220
|
var ResolvedScopeOptionsPlaceEvent = z6.object({
|
|
385
221
|
event: scopeByEvent,
|
|
386
222
|
placeOfEvent: UUID.nullish()
|
|
@@ -418,7 +254,7 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
418
254
|
"record.correct",
|
|
419
255
|
"record.unassign-others"
|
|
420
256
|
]);
|
|
421
|
-
var ScopeOptionsPrintCertifiedCopies =
|
|
257
|
+
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
422
258
|
templates: z6.preprocess(
|
|
423
259
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
424
260
|
z6.array(z6.string()).optional()
|
|
@@ -437,7 +273,7 @@ var RecordScopeV2 = z6.discriminatedUnion("type", [
|
|
|
437
273
|
}),
|
|
438
274
|
z6.object({
|
|
439
275
|
type: ScopesWithFullOptions,
|
|
440
|
-
options:
|
|
276
|
+
options: AllRecordScopeOptions.optional()
|
|
441
277
|
}),
|
|
442
278
|
z6.object({
|
|
443
279
|
type: z6.literal("record.custom-action"),
|
|
@@ -470,163 +306,42 @@ var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
|
|
|
470
306
|
}).optional()
|
|
471
307
|
})
|
|
472
308
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
309
|
+
var SystemScopeType = z6.enum([
|
|
310
|
+
"organisation.read-locations",
|
|
311
|
+
"user.read",
|
|
312
|
+
"user.create",
|
|
313
|
+
"user.edit"
|
|
314
|
+
]);
|
|
315
|
+
var Scope2 = z6.discriminatedUnion("type", [
|
|
316
|
+
z6.object({ type: PlainScopeType }),
|
|
317
|
+
...RecordScopeV2.options,
|
|
318
|
+
z6.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
|
|
319
|
+
z6.object({
|
|
320
|
+
type: z6.literal("workqueue"),
|
|
321
|
+
options: WorkqueueOrDashboardOptions
|
|
322
|
+
}),
|
|
323
|
+
z6.object({
|
|
324
|
+
type: z6.literal("dashboard.view"),
|
|
325
|
+
options: WorkqueueOrDashboardOptions
|
|
326
|
+
})
|
|
327
|
+
]);
|
|
328
|
+
var ScopeType2 = z6.enum([
|
|
329
|
+
...SystemScopeType.options,
|
|
330
|
+
...RecordScopeTypeV2.options,
|
|
331
|
+
...PlainScopeType.options,
|
|
332
|
+
"workqueue",
|
|
333
|
+
"dashboard.view"
|
|
334
|
+
]);
|
|
335
|
+
var EncodedScope2 = z6.string().brand("EncodedScope");
|
|
486
336
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
487
|
-
placeOfEvent: JurisdictionFilter.enum.all
|
|
337
|
+
placeOfEvent: JurisdictionFilter.enum.all,
|
|
338
|
+
accessLevel: JurisdictionFilter.enum.all
|
|
488
339
|
};
|
|
489
340
|
|
|
490
|
-
// ../commons/src/authentication.ts
|
|
491
|
-
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
492
|
-
var z7 = __toESM(require("zod/v4"));
|
|
493
|
-
var DEFAULT_ROLES_DEFINITION = [
|
|
494
|
-
{
|
|
495
|
-
id: "FIELD_AGENT",
|
|
496
|
-
label: {
|
|
497
|
-
defaultMessage: "Field Agent",
|
|
498
|
-
description: "Name for user role Field Agent",
|
|
499
|
-
id: "userRole.fieldAgent"
|
|
500
|
-
},
|
|
501
|
-
scopes: [
|
|
502
|
-
encodeScope({
|
|
503
|
-
type: "record.create",
|
|
504
|
-
options: {
|
|
505
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
506
|
-
}
|
|
507
|
-
}),
|
|
508
|
-
encodeScope({
|
|
509
|
-
type: "record.declare",
|
|
510
|
-
options: {
|
|
511
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
512
|
-
}
|
|
513
|
-
})
|
|
514
|
-
]
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
id: "REGISTRATION_AGENT",
|
|
518
|
-
label: {
|
|
519
|
-
defaultMessage: "Registration Agent",
|
|
520
|
-
description: "Name for user role Registration Agent",
|
|
521
|
-
id: "userRole.registrationAgent"
|
|
522
|
-
},
|
|
523
|
-
scopes: [
|
|
524
|
-
encodeScope({
|
|
525
|
-
type: "record.create",
|
|
526
|
-
options: {
|
|
527
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
528
|
-
}
|
|
529
|
-
}),
|
|
530
|
-
encodeScope({
|
|
531
|
-
type: "record.declare",
|
|
532
|
-
options: {
|
|
533
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
534
|
-
}
|
|
535
|
-
}),
|
|
536
|
-
SCOPES.PERFORMANCE_READ,
|
|
537
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
538
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
539
|
-
SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE
|
|
540
|
-
]
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
id: "LOCAL_REGISTRAR",
|
|
544
|
-
label: {
|
|
545
|
-
defaultMessage: "Local Registrar",
|
|
546
|
-
description: "Name for user role Local Registrar",
|
|
547
|
-
id: "userRole.localRegistrar"
|
|
548
|
-
},
|
|
549
|
-
scopes: [
|
|
550
|
-
encodeScope({
|
|
551
|
-
type: "record.create",
|
|
552
|
-
options: {
|
|
553
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
554
|
-
}
|
|
555
|
-
}),
|
|
556
|
-
encodeScope({
|
|
557
|
-
type: "record.declare",
|
|
558
|
-
options: {
|
|
559
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
560
|
-
}
|
|
561
|
-
}),
|
|
562
|
-
encodeScope({
|
|
563
|
-
type: "record.review-duplicates",
|
|
564
|
-
options: {
|
|
565
|
-
event: ["birth", "death", "tennis-club-membership"]
|
|
566
|
-
}
|
|
567
|
-
}),
|
|
568
|
-
SCOPES.PERFORMANCE_READ,
|
|
569
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
570
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
571
|
-
SCOPES.PROFILE_ELECTRONIC_SIGNATURE,
|
|
572
|
-
SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE
|
|
573
|
-
]
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
id: "LOCAL_SYSTEM_ADMIN",
|
|
577
|
-
label: {
|
|
578
|
-
defaultMessage: "Local System Admin",
|
|
579
|
-
description: "Name for user role Local System Admin",
|
|
580
|
-
id: "userRole.localSystemAdmin"
|
|
581
|
-
},
|
|
582
|
-
scopes: [
|
|
583
|
-
SCOPES.USER_READ_MY_OFFICE,
|
|
584
|
-
SCOPES.USER_CREATE_MY_JURISDICTION,
|
|
585
|
-
SCOPES.USER_UPDATE_MY_JURISDICTION,
|
|
586
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
587
|
-
SCOPES.PERFORMANCE_READ,
|
|
588
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
589
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
590
|
-
]
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
id: "NATIONAL_SYSTEM_ADMIN",
|
|
594
|
-
label: {
|
|
595
|
-
defaultMessage: "National System Admin",
|
|
596
|
-
description: "Name for user role National System Admin",
|
|
597
|
-
id: "userRole.nationalSystemAdmin"
|
|
598
|
-
},
|
|
599
|
-
scopes: [
|
|
600
|
-
SCOPES.USER_CREATE,
|
|
601
|
-
SCOPES.USER_READ,
|
|
602
|
-
SCOPES.USER_UPDATE,
|
|
603
|
-
SCOPES.ORGANISATION_READ_LOCATIONS,
|
|
604
|
-
SCOPES.PERFORMANCE_READ,
|
|
605
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
606
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
607
|
-
]
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
id: "PERFORMANCE_MANAGER",
|
|
611
|
-
label: {
|
|
612
|
-
defaultMessage: "Performance Manager",
|
|
613
|
-
description: "Name for user role Performance Manager",
|
|
614
|
-
id: "userRole.performanceManager"
|
|
615
|
-
},
|
|
616
|
-
scopes: [
|
|
617
|
-
SCOPES.PERFORMANCE_READ,
|
|
618
|
-
SCOPES.PERFORMANCE_READ_DASHBOARDS,
|
|
619
|
-
SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
|
|
620
|
-
]
|
|
621
|
-
}
|
|
622
|
-
];
|
|
623
|
-
var TokenUserType = z7.enum(["user", "system"]);
|
|
624
|
-
var TokenWithBearer = z7.string().regex(/^Bearer\s/);
|
|
625
|
-
|
|
626
341
|
// ../commons/src/users/userReferences.ts
|
|
627
342
|
var import_v4 = __toESM(require("zod/v4"));
|
|
628
343
|
var ScopeOptionReference = import_v4.default.object({
|
|
629
|
-
$scope:
|
|
344
|
+
$scope: ScopeType2,
|
|
630
345
|
$option: ScopeOptionKey
|
|
631
346
|
});
|
|
632
347
|
var JurisdictionReference = import_v4.default.object({
|
|
@@ -1259,4 +974,4 @@ function createFieldConditionals(fieldId) {
|
|
|
1259
974
|
}
|
|
1260
975
|
|
|
1261
976
|
// src/conditionals/index.ts
|
|
1262
|
-
|
|
977
|
+
z8.globalRegistry.clear();
|