@opencrvs/toolkit 2.0.0-rc.edee239 → 2.0.0-rc.ee6f4f7

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