@opencrvs/toolkit 2.0.0-rc.f3bc98a → 2.0.0-rc.f5b6bcb

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 (51) hide show
  1. package/create-countryconfig/index.js +73 -0
  2. package/create-countryconfig/package.json +11 -0
  3. package/dist/application-config/index.js +209 -83
  4. package/dist/cli.js +504 -170
  5. package/dist/commons/api/router.d.ts +3322 -268
  6. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  7. package/dist/commons/conditionals/validate.d.ts +1 -0
  8. package/dist/commons/events/ActionInput.d.ts +108 -0
  9. package/dist/commons/events/Draft.d.ts +3 -0
  10. package/dist/commons/events/EventIndex.d.ts +0 -3
  11. package/dist/commons/events/EventMetadata.d.ts +0 -7
  12. package/dist/commons/events/FieldConfig.d.ts +5 -0
  13. package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
  14. package/dist/commons/events/locations.d.ts +21 -0
  15. package/dist/commons/events/mocks.test.utils.d.ts +19 -0
  16. package/dist/commons/events/scopes.d.ts +24 -1
  17. package/dist/commons/events/state/index.d.ts +0 -4
  18. package/dist/commons/events/state/utils.d.ts +0 -2
  19. package/dist/commons/events/utils.d.ts +1 -1
  20. package/dist/conditionals/index.js +5 -3
  21. package/dist/events/index.js +291 -131
  22. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
  23. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +60 -35
  24. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  25. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  26. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -2
  27. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +9 -1
  28. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -1
  29. package/dist/migrations/v2.0/delete-infrastructure-directory.js +66 -20
  30. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
  31. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
  32. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
  33. package/dist/migrations/v2.0/index.d.ts +5 -3
  34. package/dist/migrations/v2.0/index.d.ts.map +1 -1
  35. package/dist/migrations/v2.0/index.js +502 -168
  36. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
  37. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +90 -1
  38. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +11 -1
  39. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -1
  40. package/dist/migrations/v2.0/merge-infrastructure-directory.js +17 -16
  41. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
  42. package/dist/migrations/v2.0/migrate-scopes.js +54 -30
  43. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
  44. package/dist/migrations/v2.0/migrate-workqueue-configs.js +140 -59
  45. package/dist/notification/index.js +223 -101
  46. package/dist/scopes/index.d.ts +6 -1
  47. package/dist/scopes/index.js +5 -3
  48. package/opencrvs-toolkit-2.0.0-rc.f5b6bcb.tgz +0 -0
  49. package/package.json +1 -1
  50. package/tsconfig.tsbuildinfo +1 -1
  51. package/opencrvs-toolkit-2.0.0-rc.f3bc98a.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
  ]);
@@ -650,7 +652,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
650
652
  ShowConditional,
651
653
  // Action can be shown to the user in the list but as disabled
652
654
  EnableConditional
653
- ]);
655
+ ]).meta({
656
+ description: "Action conditional configuration",
657
+ id: "ActionConditional"
658
+ });
654
659
  var DisplayOnReviewConditional = z7.object({
655
660
  type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
656
661
  conditional: Conditional
@@ -978,28 +983,20 @@ function schemaPriority(schema) {
978
983
  return idx === -1 ? 9999 : idx;
979
984
  }
980
985
  function safeUnion(schemas) {
986
+ const sortedSchemas = [...schemas].sort(
987
+ (a, b) => schemaPriority(a) - schemaPriority(b)
988
+ );
981
989
  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
- });
990
+ for (const schema of sortedSchemas) {
991
+ if (schema.safeParse(val).success) {
992
+ return;
993
+ }
1002
994
  }
995
+ ctx.addIssue({
996
+ code: "invalid_type",
997
+ expected: "custom",
998
+ message: "Value does not match any schema"
999
+ });
1003
1000
  }).meta({
1004
1001
  description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
1005
1002
  });
