@opencrvs/toolkit 1.9.12-rc.2bd27dc → 1.9.12-rc.8753d72
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/commons/api/router.d.ts +2 -2
- package/dist/commons/conditionals/validate.d.ts +8 -5
- package/dist/commons/events/ActionDocument.d.ts +1 -1
- package/dist/commons/events/AdvancedSearchConfig.d.ts +31 -25
- package/dist/commons/events/EventConfig.d.ts +22 -20
- package/dist/commons/events/EventIndex.d.ts +2 -2
- package/dist/commons/events/FieldConfig.d.ts +52 -17
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +22 -22
- package/dist/commons/events/FieldValue.d.ts +170 -7
- package/dist/commons/events/defineConfig.d.ts +2 -2
- package/dist/commons/events/utils.d.ts +140 -4
- package/dist/events/index.js +289 -164
- package/dist/notification/index.js +191 -178
- package/package.json +1 -1
|
@@ -243,6 +243,7 @@ var FieldType = {
|
|
|
243
243
|
PARAGRAPH: "PARAGRAPH",
|
|
244
244
|
PAGE_HEADER: "PAGE_HEADER",
|
|
245
245
|
RADIO_GROUP: "RADIO_GROUP",
|
|
246
|
+
FIELD_GROUP: "FIELD_GROUP",
|
|
246
247
|
FILE: "FILE",
|
|
247
248
|
FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS",
|
|
248
249
|
BULLET_LIST: "BULLET_LIST",
|
|
@@ -441,7 +442,7 @@ var VerificationStatusValue = import_zod8.z.enum([
|
|
|
441
442
|
"failed",
|
|
442
443
|
"pending"
|
|
443
444
|
]);
|
|
444
|
-
var
|
|
445
|
+
var LeafFieldValues = import_zod8.z.union([
|
|
445
446
|
AddressFieldValue,
|
|
446
447
|
TextValue,
|
|
447
448
|
PlainDate,
|
|
@@ -464,12 +465,15 @@ var FieldValuesWithoutDataField = import_zod8.z.union([
|
|
|
464
465
|
NumberWithUnitFieldValue,
|
|
465
466
|
NumberWithUnitFieldUpdateValue
|
|
466
467
|
]);
|
|
468
|
+
var FieldGroupValue = import_zod8.z.record(import_zod8.z.string(), LeafFieldValues);
|
|
467
469
|
var DataFieldValue = import_zod8.z.object({
|
|
468
|
-
data: import_zod8.z.record(import_zod8.z.string(),
|
|
470
|
+
data: import_zod8.z.record(import_zod8.z.string(), LeafFieldValues)
|
|
469
471
|
}).nullish();
|
|
470
|
-
var FieldValue = import_zod8.z.union(
|
|
471
|
-
|
|
472
|
-
|
|
472
|
+
var FieldValue = import_zod8.z.union([
|
|
473
|
+
LeafFieldValues,
|
|
474
|
+
DataFieldValue,
|
|
475
|
+
FieldGroupValue
|
|
476
|
+
]);
|
|
473
477
|
var PRIORITY_ORDER = [
|
|
474
478
|
"NameFieldUpdateValue",
|
|
475
479
|
"DateRangeFieldValue",
|
|
@@ -484,7 +488,8 @@ var PRIORITY_ORDER = [
|
|
|
484
488
|
"NumberWithUnitFieldUpdateValue",
|
|
485
489
|
"FileFieldValue",
|
|
486
490
|
"FileFieldWithOptionValue",
|
|
487
|
-
"DataFieldValue"
|
|
491
|
+
"DataFieldValue",
|
|
492
|
+
"GroupFieldValue"
|
|
488
493
|
];
|
|
489
494
|
function schemaPriority(schema) {
|
|
490
495
|
const name = schema._def?.description;
|
|
@@ -519,6 +524,7 @@ var FieldUpdateValue = safeUnion([
|
|
|
519
524
|
FileFieldValue.describe("FileFieldValue"),
|
|
520
525
|
FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
|
|
521
526
|
DataFieldValue.describe("DataFieldValue"),
|
|
527
|
+
FieldGroupValue.describe("GroupFieldValue"),
|
|
522
528
|
NameFieldUpdateValue.describe("NameFieldUpdateValue"),
|
|
523
529
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
524
530
|
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
@@ -1793,14 +1799,12 @@ var AdministrativeAreas = import_zod17.z.enum([
|
|
|
1793
1799
|
"CRVS_OFFICE"
|
|
1794
1800
|
]);
|
|
1795
1801
|
var AdministrativeAreaConfiguration = import_zod17.z.object({
|
|
1796
|
-
partOf:
|
|
1797
|
-
$declaration: import_zod17.z.string()
|
|
1798
|
-
}).optional().describe("Parent location"),
|
|
1802
|
+
partOf: FieldReference.optional(),
|
|
1799
1803
|
type: AdministrativeAreas
|
|
1800
1804
|
}).describe("Administrative area options");
|
|
1801
1805
|
var AdministrativeArea = BaseField.extend({
|
|
1802
1806
|
type: import_zod17.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1803
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1807
|
+
defaultValue: import_zod17.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1804
1808
|
configuration: AdministrativeAreaConfiguration
|
|
1805
1809
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1806
1810
|
var LocationInput = BaseField.extend({
|
|
@@ -1880,6 +1884,11 @@ var ButtonField = BaseField.extend({
|
|
|
1880
1884
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1881
1885
|
})
|
|
1882
1886
|
}).describe("Generic button without any built-in functionality");
|
|
1887
|
+
var FieldGroup = BaseField.extend({
|
|
1888
|
+
type: import_zod17.z.literal(FieldType.FIELD_GROUP),
|
|
1889
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1890
|
+
fields: import_zod17.z.lazy(() => import_zod17.z.array(FieldConfig))
|
|
1891
|
+
});
|
|
1883
1892
|
var AlphaPrintButton = BaseField.extend({
|
|
1884
1893
|
type: import_zod17.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1885
1894
|
configuration: import_zod17.z.object({
|
|
@@ -1987,6 +1996,7 @@ var LoaderField = BaseField.extend({
|
|
|
1987
1996
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1988
1997
|
);
|
|
1989
1998
|
var FieldConfig = import_zod17.z.discriminatedUnion("type", [
|
|
1999
|
+
FieldGroup,
|
|
1990
2000
|
Address,
|
|
1991
2001
|
TextField,
|
|
1992
2002
|
NumberField,
|
|
@@ -2334,7 +2344,7 @@ var LanguageConfig = import_zod23.z.object({
|
|
|
2334
2344
|
});
|
|
2335
2345
|
|
|
2336
2346
|
// ../commons/src/events/EventConfig.ts
|
|
2337
|
-
var
|
|
2347
|
+
var import_zod29 = require("zod");
|
|
2338
2348
|
|
|
2339
2349
|
// ../commons/src/events/SummaryConfig.ts
|
|
2340
2350
|
var import_zod24 = require("zod");
|
|
@@ -2491,9 +2501,12 @@ var import_lodash = require("lodash");
|
|
|
2491
2501
|
// ../commons/src/conditionals/validate.ts
|
|
2492
2502
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2493
2503
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2494
|
-
var
|
|
2504
|
+
var import_zod28 = require("zod");
|
|
2495
2505
|
var import_date_fns = require("date-fns");
|
|
2496
2506
|
|
|
2507
|
+
// ../commons/src/events/FieldTypeMapping.ts
|
|
2508
|
+
var import_zod27 = require("zod");
|
|
2509
|
+
|
|
2497
2510
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2498
2511
|
var import_zod26 = require("zod");
|
|
2499
2512
|
|
|
@@ -2504,9 +2517,9 @@ var ajv = new import__.default({
|
|
|
2504
2517
|
strict: false
|
|
2505
2518
|
// Allow minContains and other newer features
|
|
2506
2519
|
});
|
|
2507
|
-
var DataContext =
|
|
2508
|
-
rootData:
|
|
2509
|
-
$leafAdminStructureLocationIds:
|
|
2520
|
+
var DataContext = import_zod28.z.object({
|
|
2521
|
+
rootData: import_zod28.z.object({
|
|
2522
|
+
$leafAdminStructureLocationIds: import_zod28.z.array(import_zod28.z.object({ id: UUID }))
|
|
2510
2523
|
})
|
|
2511
2524
|
});
|
|
2512
2525
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2583,13 +2596,13 @@ ajv.addKeyword({
|
|
|
2583
2596
|
});
|
|
2584
2597
|
|
|
2585
2598
|
// ../commons/src/utils.ts
|
|
2586
|
-
var
|
|
2599
|
+
var z29 = __toESM(require("zod"));
|
|
2587
2600
|
var _ = __toESM(require("lodash"));
|
|
2588
|
-
var FullNameV1 =
|
|
2589
|
-
|
|
2590
|
-
use:
|
|
2591
|
-
family:
|
|
2592
|
-
given:
|
|
2601
|
+
var FullNameV1 = z29.array(
|
|
2602
|
+
z29.object({
|
|
2603
|
+
use: z29.string(),
|
|
2604
|
+
family: z29.string(),
|
|
2605
|
+
given: z29.array(z29.string())
|
|
2593
2606
|
})
|
|
2594
2607
|
);
|
|
2595
2608
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -3208,12 +3221,12 @@ function createFieldConditionals(fieldId) {
|
|
|
3208
3221
|
}
|
|
3209
3222
|
|
|
3210
3223
|
// ../commons/src/events/EventConfig.ts
|
|
3211
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(
|
|
3212
|
-
var EventFieldReference =
|
|
3224
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod29.z);
|
|
3225
|
+
var EventFieldReference = import_zod29.z.object({ $$event: EventMetadataDateFieldIdInput }).describe(
|
|
3213
3226
|
"Reference to a field defined in the event metadata, using the field id."
|
|
3214
3227
|
);
|
|
3215
|
-
var EventConfig =
|
|
3216
|
-
id:
|
|
3228
|
+
var EventConfig = import_zod29.z.object({
|
|
3229
|
+
id: import_zod29.z.string().describe(
|
|
3217
3230
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
3218
3231
|
),
|
|
3219
3232
|
dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
|
|
@@ -3231,13 +3244,13 @@ var EventConfig = import_zod28.z.object({
|
|
|
3231
3244
|
label: TranslationConfig.describe(
|
|
3232
3245
|
"Human-readable label for the event type."
|
|
3233
3246
|
),
|
|
3234
|
-
actions:
|
|
3247
|
+
actions: import_zod29.z.array(ActionConfig).describe(
|
|
3235
3248
|
"Configuration of system-defined actions associated with the event."
|
|
3236
3249
|
),
|
|
3237
3250
|
declaration: DeclarationFormConfig.describe(
|
|
3238
3251
|
"Configuration of the form used to gather event data."
|
|
3239
3252
|
),
|
|
3240
|
-
advancedSearch:
|
|
3253
|
+
advancedSearch: import_zod29.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
3241
3254
|
"Configuration of fields available in the advanced search feature."
|
|
3242
3255
|
)
|
|
3243
3256
|
}).superRefine((event2, ctx) => {
|
|
@@ -3301,7 +3314,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
3301
3314
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
3302
3315
|
|
|
3303
3316
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
3304
|
-
var
|
|
3317
|
+
var import_zod33 = require("zod");
|
|
3305
3318
|
|
|
3306
3319
|
// ../commons/src/searchConfigs.ts
|
|
3307
3320
|
function createSearchConfig(baseField) {
|
|
@@ -3502,17 +3515,17 @@ var event = Object.assign(eventFn, {
|
|
|
3502
3515
|
});
|
|
3503
3516
|
|
|
3504
3517
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3505
|
-
var
|
|
3518
|
+
var import_zod30 = require("zod");
|
|
3506
3519
|
var WorkqueueColumnKeysArray = [
|
|
3507
3520
|
...EventMetadataKeysArray,
|
|
3508
3521
|
"title",
|
|
3509
3522
|
"outbox"
|
|
3510
3523
|
];
|
|
3511
|
-
var WorkqueueColumnKeys =
|
|
3512
|
-
var WorkqueueColumnValue =
|
|
3524
|
+
var WorkqueueColumnKeys = import_zod30.z.enum(WorkqueueColumnKeysArray);
|
|
3525
|
+
var WorkqueueColumnValue = import_zod30.z.object({
|
|
3513
3526
|
$event: WorkqueueColumnKeys
|
|
3514
3527
|
});
|
|
3515
|
-
var WorkqueueColumn =
|
|
3528
|
+
var WorkqueueColumn = import_zod30.z.object({
|
|
3516
3529
|
label: TranslationConfig,
|
|
3517
3530
|
value: WorkqueueColumnValue
|
|
3518
3531
|
});
|
|
@@ -3523,58 +3536,58 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3523
3536
|
}
|
|
3524
3537
|
|
|
3525
3538
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3526
|
-
var
|
|
3527
|
-
var SerializableExact =
|
|
3528
|
-
type:
|
|
3529
|
-
term:
|
|
3539
|
+
var import_zod31 = require("zod");
|
|
3540
|
+
var SerializableExact = import_zod31.z.object({
|
|
3541
|
+
type: import_zod31.z.literal("exact"),
|
|
3542
|
+
term: import_zod31.z.union([import_zod31.z.string(), SerializedUserField])
|
|
3530
3543
|
});
|
|
3531
|
-
var SerializableWithin =
|
|
3532
|
-
type:
|
|
3533
|
-
location:
|
|
3544
|
+
var SerializableWithin = import_zod31.z.object({
|
|
3545
|
+
type: import_zod31.z.literal("within"),
|
|
3546
|
+
location: import_zod31.z.union([import_zod31.z.string(), SerializedUserField])
|
|
3534
3547
|
});
|
|
3535
|
-
var SerializedQueryExpression =
|
|
3536
|
-
eventType:
|
|
3537
|
-
status:
|
|
3538
|
-
createdAt:
|
|
3539
|
-
updatedAt:
|
|
3540
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3541
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3542
|
-
|
|
3548
|
+
var SerializedQueryExpression = import_zod31.z.object({
|
|
3549
|
+
eventType: import_zod31.z.string(),
|
|
3550
|
+
status: import_zod31.z.optional(import_zod31.z.union([AnyOfStatus, ExactStatus])),
|
|
3551
|
+
createdAt: import_zod31.z.optional(DateCondition),
|
|
3552
|
+
updatedAt: import_zod31.z.optional(DateCondition),
|
|
3553
|
+
"legalStatuses.REGISTERED.createdAt": import_zod31.z.optional(DateCondition),
|
|
3554
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod31.z.optional(
|
|
3555
|
+
import_zod31.z.union([Within, Exact])
|
|
3543
3556
|
),
|
|
3544
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3545
|
-
createdAtLocation:
|
|
3546
|
-
|
|
3557
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod31.z.optional(Exact),
|
|
3558
|
+
createdAtLocation: import_zod31.z.optional(
|
|
3559
|
+
import_zod31.z.union([SerializableWithin, SerializableExact])
|
|
3547
3560
|
),
|
|
3548
|
-
updatedAtLocation:
|
|
3549
|
-
|
|
3561
|
+
updatedAtLocation: import_zod31.z.optional(
|
|
3562
|
+
import_zod31.z.union([SerializableWithin, SerializableExact])
|
|
3550
3563
|
),
|
|
3551
|
-
updatedByUserRole:
|
|
3552
|
-
assignedTo:
|
|
3553
|
-
createdBy:
|
|
3564
|
+
updatedByUserRole: import_zod31.z.optional(SerializableExact),
|
|
3565
|
+
assignedTo: import_zod31.z.optional(SerializableExact),
|
|
3566
|
+
createdBy: import_zod31.z.optional(SerializableExact),
|
|
3554
3567
|
createdByUserType: ExactUserType,
|
|
3555
|
-
updatedBy:
|
|
3556
|
-
trackingId:
|
|
3557
|
-
flags:
|
|
3568
|
+
updatedBy: import_zod31.z.optional(SerializableExact),
|
|
3569
|
+
trackingId: import_zod31.z.optional(Exact),
|
|
3570
|
+
flags: import_zod31.z.optional(ContainsFlags),
|
|
3558
3571
|
data: QueryInput
|
|
3559
3572
|
}).partial();
|
|
3560
|
-
var Or2 =
|
|
3561
|
-
type:
|
|
3562
|
-
clauses:
|
|
3573
|
+
var Or2 = import_zod31.z.object({
|
|
3574
|
+
type: import_zod31.z.literal("or"),
|
|
3575
|
+
clauses: import_zod31.z.array(SerializedQueryExpression)
|
|
3563
3576
|
});
|
|
3564
|
-
var And2 =
|
|
3565
|
-
type:
|
|
3566
|
-
clauses:
|
|
3577
|
+
var And2 = import_zod31.z.object({
|
|
3578
|
+
type: import_zod31.z.literal("and"),
|
|
3579
|
+
clauses: import_zod31.z.array(SerializedQueryExpression)
|
|
3567
3580
|
});
|
|
3568
|
-
var CountryConfigQueryType =
|
|
3569
|
-
var CountryConfigQueryInputType =
|
|
3581
|
+
var CountryConfigQueryType = import_zod31.z.discriminatedUnion("type", [And2, Or2]);
|
|
3582
|
+
var CountryConfigQueryInputType = import_zod31.z.union([
|
|
3570
3583
|
SerializedQueryExpression,
|
|
3571
3584
|
And2,
|
|
3572
3585
|
Or2
|
|
3573
3586
|
]);
|
|
3574
3587
|
|
|
3575
3588
|
// ../commons/src/icons.ts
|
|
3576
|
-
var
|
|
3577
|
-
var AvailableIcons =
|
|
3589
|
+
var import_zod32 = require("zod");
|
|
3590
|
+
var AvailableIcons = import_zod32.z.enum([
|
|
3578
3591
|
"Archived",
|
|
3579
3592
|
"Assigned",
|
|
3580
3593
|
"Certified",
|
|
@@ -3695,23 +3708,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3695
3708
|
value: event.field("updatedAt")
|
|
3696
3709
|
}
|
|
3697
3710
|
]);
|
|
3698
|
-
var WorkqueueActionsWithDefault =
|
|
3711
|
+
var WorkqueueActionsWithDefault = import_zod33.z.enum([
|
|
3699
3712
|
...workqueueActions.options,
|
|
3700
3713
|
"DEFAULT"
|
|
3701
3714
|
]);
|
|
3702
|
-
var WorkqueueConfig =
|
|
3703
|
-
slug:
|
|
3715
|
+
var WorkqueueConfig = import_zod33.z.object({
|
|
3716
|
+
slug: import_zod33.z.string().describe("Determines the url of the workqueue."),
|
|
3704
3717
|
name: TranslationConfig.describe(
|
|
3705
3718
|
"Title of the workflow (both in navigation and on the page)"
|
|
3706
3719
|
),
|
|
3707
3720
|
query: CountryConfigQueryType,
|
|
3708
|
-
actions:
|
|
3709
|
-
|
|
3721
|
+
actions: import_zod33.z.array(
|
|
3722
|
+
import_zod33.z.object({
|
|
3710
3723
|
type: WorkqueueActionsWithDefault,
|
|
3711
|
-
conditionals:
|
|
3724
|
+
conditionals: import_zod33.z.array(Conditional).optional()
|
|
3712
3725
|
})
|
|
3713
3726
|
),
|
|
3714
|
-
columns:
|
|
3727
|
+
columns: import_zod33.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3715
3728
|
icon: AvailableIcons,
|
|
3716
3729
|
emptyMessage: TranslationConfig.optional()
|
|
3717
3730
|
}).describe("Configuration for workqueue.");
|
|
@@ -3719,26 +3732,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3719
3732
|
query: true,
|
|
3720
3733
|
columns: true
|
|
3721
3734
|
});
|
|
3722
|
-
var WorkqueueConfigInput =
|
|
3723
|
-
slug:
|
|
3735
|
+
var WorkqueueConfigInput = import_zod33.z.object({
|
|
3736
|
+
slug: import_zod33.z.string().describe("Determines the url of the workqueue."),
|
|
3724
3737
|
name: TranslationConfig.describe(
|
|
3725
3738
|
"Title of the workflow (both in navigation and on the page)"
|
|
3726
3739
|
),
|
|
3727
3740
|
query: CountryConfigQueryInputType,
|
|
3728
|
-
actions:
|
|
3729
|
-
|
|
3741
|
+
actions: import_zod33.z.array(
|
|
3742
|
+
import_zod33.z.object({
|
|
3730
3743
|
type: WorkqueueActionsWithDefault,
|
|
3731
|
-
conditionals:
|
|
3744
|
+
conditionals: import_zod33.z.array(Conditional).optional()
|
|
3732
3745
|
})
|
|
3733
3746
|
),
|
|
3734
|
-
columns:
|
|
3747
|
+
columns: import_zod33.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3735
3748
|
icon: AvailableIcons,
|
|
3736
3749
|
emptyMessage: TranslationConfig.optional()
|
|
3737
3750
|
});
|
|
3738
|
-
var WorkqueueCountInput =
|
|
3739
|
-
|
|
3751
|
+
var WorkqueueCountInput = import_zod33.z.array(
|
|
3752
|
+
import_zod33.z.object({ slug: import_zod33.z.string(), query: QueryType })
|
|
3740
3753
|
);
|
|
3741
|
-
var WorkqueueCountOutput =
|
|
3754
|
+
var WorkqueueCountOutput = import_zod33.z.record(import_zod33.z.string(), import_zod33.z.number());
|
|
3742
3755
|
|
|
3743
3756
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3744
3757
|
var defaultWorkqueueColumns = [
|
|
@@ -3761,45 +3774,45 @@ var defaultWorkqueueColumns = [
|
|
|
3761
3774
|
];
|
|
3762
3775
|
|
|
3763
3776
|
// ../commons/src/events/Draft.ts
|
|
3764
|
-
var
|
|
3777
|
+
var import_zod35 = require("zod");
|
|
3765
3778
|
|
|
3766
3779
|
// ../commons/src/events/ActionInput.ts
|
|
3767
|
-
var
|
|
3780
|
+
var import_zod34 = require("zod");
|
|
3768
3781
|
var import_zod_openapi11 = require("zod-openapi");
|
|
3769
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(
|
|
3770
|
-
var BaseActionInput =
|
|
3782
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod34.z);
|
|
3783
|
+
var BaseActionInput = import_zod34.z.object({
|
|
3771
3784
|
eventId: UUID,
|
|
3772
|
-
transactionId:
|
|
3785
|
+
transactionId: import_zod34.z.string(),
|
|
3773
3786
|
declaration: ActionUpdate.default({}),
|
|
3774
3787
|
annotation: ActionUpdate.optional(),
|
|
3775
3788
|
originalActionId: UUID.optional(),
|
|
3776
3789
|
// should not be part of base action.
|
|
3777
|
-
keepAssignment:
|
|
3790
|
+
keepAssignment: import_zod34.z.boolean().optional(),
|
|
3778
3791
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3779
3792
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3780
3793
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
3781
3794
|
)
|
|
3782
3795
|
});
|
|
3783
3796
|
var CreateActionInput = BaseActionInput.merge(
|
|
3784
|
-
|
|
3785
|
-
type:
|
|
3797
|
+
import_zod34.z.object({
|
|
3798
|
+
type: import_zod34.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3786
3799
|
createdAtLocation: CreatedAtLocation
|
|
3787
3800
|
})
|
|
3788
3801
|
);
|
|
3789
3802
|
var RegisterActionInput = BaseActionInput.merge(
|
|
3790
|
-
|
|
3791
|
-
type:
|
|
3792
|
-
registrationNumber:
|
|
3803
|
+
import_zod34.z.object({
|
|
3804
|
+
type: import_zod34.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3805
|
+
registrationNumber: import_zod34.z.string().optional()
|
|
3793
3806
|
})
|
|
3794
3807
|
).strict();
|
|
3795
3808
|
var ValidateActionInput = BaseActionInput.merge(
|
|
3796
|
-
|
|
3797
|
-
type:
|
|
3809
|
+
import_zod34.z.object({
|
|
3810
|
+
type: import_zod34.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3798
3811
|
})
|
|
3799
3812
|
);
|
|
3800
3813
|
var NotifyActionInput = BaseActionInput.merge(
|
|
3801
|
-
|
|
3802
|
-
type:
|
|
3814
|
+
import_zod34.z.object({
|
|
3815
|
+
type: import_zod34.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3803
3816
|
})
|
|
3804
3817
|
).openapi({
|
|
3805
3818
|
default: {
|
|
@@ -3811,86 +3824,86 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
3811
3824
|
}
|
|
3812
3825
|
});
|
|
3813
3826
|
var DeclareActionInput = BaseActionInput.merge(
|
|
3814
|
-
|
|
3815
|
-
type:
|
|
3827
|
+
import_zod34.z.object({
|
|
3828
|
+
type: import_zod34.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3816
3829
|
})
|
|
3817
3830
|
);
|
|
3818
3831
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3819
|
-
|
|
3820
|
-
type:
|
|
3832
|
+
import_zod34.z.object({
|
|
3833
|
+
type: import_zod34.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3821
3834
|
content: PrintContent.optional()
|
|
3822
3835
|
})
|
|
3823
3836
|
);
|
|
3824
3837
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3825
|
-
|
|
3826
|
-
type:
|
|
3838
|
+
import_zod34.z.object({
|
|
3839
|
+
type: import_zod34.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3827
3840
|
content: ReasonContent
|
|
3828
3841
|
})
|
|
3829
3842
|
);
|
|
3830
3843
|
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3831
|
-
|
|
3832
|
-
type:
|
|
3833
|
-
content:
|
|
3834
|
-
duplicates:
|
|
3844
|
+
import_zod34.z.object({
|
|
3845
|
+
type: import_zod34.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3846
|
+
content: import_zod34.z.object({
|
|
3847
|
+
duplicates: import_zod34.z.array(PotentialDuplicate)
|
|
3835
3848
|
})
|
|
3836
3849
|
})
|
|
3837
3850
|
);
|
|
3838
3851
|
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3839
|
-
|
|
3840
|
-
type:
|
|
3841
|
-
content:
|
|
3852
|
+
import_zod34.z.object({
|
|
3853
|
+
type: import_zod34.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3854
|
+
content: import_zod34.z.object({
|
|
3842
3855
|
duplicateOf: UUID
|
|
3843
3856
|
}).optional()
|
|
3844
3857
|
})
|
|
3845
3858
|
);
|
|
3846
3859
|
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3847
|
-
|
|
3848
|
-
type:
|
|
3860
|
+
import_zod34.z.object({
|
|
3861
|
+
type: import_zod34.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3849
3862
|
})
|
|
3850
3863
|
);
|
|
3851
3864
|
var ArchiveActionInput = BaseActionInput.merge(
|
|
3852
|
-
|
|
3853
|
-
type:
|
|
3865
|
+
import_zod34.z.object({
|
|
3866
|
+
type: import_zod34.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3854
3867
|
content: ReasonContent
|
|
3855
3868
|
})
|
|
3856
3869
|
);
|
|
3857
3870
|
var AssignActionInput = BaseActionInput.merge(
|
|
3858
|
-
|
|
3859
|
-
type:
|
|
3860
|
-
assignedTo:
|
|
3871
|
+
import_zod34.z.object({
|
|
3872
|
+
type: import_zod34.z.literal(ActionType.ASSIGN),
|
|
3873
|
+
assignedTo: import_zod34.z.string()
|
|
3861
3874
|
})
|
|
3862
3875
|
);
|
|
3863
3876
|
var UnassignActionInput = BaseActionInput.merge(
|
|
3864
|
-
|
|
3865
|
-
type:
|
|
3866
|
-
assignedTo:
|
|
3877
|
+
import_zod34.z.object({
|
|
3878
|
+
type: import_zod34.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3879
|
+
assignedTo: import_zod34.z.literal(null).default(null)
|
|
3867
3880
|
})
|
|
3868
3881
|
);
|
|
3869
3882
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3870
|
-
|
|
3871
|
-
type:
|
|
3883
|
+
import_zod34.z.object({
|
|
3884
|
+
type: import_zod34.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3872
3885
|
})
|
|
3873
3886
|
);
|
|
3874
3887
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3875
|
-
|
|
3876
|
-
requestId:
|
|
3877
|
-
type:
|
|
3888
|
+
import_zod34.z.object({
|
|
3889
|
+
requestId: import_zod34.z.string(),
|
|
3890
|
+
type: import_zod34.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3878
3891
|
content: ReasonContent
|
|
3879
3892
|
})
|
|
3880
3893
|
);
|
|
3881
3894
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3882
|
-
|
|
3883
|
-
requestId:
|
|
3884
|
-
type:
|
|
3895
|
+
import_zod34.z.object({
|
|
3896
|
+
requestId: import_zod34.z.string(),
|
|
3897
|
+
type: import_zod34.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3885
3898
|
})
|
|
3886
3899
|
);
|
|
3887
3900
|
var ReadActionInput = BaseActionInput.merge(
|
|
3888
|
-
|
|
3889
|
-
type:
|
|
3901
|
+
import_zod34.z.object({
|
|
3902
|
+
type: import_zod34.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3890
3903
|
})
|
|
3891
3904
|
);
|
|
3892
|
-
var DeleteActionInput =
|
|
3893
|
-
var ActionInput =
|
|
3905
|
+
var DeleteActionInput = import_zod34.z.object({ eventId: UUID });
|
|
3906
|
+
var ActionInput = import_zod34.z.discriminatedUnion("type", [
|
|
3894
3907
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3895
3908
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3896
3909
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
@@ -3925,11 +3938,11 @@ var ActionInput = import_zod33.z.discriminatedUnion("type", [
|
|
|
3925
3938
|
});
|
|
3926
3939
|
|
|
3927
3940
|
// ../commons/src/events/Draft.ts
|
|
3928
|
-
var Draft =
|
|
3941
|
+
var Draft = import_zod35.z.object({
|
|
3929
3942
|
id: UUID,
|
|
3930
3943
|
eventId: UUID,
|
|
3931
|
-
transactionId:
|
|
3932
|
-
createdAt:
|
|
3944
|
+
transactionId: import_zod35.z.string(),
|
|
3945
|
+
createdAt: import_zod35.z.string().datetime(),
|
|
3933
3946
|
action: ActionBase.extend({
|
|
3934
3947
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
3935
3948
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -3938,7 +3951,7 @@ var Draft = import_zod34.z.object({
|
|
|
3938
3951
|
);
|
|
3939
3952
|
var DraftInput = BaseActionInput.extend({
|
|
3940
3953
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3941
|
-
status:
|
|
3954
|
+
status: import_zod35.z.enum([
|
|
3942
3955
|
ActionStatus.Requested,
|
|
3943
3956
|
ActionStatus.Accepted,
|
|
3944
3957
|
ActionStatus.Rejected
|
|
@@ -3946,26 +3959,26 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3946
3959
|
});
|
|
3947
3960
|
|
|
3948
3961
|
// ../commons/src/events/EventInput.ts
|
|
3949
|
-
var
|
|
3962
|
+
var import_zod36 = require("zod");
|
|
3950
3963
|
var import_uuid10 = require("uuid");
|
|
3951
|
-
var EventInput =
|
|
3952
|
-
transactionId:
|
|
3953
|
-
type:
|
|
3964
|
+
var EventInput = import_zod36.z.object({
|
|
3965
|
+
transactionId: import_zod36.z.string(),
|
|
3966
|
+
type: import_zod36.z.string()
|
|
3954
3967
|
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3955
3968
|
|
|
3956
3969
|
// ../commons/src/events/EventDocument.ts
|
|
3957
|
-
var
|
|
3970
|
+
var import_zod37 = require("zod");
|
|
3958
3971
|
var import_zod_openapi12 = require("zod-openapi");
|
|
3959
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(
|
|
3960
|
-
var EventDocument =
|
|
3972
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod37.z);
|
|
3973
|
+
var EventDocument = import_zod37.z.object({
|
|
3961
3974
|
id: UUID.describe("Unique identifier of the event."),
|
|
3962
|
-
type:
|
|
3963
|
-
createdAt:
|
|
3964
|
-
updatedAt:
|
|
3975
|
+
type: import_zod37.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3976
|
+
createdAt: import_zod37.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3977
|
+
updatedAt: import_zod37.z.string().datetime().describe(
|
|
3965
3978
|
"Timestamp of the last update, excluding changes from actions."
|
|
3966
3979
|
),
|
|
3967
|
-
actions:
|
|
3968
|
-
trackingId:
|
|
3980
|
+
actions: import_zod37.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3981
|
+
trackingId: import_zod37.z.string().describe(
|
|
3969
3982
|
"System-generated tracking identifier used to look up the event."
|
|
3970
3983
|
)
|
|
3971
3984
|
}).openapi({ ref: "EventDocument" });
|
|
@@ -6476,8 +6489,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6476
6489
|
});
|
|
6477
6490
|
|
|
6478
6491
|
// ../commons/src/events/test.utils.ts
|
|
6479
|
-
var
|
|
6480
|
-
var TestUserRole =
|
|
6492
|
+
var import_zod38 = require("zod");
|
|
6493
|
+
var TestUserRole = import_zod38.z.enum([
|
|
6481
6494
|
"FIELD_AGENT",
|
|
6482
6495
|
"LOCAL_REGISTRAR",
|
|
6483
6496
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6580,22 +6593,22 @@ var ACTION_FILTERS = {
|
|
|
6580
6593
|
var import_lodash6 = require("lodash");
|
|
6581
6594
|
|
|
6582
6595
|
// ../commons/src/events/locations.ts
|
|
6583
|
-
var
|
|
6584
|
-
var LocationType =
|
|
6596
|
+
var import_zod39 = require("zod");
|
|
6597
|
+
var LocationType = import_zod39.z.enum([
|
|
6585
6598
|
"ADMIN_STRUCTURE",
|
|
6586
6599
|
"CRVS_OFFICE",
|
|
6587
6600
|
"HEALTH_FACILITY"
|
|
6588
6601
|
]);
|
|
6589
|
-
var Location =
|
|
6602
|
+
var Location = import_zod39.z.object({
|
|
6590
6603
|
id: UUID,
|
|
6591
|
-
name:
|
|
6604
|
+
name: import_zod39.z.string(),
|
|
6592
6605
|
parentId: UUID.nullable(),
|
|
6593
|
-
validUntil:
|
|
6606
|
+
validUntil: import_zod39.z.string().datetime().nullable(),
|
|
6594
6607
|
locationType: LocationType.nullable()
|
|
6595
6608
|
});
|
|
6596
6609
|
|
|
6597
6610
|
// ../commons/src/notification/UserNotifications.ts
|
|
6598
|
-
var
|
|
6611
|
+
var import_zod40 = require("zod");
|
|
6599
6612
|
var TriggerEvent = {
|
|
6600
6613
|
USER_CREATED: "user-created",
|
|
6601
6614
|
USER_UPDATED: "user-updated",
|
|
@@ -6607,50 +6620,50 @@ var TriggerEvent = {
|
|
|
6607
6620
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6608
6621
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6609
6622
|
};
|
|
6610
|
-
var Recipient =
|
|
6623
|
+
var Recipient = import_zod40.z.object({
|
|
6611
6624
|
name: NameFieldValue.optional(),
|
|
6612
|
-
mobile:
|
|
6613
|
-
email:
|
|
6614
|
-
bcc:
|
|
6625
|
+
mobile: import_zod40.z.string().optional(),
|
|
6626
|
+
email: import_zod40.z.string().optional(),
|
|
6627
|
+
bcc: import_zod40.z.array(import_zod40.z.string()).optional()
|
|
6615
6628
|
});
|
|
6616
|
-
var BasePayload =
|
|
6629
|
+
var BasePayload = import_zod40.z.object({
|
|
6617
6630
|
recipient: Recipient
|
|
6618
6631
|
});
|
|
6619
6632
|
var TriggerPayload = {
|
|
6620
6633
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6621
|
-
username:
|
|
6622
|
-
temporaryPassword:
|
|
6634
|
+
username: import_zod40.z.string(),
|
|
6635
|
+
temporaryPassword: import_zod40.z.string()
|
|
6623
6636
|
}),
|
|
6624
6637
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6625
|
-
oldUsername:
|
|
6626
|
-
newUsername:
|
|
6638
|
+
oldUsername: import_zod40.z.string(),
|
|
6639
|
+
newUsername: import_zod40.z.string()
|
|
6627
6640
|
}),
|
|
6628
6641
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6629
|
-
username:
|
|
6642
|
+
username: import_zod40.z.string()
|
|
6630
6643
|
}),
|
|
6631
6644
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6632
|
-
code:
|
|
6645
|
+
code: import_zod40.z.string()
|
|
6633
6646
|
}),
|
|
6634
6647
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6635
|
-
temporaryPassword:
|
|
6636
|
-
admin:
|
|
6637
|
-
id:
|
|
6648
|
+
temporaryPassword: import_zod40.z.string(),
|
|
6649
|
+
admin: import_zod40.z.object({
|
|
6650
|
+
id: import_zod40.z.string(),
|
|
6638
6651
|
name: NameFieldValue,
|
|
6639
|
-
role:
|
|
6652
|
+
role: import_zod40.z.string()
|
|
6640
6653
|
})
|
|
6641
6654
|
}),
|
|
6642
6655
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6643
|
-
code:
|
|
6656
|
+
code: import_zod40.z.string()
|
|
6644
6657
|
}),
|
|
6645
6658
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6646
|
-
subject:
|
|
6647
|
-
body:
|
|
6659
|
+
subject: import_zod40.z.string(),
|
|
6660
|
+
body: import_zod40.z.string()
|
|
6648
6661
|
}),
|
|
6649
6662
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6650
|
-
code:
|
|
6663
|
+
code: import_zod40.z.string()
|
|
6651
6664
|
}),
|
|
6652
6665
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6653
|
-
code:
|
|
6666
|
+
code: import_zod40.z.string()
|
|
6654
6667
|
})
|
|
6655
6668
|
};
|
|
6656
6669
|
async function triggerUserEventNotification({
|