@opencrvs/toolkit 2.0.0-rc.725758 → 2.0.0-rc.72e1808
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 +195 -78
- package/dist/cli.js +389 -127
- package/dist/commons/api/router.d.ts +3302 -248
- 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/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/events/index.js +277 -126
- 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 +387 -125
- 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 +209 -96
- package/opencrvs-toolkit-2.0.0-rc.72e1808.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.0725758.tgz +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*
|
|
8
|
+
* OpenCRVS is also distributed under the terms of the Civil Registration
|
|
9
|
+
* & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
10
|
+
*
|
|
11
|
+
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const { execSync } = require('child_process')
|
|
15
|
+
const path = require('path')
|
|
16
|
+
const fs = require('fs')
|
|
17
|
+
|
|
18
|
+
const REPO_URL = 'https://github.com/opencrvs/opencrvs-countryconfig.git'
|
|
19
|
+
|
|
20
|
+
const projectName = process.argv[2]
|
|
21
|
+
|
|
22
|
+
if (!projectName) {
|
|
23
|
+
console.error(
|
|
24
|
+
'Please specify a project name:\n\n npm create @opencrvs/countryconfig <project-name>\n'
|
|
25
|
+
)
|
|
26
|
+
process.exit(1)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const targetDir = path.resolve(process.cwd(), projectName)
|
|
30
|
+
|
|
31
|
+
if (fs.existsSync(targetDir)) {
|
|
32
|
+
console.error(`Error: Directory "${projectName}" already exists.`)
|
|
33
|
+
process.exit(1)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
console.log(`\nScaffolding OpenCRVS country config in ./${projectName}...\n`)
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
execSync(`git clone --depth 1 ${REPO_URL} ${projectName}`, {
|
|
40
|
+
stdio: 'inherit'
|
|
41
|
+
})
|
|
42
|
+
} catch (err) {
|
|
43
|
+
console.error('Failed to clone the repository:', err.message)
|
|
44
|
+
process.exit(1)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
fs.rmSync(path.join(targetDir, '.git'), { recursive: true, force: true })
|
|
49
|
+
} catch (err) {
|
|
50
|
+
console.error('Failed to remove .git directory:', err.message)
|
|
51
|
+
process.exit(1)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const pkgPath = path.join(targetDir, 'package.json')
|
|
55
|
+
if (fs.existsSync(pkgPath)) {
|
|
56
|
+
try {
|
|
57
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
|
|
58
|
+
pkg.name = projectName
|
|
59
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n')
|
|
60
|
+
} catch (err) {
|
|
61
|
+
console.error('Failed to update package.json:', err.message)
|
|
62
|
+
process.exit(1)
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
console.warn(
|
|
66
|
+
`Warning: No package.json found in the cloned repository. Project name was not updated.`
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
console.log(`\nDone! To get started:\n`)
|
|
71
|
+
console.log(` cd ${projectName}`)
|
|
72
|
+
console.log(` git init`)
|
|
73
|
+
console.log(` npm install\n`)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opencrvs/create-countryconfig",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Scaffold a new OpenCRVS country configuration",
|
|
5
|
+
"bin": {
|
|
6
|
+
"create-countryconfig": "./index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": ["index.js"],
|
|
9
|
+
"keywords": ["opencrvs", "countryconfig", "create"],
|
|
10
|
+
"license": "MPL-2.0"
|
|
11
|
+
}
|
|
@@ -75,7 +75,10 @@ var ActionConditional = z.discriminatedUnion("type", [
|
|
|
75
75
|
ShowConditional,
|
|
76
76
|
// Action can be shown to the user in the list but as disabled
|
|
77
77
|
EnableConditional
|
|
78
|
-
])
|
|
78
|
+
]).meta({
|
|
79
|
+
description: "Action conditional configuration",
|
|
80
|
+
id: "ActionConditional"
|
|
81
|
+
});
|
|
79
82
|
var DisplayOnReviewConditional = z.object({
|
|
80
83
|
type: z.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
81
84
|
conditional: Conditional
|
|
@@ -418,28 +421,20 @@ function schemaPriority(schema) {
|
|
|
418
421
|
return idx === -1 ? 9999 : idx;
|
|
419
422
|
}
|
|
420
423
|
function safeUnion(schemas) {
|
|
424
|
+
const sortedSchemas = [...schemas].sort(
|
|
425
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
426
|
+
);
|
|
421
427
|
return z7.any().superRefine((val, ctx) => {
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
if (successful.length === 0) {
|
|
427
|
-
ctx.addIssue({
|
|
428
|
-
code: "invalid_type",
|
|
429
|
-
expected: "custom",
|
|
430
|
-
message: "Value does not match any schema"
|
|
431
|
-
});
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
435
|
-
const best = successful[0];
|
|
436
|
-
if (!best.safeParse(val).success) {
|
|
437
|
-
ctx.addIssue({
|
|
438
|
-
expected: "custom",
|
|
439
|
-
code: "invalid_type",
|
|
440
|
-
message: "Value did not match the best schema"
|
|
441
|
-
});
|
|
428
|
+
for (const schema of sortedSchemas) {
|
|
429
|
+
if (schema.safeParse(val).success) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
442
432
|
}
|
|
433
|
+
ctx.addIssue({
|
|
434
|
+
code: "invalid_type",
|
|
435
|
+
expected: "custom",
|
|
436
|
+
message: "Value does not match any schema"
|
|
437
|
+
});
|
|
443
438
|
}).meta({
|
|
444
439
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
445
440
|
});
|
|
@@ -1085,6 +1080,9 @@ var FlagConfig = z14.object({
|
|
|
1085
1080
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1086
1081
|
),
|
|
1087
1082
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1083
|
+
}).meta({
|
|
1084
|
+
description: "Flag configuration",
|
|
1085
|
+
id: "FlagConfig"
|
|
1088
1086
|
});
|
|
1089
1087
|
var ActionFlagConfig = z14.object({
|
|
1090
1088
|
id: Flag,
|
|
@@ -1092,6 +1090,9 @@ var ActionFlagConfig = z14.object({
|
|
|
1092
1090
|
conditional: Conditional.optional().describe(
|
|
1093
1091
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1094
1092
|
)
|
|
1093
|
+
}).meta({
|
|
1094
|
+
description: "Action flag configuration",
|
|
1095
|
+
id: "ActionFlagConfig"
|
|
1095
1096
|
});
|
|
1096
1097
|
|
|
1097
1098
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1113,8 +1114,7 @@ var ActionCreationMetadata = z15.object({
|
|
|
1113
1114
|
),
|
|
1114
1115
|
createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1115
1116
|
acceptedAt: z15.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1116
|
-
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1117
|
-
createdBySignature: z15.string().nullish().describe("Signature of the user who created the action request.")
|
|
1117
|
+
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1118
1118
|
});
|
|
1119
1119
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1120
1120
|
registrationNumber: z15.string().describe(
|
|
@@ -1142,9 +1142,6 @@ var EventMetadata = z15.object({
|
|
|
1142
1142
|
createdAtLocation: UUID.nullish().describe(
|
|
1143
1143
|
"Location of the user who created the event."
|
|
1144
1144
|
),
|
|
1145
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1146
|
-
"Signature of the user who created the event."
|
|
1147
|
-
),
|
|
1148
1145
|
updatedAtLocation: UUID.nullish().describe(
|
|
1149
1146
|
"Location of the user who last changed the status."
|
|
1150
1147
|
),
|
|
@@ -1408,7 +1405,7 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1408
1405
|
}
|
|
1409
1406
|
}).describe("Unique identifier for the field");
|
|
1410
1407
|
var FieldReference = import_v43.default.object({
|
|
1411
|
-
$$field: FieldId,
|
|
1408
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1412
1409
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1413
1410
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1414
1411
|
)
|
|
@@ -1454,6 +1451,9 @@ var BaseField = import_v43.default.object({
|
|
|
1454
1451
|
}).describe("Common properties shared across all field types.");
|
|
1455
1452
|
var Divider = BaseField.extend({
|
|
1456
1453
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1454
|
+
}).meta({
|
|
1455
|
+
description: "A horizontal line divider",
|
|
1456
|
+
id: "Divider"
|
|
1457
1457
|
});
|
|
1458
1458
|
var TextField = BaseField.extend({
|
|
1459
1459
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
@@ -1464,7 +1464,10 @@ var TextField = BaseField.extend({
|
|
|
1464
1464
|
prefix: TranslationConfig.optional(),
|
|
1465
1465
|
postfix: TranslationConfig.optional()
|
|
1466
1466
|
}).default({ type: "text" }).optional()
|
|
1467
|
-
}).
|
|
1467
|
+
}).meta({
|
|
1468
|
+
description: "A text input field",
|
|
1469
|
+
id: "TextField"
|
|
1470
|
+
});
|
|
1468
1471
|
var NumberField = BaseField.extend({
|
|
1469
1472
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1470
1473
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1474,7 +1477,10 @@ var NumberField = BaseField.extend({
|
|
|
1474
1477
|
prefix: TranslationConfig.optional(),
|
|
1475
1478
|
postfix: TranslationConfig.optional()
|
|
1476
1479
|
}).optional()
|
|
1477
|
-
}).
|
|
1480
|
+
}).meta({
|
|
1481
|
+
description: "A number input field",
|
|
1482
|
+
id: "NumberField"
|
|
1483
|
+
});
|
|
1478
1484
|
var TextAreaField = BaseField.extend({
|
|
1479
1485
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1480
1486
|
defaultValue: NonEmptyTextValue.optional(),
|
|
@@ -1485,7 +1491,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1485
1491
|
prefix: TranslationConfig.optional(),
|
|
1486
1492
|
postfix: TranslationConfig.optional()
|
|
1487
1493
|
}).default({ rows: 4 }).optional()
|
|
1488
|
-
}).
|
|
1494
|
+
}).meta({
|
|
1495
|
+
description: "A multiline text input",
|
|
1496
|
+
id: "TextAreaField"
|
|
1497
|
+
});
|
|
1489
1498
|
var ImageMimeType = import_v43.default.enum([
|
|
1490
1499
|
"image/png",
|
|
1491
1500
|
"image/jpg",
|
|
@@ -1515,13 +1524,19 @@ var SignatureField = BaseField.extend({
|
|
|
1515
1524
|
}).default({
|
|
1516
1525
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1517
1526
|
})
|
|
1518
|
-
}).
|
|
1527
|
+
}).meta({
|
|
1528
|
+
description: "A signature input field",
|
|
1529
|
+
id: "SignatureField"
|
|
1530
|
+
});
|
|
1519
1531
|
var EmailField = BaseField.extend({
|
|
1520
1532
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1521
1533
|
configuration: import_v43.default.object({
|
|
1522
1534
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1523
1535
|
}).default({ maxLength: 255 }).optional(),
|
|
1524
1536
|
defaultValue: NonEmptyTextValue.optional()
|
|
1537
|
+
}).meta({
|
|
1538
|
+
description: "An email input field",
|
|
1539
|
+
id: "EmailField"
|
|
1525
1540
|
});
|
|
1526
1541
|
var DateField = BaseField.extend({
|
|
1527
1542
|
type: import_v43.default.literal(FieldType.DATE),
|
|
@@ -1531,7 +1546,10 @@ var DateField = BaseField.extend({
|
|
|
1531
1546
|
"Text to display above the date input"
|
|
1532
1547
|
).optional()
|
|
1533
1548
|
}).optional()
|
|
1534
|
-
}).
|
|
1549
|
+
}).meta({
|
|
1550
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1551
|
+
id: "DateField"
|
|
1552
|
+
});
|
|
1535
1553
|
var AgeField = BaseField.extend({
|
|
1536
1554
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1537
1555
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1540,7 +1558,10 @@ var AgeField = BaseField.extend({
|
|
|
1540
1558
|
prefix: TranslationConfig.optional(),
|
|
1541
1559
|
postfix: TranslationConfig.optional()
|
|
1542
1560
|
})
|
|
1543
|
-
}).
|
|
1561
|
+
}).meta({
|
|
1562
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1563
|
+
id: "AgeField"
|
|
1564
|
+
});
|
|
1544
1565
|
var TimeField = BaseField.extend({
|
|
1545
1566
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1546
1567
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
@@ -1550,7 +1571,10 @@ var TimeField = BaseField.extend({
|
|
|
1550
1571
|
"Text to display above the time input"
|
|
1551
1572
|
).optional()
|
|
1552
1573
|
}).optional()
|
|
1553
|
-
}).
|
|
1574
|
+
}).meta({
|
|
1575
|
+
description: "A single time input (HH-mm)",
|
|
1576
|
+
id: "TimeField"
|
|
1577
|
+
});
|
|
1554
1578
|
var DateRangeField = BaseField.extend({
|
|
1555
1579
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1556
1580
|
defaultValue: DateRangeFieldValue.optional(),
|
|
@@ -1559,7 +1583,10 @@ var DateRangeField = BaseField.extend({
|
|
|
1559
1583
|
"Text to display above the date input"
|
|
1560
1584
|
).optional()
|
|
1561
1585
|
}).optional()
|
|
1562
|
-
}).
|
|
1586
|
+
}).meta({
|
|
1587
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1588
|
+
id: "DateRangeField"
|
|
1589
|
+
});
|
|
1563
1590
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1564
1591
|
"reg12",
|
|
1565
1592
|
"reg14",
|
|
@@ -1603,18 +1630,30 @@ var ImageViewField = BaseField.extend({
|
|
|
1603
1630
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1604
1631
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1605
1632
|
configuration: ImageConfiguration
|
|
1606
|
-
}).
|
|
1633
|
+
}).meta({
|
|
1634
|
+
description: "A read-only image component for form pages",
|
|
1635
|
+
id: "ImageViewField"
|
|
1636
|
+
});
|
|
1607
1637
|
var Paragraph = BaseField.extend({
|
|
1608
1638
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1609
1639
|
configuration: ParagraphConfiguration
|
|
1610
|
-
}).
|
|
1640
|
+
}).meta({
|
|
1641
|
+
description: "A read-only HTML <p> paragraph",
|
|
1642
|
+
id: "Paragraph"
|
|
1643
|
+
});
|
|
1611
1644
|
var Heading = BaseField.extend({
|
|
1612
1645
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1613
1646
|
configuration: HeadingConfiguration
|
|
1614
|
-
}).
|
|
1647
|
+
}).meta({
|
|
1648
|
+
description: "A read-only heading component for form pages",
|
|
1649
|
+
id: "Heading"
|
|
1650
|
+
});
|
|
1615
1651
|
var PageHeader = BaseField.extend({
|
|
1616
1652
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1617
|
-
}).
|
|
1653
|
+
}).meta({
|
|
1654
|
+
description: "A read-only header component for form pages",
|
|
1655
|
+
id: "PageHeader"
|
|
1656
|
+
});
|
|
1618
1657
|
var File = BaseField.extend({
|
|
1619
1658
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1620
1659
|
defaultValue: FileFieldValue.optional(),
|
|
@@ -1633,7 +1672,10 @@ var File = BaseField.extend({
|
|
|
1633
1672
|
}).default({
|
|
1634
1673
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1635
1674
|
})
|
|
1636
|
-
}).
|
|
1675
|
+
}).meta({
|
|
1676
|
+
description: "A file upload field",
|
|
1677
|
+
id: "File"
|
|
1678
|
+
});
|
|
1637
1679
|
var SelectOption = import_v43.default.object({
|
|
1638
1680
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1639
1681
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1650,7 +1692,10 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1650
1692
|
"Placeholder for the number field"
|
|
1651
1693
|
)
|
|
1652
1694
|
}).optional()
|
|
1653
|
-
}).
|
|
1695
|
+
}).meta({
|
|
1696
|
+
description: "A number with unit input field",
|
|
1697
|
+
id: "NumberWithUnitField"
|
|
1698
|
+
});
|
|
1654
1699
|
var RadioGroup = BaseField.extend({
|
|
1655
1700
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1656
1701
|
defaultValue: TextValue.optional(),
|
|
@@ -1660,7 +1705,10 @@ var RadioGroup = BaseField.extend({
|
|
|
1660
1705
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1661
1706
|
}).optional()
|
|
1662
1707
|
}).optional()
|
|
1663
|
-
}).
|
|
1708
|
+
}).meta({
|
|
1709
|
+
description: "A grouped radio button field",
|
|
1710
|
+
id: "RadioGroup"
|
|
1711
|
+
});
|
|
1664
1712
|
var BulletList = BaseField.extend({
|
|
1665
1713
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1666
1714
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1669,7 +1717,10 @@ var BulletList = BaseField.extend({
|
|
|
1669
1717
|
fontVariant: HtmlFontVariant.optional()
|
|
1670
1718
|
}).optional()
|
|
1671
1719
|
}).default({})
|
|
1672
|
-
}).
|
|
1720
|
+
}).meta({
|
|
1721
|
+
description: "A list of bullet points",
|
|
1722
|
+
id: "BulletList"
|
|
1723
|
+
});
|
|
1673
1724
|
var Select = BaseField.extend({
|
|
1674
1725
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1675
1726
|
defaultValue: TextValue.optional(),
|
|
@@ -1684,7 +1735,10 @@ var Select = BaseField.extend({
|
|
|
1684
1735
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1685
1736
|
`
|
|
1686
1737
|
)
|
|
1687
|
-
}).
|
|
1738
|
+
}).meta({
|
|
1739
|
+
description: "A select input field",
|
|
1740
|
+
id: "Select"
|
|
1741
|
+
});
|
|
1688
1742
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1689
1743
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1690
1744
|
label: TranslationConfig.describe("The label of the option")
|
|
@@ -1693,7 +1747,10 @@ var SelectDateRangeField = BaseField.extend({
|
|
|
1693
1747
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1694
1748
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1695
1749
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1696
|
-
}).
|
|
1750
|
+
}).meta({
|
|
1751
|
+
description: "A date range selection field",
|
|
1752
|
+
id: "SelectDateRangeField"
|
|
1753
|
+
});
|
|
1697
1754
|
var NameConfig = import_v43.default.object({
|
|
1698
1755
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1699
1756
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1724,26 +1781,41 @@ var NameField = BaseField.extend({
|
|
|
1724
1781
|
surname: { required: true }
|
|
1725
1782
|
}
|
|
1726
1783
|
}).optional()
|
|
1727
|
-
}).
|
|
1784
|
+
}).meta({
|
|
1785
|
+
description: "A field for entering a persons name",
|
|
1786
|
+
id: "NameField"
|
|
1787
|
+
});
|
|
1728
1788
|
var PhoneField = BaseField.extend({
|
|
1729
1789
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1730
1790
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1731
|
-
}).
|
|
1791
|
+
}).meta({
|
|
1792
|
+
description: "A field for entering a phone number",
|
|
1793
|
+
id: "PhoneField"
|
|
1794
|
+
});
|
|
1732
1795
|
var IdField = BaseField.extend({
|
|
1733
1796
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1734
1797
|
type: import_v43.default.literal(FieldType.ID)
|
|
1735
|
-
}).
|
|
1798
|
+
}).meta({
|
|
1799
|
+
description: "A field for entering an ID",
|
|
1800
|
+
id: "IdField"
|
|
1801
|
+
});
|
|
1736
1802
|
var Checkbox = BaseField.extend({
|
|
1737
1803
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1738
1804
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1739
|
-
}).
|
|
1805
|
+
}).meta({
|
|
1806
|
+
description: "A boolean checkbox field",
|
|
1807
|
+
id: "Checkbox"
|
|
1808
|
+
});
|
|
1740
1809
|
var Country = BaseField.extend({
|
|
1741
1810
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1742
1811
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1743
1812
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1744
1813
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1745
1814
|
)
|
|
1746
|
-
}).
|
|
1815
|
+
}).meta({
|
|
1816
|
+
description: "A field for selecting a country",
|
|
1817
|
+
id: "Country"
|
|
1818
|
+
});
|
|
1747
1819
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
1748
1820
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
1749
1821
|
);
|
|
@@ -1752,16 +1824,18 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1752
1824
|
"HEALTH_FACILITY",
|
|
1753
1825
|
"CRVS_OFFICE"
|
|
1754
1826
|
]);
|
|
1755
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
1756
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
1757
|
-
type: AdministrativeAreas,
|
|
1758
|
-
allowedLocations: AllowedLocations
|
|
1759
|
-
}).describe("Administrative area options");
|
|
1760
1827
|
var AdministrativeAreaField = BaseField.extend({
|
|
1761
1828
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1762
1829
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1763
|
-
configuration:
|
|
1764
|
-
|
|
1830
|
+
configuration: import_v43.default.object({
|
|
1831
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
1832
|
+
type: AdministrativeAreas,
|
|
1833
|
+
allowedLocations: AllowedLocations
|
|
1834
|
+
}).describe("Administrative area options")
|
|
1835
|
+
}).meta({
|
|
1836
|
+
description: "Administrative area input field",
|
|
1837
|
+
id: "AdministrativeAreaField"
|
|
1838
|
+
});
|
|
1765
1839
|
var LocationInput = BaseField.extend({
|
|
1766
1840
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1767
1841
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
@@ -1769,7 +1843,10 @@ var LocationInput = BaseField.extend({
|
|
|
1769
1843
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1770
1844
|
allowedLocations: AllowedLocations
|
|
1771
1845
|
}).optional()
|
|
1772
|
-
}).
|
|
1846
|
+
}).meta({
|
|
1847
|
+
description: "A field for selecting a location",
|
|
1848
|
+
id: "LocationInput"
|
|
1849
|
+
});
|
|
1773
1850
|
var FileUploadWithOptions = BaseField.extend({
|
|
1774
1851
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1775
1852
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
@@ -1783,6 +1860,9 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1783
1860
|
}).default({
|
|
1784
1861
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1785
1862
|
})
|
|
1863
|
+
}).meta({
|
|
1864
|
+
description: "A field for uploading files with file type options",
|
|
1865
|
+
id: "FileUploadWithOptions"
|
|
1786
1866
|
});
|
|
1787
1867
|
var Facility = BaseField.extend({
|
|
1788
1868
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
@@ -1828,7 +1908,10 @@ var Address = BaseField.extend({
|
|
|
1828
1908
|
allowedLocations: AllowedLocations
|
|
1829
1909
|
}).optional(),
|
|
1830
1910
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1831
|
-
}).
|
|
1911
|
+
}).meta({
|
|
1912
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
1913
|
+
id: "Address"
|
|
1914
|
+
});
|
|
1832
1915
|
var StaticDataEntry = import_v43.default.object({
|
|
1833
1916
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
1834
1917
|
label: TranslationConfig,
|
|
@@ -1843,7 +1926,10 @@ var DataField = BaseField.extend({
|
|
|
1843
1926
|
subtitle: TranslationConfig.optional(),
|
|
1844
1927
|
data: import_v43.default.array(DataEntry)
|
|
1845
1928
|
})
|
|
1846
|
-
}).
|
|
1929
|
+
}).meta({
|
|
1930
|
+
description: "A field for displaying a table of read-only data",
|
|
1931
|
+
id: "DataField"
|
|
1932
|
+
});
|
|
1847
1933
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
1848
1934
|
var ButtonType = import_v43.default.enum([
|
|
1849
1935
|
"primary",
|
|
@@ -1870,11 +1956,17 @@ var ButtonField = BaseField.extend({
|
|
|
1870
1956
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1871
1957
|
defaultValue: ButtonFieldValue.optional(),
|
|
1872
1958
|
configuration: ButtonConfiguration
|
|
1873
|
-
}).
|
|
1959
|
+
}).meta({
|
|
1960
|
+
description: "A generic button that can be used to trigger an action",
|
|
1961
|
+
id: "ButtonField"
|
|
1962
|
+
});
|
|
1874
1963
|
var FieldGroup = BaseField.extend({
|
|
1875
1964
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
1876
1965
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1877
1966
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
1967
|
+
}).meta({
|
|
1968
|
+
description: "A group of fields that are displayed together",
|
|
1969
|
+
id: "FieldGroup"
|
|
1878
1970
|
});
|
|
1879
1971
|
var AlphaPrintButton = BaseField.extend({
|
|
1880
1972
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -1884,7 +1976,10 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1884
1976
|
"Label for the print button"
|
|
1885
1977
|
)
|
|
1886
1978
|
})
|
|
1887
|
-
}).
|
|
1979
|
+
}).meta({
|
|
1980
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
1981
|
+
id: "AlphaPrintButton"
|
|
1982
|
+
});
|
|
1888
1983
|
var HttpField = BaseField.extend({
|
|
1889
1984
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1890
1985
|
defaultValue: HttpFieldValue.optional(),
|
|
@@ -1900,7 +1995,10 @@ var HttpField = BaseField.extend({
|
|
|
1900
1995
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
1901
1996
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1902
1997
|
})
|
|
1903
|
-
}).
|
|
1998
|
+
}).meta({
|
|
1999
|
+
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.",
|
|
2000
|
+
id: "HttpField"
|
|
2001
|
+
});
|
|
1904
2002
|
var AutocompleteField = BaseField.extend({
|
|
1905
2003
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
1906
2004
|
configuration: import_v43.default.object({
|
|
@@ -1913,7 +2011,10 @@ var AutocompleteField = BaseField.extend({
|
|
|
1913
2011
|
})
|
|
1914
2012
|
).optional()
|
|
1915
2013
|
})
|
|
1916
|
-
}).
|
|
2014
|
+
}).meta({
|
|
2015
|
+
description: "Autocomplete input field",
|
|
2016
|
+
id: "AutocompleteField"
|
|
2017
|
+
});
|
|
1917
2018
|
var SearchField = HttpField.extend({
|
|
1918
2019
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
1919
2020
|
configuration: SearchQuery.pick({
|
|
@@ -1954,7 +2055,10 @@ var LinkButtonField = BaseField.extend({
|
|
|
1954
2055
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1955
2056
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1956
2057
|
})
|
|
1957
|
-
}).
|
|
2058
|
+
}).meta({
|
|
2059
|
+
description: "A button that opens a URL link",
|
|
2060
|
+
id: "LinkButtonField"
|
|
2061
|
+
});
|
|
1958
2062
|
var VerificationStatus = BaseField.extend({
|
|
1959
2063
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
1960
2064
|
defaultValue: VerificationStatusValue.optional(),
|
|
@@ -1964,15 +2068,19 @@ var VerificationStatus = BaseField.extend({
|
|
|
1964
2068
|
"Explaining text on the banner in form."
|
|
1965
2069
|
)
|
|
1966
2070
|
})
|
|
2071
|
+
}).meta({
|
|
2072
|
+
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.",
|
|
2073
|
+
id: "VerificationStatus"
|
|
1967
2074
|
});
|
|
1968
2075
|
var QueryParamReaderField = BaseField.extend({
|
|
1969
2076
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
1970
2077
|
configuration: import_v43.default.object({
|
|
1971
2078
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
1972
2079
|
})
|
|
1973
|
-
}).
|
|
1974
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
1975
|
-
|
|
2080
|
+
}).meta({
|
|
2081
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2082
|
+
id: "QueryParamReaderField"
|
|
2083
|
+
});
|
|
1976
2084
|
var QrReaderField = BaseField.extend({
|
|
1977
2085
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
1978
2086
|
defaultValue: QrReaderFieldValue.optional(),
|
|
@@ -1983,7 +2091,7 @@ var QrReaderField = BaseField.extend({
|
|
|
1983
2091
|
})
|
|
1984
2092
|
}).optional()
|
|
1985
2093
|
}).meta({
|
|
1986
|
-
description: "
|
|
2094
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
1987
2095
|
id: "QrReaderField"
|
|
1988
2096
|
});
|
|
1989
2097
|
var IdReaderField = BaseField.extend({
|
|
@@ -1992,12 +2100,18 @@ var IdReaderField = BaseField.extend({
|
|
|
1992
2100
|
methods: import_v43.default.array(
|
|
1993
2101
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1994
2102
|
)
|
|
2103
|
+
}).meta({
|
|
2104
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2105
|
+
id: "IdReaderField"
|
|
1995
2106
|
});
|
|
1996
2107
|
var CustomField = BaseField.extend({
|
|
1997
2108
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
1998
2109
|
defaultValue: CustomFieldValue.optional(),
|
|
1999
2110
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2000
2111
|
configuration: import_v43.default.unknown().optional()
|
|
2112
|
+
}).meta({
|
|
2113
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2114
|
+
id: "CustomField"
|
|
2001
2115
|
});
|
|
2002
2116
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2003
2117
|
var LoaderField = BaseField.extend({
|
|
@@ -2007,22 +2121,25 @@ var LoaderField = BaseField.extend({
|
|
|
2007
2121
|
configuration: import_v43.default.object({
|
|
2008
2122
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2009
2123
|
})
|
|
2010
|
-
}).
|
|
2011
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2012
|
-
|
|
2124
|
+
}).meta({
|
|
2125
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2126
|
+
id: "LoaderField"
|
|
2127
|
+
});
|
|
2013
2128
|
var HiddenField = BaseField.extend({
|
|
2014
2129
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2015
2130
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2016
2131
|
defaultValue: TextValue.optional()
|
|
2017
|
-
}).
|
|
2018
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2019
|
-
|
|
2132
|
+
}).meta({
|
|
2133
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2134
|
+
id: "HiddenField"
|
|
2135
|
+
});
|
|
2020
2136
|
var UserRoleField = BaseField.extend({
|
|
2021
2137
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2022
2138
|
defaultValue: TextValue.optional()
|
|
2023
|
-
}).
|
|
2024
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2025
|
-
|
|
2139
|
+
}).meta({
|
|
2140
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2141
|
+
id: "UserRoleField"
|
|
2142
|
+
});
|
|
2026
2143
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2027
2144
|
FieldGroup,
|
|
2028
2145
|
Address,
|