@@ -1309,6 +1306,9 @@ var FlagConfig = z15.object({
1309
1306
  "Indicates if this flag expects an action to be performed to be cleared."
1310
1307
  ),
1311
1308
  label: TranslationConfig.describe("Human readable label of the flag.")
1309
+ }).meta({
1310
+ description: "Flag configuration",
1311
+ id: "FlagConfig"
1312
1312
  });
1313
1313
  var ActionFlagConfig = z15.object({
1314
1314
  id: Flag,
@@ -1316,6 +1316,9 @@ var ActionFlagConfig = z15.object({
1316
1316
  conditional: Conditional.optional().describe(
1317
1317
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1318
1318
  )
1319
+ }).meta({
1320
+ description: "Action flag configuration",
1321
+ id: "ActionFlagConfig"
1319
1322
  });
1320
1323
 
1321
1324
  // ../commons/src/events/EventMetadata.ts
@@ -1337,8 +1340,7 @@ var ActionCreationMetadata = z16.object({
1337
1340
  ),
1338
1341
  createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1339
1342
  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.")
1343
+ createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
1342
1344
  });
1343
1345
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1344
1346
  registrationNumber: z16.string().describe(
@@ -1366,9 +1368,6 @@ var EventMetadata = z16.object({
1366
1368
  createdAtLocation: UUID.nullish().describe(
1367
1369
  "Location of the user who created the event."
1368
1370
  ),
1369
- createdBySignature: DocumentPath.nullish().describe(
1370
- "Signature of the user who created the event."
1371
- ),
1372
1371
  updatedAtLocation: UUID.nullish().describe(
1373
1372
  "Location of the user who last changed the status."
1374
1373
  ),
@@ -1661,7 +1660,7 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
1661
1660
  }
1662
1661
  }).describe("Unique identifier for the field");
1663
1662
  var FieldReference = import_v43.default.object({
1664
- $$field: FieldId,
1663
+ $$field: FieldId.describe("Id of the field to reference"),
1665
1664
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
1666
1665
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
1667
1666
  )
@@ -1707,6 +1706,9 @@ var BaseField = import_v43.default.object({
1707
1706
  }).describe("Common properties shared across all field types.");
1708
1707
  var Divider = BaseField.extend({
1709
1708
  type: import_v43.default.literal(FieldType.DIVIDER)
1709
+ }).meta({
1710
+ description: "A horizontal line divider",
1711
+ id: "Divider"
1710
1712
  });
1711
1713
  var TextField = BaseField.extend({
1712
1714
  type: import_v43.default.literal(FieldType.TEXT),
@@ -1717,7 +1719,10 @@ var TextField = BaseField.extend({
1717
1719
  prefix: TranslationConfig.optional(),
1718
1720
  postfix: TranslationConfig.optional()
1719
1721
  }).default({ type: "text" }).optional()
1720
- }).describe("Text input");
1722
+ }).meta({
1723
+ description: "A text input field",
1724
+ id: "TextField"
1725
+ });
1721
1726
  var NumberField = BaseField.extend({
1722
1727
  type: import_v43.default.literal(FieldType.NUMBER),
1723
1728
  defaultValue: NumberFieldValue.optional(),
@@ -1727,7 +1732,10 @@ var NumberField = BaseField.extend({
1727
1732
  prefix: TranslationConfig.optional(),
1728
1733
  postfix: TranslationConfig.optional()
1729
1734
  }).optional()
1730
- }).describe("Number input");
1735
+ }).meta({
1736
+ description: "A number input field",
1737
+ id: "NumberField"
1738
+ });
1731
1739
  var TextAreaField = BaseField.extend({
1732
1740
  type: import_v43.default.literal(FieldType.TEXTAREA),
1733
1741
  defaultValue: NonEmptyTextValue.optional(),
@@ -1738,7 +1746,10 @@ var TextAreaField = BaseField.extend({
1738
1746
  prefix: TranslationConfig.optional(),
1739
1747
  postfix: TranslationConfig.optional()
1740
1748
  }).default({ rows: 4 }).optional()
1741
- }).describe("Multiline text input");
1749
+ }).meta({
1750
+ description: "A multiline text input",
1751
+ id: "TextAreaField"
1752
+ });
1742
1753
  var ImageMimeType = import_v43.default.enum([
1743
1754
  "image/png",
1744
1755
  "image/jpg",
@@ -1768,13 +1779,19 @@ var SignatureField = BaseField.extend({
1768
1779
  }).default({
1769
1780
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1770
1781
  })
1771
- }).describe("Signature input field");
1782
+ }).meta({
1783
+ description: "A signature input field",
1784
+ id: "SignatureField"
1785
+ });
1772
1786
  var EmailField = BaseField.extend({
1773
1787
  type: import_v43.default.literal(FieldType.EMAIL),
1774
1788
  configuration: import_v43.default.object({
1775
1789
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
1776
1790
  }).default({ maxLength: 255 }).optional(),
1777
1791
  defaultValue: NonEmptyTextValue.optional()
1792
+ }).meta({
1793
+ description: "An email input field",
1794
+ id: "EmailField"
1778
1795
  });
