@opencrvs/toolkit 2.0.0-rc.1aa040b → 2.0.0-rc.1d4177d

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.
@@ -654,7 +654,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
654
654
  ShowConditional,
655
655
  // Action can be shown to the user in the list but as disabled
656
656
  EnableConditional
657
- ]);
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
+ });
658
661
  var DisplayOnReviewConditional = z7.object({
659
662
  type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
660
663
  conditional: Conditional
@@ -669,8 +672,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
669
672
  // Field output can be shown / hidden on the review page
670
673
  DisplayOnReviewConditional
671
674
  ]).meta({
672
- description: "Field conditional configuration",
673
- 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."
674
677
  });
675
678
 
676
679
  // ../commons/src/events/FieldType.ts
@@ -1305,6 +1308,9 @@ var FlagConfig = z15.object({
1305
1308
  "Indicates if this flag expects an action to be performed to be cleared."
1306
1309
  ),
1307
1310
  label: TranslationConfig.describe("Human readable label of the flag.")
1311
+ }).meta({
1312
+ id: "FlagConfig",
1313
+ description: "Configuration for a custom flag that can be added to or removed from records by event actions."
1308
1314
  });
1309
1315
  var ActionFlagConfig = z15.object({
1310
1316
  id: Flag,
@@ -1312,6 +1318,9 @@ var ActionFlagConfig = z15.object({
1312
1318
  conditional: Conditional.optional().describe(
1313
1319
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1314
1320
  )
1321
+ }).meta({
1322
+ id: "ActionFlagConfig",
1323
+ description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
1315
1324
  });
1316
1325
 
1317
1326
  // ../commons/src/events/EventMetadata.ts
@@ -1653,14 +1662,21 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
1653
1662
  }
1654
1663
  }).describe("Unique identifier for the field");
1655
1664
  var FieldReference = import_v43.default.object({
1656
- $$field: FieldId,
1665
+ $$field: FieldId.describe("Id of the field to reference"),
1657
1666
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
1658
1667
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
1659
1668
  )
1660
1669
  }).describe("Reference to a field by its ID");
1661
1670
  var ValidationConfig = import_v43.default.object({
1662
- validator: Conditional,
1663
- message: TranslationConfig
1671
+ validator: Conditional.describe(
1672
+ "Conditional expression that must hold for the field value to be considered valid."
1673
+ ),
1674
+ message: TranslationConfig.describe(
1675
+ "Error message displayed when the validator does not hold."
1676
+ )
1677
+ }).meta({
1678
+ id: "ValidationConfig",
1679
+ 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."
1664
1680
  });
1665
1681
  var requiredSchema = import_v43.default.union([
1666
1682
  import_v43.default.boolean(),
@@ -1699,6 +1715,9 @@ var BaseField = import_v43.default.object({
1699
1715
  }).describe("Common properties shared across all field types.");
1700
1716
  var Divider = BaseField.extend({
1701
1717
  type: import_v43.default.literal(FieldType.DIVIDER)
1718
+ }).meta({
1719
+ description: "A horizontal line divider",
1720
+ id: "Divider"
1702
1721
  });
1703
1722
  var TextField = BaseField.extend({
1704
1723
  type: import_v43.default.literal(FieldType.TEXT),
@@ -1709,7 +1728,10 @@ var TextField = BaseField.extend({
1709
1728
  prefix: TranslationConfig.optional(),
1710
1729
  postfix: TranslationConfig.optional()
1711
1730
  }).default({ type: "text" }).optional()
1712
- }).describe("Text input");
1731
+ }).meta({
1732
+ description: "A text input field",
1733
+ id: "TextField"
1734
+ });
1713
1735
  var NumberField = BaseField.extend({
1714
1736
  type: import_v43.default.literal(FieldType.NUMBER),
1715
1737
  defaultValue: NumberFieldValue.optional(),
@@ -1719,7 +1741,10 @@ var NumberField = BaseField.extend({
1719
1741
  prefix: TranslationConfig.optional(),
1720
1742
  postfix: TranslationConfig.optional()
1721
1743
  }).optional()
1722
- }).describe("Number input");
1744
+ }).meta({
1745
+ description: "A number input field",
1746
+ id: "NumberField"
1747
+ });
1723
1748
  var TextAreaField = BaseField.extend({
1724
1749
  type: import_v43.default.literal(FieldType.TEXTAREA),
1725
1750
  defaultValue: NonEmptyTextValue.optional(),
@@ -1730,7 +1755,10 @@ var TextAreaField = BaseField.extend({
1730
1755
  prefix: TranslationConfig.optional(),
1731
1756
  postfix: TranslationConfig.optional()
1732
1757
  }).default({ rows: 4 }).optional()
1733
- }).describe("Multiline text input");
1758
+ }).meta({
1759
+ description: "A multiline text input",
1760
+ id: "TextAreaField"
1761
+ });
1734
1762
  var ImageMimeType = import_v43.default.enum([
1735
1763
  "image/png",
1736
1764
  "image/jpg",
@@ -1760,13 +1788,19 @@ var SignatureField = BaseField.extend({
1760
1788
  }).default({
1761
1789
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1762
1790
  })
1763
- }).describe("Signature input field");
1791
+ }).meta({
1792
+ description: "A signature input field",
1793
+ id: "SignatureField"
1794
+ });
1764
1795
  var EmailField = BaseField.extend({
1765
1796
  type: import_v43.default.literal(FieldType.EMAIL),
1766
1797
  configuration: import_v43.default.object({
1767
1798
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
1768
1799
  }).default({ maxLength: 255 }).optional(),
1769
1800
  defaultValue: NonEmptyTextValue.optional()
1801
+ }).meta({
1802
+ description: "An email input field",
1803
+ id: "EmailField"
1770
1804
  });
