@opencrvs/toolkit 2.0.0-rc.dc48f9b → 2.0.0-rc.dcc262a
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 +264 -118
- package/dist/cli.js +392 -128
- package/dist/commons/api/router.d.ts +3383 -252
- 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/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 +377 -50
- 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 +47 -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 +3 -2
- package/dist/commons/events/utils.d.ts +13 -2
- package/dist/conditionals/index.js +55 -2
- package/dist/events/index.js +941 -250
- 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 +390 -126
- 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 +801 -153
- package/dist/scopes/index.js +3 -1
- package/opencrvs-toolkit-2.0.0-rc.dcc262a.tgz +0 -0
- package/package.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.dc48f9b.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
|
|
@@ -912,6 +917,7 @@ var DateRangeFieldValue = z12.object({
|
|
|
912
917
|
var EmailValue = z12.email();
|
|
913
918
|
var CheckboxFieldValue = z12.boolean();
|
|
914
919
|
var NumberFieldValue = z12.number();
|
|
920
|
+
var SignatureFieldValue = FileFieldValue;
|
|
915
921
|
var ButtonFieldValue = z12.number();
|
|
916
922
|
var VerificationStatusValue = z12.enum([
|
|
917
923
|
"verified",
|
|
@@ -980,28 +986,20 @@ function schemaPriority(schema) {
|
|
|
980
986
|
return idx === -1 ? 9999 : idx;
|
|
981
987
|
}
|
|
982
988
|
function safeUnion(schemas) {
|
|
989
|
+
const sortedSchemas = [...schemas].sort(
|
|
990
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
991
|
+
);
|
|
983
992
|
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
|
-
});
|
|
993
|
+
for (const schema of sortedSchemas) {
|
|
994
|
+
if (schema.safeParse(val).success) {
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
1004
997
|
}
|
|
998
|
+
ctx.addIssue({
|
|
999
|
+
code: "invalid_type",
|
|
1000
|
+
expected: "custom",
|
|
1001
|
+
message: "Value does not match any schema"
|
|
1002
|
+
});
|
|
1005
1003
|
}).meta({
|
|
1006
1004
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
1007
1005
|
});
|
|
@@ -1218,8 +1216,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
1218
1216
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1219
1217
|
z14.object({
|
|
1220
1218
|
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1221
|
-
requestId: z14.string()
|
|
1219
|
+
requestId: z14.string(),
|
|
1222
1220
|
// TODO move into 'content' property
|
|
1221
|
+
content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
|
|
1223
1222
|
}).shape
|
|
1224
1223
|
);
|
|
1225
1224
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1311,6 +1310,9 @@ var FlagConfig = z15.object({
|
|
|
1311
1310
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1312
1311
|
),
|
|
1313
1312
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1313
|
+
}).meta({
|
|
1314
|
+
id: "FlagConfig",
|
|
1315
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1314
1316
|
});
|
|
1315
1317
|
var ActionFlagConfig = z15.object({
|
|
1316
1318
|
id: Flag,
|
|
@@ -1318,6 +1320,9 @@ var ActionFlagConfig = z15.object({
|
|
|
1318
1320
|
conditional: Conditional.optional().describe(
|
|
1319
1321
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1320
1322
|
)
|
|
1323
|
+
}).meta({
|
|
1324
|
+
id: "ActionFlagConfig",
|
|
1325
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1321
1326
|
});
|
|
1322
1327
|
|
|
1323
1328
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1339,8 +1344,7 @@ var ActionCreationMetadata = z16.object({
|
|
|
1339
1344
|
),
|
|
1340
1345
|
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1341
1346
|
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.")
|
|
1347
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1344
1348
|
});
|
|
1345
1349
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1346
1350
|
registrationNumber: z16.string().describe(
|
|
@@ -1368,9 +1372,6 @@ var EventMetadata = z16.object({
|
|
|
1368
1372
|
createdAtLocation: UUID.nullish().describe(
|
|
1369
1373
|
"Location of the user who created the event."
|
|
1370
1374
|
),
|
|
1371
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1372
|
-
"Signature of the user who created the event."
|
|
1373
|
-
),
|
|
1374
1375
|
updatedAtLocation: UUID.nullish().describe(
|
|
1375
1376
|
"Location of the user who last changed the status."
|
|
1376
1377
|
),
|
|
@@ -1663,14 +1664,31 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1663
1664
|
}
|
|
1664
1665
|
}).describe("Unique identifier for the field");
|
|
1665
1666
|
var FieldReference = import_v43.default.object({
|
|
1666
|
-
$$field: FieldId,
|
|
1667
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1667
1668
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1668
1669
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1670
|
+
),
|
|
1671
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1672
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1669
1673
|
)
|
|
1670
|
-
}).describe(
|
|
1674
|
+
}).describe(
|
|
1675
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1676
|
+
);
|
|
1677
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1678
|
+
$$code: import_v43.default.string().describe(
|
|
1679
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1680
|
+
)
|
|
1681
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1671
1682
|
var ValidationConfig = import_v43.default.object({
|
|
1672
|
-
validator: Conditional
|
|
1673
|
-
|
|
1683
|
+
validator: Conditional.describe(
|
|
1684
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1685
|
+
),
|
|
1686
|
+
message: TranslationConfig.describe(
|
|
1687
|
+
"Error message displayed when the validator does not hold."
|
|
1688
|
+
)
|
|
1689
|
+
}).meta({
|
|
1690
|
+
id: "ValidationConfig",
|
|
1691
|
+
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
1692
|
});
|
|
1675
1693
|
var requiredSchema = import_v43.default.union([
|
|
1676
1694
|
import_v43.default.boolean(),
|
|
@@ -1701,7 +1719,7 @@ var BaseField = import_v43.default.object({
|
|
|
1701
1719
|
"Indicates whether the field can be modified during record correction."
|
|
1702
1720
|
),
|
|
1703
1721
|
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."
|
|
1722
|
+
"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
1723
|
),
|
|
1706
1724
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1707
1725
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1709,30 +1727,39 @@ var BaseField = import_v43.default.object({
|
|
|
1709
1727
|
}).describe("Common properties shared across all field types.");
|
|
1710
1728
|
var Divider = BaseField.extend({
|
|
1711
1729
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1730
|
+
}).meta({
|
|
1731
|
+
description: "A horizontal line divider",
|
|
1732
|
+
id: "Divider"
|
|
1712
1733
|
});
|
|
1713
1734
|
var TextField = BaseField.extend({
|
|
1714
1735
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1715
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1736
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1716
1737
|
configuration: import_v43.default.object({
|
|
1717
1738
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1718
1739
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
1719
1740
|
prefix: TranslationConfig.optional(),
|
|
1720
1741
|
postfix: TranslationConfig.optional()
|
|
1721
1742
|
}).default({ type: "text" }).optional()
|
|
1722
|
-
}).
|
|
1743
|
+
}).meta({
|
|
1744
|
+
description: "A text input field",
|
|
1745
|
+
id: "TextField"
|
|
1746
|
+
});
|
|
1723
1747
|
var NumberField = BaseField.extend({
|
|
1724
1748
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1725
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1749
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1726
1750
|
configuration: import_v43.default.object({
|
|
1727
1751
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1728
1752
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1729
1753
|
prefix: TranslationConfig.optional(),
|
|
1730
1754
|
postfix: TranslationConfig.optional()
|
|
1731
1755
|
}).optional()
|
|
1732
|
-
}).
|
|
1756
|
+
}).meta({
|
|
1757
|
+
description: "A number input field",
|
|
1758
|
+
id: "NumberField"
|
|
1759
|
+
});
|
|
1733
1760
|
var TextAreaField = BaseField.extend({
|
|
1734
1761
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1735
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1762
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1736
1763
|
configuration: import_v43.default.object({
|
|
1737
1764
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1738
1765
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1740,7 +1767,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1740
1767
|
prefix: TranslationConfig.optional(),
|
|
1741
1768
|
postfix: TranslationConfig.optional()
|
|
1742
1769
|
}).default({ rows: 4 }).optional()
|
|
1743
|
-
}).
|
|
1770
|
+
}).meta({
|
|
1771
|
+
description: "A multiline text input",
|
|
1772
|
+
id: "TextAreaField"
|
|
1773
|
+
});
|
|
1744
1774
|
var ImageMimeType = import_v43.default.enum([
|
|
1745
1775
|
"image/png",
|
|
1746
1776
|
"image/jpg",
|
|
@@ -1763,58 +1793,76 @@ var SignatureField = BaseField.extend({
|
|
|
1763
1793
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1764
1794
|
"Title of the signature modal"
|
|
1765
1795
|
),
|
|
1766
|
-
defaultValue:
|
|
1796
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1767
1797
|
configuration: import_v43.default.object({
|
|
1768
1798
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1769
1799
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1770
1800
|
}).default({
|
|
1771
1801
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1772
1802
|
})
|
|
1773
|
-
}).
|
|
1803
|
+
}).meta({
|
|
1804
|
+
description: "A signature input field",
|
|
1805
|
+
id: "SignatureField"
|
|
1806
|
+
});
|
|
1774
1807
|
var EmailField = BaseField.extend({
|
|
1775
1808
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1776
1809
|
configuration: import_v43.default.object({
|
|
1777
1810
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1778
1811
|
}).default({ maxLength: 255 }).optional(),
|
|
1779
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1812
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1813
|
+
}).meta({
|
|
1814
|
+
description: "An email input field",
|
|
1815
|
+
id: "EmailField"
|
|
1780
1816
|
});
|
|
1781
1817
|
var DateField = BaseField.extend({
|
|
1782
1818
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1783
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1819
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1784
1820
|
configuration: import_v43.default.object({
|
|
1785
1821
|
notice: TranslationConfig.describe(
|
|
1786
1822
|
"Text to display above the date input"
|
|
1787
1823
|
).optional()
|
|
1788
1824
|
}).optional()
|
|
1789
|
-
}).
|
|
1825
|
+
}).meta({
|
|
1826
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1827
|
+
id: "DateField"
|
|
1828
|
+
});
|
|
1790
1829
|
var AgeField = BaseField.extend({
|
|
1791
1830
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1792
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1831
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1793
1832
|
configuration: import_v43.default.object({
|
|
1794
1833
|
asOfDate: FieldReference,
|
|
1795
1834
|
prefix: TranslationConfig.optional(),
|
|
1796
1835
|
postfix: TranslationConfig.optional()
|
|
1797
1836
|
})
|
|
1798
|
-
}).
|
|
1837
|
+
}).meta({
|
|
1838
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1839
|
+
id: "AgeField"
|
|
1840
|
+
});
|
|
1799
1841
|
var TimeField = BaseField.extend({
|
|
1800
1842
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1801
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1843
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1802
1844
|
configuration: import_v43.default.object({
|
|
1803
1845
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1804
1846
|
notice: TranslationConfig.describe(
|
|
1805
1847
|
"Text to display above the time input"
|
|
1806
1848
|
).optional()
|
|
1807
1849
|
}).optional()
|
|
1808
|
-
}).
|
|
1850
|
+
}).meta({
|
|
1851
|
+
description: "A single time input (HH-mm)",
|
|
1852
|
+
id: "TimeField"
|
|
1853
|
+
});
|
|
1809
1854
|
var DateRangeField = BaseField.extend({
|
|
1810
1855
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1811
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1856
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1812
1857
|
configuration: import_v43.default.object({
|
|
1813
1858
|
notice: TranslationConfig.describe(
|
|
1814
1859
|
"Text to display above the date input"
|
|
1815
1860
|
).optional()
|
|
1816
1861
|
}).optional()
|
|
1817
|
-
}).
|
|
1862
|
+
}).meta({
|
|
1863
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1864
|
+
id: "DateRangeField"
|
|
1865
|
+
});
|
|
1818
1866
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1819
1867
|
"reg12",
|
|
1820
1868
|
"reg14",
|
|
@@ -1858,21 +1906,33 @@ var ImageViewField = BaseField.extend({
|
|
|
1858
1906
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1859
1907
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1860
1908
|
configuration: ImageConfiguration
|
|
1861
|
-
}).
|
|
1909
|
+
}).meta({
|
|
1910
|
+
description: "A read-only image component for form pages",
|
|
1911
|
+
id: "ImageViewField"
|
|
1912
|
+
});
|
|
1862
1913
|
var Paragraph = BaseField.extend({
|
|
1863
1914
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1864
1915
|
configuration: ParagraphConfiguration
|
|
1865
|
-
}).
|
|
1916
|
+
}).meta({
|
|
1917
|
+
description: "A read-only HTML <p> paragraph",
|
|
1918
|
+
id: "Paragraph"
|
|
1919
|
+
});
|
|
1866
1920
|
var Heading = BaseField.extend({
|
|
1867
1921
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1868
1922
|
configuration: HeadingConfiguration
|
|
1869
|
-
}).
|
|
1923
|
+
}).meta({
|
|
1924
|
+
description: "A read-only heading component for form pages",
|
|
1925
|
+
id: "Heading"
|
|
1926
|
+
});
|
|
1870
1927
|
var PageHeader = BaseField.extend({
|
|
1871
1928
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1872
|
-
}).
|
|
1929
|
+
}).meta({
|
|
1930
|
+
description: "A read-only header component for form pages",
|
|
1931
|
+
id: "PageHeader"
|
|
1932
|
+
});
|
|
1873
1933
|
var File = BaseField.extend({
|
|
1874
1934
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1875
|
-
defaultValue: FileFieldValue.optional(),
|
|
1935
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1876
1936
|
configuration: import_v43.default.object({
|
|
1877
1937
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1878
1938
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1888,7 +1948,10 @@ var File = BaseField.extend({
|
|
|
1888
1948
|
}).default({
|
|
1889
1949
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1890
1950
|
})
|
|
1891
|
-
}).
|
|
1951
|
+
}).meta({
|
|
1952
|
+
description: "A file upload field",
|
|
1953
|
+
id: "File"
|
|
1954
|
+
});
|
|
1892
1955
|
var SelectOption = import_v43.default.object({
|
|
1893
1956
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1894
1957
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1896,7 +1959,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1896
1959
|
});
|
|
1897
1960
|
var NumberWithUnitField = BaseField.extend({
|
|
1898
1961
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1899
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1962
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1900
1963
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1901
1964
|
configuration: import_v43.default.object({
|
|
1902
1965
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1905,17 +1968,23 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1905
1968
|
"Placeholder for the number field"
|
|
1906
1969
|
)
|
|
1907
1970
|
}).optional()
|
|
1908
|
-
}).
|
|
1971
|
+
}).meta({
|
|
1972
|
+
description: "A number with unit input field",
|
|
1973
|
+
id: "NumberWithUnitField"
|
|
1974
|
+
});
|
|
1909
1975
|
var RadioGroup = BaseField.extend({
|
|
1910
1976
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1911
|
-
defaultValue: TextValue.optional(),
|
|
1977
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1912
1978
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1913
1979
|
configuration: import_v43.default.object({
|
|
1914
1980
|
styles: import_v43.default.object({
|
|
1915
1981
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1916
1982
|
}).optional()
|
|
1917
1983
|
}).optional()
|
|
1918
|
-
}).
|
|
1984
|
+
}).meta({
|
|
1985
|
+
description: "A grouped radio button field",
|
|
1986
|
+
id: "RadioGroup"
|
|
1987
|
+
});
|
|
1919
1988
|
var BulletList = BaseField.extend({
|
|
1920
1989
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1921
1990
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1924,10 +1993,13 @@ var BulletList = BaseField.extend({
|
|
|
1924
1993
|
fontVariant: HtmlFontVariant.optional()
|
|
1925
1994
|
}).optional()
|
|
1926
1995
|
}).default({})
|
|
1927
|
-
}).
|
|
1996
|
+
}).meta({
|
|
1997
|
+
description: "A list of bullet points",
|
|
1998
|
+
id: "BulletList"
|
|
1999
|
+
});
|
|
1928
2000
|
var Select = BaseField.extend({
|
|
1929
2001
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1930
|
-
defaultValue: TextValue.optional(),
|
|
2002
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1931
2003
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1932
2004
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1933
2005
|
`
|
|
@@ -1939,16 +2011,22 @@ var Select = BaseField.extend({
|
|
|
1939
2011
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1940
2012
|
`
|
|
1941
2013
|
)
|
|
1942
|
-
}).
|
|
2014
|
+
}).meta({
|
|
2015
|
+
description: "A select input field",
|
|
2016
|
+
id: "Select"
|
|
2017
|
+
});
|
|
1943
2018
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1944
2019
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1945
2020
|
label: TranslationConfig.describe("The label of the option")
|
|
1946
2021
|
});
|
|
1947
2022
|
var SelectDateRangeField = BaseField.extend({
|
|
1948
2023
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1949
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
2024
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1950
2025
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1951
|
-
}).
|
|
2026
|
+
}).meta({
|
|
2027
|
+
description: "A date range selection field",
|
|
2028
|
+
id: "SelectDateRangeField"
|
|
2029
|
+
});
|
|
1952
2030
|
var NameConfig = import_v43.default.object({
|
|
1953
2031
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1954
2032
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1960,7 +2038,7 @@ var NameField = BaseField.extend({
|
|
|
1960
2038
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1961
2039
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1962
2040
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1963
|
-
}).optional(),
|
|
2041
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1964
2042
|
configuration: import_v43.default.object({
|
|
1965
2043
|
name: NameConfig.default({
|
|
1966
2044
|
firstname: { required: true },
|
|
@@ -1979,26 +2057,41 @@ var NameField = BaseField.extend({
|
|
|
1979
2057
|
surname: { required: true }
|
|
1980
2058
|
}
|
|
1981
2059
|
}).optional()
|
|
1982
|
-
}).
|
|
2060
|
+
}).meta({
|
|
2061
|
+
description: "A field for entering a persons name",
|
|
2062
|
+
id: "NameField"
|
|
2063
|
+
});
|
|
1983
2064
|
var PhoneField = BaseField.extend({
|
|
1984
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2065
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1985
2066
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1986
|
-
}).
|
|
2067
|
+
}).meta({
|
|
2068
|
+
description: "A field for entering a phone number",
|
|
2069
|
+
id: "PhoneField"
|
|
2070
|
+
});
|
|
1987
2071
|
var IdField = BaseField.extend({
|
|
1988
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2072
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1989
2073
|
type: import_v43.default.literal(FieldType.ID)
|
|
1990
|
-
}).
|
|
2074
|
+
}).meta({
|
|
2075
|
+
description: "A field for entering an ID",
|
|
2076
|
+
id: "IdField"
|
|
2077
|
+
});
|
|
1991
2078
|
var Checkbox = BaseField.extend({
|
|
1992
2079
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1993
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1994
|
-
}).
|
|
2080
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
2081
|
+
}).meta({
|
|
2082
|
+
description: "A boolean checkbox field",
|
|
2083
|
+
id: "Checkbox"
|
|
2084
|
+
});
|
|
1995
2085
|
var Country = BaseField.extend({
|
|
1996
2086
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1997
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2087
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1998
2088
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1999
2089
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2000
2090
|
)
|
|
2001
|
-
}).
|
|
2091
|
+
}).meta({
|
|
2092
|
+
description: "A field for selecting a country",
|
|
2093
|
+
id: "Country"
|
|
2094
|
+
});
|
|
2002
2095
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
2003
2096
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
2004
2097
|
);
|
|
@@ -2007,28 +2100,33 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2007
2100
|
"HEALTH_FACILITY",
|
|
2008
2101
|
"CRVS_OFFICE"
|
|
2009
2102
|
]);
|
|
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
2103
|
var AdministrativeAreaField = BaseField.extend({
|
|
2016
2104
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2017
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2018
|
-
configuration:
|
|
2019
|
-
|
|
2105
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2106
|
+
configuration: import_v43.default.object({
|
|
2107
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
2108
|
+
type: AdministrativeAreas,
|
|
2109
|
+
allowedLocations: AllowedLocations
|
|
2110
|
+
}).describe("Administrative area options")
|
|
2111
|
+
}).meta({
|
|
2112
|
+
description: "Administrative area input field",
|
|
2113
|
+
id: "AdministrativeAreaField"
|
|
2114
|
+
});
|
|
2020
2115
|
var LocationInput = BaseField.extend({
|
|
2021
2116
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2022
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2117
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2023
2118
|
configuration: import_v43.default.object({
|
|
2024
2119
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2025
2120
|
allowedLocations: AllowedLocations
|
|
2026
2121
|
}).optional()
|
|
2027
|
-
}).
|
|
2122
|
+
}).meta({
|
|
2123
|
+
description: "A field for selecting a location",
|
|
2124
|
+
id: "LocationInput"
|
|
2125
|
+
});
|
|
2028
2126
|
var FileUploadWithOptions = BaseField.extend({
|
|
2029
2127
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2030
2128
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
2031
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
2129
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
2032
2130
|
configuration: import_v43.default.object({
|
|
2033
2131
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2034
2132
|
maxImageSize: import_v43.default.object({
|
|
@@ -2038,15 +2136,18 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2038
2136
|
}).default({
|
|
2039
2137
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2040
2138
|
})
|
|
2139
|
+
}).meta({
|
|
2140
|
+
description: "A field for uploading files with file type options",
|
|
2141
|
+
id: "FileUploadWithOptions"
|
|
2041
2142
|
});
|
|
2042
2143
|
var Facility = BaseField.extend({
|
|
2043
2144
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
2044
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2145
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2045
2146
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2046
2147
|
}).describe("Input field for a facility");
|
|
2047
2148
|
var Office = BaseField.extend({
|
|
2048
2149
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
2049
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2150
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2050
2151
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2051
2152
|
}).describe("Input field for an office");
|
|
2052
2153
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -2082,8 +2183,11 @@ var Address = BaseField.extend({
|
|
|
2082
2183
|
).optional(),
|
|
2083
2184
|
allowedLocations: AllowedLocations
|
|
2084
2185
|
}).optional(),
|
|
2085
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
2086
|
-
}).
|
|
2186
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
2187
|
+
}).meta({
|
|
2188
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2189
|
+
id: "Address"
|
|
2190
|
+
});
|
|
2087
2191
|
var StaticDataEntry = import_v43.default.object({
|
|
2088
2192
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2089
2193
|
label: TranslationConfig,
|
|
@@ -2098,7 +2202,10 @@ var DataField = BaseField.extend({
|
|
|
2098
2202
|
subtitle: TranslationConfig.optional(),
|
|
2099
2203
|
data: import_v43.default.array(DataEntry)
|
|
2100
2204
|
})
|
|
2101
|
-
}).
|
|
2205
|
+
}).meta({
|
|
2206
|
+
description: "A field for displaying a table of read-only data",
|
|
2207
|
+
id: "DataField"
|
|
2208
|
+
});
|
|
2102
2209
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2103
2210
|
var ButtonType = import_v43.default.enum([
|
|
2104
2211
|
"primary",
|
|
@@ -2123,13 +2230,19 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
2123
2230
|
});
|
|
2124
2231
|
var ButtonField = BaseField.extend({
|
|
2125
2232
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2126
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
2233
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
2127
2234
|
configuration: ButtonConfiguration
|
|
2128
|
-
}).
|
|
2235
|
+
}).meta({
|
|
2236
|
+
description: "A generic button that can be used to trigger an action",
|
|
2237
|
+
id: "ButtonField"
|
|
2238
|
+
});
|
|
2129
2239
|
var FieldGroup = BaseField.extend({
|
|
2130
2240
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2131
2241
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2132
2242
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2243
|
+
}).meta({
|
|
2244
|
+
description: "A group of fields that are displayed together",
|
|
2245
|
+
id: "FieldGroup"
|
|
2133
2246
|
});
|
|
2134
2247
|
var AlphaPrintButton = BaseField.extend({
|
|
2135
2248
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2139,10 +2252,13 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2139
2252
|
"Label for the print button"
|
|
2140
2253
|
)
|
|
2141
2254
|
})
|
|
2142
|
-
}).
|
|
2255
|
+
}).meta({
|
|
2256
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2257
|
+
id: "AlphaPrintButton"
|
|
2258
|
+
});
|
|
2143
2259
|
var HttpField = BaseField.extend({
|
|
2144
2260
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2145
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2261
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
2146
2262
|
configuration: import_v43.default.object({
|
|
2147
2263
|
trigger: FieldReference.optional().describe(
|
|
2148
2264
|
"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 +2271,30 @@ var HttpField = BaseField.extend({
|
|
|
2155
2271
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2156
2272
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2157
2273
|
})
|
|
2158
|
-
}).
|
|
2274
|
+
}).meta({
|
|
2275
|
+
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.",
|
|
2276
|
+
id: "HttpField"
|
|
2277
|
+
});
|
|
2159
2278
|
var AutocompleteField = BaseField.extend({
|
|
2160
2279
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2161
2280
|
configuration: import_v43.default.object({
|
|
2162
|
-
url: import_v43.default.string().describe(
|
|
2281
|
+
url: import_v43.default.string().describe(
|
|
2282
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2283
|
+
).optional(),
|
|
2163
2284
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2164
2285
|
defaultOptions: import_v43.default.array(
|
|
2165
2286
|
import_v43.default.object({
|
|
2166
2287
|
label: import_v43.default.string(),
|
|
2167
2288
|
value: import_v43.default.string()
|
|
2168
2289
|
})
|
|
2169
|
-
).optional()
|
|
2290
|
+
).optional().describe(
|
|
2291
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2292
|
+
)
|
|
2170
2293
|
})
|
|
2171
|
-
}).
|
|
2294
|
+
}).meta({
|
|
2295
|
+
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.",
|
|
2296
|
+
id: "AutocompleteField"
|
|
2297
|
+
});
|
|
2172
2298
|
var SearchField = HttpField.extend({
|
|
2173
2299
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2174
2300
|
configuration: SearchQuery.pick({
|
|
@@ -2201,6 +2327,9 @@ var SearchField = HttpField.extend({
|
|
|
2201
2327
|
ok: TranslationConfig.optional()
|
|
2202
2328
|
}).optional()
|
|
2203
2329
|
})
|
|
2330
|
+
}).meta({
|
|
2331
|
+
description: "A search input field",
|
|
2332
|
+
id: "SearchField"
|
|
2204
2333
|
});
|
|
2205
2334
|
var LinkButtonField = BaseField.extend({
|
|
2206
2335
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2209,28 +2338,35 @@ var LinkButtonField = BaseField.extend({
|
|
|
2209
2338
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2210
2339
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2211
2340
|
})
|
|
2212
|
-
}).
|
|
2341
|
+
}).meta({
|
|
2342
|
+
description: "A button that opens a URL link",
|
|
2343
|
+
id: "LinkButtonField"
|
|
2344
|
+
});
|
|
2213
2345
|
var VerificationStatus = BaseField.extend({
|
|
2214
2346
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2215
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2347
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2216
2348
|
configuration: import_v43.default.object({
|
|
2217
2349
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2218
2350
|
description: TranslationConfig.describe(
|
|
2219
2351
|
"Explaining text on the banner in form."
|
|
2220
2352
|
)
|
|
2221
2353
|
})
|
|
2354
|
+
}).meta({
|
|
2355
|
+
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.",
|
|
2356
|
+
id: "VerificationStatus"
|
|
2222
2357
|
});
|
|
2223
2358
|
var QueryParamReaderField = BaseField.extend({
|
|
2224
2359
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2225
2360
|
configuration: import_v43.default.object({
|
|
2226
2361
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2227
2362
|
})
|
|
2228
|
-
}).
|
|
2229
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2230
|
-
|
|
2363
|
+
}).meta({
|
|
2364
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2365
|
+
id: "QueryParamReaderField"
|
|
2366
|
+
});
|
|
2231
2367
|
var QrReaderField = BaseField.extend({
|
|
2232
2368
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2233
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2369
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2234
2370
|
configuration: import_v43.default.object({
|
|
2235
2371
|
validator: import_v43.default.any().meta({
|
|
2236
2372
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2238,21 +2374,27 @@ var QrReaderField = BaseField.extend({
|
|
|
2238
2374
|
})
|
|
2239
2375
|
}).optional()
|
|
2240
2376
|
}).meta({
|
|
2241
|
-
description: "
|
|
2377
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2242
2378
|
id: "QrReaderField"
|
|
2243
2379
|
});
|
|
2244
2380
|
var IdReaderField = BaseField.extend({
|
|
2245
2381
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2246
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2382
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2247
2383
|
methods: import_v43.default.array(
|
|
2248
2384
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2249
2385
|
)
|
|
2386
|
+
}).meta({
|
|
2387
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2388
|
+
id: "IdReaderField"
|
|
2250
2389
|
});
|
|
2251
2390
|
var CustomField = BaseField.extend({
|
|
2252
2391
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2253
2392
|
defaultValue: CustomFieldValue.optional(),
|
|
2254
2393
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2255
2394
|
configuration: import_v43.default.unknown().optional()
|
|
2395
|
+
}).meta({
|
|
2396
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2397
|
+
id: "CustomField"
|
|
2256
2398
|
});
|
|
2257
2399
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2258
2400
|
var LoaderField = BaseField.extend({
|
|
@@ -2262,22 +2404,25 @@ var LoaderField = BaseField.extend({
|
|
|
2262
2404
|
configuration: import_v43.default.object({
|
|
2263
2405
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2264
2406
|
})
|
|
2265
|
-
}).
|
|
2266
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2267
|
-
|
|
2407
|
+
}).meta({
|
|
2408
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2409
|
+
id: "LoaderField"
|
|
2410
|
+
});
|
|
2268
2411
|
var HiddenField = BaseField.extend({
|
|
2269
2412
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2270
2413
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2271
2414
|
defaultValue: TextValue.optional()
|
|
2272
|
-
}).
|
|
2273
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2274
|
-
|
|
2415
|
+
}).meta({
|
|
2416
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2417
|
+
id: "HiddenField"
|
|
2418
|
+
});
|
|
2275
2419
|
var UserRoleField = BaseField.extend({
|
|
2276
2420
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2277
2421
|
defaultValue: TextValue.optional()
|
|
2278
|
-
}).
|
|
2279
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2280
|
-
|
|
2422
|
+
}).meta({
|
|
2423
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2424
|
+
id: "UserRoleField"
|
|
2425
|
+
});
|
|
2281
2426
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2282
2427
|
FieldGroup,
|
|
2283
2428
|
Address,
|
|
@@ -2376,16 +2521,19 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2376
2521
|
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2377
2522
|
actions: VerificationActionConfig
|
|
2378
2523
|
});
|
|
2379
|
-
var PageConfig = z21.discriminatedUnion("type", [
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2524
|
+
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2525
|
+
id: "PageConfig",
|
|
2526
|
+
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."
|
|
2527
|
+
});
|
|
2383
2528
|
|
|
2384
2529
|
// ../commons/src/events/FormConfig.ts
|
|
2385
2530
|
var DeclarationFormConfig = z22.object({
|
|
2386
2531
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2387
2532
|
pages: z22.array(FormPageConfig)
|
|
2388
|
-
}).
|
|
2533
|
+
}).meta({
|
|
2534
|
+
id: "DeclarationFormConfig",
|
|
2535
|
+
description: "Configuration of the declaration form."
|
|
2536
|
+
});
|
|
2389
2537
|
var ActionFormConfig = z22.object({
|
|
2390
2538
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2391
2539
|
pages: z22.array(PageConfig)
|
|
@@ -2485,6 +2633,9 @@ var DeduplicationConfig = z23.object({
|
|
|
2485
2633
|
id: z23.string(),
|
|
2486
2634
|
label: TranslationConfig,
|
|
2487
2635
|
query: Clause
|
|
2636
|
+
}).meta({
|
|
2637
|
+
id: "DeduplicationConfig",
|
|
2638
|
+
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
2639
|
});
|
|
2489
2640
|
|
|
2490
2641
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -2602,17 +2753,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2602
2753
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2603
2754
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2604
2755
|
*/
|
|
2605
|
-
ReadActionConfig.meta({
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2756
|
+
ReadActionConfig.meta({
|
|
2757
|
+
id: "ReadActionConfig",
|
|
2758
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2759
|
+
}),
|
|
2760
|
+
DeclareConfig.meta({
|
|
2761
|
+
id: "DeclareActionConfig",
|
|
2762
|
+
description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
|
|
2763
|
+
}),
|
|
2764
|
+
RejectConfig.meta({
|
|
2765
|
+
id: "RejectActionConfig",
|
|
2766
|
+
description: "Configuration for rejecting a record before registration."
|
|
2767
|
+
}),
|
|
2768
|
+
RegisterConfig.meta({
|
|
2769
|
+
id: "RegisterActionConfig",
|
|
2770
|
+
description: "Configuration for registering a record."
|
|
2771
|
+
}),
|
|
2609
2772
|
PrintCertificateActionConfig.meta({
|
|
2610
|
-
id: "PrintCertificateActionConfig"
|
|
2773
|
+
id: "PrintCertificateActionConfig",
|
|
2774
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
2611
2775
|
}),
|
|
2612
|
-
RequestCorrectionConfig.meta({
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2776
|
+
RequestCorrectionConfig.meta({
|
|
2777
|
+
id: "RequestCorrectionActionConfig",
|
|
2778
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
2779
|
+
}),
|
|
2780
|
+
EditActionConfig.meta({
|
|
2781
|
+
id: "EditActionConfig",
|
|
2782
|
+
description: "Configuration for editing a record before registration."
|
|
2783
|
+
}),
|
|
2784
|
+
ArchiveConfig.meta({
|
|
2785
|
+
id: "ArchiveActionConfig",
|
|
2786
|
+
description: "Configuration for archiving a record."
|
|
2787
|
+
}),
|
|
2788
|
+
CustomActionConfig.meta({
|
|
2789
|
+
id: "CustomActionConfig",
|
|
2790
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
2791
|
+
})
|
|
2616
2792
|
]).describe(
|
|
2617
2793
|
"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
2794
|
).meta({ id: "ActionConfig" });
|
|
@@ -2688,7 +2864,10 @@ var Field = BaseField2.extend({
|
|
|
2688
2864
|
}).describe("Custom field defined for the summary view.");
|
|
2689
2865
|
var SummaryConfig = z27.object({
|
|
2690
2866
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2691
|
-
}).
|
|
2867
|
+
}).meta({
|
|
2868
|
+
id: "SummaryConfig",
|
|
2869
|
+
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."
|
|
2870
|
+
});
|
|
2692
2871
|
|
|
2693
2872
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2694
2873
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -2812,6 +2991,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
2812
2991
|
var AdvancedSearchConfig = z28.object({
|
|
2813
2992
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2814
2993
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2994
|
+
}).meta({
|
|
2995
|
+
id: "AdvancedSearchConfig",
|
|
2996
|
+
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
2997
|
});
|
|
2816
2998
|
|
|
2817
2999
|
// ../commons/src/events/utils.ts
|
|
@@ -2862,7 +3044,37 @@ function resolveDataPath(rootData, dataPath, instancePath) {
|
|
|
2862
3044
|
}
|
|
2863
3045
|
return current;
|
|
2864
3046
|
}
|
|
3047
|
+
function todayISO() {
|
|
3048
|
+
return (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" });
|
|
3049
|
+
}
|
|
3050
|
+
var compiledFunctionCache = /* @__PURE__ */ new Map();
|
|
3051
|
+
function compileClientFunction(code) {
|
|
3052
|
+
let fn = compiledFunctionCache.get(code);
|
|
3053
|
+
if (!fn) {
|
|
3054
|
+
fn = new Function(`return (${code})`)();
|
|
3055
|
+
compiledFunctionCache.set(code, fn);
|
|
3056
|
+
}
|
|
3057
|
+
return fn;
|
|
3058
|
+
}
|
|
2865
3059
|
(0, import_ajv_formats.default)(ajv);
|
|
3060
|
+
function buildClientFunctionContext(input) {
|
|
3061
|
+
return {
|
|
3062
|
+
$form: input.form,
|
|
3063
|
+
$now: todayISO(),
|
|
3064
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3065
|
+
$online: isOnline(),
|
|
3066
|
+
$user: input.validatorContext?.user,
|
|
3067
|
+
$event: input.validatorContext?.event,
|
|
3068
|
+
$leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
|
|
3069
|
+
user: input.systemVariables?.user,
|
|
3070
|
+
$window: input.systemVariables?.$window,
|
|
3071
|
+
locations: input.locations,
|
|
3072
|
+
adminLevelIds: input.adminLevelIds
|
|
3073
|
+
};
|
|
3074
|
+
}
|
|
3075
|
+
function runClientFunction(code, data, context) {
|
|
3076
|
+
return compileClientFunction(code)(data, context);
|
|
3077
|
+
}
|
|
2866
3078
|
ajv.addKeyword({
|
|
2867
3079
|
keyword: "daysFromDate",
|
|
2868
3080
|
type: "string",
|
|
@@ -2907,12 +3119,35 @@ ajv.addKeyword({
|
|
|
2907
3119
|
$data: true,
|
|
2908
3120
|
errors: true,
|
|
2909
3121
|
// @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(
|
|
3122
|
+
validate(_schema, data, _2, dataContext) {
|
|
2911
3123
|
const locationIdInput = data;
|
|
2912
3124
|
const locations = dataContext?.rootData.$leafAdminStructureLocationIds ?? [];
|
|
2913
3125
|
return locations.some((location) => location.id === locationIdInput);
|
|
2914
3126
|
}
|
|
2915
3127
|
});
|
|
3128
|
+
ajv.addKeyword({
|
|
3129
|
+
keyword: "customClientValidator",
|
|
3130
|
+
schemaType: "object",
|
|
3131
|
+
errors: true,
|
|
3132
|
+
// @ts-expect-error -- AJV's public types don't expose `rootData`. All
|
|
3133
|
+
// `validate()` callers build root data via `buildClientFunctionContext`,
|
|
3134
|
+
// so the cast holds.
|
|
3135
|
+
validate(schema, data, _2, dataContext) {
|
|
3136
|
+
return Boolean(
|
|
3137
|
+
runClientFunction(
|
|
3138
|
+
schema.code,
|
|
3139
|
+
data,
|
|
3140
|
+
dataContext?.rootData ?? buildClientFunctionContext({ form: {} })
|
|
3141
|
+
)
|
|
3142
|
+
);
|
|
3143
|
+
}
|
|
3144
|
+
});
|
|
3145
|
+
function isOnline() {
|
|
3146
|
+
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
|
3147
|
+
return navigator.onLine;
|
|
3148
|
+
}
|
|
3149
|
+
return true;
|
|
3150
|
+
}
|
|
2916
3151
|
|
|
2917
3152
|
// ../commons/src/utils.ts
|
|
2918
3153
|
var z32 = __toESM(require("zod/v4"));
|
|
@@ -3531,7 +3766,54 @@ function createFieldConditionals(fieldId) {
|
|
|
3531
3766
|
}
|
|
3532
3767
|
},
|
|
3533
3768
|
required: [fieldId]
|
|
3534
|
-
})
|
|
3769
|
+
}),
|
|
3770
|
+
/**
|
|
3771
|
+
* Custom client-side validator. The provided function is serialised and executed
|
|
3772
|
+
* just-in-time on the client only. External references (e.g. lodash) are not
|
|
3773
|
+
* available inside the function body — all logic must be self-contained.
|
|
3774
|
+
*
|
|
3775
|
+
* @example
|
|
3776
|
+
* field('nid').customClientValidator((value) => {
|
|
3777
|
+
* // LUHN check — all logic must be inline
|
|
3778
|
+
* const digits = String(value).split('').map(Number)
|
|
3779
|
+
* // ...
|
|
3780
|
+
* return isValid
|
|
3781
|
+
* })
|
|
3782
|
+
*/
|
|
3783
|
+
customClientValidator(validationFn) {
|
|
3784
|
+
const code = validationFn.toString();
|
|
3785
|
+
return defineFormConditional({
|
|
3786
|
+
type: "object",
|
|
3787
|
+
properties: wrapToPath(
|
|
3788
|
+
{ [fieldId]: { customClientValidator: { code } } },
|
|
3789
|
+
this.$$subfield
|
|
3790
|
+
),
|
|
3791
|
+
required: [fieldId]
|
|
3792
|
+
});
|
|
3793
|
+
},
|
|
3794
|
+
/**
|
|
3795
|
+
* Custom client-side evaluation. Returns a {@link FieldReference} descriptor
|
|
3796
|
+
* that can be used as the `value` property or a DATA component entry.
|
|
3797
|
+
* The function receives the referenced field's value as the first argument and
|
|
3798
|
+
* the full form context as the second; its return value replaces the field reference.
|
|
3799
|
+
* The function is serialised and executed just-in-time on the client only.
|
|
3800
|
+
* External references (e.g. lodash) are not available inside the function body.
|
|
3801
|
+
*
|
|
3802
|
+
* For computing a default value without referencing a specific field, use
|
|
3803
|
+
* `evaluate(fn)` in the `defaultValue` property instead.
|
|
3804
|
+
*
|
|
3805
|
+
* @example
|
|
3806
|
+
* field('a').customClientEvaluation((aValue, ctx) =>
|
|
3807
|
+
* Number(aValue) + Number(ctx.$form.b)
|
|
3808
|
+
* )
|
|
3809
|
+
*/
|
|
3810
|
+
customClientEvaluation(computationFn) {
|
|
3811
|
+
return {
|
|
3812
|
+
$$code: computationFn.toString(),
|
|
3813
|
+
$$field: fieldId,
|
|
3814
|
+
$$subfield: this.$$subfield
|
|
3815
|
+
};
|
|
3816
|
+
}
|
|
3535
3817
|
};
|
|
3536
3818
|
}
|
|
3537
3819
|
|
|
@@ -3679,7 +3961,7 @@ var _EventConfigBase = z33.object({
|
|
|
3679
3961
|
),
|
|
3680
3962
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
3681
3963
|
actions: z33.array(ActionConfig).describe(
|
|
3682
|
-
"Configuration of
|
|
3964
|
+
"Configuration of core and custom actions associated with the event."
|
|
3683
3965
|
),
|
|
3684
3966
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
3685
3967
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -3691,7 +3973,7 @@ var _EventConfigBase = z33.object({
|
|
|
3691
3973
|
"Configuration of fields available in the advanced search feature."
|
|
3692
3974
|
),
|
|
3693
3975
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
3694
|
-
"Configuration of flags associated with the actions of this event type."
|
|
3976
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
3695
3977
|
),
|
|
3696
3978
|
analytics: z33.boolean().optional().default(true).describe(
|
|
3697
3979
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -3704,8 +3986,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
3704
3986
|
validateActionFlags(event2, ctx);
|
|
3705
3987
|
validateActionOrder(event2, ctx);
|
|
3706
3988
|
}).meta({
|
|
3707
|
-
id: "EventConfig"
|
|
3708
|
-
|
|
3989
|
+
id: "EventConfig",
|
|
3990
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
3991
|
+
});
|
|
3709
3992
|
|
|
3710
3993
|
// ../commons/src/events/EventConfigInput.ts
|
|
3711
3994
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -3927,6 +4210,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
3927
4210
|
var WorkqueueColumn = z34.object({
|
|
3928
4211
|
label: TranslationConfig,
|
|
3929
4212
|
value: WorkqueueColumnValue
|
|
4213
|
+
}).meta({
|
|
4214
|
+
id: "WorkqueueColumn",
|
|
4215
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
3930
4216
|
});
|
|
3931
4217
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
3932
4218
|
return workqueueColumns.map(
|
|
@@ -4129,18 +4415,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4129
4415
|
query: true,
|
|
4130
4416
|
columns: true
|
|
4131
4417
|
});
|
|
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()
|
|
4418
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4419
|
+
query: CountryConfigQueryInputType
|
|
4420
|
+
}).meta({
|
|
4421
|
+
id: "WorkqueueConfig",
|
|
4422
|
+
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
4423
|
});
|
|
4145
4424
|
var WorkqueueCountInput = z37.array(
|
|
4146
4425
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4180,6 +4459,11 @@ var BaseActionInput = z38.object({
|
|
|
4180
4459
|
originalActionId: UUID.optional(),
|
|
4181
4460
|
// should not be part of base action.
|
|
4182
4461
|
keepAssignment: z38.boolean().optional(),
|
|
4462
|
+
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
4463
|
+
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
4464
|
+
waitFor: z38.boolean().default(true).describe(
|
|
4465
|
+
"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."
|
|
4466
|
+
),
|
|
4183
4467
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4184
4468
|
// @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
4469
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4297,7 +4581,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
|
4297
4581
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4298
4582
|
z38.object({
|
|
4299
4583
|
requestId: z38.string(),
|
|
4300
|
-
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4584
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
4585
|
+
content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
|
|
4301
4586
|
}).shape
|
|
4302
4587
|
);
|
|
4303
4588
|
var ReadActionInput = BaseActionInput.extend(
|
|
@@ -4359,7 +4644,7 @@ var Draft = z39.object({
|
|
|
4359
4644
|
}).describe(
|
|
4360
4645
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
4361
4646
|
);
|
|
4362
|
-
var DraftInput = BaseActionInput.extend({
|
|
4647
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
4363
4648
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4364
4649
|
status: z39.enum([
|
|
4365
4650
|
ActionStatus.Requested,
|
|
@@ -6957,6 +7242,369 @@ var ACTION_FILTERS = {
|
|
|
6957
7242
|
// ../commons/src/events/FileUtils.ts
|
|
6958
7243
|
var import_lodash7 = require("lodash");
|
|
6959
7244
|
|
|
7245
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
7246
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
7247
|
+
{
|
|
7248
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7249
|
+
name: "Central",
|
|
7250
|
+
parentId: null,
|
|
7251
|
+
validUntil: null,
|
|
7252
|
+
externalId: "ydyJb1RAy4U1"
|
|
7253
|
+
},
|
|
7254
|
+
{
|
|
7255
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7256
|
+
name: "Sulaka",
|
|
7257
|
+
parentId: null,
|
|
7258
|
+
validUntil: null,
|
|
7259
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
7260
|
+
},
|
|
7261
|
+
{
|
|
7262
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
7263
|
+
name: "Pualula",
|
|
7264
|
+
parentId: null,
|
|
7265
|
+
validUntil: null,
|
|
7266
|
+
externalId: "Aq91DweLmT8k"
|
|
7267
|
+
},
|
|
7268
|
+
{
|
|
7269
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
7270
|
+
name: "Chuminga",
|
|
7271
|
+
parentId: null,
|
|
7272
|
+
validUntil: null,
|
|
7273
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
7274
|
+
},
|
|
7275
|
+
{
|
|
7276
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7277
|
+
name: "Ibombo",
|
|
7278
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7279
|
+
validUntil: null,
|
|
7280
|
+
externalId: "k7DsP4vbN1Qe"
|
|
7281
|
+
},
|
|
7282
|
+
{
|
|
7283
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7284
|
+
name: "Isango",
|
|
7285
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7286
|
+
validUntil: null,
|
|
7287
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
7288
|
+
},
|
|
7289
|
+
{
|
|
7290
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7291
|
+
name: "Isamba",
|
|
7292
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7293
|
+
validUntil: null,
|
|
7294
|
+
externalId: "sT0xVu1KqJ7r"
|
|
7295
|
+
},
|
|
7296
|
+
{
|
|
7297
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7298
|
+
name: "Itambo",
|
|
7299
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7300
|
+
validUntil: null,
|
|
7301
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
7302
|
+
},
|
|
7303
|
+
{
|
|
7304
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
7305
|
+
name: "Ezhi",
|
|
7306
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7307
|
+
validUntil: null,
|
|
7308
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
7309
|
+
},
|
|
7310
|
+
{
|
|
7311
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7312
|
+
name: "Ilanga",
|
|
7313
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7314
|
+
validUntil: null,
|
|
7315
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
7316
|
+
},
|
|
7317
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
7318
|
+
{
|
|
7319
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7320
|
+
name: "Klow",
|
|
7321
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7322
|
+
validUntil: null,
|
|
7323
|
+
externalId: "IkYcYBUcyY2"
|
|
7324
|
+
},
|
|
7325
|
+
{
|
|
7326
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
7327
|
+
name: "Mbondo",
|
|
7328
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7329
|
+
validUntil: null,
|
|
7330
|
+
externalId: "Qhvv5hvo3mY"
|
|
7331
|
+
},
|
|
7332
|
+
{
|
|
7333
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
7334
|
+
name: "Ndara",
|
|
7335
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7336
|
+
validUntil: null,
|
|
7337
|
+
externalId: "crXh068O9TR"
|
|
7338
|
+
},
|
|
7339
|
+
{
|
|
7340
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
7341
|
+
name: "Olani",
|
|
7342
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7343
|
+
validUntil: null,
|
|
7344
|
+
externalId: "r00It8Tvvp7"
|
|
7345
|
+
},
|
|
7346
|
+
{
|
|
7347
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
7348
|
+
name: "Pemba",
|
|
7349
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7350
|
+
validUntil: null,
|
|
7351
|
+
externalId: "ZnUWsbONIaH"
|
|
7352
|
+
},
|
|
7353
|
+
{
|
|
7354
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
7355
|
+
name: "Quanza",
|
|
7356
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7357
|
+
validUntil: null,
|
|
7358
|
+
externalId: "fDZycvQTa7l"
|
|
7359
|
+
},
|
|
7360
|
+
{
|
|
7361
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
7362
|
+
name: "Rivka",
|
|
7363
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7364
|
+
validUntil: null,
|
|
7365
|
+
externalId: "KqswxCGTELa"
|
|
7366
|
+
},
|
|
7367
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
7368
|
+
{
|
|
7369
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
7370
|
+
name: "Mbula",
|
|
7371
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7372
|
+
validUntil: null,
|
|
7373
|
+
externalId: "osEbKjRc9Kg"
|
|
7374
|
+
},
|
|
7375
|
+
{
|
|
7376
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
7377
|
+
name: "Ndoki",
|
|
7378
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7379
|
+
validUntil: null,
|
|
7380
|
+
externalId: "aq4daBUAGr3"
|
|
7381
|
+
},
|
|
7382
|
+
{
|
|
7383
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
7384
|
+
name: "Tsanga",
|
|
7385
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7386
|
+
validUntil: null,
|
|
7387
|
+
externalId: "cqis6Y8trbJ"
|
|
7388
|
+
},
|
|
7389
|
+
{
|
|
7390
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
7391
|
+
name: "Waziri",
|
|
7392
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7393
|
+
validUntil: null,
|
|
7394
|
+
externalId: "LMijHPyyx6d"
|
|
7395
|
+
},
|
|
7396
|
+
{
|
|
7397
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
7398
|
+
name: "Zimbi",
|
|
7399
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7400
|
+
validUntil: null,
|
|
7401
|
+
externalId: "pcQYbPuKGZ7"
|
|
7402
|
+
},
|
|
7403
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
7404
|
+
{
|
|
7405
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
7406
|
+
name: "Felani",
|
|
7407
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7408
|
+
validUntil: null,
|
|
7409
|
+
externalId: "gSqpoCGdMXp"
|
|
7410
|
+
},
|
|
7411
|
+
{
|
|
7412
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
7413
|
+
name: "Goroma",
|
|
7414
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7415
|
+
validUntil: null,
|
|
7416
|
+
externalId: "KvAAIaNqVrp"
|
|
7417
|
+
},
|
|
7418
|
+
{
|
|
7419
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
7420
|
+
name: "Halifu",
|
|
7421
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7422
|
+
validUntil: null,
|
|
7423
|
+
externalId: "qe4UnEVt1hv"
|
|
7424
|
+
},
|
|
7425
|
+
{
|
|
7426
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
7427
|
+
name: "Jabari",
|
|
7428
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7429
|
+
validUntil: null,
|
|
7430
|
+
externalId: "yHH9Nz4rLOt"
|
|
7431
|
+
},
|
|
7432
|
+
{
|
|
7433
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
7434
|
+
name: "Kifani",
|
|
7435
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7436
|
+
validUntil: null,
|
|
7437
|
+
externalId: "eSWmXIGeu1I"
|
|
7438
|
+
},
|
|
7439
|
+
{
|
|
7440
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
7441
|
+
name: "Lumela",
|
|
7442
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7443
|
+
validUntil: null,
|
|
7444
|
+
externalId: "bh0b3aI1uP3"
|
|
7445
|
+
}
|
|
7446
|
+
];
|
|
7447
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
7448
|
+
{
|
|
7449
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
7450
|
+
name: "Central Provincial Office",
|
|
7451
|
+
locationType: "CRVS_OFFICE",
|
|
7452
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7453
|
+
validUntil: null,
|
|
7454
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
7455
|
+
},
|
|
7456
|
+
{
|
|
7457
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
7458
|
+
name: "Central Health Post",
|
|
7459
|
+
locationType: "HEALTH_FACILITY",
|
|
7460
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7461
|
+
validUntil: null
|
|
7462
|
+
},
|
|
7463
|
+
{
|
|
7464
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
7465
|
+
name: "Ibombo District Office",
|
|
7466
|
+
locationType: "CRVS_OFFICE",
|
|
7467
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7468
|
+
validUntil: null,
|
|
7469
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
7470
|
+
},
|
|
7471
|
+
{
|
|
7472
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
7473
|
+
name: "Isamba District Office",
|
|
7474
|
+
locationType: "CRVS_OFFICE",
|
|
7475
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7476
|
+
validUntil: null,
|
|
7477
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
7478
|
+
},
|
|
7479
|
+
{
|
|
7480
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
7481
|
+
name: "Isango District Office",
|
|
7482
|
+
locationType: "CRVS_OFFICE",
|
|
7483
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7484
|
+
validUntil: null,
|
|
7485
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
7486
|
+
},
|
|
7487
|
+
{
|
|
7488
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
7489
|
+
name: "Sulaka Provincial Office",
|
|
7490
|
+
locationType: "CRVS_OFFICE",
|
|
7491
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7492
|
+
validUntil: null,
|
|
7493
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
7494
|
+
},
|
|
7495
|
+
{
|
|
7496
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
7497
|
+
name: "Ilanga District Office",
|
|
7498
|
+
locationType: "CRVS_OFFICE",
|
|
7499
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7500
|
+
validUntil: null,
|
|
7501
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
7502
|
+
},
|
|
7503
|
+
{
|
|
7504
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
7505
|
+
name: "Chamakubi Health Post",
|
|
7506
|
+
locationType: "HEALTH_FACILITY",
|
|
7507
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7508
|
+
validUntil: null,
|
|
7509
|
+
externalId: "M1nFr8LbC2Qy"
|
|
7510
|
+
},
|
|
7511
|
+
{
|
|
7512
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
7513
|
+
name: "Ibombo Rural Health Centre",
|
|
7514
|
+
locationType: "HEALTH_FACILITY",
|
|
7515
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7516
|
+
validUntil: null,
|
|
7517
|
+
externalId: "bT7pV6YrW0Xc"
|
|
7518
|
+
},
|
|
7519
|
+
{
|
|
7520
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
7521
|
+
name: "Chikobo Rural Health Centre",
|
|
7522
|
+
locationType: "HEALTH_FACILITY",
|
|
7523
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7524
|
+
validUntil: null,
|
|
7525
|
+
externalId: "zE4qPn2SgJ5d"
|
|
7526
|
+
},
|
|
7527
|
+
{
|
|
7528
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
7529
|
+
name: "Chilochabalenje Health Post",
|
|
7530
|
+
locationType: "HEALTH_FACILITY",
|
|
7531
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7532
|
+
validUntil: null,
|
|
7533
|
+
externalId: "H8vDs1MqR4Uf"
|
|
7534
|
+
},
|
|
7535
|
+
{
|
|
7536
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
7537
|
+
name: "Chipeso Rural Health Centre",
|
|
7538
|
+
locationType: "HEALTH_FACILITY",
|
|
7539
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7540
|
+
validUntil: null,
|
|
7541
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
7542
|
+
},
|
|
7543
|
+
{
|
|
7544
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
7545
|
+
name: "Chisamba Rural Health Centre",
|
|
7546
|
+
locationType: "HEALTH_FACILITY",
|
|
7547
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7548
|
+
validUntil: null,
|
|
7549
|
+
externalId: "Yr0pCg8LdM2s"
|
|
7550
|
+
},
|
|
7551
|
+
{
|
|
7552
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
7553
|
+
name: "Chitanda Rural Health Centre",
|
|
7554
|
+
locationType: "HEALTH_FACILITY",
|
|
7555
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7556
|
+
validUntil: null,
|
|
7557
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
7558
|
+
},
|
|
7559
|
+
{
|
|
7560
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
7561
|
+
name: "Golden Valley Rural Health Centre",
|
|
7562
|
+
locationType: "HEALTH_FACILITY",
|
|
7563
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7564
|
+
validUntil: null,
|
|
7565
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
7566
|
+
},
|
|
7567
|
+
{
|
|
7568
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
7569
|
+
name: "Ipongo Rural Health Centre",
|
|
7570
|
+
locationType: "HEALTH_FACILITY",
|
|
7571
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7572
|
+
validUntil: null,
|
|
7573
|
+
externalId: "kF2sW9DmH0Bt"
|
|
7574
|
+
},
|
|
7575
|
+
{
|
|
7576
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
7577
|
+
name: "Itumbwe Health Post",
|
|
7578
|
+
locationType: "HEALTH_FACILITY",
|
|
7579
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7580
|
+
validUntil: null,
|
|
7581
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
7582
|
+
},
|
|
7583
|
+
{
|
|
7584
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
7585
|
+
name: "Kabangalala Rural Health Centre",
|
|
7586
|
+
locationType: "HEALTH_FACILITY",
|
|
7587
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7588
|
+
validUntil: null,
|
|
7589
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
7590
|
+
},
|
|
7591
|
+
// Village offices
|
|
7592
|
+
{
|
|
7593
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
7594
|
+
name: "Klow Village Office",
|
|
7595
|
+
locationType: "CRVS_OFFICE",
|
|
7596
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7597
|
+
validUntil: null,
|
|
7598
|
+
externalId: "PmAyxAJkxiJ"
|
|
7599
|
+
}
|
|
7600
|
+
];
|
|
7601
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
7602
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
7603
|
+
);
|
|
7604
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
7605
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7606
|
+
);
|
|
7607
|
+
|
|
6960
7608
|
// ../commons/src/notification/UserNotifications.ts
|
|
6961
7609
|
var z44 = __toESM(require("zod/v4"));
|
|
6962
7610
|
var TriggerEvent = {
|