1779
1796
  var DateField = BaseField.extend({
1780
1797
  type: import_v43.default.literal(FieldType.DATE),
@@ -1784,7 +1801,10 @@ var DateField = BaseField.extend({
1784
1801
  "Text to display above the date input"
1785
1802
  ).optional()
1786
1803
  }).optional()
1787
- }).describe("A single date input (yyyy-MM-dd)");
1804
+ }).meta({
1805
+ description: "A date input (yyyy-MM-dd)",
1806
+ id: "DateField"
1807
+ });
1788
1808
  var AgeField = BaseField.extend({
1789
1809
  type: import_v43.default.literal(FieldType.AGE),
1790
1810
  defaultValue: NumberFieldValue.optional(),
@@ -1793,7 +1813,10 @@ var AgeField = BaseField.extend({
1793
1813
  prefix: TranslationConfig.optional(),
1794
1814
  postfix: TranslationConfig.optional()
1795
1815
  })
1796
- }).describe("An age input field which uses the current date as the asOfDate");
1816
+ }).meta({
1817
+ description: "An age input field which uses the current date as the asOfDate",
1818
+ id: "AgeField"
1819
+ });
1797
1820
  var TimeField = BaseField.extend({
1798
1821
  type: import_v43.default.literal(FieldType.TIME),
1799
1822
  defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
@@ -1803,7 +1826,10 @@ var TimeField = BaseField.extend({
1803
1826
  "Text to display above the time input"
1804
1827
  ).optional()
1805
1828
  }).optional()
1806
- }).describe("A single date input (HH-mm)");
1829
+ }).meta({
1830
+ description: "A single time input (HH-mm)",
1831
+ id: "TimeField"
1832
+ });
1807
1833
  var DateRangeField = BaseField.extend({
1808
1834
  type: import_v43.default.literal(FieldType.DATE_RANGE),
1809
1835
  defaultValue: DateRangeFieldValue.optional(),
@@ -1812,7 +1838,10 @@ var DateRangeField = BaseField.extend({
1812
1838
  "Text to display above the date input"
1813
1839
  ).optional()
1814
1840
  }).optional()
1815
- }).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
1841
+ }).meta({
1842
+ description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
1843
+ id: "DateRangeField"
1844
+ });
1816
1845
  var HtmlFontVariant = import_v43.default.enum([
1817
1846
  "reg12",
1818
1847
  "reg14",
@@ -1856,18 +1885,30 @@ var ImageViewField = BaseField.extend({
1856
1885
  type: import_v43.default.literal(FieldType.IMAGE_VIEW),
1857
1886
  defaultValue: NonEmptyTextValue.optional(),
1858
1887
  configuration: ImageConfiguration
1859
- }).describe("A read-only image component for form pages");
1888
+ }).meta({
1889
+ description: "A read-only image component for form pages",
1890
+ id: "ImageViewField"
1891
+ });
1860
1892
  var Paragraph = BaseField.extend({
1861
1893
  type: import_v43.default.literal(FieldType.PARAGRAPH),
1862
1894
  configuration: ParagraphConfiguration
1863
- }).describe("A read-only HTML <p> paragraph");
1895
+ }).meta({
1896
+ description: "A read-only HTML <p> paragraph",
1897
+ id: "Paragraph"
1898
+ });
1864
1899
  var Heading = BaseField.extend({
1865
1900
  type: import_v43.default.literal(FieldType.HEADING),
1866
1901
  configuration: HeadingConfiguration
1867
- }).describe("A read-only heading component for form pages");
1902
+ }).meta({
1903
+ description: "A read-only heading component for form pages",
1904
+ id: "Heading"
1905
+ });
1868
1906
  var PageHeader = BaseField.extend({
1869
1907
  type: import_v43.default.literal(FieldType.PAGE_HEADER)
1870
- }).describe("A read-only header component for form pages");
1908
+ }).meta({
1909
+ description: "A read-only header component for form pages",
1910
+ id: "PageHeader"
1911
+ });
1871
1912
  var File = BaseField.extend({
1872
1913
  type: import_v43.default.literal(FieldType.FILE),
1873
1914
  defaultValue: FileFieldValue.optional(),
@@ -1886,7 +1927,10 @@ var File = BaseField.extend({
1886
1927
  }).default({
1887
1928
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1888
1929
  })
1889
- }).describe("File upload");
1930
+ }).meta({
1931
+ description: "A file upload field",
1932
+ id: "File"
1933
+ });
1890
1934
  var SelectOption = import_v43.default.object({
1891
1935
  value: import_v43.default.string().describe("The value of the option"),
1892
1936
  label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
@@ -1903,7 +1947,10 @@ var NumberWithUnitField = BaseField.extend({
1903
1947
  "Placeholder for the number field"
1904
1948
  )
1905
1949
  }).optional()
1906
- }).describe("Number with unit input");
1950
+ }).meta({
1951
+ description: "A number with unit input field",
1952
+ id: "NumberWithUnitField"
1953
+ });
1907
1954
  var RadioGroup = BaseField.extend({
1908
1955
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
1909
1956
  defaultValue: TextValue.optional(),
@@ -1913,7 +1960,10 @@ var RadioGroup = BaseField.extend({
1913
1960
  size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
1914
1961
  }).optional()
1915
1962
  }).optional()
