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