@opencrvs/toolkit 2.1.0-rc.811fc78 → 2.1.0-rc.83d4009
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/dist/application-config/index.js +190 -200
- package/dist/commons/api/router.d.ts +3433 -3243
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +259 -2102
- package/dist/commons/conditionals/validate.d.ts +1 -2
- package/dist/commons/events/ActionConfig.d.ts +105 -126
- package/dist/commons/events/ActionDocument.d.ts +117 -111
- package/dist/commons/events/ActionType.d.ts +62 -62
- package/dist/commons/events/AdvancedSearchConfig.d.ts +513 -513
- package/dist/commons/events/AuditLog.d.ts +118 -42
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/Conditional.d.ts +3 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -608
- package/dist/commons/events/Draft.d.ts +37 -37
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +5 -5
- package/dist/commons/events/EventDocument.d.ts +46 -46
- package/dist/commons/events/EventIndex.d.ts +71 -52
- package/dist/commons/events/EventMetadata.d.ts +40 -41
- package/dist/commons/events/FieldConfig.d.ts +341 -341
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/Flag.d.ts +15 -63
- package/dist/commons/events/TemplateConfig.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
- package/dist/commons/events/WorkqueueConfig.d.ts +826 -841
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +2 -2
- package/dist/commons/events/field.d.ts +78 -895
- 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 +103 -6
- package/dist/commons/events/mocks.test.utils.d.ts +18 -4
- package/dist/commons/events/scopes.d.ts +4 -4
- package/dist/commons/events/state/index.d.ts +17 -17
- package/dist/commons/events/state/utils.d.ts +7 -7
- package/dist/commons/events/test.utils.d.ts +40 -40
- package/dist/commons/events/utils.d.ts +114 -114
- package/dist/commons/notification/UserNotifications.d.ts +10 -10
- package/dist/conditionals/index.js +56 -303
- package/dist/environment/derived-variables.d.ts +119 -119
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/questions.d.ts +75 -74
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +8 -14
- package/dist/environment/utils.d.ts +1 -1
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +2839 -2755
- package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
- package/dist/notification/index.js +1094 -1561
- package/dist/scopes/index.d.ts +148 -396
- package/dist/scopes/index.js +56 -304
- package/opencrvs-toolkit-2.1.0-rc.83d4009.tgz +0 -0
- package/package.json +3 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/commons/events/ActionStatus.d.ts +0 -14
- package/opencrvs-toolkit-2.1.0-rc.811fc78.tgz +0 -0
|
@@ -47,7 +47,7 @@ __export(conditionals_exports, {
|
|
|
47
47
|
user: () => user
|
|
48
48
|
});
|
|
49
49
|
module.exports = __toCommonJS(conditionals_exports);
|
|
50
|
-
var
|
|
50
|
+
var z8 = __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 z6 = __toESM(require("zod/v4"));
|
|
128
128
|
var qs = __toESM(require("qs"));
|
|
129
129
|
|
|
130
130
|
// ../commons/src/uuid.ts
|
|
@@ -138,258 +138,12 @@ 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
|
-
// General actions
|
|
166
|
-
READ: "READ",
|
|
167
|
-
ASSIGN: "ASSIGN",
|
|
168
|
-
UNASSIGN: "UNASSIGN",
|
|
169
|
-
// Custom action
|
|
170
|
-
CUSTOM: "CUSTOM"
|
|
171
|
-
};
|
|
172
|
-
var ConfirmableActions = [
|
|
173
|
-
ActionType.NOTIFY,
|
|
174
|
-
ActionType.DECLARE,
|
|
175
|
-
ActionType.EDIT,
|
|
176
|
-
ActionType.REGISTER,
|
|
177
|
-
ActionType.REJECT,
|
|
178
|
-
ActionType.ARCHIVE,
|
|
179
|
-
ActionType.UNARCHIVE,
|
|
180
|
-
ActionType.PRINT_CERTIFICATE,
|
|
181
|
-
ActionType.REQUEST_CORRECTION,
|
|
182
|
-
ActionType.APPROVE_CORRECTION,
|
|
183
|
-
ActionType.REJECT_CORRECTION,
|
|
184
|
-
ActionType.CUSTOM
|
|
185
|
-
];
|
|
186
|
-
var ActionTypes = z6.enum([
|
|
187
|
-
"DELETE",
|
|
188
|
-
"CREATE",
|
|
189
|
-
"NOTIFY",
|
|
190
|
-
"DECLARE",
|
|
191
|
-
"EDIT",
|
|
192
|
-
"REGISTER",
|
|
193
|
-
"DUPLICATE_DETECTED",
|
|
194
|
-
"REJECT",
|
|
195
|
-
"MARK_AS_DUPLICATE",
|
|
196
|
-
"MARK_AS_NOT_DUPLICATE",
|
|
197
|
-
"ARCHIVE",
|
|
198
|
-
"UNARCHIVE",
|
|
199
|
-
"PRINT_CERTIFICATE",
|
|
200
|
-
"REQUEST_CORRECTION",
|
|
201
|
-
"REJECT_CORRECTION",
|
|
202
|
-
"APPROVE_CORRECTION",
|
|
203
|
-
"READ",
|
|
204
|
-
"ASSIGN",
|
|
205
|
-
"UNASSIGN",
|
|
206
|
-
"CUSTOM"
|
|
207
|
-
]);
|
|
208
|
-
var declarationActionValues = [
|
|
209
|
-
ActionTypes.enum.DECLARE,
|
|
210
|
-
ActionTypes.enum.EDIT,
|
|
211
|
-
ActionTypes.enum.REGISTER,
|
|
212
|
-
ActionTypes.enum.NOTIFY,
|
|
213
|
-
ActionTypes.enum.DUPLICATE_DETECTED
|
|
214
|
-
];
|
|
215
|
-
var DeclarationActions = ActionTypes.extract(declarationActionValues);
|
|
216
|
-
var declarationUpdateActionValues = [
|
|
217
|
-
...declarationActionValues,
|
|
218
|
-
ActionTypes.enum.REQUEST_CORRECTION
|
|
219
|
-
];
|
|
220
|
-
var DeclarationUpdateActions = ActionTypes.extract(
|
|
221
|
-
declarationUpdateActionValues
|
|
222
|
-
);
|
|
223
|
-
var annotationActions = ActionTypes.exclude(declarationActionValues);
|
|
224
|
-
var writeActions = ActionTypes.exclude([
|
|
225
|
-
ActionType.CREATE,
|
|
226
|
-
ActionType.READ,
|
|
227
|
-
ActionType.ASSIGN,
|
|
228
|
-
ActionType.UNASSIGN
|
|
229
|
-
]);
|
|
230
|
-
var WorkqueueActionType = ActionTypes.extract([
|
|
231
|
-
ActionType.READ,
|
|
232
|
-
ActionType.DELETE,
|
|
233
|
-
ActionType.DECLARE,
|
|
234
|
-
ActionType.REGISTER,
|
|
235
|
-
ActionType.EDIT,
|
|
236
|
-
ActionType.REJECT,
|
|
237
|
-
ActionType.MARK_AS_DUPLICATE,
|
|
238
|
-
ActionType.ARCHIVE,
|
|
239
|
-
ActionType.UNARCHIVE,
|
|
240
|
-
ActionType.PRINT_CERTIFICATE,
|
|
241
|
-
ActionType.REQUEST_CORRECTION
|
|
242
|
-
]);
|
|
243
|
-
var META_ACTIONS = [
|
|
244
|
-
ActionType.ASSIGN,
|
|
245
|
-
ActionType.UNASSIGN,
|
|
246
|
-
ActionType.READ
|
|
247
|
-
];
|
|
248
|
-
|
|
249
|
-
// ../commons/src/events/ActionStatus.ts
|
|
250
|
-
var ActionStatus = {
|
|
251
|
-
Requested: "Requested",
|
|
252
|
-
Accepted: "Accepted",
|
|
253
|
-
Rejected: "Rejected"
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
// ../commons/src/events/Flag.ts
|
|
257
|
-
var z9 = __toESM(require("zod/v4"));
|
|
258
|
-
|
|
259
|
-
// ../commons/src/events/TranslationConfig.ts
|
|
260
|
-
var z7 = __toESM(require("zod/v4"));
|
|
261
|
-
var TranslationConfig = z7.object({
|
|
262
|
-
id: z7.string().describe(
|
|
263
|
-
"The identifier of the translation referred in translation CSV files"
|
|
264
|
-
),
|
|
265
|
-
defaultMessage: z7.string().describe("Default translation message"),
|
|
266
|
-
description: z7.string().describe(
|
|
267
|
-
"Describe the translation for a translator to be able to identify it."
|
|
268
|
-
)
|
|
269
|
-
}).meta({
|
|
270
|
-
description: "Translation configuration",
|
|
271
|
-
id: "TranslationConfig"
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
// ../commons/src/events/Conditional.ts
|
|
275
|
-
var z8 = __toESM(require("zod/v4"));
|
|
276
|
-
var Conditional = z8.any().describe("JSONSchema").meta({
|
|
277
|
-
description: "JSON schema conditional configuration",
|
|
278
|
-
id: "Conditional"
|
|
279
|
-
});
|
|
280
|
-
var ConditionalType = {
|
|
281
|
-
SHOW: "SHOW",
|
|
282
|
-
ENABLE: "ENABLE",
|
|
283
|
-
DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
|
|
284
|
-
};
|
|
285
|
-
var ShowConditional = z8.object({
|
|
286
|
-
type: z8.literal(ConditionalType.SHOW),
|
|
287
|
-
conditional: Conditional
|
|
288
|
-
}).describe(
|
|
289
|
-
"If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
|
|
290
|
-
);
|
|
291
|
-
var EnableConditional = z8.object({
|
|
292
|
-
type: z8.literal(ConditionalType.ENABLE),
|
|
293
|
-
conditional: Conditional
|
|
294
|
-
}).describe(
|
|
295
|
-
"If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
|
|
296
|
-
);
|
|
297
|
-
var ActionConditional = z8.discriminatedUnion("type", [
|
|
298
|
-
// Action can be shown / hidden
|
|
299
|
-
ShowConditional,
|
|
300
|
-
// Action can be shown to the user in the list but as disabled
|
|
301
|
-
EnableConditional
|
|
302
|
-
]).meta({
|
|
303
|
-
id: "ActionConditional",
|
|
304
|
-
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."
|
|
305
|
-
});
|
|
306
|
-
var DisplayOnReviewConditional = z8.object({
|
|
307
|
-
type: z8.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
308
|
-
conditional: Conditional
|
|
309
|
-
}).describe(
|
|
310
|
-
"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."
|
|
311
|
-
);
|
|
312
|
-
var FieldConditional = z8.discriminatedUnion("type", [
|
|
313
|
-
// Field input can be shown / hidden
|
|
314
|
-
ShowConditional,
|
|
315
|
-
// Field input can be shown to the user but as disabled
|
|
316
|
-
EnableConditional,
|
|
317
|
-
// Field output can be shown / hidden on the review page
|
|
318
|
-
DisplayOnReviewConditional
|
|
319
|
-
]).meta({
|
|
320
|
-
id: "FieldConditional",
|
|
321
|
-
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."
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
// ../commons/src/events/Flag.ts
|
|
325
|
-
var InherentFlags = {
|
|
326
|
-
INCOMPLETE: "incomplete",
|
|
327
|
-
REJECTED: "rejected",
|
|
328
|
-
CORRECTION_REQUESTED: "correction-requested",
|
|
329
|
-
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
330
|
-
/**
|
|
331
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
332
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
333
|
-
*
|
|
334
|
-
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
335
|
-
*/
|
|
336
|
-
EDIT_IN_PROGRESS: "edit-in-progress",
|
|
337
|
-
SEALED: "sealed"
|
|
338
|
-
};
|
|
339
|
-
var actionFlagPattern;
|
|
340
|
-
function getActionFlagPattern() {
|
|
341
|
-
actionFlagPattern ??= new RegExp(
|
|
342
|
-
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
343
|
-
ActionStatus
|
|
344
|
-
).join("|").toLowerCase()})$`
|
|
345
|
-
);
|
|
346
|
-
return actionFlagPattern;
|
|
347
|
-
}
|
|
348
|
-
var ActionFlag = z9.string().refine((value) => getActionFlagPattern().test(value), {
|
|
349
|
-
message: "Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
350
|
-
});
|
|
351
|
-
var CustomFlag = z9.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
352
|
-
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
353
|
-
InherentFlags
|
|
354
|
-
).join(", ")}`
|
|
355
|
-
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
356
|
-
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
357
|
-
}).describe("Custom flag identifier defined by the country config.");
|
|
358
|
-
var Flag = ActionFlag.or(z9.enum(InherentFlags)).or(CustomFlag);
|
|
359
|
-
var ContainsFlags = z9.object({
|
|
360
|
-
anyOf: z9.array(Flag).optional(),
|
|
361
|
-
noneOf: z9.array(Flag).optional(),
|
|
362
|
-
allOf: z9.array(Flag).optional()
|
|
363
|
-
}).meta({
|
|
364
|
-
id: "ContainsFlags"
|
|
365
|
-
});
|
|
366
|
-
var FlagConfig = z9.object({
|
|
367
|
-
id: CustomFlag,
|
|
368
|
-
requiresAction: z9.boolean().describe(
|
|
369
|
-
"Indicates if this flag expects an action to be performed to be cleared."
|
|
370
|
-
),
|
|
371
|
-
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
372
|
-
}).meta({
|
|
373
|
-
id: "FlagConfig",
|
|
374
|
-
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
375
|
-
});
|
|
376
|
-
var ActionFlagConfig = z9.object({
|
|
377
|
-
id: Flag,
|
|
378
|
-
operation: z9.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
379
|
-
conditional: Conditional.optional().describe(
|
|
380
|
-
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
381
|
-
)
|
|
382
|
-
}).meta({
|
|
383
|
-
id: "ActionFlagConfig",
|
|
384
|
-
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
385
|
-
});
|
|
386
|
-
|
|
387
141
|
// ../commons/src/scopes.ts
|
|
388
|
-
var JurisdictionFilter =
|
|
142
|
+
var JurisdictionFilter = z6.enum(["administrativeArea", "location", "all"]).describe(
|
|
389
143
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
390
144
|
);
|
|
391
|
-
var UserFilter =
|
|
392
|
-
var RecordScopeTypeV2 =
|
|
145
|
+
var UserFilter = z6.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
146
|
+
var RecordScopeTypeV2 = z6.enum([
|
|
393
147
|
"record.search",
|
|
394
148
|
"record.create",
|
|
395
149
|
"record.read",
|
|
@@ -407,7 +161,7 @@ var RecordScopeTypeV2 = z10.enum([
|
|
|
407
161
|
"record.unassign-others",
|
|
408
162
|
"record.custom-action"
|
|
409
163
|
]);
|
|
410
|
-
var PlainScopeType =
|
|
164
|
+
var PlainScopeType = z6.enum([
|
|
411
165
|
// Misc. system scopes
|
|
412
166
|
"bypassratelimit",
|
|
413
167
|
"record.reindex",
|
|
@@ -415,6 +169,7 @@ var PlainScopeType = z10.enum([
|
|
|
415
169
|
"integration.create",
|
|
416
170
|
"record.import",
|
|
417
171
|
"config.update-all",
|
|
172
|
+
"location.edit",
|
|
418
173
|
"attachment.upload",
|
|
419
174
|
"profile.electronic-signature",
|
|
420
175
|
"user.read-only-my-audit",
|
|
@@ -426,15 +181,15 @@ var PlainScopeType = z10.enum([
|
|
|
426
181
|
"record.confirm-registration",
|
|
427
182
|
"record.reject-registration"
|
|
428
183
|
]);
|
|
429
|
-
var scopeByEvent =
|
|
184
|
+
var scopeByEvent = z6.preprocess(
|
|
430
185
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
431
|
-
|
|
186
|
+
z6.array(z6.string()).optional()
|
|
432
187
|
).describe("Event type, e.g. birth, death");
|
|
433
|
-
var userRole =
|
|
188
|
+
var userRole = z6.preprocess(
|
|
434
189
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
435
|
-
|
|
190
|
+
z6.array(z6.string()).optional()
|
|
436
191
|
).describe("User role, e.g. admin, field agent");
|
|
437
|
-
var scopeOptionsPlaceEvent =
|
|
192
|
+
var scopeOptionsPlaceEvent = z6.object({
|
|
438
193
|
event: scopeByEvent,
|
|
439
194
|
placeOfEvent: JurisdictionFilter.optional()
|
|
440
195
|
}).describe("Options applicable to all record scopes.");
|
|
@@ -446,37 +201,36 @@ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
|
446
201
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
447
202
|
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
448
203
|
registeredIn: JurisdictionFilter.optional(),
|
|
449
|
-
registeredBy: UserFilter.optional()
|
|
450
|
-
flags: ContainsFlags.optional()
|
|
204
|
+
registeredBy: UserFilter.optional()
|
|
451
205
|
}).describe(
|
|
452
206
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
453
207
|
);
|
|
454
208
|
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
455
|
-
customActionTypes:
|
|
209
|
+
customActionTypes: z6.preprocess(
|
|
456
210
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
457
|
-
|
|
211
|
+
z6.array(z6.string()).optional()
|
|
458
212
|
).describe("Allowed custom action types")
|
|
459
213
|
});
|
|
460
|
-
var AccessLevelOptions =
|
|
214
|
+
var AccessLevelOptions = z6.object({
|
|
461
215
|
accessLevel: JurisdictionFilter.optional()
|
|
462
216
|
});
|
|
463
217
|
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
464
218
|
role: userRole.optional()
|
|
465
219
|
});
|
|
466
|
-
var WorkqueueOrDashboardOptions =
|
|
467
|
-
ids:
|
|
220
|
+
var WorkqueueOrDashboardOptions = z6.object({
|
|
221
|
+
ids: z6.preprocess(
|
|
468
222
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
469
|
-
|
|
223
|
+
z6.array(z6.string())
|
|
470
224
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
471
225
|
});
|
|
472
|
-
var AllScopeOptions =
|
|
226
|
+
var AllScopeOptions = z6.object({
|
|
473
227
|
...AllRecordScopeOptions.shape,
|
|
474
228
|
...AccessLevelOptions.shape,
|
|
475
229
|
...AllUserScopeOptions.shape,
|
|
476
230
|
...WorkqueueOrDashboardOptions.shape
|
|
477
231
|
});
|
|
478
232
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
479
|
-
var ResolvedScopeOptionsPlaceEvent =
|
|
233
|
+
var ResolvedScopeOptionsPlaceEvent = z6.object({
|
|
480
234
|
event: scopeByEvent,
|
|
481
235
|
placeOfEvent: UUID.nullish()
|
|
482
236
|
}).describe(
|
|
@@ -484,16 +238,15 @@ var ResolvedScopeOptionsPlaceEvent = z10.object({
|
|
|
484
238
|
);
|
|
485
239
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
486
240
|
notifiedIn: UUID.nullish(),
|
|
487
|
-
notifiedBy:
|
|
241
|
+
notifiedBy: z6.string().optional(),
|
|
488
242
|
declaredIn: UUID.nullish(),
|
|
489
|
-
declaredBy:
|
|
243
|
+
declaredBy: z6.string().optional()
|
|
490
244
|
}).describe(
|
|
491
245
|
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
492
246
|
);
|
|
493
247
|
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
494
248
|
registeredIn: UUID.nullish(),
|
|
495
|
-
registeredBy:
|
|
496
|
-
flags: ContainsFlags.optional()
|
|
249
|
+
registeredBy: z6.string().optional()
|
|
497
250
|
}).describe(
|
|
498
251
|
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
499
252
|
);
|
|
@@ -518,38 +271,38 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
518
271
|
"record.unassign-others"
|
|
519
272
|
]);
|
|
520
273
|
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
521
|
-
templates:
|
|
274
|
+
templates: z6.preprocess(
|
|
522
275
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
523
|
-
|
|
276
|
+
z6.array(z6.string()).optional()
|
|
524
277
|
).describe(
|
|
525
278
|
"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."
|
|
526
279
|
)
|
|
527
280
|
});
|
|
528
|
-
var RecordScopeV2 =
|
|
529
|
-
|
|
281
|
+
var RecordScopeV2 = z6.discriminatedUnion("type", [
|
|
282
|
+
z6.object({
|
|
530
283
|
type: ScopesWithPlaceEventOptions,
|
|
531
284
|
options: scopeOptionsPlaceEvent.optional()
|
|
532
285
|
}),
|
|
533
|
-
|
|
286
|
+
z6.object({
|
|
534
287
|
type: ScopesWithDeclaredOptions,
|
|
535
288
|
options: scopeOptionsDeclaredOrNotified.optional()
|
|
536
289
|
}),
|
|
537
|
-
|
|
290
|
+
z6.object({
|
|
538
291
|
type: ScopesWithFullOptions,
|
|
539
292
|
options: AllRecordScopeOptions.optional()
|
|
540
293
|
}),
|
|
541
|
-
|
|
542
|
-
type:
|
|
294
|
+
z6.object({
|
|
295
|
+
type: z6.literal("record.custom-action"),
|
|
543
296
|
options: CustomActionScopeOptions.optional()
|
|
544
297
|
}),
|
|
545
|
-
|
|
546
|
-
type:
|
|
298
|
+
z6.object({
|
|
299
|
+
type: z6.literal("record.print-certified-copies"),
|
|
547
300
|
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
548
301
|
})
|
|
549
302
|
]).describe(
|
|
550
303
|
"Scopes used to check user's permission to perform actions on a record."
|
|
551
304
|
);
|
|
552
|
-
var SystemScopeType =
|
|
305
|
+
var SystemScopeType = z6.enum([
|
|
553
306
|
"organisation.read-locations",
|
|
554
307
|
"user.read",
|
|
555
308
|
"user.create",
|
|
@@ -563,61 +316,61 @@ var UserScopeType = SystemScopeType.extract([
|
|
|
563
316
|
"user.search"
|
|
564
317
|
]);
|
|
565
318
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
566
|
-
var UserScopeV2 =
|
|
567
|
-
|
|
319
|
+
var UserScopeV2 = z6.discriminatedUnion("type", [
|
|
320
|
+
z6.object({
|
|
568
321
|
type: ScopesWithRoleOption,
|
|
569
322
|
options: AllUserScopeOptions.optional()
|
|
570
323
|
}),
|
|
571
|
-
|
|
324
|
+
z6.object({
|
|
572
325
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
573
326
|
options: AccessLevelOptions.optional()
|
|
574
327
|
})
|
|
575
328
|
]);
|
|
576
|
-
var ResolvedRecordScopeV2 =
|
|
577
|
-
|
|
329
|
+
var ResolvedRecordScopeV2 = z6.discriminatedUnion("type", [
|
|
330
|
+
z6.object({
|
|
578
331
|
type: ScopesWithPlaceEventOptions,
|
|
579
332
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
580
333
|
}),
|
|
581
|
-
|
|
334
|
+
z6.object({
|
|
582
335
|
type: ScopesWithDeclaredOptions,
|
|
583
336
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
584
337
|
}),
|
|
585
|
-
|
|
338
|
+
z6.object({
|
|
586
339
|
type: ScopesWithFullOptions,
|
|
587
340
|
options: ResolvedScopeOptionsFull.optional()
|
|
588
341
|
}),
|
|
589
|
-
|
|
590
|
-
type:
|
|
342
|
+
z6.object({
|
|
343
|
+
type: z6.literal("record.print-certified-copies"),
|
|
591
344
|
options: ResolvedScopeOptionsFull.extend({
|
|
592
|
-
templates:
|
|
345
|
+
templates: z6.array(z6.string()).optional()
|
|
593
346
|
}).optional()
|
|
594
347
|
})
|
|
595
348
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
596
|
-
var Scope2 =
|
|
597
|
-
|
|
349
|
+
var Scope2 = z6.discriminatedUnion("type", [
|
|
350
|
+
z6.object({ type: PlainScopeType }),
|
|
598
351
|
...RecordScopeV2.options,
|
|
599
352
|
...UserScopeV2.options,
|
|
600
|
-
|
|
601
|
-
type:
|
|
353
|
+
z6.object({
|
|
354
|
+
type: z6.literal("organisation.read-locations"),
|
|
602
355
|
options: AccessLevelOptions.optional()
|
|
603
356
|
}),
|
|
604
|
-
|
|
605
|
-
type:
|
|
357
|
+
z6.object({
|
|
358
|
+
type: z6.literal("workqueue"),
|
|
606
359
|
options: WorkqueueOrDashboardOptions
|
|
607
360
|
}),
|
|
608
|
-
|
|
609
|
-
type:
|
|
361
|
+
z6.object({
|
|
362
|
+
type: z6.literal("dashboard.view"),
|
|
610
363
|
options: WorkqueueOrDashboardOptions
|
|
611
364
|
})
|
|
612
365
|
]);
|
|
613
|
-
var ScopeType2 =
|
|
366
|
+
var ScopeType2 = z6.enum([
|
|
614
367
|
...SystemScopeType.options,
|
|
615
368
|
...RecordScopeTypeV2.options,
|
|
616
369
|
...PlainScopeType.options,
|
|
617
370
|
"workqueue",
|
|
618
371
|
"dashboard.view"
|
|
619
372
|
]);
|
|
620
|
-
var EncodedScope2 =
|
|
373
|
+
var EncodedScope2 = z6.string().brand("EncodedScope");
|
|
621
374
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
622
375
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
623
376
|
accessLevel: JurisdictionFilter.enum.all,
|
|
@@ -1312,4 +1065,4 @@ function createFieldConditionals(fieldId) {
|
|
|
1312
1065
|
}
|
|
1313
1066
|
|
|
1314
1067
|
// src/conditionals/index.ts
|
|
1315
|
-
|
|
1068
|
+
z8.globalRegistry.clear();
|