1771
1805
  var DateField = BaseField.extend({
1772
1806
  type: import_v43.default.literal(FieldType.DATE),
@@ -1776,7 +1810,10 @@ var DateField = BaseField.extend({
1776
1810
  "Text to display above the date input"
1777
1811
  ).optional()
1778
1812
  }).optional()
1779
- }).describe("A single date input (yyyy-MM-dd)");
1813
+ }).meta({
1814
+ description: "A date input (yyyy-MM-dd)",
1815
+ id: "DateField"
1816
+ });
1780
1817
  var AgeField = BaseField.extend({
1781
1818
  type: import_v43.default.literal(FieldType.AGE),
1782
1819
  defaultValue: NumberFieldValue.optional(),
@@ -1785,7 +1822,10 @@ var AgeField = BaseField.extend({
1785
1822
  prefix: TranslationConfig.optional(),
1786
1823
  postfix: TranslationConfig.optional()
1787
1824
  })
1788
- }).describe("An age input field which uses the current date as the asOfDate");
1825
+ }).meta({
1826
+ description: "An age input field which uses the current date as the asOfDate",
1827
+ id: "AgeField"
1828
+ });
1789
1829
  var TimeField = BaseField.extend({
1790
1830
  type: import_v43.default.literal(FieldType.TIME),
1791
1831
  defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
@@ -1795,7 +1835,10 @@ var TimeField = BaseField.extend({
1795
1835
  "Text to display above the time input"
1796
1836
  ).optional()
1797
1837
  }).optional()
1798
- }).describe("A single date input (HH-mm)");
1838
+ }).meta({
1839
+ description: "A single time input (HH-mm)",
1840
+ id: "TimeField"
1841
+ });
1799
1842
  var DateRangeField = BaseField.extend({
1800
1843
  type: import_v43.default.literal(FieldType.DATE_RANGE),
1801
1844
  defaultValue: DateRangeFieldValue.optional(),
@@ -1804,7 +1847,10 @@ var DateRangeField = BaseField.extend({
1804
1847
  "Text to display above the date input"
1805
1848
  ).optional()
1806
1849
  }).optional()
1807
- }).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
1850
+ }).meta({
1851
+ description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
1852
+ id: "DateRangeField"
1853
+ });
1808
1854
  var HtmlFontVariant = import_v43.default.enum([
1809
1855
  "reg12",
1810
1856
  "reg14",
@@ -1848,18 +1894,30 @@ var ImageViewField = BaseField.extend({
1848
1894
  type: import_v43.default.literal(FieldType.IMAGE_VIEW),
1849
1895
  defaultValue: NonEmptyTextValue.optional(),
1850
1896
  configuration: ImageConfiguration
1851
- }).describe("A read-only image component for form pages");
1897
+ }).meta({
1898
+ description: "A read-only image component for form pages",
1899
+ id: "ImageViewField"
1900
+ });
1852
1901
  var Paragraph = BaseField.extend({
1853
1902
  type: import_v43.default.literal(FieldType.PARAGRAPH),
1854
1903
  configuration: ParagraphConfiguration
1855
- }).describe("A read-only HTML <p> paragraph");
1904
+ }).meta({
1905
+ description: "A read-only HTML <p> paragraph",
1906
+ id: "Paragraph"
1907
+ });
1856
1908
  var Heading = BaseField.extend({
1857
1909
  type: import_v43.default.literal(FieldType.HEADING),
1858
1910
  configuration: HeadingConfiguration
1859
- }).describe("A read-only heading component for form pages");
1911
+ }).meta({
1912
+ description: "A read-only heading component for form pages",
1913
+ id: "Heading"
1914
+ });
1860
1915
  var PageHeader = BaseField.extend({
1861
1916
  type: import_v43.default.literal(FieldType.PAGE_HEADER)
1862
- }).describe("A read-only header component for form pages");
1917
+ }).meta({
1918
+ description: "A read-only header component for form pages",
1919
+ id: "PageHeader"
1920
+ });
1863
1921
  var File = BaseField.extend({
1864
1922
  type: import_v43.default.literal(FieldType.FILE),
1865
1923
  defaultValue: FileFieldValue.optional(),
@@ -1878,7 +1936,10 @@ var File = BaseField.extend({
1878
1936
  }).default({
1879
1937
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1880
1938
  })
1881
- }).describe("File upload");
1939
+ }).meta({
1940
+ description: "A file upload field",
1941
+ id: "File"
1942
+ });
1882
1943
  var SelectOption = import_v43.default.object({
1883
1944
  value: import_v43.default.string().describe("The value of the option"),
1884
1945
  label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
@@ -1895,7 +1956,10 @@ var NumberWithUnitField = BaseField.extend({
1895
1956
  "Placeholder for the number field"
1896
1957
  )
1897
1958
  }).optional()
1898
- }).describe("Number with unit input");
1959
+ }).meta({
1960
+ description: "A number with unit input field",
1961
+ id: "NumberWithUnitField"
1962
+ });
1899
1963
  var RadioGroup = BaseField.extend({
1900
1964
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
1901
1965
  defaultValue: TextValue.optional(),
@@ -1905,7 +1969,10 @@ var RadioGroup = BaseField.extend({
1905
1969
  size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
1906
1970
  }).optional()
1907
1971
  }).optional()
