@nira-opencrvs/toolkit 1.9.13-rc.cdfd84c → 1.9.13-rc.ce5957d
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 +8 -7
- package/dist/commons/events/ActionConfig.d.ts +36 -36
- package/dist/commons/events/AdvancedSearchConfig.d.ts +30 -24
- package/dist/commons/events/DeduplicationConfig.d.ts +2 -2
- package/dist/commons/events/EventConfig.d.ts +50 -48
- package/dist/commons/events/EventIndex.d.ts +3 -0
- package/dist/commons/events/FieldConfig.d.ts +381 -132
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +87 -1
- package/dist/commons/events/FieldValue.d.ts +70 -3
- package/dist/commons/events/Icd11.d.ts +52 -0
- package/dist/commons/events/defineConfig.d.ts +7 -7
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/utils.d.ts +7 -7
- package/dist/events/index.js +873 -779
- package/dist/notification/index.js +840 -798
- package/package.json +1 -1
|
@@ -50,7 +50,7 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
|
50
50
|
var BIRTH_EVENT = "birth";
|
|
51
51
|
|
|
52
52
|
// ../commons/src/events/ActionConfig.ts
|
|
53
|
-
var
|
|
53
|
+
var import_zod22 = require("zod");
|
|
54
54
|
|
|
55
55
|
// ../commons/src/events/TranslationConfig.ts
|
|
56
56
|
var import_zod = require("zod");
|
|
@@ -173,7 +173,7 @@ var META_ACTIONS = [
|
|
|
173
173
|
];
|
|
174
174
|
|
|
175
175
|
// ../commons/src/events/FieldConfig.ts
|
|
176
|
-
var
|
|
176
|
+
var import_zod18 = require("zod");
|
|
177
177
|
|
|
178
178
|
// ../commons/src/events/Conditional.ts
|
|
179
179
|
var import_zod3 = require("zod");
|
|
@@ -269,7 +269,8 @@ var FieldType = {
|
|
|
269
269
|
QUERY_PARAM_READER: "QUERY_PARAM_READER",
|
|
270
270
|
QR_READER: "QR_READER",
|
|
271
271
|
ID_READER: "ID_READER",
|
|
272
|
-
LOADER: "LOADER"
|
|
272
|
+
LOADER: "LOADER",
|
|
273
|
+
ICD11: "ICD11"
|
|
273
274
|
};
|
|
274
275
|
var FileFieldType = import_zod4.z.enum([
|
|
275
276
|
FieldType.FILE,
|
|
@@ -299,7 +300,7 @@ var FieldTypesToHideInReview = [
|
|
|
299
300
|
];
|
|
300
301
|
|
|
301
302
|
// ../commons/src/events/FieldValue.ts
|
|
302
|
-
var
|
|
303
|
+
var import_zod9 = require("zod");
|
|
303
304
|
|
|
304
305
|
// ../commons/src/documents.ts
|
|
305
306
|
var import_zod5 = require("zod");
|
|
@@ -408,44 +409,55 @@ var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
|
|
|
408
409
|
unit: import_zod6.z.string().optional()
|
|
409
410
|
});
|
|
410
411
|
|
|
411
|
-
// ../commons/src/events/
|
|
412
|
+
// ../commons/src/events/Icd11.ts
|
|
412
413
|
var import_zod7 = require("zod");
|
|
413
|
-
var
|
|
414
|
+
var Icd11FieldValue = import_zod7.z.object({
|
|
415
|
+
code: import_zod7.z.string(),
|
|
416
|
+
label: import_zod7.z.string()
|
|
417
|
+
});
|
|
418
|
+
var Icd11FieldUpdateValue = import_zod7.z.object({
|
|
419
|
+
code: import_zod7.z.string().optional(),
|
|
420
|
+
label: import_zod7.z.string().optional()
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
// ../commons/src/events/PlainDate.ts
|
|
424
|
+
var import_zod8 = require("zod");
|
|
425
|
+
var PlainDate = import_zod8.z.string().date().brand("PlainDate").describe("Date in the format YYYY-MM-DD");
|
|
414
426
|
|
|
415
427
|
// ../commons/src/events/FieldValue.ts
|
|
416
|
-
var TextValue =
|
|
428
|
+
var TextValue = import_zod9.z.string();
|
|
417
429
|
var NonEmptyTextValue = TextValue.min(1);
|
|
418
|
-
var AgeValue =
|
|
419
|
-
age:
|
|
420
|
-
asOfDateRef:
|
|
430
|
+
var AgeValue = import_zod9.z.object({
|
|
431
|
+
age: import_zod9.z.number(),
|
|
432
|
+
asOfDateRef: import_zod9.z.string()
|
|
421
433
|
});
|
|
422
434
|
var AgeUpdateValue = AgeValue.optional().nullable();
|
|
423
|
-
var TimeValue =
|
|
424
|
-
var DatetimeValue =
|
|
425
|
-
var SelectDateRangeValue =
|
|
435
|
+
var TimeValue = import_zod9.z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
|
436
|
+
var DatetimeValue = import_zod9.z.string().datetime();
|
|
437
|
+
var SelectDateRangeValue = import_zod9.z.enum([
|
|
426
438
|
"last7Days",
|
|
427
439
|
"last30Days",
|
|
428
440
|
"last90Days",
|
|
429
441
|
"last365Days"
|
|
430
442
|
]);
|
|
431
|
-
var DateRangeFieldValue =
|
|
443
|
+
var DateRangeFieldValue = import_zod9.z.object({
|
|
432
444
|
start: PlainDate,
|
|
433
445
|
end: PlainDate
|
|
434
446
|
}).or(PlainDate).describe(
|
|
435
447
|
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
|
436
448
|
);
|
|
437
|
-
var EmailValue =
|
|
438
|
-
var CheckboxFieldValue =
|
|
439
|
-
var NumberFieldValue =
|
|
440
|
-
var SignatureFieldValue =
|
|
441
|
-
var ButtonFieldValue =
|
|
442
|
-
var VerificationStatusValue =
|
|
449
|
+
var EmailValue = import_zod9.z.string().email();
|
|
450
|
+
var CheckboxFieldValue = import_zod9.z.boolean();
|
|
451
|
+
var NumberFieldValue = import_zod9.z.number();
|
|
452
|
+
var SignatureFieldValue = import_zod9.z.string();
|
|
453
|
+
var ButtonFieldValue = import_zod9.z.number();
|
|
454
|
+
var VerificationStatusValue = import_zod9.z.enum([
|
|
443
455
|
"verified",
|
|
444
456
|
"authenticated",
|
|
445
457
|
"failed",
|
|
446
458
|
"pending"
|
|
447
459
|
]);
|
|
448
|
-
var LeafFieldValues =
|
|
460
|
+
var LeafFieldValues = import_zod9.z.union([
|
|
449
461
|
AddressFieldValue,
|
|
450
462
|
TextValue,
|
|
451
463
|
PlainDate,
|
|
@@ -466,13 +478,15 @@ var LeafFieldValues = import_zod8.z.union([
|
|
|
466
478
|
QrReaderFieldValue,
|
|
467
479
|
IdReaderFieldValue,
|
|
468
480
|
NumberWithUnitFieldValue,
|
|
469
|
-
NumberWithUnitFieldUpdateValue
|
|
481
|
+
NumberWithUnitFieldUpdateValue,
|
|
482
|
+
Icd11FieldValue,
|
|
483
|
+
Icd11FieldUpdateValue
|
|
470
484
|
]);
|
|
471
|
-
var FieldGroupValue =
|
|
472
|
-
var DataFieldValue =
|
|
473
|
-
data:
|
|
485
|
+
var FieldGroupValue = import_zod9.z.record(import_zod9.z.string(), LeafFieldValues);
|
|
486
|
+
var DataFieldValue = import_zod9.z.object({
|
|
487
|
+
data: import_zod9.z.record(import_zod9.z.string(), LeafFieldValues)
|
|
474
488
|
}).nullish();
|
|
475
|
-
var FieldValue =
|
|
489
|
+
var FieldValue = import_zod9.z.union([
|
|
476
490
|
LeafFieldValues,
|
|
477
491
|
DataFieldValue,
|
|
478
492
|
FieldGroupValue
|
|
@@ -500,7 +514,7 @@ function schemaPriority(schema) {
|
|
|
500
514
|
return idx === -1 ? 9999 : idx;
|
|
501
515
|
}
|
|
502
516
|
function safeUnion(schemas) {
|
|
503
|
-
return
|
|
517
|
+
return import_zod9.z.custom((val) => {
|
|
504
518
|
const successful = schemas.filter((s) => s.safeParse(val).success);
|
|
505
519
|
if (successful.length === 1) {
|
|
506
520
|
return true;
|
|
@@ -530,7 +544,8 @@ var FieldUpdateValue = safeUnion([
|
|
|
530
544
|
FieldGroupValue.describe("GroupFieldValue"),
|
|
531
545
|
NameFieldUpdateValue.describe("NameFieldUpdateValue"),
|
|
532
546
|
HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
|
|
533
|
-
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
|
|
547
|
+
QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
|
|
548
|
+
Icd11FieldUpdateValue.describe("Icd11FieldUpdateValue")
|
|
534
549
|
]);
|
|
535
550
|
|
|
536
551
|
// ../commons/src/events/FieldConfig.ts
|
|
@@ -538,16 +553,16 @@ var import_zod_openapi6 = require("zod-openapi");
|
|
|
538
553
|
|
|
539
554
|
// ../commons/src/uuid.ts
|
|
540
555
|
var import_uuid = require("uuid");
|
|
541
|
-
var
|
|
542
|
-
var UUID =
|
|
556
|
+
var import_zod10 = require("zod");
|
|
557
|
+
var UUID = import_zod10.z.string().uuid().brand("UUID");
|
|
543
558
|
function getUUID() {
|
|
544
559
|
return (0, import_uuid.v4)();
|
|
545
560
|
}
|
|
546
561
|
|
|
547
562
|
// ../commons/src/events/serializers/user/serializer.ts
|
|
548
|
-
var
|
|
549
|
-
var SerializedUserField =
|
|
550
|
-
$userField:
|
|
563
|
+
var import_zod11 = require("zod");
|
|
564
|
+
var SerializedUserField = import_zod11.z.object({
|
|
565
|
+
$userField: import_zod11.z.enum([
|
|
551
566
|
"id",
|
|
552
567
|
"name",
|
|
553
568
|
"role",
|
|
@@ -562,7 +577,7 @@ var SerializedUserField = import_zod10.z.object({
|
|
|
562
577
|
"mobile",
|
|
563
578
|
"email"
|
|
564
579
|
]),
|
|
565
|
-
$location:
|
|
580
|
+
$location: import_zod11.z.string().optional()
|
|
566
581
|
});
|
|
567
582
|
function userSerializer(userField) {
|
|
568
583
|
return {
|
|
@@ -580,8 +595,8 @@ function userSerializer(userField) {
|
|
|
580
595
|
}
|
|
581
596
|
};
|
|
582
597
|
}
|
|
583
|
-
var SerializedUserDataField =
|
|
584
|
-
$userDataField:
|
|
598
|
+
var SerializedUserDataField = import_zod11.z.object({
|
|
599
|
+
$userDataField: import_zod11.z.string()
|
|
585
600
|
});
|
|
586
601
|
function userDataSerializer(key) {
|
|
587
602
|
return {
|
|
@@ -593,13 +608,13 @@ function userDataSerializer(key) {
|
|
|
593
608
|
}
|
|
594
609
|
|
|
595
610
|
// ../commons/src/events/EventIndex.ts
|
|
596
|
-
var
|
|
611
|
+
var import_zod16 = require("zod");
|
|
597
612
|
|
|
598
613
|
// ../commons/src/events/EventMetadata.ts
|
|
599
|
-
var
|
|
614
|
+
var import_zod15 = require("zod");
|
|
600
615
|
|
|
601
616
|
// ../commons/src/events/ActionDocument.ts
|
|
602
|
-
var
|
|
617
|
+
var import_zod14 = require("zod");
|
|
603
618
|
var import_zod_openapi4 = require("zod-openapi");
|
|
604
619
|
|
|
605
620
|
// ../commons/src/events/CreatedAtLocation.ts
|
|
@@ -607,10 +622,10 @@ var CreatedAtLocation = UUID.nullish();
|
|
|
607
622
|
|
|
608
623
|
// ../commons/src/authentication.ts
|
|
609
624
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
610
|
-
var
|
|
625
|
+
var import_zod13 = require("zod");
|
|
611
626
|
|
|
612
627
|
// ../commons/src/scopes.ts
|
|
613
|
-
var
|
|
628
|
+
var import_zod12 = require("zod");
|
|
614
629
|
var SCOPES = {
|
|
615
630
|
// TODO v1.8 legacy scopes
|
|
616
631
|
BYPASSRATELIMIT: "bypassratelimit",
|
|
@@ -689,91 +704,91 @@ var SCOPES = {
|
|
|
689
704
|
// data seeding
|
|
690
705
|
USER_DATA_SEEDING: "user.data-seeding"
|
|
691
706
|
};
|
|
692
|
-
var LegacyScopes =
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
707
|
+
var LegacyScopes = import_zod12.z.union([
|
|
708
|
+
import_zod12.z.literal(SCOPES.BYPASSRATELIMIT),
|
|
709
|
+
import_zod12.z.literal(SCOPES.REGISTER),
|
|
710
|
+
import_zod12.z.literal(SCOPES.DEMO),
|
|
711
|
+
import_zod12.z.literal(SCOPES.CONFIG)
|
|
697
712
|
]);
|
|
698
|
-
var IntegrationScopes =
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
713
|
+
var IntegrationScopes = import_zod12.z.union([
|
|
714
|
+
import_zod12.z.literal(SCOPES.WEBHOOK),
|
|
715
|
+
import_zod12.z.literal(SCOPES.NATIONALID),
|
|
716
|
+
import_zod12.z.literal(SCOPES.NOTIFICATION_API),
|
|
717
|
+
import_zod12.z.literal(SCOPES.RECORDSEARCH)
|
|
703
718
|
]);
|
|
704
|
-
var InternalOperationsScopes =
|
|
705
|
-
|
|
706
|
-
|
|
719
|
+
var InternalOperationsScopes = import_zod12.z.union([
|
|
720
|
+
import_zod12.z.literal(SCOPES.RECORD_REINDEX),
|
|
721
|
+
import_zod12.z.literal(SCOPES.RECORD_IMPORT)
|
|
707
722
|
]);
|
|
708
|
-
var DeclareScopes =
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
723
|
+
var DeclareScopes = import_zod12.z.union([
|
|
724
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
|
725
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
|
726
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
|
727
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
|
728
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
|
729
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
|
730
|
+
import_zod12.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
|
731
|
+
import_zod12.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
|
717
732
|
]);
|
|
718
|
-
var UnassignScope =
|
|
719
|
-
var ValidateScopes =
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
733
|
+
var UnassignScope = import_zod12.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
|
734
|
+
var ValidateScopes = import_zod12.z.union([
|
|
735
|
+
import_zod12.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
|
736
|
+
import_zod12.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
|
737
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
|
738
|
+
import_zod12.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
|
739
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
|
740
|
+
import_zod12.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
|
726
741
|
]);
|
|
727
|
-
var RegisterScope =
|
|
728
|
-
var CorrectionScopes =
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
742
|
+
var RegisterScope = import_zod12.z.literal(SCOPES.RECORD_REGISTER);
|
|
743
|
+
var CorrectionScopes = import_zod12.z.union([
|
|
744
|
+
import_zod12.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
|
745
|
+
import_zod12.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
|
746
|
+
import_zod12.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
|
747
|
+
import_zod12.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
|
733
748
|
]);
|
|
734
|
-
var SearchScopes =
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
749
|
+
var SearchScopes = import_zod12.z.union([
|
|
750
|
+
import_zod12.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
|
751
|
+
import_zod12.z.literal(SCOPES.SEARCH_BIRTH),
|
|
752
|
+
import_zod12.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
|
753
|
+
import_zod12.z.literal(SCOPES.SEARCH_DEATH),
|
|
754
|
+
import_zod12.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
|
755
|
+
import_zod12.z.literal(SCOPES.SEARCH_MARRIAGE)
|
|
741
756
|
]);
|
|
742
|
-
var AuditScopes =
|
|
743
|
-
var PerformanceScopes =
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
757
|
+
var AuditScopes = import_zod12.z.literal(SCOPES.RECORD_READ);
|
|
758
|
+
var PerformanceScopes = import_zod12.z.union([
|
|
759
|
+
import_zod12.z.literal(SCOPES.PERFORMANCE_READ),
|
|
760
|
+
import_zod12.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
|
761
|
+
import_zod12.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
|
747
762
|
]);
|
|
748
|
-
var OrganisationScopes =
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
763
|
+
var OrganisationScopes = import_zod12.z.union([
|
|
764
|
+
import_zod12.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
|
765
|
+
import_zod12.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
|
766
|
+
import_zod12.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
|
752
767
|
]);
|
|
753
|
-
var UserScopes =
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
768
|
+
var UserScopes = import_zod12.z.union([
|
|
769
|
+
import_zod12.z.literal(SCOPES.USER_READ),
|
|
770
|
+
import_zod12.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
|
771
|
+
import_zod12.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
|
772
|
+
import_zod12.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
|
773
|
+
import_zod12.z.literal(SCOPES.USER_CREATE),
|
|
774
|
+
import_zod12.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
|
775
|
+
import_zod12.z.literal(SCOPES.USER_UPDATE),
|
|
776
|
+
import_zod12.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
|
762
777
|
]);
|
|
763
|
-
var ConfigScope =
|
|
764
|
-
var DataSeedingScope =
|
|
765
|
-
var LiteralScopes =
|
|
778
|
+
var ConfigScope = import_zod12.z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
|
779
|
+
var DataSeedingScope = import_zod12.z.literal(SCOPES.USER_DATA_SEEDING);
|
|
780
|
+
var LiteralScopes = import_zod12.z.union([
|
|
766
781
|
LegacyScopes,
|
|
767
782
|
IntegrationScopes,
|
|
768
783
|
UnassignScope,
|
|
769
784
|
DeclareScopes,
|
|
770
785
|
ValidateScopes,
|
|
771
786
|
RegisterScope,
|
|
772
|
-
|
|
787
|
+
import_zod12.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
773
788
|
CorrectionScopes,
|
|
774
789
|
SearchScopes,
|
|
775
790
|
AuditScopes,
|
|
776
|
-
|
|
791
|
+
import_zod12.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
|
777
792
|
PerformanceScopes,
|
|
778
793
|
OrganisationScopes,
|
|
779
794
|
UserScopes,
|
|
@@ -782,42 +797,42 @@ var LiteralScopes = import_zod11.z.union([
|
|
|
782
797
|
InternalOperationsScopes
|
|
783
798
|
]);
|
|
784
799
|
var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
|
785
|
-
var rawConfigurableScope =
|
|
786
|
-
var CreateUserScope =
|
|
787
|
-
type:
|
|
788
|
-
options:
|
|
789
|
-
role:
|
|
800
|
+
var rawConfigurableScope = import_zod12.z.string().regex(rawConfigurableScopeRegex);
|
|
801
|
+
var CreateUserScope = import_zod12.z.object({
|
|
802
|
+
type: import_zod12.z.literal("user.create"),
|
|
803
|
+
options: import_zod12.z.object({
|
|
804
|
+
role: import_zod12.z.array(import_zod12.z.string())
|
|
790
805
|
})
|
|
791
806
|
});
|
|
792
|
-
var EditUserScope =
|
|
793
|
-
type:
|
|
794
|
-
options:
|
|
795
|
-
role:
|
|
807
|
+
var EditUserScope = import_zod12.z.object({
|
|
808
|
+
type: import_zod12.z.literal("user.edit"),
|
|
809
|
+
options: import_zod12.z.object({
|
|
810
|
+
role: import_zod12.z.array(import_zod12.z.string())
|
|
796
811
|
})
|
|
797
812
|
});
|
|
798
|
-
var WorkqueueScope =
|
|
799
|
-
type:
|
|
800
|
-
options:
|
|
801
|
-
id:
|
|
813
|
+
var WorkqueueScope = import_zod12.z.object({
|
|
814
|
+
type: import_zod12.z.literal("workqueue"),
|
|
815
|
+
options: import_zod12.z.object({
|
|
816
|
+
id: import_zod12.z.array(import_zod12.z.string())
|
|
802
817
|
})
|
|
803
818
|
});
|
|
804
|
-
var SearchScope =
|
|
805
|
-
type:
|
|
806
|
-
options:
|
|
807
|
-
event:
|
|
808
|
-
access:
|
|
819
|
+
var SearchScope = import_zod12.z.object({
|
|
820
|
+
type: import_zod12.z.literal("search"),
|
|
821
|
+
options: import_zod12.z.object({
|
|
822
|
+
event: import_zod12.z.array(import_zod12.z.string()).length(1),
|
|
823
|
+
access: import_zod12.z.array(import_zod12.z.enum(["my-jurisdiction", "all"])).length(1)
|
|
809
824
|
})
|
|
810
825
|
});
|
|
811
|
-
var PrintCertifiedCopiesScope =
|
|
812
|
-
type:
|
|
813
|
-
options:
|
|
814
|
-
event:
|
|
815
|
-
templates:
|
|
826
|
+
var PrintCertifiedCopiesScope = import_zod12.z.object({
|
|
827
|
+
type: import_zod12.z.literal("record.registered.print-certified-copies"),
|
|
828
|
+
options: import_zod12.z.object({
|
|
829
|
+
event: import_zod12.z.array(import_zod12.z.string()).describe("Event type, e.g. birth, death"),
|
|
830
|
+
templates: import_zod12.z.array(import_zod12.z.string()).optional().describe(
|
|
816
831
|
"Template IDs for certified copies. If not provided, all templates will be used."
|
|
817
832
|
)
|
|
818
833
|
})
|
|
819
834
|
});
|
|
820
|
-
var RecordScopeType =
|
|
835
|
+
var RecordScopeType = import_zod12.z.enum([
|
|
821
836
|
"record.create",
|
|
822
837
|
"record.read",
|
|
823
838
|
"record.declare",
|
|
@@ -831,15 +846,15 @@ var RecordScopeType = import_zod11.z.enum([
|
|
|
831
846
|
"record.registered.correct",
|
|
832
847
|
"record.unassign-others"
|
|
833
848
|
]);
|
|
834
|
-
var RecordScope =
|
|
849
|
+
var RecordScope = import_zod12.z.object({
|
|
835
850
|
type: RecordScopeType,
|
|
836
|
-
options:
|
|
837
|
-
event:
|
|
851
|
+
options: import_zod12.z.object({
|
|
852
|
+
event: import_zod12.z.array(import_zod12.z.string()).describe("Event type, e.g. birth, death")
|
|
838
853
|
})
|
|
839
854
|
}).describe(
|
|
840
855
|
"Scopes used to check user's permission to perform actions on a record."
|
|
841
856
|
);
|
|
842
|
-
var ConfigurableRawScopes =
|
|
857
|
+
var ConfigurableRawScopes = import_zod12.z.discriminatedUnion("type", [
|
|
843
858
|
SearchScope,
|
|
844
859
|
PrintCertifiedCopiesScope,
|
|
845
860
|
CreateUserScope,
|
|
@@ -848,11 +863,11 @@ var ConfigurableRawScopes = import_zod11.z.discriminatedUnion("type", [
|
|
|
848
863
|
RecordScope
|
|
849
864
|
]);
|
|
850
865
|
var scopes = Object.values(SCOPES);
|
|
851
|
-
var ActionScopes =
|
|
866
|
+
var ActionScopes = import_zod12.z.union([
|
|
852
867
|
DeclareScopes,
|
|
853
868
|
ValidateScopes,
|
|
854
869
|
RegisterScope,
|
|
855
|
-
|
|
870
|
+
import_zod12.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
|
856
871
|
CorrectionScopes
|
|
857
872
|
]);
|
|
858
873
|
|
|
@@ -986,15 +1001,15 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
|
986
1001
|
]
|
|
987
1002
|
}
|
|
988
1003
|
];
|
|
989
|
-
var TokenUserType =
|
|
990
|
-
var TokenWithBearer =
|
|
1004
|
+
var TokenUserType = import_zod13.z.enum(["user", "system"]);
|
|
1005
|
+
var TokenWithBearer = import_zod13.z.string().regex(/^Bearer\s/);
|
|
991
1006
|
|
|
992
1007
|
// ../commons/src/events/ActionDocument.ts
|
|
993
|
-
(0, import_zod_openapi4.extendZodWithOpenApi)(
|
|
994
|
-
var ActionUpdate =
|
|
1008
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod14.z);
|
|
1009
|
+
var ActionUpdate = import_zod14.z.record(import_zod14.z.string(), FieldUpdateValue).describe(
|
|
995
1010
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
996
1011
|
);
|
|
997
|
-
var EventState =
|
|
1012
|
+
var EventState = import_zod14.z.record(import_zod14.z.string(), FieldValue).describe(
|
|
998
1013
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
999
1014
|
);
|
|
1000
1015
|
var ActionStatus = {
|
|
@@ -1002,16 +1017,16 @@ var ActionStatus = {
|
|
|
1002
1017
|
Accepted: "Accepted",
|
|
1003
1018
|
Rejected: "Rejected"
|
|
1004
1019
|
};
|
|
1005
|
-
var ActionBase =
|
|
1020
|
+
var ActionBase = import_zod14.z.object({
|
|
1006
1021
|
id: UUID.describe("Unique identifier of the action."),
|
|
1007
|
-
transactionId:
|
|
1022
|
+
transactionId: import_zod14.z.string().describe("Unique identifier of the transaction."),
|
|
1008
1023
|
createdByUserType: TokenUserType.describe(
|
|
1009
1024
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
1010
1025
|
),
|
|
1011
|
-
createdAt:
|
|
1012
|
-
createdBy:
|
|
1013
|
-
createdByRole:
|
|
1014
|
-
createdBySignature:
|
|
1026
|
+
createdAt: import_zod14.z.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
1027
|
+
createdBy: import_zod14.z.string().describe("Identifier of the user who created the action."),
|
|
1028
|
+
createdByRole: import_zod14.z.string().describe("Role of the user who created the action."),
|
|
1029
|
+
createdBySignature: import_zod14.z.string().nullish().describe("Reference to the signature of the user who created the action."),
|
|
1015
1030
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1016
1031
|
"Reference to the location of the user who created the action."
|
|
1017
1032
|
),
|
|
@@ -1019,7 +1034,7 @@ var ActionBase = import_zod13.z.object({
|
|
|
1019
1034
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
1020
1035
|
),
|
|
1021
1036
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
1022
|
-
status:
|
|
1037
|
+
status: import_zod14.z.enum([
|
|
1023
1038
|
ActionStatus.Requested,
|
|
1024
1039
|
ActionStatus.Accepted,
|
|
1025
1040
|
ActionStatus.Rejected
|
|
@@ -1031,129 +1046,129 @@ var ActionBase = import_zod13.z.object({
|
|
|
1031
1046
|
)
|
|
1032
1047
|
});
|
|
1033
1048
|
var AssignedAction = ActionBase.merge(
|
|
1034
|
-
|
|
1035
|
-
type:
|
|
1036
|
-
assignedTo:
|
|
1049
|
+
import_zod14.z.object({
|
|
1050
|
+
type: import_zod14.z.literal(ActionType.ASSIGN),
|
|
1051
|
+
assignedTo: import_zod14.z.string().describe("Identifier of the user to whom the action is assigned.")
|
|
1037
1052
|
// TODO move into 'content' property
|
|
1038
1053
|
})
|
|
1039
1054
|
);
|
|
1040
1055
|
var UnassignedAction = ActionBase.merge(
|
|
1041
|
-
|
|
1042
|
-
type:
|
|
1056
|
+
import_zod14.z.object({
|
|
1057
|
+
type: import_zod14.z.literal(ActionType.UNASSIGN)
|
|
1043
1058
|
})
|
|
1044
1059
|
);
|
|
1045
1060
|
var RegisterAction = ActionBase.merge(
|
|
1046
|
-
|
|
1047
|
-
type:
|
|
1048
|
-
registrationNumber:
|
|
1061
|
+
import_zod14.z.object({
|
|
1062
|
+
type: import_zod14.z.literal(ActionType.REGISTER),
|
|
1063
|
+
registrationNumber: import_zod14.z.string().optional().describe(
|
|
1049
1064
|
"Registration number of the event. Always present for accepted registrations."
|
|
1050
1065
|
)
|
|
1051
1066
|
// TODO move into 'content' property
|
|
1052
1067
|
})
|
|
1053
1068
|
);
|
|
1054
1069
|
var DeclareAction = ActionBase.merge(
|
|
1055
|
-
|
|
1056
|
-
type:
|
|
1070
|
+
import_zod14.z.object({
|
|
1071
|
+
type: import_zod14.z.literal(ActionType.DECLARE)
|
|
1057
1072
|
})
|
|
1058
1073
|
);
|
|
1059
1074
|
var ValidateAction = ActionBase.merge(
|
|
1060
|
-
|
|
1061
|
-
type:
|
|
1075
|
+
import_zod14.z.object({
|
|
1076
|
+
type: import_zod14.z.literal(ActionType.VALIDATE)
|
|
1062
1077
|
})
|
|
1063
1078
|
);
|
|
1064
|
-
var ReasonContent =
|
|
1065
|
-
reason:
|
|
1079
|
+
var ReasonContent = import_zod14.z.object({
|
|
1080
|
+
reason: import_zod14.z.string().min(1, { message: "Message cannot be empty" }).describe(
|
|
1066
1081
|
"Message describing the reason for rejecting or archiving the event."
|
|
1067
1082
|
)
|
|
1068
1083
|
});
|
|
1069
1084
|
var EscalateAction = ActionBase.merge(
|
|
1070
|
-
|
|
1071
|
-
type:
|
|
1085
|
+
import_zod14.z.object({
|
|
1086
|
+
type: import_zod14.z.literal(ActionType.ESCALATE),
|
|
1072
1087
|
content: ReasonContent
|
|
1073
1088
|
})
|
|
1074
1089
|
);
|
|
1075
1090
|
var RejectAction = ActionBase.merge(
|
|
1076
|
-
|
|
1077
|
-
type:
|
|
1091
|
+
import_zod14.z.object({
|
|
1092
|
+
type: import_zod14.z.literal(ActionType.REJECT),
|
|
1078
1093
|
content: ReasonContent
|
|
1079
1094
|
})
|
|
1080
1095
|
);
|
|
1081
|
-
var PotentialDuplicate =
|
|
1096
|
+
var PotentialDuplicate = import_zod14.z.object({
|
|
1082
1097
|
id: UUID,
|
|
1083
|
-
trackingId:
|
|
1098
|
+
trackingId: import_zod14.z.string()
|
|
1084
1099
|
});
|
|
1085
1100
|
var DuplicateDetectedAction = ActionBase.merge(
|
|
1086
|
-
|
|
1087
|
-
type:
|
|
1088
|
-
content:
|
|
1089
|
-
duplicates:
|
|
1101
|
+
import_zod14.z.object({
|
|
1102
|
+
type: import_zod14.z.literal(ActionType.DUPLICATE_DETECTED),
|
|
1103
|
+
content: import_zod14.z.object({
|
|
1104
|
+
duplicates: import_zod14.z.array(PotentialDuplicate)
|
|
1090
1105
|
})
|
|
1091
1106
|
})
|
|
1092
1107
|
);
|
|
1093
1108
|
var MarkNotDuplicateAction = ActionBase.merge(
|
|
1094
|
-
|
|
1095
|
-
type:
|
|
1109
|
+
import_zod14.z.object({
|
|
1110
|
+
type: import_zod14.z.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
1096
1111
|
})
|
|
1097
1112
|
);
|
|
1098
1113
|
var MarkAsDuplicateAction = ActionBase.merge(
|
|
1099
|
-
|
|
1100
|
-
type:
|
|
1101
|
-
content:
|
|
1114
|
+
import_zod14.z.object({
|
|
1115
|
+
type: import_zod14.z.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1116
|
+
content: import_zod14.z.object({
|
|
1102
1117
|
duplicateOf: UUID
|
|
1103
1118
|
}).optional()
|
|
1104
1119
|
})
|
|
1105
1120
|
);
|
|
1106
1121
|
var ArchiveAction = ActionBase.merge(
|
|
1107
|
-
|
|
1108
|
-
type:
|
|
1122
|
+
import_zod14.z.object({
|
|
1123
|
+
type: import_zod14.z.literal(ActionType.ARCHIVE),
|
|
1109
1124
|
content: ReasonContent
|
|
1110
1125
|
})
|
|
1111
1126
|
);
|
|
1112
1127
|
var CreatedAction = ActionBase.merge(
|
|
1113
|
-
|
|
1114
|
-
type:
|
|
1128
|
+
import_zod14.z.object({
|
|
1129
|
+
type: import_zod14.z.literal(ActionType.CREATE)
|
|
1115
1130
|
})
|
|
1116
1131
|
);
|
|
1117
1132
|
var NotifiedAction = ActionBase.merge(
|
|
1118
|
-
|
|
1119
|
-
type:
|
|
1133
|
+
import_zod14.z.object({
|
|
1134
|
+
type: import_zod14.z.literal(ActionType.NOTIFY)
|
|
1120
1135
|
})
|
|
1121
1136
|
);
|
|
1122
|
-
var PrintContent =
|
|
1123
|
-
templateId:
|
|
1137
|
+
var PrintContent = import_zod14.z.object({
|
|
1138
|
+
templateId: import_zod14.z.string().optional()
|
|
1124
1139
|
});
|
|
1125
1140
|
var PrintCertificateAction = ActionBase.merge(
|
|
1126
|
-
|
|
1127
|
-
type:
|
|
1141
|
+
import_zod14.z.object({
|
|
1142
|
+
type: import_zod14.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
1128
1143
|
content: PrintContent.optional().nullable()
|
|
1129
1144
|
})
|
|
1130
1145
|
);
|
|
1131
1146
|
var RequestedCorrectionAction = ActionBase.merge(
|
|
1132
|
-
|
|
1133
|
-
type:
|
|
1147
|
+
import_zod14.z.object({
|
|
1148
|
+
type: import_zod14.z.literal(ActionType.REQUEST_CORRECTION)
|
|
1134
1149
|
})
|
|
1135
1150
|
);
|
|
1136
1151
|
var ApprovedCorrectionAction = ActionBase.merge(
|
|
1137
|
-
|
|
1138
|
-
type:
|
|
1139
|
-
requestId:
|
|
1152
|
+
import_zod14.z.object({
|
|
1153
|
+
type: import_zod14.z.literal(ActionType.APPROVE_CORRECTION),
|
|
1154
|
+
requestId: import_zod14.z.string()
|
|
1140
1155
|
// TODO move into 'content' property
|
|
1141
1156
|
})
|
|
1142
1157
|
);
|
|
1143
1158
|
var RejectedCorrectionAction = ActionBase.merge(
|
|
1144
|
-
|
|
1145
|
-
type:
|
|
1146
|
-
requestId:
|
|
1159
|
+
import_zod14.z.object({
|
|
1160
|
+
type: import_zod14.z.literal(ActionType.REJECT_CORRECTION),
|
|
1161
|
+
requestId: import_zod14.z.string(),
|
|
1147
1162
|
// TODO move into 'content' property
|
|
1148
1163
|
content: ReasonContent
|
|
1149
1164
|
})
|
|
1150
1165
|
);
|
|
1151
1166
|
var ReadAction = ActionBase.merge(
|
|
1152
|
-
|
|
1153
|
-
type:
|
|
1167
|
+
import_zod14.z.object({
|
|
1168
|
+
type: import_zod14.z.literal(ActionType.READ)
|
|
1154
1169
|
})
|
|
1155
1170
|
);
|
|
1156
|
-
var ActionDocument =
|
|
1171
|
+
var ActionDocument = import_zod14.z.discriminatedUnion("type", [
|
|
1157
1172
|
CreatedAction.openapi({ ref: "CreatedAction" }),
|
|
1158
1173
|
ValidateAction.openapi({ ref: "ValidateAction" }),
|
|
1159
1174
|
EscalateAction.openapi({ ref: "EscalateAction" }),
|
|
@@ -1179,15 +1194,15 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1179
1194
|
declaration: true,
|
|
1180
1195
|
annotation: true
|
|
1181
1196
|
}).merge(
|
|
1182
|
-
|
|
1183
|
-
type:
|
|
1184
|
-
status:
|
|
1197
|
+
import_zod14.z.object({
|
|
1198
|
+
type: import_zod14.z.enum(ConfirmableActions),
|
|
1199
|
+
status: import_zod14.z.literal(ActionStatus.Rejected)
|
|
1185
1200
|
})
|
|
1186
1201
|
);
|
|
1187
|
-
var Action =
|
|
1202
|
+
var Action = import_zod14.z.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1188
1203
|
|
|
1189
1204
|
// ../commons/src/events/EventMetadata.ts
|
|
1190
|
-
var EventStatus =
|
|
1205
|
+
var EventStatus = import_zod15.z.enum([
|
|
1191
1206
|
"CREATED",
|
|
1192
1207
|
"NOTIFIED",
|
|
1193
1208
|
"DECLARED",
|
|
@@ -1203,7 +1218,7 @@ var InherentFlags = {
|
|
|
1203
1218
|
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
1204
1219
|
ESCALATED: "escalated"
|
|
1205
1220
|
};
|
|
1206
|
-
var ActionFlag =
|
|
1221
|
+
var ActionFlag = import_zod15.z.string().regex(
|
|
1207
1222
|
new RegExp(
|
|
1208
1223
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1209
1224
|
ActionStatus
|
|
@@ -1211,60 +1226,60 @@ var ActionFlag = import_zod14.z.string().regex(
|
|
|
1211
1226
|
),
|
|
1212
1227
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1213
1228
|
);
|
|
1214
|
-
var Flag = ActionFlag.or(
|
|
1215
|
-
var ZodDate =
|
|
1216
|
-
var ZodDateTime =
|
|
1217
|
-
var ActionCreationMetadata =
|
|
1218
|
-
createdAt:
|
|
1219
|
-
createdBy:
|
|
1229
|
+
var Flag = ActionFlag.or(import_zod15.z.nativeEnum(InherentFlags));
|
|
1230
|
+
var ZodDate = import_zod15.z.string().date();
|
|
1231
|
+
var ZodDateTime = import_zod15.z.string().datetime();
|
|
1232
|
+
var ActionCreationMetadata = import_zod15.z.object({
|
|
1233
|
+
createdAt: import_zod15.z.string().datetime().describe("The timestamp when the action request was created."),
|
|
1234
|
+
createdBy: import_zod15.z.string().describe("ID of the user who created the action request."),
|
|
1220
1235
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1221
1236
|
"Location of the user who created the action request."
|
|
1222
1237
|
),
|
|
1223
|
-
createdByUserType:
|
|
1224
|
-
acceptedAt:
|
|
1225
|
-
createdByRole:
|
|
1226
|
-
createdBySignature:
|
|
1238
|
+
createdByUserType: import_zod15.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1239
|
+
acceptedAt: import_zod15.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
|
1240
|
+
createdByRole: import_zod15.z.string().describe("Role of the user at the time of action request creation."),
|
|
1241
|
+
createdBySignature: import_zod15.z.string().nullish().describe("Signature of the user who created the action request.")
|
|
1227
1242
|
});
|
|
1228
1243
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1229
|
-
registrationNumber:
|
|
1244
|
+
registrationNumber: import_zod15.z.string().describe(
|
|
1230
1245
|
"Registration number of the event. Always present for accepted registrations."
|
|
1231
1246
|
)
|
|
1232
1247
|
});
|
|
1233
|
-
var LegalStatuses =
|
|
1248
|
+
var LegalStatuses = import_zod15.z.object({
|
|
1234
1249
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1235
1250
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1236
1251
|
});
|
|
1237
|
-
var EventMetadata =
|
|
1252
|
+
var EventMetadata = import_zod15.z.object({
|
|
1238
1253
|
id: UUID,
|
|
1239
|
-
type:
|
|
1254
|
+
type: import_zod15.z.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1240
1255
|
status: EventStatus,
|
|
1241
1256
|
legalStatuses: LegalStatuses.describe(
|
|
1242
1257
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1243
1258
|
),
|
|
1244
|
-
createdAt:
|
|
1259
|
+
createdAt: import_zod15.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
|
1245
1260
|
dateOfEvent: ZodDate.nullish(),
|
|
1246
|
-
createdBy:
|
|
1247
|
-
createdByUserType:
|
|
1248
|
-
updatedByUserRole:
|
|
1261
|
+
createdBy: import_zod15.z.string().describe("ID of the user who created the event."),
|
|
1262
|
+
createdByUserType: import_zod15.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1263
|
+
updatedByUserRole: import_zod15.z.string().describe("Role of the user who last changed the status."),
|
|
1249
1264
|
createdAtLocation: CreatedAtLocation.describe(
|
|
1250
1265
|
"Location of the user who created the event."
|
|
1251
1266
|
),
|
|
1252
|
-
createdBySignature:
|
|
1267
|
+
createdBySignature: import_zod15.z.string().nullish().describe("Signature of the user who created the event."),
|
|
1253
1268
|
updatedAtLocation: UUID.nullish().describe(
|
|
1254
1269
|
"Location of the user who last changed the status."
|
|
1255
1270
|
),
|
|
1256
|
-
updatedAt:
|
|
1271
|
+
updatedAt: import_zod15.z.string().datetime().describe(
|
|
1257
1272
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1258
1273
|
),
|
|
1259
|
-
assignedTo:
|
|
1260
|
-
updatedBy:
|
|
1261
|
-
trackingId:
|
|
1274
|
+
assignedTo: import_zod15.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1275
|
+
updatedBy: import_zod15.z.string().nullish().describe("ID of the user who last changed the status."),
|
|
1276
|
+
trackingId: import_zod15.z.string().describe(
|
|
1262
1277
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1263
1278
|
),
|
|
1264
|
-
potentialDuplicates:
|
|
1279
|
+
potentialDuplicates: import_zod15.z.array(PotentialDuplicate).describe(
|
|
1265
1280
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1266
1281
|
),
|
|
1267
|
-
flags:
|
|
1282
|
+
flags: import_zod15.z.array(Flag)
|
|
1268
1283
|
});
|
|
1269
1284
|
var EventMetadataKeysArray = [
|
|
1270
1285
|
"id",
|
|
@@ -1284,8 +1299,8 @@ var EventMetadataKeysArray = [
|
|
|
1284
1299
|
"legalStatuses",
|
|
1285
1300
|
"flags"
|
|
1286
1301
|
];
|
|
1287
|
-
var EventMetadataKeys =
|
|
1288
|
-
var EventMetadataDateFieldIdInput =
|
|
1302
|
+
var EventMetadataKeys = import_zod15.z.enum(EventMetadataKeysArray);
|
|
1303
|
+
var EventMetadataDateFieldIdInput = import_zod15.z.enum([
|
|
1289
1304
|
"createdAt",
|
|
1290
1305
|
"updatedAt",
|
|
1291
1306
|
"legalStatuses.DECLARED.createdAt",
|
|
@@ -1293,7 +1308,7 @@ var EventMetadataDateFieldIdInput = import_zod14.z.enum([
|
|
|
1293
1308
|
"legalStatuses.REGISTERED.createdAt",
|
|
1294
1309
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
1295
1310
|
]);
|
|
1296
|
-
var EventMetadataDateFieldId =
|
|
1311
|
+
var EventMetadataDateFieldId = import_zod15.z.enum([
|
|
1297
1312
|
"event.createdAt",
|
|
1298
1313
|
"event.updatedAt",
|
|
1299
1314
|
"event.legalStatuses.DECLARED.createdAt",
|
|
@@ -1304,116 +1319,116 @@ var EventMetadataDateFieldId = import_zod14.z.enum([
|
|
|
1304
1319
|
|
|
1305
1320
|
// ../commons/src/events/EventIndex.ts
|
|
1306
1321
|
var import_zod_openapi5 = require("zod-openapi");
|
|
1307
|
-
(0, import_zod_openapi5.extendZodWithOpenApi)(
|
|
1322
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod16.z);
|
|
1308
1323
|
var EventIndex = EventMetadata.extend({
|
|
1309
1324
|
declaration: EventState
|
|
1310
1325
|
}).openapi({
|
|
1311
1326
|
ref: "EventIndex"
|
|
1312
1327
|
});
|
|
1313
|
-
var EventSearchIndex =
|
|
1314
|
-
|
|
1315
|
-
type:
|
|
1328
|
+
var EventSearchIndex = import_zod16.z.record(import_zod16.z.string(), import_zod16.z.any()).and(
|
|
1329
|
+
import_zod16.z.object({
|
|
1330
|
+
type: import_zod16.z.string()
|
|
1316
1331
|
// Ensures "type" (event-id) exists and is a string
|
|
1317
1332
|
})
|
|
1318
1333
|
).openapi({
|
|
1319
1334
|
ref: "EventSearchIndex"
|
|
1320
1335
|
});
|
|
1321
|
-
var Fuzzy =
|
|
1336
|
+
var Fuzzy = import_zod16.z.object({ type: import_zod16.z.literal("fuzzy"), term: import_zod16.z.string() }).openapi({
|
|
1322
1337
|
ref: "Fuzzy"
|
|
1323
1338
|
});
|
|
1324
|
-
var Exact =
|
|
1339
|
+
var Exact = import_zod16.z.object({ type: import_zod16.z.literal("exact"), term: import_zod16.z.string() }).openapi({
|
|
1325
1340
|
ref: "Exact"
|
|
1326
1341
|
});
|
|
1327
|
-
var ExactStatus =
|
|
1328
|
-
type:
|
|
1342
|
+
var ExactStatus = import_zod16.z.object({
|
|
1343
|
+
type: import_zod16.z.literal("exact"),
|
|
1329
1344
|
term: EventStatus
|
|
1330
1345
|
}).openapi({
|
|
1331
1346
|
ref: "ExactStatus"
|
|
1332
1347
|
});
|
|
1333
|
-
var ExactUserType =
|
|
1334
|
-
type:
|
|
1348
|
+
var ExactUserType = import_zod16.z.object({
|
|
1349
|
+
type: import_zod16.z.literal("exact"),
|
|
1335
1350
|
term: TokenUserType
|
|
1336
1351
|
}).openapi({
|
|
1337
1352
|
ref: "ExactUserType"
|
|
1338
1353
|
});
|
|
1339
|
-
var AnyOf =
|
|
1340
|
-
type:
|
|
1341
|
-
terms:
|
|
1354
|
+
var AnyOf = import_zod16.z.object({
|
|
1355
|
+
type: import_zod16.z.literal("anyOf"),
|
|
1356
|
+
terms: import_zod16.z.array(import_zod16.z.string())
|
|
1342
1357
|
}).openapi({
|
|
1343
1358
|
ref: "AnyOf"
|
|
1344
1359
|
});
|
|
1345
|
-
var AnyOfStatus =
|
|
1346
|
-
type:
|
|
1347
|
-
terms:
|
|
1360
|
+
var AnyOfStatus = import_zod16.z.object({
|
|
1361
|
+
type: import_zod16.z.literal("anyOf"),
|
|
1362
|
+
terms: import_zod16.z.array(EventStatus)
|
|
1348
1363
|
}).openapi({
|
|
1349
1364
|
ref: "AnyOfStatus"
|
|
1350
1365
|
});
|
|
1351
|
-
var Range =
|
|
1352
|
-
type:
|
|
1353
|
-
gte:
|
|
1354
|
-
lte:
|
|
1366
|
+
var Range = import_zod16.z.object({
|
|
1367
|
+
type: import_zod16.z.literal("range"),
|
|
1368
|
+
gte: import_zod16.z.string(),
|
|
1369
|
+
lte: import_zod16.z.string()
|
|
1355
1370
|
}).openapi({
|
|
1356
1371
|
ref: "Range"
|
|
1357
1372
|
});
|
|
1358
|
-
var ContainsFlags =
|
|
1359
|
-
anyOf:
|
|
1360
|
-
noneOf:
|
|
1373
|
+
var ContainsFlags = import_zod16.z.object({
|
|
1374
|
+
anyOf: import_zod16.z.array(Flag).optional(),
|
|
1375
|
+
noneOf: import_zod16.z.array(Flag).optional()
|
|
1361
1376
|
}).openapi({
|
|
1362
1377
|
ref: "ContainsFlags"
|
|
1363
1378
|
});
|
|
1364
|
-
var Within =
|
|
1379
|
+
var Within = import_zod16.z.object({ type: import_zod16.z.literal("within"), location: import_zod16.z.string() }).openapi({
|
|
1365
1380
|
ref: "Within"
|
|
1366
1381
|
});
|
|
1367
|
-
var RangeDate =
|
|
1368
|
-
type:
|
|
1369
|
-
gte:
|
|
1370
|
-
lte:
|
|
1382
|
+
var RangeDate = import_zod16.z.object({
|
|
1383
|
+
type: import_zod16.z.literal("range"),
|
|
1384
|
+
gte: import_zod16.z.string().date().or(import_zod16.z.string().datetime()),
|
|
1385
|
+
lte: import_zod16.z.string().date().or(import_zod16.z.string().datetime())
|
|
1371
1386
|
}).openapi({ ref: "RangeDate" });
|
|
1372
1387
|
var ExactDate = Exact.extend({
|
|
1373
|
-
term:
|
|
1388
|
+
term: import_zod16.z.string().date().or(import_zod16.z.string().datetime())
|
|
1374
1389
|
}).openapi({
|
|
1375
1390
|
ref: "ExactDate"
|
|
1376
1391
|
});
|
|
1377
|
-
var TimePeriod =
|
|
1378
|
-
type:
|
|
1392
|
+
var TimePeriod = import_zod16.z.object({
|
|
1393
|
+
type: import_zod16.z.literal("timePeriod"),
|
|
1379
1394
|
term: SelectDateRangeValue
|
|
1380
1395
|
}).openapi({
|
|
1381
1396
|
ref: "TimePeriod"
|
|
1382
1397
|
});
|
|
1383
|
-
var DateCondition =
|
|
1398
|
+
var DateCondition = import_zod16.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
|
|
1384
1399
|
ref: "DateCondition"
|
|
1385
1400
|
});
|
|
1386
|
-
var QueryInput =
|
|
1387
|
-
() =>
|
|
1388
|
-
|
|
1389
|
-
|
|
1401
|
+
var QueryInput = import_zod16.z.lazy(
|
|
1402
|
+
() => import_zod16.z.union([
|
|
1403
|
+
import_zod16.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
|
1404
|
+
import_zod16.z.record(import_zod16.z.string(), QueryInput)
|
|
1390
1405
|
])
|
|
1391
1406
|
).openapi({
|
|
1392
1407
|
ref: "QueryInput"
|
|
1393
1408
|
});
|
|
1394
|
-
var QueryExpression =
|
|
1395
|
-
id:
|
|
1396
|
-
eventType:
|
|
1397
|
-
status:
|
|
1398
|
-
createdAt:
|
|
1399
|
-
updatedAt:
|
|
1400
|
-
"legalStatuses.REGISTERED.acceptedAt":
|
|
1401
|
-
"legalStatuses.DECLARED.createdAtLocation":
|
|
1402
|
-
|
|
1409
|
+
var QueryExpression = import_zod16.z.object({
|
|
1410
|
+
id: import_zod16.z.optional(import_zod16.z.string()),
|
|
1411
|
+
eventType: import_zod16.z.string(),
|
|
1412
|
+
status: import_zod16.z.optional(import_zod16.z.union([AnyOfStatus, ExactStatus])),
|
|
1413
|
+
createdAt: import_zod16.z.optional(DateCondition),
|
|
1414
|
+
updatedAt: import_zod16.z.optional(DateCondition),
|
|
1415
|
+
"legalStatuses.REGISTERED.acceptedAt": import_zod16.z.optional(DateCondition),
|
|
1416
|
+
"legalStatuses.DECLARED.createdAtLocation": import_zod16.z.optional(
|
|
1417
|
+
import_zod16.z.union([Within, Exact])
|
|
1403
1418
|
),
|
|
1404
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
1405
|
-
|
|
1419
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod16.z.optional(
|
|
1420
|
+
import_zod16.z.union([Within, Exact])
|
|
1406
1421
|
),
|
|
1407
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
1408
|
-
createdAtLocation:
|
|
1409
|
-
updatedAtLocation:
|
|
1410
|
-
assignedTo:
|
|
1411
|
-
createdByUserType:
|
|
1412
|
-
updatedByUserRole:
|
|
1413
|
-
createdBy:
|
|
1414
|
-
updatedBy:
|
|
1415
|
-
trackingId:
|
|
1416
|
-
flags:
|
|
1422
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod16.z.optional(Exact),
|
|
1423
|
+
createdAtLocation: import_zod16.z.optional(import_zod16.z.union([Within, Exact])),
|
|
1424
|
+
updatedAtLocation: import_zod16.z.optional(import_zod16.z.union([Within, Exact])),
|
|
1425
|
+
assignedTo: import_zod16.z.optional(Exact),
|
|
1426
|
+
createdByUserType: import_zod16.z.optional(ExactUserType),
|
|
1427
|
+
updatedByUserRole: import_zod16.z.optional(Exact),
|
|
1428
|
+
createdBy: import_zod16.z.optional(Exact),
|
|
1429
|
+
updatedBy: import_zod16.z.optional(Exact),
|
|
1430
|
+
trackingId: import_zod16.z.optional(Exact),
|
|
1431
|
+
flags: import_zod16.z.optional(ContainsFlags),
|
|
1417
1432
|
// @todo: The type for this comes out as "any"
|
|
1418
1433
|
data: QueryInput
|
|
1419
1434
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
|
@@ -1421,10 +1436,10 @@ var QueryExpression = import_zod15.z.object({
|
|
|
1421
1436
|
}).openapi({
|
|
1422
1437
|
ref: "QueryExpression"
|
|
1423
1438
|
});
|
|
1424
|
-
var QueryType =
|
|
1425
|
-
() =>
|
|
1426
|
-
type:
|
|
1427
|
-
clauses:
|
|
1439
|
+
var QueryType = import_zod16.z.lazy(
|
|
1440
|
+
() => import_zod16.z.object({
|
|
1441
|
+
type: import_zod16.z.literal("and").or(import_zod16.z.literal("or")).openapi({ default: "and" }),
|
|
1442
|
+
clauses: import_zod16.z.array(import_zod16.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").openapi({
|
|
1428
1443
|
default: [
|
|
1429
1444
|
{
|
|
1430
1445
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
|
@@ -1451,8 +1466,8 @@ function parseStringifiedQueryField(val) {
|
|
|
1451
1466
|
}
|
|
1452
1467
|
return val;
|
|
1453
1468
|
}
|
|
1454
|
-
var SearchQuery =
|
|
1455
|
-
query:
|
|
1469
|
+
var SearchQuery = import_zod16.z.object({
|
|
1470
|
+
query: import_zod16.z.preprocess(parseStringifiedQueryField, QueryType).openapi({
|
|
1456
1471
|
default: {
|
|
1457
1472
|
type: "and",
|
|
1458
1473
|
clauses: [
|
|
@@ -1472,33 +1487,36 @@ var SearchQuery = import_zod15.z.object({
|
|
|
1472
1487
|
]
|
|
1473
1488
|
}
|
|
1474
1489
|
}),
|
|
1475
|
-
limit:
|
|
1476
|
-
offset:
|
|
1477
|
-
sort:
|
|
1490
|
+
limit: import_zod16.z.number().optional().default(100),
|
|
1491
|
+
offset: import_zod16.z.number().optional().default(0),
|
|
1492
|
+
sort: import_zod16.z.preprocess(
|
|
1478
1493
|
parseStringifiedQueryField,
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
field:
|
|
1482
|
-
direction:
|
|
1494
|
+
import_zod16.z.array(
|
|
1495
|
+
import_zod16.z.object({
|
|
1496
|
+
field: import_zod16.z.string(),
|
|
1497
|
+
direction: import_zod16.z.enum(["asc", "desc"]).default("asc")
|
|
1483
1498
|
})
|
|
1484
1499
|
)
|
|
1485
|
-
).optional()
|
|
1500
|
+
).optional(),
|
|
1501
|
+
excludeDrafts: import_zod16.z.boolean().optional().describe(
|
|
1502
|
+
'When true, undeclared drafts (events in status CREATED) are excluded from the results. Used by workqueues so that drafts only appear in the dedicated "My Draft" view, while explicit searches (e.g. by tracking ID) can still find them.'
|
|
1503
|
+
)
|
|
1486
1504
|
}).openapi({
|
|
1487
1505
|
ref: "SearchQuery"
|
|
1488
1506
|
});
|
|
1489
1507
|
|
|
1490
1508
|
// ../commons/src/events/serializers/date/serializer.ts
|
|
1491
|
-
var
|
|
1492
|
-
var SerializedNowDateTime =
|
|
1493
|
-
$$now:
|
|
1509
|
+
var import_zod17 = require("zod");
|
|
1510
|
+
var SerializedNowDateTime = import_zod17.z.object({
|
|
1511
|
+
$$now: import_zod17.z.literal(true)
|
|
1494
1512
|
});
|
|
1495
1513
|
function todayDateTimeValueSerializer() {
|
|
1496
1514
|
return { $$now: true };
|
|
1497
1515
|
}
|
|
1498
1516
|
|
|
1499
1517
|
// ../commons/src/events/FieldConfig.ts
|
|
1500
|
-
(0, import_zod_openapi6.extendZodWithOpenApi)(
|
|
1501
|
-
var FieldId =
|
|
1518
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod18.z);
|
|
1519
|
+
var FieldId = import_zod18.z.string().refine(
|
|
1502
1520
|
/*
|
|
1503
1521
|
* Disallow underscores '_' in field ids.
|
|
1504
1522
|
* Why? Theres two reasons:
|
|
@@ -1511,163 +1529,163 @@ var FieldId = import_zod17.z.string().refine(
|
|
|
1511
1529
|
message: `id: '${val}' must not contain underscores '_'`
|
|
1512
1530
|
})
|
|
1513
1531
|
).describe("Unique identifier for the field");
|
|
1514
|
-
var FieldReference =
|
|
1532
|
+
var FieldReference = import_zod18.z.object({
|
|
1515
1533
|
$$field: FieldId,
|
|
1516
|
-
$$subfield:
|
|
1534
|
+
$$subfield: import_zod18.z.array(import_zod18.z.string()).optional().default([]).describe(
|
|
1517
1535
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1518
1536
|
)
|
|
1519
1537
|
}).describe("Reference to a field by its ID");
|
|
1520
|
-
var ValidationConfig =
|
|
1538
|
+
var ValidationConfig = import_zod18.z.object({
|
|
1521
1539
|
validator: Conditional,
|
|
1522
1540
|
message: TranslationConfig
|
|
1523
1541
|
});
|
|
1524
|
-
var requiredSchema =
|
|
1525
|
-
|
|
1526
|
-
|
|
1542
|
+
var requiredSchema = import_zod18.z.union([
|
|
1543
|
+
import_zod18.z.boolean(),
|
|
1544
|
+
import_zod18.z.object({
|
|
1527
1545
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1528
1546
|
})
|
|
1529
1547
|
]).default(false).optional();
|
|
1530
|
-
var BaseField =
|
|
1548
|
+
var BaseField = import_zod18.z.object({
|
|
1531
1549
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1532
1550
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1533
|
-
parent: FieldReference.or(
|
|
1551
|
+
parent: FieldReference.or(import_zod18.z.array(FieldReference)).optional().describe(
|
|
1534
1552
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1535
1553
|
),
|
|
1536
1554
|
required: requiredSchema.describe(
|
|
1537
1555
|
"Indicates whether the field is mandatory."
|
|
1538
1556
|
),
|
|
1539
|
-
conditionals:
|
|
1557
|
+
conditionals: import_zod18.z.array(FieldConditional).default([]).optional().describe(
|
|
1540
1558
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1541
1559
|
),
|
|
1542
|
-
secured:
|
|
1560
|
+
secured: import_zod18.z.boolean().default(false).optional().describe(
|
|
1543
1561
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1544
1562
|
),
|
|
1545
1563
|
placeholder: TranslationConfig.optional(),
|
|
1546
|
-
validation:
|
|
1564
|
+
validation: import_zod18.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1547
1565
|
helperText: TranslationConfig.optional(),
|
|
1548
|
-
hideLabel:
|
|
1549
|
-
uncorrectable:
|
|
1566
|
+
hideLabel: import_zod18.z.boolean().default(false).optional(),
|
|
1567
|
+
uncorrectable: import_zod18.z.boolean().default(false).optional().describe(
|
|
1550
1568
|
"Indicates whether the field can be modified during record correction."
|
|
1551
1569
|
),
|
|
1552
|
-
value: FieldReference.or(
|
|
1570
|
+
value: FieldReference.or(import_zod18.z.array(FieldReference)).optional().describe(
|
|
1553
1571
|
"Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
|
|
1554
1572
|
),
|
|
1555
|
-
analytics:
|
|
1573
|
+
analytics: import_zod18.z.boolean().default(false).optional().describe(
|
|
1556
1574
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1557
1575
|
),
|
|
1558
|
-
persistWhenHidden:
|
|
1576
|
+
persistWhenHidden: import_zod18.z.boolean().default(false).optional().describe(
|
|
1559
1577
|
"Preserves field value during hidden field cleanup."
|
|
1560
1578
|
)
|
|
1561
1579
|
}).describe("Common properties shared across all field types.");
|
|
1562
1580
|
var Divider = BaseField.extend({
|
|
1563
|
-
type:
|
|
1581
|
+
type: import_zod18.z.literal(FieldType.DIVIDER)
|
|
1564
1582
|
});
|
|
1565
1583
|
var TextField = BaseField.extend({
|
|
1566
|
-
type:
|
|
1567
|
-
defaultValue:
|
|
1568
|
-
configuration:
|
|
1569
|
-
maxLength:
|
|
1570
|
-
type:
|
|
1584
|
+
type: import_zod18.z.literal(FieldType.TEXT),
|
|
1585
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional(),
|
|
1586
|
+
configuration: import_zod18.z.object({
|
|
1587
|
+
maxLength: import_zod18.z.number().optional().describe("Maximum length of the text"),
|
|
1588
|
+
type: import_zod18.z.enum(["text", "password"]).optional(),
|
|
1571
1589
|
prefix: TranslationConfig.optional(),
|
|
1572
1590
|
postfix: TranslationConfig.optional()
|
|
1573
1591
|
}).default({ type: "text" }).optional()
|
|
1574
1592
|
}).describe("Text input");
|
|
1575
1593
|
var NumberField = BaseField.extend({
|
|
1576
|
-
type:
|
|
1594
|
+
type: import_zod18.z.literal(FieldType.NUMBER),
|
|
1577
1595
|
defaultValue: NumberFieldValue.optional(),
|
|
1578
|
-
configuration:
|
|
1579
|
-
min:
|
|
1580
|
-
max:
|
|
1596
|
+
configuration: import_zod18.z.object({
|
|
1597
|
+
min: import_zod18.z.number().optional().describe("Minimum value"),
|
|
1598
|
+
max: import_zod18.z.number().optional().describe("Maximum value"),
|
|
1581
1599
|
prefix: TranslationConfig.optional(),
|
|
1582
1600
|
postfix: TranslationConfig.optional()
|
|
1583
1601
|
}).optional()
|
|
1584
1602
|
}).describe("Number input");
|
|
1585
1603
|
var TextAreaField = BaseField.extend({
|
|
1586
|
-
type:
|
|
1604
|
+
type: import_zod18.z.literal(FieldType.TEXTAREA),
|
|
1587
1605
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1588
|
-
configuration:
|
|
1589
|
-
maxLength:
|
|
1590
|
-
rows:
|
|
1591
|
-
cols:
|
|
1606
|
+
configuration: import_zod18.z.object({
|
|
1607
|
+
maxLength: import_zod18.z.number().optional().describe("Maximum length of the text"),
|
|
1608
|
+
rows: import_zod18.z.number().optional().describe("Number of visible text lines"),
|
|
1609
|
+
cols: import_zod18.z.number().optional().describe("Number of visible columns"),
|
|
1592
1610
|
prefix: TranslationConfig.optional(),
|
|
1593
1611
|
postfix: TranslationConfig.optional()
|
|
1594
1612
|
}).default({ rows: 4 }).optional()
|
|
1595
1613
|
}).describe("Multiline text input");
|
|
1596
|
-
var ImageMimeType =
|
|
1614
|
+
var ImageMimeType = import_zod18.z.enum([
|
|
1597
1615
|
"image/png",
|
|
1598
1616
|
"image/jpg",
|
|
1599
1617
|
"image/jpeg",
|
|
1600
1618
|
"image/svg+xml"
|
|
1601
1619
|
]);
|
|
1602
|
-
var DocumentMimeType =
|
|
1620
|
+
var DocumentMimeType = import_zod18.z.enum([
|
|
1603
1621
|
"application/pdf",
|
|
1604
1622
|
"application/msword",
|
|
1605
1623
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1606
1624
|
"application/vnd.oasis.opendocument.text"
|
|
1607
1625
|
]);
|
|
1608
|
-
var MimeType =
|
|
1626
|
+
var MimeType = import_zod18.z.enum([
|
|
1609
1627
|
...ImageMimeType.options,
|
|
1610
1628
|
...DocumentMimeType.options
|
|
1611
1629
|
]);
|
|
1612
1630
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1613
1631
|
var SignatureField = BaseField.extend({
|
|
1614
|
-
type:
|
|
1632
|
+
type: import_zod18.z.literal(FieldType.SIGNATURE),
|
|
1615
1633
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1616
1634
|
"Title of the signature modal"
|
|
1617
1635
|
),
|
|
1618
1636
|
defaultValue: SignatureFieldValue.optional(),
|
|
1619
|
-
configuration:
|
|
1620
|
-
maxFileSize:
|
|
1637
|
+
configuration: import_zod18.z.object({
|
|
1638
|
+
maxFileSize: import_zod18.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1621
1639
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1622
1640
|
}).default({
|
|
1623
1641
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1624
1642
|
})
|
|
1625
1643
|
}).describe("Signature input field");
|
|
1626
1644
|
var EmailField = BaseField.extend({
|
|
1627
|
-
type:
|
|
1628
|
-
configuration:
|
|
1629
|
-
maxLength:
|
|
1645
|
+
type: import_zod18.z.literal(FieldType.EMAIL),
|
|
1646
|
+
configuration: import_zod18.z.object({
|
|
1647
|
+
maxLength: import_zod18.z.number().optional().describe("Maximum length of the text")
|
|
1630
1648
|
}).default({ maxLength: 10 }).optional(),
|
|
1631
|
-
defaultValue:
|
|
1649
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField]).optional()
|
|
1632
1650
|
});
|
|
1633
1651
|
var DateField = BaseField.extend({
|
|
1634
|
-
type:
|
|
1652
|
+
type: import_zod18.z.literal(FieldType.DATE),
|
|
1635
1653
|
defaultValue: SerializedNowDateTime.or(PlainDate).optional().openapi({ effectType: "input", type: "string" }).describe("Default date value(yyyy-MM-dd)"),
|
|
1636
|
-
configuration:
|
|
1654
|
+
configuration: import_zod18.z.object({
|
|
1637
1655
|
notice: TranslationConfig.describe(
|
|
1638
1656
|
"Text to display above the date input"
|
|
1639
1657
|
).optional()
|
|
1640
1658
|
}).optional()
|
|
1641
1659
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1642
1660
|
var AgeField = BaseField.extend({
|
|
1643
|
-
type:
|
|
1661
|
+
type: import_zod18.z.literal(FieldType.AGE),
|
|
1644
1662
|
defaultValue: NumberFieldValue.optional(),
|
|
1645
|
-
configuration:
|
|
1663
|
+
configuration: import_zod18.z.object({
|
|
1646
1664
|
asOfDate: FieldReference,
|
|
1647
1665
|
prefix: TranslationConfig.optional(),
|
|
1648
1666
|
postfix: TranslationConfig.optional()
|
|
1649
1667
|
})
|
|
1650
1668
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1651
1669
|
var TimeField = BaseField.extend({
|
|
1652
|
-
type:
|
|
1670
|
+
type: import_zod18.z.literal(FieldType.TIME),
|
|
1653
1671
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default time value (HH-mm)"),
|
|
1654
|
-
configuration:
|
|
1655
|
-
use12HourFormat:
|
|
1672
|
+
configuration: import_zod18.z.object({
|
|
1673
|
+
use12HourFormat: import_zod18.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1656
1674
|
notice: TranslationConfig.describe(
|
|
1657
1675
|
"Text to display above the time input"
|
|
1658
1676
|
).optional()
|
|
1659
1677
|
}).optional()
|
|
1660
1678
|
}).describe("A single date input (HH-mm)");
|
|
1661
1679
|
var DateRangeField = BaseField.extend({
|
|
1662
|
-
type:
|
|
1680
|
+
type: import_zod18.z.literal(FieldType.DATE_RANGE),
|
|
1663
1681
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1664
|
-
configuration:
|
|
1682
|
+
configuration: import_zod18.z.object({
|
|
1665
1683
|
notice: TranslationConfig.describe(
|
|
1666
1684
|
"Text to display above the date input"
|
|
1667
1685
|
).optional()
|
|
1668
1686
|
}).optional()
|
|
1669
1687
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1670
|
-
var HtmlFontVariant =
|
|
1688
|
+
var HtmlFontVariant = import_zod18.z.enum([
|
|
1671
1689
|
"reg12",
|
|
1672
1690
|
"reg14",
|
|
1673
1691
|
"reg16",
|
|
@@ -1677,32 +1695,32 @@ var HtmlFontVariant = import_zod17.z.enum([
|
|
|
1677
1695
|
"h2",
|
|
1678
1696
|
"h1"
|
|
1679
1697
|
]);
|
|
1680
|
-
var ParagraphConfiguration =
|
|
1681
|
-
styles:
|
|
1698
|
+
var ParagraphConfiguration = import_zod18.z.object({
|
|
1699
|
+
styles: import_zod18.z.object({
|
|
1682
1700
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1683
1701
|
"Font variant to use for the paragraph text"
|
|
1684
1702
|
),
|
|
1685
|
-
hint:
|
|
1703
|
+
hint: import_zod18.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1686
1704
|
}).optional()
|
|
1687
1705
|
}).default({});
|
|
1688
1706
|
var Paragraph = BaseField.extend({
|
|
1689
|
-
type:
|
|
1707
|
+
type: import_zod18.z.literal(FieldType.PARAGRAPH),
|
|
1690
1708
|
configuration: ParagraphConfiguration
|
|
1691
1709
|
}).describe("A read-only HTML <p> paragraph");
|
|
1692
1710
|
var PageHeader = BaseField.extend({
|
|
1693
|
-
type:
|
|
1711
|
+
type: import_zod18.z.literal(FieldType.PAGE_HEADER)
|
|
1694
1712
|
}).describe("A read-only header component for form pages");
|
|
1695
1713
|
var File = BaseField.extend({
|
|
1696
|
-
type:
|
|
1714
|
+
type: import_zod18.z.literal(FieldType.FILE),
|
|
1697
1715
|
defaultValue: FileFieldValue.optional(),
|
|
1698
|
-
configuration:
|
|
1699
|
-
maxFileSize:
|
|
1716
|
+
configuration: import_zod18.z.object({
|
|
1717
|
+
maxFileSize: import_zod18.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1700
1718
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1701
|
-
maxImageSize:
|
|
1702
|
-
targetSize:
|
|
1719
|
+
maxImageSize: import_zod18.z.object({
|
|
1720
|
+
targetSize: import_zod18.z.object({ width: import_zod18.z.number(), height: import_zod18.z.number() })
|
|
1703
1721
|
}).optional(),
|
|
1704
|
-
style:
|
|
1705
|
-
width:
|
|
1722
|
+
style: import_zod18.z.object({
|
|
1723
|
+
width: import_zod18.z.enum(["full", "auto"]).optional().describe(
|
|
1706
1724
|
"Whether the file upload button should take the full width of the container or not"
|
|
1707
1725
|
)
|
|
1708
1726
|
}).optional(),
|
|
@@ -1711,46 +1729,46 @@ var File = BaseField.extend({
|
|
|
1711
1729
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1712
1730
|
})
|
|
1713
1731
|
}).describe("File upload");
|
|
1714
|
-
var SelectOption =
|
|
1715
|
-
value:
|
|
1716
|
-
label:
|
|
1717
|
-
conditionals:
|
|
1732
|
+
var SelectOption = import_zod18.z.object({
|
|
1733
|
+
value: import_zod18.z.string().describe("The value of the option"),
|
|
1734
|
+
label: import_zod18.z.union([import_zod18.z.string(), TranslationConfig]).describe("The label of the option"),
|
|
1735
|
+
conditionals: import_zod18.z.array(ActionConditional).default([]).optional()
|
|
1718
1736
|
});
|
|
1719
1737
|
var NumberWithUnitField = BaseField.extend({
|
|
1720
|
-
type:
|
|
1738
|
+
type: import_zod18.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1721
1739
|
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1722
|
-
options:
|
|
1723
|
-
configuration:
|
|
1724
|
-
min:
|
|
1725
|
-
max:
|
|
1740
|
+
options: import_zod18.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
1741
|
+
configuration: import_zod18.z.object({
|
|
1742
|
+
min: import_zod18.z.number().optional().describe("Minimum value of the number field"),
|
|
1743
|
+
max: import_zod18.z.number().optional().describe("Maximum value of the number field"),
|
|
1726
1744
|
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
1727
1745
|
"Placeholder for the number field"
|
|
1728
1746
|
)
|
|
1729
1747
|
}).optional()
|
|
1730
1748
|
}).describe("Number with unit input");
|
|
1731
1749
|
var RadioGroup = BaseField.extend({
|
|
1732
|
-
type:
|
|
1750
|
+
type: import_zod18.z.literal(FieldType.RADIO_GROUP),
|
|
1733
1751
|
defaultValue: TextValue.optional(),
|
|
1734
|
-
options:
|
|
1735
|
-
configuration:
|
|
1736
|
-
styles:
|
|
1737
|
-
size:
|
|
1752
|
+
options: import_zod18.z.array(SelectOption).describe("A list of options"),
|
|
1753
|
+
configuration: import_zod18.z.object({
|
|
1754
|
+
styles: import_zod18.z.object({
|
|
1755
|
+
size: import_zod18.z.enum(["NORMAL", "LARGE"]).optional()
|
|
1738
1756
|
}).optional()
|
|
1739
1757
|
}).optional()
|
|
1740
1758
|
}).describe("Grouped radio options");
|
|
1741
1759
|
var BulletList = BaseField.extend({
|
|
1742
|
-
type:
|
|
1743
|
-
items:
|
|
1744
|
-
configuration:
|
|
1745
|
-
styles:
|
|
1760
|
+
type: import_zod18.z.literal(FieldType.BULLET_LIST),
|
|
1761
|
+
items: import_zod18.z.array(TranslationConfig).describe("A list of items"),
|
|
1762
|
+
configuration: import_zod18.z.object({
|
|
1763
|
+
styles: import_zod18.z.object({
|
|
1746
1764
|
fontVariant: HtmlFontVariant.optional()
|
|
1747
1765
|
}).optional()
|
|
1748
1766
|
}).default({})
|
|
1749
1767
|
}).describe("A list of bullet points");
|
|
1750
1768
|
var Select = BaseField.extend({
|
|
1751
|
-
type:
|
|
1752
|
-
defaultValue:
|
|
1753
|
-
options:
|
|
1769
|
+
type: import_zod18.z.literal(FieldType.SELECT),
|
|
1770
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserDataField]).optional(),
|
|
1771
|
+
options: import_zod18.z.array(SelectOption).describe("A list of options"),
|
|
1754
1772
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1755
1773
|
`
|
|
1756
1774
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1762,37 +1780,37 @@ var Select = BaseField.extend({
|
|
|
1762
1780
|
`
|
|
1763
1781
|
)
|
|
1764
1782
|
}).describe("Select input");
|
|
1765
|
-
var SelectDateRangeOption =
|
|
1783
|
+
var SelectDateRangeOption = import_zod18.z.object({
|
|
1766
1784
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1767
1785
|
label: TranslationConfig.describe("The label of the option")
|
|
1768
1786
|
});
|
|
1769
1787
|
var SelectDateRangeField = BaseField.extend({
|
|
1770
|
-
type:
|
|
1788
|
+
type: import_zod18.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
1771
1789
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1772
|
-
options:
|
|
1790
|
+
options: import_zod18.z.array(SelectDateRangeOption).describe("A list of options")
|
|
1773
1791
|
}).describe("Select input with date range options");
|
|
1774
|
-
var NameConfig =
|
|
1775
|
-
firstname:
|
|
1776
|
-
middlename:
|
|
1777
|
-
surname:
|
|
1792
|
+
var NameConfig = import_zod18.z.object({
|
|
1793
|
+
firstname: import_zod18.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1794
|
+
middlename: import_zod18.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1795
|
+
surname: import_zod18.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1778
1796
|
});
|
|
1779
1797
|
var NameField = BaseField.extend({
|
|
1780
|
-
type:
|
|
1781
|
-
defaultValue:
|
|
1798
|
+
type: import_zod18.z.literal(FieldType.NAME),
|
|
1799
|
+
defaultValue: import_zod18.z.object({
|
|
1782
1800
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1783
1801
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1784
1802
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1785
1803
|
}).optional(),
|
|
1786
|
-
configuration:
|
|
1804
|
+
configuration: import_zod18.z.object({
|
|
1787
1805
|
name: NameConfig.default({
|
|
1788
1806
|
firstname: { required: true },
|
|
1789
1807
|
surname: { required: true }
|
|
1790
1808
|
}).optional(),
|
|
1791
|
-
order:
|
|
1792
|
-
maxLength:
|
|
1809
|
+
order: import_zod18.z.array(import_zod18.z.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1810
|
+
maxLength: import_zod18.z.number().optional().describe("Maximum length of the text"),
|
|
1793
1811
|
prefix: TranslationConfig.optional(),
|
|
1794
1812
|
postfix: TranslationConfig.optional(),
|
|
1795
|
-
showParentFieldError:
|
|
1813
|
+
showParentFieldError: import_zod18.z.boolean().default(false).optional().describe(
|
|
1796
1814
|
`If true, shows the parent field error and hides the subfield error`
|
|
1797
1815
|
)
|
|
1798
1816
|
}).default({
|
|
@@ -1803,53 +1821,53 @@ var NameField = BaseField.extend({
|
|
|
1803
1821
|
}).optional()
|
|
1804
1822
|
}).describe("Name input field");
|
|
1805
1823
|
var PhoneField = BaseField.extend({
|
|
1806
|
-
defaultValue:
|
|
1807
|
-
type:
|
|
1824
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1825
|
+
type: import_zod18.z.literal(FieldType.PHONE)
|
|
1808
1826
|
}).describe("Phone input field");
|
|
1809
1827
|
var IdField = BaseField.extend({
|
|
1810
|
-
defaultValue:
|
|
1811
|
-
type:
|
|
1828
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserDataField]).optional(),
|
|
1829
|
+
type: import_zod18.z.literal(FieldType.ID)
|
|
1812
1830
|
}).describe("ID input field");
|
|
1813
1831
|
var Checkbox = BaseField.extend({
|
|
1814
|
-
type:
|
|
1832
|
+
type: import_zod18.z.literal(FieldType.CHECKBOX),
|
|
1815
1833
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1816
1834
|
}).describe("Boolean checkbox field");
|
|
1817
1835
|
var Country = BaseField.extend({
|
|
1818
|
-
type:
|
|
1836
|
+
type: import_zod18.z.literal(FieldType.COUNTRY),
|
|
1819
1837
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1820
|
-
optionOverrides:
|
|
1838
|
+
optionOverrides: import_zod18.z.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1821
1839
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1822
1840
|
)
|
|
1823
1841
|
}).describe("Country select field");
|
|
1824
|
-
var AdministrativeAreas =
|
|
1842
|
+
var AdministrativeAreas = import_zod18.z.enum([
|
|
1825
1843
|
"ADMIN_STRUCTURE",
|
|
1826
1844
|
"HEALTH_FACILITY",
|
|
1827
1845
|
"CRVS_OFFICE"
|
|
1828
1846
|
]);
|
|
1829
|
-
var AdministrativeAreaConfiguration =
|
|
1847
|
+
var AdministrativeAreaConfiguration = import_zod18.z.object({
|
|
1830
1848
|
partOf: FieldReference.optional(),
|
|
1831
1849
|
type: AdministrativeAreas
|
|
1832
1850
|
}).describe("Administrative area options");
|
|
1833
1851
|
var AdministrativeArea = BaseField.extend({
|
|
1834
|
-
type:
|
|
1835
|
-
defaultValue:
|
|
1852
|
+
type: import_zod18.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1853
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1836
1854
|
configuration: AdministrativeAreaConfiguration
|
|
1837
1855
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1838
1856
|
var LocationInput = BaseField.extend({
|
|
1839
|
-
type:
|
|
1857
|
+
type: import_zod18.z.literal(FieldType.LOCATION),
|
|
1840
1858
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1841
|
-
configuration:
|
|
1842
|
-
searchableResource:
|
|
1859
|
+
configuration: import_zod18.z.object({
|
|
1860
|
+
searchableResource: import_zod18.z.array(import_zod18.z.enum(["locations", "facilities", "offices"]))
|
|
1843
1861
|
})
|
|
1844
1862
|
}).describe("Input field for a location");
|
|
1845
1863
|
var FileUploadWithOptions = BaseField.extend({
|
|
1846
|
-
type:
|
|
1847
|
-
options:
|
|
1864
|
+
type: import_zod18.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1865
|
+
options: import_zod18.z.array(SelectOption).describe("A list of options"),
|
|
1848
1866
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1849
|
-
configuration:
|
|
1850
|
-
maxFileSize:
|
|
1851
|
-
maxImageSize:
|
|
1852
|
-
targetSize:
|
|
1867
|
+
configuration: import_zod18.z.object({
|
|
1868
|
+
maxFileSize: import_zod18.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1869
|
+
maxImageSize: import_zod18.z.object({
|
|
1870
|
+
targetSize: import_zod18.z.object({ width: import_zod18.z.number(), height: import_zod18.z.number() })
|
|
1853
1871
|
}).optional(),
|
|
1854
1872
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1855
1873
|
}).default({
|
|
@@ -1857,15 +1875,15 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1857
1875
|
})
|
|
1858
1876
|
});
|
|
1859
1877
|
var Facility = BaseField.extend({
|
|
1860
|
-
type:
|
|
1861
|
-
defaultValue:
|
|
1878
|
+
type: import_zod18.z.literal(FieldType.FACILITY),
|
|
1879
|
+
defaultValue: import_zod18.z.union([NonEmptyTextValue, SerializedUserField, SerializedUserDataField]).optional()
|
|
1862
1880
|
}).describe("Input field for a facility");
|
|
1863
1881
|
var Office = BaseField.extend({
|
|
1864
|
-
type:
|
|
1882
|
+
type: import_zod18.z.literal(FieldType.OFFICE),
|
|
1865
1883
|
defaultValue: NonEmptyTextValue.optional()
|
|
1866
1884
|
}).describe("Input field for an office");
|
|
1867
1885
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1868
|
-
administrativeArea:
|
|
1886
|
+
administrativeArea: import_zod18.z.union([UUID, SerializedUserField]).optional()
|
|
1869
1887
|
});
|
|
1870
1888
|
var commonDomesticFieldProps = {
|
|
1871
1889
|
id: true,
|
|
@@ -1881,86 +1899,86 @@ var DomesticAddressField = Country.partial().pick({
|
|
|
1881
1899
|
AdministrativeArea.partial().pick(commonDomesticFieldProps).required({ id: true, type: true })
|
|
1882
1900
|
);
|
|
1883
1901
|
var Address = BaseField.extend({
|
|
1884
|
-
type:
|
|
1885
|
-
configuration:
|
|
1886
|
-
lineSeparator:
|
|
1887
|
-
fields:
|
|
1888
|
-
streetAddressForm:
|
|
1889
|
-
|
|
1890
|
-
id:
|
|
1902
|
+
type: import_zod18.z.literal(FieldType.ADDRESS),
|
|
1903
|
+
configuration: import_zod18.z.object({
|
|
1904
|
+
lineSeparator: import_zod18.z.string().optional(),
|
|
1905
|
+
fields: import_zod18.z.array(DomesticAddressField).optional(),
|
|
1906
|
+
streetAddressForm: import_zod18.z.array(
|
|
1907
|
+
import_zod18.z.object({
|
|
1908
|
+
id: import_zod18.z.string(),
|
|
1891
1909
|
required: requiredSchema,
|
|
1892
1910
|
label: TranslationConfig,
|
|
1893
|
-
type:
|
|
1894
|
-
conditionals:
|
|
1911
|
+
type: import_zod18.z.literal(FieldType.TEXT),
|
|
1912
|
+
conditionals: import_zod18.z.array(FieldConditional).default([]).optional(),
|
|
1895
1913
|
parent: FieldReference.optional()
|
|
1896
1914
|
})
|
|
1897
1915
|
).optional()
|
|
1898
1916
|
}).optional(),
|
|
1899
1917
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1900
1918
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1901
|
-
var StaticDataEntry =
|
|
1902
|
-
id:
|
|
1919
|
+
var StaticDataEntry = import_zod18.z.object({
|
|
1920
|
+
id: import_zod18.z.string().describe("ID for the data entry."),
|
|
1903
1921
|
label: TranslationConfig,
|
|
1904
|
-
value: TranslationConfig.or(
|
|
1922
|
+
value: TranslationConfig.or(import_zod18.z.string()).or(FieldReference)
|
|
1905
1923
|
}).describe("Static data entry");
|
|
1906
|
-
var DataEntry =
|
|
1924
|
+
var DataEntry = import_zod18.z.union([StaticDataEntry, import_zod18.z.object({ fieldId: import_zod18.z.string() })]).describe(
|
|
1907
1925
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1908
1926
|
);
|
|
1909
1927
|
var DataField = BaseField.extend({
|
|
1910
|
-
type:
|
|
1911
|
-
configuration:
|
|
1928
|
+
type: import_zod18.z.literal(FieldType.DATA),
|
|
1929
|
+
configuration: import_zod18.z.object({
|
|
1912
1930
|
subtitle: TranslationConfig.optional(),
|
|
1913
|
-
data:
|
|
1931
|
+
data: import_zod18.z.array(DataEntry)
|
|
1914
1932
|
})
|
|
1915
1933
|
}).describe("Data field for displaying read-only data");
|
|
1916
1934
|
var ButtonField = BaseField.extend({
|
|
1917
|
-
type:
|
|
1935
|
+
type: import_zod18.z.literal(FieldType.BUTTON),
|
|
1918
1936
|
defaultValue: ButtonFieldValue.optional(),
|
|
1919
|
-
configuration:
|
|
1920
|
-
icon:
|
|
1937
|
+
configuration: import_zod18.z.object({
|
|
1938
|
+
icon: import_zod18.z.string().optional().describe(
|
|
1921
1939
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1922
1940
|
),
|
|
1923
|
-
loading:
|
|
1941
|
+
loading: import_zod18.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1924
1942
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1925
1943
|
})
|
|
1926
1944
|
}).describe("Generic button without any built-in functionality");
|
|
1927
1945
|
var FieldGroup = BaseField.extend({
|
|
1928
|
-
type:
|
|
1946
|
+
type: import_zod18.z.literal(FieldType.FIELD_GROUP),
|
|
1929
1947
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1930
|
-
fields:
|
|
1948
|
+
fields: import_zod18.z.lazy(() => import_zod18.z.array(FieldConfig))
|
|
1931
1949
|
});
|
|
1932
1950
|
var AlphaPrintButton = BaseField.extend({
|
|
1933
|
-
type:
|
|
1934
|
-
configuration:
|
|
1935
|
-
template:
|
|
1951
|
+
type: import_zod18.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1952
|
+
configuration: import_zod18.z.object({
|
|
1953
|
+
template: import_zod18.z.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1936
1954
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1937
1955
|
"Label for the print button"
|
|
1938
1956
|
)
|
|
1939
1957
|
})
|
|
1940
1958
|
}).describe("Print button field for printing certificates");
|
|
1941
1959
|
var HttpField = BaseField.extend({
|
|
1942
|
-
type:
|
|
1960
|
+
type: import_zod18.z.literal(FieldType.HTTP),
|
|
1943
1961
|
defaultValue: HttpFieldValue.optional(),
|
|
1944
|
-
configuration:
|
|
1962
|
+
configuration: import_zod18.z.object({
|
|
1945
1963
|
trigger: FieldReference,
|
|
1946
|
-
url:
|
|
1947
|
-
method:
|
|
1948
|
-
headers:
|
|
1949
|
-
body:
|
|
1950
|
-
errorValue:
|
|
1951
|
-
params:
|
|
1952
|
-
timeout:
|
|
1964
|
+
url: import_zod18.z.string().describe("URL to send the HTTP request to"),
|
|
1965
|
+
method: import_zod18.z.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1966
|
+
headers: import_zod18.z.record(import_zod18.z.string()).optional(),
|
|
1967
|
+
body: import_zod18.z.record(import_zod18.z.any()).optional(),
|
|
1968
|
+
errorValue: import_zod18.z.any().optional().describe("Value to set if the request fails"),
|
|
1969
|
+
params: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.union([import_zod18.z.string(), FieldReference])).optional(),
|
|
1970
|
+
timeout: import_zod18.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1953
1971
|
})
|
|
1954
1972
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1955
1973
|
var SearchField = HttpField.extend({
|
|
1956
|
-
type:
|
|
1974
|
+
type: import_zod18.z.literal(FieldType.SEARCH),
|
|
1957
1975
|
configuration: SearchQuery.pick({
|
|
1958
1976
|
query: true,
|
|
1959
1977
|
limit: true,
|
|
1960
1978
|
offset: true
|
|
1961
1979
|
}).extend({
|
|
1962
1980
|
validation: ValidationConfig,
|
|
1963
|
-
indicators:
|
|
1981
|
+
indicators: import_zod18.z.object({
|
|
1964
1982
|
loading: TranslationConfig.optional().describe(
|
|
1965
1983
|
"Text to display while the search is in progress"
|
|
1966
1984
|
),
|
|
@@ -1975,7 +1993,7 @@ var SearchField = HttpField.extend({
|
|
|
1975
1993
|
),
|
|
1976
1994
|
confirmButton: TranslationConfig.optional(),
|
|
1977
1995
|
clearButton: TranslationConfig.optional(),
|
|
1978
|
-
clearModal:
|
|
1996
|
+
clearModal: import_zod18.z.object({
|
|
1979
1997
|
title: TranslationConfig.optional(),
|
|
1980
1998
|
description: TranslationConfig.optional(),
|
|
1981
1999
|
cancel: TranslationConfig.optional(),
|
|
@@ -1985,18 +2003,34 @@ var SearchField = HttpField.extend({
|
|
|
1985
2003
|
}).optional()
|
|
1986
2004
|
})
|
|
1987
2005
|
});
|
|
2006
|
+
var Icd11Field = BaseField.extend({
|
|
2007
|
+
type: import_zod18.z.literal(FieldType.ICD11),
|
|
2008
|
+
defaultValue: Icd11FieldValue.optional(),
|
|
2009
|
+
configuration: import_zod18.z.object({
|
|
2010
|
+
url: import_zod18.z.string().describe(
|
|
2011
|
+
"URL of the ICD-11 search endpoint. Should point at a countryconfig-hosted proxy route rather than the WHO API directly, since the WHO access token must stay server-side."
|
|
2012
|
+
),
|
|
2013
|
+
apiVersion: import_zod18.z.string().default("v2").describe("Value sent as the WHO ICD-11 API `api-version` header"),
|
|
2014
|
+
chapterFilter: import_zod18.z.string().optional().describe(
|
|
2015
|
+
"Semicolon-separated list of ICD-11 chapters to restrict the search to, forwarded as-is to the WHO API `chapterFilter` parameter"
|
|
2016
|
+
),
|
|
2017
|
+
timeout: import_zod18.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2018
|
+
}).describe("ICD-11 search field configuration")
|
|
2019
|
+
}).describe(
|
|
2020
|
+
"Debounced, searchable ICD-11 diagnosis code field backed by the WHO ICD-11 search API"
|
|
2021
|
+
);
|
|
1988
2022
|
var LinkButtonField = BaseField.extend({
|
|
1989
|
-
type:
|
|
1990
|
-
configuration:
|
|
1991
|
-
url:
|
|
2023
|
+
type: import_zod18.z.literal(FieldType.LINK_BUTTON),
|
|
2024
|
+
configuration: import_zod18.z.object({
|
|
2025
|
+
url: import_zod18.z.string().describe("URL to open"),
|
|
1992
2026
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1993
|
-
icon:
|
|
2027
|
+
icon: import_zod18.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1994
2028
|
})
|
|
1995
2029
|
}).describe("Button that opens a link");
|
|
1996
2030
|
var VerificationStatus = BaseField.extend({
|
|
1997
|
-
type:
|
|
2031
|
+
type: import_zod18.z.literal(FieldType.VERIFICATION_STATUS),
|
|
1998
2032
|
defaultValue: VerificationStatusValue.optional(),
|
|
1999
|
-
configuration:
|
|
2033
|
+
configuration: import_zod18.z.object({
|
|
2000
2034
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2001
2035
|
description: TranslationConfig.describe(
|
|
2002
2036
|
"Explaining text on the banner in form."
|
|
@@ -2004,38 +2038,38 @@ var VerificationStatus = BaseField.extend({
|
|
|
2004
2038
|
})
|
|
2005
2039
|
});
|
|
2006
2040
|
var QueryParamReaderField = BaseField.extend({
|
|
2007
|
-
type:
|
|
2008
|
-
configuration:
|
|
2009
|
-
pickParams:
|
|
2041
|
+
type: import_zod18.z.literal(FieldType.QUERY_PARAM_READER),
|
|
2042
|
+
configuration: import_zod18.z.object({
|
|
2043
|
+
pickParams: import_zod18.z.array(import_zod18.z.string()).describe("List of query parameters to read from the URL")
|
|
2010
2044
|
})
|
|
2011
2045
|
}).describe(
|
|
2012
2046
|
"A field that maps URL query params into form values and clears them afterward"
|
|
2013
2047
|
);
|
|
2014
2048
|
var QrReaderField = BaseField.extend({
|
|
2015
|
-
type:
|
|
2049
|
+
type: import_zod18.z.literal(FieldType.QR_READER),
|
|
2016
2050
|
defaultValue: QrReaderFieldValue.optional(),
|
|
2017
|
-
configuration:
|
|
2018
|
-
validator:
|
|
2051
|
+
configuration: import_zod18.z.object({
|
|
2052
|
+
validator: import_zod18.z.custom(
|
|
2019
2053
|
(val) => typeof val === "object" && val !== null
|
|
2020
2054
|
)
|
|
2021
2055
|
}).optional()
|
|
2022
2056
|
});
|
|
2023
2057
|
var IdReaderField = BaseField.extend({
|
|
2024
|
-
type:
|
|
2058
|
+
type: import_zod18.z.literal(FieldType.ID_READER),
|
|
2025
2059
|
defaultValue: IdReaderFieldValue.optional(),
|
|
2026
|
-
methods:
|
|
2027
|
-
|
|
2060
|
+
methods: import_zod18.z.array(
|
|
2061
|
+
import_zod18.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2028
2062
|
)
|
|
2029
2063
|
});
|
|
2030
2064
|
var LoaderField = BaseField.extend({
|
|
2031
|
-
type:
|
|
2032
|
-
configuration:
|
|
2065
|
+
type: import_zod18.z.literal(FieldType.LOADER),
|
|
2066
|
+
configuration: import_zod18.z.object({
|
|
2033
2067
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2034
2068
|
})
|
|
2035
2069
|
}).describe(
|
|
2036
2070
|
"A non-interactive field that indicates an in progress operation in form"
|
|
2037
2071
|
);
|
|
2038
|
-
var FieldConfig =
|
|
2072
|
+
var FieldConfig = import_zod18.z.discriminatedUnion("type", [
|
|
2039
2073
|
FieldGroup,
|
|
2040
2074
|
Address,
|
|
2041
2075
|
TextField,
|
|
@@ -2076,32 +2110,33 @@ var FieldConfig = import_zod17.z.discriminatedUnion("type", [
|
|
|
2076
2110
|
IdReaderField,
|
|
2077
2111
|
QueryParamReaderField,
|
|
2078
2112
|
LoaderField,
|
|
2079
|
-
SearchField
|
|
2113
|
+
SearchField,
|
|
2114
|
+
Icd11Field
|
|
2080
2115
|
]).openapi({
|
|
2081
2116
|
description: "Form field configuration",
|
|
2082
2117
|
ref: "FieldConfig"
|
|
2083
2118
|
});
|
|
2084
|
-
var AnyFileField =
|
|
2119
|
+
var AnyFileField = import_zod18.z.discriminatedUnion("type", [
|
|
2085
2120
|
SignatureField,
|
|
2086
2121
|
File,
|
|
2087
2122
|
FileUploadWithOptions
|
|
2088
2123
|
]);
|
|
2089
2124
|
|
|
2090
2125
|
// ../commons/src/events/FormConfig.ts
|
|
2091
|
-
var
|
|
2126
|
+
var import_zod20 = require("zod");
|
|
2092
2127
|
|
|
2093
2128
|
// ../commons/src/events/PageConfig.ts
|
|
2094
|
-
var
|
|
2129
|
+
var import_zod19 = require("zod");
|
|
2095
2130
|
var import_zod_openapi7 = require("zod-openapi");
|
|
2096
|
-
(0, import_zod_openapi7.extendZodWithOpenApi)(
|
|
2097
|
-
var PageTypes =
|
|
2098
|
-
var PageConfigBase =
|
|
2099
|
-
id:
|
|
2131
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod19.z);
|
|
2132
|
+
var PageTypes = import_zod19.z.enum(["FORM", "VERIFICATION"]);
|
|
2133
|
+
var PageConfigBase = import_zod19.z.object({
|
|
2134
|
+
id: import_zod19.z.string().describe("Unique identifier for the page"),
|
|
2100
2135
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2101
|
-
requireCompletionToContinue:
|
|
2136
|
+
requireCompletionToContinue: import_zod19.z.boolean().default(false).describe(
|
|
2102
2137
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2103
2138
|
),
|
|
2104
|
-
fields:
|
|
2139
|
+
fields: import_zod19.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2105
2140
|
conditional: Conditional.optional().describe(
|
|
2106
2141
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2107
2142
|
)
|
|
@@ -2110,13 +2145,13 @@ var PageConfigBase = import_zod18.z.object({
|
|
|
2110
2145
|
ref: "FormPageConfig"
|
|
2111
2146
|
});
|
|
2112
2147
|
var FormPageConfig = PageConfigBase.extend({
|
|
2113
|
-
type:
|
|
2148
|
+
type: import_zod19.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2114
2149
|
});
|
|
2115
|
-
var VerificationActionConfig =
|
|
2116
|
-
verify:
|
|
2117
|
-
cancel:
|
|
2150
|
+
var VerificationActionConfig = import_zod19.z.object({
|
|
2151
|
+
verify: import_zod19.z.object({ label: TranslationConfig }),
|
|
2152
|
+
cancel: import_zod19.z.object({
|
|
2118
2153
|
label: TranslationConfig,
|
|
2119
|
-
confirmation:
|
|
2154
|
+
confirmation: import_zod19.z.object({
|
|
2120
2155
|
title: TranslationConfig,
|
|
2121
2156
|
body: TranslationConfig
|
|
2122
2157
|
})
|
|
@@ -2126,33 +2161,33 @@ var VerificationActionConfig = import_zod18.z.object({
|
|
|
2126
2161
|
ref: "VerificationActionConfig"
|
|
2127
2162
|
});
|
|
2128
2163
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2129
|
-
type:
|
|
2164
|
+
type: import_zod19.z.literal(PageTypes.enum.VERIFICATION),
|
|
2130
2165
|
actions: VerificationActionConfig
|
|
2131
2166
|
});
|
|
2132
|
-
var PageConfig =
|
|
2167
|
+
var PageConfig = import_zod19.z.discriminatedUnion("type", [
|
|
2133
2168
|
FormPageConfig,
|
|
2134
2169
|
VerificationPageConfig
|
|
2135
2170
|
]);
|
|
2136
2171
|
|
|
2137
2172
|
// ../commons/src/events/FormConfig.ts
|
|
2138
|
-
var DeclarationFormConfig =
|
|
2173
|
+
var DeclarationFormConfig = import_zod20.z.object({
|
|
2139
2174
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2140
|
-
pages:
|
|
2175
|
+
pages: import_zod20.z.array(FormPageConfig)
|
|
2141
2176
|
}).describe("Configuration of the declaration form.");
|
|
2142
|
-
var ActionFormConfig =
|
|
2177
|
+
var ActionFormConfig = import_zod20.z.object({
|
|
2143
2178
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2144
|
-
pages:
|
|
2179
|
+
pages: import_zod20.z.array(PageConfig)
|
|
2145
2180
|
}).describe(
|
|
2146
2181
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2147
2182
|
);
|
|
2148
|
-
var FormConfig =
|
|
2183
|
+
var FormConfig = import_zod20.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2149
2184
|
|
|
2150
2185
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2151
|
-
var
|
|
2186
|
+
var import_zod21 = require("zod");
|
|
2152
2187
|
var import_zod_openapi8 = require("zod-openapi");
|
|
2153
|
-
(0, import_zod_openapi8.extendZodWithOpenApi)(
|
|
2154
|
-
var FieldReference2 =
|
|
2155
|
-
var Matcher =
|
|
2188
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod21.z);
|
|
2189
|
+
var FieldReference2 = import_zod21.z.string();
|
|
2190
|
+
var Matcher = import_zod21.z.object({
|
|
2156
2191
|
/**
|
|
2157
2192
|
* Reference to the field used in matching.
|
|
2158
2193
|
*
|
|
@@ -2160,23 +2195,23 @@ var Matcher = import_zod20.z.object({
|
|
|
2160
2195
|
* be used as the origin date to calculate the distance from.
|
|
2161
2196
|
*/
|
|
2162
2197
|
fieldId: FieldReference2,
|
|
2163
|
-
options:
|
|
2164
|
-
boost:
|
|
2198
|
+
options: import_zod21.z.object({
|
|
2199
|
+
boost: import_zod21.z.number().optional(),
|
|
2165
2200
|
matchAgainst: FieldReference2.optional()
|
|
2166
2201
|
}).optional().default({
|
|
2167
2202
|
boost: 1
|
|
2168
2203
|
})
|
|
2169
2204
|
});
|
|
2170
2205
|
var FuzzyMatcher = Matcher.extend({
|
|
2171
|
-
type:
|
|
2172
|
-
options:
|
|
2206
|
+
type: import_zod21.z.literal("fuzzy"),
|
|
2207
|
+
options: import_zod21.z.object({
|
|
2173
2208
|
/**
|
|
2174
2209
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2175
2210
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2176
2211
|
* Names of length >7 characters = 2 edits allowed
|
|
2177
2212
|
*/
|
|
2178
|
-
fuzziness:
|
|
2179
|
-
boost:
|
|
2213
|
+
fuzziness: import_zod21.z.union([import_zod21.z.string(), import_zod21.z.number()]).optional().default("AUTO:4,7"),
|
|
2214
|
+
boost: import_zod21.z.number().optional().default(1),
|
|
2180
2215
|
matchAgainst: FieldReference2.optional()
|
|
2181
2216
|
}).optional().default({
|
|
2182
2217
|
fuzziness: "AUTO:4,7",
|
|
@@ -2184,48 +2219,48 @@ var FuzzyMatcher = Matcher.extend({
|
|
|
2184
2219
|
})
|
|
2185
2220
|
});
|
|
2186
2221
|
var StrictMatcher = Matcher.extend({
|
|
2187
|
-
type:
|
|
2188
|
-
options:
|
|
2189
|
-
boost:
|
|
2222
|
+
type: import_zod21.z.literal("strict"),
|
|
2223
|
+
options: import_zod21.z.object({
|
|
2224
|
+
boost: import_zod21.z.number().optional().default(1),
|
|
2190
2225
|
/**
|
|
2191
2226
|
* The constant value to be present in the field for both records
|
|
2192
2227
|
*/
|
|
2193
|
-
value:
|
|
2228
|
+
value: import_zod21.z.string().optional(),
|
|
2194
2229
|
matchAgainst: FieldReference2.optional()
|
|
2195
2230
|
}).optional().default({
|
|
2196
2231
|
boost: 1
|
|
2197
2232
|
})
|
|
2198
2233
|
});
|
|
2199
2234
|
var DateRangeMatcher = Matcher.extend({
|
|
2200
|
-
type:
|
|
2201
|
-
options:
|
|
2235
|
+
type: import_zod21.z.literal("dateRange"),
|
|
2236
|
+
options: import_zod21.z.object({
|
|
2202
2237
|
/**
|
|
2203
2238
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2204
2239
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2205
2240
|
*/
|
|
2206
|
-
pivot:
|
|
2207
|
-
days:
|
|
2208
|
-
boost:
|
|
2241
|
+
pivot: import_zod21.z.number().optional(),
|
|
2242
|
+
days: import_zod21.z.number(),
|
|
2243
|
+
boost: import_zod21.z.number().optional().default(1),
|
|
2209
2244
|
matchAgainst: FieldReference2.optional()
|
|
2210
2245
|
})
|
|
2211
2246
|
});
|
|
2212
|
-
var Not =
|
|
2213
|
-
type:
|
|
2247
|
+
var Not = import_zod21.z.object({
|
|
2248
|
+
type: import_zod21.z.literal("not"),
|
|
2214
2249
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2215
|
-
clause:
|
|
2250
|
+
clause: import_zod21.z.lazy(() => Clause)
|
|
2216
2251
|
});
|
|
2217
|
-
var And =
|
|
2218
|
-
type:
|
|
2252
|
+
var And = import_zod21.z.object({
|
|
2253
|
+
type: import_zod21.z.literal("and"),
|
|
2219
2254
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2220
|
-
clauses:
|
|
2255
|
+
clauses: import_zod21.z.lazy(() => Clause.array())
|
|
2221
2256
|
});
|
|
2222
|
-
var Or =
|
|
2223
|
-
type:
|
|
2257
|
+
var Or = import_zod21.z.object({
|
|
2258
|
+
type: import_zod21.z.literal("or"),
|
|
2224
2259
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2225
|
-
clauses:
|
|
2260
|
+
clauses: import_zod21.z.lazy(() => Clause.array())
|
|
2226
2261
|
});
|
|
2227
|
-
var Clause =
|
|
2228
|
-
() =>
|
|
2262
|
+
var Clause = import_zod21.z.lazy(
|
|
2263
|
+
() => import_zod21.z.discriminatedUnion("type", [
|
|
2229
2264
|
Not,
|
|
2230
2265
|
And,
|
|
2231
2266
|
Or,
|
|
@@ -2236,22 +2271,22 @@ var Clause = import_zod20.z.lazy(
|
|
|
2236
2271
|
).openapi({
|
|
2237
2272
|
ref: "Clause"
|
|
2238
2273
|
});
|
|
2239
|
-
var DeduplicationConfig =
|
|
2240
|
-
id:
|
|
2274
|
+
var DeduplicationConfig = import_zod21.z.object({
|
|
2275
|
+
id: import_zod21.z.string(),
|
|
2241
2276
|
label: TranslationConfig,
|
|
2242
2277
|
query: Clause
|
|
2243
2278
|
});
|
|
2244
2279
|
|
|
2245
2280
|
// ../commons/src/events/ActionConfig.ts
|
|
2246
2281
|
var import_zod_openapi9 = require("zod-openapi");
|
|
2247
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(
|
|
2248
|
-
var DeclarationReviewConfig =
|
|
2282
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod22.z);
|
|
2283
|
+
var DeclarationReviewConfig = import_zod22.z.object({
|
|
2249
2284
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2250
|
-
fields:
|
|
2285
|
+
fields: import_zod22.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2251
2286
|
}).describe(
|
|
2252
2287
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2253
2288
|
);
|
|
2254
|
-
var ActionConfigBase =
|
|
2289
|
+
var ActionConfigBase = import_zod22.z.object({
|
|
2255
2290
|
label: TranslationConfig.describe("Human readable description of the action")
|
|
2256
2291
|
});
|
|
2257
2292
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
@@ -2259,71 +2294,71 @@ var DeclarationActionBase = ActionConfigBase.extend({
|
|
|
2259
2294
|
deduplication: DeduplicationConfig.optional()
|
|
2260
2295
|
});
|
|
2261
2296
|
var ReadActionConfig = ActionConfigBase.merge(
|
|
2262
|
-
|
|
2263
|
-
type:
|
|
2297
|
+
import_zod22.z.object({
|
|
2298
|
+
type: import_zod22.z.literal(ActionType.READ),
|
|
2264
2299
|
review: DeclarationReviewConfig.describe(
|
|
2265
2300
|
"Configuration of the review page for read-only view."
|
|
2266
2301
|
)
|
|
2267
2302
|
})
|
|
2268
2303
|
);
|
|
2269
2304
|
var DeclareConfig = DeclarationActionBase.merge(
|
|
2270
|
-
|
|
2271
|
-
type:
|
|
2305
|
+
import_zod22.z.object({
|
|
2306
|
+
type: import_zod22.z.literal(ActionType.DECLARE)
|
|
2272
2307
|
})
|
|
2273
2308
|
);
|
|
2274
2309
|
var ValidateConfig = DeclarationActionBase.merge(
|
|
2275
|
-
|
|
2276
|
-
type:
|
|
2310
|
+
import_zod22.z.object({
|
|
2311
|
+
type: import_zod22.z.literal(ActionType.VALIDATE)
|
|
2277
2312
|
})
|
|
2278
2313
|
);
|
|
2279
2314
|
var EscalateConfig = DeclarationActionBase.merge(
|
|
2280
|
-
|
|
2281
|
-
type:
|
|
2315
|
+
import_zod22.z.object({
|
|
2316
|
+
type: import_zod22.z.literal(ActionType.ESCALATE)
|
|
2282
2317
|
})
|
|
2283
2318
|
);
|
|
2284
2319
|
var RegisterConfig = DeclarationActionBase.merge(
|
|
2285
|
-
|
|
2286
|
-
type:
|
|
2320
|
+
import_zod22.z.object({
|
|
2321
|
+
type: import_zod22.z.literal(ActionType.REGISTER)
|
|
2287
2322
|
})
|
|
2288
2323
|
);
|
|
2289
2324
|
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2290
|
-
|
|
2291
|
-
type:
|
|
2325
|
+
import_zod22.z.object({
|
|
2326
|
+
type: import_zod22.z.literal(ActionType.REJECT)
|
|
2292
2327
|
})
|
|
2293
2328
|
);
|
|
2294
2329
|
var ArchiveConfig = ActionConfigBase.merge(
|
|
2295
|
-
|
|
2296
|
-
type:
|
|
2330
|
+
import_zod22.z.object({
|
|
2331
|
+
type: import_zod22.z.literal(ActionType.ARCHIVE)
|
|
2297
2332
|
})
|
|
2298
2333
|
);
|
|
2299
2334
|
var DeleteConfig = ActionConfigBase.merge(
|
|
2300
|
-
|
|
2301
|
-
type:
|
|
2335
|
+
import_zod22.z.object({
|
|
2336
|
+
type: import_zod22.z.literal(ActionType.DELETE)
|
|
2302
2337
|
})
|
|
2303
2338
|
);
|
|
2304
2339
|
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2305
|
-
|
|
2306
|
-
type:
|
|
2340
|
+
import_zod22.z.object({
|
|
2341
|
+
type: import_zod22.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2307
2342
|
printForm: ActionFormConfig
|
|
2308
2343
|
})
|
|
2309
2344
|
);
|
|
2310
2345
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2311
|
-
|
|
2312
|
-
type:
|
|
2346
|
+
import_zod22.z.object({
|
|
2347
|
+
type: import_zod22.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2313
2348
|
correctionForm: ActionFormConfig
|
|
2314
2349
|
})
|
|
2315
2350
|
);
|
|
2316
2351
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2317
|
-
|
|
2318
|
-
type:
|
|
2352
|
+
import_zod22.z.object({
|
|
2353
|
+
type: import_zod22.z.literal(ActionType.REJECT_CORRECTION)
|
|
2319
2354
|
})
|
|
2320
2355
|
);
|
|
2321
2356
|
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2322
|
-
|
|
2323
|
-
type:
|
|
2357
|
+
import_zod22.z.object({
|
|
2358
|
+
type: import_zod22.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2324
2359
|
})
|
|
2325
2360
|
);
|
|
2326
|
-
var ActionConfig =
|
|
2361
|
+
var ActionConfig = import_zod22.z.discriminatedUnion("type", [
|
|
2327
2362
|
/*
|
|
2328
2363
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2329
2364
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -2345,7 +2380,7 @@ var ActionConfig = import_zod21.z.discriminatedUnion("type", [
|
|
|
2345
2380
|
]).describe(
|
|
2346
2381
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2347
2382
|
).openapi({ ref: "ActionConfig" });
|
|
2348
|
-
var DeclarationActionConfig =
|
|
2383
|
+
var DeclarationActionConfig = import_zod22.z.discriminatedUnion("type", [
|
|
2349
2384
|
DeclareConfig,
|
|
2350
2385
|
ValidateConfig,
|
|
2351
2386
|
EscalateConfig,
|
|
@@ -2353,80 +2388,87 @@ var DeclarationActionConfig = import_zod21.z.discriminatedUnion("type", [
|
|
|
2353
2388
|
]);
|
|
2354
2389
|
|
|
2355
2390
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2356
|
-
var
|
|
2357
|
-
var FontFamily =
|
|
2358
|
-
normal:
|
|
2359
|
-
bold:
|
|
2360
|
-
italics:
|
|
2361
|
-
bolditalics:
|
|
2362
|
-
});
|
|
2363
|
-
var CertificateConfig =
|
|
2364
|
-
id:
|
|
2365
|
-
event:
|
|
2366
|
-
isV2Template:
|
|
2391
|
+
var import_zod23 = require("zod");
|
|
2392
|
+
var FontFamily = import_zod23.z.object({
|
|
2393
|
+
normal: import_zod23.z.string(),
|
|
2394
|
+
bold: import_zod23.z.string(),
|
|
2395
|
+
italics: import_zod23.z.string(),
|
|
2396
|
+
bolditalics: import_zod23.z.string()
|
|
2397
|
+
});
|
|
2398
|
+
var CertificateConfig = import_zod23.z.object({
|
|
2399
|
+
id: import_zod23.z.string(),
|
|
2400
|
+
event: import_zod23.z.string(),
|
|
2401
|
+
isV2Template: import_zod23.z.boolean().optional(),
|
|
2367
2402
|
label: TranslationConfig,
|
|
2368
|
-
isDefault:
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2403
|
+
isDefault: import_zod23.z.boolean(),
|
|
2404
|
+
/**
|
|
2405
|
+
* Whether the `record.registered.print-certified-copies` scope is required to
|
|
2406
|
+
* receive this template. Defaults to `true` when omitted (backward compatible).
|
|
2407
|
+
* Set to `false` for templates that must be available without the print
|
|
2408
|
+
* permission, e.g. Notification Records printed from the declaration review page.
|
|
2409
|
+
*/
|
|
2410
|
+
requiresPrintPermission: import_zod23.z.boolean().optional(),
|
|
2411
|
+
fee: import_zod23.z.object({
|
|
2412
|
+
onTime: import_zod23.z.number(),
|
|
2413
|
+
late: import_zod23.z.number(),
|
|
2414
|
+
delayed: import_zod23.z.number()
|
|
2373
2415
|
}),
|
|
2374
|
-
svgUrl:
|
|
2375
|
-
fonts:
|
|
2376
|
-
conditionals:
|
|
2416
|
+
svgUrl: import_zod23.z.string(),
|
|
2417
|
+
fonts: import_zod23.z.record(FontFamily).optional(),
|
|
2418
|
+
conditionals: import_zod23.z.array(ShowConditional).optional()
|
|
2377
2419
|
});
|
|
2378
2420
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2379
|
-
hash:
|
|
2380
|
-
svg:
|
|
2421
|
+
hash: import_zod23.z.string().optional(),
|
|
2422
|
+
svg: import_zod23.z.string()
|
|
2381
2423
|
});
|
|
2382
2424
|
|
|
2383
2425
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2384
|
-
var
|
|
2385
|
-
var LanguageConfig =
|
|
2386
|
-
lang:
|
|
2426
|
+
var import_zod24 = require("zod");
|
|
2427
|
+
var LanguageConfig = import_zod24.z.object({
|
|
2428
|
+
lang: import_zod24.z.string(),
|
|
2387
2429
|
/**
|
|
2388
2430
|
* client.csv contents
|
|
2389
2431
|
*/
|
|
2390
|
-
messages:
|
|
2432
|
+
messages: import_zod24.z.record(import_zod24.z.string())
|
|
2391
2433
|
});
|
|
2392
2434
|
|
|
2393
2435
|
// ../commons/src/events/EventConfig.ts
|
|
2394
|
-
var
|
|
2436
|
+
var import_zod30 = require("zod");
|
|
2395
2437
|
|
|
2396
2438
|
// ../commons/src/events/SummaryConfig.ts
|
|
2397
|
-
var
|
|
2398
|
-
var BaseField2 =
|
|
2439
|
+
var import_zod25 = require("zod");
|
|
2440
|
+
var BaseField2 = import_zod25.z.object({
|
|
2399
2441
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2400
2442
|
"Default message displayed when the field value is empty."
|
|
2401
2443
|
),
|
|
2402
|
-
conditionals:
|
|
2444
|
+
conditionals: import_zod25.z.array(ShowConditional).default([]).optional()
|
|
2403
2445
|
});
|
|
2404
2446
|
var ReferenceField = BaseField2.extend({
|
|
2405
|
-
fieldId:
|
|
2447
|
+
fieldId: import_zod25.z.string(),
|
|
2406
2448
|
label: TranslationConfig.optional().describe(
|
|
2407
2449
|
"Overrides the default label from the referenced field when provided."
|
|
2408
2450
|
)
|
|
2409
2451
|
}).describe("Field referencing existing event data by field ID.");
|
|
2410
2452
|
var Field = BaseField2.extend({
|
|
2411
|
-
id:
|
|
2453
|
+
id: import_zod25.z.string().describe("Identifier of the summary field."),
|
|
2412
2454
|
value: TranslationConfig.describe(
|
|
2413
2455
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2414
2456
|
),
|
|
2415
2457
|
label: TranslationConfig
|
|
2416
2458
|
}).describe("Custom field defined for the summary view.");
|
|
2417
|
-
var SummaryConfig =
|
|
2418
|
-
fields:
|
|
2459
|
+
var SummaryConfig = import_zod25.z.object({
|
|
2460
|
+
fields: import_zod25.z.array(import_zod25.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2419
2461
|
}).describe("Configuration of the event summary section.");
|
|
2420
2462
|
|
|
2421
2463
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2422
|
-
var
|
|
2423
|
-
var MatchType =
|
|
2424
|
-
var BaseField3 =
|
|
2425
|
-
config:
|
|
2464
|
+
var import_zod26 = require("zod");
|
|
2465
|
+
var MatchType = import_zod26.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2466
|
+
var BaseField3 = import_zod26.z.object({
|
|
2467
|
+
config: import_zod26.z.object({
|
|
2426
2468
|
type: MatchType.describe(
|
|
2427
2469
|
"Determines the search type of field. How to match value."
|
|
2428
2470
|
),
|
|
2429
|
-
searchFields:
|
|
2471
|
+
searchFields: import_zod26.z.array(import_zod26.z.string()).optional().describe(
|
|
2430
2472
|
`
|
|
2431
2473
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2432
2474
|
All specified fields will be combined using OR logic.
|
|
@@ -2436,7 +2478,7 @@ var BaseField3 = import_zod25.z.object({
|
|
|
2436
2478
|
`
|
|
2437
2479
|
)
|
|
2438
2480
|
}),
|
|
2439
|
-
type:
|
|
2481
|
+
type: import_zod26.z.nativeEnum(FieldType).optional().describe(
|
|
2440
2482
|
`
|
|
2441
2483
|
Explicitly specify the field type for searchFields.
|
|
2442
2484
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2450,7 +2492,7 @@ var BaseField3 = import_zod25.z.object({
|
|
|
2450
2492
|
This is required when searchFields is defined.
|
|
2451
2493
|
`
|
|
2452
2494
|
),
|
|
2453
|
-
options:
|
|
2495
|
+
options: import_zod26.z.array(SelectOption).optional(),
|
|
2454
2496
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2455
2497
|
`
|
|
2456
2498
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2471,7 +2513,7 @@ var BaseField3 = import_zod25.z.object({
|
|
|
2471
2513
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2472
2514
|
`
|
|
2473
2515
|
),
|
|
2474
|
-
conditionals:
|
|
2516
|
+
conditionals: import_zod26.z.array(FieldConditional).default([]).optional().describe(
|
|
2475
2517
|
`
|
|
2476
2518
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2477
2519
|
|
|
@@ -2485,20 +2527,20 @@ var BaseField3 = import_zod25.z.object({
|
|
|
2485
2527
|
are always rendered in the advanced search form.
|
|
2486
2528
|
`
|
|
2487
2529
|
),
|
|
2488
|
-
validations:
|
|
2530
|
+
validations: import_zod26.z.array(ValidationConfig).default([]).optional().describe(
|
|
2489
2531
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2490
2532
|
)
|
|
2491
2533
|
});
|
|
2492
|
-
var SearchQueryParams =
|
|
2493
|
-
eventType:
|
|
2534
|
+
var SearchQueryParams = import_zod26.z.object({
|
|
2535
|
+
eventType: import_zod26.z.string().optional().describe(
|
|
2494
2536
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2495
2537
|
)
|
|
2496
2538
|
}).catchall(FieldValue);
|
|
2497
2539
|
var FieldConfigSchema = BaseField3.extend({
|
|
2498
|
-
fieldId:
|
|
2499
|
-
fieldType:
|
|
2540
|
+
fieldId: import_zod26.z.string(),
|
|
2541
|
+
fieldType: import_zod26.z.literal("field")
|
|
2500
2542
|
});
|
|
2501
|
-
var EventFieldIdInput =
|
|
2543
|
+
var EventFieldIdInput = import_zod26.z.enum([
|
|
2502
2544
|
"trackingId",
|
|
2503
2545
|
"status",
|
|
2504
2546
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2507,7 +2549,7 @@ var EventFieldIdInput = import_zod25.z.enum([
|
|
|
2507
2549
|
"updatedAt"
|
|
2508
2550
|
]);
|
|
2509
2551
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2510
|
-
var EventFieldId =
|
|
2552
|
+
var EventFieldId = import_zod26.z.enum([
|
|
2511
2553
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2512
2554
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2513
2555
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2517,29 +2559,29 @@ var EventFieldId = import_zod25.z.enum([
|
|
|
2517
2559
|
]);
|
|
2518
2560
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2519
2561
|
fieldId: EventFieldId,
|
|
2520
|
-
fieldType:
|
|
2562
|
+
fieldType: import_zod26.z.literal("event")
|
|
2521
2563
|
});
|
|
2522
|
-
var AdvancedSearchField =
|
|
2564
|
+
var AdvancedSearchField = import_zod26.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2523
2565
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2524
2566
|
if (!data.label) {
|
|
2525
2567
|
ctx.addIssue({
|
|
2526
|
-
code:
|
|
2568
|
+
code: import_zod26.z.ZodIssueCode.custom,
|
|
2527
2569
|
message: "label is required when config.searchFields is defined.",
|
|
2528
2570
|
path: ["label"]
|
|
2529
2571
|
});
|
|
2530
2572
|
}
|
|
2531
2573
|
if (!data.type) {
|
|
2532
2574
|
ctx.addIssue({
|
|
2533
|
-
code:
|
|
2575
|
+
code: import_zod26.z.ZodIssueCode.custom,
|
|
2534
2576
|
message: "type is required when config.searchFields is defined.",
|
|
2535
2577
|
path: ["type"]
|
|
2536
2578
|
});
|
|
2537
2579
|
}
|
|
2538
2580
|
}
|
|
2539
2581
|
});
|
|
2540
|
-
var AdvancedSearchConfig =
|
|
2582
|
+
var AdvancedSearchConfig = import_zod26.z.object({
|
|
2541
2583
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2542
|
-
fields:
|
|
2584
|
+
fields: import_zod26.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2543
2585
|
});
|
|
2544
2586
|
|
|
2545
2587
|
// ../commons/src/events/utils.ts
|
|
@@ -2548,14 +2590,14 @@ var import_lodash = require("lodash");
|
|
|
2548
2590
|
// ../commons/src/conditionals/validate.ts
|
|
2549
2591
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2550
2592
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2551
|
-
var
|
|
2593
|
+
var import_zod29 = require("zod");
|
|
2552
2594
|
var import_date_fns = require("date-fns");
|
|
2553
2595
|
|
|
2554
2596
|
// ../commons/src/events/FieldTypeMapping.ts
|
|
2555
|
-
var
|
|
2597
|
+
var import_zod28 = require("zod");
|
|
2556
2598
|
|
|
2557
2599
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2558
|
-
var
|
|
2600
|
+
var import_zod27 = require("zod");
|
|
2559
2601
|
|
|
2560
2602
|
// ../commons/src/conditionals/validate.ts
|
|
2561
2603
|
var ajv = new import__.default({
|
|
@@ -2564,9 +2606,9 @@ var ajv = new import__.default({
|
|
|
2564
2606
|
strict: false
|
|
2565
2607
|
// Allow minContains and other newer features
|
|
2566
2608
|
});
|
|
2567
|
-
var DataContext =
|
|
2568
|
-
rootData:
|
|
2569
|
-
$leafAdminStructureLocationIds:
|
|
2609
|
+
var DataContext = import_zod29.z.object({
|
|
2610
|
+
rootData: import_zod29.z.object({
|
|
2611
|
+
$leafAdminStructureLocationIds: import_zod29.z.array(import_zod29.z.object({ id: UUID }))
|
|
2570
2612
|
})
|
|
2571
2613
|
});
|
|
2572
2614
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2643,13 +2685,13 @@ ajv.addKeyword({
|
|
|
2643
2685
|
});
|
|
2644
2686
|
|
|
2645
2687
|
// ../commons/src/utils.ts
|
|
2646
|
-
var
|
|
2688
|
+
var z30 = __toESM(require("zod"));
|
|
2647
2689
|
var _ = __toESM(require("lodash"));
|
|
2648
|
-
var FullNameV1 =
|
|
2649
|
-
|
|
2650
|
-
use:
|
|
2651
|
-
family:
|
|
2652
|
-
given:
|
|
2690
|
+
var FullNameV1 = z30.array(
|
|
2691
|
+
z30.object({
|
|
2692
|
+
use: z30.string(),
|
|
2693
|
+
family: z30.string(),
|
|
2694
|
+
given: z30.array(z30.string())
|
|
2653
2695
|
})
|
|
2654
2696
|
);
|
|
2655
2697
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -3269,12 +3311,12 @@ function createFieldConditionals(fieldId) {
|
|
|
3269
3311
|
}
|
|
3270
3312
|
|
|
3271
3313
|
// ../commons/src/events/EventConfig.ts
|
|
3272
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(
|
|
3273
|
-
var EventFieldReference =
|
|
3314
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod30.z);
|
|
3315
|
+
var EventFieldReference = import_zod30.z.object({ $$event: EventMetadataDateFieldIdInput }).describe(
|
|
3274
3316
|
"Reference to a field defined in the event metadata, using the field id."
|
|
3275
3317
|
);
|
|
3276
|
-
var EventConfig =
|
|
3277
|
-
id:
|
|
3318
|
+
var EventConfig = import_zod30.z.object({
|
|
3319
|
+
id: import_zod30.z.string().describe(
|
|
3278
3320
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
3279
3321
|
),
|
|
3280
3322
|
dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
|
|
@@ -3292,13 +3334,13 @@ var EventConfig = import_zod29.z.object({
|
|
|
3292
3334
|
label: TranslationConfig.describe(
|
|
3293
3335
|
"Human-readable label for the event type."
|
|
3294
3336
|
),
|
|
3295
|
-
actions:
|
|
3337
|
+
actions: import_zod30.z.array(ActionConfig).describe(
|
|
3296
3338
|
"Configuration of system-defined actions associated with the event."
|
|
3297
3339
|
),
|
|
3298
3340
|
declaration: DeclarationFormConfig.describe(
|
|
3299
3341
|
"Configuration of the form used to gather event data."
|
|
3300
3342
|
),
|
|
3301
|
-
advancedSearch:
|
|
3343
|
+
advancedSearch: import_zod30.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
3302
3344
|
"Configuration of fields available in the advanced search feature."
|
|
3303
3345
|
)
|
|
3304
3346
|
}).superRefine((event2, ctx) => {
|
|
@@ -3362,7 +3404,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
3362
3404
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
3363
3405
|
|
|
3364
3406
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
3365
|
-
var
|
|
3407
|
+
var import_zod34 = require("zod");
|
|
3366
3408
|
|
|
3367
3409
|
// ../commons/src/searchConfigs.ts
|
|
3368
3410
|
function createSearchConfig(baseField) {
|
|
@@ -3563,17 +3605,17 @@ var event = Object.assign(eventFn, {
|
|
|
3563
3605
|
});
|
|
3564
3606
|
|
|
3565
3607
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3566
|
-
var
|
|
3608
|
+
var import_zod31 = require("zod");
|
|
3567
3609
|
var WorkqueueColumnKeysArray = [
|
|
3568
3610
|
...EventMetadataKeysArray,
|
|
3569
3611
|
"title",
|
|
3570
3612
|
"outbox"
|
|
3571
3613
|
];
|
|
3572
|
-
var WorkqueueColumnKeys =
|
|
3573
|
-
var WorkqueueColumnValue =
|
|
3614
|
+
var WorkqueueColumnKeys = import_zod31.z.enum(WorkqueueColumnKeysArray);
|
|
3615
|
+
var WorkqueueColumnValue = import_zod31.z.object({
|
|
3574
3616
|
$event: WorkqueueColumnKeys
|
|
3575
3617
|
});
|
|
3576
|
-
var WorkqueueColumn =
|
|
3618
|
+
var WorkqueueColumn = import_zod31.z.object({
|
|
3577
3619
|
label: TranslationConfig,
|
|
3578
3620
|
value: WorkqueueColumnValue
|
|
3579
3621
|
});
|
|
@@ -3584,58 +3626,58 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3584
3626
|
}
|
|
3585
3627
|
|
|
3586
3628
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3587
|
-
var
|
|
3588
|
-
var SerializableExact =
|
|
3589
|
-
type:
|
|
3590
|
-
term:
|
|
3591
|
-
});
|
|
3592
|
-
var SerializableWithin =
|
|
3593
|
-
type:
|
|
3594
|
-
location:
|
|
3595
|
-
});
|
|
3596
|
-
var SerializedQueryExpression =
|
|
3597
|
-
eventType:
|
|
3598
|
-
status:
|
|
3599
|
-
createdAt:
|
|
3600
|
-
updatedAt:
|
|
3601
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3602
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3603
|
-
|
|
3629
|
+
var import_zod32 = require("zod");
|
|
3630
|
+
var SerializableExact = import_zod32.z.object({
|
|
3631
|
+
type: import_zod32.z.literal("exact"),
|
|
3632
|
+
term: import_zod32.z.union([import_zod32.z.string(), SerializedUserField])
|
|
3633
|
+
});
|
|
3634
|
+
var SerializableWithin = import_zod32.z.object({
|
|
3635
|
+
type: import_zod32.z.literal("within"),
|
|
3636
|
+
location: import_zod32.z.union([import_zod32.z.string(), SerializedUserField])
|
|
3637
|
+
});
|
|
3638
|
+
var SerializedQueryExpression = import_zod32.z.object({
|
|
3639
|
+
eventType: import_zod32.z.string(),
|
|
3640
|
+
status: import_zod32.z.optional(import_zod32.z.union([AnyOfStatus, ExactStatus])),
|
|
3641
|
+
createdAt: import_zod32.z.optional(DateCondition),
|
|
3642
|
+
updatedAt: import_zod32.z.optional(DateCondition),
|
|
3643
|
+
"legalStatuses.REGISTERED.createdAt": import_zod32.z.optional(DateCondition),
|
|
3644
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod32.z.optional(
|
|
3645
|
+
import_zod32.z.union([Within, Exact])
|
|
3604
3646
|
),
|
|
3605
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3606
|
-
createdAtLocation:
|
|
3607
|
-
|
|
3647
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod32.z.optional(Exact),
|
|
3648
|
+
createdAtLocation: import_zod32.z.optional(
|
|
3649
|
+
import_zod32.z.union([SerializableWithin, SerializableExact])
|
|
3608
3650
|
),
|
|
3609
|
-
updatedAtLocation:
|
|
3610
|
-
|
|
3651
|
+
updatedAtLocation: import_zod32.z.optional(
|
|
3652
|
+
import_zod32.z.union([SerializableWithin, SerializableExact])
|
|
3611
3653
|
),
|
|
3612
|
-
updatedByUserRole:
|
|
3613
|
-
assignedTo:
|
|
3614
|
-
createdBy:
|
|
3654
|
+
updatedByUserRole: import_zod32.z.optional(SerializableExact),
|
|
3655
|
+
assignedTo: import_zod32.z.optional(SerializableExact),
|
|
3656
|
+
createdBy: import_zod32.z.optional(SerializableExact),
|
|
3615
3657
|
createdByUserType: ExactUserType,
|
|
3616
|
-
updatedBy:
|
|
3617
|
-
trackingId:
|
|
3618
|
-
flags:
|
|
3658
|
+
updatedBy: import_zod32.z.optional(SerializableExact),
|
|
3659
|
+
trackingId: import_zod32.z.optional(Exact),
|
|
3660
|
+
flags: import_zod32.z.optional(ContainsFlags),
|
|
3619
3661
|
data: QueryInput
|
|
3620
3662
|
}).partial();
|
|
3621
|
-
var Or2 =
|
|
3622
|
-
type:
|
|
3623
|
-
clauses:
|
|
3663
|
+
var Or2 = import_zod32.z.object({
|
|
3664
|
+
type: import_zod32.z.literal("or"),
|
|
3665
|
+
clauses: import_zod32.z.array(SerializedQueryExpression)
|
|
3624
3666
|
});
|
|
3625
|
-
var And2 =
|
|
3626
|
-
type:
|
|
3627
|
-
clauses:
|
|
3667
|
+
var And2 = import_zod32.z.object({
|
|
3668
|
+
type: import_zod32.z.literal("and"),
|
|
3669
|
+
clauses: import_zod32.z.array(SerializedQueryExpression)
|
|
3628
3670
|
});
|
|
3629
|
-
var CountryConfigQueryType =
|
|
3630
|
-
var CountryConfigQueryInputType =
|
|
3671
|
+
var CountryConfigQueryType = import_zod32.z.discriminatedUnion("type", [And2, Or2]);
|
|
3672
|
+
var CountryConfigQueryInputType = import_zod32.z.union([
|
|
3631
3673
|
SerializedQueryExpression,
|
|
3632
3674
|
And2,
|
|
3633
3675
|
Or2
|
|
3634
3676
|
]);
|
|
3635
3677
|
|
|
3636
3678
|
// ../commons/src/icons.ts
|
|
3637
|
-
var
|
|
3638
|
-
var AvailableIcons =
|
|
3679
|
+
var import_zod33 = require("zod");
|
|
3680
|
+
var AvailableIcons = import_zod33.z.enum([
|
|
3639
3681
|
"Archived",
|
|
3640
3682
|
"Assigned",
|
|
3641
3683
|
"Certified",
|
|
@@ -3756,23 +3798,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3756
3798
|
value: event.field("updatedAt")
|
|
3757
3799
|
}
|
|
3758
3800
|
]);
|
|
3759
|
-
var WorkqueueActionsWithDefault =
|
|
3801
|
+
var WorkqueueActionsWithDefault = import_zod34.z.enum([
|
|
3760
3802
|
...workqueueActions.options,
|
|
3761
3803
|
"DEFAULT"
|
|
3762
3804
|
]);
|
|
3763
|
-
var WorkqueueConfig =
|
|
3764
|
-
slug:
|
|
3805
|
+
var WorkqueueConfig = import_zod34.z.object({
|
|
3806
|
+
slug: import_zod34.z.string().describe("Determines the url of the workqueue."),
|
|
3765
3807
|
name: TranslationConfig.describe(
|
|
3766
3808
|
"Title of the workflow (both in navigation and on the page)"
|
|
3767
3809
|
),
|
|
3768
3810
|
query: CountryConfigQueryType,
|
|
3769
|
-
actions:
|
|
3770
|
-
|
|
3811
|
+
actions: import_zod34.z.array(
|
|
3812
|
+
import_zod34.z.object({
|
|
3771
3813
|
type: WorkqueueActionsWithDefault,
|
|
3772
|
-
conditionals:
|
|
3814
|
+
conditionals: import_zod34.z.array(Conditional).optional()
|
|
3773
3815
|
})
|
|
3774
3816
|
),
|
|
3775
|
-
columns:
|
|
3817
|
+
columns: import_zod34.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3776
3818
|
icon: AvailableIcons,
|
|
3777
3819
|
emptyMessage: TranslationConfig.optional()
|
|
3778
3820
|
}).describe("Configuration for workqueue.");
|
|
@@ -3780,26 +3822,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3780
3822
|
query: true,
|
|
3781
3823
|
columns: true
|
|
3782
3824
|
});
|
|
3783
|
-
var WorkqueueConfigInput =
|
|
3784
|
-
slug:
|
|
3825
|
+
var WorkqueueConfigInput = import_zod34.z.object({
|
|
3826
|
+
slug: import_zod34.z.string().describe("Determines the url of the workqueue."),
|
|
3785
3827
|
name: TranslationConfig.describe(
|
|
3786
3828
|
"Title of the workflow (both in navigation and on the page)"
|
|
3787
3829
|
),
|
|
3788
3830
|
query: CountryConfigQueryInputType,
|
|
3789
|
-
actions:
|
|
3790
|
-
|
|
3831
|
+
actions: import_zod34.z.array(
|
|
3832
|
+
import_zod34.z.object({
|
|
3791
3833
|
type: WorkqueueActionsWithDefault,
|
|
3792
|
-
conditionals:
|
|
3834
|
+
conditionals: import_zod34.z.array(Conditional).optional()
|
|
3793
3835
|
})
|
|
3794
3836
|
),
|
|
3795
|
-
columns:
|
|
3837
|
+
columns: import_zod34.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3796
3838
|
icon: AvailableIcons,
|
|
3797
3839
|
emptyMessage: TranslationConfig.optional()
|
|
3798
3840
|
});
|
|
3799
|
-
var WorkqueueCountInput =
|
|
3800
|
-
|
|
3841
|
+
var WorkqueueCountInput = import_zod34.z.array(
|
|
3842
|
+
import_zod34.z.object({ slug: import_zod34.z.string(), query: QueryType })
|
|
3801
3843
|
);
|
|
3802
|
-
var WorkqueueCountOutput =
|
|
3844
|
+
var WorkqueueCountOutput = import_zod34.z.record(import_zod34.z.string(), import_zod34.z.number());
|
|
3803
3845
|
|
|
3804
3846
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3805
3847
|
var defaultWorkqueueColumns = [
|
|
@@ -3822,53 +3864,53 @@ var defaultWorkqueueColumns = [
|
|
|
3822
3864
|
];
|
|
3823
3865
|
|
|
3824
3866
|
// ../commons/src/events/Draft.ts
|
|
3825
|
-
var
|
|
3867
|
+
var import_zod36 = require("zod");
|
|
3826
3868
|
|
|
3827
3869
|
// ../commons/src/events/ActionInput.ts
|
|
3828
|
-
var
|
|
3870
|
+
var import_zod35 = require("zod");
|
|
3829
3871
|
var import_zod_openapi11 = require("zod-openapi");
|
|
3830
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(
|
|
3831
|
-
var BaseActionInput =
|
|
3872
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod35.z);
|
|
3873
|
+
var BaseActionInput = import_zod35.z.object({
|
|
3832
3874
|
eventId: UUID,
|
|
3833
|
-
transactionId:
|
|
3875
|
+
transactionId: import_zod35.z.string(),
|
|
3834
3876
|
declaration: ActionUpdate.default({}),
|
|
3835
3877
|
annotation: ActionUpdate.optional(),
|
|
3836
3878
|
originalActionId: UUID.optional(),
|
|
3837
3879
|
// should not be part of base action.
|
|
3838
|
-
keepAssignment:
|
|
3839
|
-
keepAssignmentIfAccepted:
|
|
3840
|
-
keepAssignmentIfRejected:
|
|
3880
|
+
keepAssignment: import_zod35.z.boolean().optional(),
|
|
3881
|
+
keepAssignmentIfAccepted: import_zod35.z.boolean().optional(),
|
|
3882
|
+
keepAssignmentIfRejected: import_zod35.z.boolean().optional(),
|
|
3841
3883
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3842
3884
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3843
3885
|
"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."
|
|
3844
3886
|
)
|
|
3845
3887
|
});
|
|
3846
3888
|
var CreateActionInput = BaseActionInput.merge(
|
|
3847
|
-
|
|
3848
|
-
type:
|
|
3889
|
+
import_zod35.z.object({
|
|
3890
|
+
type: import_zod35.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3849
3891
|
createdAtLocation: CreatedAtLocation
|
|
3850
3892
|
})
|
|
3851
3893
|
);
|
|
3852
3894
|
var RegisterActionInput = BaseActionInput.merge(
|
|
3853
|
-
|
|
3854
|
-
type:
|
|
3855
|
-
registrationNumber:
|
|
3895
|
+
import_zod35.z.object({
|
|
3896
|
+
type: import_zod35.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3897
|
+
registrationNumber: import_zod35.z.string().optional()
|
|
3856
3898
|
})
|
|
3857
3899
|
).strict();
|
|
3858
3900
|
var ValidateActionInput = BaseActionInput.merge(
|
|
3859
|
-
|
|
3860
|
-
type:
|
|
3901
|
+
import_zod35.z.object({
|
|
3902
|
+
type: import_zod35.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3861
3903
|
})
|
|
3862
3904
|
);
|
|
3863
3905
|
var EscalateActionInput = BaseActionInput.merge(
|
|
3864
|
-
|
|
3865
|
-
type:
|
|
3906
|
+
import_zod35.z.object({
|
|
3907
|
+
type: import_zod35.z.literal(ActionType.ESCALATE).default(ActionType.ESCALATE),
|
|
3866
3908
|
content: ReasonContent
|
|
3867
3909
|
})
|
|
3868
3910
|
);
|
|
3869
3911
|
var NotifyActionInput = BaseActionInput.merge(
|
|
3870
|
-
|
|
3871
|
-
type:
|
|
3912
|
+
import_zod35.z.object({
|
|
3913
|
+
type: import_zod35.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3872
3914
|
})
|
|
3873
3915
|
).openapi({
|
|
3874
3916
|
default: {
|
|
@@ -3880,86 +3922,86 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
3880
3922
|
}
|
|
3881
3923
|
});
|
|
3882
3924
|
var DeclareActionInput = BaseActionInput.merge(
|
|
3883
|
-
|
|
3884
|
-
type:
|
|
3925
|
+
import_zod35.z.object({
|
|
3926
|
+
type: import_zod35.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3885
3927
|
})
|
|
3886
3928
|
);
|
|
3887
3929
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3888
|
-
|
|
3889
|
-
type:
|
|
3930
|
+
import_zod35.z.object({
|
|
3931
|
+
type: import_zod35.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3890
3932
|
content: PrintContent.optional()
|
|
3891
3933
|
})
|
|
3892
3934
|
);
|
|
3893
3935
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3894
|
-
|
|
3895
|
-
type:
|
|
3936
|
+
import_zod35.z.object({
|
|
3937
|
+
type: import_zod35.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3896
3938
|
content: ReasonContent
|
|
3897
3939
|
})
|
|
3898
3940
|
);
|
|
3899
3941
|
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3900
|
-
|
|
3901
|
-
type:
|
|
3902
|
-
content:
|
|
3903
|
-
duplicates:
|
|
3942
|
+
import_zod35.z.object({
|
|
3943
|
+
type: import_zod35.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3944
|
+
content: import_zod35.z.object({
|
|
3945
|
+
duplicates: import_zod35.z.array(PotentialDuplicate)
|
|
3904
3946
|
})
|
|
3905
3947
|
})
|
|
3906
3948
|
);
|
|
3907
3949
|
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3908
|
-
|
|
3909
|
-
type:
|
|
3910
|
-
content:
|
|
3950
|
+
import_zod35.z.object({
|
|
3951
|
+
type: import_zod35.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3952
|
+
content: import_zod35.z.object({
|
|
3911
3953
|
duplicateOf: UUID
|
|
3912
3954
|
}).optional()
|
|
3913
3955
|
})
|
|
3914
3956
|
);
|
|
3915
3957
|
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3916
|
-
|
|
3917
|
-
type:
|
|
3958
|
+
import_zod35.z.object({
|
|
3959
|
+
type: import_zod35.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3918
3960
|
})
|
|
3919
3961
|
);
|
|
3920
3962
|
var ArchiveActionInput = BaseActionInput.merge(
|
|
3921
|
-
|
|
3922
|
-
type:
|
|
3963
|
+
import_zod35.z.object({
|
|
3964
|
+
type: import_zod35.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3923
3965
|
content: ReasonContent
|
|
3924
3966
|
})
|
|
3925
3967
|
);
|
|
3926
3968
|
var AssignActionInput = BaseActionInput.merge(
|
|
3927
|
-
|
|
3928
|
-
type:
|
|
3929
|
-
assignedTo:
|
|
3969
|
+
import_zod35.z.object({
|
|
3970
|
+
type: import_zod35.z.literal(ActionType.ASSIGN),
|
|
3971
|
+
assignedTo: import_zod35.z.string()
|
|
3930
3972
|
})
|
|
3931
3973
|
);
|
|
3932
3974
|
var UnassignActionInput = BaseActionInput.merge(
|
|
3933
|
-
|
|
3934
|
-
type:
|
|
3935
|
-
assignedTo:
|
|
3975
|
+
import_zod35.z.object({
|
|
3976
|
+
type: import_zod35.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3977
|
+
assignedTo: import_zod35.z.literal(null).default(null)
|
|
3936
3978
|
})
|
|
3937
3979
|
);
|
|
3938
3980
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3939
|
-
|
|
3940
|
-
type:
|
|
3981
|
+
import_zod35.z.object({
|
|
3982
|
+
type: import_zod35.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3941
3983
|
})
|
|
3942
3984
|
);
|
|
3943
3985
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3944
|
-
|
|
3945
|
-
requestId:
|
|
3946
|
-
type:
|
|
3986
|
+
import_zod35.z.object({
|
|
3987
|
+
requestId: import_zod35.z.string(),
|
|
3988
|
+
type: import_zod35.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3947
3989
|
content: ReasonContent
|
|
3948
3990
|
})
|
|
3949
3991
|
);
|
|
3950
3992
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3951
|
-
|
|
3952
|
-
requestId:
|
|
3953
|
-
type:
|
|
3993
|
+
import_zod35.z.object({
|
|
3994
|
+
requestId: import_zod35.z.string(),
|
|
3995
|
+
type: import_zod35.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3954
3996
|
})
|
|
3955
3997
|
);
|
|
3956
3998
|
var ReadActionInput = BaseActionInput.merge(
|
|
3957
|
-
|
|
3958
|
-
type:
|
|
3999
|
+
import_zod35.z.object({
|
|
4000
|
+
type: import_zod35.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3959
4001
|
})
|
|
3960
4002
|
);
|
|
3961
|
-
var DeleteActionInput =
|
|
3962
|
-
var ActionInput =
|
|
4003
|
+
var DeleteActionInput = import_zod35.z.object({ eventId: UUID });
|
|
4004
|
+
var ActionInput = import_zod35.z.discriminatedUnion("type", [
|
|
3963
4005
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3964
4006
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3965
4007
|
EscalateActionInput.openapi({ ref: "EscalateActionInput" }),
|
|
@@ -3995,11 +4037,11 @@ var ActionInput = import_zod34.z.discriminatedUnion("type", [
|
|
|
3995
4037
|
});
|
|
3996
4038
|
|
|
3997
4039
|
// ../commons/src/events/Draft.ts
|
|
3998
|
-
var Draft =
|
|
4040
|
+
var Draft = import_zod36.z.object({
|
|
3999
4041
|
id: UUID,
|
|
4000
4042
|
eventId: UUID,
|
|
4001
|
-
transactionId:
|
|
4002
|
-
createdAt:
|
|
4043
|
+
transactionId: import_zod36.z.string(),
|
|
4044
|
+
createdAt: import_zod36.z.string().datetime(),
|
|
4003
4045
|
action: ActionBase.extend({
|
|
4004
4046
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
4005
4047
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -4008,7 +4050,7 @@ var Draft = import_zod35.z.object({
|
|
|
4008
4050
|
);
|
|
4009
4051
|
var DraftInput = BaseActionInput.extend({
|
|
4010
4052
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
4011
|
-
status:
|
|
4053
|
+
status: import_zod36.z.enum([
|
|
4012
4054
|
ActionStatus.Requested,
|
|
4013
4055
|
ActionStatus.Accepted,
|
|
4014
4056
|
ActionStatus.Rejected
|
|
@@ -4016,26 +4058,26 @@ var DraftInput = BaseActionInput.extend({
|
|
|
4016
4058
|
});
|
|
4017
4059
|
|
|
4018
4060
|
// ../commons/src/events/EventInput.ts
|
|
4019
|
-
var
|
|
4061
|
+
var import_zod37 = require("zod");
|
|
4020
4062
|
var import_uuid10 = require("uuid");
|
|
4021
|
-
var EventInput =
|
|
4022
|
-
transactionId:
|
|
4023
|
-
type:
|
|
4063
|
+
var EventInput = import_zod37.z.object({
|
|
4064
|
+
transactionId: import_zod37.z.string(),
|
|
4065
|
+
type: import_zod37.z.string()
|
|
4024
4066
|
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
4025
4067
|
|
|
4026
4068
|
// ../commons/src/events/EventDocument.ts
|
|
4027
|
-
var
|
|
4069
|
+
var import_zod38 = require("zod");
|
|
4028
4070
|
var import_zod_openapi12 = require("zod-openapi");
|
|
4029
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(
|
|
4030
|
-
var EventDocument =
|
|
4071
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod38.z);
|
|
4072
|
+
var EventDocument = import_zod38.z.object({
|
|
4031
4073
|
id: UUID.describe("Unique identifier of the event."),
|
|
4032
|
-
type:
|
|
4033
|
-
createdAt:
|
|
4034
|
-
updatedAt:
|
|
4074
|
+
type: import_zod38.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
4075
|
+
createdAt: import_zod38.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
4076
|
+
updatedAt: import_zod38.z.string().datetime().describe(
|
|
4035
4077
|
"Timestamp of the last update, excluding changes from actions."
|
|
4036
4078
|
),
|
|
4037
|
-
actions:
|
|
4038
|
-
trackingId:
|
|
4079
|
+
actions: import_zod38.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
4080
|
+
trackingId: import_zod38.z.string().describe(
|
|
4039
4081
|
"System-generated tracking identifier used to look up the event."
|
|
4040
4082
|
)
|
|
4041
4083
|
}).openapi({ ref: "EventDocument" });
|
|
@@ -6546,8 +6588,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6546
6588
|
});
|
|
6547
6589
|
|
|
6548
6590
|
// ../commons/src/events/test.utils.ts
|
|
6549
|
-
var
|
|
6550
|
-
var TestUserRole =
|
|
6591
|
+
var import_zod39 = require("zod");
|
|
6592
|
+
var TestUserRole = import_zod39.z.enum([
|
|
6551
6593
|
"FIELD_AGENT",
|
|
6552
6594
|
"LOCAL_REGISTRAR",
|
|
6553
6595
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6654,22 +6696,22 @@ var ACTION_FILTERS = {
|
|
|
6654
6696
|
var import_lodash6 = require("lodash");
|
|
6655
6697
|
|
|
6656
6698
|
// ../commons/src/events/locations.ts
|
|
6657
|
-
var
|
|
6658
|
-
var LocationType =
|
|
6699
|
+
var import_zod40 = require("zod");
|
|
6700
|
+
var LocationType = import_zod40.z.enum([
|
|
6659
6701
|
"ADMIN_STRUCTURE",
|
|
6660
6702
|
"CRVS_OFFICE",
|
|
6661
6703
|
"HEALTH_FACILITY"
|
|
6662
6704
|
]);
|
|
6663
|
-
var Location =
|
|
6705
|
+
var Location = import_zod40.z.object({
|
|
6664
6706
|
id: UUID,
|
|
6665
|
-
name:
|
|
6707
|
+
name: import_zod40.z.string(),
|
|
6666
6708
|
parentId: UUID.nullable(),
|
|
6667
|
-
validUntil:
|
|
6709
|
+
validUntil: import_zod40.z.string().datetime().nullable(),
|
|
6668
6710
|
locationType: LocationType.nullable()
|
|
6669
6711
|
});
|
|
6670
6712
|
|
|
6671
6713
|
// ../commons/src/notification/UserNotifications.ts
|
|
6672
|
-
var
|
|
6714
|
+
var import_zod41 = require("zod");
|
|
6673
6715
|
var TriggerEvent = {
|
|
6674
6716
|
USER_CREATED: "user-created",
|
|
6675
6717
|
USER_UPDATED: "user-updated",
|
|
@@ -6681,50 +6723,50 @@ var TriggerEvent = {
|
|
|
6681
6723
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6682
6724
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6683
6725
|
};
|
|
6684
|
-
var Recipient =
|
|
6726
|
+
var Recipient = import_zod41.z.object({
|
|
6685
6727
|
name: NameFieldValue.optional(),
|
|
6686
|
-
mobile:
|
|
6687
|
-
email:
|
|
6688
|
-
bcc:
|
|
6728
|
+
mobile: import_zod41.z.string().optional(),
|
|
6729
|
+
email: import_zod41.z.string().optional(),
|
|
6730
|
+
bcc: import_zod41.z.array(import_zod41.z.string()).optional()
|
|
6689
6731
|
});
|
|
6690
|
-
var BasePayload =
|
|
6732
|
+
var BasePayload = import_zod41.z.object({
|
|
6691
6733
|
recipient: Recipient
|
|
6692
6734
|
});
|
|
6693
6735
|
var TriggerPayload = {
|
|
6694
6736
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6695
|
-
username:
|
|
6696
|
-
temporaryPassword:
|
|
6737
|
+
username: import_zod41.z.string(),
|
|
6738
|
+
temporaryPassword: import_zod41.z.string()
|
|
6697
6739
|
}),
|
|
6698
6740
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6699
|
-
oldUsername:
|
|
6700
|
-
newUsername:
|
|
6741
|
+
oldUsername: import_zod41.z.string(),
|
|
6742
|
+
newUsername: import_zod41.z.string()
|
|
6701
6743
|
}),
|
|
6702
6744
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6703
|
-
username:
|
|
6745
|
+
username: import_zod41.z.string()
|
|
6704
6746
|
}),
|
|
6705
6747
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6706
|
-
code:
|
|
6748
|
+
code: import_zod41.z.string()
|
|
6707
6749
|
}),
|
|
6708
6750
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6709
|
-
temporaryPassword:
|
|
6710
|
-
admin:
|
|
6711
|
-
id:
|
|
6751
|
+
temporaryPassword: import_zod41.z.string(),
|
|
6752
|
+
admin: import_zod41.z.object({
|
|
6753
|
+
id: import_zod41.z.string(),
|
|
6712
6754
|
name: NameFieldValue,
|
|
6713
|
-
role:
|
|
6755
|
+
role: import_zod41.z.string()
|
|
6714
6756
|
})
|
|
6715
6757
|
}),
|
|
6716
6758
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6717
|
-
code:
|
|
6759
|
+
code: import_zod41.z.string()
|
|
6718
6760
|
}),
|
|
6719
6761
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6720
|
-
subject:
|
|
6721
|
-
body:
|
|
6762
|
+
subject: import_zod41.z.string(),
|
|
6763
|
+
body: import_zod41.z.string()
|
|
6722
6764
|
}),
|
|
6723
6765
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6724
|
-
code:
|
|
6766
|
+
code: import_zod41.z.string()
|
|
6725
6767
|
}),
|
|
6726
6768
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6727
|
-
code:
|
|
6769
|
+
code: import_zod41.z.string()
|
|
6728
6770
|
})
|
|
6729
6771
|
};
|
|
6730
6772
|
async function triggerUserEventNotification({
|