@opencrvs/toolkit 2.1.0-rc.573b41e → 2.1.0-rc.57bc3ac
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application-config/index.js +3 -1
- package/dist/commons/api/router.d.ts +3414 -3360
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +32 -323
- package/dist/commons/events/ActionConfig.d.ts +105 -105
- package/dist/commons/events/ActionDocument.d.ts +119 -119
- package/dist/commons/events/ActionInput.d.ts +0 -6
- package/dist/commons/events/ActionType.d.ts +62 -62
- package/dist/commons/events/AdvancedSearchConfig.d.ts +513 -507
- package/dist/commons/events/AuditLog.d.ts +65 -42
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/Conditional.d.ts +3 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
- package/dist/commons/events/Draft.d.ts +37 -37
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +5 -5
- package/dist/commons/events/EventDocument.d.ts +48 -48
- package/dist/commons/events/EventIndex.d.ts +62 -62
- package/dist/commons/events/EventMetadata.d.ts +40 -40
- package/dist/commons/events/FieldConfig.d.ts +341 -336
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/Flag.d.ts +15 -15
- package/dist/commons/events/TemplateConfig.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
- package/dist/commons/events/WorkqueueConfig.d.ts +826 -826
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +2 -2
- package/dist/commons/events/field.d.ts +69 -198
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +103 -6
- package/dist/commons/events/mocks.test.utils.d.ts +18 -4
- package/dist/commons/events/scopes.d.ts +4 -4
- package/dist/commons/events/state/index.d.ts +17 -17
- package/dist/commons/events/state/utils.d.ts +7 -7
- package/dist/commons/events/test.utils.d.ts +40 -43
- package/dist/commons/events/utils.d.ts +114 -114
- package/dist/commons/notification/UserNotifications.d.ts +10 -10
- package/dist/conditionals/index.js +1 -0
- package/dist/environment/derived-variables.d.ts +119 -119
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/logger.d.ts +3 -12
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/manage-users.js +17 -7
- package/dist/environment/questions.d.ts +75 -74
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +8 -14
- package/dist/environment/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.d.ts +1 -1
- package/dist/environment/utils.js +17 -7
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +143 -58
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
- package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
- package/dist/notification/index.js +140 -82
- package/dist/scopes/index.d.ts +148 -146
- package/dist/scopes/index.js +1 -0
- package/opencrvs-toolkit-2.1.0-rc.57bc3ac.tgz +0 -0
- package/package.json +3 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.573b41e.tgz +0 -0
|
@@ -25,13 +25,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
25
25
|
}) : function(o, v) {
|
|
26
26
|
o["default"] = v;
|
|
27
27
|
});
|
|
28
|
-
var __importStar = (this && this.__importStar) || function (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
28
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
+
var ownKeys = function(o) {
|
|
30
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
+
var ar = [];
|
|
32
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
+
return ar;
|
|
34
|
+
};
|
|
35
|
+
return ownKeys(o);
|
|
36
|
+
};
|
|
37
|
+
return function (mod) {
|
|
38
|
+
if (mod && mod.__esModule) return mod;
|
|
39
|
+
var result = {};
|
|
40
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
+
__setModuleDefault(result, mod);
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
})();
|
|
35
45
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
46
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
47
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -38,7 +38,7 @@ __export(notification_exports, {
|
|
|
38
38
|
triggerUserEventNotification: () => triggerUserEventNotification
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(notification_exports);
|
|
41
|
-
var
|
|
41
|
+
var z46 = __toESM(require("zod/v4"));
|
|
42
42
|
|
|
43
43
|
// ../commons/src/url.ts
|
|
44
44
|
function joinUrl(base, path) {
|
|
@@ -96,6 +96,7 @@ var PlainScopeType = z2.enum([
|
|
|
96
96
|
"integration.create",
|
|
97
97
|
"record.import",
|
|
98
98
|
"config.update-all",
|
|
99
|
+
"location.edit",
|
|
99
100
|
"attachment.upload",
|
|
100
101
|
"profile.electronic-signature",
|
|
101
102
|
"user.read-only-my-audit",
|
|
@@ -530,6 +531,23 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
|
530
531
|
requestData: z5.object({ id: z5.string() }),
|
|
531
532
|
responseSummary: z5.object({ clientId: z5.string() })
|
|
532
533
|
});
|
|
534
|
+
var LocationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
535
|
+
operation: z5.enum(["locations.create", "administrativeAreas.create"]),
|
|
536
|
+
requestData: z5.object({
|
|
537
|
+
id: z5.string(),
|
|
538
|
+
versionId: z5.string(),
|
|
539
|
+
name: z5.string(),
|
|
540
|
+
externalId: z5.string().nullish(),
|
|
541
|
+
administrativeAreaId: z5.string().nullish(),
|
|
542
|
+
// locations only
|
|
543
|
+
parentId: z5.string().nullish(),
|
|
544
|
+
// administrative areas only
|
|
545
|
+
locationType: z5.string().nullish(),
|
|
546
|
+
// locations only
|
|
547
|
+
effectiveFrom: z5.string(),
|
|
548
|
+
status: z5.string()
|
|
549
|
+
})
|
|
550
|
+
});
|
|
533
551
|
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
534
552
|
operation: z5.literal("attachments.upload"),
|
|
535
553
|
requestData: z5.object({
|
|
@@ -605,6 +623,7 @@ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
|
|
|
605
623
|
IntegrationActivateEntrySchema,
|
|
606
624
|
IntegrationDeleteEntrySchema,
|
|
607
625
|
IntegrationRefreshSecretEntrySchema,
|
|
626
|
+
LocationCreateEntrySchema,
|
|
608
627
|
AttachmentUploadEntrySchema,
|
|
609
628
|
UserCreateEntrySchema,
|
|
610
629
|
UserReasonEntrySchema,
|
|
@@ -1216,9 +1235,10 @@ var NotifiedAction = ActionBase.extend(
|
|
|
1216
1235
|
var EditAction = ActionBase.extend(
|
|
1217
1236
|
z14.object({
|
|
1218
1237
|
type: z14.literal(ActionType.EDIT),
|
|
1238
|
+
/** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
|
|
1219
1239
|
content: z14.object({
|
|
1220
1240
|
comment: z14.string().describe("Comment for the edit action.").optional()
|
|
1221
|
-
})
|
|
1241
|
+
}).optional()
|
|
1222
1242
|
}).shape
|
|
1223
1243
|
);
|
|
1224
1244
|
var PrintContent = z14.object({
|
|
@@ -4652,10 +4672,7 @@ var DeclareActionInput = BaseActionInput.extend(
|
|
|
4652
4672
|
);
|
|
4653
4673
|
var EditActionInput = BaseActionInput.extend(
|
|
4654
4674
|
z38.object({
|
|
4655
|
-
type: z38.literal(ActionType.EDIT).default(ActionType.EDIT)
|
|
4656
|
-
content: z38.object({
|
|
4657
|
-
comment: z38.string().describe("Comment for the edit action.").optional()
|
|
4658
|
-
})
|
|
4675
|
+
type: z38.literal(ActionType.EDIT).default(ActionType.EDIT)
|
|
4659
4676
|
}).shape
|
|
4660
4677
|
);
|
|
4661
4678
|
var PrintCertificateActionInput = BaseActionInput.extend(
|
|
@@ -7361,21 +7378,44 @@ var LocationTypeV1 = z43.enum([
|
|
|
7361
7378
|
"CRVS_OFFICE",
|
|
7362
7379
|
"HEALTH_FACILITY"
|
|
7363
7380
|
]);
|
|
7381
|
+
var LocationStatus = z43.enum(["active", "inactive"]);
|
|
7382
|
+
var LocationVersion = z43.object({
|
|
7383
|
+
versionId: UUID,
|
|
7384
|
+
effectiveFrom: z43.iso.date(),
|
|
7385
|
+
name: z43.string(),
|
|
7386
|
+
externalId: z43.string().nullish(),
|
|
7387
|
+
status: LocationStatus
|
|
7388
|
+
});
|
|
7364
7389
|
var AdministrativeArea = z43.object({
|
|
7365
7390
|
id: UUID,
|
|
7366
7391
|
name: z43.string(),
|
|
7367
7392
|
externalId: z43.string().nullish(),
|
|
7368
7393
|
parentId: UUID.nullable(),
|
|
7369
|
-
|
|
7394
|
+
status: LocationStatus,
|
|
7395
|
+
versions: z43.array(LocationVersion)
|
|
7370
7396
|
});
|
|
7371
7397
|
var Location = z43.object({
|
|
7372
7398
|
id: UUID,
|
|
7373
7399
|
name: z43.string(),
|
|
7374
7400
|
externalId: z43.string().nullish(),
|
|
7375
7401
|
administrativeAreaId: UUID.nullable(),
|
|
7376
|
-
|
|
7402
|
+
locationType: z43.string().nullable(),
|
|
7403
|
+
status: LocationStatus,
|
|
7404
|
+
versions: z43.array(LocationVersion)
|
|
7405
|
+
});
|
|
7406
|
+
var SetLocationPayload = z43.object({
|
|
7407
|
+
id: UUID,
|
|
7408
|
+
name: z43.string(),
|
|
7409
|
+
externalId: z43.string().nullish(),
|
|
7410
|
+
administrativeAreaId: UUID.nullable(),
|
|
7377
7411
|
locationType: z43.string().nullable()
|
|
7378
7412
|
});
|
|
7413
|
+
var SetAdministrativeAreaPayload = z43.object({
|
|
7414
|
+
id: UUID,
|
|
7415
|
+
name: z43.string(),
|
|
7416
|
+
externalId: z43.string().nullish(),
|
|
7417
|
+
parentId: UUID.nullable()
|
|
7418
|
+
});
|
|
7379
7419
|
|
|
7380
7420
|
// ../commons/src/events/scopes.ts
|
|
7381
7421
|
var ACTION_SCOPE_MAP = {
|
|
@@ -7474,75 +7514,80 @@ var REJECTED_ACTIONS = [
|
|
|
7474
7514
|
var import_lodash7 = require("lodash");
|
|
7475
7515
|
|
|
7476
7516
|
// ../commons/src/events/mocks.test.utils.ts
|
|
7477
|
-
|
|
7517
|
+
function withVersionFields(entity) {
|
|
7518
|
+
return {
|
|
7519
|
+
...entity,
|
|
7520
|
+
status: "active",
|
|
7521
|
+
versions: [
|
|
7522
|
+
{
|
|
7523
|
+
versionId: entity.id,
|
|
7524
|
+
effectiveFrom: "0001-01-01",
|
|
7525
|
+
name: entity.name,
|
|
7526
|
+
externalId: entity.externalId ?? null,
|
|
7527
|
+
status: "active"
|
|
7528
|
+
}
|
|
7529
|
+
]
|
|
7530
|
+
};
|
|
7531
|
+
}
|
|
7532
|
+
var MOCK_ADMINISTRATIVE_AREAS_BASE = [
|
|
7478
7533
|
{
|
|
7479
7534
|
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7480
7535
|
name: "Central",
|
|
7481
7536
|
parentId: null,
|
|
7482
|
-
validUntil: null,
|
|
7483
7537
|
externalId: "ydyJb1RAy4U1"
|
|
7484
7538
|
},
|
|
7485
7539
|
{
|
|
7486
7540
|
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7487
7541
|
name: "Sulaka",
|
|
7488
7542
|
parentId: null,
|
|
7489
|
-
validUntil: null,
|
|
7490
7543
|
externalId: "pQ8nGxWmZ2Q3"
|
|
7491
7544
|
},
|
|
7492
7545
|
{
|
|
7493
7546
|
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
7494
7547
|
name: "Pualula",
|
|
7495
7548
|
parentId: null,
|
|
7496
|
-
validUntil: null,
|
|
7497
7549
|
externalId: "Aq91DweLmT8k"
|
|
7498
7550
|
},
|
|
7499
7551
|
{
|
|
7500
7552
|
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
7501
7553
|
name: "Chuminga",
|
|
7502
7554
|
parentId: null,
|
|
7503
|
-
validUntil: null,
|
|
7504
7555
|
externalId: "Rw0fYNh2Xk9a"
|
|
7505
7556
|
},
|
|
7506
7557
|
{
|
|
7507
7558
|
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7508
7559
|
name: "Ibombo",
|
|
7509
7560
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7510
|
-
validUntil: null,
|
|
7511
7561
|
externalId: "k7DsP4vbN1Qe"
|
|
7512
7562
|
},
|
|
7513
7563
|
{
|
|
7514
7564
|
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7515
7565
|
name: "Isango",
|
|
7516
7566
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7517
|
-
validUntil: null,
|
|
7518
7567
|
externalId: "Gm3Z9eQpHw4L"
|
|
7519
7568
|
},
|
|
7520
7569
|
{
|
|
7521
7570
|
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7522
7571
|
name: "Isamba",
|
|
7523
7572
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7524
|
-
validUntil: null,
|
|
7525
7573
|
externalId: "sT0xVu1KqJ7r"
|
|
7526
7574
|
},
|
|
7527
7575
|
{
|
|
7528
7576
|
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7529
7577
|
name: "Itambo",
|
|
7530
7578
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7531
|
-
validUntil: null,
|
|
7532
7579
|
externalId: "Nq6Bv2HpL9Te"
|
|
7533
7580
|
},
|
|
7534
7581
|
{
|
|
7535
7582
|
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
7536
7583
|
name: "Ezhi",
|
|
7537
7584
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7538
|
-
validUntil: null,
|
|
7539
7585
|
externalId: "xK8cQ0ZRy5Wd"
|
|
7540
7586
|
},
|
|
7541
7587
|
{
|
|
7542
7588
|
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7543
7589
|
name: "Ilanga",
|
|
7544
7590
|
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7545
|
-
validUntil: null,
|
|
7546
7591
|
externalId: "Cq4Jm1XvN8Ls"
|
|
7547
7592
|
},
|
|
7548
7593
|
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
@@ -7550,49 +7595,42 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
|
7550
7595
|
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7551
7596
|
name: "Klow",
|
|
7552
7597
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7553
|
-
validUntil: null,
|
|
7554
7598
|
externalId: "IkYcYBUcyY2"
|
|
7555
7599
|
},
|
|
7556
7600
|
{
|
|
7557
7601
|
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
7558
7602
|
name: "Mbondo",
|
|
7559
7603
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7560
|
-
validUntil: null,
|
|
7561
7604
|
externalId: "Qhvv5hvo3mY"
|
|
7562
7605
|
},
|
|
7563
7606
|
{
|
|
7564
7607
|
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
7565
7608
|
name: "Ndara",
|
|
7566
7609
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7567
|
-
validUntil: null,
|
|
7568
7610
|
externalId: "crXh068O9TR"
|
|
7569
7611
|
},
|
|
7570
7612
|
{
|
|
7571
7613
|
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
7572
7614
|
name: "Olani",
|
|
7573
7615
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7574
|
-
validUntil: null,
|
|
7575
7616
|
externalId: "r00It8Tvvp7"
|
|
7576
7617
|
},
|
|
7577
7618
|
{
|
|
7578
7619
|
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
7579
7620
|
name: "Pemba",
|
|
7580
7621
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7581
|
-
validUntil: null,
|
|
7582
7622
|
externalId: "ZnUWsbONIaH"
|
|
7583
7623
|
},
|
|
7584
7624
|
{
|
|
7585
7625
|
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
7586
7626
|
name: "Quanza",
|
|
7587
7627
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7588
|
-
validUntil: null,
|
|
7589
7628
|
externalId: "fDZycvQTa7l"
|
|
7590
7629
|
},
|
|
7591
7630
|
{
|
|
7592
7631
|
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
7593
7632
|
name: "Rivka",
|
|
7594
7633
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7595
|
-
validUntil: null,
|
|
7596
7634
|
externalId: "KqswxCGTELa"
|
|
7597
7635
|
},
|
|
7598
7636
|
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
@@ -7600,35 +7638,30 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
|
7600
7638
|
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
7601
7639
|
name: "Mbula",
|
|
7602
7640
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7603
|
-
validUntil: null,
|
|
7604
7641
|
externalId: "osEbKjRc9Kg"
|
|
7605
7642
|
},
|
|
7606
7643
|
{
|
|
7607
7644
|
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
7608
7645
|
name: "Ndoki",
|
|
7609
7646
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7610
|
-
validUntil: null,
|
|
7611
7647
|
externalId: "aq4daBUAGr3"
|
|
7612
7648
|
},
|
|
7613
7649
|
{
|
|
7614
7650
|
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
7615
7651
|
name: "Tsanga",
|
|
7616
7652
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7617
|
-
validUntil: null,
|
|
7618
7653
|
externalId: "cqis6Y8trbJ"
|
|
7619
7654
|
},
|
|
7620
7655
|
{
|
|
7621
7656
|
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
7622
7657
|
name: "Waziri",
|
|
7623
7658
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7624
|
-
validUntil: null,
|
|
7625
7659
|
externalId: "LMijHPyyx6d"
|
|
7626
7660
|
},
|
|
7627
7661
|
{
|
|
7628
7662
|
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
7629
7663
|
name: "Zimbi",
|
|
7630
7664
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7631
|
-
validUntil: null,
|
|
7632
7665
|
externalId: "pcQYbPuKGZ7"
|
|
7633
7666
|
},
|
|
7634
7667
|
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
@@ -7636,67 +7669,59 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
|
7636
7669
|
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
7637
7670
|
name: "Felani",
|
|
7638
7671
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7639
|
-
validUntil: null,
|
|
7640
7672
|
externalId: "gSqpoCGdMXp"
|
|
7641
7673
|
},
|
|
7642
7674
|
{
|
|
7643
7675
|
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
7644
7676
|
name: "Goroma",
|
|
7645
7677
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7646
|
-
validUntil: null,
|
|
7647
7678
|
externalId: "KvAAIaNqVrp"
|
|
7648
7679
|
},
|
|
7649
7680
|
{
|
|
7650
7681
|
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
7651
7682
|
name: "Halifu",
|
|
7652
7683
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7653
|
-
validUntil: null,
|
|
7654
7684
|
externalId: "qe4UnEVt1hv"
|
|
7655
7685
|
},
|
|
7656
7686
|
{
|
|
7657
7687
|
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
7658
7688
|
name: "Jabari",
|
|
7659
7689
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7660
|
-
validUntil: null,
|
|
7661
7690
|
externalId: "yHH9Nz4rLOt"
|
|
7662
7691
|
},
|
|
7663
7692
|
{
|
|
7664
7693
|
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
7665
7694
|
name: "Kifani",
|
|
7666
7695
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7667
|
-
validUntil: null,
|
|
7668
7696
|
externalId: "eSWmXIGeu1I"
|
|
7669
7697
|
},
|
|
7670
7698
|
{
|
|
7671
7699
|
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
7672
7700
|
name: "Lumela",
|
|
7673
7701
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7674
|
-
validUntil: null,
|
|
7675
7702
|
externalId: "bh0b3aI1uP3"
|
|
7676
7703
|
}
|
|
7677
7704
|
];
|
|
7678
|
-
var
|
|
7705
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = MOCK_ADMINISTRATIVE_AREAS_BASE.map(withVersionFields);
|
|
7706
|
+
var MOCK_LOCATIONS_BASE = [
|
|
7679
7707
|
{
|
|
7680
7708
|
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
7681
7709
|
name: "Central Provincial Office",
|
|
7682
7710
|
locationType: "CRVS_OFFICE",
|
|
7683
7711
|
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7684
|
-
validUntil: null,
|
|
7685
7712
|
externalId: "Xr3Df8WpK6Ys"
|
|
7686
7713
|
},
|
|
7687
7714
|
{
|
|
7688
7715
|
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
7689
7716
|
name: "Central Health Post",
|
|
7690
7717
|
locationType: "HEALTH_FACILITY",
|
|
7691
|
-
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c"
|
|
7692
|
-
validUntil: null
|
|
7718
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c"
|
|
7693
7719
|
},
|
|
7694
7720
|
{
|
|
7695
7721
|
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
7696
7722
|
name: "Ibombo District Office",
|
|
7697
7723
|
locationType: "CRVS_OFFICE",
|
|
7698
7724
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7699
|
-
validUntil: null,
|
|
7700
7725
|
externalId: "Sm4Nw7GrD2Vy"
|
|
7701
7726
|
},
|
|
7702
7727
|
{
|
|
@@ -7704,7 +7729,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7704
7729
|
name: "Isamba District Office",
|
|
7705
7730
|
locationType: "CRVS_OFFICE",
|
|
7706
7731
|
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7707
|
-
validUntil: null,
|
|
7708
7732
|
externalId: "Vg1Bq5XeH9Lt"
|
|
7709
7733
|
},
|
|
7710
7734
|
{
|
|
@@ -7712,7 +7736,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7712
7736
|
name: "Isango District Office",
|
|
7713
7737
|
locationType: "CRVS_OFFICE",
|
|
7714
7738
|
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7715
|
-
validUntil: null,
|
|
7716
7739
|
externalId: "Je7Lm2XqN9Vz"
|
|
7717
7740
|
},
|
|
7718
7741
|
{
|
|
@@ -7720,7 +7743,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7720
7743
|
name: "Sulaka Provincial Office",
|
|
7721
7744
|
locationType: "CRVS_OFFICE",
|
|
7722
7745
|
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7723
|
-
validUntil: null,
|
|
7724
7746
|
externalId: "Ht2Wp9KcX5Qv"
|
|
7725
7747
|
},
|
|
7726
7748
|
{
|
|
@@ -7728,7 +7750,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7728
7750
|
name: "Ilanga District Office",
|
|
7729
7751
|
locationType: "CRVS_OFFICE",
|
|
7730
7752
|
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7731
|
-
validUntil: null,
|
|
7732
7753
|
externalId: "Yp6Ds1WqN3Xz"
|
|
7733
7754
|
},
|
|
7734
7755
|
{
|
|
@@ -7736,7 +7757,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7736
7757
|
name: "Chamakubi Health Post",
|
|
7737
7758
|
locationType: "HEALTH_FACILITY",
|
|
7738
7759
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7739
|
-
validUntil: null,
|
|
7740
7760
|
externalId: "M1nFr8LbC2Qy"
|
|
7741
7761
|
},
|
|
7742
7762
|
{
|
|
@@ -7744,7 +7764,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7744
7764
|
name: "Ibombo Rural Health Centre",
|
|
7745
7765
|
locationType: "HEALTH_FACILITY",
|
|
7746
7766
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7747
|
-
validUntil: null,
|
|
7748
7767
|
externalId: "bT7pV6YrW0Xc"
|
|
7749
7768
|
},
|
|
7750
7769
|
{
|
|
@@ -7752,7 +7771,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7752
7771
|
name: "Chikobo Rural Health Centre",
|
|
7753
7772
|
locationType: "HEALTH_FACILITY",
|
|
7754
7773
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7755
|
-
validUntil: null,
|
|
7756
7774
|
externalId: "zE4qPn2SgJ5d"
|
|
7757
7775
|
},
|
|
7758
7776
|
{
|
|
@@ -7760,7 +7778,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7760
7778
|
name: "Chilochabalenje Health Post",
|
|
7761
7779
|
locationType: "HEALTH_FACILITY",
|
|
7762
7780
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7763
|
-
validUntil: null,
|
|
7764
7781
|
externalId: "H8vDs1MqR4Uf"
|
|
7765
7782
|
},
|
|
7766
7783
|
{
|
|
@@ -7768,7 +7785,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7768
7785
|
name: "Chipeso Rural Health Centre",
|
|
7769
7786
|
locationType: "HEALTH_FACILITY",
|
|
7770
7787
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7771
|
-
validUntil: null,
|
|
7772
7788
|
externalId: "Qw3uZ9KfX6Lm"
|
|
7773
7789
|
},
|
|
7774
7790
|
{
|
|
@@ -7776,7 +7792,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7776
7792
|
name: "Chisamba Rural Health Centre",
|
|
7777
7793
|
locationType: "HEALTH_FACILITY",
|
|
7778
7794
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7779
|
-
validUntil: null,
|
|
7780
7795
|
externalId: "Yr0pCg8LdM2s"
|
|
7781
7796
|
},
|
|
7782
7797
|
{
|
|
@@ -7784,7 +7799,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7784
7799
|
name: "Chitanda Rural Health Centre",
|
|
7785
7800
|
locationType: "HEALTH_FACILITY",
|
|
7786
7801
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7787
|
-
validUntil: null,
|
|
7788
7802
|
externalId: "tS9gJ4PwB1Qx"
|
|
7789
7803
|
},
|
|
7790
7804
|
{
|
|
@@ -7792,7 +7806,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7792
7806
|
name: "Golden Valley Rural Health Centre",
|
|
7793
7807
|
locationType: "HEALTH_FACILITY",
|
|
7794
7808
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7795
|
-
validUntil: null,
|
|
7796
7809
|
externalId: "Ld7Qm3XsA8Vr"
|
|
7797
7810
|
},
|
|
7798
7811
|
{
|
|
@@ -7800,7 +7813,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7800
7813
|
name: "Ipongo Rural Health Centre",
|
|
7801
7814
|
locationType: "HEALTH_FACILITY",
|
|
7802
7815
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7803
|
-
validUntil: null,
|
|
7804
7816
|
externalId: "kF2sW9DmH0Bt"
|
|
7805
7817
|
},
|
|
7806
7818
|
{
|
|
@@ -7808,7 +7820,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7808
7820
|
name: "Itumbwe Health Post",
|
|
7809
7821
|
locationType: "HEALTH_FACILITY",
|
|
7810
7822
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7811
|
-
validUntil: null,
|
|
7812
7823
|
externalId: "Ue5Xb3VaC7Pq"
|
|
7813
7824
|
},
|
|
7814
7825
|
{
|
|
@@ -7816,7 +7827,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7816
7827
|
name: "Kabangalala Rural Health Centre",
|
|
7817
7828
|
locationType: "HEALTH_FACILITY",
|
|
7818
7829
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7819
|
-
validUntil: null,
|
|
7820
7830
|
externalId: "Pz8Kc1TqH6Jn"
|
|
7821
7831
|
},
|
|
7822
7832
|
// Village offices
|
|
@@ -7825,10 +7835,10 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7825
7835
|
name: "Klow Village Office",
|
|
7826
7836
|
locationType: "CRVS_OFFICE",
|
|
7827
7837
|
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7828
|
-
validUntil: null,
|
|
7829
7838
|
externalId: "PmAyxAJkxiJ"
|
|
7830
7839
|
}
|
|
7831
7840
|
];
|
|
7841
|
+
var V2_DEFAULT_MOCK_LOCATIONS = MOCK_LOCATIONS_BASE.map(withVersionFields);
|
|
7832
7842
|
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
7833
7843
|
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
7834
7844
|
);
|
|
@@ -7836,8 +7846,56 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
|
7836
7846
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7837
7847
|
);
|
|
7838
7848
|
|
|
7839
|
-
// ../commons/src/
|
|
7849
|
+
// ../commons/src/events/locationPayloads.ts
|
|
7840
7850
|
var z44 = __toESM(require("zod/v4"));
|
|
7851
|
+
var CreateLocationPayload = z44.object({
|
|
7852
|
+
id: UUID.optional(),
|
|
7853
|
+
versionId: UUID.optional(),
|
|
7854
|
+
name: z44.string(),
|
|
7855
|
+
externalId: z44.string().nullish(),
|
|
7856
|
+
administrativeAreaId: UUID.nullable(),
|
|
7857
|
+
locationType: z44.string().nullable(),
|
|
7858
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7859
|
+
status: LocationStatus.default("active")
|
|
7860
|
+
});
|
|
7861
|
+
var UpdateLocationPayload = z44.strictObject({
|
|
7862
|
+
id: UUID,
|
|
7863
|
+
versionId: UUID.optional(),
|
|
7864
|
+
name: z44.string(),
|
|
7865
|
+
externalId: z44.string().nullish(),
|
|
7866
|
+
status: LocationStatus,
|
|
7867
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7868
|
+
lastVersionId: UUID
|
|
7869
|
+
});
|
|
7870
|
+
var WithdrawLocationVersionPayload = z44.object({
|
|
7871
|
+
id: UUID,
|
|
7872
|
+
versionId: UUID
|
|
7873
|
+
});
|
|
7874
|
+
var CreateAdministrativeAreaPayload = z44.object({
|
|
7875
|
+
id: UUID.optional(),
|
|
7876
|
+
versionId: UUID.optional(),
|
|
7877
|
+
name: z44.string(),
|
|
7878
|
+
externalId: z44.string().nullish(),
|
|
7879
|
+
parentId: UUID.nullable(),
|
|
7880
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7881
|
+
status: LocationStatus.default("active")
|
|
7882
|
+
});
|
|
7883
|
+
var UpdateAdministrativeAreaPayload = z44.strictObject({
|
|
7884
|
+
id: UUID,
|
|
7885
|
+
versionId: UUID.optional(),
|
|
7886
|
+
name: z44.string(),
|
|
7887
|
+
externalId: z44.string().nullish(),
|
|
7888
|
+
status: LocationStatus,
|
|
7889
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7890
|
+
lastVersionId: UUID
|
|
7891
|
+
});
|
|
7892
|
+
var WithdrawAdministrativeAreaVersionPayload = z44.object({
|
|
7893
|
+
id: UUID,
|
|
7894
|
+
versionId: UUID
|
|
7895
|
+
});
|
|
7896
|
+
|
|
7897
|
+
// ../commons/src/notification/UserNotifications.ts
|
|
7898
|
+
var z45 = __toESM(require("zod/v4"));
|
|
7841
7899
|
var TriggerEvent = {
|
|
7842
7900
|
USER_CREATED: "user-created",
|
|
7843
7901
|
USER_UPDATED: "user-updated",
|
|
@@ -7850,54 +7908,54 @@ var TriggerEvent = {
|
|
|
7850
7908
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
7851
7909
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
7852
7910
|
};
|
|
7853
|
-
var Recipient =
|
|
7911
|
+
var Recipient = z45.object({
|
|
7854
7912
|
name: NameFieldValue.optional(),
|
|
7855
|
-
mobile:
|
|
7856
|
-
email:
|
|
7857
|
-
bcc:
|
|
7913
|
+
mobile: z45.string().optional(),
|
|
7914
|
+
email: z45.string().optional(),
|
|
7915
|
+
bcc: z45.array(z45.string()).optional()
|
|
7858
7916
|
});
|
|
7859
|
-
var BasePayload =
|
|
7917
|
+
var BasePayload = z45.object({
|
|
7860
7918
|
recipient: Recipient
|
|
7861
7919
|
});
|
|
7862
7920
|
var TriggerPayload = {
|
|
7863
7921
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
7864
|
-
username:
|
|
7865
|
-
temporaryPassword:
|
|
7922
|
+
username: z45.string(),
|
|
7923
|
+
temporaryPassword: z45.string()
|
|
7866
7924
|
}),
|
|
7867
7925
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
7868
|
-
oldUsername:
|
|
7869
|
-
newUsername:
|
|
7926
|
+
oldUsername: z45.string(),
|
|
7927
|
+
newUsername: z45.string()
|
|
7870
7928
|
}),
|
|
7871
7929
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
7872
|
-
username:
|
|
7930
|
+
username: z45.string()
|
|
7873
7931
|
}),
|
|
7874
7932
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
7875
|
-
code:
|
|
7933
|
+
code: z45.string()
|
|
7876
7934
|
}),
|
|
7877
7935
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
7878
|
-
temporaryPassword:
|
|
7879
|
-
admin:
|
|
7880
|
-
id:
|
|
7936
|
+
temporaryPassword: z45.string(),
|
|
7937
|
+
admin: z45.object({
|
|
7938
|
+
id: z45.string(),
|
|
7881
7939
|
name: NameFieldValue,
|
|
7882
|
-
role:
|
|
7940
|
+
role: z45.string()
|
|
7883
7941
|
})
|
|
7884
7942
|
}),
|
|
7885
7943
|
[TriggerEvent.RESEND_INVITE]: BasePayload.extend({
|
|
7886
|
-
username:
|
|
7887
|
-
temporaryPassword:
|
|
7944
|
+
username: z45.string(),
|
|
7945
|
+
temporaryPassword: z45.string()
|
|
7888
7946
|
}),
|
|
7889
7947
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
7890
|
-
code:
|
|
7948
|
+
code: z45.string()
|
|
7891
7949
|
}),
|
|
7892
7950
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
7893
|
-
subject:
|
|
7894
|
-
body:
|
|
7951
|
+
subject: z45.string(),
|
|
7952
|
+
body: z45.string()
|
|
7895
7953
|
}),
|
|
7896
7954
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
7897
|
-
code:
|
|
7955
|
+
code: z45.string()
|
|
7898
7956
|
}),
|
|
7899
7957
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
7900
|
-
code:
|
|
7958
|
+
code: z45.string()
|
|
7901
7959
|
})
|
|
7902
7960
|
};
|
|
7903
7961
|
async function triggerUserEventNotification({
|
|
@@ -7921,4 +7979,4 @@ function parseUserEventTrigger(event2, body) {
|
|
|
7921
7979
|
}
|
|
7922
7980
|
|
|
7923
7981
|
// src/notification/index.ts
|
|
7924
|
-
|
|
7982
|
+
z46.globalRegistry.clear();
|