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