@opencrvs/toolkit 2.0.0-rc.ca1536b → 2.0.0-rc.ca3fe84
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 +15 -0
- package/build.sh +3 -2
- package/create-countryconfig/index.js +50 -20
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +273 -98
- package/dist/cli.js +3354 -51
- package/dist/commons/api/router.d.ts +3005 -2570
- package/dist/commons/application-config/index.d.ts +7 -6
- package/dist/commons/conditionals/conditionals.d.ts +293 -234
- package/dist/commons/conditionals/validate.d.ts +51 -2
- package/dist/commons/events/ActionConfig.d.ts +93 -67
- package/dist/commons/events/ActionDocument.d.ts +113 -107
- package/dist/commons/events/ActionInput.d.ts +42 -36
- package/dist/commons/events/ActionType.d.ts +57 -57
- package/dist/commons/events/AdvancedSearchConfig.d.ts +651 -297
- package/dist/commons/events/AuditLog.d.ts +41 -41
- 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 +33 -34
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +5 -3
- package/dist/commons/events/EventDocument.d.ts +46 -43
- package/dist/commons/events/EventIndex.d.ts +76 -51
- package/dist/commons/events/EventMetadata.d.ts +60 -34
- package/dist/commons/events/FieldConfig.d.ts +710 -372
- package/dist/commons/events/FieldType.d.ts +51 -50
- package/dist/commons/events/FieldTypeMapping.d.ts +101 -101
- package/dist/commons/events/FieldValue.d.ts +18 -12
- package/dist/commons/events/Flag.d.ts +15 -15
- 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 +981 -942
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +2 -2
- package/dist/commons/events/field.d.ts +112 -189
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/locations.d.ts +5 -4
- package/dist/commons/events/mocks.test.utils.d.ts +2 -2
- package/dist/commons/events/scopes.d.ts +4 -4
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/index.d.ts +23 -15
- package/dist/commons/events/state/utils.d.ts +25 -291
- package/dist/commons/events/test.utils.d.ts +33 -33
- package/dist/commons/events/utils.d.ts +120 -109
- package/dist/commons/notification/UserNotifications.d.ts +10 -10
- package/dist/conditionals/index.js +63 -5
- 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 +134 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +169 -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 +5 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +71 -0
- package/dist/environment/logger.d.ts +6 -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/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 +412 -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 +788 -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 +163 -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 +179 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +122 -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 +1088 -237
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +114 -12
- 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/notification/index.js +899 -135
- package/dist/scopes/index.d.ts +209 -123
- package/dist/scopes/index.js +20 -7
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +83 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +115 -0
- package/dist/templates/inventory/inventory.template.yml +100 -0
- package/dist/templates/inventory/production.example.yml +77 -0
- package/dist/templates/inventory/qa.example.yml +48 -0
- package/opencrvs-toolkit-2.0.0-rc.ca3fe84.tgz +0 -0
- package/package.json +21 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.ca1536b.tgz +0 -0
|
@@ -118,11 +118,13 @@ var scopeOptionsPlaceEvent = z2.object({
|
|
|
118
118
|
event: scopeByEvent,
|
|
119
119
|
placeOfEvent: JurisdictionFilter.optional()
|
|
120
120
|
}).describe("Options applicable to all record scopes.");
|
|
121
|
-
var
|
|
121
|
+
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
122
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
123
|
+
notifiedBy: UserFilter.optional(),
|
|
122
124
|
declaredIn: JurisdictionFilter.optional(),
|
|
123
125
|
declaredBy: UserFilter.optional()
|
|
124
126
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
125
|
-
var AllRecordScopeOptions =
|
|
127
|
+
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
126
128
|
registeredIn: JurisdictionFilter.optional(),
|
|
127
129
|
registeredBy: UserFilter.optional()
|
|
128
130
|
}).describe(
|
|
@@ -160,6 +162,8 @@ var ResolvedScopeOptionsPlaceEvent = z2.object({
|
|
|
160
162
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
161
163
|
);
|
|
162
164
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
165
|
+
notifiedIn: UUID.nullish(),
|
|
166
|
+
notifiedBy: z2.string().optional(),
|
|
163
167
|
declaredIn: UUID.nullish(),
|
|
164
168
|
declaredBy: z2.string().optional()
|
|
165
169
|
}).describe(
|
|
@@ -205,7 +209,7 @@ var RecordScopeV2 = z2.discriminatedUnion("type", [
|
|
|
205
209
|
}),
|
|
206
210
|
z2.object({
|
|
207
211
|
type: ScopesWithDeclaredOptions,
|
|
208
|
-
options:
|
|
212
|
+
options: scopeOptionsDeclaredOrNotified.optional()
|
|
209
213
|
}),
|
|
210
214
|
z2.object({
|
|
211
215
|
type: ScopesWithFullOptions,
|
|
@@ -293,7 +297,10 @@ var ScopeType = z2.enum([
|
|
|
293
297
|
var EncodedScope = z2.string().brand("EncodedScope");
|
|
294
298
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
295
299
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
296
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
300
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
301
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
302
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
303
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
297
304
|
};
|
|
298
305
|
|
|
299
306
|
// ../commons/src/authentication.ts
|
|
@@ -652,7 +659,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
652
659
|
ShowConditional,
|
|
653
660
|
// Action can be shown to the user in the list but as disabled
|
|
654
661
|
EnableConditional
|
|
655
|
-
])
|
|
662
|
+
]).meta({
|
|
663
|
+
id: "ActionConditional",
|
|
664
|
+
description: "Conditional gating whether an action is shown (SHOW) or enabled (ENABLE). When omitted from an action, the action is shown and enabled for everyone."
|
|
665
|
+
});
|
|
656
666
|
var DisplayOnReviewConditional = z7.object({
|
|
657
667
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
658
668
|
conditional: Conditional
|
|
@@ -667,8 +677,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
667
677
|
// Field output can be shown / hidden on the review page
|
|
668
678
|
DisplayOnReviewConditional
|
|
669
679
|
]).meta({
|
|
670
|
-
|
|
671
|
-
|
|
680
|
+
id: "FieldConditional",
|
|
681
|
+
description: "Conditional gating whether a form field is shown (SHOW), enabled (ENABLE), or displayed on the review page (DISPLAY_ON_REVIEW). When omitted, the field is shown and enabled for everyone, and is displayed on review whenever it has a value."
|
|
672
682
|
});
|
|
673
683
|
|
|
674
684
|
// ../commons/src/events/FieldType.ts
|
|
@@ -765,6 +775,11 @@ var FieldTypesToHideInReview = [
|
|
|
765
775
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
766
776
|
FieldType.ALPHA_HIDDEN
|
|
767
777
|
];
|
|
778
|
+
var HiddenFieldTypes = [
|
|
779
|
+
FieldType.HTTP,
|
|
780
|
+
FieldType.QUERY_PARAM_READER,
|
|
781
|
+
FieldType.ALPHA_HIDDEN
|
|
782
|
+
];
|
|
768
783
|
|
|
769
784
|
// ../commons/src/events/FieldValue.ts
|
|
770
785
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -883,7 +898,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
883
898
|
// ../commons/src/events/FieldValue.ts
|
|
884
899
|
var TextValue = z12.string();
|
|
885
900
|
var HiddenFieldValue = z12.string();
|
|
886
|
-
var NonEmptyTextValue =
|
|
901
|
+
var NonEmptyTextValue = z12.string().trim().min(1);
|
|
887
902
|
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
888
903
|
var AgeValue = z12.object({
|
|
889
904
|
age: z12.number(),
|
|
@@ -912,6 +927,7 @@ var DateRangeFieldValue = z12.object({
|
|
|
912
927
|
var EmailValue = z12.email();
|
|
913
928
|
var CheckboxFieldValue = z12.boolean();
|
|
914
929
|
var NumberFieldValue = z12.number();
|
|
930
|
+
var SignatureFieldValue = FileFieldValue;
|
|
915
931
|
var ButtonFieldValue = z12.number();
|
|
916
932
|
var VerificationStatusValue = z12.enum([
|
|
917
933
|
"verified",
|
|
@@ -1210,8 +1226,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
1210
1226
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1211
1227
|
z14.object({
|
|
1212
1228
|
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1213
|
-
requestId: z14.string()
|
|
1229
|
+
requestId: z14.string(),
|
|
1214
1230
|
// TODO move into 'content' property
|
|
1231
|
+
content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
|
|
1215
1232
|
}).shape
|
|
1216
1233
|
);
|
|
1217
1234
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1303,6 +1320,9 @@ var FlagConfig = z15.object({
|
|
|
1303
1320
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1304
1321
|
),
|
|
1305
1322
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1323
|
+
}).meta({
|
|
1324
|
+
id: "FlagConfig",
|
|
1325
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1306
1326
|
});
|
|
1307
1327
|
var ActionFlagConfig = z15.object({
|
|
1308
1328
|
id: Flag,
|
|
@@ -1310,6 +1330,9 @@ var ActionFlagConfig = z15.object({
|
|
|
1310
1330
|
conditional: Conditional.optional().describe(
|
|
1311
1331
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1312
1332
|
)
|
|
1333
|
+
}).meta({
|
|
1334
|
+
id: "ActionFlagConfig",
|
|
1335
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1313
1336
|
});
|
|
1314
1337
|
|
|
1315
1338
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1339,6 +1362,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1339
1362
|
)
|
|
1340
1363
|
});
|
|
1341
1364
|
var LegalStatuses = z16.object({
|
|
1365
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1342
1366
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1343
1367
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1344
1368
|
});
|
|
@@ -1398,6 +1422,8 @@ var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
|
1398
1422
|
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1399
1423
|
"createdAt",
|
|
1400
1424
|
"updatedAt",
|
|
1425
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1426
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1401
1427
|
"legalStatuses.DECLARED.createdAt",
|
|
1402
1428
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1403
1429
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1406,6 +1432,8 @@ var EventMetadataDateFieldIdInput = z16.enum([
|
|
|
1406
1432
|
var EventMetadataDateFieldId = z16.enum([
|
|
1407
1433
|
"event.createdAt",
|
|
1408
1434
|
"event.updatedAt",
|
|
1435
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1436
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1409
1437
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1410
1438
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1411
1439
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1465,7 +1493,8 @@ var Range = import_v4.z.object({
|
|
|
1465
1493
|
});
|
|
1466
1494
|
var ContainsFlags = import_v4.z.object({
|
|
1467
1495
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
1468
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1496
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
1497
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
1469
1498
|
}).meta({
|
|
1470
1499
|
id: "ContainsFlags"
|
|
1471
1500
|
});
|
|
@@ -1651,14 +1680,31 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1651
1680
|
}
|
|
1652
1681
|
}).describe("Unique identifier for the field");
|
|
1653
1682
|
var FieldReference = import_v43.default.object({
|
|
1654
|
-
$$field: FieldId,
|
|
1683
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1655
1684
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1656
1685
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1686
|
+
),
|
|
1687
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1688
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1657
1689
|
)
|
|
1658
|
-
}).describe(
|
|
1690
|
+
}).describe(
|
|
1691
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1692
|
+
);
|
|
1693
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1694
|
+
$$code: import_v43.default.string().describe(
|
|
1695
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1696
|
+
)
|
|
1697
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1659
1698
|
var ValidationConfig = import_v43.default.object({
|
|
1660
|
-
validator: Conditional
|
|
1661
|
-
|
|
1699
|
+
validator: Conditional.describe(
|
|
1700
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1701
|
+
),
|
|
1702
|
+
message: TranslationConfig.describe(
|
|
1703
|
+
"Error message displayed when the validator does not hold."
|
|
1704
|
+
)
|
|
1705
|
+
}).meta({
|
|
1706
|
+
id: "ValidationConfig",
|
|
1707
|
+
description: "Validation rule applied to a form field. The validator is a conditional expression that must hold for the field value to be considered valid."
|
|
1662
1708
|
});
|
|
1663
1709
|
var requiredSchema = import_v43.default.union([
|
|
1664
1710
|
import_v43.default.boolean(),
|
|
@@ -1689,7 +1735,7 @@ var BaseField = import_v43.default.object({
|
|
|
1689
1735
|
"Indicates whether the field can be modified during record correction."
|
|
1690
1736
|
),
|
|
1691
1737
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1692
|
-
"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."
|
|
1738
|
+
"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. A FieldReference with $$code computes the value via a custom client-side function."
|
|
1693
1739
|
),
|
|
1694
1740
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1695
1741
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1697,30 +1743,40 @@ var BaseField = import_v43.default.object({
|
|
|
1697
1743
|
}).describe("Common properties shared across all field types.");
|
|
1698
1744
|
var Divider = BaseField.extend({
|
|
1699
1745
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1746
|
+
}).meta({
|
|
1747
|
+
description: "A horizontal line divider",
|
|
1748
|
+
id: "Divider"
|
|
1700
1749
|
});
|
|
1701
1750
|
var TextField = BaseField.extend({
|
|
1702
1751
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1703
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1752
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1704
1753
|
configuration: import_v43.default.object({
|
|
1705
1754
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1706
1755
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
1707
1756
|
prefix: TranslationConfig.optional(),
|
|
1708
1757
|
postfix: TranslationConfig.optional()
|
|
1709
1758
|
}).default({ type: "text" }).optional()
|
|
1710
|
-
}).
|
|
1759
|
+
}).meta({
|
|
1760
|
+
description: "A text input field",
|
|
1761
|
+
id: "TextField"
|
|
1762
|
+
});
|
|
1711
1763
|
var NumberField = BaseField.extend({
|
|
1712
1764
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1713
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1765
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1714
1766
|
configuration: import_v43.default.object({
|
|
1715
1767
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1716
1768
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1769
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1717
1770
|
prefix: TranslationConfig.optional(),
|
|
1718
1771
|
postfix: TranslationConfig.optional()
|
|
1719
1772
|
}).optional()
|
|
1720
|
-
}).
|
|
1773
|
+
}).meta({
|
|
1774
|
+
description: "A number input field",
|
|
1775
|
+
id: "NumberField"
|
|
1776
|
+
});
|
|
1721
1777
|
var TextAreaField = BaseField.extend({
|
|
1722
1778
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1723
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1779
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1724
1780
|
configuration: import_v43.default.object({
|
|
1725
1781
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1726
1782
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1728,7 +1784,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1728
1784
|
prefix: TranslationConfig.optional(),
|
|
1729
1785
|
postfix: TranslationConfig.optional()
|
|
1730
1786
|
}).default({ rows: 4 }).optional()
|
|
1731
|
-
}).
|
|
1787
|
+
}).meta({
|
|
1788
|
+
description: "A multiline text input",
|
|
1789
|
+
id: "TextAreaField"
|
|
1790
|
+
});
|
|
1732
1791
|
var ImageMimeType = import_v43.default.enum([
|
|
1733
1792
|
"image/png",
|
|
1734
1793
|
"image/jpg",
|
|
@@ -1751,58 +1810,76 @@ var SignatureField = BaseField.extend({
|
|
|
1751
1810
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1752
1811
|
"Title of the signature modal"
|
|
1753
1812
|
),
|
|
1754
|
-
defaultValue:
|
|
1813
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1755
1814
|
configuration: import_v43.default.object({
|
|
1756
1815
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1757
1816
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1758
1817
|
}).default({
|
|
1759
1818
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1760
1819
|
})
|
|
1761
|
-
}).
|
|
1820
|
+
}).meta({
|
|
1821
|
+
description: "A signature input field",
|
|
1822
|
+
id: "SignatureField"
|
|
1823
|
+
});
|
|
1762
1824
|
var EmailField = BaseField.extend({
|
|
1763
1825
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1764
1826
|
configuration: import_v43.default.object({
|
|
1765
1827
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1766
1828
|
}).default({ maxLength: 255 }).optional(),
|
|
1767
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1829
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1830
|
+
}).meta({
|
|
1831
|
+
description: "An email input field",
|
|
1832
|
+
id: "EmailField"
|
|
1768
1833
|
});
|
|
1769
1834
|
var DateField = BaseField.extend({
|
|
1770
1835
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1771
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1836
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1772
1837
|
configuration: import_v43.default.object({
|
|
1773
1838
|
notice: TranslationConfig.describe(
|
|
1774
1839
|
"Text to display above the date input"
|
|
1775
1840
|
).optional()
|
|
1776
1841
|
}).optional()
|
|
1777
|
-
}).
|
|
1842
|
+
}).meta({
|
|
1843
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1844
|
+
id: "DateField"
|
|
1845
|
+
});
|
|
1778
1846
|
var AgeField = BaseField.extend({
|
|
1779
1847
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1780
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1848
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1781
1849
|
configuration: import_v43.default.object({
|
|
1782
1850
|
asOfDate: FieldReference,
|
|
1783
1851
|
prefix: TranslationConfig.optional(),
|
|
1784
1852
|
postfix: TranslationConfig.optional()
|
|
1785
1853
|
})
|
|
1786
|
-
}).
|
|
1854
|
+
}).meta({
|
|
1855
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1856
|
+
id: "AgeField"
|
|
1857
|
+
});
|
|
1787
1858
|
var TimeField = BaseField.extend({
|
|
1788
1859
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1789
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1860
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1790
1861
|
configuration: import_v43.default.object({
|
|
1791
1862
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1792
1863
|
notice: TranslationConfig.describe(
|
|
1793
1864
|
"Text to display above the time input"
|
|
1794
1865
|
).optional()
|
|
1795
1866
|
}).optional()
|
|
1796
|
-
}).
|
|
1867
|
+
}).meta({
|
|
1868
|
+
description: "A single time input (HH-mm)",
|
|
1869
|
+
id: "TimeField"
|
|
1870
|
+
});
|
|
1797
1871
|
var DateRangeField = BaseField.extend({
|
|
1798
1872
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1799
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1873
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1800
1874
|
configuration: import_v43.default.object({
|
|
1801
1875
|
notice: TranslationConfig.describe(
|
|
1802
1876
|
"Text to display above the date input"
|
|
1803
1877
|
).optional()
|
|
1804
1878
|
}).optional()
|
|
1805
|
-
}).
|
|
1879
|
+
}).meta({
|
|
1880
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1881
|
+
id: "DateRangeField"
|
|
1882
|
+
});
|
|
1806
1883
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1807
1884
|
"reg12",
|
|
1808
1885
|
"reg14",
|
|
@@ -1846,21 +1923,33 @@ var ImageViewField = BaseField.extend({
|
|
|
1846
1923
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1847
1924
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1848
1925
|
configuration: ImageConfiguration
|
|
1849
|
-
}).
|
|
1926
|
+
}).meta({
|
|
1927
|
+
description: "A read-only image component for form pages",
|
|
1928
|
+
id: "ImageViewField"
|
|
1929
|
+
});
|
|
1850
1930
|
var Paragraph = BaseField.extend({
|
|
1851
1931
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1852
1932
|
configuration: ParagraphConfiguration
|
|
1853
|
-
}).
|
|
1933
|
+
}).meta({
|
|
1934
|
+
description: "A read-only HTML <p> paragraph",
|
|
1935
|
+
id: "Paragraph"
|
|
1936
|
+
});
|
|
1854
1937
|
var Heading = BaseField.extend({
|
|
1855
1938
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1856
1939
|
configuration: HeadingConfiguration
|
|
1857
|
-
}).
|
|
1940
|
+
}).meta({
|
|
1941
|
+
description: "A read-only heading component for form pages",
|
|
1942
|
+
id: "Heading"
|
|
1943
|
+
});
|
|
1858
1944
|
var PageHeader = BaseField.extend({
|
|
1859
1945
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1860
|
-
}).
|
|
1946
|
+
}).meta({
|
|
1947
|
+
description: "A read-only header component for form pages",
|
|
1948
|
+
id: "PageHeader"
|
|
1949
|
+
});
|
|
1861
1950
|
var File = BaseField.extend({
|
|
1862
1951
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1863
|
-
defaultValue: FileFieldValue.optional(),
|
|
1952
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1864
1953
|
configuration: import_v43.default.object({
|
|
1865
1954
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1866
1955
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1876,7 +1965,10 @@ var File = BaseField.extend({
|
|
|
1876
1965
|
}).default({
|
|
1877
1966
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1878
1967
|
})
|
|
1879
|
-
}).
|
|
1968
|
+
}).meta({
|
|
1969
|
+
description: "A file upload field",
|
|
1970
|
+
id: "File"
|
|
1971
|
+
});
|
|
1880
1972
|
var SelectOption = import_v43.default.object({
|
|
1881
1973
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1882
1974
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1884,7 +1976,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1884
1976
|
});
|
|
1885
1977
|
var NumberWithUnitField = BaseField.extend({
|
|
1886
1978
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1887
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1979
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1888
1980
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1889
1981
|
configuration: import_v43.default.object({
|
|
1890
1982
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1893,17 +1985,23 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1893
1985
|
"Placeholder for the number field"
|
|
1894
1986
|
)
|
|
1895
1987
|
}).optional()
|
|
1896
|
-
}).
|
|
1988
|
+
}).meta({
|
|
1989
|
+
description: "A number with unit input field",
|
|
1990
|
+
id: "NumberWithUnitField"
|
|
1991
|
+
});
|
|
1897
1992
|
var RadioGroup = BaseField.extend({
|
|
1898
1993
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1899
|
-
defaultValue: TextValue.optional(),
|
|
1994
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1900
1995
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1901
1996
|
configuration: import_v43.default.object({
|
|
1902
1997
|
styles: import_v43.default.object({
|
|
1903
1998
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1904
1999
|
}).optional()
|
|
1905
2000
|
}).optional()
|
|
1906
|
-
}).
|
|
2001
|
+
}).meta({
|
|
2002
|
+
description: "A grouped radio button field",
|
|
2003
|
+
id: "RadioGroup"
|
|
2004
|
+
});
|
|
1907
2005
|
var BulletList = BaseField.extend({
|
|
1908
2006
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1909
2007
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1912,10 +2010,13 @@ var BulletList = BaseField.extend({
|
|
|
1912
2010
|
fontVariant: HtmlFontVariant.optional()
|
|
1913
2011
|
}).optional()
|
|
1914
2012
|
}).default({})
|
|
1915
|
-
}).
|
|
2013
|
+
}).meta({
|
|
2014
|
+
description: "A list of bullet points",
|
|
2015
|
+
id: "BulletList"
|
|
2016
|
+
});
|
|
1916
2017
|
var Select = BaseField.extend({
|
|
1917
2018
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1918
|
-
defaultValue: TextValue.optional(),
|
|
2019
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1919
2020
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1920
2021
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1921
2022
|
`
|
|
@@ -1927,16 +2028,22 @@ var Select = BaseField.extend({
|
|
|
1927
2028
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1928
2029
|
`
|
|
1929
2030
|
)
|
|
1930
|
-
}).
|
|
2031
|
+
}).meta({
|
|
2032
|
+
description: "A select input field",
|
|
2033
|
+
id: "Select"
|
|
2034
|
+
});
|
|
1931
2035
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1932
2036
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1933
2037
|
label: TranslationConfig.describe("The label of the option")
|
|
1934
2038
|
});
|
|
1935
2039
|
var SelectDateRangeField = BaseField.extend({
|
|
1936
2040
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1937
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
2041
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1938
2042
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1939
|
-
}).
|
|
2043
|
+
}).meta({
|
|
2044
|
+
description: "A date range selection field",
|
|
2045
|
+
id: "SelectDateRangeField"
|
|
2046
|
+
});
|
|
1940
2047
|
var NameConfig = import_v43.default.object({
|
|
1941
2048
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1942
2049
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1948,7 +2055,7 @@ var NameField = BaseField.extend({
|
|
|
1948
2055
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1949
2056
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1950
2057
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1951
|
-
}).optional(),
|
|
2058
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1952
2059
|
configuration: import_v43.default.object({
|
|
1953
2060
|
name: NameConfig.default({
|
|
1954
2061
|
firstname: { required: true },
|
|
@@ -1967,26 +2074,41 @@ var NameField = BaseField.extend({
|
|
|
1967
2074
|
surname: { required: true }
|
|
1968
2075
|
}
|
|
1969
2076
|
}).optional()
|
|
1970
|
-
}).
|
|
2077
|
+
}).meta({
|
|
2078
|
+
description: "A field for entering a persons name",
|
|
2079
|
+
id: "NameField"
|
|
2080
|
+
});
|
|
1971
2081
|
var PhoneField = BaseField.extend({
|
|
1972
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2082
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1973
2083
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1974
|
-
}).
|
|
2084
|
+
}).meta({
|
|
2085
|
+
description: "A field for entering a phone number",
|
|
2086
|
+
id: "PhoneField"
|
|
2087
|
+
});
|
|
1975
2088
|
var IdField = BaseField.extend({
|
|
1976
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2089
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1977
2090
|
type: import_v43.default.literal(FieldType.ID)
|
|
1978
|
-
}).
|
|
2091
|
+
}).meta({
|
|
2092
|
+
description: "A field for entering an ID",
|
|
2093
|
+
id: "IdField"
|
|
2094
|
+
});
|
|
1979
2095
|
var Checkbox = BaseField.extend({
|
|
1980
2096
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1981
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1982
|
-
}).
|
|
2097
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
2098
|
+
}).meta({
|
|
2099
|
+
description: "A boolean checkbox field",
|
|
2100
|
+
id: "Checkbox"
|
|
2101
|
+
});
|
|
1983
2102
|
var Country = BaseField.extend({
|
|
1984
2103
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1985
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2104
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1986
2105
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1987
2106
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1988
2107
|
)
|
|
1989
|
-
}).
|
|
2108
|
+
}).meta({
|
|
2109
|
+
description: "A field for selecting a country",
|
|
2110
|
+
id: "Country"
|
|
2111
|
+
});
|
|
1990
2112
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
1991
2113
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
1992
2114
|
);
|
|
@@ -1995,28 +2117,33 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1995
2117
|
"HEALTH_FACILITY",
|
|
1996
2118
|
"CRVS_OFFICE"
|
|
1997
2119
|
]);
|
|
1998
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
1999
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
2000
|
-
type: AdministrativeAreas,
|
|
2001
|
-
allowedLocations: AllowedLocations
|
|
2002
|
-
}).describe("Administrative area options");
|
|
2003
2120
|
var AdministrativeAreaField = BaseField.extend({
|
|
2004
2121
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2005
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2006
|
-
configuration:
|
|
2007
|
-
|
|
2122
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2123
|
+
configuration: import_v43.default.object({
|
|
2124
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
2125
|
+
type: AdministrativeAreas,
|
|
2126
|
+
allowedLocations: AllowedLocations
|
|
2127
|
+
}).describe("Administrative area options")
|
|
2128
|
+
}).meta({
|
|
2129
|
+
description: "Administrative area input field",
|
|
2130
|
+
id: "AdministrativeAreaField"
|
|
2131
|
+
});
|
|
2008
2132
|
var LocationInput = BaseField.extend({
|
|
2009
2133
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2010
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2134
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2011
2135
|
configuration: import_v43.default.object({
|
|
2012
2136
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2013
2137
|
allowedLocations: AllowedLocations
|
|
2014
2138
|
}).optional()
|
|
2015
|
-
}).
|
|
2139
|
+
}).meta({
|
|
2140
|
+
description: "A field for selecting a location",
|
|
2141
|
+
id: "LocationInput"
|
|
2142
|
+
});
|
|
2016
2143
|
var FileUploadWithOptions = BaseField.extend({
|
|
2017
2144
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2018
2145
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
2019
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
2146
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
2020
2147
|
configuration: import_v43.default.object({
|
|
2021
2148
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2022
2149
|
maxImageSize: import_v43.default.object({
|
|
@@ -2026,15 +2153,18 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2026
2153
|
}).default({
|
|
2027
2154
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2028
2155
|
})
|
|
2156
|
+
}).meta({
|
|
2157
|
+
description: "A field for uploading files with file type options",
|
|
2158
|
+
id: "FileUploadWithOptions"
|
|
2029
2159
|
});
|
|
2030
2160
|
var Facility = BaseField.extend({
|
|
2031
2161
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
2032
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2162
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2033
2163
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2034
2164
|
}).describe("Input field for a facility");
|
|
2035
2165
|
var Office = BaseField.extend({
|
|
2036
2166
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
2037
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2167
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2038
2168
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2039
2169
|
}).describe("Input field for an office");
|
|
2040
2170
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -2070,8 +2200,11 @@ var Address = BaseField.extend({
|
|
|
2070
2200
|
).optional(),
|
|
2071
2201
|
allowedLocations: AllowedLocations
|
|
2072
2202
|
}).optional(),
|
|
2073
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
2074
|
-
}).
|
|
2203
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
2204
|
+
}).meta({
|
|
2205
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2206
|
+
id: "Address"
|
|
2207
|
+
});
|
|
2075
2208
|
var StaticDataEntry = import_v43.default.object({
|
|
2076
2209
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2077
2210
|
label: TranslationConfig,
|
|
@@ -2086,7 +2219,10 @@ var DataField = BaseField.extend({
|
|
|
2086
2219
|
subtitle: TranslationConfig.optional(),
|
|
2087
2220
|
data: import_v43.default.array(DataEntry)
|
|
2088
2221
|
})
|
|
2089
|
-
}).
|
|
2222
|
+
}).meta({
|
|
2223
|
+
description: "A field for displaying a table of read-only data",
|
|
2224
|
+
id: "DataField"
|
|
2225
|
+
});
|
|
2090
2226
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2091
2227
|
var ButtonType = import_v43.default.enum([
|
|
2092
2228
|
"primary",
|
|
@@ -2111,13 +2247,19 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
2111
2247
|
});
|
|
2112
2248
|
var ButtonField = BaseField.extend({
|
|
2113
2249
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2114
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
2250
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
2115
2251
|
configuration: ButtonConfiguration
|
|
2116
|
-
}).
|
|
2252
|
+
}).meta({
|
|
2253
|
+
description: "A generic button that can be used to trigger an action",
|
|
2254
|
+
id: "ButtonField"
|
|
2255
|
+
});
|
|
2117
2256
|
var FieldGroup = BaseField.extend({
|
|
2118
2257
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2119
2258
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2120
2259
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2260
|
+
}).meta({
|
|
2261
|
+
description: "A group of fields that are displayed together",
|
|
2262
|
+
id: "FieldGroup"
|
|
2121
2263
|
});
|
|
2122
2264
|
var AlphaPrintButton = BaseField.extend({
|
|
2123
2265
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2127,10 +2269,13 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2127
2269
|
"Label for the print button"
|
|
2128
2270
|
)
|
|
2129
2271
|
})
|
|
2130
|
-
}).
|
|
2272
|
+
}).meta({
|
|
2273
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2274
|
+
id: "AlphaPrintButton"
|
|
2275
|
+
});
|
|
2131
2276
|
var HttpField = BaseField.extend({
|
|
2132
2277
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2133
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2278
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
2134
2279
|
configuration: import_v43.default.object({
|
|
2135
2280
|
trigger: FieldReference.optional().describe(
|
|
2136
2281
|
"Reference to the field that triggers the HTTP request when its value changes. If not provided, the HTTP request is triggered once on component mount."
|
|
@@ -2143,20 +2288,30 @@ var HttpField = BaseField.extend({
|
|
|
2143
2288
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2144
2289
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2145
2290
|
})
|
|
2146
|
-
}).
|
|
2291
|
+
}).meta({
|
|
2292
|
+
description: "Makes a background HTTP request to an external service and stores the response so other fields can use it. Has no visible UI \u2014 pair with LOADER to show request status.",
|
|
2293
|
+
id: "HttpField"
|
|
2294
|
+
});
|
|
2147
2295
|
var AutocompleteField = BaseField.extend({
|
|
2148
2296
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2149
2297
|
configuration: import_v43.default.object({
|
|
2150
|
-
url: import_v43.default.string().describe(
|
|
2298
|
+
url: import_v43.default.string().describe(
|
|
2299
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2300
|
+
).optional(),
|
|
2151
2301
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2152
2302
|
defaultOptions: import_v43.default.array(
|
|
2153
2303
|
import_v43.default.object({
|
|
2154
2304
|
label: import_v43.default.string(),
|
|
2155
2305
|
value: import_v43.default.string()
|
|
2156
2306
|
})
|
|
2157
|
-
).optional()
|
|
2307
|
+
).optional().describe(
|
|
2308
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2309
|
+
)
|
|
2158
2310
|
})
|
|
2159
|
-
}).
|
|
2311
|
+
}).meta({
|
|
2312
|
+
description: "Generic autocomplete component designed for use with large dictionary-based datasets. The component supports dynamic retrieval of options from configurable data sources and is intended for datasets that may contain tens or hundreds of thousands of records.",
|
|
2313
|
+
id: "AutocompleteField"
|
|
2314
|
+
});
|
|
2160
2315
|
var SearchField = HttpField.extend({
|
|
2161
2316
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2162
2317
|
configuration: SearchQuery.pick({
|
|
@@ -2189,6 +2344,9 @@ var SearchField = HttpField.extend({
|
|
|
2189
2344
|
ok: TranslationConfig.optional()
|
|
2190
2345
|
}).optional()
|
|
2191
2346
|
})
|
|
2347
|
+
}).meta({
|
|
2348
|
+
description: "A search input field",
|
|
2349
|
+
id: "SearchField"
|
|
2192
2350
|
});
|
|
2193
2351
|
var LinkButtonField = BaseField.extend({
|
|
2194
2352
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2197,28 +2355,35 @@ var LinkButtonField = BaseField.extend({
|
|
|
2197
2355
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2198
2356
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2199
2357
|
})
|
|
2200
|
-
}).
|
|
2358
|
+
}).meta({
|
|
2359
|
+
description: "A button that opens a URL link",
|
|
2360
|
+
id: "LinkButtonField"
|
|
2361
|
+
});
|
|
2201
2362
|
var VerificationStatus = BaseField.extend({
|
|
2202
2363
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2203
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2364
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2204
2365
|
configuration: import_v43.default.object({
|
|
2205
2366
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2206
2367
|
description: TranslationConfig.describe(
|
|
2207
2368
|
"Explaining text on the banner in form."
|
|
2208
2369
|
)
|
|
2209
2370
|
})
|
|
2371
|
+
}).meta({
|
|
2372
|
+
description: "Displays a verification state (e.g. ID verified / pending). Often paired with ID_READER \u2014 it can read its value off an ID_READER rather than holding its own.",
|
|
2373
|
+
id: "VerificationStatus"
|
|
2210
2374
|
});
|
|
2211
2375
|
var QueryParamReaderField = BaseField.extend({
|
|
2212
2376
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2213
2377
|
configuration: import_v43.default.object({
|
|
2214
2378
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2215
2379
|
})
|
|
2216
|
-
}).
|
|
2217
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2218
|
-
|
|
2380
|
+
}).meta({
|
|
2381
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2382
|
+
id: "QueryParamReaderField"
|
|
2383
|
+
});
|
|
2219
2384
|
var QrReaderField = BaseField.extend({
|
|
2220
2385
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2221
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2386
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2222
2387
|
configuration: import_v43.default.object({
|
|
2223
2388
|
validator: import_v43.default.any().meta({
|
|
2224
2389
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2226,21 +2391,27 @@ var QrReaderField = BaseField.extend({
|
|
|
2226
2391
|
})
|
|
2227
2392
|
}).optional()
|
|
2228
2393
|
}).meta({
|
|
2229
|
-
description: "
|
|
2394
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2230
2395
|
id: "QrReaderField"
|
|
2231
2396
|
});
|
|
2232
2397
|
var IdReaderField = BaseField.extend({
|
|
2233
2398
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2234
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2399
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2235
2400
|
methods: import_v43.default.array(
|
|
2236
2401
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2237
2402
|
)
|
|
2403
|
+
}).meta({
|
|
2404
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2405
|
+
id: "IdReaderField"
|
|
2238
2406
|
});
|
|
2239
2407
|
var CustomField = BaseField.extend({
|
|
2240
2408
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2241
2409
|
defaultValue: CustomFieldValue.optional(),
|
|
2242
2410
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2243
2411
|
configuration: import_v43.default.unknown().optional()
|
|
2412
|
+
}).meta({
|
|
2413
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2414
|
+
id: "CustomField"
|
|
2244
2415
|
});
|
|
2245
2416
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2246
2417
|
var LoaderField = BaseField.extend({
|
|
@@ -2250,22 +2421,25 @@ var LoaderField = BaseField.extend({
|
|
|
2250
2421
|
configuration: import_v43.default.object({
|
|
2251
2422
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2252
2423
|
})
|
|
2253
|
-
}).
|
|
2254
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2255
|
-
|
|
2424
|
+
}).meta({
|
|
2425
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2426
|
+
id: "LoaderField"
|
|
2427
|
+
});
|
|
2256
2428
|
var HiddenField = BaseField.extend({
|
|
2257
2429
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2258
2430
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2259
2431
|
defaultValue: TextValue.optional()
|
|
2260
|
-
}).
|
|
2261
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2262
|
-
|
|
2432
|
+
}).meta({
|
|
2433
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2434
|
+
id: "HiddenField"
|
|
2435
|
+
});
|
|
2263
2436
|
var UserRoleField = BaseField.extend({
|
|
2264
2437
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2265
2438
|
defaultValue: TextValue.optional()
|
|
2266
|
-
}).
|
|
2267
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2268
|
-
|
|
2439
|
+
}).meta({
|
|
2440
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2441
|
+
id: "UserRoleField"
|
|
2442
|
+
});
|
|
2269
2443
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2270
2444
|
FieldGroup,
|
|
2271
2445
|
Address,
|
|
@@ -2364,16 +2538,19 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2364
2538
|
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2365
2539
|
actions: VerificationActionConfig
|
|
2366
2540
|
});
|
|
2367
|
-
var PageConfig = z21.discriminatedUnion("type", [
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2541
|
+
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2542
|
+
id: "PageConfig",
|
|
2543
|
+
description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
|
|
2544
|
+
});
|
|
2371
2545
|
|
|
2372
2546
|
// ../commons/src/events/FormConfig.ts
|
|
2373
2547
|
var DeclarationFormConfig = z22.object({
|
|
2374
2548
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2375
2549
|
pages: z22.array(FormPageConfig)
|
|
2376
|
-
}).
|
|
2550
|
+
}).meta({
|
|
2551
|
+
id: "DeclarationFormConfig",
|
|
2552
|
+
description: "Configuration of the declaration form."
|
|
2553
|
+
});
|
|
2377
2554
|
var ActionFormConfig = z22.object({
|
|
2378
2555
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2379
2556
|
pages: z22.array(PageConfig)
|
|
@@ -2473,6 +2650,9 @@ var DeduplicationConfig = z23.object({
|
|
|
2473
2650
|
id: z23.string(),
|
|
2474
2651
|
label: TranslationConfig,
|
|
2475
2652
|
query: Clause
|
|
2653
|
+
}).meta({
|
|
2654
|
+
id: "DeduplicationConfig",
|
|
2655
|
+
description: "Configuration for duplicate detection on a declare or register action. The query is built from fuzzy / strict / date-range matchers combined with and/or/not."
|
|
2476
2656
|
});
|
|
2477
2657
|
|
|
2478
2658
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -2510,6 +2690,11 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
2510
2690
|
conditionals: z24.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2511
2691
|
}).shape
|
|
2512
2692
|
);
|
|
2693
|
+
var NotifyConfig = ActionConfigBase.extend(
|
|
2694
|
+
z24.object({
|
|
2695
|
+
type: z24.literal(ActionType.NOTIFY)
|
|
2696
|
+
}).shape
|
|
2697
|
+
);
|
|
2513
2698
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
2514
2699
|
z24.object({
|
|
2515
2700
|
type: z24.literal(ActionType.DECLARE),
|
|
@@ -2590,17 +2775,46 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2590
2775
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2591
2776
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2592
2777
|
*/
|
|
2593
|
-
ReadActionConfig.meta({
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2778
|
+
ReadActionConfig.meta({
|
|
2779
|
+
id: "ReadActionConfig",
|
|
2780
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2781
|
+
}),
|
|
2782
|
+
NotifyConfig.meta({
|
|
2783
|
+
id: "NotifyActionConfig",
|
|
2784
|
+
description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
|
|
2785
|
+
}),
|
|
2786
|
+
DeclareConfig.meta({
|
|
2787
|
+
id: "DeclareActionConfig",
|
|
2788
|
+
description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
|
|
2789
|
+
}),
|
|
2790
|
+
RejectConfig.meta({
|
|
2791
|
+
id: "RejectActionConfig",
|
|
2792
|
+
description: "Configuration for rejecting a record before registration."
|
|
2793
|
+
}),
|
|
2794
|
+
RegisterConfig.meta({
|
|
2795
|
+
id: "RegisterActionConfig",
|
|
2796
|
+
description: "Configuration for registering a record."
|
|
2797
|
+
}),
|
|
2597
2798
|
PrintCertificateActionConfig.meta({
|
|
2598
|
-
id: "PrintCertificateActionConfig"
|
|
2799
|
+
id: "PrintCertificateActionConfig",
|
|
2800
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
2801
|
+
}),
|
|
2802
|
+
RequestCorrectionConfig.meta({
|
|
2803
|
+
id: "RequestCorrectionActionConfig",
|
|
2804
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
2805
|
+
}),
|
|
2806
|
+
EditActionConfig.meta({
|
|
2807
|
+
id: "EditActionConfig",
|
|
2808
|
+
description: "Configuration for editing a record before registration."
|
|
2599
2809
|
}),
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2810
|
+
ArchiveConfig.meta({
|
|
2811
|
+
id: "ArchiveActionConfig",
|
|
2812
|
+
description: "Configuration for archiving a record."
|
|
2813
|
+
}),
|
|
2814
|
+
CustomActionConfig.meta({
|
|
2815
|
+
id: "CustomActionConfig",
|
|
2816
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
2817
|
+
})
|
|
2604
2818
|
]).describe(
|
|
2605
2819
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2606
2820
|
).meta({ id: "ActionConfig" });
|
|
@@ -2676,7 +2890,10 @@ var Field = BaseField2.extend({
|
|
|
2676
2890
|
}).describe("Custom field defined for the summary view.");
|
|
2677
2891
|
var SummaryConfig = z27.object({
|
|
2678
2892
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2679
|
-
}).
|
|
2893
|
+
}).meta({
|
|
2894
|
+
id: "SummaryConfig",
|
|
2895
|
+
description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
|
|
2896
|
+
});
|
|
2680
2897
|
|
|
2681
2898
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2682
2899
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -2747,6 +2964,9 @@ var BaseField3 = z28.object({
|
|
|
2747
2964
|
),
|
|
2748
2965
|
validations: z28.array(ValidationConfig).optional().describe(
|
|
2749
2966
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2967
|
+
),
|
|
2968
|
+
allowedLocations: JurisdictionReference.optional().describe(
|
|
2969
|
+
`Override the allowedLocations for a location field in advanced search. Use this when the declaration form's allowedLocations references a scope (e.g. record.create) that search-only users don't have \u2014 specify record.search scope instead.`
|
|
2750
2970
|
)
|
|
2751
2971
|
});
|
|
2752
2972
|
var SearchQueryParams = z28.object({
|
|
@@ -2800,6 +3020,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
2800
3020
|
var AdvancedSearchConfig = z28.object({
|
|
2801
3021
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2802
3022
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3023
|
+
}).meta({
|
|
3024
|
+
id: "AdvancedSearchConfig",
|
|
3025
|
+
description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
|
|
2803
3026
|
});
|
|
2804
3027
|
|
|
2805
3028
|
// ../commons/src/events/utils.ts
|
|
@@ -2850,7 +3073,37 @@ function resolveDataPath(rootData, dataPath, instancePath) {
|
|
|
2850
3073
|
}
|
|
2851
3074
|
return current;
|
|
2852
3075
|
}
|
|
3076
|
+
function todayISO() {
|
|
3077
|
+
return (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" });
|
|
3078
|
+
}
|
|
3079
|
+
var compiledFunctionCache = /* @__PURE__ */ new Map();
|
|
3080
|
+
function compileClientFunction(code) {
|
|
3081
|
+
let fn = compiledFunctionCache.get(code);
|
|
3082
|
+
if (!fn) {
|
|
3083
|
+
fn = new Function(`return (${code})`)();
|
|
3084
|
+
compiledFunctionCache.set(code, fn);
|
|
3085
|
+
}
|
|
3086
|
+
return fn;
|
|
3087
|
+
}
|
|
2853
3088
|
(0, import_ajv_formats.default)(ajv);
|
|
3089
|
+
function buildClientFunctionContext(input) {
|
|
3090
|
+
return {
|
|
3091
|
+
$form: input.form,
|
|
3092
|
+
$now: todayISO(),
|
|
3093
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3094
|
+
$online: isOnline(),
|
|
3095
|
+
$user: input.validatorContext?.user,
|
|
3096
|
+
$event: input.validatorContext?.event,
|
|
3097
|
+
$leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
|
|
3098
|
+
user: input.systemVariables?.user,
|
|
3099
|
+
$window: input.systemVariables?.$window,
|
|
3100
|
+
locations: input.locations,
|
|
3101
|
+
adminLevelIds: input.adminLevelIds
|
|
3102
|
+
};
|
|
3103
|
+
}
|
|
3104
|
+
function runClientFunction(code, data, context) {
|
|
3105
|
+
return compileClientFunction(code)(data, context);
|
|
3106
|
+
}
|
|
2854
3107
|
ajv.addKeyword({
|
|
2855
3108
|
keyword: "daysFromDate",
|
|
2856
3109
|
type: "string",
|
|
@@ -2895,12 +3148,35 @@ ajv.addKeyword({
|
|
|
2895
3148
|
$data: true,
|
|
2896
3149
|
errors: true,
|
|
2897
3150
|
// @ts-ignore -- Force type. We will move this away from AJV next. Parsing the array will take seconds and is only called by core.
|
|
2898
|
-
validate(
|
|
3151
|
+
validate(_schema, data, _2, dataContext) {
|
|
2899
3152
|
const locationIdInput = data;
|
|
2900
3153
|
const locations = dataContext?.rootData.$leafAdminStructureLocationIds ?? [];
|
|
2901
3154
|
return locations.some((location) => location.id === locationIdInput);
|
|
2902
3155
|
}
|
|
2903
3156
|
});
|
|
3157
|
+
ajv.addKeyword({
|
|
3158
|
+
keyword: "customClientValidator",
|
|
3159
|
+
schemaType: "object",
|
|
3160
|
+
errors: true,
|
|
3161
|
+
// @ts-expect-error -- AJV's public types don't expose `rootData`. All
|
|
3162
|
+
// `validate()` callers build root data via `buildClientFunctionContext`,
|
|
3163
|
+
// so the cast holds.
|
|
3164
|
+
validate(schema, data, _2, dataContext) {
|
|
3165
|
+
return Boolean(
|
|
3166
|
+
runClientFunction(
|
|
3167
|
+
schema.code,
|
|
3168
|
+
data,
|
|
3169
|
+
dataContext?.rootData ?? buildClientFunctionContext({ form: {} })
|
|
3170
|
+
)
|
|
3171
|
+
);
|
|
3172
|
+
}
|
|
3173
|
+
});
|
|
3174
|
+
function isOnline() {
|
|
3175
|
+
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
|
3176
|
+
return navigator.onLine;
|
|
3177
|
+
}
|
|
3178
|
+
return true;
|
|
3179
|
+
}
|
|
2904
3180
|
|
|
2905
3181
|
// ../commons/src/utils.ts
|
|
2906
3182
|
var z32 = __toESM(require("zod/v4"));
|
|
@@ -2943,7 +3219,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2943
3219
|
if (actionConfig.type === ActionType.CUSTOM) {
|
|
2944
3220
|
return actionConfig.form;
|
|
2945
3221
|
}
|
|
2946
|
-
if ("review" in actionConfig) {
|
|
3222
|
+
if ("review" in actionConfig && actionConfig.review != null) {
|
|
2947
3223
|
return actionConfig.review.fields;
|
|
2948
3224
|
}
|
|
2949
3225
|
return [];
|
|
@@ -3519,7 +3795,54 @@ function createFieldConditionals(fieldId) {
|
|
|
3519
3795
|
}
|
|
3520
3796
|
},
|
|
3521
3797
|
required: [fieldId]
|
|
3522
|
-
})
|
|
3798
|
+
}),
|
|
3799
|
+
/**
|
|
3800
|
+
* Custom client-side validator. The provided function is serialised and executed
|
|
3801
|
+
* just-in-time on the client only. External references (e.g. lodash) are not
|
|
3802
|
+
* available inside the function body — all logic must be self-contained.
|
|
3803
|
+
*
|
|
3804
|
+
* @example
|
|
3805
|
+
* field('nid').customClientValidator((value) => {
|
|
3806
|
+
* // LUHN check — all logic must be inline
|
|
3807
|
+
* const digits = String(value).split('').map(Number)
|
|
3808
|
+
* // ...
|
|
3809
|
+
* return isValid
|
|
3810
|
+
* })
|
|
3811
|
+
*/
|
|
3812
|
+
customClientValidator(validationFn) {
|
|
3813
|
+
const code = validationFn.toString();
|
|
3814
|
+
return defineFormConditional({
|
|
3815
|
+
type: "object",
|
|
3816
|
+
properties: wrapToPath(
|
|
3817
|
+
{ [fieldId]: { customClientValidator: { code } } },
|
|
3818
|
+
this.$$subfield
|
|
3819
|
+
),
|
|
3820
|
+
required: [fieldId]
|
|
3821
|
+
});
|
|
3822
|
+
},
|
|
3823
|
+
/**
|
|
3824
|
+
* Custom client-side evaluation. Returns a {@link FieldReference} descriptor
|
|
3825
|
+
* that can be used as the `value` property or a DATA component entry.
|
|
3826
|
+
* The function receives the referenced field's value as the first argument and
|
|
3827
|
+
* the full form context as the second; its return value replaces the field reference.
|
|
3828
|
+
* The function is serialised and executed just-in-time on the client only.
|
|
3829
|
+
* External references (e.g. lodash) are not available inside the function body.
|
|
3830
|
+
*
|
|
3831
|
+
* For computing a default value without referencing a specific field, use
|
|
3832
|
+
* `evaluate(fn)` in the `defaultValue` property instead.
|
|
3833
|
+
*
|
|
3834
|
+
* @example
|
|
3835
|
+
* field('a').customClientEvaluation((aValue, ctx) =>
|
|
3836
|
+
* Number(aValue) + Number(ctx.$form.b)
|
|
3837
|
+
* )
|
|
3838
|
+
*/
|
|
3839
|
+
customClientEvaluation(computationFn) {
|
|
3840
|
+
return {
|
|
3841
|
+
$$code: computationFn.toString(),
|
|
3842
|
+
$$field: fieldId,
|
|
3843
|
+
$$subfield: this.$$subfield
|
|
3844
|
+
};
|
|
3845
|
+
}
|
|
3523
3846
|
};
|
|
3524
3847
|
}
|
|
3525
3848
|
|
|
@@ -3667,7 +3990,7 @@ var _EventConfigBase = z33.object({
|
|
|
3667
3990
|
),
|
|
3668
3991
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
3669
3992
|
actions: z33.array(ActionConfig).describe(
|
|
3670
|
-
"Configuration of
|
|
3993
|
+
"Configuration of core and custom actions associated with the event."
|
|
3671
3994
|
),
|
|
3672
3995
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
3673
3996
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -3679,7 +4002,7 @@ var _EventConfigBase = z33.object({
|
|
|
3679
4002
|
"Configuration of fields available in the advanced search feature."
|
|
3680
4003
|
),
|
|
3681
4004
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
3682
|
-
"Configuration of flags associated with the actions of this event type."
|
|
4005
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
3683
4006
|
),
|
|
3684
4007
|
analytics: z33.boolean().optional().default(true).describe(
|
|
3685
4008
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -3692,8 +4015,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
3692
4015
|
validateActionFlags(event2, ctx);
|
|
3693
4016
|
validateActionOrder(event2, ctx);
|
|
3694
4017
|
}).meta({
|
|
3695
|
-
id: "EventConfig"
|
|
3696
|
-
|
|
4018
|
+
id: "EventConfig",
|
|
4019
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
4020
|
+
});
|
|
3697
4021
|
|
|
3698
4022
|
// ../commons/src/events/EventConfigInput.ts
|
|
3699
4023
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -3915,6 +4239,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
3915
4239
|
var WorkqueueColumn = z34.object({
|
|
3916
4240
|
label: TranslationConfig,
|
|
3917
4241
|
value: WorkqueueColumnValue
|
|
4242
|
+
}).meta({
|
|
4243
|
+
id: "WorkqueueColumn",
|
|
4244
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
3918
4245
|
});
|
|
3919
4246
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3920
4247
|
return workqueueColumns.map(
|
|
@@ -4117,18 +4444,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4117
4444
|
query: true,
|
|
4118
4445
|
columns: true
|
|
4119
4446
|
});
|
|
4120
|
-
var WorkqueueConfigInput =
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
query: CountryConfigQueryInputType,
|
|
4126
|
-
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
4127
|
-
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
4128
|
-
),
|
|
4129
|
-
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4130
|
-
icon: AvailableIcons,
|
|
4131
|
-
emptyMessage: TranslationConfig.optional()
|
|
4447
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4448
|
+
query: CountryConfigQueryInputType
|
|
4449
|
+
}).meta({
|
|
4450
|
+
id: "WorkqueueConfig",
|
|
4451
|
+
description: "Configuration for a single workqueue. Defines the filter applied to the event index, the quick-action button, the columns shown on each row, and the message rendered when the queue is empty."
|
|
4132
4452
|
});
|
|
4133
4453
|
var WorkqueueCountInput = z37.array(
|
|
4134
4454
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4170,7 +4490,9 @@ var BaseActionInput = z38.object({
|
|
|
4170
4490
|
keepAssignment: z38.boolean().optional(),
|
|
4171
4491
|
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
4172
4492
|
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
4173
|
-
waitFor: z38.boolean().
|
|
4493
|
+
waitFor: z38.boolean().default(true).describe(
|
|
4494
|
+
"Whether action waits for the indexing before returning. Defaults to true. Setting this to to false completes faster but might lead to stale data in the client if the client tries to read the event immediately after performing the action. Use with care."
|
|
4495
|
+
),
|
|
4174
4496
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4175
4497
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
4176
4498
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4288,7 +4610,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
|
4288
4610
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4289
4611
|
z38.object({
|
|
4290
4612
|
requestId: z38.string(),
|
|
4291
|
-
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4613
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
4614
|
+
content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
|
|
4292
4615
|
}).shape
|
|
4293
4616
|
);
|
|
4294
4617
|
var ReadActionInput = BaseActionInput.extend(
|
|
@@ -4350,7 +4673,7 @@ var Draft = z39.object({
|
|
|
4350
4673
|
}).describe(
|
|
4351
4674
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
4352
4675
|
);
|
|
4353
|
-
var DraftInput = BaseActionInput.extend({
|
|
4676
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
4354
4677
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4355
4678
|
status: z39.enum([
|
|
4356
4679
|
ActionStatus.Requested,
|
|
@@ -4400,12 +4723,53 @@ var updateActions = ActionTypes.extract([
|
|
|
4400
4723
|
ActionType.ARCHIVE,
|
|
4401
4724
|
ActionType.PRINT_CERTIFICATE,
|
|
4402
4725
|
ActionType.REQUEST_CORRECTION,
|
|
4726
|
+
ActionType.APPROVE_CORRECTION,
|
|
4727
|
+
ActionType.REJECT_CORRECTION,
|
|
4403
4728
|
ActionType.CUSTOM
|
|
4404
4729
|
]);
|
|
4405
4730
|
|
|
4406
4731
|
// ../commons/src/events/state/flags.ts
|
|
4407
4732
|
var import_lodash3 = require("lodash");
|
|
4408
4733
|
var import_date_fns3 = require("date-fns");
|
|
4734
|
+
var INHERENT_FLAG_RULES = [
|
|
4735
|
+
{
|
|
4736
|
+
flag: InherentFlags.CORRECTION_REQUESTED,
|
|
4737
|
+
setOn: [ActionType.REQUEST_CORRECTION],
|
|
4738
|
+
resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
|
|
4739
|
+
},
|
|
4740
|
+
{
|
|
4741
|
+
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
4742
|
+
// other status-changing action (see getStatusFromActions).
|
|
4743
|
+
flag: InherentFlags.INCOMPLETE,
|
|
4744
|
+
setOn: [ActionType.NOTIFY],
|
|
4745
|
+
resetOn: [
|
|
4746
|
+
ActionType.CREATE,
|
|
4747
|
+
ActionType.DECLARE,
|
|
4748
|
+
ActionType.REGISTER,
|
|
4749
|
+
ActionType.ARCHIVE
|
|
4750
|
+
]
|
|
4751
|
+
},
|
|
4752
|
+
{
|
|
4753
|
+
flag: InherentFlags.REJECTED,
|
|
4754
|
+
setOn: [ActionType.REJECT],
|
|
4755
|
+
resetOn: [
|
|
4756
|
+
ActionType.NOTIFY,
|
|
4757
|
+
ActionType.DECLARE,
|
|
4758
|
+
ActionType.EDIT,
|
|
4759
|
+
ActionType.REGISTER
|
|
4760
|
+
]
|
|
4761
|
+
},
|
|
4762
|
+
{
|
|
4763
|
+
flag: InherentFlags.POTENTIAL_DUPLICATE,
|
|
4764
|
+
setOn: [ActionType.DUPLICATE_DETECTED],
|
|
4765
|
+
resetOn: [ActionType.MARK_AS_DUPLICATE, ActionType.MARK_AS_NOT_DUPLICATE]
|
|
4766
|
+
},
|
|
4767
|
+
{
|
|
4768
|
+
flag: InherentFlags.EDIT_IN_PROGRESS,
|
|
4769
|
+
setOn: [ActionType.EDIT],
|
|
4770
|
+
resetOnAnyOtherAction: true
|
|
4771
|
+
}
|
|
4772
|
+
];
|
|
4409
4773
|
|
|
4410
4774
|
// ../commons/src/events/defineConfig.ts
|
|
4411
4775
|
var IGNORED_EVENT_TYPES = [
|
|
@@ -5151,6 +5515,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
|
5151
5515
|
id: "signature.upload.modal.title",
|
|
5152
5516
|
defaultMessage: "Draw signature",
|
|
5153
5517
|
description: "Title for the modal to draw signature"
|
|
5518
|
+
},
|
|
5519
|
+
// Zod applies the schema default at parse time, but this fixture bypasses
|
|
5520
|
+
// parsing — GeneratedInputField accesses configuration.maxFileSize directly.
|
|
5521
|
+
configuration: {
|
|
5522
|
+
maxFileSize: 5 * 1024 * 1024
|
|
5154
5523
|
}
|
|
5155
5524
|
}
|
|
5156
5525
|
]
|
|
@@ -5707,6 +6076,20 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5707
6076
|
},
|
|
5708
6077
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5709
6078
|
},
|
|
6079
|
+
{
|
|
6080
|
+
type: ActionType.NOTIFY,
|
|
6081
|
+
label: {
|
|
6082
|
+
defaultMessage: "Notify health worker",
|
|
6083
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
6084
|
+
id: "event.tennis-club-membership.action.notify.label"
|
|
6085
|
+
},
|
|
6086
|
+
flags: [
|
|
6087
|
+
{
|
|
6088
|
+
id: "health-worker-notified",
|
|
6089
|
+
operation: "add"
|
|
6090
|
+
}
|
|
6091
|
+
]
|
|
6092
|
+
},
|
|
5710
6093
|
{
|
|
5711
6094
|
type: ActionType.REJECT,
|
|
5712
6095
|
label: {
|
|
@@ -5949,6 +6332,17 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5949
6332
|
}
|
|
5950
6333
|
}
|
|
5951
6334
|
],
|
|
6335
|
+
flags: [
|
|
6336
|
+
{
|
|
6337
|
+
id: "health-worker-notified",
|
|
6338
|
+
requiresAction: false,
|
|
6339
|
+
label: {
|
|
6340
|
+
id: "event.tennis-club-membership.flag.health-worker-notified.label",
|
|
6341
|
+
defaultMessage: "Health worker notified",
|
|
6342
|
+
description: "Label for the health-worker-notified flag"
|
|
6343
|
+
}
|
|
6344
|
+
}
|
|
6345
|
+
],
|
|
5952
6346
|
advancedSearch: [
|
|
5953
6347
|
{
|
|
5954
6348
|
title: {
|
|
@@ -6944,10 +7338,380 @@ var ACTION_FILTERS = {
|
|
|
6944
7338
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
6945
7339
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6946
7340
|
};
|
|
7341
|
+
var REJECTED_ACTIONS = [
|
|
7342
|
+
ActionType.READ,
|
|
7343
|
+
ActionType.NOTIFY,
|
|
7344
|
+
ActionType.CUSTOM,
|
|
7345
|
+
ActionType.EDIT,
|
|
7346
|
+
ActionType.ARCHIVE
|
|
7347
|
+
];
|
|
6947
7348
|
|
|
6948
7349
|
// ../commons/src/events/FileUtils.ts
|
|
6949
7350
|
var import_lodash7 = require("lodash");
|
|
6950
7351
|
|
|
7352
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
7353
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
7354
|
+
{
|
|
7355
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7356
|
+
name: "Central",
|
|
7357
|
+
parentId: null,
|
|
7358
|
+
validUntil: null,
|
|
7359
|
+
externalId: "ydyJb1RAy4U1"
|
|
7360
|
+
},
|
|
7361
|
+
{
|
|
7362
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7363
|
+
name: "Sulaka",
|
|
7364
|
+
parentId: null,
|
|
7365
|
+
validUntil: null,
|
|
7366
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
7367
|
+
},
|
|
7368
|
+
{
|
|
7369
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
7370
|
+
name: "Pualula",
|
|
7371
|
+
parentId: null,
|
|
7372
|
+
validUntil: null,
|
|
7373
|
+
externalId: "Aq91DweLmT8k"
|
|
7374
|
+
},
|
|
7375
|
+
{
|
|
7376
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
7377
|
+
name: "Chuminga",
|
|
7378
|
+
parentId: null,
|
|
7379
|
+
validUntil: null,
|
|
7380
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
7381
|
+
},
|
|
7382
|
+
{
|
|
7383
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7384
|
+
name: "Ibombo",
|
|
7385
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7386
|
+
validUntil: null,
|
|
7387
|
+
externalId: "k7DsP4vbN1Qe"
|
|
7388
|
+
},
|
|
7389
|
+
{
|
|
7390
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7391
|
+
name: "Isango",
|
|
7392
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7393
|
+
validUntil: null,
|
|
7394
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
7395
|
+
},
|
|
7396
|
+
{
|
|
7397
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7398
|
+
name: "Isamba",
|
|
7399
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7400
|
+
validUntil: null,
|
|
7401
|
+
externalId: "sT0xVu1KqJ7r"
|
|
7402
|
+
},
|
|
7403
|
+
{
|
|
7404
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7405
|
+
name: "Itambo",
|
|
7406
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7407
|
+
validUntil: null,
|
|
7408
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
7409
|
+
},
|
|
7410
|
+
{
|
|
7411
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
7412
|
+
name: "Ezhi",
|
|
7413
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7414
|
+
validUntil: null,
|
|
7415
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
7416
|
+
},
|
|
7417
|
+
{
|
|
7418
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7419
|
+
name: "Ilanga",
|
|
7420
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7421
|
+
validUntil: null,
|
|
7422
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
7423
|
+
},
|
|
7424
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
7425
|
+
{
|
|
7426
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7427
|
+
name: "Klow",
|
|
7428
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7429
|
+
validUntil: null,
|
|
7430
|
+
externalId: "IkYcYBUcyY2"
|
|
7431
|
+
},
|
|
7432
|
+
{
|
|
7433
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
7434
|
+
name: "Mbondo",
|
|
7435
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7436
|
+
validUntil: null,
|
|
7437
|
+
externalId: "Qhvv5hvo3mY"
|
|
7438
|
+
},
|
|
7439
|
+
{
|
|
7440
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
7441
|
+
name: "Ndara",
|
|
7442
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7443
|
+
validUntil: null,
|
|
7444
|
+
externalId: "crXh068O9TR"
|
|
7445
|
+
},
|
|
7446
|
+
{
|
|
7447
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
7448
|
+
name: "Olani",
|
|
7449
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7450
|
+
validUntil: null,
|
|
7451
|
+
externalId: "r00It8Tvvp7"
|
|
7452
|
+
},
|
|
7453
|
+
{
|
|
7454
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
7455
|
+
name: "Pemba",
|
|
7456
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7457
|
+
validUntil: null,
|
|
7458
|
+
externalId: "ZnUWsbONIaH"
|
|
7459
|
+
},
|
|
7460
|
+
{
|
|
7461
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
7462
|
+
name: "Quanza",
|
|
7463
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7464
|
+
validUntil: null,
|
|
7465
|
+
externalId: "fDZycvQTa7l"
|
|
7466
|
+
},
|
|
7467
|
+
{
|
|
7468
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
7469
|
+
name: "Rivka",
|
|
7470
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7471
|
+
validUntil: null,
|
|
7472
|
+
externalId: "KqswxCGTELa"
|
|
7473
|
+
},
|
|
7474
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
7475
|
+
{
|
|
7476
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
7477
|
+
name: "Mbula",
|
|
7478
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7479
|
+
validUntil: null,
|
|
7480
|
+
externalId: "osEbKjRc9Kg"
|
|
7481
|
+
},
|
|
7482
|
+
{
|
|
7483
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
7484
|
+
name: "Ndoki",
|
|
7485
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7486
|
+
validUntil: null,
|
|
7487
|
+
externalId: "aq4daBUAGr3"
|
|
7488
|
+
},
|
|
7489
|
+
{
|
|
7490
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
7491
|
+
name: "Tsanga",
|
|
7492
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7493
|
+
validUntil: null,
|
|
7494
|
+
externalId: "cqis6Y8trbJ"
|
|
7495
|
+
},
|
|
7496
|
+
{
|
|
7497
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
7498
|
+
name: "Waziri",
|
|
7499
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7500
|
+
validUntil: null,
|
|
7501
|
+
externalId: "LMijHPyyx6d"
|
|
7502
|
+
},
|
|
7503
|
+
{
|
|
7504
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
7505
|
+
name: "Zimbi",
|
|
7506
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7507
|
+
validUntil: null,
|
|
7508
|
+
externalId: "pcQYbPuKGZ7"
|
|
7509
|
+
},
|
|
7510
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
7511
|
+
{
|
|
7512
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
7513
|
+
name: "Felani",
|
|
7514
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7515
|
+
validUntil: null,
|
|
7516
|
+
externalId: "gSqpoCGdMXp"
|
|
7517
|
+
},
|
|
7518
|
+
{
|
|
7519
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
7520
|
+
name: "Goroma",
|
|
7521
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7522
|
+
validUntil: null,
|
|
7523
|
+
externalId: "KvAAIaNqVrp"
|
|
7524
|
+
},
|
|
7525
|
+
{
|
|
7526
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
7527
|
+
name: "Halifu",
|
|
7528
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7529
|
+
validUntil: null,
|
|
7530
|
+
externalId: "qe4UnEVt1hv"
|
|
7531
|
+
},
|
|
7532
|
+
{
|
|
7533
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
7534
|
+
name: "Jabari",
|
|
7535
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7536
|
+
validUntil: null,
|
|
7537
|
+
externalId: "yHH9Nz4rLOt"
|
|
7538
|
+
},
|
|
7539
|
+
{
|
|
7540
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
7541
|
+
name: "Kifani",
|
|
7542
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7543
|
+
validUntil: null,
|
|
7544
|
+
externalId: "eSWmXIGeu1I"
|
|
7545
|
+
},
|
|
7546
|
+
{
|
|
7547
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
7548
|
+
name: "Lumela",
|
|
7549
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7550
|
+
validUntil: null,
|
|
7551
|
+
externalId: "bh0b3aI1uP3"
|
|
7552
|
+
}
|
|
7553
|
+
];
|
|
7554
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
7555
|
+
{
|
|
7556
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
7557
|
+
name: "Central Provincial Office",
|
|
7558
|
+
locationType: "CRVS_OFFICE",
|
|
7559
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7560
|
+
validUntil: null,
|
|
7561
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
7562
|
+
},
|
|
7563
|
+
{
|
|
7564
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
7565
|
+
name: "Central Health Post",
|
|
7566
|
+
locationType: "HEALTH_FACILITY",
|
|
7567
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7568
|
+
validUntil: null
|
|
7569
|
+
},
|
|
7570
|
+
{
|
|
7571
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
7572
|
+
name: "Ibombo District Office",
|
|
7573
|
+
locationType: "CRVS_OFFICE",
|
|
7574
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7575
|
+
validUntil: null,
|
|
7576
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
7577
|
+
},
|
|
7578
|
+
{
|
|
7579
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
7580
|
+
name: "Isamba District Office",
|
|
7581
|
+
locationType: "CRVS_OFFICE",
|
|
7582
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7583
|
+
validUntil: null,
|
|
7584
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
7585
|
+
},
|
|
7586
|
+
{
|
|
7587
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
7588
|
+
name: "Isango District Office",
|
|
7589
|
+
locationType: "CRVS_OFFICE",
|
|
7590
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7591
|
+
validUntil: null,
|
|
7592
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
7593
|
+
},
|
|
7594
|
+
{
|
|
7595
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
7596
|
+
name: "Sulaka Provincial Office",
|
|
7597
|
+
locationType: "CRVS_OFFICE",
|
|
7598
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7599
|
+
validUntil: null,
|
|
7600
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
7601
|
+
},
|
|
7602
|
+
{
|
|
7603
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
7604
|
+
name: "Ilanga District Office",
|
|
7605
|
+
locationType: "CRVS_OFFICE",
|
|
7606
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7607
|
+
validUntil: null,
|
|
7608
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
7609
|
+
},
|
|
7610
|
+
{
|
|
7611
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
7612
|
+
name: "Chamakubi Health Post",
|
|
7613
|
+
locationType: "HEALTH_FACILITY",
|
|
7614
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7615
|
+
validUntil: null,
|
|
7616
|
+
externalId: "M1nFr8LbC2Qy"
|
|
7617
|
+
},
|
|
7618
|
+
{
|
|
7619
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
7620
|
+
name: "Ibombo Rural Health Centre",
|
|
7621
|
+
locationType: "HEALTH_FACILITY",
|
|
7622
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7623
|
+
validUntil: null,
|
|
7624
|
+
externalId: "bT7pV6YrW0Xc"
|
|
7625
|
+
},
|
|
7626
|
+
{
|
|
7627
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
7628
|
+
name: "Chikobo Rural Health Centre",
|
|
7629
|
+
locationType: "HEALTH_FACILITY",
|
|
7630
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7631
|
+
validUntil: null,
|
|
7632
|
+
externalId: "zE4qPn2SgJ5d"
|
|
7633
|
+
},
|
|
7634
|
+
{
|
|
7635
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
7636
|
+
name: "Chilochabalenje Health Post",
|
|
7637
|
+
locationType: "HEALTH_FACILITY",
|
|
7638
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7639
|
+
validUntil: null,
|
|
7640
|
+
externalId: "H8vDs1MqR4Uf"
|
|
7641
|
+
},
|
|
7642
|
+
{
|
|
7643
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
7644
|
+
name: "Chipeso Rural Health Centre",
|
|
7645
|
+
locationType: "HEALTH_FACILITY",
|
|
7646
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7647
|
+
validUntil: null,
|
|
7648
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
7649
|
+
},
|
|
7650
|
+
{
|
|
7651
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
7652
|
+
name: "Chisamba Rural Health Centre",
|
|
7653
|
+
locationType: "HEALTH_FACILITY",
|
|
7654
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7655
|
+
validUntil: null,
|
|
7656
|
+
externalId: "Yr0pCg8LdM2s"
|
|
7657
|
+
},
|
|
7658
|
+
{
|
|
7659
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
7660
|
+
name: "Chitanda Rural Health Centre",
|
|
7661
|
+
locationType: "HEALTH_FACILITY",
|
|
7662
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7663
|
+
validUntil: null,
|
|
7664
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
7665
|
+
},
|
|
7666
|
+
{
|
|
7667
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
7668
|
+
name: "Golden Valley Rural Health Centre",
|
|
7669
|
+
locationType: "HEALTH_FACILITY",
|
|
7670
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7671
|
+
validUntil: null,
|
|
7672
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
7673
|
+
},
|
|
7674
|
+
{
|
|
7675
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
7676
|
+
name: "Ipongo Rural Health Centre",
|
|
7677
|
+
locationType: "HEALTH_FACILITY",
|
|
7678
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7679
|
+
validUntil: null,
|
|
7680
|
+
externalId: "kF2sW9DmH0Bt"
|
|
7681
|
+
},
|
|
7682
|
+
{
|
|
7683
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
7684
|
+
name: "Itumbwe Health Post",
|
|
7685
|
+
locationType: "HEALTH_FACILITY",
|
|
7686
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7687
|
+
validUntil: null,
|
|
7688
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
7689
|
+
},
|
|
7690
|
+
{
|
|
7691
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
7692
|
+
name: "Kabangalala Rural Health Centre",
|
|
7693
|
+
locationType: "HEALTH_FACILITY",
|
|
7694
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7695
|
+
validUntil: null,
|
|
7696
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
7697
|
+
},
|
|
7698
|
+
// Village offices
|
|
7699
|
+
{
|
|
7700
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
7701
|
+
name: "Klow Village Office",
|
|
7702
|
+
locationType: "CRVS_OFFICE",
|
|
7703
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7704
|
+
validUntil: null,
|
|
7705
|
+
externalId: "PmAyxAJkxiJ"
|
|
7706
|
+
}
|
|
7707
|
+
];
|
|
7708
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
7709
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
7710
|
+
);
|
|
7711
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
7712
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7713
|
+
);
|
|
7714
|
+
|
|
6951
7715
|
// ../commons/src/notification/UserNotifications.ts
|
|
6952
7716
|
var z44 = __toESM(require("zod/v4"));
|
|
6953
7717
|
var TriggerEvent = {
|