@opencrvs/toolkit 2.1.0-rc.982e0ae → 2.1.0-rc.9a83eed
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 +2 -12
- package/create-countryconfig/index.js +133 -2
- package/dist/application-config/index.js +17 -18
- package/dist/authentication/index.js +7 -6
- package/dist/cli.js +458 -204
- package/dist/commons/api/router.d.ts +6 -42
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +1 -1
- package/dist/commons/events/ActionConfig.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -12
- package/dist/commons/events/FieldConfig.d.ts +16 -15
- package/dist/commons/events/FormConfig.d.ts +6 -0
- package/dist/commons/events/PageConfig.d.ts +4 -0
- package/dist/commons/events/locations.d.ts +4 -0
- package/dist/commons/events/test.utils.d.ts +18 -1
- package/dist/commons/events/utils.d.ts +15 -0
- package/dist/conditionals/index.js +7 -6
- package/dist/environment/manage-users.js +1 -1
- package/dist/environment/setup-environment.js +44 -26
- package/dist/environment/templates.d.ts +0 -1
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +3 -8
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +4 -0
- package/dist/environment/utils.d.ts +0 -12
- package/dist/environment/utils.d.ts.map +1 -1
- package/dist/environment/utils.js +1 -28
- package/dist/events/index.js +1901 -1792
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +3 -3
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +1 -1
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -1
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +34 -6
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +1 -1
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -1
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +2 -7
- package/dist/migrations/v2.1/add-translations.d.ts +1 -1
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -1
- package/dist/migrations/v2.1/add-translations.js +1 -6
- package/dist/migrations/v2.1/enable-telemetry.d.ts +1 -1
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -1
- package/dist/migrations/v2.1/enable-telemetry.js +1 -6
- package/dist/migrations/v2.1/index.d.ts +14 -1
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +96 -84
- package/dist/notification/index.js +155 -152
- package/dist/scopes/index.d.ts +109 -5
- package/dist/scopes/index.js +7 -6
- package/dist/templates/charts-values/dependencies/values.yaml +2 -0
- package/dist/translations/check.d.ts +2 -0
- package/dist/translations/check.d.ts.map +1 -1
- package/dist/translations/check.js +9 -4
- package/dist/verify/endpoints.d.ts +18 -1
- package/dist/verify/endpoints.d.ts.map +1 -1
- package/dist/verify/endpoints.js +12 -4
- package/dist/verify/scopes.d.ts +13 -0
- package/dist/verify/scopes.d.ts.map +1 -0
- package/dist/verify/scopes.js +131 -0
- package/dist/verify/upgrade.d.ts +14 -0
- package/dist/verify/upgrade.d.ts.map +1 -0
- package/dist/verify/upgrade.js +111 -0
- package/opencrvs-toolkit-2.1.0-rc.9a83eed.tgz +0 -0
- package/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.982e0ae.tgz +0 -0
|
@@ -360,10 +360,7 @@ var PlainScopeType = z7.enum([
|
|
|
360
360
|
// Performance dashboard
|
|
361
361
|
"performance.read",
|
|
362
362
|
"performance.read-dashboards",
|
|
363
|
-
"performance.vital-statistics-export"
|
|
364
|
-
// Scopes used exclusively by countryconfig integration token
|
|
365
|
-
"record.confirm-registration",
|
|
366
|
-
"record.reject-registration"
|
|
363
|
+
"performance.vital-statistics-export"
|
|
367
364
|
]);
|
|
368
365
|
var scopeByEvent = z7.preprocess(
|
|
369
366
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -381,7 +378,9 @@ var userRole = z7.preprocess(
|
|
|
381
378
|
).describe("User role, e.g. admin, field agent");
|
|
382
379
|
var scopeOptionsPlaceEvent = z7.object({
|
|
383
380
|
event: scopeByEvent,
|
|
384
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
381
|
+
placeOfEvent: JurisdictionFilter.optional(),
|
|
382
|
+
createdBy: UserFilter.optional(),
|
|
383
|
+
createdIn: JurisdictionFilter.optional()
|
|
385
384
|
}).describe("Options applicable to all record scopes.");
|
|
386
385
|
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
387
386
|
notifiedIn: JurisdictionFilter.optional(),
|
|
@@ -424,7 +423,9 @@ var AllScopeOptions = z7.object({
|
|
|
424
423
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
425
424
|
var ResolvedScopeOptionsPlaceEvent = z7.object({
|
|
426
425
|
event: scopeByEvent,
|
|
427
|
-
placeOfEvent: UUID.nullish()
|
|
426
|
+
placeOfEvent: UUID.nullish(),
|
|
427
|
+
createdBy: z7.string().optional(),
|
|
428
|
+
createdIn: UUID.nullish()
|
|
428
429
|
}).describe(
|
|
429
430
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
430
431
|
);
|
|
@@ -2244,9 +2245,6 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
2244
2245
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
2245
2246
|
type: AdministrativeAreas,
|
|
2246
2247
|
allowedLocations: AllowedLocations,
|
|
2247
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2248
|
-
"List every historical name a location has had as a separate, selectable option."
|
|
2249
|
-
),
|
|
2250
2248
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2251
2249
|
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
2252
2250
|
),
|
|
@@ -2264,9 +2262,6 @@ var LocationInput = BaseField.extend({
|
|
|
2264
2262
|
configuration: import_v43.default.object({
|
|
2265
2263
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2266
2264
|
allowedLocations: AllowedLocations,
|
|
2267
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2268
|
-
"List every historical name a location has had as a separate, selectable option."
|
|
2269
|
-
),
|
|
2270
2265
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2271
2266
|
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
2272
2267
|
),
|
|
@@ -2300,7 +2295,6 @@ var Facility = BaseField.extend({
|
|
|
2300
2295
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2301
2296
|
configuration: import_v43.default.object({
|
|
2302
2297
|
allowedLocations: AllowedLocations,
|
|
2303
|
-
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
2304
2298
|
activeOnly: import_v43.default.boolean().optional(),
|
|
2305
2299
|
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2306
2300
|
}).optional()
|
|
@@ -2310,7 +2304,6 @@ var Office = BaseField.extend({
|
|
|
2310
2304
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2311
2305
|
configuration: import_v43.default.object({
|
|
2312
2306
|
allowedLocations: AllowedLocations,
|
|
2313
|
-
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
2314
2307
|
activeOnly: import_v43.default.boolean().optional(),
|
|
2315
2308
|
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
2316
2309
|
}).optional()
|
|
@@ -2347,9 +2340,6 @@ var Address = BaseField.extend({
|
|
|
2347
2340
|
})
|
|
2348
2341
|
).optional(),
|
|
2349
2342
|
allowedLocations: AllowedLocations,
|
|
2350
|
-
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2351
|
-
"List every historical name a location has had as a separate, selectable option. Propagated to the embedded admin-area selectors."
|
|
2352
|
-
),
|
|
2353
2343
|
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2354
2344
|
"Offer only admin areas that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded. Propagated to the embedded admin-area selectors."
|
|
2355
2345
|
),
|
|
@@ -2410,10 +2400,19 @@ var ButtonField = BaseField.extend({
|
|
|
2410
2400
|
description: "A generic button that can be used to trigger an action",
|
|
2411
2401
|
id: "ButtonField"
|
|
2412
2402
|
});
|
|
2403
|
+
var FieldGroupConfiguration = import_v43.default.object({
|
|
2404
|
+
separator: import_v43.default.string().optional().describe(
|
|
2405
|
+
'Joins the subfield values when the group is rendered as output, e.g. ", ". Defaults to one subfield per line.'
|
|
2406
|
+
),
|
|
2407
|
+
hideEmptyFields: import_v43.default.boolean().default(false).optional().describe(
|
|
2408
|
+
"Leaves subfields without a value out of the output. Pair it with a separator so the separator does not double up around the gaps."
|
|
2409
|
+
)
|
|
2410
|
+
});
|
|
2413
2411
|
var FieldGroup = BaseField.extend({
|
|
2414
2412
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2415
2413
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2416
|
-
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2414
|
+
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig)),
|
|
2415
|
+
configuration: FieldGroupConfiguration.optional()
|
|
2417
2416
|
}).meta({
|
|
2418
2417
|
description: "A group of fields that are displayed together",
|
|
2419
2418
|
id: "FieldGroup"
|
|
@@ -2667,6 +2666,9 @@ var PageConfigBase = z22.object({
|
|
|
2667
2666
|
requireCompletionToContinue: z22.boolean().default(false).describe(
|
|
2668
2667
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2669
2668
|
),
|
|
2669
|
+
showClearButton: z22.boolean().optional().describe(
|
|
2670
|
+
'If true, a "Clear" button is shown at the top of the page allowing the user to reset all fields on the page to their default state'
|
|
2671
|
+
),
|
|
2670
2672
|
fields: z22.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2671
2673
|
conditional: Conditional.optional().describe(
|
|
2672
2674
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
@@ -5885,6 +5887,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5885
5887
|
defaultMessage: "Who is applying for the membership?",
|
|
5886
5888
|
description: "This is the title of the section"
|
|
5887
5889
|
},
|
|
5890
|
+
showClearButton: true,
|
|
5888
5891
|
fields: [
|
|
5889
5892
|
{
|
|
5890
5893
|
id: "applicant.name",
|
|
@@ -7555,53 +7558,39 @@ var digitalIdentityEvent = defineConfig({
|
|
|
7555
7558
|
});
|
|
7556
7559
|
|
|
7557
7560
|
// ../commons/src/events/test.utils.ts
|
|
7558
|
-
var
|
|
7559
|
-
var TestUserRole = z43.enum([
|
|
7560
|
-
"FIELD_AGENT",
|
|
7561
|
-
"LOCAL_REGISTRAR",
|
|
7562
|
-
"LOCAL_SYSTEM_ADMIN",
|
|
7563
|
-
"NATIONAL_REGISTRAR",
|
|
7564
|
-
"REGISTRATION_AGENT",
|
|
7565
|
-
"NATIONAL_SYSTEM_ADMIN",
|
|
7566
|
-
"SOCIAL_WORKER",
|
|
7567
|
-
"COMMUNITY_LEADER",
|
|
7568
|
-
"PROVINCIAL_REGISTRAR"
|
|
7569
|
-
]);
|
|
7570
|
-
|
|
7571
|
-
// ../commons/src/events/scopes.ts
|
|
7572
|
-
var import_lodash6 = require("lodash");
|
|
7561
|
+
var z44 = __toESM(require("zod/v4"));
|
|
7573
7562
|
|
|
7574
7563
|
// ../commons/src/events/locations.ts
|
|
7575
|
-
var
|
|
7576
|
-
var LocationTypeV1 =
|
|
7564
|
+
var z43 = __toESM(require("zod/v4"));
|
|
7565
|
+
var LocationTypeV1 = z43.enum([
|
|
7577
7566
|
"ADMIN_STRUCTURE",
|
|
7578
7567
|
"CRVS_OFFICE",
|
|
7579
7568
|
"HEALTH_FACILITY"
|
|
7580
7569
|
]);
|
|
7581
|
-
var LocationStatus =
|
|
7582
|
-
var LocationVersion =
|
|
7570
|
+
var LocationStatus = z43.enum(["active", "inactive"]);
|
|
7571
|
+
var LocationVersion = z43.object({
|
|
7583
7572
|
versionId: UUID,
|
|
7584
|
-
effectiveFrom:
|
|
7585
|
-
name:
|
|
7586
|
-
externalId:
|
|
7573
|
+
effectiveFrom: z43.iso.date(),
|
|
7574
|
+
name: z43.string(),
|
|
7575
|
+
externalId: z43.string().nullish(),
|
|
7587
7576
|
status: LocationStatus
|
|
7588
7577
|
});
|
|
7589
|
-
var AdministrativeArea =
|
|
7578
|
+
var AdministrativeArea = z43.object({
|
|
7590
7579
|
id: UUID,
|
|
7591
|
-
name:
|
|
7592
|
-
externalId:
|
|
7580
|
+
name: z43.string(),
|
|
7581
|
+
externalId: z43.string().nullish(),
|
|
7593
7582
|
parentId: UUID.nullable(),
|
|
7594
7583
|
status: LocationStatus,
|
|
7595
|
-
versions:
|
|
7584
|
+
versions: z43.array(LocationVersion)
|
|
7596
7585
|
});
|
|
7597
|
-
var Location =
|
|
7586
|
+
var Location = z43.object({
|
|
7598
7587
|
id: UUID,
|
|
7599
|
-
name:
|
|
7600
|
-
externalId:
|
|
7588
|
+
name: z43.string(),
|
|
7589
|
+
externalId: z43.string().nullish(),
|
|
7601
7590
|
administrativeAreaId: UUID.nullable(),
|
|
7602
|
-
locationType:
|
|
7591
|
+
locationType: z43.string().nullable(),
|
|
7603
7592
|
status: LocationStatus,
|
|
7604
|
-
versions:
|
|
7593
|
+
versions: z43.array(LocationVersion)
|
|
7605
7594
|
});
|
|
7606
7595
|
var ClientAdministrativeArea = AdministrativeArea.omit({
|
|
7607
7596
|
name: true,
|
|
@@ -7642,121 +7631,26 @@ function validateUniqueIds(versions, ctx) {
|
|
|
7642
7631
|
ctx.addIssue("versions must not repeat a versionId");
|
|
7643
7632
|
}
|
|
7644
7633
|
}
|
|
7645
|
-
var SeededLocationVersions =
|
|
7634
|
+
var SeededLocationVersions = z43.array(LocationVersion).min(1).superRefine((versions, ctx) => {
|
|
7646
7635
|
validateAscendingDates(versions, ctx);
|
|
7647
7636
|
validateUniqueIds(versions, ctx);
|
|
7648
7637
|
});
|
|
7649
|
-
var SetLocationPayload =
|
|
7638
|
+
var SetLocationPayload = z43.object({
|
|
7650
7639
|
id: UUID,
|
|
7651
|
-
name:
|
|
7652
|
-
externalId:
|
|
7640
|
+
name: z43.string(),
|
|
7641
|
+
externalId: z43.string().nullish(),
|
|
7653
7642
|
administrativeAreaId: UUID.nullable(),
|
|
7654
|
-
locationType:
|
|
7643
|
+
locationType: z43.string().nullable(),
|
|
7655
7644
|
versions: SeededLocationVersions.optional()
|
|
7656
7645
|
});
|
|
7657
|
-
var SetAdministrativeAreaPayload =
|
|
7646
|
+
var SetAdministrativeAreaPayload = z43.object({
|
|
7658
7647
|
id: UUID,
|
|
7659
|
-
name:
|
|
7660
|
-
externalId:
|
|
7648
|
+
name: z43.string(),
|
|
7649
|
+
externalId: z43.string().nullish(),
|
|
7661
7650
|
parentId: UUID.nullable(),
|
|
7662
7651
|
versions: SeededLocationVersions.optional()
|
|
7663
7652
|
});
|
|
7664
7653
|
|
|
7665
|
-
// ../commons/src/events/scopes.ts
|
|
7666
|
-
var ACTION_SCOPE_MAP = {
|
|
7667
|
-
[ActionType.READ]: ["record.read"],
|
|
7668
|
-
[ActionType.CREATE]: ["record.create"],
|
|
7669
|
-
[ActionType.NOTIFY]: ["record.notify"],
|
|
7670
|
-
[ActionType.DECLARE]: ["record.declare", "record.register"],
|
|
7671
|
-
[ActionType.EDIT]: ["record.edit"],
|
|
7672
|
-
[ActionType.DELETE]: ["record.declare", "record.notify"],
|
|
7673
|
-
[ActionType.REGISTER]: ["record.register"],
|
|
7674
|
-
[ActionType.PRINT_CERTIFICATE]: ["record.print-certified-copies"],
|
|
7675
|
-
[ActionType.REQUEST_CORRECTION]: [
|
|
7676
|
-
"record.request-correction",
|
|
7677
|
-
"record.correct"
|
|
7678
|
-
],
|
|
7679
|
-
[ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: ["record.correct"],
|
|
7680
|
-
[ActionType.REJECT_CORRECTION]: ["record.correct"],
|
|
7681
|
-
[ActionType.APPROVE_CORRECTION]: ["record.correct"],
|
|
7682
|
-
[ActionType.MARK_AS_DUPLICATE]: ["record.review-duplicates"],
|
|
7683
|
-
[ActionType.MARK_AS_NOT_DUPLICATE]: ["record.review-duplicates"],
|
|
7684
|
-
[ActionType.ARCHIVE]: ["record.archive"],
|
|
7685
|
-
[ActionType.UNARCHIVE]: ["record.unarchive"],
|
|
7686
|
-
[ActionType.REJECT]: ["record.reject"],
|
|
7687
|
-
[ActionType.ASSIGN]: null,
|
|
7688
|
-
[ActionType.UNASSIGN]: null,
|
|
7689
|
-
[ActionType.DUPLICATE_DETECTED]: [],
|
|
7690
|
-
[ActionType.CUSTOM]: []
|
|
7691
|
-
};
|
|
7692
|
-
|
|
7693
|
-
// ../commons/src/events/state/availableActions.ts
|
|
7694
|
-
var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
7695
|
-
[EventStatus.enum.CREATED]: [
|
|
7696
|
-
ActionType.READ,
|
|
7697
|
-
ActionType.DECLARE,
|
|
7698
|
-
ActionType.NOTIFY,
|
|
7699
|
-
ActionType.DELETE
|
|
7700
|
-
],
|
|
7701
|
-
[EventStatus.enum.NOTIFIED]: [
|
|
7702
|
-
ActionType.READ,
|
|
7703
|
-
ActionType.EDIT,
|
|
7704
|
-
ActionType.MARK_AS_DUPLICATE,
|
|
7705
|
-
ActionType.ARCHIVE,
|
|
7706
|
-
ActionType.REJECT,
|
|
7707
|
-
ActionType.CUSTOM
|
|
7708
|
-
],
|
|
7709
|
-
[EventStatus.enum.DECLARED]: [
|
|
7710
|
-
ActionType.READ,
|
|
7711
|
-
ActionType.REGISTER,
|
|
7712
|
-
ActionType.MARK_AS_DUPLICATE,
|
|
7713
|
-
ActionType.ARCHIVE,
|
|
7714
|
-
ActionType.REJECT,
|
|
7715
|
-
ActionType.CUSTOM,
|
|
7716
|
-
ActionType.EDIT
|
|
7717
|
-
],
|
|
7718
|
-
[EventStatus.enum.REGISTERED]: [
|
|
7719
|
-
ActionType.READ,
|
|
7720
|
-
ActionType.PRINT_CERTIFICATE,
|
|
7721
|
-
ActionType.REQUEST_CORRECTION,
|
|
7722
|
-
ActionType.APPROVE_CORRECTION,
|
|
7723
|
-
ActionType.REJECT_CORRECTION,
|
|
7724
|
-
ActionType.CUSTOM,
|
|
7725
|
-
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
7726
|
-
],
|
|
7727
|
-
[EventStatus.enum.ARCHIVED]: [
|
|
7728
|
-
ActionType.READ,
|
|
7729
|
-
ActionType.CUSTOM,
|
|
7730
|
-
ActionType.UNARCHIVE
|
|
7731
|
-
]
|
|
7732
|
-
};
|
|
7733
|
-
var ACTION_FILTERS = {
|
|
7734
|
-
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7735
|
-
[ActionType.REQUEST_CORRECTION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7736
|
-
[ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7737
|
-
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7738
|
-
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7739
|
-
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7740
|
-
[ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7741
|
-
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7742
|
-
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7743
|
-
[ActionType.ARCHIVE]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7744
|
-
[ActionType.UNARCHIVE]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7745
|
-
[ActionType.ASSIGN]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7746
|
-
[ActionType.UNASSIGN]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
7747
|
-
[ActionType.CUSTOM]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested"))
|
|
7748
|
-
};
|
|
7749
|
-
var REJECTED_ACTIONS = [
|
|
7750
|
-
ActionType.READ,
|
|
7751
|
-
ActionType.NOTIFY,
|
|
7752
|
-
ActionType.CUSTOM,
|
|
7753
|
-
ActionType.EDIT,
|
|
7754
|
-
ActionType.ARCHIVE
|
|
7755
|
-
];
|
|
7756
|
-
|
|
7757
|
-
// ../commons/src/events/FileUtils.ts
|
|
7758
|
-
var import_lodash7 = require("lodash");
|
|
7759
|
-
|
|
7760
7654
|
// ../commons/src/events/mocks.test.utils.ts
|
|
7761
7655
|
function withVersionFields(entity) {
|
|
7762
7656
|
return {
|
|
@@ -8099,6 +7993,115 @@ var V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
|
8099
7993
|
])
|
|
8100
7994
|
);
|
|
8101
7995
|
|
|
7996
|
+
// ../commons/src/events/test.utils.ts
|
|
7997
|
+
var TestUserRole = z44.enum([
|
|
7998
|
+
"FIELD_AGENT",
|
|
7999
|
+
"LOCAL_REGISTRAR",
|
|
8000
|
+
"LOCAL_SYSTEM_ADMIN",
|
|
8001
|
+
"NATIONAL_REGISTRAR",
|
|
8002
|
+
"REGISTRATION_AGENT",
|
|
8003
|
+
"NATIONAL_SYSTEM_ADMIN",
|
|
8004
|
+
"SOCIAL_WORKER",
|
|
8005
|
+
"COMMUNITY_LEADER",
|
|
8006
|
+
"PROVINCIAL_REGISTRAR"
|
|
8007
|
+
]);
|
|
8008
|
+
|
|
8009
|
+
// ../commons/src/events/scopes.ts
|
|
8010
|
+
var import_lodash6 = require("lodash");
|
|
8011
|
+
var ACTION_SCOPE_MAP = {
|
|
8012
|
+
[ActionType.READ]: ["record.read"],
|
|
8013
|
+
[ActionType.CREATE]: ["record.create"],
|
|
8014
|
+
[ActionType.NOTIFY]: ["record.notify"],
|
|
8015
|
+
[ActionType.DECLARE]: ["record.declare", "record.register"],
|
|
8016
|
+
[ActionType.EDIT]: ["record.edit"],
|
|
8017
|
+
[ActionType.DELETE]: ["record.declare", "record.notify"],
|
|
8018
|
+
[ActionType.REGISTER]: ["record.register"],
|
|
8019
|
+
[ActionType.PRINT_CERTIFICATE]: ["record.print-certified-copies"],
|
|
8020
|
+
[ActionType.REQUEST_CORRECTION]: [
|
|
8021
|
+
"record.request-correction",
|
|
8022
|
+
"record.correct"
|
|
8023
|
+
],
|
|
8024
|
+
[ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: ["record.correct"],
|
|
8025
|
+
[ActionType.REJECT_CORRECTION]: ["record.correct"],
|
|
8026
|
+
[ActionType.APPROVE_CORRECTION]: ["record.correct"],
|
|
8027
|
+
[ActionType.MARK_AS_DUPLICATE]: ["record.review-duplicates"],
|
|
8028
|
+
[ActionType.MARK_AS_NOT_DUPLICATE]: ["record.review-duplicates"],
|
|
8029
|
+
[ActionType.ARCHIVE]: ["record.archive"],
|
|
8030
|
+
[ActionType.UNARCHIVE]: ["record.unarchive"],
|
|
8031
|
+
[ActionType.REJECT]: ["record.reject"],
|
|
8032
|
+
[ActionType.ASSIGN]: null,
|
|
8033
|
+
[ActionType.UNASSIGN]: null,
|
|
8034
|
+
[ActionType.DUPLICATE_DETECTED]: [],
|
|
8035
|
+
[ActionType.CUSTOM]: []
|
|
8036
|
+
};
|
|
8037
|
+
|
|
8038
|
+
// ../commons/src/events/state/availableActions.ts
|
|
8039
|
+
var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
8040
|
+
[EventStatus.enum.CREATED]: [
|
|
8041
|
+
ActionType.READ,
|
|
8042
|
+
ActionType.DECLARE,
|
|
8043
|
+
ActionType.NOTIFY,
|
|
8044
|
+
ActionType.DELETE
|
|
8045
|
+
],
|
|
8046
|
+
[EventStatus.enum.NOTIFIED]: [
|
|
8047
|
+
ActionType.READ,
|
|
8048
|
+
ActionType.EDIT,
|
|
8049
|
+
ActionType.MARK_AS_DUPLICATE,
|
|
8050
|
+
ActionType.ARCHIVE,
|
|
8051
|
+
ActionType.REJECT,
|
|
8052
|
+
ActionType.CUSTOM
|
|
8053
|
+
],
|
|
8054
|
+
[EventStatus.enum.DECLARED]: [
|
|
8055
|
+
ActionType.READ,
|
|
8056
|
+
ActionType.REGISTER,
|
|
8057
|
+
ActionType.MARK_AS_DUPLICATE,
|
|
8058
|
+
ActionType.ARCHIVE,
|
|
8059
|
+
ActionType.REJECT,
|
|
8060
|
+
ActionType.CUSTOM,
|
|
8061
|
+
ActionType.EDIT
|
|
8062
|
+
],
|
|
8063
|
+
[EventStatus.enum.REGISTERED]: [
|
|
8064
|
+
ActionType.READ,
|
|
8065
|
+
ActionType.PRINT_CERTIFICATE,
|
|
8066
|
+
ActionType.REQUEST_CORRECTION,
|
|
8067
|
+
ActionType.APPROVE_CORRECTION,
|
|
8068
|
+
ActionType.REJECT_CORRECTION,
|
|
8069
|
+
ActionType.CUSTOM,
|
|
8070
|
+
ClientSpecificAction.REVIEW_CORRECTION_REQUEST
|
|
8071
|
+
],
|
|
8072
|
+
[EventStatus.enum.ARCHIVED]: [
|
|
8073
|
+
ActionType.READ,
|
|
8074
|
+
ActionType.CUSTOM,
|
|
8075
|
+
ActionType.UNARCHIVE
|
|
8076
|
+
]
|
|
8077
|
+
};
|
|
8078
|
+
var ACTION_FILTERS = {
|
|
8079
|
+
[ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8080
|
+
[ActionType.REQUEST_CORRECTION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8081
|
+
[ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8082
|
+
[ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8083
|
+
[ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8084
|
+
[ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8085
|
+
[ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8086
|
+
[ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8087
|
+
[ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8088
|
+
[ActionType.ARCHIVE]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8089
|
+
[ActionType.UNARCHIVE]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8090
|
+
[ActionType.ASSIGN]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8091
|
+
[ActionType.UNASSIGN]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
|
|
8092
|
+
[ActionType.CUSTOM]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested"))
|
|
8093
|
+
};
|
|
8094
|
+
var REJECTED_ACTIONS = [
|
|
8095
|
+
ActionType.READ,
|
|
8096
|
+
ActionType.NOTIFY,
|
|
8097
|
+
ActionType.CUSTOM,
|
|
8098
|
+
ActionType.EDIT,
|
|
8099
|
+
ActionType.ARCHIVE
|
|
8100
|
+
];
|
|
8101
|
+
|
|
8102
|
+
// ../commons/src/events/FileUtils.ts
|
|
8103
|
+
var import_lodash7 = require("lodash");
|
|
8104
|
+
|
|
8102
8105
|
// ../commons/src/events/locationPayloads.ts
|
|
8103
8106
|
var z45 = __toESM(require("zod/v4"));
|
|
8104
8107
|
var CreateLocationPayload = z45.object({
|