@opencrvs/toolkit 2.0.0-rc.a67dcdd → 2.0.0-rc.a6e6000
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/build.sh +0 -3
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +218 -85
- package/dist/cli.js +206 -36
- package/dist/commons/api/router.d.ts +3311 -246
- package/dist/commons/conditionals/validate.d.ts +1 -0
- package/dist/commons/events/ActionInput.d.ts +108 -0
- package/dist/commons/events/Draft.d.ts +4 -2
- package/dist/commons/events/EventIndex.d.ts +0 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +0 -2
- package/dist/commons/events/utils.d.ts +1 -1
- package/dist/conditionals/index.js +3 -1
- package/dist/events/index.js +289 -146
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +204 -34
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +54 -30
- package/dist/notification/index.js +276 -116
- package/dist/scopes/index.js +3 -1
- package/opencrvs-toolkit-2.0.0-rc.a6e6000.tgz +0 -0
- package/package.json +6 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/core-en.json +0 -7238
- package/dist/core-en.json.d.ts +0 -2
- package/opencrvs-toolkit-2.0.0-rc.a67dcdd.tgz +0 -0
|
@@ -293,7 +293,9 @@ var ScopeType = z2.enum([
|
|
|
293
293
|
var EncodedScope = z2.string().brand("EncodedScope");
|
|
294
294
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
295
295
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
296
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
296
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
297
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
298
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
297
299
|
};
|
|
298
300
|
|
|
299
301
|
// ../commons/src/authentication.ts
|
|
@@ -652,7 +654,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
652
654
|
ShowConditional,
|
|
653
655
|
// Action can be shown to the user in the list but as disabled
|
|
654
656
|
EnableConditional
|
|
655
|
-
])
|
|
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
|
+
});
|
|
656
661
|
var DisplayOnReviewConditional = z7.object({
|
|
657
662
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
658
663
|
conditional: Conditional
|
|
@@ -667,8 +672,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
667
672
|
// Field output can be shown / hidden on the review page
|
|
668
673
|
DisplayOnReviewConditional
|
|
669
674
|
]).meta({
|
|
670
|
-
|
|
671
|
-
|
|
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."
|
|
672
677
|
});
|
|
673
678
|
|
|
674
679
|
// ../commons/src/events/FieldType.ts
|
|
@@ -980,28 +985,20 @@ function schemaPriority(schema) {
|
|
|
980
985
|
return idx === -1 ? 9999 : idx;
|
|
981
986
|
}
|
|
982
987
|
function safeUnion(schemas) {
|
|
988
|
+
const sortedSchemas = [...schemas].sort(
|
|
989
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
990
|
+
);
|
|
983
991
|
return z12.any().superRefine((val, ctx) => {
|
|
984
|
-
const
|
|
985
|
-
|
|
986
|
-
|
|
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
|
-
});
|
|
992
|
+
for (const schema of sortedSchemas) {
|
|
993
|
+
if (schema.safeParse(val).success) {
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
1004
996
|
}
|
|
997
|
+
ctx.addIssue({
|
|
998
|
+
code: "invalid_type",
|
|
999
|
+
expected: "custom",
|
|
1000
|
+
message: "Value does not match any schema"
|
|
1001
|
+
});
|
|
1005
1002
|
}).meta({
|
|
1006
1003
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
1007
1004
|
});
|
|
@@ -1311,6 +1308,9 @@ var FlagConfig = z15.object({
|
|
|
1311
1308
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1312
1309
|
),
|
|
1313
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."
|
|
1314
1314
|
});
|
|
1315
1315
|
var ActionFlagConfig = z15.object({
|
|
1316
1316
|
id: Flag,
|
|
@@ -1318,6 +1318,9 @@ var ActionFlagConfig = z15.object({
|
|
|
1318
1318
|
conditional: Conditional.optional().describe(
|
|
1319
1319
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1320
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."
|
|
1321
1324
|
});
|
|
1322
1325
|
|
|
1323
1326
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1339,8 +1342,7 @@ var ActionCreationMetadata = z16.object({
|
|
|
1339
1342
|
),
|
|
1340
1343
|
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1341
1344
|
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.")
|
|
1345
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1344
1346
|
});
|
|
1345
1347
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1346
1348
|
registrationNumber: z16.string().describe(
|
|
@@ -1368,9 +1370,6 @@ var EventMetadata = z16.object({
|
|
|
1368
1370
|
createdAtLocation: UUID.nullish().describe(
|
|
1369
1371
|
"Location of the user who created the event."
|
|
1370
1372
|
),
|
|
1371
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1372
|
-
"Signature of the user who created the event."
|
|
1373
|
-
),
|
|
1374
1373
|
updatedAtLocation: UUID.nullish().describe(
|
|
1375
1374
|
"Location of the user who last changed the status."
|
|
1376
1375
|
),
|
|
@@ -1663,14 +1662,21 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1663
1662
|
}
|
|
1664
1663
|
}).describe("Unique identifier for the field");
|
|
1665
1664
|
var FieldReference = import_v43.default.object({
|
|
1666
|
-
$$field: FieldId,
|
|
1665
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1667
1666
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1668
1667
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1669
1668
|
)
|
|
1670
1669
|
}).describe("Reference to a field by its ID");
|
|
1671
1670
|
var ValidationConfig = import_v43.default.object({
|
|
1672
|
-
validator: Conditional
|
|
1673
|
-
|
|
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."
|
|
1674
1680
|
});
|
|
1675
1681
|
var requiredSchema = import_v43.default.union([
|
|
1676
1682
|
import_v43.default.boolean(),
|
|
@@ -1709,6 +1715,9 @@ var BaseField = import_v43.default.object({
|
|
|
1709
1715
|
}).describe("Common properties shared across all field types.");
|
|
1710
1716
|
var Divider = BaseField.extend({
|
|
1711
1717
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1718
|
+
}).meta({
|
|
1719
|
+
description: "A horizontal line divider",
|
|
1720
|
+
id: "Divider"
|
|
1712
1721
|
});
|
|
1713
1722
|
var TextField = BaseField.extend({
|
|
1714
1723
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
@@ -1719,7 +1728,10 @@ var TextField = BaseField.extend({
|
|
|
1719
1728
|
prefix: TranslationConfig.optional(),
|
|
1720
1729
|
postfix: TranslationConfig.optional()
|
|
1721
1730
|
}).default({ type: "text" }).optional()
|
|
1722
|
-
}).
|
|
1731
|
+
}).meta({
|
|
1732
|
+
description: "A text input field",
|
|
1733
|
+
id: "TextField"
|
|
1734
|
+
});
|
|
1723
1735
|
var NumberField = BaseField.extend({
|
|
1724
1736
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1725
1737
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1729,7 +1741,10 @@ var NumberField = BaseField.extend({
|
|
|
1729
1741
|
prefix: TranslationConfig.optional(),
|
|
1730
1742
|
postfix: TranslationConfig.optional()
|
|
1731
1743
|
}).optional()
|
|
1732
|
-
}).
|
|
1744
|
+
}).meta({
|
|
1745
|
+
description: "A number input field",
|
|
1746
|
+
id: "NumberField"
|
|
1747
|
+
});
|
|
1733
1748
|
var TextAreaField = BaseField.extend({
|
|
1734
1749
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1735
1750
|
defaultValue: NonEmptyTextValue.optional(),
|
|
@@ -1740,7 +1755,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1740
1755
|
prefix: TranslationConfig.optional(),
|
|
1741
1756
|
postfix: TranslationConfig.optional()
|
|
1742
1757
|
}).default({ rows: 4 }).optional()
|
|
1743
|
-
}).
|
|
1758
|
+
}).meta({
|
|
1759
|
+
description: "A multiline text input",
|
|
1760
|
+
id: "TextAreaField"
|
|
1761
|
+
});
|
|
1744
1762
|
var ImageMimeType = import_v43.default.enum([
|
|
1745
1763
|
"image/png",
|
|
1746
1764
|
"image/jpg",
|
|
@@ -1770,13 +1788,19 @@ var SignatureField = BaseField.extend({
|
|
|
1770
1788
|
}).default({
|
|
1771
1789
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1772
1790
|
})
|
|
1773
|
-
}).
|
|
1791
|
+
}).meta({
|
|
1792
|
+
description: "A signature input field",
|
|
1793
|
+
id: "SignatureField"
|
|
1794
|
+
});
|
|
1774
1795
|
var EmailField = BaseField.extend({
|
|
1775
1796
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1776
1797
|
configuration: import_v43.default.object({
|
|
1777
1798
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1778
1799
|
}).default({ maxLength: 255 }).optional(),
|
|
1779
1800
|
defaultValue: NonEmptyTextValue.optional()
|
|
1801
|
+
}).meta({
|
|
1802
|
+
description: "An email input field",
|
|
1803
|
+
id: "EmailField"
|
|
1780
1804
|
});
|
|
1781
1805
|
var DateField = BaseField.extend({
|
|
1782
1806
|
type: import_v43.default.literal(FieldType.DATE),
|
|
@@ -1786,7 +1810,10 @@ var DateField = BaseField.extend({
|
|
|
1786
1810
|
"Text to display above the date input"
|
|
1787
1811
|
).optional()
|
|
1788
1812
|
}).optional()
|
|
1789
|
-
}).
|
|
1813
|
+
}).meta({
|
|
1814
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1815
|
+
id: "DateField"
|
|
1816
|
+
});
|
|
1790
1817
|
var AgeField = BaseField.extend({
|
|
1791
1818
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1792
1819
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1795,7 +1822,10 @@ var AgeField = BaseField.extend({
|
|
|
1795
1822
|
prefix: TranslationConfig.optional(),
|
|
1796
1823
|
postfix: TranslationConfig.optional()
|
|
1797
1824
|
})
|
|
1798
|
-
}).
|
|
1825
|
+
}).meta({
|
|
1826
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1827
|
+
id: "AgeField"
|
|
1828
|
+
});
|
|
1799
1829
|
var TimeField = BaseField.extend({
|
|
1800
1830
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1801
1831
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
@@ -1805,7 +1835,10 @@ var TimeField = BaseField.extend({
|
|
|
1805
1835
|
"Text to display above the time input"
|
|
1806
1836
|
).optional()
|
|
1807
1837
|
}).optional()
|
|
1808
|
-
}).
|
|
1838
|
+
}).meta({
|
|
1839
|
+
description: "A single time input (HH-mm)",
|
|
1840
|
+
id: "TimeField"
|
|
1841
|
+
});
|
|
1809
1842
|
var DateRangeField = BaseField.extend({
|
|
1810
1843
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1811
1844
|
defaultValue: DateRangeFieldValue.optional(),
|
|
@@ -1814,7 +1847,10 @@ var DateRangeField = BaseField.extend({
|
|
|
1814
1847
|
"Text to display above the date input"
|
|
1815
1848
|
).optional()
|
|
1816
1849
|
}).optional()
|
|
1817
|
-
}).
|
|
1850
|
+
}).meta({
|
|
1851
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1852
|
+
id: "DateRangeField"
|
|
1853
|
+
});
|
|
1818
1854
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1819
1855
|
"reg12",
|
|
1820
1856
|
"reg14",
|
|
@@ -1858,18 +1894,30 @@ var ImageViewField = BaseField.extend({
|
|
|
1858
1894
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1859
1895
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1860
1896
|
configuration: ImageConfiguration
|
|
1861
|
-
}).
|
|
1897
|
+
}).meta({
|
|
1898
|
+
description: "A read-only image component for form pages",
|
|
1899
|
+
id: "ImageViewField"
|
|
1900
|
+
});
|
|
1862
1901
|
var Paragraph = BaseField.extend({
|
|
1863
1902
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1864
1903
|
configuration: ParagraphConfiguration
|
|
1865
|
-
}).
|
|
1904
|
+
}).meta({
|
|
1905
|
+
description: "A read-only HTML <p> paragraph",
|
|
1906
|
+
id: "Paragraph"
|
|
1907
|
+
});
|
|
1866
1908
|
var Heading = BaseField.extend({
|
|
1867
1909
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1868
1910
|
configuration: HeadingConfiguration
|
|
1869
|
-
}).
|
|
1911
|
+
}).meta({
|
|
1912
|
+
description: "A read-only heading component for form pages",
|
|
1913
|
+
id: "Heading"
|
|
1914
|
+
});
|
|
1870
1915
|
var PageHeader = BaseField.extend({
|
|
1871
1916
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1872
|
-
}).
|
|
1917
|
+
}).meta({
|
|
1918
|
+
description: "A read-only header component for form pages",
|
|
1919
|
+
id: "PageHeader"
|
|
1920
|
+
});
|
|
1873
1921
|
var File = BaseField.extend({
|
|
1874
1922
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1875
1923
|
defaultValue: FileFieldValue.optional(),
|
|
@@ -1888,7 +1936,10 @@ var File = BaseField.extend({
|
|
|
1888
1936
|
}).default({
|
|
1889
1937
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1890
1938
|
})
|
|
1891
|
-
}).
|
|
1939
|
+
}).meta({
|
|
1940
|
+
description: "A file upload field",
|
|
1941
|
+
id: "File"
|
|
1942
|
+
});
|
|
1892
1943
|
var SelectOption = import_v43.default.object({
|
|
1893
1944
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1894
1945
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1905,7 +1956,10 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1905
1956
|
"Placeholder for the number field"
|
|
1906
1957
|
)
|
|
1907
1958
|
}).optional()
|
|
1908
|
-
}).
|
|
1959
|
+
}).meta({
|
|
1960
|
+
description: "A number with unit input field",
|
|
1961
|
+
id: "NumberWithUnitField"
|
|
1962
|
+
});
|
|
1909
1963
|
var RadioGroup = BaseField.extend({
|
|
1910
1964
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1911
1965
|
defaultValue: TextValue.optional(),
|
|
@@ -1915,7 +1969,10 @@ var RadioGroup = BaseField.extend({
|
|
|
1915
1969
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1916
1970
|
}).optional()
|
|
1917
1971
|
}).optional()
|
|
1918
|
-
}).
|
|
1972
|
+
}).meta({
|
|
1973
|
+
description: "A grouped radio button field",
|
|
1974
|
+
id: "RadioGroup"
|
|
1975
|
+
});
|
|
1919
1976
|
var BulletList = BaseField.extend({
|
|
1920
1977
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1921
1978
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1924,7 +1981,10 @@ var BulletList = BaseField.extend({
|
|
|
1924
1981
|
fontVariant: HtmlFontVariant.optional()
|
|
1925
1982
|
}).optional()
|
|
1926
1983
|
}).default({})
|
|
1927
|
-
}).
|
|
1984
|
+
}).meta({
|
|
1985
|
+
description: "A list of bullet points",
|
|
1986
|
+
id: "BulletList"
|
|
1987
|
+
});
|
|
1928
1988
|
var Select = BaseField.extend({
|
|
1929
1989
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1930
1990
|
defaultValue: TextValue.optional(),
|
|
@@ -1939,7 +1999,10 @@ var Select = BaseField.extend({
|
|
|
1939
1999
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1940
2000
|
`
|
|
1941
2001
|
)
|
|
1942
|
-
}).
|
|
2002
|
+
}).meta({
|
|
2003
|
+
description: "A select input field",
|
|
2004
|
+
id: "Select"
|
|
2005
|
+
});
|
|
1943
2006
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1944
2007
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1945
2008
|
label: TranslationConfig.describe("The label of the option")
|
|
@@ -1948,7 +2011,10 @@ var SelectDateRangeField = BaseField.extend({
|
|
|
1948
2011
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1949
2012
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1950
2013
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1951
|
-
}).
|
|
2014
|
+
}).meta({
|
|
2015
|
+
description: "A date range selection field",
|
|
2016
|
+
id: "SelectDateRangeField"
|
|
2017
|
+
});
|
|
1952
2018
|
var NameConfig = import_v43.default.object({
|
|
1953
2019
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1954
2020
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1979,26 +2045,41 @@ var NameField = BaseField.extend({
|
|
|
1979
2045
|
surname: { required: true }
|
|
1980
2046
|
}
|
|
1981
2047
|
}).optional()
|
|
1982
|
-
}).
|
|
2048
|
+
}).meta({
|
|
2049
|
+
description: "A field for entering a persons name",
|
|
2050
|
+
id: "NameField"
|
|
2051
|
+
});
|
|
1983
2052
|
var PhoneField = BaseField.extend({
|
|
1984
2053
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1985
2054
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1986
|
-
}).
|
|
2055
|
+
}).meta({
|
|
2056
|
+
description: "A field for entering a phone number",
|
|
2057
|
+
id: "PhoneField"
|
|
2058
|
+
});
|
|
1987
2059
|
var IdField = BaseField.extend({
|
|
1988
2060
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1989
2061
|
type: import_v43.default.literal(FieldType.ID)
|
|
1990
|
-
}).
|
|
2062
|
+
}).meta({
|
|
2063
|
+
description: "A field for entering an ID",
|
|
2064
|
+
id: "IdField"
|
|
2065
|
+
});
|
|
1991
2066
|
var Checkbox = BaseField.extend({
|
|
1992
2067
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1993
2068
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1994
|
-
}).
|
|
2069
|
+
}).meta({
|
|
2070
|
+
description: "A boolean checkbox field",
|
|
2071
|
+
id: "Checkbox"
|
|
2072
|
+
});
|
|
1995
2073
|
var Country = BaseField.extend({
|
|
1996
2074
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1997
2075
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1998
2076
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1999
2077
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2000
2078
|
)
|
|
2001
|
-
}).
|
|
2079
|
+
}).meta({
|
|
2080
|
+
description: "A field for selecting a country",
|
|
2081
|
+
id: "Country"
|
|
2082
|
+
});
|
|
2002
2083
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
2003
2084
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
2004
2085
|
);
|
|
@@ -2007,16 +2088,18 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2007
2088
|
"HEALTH_FACILITY",
|
|
2008
2089
|
"CRVS_OFFICE"
|
|
2009
2090
|
]);
|
|
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
2091
|
var AdministrativeAreaField = BaseField.extend({
|
|
2016
2092
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2017
2093
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2018
|
-
configuration:
|
|
2019
|
-
|
|
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
|
+
});
|
|
2020
2103
|
var LocationInput = BaseField.extend({
|
|
2021
2104
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2022
2105
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
@@ -2024,7 +2107,10 @@ var LocationInput = BaseField.extend({
|
|
|
2024
2107
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2025
2108
|
allowedLocations: AllowedLocations
|
|
2026
2109
|
}).optional()
|
|
2027
|
-
}).
|
|
2110
|
+
}).meta({
|
|
2111
|
+
description: "A field for selecting a location",
|
|
2112
|
+
id: "LocationInput"
|
|
2113
|
+
});
|
|
2028
2114
|
var FileUploadWithOptions = BaseField.extend({
|
|
2029
2115
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2030
2116
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
@@ -2038,6 +2124,9 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2038
2124
|
}).default({
|
|
2039
2125
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2040
2126
|
})
|
|
2127
|
+
}).meta({
|
|
2128
|
+
description: "A field for uploading files with file type options",
|
|
2129
|
+
id: "FileUploadWithOptions"
|
|
2041
2130
|
});
|
|
2042
2131
|
var Facility = BaseField.extend({
|
|
2043
2132
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
@@ -2083,7 +2172,10 @@ var Address = BaseField.extend({
|
|
|
2083
2172
|
allowedLocations: AllowedLocations
|
|
2084
2173
|
}).optional(),
|
|
2085
2174
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
2086
|
-
}).
|
|
2175
|
+
}).meta({
|
|
2176
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2177
|
+
id: "Address"
|
|
2178
|
+
});
|
|
2087
2179
|
var StaticDataEntry = import_v43.default.object({
|
|
2088
2180
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2089
2181
|
label: TranslationConfig,
|
|
@@ -2098,7 +2190,10 @@ var DataField = BaseField.extend({
|
|
|
2098
2190
|
subtitle: TranslationConfig.optional(),
|
|
2099
2191
|
data: import_v43.default.array(DataEntry)
|
|
2100
2192
|
})
|
|
2101
|
-
}).
|
|
2193
|
+
}).meta({
|
|
2194
|
+
description: "A field for displaying a table of read-only data",
|
|
2195
|
+
id: "DataField"
|
|
2196
|
+
});
|
|
2102
2197
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2103
2198
|
var ButtonType = import_v43.default.enum([
|
|
2104
2199
|
"primary",
|
|
@@ -2125,11 +2220,17 @@ var ButtonField = BaseField.extend({
|
|
|
2125
2220
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2126
2221
|
defaultValue: ButtonFieldValue.optional(),
|
|
2127
2222
|
configuration: ButtonConfiguration
|
|
2128
|
-
}).
|
|
2223
|
+
}).meta({
|
|
2224
|
+
description: "A generic button that can be used to trigger an action",
|
|
2225
|
+
id: "ButtonField"
|
|
2226
|
+
});
|
|
2129
2227
|
var FieldGroup = BaseField.extend({
|
|
2130
2228
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2131
2229
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2132
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"
|
|
2133
2234
|
});
|
|
2134
2235
|
var AlphaPrintButton = BaseField.extend({
|
|
2135
2236
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2139,7 +2240,10 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2139
2240
|
"Label for the print button"
|
|
2140
2241
|
)
|
|
2141
2242
|
})
|
|
2142
|
-
}).
|
|
2243
|
+
}).meta({
|
|
2244
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2245
|
+
id: "AlphaPrintButton"
|
|
2246
|
+
});
|
|
2143
2247
|
var HttpField = BaseField.extend({
|
|
2144
2248
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2145
2249
|
defaultValue: HttpFieldValue.optional(),
|
|
@@ -2155,20 +2259,30 @@ var HttpField = BaseField.extend({
|
|
|
2155
2259
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2156
2260
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2157
2261
|
})
|
|
2158
|
-
}).
|
|
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
|
+
});
|
|
2159
2266
|
var AutocompleteField = BaseField.extend({
|
|
2160
2267
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2161
2268
|
configuration: import_v43.default.object({
|
|
2162
|
-
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(),
|
|
2163
2272
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2164
2273
|
defaultOptions: import_v43.default.array(
|
|
2165
2274
|
import_v43.default.object({
|
|
2166
2275
|
label: import_v43.default.string(),
|
|
2167
2276
|
value: import_v43.default.string()
|
|
2168
2277
|
})
|
|
2169
|
-
).optional()
|
|
2278
|
+
).optional().describe(
|
|
2279
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2280
|
+
)
|
|
2170
2281
|
})
|
|
2171
|
-
}).
|
|
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
|
+
});
|
|
2172
2286
|
var SearchField = HttpField.extend({
|
|
2173
2287
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2174
2288
|
configuration: SearchQuery.pick({
|
|
@@ -2201,6 +2315,9 @@ var SearchField = HttpField.extend({
|
|
|
2201
2315
|
ok: TranslationConfig.optional()
|
|
2202
2316
|
}).optional()
|
|
2203
2317
|
})
|
|
2318
|
+
}).meta({
|
|
2319
|
+
description: "A search input field",
|
|
2320
|
+
id: "SearchField"
|
|
2204
2321
|
});
|
|
2205
2322
|
var LinkButtonField = BaseField.extend({
|
|
2206
2323
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2209,7 +2326,10 @@ var LinkButtonField = BaseField.extend({
|
|
|
2209
2326
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2210
2327
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2211
2328
|
})
|
|
2212
|
-
}).
|
|
2329
|
+
}).meta({
|
|
2330
|
+
description: "A button that opens a URL link",
|
|
2331
|
+
id: "LinkButtonField"
|
|
2332
|
+
});
|
|
2213
2333
|
var VerificationStatus = BaseField.extend({
|
|
2214
2334
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2215
2335
|
defaultValue: VerificationStatusValue.optional(),
|
|
@@ -2219,15 +2339,19 @@ var VerificationStatus = BaseField.extend({
|
|
|
2219
2339
|
"Explaining text on the banner in form."
|
|
2220
2340
|
)
|
|
2221
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"
|
|
2222
2345
|
});
|
|
2223
2346
|
var QueryParamReaderField = BaseField.extend({
|
|
2224
2347
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2225
2348
|
configuration: import_v43.default.object({
|
|
2226
2349
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2227
2350
|
})
|
|
2228
|
-
}).
|
|
2229
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2230
|
-
|
|
2351
|
+
}).meta({
|
|
2352
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2353
|
+
id: "QueryParamReaderField"
|
|
2354
|
+
});
|
|
2231
2355
|
var QrReaderField = BaseField.extend({
|
|
2232
2356
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2233
2357
|
defaultValue: QrReaderFieldValue.optional(),
|
|
@@ -2238,7 +2362,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2238
2362
|
})
|
|
2239
2363
|
}).optional()
|
|
2240
2364
|
}).meta({
|
|
2241
|
-
description: "
|
|
2365
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2242
2366
|
id: "QrReaderField"
|
|
2243
2367
|
});
|
|
2244
2368
|
var IdReaderField = BaseField.extend({
|
|
@@ -2247,12 +2371,18 @@ var IdReaderField = BaseField.extend({
|
|
|
2247
2371
|
methods: import_v43.default.array(
|
|
2248
2372
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2249
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"
|
|
2250
2377
|
});
|
|
2251
2378
|
var CustomField = BaseField.extend({
|
|
2252
2379
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2253
2380
|
defaultValue: CustomFieldValue.optional(),
|
|
2254
2381
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2255
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"
|
|
2256
2386
|
});
|
|
2257
2387
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2258
2388
|
var LoaderField = BaseField.extend({
|
|
@@ -2262,22 +2392,25 @@ var LoaderField = BaseField.extend({
|
|
|
2262
2392
|
configuration: import_v43.default.object({
|
|
2263
2393
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2264
2394
|
})
|
|
2265
|
-
}).
|
|
2266
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2267
|
-
|
|
2395
|
+
}).meta({
|
|
2396
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2397
|
+
id: "LoaderField"
|
|
2398
|
+
});
|
|
2268
2399
|
var HiddenField = BaseField.extend({
|
|
2269
2400
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2270
2401
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2271
2402
|
defaultValue: TextValue.optional()
|
|
2272
|
-
}).
|
|
2273
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2274
|
-
|
|
2403
|
+
}).meta({
|
|
2404
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2405
|
+
id: "HiddenField"
|
|
2406
|
+
});
|
|
2275
2407
|
var UserRoleField = BaseField.extend({
|
|
2276
2408
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2277
2409
|
defaultValue: TextValue.optional()
|
|
2278
|
-
}).
|
|
2279
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2280
|
-
|
|
2410
|
+
}).meta({
|
|
2411
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2412
|
+
id: "UserRoleField"
|
|
2413
|
+
});
|
|
2281
2414
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2282
2415
|
FieldGroup,
|
|
2283
2416
|
Address,
|
|
@@ -2376,16 +2509,19 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2376
2509
|
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2377
2510
|
actions: VerificationActionConfig
|
|
2378
2511
|
});
|
|
2379
|
-
var PageConfig = z21.discriminatedUnion("type", [
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
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
|
+
});
|
|
2383
2516
|
|
|
2384
2517
|
// ../commons/src/events/FormConfig.ts
|
|
2385
2518
|
var DeclarationFormConfig = z22.object({
|
|
2386
2519
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2387
2520
|
pages: z22.array(FormPageConfig)
|
|
2388
|
-
}).
|
|
2521
|
+
}).meta({
|
|
2522
|
+
id: "DeclarationFormConfig",
|
|
2523
|
+
description: "Configuration of the declaration form."
|
|
2524
|
+
});
|
|
2389
2525
|
var ActionFormConfig = z22.object({
|
|
2390
2526
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2391
2527
|
pages: z22.array(PageConfig)
|
|
@@ -2602,17 +2738,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2602
2738
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2603
2739
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2604
2740
|
*/
|
|
2605
|
-
ReadActionConfig.meta({
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
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
|
+
}),
|
|
2609
2757
|
PrintCertificateActionConfig.meta({
|
|
2610
|
-
id: "PrintCertificateActionConfig"
|
|
2758
|
+
id: "PrintCertificateActionConfig",
|
|
2759
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
2611
2760
|
}),
|
|
2612
|
-
RequestCorrectionConfig.meta({
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
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."
|
|
2768
|
+
}),
|
|
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
|
+
})
|
|
2616
2777
|
]).describe(
|
|
2617
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."
|
|
2618
2779
|
).meta({ id: "ActionConfig" });
|
|
@@ -3679,7 +3840,7 @@ var _EventConfigBase = z33.object({
|
|
|
3679
3840
|
),
|
|
3680
3841
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
3681
3842
|
actions: z33.array(ActionConfig).describe(
|
|
3682
|
-
"Configuration of
|
|
3843
|
+
"Configuration of core and custom actions associated with the event."
|
|
3683
3844
|
),
|
|
3684
3845
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
3685
3846
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -3691,7 +3852,7 @@ var _EventConfigBase = z33.object({
|
|
|
3691
3852
|
"Configuration of fields available in the advanced search feature."
|
|
3692
3853
|
),
|
|
3693
3854
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
3694
|
-
"Configuration of flags associated with the actions of this event type."
|
|
3855
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
3695
3856
|
),
|
|
3696
3857
|
analytics: z33.boolean().optional().default(true).describe(
|
|
3697
3858
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -3704,8 +3865,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
3704
3865
|
validateActionFlags(event2, ctx);
|
|
3705
3866
|
validateActionOrder(event2, ctx);
|
|
3706
3867
|
}).meta({
|
|
3707
|
-
id: "EventConfig"
|
|
3708
|
-
|
|
3868
|
+
id: "EventConfig",
|
|
3869
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
3870
|
+
});
|
|
3709
3871
|
|
|
3710
3872
|
// ../commons/src/events/EventConfigInput.ts
|
|
3711
3873
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -4129,18 +4291,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4129
4291
|
query: true,
|
|
4130
4292
|
columns: true
|
|
4131
4293
|
});
|
|
4132
|
-
var WorkqueueConfigInput =
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
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()
|
|
4294
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4295
|
+
query: CountryConfigQueryInputType
|
|
4296
|
+
}).meta({
|
|
4297
|
+
description: "Workqueue configuration",
|
|
4298
|
+
id: "WorkqueueConfig"
|
|
4144
4299
|
});
|
|
4145
4300
|
var WorkqueueCountInput = z37.array(
|
|
4146
4301
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4180,6 +4335,11 @@ var BaseActionInput = z38.object({
|
|
|
4180
4335
|
originalActionId: UUID.optional(),
|
|
4181
4336
|
// should not be part of base action.
|
|
4182
4337
|
keepAssignment: z38.boolean().optional(),
|
|
4338
|
+
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
4339
|
+
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
4340
|
+
waitFor: z38.boolean().default(true).describe(
|
|
4341
|
+
"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."
|
|
4342
|
+
),
|
|
4183
4343
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4184
4344
|
// @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
4345
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4359,7 +4519,7 @@ var Draft = z39.object({
|
|
|
4359
4519
|
}).describe(
|
|
4360
4520
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
4361
4521
|
);
|
|
4362
|
-
var DraftInput = BaseActionInput.extend({
|
|
4522
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
4363
4523
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4364
4524
|
status: z39.enum([
|
|
4365
4525
|
ActionStatus.Requested,
|