@opencrvs/toolkit 2.0.0-rc.ff99998 → 2.1.0-rc.0066f38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/build.sh +5 -4
- package/create-countryconfig/package.json +1 -1
- package/dist/application-config/index.js +36 -7
- package/dist/cli.js +3186 -4921
- package/dist/commons/api/router.d.ts +634 -22
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/events/ActionConfig.d.ts +237 -2
- 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 +18 -0
- package/dist/commons/events/AuditLog.d.ts +2 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/Draft.d.ts +2 -0
- package/dist/commons/events/EventConfig.d.ts +2 -0
- package/dist/commons/events/EventDocument.d.ts +22 -0
- package/dist/commons/events/EventIndex.d.ts +25 -0
- package/dist/commons/events/EventMetadata.d.ts +26 -0
- package/dist/commons/events/FieldConfig.d.ts +16 -0
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- package/dist/commons/events/WorkqueueConfig.d.ts +44 -2
- package/dist/commons/events/locations.d.ts +1 -0
- package/dist/commons/events/scopes.d.ts +1 -0
- package/dist/commons/events/state/index.d.ts +8 -0
- package/dist/commons/events/state/utils.d.ts +9 -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 +12 -5
- package/dist/environment/custom-types.d.ts +33 -0
- package/dist/environment/custom-types.d.ts.map +1 -0
- package/dist/environment/custom-types.js +12 -0
- package/dist/environment/derived-variables.d.ts +134 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +169 -0
- package/dist/environment/editor-questions.d.ts +4 -0
- package/dist/environment/editor-questions.d.ts.map +1 -0
- package/dist/environment/editor-questions.js +67 -0
- package/dist/environment/git.d.ts +5 -0
- package/dist/environment/git.d.ts.map +1 -0
- package/dist/environment/git.js +38 -0
- package/dist/environment/github.d.ts +26 -0
- package/dist/environment/github.d.ts.map +1 -0
- package/dist/environment/github.js +247 -0
- package/dist/environment/index.d.ts +5 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +71 -0
- package/dist/environment/logger.d.ts +15 -0
- package/dist/environment/logger.d.ts.map +1 -0
- package/dist/environment/logger.js +25 -0
- package/dist/environment/manage-users.d.ts +11 -0
- package/dist/environment/manage-users.d.ts.map +1 -0
- package/dist/environment/manage-users.js +497 -0
- package/dist/environment/questions-helper.d.ts +15 -0
- package/dist/environment/questions-helper.d.ts.map +1 -0
- package/dist/environment/questions-helper.js +70 -0
- package/dist/environment/questions.d.ts +199 -0
- package/dist/environment/questions.d.ts.map +1 -0
- package/dist/environment/questions.js +412 -0
- package/dist/environment/setup-environment.d.ts +2 -0
- package/dist/environment/setup-environment.d.ts.map +1 -0
- package/dist/environment/setup-environment.js +794 -0
- package/dist/environment/ssh-keygen.d.ts +5 -0
- package/dist/environment/ssh-keygen.d.ts.map +1 -0
- package/dist/environment/ssh-keygen.js +21 -0
- package/dist/environment/swarm-to-k8s.d.ts +2 -0
- package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
- package/dist/environment/swarm-to-k8s.js +173 -0
- package/dist/environment/templates.d.ts +27 -0
- package/dist/environment/templates.d.ts.map +1 -0
- package/dist/environment/templates.js +163 -0
- package/dist/environment/update-workflows.d.ts +2 -0
- package/dist/environment/update-workflows.d.ts.map +1 -0
- package/dist/environment/update-workflows.js +169 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +112 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +100 -0
- package/dist/events/index.js +379 -89
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
- package/dist/migrations/v2.0/index.js +88 -5139
- 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 +250 -22
- package/dist/scopes/index.d.ts +96 -2
- package/dist/scopes/index.js +12 -5
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +83 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +115 -0
- package/dist/templates/inventory/inventory.template.yml +100 -0
- package/dist/templates/inventory/production.example.yml +77 -0
- package/dist/templates/inventory/qa.example.yml +48 -0
- package/opencrvs-toolkit-2.1.0-rc.0066f38.tgz +0 -0
- package/package.json +15 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.ff99998.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",
|
|
@@ -118,11 +119,13 @@ var scopeOptionsPlaceEvent = z2.object({
|
|
|
118
119
|
event: scopeByEvent,
|
|
119
120
|
placeOfEvent: JurisdictionFilter.optional()
|
|
120
121
|
}).describe("Options applicable to all record scopes.");
|
|
121
|
-
var
|
|
122
|
+
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
123
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
124
|
+
notifiedBy: UserFilter.optional(),
|
|
122
125
|
declaredIn: JurisdictionFilter.optional(),
|
|
123
126
|
declaredBy: UserFilter.optional()
|
|
124
127
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
125
|
-
var AllRecordScopeOptions =
|
|
128
|
+
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
126
129
|
registeredIn: JurisdictionFilter.optional(),
|
|
127
130
|
registeredBy: UserFilter.optional()
|
|
128
131
|
}).describe(
|
|
@@ -160,6 +163,8 @@ var ResolvedScopeOptionsPlaceEvent = z2.object({
|
|
|
160
163
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
161
164
|
);
|
|
162
165
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
166
|
+
notifiedIn: UUID.nullish(),
|
|
167
|
+
notifiedBy: z2.string().optional(),
|
|
163
168
|
declaredIn: UUID.nullish(),
|
|
164
169
|
declaredBy: z2.string().optional()
|
|
165
170
|
}).describe(
|
|
@@ -180,6 +185,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
180
185
|
"record.edit",
|
|
181
186
|
"record.reject",
|
|
182
187
|
"record.archive",
|
|
188
|
+
"record.unarchive",
|
|
183
189
|
"record.review-duplicates",
|
|
184
190
|
"record.register"
|
|
185
191
|
]);
|
|
@@ -205,7 +211,7 @@ var RecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
205
211
|
}),
|
|
206
212
|
z2.object({
|
|
207
213
|
type: ScopesWithDeclaredOptions,
|
|
208
|
-
options:
|
|
214
|
+
options: scopeOptionsDeclaredOrNotified.optional()
|
|
209
215
|
}),
|
|
210
216
|
z2.object({
|
|
211
217
|
type: ScopesWithFullOptions,
|
|
@@ -294,8 +300,9 @@ var EncodedScope = z2.string().brand("EncodedScope");
|
|
|
294
300
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
295
301
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
296
302
|
accessLevel: JurisdictionFilter.enum.all,
|
|
297
|
-
|
|
298
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
303
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
304
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
305
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
299
306
|
};
|
|
300
307
|
|
|
301
308
|
// ../commons/src/authentication.ts
|
|
@@ -320,6 +327,7 @@ var ActionType = {
|
|
|
320
327
|
MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE",
|
|
321
328
|
MARK_AS_NOT_DUPLICATE: "MARK_AS_NOT_DUPLICATE",
|
|
322
329
|
ARCHIVE: "ARCHIVE",
|
|
330
|
+
UNARCHIVE: "UNARCHIVE",
|
|
323
331
|
// Record actions
|
|
324
332
|
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
|
325
333
|
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
|
@@ -339,6 +347,7 @@ var ConfirmableActions = [
|
|
|
339
347
|
ActionType.REGISTER,
|
|
340
348
|
ActionType.REJECT,
|
|
341
349
|
ActionType.ARCHIVE,
|
|
350
|
+
ActionType.UNARCHIVE,
|
|
342
351
|
ActionType.PRINT_CERTIFICATE,
|
|
343
352
|
ActionType.REQUEST_CORRECTION,
|
|
344
353
|
ActionType.APPROVE_CORRECTION,
|
|
@@ -357,6 +366,7 @@ var ActionTypes = z4.enum([
|
|
|
357
366
|
"MARK_AS_DUPLICATE",
|
|
358
367
|
"MARK_AS_NOT_DUPLICATE",
|
|
359
368
|
"ARCHIVE",
|
|
369
|
+
"UNARCHIVE",
|
|
360
370
|
"PRINT_CERTIFICATE",
|
|
361
371
|
"REQUEST_CORRECTION",
|
|
362
372
|
"REJECT_CORRECTION",
|
|
@@ -400,6 +410,7 @@ var WorkqueueActionType = ActionTypes.extract([
|
|
|
400
410
|
ActionType.REJECT,
|
|
401
411
|
ActionType.MARK_AS_DUPLICATE,
|
|
402
412
|
ActionType.ARCHIVE,
|
|
413
|
+
ActionType.UNARCHIVE,
|
|
403
414
|
ActionType.PRINT_CERTIFICATE,
|
|
404
415
|
ActionType.REQUEST_CORRECTION
|
|
405
416
|
]);
|
|
@@ -461,6 +472,7 @@ var EventActionEntrySchema = AuditLogEntryBase.extend({
|
|
|
461
472
|
"event.actions.unassign.request",
|
|
462
473
|
"event.actions.read.request",
|
|
463
474
|
"event.actions.archive.request",
|
|
475
|
+
"event.actions.unarchive.request",
|
|
464
476
|
"event.actions.reinstate.request",
|
|
465
477
|
"event.actions.print_certificate.request",
|
|
466
478
|
"event.actions.correction.request.request",
|
|
@@ -770,6 +782,11 @@ var FieldTypesToHideInReview = [
|
|
|
770
782
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
771
783
|
FieldType.ALPHA_HIDDEN
|
|
772
784
|
];
|
|
785
|
+
var HiddenFieldTypes = [
|
|
786
|
+
FieldType.HTTP,
|
|
787
|
+
FieldType.QUERY_PARAM_READER,
|
|
788
|
+
FieldType.ALPHA_HIDDEN
|
|
789
|
+
];
|
|
773
790
|
|
|
774
791
|
// ../commons/src/events/FieldValue.ts
|
|
775
792
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -888,7 +905,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
888
905
|
// ../commons/src/events/FieldValue.ts
|
|
889
906
|
var TextValue = z12.string();
|
|
890
907
|
var HiddenFieldValue = z12.string();
|
|
891
|
-
var NonEmptyTextValue =
|
|
908
|
+
var NonEmptyTextValue = z12.string().trim().min(1);
|
|
892
909
|
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
893
910
|
var AgeValue = z12.object({
|
|
894
911
|
age: z12.number(),
|
|
@@ -1181,6 +1198,11 @@ var ArchiveAction = ActionBase.extend(
|
|
|
1181
1198
|
content: ReasonContent
|
|
1182
1199
|
}).shape
|
|
1183
1200
|
);
|
|
1201
|
+
var UnarchiveAction = ActionBase.extend(
|
|
1202
|
+
z14.object({
|
|
1203
|
+
type: z14.literal(ActionType.UNARCHIVE)
|
|
1204
|
+
}).shape
|
|
1205
|
+
);
|
|
1184
1206
|
var CreatedAction = ActionBase.extend(
|
|
1185
1207
|
z14.object({
|
|
1186
1208
|
type: z14.literal(ActionType.CREATE)
|
|
@@ -1247,6 +1269,7 @@ var ActionDocument = z14.discriminatedUnion("type", [
|
|
|
1247
1269
|
MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
|
|
1248
1270
|
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1249
1271
|
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1272
|
+
UnarchiveAction.meta({ id: "UnarchiveAction" }),
|
|
1250
1273
|
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1251
1274
|
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1252
1275
|
DeclareAction.meta({ id: "DeclareAction" }),
|
|
@@ -1352,6 +1375,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1352
1375
|
)
|
|
1353
1376
|
});
|
|
1354
1377
|
var LegalStatuses = z16.object({
|
|
1378
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1355
1379
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1356
1380
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1357
1381
|
});
|
|
@@ -1411,6 +1435,8 @@ var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
|
1411
1435
|
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1412
1436
|
"createdAt",
|
|
1413
1437
|
"updatedAt",
|
|
1438
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1439
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1414
1440
|
"legalStatuses.DECLARED.createdAt",
|
|
1415
1441
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1416
1442
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1419,6 +1445,8 @@ var EventMetadataDateFieldIdInput = z16.enum([
|
|
|
1419
1445
|
var EventMetadataDateFieldId = z16.enum([
|
|
1420
1446
|
"event.createdAt",
|
|
1421
1447
|
"event.updatedAt",
|
|
1448
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1449
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1422
1450
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1423
1451
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1424
1452
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1478,7 +1506,8 @@ var Range = import_v4.z.object({
|
|
|
1478
1506
|
});
|
|
1479
1507
|
var ContainsFlags = import_v4.z.object({
|
|
1480
1508
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
1481
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1509
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
1510
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
1482
1511
|
}).meta({
|
|
1483
1512
|
id: "ContainsFlags"
|
|
1484
1513
|
});
|
|
@@ -1750,6 +1779,7 @@ var NumberField = BaseField.extend({
|
|
|
1750
1779
|
configuration: import_v43.default.object({
|
|
1751
1780
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1752
1781
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1782
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1753
1783
|
prefix: TranslationConfig.optional(),
|
|
1754
1784
|
postfix: TranslationConfig.optional()
|
|
1755
1785
|
}).optional()
|
|
@@ -2664,6 +2694,9 @@ var ActionConfigBase = z24.object({
|
|
|
2664
2694
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
2665
2695
|
deduplication: DeduplicationConfig.optional()
|
|
2666
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
|
+
);
|
|
2667
2700
|
var ReadActionConfig = ActionConfigBase.extend(
|
|
2668
2701
|
z24.object({
|
|
2669
2702
|
type: z24.literal(ActionType.READ),
|
|
@@ -2673,12 +2706,65 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
2673
2706
|
conditionals: z24.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2674
2707
|
}).shape
|
|
2675
2708
|
);
|
|
2709
|
+
var NotifyConfig = ActionConfigBase.extend(
|
|
2710
|
+
z24.object({
|
|
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)
|
|
2759
|
+
}).shape
|
|
2760
|
+
);
|
|
2676
2761
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
2677
2762
|
z24.object({
|
|
2678
2763
|
type: z24.literal(ActionType.DECLARE),
|
|
2679
2764
|
review: DeclarationReviewConfig.describe(
|
|
2680
2765
|
"Configuration of the review page fields."
|
|
2681
2766
|
),
|
|
2767
|
+
form: actionConfirmationForm,
|
|
2682
2768
|
dialogCopy: z24.object({
|
|
2683
2769
|
notify: TranslationConfig.describe(
|
|
2684
2770
|
"Confirmation text for the notify action"
|
|
@@ -2694,7 +2780,13 @@ var DeclareConfig = DeclarationActionBase.extend(
|
|
|
2694
2780
|
);
|
|
2695
2781
|
var ArchiveConfig = ActionConfigBase.extend(
|
|
2696
2782
|
z24.object({
|
|
2697
|
-
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)
|
|
2698
2790
|
}).shape
|
|
2699
2791
|
);
|
|
2700
2792
|
var EditActionConfig = ActionConfigBase.extend(
|
|
@@ -2715,12 +2807,14 @@ var EditActionConfig = ActionConfigBase.extend(
|
|
|
2715
2807
|
);
|
|
2716
2808
|
var RejectConfig = ActionConfigBase.extend(
|
|
2717
2809
|
z24.object({
|
|
2718
|
-
type: z24.literal(ActionType.REJECT)
|
|
2810
|
+
type: z24.literal(ActionType.REJECT),
|
|
2811
|
+
form: actionConfirmationForm
|
|
2719
2812
|
}).shape
|
|
2720
2813
|
);
|
|
2721
2814
|
var RegisterConfig = DeclarationActionBase.extend(
|
|
2722
2815
|
z24.object({
|
|
2723
|
-
type: z24.literal(ActionType.REGISTER)
|
|
2816
|
+
type: z24.literal(ActionType.REGISTER),
|
|
2817
|
+
form: actionConfirmationForm
|
|
2724
2818
|
}).shape
|
|
2725
2819
|
);
|
|
2726
2820
|
var PrintCertificateActionConfig = ActionConfigBase.extend(
|
|
@@ -2735,7 +2829,17 @@ var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
|
2735
2829
|
correctionForm: ActionFormConfig
|
|
2736
2830
|
}).shape
|
|
2737
2831
|
);
|
|
2738
|
-
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(
|
|
2739
2843
|
z24.object({
|
|
2740
2844
|
type: z24.literal(ActionType.CUSTOM),
|
|
2741
2845
|
customActionType: z24.string().describe("Type identifier of the custom action."),
|
|
@@ -2746,7 +2850,7 @@ var CustomActionConfig = ActionConfigBase.merge(
|
|
|
2746
2850
|
auditHistoryLabel: TranslationConfig.describe(
|
|
2747
2851
|
'The label to show in audit history for this action. For example "Approved".'
|
|
2748
2852
|
)
|
|
2749
|
-
})
|
|
2853
|
+
}).shape
|
|
2750
2854
|
);
|
|
2751
2855
|
var ActionConfig = z24.discriminatedUnion("type", [
|
|
2752
2856
|
/*
|
|
@@ -2757,9 +2861,37 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2757
2861
|
id: "ReadActionConfig",
|
|
2758
2862
|
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2759
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
|
+
}),
|
|
2876
|
+
NotifyConfig.meta({
|
|
2877
|
+
id: "NotifyActionConfig",
|
|
2878
|
+
description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
|
|
2879
|
+
}),
|
|
2760
2880
|
DeclareConfig.meta({
|
|
2761
2881
|
id: "DeclareActionConfig",
|
|
2762
|
-
description: "Configuration for the declare action. Includes review-page fields.
|
|
2882
|
+
description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
|
|
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."
|
|
2763
2895
|
}),
|
|
2764
2896
|
RejectConfig.meta({
|
|
2765
2897
|
id: "RejectActionConfig",
|
|
@@ -2777,6 +2909,14 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2777
2909
|
id: "RequestCorrectionActionConfig",
|
|
2778
2910
|
description: "Configuration for requesting a correction on a registered record."
|
|
2779
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
|
+
}),
|
|
2780
2920
|
EditActionConfig.meta({
|
|
2781
2921
|
id: "EditActionConfig",
|
|
2782
2922
|
description: "Configuration for editing a record before registration."
|
|
@@ -2785,6 +2925,10 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2785
2925
|
id: "ArchiveActionConfig",
|
|
2786
2926
|
description: "Configuration for archiving a record."
|
|
2787
2927
|
}),
|
|
2928
|
+
UnarchiveConfig.meta({
|
|
2929
|
+
id: "UnarchiveActionConfig",
|
|
2930
|
+
description: "Configuration for unarchiving a record."
|
|
2931
|
+
}),
|
|
2788
2932
|
CustomActionConfig.meta({
|
|
2789
2933
|
id: "CustomActionConfig",
|
|
2790
2934
|
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
@@ -3190,13 +3334,9 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
3190
3334
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
|
3191
3335
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
|
3192
3336
|
}
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
if ("review" in actionConfig) {
|
|
3197
|
-
return actionConfig.review.fields;
|
|
3198
|
-
}
|
|
3199
|
-
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];
|
|
3200
3340
|
};
|
|
3201
3341
|
function getAllAnnotationFields(config) {
|
|
3202
3342
|
return (0, import_lodash.flattenDeep)(config.actions.map(getActionAnnotationFields));
|
|
@@ -3904,7 +4044,7 @@ function validateActionFlags(event2, ctx) {
|
|
|
3904
4044
|
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
3905
4045
|
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
3906
4046
|
const actionFlagIds = event2.actions.flatMap(
|
|
3907
|
-
(action) => action.flags.map((flag) => flag.id)
|
|
4047
|
+
(action) => (action.flags ?? []).map((flag) => flag.id)
|
|
3908
4048
|
);
|
|
3909
4049
|
for (const actionFlagId of actionFlagIds) {
|
|
3910
4050
|
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
@@ -4557,6 +4697,11 @@ var ArchiveActionInput = BaseActionInput.extend(
|
|
|
4557
4697
|
content: ReasonContent
|
|
4558
4698
|
}).shape
|
|
4559
4699
|
);
|
|
4700
|
+
var UnarchiveActionInput = BaseActionInput.extend(
|
|
4701
|
+
z38.object({
|
|
4702
|
+
type: z38.literal(ActionType.UNARCHIVE).default(ActionType.UNARCHIVE)
|
|
4703
|
+
}).shape
|
|
4704
|
+
);
|
|
4560
4705
|
var AssignActionInput = BaseActionInput.extend(
|
|
4561
4706
|
z38.object({
|
|
4562
4707
|
type: z38.literal(ActionType.ASSIGN),
|
|
@@ -4618,6 +4763,7 @@ var ActionInput = z38.discriminatedUnion("type", [
|
|
|
4618
4763
|
id: "MarkNotDuplicateActionInput"
|
|
4619
4764
|
}),
|
|
4620
4765
|
ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
|
|
4766
|
+
UnarchiveActionInput.meta({ id: "UnarchiveActionInput" }),
|
|
4621
4767
|
AssignActionInput.meta({ id: "AssignActionInput" }),
|
|
4622
4768
|
UnassignActionInput.meta({ id: "UnassignActionInput" }),
|
|
4623
4769
|
PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
|
|
@@ -4695,14 +4841,53 @@ var updateActions = ActionTypes.extract([
|
|
|
4695
4841
|
ActionType.REGISTER,
|
|
4696
4842
|
ActionType.REJECT,
|
|
4697
4843
|
ActionType.ARCHIVE,
|
|
4844
|
+
ActionType.UNARCHIVE,
|
|
4698
4845
|
ActionType.PRINT_CERTIFICATE,
|
|
4699
4846
|
ActionType.REQUEST_CORRECTION,
|
|
4847
|
+
ActionType.APPROVE_CORRECTION,
|
|
4848
|
+
ActionType.REJECT_CORRECTION,
|
|
4700
4849
|
ActionType.CUSTOM
|
|
4701
4850
|
]);
|
|
4702
4851
|
|
|
4703
4852
|
// ../commons/src/events/state/flags.ts
|
|
4704
4853
|
var import_lodash3 = require("lodash");
|
|
4705
4854
|
var import_date_fns3 = require("date-fns");
|
|
4855
|
+
var INHERENT_FLAG_RULES = [
|
|
4856
|
+
{
|
|
4857
|
+
flag: InherentFlags.CORRECTION_REQUESTED,
|
|
4858
|
+
setOn: [ActionType.REQUEST_CORRECTION],
|
|
4859
|
+
resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
|
|
4860
|
+
},
|
|
4861
|
+
{
|
|
4862
|
+
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
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.
|
|
4866
|
+
flag: InherentFlags.INCOMPLETE,
|
|
4867
|
+
setOn: [ActionType.NOTIFY],
|
|
4868
|
+
resetOn: [ActionType.CREATE, ActionType.DECLARE, ActionType.REGISTER]
|
|
4869
|
+
},
|
|
4870
|
+
{
|
|
4871
|
+
flag: InherentFlags.REJECTED,
|
|
4872
|
+
setOn: [ActionType.REJECT],
|
|
4873
|
+
resetOn: [
|
|
4874
|
+
ActionType.NOTIFY,
|
|
4875
|
+
ActionType.DECLARE,
|
|
4876
|
+
ActionType.EDIT,
|
|
4877
|
+
ActionType.REGISTER
|
|
4878
|
+
]
|
|
4879
|
+
},
|
|
4880
|
+
{
|
|
4881
|
+
flag: InherentFlags.POTENTIAL_DUPLICATE,
|
|
4882
|
+
setOn: [ActionType.DUPLICATE_DETECTED],
|
|
4883
|
+
resetOn: [ActionType.MARK_AS_DUPLICATE, ActionType.MARK_AS_NOT_DUPLICATE]
|
|
4884
|
+
},
|
|
4885
|
+
{
|
|
4886
|
+
flag: InherentFlags.EDIT_IN_PROGRESS,
|
|
4887
|
+
setOn: [ActionType.EDIT],
|
|
4888
|
+
resetOnAnyOtherAction: true
|
|
4889
|
+
}
|
|
4890
|
+
];
|
|
4706
4891
|
|
|
4707
4892
|
// ../commons/src/events/defineConfig.ts
|
|
4708
4893
|
var IGNORED_EVENT_TYPES = [
|
|
@@ -5448,6 +5633,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
|
5448
5633
|
id: "signature.upload.modal.title",
|
|
5449
5634
|
defaultMessage: "Draw signature",
|
|
5450
5635
|
description: "Title for the modal to draw signature"
|
|
5636
|
+
},
|
|
5637
|
+
// Zod applies the schema default at parse time, but this fixture bypasses
|
|
5638
|
+
// parsing — GeneratedInputField accesses configuration.maxFileSize directly.
|
|
5639
|
+
configuration: {
|
|
5640
|
+
maxFileSize: 5 * 1024 * 1024
|
|
5451
5641
|
}
|
|
5452
5642
|
}
|
|
5453
5643
|
]
|
|
@@ -6004,6 +6194,20 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
6004
6194
|
},
|
|
6005
6195
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
6006
6196
|
},
|
|
6197
|
+
{
|
|
6198
|
+
type: ActionType.NOTIFY,
|
|
6199
|
+
label: {
|
|
6200
|
+
defaultMessage: "Notify health worker",
|
|
6201
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
6202
|
+
id: "event.tennis-club-membership.action.notify.label"
|
|
6203
|
+
},
|
|
6204
|
+
flags: [
|
|
6205
|
+
{
|
|
6206
|
+
id: "health-worker-notified",
|
|
6207
|
+
operation: "add"
|
|
6208
|
+
}
|
|
6209
|
+
]
|
|
6210
|
+
},
|
|
6007
6211
|
{
|
|
6008
6212
|
type: ActionType.REJECT,
|
|
6009
6213
|
label: {
|
|
@@ -6246,6 +6450,17 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
6246
6450
|
}
|
|
6247
6451
|
}
|
|
6248
6452
|
],
|
|
6453
|
+
flags: [
|
|
6454
|
+
{
|
|
6455
|
+
id: "health-worker-notified",
|
|
6456
|
+
requiresAction: false,
|
|
6457
|
+
label: {
|
|
6458
|
+
id: "event.tennis-club-membership.flag.health-worker-notified.label",
|
|
6459
|
+
defaultMessage: "Health worker notified",
|
|
6460
|
+
description: "Label for the health-worker-notified flag"
|
|
6461
|
+
}
|
|
6462
|
+
}
|
|
6463
|
+
],
|
|
6249
6464
|
advancedSearch: [
|
|
6250
6465
|
{
|
|
6251
6466
|
title: {
|
|
@@ -7182,6 +7397,7 @@ var ACTION_SCOPE_MAP = {
|
|
|
7182
7397
|
[ActionType.MARK_AS_DUPLICATE]: ["record.review-duplicates"],
|
|
7183
7398
|
[ActionType.MARK_AS_NOT_DUPLICATE]: ["record.review-duplicates"],
|
|
7184
7399
|
[ActionType.ARCHIVE]: ["record.archive"],
|
|
7400
|
+
[ActionType.UNARCHIVE]: ["record.unarchive"],
|
|
7185
7401
|
[ActionType.REJECT]: ["record.reject"],
|
|
7186
7402
|
[ActionType.ASSIGN]: null,
|
|
7187
7403
|
[ActionType.UNASSIGN]: null,
|
|
@@ -7224,7 +7440,11 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
|
7224
7440
|
ActionType.CUSTOM,
|
|
7225
7441
|
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
7226
7442
|
],
|
|
7227
|
-
[EventStatus.enum.ARCHIVED]: [
|
|
7443
|
+
[EventStatus.enum.ARCHIVED]: [
|
|
7444
|
+
ActionType.READ,
|
|
7445
|
+
ActionType.CUSTOM,
|
|
7446
|
+
ActionType.UNARCHIVE
|
|
7447
|
+
]
|
|
7228
7448
|
};
|
|
7229
7449
|
var ACTION_FILTERS = {
|
|
7230
7450
|
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
@@ -7237,10 +7457,18 @@ var ACTION_FILTERS = {
|
|
|
7237
7457
|
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
7238
7458
|
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
|
|
7239
7459
|
[ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7460
|
+
[ActionType.UNARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7240
7461
|
[ActionType.ASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7241
7462
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7242
7463
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
7243
7464
|
};
|
|
7465
|
+
var REJECTED_ACTIONS = [
|
|
7466
|
+
ActionType.READ,
|
|
7467
|
+
ActionType.NOTIFY,
|
|
7468
|
+
ActionType.CUSTOM,
|
|
7469
|
+
ActionType.EDIT,
|
|
7470
|
+
ActionType.ARCHIVE
|
|
7471
|
+
];
|
|
7244
7472
|
|
|
7245
7473
|
// ../commons/src/events/FileUtils.ts
|
|
7246
7474
|
var import_lodash7 = require("lodash");
|