@opencrvs/toolkit 2.0.0-rc.ddf354d → 2.0.0-rc.de06664
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 +5 -4
- package/create-countryconfig/index.js +50 -20
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +267 -103
- package/dist/cli.js +3186 -4915
- package/dist/commons/api/router.d.ts +117 -21
- package/dist/commons/application-config/index.d.ts +1 -0
- package/dist/commons/conditionals/conditionals.d.ts +357 -7
- package/dist/commons/conditionals/validate.d.ts +51 -2
- package/dist/commons/events/ActionConfig.d.ts +204 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +42 -36
- package/dist/commons/events/AdvancedSearchConfig.d.ts +354 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/Draft.d.ts +2 -3
- package/dist/commons/events/EventConfig.d.ts +2 -0
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/EventIndex.d.ts +25 -0
- package/dist/commons/events/EventMetadata.d.ts +26 -0
- package/dist/commons/events/FieldConfig.d.ts +388 -50
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- package/dist/commons/events/FieldValue.d.ts +6 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +44 -5
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/locations.d.ts +1 -0
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/index.d.ts +8 -0
- package/dist/commons/events/state/utils.d.ts +21 -287
- package/dist/commons/events/utils.d.ts +12 -1
- package/dist/conditionals/index.js +62 -6
- 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 +15 -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 +497 -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 +199 -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 +794 -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 +173 -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 +169 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +112 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +100 -0
- package/dist/events/index.js +1167 -235
- 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/index.js +88 -5133
- 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/index.d.ts +6 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -0
- package/dist/migrations/v2.1/index.js +218 -0
- package/dist/notification/index.js +977 -129
- package/dist/scopes/index.d.ts +93 -7
- package/dist/scopes/index.js +19 -8
- 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.de06664.tgz +0 -0
- package/package.json +20 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.ddf354d.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,
|
|
@@ -294,8 +298,9 @@ var EncodedScope = z2.string().brand("EncodedScope");
|
|
|
294
298
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
295
299
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
296
300
|
accessLevel: JurisdictionFilter.enum.all,
|
|
297
|
-
|
|
298
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
301
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
302
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
303
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
299
304
|
};
|
|
300
305
|
|
|
301
306
|
// ../commons/src/authentication.ts
|
|
@@ -655,8 +660,8 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
655
660
|
// Action can be shown to the user in the list but as disabled
|
|
656
661
|
EnableConditional
|
|
657
662
|
]).meta({
|
|
658
|
-
|
|
659
|
-
|
|
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."
|
|
660
665
|
});
|
|
661
666
|
var DisplayOnReviewConditional = z7.object({
|
|
662
667
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
@@ -672,8 +677,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
672
677
|
// Field output can be shown / hidden on the review page
|
|
673
678
|
DisplayOnReviewConditional
|
|
674
679
|
]).meta({
|
|
675
|
-
|
|
676
|
-
|
|
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."
|
|
677
682
|
});
|
|
678
683
|
|
|
679
684
|
// ../commons/src/events/FieldType.ts
|
|
@@ -770,6 +775,11 @@ var FieldTypesToHideInReview = [
|
|
|
770
775
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
771
776
|
FieldType.ALPHA_HIDDEN
|
|
772
777
|
];
|
|
778
|
+
var HiddenFieldTypes = [
|
|
779
|
+
FieldType.HTTP,
|
|
780
|
+
FieldType.QUERY_PARAM_READER,
|
|
781
|
+
FieldType.ALPHA_HIDDEN
|
|
782
|
+
];
|
|
773
783
|
|
|
774
784
|
// ../commons/src/events/FieldValue.ts
|
|
775
785
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -888,7 +898,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
888
898
|
// ../commons/src/events/FieldValue.ts
|
|
889
899
|
var TextValue = z12.string();
|
|
890
900
|
var HiddenFieldValue = z12.string();
|
|
891
|
-
var NonEmptyTextValue =
|
|
901
|
+
var NonEmptyTextValue = z12.string().trim().min(1);
|
|
892
902
|
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
893
903
|
var AgeValue = z12.object({
|
|
894
904
|
age: z12.number(),
|
|
@@ -917,6 +927,7 @@ var DateRangeFieldValue = z12.object({
|
|
|
917
927
|
var EmailValue = z12.email();
|
|
918
928
|
var CheckboxFieldValue = z12.boolean();
|
|
919
929
|
var NumberFieldValue = z12.number();
|
|
930
|
+
var SignatureFieldValue = FileFieldValue;
|
|
920
931
|
var ButtonFieldValue = z12.number();
|
|
921
932
|
var VerificationStatusValue = z12.enum([
|
|
922
933
|
"verified",
|
|
@@ -1215,8 +1226,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
1215
1226
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1216
1227
|
z14.object({
|
|
1217
1228
|
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1218
|
-
requestId: z14.string()
|
|
1229
|
+
requestId: z14.string(),
|
|
1219
1230
|
// TODO move into 'content' property
|
|
1231
|
+
content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
|
|
1220
1232
|
}).shape
|
|
1221
1233
|
);
|
|
1222
1234
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1309,8 +1321,8 @@ var FlagConfig = z15.object({
|
|
|
1309
1321
|
),
|
|
1310
1322
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1311
1323
|
}).meta({
|
|
1312
|
-
|
|
1313
|
-
|
|
1324
|
+
id: "FlagConfig",
|
|
1325
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1314
1326
|
});
|
|
1315
1327
|
var ActionFlagConfig = z15.object({
|
|
1316
1328
|
id: Flag,
|
|
@@ -1319,8 +1331,8 @@ var ActionFlagConfig = z15.object({
|
|
|
1319
1331
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1320
1332
|
)
|
|
1321
1333
|
}).meta({
|
|
1322
|
-
|
|
1323
|
-
|
|
1334
|
+
id: "ActionFlagConfig",
|
|
1335
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1324
1336
|
});
|
|
1325
1337
|
|
|
1326
1338
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1350,6 +1362,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1350
1362
|
)
|
|
1351
1363
|
});
|
|
1352
1364
|
var LegalStatuses = z16.object({
|
|
1365
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1353
1366
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1354
1367
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1355
1368
|
});
|
|
@@ -1409,6 +1422,8 @@ var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
|
|
|
1409
1422
|
var EventMetadataDateFieldIdInput = z16.enum([
|
|
1410
1423
|
"createdAt",
|
|
1411
1424
|
"updatedAt",
|
|
1425
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1426
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1412
1427
|
"legalStatuses.DECLARED.createdAt",
|
|
1413
1428
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1414
1429
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1417,6 +1432,8 @@ var EventMetadataDateFieldIdInput = z16.enum([
|
|
|
1417
1432
|
var EventMetadataDateFieldId = z16.enum([
|
|
1418
1433
|
"event.createdAt",
|
|
1419
1434
|
"event.updatedAt",
|
|
1435
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1436
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1420
1437
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1421
1438
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1422
1439
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1476,7 +1493,8 @@ var Range = import_v4.z.object({
|
|
|
1476
1493
|
});
|
|
1477
1494
|
var ContainsFlags = import_v4.z.object({
|
|
1478
1495
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
1479
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1496
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
1497
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
1480
1498
|
}).meta({
|
|
1481
1499
|
id: "ContainsFlags"
|
|
1482
1500
|
});
|
|
@@ -1665,11 +1683,28 @@ var FieldReference = import_v43.default.object({
|
|
|
1665
1683
|
$$field: FieldId.describe("Id of the field to reference"),
|
|
1666
1684
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1667
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."
|
|
1668
1689
|
)
|
|
1669
|
-
}).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.");
|
|
1670
1698
|
var ValidationConfig = import_v43.default.object({
|
|
1671
|
-
validator: Conditional
|
|
1672
|
-
|
|
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."
|
|
1673
1708
|
});
|
|
1674
1709
|
var requiredSchema = import_v43.default.union([
|
|
1675
1710
|
import_v43.default.boolean(),
|
|
@@ -1700,7 +1735,7 @@ var BaseField = import_v43.default.object({
|
|
|
1700
1735
|
"Indicates whether the field can be modified during record correction."
|
|
1701
1736
|
),
|
|
1702
1737
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1703
|
-
"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."
|
|
1704
1739
|
),
|
|
1705
1740
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1706
1741
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1708,30 +1743,40 @@ var BaseField = import_v43.default.object({
|
|
|
1708
1743
|
}).describe("Common properties shared across all field types.");
|
|
1709
1744
|
var Divider = BaseField.extend({
|
|
1710
1745
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1746
|
+
}).meta({
|
|
1747
|
+
description: "A horizontal line divider",
|
|
1748
|
+
id: "Divider"
|
|
1711
1749
|
});
|
|
1712
1750
|
var TextField = BaseField.extend({
|
|
1713
1751
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1714
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1752
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1715
1753
|
configuration: import_v43.default.object({
|
|
1716
1754
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1717
1755
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
1718
1756
|
prefix: TranslationConfig.optional(),
|
|
1719
1757
|
postfix: TranslationConfig.optional()
|
|
1720
1758
|
}).default({ type: "text" }).optional()
|
|
1721
|
-
}).
|
|
1759
|
+
}).meta({
|
|
1760
|
+
description: "A text input field",
|
|
1761
|
+
id: "TextField"
|
|
1762
|
+
});
|
|
1722
1763
|
var NumberField = BaseField.extend({
|
|
1723
1764
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1724
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1765
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1725
1766
|
configuration: import_v43.default.object({
|
|
1726
1767
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1727
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"),
|
|
1728
1770
|
prefix: TranslationConfig.optional(),
|
|
1729
1771
|
postfix: TranslationConfig.optional()
|
|
1730
1772
|
}).optional()
|
|
1731
|
-
}).
|
|
1773
|
+
}).meta({
|
|
1774
|
+
description: "A number input field",
|
|
1775
|
+
id: "NumberField"
|
|
1776
|
+
});
|
|
1732
1777
|
var TextAreaField = BaseField.extend({
|
|
1733
1778
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1734
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1779
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1735
1780
|
configuration: import_v43.default.object({
|
|
1736
1781
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1737
1782
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1739,7 +1784,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1739
1784
|
prefix: TranslationConfig.optional(),
|
|
1740
1785
|
postfix: TranslationConfig.optional()
|
|
1741
1786
|
}).default({ rows: 4 }).optional()
|
|
1742
|
-
}).
|
|
1787
|
+
}).meta({
|
|
1788
|
+
description: "A multiline text input",
|
|
1789
|
+
id: "TextAreaField"
|
|
1790
|
+
});
|
|
1743
1791
|
var ImageMimeType = import_v43.default.enum([
|
|
1744
1792
|
"image/png",
|
|
1745
1793
|
"image/jpg",
|
|
@@ -1762,58 +1810,76 @@ var SignatureField = BaseField.extend({
|
|
|
1762
1810
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1763
1811
|
"Title of the signature modal"
|
|
1764
1812
|
),
|
|
1765
|
-
defaultValue:
|
|
1813
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1766
1814
|
configuration: import_v43.default.object({
|
|
1767
1815
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1768
1816
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1769
1817
|
}).default({
|
|
1770
1818
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1771
1819
|
})
|
|
1772
|
-
}).
|
|
1820
|
+
}).meta({
|
|
1821
|
+
description: "A signature input field",
|
|
1822
|
+
id: "SignatureField"
|
|
1823
|
+
});
|
|
1773
1824
|
var EmailField = BaseField.extend({
|
|
1774
1825
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1775
1826
|
configuration: import_v43.default.object({
|
|
1776
1827
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1777
1828
|
}).default({ maxLength: 255 }).optional(),
|
|
1778
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1829
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1830
|
+
}).meta({
|
|
1831
|
+
description: "An email input field",
|
|
1832
|
+
id: "EmailField"
|
|
1779
1833
|
});
|
|
1780
1834
|
var DateField = BaseField.extend({
|
|
1781
1835
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1782
|
-
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)"),
|
|
1783
1837
|
configuration: import_v43.default.object({
|
|
1784
1838
|
notice: TranslationConfig.describe(
|
|
1785
1839
|
"Text to display above the date input"
|
|
1786
1840
|
).optional()
|
|
1787
1841
|
}).optional()
|
|
1788
|
-
}).
|
|
1842
|
+
}).meta({
|
|
1843
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1844
|
+
id: "DateField"
|
|
1845
|
+
});
|
|
1789
1846
|
var AgeField = BaseField.extend({
|
|
1790
1847
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1791
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1848
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1792
1849
|
configuration: import_v43.default.object({
|
|
1793
1850
|
asOfDate: FieldReference,
|
|
1794
1851
|
prefix: TranslationConfig.optional(),
|
|
1795
1852
|
postfix: TranslationConfig.optional()
|
|
1796
1853
|
})
|
|
1797
|
-
}).
|
|
1854
|
+
}).meta({
|
|
1855
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1856
|
+
id: "AgeField"
|
|
1857
|
+
});
|
|
1798
1858
|
var TimeField = BaseField.extend({
|
|
1799
1859
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1800
|
-
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)"),
|
|
1801
1861
|
configuration: import_v43.default.object({
|
|
1802
1862
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1803
1863
|
notice: TranslationConfig.describe(
|
|
1804
1864
|
"Text to display above the time input"
|
|
1805
1865
|
).optional()
|
|
1806
1866
|
}).optional()
|
|
1807
|
-
}).
|
|
1867
|
+
}).meta({
|
|
1868
|
+
description: "A single time input (HH-mm)",
|
|
1869
|
+
id: "TimeField"
|
|
1870
|
+
});
|
|
1808
1871
|
var DateRangeField = BaseField.extend({
|
|
1809
1872
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1810
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1873
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1811
1874
|
configuration: import_v43.default.object({
|
|
1812
1875
|
notice: TranslationConfig.describe(
|
|
1813
1876
|
"Text to display above the date input"
|
|
1814
1877
|
).optional()
|
|
1815
1878
|
}).optional()
|
|
1816
|
-
}).
|
|
1879
|
+
}).meta({
|
|
1880
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1881
|
+
id: "DateRangeField"
|
|
1882
|
+
});
|
|
1817
1883
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1818
1884
|
"reg12",
|
|
1819
1885
|
"reg14",
|
|
@@ -1857,21 +1923,33 @@ var ImageViewField = BaseField.extend({
|
|
|
1857
1923
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1858
1924
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1859
1925
|
configuration: ImageConfiguration
|
|
1860
|
-
}).
|
|
1926
|
+
}).meta({
|
|
1927
|
+
description: "A read-only image component for form pages",
|
|
1928
|
+
id: "ImageViewField"
|
|
1929
|
+
});
|
|
1861
1930
|
var Paragraph = BaseField.extend({
|
|
1862
1931
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1863
1932
|
configuration: ParagraphConfiguration
|
|
1864
|
-
}).
|
|
1933
|
+
}).meta({
|
|
1934
|
+
description: "A read-only HTML <p> paragraph",
|
|
1935
|
+
id: "Paragraph"
|
|
1936
|
+
});
|
|
1865
1937
|
var Heading = BaseField.extend({
|
|
1866
1938
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1867
1939
|
configuration: HeadingConfiguration
|
|
1868
|
-
}).
|
|
1940
|
+
}).meta({
|
|
1941
|
+
description: "A read-only heading component for form pages",
|
|
1942
|
+
id: "Heading"
|
|
1943
|
+
});
|
|
1869
1944
|
var PageHeader = BaseField.extend({
|
|
1870
1945
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1871
|
-
}).
|
|
1946
|
+
}).meta({
|
|
1947
|
+
description: "A read-only header component for form pages",
|
|
1948
|
+
id: "PageHeader"
|
|
1949
|
+
});
|
|
1872
1950
|
var File = BaseField.extend({
|
|
1873
1951
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1874
|
-
defaultValue: FileFieldValue.optional(),
|
|
1952
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1875
1953
|
configuration: import_v43.default.object({
|
|
1876
1954
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1877
1955
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1887,7 +1965,10 @@ var File = BaseField.extend({
|
|
|
1887
1965
|
}).default({
|
|
1888
1966
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1889
1967
|
})
|
|
1890
|
-
}).
|
|
1968
|
+
}).meta({
|
|
1969
|
+
description: "A file upload field",
|
|
1970
|
+
id: "File"
|
|
1971
|
+
});
|
|
1891
1972
|
var SelectOption = import_v43.default.object({
|
|
1892
1973
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1893
1974
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1895,7 +1976,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1895
1976
|
});
|
|
1896
1977
|
var NumberWithUnitField = BaseField.extend({
|
|
1897
1978
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1898
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1979
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1899
1980
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1900
1981
|
configuration: import_v43.default.object({
|
|
1901
1982
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1904,17 +1985,23 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1904
1985
|
"Placeholder for the number field"
|
|
1905
1986
|
)
|
|
1906
1987
|
}).optional()
|
|
1907
|
-
}).
|
|
1988
|
+
}).meta({
|
|
1989
|
+
description: "A number with unit input field",
|
|
1990
|
+
id: "NumberWithUnitField"
|
|
1991
|
+
});
|
|
1908
1992
|
var RadioGroup = BaseField.extend({
|
|
1909
1993
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1910
|
-
defaultValue: TextValue.optional(),
|
|
1994
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1911
1995
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1912
1996
|
configuration: import_v43.default.object({
|
|
1913
1997
|
styles: import_v43.default.object({
|
|
1914
1998
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1915
1999
|
}).optional()
|
|
1916
2000
|
}).optional()
|
|
1917
|
-
}).
|
|
2001
|
+
}).meta({
|
|
2002
|
+
description: "A grouped radio button field",
|
|
2003
|
+
id: "RadioGroup"
|
|
2004
|
+
});
|
|
1918
2005
|
var BulletList = BaseField.extend({
|
|
1919
2006
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1920
2007
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1923,10 +2010,13 @@ var BulletList = BaseField.extend({
|
|
|
1923
2010
|
fontVariant: HtmlFontVariant.optional()
|
|
1924
2011
|
}).optional()
|
|
1925
2012
|
}).default({})
|
|
1926
|
-
}).
|
|
2013
|
+
}).meta({
|
|
2014
|
+
description: "A list of bullet points",
|
|
2015
|
+
id: "BulletList"
|
|
2016
|
+
});
|
|
1927
2017
|
var Select = BaseField.extend({
|
|
1928
2018
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1929
|
-
defaultValue: TextValue.optional(),
|
|
2019
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1930
2020
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1931
2021
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1932
2022
|
`
|
|
@@ -1938,16 +2028,22 @@ var Select = BaseField.extend({
|
|
|
1938
2028
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1939
2029
|
`
|
|
1940
2030
|
)
|
|
1941
|
-
}).
|
|
2031
|
+
}).meta({
|
|
2032
|
+
description: "A select input field",
|
|
2033
|
+
id: "Select"
|
|
2034
|
+
});
|
|
1942
2035
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1943
2036
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1944
2037
|
label: TranslationConfig.describe("The label of the option")
|
|
1945
2038
|
});
|
|
1946
2039
|
var SelectDateRangeField = BaseField.extend({
|
|
1947
2040
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1948
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
2041
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1949
2042
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1950
|
-
}).
|
|
2043
|
+
}).meta({
|
|
2044
|
+
description: "A date range selection field",
|
|
2045
|
+
id: "SelectDateRangeField"
|
|
2046
|
+
});
|
|
1951
2047
|
var NameConfig = import_v43.default.object({
|
|
1952
2048
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1953
2049
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1959,7 +2055,7 @@ var NameField = BaseField.extend({
|
|
|
1959
2055
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1960
2056
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1961
2057
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1962
|
-
}).optional(),
|
|
2058
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1963
2059
|
configuration: import_v43.default.object({
|
|
1964
2060
|
name: NameConfig.default({
|
|
1965
2061
|
firstname: { required: true },
|
|
@@ -1978,26 +2074,41 @@ var NameField = BaseField.extend({
|
|
|
1978
2074
|
surname: { required: true }
|
|
1979
2075
|
}
|
|
1980
2076
|
}).optional()
|
|
1981
|
-
}).
|
|
2077
|
+
}).meta({
|
|
2078
|
+
description: "A field for entering a persons name",
|
|
2079
|
+
id: "NameField"
|
|
2080
|
+
});
|
|
1982
2081
|
var PhoneField = BaseField.extend({
|
|
1983
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2082
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1984
2083
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1985
|
-
}).
|
|
2084
|
+
}).meta({
|
|
2085
|
+
description: "A field for entering a phone number",
|
|
2086
|
+
id: "PhoneField"
|
|
2087
|
+
});
|
|
1986
2088
|
var IdField = BaseField.extend({
|
|
1987
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2089
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1988
2090
|
type: import_v43.default.literal(FieldType.ID)
|
|
1989
|
-
}).
|
|
2091
|
+
}).meta({
|
|
2092
|
+
description: "A field for entering an ID",
|
|
2093
|
+
id: "IdField"
|
|
2094
|
+
});
|
|
1990
2095
|
var Checkbox = BaseField.extend({
|
|
1991
2096
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1992
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1993
|
-
}).
|
|
2097
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
2098
|
+
}).meta({
|
|
2099
|
+
description: "A boolean checkbox field",
|
|
2100
|
+
id: "Checkbox"
|
|
2101
|
+
});
|
|
1994
2102
|
var Country = BaseField.extend({
|
|
1995
2103
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1996
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2104
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1997
2105
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1998
2106
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1999
2107
|
)
|
|
2000
|
-
}).
|
|
2108
|
+
}).meta({
|
|
2109
|
+
description: "A field for selecting a country",
|
|
2110
|
+
id: "Country"
|
|
2111
|
+
});
|
|
2001
2112
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
2002
2113
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
2003
2114
|
);
|
|
@@ -2006,28 +2117,33 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2006
2117
|
"HEALTH_FACILITY",
|
|
2007
2118
|
"CRVS_OFFICE"
|
|
2008
2119
|
]);
|
|
2009
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
2010
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
2011
|
-
type: AdministrativeAreas,
|
|
2012
|
-
allowedLocations: AllowedLocations
|
|
2013
|
-
}).describe("Administrative area options");
|
|
2014
2120
|
var AdministrativeAreaField = BaseField.extend({
|
|
2015
2121
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2016
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2017
|
-
configuration:
|
|
2018
|
-
|
|
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
|
+
});
|
|
2019
2132
|
var LocationInput = BaseField.extend({
|
|
2020
2133
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2021
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2134
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2022
2135
|
configuration: import_v43.default.object({
|
|
2023
2136
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2024
2137
|
allowedLocations: AllowedLocations
|
|
2025
2138
|
}).optional()
|
|
2026
|
-
}).
|
|
2139
|
+
}).meta({
|
|
2140
|
+
description: "A field for selecting a location",
|
|
2141
|
+
id: "LocationInput"
|
|
2142
|
+
});
|
|
2027
2143
|
var FileUploadWithOptions = BaseField.extend({
|
|
2028
2144
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2029
2145
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
2030
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
2146
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
2031
2147
|
configuration: import_v43.default.object({
|
|
2032
2148
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2033
2149
|
maxImageSize: import_v43.default.object({
|
|
@@ -2037,15 +2153,18 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2037
2153
|
}).default({
|
|
2038
2154
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2039
2155
|
})
|
|
2156
|
+
}).meta({
|
|
2157
|
+
description: "A field for uploading files with file type options",
|
|
2158
|
+
id: "FileUploadWithOptions"
|
|
2040
2159
|
});
|
|
2041
2160
|
var Facility = BaseField.extend({
|
|
2042
2161
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
2043
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2162
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2044
2163
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2045
2164
|
}).describe("Input field for a facility");
|
|
2046
2165
|
var Office = BaseField.extend({
|
|
2047
2166
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
2048
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2167
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2049
2168
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2050
2169
|
}).describe("Input field for an office");
|
|
2051
2170
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -2081,8 +2200,11 @@ var Address = BaseField.extend({
|
|
|
2081
2200
|
).optional(),
|
|
2082
2201
|
allowedLocations: AllowedLocations
|
|
2083
2202
|
}).optional(),
|
|
2084
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
2085
|
-
}).
|
|
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
|
+
});
|
|
2086
2208
|
var StaticDataEntry = import_v43.default.object({
|
|
2087
2209
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2088
2210
|
label: TranslationConfig,
|
|
@@ -2097,7 +2219,10 @@ var DataField = BaseField.extend({
|
|
|
2097
2219
|
subtitle: TranslationConfig.optional(),
|
|
2098
2220
|
data: import_v43.default.array(DataEntry)
|
|
2099
2221
|
})
|
|
2100
|
-
}).
|
|
2222
|
+
}).meta({
|
|
2223
|
+
description: "A field for displaying a table of read-only data",
|
|
2224
|
+
id: "DataField"
|
|
2225
|
+
});
|
|
2101
2226
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2102
2227
|
var ButtonType = import_v43.default.enum([
|
|
2103
2228
|
"primary",
|
|
@@ -2122,13 +2247,19 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
2122
2247
|
});
|
|
2123
2248
|
var ButtonField = BaseField.extend({
|
|
2124
2249
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2125
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
2250
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
2126
2251
|
configuration: ButtonConfiguration
|
|
2127
|
-
}).
|
|
2252
|
+
}).meta({
|
|
2253
|
+
description: "A generic button that can be used to trigger an action",
|
|
2254
|
+
id: "ButtonField"
|
|
2255
|
+
});
|
|
2128
2256
|
var FieldGroup = BaseField.extend({
|
|
2129
2257
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2130
2258
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2131
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"
|
|
2132
2263
|
});
|
|
2133
2264
|
var AlphaPrintButton = BaseField.extend({
|
|
2134
2265
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2138,10 +2269,13 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2138
2269
|
"Label for the print button"
|
|
2139
2270
|
)
|
|
2140
2271
|
})
|
|
2141
|
-
}).
|
|
2272
|
+
}).meta({
|
|
2273
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2274
|
+
id: "AlphaPrintButton"
|
|
2275
|
+
});
|
|
2142
2276
|
var HttpField = BaseField.extend({
|
|
2143
2277
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2144
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2278
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
2145
2279
|
configuration: import_v43.default.object({
|
|
2146
2280
|
trigger: FieldReference.optional().describe(
|
|
2147
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."
|
|
@@ -2154,20 +2288,30 @@ var HttpField = BaseField.extend({
|
|
|
2154
2288
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2155
2289
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2156
2290
|
})
|
|
2157
|
-
}).
|
|
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
|
+
});
|
|
2158
2295
|
var AutocompleteField = BaseField.extend({
|
|
2159
2296
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2160
2297
|
configuration: import_v43.default.object({
|
|
2161
|
-
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(),
|
|
2162
2301
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2163
2302
|
defaultOptions: import_v43.default.array(
|
|
2164
2303
|
import_v43.default.object({
|
|
2165
2304
|
label: import_v43.default.string(),
|
|
2166
2305
|
value: import_v43.default.string()
|
|
2167
2306
|
})
|
|
2168
|
-
).optional()
|
|
2307
|
+
).optional().describe(
|
|
2308
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2309
|
+
)
|
|
2169
2310
|
})
|
|
2170
|
-
}).
|
|
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
|
+
});
|
|
2171
2315
|
var SearchField = HttpField.extend({
|
|
2172
2316
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2173
2317
|
configuration: SearchQuery.pick({
|
|
@@ -2200,6 +2344,9 @@ var SearchField = HttpField.extend({
|
|
|
2200
2344
|
ok: TranslationConfig.optional()
|
|
2201
2345
|
}).optional()
|
|
2202
2346
|
})
|
|
2347
|
+
}).meta({
|
|
2348
|
+
description: "A search input field",
|
|
2349
|
+
id: "SearchField"
|
|
2203
2350
|
});
|
|
2204
2351
|
var LinkButtonField = BaseField.extend({
|
|
2205
2352
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2208,28 +2355,35 @@ var LinkButtonField = BaseField.extend({
|
|
|
2208
2355
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2209
2356
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2210
2357
|
})
|
|
2211
|
-
}).
|
|
2358
|
+
}).meta({
|
|
2359
|
+
description: "A button that opens a URL link",
|
|
2360
|
+
id: "LinkButtonField"
|
|
2361
|
+
});
|
|
2212
2362
|
var VerificationStatus = BaseField.extend({
|
|
2213
2363
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2214
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2364
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2215
2365
|
configuration: import_v43.default.object({
|
|
2216
2366
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2217
2367
|
description: TranslationConfig.describe(
|
|
2218
2368
|
"Explaining text on the banner in form."
|
|
2219
2369
|
)
|
|
2220
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"
|
|
2221
2374
|
});
|
|
2222
2375
|
var QueryParamReaderField = BaseField.extend({
|
|
2223
2376
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2224
2377
|
configuration: import_v43.default.object({
|
|
2225
2378
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2226
2379
|
})
|
|
2227
|
-
}).
|
|
2228
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2229
|
-
|
|
2380
|
+
}).meta({
|
|
2381
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2382
|
+
id: "QueryParamReaderField"
|
|
2383
|
+
});
|
|
2230
2384
|
var QrReaderField = BaseField.extend({
|
|
2231
2385
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2232
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2386
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2233
2387
|
configuration: import_v43.default.object({
|
|
2234
2388
|
validator: import_v43.default.any().meta({
|
|
2235
2389
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2237,21 +2391,27 @@ var QrReaderField = BaseField.extend({
|
|
|
2237
2391
|
})
|
|
2238
2392
|
}).optional()
|
|
2239
2393
|
}).meta({
|
|
2240
|
-
description: "
|
|
2394
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2241
2395
|
id: "QrReaderField"
|
|
2242
2396
|
});
|
|
2243
2397
|
var IdReaderField = BaseField.extend({
|
|
2244
2398
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2245
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2399
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2246
2400
|
methods: import_v43.default.array(
|
|
2247
2401
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2248
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"
|
|
2249
2406
|
});
|
|
2250
2407
|
var CustomField = BaseField.extend({
|
|
2251
2408
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2252
2409
|
defaultValue: CustomFieldValue.optional(),
|
|
2253
2410
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2254
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"
|
|
2255
2415
|
});
|
|
2256
2416
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2257
2417
|
var LoaderField = BaseField.extend({
|
|
@@ -2261,22 +2421,25 @@ var LoaderField = BaseField.extend({
|
|
|
2261
2421
|
configuration: import_v43.default.object({
|
|
2262
2422
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2263
2423
|
})
|
|
2264
|
-
}).
|
|
2265
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2266
|
-
|
|
2424
|
+
}).meta({
|
|
2425
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2426
|
+
id: "LoaderField"
|
|
2427
|
+
});
|
|
2267
2428
|
var HiddenField = BaseField.extend({
|
|
2268
2429
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2269
2430
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2270
2431
|
defaultValue: TextValue.optional()
|
|
2271
|
-
}).
|
|
2272
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2273
|
-
|
|
2432
|
+
}).meta({
|
|
2433
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2434
|
+
id: "HiddenField"
|
|
2435
|
+
});
|
|
2274
2436
|
var UserRoleField = BaseField.extend({
|
|
2275
2437
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2276
2438
|
defaultValue: TextValue.optional()
|
|
2277
|
-
}).
|
|
2278
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2279
|
-
|
|
2439
|
+
}).meta({
|
|
2440
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2441
|
+
id: "UserRoleField"
|
|
2442
|
+
});
|
|
2280
2443
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2281
2444
|
FieldGroup,
|
|
2282
2445
|
Address,
|
|
@@ -2376,15 +2539,18 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2376
2539
|
actions: VerificationActionConfig
|
|
2377
2540
|
});
|
|
2378
2541
|
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2379
|
-
|
|
2380
|
-
|
|
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."
|
|
2381
2544
|
});
|
|
2382
2545
|
|
|
2383
2546
|
// ../commons/src/events/FormConfig.ts
|
|
2384
2547
|
var DeclarationFormConfig = z22.object({
|
|
2385
2548
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2386
2549
|
pages: z22.array(FormPageConfig)
|
|
2387
|
-
}).
|
|
2550
|
+
}).meta({
|
|
2551
|
+
id: "DeclarationFormConfig",
|
|
2552
|
+
description: "Configuration of the declaration form."
|
|
2553
|
+
});
|
|
2388
2554
|
var ActionFormConfig = z22.object({
|
|
2389
2555
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2390
2556
|
pages: z22.array(PageConfig)
|
|
@@ -2484,6 +2650,9 @@ var DeduplicationConfig = z23.object({
|
|
|
2484
2650
|
id: z23.string(),
|
|
2485
2651
|
label: TranslationConfig,
|
|
2486
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."
|
|
2487
2656
|
});
|
|
2488
2657
|
|
|
2489
2658
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -2521,6 +2690,57 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
2521
2690
|
conditionals: z24.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
2522
2691
|
}).shape
|
|
2523
2692
|
);
|
|
2693
|
+
var NotifyConfig = ActionConfigBase.extend(
|
|
2694
|
+
z24.object({
|
|
2695
|
+
type: z24.literal(ActionType.NOTIFY)
|
|
2696
|
+
}).shape
|
|
2697
|
+
);
|
|
2698
|
+
var DuplicateDetectedConfig = ActionConfigBase.extend(
|
|
2699
|
+
z24.object({
|
|
2700
|
+
type: z24.literal(ActionType.DUPLICATE_DETECTED),
|
|
2701
|
+
label: z24.never().optional().describe(
|
|
2702
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no label."
|
|
2703
|
+
),
|
|
2704
|
+
supportingCopy: z24.never().optional(),
|
|
2705
|
+
icon: z24.never().optional().describe(
|
|
2706
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it has no icon."
|
|
2707
|
+
),
|
|
2708
|
+
conditionals: z24.never().optional().describe(
|
|
2709
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it cannot be disabled or hidden with conditionals."
|
|
2710
|
+
)
|
|
2711
|
+
}).shape
|
|
2712
|
+
);
|
|
2713
|
+
var MarkAsDuplicateConfig = ActionConfigBase.extend(
|
|
2714
|
+
z24.object({
|
|
2715
|
+
type: z24.literal(ActionType.MARK_AS_DUPLICATE)
|
|
2716
|
+
}).shape
|
|
2717
|
+
);
|
|
2718
|
+
var MarkAsNotDuplicateConfig = ActionConfigBase.extend(
|
|
2719
|
+
z24.object({
|
|
2720
|
+
type: z24.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
2721
|
+
}).shape
|
|
2722
|
+
);
|
|
2723
|
+
var AssignConfig = ActionConfigBase.extend(
|
|
2724
|
+
z24.object({
|
|
2725
|
+
type: z24.literal(ActionType.ASSIGN),
|
|
2726
|
+
flags: z24.never().optional().describe(
|
|
2727
|
+
"ASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
2728
|
+
)
|
|
2729
|
+
}).shape
|
|
2730
|
+
);
|
|
2731
|
+
var UnassignConfig = ActionConfigBase.extend(
|
|
2732
|
+
z24.object({
|
|
2733
|
+
type: z24.literal(ActionType.UNASSIGN),
|
|
2734
|
+
flags: z24.never().optional().describe(
|
|
2735
|
+
"UNASSIGN is a meta action excluded from flag resolution, so flags configured here would never apply."
|
|
2736
|
+
)
|
|
2737
|
+
}).shape
|
|
2738
|
+
);
|
|
2739
|
+
var DeleteConfig = ActionConfigBase.extend(
|
|
2740
|
+
z24.object({
|
|
2741
|
+
type: z24.literal(ActionType.DELETE)
|
|
2742
|
+
}).shape
|
|
2743
|
+
);
|
|
2524
2744
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
2525
2745
|
z24.object({
|
|
2526
2746
|
type: z24.literal(ActionType.DECLARE),
|
|
@@ -2583,7 +2803,17 @@ var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
|
2583
2803
|
correctionForm: ActionFormConfig
|
|
2584
2804
|
}).shape
|
|
2585
2805
|
);
|
|
2586
|
-
var
|
|
2806
|
+
var ApproveCorrectionConfig = ActionConfigBase.extend(
|
|
2807
|
+
z24.object({
|
|
2808
|
+
type: z24.literal(ActionType.APPROVE_CORRECTION)
|
|
2809
|
+
}).shape
|
|
2810
|
+
);
|
|
2811
|
+
var RejectCorrectionConfig = ActionConfigBase.extend(
|
|
2812
|
+
z24.object({
|
|
2813
|
+
type: z24.literal(ActionType.REJECT_CORRECTION)
|
|
2814
|
+
}).shape
|
|
2815
|
+
);
|
|
2816
|
+
var CustomActionConfig = ActionConfigBase.extend(
|
|
2587
2817
|
z24.object({
|
|
2588
2818
|
type: z24.literal(ActionType.CUSTOM),
|
|
2589
2819
|
customActionType: z24.string().describe("Type identifier of the custom action."),
|
|
@@ -2594,24 +2824,85 @@ var CustomActionConfig = ActionConfigBase.merge(
|
|
|
2594
2824
|
auditHistoryLabel: TranslationConfig.describe(
|
|
2595
2825
|
'The label to show in audit history for this action. For example "Approved".'
|
|
2596
2826
|
)
|
|
2597
|
-
})
|
|
2827
|
+
}).shape
|
|
2598
2828
|
);
|
|
2599
2829
|
var ActionConfig = z24.discriminatedUnion("type", [
|
|
2600
2830
|
/*
|
|
2601
2831
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2602
2832
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2603
2833
|
*/
|
|
2604
|
-
ReadActionConfig.meta({
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2834
|
+
ReadActionConfig.meta({
|
|
2835
|
+
id: "ReadActionConfig",
|
|
2836
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2837
|
+
}),
|
|
2838
|
+
AssignConfig.meta({
|
|
2839
|
+
id: "AssignActionConfig",
|
|
2840
|
+
description: "Configuration for assigning a record to the current user."
|
|
2841
|
+
}),
|
|
2842
|
+
UnassignConfig.meta({
|
|
2843
|
+
id: "UnassignActionConfig",
|
|
2844
|
+
description: "Configuration for unassigning a record from its current assignee."
|
|
2845
|
+
}),
|
|
2846
|
+
DeleteConfig.meta({
|
|
2847
|
+
id: "DeleteActionConfig",
|
|
2848
|
+
description: "Configuration for deleting a draft record."
|
|
2849
|
+
}),
|
|
2850
|
+
NotifyConfig.meta({
|
|
2851
|
+
id: "NotifyActionConfig",
|
|
2852
|
+
description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
|
|
2853
|
+
}),
|
|
2854
|
+
DeclareConfig.meta({
|
|
2855
|
+
id: "DeclareActionConfig",
|
|
2856
|
+
description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
|
|
2857
|
+
}),
|
|
2858
|
+
DuplicateDetectedConfig.meta({
|
|
2859
|
+
id: "DuplicateDetectedActionConfig",
|
|
2860
|
+
description: "Configuration for the system-generated duplicate-detection action. Never shown as a button, so it only supports flags \u2014 not label, icon, or conditionals."
|
|
2861
|
+
}),
|
|
2862
|
+
MarkAsDuplicateConfig.meta({
|
|
2863
|
+
id: "MarkAsDuplicateActionConfig",
|
|
2864
|
+
description: "Configuration for marking a record as a duplicate."
|
|
2865
|
+
}),
|
|
2866
|
+
MarkAsNotDuplicateConfig.meta({
|
|
2867
|
+
id: "MarkAsNotDuplicateActionConfig",
|
|
2868
|
+
description: "Configuration for marking a record as not a duplicate, after it was previously flagged as one."
|
|
2869
|
+
}),
|
|
2870
|
+
RejectConfig.meta({
|
|
2871
|
+
id: "RejectActionConfig",
|
|
2872
|
+
description: "Configuration for rejecting a record before registration."
|
|
2873
|
+
}),
|
|
2874
|
+
RegisterConfig.meta({
|
|
2875
|
+
id: "RegisterActionConfig",
|
|
2876
|
+
description: "Configuration for registering a record."
|
|
2877
|
+
}),
|
|
2608
2878
|
PrintCertificateActionConfig.meta({
|
|
2609
|
-
id: "PrintCertificateActionConfig"
|
|
2879
|
+
id: "PrintCertificateActionConfig",
|
|
2880
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
2881
|
+
}),
|
|
2882
|
+
RequestCorrectionConfig.meta({
|
|
2883
|
+
id: "RequestCorrectionActionConfig",
|
|
2884
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
2885
|
+
}),
|
|
2886
|
+
ApproveCorrectionConfig.meta({
|
|
2887
|
+
id: "ApproveCorrectionActionConfig",
|
|
2888
|
+
description: "Configuration for approving a requested correction."
|
|
2889
|
+
}),
|
|
2890
|
+
RejectCorrectionConfig.meta({
|
|
2891
|
+
id: "RejectCorrectionActionConfig",
|
|
2892
|
+
description: "Configuration for rejecting a requested correction."
|
|
2610
2893
|
}),
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2894
|
+
EditActionConfig.meta({
|
|
2895
|
+
id: "EditActionConfig",
|
|
2896
|
+
description: "Configuration for editing a record before registration."
|
|
2897
|
+
}),
|
|
2898
|
+
ArchiveConfig.meta({
|
|
2899
|
+
id: "ArchiveActionConfig",
|
|
2900
|
+
description: "Configuration for archiving a record."
|
|
2901
|
+
}),
|
|
2902
|
+
CustomActionConfig.meta({
|
|
2903
|
+
id: "CustomActionConfig",
|
|
2904
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
2905
|
+
})
|
|
2615
2906
|
]).describe(
|
|
2616
2907
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2617
2908
|
).meta({ id: "ActionConfig" });
|
|
@@ -2687,7 +2978,10 @@ var Field = BaseField2.extend({
|
|
|
2687
2978
|
}).describe("Custom field defined for the summary view.");
|
|
2688
2979
|
var SummaryConfig = z27.object({
|
|
2689
2980
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2690
|
-
}).
|
|
2981
|
+
}).meta({
|
|
2982
|
+
id: "SummaryConfig",
|
|
2983
|
+
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."
|
|
2984
|
+
});
|
|
2691
2985
|
|
|
2692
2986
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2693
2987
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -2758,6 +3052,9 @@ var BaseField3 = z28.object({
|
|
|
2758
3052
|
),
|
|
2759
3053
|
validations: z28.array(ValidationConfig).optional().describe(
|
|
2760
3054
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
3055
|
+
),
|
|
3056
|
+
allowedLocations: JurisdictionReference.optional().describe(
|
|
3057
|
+
`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.`
|
|
2761
3058
|
)
|
|
2762
3059
|
});
|
|
2763
3060
|
var SearchQueryParams = z28.object({
|
|
@@ -2811,6 +3108,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
2811
3108
|
var AdvancedSearchConfig = z28.object({
|
|
2812
3109
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2813
3110
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3111
|
+
}).meta({
|
|
3112
|
+
id: "AdvancedSearchConfig",
|
|
3113
|
+
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()`)."
|
|
2814
3114
|
});
|
|
2815
3115
|
|
|
2816
3116
|
// ../commons/src/events/utils.ts
|
|
@@ -2861,7 +3161,37 @@ function resolveDataPath(rootData, dataPath, instancePath) {
|
|
|
2861
3161
|
}
|
|
2862
3162
|
return current;
|
|
2863
3163
|
}
|
|
3164
|
+
function todayISO() {
|
|
3165
|
+
return (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" });
|
|
3166
|
+
}
|
|
3167
|
+
var compiledFunctionCache = /* @__PURE__ */ new Map();
|
|
3168
|
+
function compileClientFunction(code) {
|
|
3169
|
+
let fn = compiledFunctionCache.get(code);
|
|
3170
|
+
if (!fn) {
|
|
3171
|
+
fn = new Function(`return (${code})`)();
|
|
3172
|
+
compiledFunctionCache.set(code, fn);
|
|
3173
|
+
}
|
|
3174
|
+
return fn;
|
|
3175
|
+
}
|
|
2864
3176
|
(0, import_ajv_formats.default)(ajv);
|
|
3177
|
+
function buildClientFunctionContext(input) {
|
|
3178
|
+
return {
|
|
3179
|
+
$form: input.form,
|
|
3180
|
+
$now: todayISO(),
|
|
3181
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3182
|
+
$online: isOnline(),
|
|
3183
|
+
$user: input.validatorContext?.user,
|
|
3184
|
+
$event: input.validatorContext?.event,
|
|
3185
|
+
$leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
|
|
3186
|
+
user: input.systemVariables?.user,
|
|
3187
|
+
$window: input.systemVariables?.$window,
|
|
3188
|
+
locations: input.locations,
|
|
3189
|
+
adminLevelIds: input.adminLevelIds
|
|
3190
|
+
};
|
|
3191
|
+
}
|
|
3192
|
+
function runClientFunction(code, data, context) {
|
|
3193
|
+
return compileClientFunction(code)(data, context);
|
|
3194
|
+
}
|
|
2865
3195
|
ajv.addKeyword({
|
|
2866
3196
|
keyword: "daysFromDate",
|
|
2867
3197
|
type: "string",
|
|
@@ -2906,12 +3236,35 @@ ajv.addKeyword({
|
|
|
2906
3236
|
$data: true,
|
|
2907
3237
|
errors: true,
|
|
2908
3238
|
// @ts-ignore -- Force type. We will move this away from AJV next. Parsing the array will take seconds and is only called by core.
|
|
2909
|
-
validate(
|
|
3239
|
+
validate(_schema, data, _2, dataContext) {
|
|
2910
3240
|
const locationIdInput = data;
|
|
2911
3241
|
const locations = dataContext?.rootData.$leafAdminStructureLocationIds ?? [];
|
|
2912
3242
|
return locations.some((location) => location.id === locationIdInput);
|
|
2913
3243
|
}
|
|
2914
3244
|
});
|
|
3245
|
+
ajv.addKeyword({
|
|
3246
|
+
keyword: "customClientValidator",
|
|
3247
|
+
schemaType: "object",
|
|
3248
|
+
errors: true,
|
|
3249
|
+
// @ts-expect-error -- AJV's public types don't expose `rootData`. All
|
|
3250
|
+
// `validate()` callers build root data via `buildClientFunctionContext`,
|
|
3251
|
+
// so the cast holds.
|
|
3252
|
+
validate(schema, data, _2, dataContext) {
|
|
3253
|
+
return Boolean(
|
|
3254
|
+
runClientFunction(
|
|
3255
|
+
schema.code,
|
|
3256
|
+
data,
|
|
3257
|
+
dataContext?.rootData ?? buildClientFunctionContext({ form: {} })
|
|
3258
|
+
)
|
|
3259
|
+
);
|
|
3260
|
+
}
|
|
3261
|
+
});
|
|
3262
|
+
function isOnline() {
|
|
3263
|
+
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
|
3264
|
+
return navigator.onLine;
|
|
3265
|
+
}
|
|
3266
|
+
return true;
|
|
3267
|
+
}
|
|
2915
3268
|
|
|
2916
3269
|
// ../commons/src/utils.ts
|
|
2917
3270
|
var z32 = __toESM(require("zod/v4"));
|
|
@@ -2954,7 +3307,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
2954
3307
|
if (actionConfig.type === ActionType.CUSTOM) {
|
|
2955
3308
|
return actionConfig.form;
|
|
2956
3309
|
}
|
|
2957
|
-
if ("review" in actionConfig) {
|
|
3310
|
+
if ("review" in actionConfig && actionConfig.review != null) {
|
|
2958
3311
|
return actionConfig.review.fields;
|
|
2959
3312
|
}
|
|
2960
3313
|
return [];
|
|
@@ -3530,7 +3883,54 @@ function createFieldConditionals(fieldId) {
|
|
|
3530
3883
|
}
|
|
3531
3884
|
},
|
|
3532
3885
|
required: [fieldId]
|
|
3533
|
-
})
|
|
3886
|
+
}),
|
|
3887
|
+
/**
|
|
3888
|
+
* Custom client-side validator. The provided function is serialised and executed
|
|
3889
|
+
* just-in-time on the client only. External references (e.g. lodash) are not
|
|
3890
|
+
* available inside the function body — all logic must be self-contained.
|
|
3891
|
+
*
|
|
3892
|
+
* @example
|
|
3893
|
+
* field('nid').customClientValidator((value) => {
|
|
3894
|
+
* // LUHN check — all logic must be inline
|
|
3895
|
+
* const digits = String(value).split('').map(Number)
|
|
3896
|
+
* // ...
|
|
3897
|
+
* return isValid
|
|
3898
|
+
* })
|
|
3899
|
+
*/
|
|
3900
|
+
customClientValidator(validationFn) {
|
|
3901
|
+
const code = validationFn.toString();
|
|
3902
|
+
return defineFormConditional({
|
|
3903
|
+
type: "object",
|
|
3904
|
+
properties: wrapToPath(
|
|
3905
|
+
{ [fieldId]: { customClientValidator: { code } } },
|
|
3906
|
+
this.$$subfield
|
|
3907
|
+
),
|
|
3908
|
+
required: [fieldId]
|
|
3909
|
+
});
|
|
3910
|
+
},
|
|
3911
|
+
/**
|
|
3912
|
+
* Custom client-side evaluation. Returns a {@link FieldReference} descriptor
|
|
3913
|
+
* that can be used as the `value` property or a DATA component entry.
|
|
3914
|
+
* The function receives the referenced field's value as the first argument and
|
|
3915
|
+
* the full form context as the second; its return value replaces the field reference.
|
|
3916
|
+
* The function is serialised and executed just-in-time on the client only.
|
|
3917
|
+
* External references (e.g. lodash) are not available inside the function body.
|
|
3918
|
+
*
|
|
3919
|
+
* For computing a default value without referencing a specific field, use
|
|
3920
|
+
* `evaluate(fn)` in the `defaultValue` property instead.
|
|
3921
|
+
*
|
|
3922
|
+
* @example
|
|
3923
|
+
* field('a').customClientEvaluation((aValue, ctx) =>
|
|
3924
|
+
* Number(aValue) + Number(ctx.$form.b)
|
|
3925
|
+
* )
|
|
3926
|
+
*/
|
|
3927
|
+
customClientEvaluation(computationFn) {
|
|
3928
|
+
return {
|
|
3929
|
+
$$code: computationFn.toString(),
|
|
3930
|
+
$$field: fieldId,
|
|
3931
|
+
$$subfield: this.$$subfield
|
|
3932
|
+
};
|
|
3933
|
+
}
|
|
3534
3934
|
};
|
|
3535
3935
|
}
|
|
3536
3936
|
|
|
@@ -3618,7 +4018,7 @@ function validateActionFlags(event2, ctx) {
|
|
|
3618
4018
|
const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
|
|
3619
4019
|
const configuredFlagIds = event2.flags.map((flag) => flag.id);
|
|
3620
4020
|
const actionFlagIds = event2.actions.flatMap(
|
|
3621
|
-
(action) => action.flags.map((flag) => flag.id)
|
|
4021
|
+
(action) => (action.flags ?? []).map((flag) => flag.id)
|
|
3622
4022
|
);
|
|
3623
4023
|
for (const actionFlagId of actionFlagIds) {
|
|
3624
4024
|
const isConfigured = configuredFlagIds.includes(actionFlagId);
|
|
@@ -3703,8 +4103,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
3703
4103
|
validateActionFlags(event2, ctx);
|
|
3704
4104
|
validateActionOrder(event2, ctx);
|
|
3705
4105
|
}).meta({
|
|
3706
|
-
id: "EventConfig"
|
|
3707
|
-
|
|
4106
|
+
id: "EventConfig",
|
|
4107
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
4108
|
+
});
|
|
3708
4109
|
|
|
3709
4110
|
// ../commons/src/events/EventConfigInput.ts
|
|
3710
4111
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -3926,6 +4327,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
3926
4327
|
var WorkqueueColumn = z34.object({
|
|
3927
4328
|
label: TranslationConfig,
|
|
3928
4329
|
value: WorkqueueColumnValue
|
|
4330
|
+
}).meta({
|
|
4331
|
+
id: "WorkqueueColumn",
|
|
4332
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
3929
4333
|
});
|
|
3930
4334
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3931
4335
|
return workqueueColumns.map(
|
|
@@ -4131,8 +4535,8 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4131
4535
|
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4132
4536
|
query: CountryConfigQueryInputType
|
|
4133
4537
|
}).meta({
|
|
4134
|
-
|
|
4135
|
-
|
|
4538
|
+
id: "WorkqueueConfig",
|
|
4539
|
+
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."
|
|
4136
4540
|
});
|
|
4137
4541
|
var WorkqueueCountInput = z37.array(
|
|
4138
4542
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4174,7 +4578,9 @@ var BaseActionInput = z38.object({
|
|
|
4174
4578
|
keepAssignment: z38.boolean().optional(),
|
|
4175
4579
|
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
4176
4580
|
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
4177
|
-
waitFor: z38.boolean().
|
|
4581
|
+
waitFor: z38.boolean().default(true).describe(
|
|
4582
|
+
"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."
|
|
4583
|
+
),
|
|
4178
4584
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4179
4585
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
4180
4586
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4292,7 +4698,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
|
4292
4698
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4293
4699
|
z38.object({
|
|
4294
4700
|
requestId: z38.string(),
|
|
4295
|
-
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4701
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
4702
|
+
content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
|
|
4296
4703
|
}).shape
|
|
4297
4704
|
);
|
|
4298
4705
|
var ReadActionInput = BaseActionInput.extend(
|
|
@@ -4354,7 +4761,7 @@ var Draft = z39.object({
|
|
|
4354
4761
|
}).describe(
|
|
4355
4762
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
4356
4763
|
);
|
|
4357
|
-
var DraftInput = BaseActionInput.extend({
|
|
4764
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
4358
4765
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4359
4766
|
status: z39.enum([
|
|
4360
4767
|
ActionStatus.Requested,
|
|
@@ -4404,12 +4811,53 @@ var updateActions = ActionTypes.extract([
|
|
|
4404
4811
|
ActionType.ARCHIVE,
|
|
4405
4812
|
ActionType.PRINT_CERTIFICATE,
|
|
4406
4813
|
ActionType.REQUEST_CORRECTION,
|
|
4814
|
+
ActionType.APPROVE_CORRECTION,
|
|
4815
|
+
ActionType.REJECT_CORRECTION,
|
|
4407
4816
|
ActionType.CUSTOM
|
|
4408
4817
|
]);
|
|
4409
4818
|
|
|
4410
4819
|
// ../commons/src/events/state/flags.ts
|
|
4411
4820
|
var import_lodash3 = require("lodash");
|
|
4412
4821
|
var import_date_fns3 = require("date-fns");
|
|
4822
|
+
var INHERENT_FLAG_RULES = [
|
|
4823
|
+
{
|
|
4824
|
+
flag: InherentFlags.CORRECTION_REQUESTED,
|
|
4825
|
+
setOn: [ActionType.REQUEST_CORRECTION],
|
|
4826
|
+
resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
|
|
4827
|
+
},
|
|
4828
|
+
{
|
|
4829
|
+
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
4830
|
+
// other status-changing action (see getStatusFromActions).
|
|
4831
|
+
flag: InherentFlags.INCOMPLETE,
|
|
4832
|
+
setOn: [ActionType.NOTIFY],
|
|
4833
|
+
resetOn: [
|
|
4834
|
+
ActionType.CREATE,
|
|
4835
|
+
ActionType.DECLARE,
|
|
4836
|
+
ActionType.REGISTER,
|
|
4837
|
+
ActionType.ARCHIVE
|
|
4838
|
+
]
|
|
4839
|
+
},
|
|
4840
|
+
{
|
|
4841
|
+
flag: InherentFlags.REJECTED,
|
|
4842
|
+
setOn: [ActionType.REJECT],
|
|
4843
|
+
resetOn: [
|
|
4844
|
+
ActionType.NOTIFY,
|
|
4845
|
+
ActionType.DECLARE,
|
|
4846
|
+
ActionType.EDIT,
|
|
4847
|
+
ActionType.REGISTER
|
|
4848
|
+
]
|
|
4849
|
+
},
|
|
4850
|
+
{
|
|
4851
|
+
flag: InherentFlags.POTENTIAL_DUPLICATE,
|
|
4852
|
+
setOn: [ActionType.DUPLICATE_DETECTED],
|
|
4853
|
+
resetOn: [ActionType.MARK_AS_DUPLICATE, ActionType.MARK_AS_NOT_DUPLICATE]
|
|
4854
|
+
},
|
|
4855
|
+
{
|
|
4856
|
+
flag: InherentFlags.EDIT_IN_PROGRESS,
|
|
4857
|
+
setOn: [ActionType.EDIT],
|
|
4858
|
+
resetOnAnyOtherAction: true
|
|
4859
|
+
}
|
|
4860
|
+
];
|
|
4413
4861
|
|
|
4414
4862
|
// ../commons/src/events/defineConfig.ts
|
|
4415
4863
|
var IGNORED_EVENT_TYPES = [
|
|
@@ -5155,6 +5603,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
|
5155
5603
|
id: "signature.upload.modal.title",
|
|
5156
5604
|
defaultMessage: "Draw signature",
|
|
5157
5605
|
description: "Title for the modal to draw signature"
|
|
5606
|
+
},
|
|
5607
|
+
// Zod applies the schema default at parse time, but this fixture bypasses
|
|
5608
|
+
// parsing — GeneratedInputField accesses configuration.maxFileSize directly.
|
|
5609
|
+
configuration: {
|
|
5610
|
+
maxFileSize: 5 * 1024 * 1024
|
|
5158
5611
|
}
|
|
5159
5612
|
}
|
|
5160
5613
|
]
|
|
@@ -5711,6 +6164,20 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5711
6164
|
},
|
|
5712
6165
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
5713
6166
|
},
|
|
6167
|
+
{
|
|
6168
|
+
type: ActionType.NOTIFY,
|
|
6169
|
+
label: {
|
|
6170
|
+
defaultMessage: "Notify health worker",
|
|
6171
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
6172
|
+
id: "event.tennis-club-membership.action.notify.label"
|
|
6173
|
+
},
|
|
6174
|
+
flags: [
|
|
6175
|
+
{
|
|
6176
|
+
id: "health-worker-notified",
|
|
6177
|
+
operation: "add"
|
|
6178
|
+
}
|
|
6179
|
+
]
|
|
6180
|
+
},
|
|
5714
6181
|
{
|
|
5715
6182
|
type: ActionType.REJECT,
|
|
5716
6183
|
label: {
|
|
@@ -5953,6 +6420,17 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
5953
6420
|
}
|
|
5954
6421
|
}
|
|
5955
6422
|
],
|
|
6423
|
+
flags: [
|
|
6424
|
+
{
|
|
6425
|
+
id: "health-worker-notified",
|
|
6426
|
+
requiresAction: false,
|
|
6427
|
+
label: {
|
|
6428
|
+
id: "event.tennis-club-membership.flag.health-worker-notified.label",
|
|
6429
|
+
defaultMessage: "Health worker notified",
|
|
6430
|
+
description: "Label for the health-worker-notified flag"
|
|
6431
|
+
}
|
|
6432
|
+
}
|
|
6433
|
+
],
|
|
5956
6434
|
advancedSearch: [
|
|
5957
6435
|
{
|
|
5958
6436
|
title: {
|
|
@@ -6948,10 +7426,380 @@ var ACTION_FILTERS = {
|
|
|
6948
7426
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
6949
7427
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6950
7428
|
};
|
|
7429
|
+
var REJECTED_ACTIONS = [
|
|
7430
|
+
ActionType.READ,
|
|
7431
|
+
ActionType.NOTIFY,
|
|
7432
|
+
ActionType.CUSTOM,
|
|
7433
|
+
ActionType.EDIT,
|
|
7434
|
+
ActionType.ARCHIVE
|
|
7435
|
+
];
|
|
6951
7436
|
|
|
6952
7437
|
// ../commons/src/events/FileUtils.ts
|
|
6953
7438
|
var import_lodash7 = require("lodash");
|
|
6954
7439
|
|
|
7440
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
7441
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
7442
|
+
{
|
|
7443
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7444
|
+
name: "Central",
|
|
7445
|
+
parentId: null,
|
|
7446
|
+
validUntil: null,
|
|
7447
|
+
externalId: "ydyJb1RAy4U1"
|
|
7448
|
+
},
|
|
7449
|
+
{
|
|
7450
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7451
|
+
name: "Sulaka",
|
|
7452
|
+
parentId: null,
|
|
7453
|
+
validUntil: null,
|
|
7454
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
7455
|
+
},
|
|
7456
|
+
{
|
|
7457
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
7458
|
+
name: "Pualula",
|
|
7459
|
+
parentId: null,
|
|
7460
|
+
validUntil: null,
|
|
7461
|
+
externalId: "Aq91DweLmT8k"
|
|
7462
|
+
},
|
|
7463
|
+
{
|
|
7464
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
7465
|
+
name: "Chuminga",
|
|
7466
|
+
parentId: null,
|
|
7467
|
+
validUntil: null,
|
|
7468
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
7469
|
+
},
|
|
7470
|
+
{
|
|
7471
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7472
|
+
name: "Ibombo",
|
|
7473
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7474
|
+
validUntil: null,
|
|
7475
|
+
externalId: "k7DsP4vbN1Qe"
|
|
7476
|
+
},
|
|
7477
|
+
{
|
|
7478
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7479
|
+
name: "Isango",
|
|
7480
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7481
|
+
validUntil: null,
|
|
7482
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
7483
|
+
},
|
|
7484
|
+
{
|
|
7485
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7486
|
+
name: "Isamba",
|
|
7487
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7488
|
+
validUntil: null,
|
|
7489
|
+
externalId: "sT0xVu1KqJ7r"
|
|
7490
|
+
},
|
|
7491
|
+
{
|
|
7492
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7493
|
+
name: "Itambo",
|
|
7494
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7495
|
+
validUntil: null,
|
|
7496
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
7497
|
+
},
|
|
7498
|
+
{
|
|
7499
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
7500
|
+
name: "Ezhi",
|
|
7501
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7502
|
+
validUntil: null,
|
|
7503
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
7504
|
+
},
|
|
7505
|
+
{
|
|
7506
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7507
|
+
name: "Ilanga",
|
|
7508
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7509
|
+
validUntil: null,
|
|
7510
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
7511
|
+
},
|
|
7512
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
7513
|
+
{
|
|
7514
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7515
|
+
name: "Klow",
|
|
7516
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7517
|
+
validUntil: null,
|
|
7518
|
+
externalId: "IkYcYBUcyY2"
|
|
7519
|
+
},
|
|
7520
|
+
{
|
|
7521
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
7522
|
+
name: "Mbondo",
|
|
7523
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7524
|
+
validUntil: null,
|
|
7525
|
+
externalId: "Qhvv5hvo3mY"
|
|
7526
|
+
},
|
|
7527
|
+
{
|
|
7528
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
7529
|
+
name: "Ndara",
|
|
7530
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7531
|
+
validUntil: null,
|
|
7532
|
+
externalId: "crXh068O9TR"
|
|
7533
|
+
},
|
|
7534
|
+
{
|
|
7535
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
7536
|
+
name: "Olani",
|
|
7537
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7538
|
+
validUntil: null,
|
|
7539
|
+
externalId: "r00It8Tvvp7"
|
|
7540
|
+
},
|
|
7541
|
+
{
|
|
7542
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
7543
|
+
name: "Pemba",
|
|
7544
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7545
|
+
validUntil: null,
|
|
7546
|
+
externalId: "ZnUWsbONIaH"
|
|
7547
|
+
},
|
|
7548
|
+
{
|
|
7549
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
7550
|
+
name: "Quanza",
|
|
7551
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7552
|
+
validUntil: null,
|
|
7553
|
+
externalId: "fDZycvQTa7l"
|
|
7554
|
+
},
|
|
7555
|
+
{
|
|
7556
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
7557
|
+
name: "Rivka",
|
|
7558
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7559
|
+
validUntil: null,
|
|
7560
|
+
externalId: "KqswxCGTELa"
|
|
7561
|
+
},
|
|
7562
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
7563
|
+
{
|
|
7564
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
7565
|
+
name: "Mbula",
|
|
7566
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7567
|
+
validUntil: null,
|
|
7568
|
+
externalId: "osEbKjRc9Kg"
|
|
7569
|
+
},
|
|
7570
|
+
{
|
|
7571
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
7572
|
+
name: "Ndoki",
|
|
7573
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7574
|
+
validUntil: null,
|
|
7575
|
+
externalId: "aq4daBUAGr3"
|
|
7576
|
+
},
|
|
7577
|
+
{
|
|
7578
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
7579
|
+
name: "Tsanga",
|
|
7580
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7581
|
+
validUntil: null,
|
|
7582
|
+
externalId: "cqis6Y8trbJ"
|
|
7583
|
+
},
|
|
7584
|
+
{
|
|
7585
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
7586
|
+
name: "Waziri",
|
|
7587
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7588
|
+
validUntil: null,
|
|
7589
|
+
externalId: "LMijHPyyx6d"
|
|
7590
|
+
},
|
|
7591
|
+
{
|
|
7592
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
7593
|
+
name: "Zimbi",
|
|
7594
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7595
|
+
validUntil: null,
|
|
7596
|
+
externalId: "pcQYbPuKGZ7"
|
|
7597
|
+
},
|
|
7598
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
7599
|
+
{
|
|
7600
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
7601
|
+
name: "Felani",
|
|
7602
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7603
|
+
validUntil: null,
|
|
7604
|
+
externalId: "gSqpoCGdMXp"
|
|
7605
|
+
},
|
|
7606
|
+
{
|
|
7607
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
7608
|
+
name: "Goroma",
|
|
7609
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7610
|
+
validUntil: null,
|
|
7611
|
+
externalId: "KvAAIaNqVrp"
|
|
7612
|
+
},
|
|
7613
|
+
{
|
|
7614
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
7615
|
+
name: "Halifu",
|
|
7616
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7617
|
+
validUntil: null,
|
|
7618
|
+
externalId: "qe4UnEVt1hv"
|
|
7619
|
+
},
|
|
7620
|
+
{
|
|
7621
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
7622
|
+
name: "Jabari",
|
|
7623
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7624
|
+
validUntil: null,
|
|
7625
|
+
externalId: "yHH9Nz4rLOt"
|
|
7626
|
+
},
|
|
7627
|
+
{
|
|
7628
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
7629
|
+
name: "Kifani",
|
|
7630
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7631
|
+
validUntil: null,
|
|
7632
|
+
externalId: "eSWmXIGeu1I"
|
|
7633
|
+
},
|
|
7634
|
+
{
|
|
7635
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
7636
|
+
name: "Lumela",
|
|
7637
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7638
|
+
validUntil: null,
|
|
7639
|
+
externalId: "bh0b3aI1uP3"
|
|
7640
|
+
}
|
|
7641
|
+
];
|
|
7642
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
7643
|
+
{
|
|
7644
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
7645
|
+
name: "Central Provincial Office",
|
|
7646
|
+
locationType: "CRVS_OFFICE",
|
|
7647
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7648
|
+
validUntil: null,
|
|
7649
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
7650
|
+
},
|
|
7651
|
+
{
|
|
7652
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
7653
|
+
name: "Central Health Post",
|
|
7654
|
+
locationType: "HEALTH_FACILITY",
|
|
7655
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7656
|
+
validUntil: null
|
|
7657
|
+
},
|
|
7658
|
+
{
|
|
7659
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
7660
|
+
name: "Ibombo District Office",
|
|
7661
|
+
locationType: "CRVS_OFFICE",
|
|
7662
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7663
|
+
validUntil: null,
|
|
7664
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
7665
|
+
},
|
|
7666
|
+
{
|
|
7667
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
7668
|
+
name: "Isamba District Office",
|
|
7669
|
+
locationType: "CRVS_OFFICE",
|
|
7670
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7671
|
+
validUntil: null,
|
|
7672
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
7673
|
+
},
|
|
7674
|
+
{
|
|
7675
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
7676
|
+
name: "Isango District Office",
|
|
7677
|
+
locationType: "CRVS_OFFICE",
|
|
7678
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7679
|
+
validUntil: null,
|
|
7680
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
7681
|
+
},
|
|
7682
|
+
{
|
|
7683
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
7684
|
+
name: "Sulaka Provincial Office",
|
|
7685
|
+
locationType: "CRVS_OFFICE",
|
|
7686
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7687
|
+
validUntil: null,
|
|
7688
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
7689
|
+
},
|
|
7690
|
+
{
|
|
7691
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
7692
|
+
name: "Ilanga District Office",
|
|
7693
|
+
locationType: "CRVS_OFFICE",
|
|
7694
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7695
|
+
validUntil: null,
|
|
7696
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
7697
|
+
},
|
|
7698
|
+
{
|
|
7699
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
7700
|
+
name: "Chamakubi Health Post",
|
|
7701
|
+
locationType: "HEALTH_FACILITY",
|
|
7702
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7703
|
+
validUntil: null,
|
|
7704
|
+
externalId: "M1nFr8LbC2Qy"
|
|
7705
|
+
},
|
|
7706
|
+
{
|
|
7707
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
7708
|
+
name: "Ibombo Rural Health Centre",
|
|
7709
|
+
locationType: "HEALTH_FACILITY",
|
|
7710
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7711
|
+
validUntil: null,
|
|
7712
|
+
externalId: "bT7pV6YrW0Xc"
|
|
7713
|
+
},
|
|
7714
|
+
{
|
|
7715
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
7716
|
+
name: "Chikobo Rural Health Centre",
|
|
7717
|
+
locationType: "HEALTH_FACILITY",
|
|
7718
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7719
|
+
validUntil: null,
|
|
7720
|
+
externalId: "zE4qPn2SgJ5d"
|
|
7721
|
+
},
|
|
7722
|
+
{
|
|
7723
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
7724
|
+
name: "Chilochabalenje Health Post",
|
|
7725
|
+
locationType: "HEALTH_FACILITY",
|
|
7726
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7727
|
+
validUntil: null,
|
|
7728
|
+
externalId: "H8vDs1MqR4Uf"
|
|
7729
|
+
},
|
|
7730
|
+
{
|
|
7731
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
7732
|
+
name: "Chipeso Rural Health Centre",
|
|
7733
|
+
locationType: "HEALTH_FACILITY",
|
|
7734
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7735
|
+
validUntil: null,
|
|
7736
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
7737
|
+
},
|
|
7738
|
+
{
|
|
7739
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
7740
|
+
name: "Chisamba Rural Health Centre",
|
|
7741
|
+
locationType: "HEALTH_FACILITY",
|
|
7742
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7743
|
+
validUntil: null,
|
|
7744
|
+
externalId: "Yr0pCg8LdM2s"
|
|
7745
|
+
},
|
|
7746
|
+
{
|
|
7747
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
7748
|
+
name: "Chitanda Rural Health Centre",
|
|
7749
|
+
locationType: "HEALTH_FACILITY",
|
|
7750
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7751
|
+
validUntil: null,
|
|
7752
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
7753
|
+
},
|
|
7754
|
+
{
|
|
7755
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
7756
|
+
name: "Golden Valley Rural Health Centre",
|
|
7757
|
+
locationType: "HEALTH_FACILITY",
|
|
7758
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7759
|
+
validUntil: null,
|
|
7760
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
7761
|
+
},
|
|
7762
|
+
{
|
|
7763
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
7764
|
+
name: "Ipongo Rural Health Centre",
|
|
7765
|
+
locationType: "HEALTH_FACILITY",
|
|
7766
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7767
|
+
validUntil: null,
|
|
7768
|
+
externalId: "kF2sW9DmH0Bt"
|
|
7769
|
+
},
|
|
7770
|
+
{
|
|
7771
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
7772
|
+
name: "Itumbwe Health Post",
|
|
7773
|
+
locationType: "HEALTH_FACILITY",
|
|
7774
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7775
|
+
validUntil: null,
|
|
7776
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
7777
|
+
},
|
|
7778
|
+
{
|
|
7779
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
7780
|
+
name: "Kabangalala Rural Health Centre",
|
|
7781
|
+
locationType: "HEALTH_FACILITY",
|
|
7782
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7783
|
+
validUntil: null,
|
|
7784
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
7785
|
+
},
|
|
7786
|
+
// Village offices
|
|
7787
|
+
{
|
|
7788
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
7789
|
+
name: "Klow Village Office",
|
|
7790
|
+
locationType: "CRVS_OFFICE",
|
|
7791
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7792
|
+
validUntil: null,
|
|
7793
|
+
externalId: "PmAyxAJkxiJ"
|
|
7794
|
+
}
|
|
7795
|
+
];
|
|
7796
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
7797
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
7798
|
+
);
|
|
7799
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
7800
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7801
|
+
);
|
|
7802
|
+
|
|
6955
7803
|
// ../commons/src/notification/UserNotifications.ts
|
|
6956
7804
|
var z44 = __toESM(require("zod/v4"));
|
|
6957
7805
|
var TriggerEvent = {
|