@opencrvs/toolkit 2.0.0-rc.fdc585a → 2.0.0-rc.fe94e41
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 +103 -0
- package/create-countryconfig/package.json +21 -0
- package/dist/application-config/index.js +220 -86
- package/dist/cli.js +392 -128
- package/dist/commons/api/router.d.ts +3369 -238
- package/dist/commons/conditionals/conditionals.d.ts +6 -0
- package/dist/commons/conditionals/validate.d.ts +1 -0
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +114 -0
- package/dist/commons/events/Draft.d.ts +4 -2
- package/dist/commons/events/EventDocument.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/index.d.ts +2 -0
- 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/flags.d.ts +16 -0
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +3 -2
- package/dist/commons/events/utils.d.ts +12 -1
- package/dist/conditionals/index.js +7 -1
- package/dist/events/index.js +808 -174
- 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 +390 -126
- 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 +656 -119
- package/dist/scopes/index.js +3 -1
- package/opencrvs-toolkit-2.0.0-rc.fe94e41.tgz +0 -0
- package/package.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.fdc585a.tgz +0 -0
|
@@ -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
|
+
id: "ActionConditional",
|
|
80
|
+
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."
|
|
81
|
+
});
|
|
79
82
|
var DisplayOnReviewConditional = z.object({
|
|
80
83
|
type: z.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
81
84
|
conditional: Conditional
|
|
@@ -90,8 +93,8 @@ var FieldConditional = z.discriminatedUnion("type", [
|
|
|
90
93
|
// Field output can be shown / hidden on the review page
|
|
91
94
|
DisplayOnReviewConditional
|
|
92
95
|
]).meta({
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
id: "FieldConditional",
|
|
97
|
+
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."
|
|
95
98
|
});
|
|
96
99
|
|
|
97
100
|
// ../commons/src/events/TranslationConfig.ts
|
|
@@ -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
|
});
|
|
@@ -839,7 +834,9 @@ var ScopeType = z11.enum([
|
|
|
839
834
|
var EncodedScope = z11.string().brand("EncodedScope");
|
|
840
835
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
841
836
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
842
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
837
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
838
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
839
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
843
840
|
};
|
|
844
841
|
|
|
845
842
|
// ../commons/src/authentication.ts
|
|
@@ -992,8 +989,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
992
989
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
993
990
|
z13.object({
|
|
994
991
|
type: z13.literal(ActionType.APPROVE_CORRECTION),
|
|
995
|
-
requestId: z13.string()
|
|
992
|
+
requestId: z13.string(),
|
|
996
993
|
// TODO move into 'content' property
|
|
994
|
+
content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
|
|
997
995
|
}).shape
|
|
998
996
|
);
|
|
999
997
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1085,6 +1083,9 @@ var FlagConfig = z14.object({
|
|
|
1085
1083
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1086
1084
|
),
|
|
1087
1085
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1086
|
+
}).meta({
|
|
1087
|
+
id: "FlagConfig",
|
|
1088
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1088
1089
|
});
|
|
1089
1090
|
var ActionFlagConfig = z14.object({
|
|
1090
1091
|
id: Flag,
|
|
@@ -1092,6 +1093,9 @@ var ActionFlagConfig = z14.object({
|
|
|
1092
1093
|
conditional: Conditional.optional().describe(
|
|
1093
1094
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1094
1095
|
)
|
|
1096
|
+
}).meta({
|
|
1097
|
+
id: "ActionFlagConfig",
|
|
1098
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1095
1099
|
});
|
|
1096
1100
|
|
|
1097
1101
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1113,8 +1117,7 @@ var ActionCreationMetadata = z15.object({
|
|
|
1113
1117
|
),
|
|
1114
1118
|
createdByUserType: z15.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1115
1119
|
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.")
|
|
1120
|
+
createdByRole: z15.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1118
1121
|
});
|
|
1119
1122
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1120
1123
|
registrationNumber: z15.string().describe(
|
|
@@ -1142,9 +1145,6 @@ var EventMetadata = z15.object({
|
|
|
1142
1145
|
createdAtLocation: UUID.nullish().describe(
|
|
1143
1146
|
"Location of the user who created the event."
|
|
1144
1147
|
),
|
|
1145
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1146
|
-
"Signature of the user who created the event."
|
|
1147
|
-
),
|
|
1148
1148
|
updatedAtLocation: UUID.nullish().describe(
|
|
1149
1149
|
"Location of the user who last changed the status."
|
|
1150
1150
|
),
|
|
@@ -1408,14 +1408,21 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
}).describe("Unique identifier for the field");
|
|
1410
1410
|
var FieldReference = import_v43.default.object({
|
|
1411
|
-
$$field: FieldId,
|
|
1411
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
1412
1412
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1413
1413
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1414
1414
|
)
|
|
1415
1415
|
}).describe("Reference to a field by its ID");
|
|
1416
1416
|
var ValidationConfig = import_v43.default.object({
|
|
1417
|
-
validator: Conditional
|
|
1418
|
-
|
|
1417
|
+
validator: Conditional.describe(
|
|
1418
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1419
|
+
),
|
|
1420
|
+
message: TranslationConfig.describe(
|
|
1421
|
+
"Error message displayed when the validator does not hold."
|
|
1422
|
+
)
|
|
1423
|
+
}).meta({
|
|
1424
|
+
id: "ValidationConfig",
|
|
1425
|
+
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."
|
|
1419
1426
|
});
|
|
1420
1427
|
var requiredSchema = import_v43.default.union([
|
|
1421
1428
|
import_v43.default.boolean(),
|
|
@@ -1454,6 +1461,9 @@ var BaseField = import_v43.default.object({
|
|
|
1454
1461
|
}).describe("Common properties shared across all field types.");
|
|
1455
1462
|
var Divider = BaseField.extend({
|
|
1456
1463
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
1464
|
+
}).meta({
|
|
1465
|
+
description: "A horizontal line divider",
|
|
1466
|
+
id: "Divider"
|
|
1457
1467
|
});
|
|
1458
1468
|
var TextField = BaseField.extend({
|
|
1459
1469
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
@@ -1464,7 +1474,10 @@ var TextField = BaseField.extend({
|
|
|
1464
1474
|
prefix: TranslationConfig.optional(),
|
|
1465
1475
|
postfix: TranslationConfig.optional()
|
|
1466
1476
|
}).default({ type: "text" }).optional()
|
|
1467
|
-
}).
|
|
1477
|
+
}).meta({
|
|
1478
|
+
description: "A text input field",
|
|
1479
|
+
id: "TextField"
|
|
1480
|
+
});
|
|
1468
1481
|
var NumberField = BaseField.extend({
|
|
1469
1482
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1470
1483
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1474,7 +1487,10 @@ var NumberField = BaseField.extend({
|
|
|
1474
1487
|
prefix: TranslationConfig.optional(),
|
|
1475
1488
|
postfix: TranslationConfig.optional()
|
|
1476
1489
|
}).optional()
|
|
1477
|
-
}).
|
|
1490
|
+
}).meta({
|
|
1491
|
+
description: "A number input field",
|
|
1492
|
+
id: "NumberField"
|
|
1493
|
+
});
|
|
1478
1494
|
var TextAreaField = BaseField.extend({
|
|
1479
1495
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1480
1496
|
defaultValue: NonEmptyTextValue.optional(),
|
|
@@ -1485,7 +1501,10 @@ var TextAreaField = BaseField.extend({
|
|
|
1485
1501
|
prefix: TranslationConfig.optional(),
|
|
1486
1502
|
postfix: TranslationConfig.optional()
|
|
1487
1503
|
}).default({ rows: 4 }).optional()
|
|
1488
|
-
}).
|
|
1504
|
+
}).meta({
|
|
1505
|
+
description: "A multiline text input",
|
|
1506
|
+
id: "TextAreaField"
|
|
1507
|
+
});
|
|
1489
1508
|
var ImageMimeType = import_v43.default.enum([
|
|
1490
1509
|
"image/png",
|
|
1491
1510
|
"image/jpg",
|
|
@@ -1515,13 +1534,19 @@ var SignatureField = BaseField.extend({
|
|
|
1515
1534
|
}).default({
|
|
1516
1535
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1517
1536
|
})
|
|
1518
|
-
}).
|
|
1537
|
+
}).meta({
|
|
1538
|
+
description: "A signature input field",
|
|
1539
|
+
id: "SignatureField"
|
|
1540
|
+
});
|
|
1519
1541
|
var EmailField = BaseField.extend({
|
|
1520
1542
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
1521
1543
|
configuration: import_v43.default.object({
|
|
1522
1544
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1523
1545
|
}).default({ maxLength: 255 }).optional(),
|
|
1524
1546
|
defaultValue: NonEmptyTextValue.optional()
|
|
1547
|
+
}).meta({
|
|
1548
|
+
description: "An email input field",
|
|
1549
|
+
id: "EmailField"
|
|
1525
1550
|
});
|
|
1526
1551
|
var DateField = BaseField.extend({
|
|
1527
1552
|
type: import_v43.default.literal(FieldType.DATE),
|
|
@@ -1531,7 +1556,10 @@ var DateField = BaseField.extend({
|
|
|
1531
1556
|
"Text to display above the date input"
|
|
1532
1557
|
).optional()
|
|
1533
1558
|
}).optional()
|
|
1534
|
-
}).
|
|
1559
|
+
}).meta({
|
|
1560
|
+
description: "A date input (yyyy-MM-dd)",
|
|
1561
|
+
id: "DateField"
|
|
1562
|
+
});
|
|
1535
1563
|
var AgeField = BaseField.extend({
|
|
1536
1564
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1537
1565
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -1540,7 +1568,10 @@ var AgeField = BaseField.extend({
|
|
|
1540
1568
|
prefix: TranslationConfig.optional(),
|
|
1541
1569
|
postfix: TranslationConfig.optional()
|
|
1542
1570
|
})
|
|
1543
|
-
}).
|
|
1571
|
+
}).meta({
|
|
1572
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
1573
|
+
id: "AgeField"
|
|
1574
|
+
});
|
|
1544
1575
|
var TimeField = BaseField.extend({
|
|
1545
1576
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1546
1577
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
@@ -1550,7 +1581,10 @@ var TimeField = BaseField.extend({
|
|
|
1550
1581
|
"Text to display above the time input"
|
|
1551
1582
|
).optional()
|
|
1552
1583
|
}).optional()
|
|
1553
|
-
}).
|
|
1584
|
+
}).meta({
|
|
1585
|
+
description: "A single time input (HH-mm)",
|
|
1586
|
+
id: "TimeField"
|
|
1587
|
+
});
|
|
1554
1588
|
var DateRangeField = BaseField.extend({
|
|
1555
1589
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1556
1590
|
defaultValue: DateRangeFieldValue.optional(),
|
|
@@ -1559,7 +1593,10 @@ var DateRangeField = BaseField.extend({
|
|
|
1559
1593
|
"Text to display above the date input"
|
|
1560
1594
|
).optional()
|
|
1561
1595
|
}).optional()
|
|
1562
|
-
}).
|
|
1596
|
+
}).meta({
|
|
1597
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
1598
|
+
id: "DateRangeField"
|
|
1599
|
+
});
|
|
1563
1600
|
var HtmlFontVariant = import_v43.default.enum([
|
|
1564
1601
|
"reg12",
|
|
1565
1602
|
"reg14",
|
|
@@ -1603,18 +1640,30 @@ var ImageViewField = BaseField.extend({
|
|
|
1603
1640
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
1604
1641
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1605
1642
|
configuration: ImageConfiguration
|
|
1606
|
-
}).
|
|
1643
|
+
}).meta({
|
|
1644
|
+
description: "A read-only image component for form pages",
|
|
1645
|
+
id: "ImageViewField"
|
|
1646
|
+
});
|
|
1607
1647
|
var Paragraph = BaseField.extend({
|
|
1608
1648
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
1609
1649
|
configuration: ParagraphConfiguration
|
|
1610
|
-
}).
|
|
1650
|
+
}).meta({
|
|
1651
|
+
description: "A read-only HTML <p> paragraph",
|
|
1652
|
+
id: "Paragraph"
|
|
1653
|
+
});
|
|
1611
1654
|
var Heading = BaseField.extend({
|
|
1612
1655
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
1613
1656
|
configuration: HeadingConfiguration
|
|
1614
|
-
}).
|
|
1657
|
+
}).meta({
|
|
1658
|
+
description: "A read-only heading component for form pages",
|
|
1659
|
+
id: "Heading"
|
|
1660
|
+
});
|
|
1615
1661
|
var PageHeader = BaseField.extend({
|
|
1616
1662
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
1617
|
-
}).
|
|
1663
|
+
}).meta({
|
|
1664
|
+
description: "A read-only header component for form pages",
|
|
1665
|
+
id: "PageHeader"
|
|
1666
|
+
});
|
|
1618
1667
|
var File = BaseField.extend({
|
|
1619
1668
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1620
1669
|
defaultValue: FileFieldValue.optional(),
|
|
@@ -1633,7 +1682,10 @@ var File = BaseField.extend({
|
|
|
1633
1682
|
}).default({
|
|
1634
1683
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1635
1684
|
})
|
|
1636
|
-
}).
|
|
1685
|
+
}).meta({
|
|
1686
|
+
description: "A file upload field",
|
|
1687
|
+
id: "File"
|
|
1688
|
+
});
|
|
1637
1689
|
var SelectOption = import_v43.default.object({
|
|
1638
1690
|
value: import_v43.default.string().describe("The value of the option"),
|
|
1639
1691
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -1650,7 +1702,10 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1650
1702
|
"Placeholder for the number field"
|
|
1651
1703
|
)
|
|
1652
1704
|
}).optional()
|
|
1653
|
-
}).
|
|
1705
|
+
}).meta({
|
|
1706
|
+
description: "A number with unit input field",
|
|
1707
|
+
id: "NumberWithUnitField"
|
|
1708
|
+
});
|
|
1654
1709
|
var RadioGroup = BaseField.extend({
|
|
1655
1710
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1656
1711
|
defaultValue: TextValue.optional(),
|
|
@@ -1660,7 +1715,10 @@ var RadioGroup = BaseField.extend({
|
|
|
1660
1715
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
1661
1716
|
}).optional()
|
|
1662
1717
|
}).optional()
|
|
1663
|
-
}).
|
|
1718
|
+
}).meta({
|
|
1719
|
+
description: "A grouped radio button field",
|
|
1720
|
+
id: "RadioGroup"
|
|
1721
|
+
});
|
|
1664
1722
|
var BulletList = BaseField.extend({
|
|
1665
1723
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
1666
1724
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -1669,7 +1727,10 @@ var BulletList = BaseField.extend({
|
|
|
1669
1727
|
fontVariant: HtmlFontVariant.optional()
|
|
1670
1728
|
}).optional()
|
|
1671
1729
|
}).default({})
|
|
1672
|
-
}).
|
|
1730
|
+
}).meta({
|
|
1731
|
+
description: "A list of bullet points",
|
|
1732
|
+
id: "BulletList"
|
|
1733
|
+
});
|
|
1673
1734
|
var Select = BaseField.extend({
|
|
1674
1735
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1675
1736
|
defaultValue: TextValue.optional(),
|
|
@@ -1684,7 +1745,10 @@ var Select = BaseField.extend({
|
|
|
1684
1745
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
1685
1746
|
`
|
|
1686
1747
|
)
|
|
1687
|
-
}).
|
|
1748
|
+
}).meta({
|
|
1749
|
+
description: "A select input field",
|
|
1750
|
+
id: "Select"
|
|
1751
|
+
});
|
|
1688
1752
|
var SelectDateRangeOption = import_v43.default.object({
|
|
1689
1753
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1690
1754
|
label: TranslationConfig.describe("The label of the option")
|
|
@@ -1693,7 +1757,10 @@ var SelectDateRangeField = BaseField.extend({
|
|
|
1693
1757
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1694
1758
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1695
1759
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1696
|
-
}).
|
|
1760
|
+
}).meta({
|
|
1761
|
+
description: "A date range selection field",
|
|
1762
|
+
id: "SelectDateRangeField"
|
|
1763
|
+
});
|
|
1697
1764
|
var NameConfig = import_v43.default.object({
|
|
1698
1765
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1699
1766
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -1724,26 +1791,41 @@ var NameField = BaseField.extend({
|
|
|
1724
1791
|
surname: { required: true }
|
|
1725
1792
|
}
|
|
1726
1793
|
}).optional()
|
|
1727
|
-
}).
|
|
1794
|
+
}).meta({
|
|
1795
|
+
description: "A field for entering a persons name",
|
|
1796
|
+
id: "NameField"
|
|
1797
|
+
});
|
|
1728
1798
|
var PhoneField = BaseField.extend({
|
|
1729
1799
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1730
1800
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1731
|
-
}).
|
|
1801
|
+
}).meta({
|
|
1802
|
+
description: "A field for entering a phone number",
|
|
1803
|
+
id: "PhoneField"
|
|
1804
|
+
});
|
|
1732
1805
|
var IdField = BaseField.extend({
|
|
1733
1806
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1734
1807
|
type: import_v43.default.literal(FieldType.ID)
|
|
1735
|
-
}).
|
|
1808
|
+
}).meta({
|
|
1809
|
+
description: "A field for entering an ID",
|
|
1810
|
+
id: "IdField"
|
|
1811
|
+
});
|
|
1736
1812
|
var Checkbox = BaseField.extend({
|
|
1737
1813
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1738
1814
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1739
|
-
}).
|
|
1815
|
+
}).meta({
|
|
1816
|
+
description: "A boolean checkbox field",
|
|
1817
|
+
id: "Checkbox"
|
|
1818
|
+
});
|
|
1740
1819
|
var Country = BaseField.extend({
|
|
1741
1820
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1742
1821
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1743
1822
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1744
1823
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1745
1824
|
)
|
|
1746
|
-
}).
|
|
1825
|
+
}).meta({
|
|
1826
|
+
description: "A field for selecting a country",
|
|
1827
|
+
id: "Country"
|
|
1828
|
+
});
|
|
1747
1829
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
1748
1830
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
1749
1831
|
);
|
|
@@ -1752,16 +1834,18 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1752
1834
|
"HEALTH_FACILITY",
|
|
1753
1835
|
"CRVS_OFFICE"
|
|
1754
1836
|
]);
|
|
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
1837
|
var AdministrativeAreaField = BaseField.extend({
|
|
1761
1838
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1762
1839
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1763
|
-
configuration:
|
|
1764
|
-
|
|
1840
|
+
configuration: import_v43.default.object({
|
|
1841
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
1842
|
+
type: AdministrativeAreas,
|
|
1843
|
+
allowedLocations: AllowedLocations
|
|
1844
|
+
}).describe("Administrative area options")
|
|
1845
|
+
}).meta({
|
|
1846
|
+
description: "Administrative area input field",
|
|
1847
|
+
id: "AdministrativeAreaField"
|
|
1848
|
+
});
|
|
1765
1849
|
var LocationInput = BaseField.extend({
|
|
1766
1850
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1767
1851
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
@@ -1769,7 +1853,10 @@ var LocationInput = BaseField.extend({
|
|
|
1769
1853
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1770
1854
|
allowedLocations: AllowedLocations
|
|
1771
1855
|
}).optional()
|
|
1772
|
-
}).
|
|
1856
|
+
}).meta({
|
|
1857
|
+
description: "A field for selecting a location",
|
|
1858
|
+
id: "LocationInput"
|
|
1859
|
+
});
|
|
1773
1860
|
var FileUploadWithOptions = BaseField.extend({
|
|
1774
1861
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1775
1862
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
@@ -1783,6 +1870,9 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1783
1870
|
}).default({
|
|
1784
1871
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1785
1872
|
})
|
|
1873
|
+
}).meta({
|
|
1874
|
+
description: "A field for uploading files with file type options",
|
|
1875
|
+
id: "FileUploadWithOptions"
|
|
1786
1876
|
});
|
|
1787
1877
|
var Facility = BaseField.extend({
|
|
1788
1878
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
@@ -1828,7 +1918,10 @@ var Address = BaseField.extend({
|
|
|
1828
1918
|
allowedLocations: AllowedLocations
|
|
1829
1919
|
}).optional(),
|
|
1830
1920
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1831
|
-
}).
|
|
1921
|
+
}).meta({
|
|
1922
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
1923
|
+
id: "Address"
|
|
1924
|
+
});
|
|
1832
1925
|
var StaticDataEntry = import_v43.default.object({
|
|
1833
1926
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
1834
1927
|
label: TranslationConfig,
|
|
@@ -1843,7 +1936,10 @@ var DataField = BaseField.extend({
|
|
|
1843
1936
|
subtitle: TranslationConfig.optional(),
|
|
1844
1937
|
data: import_v43.default.array(DataEntry)
|
|
1845
1938
|
})
|
|
1846
|
-
}).
|
|
1939
|
+
}).meta({
|
|
1940
|
+
description: "A field for displaying a table of read-only data",
|
|
1941
|
+
id: "DataField"
|
|
1942
|
+
});
|
|
1847
1943
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
1848
1944
|
var ButtonType = import_v43.default.enum([
|
|
1849
1945
|
"primary",
|
|
@@ -1870,11 +1966,17 @@ var ButtonField = BaseField.extend({
|
|
|
1870
1966
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1871
1967
|
defaultValue: ButtonFieldValue.optional(),
|
|
1872
1968
|
configuration: ButtonConfiguration
|
|
1873
|
-
}).
|
|
1969
|
+
}).meta({
|
|
1970
|
+
description: "A generic button that can be used to trigger an action",
|
|
1971
|
+
id: "ButtonField"
|
|
1972
|
+
});
|
|
1874
1973
|
var FieldGroup = BaseField.extend({
|
|
1875
1974
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
1876
1975
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1877
1976
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
1977
|
+
}).meta({
|
|
1978
|
+
description: "A group of fields that are displayed together",
|
|
1979
|
+
id: "FieldGroup"
|
|
1878
1980
|
});
|
|
1879
1981
|
var AlphaPrintButton = BaseField.extend({
|
|
1880
1982
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -1884,7 +1986,10 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1884
1986
|
"Label for the print button"
|
|
1885
1987
|
)
|
|
1886
1988
|
})
|
|
1887
|
-
}).
|
|
1989
|
+
}).meta({
|
|
1990
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
1991
|
+
id: "AlphaPrintButton"
|
|
1992
|
+
});
|
|
1888
1993
|
var HttpField = BaseField.extend({
|
|
1889
1994
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1890
1995
|
defaultValue: HttpFieldValue.optional(),
|
|
@@ -1900,20 +2005,30 @@ var HttpField = BaseField.extend({
|
|
|
1900
2005
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
1901
2006
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1902
2007
|
})
|
|
1903
|
-
}).
|
|
2008
|
+
}).meta({
|
|
2009
|
+
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.",
|
|
2010
|
+
id: "HttpField"
|
|
2011
|
+
});
|
|
1904
2012
|
var AutocompleteField = BaseField.extend({
|
|
1905
2013
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
1906
2014
|
configuration: import_v43.default.object({
|
|
1907
|
-
url: import_v43.default.string().describe(
|
|
2015
|
+
url: import_v43.default.string().describe(
|
|
2016
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2017
|
+
).optional(),
|
|
1908
2018
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
1909
2019
|
defaultOptions: import_v43.default.array(
|
|
1910
2020
|
import_v43.default.object({
|
|
1911
2021
|
label: import_v43.default.string(),
|
|
1912
2022
|
value: import_v43.default.string()
|
|
1913
2023
|
})
|
|
1914
|
-
).optional()
|
|
2024
|
+
).optional().describe(
|
|
2025
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2026
|
+
)
|
|
1915
2027
|
})
|
|
1916
|
-
}).
|
|
2028
|
+
}).meta({
|
|
2029
|
+
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.",
|
|
2030
|
+
id: "AutocompleteField"
|
|
2031
|
+
});
|
|
1917
2032
|
var SearchField = HttpField.extend({
|
|
1918
2033
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
1919
2034
|
configuration: SearchQuery.pick({
|
|
@@ -1946,6 +2061,9 @@ var SearchField = HttpField.extend({
|
|
|
1946
2061
|
ok: TranslationConfig.optional()
|
|
1947
2062
|
}).optional()
|
|
1948
2063
|
})
|
|
2064
|
+
}).meta({
|
|
2065
|
+
description: "A search input field",
|
|
2066
|
+
id: "SearchField"
|
|
1949
2067
|
});
|
|
1950
2068
|
var LinkButtonField = BaseField.extend({
|
|
1951
2069
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -1954,7 +2072,10 @@ var LinkButtonField = BaseField.extend({
|
|
|
1954
2072
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1955
2073
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1956
2074
|
})
|
|
1957
|
-
}).
|
|
2075
|
+
}).meta({
|
|
2076
|
+
description: "A button that opens a URL link",
|
|
2077
|
+
id: "LinkButtonField"
|
|
2078
|
+
});
|
|
1958
2079
|
var VerificationStatus = BaseField.extend({
|
|
1959
2080
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
1960
2081
|
defaultValue: VerificationStatusValue.optional(),
|
|
@@ -1964,15 +2085,19 @@ var VerificationStatus = BaseField.extend({
|
|
|
1964
2085
|
"Explaining text on the banner in form."
|
|
1965
2086
|
)
|
|
1966
2087
|
})
|
|
2088
|
+
}).meta({
|
|
2089
|
+
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.",
|
|
2090
|
+
id: "VerificationStatus"
|
|
1967
2091
|
});
|
|
1968
2092
|
var QueryParamReaderField = BaseField.extend({
|
|
1969
2093
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
1970
2094
|
configuration: import_v43.default.object({
|
|
1971
2095
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
1972
2096
|
})
|
|
1973
|
-
}).
|
|
1974
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
1975
|
-
|
|
2097
|
+
}).meta({
|
|
2098
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2099
|
+
id: "QueryParamReaderField"
|
|
2100
|
+
});
|
|
1976
2101
|
var QrReaderField = BaseField.extend({
|
|
1977
2102
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
1978
2103
|
defaultValue: QrReaderFieldValue.optional(),
|
|
@@ -1983,7 +2108,7 @@ var QrReaderField = BaseField.extend({
|
|
|
1983
2108
|
})
|
|
1984
2109
|
}).optional()
|
|
1985
2110
|
}).meta({
|
|
1986
|
-
description: "
|
|
2111
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
1987
2112
|
id: "QrReaderField"
|
|
1988
2113
|
});
|
|
1989
2114
|
var IdReaderField = BaseField.extend({
|
|
@@ -1992,12 +2117,18 @@ var IdReaderField = BaseField.extend({
|
|
|
1992
2117
|
methods: import_v43.default.array(
|
|
1993
2118
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1994
2119
|
)
|
|
2120
|
+
}).meta({
|
|
2121
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2122
|
+
id: "IdReaderField"
|
|
1995
2123
|
});
|
|
1996
2124
|
var CustomField = BaseField.extend({
|
|
1997
2125
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
1998
2126
|
defaultValue: CustomFieldValue.optional(),
|
|
1999
2127
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2000
2128
|
configuration: import_v43.default.unknown().optional()
|
|
2129
|
+
}).meta({
|
|
2130
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2131
|
+
id: "CustomField"
|
|
2001
2132
|
});
|
|
2002
2133
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2003
2134
|
var LoaderField = BaseField.extend({
|
|
@@ -2007,22 +2138,25 @@ var LoaderField = BaseField.extend({
|
|
|
2007
2138
|
configuration: import_v43.default.object({
|
|
2008
2139
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2009
2140
|
})
|
|
2010
|
-
}).
|
|
2011
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2012
|
-
|
|
2141
|
+
}).meta({
|
|
2142
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2143
|
+
id: "LoaderField"
|
|
2144
|
+
});
|
|
2013
2145
|
var HiddenField = BaseField.extend({
|
|
2014
2146
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2015
2147
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2016
2148
|
defaultValue: TextValue.optional()
|
|
2017
|
-
}).
|
|
2018
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2019
|
-
|
|
2149
|
+
}).meta({
|
|
2150
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2151
|
+
id: "HiddenField"
|
|
2152
|
+
});
|
|
2020
2153
|
var UserRoleField = BaseField.extend({
|
|
2021
2154
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2022
2155
|
defaultValue: TextValue.optional()
|
|
2023
|
-
}).
|
|
2024
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2025
|
-
|
|
2156
|
+
}).meta({
|
|
2157
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2158
|
+
id: "UserRoleField"
|
|
2159
|
+
});
|
|
2026
2160
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2027
2161
|
FieldGroup,
|
|
2028
2162
|
Address,
|