@opencrvs/toolkit 2.0.0-rc.ddf354d → 2.0.0-rc.de6e7de
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +197 -63
- package/dist/commons/api/router.d.ts +1 -1
- package/dist/commons/events/WorkqueueConfig.d.ts +5 -5
- package/dist/events/index.js +240 -77
- package/dist/notification/index.js +240 -77
- package/opencrvs-toolkit-2.0.0-rc.de6e7de.tgz +0 -0
- package/package.json +5 -1
- package/opencrvs-toolkit-2.0.0-rc.ddf354d.tgz +0 -0
|
@@ -655,8 +655,8 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
655
655
|
// Action can be shown to the user in the list but as disabled
|
|
656
656
|
EnableConditional
|
|
657
657
|
]).meta({
|
|
658
|
-
|
|
659
|
-
|
|
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
660
|
});
|
|
661
661
|
var DisplayOnReviewConditional = z7.object({
|
|
662
662
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
@@ -672,8 +672,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
672
672
|
// Field output can be shown / hidden on the review page
|
|
673
673
|
DisplayOnReviewConditional
|
|
674
674
|
]).meta({
|
|
675
|
-
|
|
676
|
-
|
|
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."
|
|
677
677
|
});
|
|
678
678
|
|
|
679
679
|
// ../commons/src/events/FieldType.ts
|
|
@@ -1309,8 +1309,8 @@ var FlagConfig = z15.object({
|
|
|
1309
1309
|
),
|
|
1310
1310
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1311
1311
|
}).meta({
|
|
1312
|
-
|
|
1313
|
-
|
|
1312
|
+
id: "FlagConfig",
|
|
1313
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1314
1314
|
});
|
|
1315
1315
|
var ActionFlagConfig = z15.object({
|
|
1316
1316
|
id: Flag,
|
|
@@ -1319,8 +1319,8 @@ var ActionFlagConfig = z15.object({
|
|
|
1319
1319
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1320
1320
|
)
|
|
1321
1321
|
}).meta({
|
|
1322
|
-
|
|
1323
|
-
|
|
1322
|
+
id: "ActionFlagConfig",
|
|
1323
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1324
1324
|
});
|
|
1325
1325
|
|
|
1326
1326
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1668,8 +1668,15 @@ var FieldReference = import_v43.default.object({
|
|
|
1668
1668
|
)
|
|
1669
1669
|
}).describe("Reference to a field by its ID");
|
|
1670
1670
|
var ValidationConfig = import_v43.default.object({
|
|
1671
|
-
validator: Conditional
|
|
1672
|
-
|
|
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."
|
|
1673
1680
|
});
|
|
1674
1681
|
var requiredSchema = import_v43.default.union([
|
|
1675
1682
|
import_v43.default.boolean(),
|
|
@@ -1708,6 +1715,9 @@ var BaseField = import_v43.default.object({
|
|
|
1708
1715
|
}).describe("Common properties shared across all field types.");
|
|
1709
1716
|
var Divider = BaseField.extend({
|
|
1710
1717
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1718
|
+
}).meta({
|
|
1719
|
+
description: "A horizontal line divider",
|
|
1720
|
+
id: "Divider"
|
|
1711
1721
|
});
|
|
1712
1722
|
var TextField = BaseField.extend({
|
|
1713
1723
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
@@ -1718,7 +1728,10 @@ var TextField = BaseField.extend({
|
|
|
1718
1728
|
prefix: TranslationConfig.optional(),
|
|
1719
1729
|
postfix: TranslationConfig.optional()
|
|
1720
1730
|
}).default({ type: "text" }).optional()
|
|
1721
|
-
}).
|
|
1731
|
+
}).meta({
|
|
1732
|
+
description: "A text input field",
|
|
1733
|
+
id: "TextField"
|
|
1734
|
+
});
|
|
1722
1735
|
var NumberField = BaseField.extend({
|
|
1723
1736
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1724
1737
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1728,7 +1741,10 @@ var NumberField = BaseField.extend({
|
|
|
1728
1741
|
prefix: TranslationConfig.optional(),
|
|
1729
1742
|
postfix: TranslationConfig.optional()
|
|
1730
1743
|
}).optional()
|
|
1731
|
-
}).
|
|
1744
|
+
}).meta({
|
|
1745
|
+
description: "A number input field",
|
|
1746
|
+
id: "NumberField"
|
|
1747
|
+
});
|
|
1732
1748
|
var TextAreaField = BaseField.extend({
|
|
1733
1749
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1734
1750
|
defaultValue: NonEmptyTextValue.optional(),
|
|
@@ -1739,7 +1755,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1739
1755
|
prefix: TranslationConfig.optional(),
|
|
1740
1756
|
postfix: TranslationConfig.optional()
|
|
1741
1757
|
}).default({ rows: 4 }).optional()
|
|
1742
|
-
}).
|
|
1758
|
+
}).meta({
|
|
1759
|
+
description: "A multiline text input",
|
|
1760
|
+
id: "TextAreaField"
|
|
1761
|
+
});
|
|
1743
1762
|
var ImageMimeType = import_v43.default.enum([
|
|
1744
1763
|
"image/png",
|
|
1745
1764
|
"image/jpg",
|
|
@@ -1769,13 +1788,19 @@ var SignatureField = BaseField.extend({
|
|
|
1769
1788
|
}).default({
|
|
1770
1789
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1771
1790
|
})
|
|
1772
|
-
}).
|
|
1791
|
+
}).meta({
|
|
1792
|
+
description: "A signature input field",
|
|
1793
|
+
id: "SignatureField"
|
|
1794
|
+
});
|
|
1773
1795
|
var EmailField = BaseField.extend({
|
|
1774
1796
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1775
1797
|
configuration: import_v43.default.object({
|
|
1776
1798
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1777
1799
|
}).default({ maxLength: 255 }).optional(),
|
|
1778
1800
|
defaultValue: NonEmptyTextValue.optional()
|
|
1801
|
+
}).meta({
|
|
1802
|
+
description: "An email input field",
|
|
1803
|
+
id: "EmailField"
|
|
1779
1804
|
});
|
|
1780
1805
|
var DateField = BaseField.extend({
|
|
1781
1806
|
type: import_v43.default.literal(FieldType.DATE),
|
|
@@ -1785,7 +1810,10 @@ var DateField = BaseField.extend({
|
|
|
1785
1810
|
"Text to display above the date input"
|
|
1786
1811
|
).optional()
|
|
1787
1812
|
}).optional()
|
|
1788
|
-
}).
|
|
1813
|
+
}).meta({
|
|
1814
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1815
|
+
id: "DateField"
|
|
1816
|
+
});
|
|
1789
1817
|
var AgeField = BaseField.extend({
|
|
1790
1818
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1791
1819
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1794,7 +1822,10 @@ var AgeField = BaseField.extend({
|
|
|
1794
1822
|
prefix: TranslationConfig.optional(),
|
|
1795
1823
|
postfix: TranslationConfig.optional()
|
|
1796
1824
|
})
|
|
1797
|
-
}).
|
|
1825
|
+
}).meta({
|
|
1826
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1827
|
+
id: "AgeField"
|
|
1828
|
+
});
|
|
1798
1829
|
var TimeField = BaseField.extend({
|
|
1799
1830
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1800
1831
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
@@ -1804,7 +1835,10 @@ var TimeField = BaseField.extend({
|
|
|
1804
1835
|
"Text to display above the time input"
|
|
1805
1836
|
).optional()
|
|
1806
1837
|
}).optional()
|
|
1807
|
-
}).
|
|
1838
|
+
}).meta({
|
|
1839
|
+
description: "A single time input (HH-mm)",
|
|
1840
|
+
id: "TimeField"
|
|
1841
|
+
});
|
|
1808
1842
|
var DateRangeField = BaseField.extend({
|
|
1809
1843
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1810
1844
|
defaultValue: DateRangeFieldValue.optional(),
|
|
@@ -1813,7 +1847,10 @@ var DateRangeField = BaseField.extend({
|
|
|
1813
1847
|
"Text to display above the date input"
|
|
1814
1848
|
).optional()
|
|
1815
1849
|
}).optional()
|
|
1816
|
-
}).
|
|
1850
|
+
}).meta({
|
|
1851
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1852
|
+
id: "DateRangeField"
|
|
1853
|
+
});
|
|
1817
1854
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1818
1855
|
"reg12",
|
|
1819
1856
|
"reg14",
|
|
@@ -1857,18 +1894,30 @@ var ImageViewField = BaseField.extend({
|
|
|
1857
1894
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1858
1895
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1859
1896
|
configuration: ImageConfiguration
|
|
1860
|
-
}).
|
|
1897
|
+
}).meta({
|
|
1898
|
+
description: "A read-only image component for form pages",
|
|
1899
|
+
id: "ImageViewField"
|
|
1900
|
+
});
|
|
1861
1901
|
var Paragraph = BaseField.extend({
|
|
1862
1902
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1863
1903
|
configuration: ParagraphConfiguration
|
|
1864
|
-
}).
|
|
1904
|
+
}).meta({
|
|
1905
|
+
description: "A read-only HTML <p> paragraph",
|
|
1906
|
+
id: "Paragraph"
|
|
1907
|
+
});
|
|
1865
1908
|
var Heading = BaseField.extend({
|
|
1866
1909
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1867
1910
|
configuration: HeadingConfiguration
|
|
1868
|
-
}).
|
|
1911
|
+
}).meta({
|
|
1912
|
+
description: "A read-only heading component for form pages",
|
|
1913
|
+
id: "Heading"
|
|
1914
|
+
});
|
|
1869
1915
|
var PageHeader = BaseField.extend({
|
|
1870
1916
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1871
|
-
}).
|
|
1917
|
+
}).meta({
|
|
1918
|
+
description: "A read-only header component for form pages",
|
|
1919
|
+
id: "PageHeader"
|
|
1920
|
+
});
|
|
1872
1921
|
var File = BaseField.extend({
|
|
1873
1922
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1874
1923
|
defaultValue: FileFieldValue.optional(),
|
|
@@ -1887,7 +1936,10 @@ var File = BaseField.extend({
|
|
|
1887
1936
|
}).default({
|
|
1888
1937
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1889
1938
|
})
|
|
1890
|
-
}).
|
|
1939
|
+
}).meta({
|
|
1940
|
+
description: "A file upload field",
|
|
1941
|
+
id: "File"
|
|
1942
|
+
});
|
|
1891
1943
|
var SelectOption = import_v43.default.object({
|
|
1892
1944
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1893
1945
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1904,7 +1956,10 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1904
1956
|
"Placeholder for the number field"
|
|
1905
1957
|
)
|
|
1906
1958
|
}).optional()
|
|
1907
|
-
}).
|
|
1959
|
+
}).meta({
|
|
1960
|
+
description: "A number with unit input field",
|
|
1961
|
+
id: "NumberWithUnitField"
|
|
1962
|
+
});
|
|
1908
1963
|
var RadioGroup = BaseField.extend({
|
|
1909
1964
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1910
1965
|
defaultValue: TextValue.optional(),
|
|
@@ -1914,7 +1969,10 @@ var RadioGroup = BaseField.extend({
|
|
|
1914
1969
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1915
1970
|
}).optional()
|
|
1916
1971
|
}).optional()
|
|
1917
|
-
}).
|
|
1972
|
+
}).meta({
|
|
1973
|
+
description: "A grouped radio button field",
|
|
1974
|
+
id: "RadioGroup"
|
|
1975
|
+
});
|
|
1918
1976
|
var BulletList = BaseField.extend({
|
|
1919
1977
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1920
1978
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1923,7 +1981,10 @@ var BulletList = BaseField.extend({
|
|
|
1923
1981
|
fontVariant: HtmlFontVariant.optional()
|
|
1924
1982
|
}).optional()
|
|
1925
1983
|
}).default({})
|
|
1926
|
-
}).
|
|
1984
|
+
}).meta({
|
|
1985
|
+
description: "A list of bullet points",
|
|
1986
|
+
id: "BulletList"
|
|
1987
|
+
});
|
|
1927
1988
|
var Select = BaseField.extend({
|
|
1928
1989
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1929
1990
|
defaultValue: TextValue.optional(),
|
|
@@ -1938,7 +1999,10 @@ var Select = BaseField.extend({
|
|
|
1938
1999
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1939
2000
|
`
|
|
1940
2001
|
)
|
|
1941
|
-
}).
|
|
2002
|
+
}).meta({
|
|
2003
|
+
description: "A select input field",
|
|
2004
|
+
id: "Select"
|
|
2005
|
+
});
|
|
1942
2006
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1943
2007
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1944
2008
|
label: TranslationConfig.describe("The label of the option")
|
|
@@ -1947,7 +2011,10 @@ var SelectDateRangeField = BaseField.extend({
|
|
|
1947
2011
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1948
2012
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1949
2013
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1950
|
-
}).
|
|
2014
|
+
}).meta({
|
|
2015
|
+
description: "A date range selection field",
|
|
2016
|
+
id: "SelectDateRangeField"
|
|
2017
|
+
});
|
|
1951
2018
|
var NameConfig = import_v43.default.object({
|
|
1952
2019
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1953
2020
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1978,26 +2045,41 @@ var NameField = BaseField.extend({
|
|
|
1978
2045
|
surname: { required: true }
|
|
1979
2046
|
}
|
|
1980
2047
|
}).optional()
|
|
1981
|
-
}).
|
|
2048
|
+
}).meta({
|
|
2049
|
+
description: "A field for entering a persons name",
|
|
2050
|
+
id: "NameField"
|
|
2051
|
+
});
|
|
1982
2052
|
var PhoneField = BaseField.extend({
|
|
1983
2053
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1984
2054
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1985
|
-
}).
|
|
2055
|
+
}).meta({
|
|
2056
|
+
description: "A field for entering a phone number",
|
|
2057
|
+
id: "PhoneField"
|
|
2058
|
+
});
|
|
1986
2059
|
var IdField = BaseField.extend({
|
|
1987
2060
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1988
2061
|
type: import_v43.default.literal(FieldType.ID)
|
|
1989
|
-
}).
|
|
2062
|
+
}).meta({
|
|
2063
|
+
description: "A field for entering an ID",
|
|
2064
|
+
id: "IdField"
|
|
2065
|
+
});
|
|
1990
2066
|
var Checkbox = BaseField.extend({
|
|
1991
2067
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1992
2068
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1993
|
-
}).
|
|
2069
|
+
}).meta({
|
|
2070
|
+
description: "A boolean checkbox field",
|
|
2071
|
+
id: "Checkbox"
|
|
2072
|
+
});
|
|
1994
2073
|
var Country = BaseField.extend({
|
|
1995
2074
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1996
2075
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1997
2076
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1998
2077
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1999
2078
|
)
|
|
2000
|
-
}).
|
|
2079
|
+
}).meta({
|
|
2080
|
+
description: "A field for selecting a country",
|
|
2081
|
+
id: "Country"
|
|
2082
|
+
});
|
|
2001
2083
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
2002
2084
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
2003
2085
|
);
|
|
@@ -2006,16 +2088,18 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2006
2088
|
"HEALTH_FACILITY",
|
|
2007
2089
|
"CRVS_OFFICE"
|
|
2008
2090
|
]);
|
|
2009
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
2010
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
2011
|
-
type: AdministrativeAreas,
|
|
2012
|
-
allowedLocations: AllowedLocations
|
|
2013
|
-
}).describe("Administrative area options");
|
|
2014
2091
|
var AdministrativeAreaField = BaseField.extend({
|
|
2015
2092
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2016
2093
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2017
|
-
configuration:
|
|
2018
|
-
|
|
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
|
+
});
|
|
2019
2103
|
var LocationInput = BaseField.extend({
|
|
2020
2104
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2021
2105
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
@@ -2023,7 +2107,10 @@ var LocationInput = BaseField.extend({
|
|
|
2023
2107
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2024
2108
|
allowedLocations: AllowedLocations
|
|
2025
2109
|
}).optional()
|
|
2026
|
-
}).
|
|
2110
|
+
}).meta({
|
|
2111
|
+
description: "A field for selecting a location",
|
|
2112
|
+
id: "LocationInput"
|
|
2113
|
+
});
|
|
2027
2114
|
var FileUploadWithOptions = BaseField.extend({
|
|
2028
2115
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2029
2116
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
@@ -2037,6 +2124,9 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2037
2124
|
}).default({
|
|
2038
2125
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2039
2126
|
})
|
|
2127
|
+
}).meta({
|
|
2128
|
+
description: "A field for uploading files with file type options",
|
|
2129
|
+
id: "FileUploadWithOptions"
|
|
2040
2130
|
});
|
|
2041
2131
|
var Facility = BaseField.extend({
|
|
2042
2132
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
@@ -2082,7 +2172,10 @@ var Address = BaseField.extend({
|
|
|
2082
2172
|
allowedLocations: AllowedLocations
|
|
2083
2173
|
}).optional(),
|
|
2084
2174
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
2085
|
-
}).
|
|
2175
|
+
}).meta({
|
|
2176
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2177
|
+
id: "Address"
|
|
2178
|
+
});
|
|
2086
2179
|
var StaticDataEntry = import_v43.default.object({
|
|
2087
2180
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2088
2181
|
label: TranslationConfig,
|
|
@@ -2097,7 +2190,10 @@ var DataField = BaseField.extend({
|
|
|
2097
2190
|
subtitle: TranslationConfig.optional(),
|
|
2098
2191
|
data: import_v43.default.array(DataEntry)
|
|
2099
2192
|
})
|
|
2100
|
-
}).
|
|
2193
|
+
}).meta({
|
|
2194
|
+
description: "A field for displaying a table of read-only data",
|
|
2195
|
+
id: "DataField"
|
|
2196
|
+
});
|
|
2101
2197
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2102
2198
|
var ButtonType = import_v43.default.enum([
|
|
2103
2199
|
"primary",
|
|
@@ -2124,11 +2220,17 @@ var ButtonField = BaseField.extend({
|
|
|
2124
2220
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2125
2221
|
defaultValue: ButtonFieldValue.optional(),
|
|
2126
2222
|
configuration: ButtonConfiguration
|
|
2127
|
-
}).
|
|
2223
|
+
}).meta({
|
|
2224
|
+
description: "A generic button that can be used to trigger an action",
|
|
2225
|
+
id: "ButtonField"
|
|
2226
|
+
});
|
|
2128
2227
|
var FieldGroup = BaseField.extend({
|
|
2129
2228
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2130
2229
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2131
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"
|
|
2132
2234
|
});
|
|
2133
2235
|
var AlphaPrintButton = BaseField.extend({
|
|
2134
2236
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2138,7 +2240,10 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2138
2240
|
"Label for the print button"
|
|
2139
2241
|
)
|
|
2140
2242
|
})
|
|
2141
|
-
}).
|
|
2243
|
+
}).meta({
|
|
2244
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2245
|
+
id: "AlphaPrintButton"
|
|
2246
|
+
});
|
|
2142
2247
|
var HttpField = BaseField.extend({
|
|
2143
2248
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2144
2249
|
defaultValue: HttpFieldValue.optional(),
|
|
@@ -2154,20 +2259,30 @@ var HttpField = BaseField.extend({
|
|
|
2154
2259
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2155
2260
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2156
2261
|
})
|
|
2157
|
-
}).
|
|
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
|
+
});
|
|
2158
2266
|
var AutocompleteField = BaseField.extend({
|
|
2159
2267
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2160
2268
|
configuration: import_v43.default.object({
|
|
2161
|
-
url: import_v43.default.string().describe(
|
|
2269
|
+
url: import_v43.default.string().describe(
|
|
2270
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2271
|
+
).optional(),
|
|
2162
2272
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2163
2273
|
defaultOptions: import_v43.default.array(
|
|
2164
2274
|
import_v43.default.object({
|
|
2165
2275
|
label: import_v43.default.string(),
|
|
2166
2276
|
value: import_v43.default.string()
|
|
2167
2277
|
})
|
|
2168
|
-
).optional()
|
|
2278
|
+
).optional().describe(
|
|
2279
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2280
|
+
)
|
|
2169
2281
|
})
|
|
2170
|
-
}).
|
|
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
|
+
});
|
|
2171
2286
|
var SearchField = HttpField.extend({
|
|
2172
2287
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2173
2288
|
configuration: SearchQuery.pick({
|
|
@@ -2200,6 +2315,9 @@ var SearchField = HttpField.extend({
|
|
|
2200
2315
|
ok: TranslationConfig.optional()
|
|
2201
2316
|
}).optional()
|
|
2202
2317
|
})
|
|
2318
|
+
}).meta({
|
|
2319
|
+
description: "A search input field",
|
|
2320
|
+
id: "SearchField"
|
|
2203
2321
|
});
|
|
2204
2322
|
var LinkButtonField = BaseField.extend({
|
|
2205
2323
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2208,7 +2326,10 @@ var LinkButtonField = BaseField.extend({
|
|
|
2208
2326
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2209
2327
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2210
2328
|
})
|
|
2211
|
-
}).
|
|
2329
|
+
}).meta({
|
|
2330
|
+
description: "A button that opens a URL link",
|
|
2331
|
+
id: "LinkButtonField"
|
|
2332
|
+
});
|
|
2212
2333
|
var VerificationStatus = BaseField.extend({
|
|
2213
2334
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2214
2335
|
defaultValue: VerificationStatusValue.optional(),
|
|
@@ -2218,15 +2339,19 @@ var VerificationStatus = BaseField.extend({
|
|
|
2218
2339
|
"Explaining text on the banner in form."
|
|
2219
2340
|
)
|
|
2220
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"
|
|
2221
2345
|
});
|
|
2222
2346
|
var QueryParamReaderField = BaseField.extend({
|
|
2223
2347
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2224
2348
|
configuration: import_v43.default.object({
|
|
2225
2349
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2226
2350
|
})
|
|
2227
|
-
}).
|
|
2228
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2229
|
-
|
|
2351
|
+
}).meta({
|
|
2352
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2353
|
+
id: "QueryParamReaderField"
|
|
2354
|
+
});
|
|
2230
2355
|
var QrReaderField = BaseField.extend({
|
|
2231
2356
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2232
2357
|
defaultValue: QrReaderFieldValue.optional(),
|
|
@@ -2237,7 +2362,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2237
2362
|
})
|
|
2238
2363
|
}).optional()
|
|
2239
2364
|
}).meta({
|
|
2240
|
-
description: "
|
|
2365
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2241
2366
|
id: "QrReaderField"
|
|
2242
2367
|
});
|
|
2243
2368
|
var IdReaderField = BaseField.extend({
|
|
@@ -2246,12 +2371,18 @@ var IdReaderField = BaseField.extend({
|
|
|
2246
2371
|
methods: import_v43.default.array(
|
|
2247
2372
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2248
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"
|
|
2249
2377
|
});
|
|
2250
2378
|
var CustomField = BaseField.extend({
|
|
2251
2379
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2252
2380
|
defaultValue: CustomFieldValue.optional(),
|
|
2253
2381
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2254
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"
|
|
2255
2386
|
});
|
|
2256
2387
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2257
2388
|
var LoaderField = BaseField.extend({
|
|
@@ -2261,22 +2392,25 @@ var LoaderField = BaseField.extend({
|
|
|
2261
2392
|
configuration: import_v43.default.object({
|
|
2262
2393
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2263
2394
|
})
|
|
2264
|
-
}).
|
|
2265
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2266
|
-
|
|
2395
|
+
}).meta({
|
|
2396
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2397
|
+
id: "LoaderField"
|
|
2398
|
+
});
|
|
2267
2399
|
var HiddenField = BaseField.extend({
|
|
2268
2400
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2269
2401
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2270
2402
|
defaultValue: TextValue.optional()
|
|
2271
|
-
}).
|
|
2272
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2273
|
-
|
|
2403
|
+
}).meta({
|
|
2404
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2405
|
+
id: "HiddenField"
|
|
2406
|
+
});
|
|
2274
2407
|
var UserRoleField = BaseField.extend({
|
|
2275
2408
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2276
2409
|
defaultValue: TextValue.optional()
|
|
2277
|
-
}).
|
|
2278
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2279
|
-
|
|
2410
|
+
}).meta({
|
|
2411
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2412
|
+
id: "UserRoleField"
|
|
2413
|
+
});
|
|
2280
2414
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2281
2415
|
FieldGroup,
|
|
2282
2416
|
Address,
|
|
@@ -2376,15 +2510,18 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2376
2510
|
actions: VerificationActionConfig
|
|
2377
2511
|
});
|
|
2378
2512
|
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2379
|
-
|
|
2380
|
-
|
|
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."
|
|
2381
2515
|
});
|
|
2382
2516
|
|
|
2383
2517
|
// ../commons/src/events/FormConfig.ts
|
|
2384
2518
|
var DeclarationFormConfig = z22.object({
|
|
2385
2519
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2386
2520
|
pages: z22.array(FormPageConfig)
|
|
2387
|
-
}).
|
|
2521
|
+
}).meta({
|
|
2522
|
+
id: "DeclarationFormConfig",
|
|
2523
|
+
description: "Configuration of the declaration form."
|
|
2524
|
+
});
|
|
2388
2525
|
var ActionFormConfig = z22.object({
|
|
2389
2526
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2390
2527
|
pages: z22.array(PageConfig)
|
|
@@ -2601,17 +2738,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2601
2738
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2602
2739
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2603
2740
|
*/
|
|
2604
|
-
ReadActionConfig.meta({
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2741
|
+
ReadActionConfig.meta({
|
|
2742
|
+
id: "ReadActionConfig",
|
|
2743
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2744
|
+
}),
|
|
2745
|
+
DeclareConfig.meta({
|
|
2746
|
+
id: "DeclareActionConfig",
|
|
2747
|
+
description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
|
|
2748
|
+
}),
|
|
2749
|
+
RejectConfig.meta({
|
|
2750
|
+
id: "RejectActionConfig",
|
|
2751
|
+
description: "Configuration for rejecting a record before registration."
|
|
2752
|
+
}),
|
|
2753
|
+
RegisterConfig.meta({
|
|
2754
|
+
id: "RegisterActionConfig",
|
|
2755
|
+
description: "Configuration for registering a record."
|
|
2756
|
+
}),
|
|
2608
2757
|
PrintCertificateActionConfig.meta({
|
|
2609
|
-
id: "PrintCertificateActionConfig"
|
|
2758
|
+
id: "PrintCertificateActionConfig",
|
|
2759
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
2760
|
+
}),
|
|
2761
|
+
RequestCorrectionConfig.meta({
|
|
2762
|
+
id: "RequestCorrectionActionConfig",
|
|
2763
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
2764
|
+
}),
|
|
2765
|
+
EditActionConfig.meta({
|
|
2766
|
+
id: "EditActionConfig",
|
|
2767
|
+
description: "Configuration for editing a record before registration."
|
|
2610
2768
|
}),
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2769
|
+
ArchiveConfig.meta({
|
|
2770
|
+
id: "ArchiveActionConfig",
|
|
2771
|
+
description: "Configuration for archiving a record."
|
|
2772
|
+
}),
|
|
2773
|
+
CustomActionConfig.meta({
|
|
2774
|
+
id: "CustomActionConfig",
|
|
2775
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
2776
|
+
})
|
|
2615
2777
|
]).describe(
|
|
2616
2778
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2617
2779
|
).meta({ id: "ActionConfig" });
|
|
@@ -3703,8 +3865,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
3703
3865
|
validateActionFlags(event2, ctx);
|
|
3704
3866
|
validateActionOrder(event2, ctx);
|
|
3705
3867
|
}).meta({
|
|
3706
|
-
id: "EventConfig"
|
|
3707
|
-
|
|
3868
|
+
id: "EventConfig",
|
|
3869
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
3870
|
+
});
|
|
3708
3871
|
|
|
3709
3872
|
// ../commons/src/events/EventConfigInput.ts
|
|
3710
3873
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencrvs/toolkit",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.de6e7de",
|
|
4
4
|
"description": "OpenCRVS toolkit for building country configurations",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"build": "./build.sh",
|
|
21
21
|
"build:all": "lerna run build --include-dependencies --scope @opencrvs/toolkit && ./build.sh"
|
|
22
22
|
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/opencrvs/opencrvs-core.git"
|
|
26
|
+
},
|
|
23
27
|
"dependencies": {
|
|
24
28
|
"@trpc/client": "11.4.3",
|
|
25
29
|
"@trpc/server": "^11.8.0",
|
|
Binary file
|