@opencrvs/toolkit 2.1.0-rc.bfdbd70 → 2.1.0-rc.c3b24ba
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 +1 -0
- package/dist/commons/api/router.d.ts +111 -7
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
- package/dist/commons/events/AuditLog.d.ts +37 -0
- package/dist/commons/events/FieldConfig.d.ts +5 -0
- 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 +100 -3
- package/dist/commons/events/mocks.test.utils.d.ts +16 -2
- package/dist/commons/events/test.utils.d.ts +5 -5
- package/dist/conditionals/index.js +1 -0
- package/dist/events/index.js +147 -52
- package/dist/notification/index.js +144 -77
- package/dist/scopes/index.d.ts +3 -1
- package/dist/scopes/index.js +1 -0
- package/opencrvs-toolkit-2.1.0-rc.c3b24ba.tgz +0 -0
- package/package.json +4 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.1.0-rc.bfdbd70.tgz +0 -0
|
@@ -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,29 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
|
|
|
530
531
|
requestData: z5.object({ id: z5.string() }),
|
|
531
532
|
responseSummary: z5.object({ clientId: z5.string() })
|
|
532
533
|
});
|
|
534
|
+
var createdVersionFields = {
|
|
535
|
+
id: z5.string(),
|
|
536
|
+
versionId: z5.string(),
|
|
537
|
+
name: z5.string(),
|
|
538
|
+
externalId: z5.string().nullish(),
|
|
539
|
+
effectiveFrom: z5.string(),
|
|
540
|
+
status: z5.string()
|
|
541
|
+
};
|
|
542
|
+
var LocationCreateEntrySchema = AuditLogEntryBase.extend({
|
|
543
|
+
operation: z5.literal("locations.create"),
|
|
544
|
+
requestData: z5.object({
|
|
545
|
+
...createdVersionFields,
|
|
546
|
+
administrativeAreaId: z5.string().nullish(),
|
|
547
|
+
locationType: z5.string().nullish()
|
|
548
|
+
})
|
|
549
|
+
});
|
|
550
|
+
var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
|
|
551
|
+
operation: z5.literal("administrativeAreas.create"),
|
|
552
|
+
requestData: z5.object({
|
|
553
|
+
...createdVersionFields,
|
|
554
|
+
parentId: z5.string().nullish()
|
|
555
|
+
})
|
|
556
|
+
});
|
|
533
557
|
var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
|
|
534
558
|
operation: z5.literal("attachments.upload"),
|
|
535
559
|
requestData: z5.object({
|
|
@@ -605,6 +629,8 @@ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
|
|
|
605
629
|
IntegrationActivateEntrySchema,
|
|
606
630
|
IntegrationDeleteEntrySchema,
|
|
607
631
|
IntegrationRefreshSecretEntrySchema,
|
|
632
|
+
LocationCreateEntrySchema,
|
|
633
|
+
AdministrativeAreaCreateEntrySchema,
|
|
608
634
|
AttachmentUploadEntrySchema,
|
|
609
635
|
UserCreateEntrySchema,
|
|
610
636
|
UserReasonEntrySchema,
|
|
@@ -7359,21 +7385,44 @@ var LocationTypeV1 = z43.enum([
|
|
|
7359
7385
|
"CRVS_OFFICE",
|
|
7360
7386
|
"HEALTH_FACILITY"
|
|
7361
7387
|
]);
|
|
7388
|
+
var LocationStatus = z43.enum(["active", "inactive"]);
|
|
7389
|
+
var LocationVersion = z43.object({
|
|
7390
|
+
versionId: UUID,
|
|
7391
|
+
effectiveFrom: z43.iso.date(),
|
|
7392
|
+
name: z43.string(),
|
|
7393
|
+
externalId: z43.string().nullish(),
|
|
7394
|
+
status: LocationStatus
|
|
7395
|
+
});
|
|
7362
7396
|
var AdministrativeArea = z43.object({
|
|
7363
7397
|
id: UUID,
|
|
7364
7398
|
name: z43.string(),
|
|
7365
7399
|
externalId: z43.string().nullish(),
|
|
7366
7400
|
parentId: UUID.nullable(),
|
|
7367
|
-
|
|
7401
|
+
status: LocationStatus,
|
|
7402
|
+
versions: z43.array(LocationVersion)
|
|
7368
7403
|
});
|
|
7369
7404
|
var Location = z43.object({
|
|
7370
7405
|
id: UUID,
|
|
7371
7406
|
name: z43.string(),
|
|
7372
7407
|
externalId: z43.string().nullish(),
|
|
7373
7408
|
administrativeAreaId: UUID.nullable(),
|
|
7374
|
-
|
|
7409
|
+
locationType: z43.string().nullable(),
|
|
7410
|
+
status: LocationStatus,
|
|
7411
|
+
versions: z43.array(LocationVersion)
|
|
7412
|
+
});
|
|
7413
|
+
var SetLocationPayload = z43.object({
|
|
7414
|
+
id: UUID,
|
|
7415
|
+
name: z43.string(),
|
|
7416
|
+
externalId: z43.string().nullish(),
|
|
7417
|
+
administrativeAreaId: UUID.nullable(),
|
|
7375
7418
|
locationType: z43.string().nullable()
|
|
7376
7419
|
});
|
|
7420
|
+
var SetAdministrativeAreaPayload = z43.object({
|
|
7421
|
+
id: UUID,
|
|
7422
|
+
name: z43.string(),
|
|
7423
|
+
externalId: z43.string().nullish(),
|
|
7424
|
+
parentId: UUID.nullable()
|
|
7425
|
+
});
|
|
7377
7426
|
|
|
7378
7427
|
// ../commons/src/events/scopes.ts
|
|
7379
7428
|
var ACTION_SCOPE_MAP = {
|
|
@@ -7472,75 +7521,80 @@ var REJECTED_ACTIONS = [
|
|
|
7472
7521
|
var import_lodash7 = require("lodash");
|
|
7473
7522
|
|
|
7474
7523
|
// ../commons/src/events/mocks.test.utils.ts
|
|
7475
|
-
|
|
7524
|
+
function withVersionFields(entity) {
|
|
7525
|
+
return {
|
|
7526
|
+
...entity,
|
|
7527
|
+
status: "active",
|
|
7528
|
+
versions: [
|
|
7529
|
+
{
|
|
7530
|
+
versionId: entity.id,
|
|
7531
|
+
effectiveFrom: "0001-01-01",
|
|
7532
|
+
name: entity.name,
|
|
7533
|
+
externalId: entity.externalId ?? null,
|
|
7534
|
+
status: "active"
|
|
7535
|
+
}
|
|
7536
|
+
]
|
|
7537
|
+
};
|
|
7538
|
+
}
|
|
7539
|
+
var MOCK_ADMINISTRATIVE_AREAS_BASE = [
|
|
7476
7540
|
{
|
|
7477
7541
|
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7478
7542
|
name: "Central",
|
|
7479
7543
|
parentId: null,
|
|
7480
|
-
validUntil: null,
|
|
7481
7544
|
externalId: "ydyJb1RAy4U1"
|
|
7482
7545
|
},
|
|
7483
7546
|
{
|
|
7484
7547
|
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7485
7548
|
name: "Sulaka",
|
|
7486
7549
|
parentId: null,
|
|
7487
|
-
validUntil: null,
|
|
7488
7550
|
externalId: "pQ8nGxWmZ2Q3"
|
|
7489
7551
|
},
|
|
7490
7552
|
{
|
|
7491
7553
|
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
7492
7554
|
name: "Pualula",
|
|
7493
7555
|
parentId: null,
|
|
7494
|
-
validUntil: null,
|
|
7495
7556
|
externalId: "Aq91DweLmT8k"
|
|
7496
7557
|
},
|
|
7497
7558
|
{
|
|
7498
7559
|
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
7499
7560
|
name: "Chuminga",
|
|
7500
7561
|
parentId: null,
|
|
7501
|
-
validUntil: null,
|
|
7502
7562
|
externalId: "Rw0fYNh2Xk9a"
|
|
7503
7563
|
},
|
|
7504
7564
|
{
|
|
7505
7565
|
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7506
7566
|
name: "Ibombo",
|
|
7507
7567
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7508
|
-
validUntil: null,
|
|
7509
7568
|
externalId: "k7DsP4vbN1Qe"
|
|
7510
7569
|
},
|
|
7511
7570
|
{
|
|
7512
7571
|
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7513
7572
|
name: "Isango",
|
|
7514
7573
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7515
|
-
validUntil: null,
|
|
7516
7574
|
externalId: "Gm3Z9eQpHw4L"
|
|
7517
7575
|
},
|
|
7518
7576
|
{
|
|
7519
7577
|
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7520
7578
|
name: "Isamba",
|
|
7521
7579
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7522
|
-
validUntil: null,
|
|
7523
7580
|
externalId: "sT0xVu1KqJ7r"
|
|
7524
7581
|
},
|
|
7525
7582
|
{
|
|
7526
7583
|
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7527
7584
|
name: "Itambo",
|
|
7528
7585
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7529
|
-
validUntil: null,
|
|
7530
7586
|
externalId: "Nq6Bv2HpL9Te"
|
|
7531
7587
|
},
|
|
7532
7588
|
{
|
|
7533
7589
|
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
7534
7590
|
name: "Ezhi",
|
|
7535
7591
|
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7536
|
-
validUntil: null,
|
|
7537
7592
|
externalId: "xK8cQ0ZRy5Wd"
|
|
7538
7593
|
},
|
|
7539
7594
|
{
|
|
7540
7595
|
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7541
7596
|
name: "Ilanga",
|
|
7542
7597
|
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7543
|
-
validUntil: null,
|
|
7544
7598
|
externalId: "Cq4Jm1XvN8Ls"
|
|
7545
7599
|
},
|
|
7546
7600
|
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
@@ -7548,49 +7602,42 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
|
7548
7602
|
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7549
7603
|
name: "Klow",
|
|
7550
7604
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7551
|
-
validUntil: null,
|
|
7552
7605
|
externalId: "IkYcYBUcyY2"
|
|
7553
7606
|
},
|
|
7554
7607
|
{
|
|
7555
7608
|
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
7556
7609
|
name: "Mbondo",
|
|
7557
7610
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7558
|
-
validUntil: null,
|
|
7559
7611
|
externalId: "Qhvv5hvo3mY"
|
|
7560
7612
|
},
|
|
7561
7613
|
{
|
|
7562
7614
|
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
7563
7615
|
name: "Ndara",
|
|
7564
7616
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7565
|
-
validUntil: null,
|
|
7566
7617
|
externalId: "crXh068O9TR"
|
|
7567
7618
|
},
|
|
7568
7619
|
{
|
|
7569
7620
|
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
7570
7621
|
name: "Olani",
|
|
7571
7622
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7572
|
-
validUntil: null,
|
|
7573
7623
|
externalId: "r00It8Tvvp7"
|
|
7574
7624
|
},
|
|
7575
7625
|
{
|
|
7576
7626
|
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
7577
7627
|
name: "Pemba",
|
|
7578
7628
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7579
|
-
validUntil: null,
|
|
7580
7629
|
externalId: "ZnUWsbONIaH"
|
|
7581
7630
|
},
|
|
7582
7631
|
{
|
|
7583
7632
|
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
7584
7633
|
name: "Quanza",
|
|
7585
7634
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7586
|
-
validUntil: null,
|
|
7587
7635
|
externalId: "fDZycvQTa7l"
|
|
7588
7636
|
},
|
|
7589
7637
|
{
|
|
7590
7638
|
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
7591
7639
|
name: "Rivka",
|
|
7592
7640
|
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7593
|
-
validUntil: null,
|
|
7594
7641
|
externalId: "KqswxCGTELa"
|
|
7595
7642
|
},
|
|
7596
7643
|
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
@@ -7598,35 +7645,30 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
|
7598
7645
|
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
7599
7646
|
name: "Mbula",
|
|
7600
7647
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7601
|
-
validUntil: null,
|
|
7602
7648
|
externalId: "osEbKjRc9Kg"
|
|
7603
7649
|
},
|
|
7604
7650
|
{
|
|
7605
7651
|
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
7606
7652
|
name: "Ndoki",
|
|
7607
7653
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7608
|
-
validUntil: null,
|
|
7609
7654
|
externalId: "aq4daBUAGr3"
|
|
7610
7655
|
},
|
|
7611
7656
|
{
|
|
7612
7657
|
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
7613
7658
|
name: "Tsanga",
|
|
7614
7659
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7615
|
-
validUntil: null,
|
|
7616
7660
|
externalId: "cqis6Y8trbJ"
|
|
7617
7661
|
},
|
|
7618
7662
|
{
|
|
7619
7663
|
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
7620
7664
|
name: "Waziri",
|
|
7621
7665
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7622
|
-
validUntil: null,
|
|
7623
7666
|
externalId: "LMijHPyyx6d"
|
|
7624
7667
|
},
|
|
7625
7668
|
{
|
|
7626
7669
|
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
7627
7670
|
name: "Zimbi",
|
|
7628
7671
|
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7629
|
-
validUntil: null,
|
|
7630
7672
|
externalId: "pcQYbPuKGZ7"
|
|
7631
7673
|
},
|
|
7632
7674
|
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
@@ -7634,67 +7676,59 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
|
7634
7676
|
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
7635
7677
|
name: "Felani",
|
|
7636
7678
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7637
|
-
validUntil: null,
|
|
7638
7679
|
externalId: "gSqpoCGdMXp"
|
|
7639
7680
|
},
|
|
7640
7681
|
{
|
|
7641
7682
|
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
7642
7683
|
name: "Goroma",
|
|
7643
7684
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7644
|
-
validUntil: null,
|
|
7645
7685
|
externalId: "KvAAIaNqVrp"
|
|
7646
7686
|
},
|
|
7647
7687
|
{
|
|
7648
7688
|
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
7649
7689
|
name: "Halifu",
|
|
7650
7690
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7651
|
-
validUntil: null,
|
|
7652
7691
|
externalId: "qe4UnEVt1hv"
|
|
7653
7692
|
},
|
|
7654
7693
|
{
|
|
7655
7694
|
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
7656
7695
|
name: "Jabari",
|
|
7657
7696
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7658
|
-
validUntil: null,
|
|
7659
7697
|
externalId: "yHH9Nz4rLOt"
|
|
7660
7698
|
},
|
|
7661
7699
|
{
|
|
7662
7700
|
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
7663
7701
|
name: "Kifani",
|
|
7664
7702
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7665
|
-
validUntil: null,
|
|
7666
7703
|
externalId: "eSWmXIGeu1I"
|
|
7667
7704
|
},
|
|
7668
7705
|
{
|
|
7669
7706
|
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
7670
7707
|
name: "Lumela",
|
|
7671
7708
|
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7672
|
-
validUntil: null,
|
|
7673
7709
|
externalId: "bh0b3aI1uP3"
|
|
7674
7710
|
}
|
|
7675
7711
|
];
|
|
7676
|
-
var
|
|
7712
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = MOCK_ADMINISTRATIVE_AREAS_BASE.map(withVersionFields);
|
|
7713
|
+
var MOCK_LOCATIONS_BASE = [
|
|
7677
7714
|
{
|
|
7678
7715
|
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
7679
7716
|
name: "Central Provincial Office",
|
|
7680
7717
|
locationType: "CRVS_OFFICE",
|
|
7681
7718
|
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7682
|
-
validUntil: null,
|
|
7683
7719
|
externalId: "Xr3Df8WpK6Ys"
|
|
7684
7720
|
},
|
|
7685
7721
|
{
|
|
7686
7722
|
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
7687
7723
|
name: "Central Health Post",
|
|
7688
7724
|
locationType: "HEALTH_FACILITY",
|
|
7689
|
-
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c"
|
|
7690
|
-
validUntil: null
|
|
7725
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c"
|
|
7691
7726
|
},
|
|
7692
7727
|
{
|
|
7693
7728
|
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
7694
7729
|
name: "Ibombo District Office",
|
|
7695
7730
|
locationType: "CRVS_OFFICE",
|
|
7696
7731
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7697
|
-
validUntil: null,
|
|
7698
7732
|
externalId: "Sm4Nw7GrD2Vy"
|
|
7699
7733
|
},
|
|
7700
7734
|
{
|
|
@@ -7702,7 +7736,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7702
7736
|
name: "Isamba District Office",
|
|
7703
7737
|
locationType: "CRVS_OFFICE",
|
|
7704
7738
|
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7705
|
-
validUntil: null,
|
|
7706
7739
|
externalId: "Vg1Bq5XeH9Lt"
|
|
7707
7740
|
},
|
|
7708
7741
|
{
|
|
@@ -7710,7 +7743,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7710
7743
|
name: "Isango District Office",
|
|
7711
7744
|
locationType: "CRVS_OFFICE",
|
|
7712
7745
|
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7713
|
-
validUntil: null,
|
|
7714
7746
|
externalId: "Je7Lm2XqN9Vz"
|
|
7715
7747
|
},
|
|
7716
7748
|
{
|
|
@@ -7718,7 +7750,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7718
7750
|
name: "Sulaka Provincial Office",
|
|
7719
7751
|
locationType: "CRVS_OFFICE",
|
|
7720
7752
|
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7721
|
-
validUntil: null,
|
|
7722
7753
|
externalId: "Ht2Wp9KcX5Qv"
|
|
7723
7754
|
},
|
|
7724
7755
|
{
|
|
@@ -7726,7 +7757,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7726
7757
|
name: "Ilanga District Office",
|
|
7727
7758
|
locationType: "CRVS_OFFICE",
|
|
7728
7759
|
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7729
|
-
validUntil: null,
|
|
7730
7760
|
externalId: "Yp6Ds1WqN3Xz"
|
|
7731
7761
|
},
|
|
7732
7762
|
{
|
|
@@ -7734,7 +7764,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7734
7764
|
name: "Chamakubi Health Post",
|
|
7735
7765
|
locationType: "HEALTH_FACILITY",
|
|
7736
7766
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7737
|
-
validUntil: null,
|
|
7738
7767
|
externalId: "M1nFr8LbC2Qy"
|
|
7739
7768
|
},
|
|
7740
7769
|
{
|
|
@@ -7742,7 +7771,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7742
7771
|
name: "Ibombo Rural Health Centre",
|
|
7743
7772
|
locationType: "HEALTH_FACILITY",
|
|
7744
7773
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7745
|
-
validUntil: null,
|
|
7746
7774
|
externalId: "bT7pV6YrW0Xc"
|
|
7747
7775
|
},
|
|
7748
7776
|
{
|
|
@@ -7750,7 +7778,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7750
7778
|
name: "Chikobo Rural Health Centre",
|
|
7751
7779
|
locationType: "HEALTH_FACILITY",
|
|
7752
7780
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7753
|
-
validUntil: null,
|
|
7754
7781
|
externalId: "zE4qPn2SgJ5d"
|
|
7755
7782
|
},
|
|
7756
7783
|
{
|
|
@@ -7758,7 +7785,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7758
7785
|
name: "Chilochabalenje Health Post",
|
|
7759
7786
|
locationType: "HEALTH_FACILITY",
|
|
7760
7787
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7761
|
-
validUntil: null,
|
|
7762
7788
|
externalId: "H8vDs1MqR4Uf"
|
|
7763
7789
|
},
|
|
7764
7790
|
{
|
|
@@ -7766,7 +7792,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7766
7792
|
name: "Chipeso Rural Health Centre",
|
|
7767
7793
|
locationType: "HEALTH_FACILITY",
|
|
7768
7794
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7769
|
-
validUntil: null,
|
|
7770
7795
|
externalId: "Qw3uZ9KfX6Lm"
|
|
7771
7796
|
},
|
|
7772
7797
|
{
|
|
@@ -7774,7 +7799,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7774
7799
|
name: "Chisamba Rural Health Centre",
|
|
7775
7800
|
locationType: "HEALTH_FACILITY",
|
|
7776
7801
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7777
|
-
validUntil: null,
|
|
7778
7802
|
externalId: "Yr0pCg8LdM2s"
|
|
7779
7803
|
},
|
|
7780
7804
|
{
|
|
@@ -7782,7 +7806,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7782
7806
|
name: "Chitanda Rural Health Centre",
|
|
7783
7807
|
locationType: "HEALTH_FACILITY",
|
|
7784
7808
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7785
|
-
validUntil: null,
|
|
7786
7809
|
externalId: "tS9gJ4PwB1Qx"
|
|
7787
7810
|
},
|
|
7788
7811
|
{
|
|
@@ -7790,7 +7813,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7790
7813
|
name: "Golden Valley Rural Health Centre",
|
|
7791
7814
|
locationType: "HEALTH_FACILITY",
|
|
7792
7815
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7793
|
-
validUntil: null,
|
|
7794
7816
|
externalId: "Ld7Qm3XsA8Vr"
|
|
7795
7817
|
},
|
|
7796
7818
|
{
|
|
@@ -7798,7 +7820,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7798
7820
|
name: "Ipongo Rural Health Centre",
|
|
7799
7821
|
locationType: "HEALTH_FACILITY",
|
|
7800
7822
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7801
|
-
validUntil: null,
|
|
7802
7823
|
externalId: "kF2sW9DmH0Bt"
|
|
7803
7824
|
},
|
|
7804
7825
|
{
|
|
@@ -7806,7 +7827,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7806
7827
|
name: "Itumbwe Health Post",
|
|
7807
7828
|
locationType: "HEALTH_FACILITY",
|
|
7808
7829
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7809
|
-
validUntil: null,
|
|
7810
7830
|
externalId: "Ue5Xb3VaC7Pq"
|
|
7811
7831
|
},
|
|
7812
7832
|
{
|
|
@@ -7814,7 +7834,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7814
7834
|
name: "Kabangalala Rural Health Centre",
|
|
7815
7835
|
locationType: "HEALTH_FACILITY",
|
|
7816
7836
|
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7817
|
-
validUntil: null,
|
|
7818
7837
|
externalId: "Pz8Kc1TqH6Jn"
|
|
7819
7838
|
},
|
|
7820
7839
|
// Village offices
|
|
@@ -7823,10 +7842,10 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
|
7823
7842
|
name: "Klow Village Office",
|
|
7824
7843
|
locationType: "CRVS_OFFICE",
|
|
7825
7844
|
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7826
|
-
validUntil: null,
|
|
7827
7845
|
externalId: "PmAyxAJkxiJ"
|
|
7828
7846
|
}
|
|
7829
7847
|
];
|
|
7848
|
+
var V2_DEFAULT_MOCK_LOCATIONS = MOCK_LOCATIONS_BASE.map(withVersionFields);
|
|
7830
7849
|
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
7831
7850
|
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
7832
7851
|
);
|
|
@@ -7834,8 +7853,56 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
|
7834
7853
|
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7835
7854
|
);
|
|
7836
7855
|
|
|
7837
|
-
// ../commons/src/
|
|
7856
|
+
// ../commons/src/events/locationPayloads.ts
|
|
7838
7857
|
var z44 = __toESM(require("zod/v4"));
|
|
7858
|
+
var CreateLocationPayload = z44.object({
|
|
7859
|
+
id: UUID.optional(),
|
|
7860
|
+
versionId: UUID.optional(),
|
|
7861
|
+
name: z44.string(),
|
|
7862
|
+
externalId: z44.string().nullish(),
|
|
7863
|
+
administrativeAreaId: UUID.nullable(),
|
|
7864
|
+
locationType: z44.string().nullable(),
|
|
7865
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7866
|
+
status: LocationStatus.default("active")
|
|
7867
|
+
});
|
|
7868
|
+
var UpdateLocationPayload = z44.strictObject({
|
|
7869
|
+
id: UUID,
|
|
7870
|
+
versionId: UUID.optional(),
|
|
7871
|
+
name: z44.string(),
|
|
7872
|
+
externalId: z44.string().nullish(),
|
|
7873
|
+
status: LocationStatus,
|
|
7874
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7875
|
+
lastVersionId: UUID
|
|
7876
|
+
});
|
|
7877
|
+
var WithdrawLocationVersionPayload = z44.object({
|
|
7878
|
+
id: UUID,
|
|
7879
|
+
versionId: UUID
|
|
7880
|
+
});
|
|
7881
|
+
var CreateAdministrativeAreaPayload = z44.object({
|
|
7882
|
+
id: UUID.optional(),
|
|
7883
|
+
versionId: UUID.optional(),
|
|
7884
|
+
name: z44.string(),
|
|
7885
|
+
externalId: z44.string().nullish(),
|
|
7886
|
+
parentId: UUID.nullable(),
|
|
7887
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7888
|
+
status: LocationStatus.default("active")
|
|
7889
|
+
});
|
|
7890
|
+
var UpdateAdministrativeAreaPayload = z44.strictObject({
|
|
7891
|
+
id: UUID,
|
|
7892
|
+
versionId: UUID.optional(),
|
|
7893
|
+
name: z44.string(),
|
|
7894
|
+
externalId: z44.string().nullish(),
|
|
7895
|
+
status: LocationStatus,
|
|
7896
|
+
effectiveFrom: z44.iso.date().optional(),
|
|
7897
|
+
lastVersionId: UUID
|
|
7898
|
+
});
|
|
7899
|
+
var WithdrawAdministrativeAreaVersionPayload = z44.object({
|
|
7900
|
+
id: UUID,
|
|
7901
|
+
versionId: UUID
|
|
7902
|
+
});
|
|
7903
|
+
|
|
7904
|
+
// ../commons/src/notification/UserNotifications.ts
|
|
7905
|
+
var z45 = __toESM(require("zod/v4"));
|
|
7839
7906
|
var TriggerEvent = {
|
|
7840
7907
|
USER_CREATED: "user-created",
|
|
7841
7908
|
USER_UPDATED: "user-updated",
|
|
@@ -7848,54 +7915,54 @@ var TriggerEvent = {
|
|
|
7848
7915
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
7849
7916
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
7850
7917
|
};
|
|
7851
|
-
var Recipient =
|
|
7918
|
+
var Recipient = z45.object({
|
|
7852
7919
|
name: NameFieldValue.optional(),
|
|
7853
|
-
mobile:
|
|
7854
|
-
email:
|
|
7855
|
-
bcc:
|
|
7920
|
+
mobile: z45.string().optional(),
|
|
7921
|
+
email: z45.string().optional(),
|
|
7922
|
+
bcc: z45.array(z45.string()).optional()
|
|
7856
7923
|
});
|
|
7857
|
-
var BasePayload =
|
|
7924
|
+
var BasePayload = z45.object({
|
|
7858
7925
|
recipient: Recipient
|
|
7859
7926
|
});
|
|
7860
7927
|
var TriggerPayload = {
|
|
7861
7928
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
7862
|
-
username:
|
|
7863
|
-
temporaryPassword:
|
|
7929
|
+
username: z45.string(),
|
|
7930
|
+
temporaryPassword: z45.string()
|
|
7864
7931
|
}),
|
|
7865
7932
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
7866
|
-
oldUsername:
|
|
7867
|
-
newUsername:
|
|
7933
|
+
oldUsername: z45.string(),
|
|
7934
|
+
newUsername: z45.string()
|
|
7868
7935
|
}),
|
|
7869
7936
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
7870
|
-
username:
|
|
7937
|
+
username: z45.string()
|
|
7871
7938
|
}),
|
|
7872
7939
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
7873
|
-
code:
|
|
7940
|
+
code: z45.string()
|
|
7874
7941
|
}),
|
|
7875
7942
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
7876
|
-
temporaryPassword:
|
|
7877
|
-
admin:
|
|
7878
|
-
id:
|
|
7943
|
+
temporaryPassword: z45.string(),
|
|
7944
|
+
admin: z45.object({
|
|
7945
|
+
id: z45.string(),
|
|
7879
7946
|
name: NameFieldValue,
|
|
7880
|
-
role:
|
|
7947
|
+
role: z45.string()
|
|
7881
7948
|
})
|
|
7882
7949
|
}),
|
|
7883
7950
|
[TriggerEvent.RESEND_INVITE]: BasePayload.extend({
|
|
7884
|
-
username:
|
|
7885
|
-
temporaryPassword:
|
|
7951
|
+
username: z45.string(),
|
|
7952
|
+
temporaryPassword: z45.string()
|
|
7886
7953
|
}),
|
|
7887
7954
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
7888
|
-
code:
|
|
7955
|
+
code: z45.string()
|
|
7889
7956
|
}),
|
|
7890
7957
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
7891
|
-
subject:
|
|
7892
|
-
body:
|
|
7958
|
+
subject: z45.string(),
|
|
7959
|
+
body: z45.string()
|
|
7893
7960
|
}),
|
|
7894
7961
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
7895
|
-
code:
|
|
7962
|
+
code: z45.string()
|
|
7896
7963
|
}),
|
|
7897
7964
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
7898
|
-
code:
|
|
7965
|
+
code: z45.string()
|
|
7899
7966
|
})
|
|
7900
7967
|
};
|
|
7901
7968
|
async function triggerUserEventNotification({
|
|
@@ -7919,4 +7986,4 @@ function parseUserEventTrigger(event2, body) {
|
|
|
7919
7986
|
}
|
|
7920
7987
|
|
|
7921
7988
|
// src/notification/index.ts
|
|
7922
|
-
|
|
7989
|
+
z46.globalRegistry.clear();
|
package/dist/scopes/index.d.ts
CHANGED
|
@@ -397,6 +397,7 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
397
397
|
bypassratelimit: "bypassratelimit";
|
|
398
398
|
"config.update-all": "config.update-all";
|
|
399
399
|
"integration.create": "integration.create";
|
|
400
|
+
"location.edit": "location.edit";
|
|
400
401
|
"performance.read": "performance.read";
|
|
401
402
|
"performance.read-dashboards": "performance.read-dashboards";
|
|
402
403
|
"performance.vital-statistics-export": "performance.vital-statistics-export";
|
|
@@ -617,6 +618,7 @@ export declare const ScopeType: z.ZodEnum<{
|
|
|
617
618
|
"config.update-all": "config.update-all";
|
|
618
619
|
"dashboard.view": "dashboard.view";
|
|
619
620
|
"integration.create": "integration.create";
|
|
621
|
+
"location.edit": "location.edit";
|
|
620
622
|
"organisation.read-locations": "organisation.read-locations";
|
|
621
623
|
"performance.read": "performance.read";
|
|
622
624
|
"performance.read-dashboards": "performance.read-dashboards";
|
|
@@ -737,7 +739,7 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
|
737
739
|
accessLevel?: "administrativeArea" | "all" | "location" | undefined;
|
|
738
740
|
} | undefined;
|
|
739
741
|
} | {
|
|
740
|
-
type: "attachment.upload" | "bypassratelimit" | "config.update-all" | "integration.create" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.confirm-registration" | "record.import" | "record.reindex" | "record.reject-registration" | "user.data-seeding" | "user.read-only-my-audit";
|
|
742
|
+
type: "attachment.upload" | "bypassratelimit" | "config.update-all" | "integration.create" | "location.edit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.confirm-registration" | "record.import" | "record.reindex" | "record.reject-registration" | "user.data-seeding" | "user.read-only-my-audit";
|
|
741
743
|
} | {
|
|
742
744
|
type: "organisation.read-locations";
|
|
743
745
|
options?: {
|
package/dist/scopes/index.js
CHANGED
|
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.c3b24ba",
|
|
4
4
|
"description": "OpenCRVS toolkit for building country configurations",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "./build.sh",
|
|
21
|
-
"build:all": "lerna run build --include-dependencies --scope @opencrvs/toolkit
|
|
21
|
+
"build:all": "lerna run build --include-dependencies --scope @opencrvs/toolkit"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"ajv-formats": "^3.0.1",
|
|
34
34
|
"date-fns": "^2.28.0",
|
|
35
35
|
"dotenv": "^16.4.5",
|
|
36
|
-
"glob": "11.0
|
|
36
|
+
"glob": "11.1.0",
|
|
37
37
|
"handlebars": "^4.7.8",
|
|
38
38
|
"js-yaml": "4.1.0",
|
|
39
39
|
"jwt-decode": "^3.0.0",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"zod-openapi": "^5.4.6"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
+
"@opencrvs/commons": "^2.0.0",
|
|
54
55
|
"@opencrvs/events": "^2.0.0",
|
|
55
56
|
"@types/js-yaml": "4.0.9",
|
|
56
57
|
"@types/libsodium-wrappers": "^0.7.10",
|