@opencrvs/toolkit 2.0.0-rc.1498d58 → 2.0.0-rc.14dd6ca
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 +2 -2
- package/dist/application-config/index.js +5 -27
- package/dist/cli.js +5103 -167
- package/dist/commons/api/router.d.ts +68 -669
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/events/ActionConfig.d.ts +0 -202
- package/dist/commons/events/ActionDocument.d.ts +0 -44
- package/dist/commons/events/ActionInput.d.ts +0 -26
- package/dist/commons/events/ActionType.d.ts +1 -6
- package/dist/commons/events/AdvancedSearchConfig.d.ts +0 -18
- package/dist/commons/events/AuditLog.d.ts +0 -2
- package/dist/commons/events/Draft.d.ts +0 -2
- package/dist/commons/events/EventConfig.d.ts +0 -2
- package/dist/commons/events/EventDocument.d.ts +0 -22
- package/dist/commons/events/EventIndex.d.ts +0 -11
- package/dist/commons/events/EventMetadata.d.ts +0 -26
- package/dist/commons/events/FieldConfig.d.ts +0 -15
- package/dist/commons/events/WorkqueueConfig.d.ts +2 -5
- package/dist/commons/events/locations.d.ts +0 -1
- package/dist/commons/events/scopes.d.ts +0 -1
- package/dist/commons/events/state/index.d.ts +0 -8
- package/dist/commons/events/state/utils.d.ts +0 -9
- package/dist/commons/events/test.utils.d.ts +1 -9
- package/dist/commons/events/utils.d.ts +1 -15
- package/dist/conditionals/index.js +5 -12
- package/dist/events/index.js +23 -204
- package/dist/migrations/v2.0/index.js +5139 -88
- package/dist/notification/index.js +16 -146
- package/dist/scopes/index.d.ts +2 -96
- package/dist/scopes/index.js +5 -12
- package/opencrvs-toolkit-2.0.0-rc.14dd6ca.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +0 -3
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +0 -1
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +0 -234
- package/dist/migrations/v2.1/index.d.ts +0 -6
- package/dist/migrations/v2.1/index.d.ts.map +0 -1
- package/dist/migrations/v2.1/index.js +0 -218
- package/opencrvs-toolkit-2.0.0-rc.1498d58.tgz +0 -0
|
@@ -79,7 +79,6 @@ var RecordScopeTypeV2 = z2.enum([
|
|
|
79
79
|
"record.edit",
|
|
80
80
|
"record.reject",
|
|
81
81
|
"record.archive",
|
|
82
|
-
"record.unarchive",
|
|
83
82
|
"record.review-duplicates",
|
|
84
83
|
"record.register",
|
|
85
84
|
"record.print-certified-copies",
|
|
@@ -119,13 +118,11 @@ var scopeOptionsPlaceEvent = z2.object({
|
|
|
119
118
|
event: scopeByEvent,
|
|
120
119
|
placeOfEvent: JurisdictionFilter.optional()
|
|
121
120
|
}).describe("Options applicable to all record scopes.");
|
|
122
|
-
var
|
|
123
|
-
notifiedIn: JurisdictionFilter.optional(),
|
|
124
|
-
notifiedBy: UserFilter.optional(),
|
|
121
|
+
var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
125
122
|
declaredIn: JurisdictionFilter.optional(),
|
|
126
123
|
declaredBy: UserFilter.optional()
|
|
127
124
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
128
|
-
var AllRecordScopeOptions =
|
|
125
|
+
var AllRecordScopeOptions = scopeOptionsDeclared.extend({
|
|
129
126
|
registeredIn: JurisdictionFilter.optional(),
|
|
130
127
|
registeredBy: UserFilter.optional()
|
|
131
128
|
}).describe(
|
|
@@ -163,8 +160,6 @@ var ResolvedScopeOptionsPlaceEvent = z2.object({
|
|
|
163
160
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
164
161
|
);
|
|
165
162
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
166
|
-
notifiedIn: UUID.nullish(),
|
|
167
|
-
notifiedBy: z2.string().optional(),
|
|
168
163
|
declaredIn: UUID.nullish(),
|
|
169
164
|
declaredBy: z2.string().optional()
|
|
170
165
|
}).describe(
|
|
@@ -185,7 +180,6 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
185
180
|
"record.edit",
|
|
186
181
|
"record.reject",
|
|
187
182
|
"record.archive",
|
|
188
|
-
"record.unarchive",
|
|
189
183
|
"record.review-duplicates",
|
|
190
184
|
"record.register"
|
|
191
185
|
]);
|
|
@@ -211,7 +205,7 @@ var RecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
211
205
|
}),
|
|
212
206
|
z2.object({
|
|
213
207
|
type: ScopesWithDeclaredOptions,
|
|
214
|
-
options:
|
|
208
|
+
options: scopeOptionsDeclared.optional()
|
|
215
209
|
}),
|
|
216
210
|
z2.object({
|
|
217
211
|
type: ScopesWithFullOptions,
|
|
@@ -300,9 +294,8 @@ var EncodedScope = z2.string().brand("EncodedScope");
|
|
|
300
294
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
301
295
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
302
296
|
accessLevel: JurisdictionFilter.enum.all,
|
|
303
|
-
|
|
304
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
305
|
-
registeredIn: JurisdictionFilter.enum.all
|
|
297
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
298
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
306
299
|
};
|
|
307
300
|
|
|
308
301
|
// ../commons/src/authentication.ts
|
|
@@ -327,7 +320,6 @@ var ActionType = {
|
|
|
327
320
|
MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE",
|
|
328
321
|
MARK_AS_NOT_DUPLICATE: "MARK_AS_NOT_DUPLICATE",
|
|
329
322
|
ARCHIVE: "ARCHIVE",
|
|
330
|
-
UNARCHIVE: "UNARCHIVE",
|
|
331
323
|
// Record actions
|
|
332
324
|
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
|
333
325
|
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
|
@@ -347,7 +339,6 @@ var ConfirmableActions = [
|
|
|
347
339
|
ActionType.REGISTER,
|
|
348
340
|
ActionType.REJECT,
|
|
349
341
|
ActionType.ARCHIVE,
|
|
350
|
-
ActionType.UNARCHIVE,
|
|
351
342
|
ActionType.PRINT_CERTIFICATE,
|
|
352
343
|
ActionType.REQUEST_CORRECTION,
|
|
353
344
|
ActionType.APPROVE_CORRECTION,
|
|
@@ -366,7 +357,6 @@ var ActionTypes = z4.enum([
|
|
|
366
357
|
"MARK_AS_DUPLICATE",
|
|
367
358
|
"MARK_AS_NOT_DUPLICATE",
|
|
368
359
|
"ARCHIVE",
|
|
369
|
-
"UNARCHIVE",
|
|
370
360
|
"PRINT_CERTIFICATE",
|
|
371
361
|
"REQUEST_CORRECTION",
|
|
372
362
|
"REJECT_CORRECTION",
|
|
@@ -410,7 +400,6 @@ var WorkqueueActionType = ActionTypes.extract([
|
|
|
410
400
|
ActionType.REJECT,
|
|
411
401
|
ActionType.MARK_AS_DUPLICATE,
|
|
412
402
|
ActionType.ARCHIVE,
|
|
413
|
-
ActionType.UNARCHIVE,
|
|
414
403
|
ActionType.PRINT_CERTIFICATE,
|
|
415
404
|
ActionType.REQUEST_CORRECTION
|
|
416
405
|
]);
|
|
@@ -472,7 +461,6 @@ var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
|
472
461
|
"event.actions.unassign.request",
|
|
473
462
|
"event.actions.read.request",
|
|
474
463
|
"event.actions.archive.request",
|
|
475
|
-
"event.actions.unarchive.request",
|
|
476
464
|
"event.actions.reinstate.request",
|
|
477
465
|
"event.actions.print_certificate.request",
|
|
478
466
|
"event.actions.correction.request.request",
|
|
@@ -1198,11 +1186,6 @@ var ArchiveAction = ActionBase.extend(
|
|
|
1198
1186
|
content: ReasonContent
|
|
1199
1187
|
}).shape
|
|
1200
1188
|
);
|
|
1201
|
-
var UnarchiveAction = ActionBase.extend(
|
|
1202
|
-
z14.object({
|
|
1203
|
-
type: z14.literal(ActionType.UNARCHIVE)
|
|
1204
|
-
}).shape
|
|
1205
|
-
);
|
|
1206
1189
|
var CreatedAction = ActionBase.extend(
|
|
1207
1190
|
z14.object({
|
|
1208
1191
|
type: z14.literal(ActionType.CREATE)
|
|
@@ -1269,7 +1252,6 @@ var ActionDocument = z14.discriminatedUnion("type", [
|
|
|
1269
1252
|
MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
|
|
1270
1253
|
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1271
1254
|
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1272
|
-
UnarchiveAction.meta({ id: "UnarchiveAction" }),
|
|
1273
1255
|
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1274
1256
|
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1275
1257
|
DeclareAction.meta({ id: "DeclareAction" }),
|
|
@@ -1375,7 +1357,6 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1375
1357
|
)
|
|
1376
1358
|
});
|
|
1377
1359
|
var LegalStatuses = z16.object({
|
|
1378
|
-
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1379
1360
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1380
1361
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1381
1362
|
});
|
|
@@ -1435,8 +1416,6 @@ var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
|
1435
1416
|
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1436
1417
|
"createdAt",
|
|
1437
1418
|
"updatedAt",
|
|
1438
|
-
"legalStatuses.NOTIFIED.createdAt",
|
|
1439
|
-
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1440
1419
|
"legalStatuses.DECLARED.createdAt",
|
|
1441
1420
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1442
1421
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1445,8 +1424,6 @@ var EventMetadataDateFieldIdInput = z16.enum([
|
|
|
1445
1424
|
var EventMetadataDateFieldId = z16.enum([
|
|
1446
1425
|
"event.createdAt",
|
|
1447
1426
|
"event.updatedAt",
|
|
1448
|
-
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1449
|
-
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1450
1427
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1451
1428
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1452
1429
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -2708,52 +2685,6 @@ var NotifyConfig = ActionConfigBase.extend(
|
|
|
2708
2685
|
type: z24.literal(ActionType.NOTIFY)
|
|
2709
2686
|
}).shape
|
|
2710
2687
|
);
|
|
2711
|
-
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
2712
|
-
z24.object({
|
|
2713
|
-
type: z24.literal(ActionType.DUPLICATE_DETECTED),
|
|
2714
|
-
label: z24.never().optional().describe(
|
|
2715
|
-
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no label."
|
|
2716
|
-
),
|
|
2717
|
-
supportingCopy: z24.never().optional(),
|
|
2718
|
-
icon: z24.never().optional().describe(
|
|
2719
|
-
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no icon."
|
|
2720
|
-
),
|
|
2721
|
-
conditionals: z24.never().optional().describe(
|
|
2722
|
-
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it cannot be disabled or hidden with conditionals."
|
|
2723
|
-
)
|
|
2724
|
-
}).shape
|
|
2725
|
-
);
|
|
2726
|
-
var MarkAsDuplicateConfig = ActionConfigBase.extend(
|
|
2727
|
-
z24.object({
|
|
2728
|
-
type: z24.literal(ActionType.MARK_AS_DUPLICATE)
|
|
2729
|
-
}).shape
|
|
2730
|
-
);
|
|
2731
|
-
var MarkAsNotDuplicateConfig = ActionConfigBase.extend(
|
|
2732
|
-
z24.object({
|
|
2733
|
-
type: z24.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
2734
|
-
}).shape
|
|
2735
|
-
);
|
|
2736
|
-
var AssignConfig = ActionConfigBase.extend(
|
|
2737
|
-
z24.object({
|
|
2738
|
-
type: z24.literal(ActionType.ASSIGN),
|
|
2739
|
-
flags: z24.never().optional().describe(
|
|
2740
|
-
"ASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
2741
|
-
)
|
|
2742
|
-
}).shape
|
|
2743
|
-
);
|
|
2744
|
-
var UnassignConfig = ActionConfigBase.extend(
|
|
2745
|
-
z24.object({
|
|
2746
|
-
type: z24.literal(ActionType.UNASSIGN),
|
|
2747
|
-
flags: z24.never().optional().describe(
|
|
2748
|
-
"UNASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
2749
|
-
)
|
|
2750
|
-
}).shape
|
|
2751
|
-
);
|
|
2752
|
-
var DeleteConfig = ActionConfigBase.extend(
|
|
2753
|
-
z24.object({
|
|
2754
|
-
type: z24.literal(ActionType.DELETE)
|
|
2755
|
-
}).shape
|
|
2756
|
-
);
|
|
2757
2688
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
2758
2689
|
z24.object({
|
|
2759
2690
|
type: z24.literal(ActionType.DECLARE),
|
|
@@ -2778,11 +2709,6 @@ var ArchiveConfig = ActionConfigBase.extend(
|
|
|
2778
2709
|
type: z24.literal(ActionType.ARCHIVE)
|
|
2779
2710
|
}).shape
|
|
2780
2711
|
);
|
|
2781
|
-
var UnarchiveConfig = ActionConfigBase.extend(
|
|
2782
|
-
z24.object({
|
|
2783
|
-
type: z24.literal(ActionType.UNARCHIVE)
|
|
2784
|
-
}).shape
|
|
2785
|
-
);
|
|
2786
2712
|
var EditActionConfig = ActionConfigBase.extend(
|
|
2787
2713
|
z24.object({
|
|
2788
2714
|
type: z24.literal(ActionType.EDIT),
|
|
@@ -2821,17 +2747,7 @@ var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
|
2821
2747
|
correctionForm: ActionFormConfig
|
|
2822
2748
|
}).shape
|
|
2823
2749
|
);
|
|
2824
|
-
var
|
|
2825
|
-
z24.object({
|
|
2826
|
-
type: z24.literal(ActionType.APPROVE_CORRECTION)
|
|
2827
|
-
}).shape
|
|
2828
|
-
);
|
|
2829
|
-
var RejectCorrectionConfig = ActionConfigBase.extend(
|
|
2830
|
-
z24.object({
|
|
2831
|
-
type: z24.literal(ActionType.REJECT_CORRECTION)
|
|
2832
|
-
}).shape
|
|
2833
|
-
);
|
|
2834
|
-
var CustomActionConfig = ActionConfigBase.extend(
|
|
2750
|
+
var CustomActionConfig = ActionConfigBase.merge(
|
|
2835
2751
|
z24.object({
|
|
2836
2752
|
type: z24.literal(ActionType.CUSTOM),
|
|
2837
2753
|
customActionType: z24.string().describe("Type identifier of the custom action."),
|
|
@@ -2842,7 +2758,7 @@ var CustomActionConfig = ActionConfigBase.extend(
|
|
|
2842
2758
|
auditHistoryLabel: TranslationConfig.describe(
|
|
2843
2759
|
'The label to show in audit history for this action. For example "Approved".'
|
|
2844
2760
|
)
|
|
2845
|
-
})
|
|
2761
|
+
})
|
|
2846
2762
|
);
|
|
2847
2763
|
var ActionConfig = z24.discriminatedUnion("type", [
|
|
2848
2764
|
/*
|
|
@@ -2853,18 +2769,6 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2853
2769
|
id: "ReadActionConfig",
|
|
2854
2770
|
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2855
2771
|
}),
|
|
2856
|
-
AssignConfig.meta({
|
|
2857
|
-
id: "AssignActionConfig",
|
|
2858
|
-
description: "Configuration for assigning a record to the current user."
|
|
2859
|
-
}),
|
|
2860
|
-
UnassignConfig.meta({
|
|
2861
|
-
id: "UnassignActionConfig",
|
|
2862
|
-
description: "Configuration for unassigning a record from its current assignee."
|
|
2863
|
-
}),
|
|
2864
|
-
DeleteConfig.meta({
|
|
2865
|
-
id: "DeleteActionConfig",
|
|
2866
|
-
description: "Configuration for deleting a draft record."
|
|
2867
|
-
}),
|
|
2868
2772
|
NotifyConfig.meta({
|
|
2869
2773
|
id: "NotifyActionConfig",
|
|
2870
2774
|
description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
|
|
@@ -2873,18 +2777,6 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2873
2777
|
id: "DeclareActionConfig",
|
|
2874
2778
|
description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
|
|
2875
2779
|
}),
|
|
2876
|
-
DuplicateDetectedConfig.meta({
|
|
2877
|
-
id: "DuplicateDetectedActionConfig",
|
|
2878
|
-
description: "Configuration for the system-generated duplicate-detection action. Never shown as a button, so it only supports flags \u2014 not label, icon, or conditionals."
|
|
2879
|
-
}),
|
|
2880
|
-
MarkAsDuplicateConfig.meta({
|
|
2881
|
-
id: "MarkAsDuplicateActionConfig",
|
|
2882
|
-
description: "Configuration for marking a record as a duplicate."
|
|
2883
|
-
}),
|
|
2884
|
-
MarkAsNotDuplicateConfig.meta({
|
|
2885
|
-
id: "MarkAsNotDuplicateActionConfig",
|
|
2886
|
-
description: "Configuration for marking a record as not a duplicate, after it was previously flagged as one."
|
|
2887
|
-
}),
|
|
2888
2780
|
RejectConfig.meta({
|
|
2889
2781
|
id: "RejectActionConfig",
|
|
2890
2782
|
description: "Configuration for rejecting a record before registration."
|
|
@@ -2901,14 +2793,6 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2901
2793
|
id: "RequestCorrectionActionConfig",
|
|
2902
2794
|
description: "Configuration for requesting a correction on a registered record."
|
|
2903
2795
|
}),
|
|
2904
|
-
ApproveCorrectionConfig.meta({
|
|
2905
|
-
id: "ApproveCorrectionActionConfig",
|
|
2906
|
-
description: "Configuration for approving a requested correction."
|
|
2907
|
-
}),
|
|
2908
|
-
RejectCorrectionConfig.meta({
|
|
2909
|
-
id: "RejectCorrectionActionConfig",
|
|
2910
|
-
description: "Configuration for rejecting a requested correction."
|
|
2911
|
-
}),
|
|
2912
2796
|
EditActionConfig.meta({
|
|
2913
2797
|
id: "EditActionConfig",
|
|
2914
2798
|
description: "Configuration for editing a record before registration."
|
|
@@ -2917,10 +2801,6 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2917
2801
|
id: "ArchiveActionConfig",
|
|
2918
2802
|
description: "Configuration for archiving a record."
|
|
2919
2803
|
}),
|
|
2920
|
-
UnarchiveConfig.meta({
|
|
2921
|
-
id: "UnarchiveActionConfig",
|
|
2922
|
-
description: "Configuration for unarchiving a record."
|
|
2923
|
-
}),
|
|
2924
2804
|
CustomActionConfig.meta({
|
|
2925
2805
|
id: "CustomActionConfig",
|
|
2926
2806
|
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
@@ -4040,7 +3920,7 @@ function validateActionFlags(event2, ctx) {
|
|
|
4040
3920
|
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
4041
3921
|
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
4042
3922
|
const actionFlagIds = event2.actions.flatMap(
|
|
4043
|
-
(action) =>
|
|
3923
|
+
(action) => action.flags.map((flag) => flag.id)
|
|
4044
3924
|
);
|
|
4045
3925
|
for (const actionFlagId of actionFlagIds) {
|
|
4046
3926
|
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
@@ -4693,11 +4573,6 @@ var ArchiveActionInput = BaseActionInput.extend(
|
|
|
4693
4573
|
content: ReasonContent
|
|
4694
4574
|
}).shape
|
|
4695
4575
|
);
|
|
4696
|
-
var UnarchiveActionInput = BaseActionInput.extend(
|
|
4697
|
-
z38.object({
|
|
4698
|
-
type: z38.literal(ActionType.UNARCHIVE).default(ActionType.UNARCHIVE)
|
|
4699
|
-
}).shape
|
|
4700
|
-
);
|
|
4701
4576
|
var AssignActionInput = BaseActionInput.extend(
|
|
4702
4577
|
z38.object({
|
|
4703
4578
|
type: z38.literal(ActionType.ASSIGN),
|
|
@@ -4759,7 +4634,6 @@ var ActionInput = z38.discriminatedUnion("type", [
|
|
|
4759
4634
|
id: "MarkNotDuplicateActionInput"
|
|
4760
4635
|
}),
|
|
4761
4636
|
ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
|
|
4762
|
-
UnarchiveActionInput.meta({ id: "UnarchiveActionInput" }),
|
|
4763
4637
|
AssignActionInput.meta({ id: "AssignActionInput" }),
|
|
4764
4638
|
UnassignActionInput.meta({ id: "UnassignActionInput" }),
|
|
4765
4639
|
PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
|
|
@@ -4837,7 +4711,6 @@ var updateActions = ActionTypes.extract([
|
|
|
4837
4711
|
ActionType.REGISTER,
|
|
4838
4712
|
ActionType.REJECT,
|
|
4839
4713
|
ActionType.ARCHIVE,
|
|
4840
|
-
ActionType.UNARCHIVE,
|
|
4841
4714
|
ActionType.PRINT_CERTIFICATE,
|
|
4842
4715
|
ActionType.REQUEST_CORRECTION,
|
|
4843
4716
|
ActionType.APPROVE_CORRECTION,
|
|
@@ -4856,12 +4729,15 @@ var INHERENT_FLAG_RULES = [
|
|
|
4856
4729
|
},
|
|
4857
4730
|
{
|
|
4858
4731
|
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
4859
|
-
// other status-changing action (see getStatusFromActions).
|
|
4860
|
-
// are deliberately excluded so the flag freezes across an archive/unarchive
|
|
4861
|
-
// round trip and comes back exactly as it was.
|
|
4732
|
+
// other status-changing action (see getStatusFromActions).
|
|
4862
4733
|
flag: InherentFlags.INCOMPLETE,
|
|
4863
4734
|
setOn: [ActionType.NOTIFY],
|
|
4864
|
-
resetOn: [
|
|
4735
|
+
resetOn: [
|
|
4736
|
+
ActionType.CREATE,
|
|
4737
|
+
ActionType.DECLARE,
|
|
4738
|
+
ActionType.REGISTER,
|
|
4739
|
+
ActionType.ARCHIVE
|
|
4740
|
+
]
|
|
4865
4741
|
},
|
|
4866
4742
|
{
|
|
4867
4743
|
flag: InherentFlags.REJECTED,
|
|
@@ -7393,7 +7269,6 @@ var ACTION_SCOPE_MAP = {
|
|
|
7393
7269
|
[ActionType.MARK_AS_DUPLICATE]: ["record.review-duplicates"],
|
|
7394
7270
|
[ActionType.MARK_AS_NOT_DUPLICATE]: ["record.review-duplicates"],
|
|
7395
7271
|
[ActionType.ARCHIVE]: ["record.archive"],
|
|
7396
|
-
[ActionType.UNARCHIVE]: ["record.unarchive"],
|
|
7397
7272
|
[ActionType.REJECT]: ["record.reject"],
|
|
7398
7273
|
[ActionType.ASSIGN]: null,
|
|
7399
7274
|
[ActionType.UNASSIGN]: null,
|
|
@@ -7436,11 +7311,7 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
7436
7311
|
ActionType.CUSTOM,
|
|
7437
7312
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
7438
7313
|
],
|
|
7439
|
-
[EventStatus.enum.ARCHIVED]: [
|
|
7440
|
-
ActionType.READ,
|
|
7441
|
-
ActionType.CUSTOM,
|
|
7442
|
-
ActionType.UNARCHIVE
|
|
7443
|
-
]
|
|
7314
|
+
[EventStatus.enum.ARCHIVED]: [ActionType.READ, ActionType.CUSTOM]
|
|
7444
7315
|
};
|
|
7445
7316
|
var ACTION_FILTERS = {
|
|
7446
7317
|
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
@@ -7453,7 +7324,6 @@ var ACTION_FILTERS = {
|
|
|
7453
7324
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
7454
7325
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
7455
7326
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7456
|
-
[ActionType.UNARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7457
7327
|
[ActionType.ASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7458
7328
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7459
7329
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
package/dist/scopes/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type UserFilter = z.infer<typeof UserFilter>;
|
|
|
14
14
|
* The different types of scopes that can be used to control access to records. Each type has different options that can be used to further filter the records that the scope applies to.
|
|
15
15
|
* When adding new scope types, they should be added to the appropriate section based on the options they require.
|
|
16
16
|
*
|
|
17
|
-
* @see scopeOptionsPlaceEvent @see
|
|
17
|
+
* @see scopeOptionsPlaceEvent @see scopeOptionsDeclared @see scopeOptionsFull
|
|
18
18
|
*/
|
|
19
19
|
export declare const RecordScopeTypeV2: z.ZodEnum<{
|
|
20
20
|
"record.search": "record.search";
|
|
@@ -25,7 +25,6 @@ export declare const RecordScopeTypeV2: z.ZodEnum<{
|
|
|
25
25
|
"record.edit": "record.edit";
|
|
26
26
|
"record.reject": "record.reject";
|
|
27
27
|
"record.archive": "record.archive";
|
|
28
|
-
"record.unarchive": "record.unarchive";
|
|
29
28
|
"record.review-duplicates": "record.review-duplicates";
|
|
30
29
|
"record.register": "record.register";
|
|
31
30
|
"record.print-certified-copies": "record.print-certified-copies";
|
|
@@ -49,14 +48,6 @@ declare const AllScopeOptions: z.ZodObject<{
|
|
|
49
48
|
location: "location";
|
|
50
49
|
all: "all";
|
|
51
50
|
}>>;
|
|
52
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
53
|
-
administrativeArea: "administrativeArea";
|
|
54
|
-
location: "location";
|
|
55
|
-
all: "all";
|
|
56
|
-
}>>;
|
|
57
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
58
|
-
user: "user";
|
|
59
|
-
}>>;
|
|
60
51
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
61
52
|
administrativeArea: "administrativeArea";
|
|
62
53
|
location: "location";
|
|
@@ -79,8 +70,6 @@ export declare const ScopeOptionKey: z.ZodEnum<{
|
|
|
79
70
|
role: "role";
|
|
80
71
|
event: "event";
|
|
81
72
|
placeOfEvent: "placeOfEvent";
|
|
82
|
-
notifiedIn: "notifiedIn";
|
|
83
|
-
notifiedBy: "notifiedBy";
|
|
84
73
|
declaredIn: "declaredIn";
|
|
85
74
|
declaredBy: "declaredBy";
|
|
86
75
|
registeredIn: "registeredIn";
|
|
@@ -98,7 +87,6 @@ export declare const ScopesWithDeclaredOptions: z.ZodEnum<{
|
|
|
98
87
|
"record.edit": "record.edit";
|
|
99
88
|
"record.reject": "record.reject";
|
|
100
89
|
"record.archive": "record.archive";
|
|
101
|
-
"record.unarchive": "record.unarchive";
|
|
102
90
|
"record.review-duplicates": "record.review-duplicates";
|
|
103
91
|
"record.register": "record.register";
|
|
104
92
|
}>;
|
|
@@ -128,7 +116,6 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
128
116
|
"record.edit": "record.edit";
|
|
129
117
|
"record.reject": "record.reject";
|
|
130
118
|
"record.archive": "record.archive";
|
|
131
|
-
"record.unarchive": "record.unarchive";
|
|
132
119
|
"record.review-duplicates": "record.review-duplicates";
|
|
133
120
|
"record.register": "record.register";
|
|
134
121
|
}>;
|
|
@@ -139,14 +126,6 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
139
126
|
location: "location";
|
|
140
127
|
all: "all";
|
|
141
128
|
}>>;
|
|
142
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
143
|
-
administrativeArea: "administrativeArea";
|
|
144
|
-
location: "location";
|
|
145
|
-
all: "all";
|
|
146
|
-
}>>;
|
|
147
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
148
|
-
user: "user";
|
|
149
|
-
}>>;
|
|
150
129
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
151
130
|
administrativeArea: "administrativeArea";
|
|
152
131
|
location: "location";
|
|
@@ -171,14 +150,6 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
171
150
|
location: "location";
|
|
172
151
|
all: "all";
|
|
173
152
|
}>>;
|
|
174
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
175
|
-
administrativeArea: "administrativeArea";
|
|
176
|
-
location: "location";
|
|
177
|
-
all: "all";
|
|
178
|
-
}>>;
|
|
179
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
180
|
-
user: "user";
|
|
181
|
-
}>>;
|
|
182
153
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
183
154
|
administrativeArea: "administrativeArea";
|
|
184
155
|
location: "location";
|
|
@@ -205,14 +176,6 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
205
176
|
location: "location";
|
|
206
177
|
all: "all";
|
|
207
178
|
}>>;
|
|
208
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
209
|
-
administrativeArea: "administrativeArea";
|
|
210
|
-
location: "location";
|
|
211
|
-
all: "all";
|
|
212
|
-
}>>;
|
|
213
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
214
|
-
user: "user";
|
|
215
|
-
}>>;
|
|
216
179
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
217
180
|
administrativeArea: "administrativeArea";
|
|
218
181
|
location: "location";
|
|
@@ -240,14 +203,6 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
240
203
|
location: "location";
|
|
241
204
|
all: "all";
|
|
242
205
|
}>>;
|
|
243
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
244
|
-
administrativeArea: "administrativeArea";
|
|
245
|
-
location: "location";
|
|
246
|
-
all: "all";
|
|
247
|
-
}>>;
|
|
248
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
249
|
-
user: "user";
|
|
250
|
-
}>>;
|
|
251
206
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
252
207
|
administrativeArea: "administrativeArea";
|
|
253
208
|
location: "location";
|
|
@@ -344,15 +299,12 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
344
299
|
"record.edit": "record.edit";
|
|
345
300
|
"record.reject": "record.reject";
|
|
346
301
|
"record.archive": "record.archive";
|
|
347
|
-
"record.unarchive": "record.unarchive";
|
|
348
302
|
"record.review-duplicates": "record.review-duplicates";
|
|
349
303
|
"record.register": "record.register";
|
|
350
304
|
}>;
|
|
351
305
|
options: z.ZodOptional<z.ZodObject<{
|
|
352
306
|
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
353
307
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
354
|
-
notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
355
|
-
notifiedBy: z.ZodOptional<z.ZodString>;
|
|
356
308
|
declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
357
309
|
declaredBy: z.ZodOptional<z.ZodString>;
|
|
358
310
|
}, z.core.$strip>>;
|
|
@@ -367,8 +319,6 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
367
319
|
options: z.ZodOptional<z.ZodObject<{
|
|
368
320
|
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
369
321
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
370
|
-
notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
371
|
-
notifiedBy: z.ZodOptional<z.ZodString>;
|
|
372
322
|
declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
373
323
|
declaredBy: z.ZodOptional<z.ZodString>;
|
|
374
324
|
registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -379,8 +329,6 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
379
329
|
options: z.ZodOptional<z.ZodObject<{
|
|
380
330
|
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
381
331
|
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
382
|
-
notifiedIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
383
|
-
notifiedBy: z.ZodOptional<z.ZodString>;
|
|
384
332
|
declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
385
333
|
declaredBy: z.ZodOptional<z.ZodString>;
|
|
386
334
|
registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
@@ -427,7 +375,6 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
427
375
|
"record.edit": "record.edit";
|
|
428
376
|
"record.reject": "record.reject";
|
|
429
377
|
"record.archive": "record.archive";
|
|
430
|
-
"record.unarchive": "record.unarchive";
|
|
431
378
|
"record.review-duplicates": "record.review-duplicates";
|
|
432
379
|
"record.register": "record.register";
|
|
433
380
|
}>;
|
|
@@ -438,14 +385,6 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
438
385
|
location: "location";
|
|
439
386
|
all: "all";
|
|
440
387
|
}>>;
|
|
441
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
442
|
-
administrativeArea: "administrativeArea";
|
|
443
|
-
location: "location";
|
|
444
|
-
all: "all";
|
|
445
|
-
}>>;
|
|
446
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
447
|
-
user: "user";
|
|
448
|
-
}>>;
|
|
449
388
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
450
389
|
administrativeArea: "administrativeArea";
|
|
451
390
|
location: "location";
|
|
@@ -470,14 +409,6 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
470
409
|
location: "location";
|
|
471
410
|
all: "all";
|
|
472
411
|
}>>;
|
|
473
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
474
|
-
administrativeArea: "administrativeArea";
|
|
475
|
-
location: "location";
|
|
476
|
-
all: "all";
|
|
477
|
-
}>>;
|
|
478
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
479
|
-
user: "user";
|
|
480
|
-
}>>;
|
|
481
412
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
482
413
|
administrativeArea: "administrativeArea";
|
|
483
414
|
location: "location";
|
|
@@ -504,14 +435,6 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
504
435
|
location: "location";
|
|
505
436
|
all: "all";
|
|
506
437
|
}>>;
|
|
507
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
508
|
-
administrativeArea: "administrativeArea";
|
|
509
|
-
location: "location";
|
|
510
|
-
all: "all";
|
|
511
|
-
}>>;
|
|
512
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
513
|
-
user: "user";
|
|
514
|
-
}>>;
|
|
515
438
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
516
439
|
administrativeArea: "administrativeArea";
|
|
517
440
|
location: "location";
|
|
@@ -539,14 +462,6 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
539
462
|
location: "location";
|
|
540
463
|
all: "all";
|
|
541
464
|
}>>;
|
|
542
|
-
notifiedIn: z.ZodOptional<z.ZodEnum<{
|
|
543
|
-
administrativeArea: "administrativeArea";
|
|
544
|
-
location: "location";
|
|
545
|
-
all: "all";
|
|
546
|
-
}>>;
|
|
547
|
-
notifiedBy: z.ZodOptional<z.ZodEnum<{
|
|
548
|
-
user: "user";
|
|
549
|
-
}>>;
|
|
550
465
|
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
551
466
|
administrativeArea: "administrativeArea";
|
|
552
467
|
location: "location";
|
|
@@ -620,7 +535,6 @@ export declare const ScopeType: z.ZodEnum<{
|
|
|
620
535
|
"record.edit": "record.edit";
|
|
621
536
|
"record.reject": "record.reject";
|
|
622
537
|
"record.archive": "record.archive";
|
|
623
|
-
"record.unarchive": "record.unarchive";
|
|
624
538
|
"record.review-duplicates": "record.review-duplicates";
|
|
625
539
|
"record.register": "record.register";
|
|
626
540
|
"record.print-certified-copies": "record.print-certified-copies";
|
|
@@ -678,12 +592,10 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
678
592
|
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
679
593
|
} | undefined;
|
|
680
594
|
} | {
|
|
681
|
-
type: "record.edit" | "record.reject" | "record.archive" | "record.
|
|
595
|
+
type: "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register";
|
|
682
596
|
options?: {
|
|
683
597
|
event?: string[] | undefined;
|
|
684
598
|
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
685
|
-
notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
686
|
-
notifiedBy?: "user" | undefined;
|
|
687
599
|
declaredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
688
600
|
declaredBy?: "user" | undefined;
|
|
689
601
|
} | undefined;
|
|
@@ -692,8 +604,6 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
692
604
|
options?: {
|
|
693
605
|
event?: string[] | undefined;
|
|
694
606
|
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
695
|
-
notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
696
|
-
notifiedBy?: "user" | undefined;
|
|
697
607
|
declaredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
698
608
|
declaredBy?: "user" | undefined;
|
|
699
609
|
registeredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
@@ -704,8 +614,6 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
704
614
|
options?: {
|
|
705
615
|
event?: string[] | undefined;
|
|
706
616
|
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
707
|
-
notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
708
|
-
notifiedBy?: "user" | undefined;
|
|
709
617
|
declaredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
710
618
|
declaredBy?: "user" | undefined;
|
|
711
619
|
registeredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
@@ -717,8 +625,6 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
717
625
|
options?: {
|
|
718
626
|
event?: string[] | undefined;
|
|
719
627
|
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
720
|
-
notifiedIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
721
|
-
notifiedBy?: "user" | undefined;
|
|
722
628
|
declaredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
723
629
|
declaredBy?: "user" | undefined;
|
|
724
630
|
registeredIn?: "administrativeArea" | "location" | "all" | undefined;
|