1916
- }).describe("Grouped radio options");
1963
+ }).meta({
1964
+ description: "A grouped radio button field",
1965
+ id: "RadioGroup"
1966
+ });
1917
1967
  var BulletList = BaseField.extend({
1918
1968
  type: import_v43.default.literal(FieldType.BULLET_LIST),
1919
1969
  items: import_v43.default.array(TranslationConfig).describe("A list of items"),
@@ -1922,7 +1972,10 @@ var BulletList = BaseField.extend({
1922
1972
  fontVariant: HtmlFontVariant.optional()
1923
1973
  }).optional()
1924
1974
  }).default({})
1925
- }).describe("A list of bullet points");
1975
+ }).meta({
1976
+ description: "A list of bullet points",
1977
+ id: "BulletList"
1978
+ });
1926
1979
  var Select = BaseField.extend({
1927
1980
  type: import_v43.default.literal(FieldType.SELECT),
1928
1981
  defaultValue: TextValue.optional(),
@@ -1937,7 +1990,10 @@ var Select = BaseField.extend({
1937
1990
  { ..., defaultMessage: "'{input}' is not listed among the health facilities." }
1938
1991
  `
1939
1992
  )
1940
- }).describe("Select input");
1993
+ }).meta({
1994
+ description: "A select input field",
1995
+ id: "Select"
1996
+ });
1941
1997
  var SelectDateRangeOption = import_v43.default.object({
1942
1998
  value: SelectDateRangeValue.describe("The value of the option"),
1943
1999
  label: TranslationConfig.describe("The label of the option")
@@ -1946,7 +2002,10 @@ var SelectDateRangeField = BaseField.extend({
1946
2002
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
1947
2003
  defaultValue: SelectDateRangeValue.optional(),
1948
2004
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
1949
- }).describe("Select input with date range options");
2005
+ }).meta({
2006
+ description: "A date range selection field",
2007
+ id: "SelectDateRangeField"
2008
+ });
1950
2009
  var NameConfig = import_v43.default.object({
1951
2010
  firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
1952
2011
  middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
@@ -1977,26 +2036,41 @@ var NameField = BaseField.extend({
1977
2036
  surname: { required: true }
1978
2037
  }
1979
2038
  }).optional()
1980
- }).describe("Name input field");
2039
+ }).meta({
2040
+ description: "A field for entering a persons name",
2041
+ id: "NameField"
2042
+ });
1981
2043
  var PhoneField = BaseField.extend({
1982
2044
  defaultValue: NonEmptyTextValue.optional(),
1983
2045
  type: import_v43.default.literal(FieldType.PHONE)
1984
- }).describe("Phone input field");
2046
+ }).meta({
2047
+ description: "A field for entering a phone number",
2048
+ id: "PhoneField"
2049
+ });
1985
2050
  var IdField = BaseField.extend({
1986
2051
  defaultValue: NonEmptyTextValue.optional(),
1987
2052
  type: import_v43.default.literal(FieldType.ID)
1988
- }).describe("ID input field");
2053
+ }).meta({
2054
+ description: "A field for entering an ID",
2055
+ id: "IdField"
2056
+ });
1989
2057
  var Checkbox = BaseField.extend({
1990
2058
  type: import_v43.default.literal(FieldType.CHECKBOX),
1991
2059
  defaultValue: CheckboxFieldValue.default(false)
1992
- }).describe("Boolean checkbox field");
2060
+ }).meta({
2061
+ description: "A boolean checkbox field",
2062
+ id: "Checkbox"
2063
+ });
1993
2064
  var Country = BaseField.extend({
1994
2065
  type: import_v43.default.literal(FieldType.COUNTRY),
1995
2066
  defaultValue: NonEmptyTextValue.optional(),
1996
2067
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
1997
2068
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
1998
2069
  )
1999
- }).describe("Country select field");
2070
+ }).meta({
2071
+ description: "A field for selecting a country",
2072
+ id: "Country"
2073
+ });
2000
2074
  var AllowedLocations = JurisdictionReference.optional().describe(
2001
2075
  "Limits which location options are selectable depending on user jurisdiction and location."
2002
2076
  );
@@ -2005,16 +2079,18 @@ var AdministrativeAreas = import_v43.default.enum([
2005
2079
  "HEALTH_FACILITY",
2006
2080
  "CRVS_OFFICE"
2007
2081
  ]);
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
2082
  var AdministrativeAreaField = BaseField.extend({
2014
2083
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
2015
2084
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
2016
- configuration: AdministrativeAreaConfiguration
2017
- }).describe("Administrative area input field e.g. facility, office");
2085
+ configuration: import_v43.default.object({
2086
+ partOf: FieldReference.optional().describe("Parent location"),
2087
+ type: AdministrativeAreas,
2088
+ allowedLocations: AllowedLocations
2089
+ }).describe("Administrative area options")
2090
+ }).meta({
2091
+ description: "Administrative area input field",
2092
+ id: "AdministrativeAreaField"
2093
+ });
2018
2094
  var LocationInput = BaseField.extend({
2019
2095
  type: import_v43.default.literal(FieldType.LOCATION),
2020
2096
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
@@ -2022,7 +2098,10 @@ var LocationInput = BaseField.extend({
2022
2098
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
2023
2099
  allowedLocations: AllowedLocations
2024
2100
  }).optional()
2025
- }).describe("Input field for a location");
2101
+ }).meta({
2102
+ description: "A field for selecting a location",
2103
+ id: "LocationInput"
2104
+ });
2026
2105
  var FileUploadWithOptions = BaseField.extend({
2027
2106
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
2028
2107
  options: import_v43.default.array(SelectOption).describe("A list of options"),
@@ -2036,6 +2115,9 @@ var FileUploadWithOptions = BaseField.extend({
2036
2115
  }).default({
2037
2116
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2038
2117
  })
2118
+ }).meta({
2119
+ description: "A field for uploading files with file type options",
2120
+ id: "FileUploadWithOptions"
2039
2121
  });
2040
2122
  var Facility = BaseField.extend({
2041
2123
  type: import_v43.default.literal(FieldType.FACILITY),
@@ -2081,7 +2163,10 @@ var Address = BaseField.extend({
2081
2163
  allowedLocations: AllowedLocations
2082
2164
  }).optional(),
2083
2165
  defaultValue: DefaultAddressFieldValue.optional()
2084
- }).describe("Address input field \u2013 a combination of location and text fields");
2166
+ }).meta({
2167
+ description: "Address input field \u2013 a combination of location and text fields",
2168
+ id: "Address"
2169
+ });
2085
2170
  var StaticDataEntry = import_v43.default.object({
2086
2171
  id: import_v43.default.string().describe("ID for the data entry."),
2087
2172
  label: TranslationConfig,
@@ -2096,7 +2181,10 @@ var DataField = BaseField.extend({
2096
2181
  subtitle: TranslationConfig.optional(),
2097
2182
  data: import_v43.default.array(DataEntry)
2098
2183
  })
2099
- }).describe("Data field for displaying read-only data");
2184
+ }).meta({
2185
+ description: "A field for displaying a table of read-only data",
2186
+ id: "DataField"
2187
+ });
2100
2188
  var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
2101
2189
  var ButtonType = import_v43.default.enum([
2102
2190
  "primary",
@@ -2123,11 +2211,17 @@ var ButtonField = BaseField.extend({
2123
2211
  type: import_v43.default.literal(FieldType.BUTTON),
2124
2212
  defaultValue: ButtonFieldValue.optional(),
2125
2213
  configuration: ButtonConfiguration
2126
- }).describe("Generic button without any built-in functionality");
2214
+ }).meta({
2215
+ description: "A generic button that can be used to trigger an action",
2216
+ id: "ButtonField"
2217
+ });
2127
2218
  var FieldGroup = BaseField.extend({
2128
2219
  type: import_v43.default.literal(FieldType.FIELD_GROUP),
2129
2220
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2130
2221
  fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
2222
+ }).meta({
2223
+ description: "A group of fields that are displayed together",
2224
+ id: "FieldGroup"
2131
2225
  });
2132
2226
  var AlphaPrintButton = BaseField.extend({
2133
2227
  type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
@@ -2137,7 +2231,10 @@ var AlphaPrintButton = BaseField.extend({
2137
2231
  "Label for the print button"
2138
2232
  )
2139
2233
  })
2140
- }).describe("Print button field for printing certificates");
2234
+ }).meta({
2235
+ description: "An experimental print button field for printing certificates during the declaration process",
2236
+ id: "AlphaPrintButton"
2237
+ });
2141
2238
  var HttpField = BaseField.extend({
2142
2239
  type: import_v43.default.literal(FieldType.HTTP),
2143
2240
  defaultValue: HttpFieldValue.optional(),
@@ -2153,20 +2250,30 @@ var HttpField = BaseField.extend({
2153
2250
  params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
2154
2251
  timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
2155
2252
  })
2156
- }).describe("HTTP request function triggered by a button click or other event");
2253
+ }).meta({
2254
+ 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.",
2255
+ id: "HttpField"
2256
+ });
2157
2257
  var AutocompleteField = BaseField.extend({
2158
2258
  type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
2159
2259
  configuration: import_v43.default.object({
2160
- url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
2260
+ url: import_v43.default.string().describe(
2261
+ "URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
2262
+ ).optional(),
2161
2263
  method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
2162
2264
  defaultOptions: import_v43.default.array(
2163
2265
  import_v43.default.object({
2164
2266
  label: import_v43.default.string(),
2165
2267
  value: import_v43.default.string()
2166
2268
  })
2167
- ).optional()
2269
+ ).optional().describe(
2270
+ "Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
2271
+ )
2168
2272
  })
2169
- }).describe("Autocomplete input field");
2273
+ }).meta({
2274
+ 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.",
2275
+ id: "AutocompleteField"
2276
+ });
2170
2277
  var SearchField = HttpField.extend({
2171
2278
  type: import_v43.default.literal(FieldType.SEARCH),
2172
2279
  configuration: SearchQuery.pick({
@@ -2199,6 +2306,9 @@ var SearchField = HttpField.extend({
2199
2306
  ok: TranslationConfig.optional()
2200
2307
  }).optional()
2201
2308
  })
2309
+ }).meta({
2310
+ description: "A search input field",
2311
+ id: "SearchField"
2202
2312
  });
2203
2313
  var LinkButtonField = BaseField.extend({
2204
2314
  type: import_v43.default.literal(FieldType.LINK_BUTTON),
@@ -2207,7 +2317,10 @@ var LinkButtonField = BaseField.extend({
2207
2317
  text: TranslationConfig.describe("Text to display on the button"),
2208
2318
  icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
2209
2319
  })
2210
- }).describe("Button that opens a link");
2320
+ }).meta({
2321
+ description: "A button that opens a URL link",
2322
+ id: "LinkButtonField"
2323
+ });
2211
2324
  var VerificationStatus = BaseField.extend({
2212
2325
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
2213
2326
  defaultValue: VerificationStatusValue.optional(),
@@ -2217,15 +2330,19 @@ var VerificationStatus = BaseField.extend({
2217
2330
  "Explaining text on the banner in form."
2218
2331
  )
2219
2332
  })
2333
+ }).meta({
2334
+ 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.",
2335
+ id: "VerificationStatus"
2220
2336
  });
2221
2337
  var QueryParamReaderField = BaseField.extend({
2222
2338
  type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
2223
2339
  configuration: import_v43.default.object({
2224
2340
  pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
2225
2341
  })
2226
- }).describe(
2227
- "A field that maps URL query params into form values and clears them afterward"
2228
- );
2342
+ }).meta({
2343
+ description: "A field that maps URL query params into form values and clears them afterward",
2344
+ id: "QueryParamReaderField"
2345
+ });
2229
2346
  var QrReaderField = BaseField.extend({
2230
2347
  type: import_v43.default.literal(FieldType.QR_READER),
2231
2348
  defaultValue: QrReaderFieldValue.optional(),
@@ -2236,7 +2353,7 @@ var QrReaderField = BaseField.extend({
2236
2353
  })
2237
2354
  }).optional()
2238
2355
  }).meta({
2239
- description: "Configuration for QR code reader field, including optional JSON Schema validator.",
2356
+ description: "QR code reader field, including optional JSON Schema validator.",
2240
2357
  id: "QrReaderField"
2241
2358
  });
2242
2359
  var IdReaderField = BaseField.extend({
@@ -2245,12 +2362,18 @@ var IdReaderField = BaseField.extend({
2245
2362
  methods: import_v43.default.array(
2246
2363
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2247
2364
  )
2365
+ }).meta({
2366
+ description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
2367
+ id: "IdReaderField"
2248
2368
  });
2249
2369
  var CustomField = BaseField.extend({
2250
2370
  type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
2251
2371
  defaultValue: CustomFieldValue.optional(),
2252
2372
  src: import_v43.default.string().describe("Module source path for the custom field component"),
2253
2373
  configuration: import_v43.default.unknown().optional()
2374
+ }).meta({
2375
+ description: "An expiremental custom field that is defined by a module source path",
2376
+ id: "CustomField"
2254
2377
  });
2255
2378
  var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
2256
2379
  var LoaderField = BaseField.extend({
@@ -2260,22 +2383,25 @@ var LoaderField = BaseField.extend({
2260
2383
  configuration: import_v43.default.object({
2261
2384
  text: TranslationConfig.describe("Display text above the loading spinner")
2262
2385
  })
2263
- }).describe(
2264
- "A non-interactive field that indicates an in progress operation in form"
2265
- );
2386
+ }).meta({
2387
+ description: "A non-interactive field that indicates an in progress operation in form",
2388
+ id: "LoaderField"
2389
+ });
2266
2390
  var HiddenField = BaseField.extend({
2267
2391
  type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
2268
2392
  required: import_v43.default.boolean().default(false).optional(),
2269
2393
  defaultValue: TextValue.optional()
2270
- }).describe(
2271
- "A non-interactive, hidden field that only hold a value in the form"
2272
- );
2394
+ }).meta({
2395
+ description: "A non-interactive, hidden field that only hold a value in the form",
2396
+ id: "HiddenField"
2397
+ });
2273
2398
  var UserRoleField = BaseField.extend({
2274
2399
  type: import_v43.default.literal(FieldType.USER_ROLE),
2275
2400
  defaultValue: TextValue.optional()
2276
- }).describe(
2277
- "A select dropdown that is automatically populated with available user roles"
2278
- );
2401
+ }).meta({
2402
+ description: "A select dropdown that is automatically populated with available user roles",
2403
+ id: "UserRoleField"
2404
+ });
2279
2405
  var FieldConfig = import_v43.default.discriminatedUnion("type", [
2280
2406
  FieldGroup,
2281
2407
  Address,
@@ -2374,10 +2500,10 @@ var VerificationPageConfig = FormPageConfig.extend({
2374
2500
  type: z21.literal(PageTypes.enum.VERIFICATION),
2375
2501
  actions: VerificationActionConfig
2376
2502
  });
2377
- var PageConfig = z21.discriminatedUnion("type", [
2378
- FormPageConfig,
2379
- VerificationPageConfig
2380
- ]);
2503
+ var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
2504
+ description: "Page configuration",
2505
+ id: "PageConfig"
2506
+ });
2381
2507
 
2382
2508
  // ../commons/src/events/FormConfig.ts
2383
2509
  var DeclarationFormConfig = z22.object({
@@ -3677,7 +3803,7 @@ var _EventConfigBase = z33.object({
3677
3803
  ),
3678
3804
  label: TranslationConfig.describe("Human-readable label for the event type."),
3679
3805
  actions: z33.array(ActionConfig).describe(
3680
- "Configuration of system-defined actions associated with the event."
3806
+ "Configuration of core and custom actions associated with the event."
3681
3807
  ),
3682
3808
  actionOrder: z33.array(z33.string()).optional().describe(
3683
3809
  "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
@@ -3689,7 +3815,7 @@ var _EventConfigBase = z33.object({
3689
3815
  "Configuration of fields available in the advanced search feature."
3690
3816
  ),
3691
3817
  flags: z33.array(FlagConfig).optional().default([]).describe(
3692
- "Configuration of flags associated with the actions of this event type."
3818
+ "Configuration of custom flags associated with the actions of this event type."
3693
3819
  ),
3694
3820
  analytics: z33.boolean().optional().default(true).describe(
3695
3821
  "Indicates whether the records of this event type are included in analytics"
@@ -4127,18 +4253,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
4127
4253
  query: true,
4128
4254
  columns: true
4129
4255
  });
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()
4256
+ var WorkqueueConfigInput = WorkqueueConfig.extend({
4257
+ query: CountryConfigQueryInputType
4258
+ }).meta({
4259
+ description: "Workqueue configuration",
4260
+ id: "WorkqueueConfig"
4142
4261
  });
4143
4262
  var WorkqueueCountInput = z37.array(
4144
4263
  z37.object({ slug: z37.string(), query: QueryType })
@@ -4178,6 +4297,9 @@ var BaseActionInput = z38.object({
4178
4297
  originalActionId: UUID.optional(),
4179
4298
  // should not be part of base action.
4180
4299
  keepAssignment: z38.boolean().optional(),
4300
+ keepAssignmentIfAccepted: z38.boolean().optional(),
4301
+ keepAssignmentIfRejected: z38.boolean().optional(),
4302
+ waitFor: z38.boolean().optional(),
4181
4303
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
4182
4304
  // @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
4305
  createdAtLocation: UUID.nullish().describe(