1908
- }).describe("Grouped radio options");
1972
+ }).meta({
1973
+ description: "A grouped radio button field",
1974
+ id: "RadioGroup"
1975
+ });
1909
1976
  var BulletList = BaseField.extend({
1910
1977
  type: import_v43.default.literal(FieldType.BULLET_LIST),
1911
1978
  items: import_v43.default.array(TranslationConfig).describe("A list of items"),
@@ -1914,7 +1981,10 @@ var BulletList = BaseField.extend({
1914
1981
  fontVariant: HtmlFontVariant.optional()
1915
1982
  }).optional()
1916
1983
  }).default({})
1917
- }).describe("A list of bullet points");
1984
+ }).meta({
1985
+ description: "A list of bullet points",
1986
+ id: "BulletList"
1987
+ });
1918
1988
  var Select = BaseField.extend({
1919
1989
  type: import_v43.default.literal(FieldType.SELECT),
1920
1990
  defaultValue: TextValue.optional(),
@@ -1929,7 +1999,10 @@ var Select = BaseField.extend({
1929
1999
  { ..., defaultMessage: "'{input}' is not listed among the health facilities." }
1930
2000
  `
1931
2001
  )
1932
- }).describe("Select input");
2002
+ }).meta({
2003
+ description: "A select input field",
2004
+ id: "Select"
2005
+ });
1933
2006
  var SelectDateRangeOption = import_v43.default.object({
1934
2007
  value: SelectDateRangeValue.describe("The value of the option"),
1935
2008
  label: TranslationConfig.describe("The label of the option")
@@ -1938,7 +2011,10 @@ var SelectDateRangeField = BaseField.extend({
1938
2011
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
1939
2012
  defaultValue: SelectDateRangeValue.optional(),
1940
2013
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
1941
- }).describe("Select input with date range options");
2014
+ }).meta({
2015
+ description: "A date range selection field",
2016
+ id: "SelectDateRangeField"
2017
+ });
1942
2018
  var NameConfig = import_v43.default.object({
1943
2019
  firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
1944
2020
  middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
@@ -1969,26 +2045,41 @@ var NameField = BaseField.extend({
1969
2045
  surname: { required: true }
1970
2046
  }
1971
2047
  }).optional()
1972
- }).describe("Name input field");
2048
+ }).meta({
2049
+ description: "A field for entering a persons name",
2050
+ id: "NameField"
2051
+ });
1973
2052
  var PhoneField = BaseField.extend({
1974
2053
  defaultValue: NonEmptyTextValue.optional(),
1975
2054
  type: import_v43.default.literal(FieldType.PHONE)
1976
- }).describe("Phone input field");
2055
+ }).meta({
2056
+ description: "A field for entering a phone number",
2057
+ id: "PhoneField"
2058
+ });
1977
2059
  var IdField = BaseField.extend({
1978
2060
  defaultValue: NonEmptyTextValue.optional(),
1979
2061
  type: import_v43.default.literal(FieldType.ID)
1980
- }).describe("ID input field");
2062
+ }).meta({
2063
+ description: "A field for entering an ID",
2064
+ id: "IdField"
2065
+ });
1981
2066
  var Checkbox = BaseField.extend({
1982
2067
  type: import_v43.default.literal(FieldType.CHECKBOX),
1983
2068
  defaultValue: CheckboxFieldValue.default(false)
1984
- }).describe("Boolean checkbox field");
2069
+ }).meta({
2070
+ description: "A boolean checkbox field",
2071
+ id: "Checkbox"
2072
+ });
1985
2073
  var Country = BaseField.extend({
1986
2074
  type: import_v43.default.literal(FieldType.COUNTRY),
1987
2075
  defaultValue: NonEmptyTextValue.optional(),
1988
2076
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
1989
2077
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
1990
2078
  )
1991
- }).describe("Country select field");
2079
+ }).meta({
2080
+ description: "A field for selecting a country",
2081
+ id: "Country"
2082
+ });
1992
2083
  var AllowedLocations = JurisdictionReference.optional().describe(
1993
2084
  "Limits which location options are selectable depending on user jurisdiction and location."
1994
2085
  );
@@ -1997,16 +2088,18 @@ var AdministrativeAreas = import_v43.default.enum([
1997
2088
  "HEALTH_FACILITY",
1998
2089
  "CRVS_OFFICE"
1999
2090
  ]);
2000
- var AdministrativeAreaConfiguration = import_v43.default.object({
2001
- partOf: FieldReference.optional().describe("Parent location"),
2002
- type: AdministrativeAreas,
2003
- allowedLocations: AllowedLocations
2004
- }).describe("Administrative area options");
2005
2091
  var AdministrativeAreaField = BaseField.extend({
2006
2092
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
2007
2093
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
2008
- configuration: AdministrativeAreaConfiguration
2009
- }).describe("Administrative area input field e.g. facility, office");
2094
+ configuration: import_v43.default.object({
2095
+ partOf: FieldReference.optional().describe("Parent location"),
2096
+ type: AdministrativeAreas,
2097
+ allowedLocations: AllowedLocations
2098
+ }).describe("Administrative area options")
2099
+ }).meta({
2100
+ description: "Administrative area input field",
2101
+ id: "AdministrativeAreaField"
2102
+ });
2010
2103
  var LocationInput = BaseField.extend({
2011
2104
  type: import_v43.default.literal(FieldType.LOCATION),
2012
2105
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
@@ -2014,7 +2107,10 @@ var LocationInput = BaseField.extend({
2014
2107
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
2015
2108
  allowedLocations: AllowedLocations
2016
2109
  }).optional()
2017
- }).describe("Input field for a location");
2110
+ }).meta({
2111
+ description: "A field for selecting a location",
2112
+ id: "LocationInput"
2113
+ });
2018
2114
  var FileUploadWithOptions = BaseField.extend({
2019
2115
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
2020
2116
  options: import_v43.default.array(SelectOption).describe("A list of options"),
@@ -2028,6 +2124,9 @@ var FileUploadWithOptions = BaseField.extend({
2028
2124
  }).default({
2029
2125
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2030
2126
  })
2127
+ }).meta({
2128
+ description: "A field for uploading files with file type options",
2129
+ id: "FileUploadWithOptions"
2031
2130
  });
2032
2131
  var Facility = BaseField.extend({
2033
2132
  type: import_v43.default.literal(FieldType.FACILITY),
@@ -2073,7 +2172,10 @@ var Address = BaseField.extend({
2073
2172
  allowedLocations: AllowedLocations
2074
2173
  }).optional(),
2075
2174
  defaultValue: DefaultAddressFieldValue.optional()
2076
- }).describe("Address input field \u2013 a combination of location and text fields");
2175
+ }).meta({
2176
+ description: "Address input field \u2013 a combination of location and text fields",
2177
+ id: "Address"
2178
+ });
2077
2179
  var StaticDataEntry = import_v43.default.object({
2078
2180
  id: import_v43.default.string().describe("ID for the data entry."),
2079
2181
  label: TranslationConfig,
@@ -2088,7 +2190,10 @@ var DataField = BaseField.extend({
2088
2190
  subtitle: TranslationConfig.optional(),
2089
2191
  data: import_v43.default.array(DataEntry)
2090
2192
  })
2091
- }).describe("Data field for displaying read-only data");
2193
+ }).meta({
2194
+ description: "A field for displaying a table of read-only data",
2195
+ id: "DataField"
2196
+ });
2092
2197
  var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
2093
2198
  var ButtonType = import_v43.default.enum([
2094
2199
  "primary",
@@ -2115,11 +2220,17 @@ var ButtonField = BaseField.extend({
2115
2220
  type: import_v43.default.literal(FieldType.BUTTON),
2116
2221
  defaultValue: ButtonFieldValue.optional(),
2117
2222
  configuration: ButtonConfiguration
2118
- }).describe("Generic button without any built-in functionality");
2223
+ }).meta({
2224
+ description: "A generic button that can be used to trigger an action",
2225
+ id: "ButtonField"
2226
+ });
2119
2227
  var FieldGroup = BaseField.extend({
2120
2228
  type: import_v43.default.literal(FieldType.FIELD_GROUP),
2121
2229
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2122
2230
  fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
2231
+ }).meta({
2232
+ description: "A group of fields that are displayed together",
2233
+ id: "FieldGroup"
2123
2234
  });
2124
2235
  var AlphaPrintButton = BaseField.extend({
2125
2236
  type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
@@ -2129,7 +2240,10 @@ var AlphaPrintButton = BaseField.extend({
2129
2240
  "Label for the print button"
2130
2241
  )
2131
2242
  })
2132
- }).describe("Print button field for printing certificates");
2243
+ }).meta({
2244
+ description: "An experimental print button field for printing certificates during the declaration process",
2245
+ id: "AlphaPrintButton"
2246
+ });
2133
2247
  var HttpField = BaseField.extend({
2134
2248
  type: import_v43.default.literal(FieldType.HTTP),
2135
2249
  defaultValue: HttpFieldValue.optional(),
@@ -2145,20 +2259,30 @@ var HttpField = BaseField.extend({
2145
2259
  params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
2146
2260
  timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
2147
2261
  })
2148
- }).describe("HTTP request function triggered by a button click or other event");
2262
+ }).meta({
2263
+ 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.",
2264
+ id: "HttpField"
2265
+ });
2149
2266
  var AutocompleteField = BaseField.extend({
2150
2267
  type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
2151
2268
  configuration: import_v43.default.object({
2152
- url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
2269
+ url: import_v43.default.string().describe(
2270
+ "URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
2271
+ ).optional(),
2153
2272
  method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
2154
2273
  defaultOptions: import_v43.default.array(
2155
2274
  import_v43.default.object({
2156
2275
  label: import_v43.default.string(),
2157
2276
  value: import_v43.default.string()
2158
2277
  })
2159
- ).optional()
2278
+ ).optional().describe(
2279
+ "Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
2280
+ )
2160
2281
  })
2161
- }).describe("Autocomplete input field");
2282
+ }).meta({
2283
+ 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.",
2284
+ id: "AutocompleteField"
2285
+ });
2162
2286
  var SearchField = HttpField.extend({
2163
2287
  type: import_v43.default.literal(FieldType.SEARCH),
2164
2288
  configuration: SearchQuery.pick({
@@ -2191,6 +2315,9 @@ var SearchField = HttpField.extend({
2191
2315
  ok: TranslationConfig.optional()
2192
2316
  }).optional()
2193
2317
  })
2318
+ }).meta({
2319
+ description: "A search input field",
2320
+ id: "SearchField"
2194
2321
  });
2195
2322
  var LinkButtonField = BaseField.extend({
2196
2323
  type: import_v43.default.literal(FieldType.LINK_BUTTON),
@@ -2199,7 +2326,10 @@ var LinkButtonField = BaseField.extend({
2199
2326
  text: TranslationConfig.describe("Text to display on the button"),
2200
2327
  icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
2201
2328
  })
2202
- }).describe("Button that opens a link");
2329
+ }).meta({
2330
+ description: "A button that opens a URL link",
2331
+ id: "LinkButtonField"
2332
+ });
2203
2333
  var VerificationStatus = BaseField.extend({
2204
2334
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
2205
2335
  defaultValue: VerificationStatusValue.optional(),
@@ -2209,15 +2339,19 @@ var VerificationStatus = BaseField.extend({
2209
2339
  "Explaining text on the banner in form."
2210
2340
  )
2211
2341
  })
2342
+ }).meta({
2343
+ 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.",
2344
+ id: "VerificationStatus"
2212
2345
  });
2213
2346
  var QueryParamReaderField = BaseField.extend({
2214
2347
  type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
2215
2348
  configuration: import_v43.default.object({
2216
2349
  pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
2217
2350
  })
2218
- }).describe(
2219
- "A field that maps URL query params into form values and clears them afterward"
2220
- );
2351
+ }).meta({
2352
+ description: "A field that maps URL query params into form values and clears them afterward",
2353
+ id: "QueryParamReaderField"
2354
+ });
2221
2355
  var QrReaderField = BaseField.extend({
2222
2356
  type: import_v43.default.literal(FieldType.QR_READER),
2223
2357
  defaultValue: QrReaderFieldValue.optional(),
@@ -2228,7 +2362,7 @@ var QrReaderField = BaseField.extend({
2228
2362
  })
2229
2363
  }).optional()
2230
2364
  }).meta({
2231
- description: "Configuration for QR code reader field, including optional JSON Schema validator.",
2365
+ description: "QR code reader field, including optional JSON Schema validator.",
2232
2366
  id: "QrReaderField"
2233
2367
  });
2234
2368
  var IdReaderField = BaseField.extend({
@@ -2237,12 +2371,18 @@ var IdReaderField = BaseField.extend({
2237
2371
  methods: import_v43.default.array(
2238
2372
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2239
2373
  )
2374
+ }).meta({
2375
+ description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
2376
+ id: "IdReaderField"
2240
2377
  });
2241
2378
  var CustomField = BaseField.extend({
2242
2379
  type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
2243
2380
  defaultValue: CustomFieldValue.optional(),
2244
2381
  src: import_v43.default.string().describe("Module source path for the custom field component"),
2245
2382
  configuration: import_v43.default.unknown().optional()
2383
+ }).meta({
2384
+ description: "An expiremental custom field that is defined by a module source path",
2385
+ id: "CustomField"
2246
2386
  });
2247
2387
  var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
2248
2388
  var LoaderField = BaseField.extend({
@@ -2252,22 +2392,25 @@ var LoaderField = BaseField.extend({
2252
2392
  configuration: import_v43.default.object({
2253
2393
  text: TranslationConfig.describe("Display text above the loading spinner")
2254
2394
  })
2255
- }).describe(
2256
- "A non-interactive field that indicates an in progress operation in form"
2257
- );
2395
+ }).meta({
2396
+ description: "A non-interactive field that indicates an in progress operation in form",
2397
+ id: "LoaderField"
2398
+ });
2258
2399
  var HiddenField = BaseField.extend({
2259
2400
  type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
2260
2401
  required: import_v43.default.boolean().default(false).optional(),
2261
2402
  defaultValue: TextValue.optional()
2262
- }).describe(
2263
- "A non-interactive, hidden field that only hold a value in the form"
2264
- );
2403
+ }).meta({
2404
+ description: "A non-interactive, hidden field that only hold a value in the form",
2405
+ id: "HiddenField"
2406
+ });
2265
2407
  var UserRoleField = BaseField.extend({
2266
2408
  type: import_v43.default.literal(FieldType.USER_ROLE),
2267
2409
  defaultValue: TextValue.optional()
2268
- }).describe(
2269
- "A select dropdown that is automatically populated with available user roles"
2270
- );
2410
+ }).meta({
2411
+ description: "A select dropdown that is automatically populated with available user roles",
2412
+ id: "UserRoleField"
2413
+ });
2271
2414
  var FieldConfig = import_v43.default.discriminatedUnion("type", [
2272
2415
  FieldGroup,
2273
2416
  Address,
@@ -2366,16 +2509,19 @@ var VerificationPageConfig = FormPageConfig.extend({
2366
2509
  type: z21.literal(PageTypes.enum.VERIFICATION),
2367
2510
  actions: VerificationActionConfig
2368
2511
  });
2369
- var PageConfig = z21.discriminatedUnion("type", [
2370
- FormPageConfig,
2371
- VerificationPageConfig
2372
- ]);
2512
+ var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
2513
+ id: "PageConfig",
2514
+ 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."
2515
+ });
2373
2516
 
2374
2517
  // ../commons/src/events/FormConfig.ts
2375
2518
  var DeclarationFormConfig = z22.object({
2376
2519
  label: TranslationConfig.describe("Human readable description of the form"),
2377
2520
  pages: z22.array(FormPageConfig)
2378
- }).describe("Configuration of the declaration form.");
2521
+ }).meta({
2522
+ id: "DeclarationFormConfig",
2523
+ description: "Configuration of the declaration form."
2524
+ });
2379
2525
  var ActionFormConfig = z22.object({
2380
2526
  label: TranslationConfig.describe("Human readable description of the form"),
2381
2527
  pages: z22.array(PageConfig)
@@ -2475,6 +2621,9 @@ var DeduplicationConfig = z23.object({
2475
2621
  id: z23.string(),
2476
2622
  label: TranslationConfig,
2477
2623
  query: Clause
2624
+ }).meta({
2625
+ id: "DeduplicationConfig",
2626
+ 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."
2478
2627
  });
2479
2628
 
2480
2629
  // ../commons/src/events/ActionConfig.ts
@@ -2592,17 +2741,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
2592
2741
  * OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
2593
2742
  * and treat them as "models" instead of duplicating the data structure in each endpoint.
2594
2743
  */
2595
- ReadActionConfig.meta({ id: "ReadActionConfig" }),
2596
- DeclareConfig.meta({ id: "DeclareActionConfig" }),
2597
- RejectConfig.meta({ id: "RejectActionConfig" }),
2598
- RegisterConfig.meta({ id: "RegisterActionConfig" }),
2744
+ ReadActionConfig.meta({
2745
+ id: "ReadActionConfig",
2746
+ description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
2747
+ }),
2748
+ DeclareConfig.meta({
2749
+ id: "DeclareActionConfig",
2750
+ description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
2751
+ }),
2752
+ RejectConfig.meta({
2753
+ id: "RejectActionConfig",
2754
+ description: "Configuration for rejecting a record before registration."
2755
+ }),
2756
+ RegisterConfig.meta({
2757
+ id: "RegisterActionConfig",
2758
+ description: "Configuration for registering a record."
2759
+ }),
2599
2760
  PrintCertificateActionConfig.meta({
2600
- id: "PrintCertificateActionConfig"
2761
+ id: "PrintCertificateActionConfig",
2762
+ description: "Configuration for printing a certificate of a registered record."
2763
+ }),
2764
+ RequestCorrectionConfig.meta({
2765
+ id: "RequestCorrectionActionConfig",
2766
+ description: "Configuration for requesting a correction on a registered record."
2601
2767
  }),
2602
- RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
2603
- EditActionConfig.meta({ id: "EditActionConfig" }),
2604
- ArchiveConfig.meta({ id: "ArchiveActionConfig" }),
2605
- CustomActionConfig.meta({ id: "CustomActionConfig" })
2768
+ EditActionConfig.meta({
2769
+ id: "EditActionConfig",
2770
+ description: "Configuration for editing a record before registration."
2771
+ }),
2772
+ ArchiveConfig.meta({
2773
+ id: "ArchiveActionConfig",
2774
+ description: "Configuration for archiving a record."
2775
+ }),
2776
+ CustomActionConfig.meta({
2777
+ id: "CustomActionConfig",
2778
+ description: "Configuration for a country-defined custom action. An event may include any number of these."
2779
+ })
2606
2780
  ]).describe(
2607
2781
  "Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
2608
2782
  ).meta({ id: "ActionConfig" });
@@ -2678,7 +2852,10 @@ var Field = BaseField2.extend({
2678
2852
  }).describe("Custom field defined for the summary view.");
2679
2853
  var SummaryConfig = z27.object({
2680
2854
  fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2681
- }).describe("Configuration of the event summary section.");
2855
+ }).meta({
2856
+ id: "SummaryConfig",
2857
+ 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."
2858
+ });
2682
2859
 
2683
2860
  // ../commons/src/events/AdvancedSearchConfig.ts
2684
2861
  var z28 = __toESM(require("zod/v4"));
@@ -2802,6 +2979,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
2802
2979
  var AdvancedSearchConfig = z28.object({
2803
2980
  title: TranslationConfig.describe("Advanced search tab title"),
2804
2981
  fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2982
+ }).meta({
2983
+ id: "AdvancedSearchConfig",
2984
+ 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()`)."
2805
2985
  });
2806
2986
 
2807
2987
  // ../commons/src/events/utils.ts
@@ -3669,7 +3849,7 @@ var _EventConfigBase = z33.object({
3669
3849
  ),
3670
3850
  label: TranslationConfig.describe("Human-readable label for the event type."),
3671
3851
  actions: z33.array(ActionConfig).describe(
3672
- "Configuration of system-defined actions associated with the event."
3852
+ "Configuration of core and custom actions associated with the event."
3673
3853
  ),
3674
3854
  actionOrder: z33.array(z33.string()).optional().describe(
3675
3855
  "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
@@ -3681,7 +3861,7 @@ var _EventConfigBase = z33.object({
3681
3861
  "Configuration of fields available in the advanced search feature."
3682
3862
  ),
3683
3863
  flags: z33.array(FlagConfig).optional().default([]).describe(
3684
- "Configuration of flags associated with the actions of this event type."
3864
+ "Configuration of custom flags associated with the actions of this event type."
3685
3865
  ),
3686
3866
  analytics: z33.boolean().optional().default(true).describe(
3687
3867
  "Indicates whether the records of this event type are included in analytics"
@@ -3694,8 +3874,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
3694
3874
  validateActionFlags(event2, ctx);
3695
3875
  validateActionOrder(event2, ctx);
3696
3876
  }).meta({
3697
- id: "EventConfig"
3698
- }).describe("Configuration defining an event type.");
3877
+ id: "EventConfig",
3878
+ description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
3879
+ });
3699
3880
 
3700
3881
  // ../commons/src/events/EventConfigInput.ts
3701
3882
  var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
@@ -3917,6 +4098,9 @@ var WorkqueueColumnValue = z34.object({
3917
4098
  var WorkqueueColumn = z34.object({
3918
4099
  label: TranslationConfig,
3919
4100
  value: WorkqueueColumnValue
4101
+ }).meta({
4102
+ id: "WorkqueueColumn",
4103
+ description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
3920
4104
  });
3921
4105
  function defineWorkqueuesColumns(workqueueColumns) {
3922
4106
  return workqueueColumns.map(
@@ -4119,18 +4303,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
4119
4303
  query: true,
4120
4304
  columns: true
4121
4305
  });
4122
- var WorkqueueConfigInput = z37.object({
4123
- slug: z37.string().describe("Determines the url of the workqueue."),
4124
- name: TranslationConfig.describe(
4125
- "Title of the workflow (both in navigation and on the page)"
4126
- ),
4127
- query: CountryConfigQueryInputType,
4128
- action: z37.object({ type: WorkqueueActionType }).optional().describe(
4129
- "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."
4130
- ),
4131
- columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
4132
- icon: AvailableIcons,
4133
- emptyMessage: TranslationConfig.optional()
4306
+ var WorkqueueConfigInput = WorkqueueConfig.extend({
4307
+ query: CountryConfigQueryInputType
4308
+ }).meta({
4309
+ id: "WorkqueueConfig",
4310
+ 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."
4134
4311
  });
4135
4312
  var WorkqueueCountInput = z37.array(
4136
4313
  z37.object({ slug: z37.string(), query: QueryType })
@@ -4172,7 +4349,9 @@ var BaseActionInput = z38.object({
4172
4349
  keepAssignment: z38.boolean().optional(),
4173
4350
  keepAssignmentIfAccepted: z38.boolean().optional(),
4174
4351
  keepAssignmentIfRejected: z38.boolean().optional(),
4175
- waitFor: z38.boolean().optional(),
4352
+ waitFor: z38.boolean().default(true).describe(
4353
+ "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."
4354
+ ),
4176
4355
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
4177
4356
  // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
4178
4357
  createdAtLocation: UUID.nullish().describe(
@@ -4352,7 +4531,7 @@ var Draft = z39.object({
4352
4531
  }).describe(
4353
4532
  "A temporary storage for an action. Stored with details of the event, creator and creation time."
4354
4533
  );
4355
- var DraftInput = BaseActionInput.extend({
4534
+ var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
4356
4535
  type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
4357
4536
  status: z39.enum([
4358
4537
  ActionStatus.Requested,