@opencrvs/toolkit 2.0.0-rc.5f2b416 → 2.0.0-rc.5f678db

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