@opencrvs/toolkit 2.1.0-rc.4bddaf2 → 2.1.0-rc.4c1664c
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 +12 -0
- package/dist/cli.js +165 -5154
- package/dist/commons/api/router.d.ts +723 -130
- package/dist/commons/conditionals/conditionals.d.ts +1589 -37
- package/dist/commons/events/ActionConfig.d.ts +209 -0
- package/dist/commons/events/ActionDocument.d.ts +44 -0
- package/dist/commons/events/ActionInput.d.ts +26 -0
- package/dist/commons/events/ActionType.d.ts +6 -1
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
- package/dist/commons/events/AuditLog.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +2 -0
- package/dist/commons/events/EventDocument.d.ts +22 -0
- package/dist/commons/events/FieldConfig.d.ts +5 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +5 -2
- package/dist/commons/events/field.d.ts +722 -34
- package/dist/commons/events/scopes.d.ts +1 -0
- package/dist/commons/events/test.utils.d.ts +9 -1
- package/dist/commons/events/utils.d.ts +23 -1
- package/dist/conditionals/index.js +2 -0
- package/dist/environment/derived-variables.d.ts +0 -12
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +0 -14
- package/dist/environment/logger.d.ts +3 -12
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/manage-users.js +17 -7
- package/dist/environment/setup-environment.js +0 -14
- package/dist/environment/swarm-to-k8s.js +17 -7
- package/dist/environment/update-workflows.js +17 -7
- package/dist/environment/users.js +17 -7
- package/dist/environment/utils.js +17 -7
- package/dist/events/index.js +195 -30
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
- package/dist/migrations/v2.0/index.js +88 -5144
- package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
- package/dist/migrations/v2.1/index.d.ts +6 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -0
- package/dist/migrations/v2.1/index.js +218 -0
- package/dist/notification/index.js +146 -22
- package/dist/scopes/index.d.ts +7 -1
- package/dist/scopes/index.js +2 -0
- package/dist/templates/charts-values/dependencies/values.yaml +0 -3
- package/dist/templates/charts-values/opencrvs-services/values.yaml +0 -4
- package/opencrvs-toolkit-2.1.0-rc.4c1664c.tgz +0 -0
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.4bddaf2.tgz +0 -0
|
@@ -79,6 +79,7 @@ var RecordScopeTypeV2 = z2.enum([
|
|
|
79
79
|
"record.edit",
|
|
80
80
|
"record.reject",
|
|
81
81
|
"record.archive",
|
|
82
|
+
"record.unarchive",
|
|
82
83
|
"record.review-duplicates",
|
|
83
84
|
"record.register",
|
|
84
85
|
"record.print-certified-copies",
|
|
@@ -184,6 +185,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
184
185
|
"record.edit",
|
|
185
186
|
"record.reject",
|
|
186
187
|
"record.archive",
|
|
188
|
+
"record.unarchive",
|
|
187
189
|
"record.review-duplicates",
|
|
188
190
|
"record.register"
|
|
189
191
|
]);
|
|
@@ -325,6 +327,7 @@ var ActionType = {
|
|
|
325
327
|
MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE",
|
|
326
328
|
MARK_AS_NOT_DUPLICATE: "MARK_AS_NOT_DUPLICATE",
|
|
327
329
|
ARCHIVE: "ARCHIVE",
|
|
330
|
+
UNARCHIVE: "UNARCHIVE",
|
|
328
331
|
// Record actions
|
|
329
332
|
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
|
330
333
|
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
|
@@ -344,6 +347,7 @@ var ConfirmableActions = [
|
|
|
344
347
|
ActionType.REGISTER,
|
|
345
348
|
ActionType.REJECT,
|
|
346
349
|
ActionType.ARCHIVE,
|
|
350
|
+
ActionType.UNARCHIVE,
|
|
347
351
|
ActionType.PRINT_CERTIFICATE,
|
|
348
352
|
ActionType.REQUEST_CORRECTION,
|
|
349
353
|
ActionType.APPROVE_CORRECTION,
|
|
@@ -362,6 +366,7 @@ var ActionTypes = z4.enum([
|
|
|
362
366
|
"MARK_AS_DUPLICATE",
|
|
363
367
|
"MARK_AS_NOT_DUPLICATE",
|
|
364
368
|
"ARCHIVE",
|
|
369
|
+
"UNARCHIVE",
|
|
365
370
|
"PRINT_CERTIFICATE",
|
|
366
371
|
"REQUEST_CORRECTION",
|
|
367
372
|
"REJECT_CORRECTION",
|
|
@@ -405,6 +410,7 @@ var WorkqueueActionType = ActionTypes.extract([
|
|
|
405
410
|
ActionType.REJECT,
|
|
406
411
|
ActionType.MARK_AS_DUPLICATE,
|
|
407
412
|
ActionType.ARCHIVE,
|
|
413
|
+
ActionType.UNARCHIVE,
|
|
408
414
|
ActionType.PRINT_CERTIFICATE,
|
|
409
415
|
ActionType.REQUEST_CORRECTION
|
|
410
416
|
]);
|
|
@@ -466,6 +472,7 @@ var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
|
466
472
|
"event.actions.unassign.request",
|
|
467
473
|
"event.actions.read.request",
|
|
468
474
|
"event.actions.archive.request",
|
|
475
|
+
"event.actions.unarchive.request",
|
|
469
476
|
"event.actions.reinstate.request",
|
|
470
477
|
"event.actions.print_certificate.request",
|
|
471
478
|
"event.actions.correction.request.request",
|
|
@@ -1191,6 +1198,11 @@ var ArchiveAction = ActionBase.extend(
|
|
|
1191
1198
|
content: ReasonContent
|
|
1192
1199
|
}).shape
|
|
1193
1200
|
);
|
|
1201
|
+
var UnarchiveAction = ActionBase.extend(
|
|
1202
|
+
z14.object({
|
|
1203
|
+
type: z14.literal(ActionType.UNARCHIVE)
|
|
1204
|
+
}).shape
|
|
1205
|
+
);
|
|
1194
1206
|
var CreatedAction = ActionBase.extend(
|
|
1195
1207
|
z14.object({
|
|
1196
1208
|
type: z14.literal(ActionType.CREATE)
|
|
@@ -1257,6 +1269,7 @@ var ActionDocument = z14.discriminatedUnion("type", [
|
|
|
1257
1269
|
MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
|
|
1258
1270
|
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1259
1271
|
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1272
|
+
UnarchiveAction.meta({ id: "UnarchiveAction" }),
|
|
1260
1273
|
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1261
1274
|
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1262
1275
|
DeclareAction.meta({ id: "DeclareAction" }),
|
|
@@ -2681,6 +2694,9 @@ var ActionConfigBase = z24.object({
|
|
|
2681
2694
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2682
2695
|
deduplication: DeduplicationConfig.optional()
|
|
2683
2696
|
});
|
|
2697
|
+
var actionConfirmationForm = z24.array(FieldConfig).optional().describe(
|
|
2698
|
+
"Fields rendered on the action confirmation dialog. Submitted values are stored in the action annotation and shown in the audit history."
|
|
2699
|
+
);
|
|
2684
2700
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
2685
2701
|
z24.object({
|
|
2686
2702
|
type: z24.literal(ActionType.READ),
|
|
@@ -2692,7 +2708,54 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
2692
2708
|
);
|
|
2693
2709
|
var NotifyConfig = ActionConfigBase.extend(
|
|
2694
2710
|
z24.object({
|
|
2695
|
-
type: z24.literal(ActionType.NOTIFY)
|
|
2711
|
+
type: z24.literal(ActionType.NOTIFY),
|
|
2712
|
+
form: actionConfirmationForm
|
|
2713
|
+
}).shape
|
|
2714
|
+
);
|
|
2715
|
+
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
2716
|
+
z24.object({
|
|
2717
|
+
type: z24.literal(ActionType.DUPLICATE_DETECTED),
|
|
2718
|
+
label: z24.never().optional().describe(
|
|
2719
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no label."
|
|
2720
|
+
),
|
|
2721
|
+
supportingCopy: z24.never().optional(),
|
|
2722
|
+
icon: z24.never().optional().describe(
|
|
2723
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no icon."
|
|
2724
|
+
),
|
|
2725
|
+
conditionals: z24.never().optional().describe(
|
|
2726
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it cannot be disabled or hidden with conditionals."
|
|
2727
|
+
)
|
|
2728
|
+
}).shape
|
|
2729
|
+
);
|
|
2730
|
+
var MarkAsDuplicateConfig = ActionConfigBase.extend(
|
|
2731
|
+
z24.object({
|
|
2732
|
+
type: z24.literal(ActionType.MARK_AS_DUPLICATE)
|
|
2733
|
+
}).shape
|
|
2734
|
+
);
|
|
2735
|
+
var MarkAsNotDuplicateConfig = ActionConfigBase.extend(
|
|
2736
|
+
z24.object({
|
|
2737
|
+
type: z24.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
2738
|
+
}).shape
|
|
2739
|
+
);
|
|
2740
|
+
var AssignConfig = ActionConfigBase.extend(
|
|
2741
|
+
z24.object({
|
|
2742
|
+
type: z24.literal(ActionType.ASSIGN),
|
|
2743
|
+
flags: z24.never().optional().describe(
|
|
2744
|
+
"ASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
2745
|
+
)
|
|
2746
|
+
}).shape
|
|
2747
|
+
);
|
|
2748
|
+
var UnassignConfig = ActionConfigBase.extend(
|
|
2749
|
+
z24.object({
|
|
2750
|
+
type: z24.literal(ActionType.UNASSIGN),
|
|
2751
|
+
flags: z24.never().optional().describe(
|
|
2752
|
+
"UNASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
2753
|
+
)
|
|
2754
|
+
}).shape
|
|
2755
|
+
);
|
|
2756
|
+
var DeleteConfig = ActionConfigBase.extend(
|
|
2757
|
+
z24.object({
|
|
2758
|
+
type: z24.literal(ActionType.DELETE)
|
|
2696
2759
|
}).shape
|
|
2697
2760
|
);
|
|
2698
2761
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
@@ -2701,6 +2764,7 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2701
2764
|
review: DeclarationReviewConfig.describe(
|
|
2702
2765
|
"Configuration of the review page fields."
|
|
2703
2766
|
),
|
|
2767
|
+
form: actionConfirmationForm,
|
|
2704
2768
|
dialogCopy: z24.object({
|
|
2705
2769
|
notify: TranslationConfig.describe(
|
|
2706
2770
|
"Confirmation text for the notify action"
|
|
@@ -2716,7 +2780,13 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2716
2780
|
);
|
|
2717
2781
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
2718
2782
|
z24.object({
|
|
2719
|
-
type: z24.literal(ActionType.ARCHIVE)
|
|
2783
|
+
type: z24.literal(ActionType.ARCHIVE),
|
|
2784
|
+
form: actionConfirmationForm
|
|
2785
|
+
}).shape
|
|
2786
|
+
);
|
|
2787
|
+
var UnarchiveConfig = ActionConfigBase.extend(
|
|
2788
|
+
z24.object({
|
|
2789
|
+
type: z24.literal(ActionType.UNARCHIVE)
|
|
2720
2790
|
}).shape
|
|
2721
2791
|
);
|
|
2722
2792
|
var EditActionConfig = ActionConfigBase.extend(
|
|
@@ -2737,12 +2807,14 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
2737
2807
|
);
|
|
2738
2808
|
var RejectConfig = ActionConfigBase.extend(
|
|
2739
2809
|
z24.object({
|
|
2740
|
-
type: z24.literal(ActionType.REJECT)
|
|
2810
|
+
type: z24.literal(ActionType.REJECT),
|
|
2811
|
+
form: actionConfirmationForm
|
|
2741
2812
|
}).shape
|
|
2742
2813
|
);
|
|
2743
2814
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
2744
2815
|
z24.object({
|
|
2745
|
-
type: z24.literal(ActionType.REGISTER)
|
|
2816
|
+
type: z24.literal(ActionType.REGISTER),
|
|
2817
|
+
form: actionConfirmationForm
|
|
2746
2818
|
}).shape
|
|
2747
2819
|
);
|
|
2748
2820
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
@@ -2757,7 +2829,17 @@ var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
|
2757
2829
|
correctionForm: ActionFormConfig
|
|
2758
2830
|
}).shape
|
|
2759
2831
|
);
|
|
2760
|
-
var
|
|
2832
|
+
var ApproveCorrectionConfig = ActionConfigBase.extend(
|
|
2833
|
+
z24.object({
|
|
2834
|
+
type: z24.literal(ActionType.APPROVE_CORRECTION)
|
|
2835
|
+
}).shape
|
|
2836
|
+
);
|
|
2837
|
+
var RejectCorrectionConfig = ActionConfigBase.extend(
|
|
2838
|
+
z24.object({
|
|
2839
|
+
type: z24.literal(ActionType.REJECT_CORRECTION)
|
|
2840
|
+
}).shape
|
|
2841
|
+
);
|
|
2842
|
+
var CustomActionConfig = ActionConfigBase.extend(
|
|
2761
2843
|
z24.object({
|
|
2762
2844
|
type: z24.literal(ActionType.CUSTOM),
|
|
2763
2845
|
customActionType: z24.string().describe("Type identifier of the custom action."),
|
|
@@ -2768,7 +2850,7 @@ var CustomActionConfig = ActionConfigBase.merge(
|
|
|
2768
2850
|
auditHistoryLabel: TranslationConfig.describe(
|
|
2769
2851
|
'The label to show in audit history for this action. For example "Approved".'
|
|
2770
2852
|
)
|
|
2771
|
-
})
|
|
2853
|
+
}).shape
|
|
2772
2854
|
);
|
|
2773
2855
|
var ActionConfig = z24.discriminatedUnion("type", [
|
|
2774
2856
|
/*
|
|
@@ -2779,6 +2861,18 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2779
2861
|
id: "ReadActionConfig",
|
|
2780
2862
|
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2781
2863
|
}),
|
|
2864
|
+
AssignConfig.meta({
|
|
2865
|
+
id: "AssignActionConfig",
|
|
2866
|
+
description: "Configuration for assigning a record to the current user."
|
|
2867
|
+
}),
|
|
2868
|
+
UnassignConfig.meta({
|
|
2869
|
+
id: "UnassignActionConfig",
|
|
2870
|
+
description: "Configuration for unassigning a record from its current assignee."
|
|
2871
|
+
}),
|
|
2872
|
+
DeleteConfig.meta({
|
|
2873
|
+
id: "DeleteActionConfig",
|
|
2874
|
+
description: "Configuration for deleting a draft record."
|
|
2875
|
+
}),
|
|
2782
2876
|
NotifyConfig.meta({
|
|
2783
2877
|
id: "NotifyActionConfig",
|
|
2784
2878
|
description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
|
|
@@ -2787,6 +2881,18 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2787
2881
|
id: "DeclareActionConfig",
|
|
2788
2882
|
description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
|
|
2789
2883
|
}),
|
|
2884
|
+
DuplicateDetectedConfig.meta({
|
|
2885
|
+
id: "DuplicateDetectedActionConfig",
|
|
2886
|
+
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."
|
|
2887
|
+
}),
|
|
2888
|
+
MarkAsDuplicateConfig.meta({
|
|
2889
|
+
id: "MarkAsDuplicateActionConfig",
|
|
2890
|
+
description: "Configuration for marking a record as a duplicate."
|
|
2891
|
+
}),
|
|
2892
|
+
MarkAsNotDuplicateConfig.meta({
|
|
2893
|
+
id: "MarkAsNotDuplicateActionConfig",
|
|
2894
|
+
description: "Configuration for marking a record as not a duplicate, after it was previously flagged as one."
|
|
2895
|
+
}),
|
|
2790
2896
|
RejectConfig.meta({
|
|
2791
2897
|
id: "RejectActionConfig",
|
|
2792
2898
|
description: "Configuration for rejecting a record before registration."
|
|
@@ -2803,6 +2909,14 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2803
2909
|
id: "RequestCorrectionActionConfig",
|
|
2804
2910
|
description: "Configuration for requesting a correction on a registered record."
|
|
2805
2911
|
}),
|
|
2912
|
+
ApproveCorrectionConfig.meta({
|
|
2913
|
+
id: "ApproveCorrectionActionConfig",
|
|
2914
|
+
description: "Configuration for approving a requested correction."
|
|
2915
|
+
}),
|
|
2916
|
+
RejectCorrectionConfig.meta({
|
|
2917
|
+
id: "RejectCorrectionActionConfig",
|
|
2918
|
+
description: "Configuration for rejecting a requested correction."
|
|
2919
|
+
}),
|
|
2806
2920
|
EditActionConfig.meta({
|
|
2807
2921
|
id: "EditActionConfig",
|
|
2808
2922
|
description: "Configuration for editing a record before registration."
|
|
@@ -2811,6 +2925,10 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2811
2925
|
id: "ArchiveActionConfig",
|
|
2812
2926
|
description: "Configuration for archiving a record."
|
|
2813
2927
|
}),
|
|
2928
|
+
UnarchiveConfig.meta({
|
|
2929
|
+
id: "UnarchiveActionConfig",
|
|
2930
|
+
description: "Configuration for unarchiving a record."
|
|
2931
|
+
}),
|
|
2814
2932
|
CustomActionConfig.meta({
|
|
2815
2933
|
id: "CustomActionConfig",
|
|
2816
2934
|
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
@@ -3216,13 +3334,9 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
3216
3334
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
3217
3335
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
3218
3336
|
}
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
if ("review" in actionConfig && actionConfig.review != null) {
|
|
3223
|
-
return actionConfig.review.fields;
|
|
3224
|
-
}
|
|
3225
|
-
return [];
|
|
3337
|
+
const reviewFields = "review" in actionConfig && actionConfig.review != null ? actionConfig.review.fields : [];
|
|
3338
|
+
const formFields = "form" in actionConfig && actionConfig.form != null ? actionConfig.form : [];
|
|
3339
|
+
return [...reviewFields, ...formFields];
|
|
3226
3340
|
};
|
|
3227
3341
|
function getAllAnnotationFields(config) {
|
|
3228
3342
|
return (0, import_lodash.flattenDeep)(config.actions.map(getActionAnnotationFields));
|
|
@@ -3930,7 +4044,7 @@ function validateActionFlags(event2, ctx) {
|
|
|
3930
4044
|
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
3931
4045
|
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
3932
4046
|
const actionFlagIds = event2.actions.flatMap(
|
|
3933
|
-
(action) => action.flags.map((flag) => flag.id)
|
|
4047
|
+
(action) => (action.flags ?? []).map((flag) => flag.id)
|
|
3934
4048
|
);
|
|
3935
4049
|
for (const actionFlagId of actionFlagIds) {
|
|
3936
4050
|
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
@@ -4583,6 +4697,11 @@ var ArchiveActionInput = BaseActionInput.extend(
|
|
|
4583
4697
|
content: ReasonContent
|
|
4584
4698
|
}).shape
|
|
4585
4699
|
);
|
|
4700
|
+
var UnarchiveActionInput = BaseActionInput.extend(
|
|
4701
|
+
z38.object({
|
|
4702
|
+
type: z38.literal(ActionType.UNARCHIVE).default(ActionType.UNARCHIVE)
|
|
4703
|
+
}).shape
|
|
4704
|
+
);
|
|
4586
4705
|
var AssignActionInput = BaseActionInput.extend(
|
|
4587
4706
|
z38.object({
|
|
4588
4707
|
type: z38.literal(ActionType.ASSIGN),
|
|
@@ -4644,6 +4763,7 @@ var ActionInput = z38.discriminatedUnion("type", [
|
|
|
4644
4763
|
id: "MarkNotDuplicateActionInput"
|
|
4645
4764
|
}),
|
|
4646
4765
|
ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
|
|
4766
|
+
UnarchiveActionInput.meta({ id: "UnarchiveActionInput" }),
|
|
4647
4767
|
AssignActionInput.meta({ id: "AssignActionInput" }),
|
|
4648
4768
|
UnassignActionInput.meta({ id: "UnassignActionInput" }),
|
|
4649
4769
|
PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
|
|
@@ -4721,6 +4841,7 @@ var updateActions = ActionTypes.extract([
|
|
|
4721
4841
|
ActionType.REGISTER,
|
|
4722
4842
|
ActionType.REJECT,
|
|
4723
4843
|
ActionType.ARCHIVE,
|
|
4844
|
+
ActionType.UNARCHIVE,
|
|
4724
4845
|
ActionType.PRINT_CERTIFICATE,
|
|
4725
4846
|
ActionType.REQUEST_CORRECTION,
|
|
4726
4847
|
ActionType.APPROVE_CORRECTION,
|
|
@@ -4739,15 +4860,12 @@ var INHERENT_FLAG_RULES = [
|
|
|
4739
4860
|
},
|
|
4740
4861
|
{
|
|
4741
4862
|
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
4742
|
-
// other status-changing action (see getStatusFromActions).
|
|
4863
|
+
// other status-changing action (see getStatusFromActions). ARCHIVE/UNARCHIVE
|
|
4864
|
+
// are deliberately excluded so the flag freezes across an archive/unarchive
|
|
4865
|
+
// round trip and comes back exactly as it was.
|
|
4743
4866
|
flag: InherentFlags.INCOMPLETE,
|
|
4744
4867
|
setOn: [ActionType.NOTIFY],
|
|
4745
|
-
resetOn: [
|
|
4746
|
-
ActionType.CREATE,
|
|
4747
|
-
ActionType.DECLARE,
|
|
4748
|
-
ActionType.REGISTER,
|
|
4749
|
-
ActionType.ARCHIVE
|
|
4750
|
-
]
|
|
4868
|
+
resetOn: [ActionType.CREATE, ActionType.DECLARE, ActionType.REGISTER]
|
|
4751
4869
|
},
|
|
4752
4870
|
{
|
|
4753
4871
|
flag: InherentFlags.REJECTED,
|
|
@@ -7279,6 +7397,7 @@ var ACTION_SCOPE_MAP = {
|
|
|
7279
7397
|
[ActionType.MARK_AS_DUPLICATE]: ["record.review-duplicates"],
|
|
7280
7398
|
[ActionType.MARK_AS_NOT_DUPLICATE]: ["record.review-duplicates"],
|
|
7281
7399
|
[ActionType.ARCHIVE]: ["record.archive"],
|
|
7400
|
+
[ActionType.UNARCHIVE]: ["record.unarchive"],
|
|
7282
7401
|
[ActionType.REJECT]: ["record.reject"],
|
|
7283
7402
|
[ActionType.ASSIGN]: null,
|
|
7284
7403
|
[ActionType.UNASSIGN]: null,
|
|
@@ -7321,7 +7440,11 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
7321
7440
|
ActionType.CUSTOM,
|
|
7322
7441
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
7323
7442
|
],
|
|
7324
|
-
[EventStatus.enum.ARCHIVED]: [
|
|
7443
|
+
[EventStatus.enum.ARCHIVED]: [
|
|
7444
|
+
ActionType.READ,
|
|
7445
|
+
ActionType.CUSTOM,
|
|
7446
|
+
ActionType.UNARCHIVE
|
|
7447
|
+
]
|
|
7325
7448
|
};
|
|
7326
7449
|
var ACTION_FILTERS = {
|
|
7327
7450
|
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
@@ -7334,6 +7457,7 @@ var ACTION_FILTERS = {
|
|
|
7334
7457
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
7335
7458
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
7336
7459
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7460
|
+
[ActionType.UNARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7337
7461
|
[ActionType.ASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7338
7462
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7339
7463
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
package/dist/scopes/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ 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";
|
|
28
29
|
"record.review-duplicates": "record.review-duplicates";
|
|
29
30
|
"record.register": "record.register";
|
|
30
31
|
"record.print-certified-copies": "record.print-certified-copies";
|
|
@@ -97,6 +98,7 @@ export declare const ScopesWithDeclaredOptions: z.ZodEnum<{
|
|
|
97
98
|
"record.edit": "record.edit";
|
|
98
99
|
"record.reject": "record.reject";
|
|
99
100
|
"record.archive": "record.archive";
|
|
101
|
+
"record.unarchive": "record.unarchive";
|
|
100
102
|
"record.review-duplicates": "record.review-duplicates";
|
|
101
103
|
"record.register": "record.register";
|
|
102
104
|
}>;
|
|
@@ -126,6 +128,7 @@ export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
126
128
|
"record.edit": "record.edit";
|
|
127
129
|
"record.reject": "record.reject";
|
|
128
130
|
"record.archive": "record.archive";
|
|
131
|
+
"record.unarchive": "record.unarchive";
|
|
129
132
|
"record.review-duplicates": "record.review-duplicates";
|
|
130
133
|
"record.register": "record.register";
|
|
131
134
|
}>;
|
|
@@ -341,6 +344,7 @@ export declare const ResolvedRecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
341
344
|
"record.edit": "record.edit";
|
|
342
345
|
"record.reject": "record.reject";
|
|
343
346
|
"record.archive": "record.archive";
|
|
347
|
+
"record.unarchive": "record.unarchive";
|
|
344
348
|
"record.review-duplicates": "record.review-duplicates";
|
|
345
349
|
"record.register": "record.register";
|
|
346
350
|
}>;
|
|
@@ -423,6 +427,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
423
427
|
"record.edit": "record.edit";
|
|
424
428
|
"record.reject": "record.reject";
|
|
425
429
|
"record.archive": "record.archive";
|
|
430
|
+
"record.unarchive": "record.unarchive";
|
|
426
431
|
"record.review-duplicates": "record.review-duplicates";
|
|
427
432
|
"record.register": "record.register";
|
|
428
433
|
}>;
|
|
@@ -615,6 +620,7 @@ export declare const ScopeType: z.ZodEnum<{
|
|
|
615
620
|
"record.edit": "record.edit";
|
|
616
621
|
"record.reject": "record.reject";
|
|
617
622
|
"record.archive": "record.archive";
|
|
623
|
+
"record.unarchive": "record.unarchive";
|
|
618
624
|
"record.review-duplicates": "record.review-duplicates";
|
|
619
625
|
"record.register": "record.register";
|
|
620
626
|
"record.print-certified-copies": "record.print-certified-copies";
|
|
@@ -672,7 +678,7 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
672
678
|
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
673
679
|
} | undefined;
|
|
674
680
|
} | {
|
|
675
|
-
type: "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register";
|
|
681
|
+
type: "record.edit" | "record.reject" | "record.archive" | "record.unarchive" | "record.review-duplicates" | "record.register";
|
|
676
682
|
options?: {
|
|
677
683
|
event?: string[] | undefined;
|
|
678
684
|
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
package/dist/scopes/index.js
CHANGED
|
@@ -110,6 +110,7 @@ var RecordScopeTypeV2 = z3.enum([
|
|
|
110
110
|
"record.edit",
|
|
111
111
|
"record.reject",
|
|
112
112
|
"record.archive",
|
|
113
|
+
"record.unarchive",
|
|
113
114
|
"record.review-duplicates",
|
|
114
115
|
"record.register",
|
|
115
116
|
"record.print-certified-copies",
|
|
@@ -215,6 +216,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
215
216
|
"record.edit",
|
|
216
217
|
"record.reject",
|
|
217
218
|
"record.archive",
|
|
219
|
+
"record.unarchive",
|
|
218
220
|
"record.review-duplicates",
|
|
219
221
|
"record.register"
|
|
220
222
|
]);
|
|
@@ -36,10 +36,6 @@ minio:
|
|
|
36
36
|
auth_mode: use_secret
|
|
37
37
|
host: minio-0.minio.opencrvs-deps-{{env}}.svc.cluster.local
|
|
38
38
|
|
|
39
|
-
mongodb:
|
|
40
|
-
auth_mode: auto
|
|
41
|
-
host: mongodb-0.mongodb.opencrvs-deps-{{env}}.svc.cluster.local
|
|
42
|
-
|
|
43
39
|
redis:
|
|
44
40
|
auth_mode: use_secret
|
|
45
41
|
host: redis-0.redis.opencrvs-deps-{{env}}.svc.cluster.local
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencrvs/toolkit",
|
|
3
|
-
"version": "2.1.0-rc.
|
|
3
|
+
"version": "2.1.0-rc.4c1664c",
|
|
4
4
|
"description": "OpenCRVS toolkit for building country configurations",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@types/ssh2": "^1.15.5",
|
|
60
60
|
"@types/uuid": "^9.0.3",
|
|
61
61
|
"esbuild": "^0.24.0",
|
|
62
|
-
"typescript": "
|
|
62
|
+
"typescript": "6.0.3"
|
|
63
63
|
},
|
|
64
64
|
"moduleNameMapper": {
|
|
65
65
|
"@opencrvs/commons/events": "@opencrvs/commons/build/dist/common/events/index.js",
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/cli.ts","./src/api/index.ts","./src/application-config/index.ts","./src/conditionals/index.ts","./src/environment/custom-types.ts","./src/environment/derived-variables.ts","./src/environment/editor-questions.ts","./src/environment/git.ts","./src/environment/github.ts","./src/environment/index.ts","./src/environment/logger.ts","./src/environment/manage-users.ts","./src/environment/questions-helper.ts","./src/environment/questions.ts","./src/environment/setup-environment.ts","./src/environment/ssh-keygen.ts","./src/environment/swarm-to-k8s.ts","./src/environment/templates.ts","./src/environment/update-workflows.ts","./src/environment/users.ts","./src/environment/utils.ts","./src/events/deduplication.ts","./src/events/index.ts","./src/migrations/v2.0/add-birth-certificate-issuance-flag.ts","./src/migrations/v2.0/add-resend-invite-notification.ts","./src/migrations/v2.0/checkout-upstream-files.ts","./src/migrations/v2.0/convert-config-files-to-ts.ts","./src/migrations/v2.0/convert-paragraph-to-heading.ts","./src/migrations/v2.0/create-events-index.ts","./src/migrations/v2.0/delete-infrastructure-directory.ts","./src/migrations/v2.0/fix-accept-requested-registration-function-type.ts","./src/migrations/v2.0/index.ts","./src/migrations/v2.0/make-built-in-validate-actions-custom.ts","./src/migrations/v2.0/merge-infrastructure-directory.ts","./src/migrations/v2.0/migrate-application-config-url.ts","./src/migrations/v2.0/migrate-scopes.ts","./src/migrations/v2.0/migrate-validated-workqueue-status-to-flag.ts","./src/migrations/v2.0/migrate-workqueue-configs.ts","./src/migrations/v2.0/remove-delete-actions.ts","./src/migrations/v2.0/remove-demo-scope.ts","./src/migrations/v2.0/remove-deprecated-imports.ts","./src/migrations/v2.0/remove-fhir-url-helpers.ts","./src/migrations/v2.0/remove-hearth-migrations.ts","./src/migrations/v2.0/remove-old-statistics-service.ts","./src/migrations/v2.0/remove-pending-certification-flag.ts","./src/migrations/v2.0/remove-review-from-register-action.ts","./src/migrations/v2.0/remove-unused-environment-variables.ts","./src/migrations/v2.0/rename-api-paths.ts","./src/migrations/v2.0/rename-location-parent-id.ts","./src/migrations/v2.0/simplify-analytics-precalculations.ts","./src/migrations/v2.0/update-package-json.ts","./src/notification/index.ts","./src/scopes/index.ts"],"version":"
|
|
1
|
+
{"root":["./src/cli.ts","./src/api/index.ts","./src/application-config/index.ts","./src/conditionals/index.ts","./src/environment/custom-types.ts","./src/environment/derived-variables.ts","./src/environment/editor-questions.ts","./src/environment/git.ts","./src/environment/github.ts","./src/environment/index.ts","./src/environment/logger.ts","./src/environment/manage-users.ts","./src/environment/questions-helper.ts","./src/environment/questions.ts","./src/environment/setup-environment.ts","./src/environment/ssh-keygen.ts","./src/environment/swarm-to-k8s.ts","./src/environment/templates.ts","./src/environment/update-workflows.ts","./src/environment/users.ts","./src/environment/utils.ts","./src/events/deduplication.ts","./src/events/index.ts","./src/migrations/v2.0/add-birth-certificate-issuance-flag.ts","./src/migrations/v2.0/add-resend-invite-notification.ts","./src/migrations/v2.0/checkout-upstream-files.ts","./src/migrations/v2.0/convert-config-files-to-ts.ts","./src/migrations/v2.0/convert-paragraph-to-heading.ts","./src/migrations/v2.0/create-events-index.ts","./src/migrations/v2.0/delete-infrastructure-directory.ts","./src/migrations/v2.0/fix-accept-requested-registration-function-type.ts","./src/migrations/v2.0/index.ts","./src/migrations/v2.0/make-built-in-validate-actions-custom.ts","./src/migrations/v2.0/merge-infrastructure-directory.ts","./src/migrations/v2.0/migrate-application-config-url.ts","./src/migrations/v2.0/migrate-scopes.ts","./src/migrations/v2.0/migrate-validated-workqueue-status-to-flag.ts","./src/migrations/v2.0/migrate-workqueue-configs.ts","./src/migrations/v2.0/remove-delete-actions.ts","./src/migrations/v2.0/remove-demo-scope.ts","./src/migrations/v2.0/remove-deprecated-imports.ts","./src/migrations/v2.0/remove-fhir-url-helpers.ts","./src/migrations/v2.0/remove-hearth-migrations.ts","./src/migrations/v2.0/remove-old-statistics-service.ts","./src/migrations/v2.0/remove-pending-certification-flag.ts","./src/migrations/v2.0/remove-review-from-register-action.ts","./src/migrations/v2.0/remove-unused-environment-variables.ts","./src/migrations/v2.0/rename-api-paths.ts","./src/migrations/v2.0/rename-location-parent-id.ts","./src/migrations/v2.0/simplify-analytics-precalculations.ts","./src/migrations/v2.0/update-package-json.ts","./src/migrations/v2.1/add-explicit-correction-flags.ts","./src/migrations/v2.1/index.ts","./src/notification/index.ts","./src/scopes/index.ts"],"version":"6.0.3"}
|
|
Binary file
|