@opencrvs/toolkit 2.0.1 → 2.1.0-beta
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/README.md +16 -0
- package/build.sh +14 -5
- package/create-countryconfig/index.js +293 -103
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +5 -2
- package/dist/application-config/index.js +369 -282
- package/dist/authentication/index.d.ts +67 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +750 -0
- package/dist/cli.js +4343 -4788
- package/dist/commons/api/router.d.ts +4120 -2946
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +32 -323
- package/dist/commons/conditionals/validate.d.ts +16 -5
- package/dist/commons/events/ActionConfig.d.ts +302 -71
- package/dist/commons/events/ActionDocument.d.ts +159 -121
- package/dist/commons/events/ActionInput.d.ts +30 -10
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/ActionType.d.ts +63 -58
- package/dist/commons/events/AdvancedSearchConfig.d.ts +531 -501
- package/dist/commons/events/AuditLog.d.ts +189 -40
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/Conditional.d.ts +3 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +603 -561
- package/dist/commons/events/Draft.d.ts +38 -36
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +8 -3
- package/dist/commons/events/EventDocument.d.ts +537 -47
- package/dist/commons/events/EventIndex.d.ts +61 -59
- package/dist/commons/events/EventMetadata.d.ts +59 -43
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +424 -384
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +86 -86
- package/dist/commons/events/FieldValue.d.ts +14 -14
- package/dist/commons/events/Flag.d.ts +57 -15
- package/dist/commons/events/FormConfig.d.ts +0 -6
- package/dist/commons/events/PageConfig.d.ts +0 -4
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/TemplateConfig.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
- package/dist/commons/events/WorkqueueConfig.d.ts +835 -790
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +14 -2
- package/dist/commons/events/field.d.ts +69 -198
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +248 -14
- package/dist/commons/events/mocks.test.utils.d.ts +48 -4
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/index.d.ts +23 -15
- package/dist/commons/events/state/utils.d.ts +15 -6
- package/dist/commons/events/test.utils.d.ts +68 -42
- package/dist/commons/events/utils.d.ts +139 -110
- package/dist/commons/notification/UserNotifications.d.ts +38 -18
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +341 -68
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/custom-types.d.ts +33 -0
- package/dist/environment/custom-types.d.ts.map +1 -0
- package/dist/environment/custom-types.js +12 -0
- package/dist/environment/derived-variables.d.ts +122 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +155 -0
- package/dist/environment/editor-questions.d.ts +4 -0
- package/dist/environment/editor-questions.d.ts.map +1 -0
- package/dist/environment/editor-questions.js +67 -0
- package/dist/environment/git.d.ts +5 -0
- package/dist/environment/git.d.ts.map +1 -0
- package/dist/environment/git.js +38 -0
- package/dist/environment/github.d.ts +26 -0
- package/dist/environment/github.d.ts.map +1 -0
- package/dist/environment/github.js +247 -0
- package/dist/environment/index.d.ts +6 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +81 -0
- package/dist/environment/logger.d.ts +18 -0
- package/dist/environment/logger.d.ts.map +1 -0
- package/dist/environment/logger.js +25 -0
- package/dist/environment/manage-users.d.ts +11 -0
- package/dist/environment/manage-users.d.ts.map +1 -0
- package/dist/environment/manage-users.js +507 -0
- package/dist/environment/paths.d.ts +7 -0
- package/dist/environment/paths.d.ts.map +1 -0
- package/dist/environment/paths.js +72 -0
- package/dist/environment/questions-helper.d.ts +15 -0
- package/dist/environment/questions-helper.d.ts.map +1 -0
- package/dist/environment/questions-helper.js +70 -0
- package/dist/environment/questions.d.ts +200 -0
- package/dist/environment/questions.d.ts.map +1 -0
- package/dist/environment/questions.js +418 -0
- package/dist/environment/setup-environment.d.ts +2 -0
- package/dist/environment/setup-environment.d.ts.map +1 -0
- package/dist/environment/setup-environment.js +795 -0
- package/dist/environment/ssh-keygen.d.ts +5 -0
- package/dist/environment/ssh-keygen.d.ts.map +1 -0
- package/dist/environment/ssh-keygen.js +21 -0
- package/dist/environment/swarm-to-k8s.d.ts +2 -0
- package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
- package/dist/environment/swarm-to-k8s.js +183 -0
- package/dist/environment/templates.d.ts +27 -0
- package/dist/environment/templates.d.ts.map +1 -0
- package/dist/environment/templates.js +164 -0
- package/dist/environment/update-workflows.d.ts +2 -0
- package/dist/environment/update-workflows.d.ts.map +1 -0
- package/dist/environment/update-workflows.js +191 -0
- package/dist/environment/upgrade.d.ts +2 -0
- package/dist/environment/upgrade.d.ts.map +1 -0
- package/dist/environment/upgrade.js +82 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +120 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +110 -0
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +8104 -7408
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
- package/dist/migrations/v2.0/index.js +88 -5143
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +3 -3
- package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +213 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +438 -0
- package/dist/migrations/v2.1/index.d.ts +6 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -0
- package/dist/migrations/v2.1/index.js +1276 -0
- package/dist/notification/index.js +2010 -1451
- package/dist/scopes/index.d.ts +512 -231
- package/dist/scopes/index.js +342 -68
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +39 -0
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +82 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +78 -0
- package/dist/templates/charts-values/opentelemetry/values.yaml +95 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +129 -0
- package/dist/templates/inventory/inventory.template.yml +98 -0
- package/dist/translations/check.d.ts +19 -0
- package/dist/translations/check.d.ts.map +1 -0
- package/dist/translations/check.js +127 -0
- package/dist/verify/endpoints.d.ts.map +1 -1
- package/dist/verify/endpoints.js +25 -25
- package/opencrvs-toolkit-2.1.0-beta.tgz +0 -0
- package/package.json +25 -6
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/opencrvs-toolkit-2.0.1.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -42,7 +42,7 @@ __export(application_config_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(application_config_exports);
|
|
43
43
|
|
|
44
44
|
// ../commons/src/application-config.ts
|
|
45
|
-
var
|
|
45
|
+
var z21 = __toESM(require("zod/v4"));
|
|
46
46
|
|
|
47
47
|
// ../commons/src/events/FieldConfig.ts
|
|
48
48
|
var import_v43 = __toESM(require("zod/v4"));
|
|
@@ -497,10 +497,10 @@ var SerializedUserField = z9.object({
|
|
|
497
497
|
var import_v4 = require("zod/v4");
|
|
498
498
|
|
|
499
499
|
// ../commons/src/events/EventMetadata.ts
|
|
500
|
-
var
|
|
500
|
+
var z16 = __toESM(require("zod/v4"));
|
|
501
501
|
|
|
502
502
|
// ../commons/src/events/ActionDocument.ts
|
|
503
|
-
var
|
|
503
|
+
var z15 = __toESM(require("zod/v4"));
|
|
504
504
|
|
|
505
505
|
// ../commons/src/events/ActionType.ts
|
|
506
506
|
var z10 = __toESM(require("zod/v4"));
|
|
@@ -520,6 +520,7 @@ var ActionType = {
|
|
|
520
520
|
MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE",
|
|
521
521
|
MARK_AS_NOT_DUPLICATE: "MARK_AS_NOT_DUPLICATE",
|
|
522
522
|
ARCHIVE: "ARCHIVE",
|
|
523
|
+
UNARCHIVE: "UNARCHIVE",
|
|
523
524
|
// Record actions
|
|
524
525
|
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
|
525
526
|
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
|
@@ -539,6 +540,7 @@ var ConfirmableActions = [
|
|
|
539
540
|
ActionType.REGISTER,
|
|
540
541
|
ActionType.REJECT,
|
|
541
542
|
ActionType.ARCHIVE,
|
|
543
|
+
ActionType.UNARCHIVE,
|
|
542
544
|
ActionType.PRINT_CERTIFICATE,
|
|
543
545
|
ActionType.REQUEST_CORRECTION,
|
|
544
546
|
ActionType.APPROVE_CORRECTION,
|
|
@@ -557,6 +559,7 @@ var ActionTypes = z10.enum([
|
|
|
557
559
|
"MARK_AS_DUPLICATE",
|
|
558
560
|
"MARK_AS_NOT_DUPLICATE",
|
|
559
561
|
"ARCHIVE",
|
|
562
|
+
"UNARCHIVE",
|
|
560
563
|
"PRINT_CERTIFICATE",
|
|
561
564
|
"REQUEST_CORRECTION",
|
|
562
565
|
"REJECT_CORRECTION",
|
|
@@ -597,6 +600,7 @@ var WorkqueueActionType = ActionTypes.extract([
|
|
|
597
600
|
ActionType.REJECT,
|
|
598
601
|
ActionType.MARK_AS_DUPLICATE,
|
|
599
602
|
ActionType.ARCHIVE,
|
|
603
|
+
ActionType.UNARCHIVE,
|
|
600
604
|
ActionType.PRINT_CERTIFICATE,
|
|
601
605
|
ActionType.REQUEST_CORRECTION
|
|
602
606
|
]);
|
|
@@ -608,16 +612,98 @@ var META_ACTIONS = [
|
|
|
608
612
|
|
|
609
613
|
// ../commons/src/authentication.ts
|
|
610
614
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
611
|
-
var
|
|
615
|
+
var z14 = __toESM(require("zod/v4"));
|
|
612
616
|
|
|
613
617
|
// ../commons/src/scopes.ts
|
|
614
|
-
var
|
|
618
|
+
var z13 = __toESM(require("zod/v4"));
|
|
615
619
|
var qs = __toESM(require("qs"));
|
|
616
|
-
|
|
620
|
+
|
|
621
|
+
// ../commons/src/events/ActionStatus.ts
|
|
622
|
+
var ActionStatus = {
|
|
623
|
+
Requested: "Requested",
|
|
624
|
+
Accepted: "Accepted",
|
|
625
|
+
Rejected: "Rejected"
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
// ../commons/src/events/Flag.ts
|
|
629
|
+
var z11 = __toESM(require("zod/v4"));
|
|
630
|
+
var InherentFlags = {
|
|
631
|
+
INCOMPLETE: "incomplete",
|
|
632
|
+
REJECTED: "rejected",
|
|
633
|
+
CORRECTION_REQUESTED: "correction-requested",
|
|
634
|
+
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
635
|
+
/**
|
|
636
|
+
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
637
|
+
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
638
|
+
*
|
|
639
|
+
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
640
|
+
*/
|
|
641
|
+
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
642
|
+
};
|
|
643
|
+
var actionFlagPattern;
|
|
644
|
+
function getActionFlagPattern() {
|
|
645
|
+
actionFlagPattern ??= new RegExp(
|
|
646
|
+
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
647
|
+
ActionStatus
|
|
648
|
+
).join("|").toLowerCase()})$`
|
|
649
|
+
);
|
|
650
|
+
return actionFlagPattern;
|
|
651
|
+
}
|
|
652
|
+
var ActionFlag = z11.string().refine((value) => getActionFlagPattern().test(value), {
|
|
653
|
+
message: "Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
654
|
+
});
|
|
655
|
+
var CustomFlag = z11.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
656
|
+
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
657
|
+
InherentFlags
|
|
658
|
+
).join(", ")}`
|
|
659
|
+
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
660
|
+
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
661
|
+
}).describe("Custom flag identifier defined by the country config.");
|
|
662
|
+
var Flag = ActionFlag.or(z11.enum(InherentFlags)).or(CustomFlag);
|
|
663
|
+
var ContainsFlags = z11.object({
|
|
664
|
+
anyOf: z11.array(Flag).optional(),
|
|
665
|
+
noneOf: z11.array(Flag).optional(),
|
|
666
|
+
allOf: z11.array(Flag).optional()
|
|
667
|
+
}).meta({
|
|
668
|
+
id: "ContainsFlags"
|
|
669
|
+
});
|
|
670
|
+
var FlagConfig = z11.object({
|
|
671
|
+
id: CustomFlag,
|
|
672
|
+
requiresAction: z11.boolean().describe(
|
|
673
|
+
"Indicates if this flag expects an action to be performed to be cleared."
|
|
674
|
+
),
|
|
675
|
+
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
676
|
+
}).meta({
|
|
677
|
+
id: "FlagConfig",
|
|
678
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
679
|
+
});
|
|
680
|
+
var ActionFlagConfig = z11.object({
|
|
681
|
+
id: Flag,
|
|
682
|
+
operation: z11.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
683
|
+
conditional: Conditional.optional().describe(
|
|
684
|
+
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
685
|
+
)
|
|
686
|
+
}).meta({
|
|
687
|
+
id: "ActionFlagConfig",
|
|
688
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
// ../commons/src/events/EventStatus.ts
|
|
692
|
+
var z12 = __toESM(require("zod/v4"));
|
|
693
|
+
var EventStatus = z12.enum([
|
|
694
|
+
"CREATED",
|
|
695
|
+
"NOTIFIED",
|
|
696
|
+
"DECLARED",
|
|
697
|
+
"REGISTERED",
|
|
698
|
+
"ARCHIVED"
|
|
699
|
+
]);
|
|
700
|
+
|
|
701
|
+
// ../commons/src/scopes.ts
|
|
702
|
+
var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
|
|
617
703
|
"Filters based on user jurisdiction relative to their office location in hierarchy."
|
|
618
704
|
);
|
|
619
|
-
var UserFilter =
|
|
620
|
-
var RecordScopeTypeV2 =
|
|
705
|
+
var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
|
|
706
|
+
var RecordScopeTypeV2 = z13.enum([
|
|
621
707
|
"record.search",
|
|
622
708
|
"record.create",
|
|
623
709
|
"record.read",
|
|
@@ -626,6 +712,7 @@ var RecordScopeTypeV2 = z11.enum([
|
|
|
626
712
|
"record.edit",
|
|
627
713
|
"record.reject",
|
|
628
714
|
"record.archive",
|
|
715
|
+
"record.unarchive",
|
|
629
716
|
"record.review-duplicates",
|
|
630
717
|
"record.register",
|
|
631
718
|
"record.print-certified-copies",
|
|
@@ -634,14 +721,20 @@ var RecordScopeTypeV2 = z11.enum([
|
|
|
634
721
|
"record.unassign-others",
|
|
635
722
|
"record.custom-action"
|
|
636
723
|
]);
|
|
637
|
-
var PlainScopeType =
|
|
724
|
+
var PlainScopeType = z13.enum([
|
|
638
725
|
// Misc. system scopes
|
|
639
726
|
"bypassratelimit",
|
|
640
727
|
"record.reindex",
|
|
641
728
|
"user.data-seeding",
|
|
642
729
|
"integration.create",
|
|
730
|
+
// Reading an integration's audit log. Deliberately separate from
|
|
731
|
+
// 'integration.create' so read-only oversight can be granted on its own, and
|
|
732
|
+
// deliberately option-less: system clients have no office and no
|
|
733
|
+
// administrative area, so jurisdiction options would have nothing to bind to.
|
|
734
|
+
"integration.audit.read",
|
|
643
735
|
"record.import",
|
|
644
736
|
"config.update-all",
|
|
737
|
+
"location.edit",
|
|
645
738
|
"attachment.upload",
|
|
646
739
|
"profile.electronic-signature",
|
|
647
740
|
"user.read-only-my-audit",
|
|
@@ -653,72 +746,81 @@ var PlainScopeType = z11.enum([
|
|
|
653
746
|
"record.confirm-registration",
|
|
654
747
|
"record.reject-registration"
|
|
655
748
|
]);
|
|
656
|
-
var scopeByEvent =
|
|
749
|
+
var scopeByEvent = z13.preprocess(
|
|
657
750
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
658
|
-
|
|
751
|
+
z13.array(z13.string()).optional()
|
|
659
752
|
).describe("Event type, e.g. birth, death");
|
|
660
|
-
var
|
|
753
|
+
var scopeByStatus = z13.preprocess(
|
|
754
|
+
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
755
|
+
z13.array(EventStatus).optional()
|
|
756
|
+
).describe(
|
|
757
|
+
"Restricts the scope to records currently in one of these statuses."
|
|
758
|
+
);
|
|
759
|
+
var userRole = z13.preprocess(
|
|
661
760
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
662
|
-
|
|
761
|
+
z13.array(z13.string()).optional()
|
|
663
762
|
).describe("User role, e.g. admin, field agent");
|
|
664
|
-
var scopeOptionsPlaceEvent =
|
|
763
|
+
var scopeOptionsPlaceEvent = z13.object({
|
|
665
764
|
event: scopeByEvent,
|
|
666
|
-
placeOfEvent: JurisdictionFilter.optional()
|
|
667
|
-
createdBy: UserFilter.optional(),
|
|
668
|
-
createdIn: JurisdictionFilter.optional()
|
|
765
|
+
placeOfEvent: JurisdictionFilter.optional()
|
|
669
766
|
}).describe("Options applicable to all record scopes.");
|
|
670
|
-
var
|
|
767
|
+
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
768
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
769
|
+
notifiedBy: UserFilter.optional(),
|
|
671
770
|
declaredIn: JurisdictionFilter.optional(),
|
|
672
|
-
declaredBy: UserFilter.optional()
|
|
771
|
+
declaredBy: UserFilter.optional(),
|
|
772
|
+
status: scopeByStatus
|
|
673
773
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
674
|
-
var AllRecordScopeOptions =
|
|
774
|
+
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
675
775
|
registeredIn: JurisdictionFilter.optional(),
|
|
676
|
-
registeredBy: UserFilter.optional()
|
|
776
|
+
registeredBy: UserFilter.optional(),
|
|
777
|
+
flags: ContainsFlags.optional()
|
|
677
778
|
}).describe(
|
|
678
779
|
"Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
|
|
679
780
|
);
|
|
680
781
|
var CustomActionScopeOptions = AllRecordScopeOptions.extend({
|
|
681
|
-
customActionTypes:
|
|
782
|
+
customActionTypes: z13.preprocess(
|
|
682
783
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
683
|
-
|
|
784
|
+
z13.array(z13.string()).optional()
|
|
684
785
|
).describe("Allowed custom action types")
|
|
685
786
|
});
|
|
686
|
-
var AccessLevelOptions =
|
|
787
|
+
var AccessLevelOptions = z13.object({
|
|
687
788
|
accessLevel: JurisdictionFilter.optional()
|
|
688
789
|
});
|
|
689
790
|
var AllUserScopeOptions = AccessLevelOptions.extend({
|
|
690
791
|
role: userRole.optional()
|
|
691
792
|
});
|
|
692
|
-
var WorkqueueOrDashboardOptions =
|
|
693
|
-
ids:
|
|
793
|
+
var WorkqueueOrDashboardOptions = z13.object({
|
|
794
|
+
ids: z13.preprocess(
|
|
694
795
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
695
|
-
|
|
796
|
+
z13.array(z13.string())
|
|
696
797
|
).describe("Must contain a list of workqueue or dashboard ids.")
|
|
697
798
|
});
|
|
698
|
-
var AllScopeOptions =
|
|
799
|
+
var AllScopeOptions = z13.object({
|
|
699
800
|
...AllRecordScopeOptions.shape,
|
|
700
801
|
...AccessLevelOptions.shape,
|
|
701
802
|
...AllUserScopeOptions.shape,
|
|
702
803
|
...WorkqueueOrDashboardOptions.shape
|
|
703
804
|
});
|
|
704
805
|
var ScopeOptionKey = AllScopeOptions.keyof();
|
|
705
|
-
var ResolvedScopeOptionsPlaceEvent =
|
|
806
|
+
var ResolvedScopeOptionsPlaceEvent = z13.object({
|
|
706
807
|
event: scopeByEvent,
|
|
707
|
-
placeOfEvent: UUID.nullish()
|
|
708
|
-
createdBy: z11.string().optional(),
|
|
709
|
-
createdIn: UUID.nullish()
|
|
808
|
+
placeOfEvent: UUID.nullish()
|
|
710
809
|
}).describe(
|
|
711
810
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
712
811
|
);
|
|
713
812
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
813
|
+
notifiedIn: UUID.nullish(),
|
|
814
|
+
notifiedBy: z13.string().optional(),
|
|
714
815
|
declaredIn: UUID.nullish(),
|
|
715
|
-
declaredBy:
|
|
816
|
+
declaredBy: z13.string().optional()
|
|
716
817
|
}).describe(
|
|
717
818
|
"Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
|
|
718
819
|
);
|
|
719
820
|
var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
|
|
720
821
|
registeredIn: UUID.nullish(),
|
|
721
|
-
registeredBy:
|
|
822
|
+
registeredBy: z13.string().optional(),
|
|
823
|
+
flags: ContainsFlags.optional()
|
|
722
824
|
}).describe(
|
|
723
825
|
"Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
|
|
724
826
|
);
|
|
@@ -731,7 +833,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
731
833
|
"record.edit",
|
|
732
834
|
"record.reject",
|
|
733
835
|
"record.archive",
|
|
734
|
-
"record.
|
|
836
|
+
"record.unarchive",
|
|
735
837
|
"record.register"
|
|
736
838
|
]);
|
|
737
839
|
var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
@@ -739,41 +841,42 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
|
|
|
739
841
|
"record.read",
|
|
740
842
|
"record.request-correction",
|
|
741
843
|
"record.correct",
|
|
742
|
-
"record.unassign-others"
|
|
844
|
+
"record.unassign-others",
|
|
845
|
+
"record.review-duplicates"
|
|
743
846
|
]);
|
|
744
847
|
var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
|
|
745
|
-
templates:
|
|
848
|
+
templates: z13.preprocess(
|
|
746
849
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
747
|
-
|
|
850
|
+
z13.array(z13.string()).optional()
|
|
748
851
|
).describe(
|
|
749
852
|
"Template IDs for certified copies. Controls which certificate templates are returned to the client via the config service. Certificate printing is a client-side operation \u2014 this option is not validated when the printCertificate action is submitted."
|
|
750
853
|
)
|
|
751
854
|
});
|
|
752
|
-
var RecordScopeV2 =
|
|
753
|
-
|
|
855
|
+
var RecordScopeV2 = z13.discriminatedUnion("type", [
|
|
856
|
+
z13.object({
|
|
754
857
|
type: ScopesWithPlaceEventOptions,
|
|
755
858
|
options: scopeOptionsPlaceEvent.optional()
|
|
756
859
|
}),
|
|
757
|
-
|
|
860
|
+
z13.object({
|
|
758
861
|
type: ScopesWithDeclaredOptions,
|
|
759
|
-
options:
|
|
862
|
+
options: scopeOptionsDeclaredOrNotified.optional()
|
|
760
863
|
}),
|
|
761
|
-
|
|
864
|
+
z13.object({
|
|
762
865
|
type: ScopesWithFullOptions,
|
|
763
866
|
options: AllRecordScopeOptions.optional()
|
|
764
867
|
}),
|
|
765
|
-
|
|
766
|
-
type:
|
|
868
|
+
z13.object({
|
|
869
|
+
type: z13.literal("record.custom-action"),
|
|
767
870
|
options: CustomActionScopeOptions.optional()
|
|
768
871
|
}),
|
|
769
|
-
|
|
770
|
-
type:
|
|
872
|
+
z13.object({
|
|
873
|
+
type: z13.literal("record.print-certified-copies"),
|
|
771
874
|
options: ScopeOptionsPrintCertifiedCopies.optional()
|
|
772
875
|
})
|
|
773
876
|
]).describe(
|
|
774
877
|
"Scopes used to check user's permission to perform actions on a record."
|
|
775
878
|
);
|
|
776
|
-
var SystemScopeType =
|
|
879
|
+
var SystemScopeType = z13.enum([
|
|
777
880
|
"organisation.read-locations",
|
|
778
881
|
"user.read",
|
|
779
882
|
"user.create",
|
|
@@ -787,93 +890,89 @@ var UserScopeType = SystemScopeType.extract([
|
|
|
787
890
|
"user.search"
|
|
788
891
|
]);
|
|
789
892
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
790
|
-
var UserScopeV2 =
|
|
791
|
-
|
|
893
|
+
var UserScopeV2 = z13.discriminatedUnion("type", [
|
|
894
|
+
z13.object({
|
|
792
895
|
type: ScopesWithRoleOption,
|
|
793
896
|
options: AllUserScopeOptions.optional()
|
|
794
897
|
}),
|
|
795
|
-
|
|
898
|
+
z13.object({
|
|
796
899
|
type: UserScopeType.extract(["user.read", "user.search"]),
|
|
797
900
|
options: AccessLevelOptions.optional()
|
|
798
901
|
})
|
|
799
902
|
]);
|
|
800
|
-
var ResolvedRecordScopeV2 =
|
|
801
|
-
|
|
903
|
+
var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
|
|
904
|
+
z13.object({
|
|
802
905
|
type: ScopesWithPlaceEventOptions,
|
|
803
906
|
options: ResolvedScopeOptionsPlaceEvent.optional()
|
|
804
907
|
}),
|
|
805
|
-
|
|
908
|
+
z13.object({
|
|
806
909
|
type: ScopesWithDeclaredOptions,
|
|
807
910
|
options: ResolvedScopeOptionsDeclared.optional()
|
|
808
911
|
}),
|
|
809
|
-
|
|
912
|
+
z13.object({
|
|
810
913
|
type: ScopesWithFullOptions,
|
|
811
914
|
options: ResolvedScopeOptionsFull.optional()
|
|
812
915
|
}),
|
|
813
|
-
|
|
814
|
-
type:
|
|
916
|
+
z13.object({
|
|
917
|
+
type: z13.literal("record.print-certified-copies"),
|
|
815
918
|
options: ResolvedScopeOptionsFull.extend({
|
|
816
|
-
templates:
|
|
919
|
+
templates: z13.array(z13.string()).optional()
|
|
817
920
|
}).optional()
|
|
818
921
|
})
|
|
819
922
|
]).describe("Resolved scope with location/user IDs instead of filters.");
|
|
820
|
-
var Scope =
|
|
821
|
-
|
|
923
|
+
var Scope = z13.discriminatedUnion("type", [
|
|
924
|
+
z13.object({ type: PlainScopeType }),
|
|
822
925
|
...RecordScopeV2.options,
|
|
823
926
|
...UserScopeV2.options,
|
|
824
|
-
|
|
825
|
-
type:
|
|
927
|
+
z13.object({
|
|
928
|
+
type: z13.literal("organisation.read-locations"),
|
|
826
929
|
options: AccessLevelOptions.optional()
|
|
827
930
|
}),
|
|
828
|
-
|
|
829
|
-
type:
|
|
931
|
+
z13.object({
|
|
932
|
+
type: z13.literal("workqueue"),
|
|
830
933
|
options: WorkqueueOrDashboardOptions
|
|
831
934
|
}),
|
|
832
|
-
|
|
833
|
-
type:
|
|
935
|
+
z13.object({
|
|
936
|
+
type: z13.literal("dashboard.view"),
|
|
834
937
|
options: WorkqueueOrDashboardOptions
|
|
835
938
|
})
|
|
836
939
|
]);
|
|
837
|
-
var ScopeType =
|
|
940
|
+
var ScopeType = z13.enum([
|
|
838
941
|
...SystemScopeType.options,
|
|
839
942
|
...RecordScopeTypeV2.options,
|
|
840
943
|
...PlainScopeType.options,
|
|
841
944
|
"workqueue",
|
|
842
945
|
"dashboard.view"
|
|
843
946
|
]);
|
|
844
|
-
var EncodedScope =
|
|
947
|
+
var EncodedScope = z13.string().brand("EncodedScope");
|
|
845
948
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
846
949
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
847
950
|
accessLevel: JurisdictionFilter.enum.all,
|
|
848
|
-
|
|
849
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
951
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
952
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
953
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
850
954
|
};
|
|
851
955
|
|
|
852
956
|
// ../commons/src/authentication.ts
|
|
853
|
-
var TokenUserType =
|
|
854
|
-
var TokenWithBearer =
|
|
957
|
+
var TokenUserType = z14.enum(["user", "system"]);
|
|
958
|
+
var TokenWithBearer = z14.string().regex(/^Bearer\s/);
|
|
855
959
|
|
|
856
960
|
// ../commons/src/events/ActionDocument.ts
|
|
857
|
-
var ActionUpdate =
|
|
961
|
+
var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
|
|
858
962
|
"Record of field-level changes made by an action. Supports partial updates and nullable values."
|
|
859
963
|
);
|
|
860
|
-
var EventState =
|
|
964
|
+
var EventState = z15.record(z15.string(), FieldValue).describe(
|
|
861
965
|
"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
|
|
862
966
|
);
|
|
863
|
-
var
|
|
864
|
-
Requested: "Requested",
|
|
865
|
-
Accepted: "Accepted",
|
|
866
|
-
Rejected: "Rejected"
|
|
867
|
-
};
|
|
868
|
-
var ActionBase = z13.object({
|
|
967
|
+
var ActionBase = z15.object({
|
|
869
968
|
id: UUID.describe("Unique identifier of the action."),
|
|
870
|
-
transactionId:
|
|
969
|
+
transactionId: z15.string().describe("Unique identifier of the transaction."),
|
|
871
970
|
createdByUserType: TokenUserType.describe(
|
|
872
971
|
"Indicates whether the action was created by a human-user or by a system-user."
|
|
873
972
|
),
|
|
874
|
-
createdAt:
|
|
875
|
-
createdBy:
|
|
876
|
-
createdByRole:
|
|
973
|
+
createdAt: z15.string().datetime().describe("Timestamp indicating when the action was created."),
|
|
974
|
+
createdBy: z15.string().describe("Identifier of the user who created the action."),
|
|
975
|
+
createdByRole: z15.string().optional().describe("Role of the user who created the action."),
|
|
877
976
|
createdBySignature: DocumentPath.nullish().describe(
|
|
878
977
|
"Reference to the signature of the user who created the action."
|
|
879
978
|
),
|
|
@@ -885,7 +984,7 @@ var ActionBase = z13.object({
|
|
|
885
984
|
"Declaration data defined by the ActionConfig. Supports partial updates."
|
|
886
985
|
),
|
|
887
986
|
annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
|
|
888
|
-
status:
|
|
987
|
+
status: z15.enum([
|
|
889
988
|
ActionStatus.Requested,
|
|
890
989
|
ActionStatus.Accepted,
|
|
891
990
|
ActionStatus.Rejected
|
|
@@ -897,139 +996,150 @@ var ActionBase = z13.object({
|
|
|
897
996
|
)
|
|
898
997
|
});
|
|
899
998
|
var AssignedAction = ActionBase.extend(
|
|
900
|
-
|
|
901
|
-
type:
|
|
902
|
-
assignedTo:
|
|
999
|
+
z15.object({
|
|
1000
|
+
type: z15.literal(ActionType.ASSIGN),
|
|
1001
|
+
assignedTo: z15.string().describe("Identifier of the user to whom the action is assigned.")
|
|
903
1002
|
// TODO move into 'content' property
|
|
904
1003
|
}).shape
|
|
905
1004
|
);
|
|
906
1005
|
var UnassignedAction = ActionBase.extend(
|
|
907
|
-
|
|
908
|
-
type:
|
|
1006
|
+
z15.object({
|
|
1007
|
+
type: z15.literal(ActionType.UNASSIGN)
|
|
909
1008
|
}).shape
|
|
910
1009
|
);
|
|
911
1010
|
var RegisterAction = ActionBase.extend(
|
|
912
|
-
|
|
913
|
-
type:
|
|
914
|
-
registrationNumber:
|
|
1011
|
+
z15.object({
|
|
1012
|
+
type: z15.literal(ActionType.REGISTER),
|
|
1013
|
+
registrationNumber: z15.string().optional().describe(
|
|
915
1014
|
"Registration number of the event. Always present for accepted registrations."
|
|
916
1015
|
)
|
|
917
1016
|
// TODO move into 'content' property
|
|
918
1017
|
}).shape
|
|
919
1018
|
);
|
|
920
1019
|
var DeclareAction = ActionBase.extend(
|
|
921
|
-
|
|
922
|
-
type:
|
|
1020
|
+
z15.object({
|
|
1021
|
+
type: z15.literal(ActionType.DECLARE)
|
|
923
1022
|
}).shape
|
|
924
1023
|
);
|
|
925
|
-
var ReasonContent =
|
|
926
|
-
reason:
|
|
1024
|
+
var ReasonContent = z15.object({
|
|
1025
|
+
reason: z15.string().min(1, { error: "Message cannot be empty" }).describe(
|
|
927
1026
|
"Message describing the reason for rejecting or archiving the event."
|
|
928
1027
|
)
|
|
929
1028
|
});
|
|
930
1029
|
var RejectAction = ActionBase.extend(
|
|
931
|
-
|
|
932
|
-
type:
|
|
1030
|
+
z15.object({
|
|
1031
|
+
type: z15.literal(ActionType.REJECT),
|
|
933
1032
|
content: ReasonContent
|
|
934
1033
|
}).shape
|
|
935
1034
|
);
|
|
936
|
-
var PotentialDuplicate =
|
|
1035
|
+
var PotentialDuplicate = z15.object({
|
|
937
1036
|
id: UUID,
|
|
938
|
-
trackingId:
|
|
1037
|
+
trackingId: z15.string()
|
|
939
1038
|
});
|
|
940
1039
|
var DuplicateDetectedAction = ActionBase.extend(
|
|
941
|
-
|
|
942
|
-
type:
|
|
943
|
-
content:
|
|
944
|
-
duplicates:
|
|
1040
|
+
z15.object({
|
|
1041
|
+
type: z15.literal(ActionType.DUPLICATE_DETECTED),
|
|
1042
|
+
content: z15.object({
|
|
1043
|
+
duplicates: z15.array(PotentialDuplicate)
|
|
945
1044
|
})
|
|
946
1045
|
}).shape
|
|
947
1046
|
);
|
|
948
1047
|
var MarkNotDuplicateAction = ActionBase.extend(
|
|
949
|
-
|
|
950
|
-
type:
|
|
1048
|
+
z15.object({
|
|
1049
|
+
type: z15.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
951
1050
|
}).shape
|
|
952
1051
|
);
|
|
953
1052
|
var MarkAsDuplicateAction = ActionBase.extend(
|
|
954
|
-
|
|
955
|
-
type:
|
|
956
|
-
content:
|
|
1053
|
+
z15.object({
|
|
1054
|
+
type: z15.literal(ActionType.MARK_AS_DUPLICATE),
|
|
1055
|
+
content: z15.object({
|
|
957
1056
|
duplicateOf: UUID
|
|
958
1057
|
}).optional()
|
|
959
1058
|
}).shape
|
|
960
1059
|
);
|
|
961
1060
|
var ArchiveAction = ActionBase.extend(
|
|
962
|
-
|
|
963
|
-
type:
|
|
964
|
-
|
|
1061
|
+
z15.object({
|
|
1062
|
+
type: z15.literal(ActionType.ARCHIVE),
|
|
1063
|
+
/**
|
|
1064
|
+
* Archiving does not collect a reason on its own. Only the
|
|
1065
|
+
* "mark as duplicate" flow archives with a reason attached.
|
|
1066
|
+
*/
|
|
1067
|
+
content: ReasonContent.optional()
|
|
1068
|
+
}).shape
|
|
1069
|
+
);
|
|
1070
|
+
var UnarchiveAction = ActionBase.extend(
|
|
1071
|
+
z15.object({
|
|
1072
|
+
type: z15.literal(ActionType.UNARCHIVE)
|
|
965
1073
|
}).shape
|
|
966
1074
|
);
|
|
967
1075
|
var CreatedAction = ActionBase.extend(
|
|
968
|
-
|
|
969
|
-
type:
|
|
1076
|
+
z15.object({
|
|
1077
|
+
type: z15.literal(ActionType.CREATE)
|
|
970
1078
|
}).shape
|
|
971
1079
|
);
|
|
972
1080
|
var NotifiedAction = ActionBase.extend(
|
|
973
|
-
|
|
974
|
-
type:
|
|
1081
|
+
z15.object({
|
|
1082
|
+
type: z15.literal(ActionType.NOTIFY)
|
|
975
1083
|
}).shape
|
|
976
1084
|
);
|
|
977
1085
|
var EditAction = ActionBase.extend(
|
|
978
|
-
|
|
979
|
-
type:
|
|
980
|
-
content
|
|
981
|
-
|
|
982
|
-
|
|
1086
|
+
z15.object({
|
|
1087
|
+
type: z15.literal(ActionType.EDIT),
|
|
1088
|
+
/** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
|
|
1089
|
+
content: z15.object({
|
|
1090
|
+
comment: z15.string().describe("Comment for the edit action.").optional()
|
|
1091
|
+
}).optional()
|
|
983
1092
|
}).shape
|
|
984
1093
|
);
|
|
985
|
-
var PrintContent =
|
|
986
|
-
templateId:
|
|
1094
|
+
var PrintContent = z15.object({
|
|
1095
|
+
templateId: z15.string().optional()
|
|
987
1096
|
});
|
|
988
1097
|
var PrintCertificateAction = ActionBase.extend(
|
|
989
|
-
|
|
990
|
-
type:
|
|
1098
|
+
z15.object({
|
|
1099
|
+
type: z15.literal(ActionType.PRINT_CERTIFICATE),
|
|
991
1100
|
content: PrintContent.optional().nullable()
|
|
992
1101
|
}).shape
|
|
993
1102
|
);
|
|
994
1103
|
var RequestedCorrectionAction = ActionBase.extend(
|
|
995
|
-
|
|
996
|
-
type:
|
|
1104
|
+
z15.object({
|
|
1105
|
+
type: z15.literal(ActionType.REQUEST_CORRECTION)
|
|
997
1106
|
}).shape
|
|
998
1107
|
);
|
|
999
1108
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1000
|
-
|
|
1001
|
-
type:
|
|
1002
|
-
requestId:
|
|
1109
|
+
z15.object({
|
|
1110
|
+
type: z15.literal(ActionType.APPROVE_CORRECTION),
|
|
1111
|
+
requestId: z15.string(),
|
|
1003
1112
|
// TODO move into 'content' property
|
|
1004
|
-
content:
|
|
1113
|
+
content: z15.object({ immediateCorrection: z15.boolean().optional() }).optional()
|
|
1005
1114
|
}).shape
|
|
1006
1115
|
);
|
|
1007
1116
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
1008
|
-
|
|
1009
|
-
type:
|
|
1010
|
-
requestId:
|
|
1117
|
+
z15.object({
|
|
1118
|
+
type: z15.literal(ActionType.REJECT_CORRECTION),
|
|
1119
|
+
requestId: z15.string(),
|
|
1011
1120
|
// TODO move into 'content' property
|
|
1012
1121
|
content: ReasonContent
|
|
1013
1122
|
}).shape
|
|
1014
1123
|
);
|
|
1015
1124
|
var ReadAction = ActionBase.extend(
|
|
1016
|
-
|
|
1017
|
-
type:
|
|
1125
|
+
z15.object({
|
|
1126
|
+
type: z15.literal(ActionType.READ)
|
|
1018
1127
|
}).shape
|
|
1019
1128
|
);
|
|
1020
1129
|
var CustomAction = ActionBase.merge(
|
|
1021
|
-
|
|
1022
|
-
type:
|
|
1023
|
-
customActionType:
|
|
1130
|
+
z15.object({
|
|
1131
|
+
type: z15.literal(ActionType.CUSTOM),
|
|
1132
|
+
customActionType: z15.string()
|
|
1024
1133
|
})
|
|
1025
1134
|
);
|
|
1026
|
-
var ActionDocument =
|
|
1135
|
+
var ActionDocument = z15.discriminatedUnion("type", [
|
|
1027
1136
|
CreatedAction.meta({ id: "CreatedAction" }),
|
|
1028
1137
|
RejectAction.meta({ id: "RejectAction" }),
|
|
1029
1138
|
DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
|
|
1030
1139
|
MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
|
|
1031
1140
|
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1032
1141
|
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1142
|
+
UnarchiveAction.meta({ id: "UnarchiveAction" }),
|
|
1033
1143
|
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1034
1144
|
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1035
1145
|
DeclareAction.meta({ id: "DeclareAction" }),
|
|
@@ -1049,108 +1159,50 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
|
1049
1159
|
declaration: true,
|
|
1050
1160
|
annotation: true
|
|
1051
1161
|
}).extend(
|
|
1052
|
-
|
|
1053
|
-
type:
|
|
1054
|
-
status:
|
|
1162
|
+
z15.object({
|
|
1163
|
+
type: z15.enum(ConfirmableActions),
|
|
1164
|
+
status: z15.literal(ActionStatus.Rejected)
|
|
1055
1165
|
}).shape
|
|
1056
1166
|
);
|
|
1057
|
-
var Action =
|
|
1058
|
-
|
|
1059
|
-
// ../commons/src/events/Flag.ts
|
|
1060
|
-
var z14 = __toESM(require("zod/v4"));
|
|
1061
|
-
var InherentFlags = {
|
|
1062
|
-
INCOMPLETE: "incomplete",
|
|
1063
|
-
REJECTED: "rejected",
|
|
1064
|
-
CORRECTION_REQUESTED: "correction-requested",
|
|
1065
|
-
POTENTIAL_DUPLICATE: "potential-duplicate",
|
|
1066
|
-
/**
|
|
1067
|
-
* This flag is set by the Edit-action and removed after the declaration or registration.
|
|
1068
|
-
* A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
|
|
1069
|
-
*
|
|
1070
|
-
* We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
|
|
1071
|
-
*/
|
|
1072
|
-
EDIT_IN_PROGRESS: "edit-in-progress"
|
|
1073
|
-
};
|
|
1074
|
-
var ActionFlag = z14.string().regex(
|
|
1075
|
-
new RegExp(
|
|
1076
|
-
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
|
1077
|
-
ActionStatus
|
|
1078
|
-
).join("|").toLowerCase()})$`
|
|
1079
|
-
),
|
|
1080
|
-
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
|
1081
|
-
);
|
|
1082
|
-
var CustomFlag = z14.string().refine((val) => !Object.values(InherentFlags).includes(val), {
|
|
1083
|
-
message: `Custom flag cannot be one of the inherent flags: ${Object.values(
|
|
1084
|
-
InherentFlags
|
|
1085
|
-
).join(", ")}`
|
|
1086
|
-
}).refine((val) => !ActionFlag.safeParse(val).success, {
|
|
1087
|
-
message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
|
|
1088
|
-
}).describe("Custom flag identifier defined by the country config.");
|
|
1089
|
-
var Flag = ActionFlag.or(z14.enum(InherentFlags)).or(CustomFlag);
|
|
1090
|
-
var FlagConfig = z14.object({
|
|
1091
|
-
id: CustomFlag,
|
|
1092
|
-
requiresAction: z14.boolean().describe(
|
|
1093
|
-
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1094
|
-
),
|
|
1095
|
-
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1096
|
-
}).meta({
|
|
1097
|
-
id: "FlagConfig",
|
|
1098
|
-
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1099
|
-
});
|
|
1100
|
-
var ActionFlagConfig = z14.object({
|
|
1101
|
-
id: Flag,
|
|
1102
|
-
operation: z14.enum(["add", "remove"]).describe("Operation to perform on the flag."),
|
|
1103
|
-
conditional: Conditional.optional().describe(
|
|
1104
|
-
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1105
|
-
)
|
|
1106
|
-
}).meta({
|
|
1107
|
-
id: "ActionFlagConfig",
|
|
1108
|
-
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1109
|
-
});
|
|
1167
|
+
var Action = z15.union([ActionDocument, AsyncRejectActionDocument]);
|
|
1110
1168
|
|
|
1111
1169
|
// ../commons/src/events/EventMetadata.ts
|
|
1112
|
-
var
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
"
|
|
1116
|
-
"
|
|
1117
|
-
"ARCHIVED"
|
|
1118
|
-
]);
|
|
1119
|
-
var ZodDate = z15.iso.date();
|
|
1120
|
-
var ZodDateTime = z15.string().datetime();
|
|
1121
|
-
var ActionCreationMetadata = z15.object({
|
|
1122
|
-
createdAt: z15.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1123
|
-
createdBy: z15.string().describe("ID of the user who created the action request."),
|
|
1170
|
+
var ZodDate = z16.iso.date();
|
|
1171
|
+
var ZodDateTime = z16.string().datetime();
|
|
1172
|
+
var ActionCreationMetadata = z16.object({
|
|
1173
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
|
|
1174
|
+
createdBy: z16.string().describe("ID of the user who created the action request."),
|
|
1124
1175
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1125
1176
|
createdAtLocation: UUID.nullish().describe(
|
|
1126
1177
|
"Location of the user who created the action request."
|
|
1127
1178
|
),
|
|
1128
|
-
createdByUserType:
|
|
1129
|
-
acceptedAt:
|
|
1130
|
-
createdByRole:
|
|
1179
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1180
|
+
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1181
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1131
1182
|
});
|
|
1132
1183
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1133
|
-
registrationNumber:
|
|
1184
|
+
registrationNumber: z16.string().describe(
|
|
1134
1185
|
"Registration number of the event. Always present for accepted registrations."
|
|
1135
1186
|
)
|
|
1136
1187
|
});
|
|
1137
|
-
var LegalStatuses =
|
|
1188
|
+
var LegalStatuses = z16.object({
|
|
1189
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1138
1190
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1139
1191
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1140
1192
|
});
|
|
1141
|
-
var EventMetadata =
|
|
1193
|
+
var EventMetadata = z16.object({
|
|
1142
1194
|
id: UUID,
|
|
1143
|
-
type:
|
|
1195
|
+
type: z16.string().describe("The type of event, such as birth, death, or marriage."),
|
|
1144
1196
|
status: EventStatus,
|
|
1145
1197
|
legalStatuses: LegalStatuses.describe(
|
|
1146
1198
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
|
1147
1199
|
),
|
|
1148
|
-
createdAt:
|
|
1200
|
+
createdAt: z16.iso.datetime().describe("The timestamp when the event was first created and saved."),
|
|
1149
1201
|
dateOfEvent: ZodDate.nullish(),
|
|
1150
1202
|
placeOfEvent: UUID.nullish(),
|
|
1151
|
-
createdBy:
|
|
1152
|
-
createdByUserType:
|
|
1153
|
-
updatedByUserRole:
|
|
1203
|
+
createdBy: z16.string().describe("ID of the user who created the event."),
|
|
1204
|
+
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1205
|
+
updatedByUserRole: z16.string().nullish().describe("Role of the user who last changed the status."),
|
|
1154
1206
|
// @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
|
|
1155
1207
|
createdAtLocation: UUID.nullish().describe(
|
|
1156
1208
|
"Location of the user who created the event."
|
|
@@ -1158,18 +1210,18 @@ var EventMetadata = z15.object({
|
|
|
1158
1210
|
updatedAtLocation: UUID.nullish().describe(
|
|
1159
1211
|
"Location of the user who last changed the status."
|
|
1160
1212
|
),
|
|
1161
|
-
updatedAt:
|
|
1213
|
+
updatedAt: z16.iso.datetime().describe(
|
|
1162
1214
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
|
1163
1215
|
),
|
|
1164
|
-
assignedTo:
|
|
1165
|
-
updatedBy:
|
|
1166
|
-
trackingId:
|
|
1216
|
+
assignedTo: z16.string().nullish().describe("ID of the user currently assigned to the event."),
|
|
1217
|
+
updatedBy: z16.string().nullish().describe("ID of the user who last changed the status."),
|
|
1218
|
+
trackingId: z16.string().describe(
|
|
1167
1219
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
|
1168
1220
|
),
|
|
1169
|
-
potentialDuplicates:
|
|
1221
|
+
potentialDuplicates: z16.array(PotentialDuplicate).describe(
|
|
1170
1222
|
"List of event IDs and their tracking IDs that this event could be a duplicate of."
|
|
1171
1223
|
),
|
|
1172
|
-
flags:
|
|
1224
|
+
flags: z16.array(Flag)
|
|
1173
1225
|
});
|
|
1174
1226
|
var EventMetadataKeysArray = [
|
|
1175
1227
|
"id",
|
|
@@ -1190,18 +1242,22 @@ var EventMetadataKeysArray = [
|
|
|
1190
1242
|
"legalStatuses",
|
|
1191
1243
|
"flags"
|
|
1192
1244
|
];
|
|
1193
|
-
var EventMetadataKeys =
|
|
1194
|
-
var EventMetadataDateFieldIdInput =
|
|
1245
|
+
var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
1246
|
+
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1195
1247
|
"createdAt",
|
|
1196
1248
|
"updatedAt",
|
|
1249
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1250
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1197
1251
|
"legalStatuses.DECLARED.createdAt",
|
|
1198
1252
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1199
1253
|
"legalStatuses.REGISTERED.createdAt",
|
|
1200
1254
|
"legalStatuses.REGISTERED.acceptedAt"
|
|
1201
1255
|
]);
|
|
1202
|
-
var EventMetadataDateFieldId =
|
|
1256
|
+
var EventMetadataDateFieldId = z16.enum([
|
|
1203
1257
|
"event.createdAt",
|
|
1204
1258
|
"event.updatedAt",
|
|
1259
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1260
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1205
1261
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1206
1262
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1207
1263
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1262,12 +1318,6 @@ var Range = import_v4.z.object({
|
|
|
1262
1318
|
}).meta({
|
|
1263
1319
|
id: "Range"
|
|
1264
1320
|
});
|
|
1265
|
-
var ContainsFlags = import_v4.z.object({
|
|
1266
|
-
anyOf: import_v4.z.array(Flag).optional(),
|
|
1267
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1268
|
-
}).meta({
|
|
1269
|
-
id: "ContainsFlags"
|
|
1270
|
-
});
|
|
1271
1321
|
var Within = import_v4.z.object({ type: import_v4.z.literal("within"), location: import_v4.z.string() }).meta({
|
|
1272
1322
|
id: "Within"
|
|
1273
1323
|
});
|
|
@@ -1462,8 +1512,8 @@ var BaseField = import_v43.default.object({
|
|
|
1462
1512
|
conditionals: import_v43.default.array(FieldConditional).default([]).optional().describe(
|
|
1463
1513
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1464
1514
|
),
|
|
1465
|
-
secured: import_v43.default.boolean().default(false).optional().describe(
|
|
1466
|
-
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1515
|
+
secured: import_v43.default.union([import_v43.default.boolean(), Conditional]).default(false).optional().describe(
|
|
1516
|
+
"Indicates whether the field is secured, either always (boolean) or conditionally, evaluated against the event (a JSONSchema conditional, e.g. flag('sealed')). Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1467
1517
|
),
|
|
1468
1518
|
placeholder: TranslationConfig.optional(),
|
|
1469
1519
|
validation: import_v43.default.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
@@ -1861,7 +1911,16 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
1861
1911
|
configuration: import_v43.default.object({
|
|
1862
1912
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
1863
1913
|
type: AdministrativeAreas,
|
|
1864
|
-
allowedLocations: AllowedLocations
|
|
1914
|
+
allowedLocations: AllowedLocations,
|
|
1915
|
+
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
1916
|
+
"List every historical name a location has had as a separate, selectable option."
|
|
1917
|
+
),
|
|
1918
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1919
|
+
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
1920
|
+
),
|
|
1921
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
1922
|
+
"Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that."
|
|
1923
|
+
)
|
|
1865
1924
|
}).describe("Administrative area options")
|
|
1866
1925
|
}).meta({
|
|
1867
1926
|
description: "Administrative area input field",
|
|
@@ -1872,7 +1931,16 @@ var LocationInput = BaseField.extend({
|
|
|
1872
1931
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1873
1932
|
configuration: import_v43.default.object({
|
|
1874
1933
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1875
|
-
allowedLocations: AllowedLocations
|
|
1934
|
+
allowedLocations: AllowedLocations,
|
|
1935
|
+
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
1936
|
+
"List every historical name a location has had as a separate, selectable option."
|
|
1937
|
+
),
|
|
1938
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
1939
|
+
"Offer only locations that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded."
|
|
1940
|
+
),
|
|
1941
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
1942
|
+
"Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that."
|
|
1943
|
+
)
|
|
1876
1944
|
}).optional()
|
|
1877
1945
|
}).meta({
|
|
1878
1946
|
description: "A field for selecting a location",
|
|
@@ -1898,12 +1966,22 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1898
1966
|
var Facility = BaseField.extend({
|
|
1899
1967
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1900
1968
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1901
|
-
configuration: import_v43.default.object({
|
|
1969
|
+
configuration: import_v43.default.object({
|
|
1970
|
+
allowedLocations: AllowedLocations,
|
|
1971
|
+
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
1972
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
1973
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
1974
|
+
}).optional()
|
|
1902
1975
|
}).describe("Input field for a facility");
|
|
1903
1976
|
var Office = BaseField.extend({
|
|
1904
1977
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1905
1978
|
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1906
|
-
configuration: import_v43.default.object({
|
|
1979
|
+
configuration: import_v43.default.object({
|
|
1980
|
+
allowedLocations: AllowedLocations,
|
|
1981
|
+
listHistoricalNames: import_v43.default.boolean().optional(),
|
|
1982
|
+
activeOnly: import_v43.default.boolean().optional(),
|
|
1983
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional()
|
|
1984
|
+
}).optional()
|
|
1907
1985
|
}).describe("Input field for an office");
|
|
1908
1986
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1909
1987
|
administrativeArea: import_v43.default.union([UUID, SerializedUserField]).optional()
|
|
@@ -1936,7 +2014,16 @@ var Address = BaseField.extend({
|
|
|
1936
2014
|
parent: FieldReference.optional()
|
|
1937
2015
|
})
|
|
1938
2016
|
).optional(),
|
|
1939
|
-
allowedLocations: AllowedLocations
|
|
2017
|
+
allowedLocations: AllowedLocations,
|
|
2018
|
+
listHistoricalNames: import_v43.default.boolean().optional().describe(
|
|
2019
|
+
"List every historical name a location has had as a separate, selectable option. Propagated to the embedded admin-area selectors."
|
|
2020
|
+
),
|
|
2021
|
+
activeOnly: import_v43.default.boolean().optional().describe(
|
|
2022
|
+
"Offer only admin areas that are active at the resolved anchor date (today, or the date of event when anchorToDateOfEvent is set); inactive or not-yet-effective versions are excluded. Propagated to the embedded admin-area selectors."
|
|
2023
|
+
),
|
|
2024
|
+
anchorToDateOfEvent: import_v43.default.boolean().optional().describe(
|
|
2025
|
+
"Resolve selectable/displayed versions against the event's date of event (falling back to the record's creation date when empty) instead of today. Does not by itself exclude inactive versions; combine with activeOnly for that. Propagated to the embedded admin-area selectors."
|
|
2026
|
+
)
|
|
1940
2027
|
}).optional(),
|
|
1941
2028
|
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1942
2029
|
}).meta({
|
|
@@ -2237,7 +2324,7 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
|
|
|
2237
2324
|
]);
|
|
2238
2325
|
|
|
2239
2326
|
// ../commons/src/application-config.ts
|
|
2240
|
-
var SearchCriteria =
|
|
2327
|
+
var SearchCriteria = z21.enum([
|
|
2241
2328
|
"TRACKING_ID",
|
|
2242
2329
|
"REGISTRATION_NUMBER",
|
|
2243
2330
|
"NATIONAL_ID",
|
|
@@ -2245,69 +2332,69 @@ var SearchCriteria = z20.enum([
|
|
|
2245
2332
|
"PHONE_NUMBER",
|
|
2246
2333
|
"EMAIL"
|
|
2247
2334
|
]);
|
|
2248
|
-
var ApplicationConfig =
|
|
2249
|
-
APPLICATION_NAME:
|
|
2250
|
-
COUNTRY_LOGO:
|
|
2251
|
-
fileName:
|
|
2252
|
-
file:
|
|
2335
|
+
var ApplicationConfig = z21.object({
|
|
2336
|
+
APPLICATION_NAME: z21.string(),
|
|
2337
|
+
COUNTRY_LOGO: z21.object({
|
|
2338
|
+
fileName: z21.string(),
|
|
2339
|
+
file: z21.string()
|
|
2253
2340
|
}),
|
|
2254
|
-
SYSTEM_IANA_TIMEZONE:
|
|
2255
|
-
CURRENCY:
|
|
2256
|
-
languagesAndCountry:
|
|
2257
|
-
isoCode:
|
|
2341
|
+
SYSTEM_IANA_TIMEZONE: z21.string(),
|
|
2342
|
+
CURRENCY: z21.object({
|
|
2343
|
+
languagesAndCountry: z21.array(z21.string()),
|
|
2344
|
+
isoCode: z21.string()
|
|
2258
2345
|
}),
|
|
2259
|
-
ADMIN_STRUCTURE:
|
|
2260
|
-
|
|
2261
|
-
id:
|
|
2346
|
+
ADMIN_STRUCTURE: z21.array(
|
|
2347
|
+
z21.object({
|
|
2348
|
+
id: z21.string(),
|
|
2262
2349
|
label: TranslationConfig
|
|
2263
2350
|
})
|
|
2264
2351
|
),
|
|
2265
|
-
PHONE_NUMBER_PATTERN:
|
|
2266
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2267
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2352
|
+
PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
|
|
2353
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2354
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2268
2355
|
SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID"),
|
|
2269
|
-
ADDITIONAL_USER_FIELDS:
|
|
2356
|
+
ADDITIONAL_USER_FIELDS: z21.array(FieldConfig).optional().default([])
|
|
2270
2357
|
});
|
|
2271
2358
|
var defineApplicationConfig = (config) => {
|
|
2272
2359
|
return ApplicationConfig.parse(config);
|
|
2273
2360
|
};
|
|
2274
|
-
var BackgroundConfig =
|
|
2275
|
-
backgroundColor:
|
|
2276
|
-
backgroundImage:
|
|
2277
|
-
imageFit:
|
|
2361
|
+
var BackgroundConfig = z21.object({
|
|
2362
|
+
backgroundColor: z21.string().optional(),
|
|
2363
|
+
backgroundImage: z21.string().optional(),
|
|
2364
|
+
imageFit: z21.string().optional()
|
|
2278
2365
|
}).refine(
|
|
2279
2366
|
(data) => !!(data.backgroundColor || data.backgroundImage),
|
|
2280
2367
|
"backgroundColor and backgroundImage cannot be empty at the same time"
|
|
2281
2368
|
);
|
|
2282
|
-
var LoginConfig =
|
|
2283
|
-
COUNTRY:
|
|
2284
|
-
LANGUAGES:
|
|
2285
|
-
USER_NOTIFICATION_DELIVERY_METHOD:
|
|
2286
|
-
INFORMANT_NOTIFICATION_DELIVERY_METHOD:
|
|
2287
|
-
PHONE_NUMBER_PATTERN:
|
|
2369
|
+
var LoginConfig = z21.object({
|
|
2370
|
+
COUNTRY: z21.string(),
|
|
2371
|
+
LANGUAGES: z21.array(z21.string()),
|
|
2372
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2373
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z21.enum(["email", "sms"]),
|
|
2374
|
+
PHONE_NUMBER_PATTERN: z21.string().or(z21.instanceof(RegExp)),
|
|
2288
2375
|
LOGIN_BACKGROUND: BackgroundConfig,
|
|
2289
|
-
SENTRY:
|
|
2376
|
+
SENTRY: z21.string().optional()
|
|
2290
2377
|
});
|
|
2291
2378
|
var defineLoginConfig = (config) => {
|
|
2292
2379
|
return LoginConfig.parse(config);
|
|
2293
2380
|
};
|
|
2294
|
-
var ClientConfig =
|
|
2295
|
-
COUNTRY:
|
|
2296
|
-
LANGUAGES:
|
|
2297
|
-
SENTRY:
|
|
2298
|
-
LOGIN_URL:
|
|
2381
|
+
var ClientConfig = z21.object({
|
|
2382
|
+
COUNTRY: z21.string(),
|
|
2383
|
+
LANGUAGES: z21.array(z21.string()),
|
|
2384
|
+
SENTRY: z21.string().optional(),
|
|
2385
|
+
LOGIN_URL: z21.string().optional(),
|
|
2299
2386
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2300
|
-
DASHBOARDS:
|
|
2301
|
-
|
|
2302
|
-
id:
|
|
2387
|
+
DASHBOARDS: z21.array(
|
|
2388
|
+
z21.object({
|
|
2389
|
+
id: z21.string(),
|
|
2303
2390
|
title: TranslationConfig,
|
|
2304
|
-
url:
|
|
2305
|
-
context:
|
|
2306
|
-
auth:
|
|
2391
|
+
url: z21.string(),
|
|
2392
|
+
context: z21.object({
|
|
2393
|
+
auth: z21.literal("REQUEST_AUTH_TOKEN")
|
|
2307
2394
|
}).optional()
|
|
2308
2395
|
})
|
|
2309
2396
|
),
|
|
2310
|
-
FEATURES:
|
|
2397
|
+
FEATURES: z21.object({ V2_EVENTS: z21.boolean().optional().default(true) }).optional().default({ V2_EVENTS: true })
|
|
2311
2398
|
});
|
|
2312
2399
|
var defineClientConfig = (config) => {
|
|
2313
2400
|
return ClientConfig.parse(config);
|