@opencrvs/toolkit 2.0.0-rc.d2411da → 2.0.0-rc.d244255
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/create-countryconfig/index.js +50 -20
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +271 -119
- package/dist/cli.js +401 -131
- package/dist/commons/api/router.d.ts +3357 -217
- package/dist/commons/application-config/index.d.ts +1 -0
- package/dist/commons/conditionals/conditionals.d.ts +354 -4
- package/dist/commons/conditionals/validate.d.ts +52 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +114 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +342 -0
- package/dist/commons/events/Draft.d.ts +4 -2
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/EventIndex.d.ts +0 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/FieldConfig.d.ts +378 -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 +150 -150
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +12 -289
- package/dist/commons/events/utils.d.ts +13 -2
- package/dist/conditionals/index.js +55 -2
- package/dist/events/index.js +1037 -280
- 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 -2
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +9 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +66 -20
- 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 +5 -3
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +399 -129
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +11 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +17 -16
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +54 -30
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +140 -59
- package/dist/notification/index.js +864 -154
- package/dist/scopes/index.d.ts +4 -6
- package/dist/scopes/index.js +12 -4
- package/opencrvs-toolkit-2.0.0-rc.d244255.tgz +0 -0
- package/package.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.d2411da.tgz +0 -0
|
@@ -293,7 +293,9 @@ var ScopeType = z2.enum([
|
|
|
293
293
|
var EncodedScope = z2.string().brand("EncodedScope");
|
|
294
294
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
295
295
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
296
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
296
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
297
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
298
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
297
299
|
};
|
|
298
300
|
|
|
299
301
|
// ../commons/src/authentication.ts
|
|
@@ -652,7 +654,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
652
654
|
ShowConditional,
|
|
653
655
|
// Action can be shown to the user in the list but as disabled
|
|
654
656
|
EnableConditional
|
|
655
|
-
])
|
|
657
|
+
]).meta({
|
|
658
|
+
id: "ActionConditional",
|
|
659
|
+
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
|
+
});
|
|
656
661
|
var DisplayOnReviewConditional = z7.object({
|
|
657
662
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
658
663
|
conditional: Conditional
|
|
@@ -667,8 +672,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
667
672
|
// Field output can be shown / hidden on the review page
|
|
668
673
|
DisplayOnReviewConditional
|
|
669
674
|
]).meta({
|
|
670
|
-
|
|
671
|
-
|
|
675
|
+
id: "FieldConditional",
|
|
676
|
+
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
677
|
});
|
|
673
678
|
|
|
674
679
|
// ../commons/src/events/FieldType.ts
|
|
@@ -765,6 +770,11 @@ var FieldTypesToHideInReview = [
|
|
|
765
770
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
766
771
|
FieldType.ALPHA_HIDDEN
|
|
767
772
|
];
|
|
773
|
+
var HiddenFieldTypes = [
|
|
774
|
+
FieldType.HTTP,
|
|
775
|
+
FieldType.QUERY_PARAM_READER,
|
|
776
|
+
FieldType.ALPHA_HIDDEN
|
|
777
|
+
];
|
|
768
778
|
|
|
769
779
|
// ../commons/src/events/FieldValue.ts
|
|
770
780
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -883,7 +893,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
883
893
|
// ../commons/src/events/FieldValue.ts
|
|
884
894
|
var TextValue = z12.string();
|
|
885
895
|
var HiddenFieldValue = z12.string();
|
|
886
|
-
var NonEmptyTextValue =
|
|
896
|
+
var NonEmptyTextValue = z12.string().trim().min(1);
|
|
887
897
|
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
888
898
|
var AgeValue = z12.object({
|
|
889
899
|
age: z12.number(),
|
|
@@ -912,6 +922,7 @@ var DateRangeFieldValue = z12.object({
|
|
|
912
922
|
var EmailValue = z12.email();
|
|
913
923
|
var CheckboxFieldValue = z12.boolean();
|
|
914
924
|
var NumberFieldValue = z12.number();
|
|
925
|
+
var SignatureFieldValue = FileFieldValue;
|
|
915
926
|
var ButtonFieldValue = z12.number();
|
|
916
927
|
var VerificationStatusValue = z12.enum([
|
|
917
928
|
"verified",
|
|
@@ -980,28 +991,20 @@ function schemaPriority(schema) {
|
|
|
980
991
|
return idx === -1 ? 9999 : idx;
|
|
981
992
|
}
|
|
982
993
|
function safeUnion(schemas) {
|
|
994
|
+
const sortedSchemas = [...schemas].sort(
|
|
995
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
996
|
+
);
|
|
983
997
|
return z12.any().superRefine((val, ctx) => {
|
|
984
|
-
const
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
if (successful.length === 0) {
|
|
989
|
-
ctx.addIssue({
|
|
990
|
-
code: "invalid_type",
|
|
991
|
-
expected: "custom",
|
|
992
|
-
message: "Value does not match any schema"
|
|
993
|
-
});
|
|
994
|
-
return;
|
|
995
|
-
}
|
|
996
|
-
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
997
|
-
const best = successful[0];
|
|
998
|
-
if (!best.safeParse(val).success) {
|
|
999
|
-
ctx.addIssue({
|
|
1000
|
-
expected: "custom",
|
|
1001
|
-
code: "invalid_type",
|
|
1002
|
-
message: "Value did not match the best schema"
|
|
1003
|
-
});
|
|
998
|
+
for (const schema of sortedSchemas) {
|
|
999
|
+
if (schema.safeParse(val).success) {
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1004
1002
|
}
|
|
1003
|
+
ctx.addIssue({
|
|
1004
|
+
code: "invalid_type",
|
|
1005
|
+
expected: "custom",
|
|
1006
|
+
message: "Value does not match any schema"
|
|
1007
|
+
});
|
|
1005
1008
|
}).meta({
|
|
1006
1009
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
1007
1010
|
});
|
|
@@ -1218,8 +1221,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
1218
1221
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1219
1222
|
z14.object({
|
|
1220
1223
|
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1221
|
-
requestId: z14.string()
|
|
1224
|
+
requestId: z14.string(),
|
|
1222
1225
|
// TODO move into 'content' property
|
|
1226
|
+
content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
|
|
1223
1227
|
}).shape
|
|
1224
1228
|
);
|
|
1225
1229
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1311,6 +1315,9 @@ var FlagConfig = z15.object({
|
|
|
1311
1315
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1312
1316
|
),
|
|
1313
1317
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1318
|
+
}).meta({
|
|
1319
|
+
id: "FlagConfig",
|
|
1320
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1314
1321
|
});
|
|
1315
1322
|
var ActionFlagConfig = z15.object({
|
|
1316
1323
|
id: Flag,
|
|
@@ -1318,6 +1325,9 @@ var ActionFlagConfig = z15.object({
|
|
|
1318
1325
|
conditional: Conditional.optional().describe(
|
|
1319
1326
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1320
1327
|
)
|
|
1328
|
+
}).meta({
|
|
1329
|
+
id: "ActionFlagConfig",
|
|
1330
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1321
1331
|
});
|
|
1322
1332
|
|
|
1323
1333
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1339,8 +1349,7 @@ var ActionCreationMetadata = z16.object({
|
|
|
1339
1349
|
),
|
|
1340
1350
|
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1341
1351
|
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1342
|
-
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1343
|
-
createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
|
|
1352
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1344
1353
|
});
|
|
1345
1354
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1346
1355
|
registrationNumber: z16.string().describe(
|
|
@@ -1368,9 +1377,6 @@ var EventMetadata = z16.object({
|
|
|
1368
1377
|
createdAtLocation: UUID.nullish().describe(
|
|
1369
1378
|
"Location of the user who created the event."
|
|
1370
1379
|
),
|
|
1371
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1372
|
-
"Signature of the user who created the event."
|
|
1373
|
-
),
|
|
1374
1380
|
updatedAtLocation: UUID.nullish().describe(
|
|
1375
1381
|
"Location of the user who last changed the status."
|
|
1376
1382
|
),
|
|
@@ -1663,14 +1669,31 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1663
1669
|
}
|
|
1664
1670
|
}).describe("Unique identifier for the field");
|
|
1665
1671
|
var FieldReference = import_v43.default.object({
|
|
1666
|
-
$$field: FieldId,
|
|
1672
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1667
1673
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1668
1674
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1675
|
+
),
|
|
1676
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1677
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1678
|
+
)
|
|
1679
|
+
}).describe(
|
|
1680
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1681
|
+
);
|
|
1682
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1683
|
+
$$code: import_v43.default.string().describe(
|
|
1684
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1669
1685
|
)
|
|
1670
|
-
}).describe("
|
|
1686
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1671
1687
|
var ValidationConfig = import_v43.default.object({
|
|
1672
|
-
validator: Conditional
|
|
1673
|
-
|
|
1688
|
+
validator: Conditional.describe(
|
|
1689
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1690
|
+
),
|
|
1691
|
+
message: TranslationConfig.describe(
|
|
1692
|
+
"Error message displayed when the validator does not hold."
|
|
1693
|
+
)
|
|
1694
|
+
}).meta({
|
|
1695
|
+
id: "ValidationConfig",
|
|
1696
|
+
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."
|
|
1674
1697
|
});
|
|
1675
1698
|
var requiredSchema = import_v43.default.union([
|
|
1676
1699
|
import_v43.default.boolean(),
|
|
@@ -1701,7 +1724,7 @@ var BaseField = import_v43.default.object({
|
|
|
1701
1724
|
"Indicates whether the field can be modified during record correction."
|
|
1702
1725
|
),
|
|
1703
1726
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1704
|
-
"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."
|
|
1727
|
+
"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."
|
|
1705
1728
|
),
|
|
1706
1729
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1707
1730
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1709,30 +1732,40 @@ var BaseField = import_v43.default.object({
|
|
|
1709
1732
|
}).describe("Common properties shared across all field types.");
|
|
1710
1733
|
var Divider = BaseField.extend({
|
|
1711
1734
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1735
|
+
}).meta({
|
|
1736
|
+
description: "A horizontal line divider",
|
|
1737
|
+
id: "Divider"
|
|
1712
1738
|
});
|
|
1713
1739
|
var TextField = BaseField.extend({
|
|
1714
1740
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1715
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1741
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1716
1742
|
configuration: import_v43.default.object({
|
|
1717
1743
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1718
1744
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
1719
1745
|
prefix: TranslationConfig.optional(),
|
|
1720
1746
|
postfix: TranslationConfig.optional()
|
|
1721
1747
|
}).default({ type: "text" }).optional()
|
|
1722
|
-
}).
|
|
1748
|
+
}).meta({
|
|
1749
|
+
description: "A text input field",
|
|
1750
|
+
id: "TextField"
|
|
1751
|
+
});
|
|
1723
1752
|
var NumberField = BaseField.extend({
|
|
1724
1753
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1725
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1754
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1726
1755
|
configuration: import_v43.default.object({
|
|
1727
1756
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1728
1757
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1758
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1729
1759
|
prefix: TranslationConfig.optional(),
|
|
1730
1760
|
postfix: TranslationConfig.optional()
|
|
1731
1761
|
}).optional()
|
|
1732
|
-
}).
|
|
1762
|
+
}).meta({
|
|
1763
|
+
description: "A number input field",
|
|
1764
|
+
id: "NumberField"
|
|
1765
|
+
});
|
|
1733
1766
|
var TextAreaField = BaseField.extend({
|
|
1734
1767
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1735
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1768
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1736
1769
|
configuration: import_v43.default.object({
|
|
1737
1770
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1738
1771
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1740,7 +1773,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1740
1773
|
prefix: TranslationConfig.optional(),
|
|
1741
1774
|
postfix: TranslationConfig.optional()
|
|
1742
1775
|
}).default({ rows: 4 }).optional()
|
|
1743
|
-
}).
|
|
1776
|
+
}).meta({
|
|
1777
|
+
description: "A multiline text input",
|
|
1778
|
+
id: "TextAreaField"
|
|
1779
|
+
});
|
|
1744
1780
|
var ImageMimeType = import_v43.default.enum([
|
|
1745
1781
|
"image/png",
|
|
1746
1782
|
"image/jpg",
|
|
@@ -1763,58 +1799,76 @@ var SignatureField = BaseField.extend({
|
|
|
1763
1799
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1764
1800
|
"Title of the signature modal"
|
|
1765
1801
|
),
|
|
1766
|
-
defaultValue:
|
|
1802
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1767
1803
|
configuration: import_v43.default.object({
|
|
1768
1804
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1769
1805
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1770
1806
|
}).default({
|
|
1771
1807
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1772
1808
|
})
|
|
1773
|
-
}).
|
|
1809
|
+
}).meta({
|
|
1810
|
+
description: "A signature input field",
|
|
1811
|
+
id: "SignatureField"
|
|
1812
|
+
});
|
|
1774
1813
|
var EmailField = BaseField.extend({
|
|
1775
1814
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1776
1815
|
configuration: import_v43.default.object({
|
|
1777
1816
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1778
1817
|
}).default({ maxLength: 255 }).optional(),
|
|
1779
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1818
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1819
|
+
}).meta({
|
|
1820
|
+
description: "An email input field",
|
|
1821
|
+
id: "EmailField"
|
|
1780
1822
|
});
|
|
1781
1823
|
var DateField = BaseField.extend({
|
|
1782
1824
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1783
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1825
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1784
1826
|
configuration: import_v43.default.object({
|
|
1785
1827
|
notice: TranslationConfig.describe(
|
|
1786
1828
|
"Text to display above the date input"
|
|
1787
1829
|
).optional()
|
|
1788
1830
|
}).optional()
|
|
1789
|
-
}).
|
|
1831
|
+
}).meta({
|
|
1832
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1833
|
+
id: "DateField"
|
|
1834
|
+
});
|
|
1790
1835
|
var AgeField = BaseField.extend({
|
|
1791
1836
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1792
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1837
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1793
1838
|
configuration: import_v43.default.object({
|
|
1794
1839
|
asOfDate: FieldReference,
|
|
1795
1840
|
prefix: TranslationConfig.optional(),
|
|
1796
1841
|
postfix: TranslationConfig.optional()
|
|
1797
1842
|
})
|
|
1798
|
-
}).
|
|
1843
|
+
}).meta({
|
|
1844
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1845
|
+
id: "AgeField"
|
|
1846
|
+
});
|
|
1799
1847
|
var TimeField = BaseField.extend({
|
|
1800
1848
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1801
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1849
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1802
1850
|
configuration: import_v43.default.object({
|
|
1803
1851
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1804
1852
|
notice: TranslationConfig.describe(
|
|
1805
1853
|
"Text to display above the time input"
|
|
1806
1854
|
).optional()
|
|
1807
1855
|
}).optional()
|
|
1808
|
-
}).
|
|
1856
|
+
}).meta({
|
|
1857
|
+
description: "A single time input (HH-mm)",
|
|
1858
|
+
id: "TimeField"
|
|
1859
|
+
});
|
|
1809
1860
|
var DateRangeField = BaseField.extend({
|
|
1810
1861
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1811
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1862
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1812
1863
|
configuration: import_v43.default.object({
|
|
1813
1864
|
notice: TranslationConfig.describe(
|
|
1814
1865
|
"Text to display above the date input"
|
|
1815
1866
|
).optional()
|
|
1816
1867
|
}).optional()
|
|
1817
|
-
}).
|
|
1868
|
+
}).meta({
|
|
1869
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1870
|
+
id: "DateRangeField"
|
|
1871
|
+
});
|
|
1818
1872
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1819
1873
|
"reg12",
|
|
1820
1874
|
"reg14",
|
|
@@ -1858,21 +1912,33 @@ var ImageViewField = BaseField.extend({
|
|
|
1858
1912
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1859
1913
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1860
1914
|
configuration: ImageConfiguration
|
|
1861
|
-
}).
|
|
1915
|
+
}).meta({
|
|
1916
|
+
description: "A read-only image component for form pages",
|
|
1917
|
+
id: "ImageViewField"
|
|
1918
|
+
});
|
|
1862
1919
|
var Paragraph = BaseField.extend({
|
|
1863
1920
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1864
1921
|
configuration: ParagraphConfiguration
|
|
1865
|
-
}).
|
|
1922
|
+
}).meta({
|
|
1923
|
+
description: "A read-only HTML <p> paragraph",
|
|
1924
|
+
id: "Paragraph"
|
|
1925
|
+
});
|
|
1866
1926
|
var Heading = BaseField.extend({
|
|
1867
1927
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1868
1928
|
configuration: HeadingConfiguration
|
|
1869
|
-
}).
|
|
1929
|
+
}).meta({
|
|
1930
|
+
description: "A read-only heading component for form pages",
|
|
1931
|
+
id: "Heading"
|
|
1932
|
+
});
|
|
1870
1933
|
var PageHeader = BaseField.extend({
|
|
1871
1934
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1872
|
-
}).
|
|
1935
|
+
}).meta({
|
|
1936
|
+
description: "A read-only header component for form pages",
|
|
1937
|
+
id: "PageHeader"
|
|
1938
|
+
});
|
|
1873
1939
|
var File = BaseField.extend({
|
|
1874
1940
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1875
|
-
defaultValue: FileFieldValue.optional(),
|
|
1941
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1876
1942
|
configuration: import_v43.default.object({
|
|
1877
1943
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1878
1944
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1888,7 +1954,10 @@ var File = BaseField.extend({
|
|
|
1888
1954
|
}).default({
|
|
1889
1955
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1890
1956
|
})
|
|
1891
|
-
}).
|
|
1957
|
+
}).meta({
|
|
1958
|
+
description: "A file upload field",
|
|
1959
|
+
id: "File"
|
|
1960
|
+
});
|
|
1892
1961
|
var SelectOption = import_v43.default.object({
|
|
1893
1962
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1894
1963
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1896,7 +1965,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1896
1965
|
});
|
|
1897
1966
|
var NumberWithUnitField = BaseField.extend({
|
|
1898
1967
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1899
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1968
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1900
1969
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1901
1970
|
configuration: import_v43.default.object({
|
|
1902
1971
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1905,17 +1974,23 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1905
1974
|
"Placeholder for the number field"
|
|
1906
1975
|
)
|
|
1907
1976
|
}).optional()
|
|
1908
|
-
}).
|
|
1977
|
+
}).meta({
|
|
1978
|
+
description: "A number with unit input field",
|
|
1979
|
+
id: "NumberWithUnitField"
|
|
1980
|
+
});
|
|
1909
1981
|
var RadioGroup = BaseField.extend({
|
|
1910
1982
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1911
|
-
defaultValue: TextValue.optional(),
|
|
1983
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1912
1984
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1913
1985
|
configuration: import_v43.default.object({
|
|
1914
1986
|
styles: import_v43.default.object({
|
|
1915
1987
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1916
1988
|
}).optional()
|
|
1917
1989
|
}).optional()
|
|
1918
|
-
}).
|
|
1990
|
+
}).meta({
|
|
1991
|
+
description: "A grouped radio button field",
|
|
1992
|
+
id: "RadioGroup"
|
|
1993
|
+
});
|
|
1919
1994
|
var BulletList = BaseField.extend({
|
|
1920
1995
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1921
1996
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1924,10 +1999,13 @@ var BulletList = BaseField.extend({
|
|
|
1924
1999
|
fontVariant: HtmlFontVariant.optional()
|
|
1925
2000
|
}).optional()
|
|
1926
2001
|
}).default({})
|
|
1927
|
-
}).
|
|
2002
|
+
}).meta({
|
|
2003
|
+
description: "A list of bullet points",
|
|
2004
|
+
id: "BulletList"
|
|
2005
|
+
});
|
|
1928
2006
|
var Select = BaseField.extend({
|
|
1929
2007
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1930
|
-
defaultValue: TextValue.optional(),
|
|
2008
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1931
2009
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1932
2010
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1933
2011
|
`
|
|
@@ -1939,16 +2017,22 @@ var Select = BaseField.extend({
|
|
|
1939
2017
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1940
2018
|
`
|
|
1941
2019
|
)
|
|
1942
|
-
}).
|
|
2020
|
+
}).meta({
|
|
2021
|
+
description: "A select input field",
|
|
2022
|
+
id: "Select"
|
|
2023
|
+
});
|
|
1943
2024
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1944
2025
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1945
2026
|
label: TranslationConfig.describe("The label of the option")
|
|
1946
2027
|
});
|
|
1947
2028
|
var SelectDateRangeField = BaseField.extend({
|
|
1948
2029
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1949
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
2030
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1950
2031
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1951
|
-
}).
|
|
2032
|
+
}).meta({
|
|
2033
|
+
description: "A date range selection field",
|
|
2034
|
+
id: "SelectDateRangeField"
|
|
2035
|
+
});
|
|
1952
2036
|
var NameConfig = import_v43.default.object({
|
|
1953
2037
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1954
2038
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1960,7 +2044,7 @@ var NameField = BaseField.extend({
|
|
|
1960
2044
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1961
2045
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1962
2046
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1963
|
-
}).optional(),
|
|
2047
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1964
2048
|
configuration: import_v43.default.object({
|
|
1965
2049
|
name: NameConfig.default({
|
|
1966
2050
|
firstname: { required: true },
|
|
@@ -1979,26 +2063,41 @@ var NameField = BaseField.extend({
|
|
|
1979
2063
|
surname: { required: true }
|
|
1980
2064
|
}
|
|
1981
2065
|
}).optional()
|
|
1982
|
-
}).
|
|
2066
|
+
}).meta({
|
|
2067
|
+
description: "A field for entering a persons name",
|
|
2068
|
+
id: "NameField"
|
|
2069
|
+
});
|
|
1983
2070
|
var PhoneField = BaseField.extend({
|
|
1984
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2071
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1985
2072
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1986
|
-
}).
|
|
2073
|
+
}).meta({
|
|
2074
|
+
description: "A field for entering a phone number",
|
|
2075
|
+
id: "PhoneField"
|
|
2076
|
+
});
|
|
1987
2077
|
var IdField = BaseField.extend({
|
|
1988
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2078
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1989
2079
|
type: import_v43.default.literal(FieldType.ID)
|
|
1990
|
-
}).
|
|
2080
|
+
}).meta({
|
|
2081
|
+
description: "A field for entering an ID",
|
|
2082
|
+
id: "IdField"
|
|
2083
|
+
});
|
|
1991
2084
|
var Checkbox = BaseField.extend({
|
|
1992
2085
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1993
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1994
|
-
}).
|
|
2086
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
2087
|
+
}).meta({
|
|
2088
|
+
description: "A boolean checkbox field",
|
|
2089
|
+
id: "Checkbox"
|
|
2090
|
+
});
|
|
1995
2091
|
var Country = BaseField.extend({
|
|
1996
2092
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1997
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2093
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1998
2094
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1999
2095
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2000
2096
|
)
|
|
2001
|
-
}).
|
|
2097
|
+
}).meta({
|
|
2098
|
+
description: "A field for selecting a country",
|
|
2099
|
+
id: "Country"
|
|
2100
|
+
});
|
|
2002
2101
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
2003
2102
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
2004
2103
|
);
|
|
@@ -2007,28 +2106,33 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2007
2106
|
"HEALTH_FACILITY",
|
|
2008
2107
|
"CRVS_OFFICE"
|
|
2009
2108
|
]);
|
|
2010
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
2011
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
2012
|
-
type: AdministrativeAreas,
|
|
2013
|
-
allowedLocations: AllowedLocations
|
|
2014
|
-
}).describe("Administrative area options");
|
|
2015
2109
|
var AdministrativeAreaField = BaseField.extend({
|
|
2016
2110
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2017
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2018
|
-
configuration:
|
|
2019
|
-
|
|
2111
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2112
|
+
configuration: import_v43.default.object({
|
|
2113
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
2114
|
+
type: AdministrativeAreas,
|
|
2115
|
+
allowedLocations: AllowedLocations
|
|
2116
|
+
}).describe("Administrative area options")
|
|
2117
|
+
}).meta({
|
|
2118
|
+
description: "Administrative area input field",
|
|
2119
|
+
id: "AdministrativeAreaField"
|
|
2120
|
+
});
|
|
2020
2121
|
var LocationInput = BaseField.extend({
|
|
2021
2122
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2022
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2123
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2023
2124
|
configuration: import_v43.default.object({
|
|
2024
2125
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2025
2126
|
allowedLocations: AllowedLocations
|
|
2026
2127
|
}).optional()
|
|
2027
|
-
}).
|
|
2128
|
+
}).meta({
|
|
2129
|
+
description: "A field for selecting a location",
|
|
2130
|
+
id: "LocationInput"
|
|
2131
|
+
});
|
|
2028
2132
|
var FileUploadWithOptions = BaseField.extend({
|
|
2029
2133
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2030
2134
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
2031
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
2135
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
2032
2136
|
configuration: import_v43.default.object({
|
|
2033
2137
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2034
2138
|
maxImageSize: import_v43.default.object({
|
|
@@ -2038,15 +2142,18 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2038
2142
|
}).default({
|
|
2039
2143
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2040
2144
|
})
|
|
2145
|
+
}).meta({
|
|
2146
|
+
description: "A field for uploading files with file type options",
|
|
2147
|
+
id: "FileUploadWithOptions"
|
|
2041
2148
|
});
|
|
2042
2149
|
var Facility = BaseField.extend({
|
|
2043
2150
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
2044
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2151
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2045
2152
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2046
2153
|
}).describe("Input field for a facility");
|
|
2047
2154
|
var Office = BaseField.extend({
|
|
2048
2155
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
2049
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2156
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2050
2157
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2051
2158
|
}).describe("Input field for an office");
|
|
2052
2159
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -2082,8 +2189,11 @@ var Address = BaseField.extend({
|
|
|
2082
2189
|
).optional(),
|
|
2083
2190
|
allowedLocations: AllowedLocations
|
|
2084
2191
|
}).optional(),
|
|
2085
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
2086
|
-
}).
|
|
2192
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
2193
|
+
}).meta({
|
|
2194
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2195
|
+
id: "Address"
|
|
2196
|
+
});
|
|
2087
2197
|
var StaticDataEntry = import_v43.default.object({
|
|
2088
2198
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2089
2199
|
label: TranslationConfig,
|
|
@@ -2098,7 +2208,10 @@ var DataField = BaseField.extend({
|
|
|
2098
2208
|
subtitle: TranslationConfig.optional(),
|
|
2099
2209
|
data: import_v43.default.array(DataEntry)
|
|
2100
2210
|
})
|
|
2101
|
-
}).
|
|
2211
|
+
}).meta({
|
|
2212
|
+
description: "A field for displaying a table of read-only data",
|
|
2213
|
+
id: "DataField"
|
|
2214
|
+
});
|
|
2102
2215
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2103
2216
|
var ButtonType = import_v43.default.enum([
|
|
2104
2217
|
"primary",
|
|
@@ -2123,13 +2236,19 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
2123
2236
|
});
|
|
2124
2237
|
var ButtonField = BaseField.extend({
|
|
2125
2238
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2126
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
2239
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
2127
2240
|
configuration: ButtonConfiguration
|
|
2128
|
-
}).
|
|
2241
|
+
}).meta({
|
|
2242
|
+
description: "A generic button that can be used to trigger an action",
|
|
2243
|
+
id: "ButtonField"
|
|
2244
|
+
});
|
|
2129
2245
|
var FieldGroup = BaseField.extend({
|
|
2130
2246
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2131
2247
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2132
2248
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2249
|
+
}).meta({
|
|
2250
|
+
description: "A group of fields that are displayed together",
|
|
2251
|
+
id: "FieldGroup"
|
|
2133
2252
|
});
|
|
2134
2253
|
var AlphaPrintButton = BaseField.extend({
|
|
2135
2254
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2139,10 +2258,13 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2139
2258
|
"Label for the print button"
|
|
2140
2259
|
)
|
|
2141
2260
|
})
|
|
2142
|
-
}).
|
|
2261
|
+
}).meta({
|
|
2262
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2263
|
+
id: "AlphaPrintButton"
|
|
2264
|
+
});
|
|
2143
2265
|
var HttpField = BaseField.extend({
|
|
2144
2266
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2145
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2267
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
2146
2268
|
configuration: import_v43.default.object({
|
|
2147
2269
|
trigger: FieldReference.optional().describe(
|
|
2148
2270
|
"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."
|
|
@@ -2155,20 +2277,30 @@ var HttpField = BaseField.extend({
|
|
|
2155
2277
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2156
2278
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2157
2279
|
})
|
|
2158
|
-
}).
|
|
2280
|
+
}).meta({
|
|
2281
|
+
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.",
|
|
2282
|
+
id: "HttpField"
|
|
2283
|
+
});
|
|
2159
2284
|
var AutocompleteField = BaseField.extend({
|
|
2160
2285
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2161
2286
|
configuration: import_v43.default.object({
|
|
2162
|
-
url: import_v43.default.string().describe(
|
|
2287
|
+
url: import_v43.default.string().describe(
|
|
2288
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2289
|
+
).optional(),
|
|
2163
2290
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2164
2291
|
defaultOptions: import_v43.default.array(
|
|
2165
2292
|
import_v43.default.object({
|
|
2166
2293
|
label: import_v43.default.string(),
|
|
2167
2294
|
value: import_v43.default.string()
|
|
2168
2295
|
})
|
|
2169
|
-
).optional()
|
|
2296
|
+
).optional().describe(
|
|
2297
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2298
|
+
)
|
|
2170
2299
|
})
|
|
2171
|
-
}).
|
|
2300
|
+
}).meta({
|
|
2301
|
+
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.",
|
|
2302
|
+
id: "AutocompleteField"
|
|
2303
|
+
});
|
|
2172
2304
|
var SearchField = HttpField.extend({
|
|
2173
2305
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2174
2306
|
configuration: SearchQuery.pick({
|
|
@@ -2201,6 +2333,9 @@ var SearchField = HttpField.extend({
|
|
|
2201
2333
|
ok: TranslationConfig.optional()
|
|
2202
2334
|
}).optional()
|
|
2203
2335
|
})
|
|
2336
|
+
}).meta({
|
|
2337
|
+
description: "A search input field",
|
|
2338
|
+
id: "SearchField"
|
|
2204
2339
|
});
|
|
2205
2340
|
var LinkButtonField = BaseField.extend({
|
|
2206
2341
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2209,28 +2344,35 @@ var LinkButtonField = BaseField.extend({
|
|
|
2209
2344
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2210
2345
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2211
2346
|
})
|
|
2212
|
-
}).
|
|
2347
|
+
}).meta({
|
|
2348
|
+
description: "A button that opens a URL link",
|
|
2349
|
+
id: "LinkButtonField"
|
|
2350
|
+
});
|
|
2213
2351
|
var VerificationStatus = BaseField.extend({
|
|
2214
2352
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2215
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2353
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2216
2354
|
configuration: import_v43.default.object({
|
|
2217
2355
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2218
2356
|
description: TranslationConfig.describe(
|
|
2219
2357
|
"Explaining text on the banner in form."
|
|
2220
2358
|
)
|
|
2221
2359
|
})
|
|
2360
|
+
}).meta({
|
|
2361
|
+
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.",
|
|
2362
|
+
id: "VerificationStatus"
|
|
2222
2363
|
});
|
|
2223
2364
|
var QueryParamReaderField = BaseField.extend({
|
|
2224
2365
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2225
2366
|
configuration: import_v43.default.object({
|
|
2226
2367
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2227
2368
|
})
|
|
2228
|
-
}).
|
|
2229
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2230
|
-
|
|
2369
|
+
}).meta({
|
|
2370
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2371
|
+
id: "QueryParamReaderField"
|
|
2372
|
+
});
|
|
2231
2373
|
var QrReaderField = BaseField.extend({
|
|
2232
2374
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2233
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2375
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2234
2376
|
configuration: import_v43.default.object({
|
|
2235
2377
|
validator: import_v43.default.any().meta({
|
|
2236
2378
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2238,21 +2380,27 @@ var QrReaderField = BaseField.extend({
|
|
|
2238
2380
|
})
|
|
2239
2381
|
}).optional()
|
|
2240
2382
|
}).meta({
|
|
2241
|
-
description: "
|
|
2383
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2242
2384
|
id: "QrReaderField"
|
|
2243
2385
|
});
|
|
2244
2386
|
var IdReaderField = BaseField.extend({
|
|
2245
2387
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2246
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2388
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2247
2389
|
methods: import_v43.default.array(
|
|
2248
2390
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2249
2391
|
)
|
|
2392
|
+
}).meta({
|
|
2393
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2394
|
+
id: "IdReaderField"
|
|
2250
2395
|
});
|
|
2251
2396
|
var CustomField = BaseField.extend({
|
|
2252
2397
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2253
2398
|
defaultValue: CustomFieldValue.optional(),
|
|
2254
2399
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2255
2400
|
configuration: import_v43.default.unknown().optional()
|
|
2401
|
+
}).meta({
|
|
2402
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2403
|
+
id: "CustomField"
|
|
2256
2404
|
});
|
|
2257
2405
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2258
2406
|
var LoaderField = BaseField.extend({
|
|
@@ -2262,22 +2410,25 @@ var LoaderField = BaseField.extend({
|
|
|
2262
2410
|
configuration: import_v43.default.object({
|
|
2263
2411
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2264
2412
|
})
|
|
2265
|
-
}).
|
|
2266
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2267
|
-
|
|
2413
|
+
}).meta({
|
|
2414
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2415
|
+
id: "LoaderField"
|
|
2416
|
+
});
|
|
2268
2417
|
var HiddenField = BaseField.extend({
|
|
2269
2418
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2270
2419
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2271
2420
|
defaultValue: TextValue.optional()
|
|
2272
|
-
}).
|
|
2273
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2274
|
-
|
|
2421
|
+
}).meta({
|
|
2422
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2423
|
+
id: "HiddenField"
|
|
2424
|
+
});
|
|
2275
2425
|
var UserRoleField = BaseField.extend({
|
|
2276
2426
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2277
2427
|
defaultValue: TextValue.optional()
|
|
2278
|
-
}).
|
|
2279
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2280
|
-
|
|
2428
|
+
}).meta({
|
|
2429
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2430
|
+
id: "UserRoleField"
|
|
2431
|
+
});
|
|
2281
2432
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2282
2433
|
FieldGroup,
|
|
2283
2434
|
Address,
|
|
@@ -2376,16 +2527,19 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2376
2527
|
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2377
2528
|
actions: VerificationActionConfig
|
|
2378
2529
|
});
|
|
2379
|
-
var PageConfig = z21.discriminatedUnion("type", [
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2530
|
+
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2531
|
+
id: "PageConfig",
|
|
2532
|
+
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."
|
|
2533
|
+
});
|
|
2383
2534
|
|
|
2384
2535
|
// ../commons/src/events/FormConfig.ts
|
|
2385
2536
|
var DeclarationFormConfig = z22.object({
|
|
2386
2537
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2387
2538
|
pages: z22.array(FormPageConfig)
|
|
2388
|
-
}).
|
|
2539
|
+
}).meta({
|
|
2540
|
+
id: "DeclarationFormConfig",
|
|
2541
|
+
description: "Configuration of the declaration form."
|
|
2542
|
+
});
|
|
2389
2543
|
var ActionFormConfig = z22.object({
|
|
2390
2544
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2391
2545
|
pages: z22.array(PageConfig)
|
|
@@ -2485,6 +2639,9 @@ var DeduplicationConfig = z23.object({
|
|
|
2485
2639
|
id: z23.string(),
|
|
2486
2640
|
label: TranslationConfig,
|
|
2487
2641
|
query: Clause
|
|
2642
|
+
}).meta({
|
|
2643
|
+
id: "DeduplicationConfig",
|
|
2644
|
+
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."
|
|
2488
2645
|
});
|
|
2489
2646
|
|
|
2490
2647
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -2602,17 +2759,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2602
2759
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2603
2760
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2604
2761
|
*/
|
|
2605
|
-
ReadActionConfig.meta({
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2762
|
+
ReadActionConfig.meta({
|
|
2763
|
+
id: "ReadActionConfig",
|
|
2764
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2765
|
+
}),
|
|
2766
|
+
DeclareConfig.meta({
|
|
2767
|
+
id: "DeclareActionConfig",
|
|
2768
|
+
description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
|
|
2769
|
+
}),
|
|
2770
|
+
RejectConfig.meta({
|
|
2771
|
+
id: "RejectActionConfig",
|
|
2772
|
+
description: "Configuration for rejecting a record before registration."
|
|
2773
|
+
}),
|
|
2774
|
+
RegisterConfig.meta({
|
|
2775
|
+
id: "RegisterActionConfig",
|
|
2776
|
+
description: "Configuration for registering a record."
|
|
2777
|
+
}),
|
|
2609
2778
|
PrintCertificateActionConfig.meta({
|
|
2610
|
-
id: "PrintCertificateActionConfig"
|
|
2779
|
+
id: "PrintCertificateActionConfig",
|
|
2780
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
2781
|
+
}),
|
|
2782
|
+
RequestCorrectionConfig.meta({
|
|
2783
|
+
id: "RequestCorrectionActionConfig",
|
|
2784
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
2785
|
+
}),
|
|
2786
|
+
EditActionConfig.meta({
|
|
2787
|
+
id: "EditActionConfig",
|
|
2788
|
+
description: "Configuration for editing a record before registration."
|
|
2611
2789
|
}),
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2790
|
+
ArchiveConfig.meta({
|
|
2791
|
+
id: "ArchiveActionConfig",
|
|
2792
|
+
description: "Configuration for archiving a record."
|
|
2793
|
+
}),
|
|
2794
|
+
CustomActionConfig.meta({
|
|
2795
|
+
id: "CustomActionConfig",
|
|
2796
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
2797
|
+
})
|
|
2616
2798
|
]).describe(
|
|
2617
2799
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2618
2800
|
).meta({ id: "ActionConfig" });
|
|
@@ -2688,7 +2870,10 @@ var Field = BaseField2.extend({
|
|
|
2688
2870
|
}).describe("Custom field defined for the summary view.");
|
|
2689
2871
|
var SummaryConfig = z27.object({
|
|
2690
2872
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2691
|
-
}).
|
|
2873
|
+
}).meta({
|
|
2874
|
+
id: "SummaryConfig",
|
|
2875
|
+
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."
|
|
2876
|
+
});
|
|
2692
2877
|
|
|
2693
2878
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2694
2879
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -2759,6 +2944,9 @@ var BaseField3 = z28.object({
|
|
|
2759
2944
|
),
|
|
2760
2945
|
validations: z28.array(ValidationConfig).optional().describe(
|
|
2761
2946
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2947
|
+
),
|
|
2948
|
+
allowedLocations: JurisdictionReference.optional().describe(
|
|
2949
|
+
`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.`
|
|
2762
2950
|
)
|
|
2763
2951
|
});
|
|
2764
2952
|
var SearchQueryParams = z28.object({
|
|
@@ -2812,6 +3000,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
2812
3000
|
var AdvancedSearchConfig = z28.object({
|
|
2813
3001
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2814
3002
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3003
|
+
}).meta({
|
|
3004
|
+
id: "AdvancedSearchConfig",
|
|
3005
|
+
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()`)."
|
|
2815
3006
|
});
|
|
2816
3007
|
|
|
2817
3008
|
// ../commons/src/events/utils.ts
|
|
@@ -2862,7 +3053,37 @@ function resolveDataPath(rootData, dataPath, instancePath) {
|
|
|
2862
3053
|
}
|
|
2863
3054
|
return current;
|
|
2864
3055
|
}
|
|
3056
|
+
function todayISO() {
|
|
3057
|
+
return (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" });
|
|
3058
|
+
}
|
|
3059
|
+
var compiledFunctionCache = /* @__PURE__ */ new Map();
|
|
3060
|
+
function compileClientFunction(code) {
|
|
3061
|
+
let fn = compiledFunctionCache.get(code);
|
|
3062
|
+
if (!fn) {
|
|
3063
|
+
fn = new Function(`return (${code})`)();
|
|
3064
|
+
compiledFunctionCache.set(code, fn);
|
|
3065
|
+
}
|
|
3066
|
+
return fn;
|
|
3067
|
+
}
|
|
2865
3068
|
(0, import_ajv_formats.default)(ajv);
|
|
3069
|
+
function buildClientFunctionContext(input) {
|
|
3070
|
+
return {
|
|
3071
|
+
$form: input.form,
|
|
3072
|
+
$now: todayISO(),
|
|
3073
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3074
|
+
$online: isOnline(),
|
|
3075
|
+
$user: input.validatorContext?.user,
|
|
3076
|
+
$event: input.validatorContext?.event,
|
|
3077
|
+
$leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
|
|
3078
|
+
user: input.systemVariables?.user,
|
|
3079
|
+
$window: input.systemVariables?.$window,
|
|
3080
|
+
locations: input.locations,
|
|
3081
|
+
adminLevelIds: input.adminLevelIds
|
|
3082
|
+
};
|
|
3083
|
+
}
|
|
3084
|
+
function runClientFunction(code, data, context) {
|
|
3085
|
+
return compileClientFunction(code)(data, context);
|
|
3086
|
+
}
|
|
2866
3087
|
ajv.addKeyword({
|
|
2867
3088
|
keyword: "daysFromDate",
|
|
2868
3089
|
type: "string",
|
|
@@ -2907,12 +3128,35 @@ ajv.addKeyword({
|
|
|
2907
3128
|
$data: true,
|
|
2908
3129
|
errors: true,
|
|
2909
3130
|
// @ts-ignore -- Force type. We will move this away from AJV next. Parsing the array will take seconds and is only called by core.
|
|
2910
|
-
validate(
|
|
3131
|
+
validate(_schema, data, _2, dataContext) {
|
|
2911
3132
|
const locationIdInput = data;
|
|
2912
3133
|
const locations = dataContext?.rootData.$leafAdminStructureLocationIds ?? [];
|
|
2913
3134
|
return locations.some((location) => location.id === locationIdInput);
|
|
2914
3135
|
}
|
|
2915
3136
|
});
|
|
3137
|
+
ajv.addKeyword({
|
|
3138
|
+
keyword: "customClientValidator",
|
|
3139
|
+
schemaType: "object",
|
|
3140
|
+
errors: true,
|
|
3141
|
+
// @ts-expect-error -- AJV's public types don't expose `rootData`. All
|
|
3142
|
+
// `validate()` callers build root data via `buildClientFunctionContext`,
|
|
3143
|
+
// so the cast holds.
|
|
3144
|
+
validate(schema, data, _2, dataContext) {
|
|
3145
|
+
return Boolean(
|
|
3146
|
+
runClientFunction(
|
|
3147
|
+
schema.code,
|
|
3148
|
+
data,
|
|
3149
|
+
dataContext?.rootData ?? buildClientFunctionContext({ form: {} })
|
|
3150
|
+
)
|
|
3151
|
+
);
|
|
3152
|
+
}
|
|
3153
|
+
});
|
|
3154
|
+
function isOnline() {
|
|
3155
|
+
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
|
3156
|
+
return navigator.onLine;
|
|
3157
|
+
}
|
|
3158
|
+
return true;
|
|
3159
|
+
}
|
|
2916
3160
|
|
|
2917
3161
|
// ../commons/src/utils.ts
|
|
2918
3162
|
var z32 = __toESM(require("zod/v4"));
|
|
@@ -3531,7 +3775,54 @@ function createFieldConditionals(fieldId) {
|
|
|
3531
3775
|
}
|
|
3532
3776
|
},
|
|
3533
3777
|
required: [fieldId]
|
|
3534
|
-
})
|
|
3778
|
+
}),
|
|
3779
|
+
/**
|
|
3780
|
+
* Custom client-side validator. The provided function is serialised and executed
|
|
3781
|
+
* just-in-time on the client only. External references (e.g. lodash) are not
|
|
3782
|
+
* available inside the function body — all logic must be self-contained.
|
|
3783
|
+
*
|
|
3784
|
+
* @example
|
|
3785
|
+
* field('nid').customClientValidator((value) => {
|
|
3786
|
+
* // LUHN check — all logic must be inline
|
|
3787
|
+
* const digits = String(value).split('').map(Number)
|
|
3788
|
+
* // ...
|
|
3789
|
+
* return isValid
|
|
3790
|
+
* })
|
|
3791
|
+
*/
|
|
3792
|
+
customClientValidator(validationFn) {
|
|
3793
|
+
const code = validationFn.toString();
|
|
3794
|
+
return defineFormConditional({
|
|
3795
|
+
type: "object",
|
|
3796
|
+
properties: wrapToPath(
|
|
3797
|
+
{ [fieldId]: { customClientValidator: { code } } },
|
|
3798
|
+
this.$$subfield
|
|
3799
|
+
),
|
|
3800
|
+
required: [fieldId]
|
|
3801
|
+
});
|
|
3802
|
+
},
|
|
3803
|
+
/**
|
|
3804
|
+
* Custom client-side evaluation. Returns a {@link FieldReference} descriptor
|
|
3805
|
+
* that can be used as the `value` property or a DATA component entry.
|
|
3806
|
+
* The function receives the referenced field's value as the first argument and
|
|
3807
|
+
* the full form context as the second; its return value replaces the field reference.
|
|
3808
|
+
* The function is serialised and executed just-in-time on the client only.
|
|
3809
|
+
* External references (e.g. lodash) are not available inside the function body.
|
|
3810
|
+
*
|
|
3811
|
+
* For computing a default value without referencing a specific field, use
|
|
3812
|
+
* `evaluate(fn)` in the `defaultValue` property instead.
|
|
3813
|
+
*
|
|
3814
|
+
* @example
|
|
3815
|
+
* field('a').customClientEvaluation((aValue, ctx) =>
|
|
3816
|
+
* Number(aValue) + Number(ctx.$form.b)
|
|
3817
|
+
* )
|
|
3818
|
+
*/
|
|
3819
|
+
customClientEvaluation(computationFn) {
|
|
3820
|
+
return {
|
|
3821
|
+
$$code: computationFn.toString(),
|
|
3822
|
+
$$field: fieldId,
|
|
3823
|
+
$$subfield: this.$$subfield
|
|
3824
|
+
};
|
|
3825
|
+
}
|
|
3535
3826
|
};
|
|
3536
3827
|
}
|
|
3537
3828
|
|
|
@@ -3679,7 +3970,7 @@ var _EventConfigBase = z33.object({
|
|
|
3679
3970
|
),
|
|
3680
3971
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
3681
3972
|
actions: z33.array(ActionConfig).describe(
|
|
3682
|
-
"Configuration of
|
|
3973
|
+
"Configuration of core and custom actions associated with the event."
|
|
3683
3974
|
),
|
|
3684
3975
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
3685
3976
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -3691,7 +3982,7 @@ var _EventConfigBase = z33.object({
|
|
|
3691
3982
|
"Configuration of fields available in the advanced search feature."
|
|
3692
3983
|
),
|
|
3693
3984
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
3694
|
-
"Configuration of flags associated with the actions of this event type."
|
|
3985
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
3695
3986
|
),
|
|
3696
3987
|
analytics: z33.boolean().optional().default(true).describe(
|
|
3697
3988
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -3704,8 +3995,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
3704
3995
|
validateActionFlags(event2, ctx);
|
|
3705
3996
|
validateActionOrder(event2, ctx);
|
|
3706
3997
|
}).meta({
|
|
3707
|
-
id: "EventConfig"
|
|
3708
|
-
|
|
3998
|
+
id: "EventConfig",
|
|
3999
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
4000
|
+
});
|
|
3709
4001
|
|
|
3710
4002
|
// ../commons/src/events/EventConfigInput.ts
|
|
3711
4003
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -3927,6 +4219,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
3927
4219
|
var WorkqueueColumn = z34.object({
|
|
3928
4220
|
label: TranslationConfig,
|
|
3929
4221
|
value: WorkqueueColumnValue
|
|
4222
|
+
}).meta({
|
|
4223
|
+
id: "WorkqueueColumn",
|
|
4224
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
3930
4225
|
});
|
|
3931
4226
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3932
4227
|
return workqueueColumns.map(
|
|
@@ -4129,18 +4424,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4129
4424
|
query: true,
|
|
4130
4425
|
columns: true
|
|
4131
4426
|
});
|
|
4132
|
-
var WorkqueueConfigInput =
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
query: CountryConfigQueryInputType,
|
|
4138
|
-
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
4139
|
-
"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."
|
|
4140
|
-
),
|
|
4141
|
-
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
4142
|
-
icon: AvailableIcons,
|
|
4143
|
-
emptyMessage: TranslationConfig.optional()
|
|
4427
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4428
|
+
query: CountryConfigQueryInputType
|
|
4429
|
+
}).meta({
|
|
4430
|
+
id: "WorkqueueConfig",
|
|
4431
|
+
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."
|
|
4144
4432
|
});
|
|
4145
4433
|
var WorkqueueCountInput = z37.array(
|
|
4146
4434
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4180,6 +4468,11 @@ var BaseActionInput = z38.object({
|
|
|
4180
4468
|
originalActionId: UUID.optional(),
|
|
4181
4469
|
// should not be part of base action.
|
|
4182
4470
|
keepAssignment: z38.boolean().optional(),
|
|
4471
|
+
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
4472
|
+
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
4473
|
+
waitFor: z38.boolean().default(true).describe(
|
|
4474
|
+
"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."
|
|
4475
|
+
),
|
|
4183
4476
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4184
4477
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
4185
4478
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4297,7 +4590,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
|
4297
4590
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4298
4591
|
z38.object({
|
|
4299
4592
|
requestId: z38.string(),
|
|
4300
|
-
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4593
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
4594
|
+
content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
|
|
4301
4595
|
}).shape
|
|
4302
4596
|
);
|
|
4303
4597
|
var ReadActionInput = BaseActionInput.extend(
|
|
@@ -4359,7 +4653,7 @@ var Draft = z39.object({
|
|
|
4359
4653
|
}).describe(
|
|
4360
4654
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
4361
4655
|
);
|
|
4362
|
-
var DraftInput = BaseActionInput.extend({
|
|
4656
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
4363
4657
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4364
4658
|
status: z39.enum([
|
|
4365
4659
|
ActionStatus.Requested,
|
|
@@ -4409,12 +4703,53 @@ var updateActions = ActionTypes.extract([
|
|
|
4409
4703
|
ActionType.ARCHIVE,
|
|
4410
4704
|
ActionType.PRINT_CERTIFICATE,
|
|
4411
4705
|
ActionType.REQUEST_CORRECTION,
|
|
4706
|
+
ActionType.APPROVE_CORRECTION,
|
|
4707
|
+
ActionType.REJECT_CORRECTION,
|
|
4412
4708
|
ActionType.CUSTOM
|
|
4413
4709
|
]);
|
|
4414
4710
|
|
|
4415
4711
|
// ../commons/src/events/state/flags.ts
|
|
4416
4712
|
var import_lodash3 = require("lodash");
|
|
4417
4713
|
var import_date_fns3 = require("date-fns");
|
|
4714
|
+
var INHERENT_FLAG_RULES = [
|
|
4715
|
+
{
|
|
4716
|
+
flag: InherentFlags.CORRECTION_REQUESTED,
|
|
4717
|
+
setOn: [ActionType.REQUEST_CORRECTION],
|
|
4718
|
+
resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
|
|
4719
|
+
},
|
|
4720
|
+
{
|
|
4721
|
+
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
4722
|
+
// other status-changing action (see getStatusFromActions).
|
|
4723
|
+
flag: InherentFlags.INCOMPLETE,
|
|
4724
|
+
setOn: [ActionType.NOTIFY],
|
|
4725
|
+
resetOn: [
|
|
4726
|
+
ActionType.CREATE,
|
|
4727
|
+
ActionType.DECLARE,
|
|
4728
|
+
ActionType.REGISTER,
|
|
4729
|
+
ActionType.ARCHIVE
|
|
4730
|
+
]
|
|
4731
|
+
},
|
|
4732
|
+
{
|
|
4733
|
+
flag: InherentFlags.REJECTED,
|
|
4734
|
+
setOn: [ActionType.REJECT],
|
|
4735
|
+
resetOn: [
|
|
4736
|
+
ActionType.NOTIFY,
|
|
4737
|
+
ActionType.DECLARE,
|
|
4738
|
+
ActionType.EDIT,
|
|
4739
|
+
ActionType.REGISTER
|
|
4740
|
+
]
|
|
4741
|
+
},
|
|
4742
|
+
{
|
|
4743
|
+
flag: InherentFlags.POTENTIAL_DUPLICATE,
|
|
4744
|
+
setOn: [ActionType.DUPLICATE_DETECTED],
|
|
4745
|
+
resetOn: [ActionType.MARK_AS_DUPLICATE, ActionType.MARK_AS_NOT_DUPLICATE]
|
|
4746
|
+
},
|
|
4747
|
+
{
|
|
4748
|
+
flag: InherentFlags.EDIT_IN_PROGRESS,
|
|
4749
|
+
setOn: [ActionType.EDIT],
|
|
4750
|
+
resetOnAnyOtherAction: true
|
|
4751
|
+
}
|
|
4752
|
+
];
|
|
4418
4753
|
|
|
4419
4754
|
// ../commons/src/events/defineConfig.ts
|
|
4420
4755
|
var IGNORED_EVENT_TYPES = [
|
|
@@ -5160,6 +5495,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
|
5160
5495
|
id: "signature.upload.modal.title",
|
|
5161
5496
|
defaultMessage: "Draw signature",
|
|
5162
5497
|
description: "Title for the modal to draw signature"
|
|
5498
|
+
},
|
|
5499
|
+
// Zod applies the schema default at parse time, but this fixture bypasses
|
|
5500
|
+
// parsing — GeneratedInputField accesses configuration.maxFileSize directly.
|
|
5501
|
+
configuration: {
|
|
5502
|
+
maxFileSize: 5 * 1024 * 1024
|
|
5163
5503
|
}
|
|
5164
5504
|
}
|
|
5165
5505
|
]
|
|
@@ -6953,10 +7293,380 @@ var ACTION_FILTERS = {
|
|
|
6953
7293
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
6954
7294
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
6955
7295
|
};
|
|
7296
|
+
var REJECTED_ACTIONS = [
|
|
7297
|
+
ActionType.READ,
|
|
7298
|
+
ActionType.NOTIFY,
|
|
7299
|
+
ActionType.CUSTOM,
|
|
7300
|
+
ActionType.EDIT,
|
|
7301
|
+
ActionType.ARCHIVE
|
|
7302
|
+
];
|
|
6956
7303
|
|
|
6957
7304
|
// ../commons/src/events/FileUtils.ts
|
|
6958
7305
|
var import_lodash7 = require("lodash");
|
|
6959
7306
|
|
|
7307
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
7308
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
7309
|
+
{
|
|
7310
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7311
|
+
name: "Central",
|
|
7312
|
+
parentId: null,
|
|
7313
|
+
validUntil: null,
|
|
7314
|
+
externalId: "ydyJb1RAy4U1"
|
|
7315
|
+
},
|
|
7316
|
+
{
|
|
7317
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7318
|
+
name: "Sulaka",
|
|
7319
|
+
parentId: null,
|
|
7320
|
+
validUntil: null,
|
|
7321
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
7322
|
+
},
|
|
7323
|
+
{
|
|
7324
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
7325
|
+
name: "Pualula",
|
|
7326
|
+
parentId: null,
|
|
7327
|
+
validUntil: null,
|
|
7328
|
+
externalId: "Aq91DweLmT8k"
|
|
7329
|
+
},
|
|
7330
|
+
{
|
|
7331
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
7332
|
+
name: "Chuminga",
|
|
7333
|
+
parentId: null,
|
|
7334
|
+
validUntil: null,
|
|
7335
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
7336
|
+
},
|
|
7337
|
+
{
|
|
7338
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7339
|
+
name: "Ibombo",
|
|
7340
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7341
|
+
validUntil: null,
|
|
7342
|
+
externalId: "k7DsP4vbN1Qe"
|
|
7343
|
+
},
|
|
7344
|
+
{
|
|
7345
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7346
|
+
name: "Isango",
|
|
7347
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7348
|
+
validUntil: null,
|
|
7349
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
7350
|
+
},
|
|
7351
|
+
{
|
|
7352
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7353
|
+
name: "Isamba",
|
|
7354
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7355
|
+
validUntil: null,
|
|
7356
|
+
externalId: "sT0xVu1KqJ7r"
|
|
7357
|
+
},
|
|
7358
|
+
{
|
|
7359
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7360
|
+
name: "Itambo",
|
|
7361
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7362
|
+
validUntil: null,
|
|
7363
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
7364
|
+
},
|
|
7365
|
+
{
|
|
7366
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
7367
|
+
name: "Ezhi",
|
|
7368
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7369
|
+
validUntil: null,
|
|
7370
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
7371
|
+
},
|
|
7372
|
+
{
|
|
7373
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7374
|
+
name: "Ilanga",
|
|
7375
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7376
|
+
validUntil: null,
|
|
7377
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
7378
|
+
},
|
|
7379
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
7380
|
+
{
|
|
7381
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7382
|
+
name: "Klow",
|
|
7383
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7384
|
+
validUntil: null,
|
|
7385
|
+
externalId: "IkYcYBUcyY2"
|
|
7386
|
+
},
|
|
7387
|
+
{
|
|
7388
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
7389
|
+
name: "Mbondo",
|
|
7390
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7391
|
+
validUntil: null,
|
|
7392
|
+
externalId: "Qhvv5hvo3mY"
|
|
7393
|
+
},
|
|
7394
|
+
{
|
|
7395
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
7396
|
+
name: "Ndara",
|
|
7397
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7398
|
+
validUntil: null,
|
|
7399
|
+
externalId: "crXh068O9TR"
|
|
7400
|
+
},
|
|
7401
|
+
{
|
|
7402
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
7403
|
+
name: "Olani",
|
|
7404
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7405
|
+
validUntil: null,
|
|
7406
|
+
externalId: "r00It8Tvvp7"
|
|
7407
|
+
},
|
|
7408
|
+
{
|
|
7409
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
7410
|
+
name: "Pemba",
|
|
7411
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7412
|
+
validUntil: null,
|
|
7413
|
+
externalId: "ZnUWsbONIaH"
|
|
7414
|
+
},
|
|
7415
|
+
{
|
|
7416
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
7417
|
+
name: "Quanza",
|
|
7418
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7419
|
+
validUntil: null,
|
|
7420
|
+
externalId: "fDZycvQTa7l"
|
|
7421
|
+
},
|
|
7422
|
+
{
|
|
7423
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
7424
|
+
name: "Rivka",
|
|
7425
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7426
|
+
validUntil: null,
|
|
7427
|
+
externalId: "KqswxCGTELa"
|
|
7428
|
+
},
|
|
7429
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
7430
|
+
{
|
|
7431
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
7432
|
+
name: "Mbula",
|
|
7433
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7434
|
+
validUntil: null,
|
|
7435
|
+
externalId: "osEbKjRc9Kg"
|
|
7436
|
+
},
|
|
7437
|
+
{
|
|
7438
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
7439
|
+
name: "Ndoki",
|
|
7440
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7441
|
+
validUntil: null,
|
|
7442
|
+
externalId: "aq4daBUAGr3"
|
|
7443
|
+
},
|
|
7444
|
+
{
|
|
7445
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
7446
|
+
name: "Tsanga",
|
|
7447
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7448
|
+
validUntil: null,
|
|
7449
|
+
externalId: "cqis6Y8trbJ"
|
|
7450
|
+
},
|
|
7451
|
+
{
|
|
7452
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
7453
|
+
name: "Waziri",
|
|
7454
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7455
|
+
validUntil: null,
|
|
7456
|
+
externalId: "LMijHPyyx6d"
|
|
7457
|
+
},
|
|
7458
|
+
{
|
|
7459
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
7460
|
+
name: "Zimbi",
|
|
7461
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7462
|
+
validUntil: null,
|
|
7463
|
+
externalId: "pcQYbPuKGZ7"
|
|
7464
|
+
},
|
|
7465
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
7466
|
+
{
|
|
7467
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
7468
|
+
name: "Felani",
|
|
7469
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7470
|
+
validUntil: null,
|
|
7471
|
+
externalId: "gSqpoCGdMXp"
|
|
7472
|
+
},
|
|
7473
|
+
{
|
|
7474
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
7475
|
+
name: "Goroma",
|
|
7476
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7477
|
+
validUntil: null,
|
|
7478
|
+
externalId: "KvAAIaNqVrp"
|
|
7479
|
+
},
|
|
7480
|
+
{
|
|
7481
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
7482
|
+
name: "Halifu",
|
|
7483
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7484
|
+
validUntil: null,
|
|
7485
|
+
externalId: "qe4UnEVt1hv"
|
|
7486
|
+
},
|
|
7487
|
+
{
|
|
7488
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
7489
|
+
name: "Jabari",
|
|
7490
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7491
|
+
validUntil: null,
|
|
7492
|
+
externalId: "yHH9Nz4rLOt"
|
|
7493
|
+
},
|
|
7494
|
+
{
|
|
7495
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
7496
|
+
name: "Kifani",
|
|
7497
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7498
|
+
validUntil: null,
|
|
7499
|
+
externalId: "eSWmXIGeu1I"
|
|
7500
|
+
},
|
|
7501
|
+
{
|
|
7502
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
7503
|
+
name: "Lumela",
|
|
7504
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7505
|
+
validUntil: null,
|
|
7506
|
+
externalId: "bh0b3aI1uP3"
|
|
7507
|
+
}
|
|
7508
|
+
];
|
|
7509
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
7510
|
+
{
|
|
7511
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
7512
|
+
name: "Central Provincial Office",
|
|
7513
|
+
locationType: "CRVS_OFFICE",
|
|
7514
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7515
|
+
validUntil: null,
|
|
7516
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
7517
|
+
},
|
|
7518
|
+
{
|
|
7519
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
7520
|
+
name: "Central Health Post",
|
|
7521
|
+
locationType: "HEALTH_FACILITY",
|
|
7522
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7523
|
+
validUntil: null
|
|
7524
|
+
},
|
|
7525
|
+
{
|
|
7526
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
7527
|
+
name: "Ibombo District Office",
|
|
7528
|
+
locationType: "CRVS_OFFICE",
|
|
7529
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7530
|
+
validUntil: null,
|
|
7531
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
7532
|
+
},
|
|
7533
|
+
{
|
|
7534
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
7535
|
+
name: "Isamba District Office",
|
|
7536
|
+
locationType: "CRVS_OFFICE",
|
|
7537
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7538
|
+
validUntil: null,
|
|
7539
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
7540
|
+
},
|
|
7541
|
+
{
|
|
7542
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
7543
|
+
name: "Isango District Office",
|
|
7544
|
+
locationType: "CRVS_OFFICE",
|
|
7545
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7546
|
+
validUntil: null,
|
|
7547
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
7548
|
+
},
|
|
7549
|
+
{
|
|
7550
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
7551
|
+
name: "Sulaka Provincial Office",
|
|
7552
|
+
locationType: "CRVS_OFFICE",
|
|
7553
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7554
|
+
validUntil: null,
|
|
7555
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
7556
|
+
},
|
|
7557
|
+
{
|
|
7558
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
7559
|
+
name: "Ilanga District Office",
|
|
7560
|
+
locationType: "CRVS_OFFICE",
|
|
7561
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7562
|
+
validUntil: null,
|
|
7563
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
7564
|
+
},
|
|
7565
|
+
{
|
|
7566
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
7567
|
+
name: "Chamakubi Health Post",
|
|
7568
|
+
locationType: "HEALTH_FACILITY",
|
|
7569
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7570
|
+
validUntil: null,
|
|
7571
|
+
externalId: "M1nFr8LbC2Qy"
|
|
7572
|
+
},
|
|
7573
|
+
{
|
|
7574
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
7575
|
+
name: "Ibombo Rural Health Centre",
|
|
7576
|
+
locationType: "HEALTH_FACILITY",
|
|
7577
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7578
|
+
validUntil: null,
|
|
7579
|
+
externalId: "bT7pV6YrW0Xc"
|
|
7580
|
+
},
|
|
7581
|
+
{
|
|
7582
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
7583
|
+
name: "Chikobo Rural Health Centre",
|
|
7584
|
+
locationType: "HEALTH_FACILITY",
|
|
7585
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7586
|
+
validUntil: null,
|
|
7587
|
+
externalId: "zE4qPn2SgJ5d"
|
|
7588
|
+
},
|
|
7589
|
+
{
|
|
7590
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
7591
|
+
name: "Chilochabalenje Health Post",
|
|
7592
|
+
locationType: "HEALTH_FACILITY",
|
|
7593
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7594
|
+
validUntil: null,
|
|
7595
|
+
externalId: "H8vDs1MqR4Uf"
|
|
7596
|
+
},
|
|
7597
|
+
{
|
|
7598
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
7599
|
+
name: "Chipeso Rural Health Centre",
|
|
7600
|
+
locationType: "HEALTH_FACILITY",
|
|
7601
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7602
|
+
validUntil: null,
|
|
7603
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
7604
|
+
},
|
|
7605
|
+
{
|
|
7606
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
7607
|
+
name: "Chisamba Rural Health Centre",
|
|
7608
|
+
locationType: "HEALTH_FACILITY",
|
|
7609
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7610
|
+
validUntil: null,
|
|
7611
|
+
externalId: "Yr0pCg8LdM2s"
|
|
7612
|
+
},
|
|
7613
|
+
{
|
|
7614
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
7615
|
+
name: "Chitanda Rural Health Centre",
|
|
7616
|
+
locationType: "HEALTH_FACILITY",
|
|
7617
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7618
|
+
validUntil: null,
|
|
7619
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
7620
|
+
},
|
|
7621
|
+
{
|
|
7622
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
7623
|
+
name: "Golden Valley Rural Health Centre",
|
|
7624
|
+
locationType: "HEALTH_FACILITY",
|
|
7625
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7626
|
+
validUntil: null,
|
|
7627
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
7628
|
+
},
|
|
7629
|
+
{
|
|
7630
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
7631
|
+
name: "Ipongo Rural Health Centre",
|
|
7632
|
+
locationType: "HEALTH_FACILITY",
|
|
7633
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7634
|
+
validUntil: null,
|
|
7635
|
+
externalId: "kF2sW9DmH0Bt"
|
|
7636
|
+
},
|
|
7637
|
+
{
|
|
7638
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
7639
|
+
name: "Itumbwe Health Post",
|
|
7640
|
+
locationType: "HEALTH_FACILITY",
|
|
7641
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7642
|
+
validUntil: null,
|
|
7643
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
7644
|
+
},
|
|
7645
|
+
{
|
|
7646
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
7647
|
+
name: "Kabangalala Rural Health Centre",
|
|
7648
|
+
locationType: "HEALTH_FACILITY",
|
|
7649
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7650
|
+
validUntil: null,
|
|
7651
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
7652
|
+
},
|
|
7653
|
+
// Village offices
|
|
7654
|
+
{
|
|
7655
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
7656
|
+
name: "Klow Village Office",
|
|
7657
|
+
locationType: "CRVS_OFFICE",
|
|
7658
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7659
|
+
validUntil: null,
|
|
7660
|
+
externalId: "PmAyxAJkxiJ"
|
|
7661
|
+
}
|
|
7662
|
+
];
|
|
7663
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
7664
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
7665
|
+
);
|
|
7666
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
7667
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7668
|
+
);
|
|
7669
|
+
|
|
6960
7670
|
// ../commons/src/notification/UserNotifications.ts
|
|
6961
7671
|
var z44 = __toESM(require("zod/v4"));
|
|
6962
7672
|
var TriggerEvent = {
|