@opencrvs/toolkit 1.9.6-rc.190db7e → 1.9.6-rc.3c3bfa8
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/dist/commons/conditionals/conditionals.d.ts +5 -0
- package/dist/commons/events/FieldConfig.d.ts +44 -6
- package/dist/commons/events/TemplateConfig.d.ts +2 -0
- package/dist/conditionals/index.js +15 -0
- package/dist/events/index.js +488 -469
- package/dist/notification/index.js +507 -494
- package/package.json +1 -1
|
@@ -50,7 +50,7 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
|
50
50
|
var BIRTH_EVENT = "birth";
|
|
51
51
|
|
|
52
52
|
// ../commons/src/events/ActionConfig.ts
|
|
53
|
-
var
|
|
53
|
+
var import_zod20 = require("zod");
|
|
54
54
|
|
|
55
55
|
// ../commons/src/events/TranslationConfig.ts
|
|
56
56
|
var import_zod = require("zod");
|
|
@@ -170,7 +170,7 @@ var META_ACTIONS = [
|
|
|
170
170
|
];
|
|
171
171
|
|
|
172
172
|
// ../commons/src/events/FieldConfig.ts
|
|
173
|
-
var
|
|
173
|
+
var import_zod16 = require("zod");
|
|
174
174
|
|
|
175
175
|
// ../commons/src/events/Conditional.ts
|
|
176
176
|
var import_zod3 = require("zod");
|
|
@@ -1428,9 +1428,22 @@ var SearchQuery = import_zod14.z.object({
|
|
|
1428
1428
|
ref: "SearchQuery"
|
|
1429
1429
|
});
|
|
1430
1430
|
|
|
1431
|
+
// ../commons/src/events/serializers/date/serializer.ts
|
|
1432
|
+
var import_zod15 = require("zod");
|
|
1433
|
+
var SerializedNowDateTime = import_zod15.z.object({
|
|
1434
|
+
$$date: import_zod15.z.literal("now"),
|
|
1435
|
+
$$time: import_zod15.z.literal("now")
|
|
1436
|
+
});
|
|
1437
|
+
function todayDateTimeValueSerializer() {
|
|
1438
|
+
return {
|
|
1439
|
+
$$date: "now",
|
|
1440
|
+
$$time: "now"
|
|
1441
|
+
};
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1431
1444
|
// ../commons/src/events/FieldConfig.ts
|
|
1432
|
-
(0, import_zod_openapi6.extendZodWithOpenApi)(
|
|
1433
|
-
var FieldId =
|
|
1445
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod16.z);
|
|
1446
|
+
var FieldId = import_zod16.z.string().refine(
|
|
1434
1447
|
/*
|
|
1435
1448
|
* Disallow underscores '_' in field ids.
|
|
1436
1449
|
* Why? Theres two reasons:
|
|
@@ -1443,160 +1456,164 @@ var FieldId = import_zod15.z.string().refine(
|
|
|
1443
1456
|
message: `id: '${val}' must not contain underscores '_'`
|
|
1444
1457
|
})
|
|
1445
1458
|
).describe("Unique identifier for the field");
|
|
1446
|
-
var FieldReference =
|
|
1459
|
+
var FieldReference = import_zod16.z.object({
|
|
1447
1460
|
$$field: FieldId,
|
|
1448
|
-
$$subfield:
|
|
1461
|
+
$$subfield: import_zod16.z.array(import_zod16.z.string()).optional().describe(
|
|
1449
1462
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1450
1463
|
)
|
|
1451
1464
|
}).describe("Reference to a field by its ID");
|
|
1452
|
-
var ValidationConfig =
|
|
1465
|
+
var ValidationConfig = import_zod16.z.object({
|
|
1453
1466
|
validator: Conditional,
|
|
1454
1467
|
message: TranslationConfig
|
|
1455
1468
|
});
|
|
1456
|
-
var requiredSchema =
|
|
1457
|
-
|
|
1458
|
-
|
|
1469
|
+
var requiredSchema = import_zod16.z.union([
|
|
1470
|
+
import_zod16.z.boolean(),
|
|
1471
|
+
import_zod16.z.object({
|
|
1459
1472
|
message: TranslationConfig.describe("Custom required validation message")
|
|
1460
1473
|
})
|
|
1461
1474
|
]).default(false).optional();
|
|
1462
|
-
var BaseField =
|
|
1475
|
+
var BaseField = import_zod16.z.object({
|
|
1463
1476
|
id: FieldId.describe("Unique identifier of the field."),
|
|
1464
1477
|
label: TranslationConfig.describe("Human-readable label of the field."),
|
|
1465
|
-
parent: FieldReference.or(
|
|
1478
|
+
parent: FieldReference.or(import_zod16.z.array(FieldReference)).optional().describe(
|
|
1466
1479
|
"Reference to the parent field or fields. When a parent field changes, this field is reset."
|
|
1467
1480
|
),
|
|
1468
1481
|
required: requiredSchema.describe(
|
|
1469
1482
|
"Indicates whether the field is mandatory."
|
|
1470
1483
|
),
|
|
1471
|
-
conditionals:
|
|
1484
|
+
conditionals: import_zod16.z.array(FieldConditional).default([]).optional().describe(
|
|
1472
1485
|
"Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
|
|
1473
1486
|
),
|
|
1474
|
-
secured:
|
|
1487
|
+
secured: import_zod16.z.boolean().default(false).optional().describe(
|
|
1475
1488
|
"Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
|
|
1476
1489
|
),
|
|
1477
1490
|
placeholder: TranslationConfig.optional(),
|
|
1478
|
-
validation:
|
|
1491
|
+
validation: import_zod16.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
|
|
1479
1492
|
helperText: TranslationConfig.optional(),
|
|
1480
|
-
hideLabel:
|
|
1481
|
-
uncorrectable:
|
|
1493
|
+
hideLabel: import_zod16.z.boolean().default(false).optional(),
|
|
1494
|
+
uncorrectable: import_zod16.z.boolean().default(false).optional().describe(
|
|
1482
1495
|
"Indicates whether the field can be modified during record correction."
|
|
1483
1496
|
),
|
|
1484
|
-
value: FieldReference.or(
|
|
1497
|
+
value: FieldReference.or(import_zod16.z.array(FieldReference)).optional().describe(
|
|
1485
1498
|
"Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
|
|
1486
1499
|
),
|
|
1487
|
-
analytics:
|
|
1500
|
+
analytics: import_zod16.z.boolean().default(false).optional().describe(
|
|
1488
1501
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
1489
1502
|
)
|
|
1490
1503
|
}).describe("Common properties shared across all field types.");
|
|
1491
1504
|
var Divider = BaseField.extend({
|
|
1492
|
-
type:
|
|
1505
|
+
type: import_zod16.z.literal(FieldType.DIVIDER)
|
|
1493
1506
|
});
|
|
1494
1507
|
var TextField = BaseField.extend({
|
|
1495
|
-
type:
|
|
1496
|
-
defaultValue:
|
|
1497
|
-
configuration:
|
|
1498
|
-
maxLength:
|
|
1499
|
-
type:
|
|
1508
|
+
type: import_zod16.z.literal(FieldType.TEXT),
|
|
1509
|
+
defaultValue: import_zod16.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1510
|
+
configuration: import_zod16.z.object({
|
|
1511
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
1512
|
+
type: import_zod16.z.enum(["text", "password"]).optional(),
|
|
1500
1513
|
prefix: TranslationConfig.optional(),
|
|
1501
1514
|
postfix: TranslationConfig.optional()
|
|
1502
1515
|
}).default({ type: "text" }).optional()
|
|
1503
1516
|
}).describe("Text input");
|
|
1504
1517
|
var NumberField = BaseField.extend({
|
|
1505
|
-
type:
|
|
1518
|
+
type: import_zod16.z.literal(FieldType.NUMBER),
|
|
1506
1519
|
defaultValue: NumberFieldValue.optional(),
|
|
1507
|
-
configuration:
|
|
1508
|
-
min:
|
|
1509
|
-
max:
|
|
1520
|
+
configuration: import_zod16.z.object({
|
|
1521
|
+
min: import_zod16.z.number().optional().describe("Minimum value"),
|
|
1522
|
+
max: import_zod16.z.number().optional().describe("Maximum value"),
|
|
1510
1523
|
prefix: TranslationConfig.optional(),
|
|
1511
1524
|
postfix: TranslationConfig.optional()
|
|
1512
1525
|
}).optional()
|
|
1513
1526
|
}).describe("Number input");
|
|
1514
1527
|
var TextAreaField = BaseField.extend({
|
|
1515
|
-
type:
|
|
1528
|
+
type: import_zod16.z.literal(FieldType.TEXTAREA),
|
|
1516
1529
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1517
|
-
configuration:
|
|
1518
|
-
maxLength:
|
|
1519
|
-
rows:
|
|
1520
|
-
cols:
|
|
1530
|
+
configuration: import_zod16.z.object({
|
|
1531
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
1532
|
+
rows: import_zod16.z.number().optional().describe("Number of visible text lines"),
|
|
1533
|
+
cols: import_zod16.z.number().optional().describe("Number of visible columns"),
|
|
1521
1534
|
prefix: TranslationConfig.optional(),
|
|
1522
1535
|
postfix: TranslationConfig.optional()
|
|
1523
1536
|
}).default({ rows: 4 }).optional()
|
|
1524
1537
|
}).describe("Multiline text input");
|
|
1525
|
-
var ImageMimeType =
|
|
1538
|
+
var ImageMimeType = import_zod16.z.enum([
|
|
1526
1539
|
"image/png",
|
|
1527
1540
|
"image/jpg",
|
|
1528
1541
|
"image/jpeg",
|
|
1529
1542
|
"image/svg+xml"
|
|
1530
1543
|
]);
|
|
1531
|
-
var DocumentMimeType =
|
|
1544
|
+
var DocumentMimeType = import_zod16.z.enum([
|
|
1532
1545
|
"application/pdf",
|
|
1533
1546
|
"application/msword",
|
|
1534
1547
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1535
1548
|
"application/vnd.oasis.opendocument.text"
|
|
1536
1549
|
]);
|
|
1537
|
-
var MimeType =
|
|
1550
|
+
var MimeType = import_zod16.z.enum([
|
|
1538
1551
|
...ImageMimeType.options,
|
|
1539
1552
|
...DocumentMimeType.options
|
|
1540
1553
|
]);
|
|
1541
1554
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
1542
1555
|
var SignatureField = BaseField.extend({
|
|
1543
|
-
type:
|
|
1556
|
+
type: import_zod16.z.literal(FieldType.SIGNATURE),
|
|
1544
1557
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1545
1558
|
"Title of the signature modal"
|
|
1546
1559
|
),
|
|
1547
1560
|
defaultValue: SignatureFieldValue.optional(),
|
|
1548
|
-
configuration:
|
|
1549
|
-
maxFileSize:
|
|
1561
|
+
configuration: import_zod16.z.object({
|
|
1562
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1550
1563
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1551
1564
|
}).default({
|
|
1552
1565
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1553
1566
|
})
|
|
1554
1567
|
}).describe("Signature input field");
|
|
1555
1568
|
var EmailField = BaseField.extend({
|
|
1556
|
-
type:
|
|
1557
|
-
configuration:
|
|
1558
|
-
maxLength:
|
|
1569
|
+
type: import_zod16.z.literal(FieldType.EMAIL),
|
|
1570
|
+
configuration: import_zod16.z.object({
|
|
1571
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text")
|
|
1559
1572
|
}).default({ maxLength: 10 }).optional(),
|
|
1560
1573
|
defaultValue: NonEmptyTextValue.optional()
|
|
1561
1574
|
});
|
|
1562
1575
|
var DateField = BaseField.extend({
|
|
1563
|
-
type:
|
|
1564
|
-
defaultValue:
|
|
1565
|
-
|
|
1576
|
+
type: import_zod16.z.literal(FieldType.DATE),
|
|
1577
|
+
defaultValue: SerializedNowDateTime.transform(() => ({
|
|
1578
|
+
$$date: "now"
|
|
1579
|
+
})).or(DateValue).optional().openapi({ effectType: "input", type: "string" }).describe("A single time input (HH-mm)"),
|
|
1580
|
+
configuration: import_zod16.z.object({
|
|
1566
1581
|
notice: TranslationConfig.describe(
|
|
1567
1582
|
"Text to display above the date input"
|
|
1568
1583
|
).optional()
|
|
1569
1584
|
}).optional()
|
|
1570
1585
|
}).describe("A single date input (yyyy-MM-dd)");
|
|
1571
1586
|
var AgeField = BaseField.extend({
|
|
1572
|
-
type:
|
|
1587
|
+
type: import_zod16.z.literal(FieldType.AGE),
|
|
1573
1588
|
defaultValue: NumberFieldValue.optional(),
|
|
1574
|
-
configuration:
|
|
1589
|
+
configuration: import_zod16.z.object({
|
|
1575
1590
|
asOfDate: FieldReference,
|
|
1576
1591
|
prefix: TranslationConfig.optional(),
|
|
1577
1592
|
postfix: TranslationConfig.optional()
|
|
1578
1593
|
})
|
|
1579
1594
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1580
1595
|
var TimeField = BaseField.extend({
|
|
1581
|
-
type:
|
|
1582
|
-
defaultValue:
|
|
1583
|
-
|
|
1584
|
-
|
|
1596
|
+
type: import_zod16.z.literal(FieldType.TIME),
|
|
1597
|
+
defaultValue: SerializedNowDateTime.transform(() => ({
|
|
1598
|
+
$$time: "now"
|
|
1599
|
+
})).or(TimeValue).optional().openapi({ effectType: "input", type: "string" }).describe("A single time input (HH-mm)"),
|
|
1600
|
+
configuration: import_zod16.z.object({
|
|
1601
|
+
use12HourFormat: import_zod16.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1585
1602
|
notice: TranslationConfig.describe(
|
|
1586
1603
|
"Text to display above the time input"
|
|
1587
1604
|
).optional()
|
|
1588
1605
|
}).optional()
|
|
1589
1606
|
}).describe("A single date input (HH-mm)");
|
|
1590
1607
|
var DateRangeField = BaseField.extend({
|
|
1591
|
-
type:
|
|
1608
|
+
type: import_zod16.z.literal(FieldType.DATE_RANGE),
|
|
1592
1609
|
defaultValue: DateRangeFieldValue.optional(),
|
|
1593
|
-
configuration:
|
|
1610
|
+
configuration: import_zod16.z.object({
|
|
1594
1611
|
notice: TranslationConfig.describe(
|
|
1595
1612
|
"Text to display above the date input"
|
|
1596
1613
|
).optional()
|
|
1597
1614
|
}).optional()
|
|
1598
1615
|
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
|
1599
|
-
var HtmlFontVariant =
|
|
1616
|
+
var HtmlFontVariant = import_zod16.z.enum([
|
|
1600
1617
|
"reg12",
|
|
1601
1618
|
"reg14",
|
|
1602
1619
|
"reg16",
|
|
@@ -1606,34 +1623,34 @@ var HtmlFontVariant = import_zod15.z.enum([
|
|
|
1606
1623
|
"h2",
|
|
1607
1624
|
"h1"
|
|
1608
1625
|
]);
|
|
1609
|
-
var ParagraphConfiguration =
|
|
1610
|
-
styles:
|
|
1626
|
+
var ParagraphConfiguration = import_zod16.z.object({
|
|
1627
|
+
styles: import_zod16.z.object({
|
|
1611
1628
|
fontVariant: HtmlFontVariant.optional().describe(
|
|
1612
1629
|
"Font variant to use for the paragraph text"
|
|
1613
1630
|
),
|
|
1614
|
-
hint:
|
|
1631
|
+
hint: import_zod16.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
|
1615
1632
|
}).optional()
|
|
1616
1633
|
}).default({});
|
|
1617
1634
|
var Paragraph = BaseField.extend({
|
|
1618
|
-
type:
|
|
1635
|
+
type: import_zod16.z.literal(FieldType.PARAGRAPH),
|
|
1619
1636
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1620
1637
|
configuration: ParagraphConfiguration
|
|
1621
1638
|
}).describe("A read-only HTML <p> paragraph");
|
|
1622
1639
|
var PageHeader = BaseField.extend({
|
|
1623
|
-
type:
|
|
1640
|
+
type: import_zod16.z.literal(FieldType.PAGE_HEADER),
|
|
1624
1641
|
defaultValue: NonEmptyTextValue.optional()
|
|
1625
1642
|
}).describe("A read-only header component for form pages");
|
|
1626
1643
|
var File = BaseField.extend({
|
|
1627
|
-
type:
|
|
1644
|
+
type: import_zod16.z.literal(FieldType.FILE),
|
|
1628
1645
|
defaultValue: FileFieldValue.optional(),
|
|
1629
|
-
configuration:
|
|
1630
|
-
maxFileSize:
|
|
1646
|
+
configuration: import_zod16.z.object({
|
|
1647
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1631
1648
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
1632
|
-
maxImageSize:
|
|
1633
|
-
targetSize:
|
|
1649
|
+
maxImageSize: import_zod16.z.object({
|
|
1650
|
+
targetSize: import_zod16.z.object({ width: import_zod16.z.number(), height: import_zod16.z.number() })
|
|
1634
1651
|
}).optional(),
|
|
1635
|
-
style:
|
|
1636
|
-
width:
|
|
1652
|
+
style: import_zod16.z.object({
|
|
1653
|
+
width: import_zod16.z.enum(["full", "auto"]).optional().describe(
|
|
1637
1654
|
"Whether the file upload button should take the full width of the container or not"
|
|
1638
1655
|
)
|
|
1639
1656
|
}).optional(),
|
|
@@ -1642,46 +1659,46 @@ var File = BaseField.extend({
|
|
|
1642
1659
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
1643
1660
|
})
|
|
1644
1661
|
}).describe("File upload");
|
|
1645
|
-
var SelectOption =
|
|
1646
|
-
value:
|
|
1647
|
-
label:
|
|
1662
|
+
var SelectOption = import_zod16.z.object({
|
|
1663
|
+
value: import_zod16.z.string().describe("The value of the option"),
|
|
1664
|
+
label: import_zod16.z.union([import_zod16.z.string(), TranslationConfig]).describe("The label of the option")
|
|
1648
1665
|
});
|
|
1649
1666
|
var NumberWithUnitField = BaseField.extend({
|
|
1650
|
-
type:
|
|
1667
|
+
type: import_zod16.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1651
1668
|
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1652
|
-
options:
|
|
1653
|
-
configuration:
|
|
1654
|
-
min:
|
|
1655
|
-
max:
|
|
1669
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
1670
|
+
configuration: import_zod16.z.object({
|
|
1671
|
+
min: import_zod16.z.number().optional().describe("Minimum value of the number field"),
|
|
1672
|
+
max: import_zod16.z.number().optional().describe("Maximum value of the number field"),
|
|
1656
1673
|
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
1657
1674
|
"Placeholder for the number field"
|
|
1658
1675
|
)
|
|
1659
1676
|
}).optional()
|
|
1660
1677
|
}).describe("Number with unit input");
|
|
1661
1678
|
var RadioGroup = BaseField.extend({
|
|
1662
|
-
type:
|
|
1679
|
+
type: import_zod16.z.literal(FieldType.RADIO_GROUP),
|
|
1663
1680
|
defaultValue: TextValue.optional(),
|
|
1664
|
-
options:
|
|
1665
|
-
configuration:
|
|
1666
|
-
styles:
|
|
1667
|
-
size:
|
|
1681
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
1682
|
+
configuration: import_zod16.z.object({
|
|
1683
|
+
styles: import_zod16.z.object({
|
|
1684
|
+
size: import_zod16.z.enum(["NORMAL", "LARGE"]).optional()
|
|
1668
1685
|
}).optional()
|
|
1669
1686
|
}).optional()
|
|
1670
1687
|
}).describe("Grouped radio options");
|
|
1671
1688
|
var BulletList = BaseField.extend({
|
|
1672
|
-
type:
|
|
1689
|
+
type: import_zod16.z.literal(FieldType.BULLET_LIST),
|
|
1673
1690
|
defaultValue: TextValue.optional(),
|
|
1674
|
-
items:
|
|
1675
|
-
configuration:
|
|
1676
|
-
styles:
|
|
1691
|
+
items: import_zod16.z.array(TranslationConfig).describe("A list of items"),
|
|
1692
|
+
configuration: import_zod16.z.object({
|
|
1693
|
+
styles: import_zod16.z.object({
|
|
1677
1694
|
fontVariant: HtmlFontVariant.optional()
|
|
1678
1695
|
}).optional()
|
|
1679
1696
|
}).default({})
|
|
1680
1697
|
}).describe("A list of bullet points");
|
|
1681
1698
|
var Select = BaseField.extend({
|
|
1682
|
-
type:
|
|
1699
|
+
type: import_zod16.z.literal(FieldType.SELECT),
|
|
1683
1700
|
defaultValue: TextValue.optional(),
|
|
1684
|
-
options:
|
|
1701
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
1685
1702
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1686
1703
|
`
|
|
1687
1704
|
A translation configuration object used to display a message when no options are available.
|
|
@@ -1693,34 +1710,34 @@ var Select = BaseField.extend({
|
|
|
1693
1710
|
`
|
|
1694
1711
|
)
|
|
1695
1712
|
}).describe("Select input");
|
|
1696
|
-
var SelectDateRangeOption =
|
|
1713
|
+
var SelectDateRangeOption = import_zod16.z.object({
|
|
1697
1714
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
1698
1715
|
label: TranslationConfig.describe("The label of the option")
|
|
1699
1716
|
});
|
|
1700
1717
|
var SelectDateRangeField = BaseField.extend({
|
|
1701
|
-
type:
|
|
1718
|
+
type: import_zod16.z.literal(FieldType.SELECT_DATE_RANGE),
|
|
1702
1719
|
defaultValue: SelectDateRangeValue.optional(),
|
|
1703
|
-
options:
|
|
1720
|
+
options: import_zod16.z.array(SelectDateRangeOption).describe("A list of options")
|
|
1704
1721
|
}).describe("Select input with date range options");
|
|
1705
|
-
var NameConfig =
|
|
1706
|
-
firstname:
|
|
1707
|
-
middlename:
|
|
1708
|
-
surname:
|
|
1722
|
+
var NameConfig = import_zod16.z.object({
|
|
1723
|
+
firstname: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1724
|
+
middlename: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
1725
|
+
surname: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
|
|
1709
1726
|
});
|
|
1710
1727
|
var NameField = BaseField.extend({
|
|
1711
|
-
type:
|
|
1712
|
-
defaultValue:
|
|
1728
|
+
type: import_zod16.z.literal(FieldType.NAME),
|
|
1729
|
+
defaultValue: import_zod16.z.object({
|
|
1713
1730
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1714
1731
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1715
1732
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1716
1733
|
}).optional(),
|
|
1717
|
-
configuration:
|
|
1734
|
+
configuration: import_zod16.z.object({
|
|
1718
1735
|
name: NameConfig.default({
|
|
1719
1736
|
firstname: { required: true },
|
|
1720
1737
|
surname: { required: true }
|
|
1721
1738
|
}).optional(),
|
|
1722
|
-
order:
|
|
1723
|
-
maxLength:
|
|
1739
|
+
order: import_zod16.z.array(import_zod16.z.enum(["firstname", "middlename", "surname"])).optional(),
|
|
1740
|
+
maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
|
|
1724
1741
|
prefix: TranslationConfig.optional(),
|
|
1725
1742
|
postfix: TranslationConfig.optional()
|
|
1726
1743
|
}).default({
|
|
@@ -1732,51 +1749,51 @@ var NameField = BaseField.extend({
|
|
|
1732
1749
|
}).describe("Name input field");
|
|
1733
1750
|
var PhoneField = BaseField.extend({
|
|
1734
1751
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1735
|
-
type:
|
|
1752
|
+
type: import_zod16.z.literal(FieldType.PHONE)
|
|
1736
1753
|
}).describe("Phone input field");
|
|
1737
1754
|
var IdField = BaseField.extend({
|
|
1738
1755
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1739
|
-
type:
|
|
1756
|
+
type: import_zod16.z.literal(FieldType.ID)
|
|
1740
1757
|
}).describe("ID input field");
|
|
1741
1758
|
var Checkbox = BaseField.extend({
|
|
1742
|
-
type:
|
|
1759
|
+
type: import_zod16.z.literal(FieldType.CHECKBOX),
|
|
1743
1760
|
defaultValue: CheckboxFieldValue.default(false)
|
|
1744
1761
|
}).describe("Boolean checkbox field");
|
|
1745
1762
|
var Country = BaseField.extend({
|
|
1746
|
-
type:
|
|
1763
|
+
type: import_zod16.z.literal(FieldType.COUNTRY),
|
|
1747
1764
|
defaultValue: NonEmptyTextValue.optional()
|
|
1748
1765
|
}).describe("Country select field");
|
|
1749
|
-
var AdministrativeAreas =
|
|
1766
|
+
var AdministrativeAreas = import_zod16.z.enum([
|
|
1750
1767
|
"ADMIN_STRUCTURE",
|
|
1751
1768
|
"HEALTH_FACILITY",
|
|
1752
1769
|
"CRVS_OFFICE"
|
|
1753
1770
|
]);
|
|
1754
|
-
var AdministrativeAreaConfiguration =
|
|
1755
|
-
partOf:
|
|
1756
|
-
$declaration:
|
|
1771
|
+
var AdministrativeAreaConfiguration = import_zod16.z.object({
|
|
1772
|
+
partOf: import_zod16.z.object({
|
|
1773
|
+
$declaration: import_zod16.z.string()
|
|
1757
1774
|
}).optional().describe("Parent location"),
|
|
1758
1775
|
type: AdministrativeAreas
|
|
1759
1776
|
}).describe("Administrative area options");
|
|
1760
1777
|
var AdministrativeArea = BaseField.extend({
|
|
1761
|
-
type:
|
|
1778
|
+
type: import_zod16.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1762
1779
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1763
1780
|
configuration: AdministrativeAreaConfiguration
|
|
1764
1781
|
}).describe("Administrative area input field e.g. facility, office");
|
|
1765
1782
|
var LocationInput = BaseField.extend({
|
|
1766
|
-
type:
|
|
1783
|
+
type: import_zod16.z.literal(FieldType.LOCATION),
|
|
1767
1784
|
defaultValue: NonEmptyTextValue.optional(),
|
|
1768
|
-
configuration:
|
|
1769
|
-
searchableResource:
|
|
1785
|
+
configuration: import_zod16.z.object({
|
|
1786
|
+
searchableResource: import_zod16.z.array(import_zod16.z.enum(["locations", "facilities", "offices"]))
|
|
1770
1787
|
})
|
|
1771
1788
|
}).describe("Input field for a location");
|
|
1772
1789
|
var FileUploadWithOptions = BaseField.extend({
|
|
1773
|
-
type:
|
|
1774
|
-
options:
|
|
1790
|
+
type: import_zod16.z.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1791
|
+
options: import_zod16.z.array(SelectOption).describe("A list of options"),
|
|
1775
1792
|
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1776
|
-
configuration:
|
|
1777
|
-
maxFileSize:
|
|
1778
|
-
maxImageSize:
|
|
1779
|
-
targetSize:
|
|
1793
|
+
configuration: import_zod16.z.object({
|
|
1794
|
+
maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1795
|
+
maxImageSize: import_zod16.z.object({
|
|
1796
|
+
targetSize: import_zod16.z.object({ width: import_zod16.z.number(), height: import_zod16.z.number() })
|
|
1780
1797
|
}).optional(),
|
|
1781
1798
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
1782
1799
|
}).default({
|
|
@@ -1784,93 +1801,93 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1784
1801
|
})
|
|
1785
1802
|
});
|
|
1786
1803
|
var Facility = BaseField.extend({
|
|
1787
|
-
type:
|
|
1804
|
+
type: import_zod16.z.literal(FieldType.FACILITY),
|
|
1788
1805
|
defaultValue: NonEmptyTextValue.optional()
|
|
1789
1806
|
}).describe("Input field for a facility");
|
|
1790
1807
|
var Office = BaseField.extend({
|
|
1791
|
-
type:
|
|
1808
|
+
type: import_zod16.z.literal(FieldType.OFFICE),
|
|
1792
1809
|
defaultValue: NonEmptyTextValue.optional()
|
|
1793
1810
|
}).describe("Input field for an office");
|
|
1794
1811
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
1795
|
-
administrativeArea:
|
|
1812
|
+
administrativeArea: import_zod16.z.union([UUID, SerializedUserField]).optional()
|
|
1796
1813
|
});
|
|
1797
1814
|
var Address = BaseField.extend({
|
|
1798
|
-
type:
|
|
1799
|
-
configuration:
|
|
1800
|
-
lineSeparator:
|
|
1801
|
-
fields:
|
|
1802
|
-
administrativeLevels:
|
|
1803
|
-
streetAddressForm:
|
|
1804
|
-
|
|
1805
|
-
id:
|
|
1815
|
+
type: import_zod16.z.literal(FieldType.ADDRESS),
|
|
1816
|
+
configuration: import_zod16.z.object({
|
|
1817
|
+
lineSeparator: import_zod16.z.string().optional(),
|
|
1818
|
+
fields: import_zod16.z.array(import_zod16.z.enum(["country", "administrativeArea"])).optional(),
|
|
1819
|
+
administrativeLevels: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
1820
|
+
streetAddressForm: import_zod16.z.array(
|
|
1821
|
+
import_zod16.z.object({
|
|
1822
|
+
id: import_zod16.z.string(),
|
|
1806
1823
|
required: requiredSchema,
|
|
1807
1824
|
label: TranslationConfig,
|
|
1808
|
-
type:
|
|
1809
|
-
conditionals:
|
|
1825
|
+
type: import_zod16.z.literal(FieldType.TEXT),
|
|
1826
|
+
conditionals: import_zod16.z.array(FieldConditional).default([]).optional(),
|
|
1810
1827
|
parent: FieldReference.optional()
|
|
1811
1828
|
})
|
|
1812
1829
|
).optional()
|
|
1813
1830
|
}).optional(),
|
|
1814
1831
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
1815
1832
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
|
1816
|
-
var StaticDataEntry =
|
|
1817
|
-
id:
|
|
1833
|
+
var StaticDataEntry = import_zod16.z.object({
|
|
1834
|
+
id: import_zod16.z.string().describe("ID for the data entry."),
|
|
1818
1835
|
label: TranslationConfig,
|
|
1819
|
-
value: TranslationConfig.or(
|
|
1836
|
+
value: TranslationConfig.or(import_zod16.z.string()).or(FieldReference)
|
|
1820
1837
|
}).describe("Static data entry");
|
|
1821
|
-
var DataEntry =
|
|
1838
|
+
var DataEntry = import_zod16.z.union([StaticDataEntry, import_zod16.z.object({ fieldId: import_zod16.z.string() })]).describe(
|
|
1822
1839
|
"Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
|
|
1823
1840
|
);
|
|
1824
1841
|
var DataField = BaseField.extend({
|
|
1825
|
-
type:
|
|
1826
|
-
configuration:
|
|
1842
|
+
type: import_zod16.z.literal(FieldType.DATA),
|
|
1843
|
+
configuration: import_zod16.z.object({
|
|
1827
1844
|
subtitle: TranslationConfig.optional(),
|
|
1828
|
-
data:
|
|
1845
|
+
data: import_zod16.z.array(DataEntry)
|
|
1829
1846
|
})
|
|
1830
1847
|
}).describe("Data field for displaying read-only data");
|
|
1831
1848
|
var ButtonField = BaseField.extend({
|
|
1832
|
-
type:
|
|
1849
|
+
type: import_zod16.z.literal(FieldType.BUTTON),
|
|
1833
1850
|
defaultValue: ButtonFieldValue.optional(),
|
|
1834
|
-
configuration:
|
|
1835
|
-
icon:
|
|
1851
|
+
configuration: import_zod16.z.object({
|
|
1852
|
+
icon: import_zod16.z.string().optional().describe(
|
|
1836
1853
|
"Icon for the button. You can find icons from OpenCRVS UI-Kit."
|
|
1837
1854
|
),
|
|
1838
|
-
loading:
|
|
1855
|
+
loading: import_zod16.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
|
|
1839
1856
|
text: TranslationConfig.describe("Text to display on the button")
|
|
1840
1857
|
})
|
|
1841
1858
|
}).describe("Generic button without any built-in functionality");
|
|
1842
1859
|
var AlphaPrintButton = BaseField.extend({
|
|
1843
|
-
type:
|
|
1844
|
-
configuration:
|
|
1845
|
-
template:
|
|
1860
|
+
type: import_zod16.z.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
1861
|
+
configuration: import_zod16.z.object({
|
|
1862
|
+
template: import_zod16.z.string().describe("Template ID from countryconfig templates to use for printing"),
|
|
1846
1863
|
buttonLabel: TranslationConfig.optional().describe(
|
|
1847
1864
|
"Label for the print button"
|
|
1848
1865
|
)
|
|
1849
1866
|
})
|
|
1850
1867
|
}).describe("Print button field for printing certificates");
|
|
1851
1868
|
var HttpField = BaseField.extend({
|
|
1852
|
-
type:
|
|
1869
|
+
type: import_zod16.z.literal(FieldType.HTTP),
|
|
1853
1870
|
defaultValue: HttpFieldValue.optional(),
|
|
1854
|
-
configuration:
|
|
1871
|
+
configuration: import_zod16.z.object({
|
|
1855
1872
|
trigger: FieldReference,
|
|
1856
|
-
url:
|
|
1857
|
-
method:
|
|
1858
|
-
headers:
|
|
1859
|
-
body:
|
|
1860
|
-
errorValue:
|
|
1861
|
-
params:
|
|
1862
|
-
timeout:
|
|
1873
|
+
url: import_zod16.z.string().describe("URL to send the HTTP request to"),
|
|
1874
|
+
method: import_zod16.z.enum(["GET", "POST", "PUT", "DELETE"]),
|
|
1875
|
+
headers: import_zod16.z.record(import_zod16.z.string()).optional(),
|
|
1876
|
+
body: import_zod16.z.record(import_zod16.z.any()).optional(),
|
|
1877
|
+
errorValue: import_zod16.z.any().optional().describe("Value to set if the request fails"),
|
|
1878
|
+
params: import_zod16.z.record(import_zod16.z.string(), import_zod16.z.union([import_zod16.z.string(), FieldReference])).optional(),
|
|
1879
|
+
timeout: import_zod16.z.number().default(15e3).describe("Request timeout in milliseconds")
|
|
1863
1880
|
})
|
|
1864
1881
|
}).describe("HTTP request function triggered by a button click or other event");
|
|
1865
1882
|
var SearchField = HttpField.extend({
|
|
1866
|
-
type:
|
|
1883
|
+
type: import_zod16.z.literal(FieldType.SEARCH),
|
|
1867
1884
|
configuration: SearchQuery.pick({
|
|
1868
1885
|
query: true,
|
|
1869
1886
|
limit: true,
|
|
1870
1887
|
offset: true
|
|
1871
1888
|
}).extend({
|
|
1872
1889
|
validation: ValidationConfig,
|
|
1873
|
-
indicators:
|
|
1890
|
+
indicators: import_zod16.z.object({
|
|
1874
1891
|
loading: TranslationConfig.optional().describe(
|
|
1875
1892
|
"Text to display while the search is in progress"
|
|
1876
1893
|
),
|
|
@@ -1885,7 +1902,7 @@ var SearchField = HttpField.extend({
|
|
|
1885
1902
|
),
|
|
1886
1903
|
confirmButton: TranslationConfig.optional(),
|
|
1887
1904
|
clearButton: TranslationConfig.optional(),
|
|
1888
|
-
clearModal:
|
|
1905
|
+
clearModal: import_zod16.z.object({
|
|
1889
1906
|
title: TranslationConfig.optional(),
|
|
1890
1907
|
description: TranslationConfig.optional(),
|
|
1891
1908
|
cancel: TranslationConfig.optional(),
|
|
@@ -1896,17 +1913,17 @@ var SearchField = HttpField.extend({
|
|
|
1896
1913
|
})
|
|
1897
1914
|
});
|
|
1898
1915
|
var LinkButtonField = BaseField.extend({
|
|
1899
|
-
type:
|
|
1900
|
-
configuration:
|
|
1901
|
-
url:
|
|
1916
|
+
type: import_zod16.z.literal(FieldType.LINK_BUTTON),
|
|
1917
|
+
configuration: import_zod16.z.object({
|
|
1918
|
+
url: import_zod16.z.string().describe("URL to open"),
|
|
1902
1919
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
1903
|
-
icon:
|
|
1920
|
+
icon: import_zod16.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
1904
1921
|
})
|
|
1905
1922
|
}).describe("Button that opens a link");
|
|
1906
1923
|
var VerificationStatus = BaseField.extend({
|
|
1907
|
-
type:
|
|
1924
|
+
type: import_zod16.z.literal(FieldType.VERIFICATION_STATUS),
|
|
1908
1925
|
defaultValue: VerificationStatusValue.optional(),
|
|
1909
|
-
configuration:
|
|
1926
|
+
configuration: import_zod16.z.object({
|
|
1910
1927
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
1911
1928
|
description: TranslationConfig.describe(
|
|
1912
1929
|
"Explaining text on the banner in form."
|
|
@@ -1914,38 +1931,38 @@ var VerificationStatus = BaseField.extend({
|
|
|
1914
1931
|
})
|
|
1915
1932
|
});
|
|
1916
1933
|
var QueryParamReaderField = BaseField.extend({
|
|
1917
|
-
type:
|
|
1918
|
-
configuration:
|
|
1919
|
-
pickParams:
|
|
1934
|
+
type: import_zod16.z.literal(FieldType.QUERY_PARAM_READER),
|
|
1935
|
+
configuration: import_zod16.z.object({
|
|
1936
|
+
pickParams: import_zod16.z.array(import_zod16.z.string()).describe("List of query parameters to read from the URL")
|
|
1920
1937
|
})
|
|
1921
1938
|
}).describe(
|
|
1922
1939
|
"A field that maps URL query params into form values and clears them afterward"
|
|
1923
1940
|
);
|
|
1924
1941
|
var QrReaderField = BaseField.extend({
|
|
1925
|
-
type:
|
|
1942
|
+
type: import_zod16.z.literal(FieldType.QR_READER),
|
|
1926
1943
|
defaultValue: QrReaderFieldValue.optional(),
|
|
1927
|
-
configuration:
|
|
1928
|
-
validator:
|
|
1944
|
+
configuration: import_zod16.z.object({
|
|
1945
|
+
validator: import_zod16.z.custom(
|
|
1929
1946
|
(val) => typeof val === "object" && val !== null
|
|
1930
1947
|
)
|
|
1931
1948
|
}).optional()
|
|
1932
1949
|
});
|
|
1933
1950
|
var IdReaderField = BaseField.extend({
|
|
1934
|
-
type:
|
|
1951
|
+
type: import_zod16.z.literal(FieldType.ID_READER),
|
|
1935
1952
|
defaultValue: IdReaderFieldValue.optional(),
|
|
1936
|
-
methods:
|
|
1937
|
-
|
|
1953
|
+
methods: import_zod16.z.array(
|
|
1954
|
+
import_zod16.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
1938
1955
|
)
|
|
1939
1956
|
});
|
|
1940
1957
|
var LoaderField = BaseField.extend({
|
|
1941
|
-
type:
|
|
1942
|
-
configuration:
|
|
1958
|
+
type: import_zod16.z.literal(FieldType.LOADER),
|
|
1959
|
+
configuration: import_zod16.z.object({
|
|
1943
1960
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
1944
1961
|
})
|
|
1945
1962
|
}).describe(
|
|
1946
1963
|
"A non-interactive field that indicates an in progress operation in form"
|
|
1947
1964
|
);
|
|
1948
|
-
var FieldConfig =
|
|
1965
|
+
var FieldConfig = import_zod16.z.discriminatedUnion("type", [
|
|
1949
1966
|
Address,
|
|
1950
1967
|
TextField,
|
|
1951
1968
|
NumberField,
|
|
@@ -1990,27 +2007,27 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
|
1990
2007
|
description: "Form field configuration",
|
|
1991
2008
|
ref: "FieldConfig"
|
|
1992
2009
|
});
|
|
1993
|
-
var AnyFileField =
|
|
2010
|
+
var AnyFileField = import_zod16.z.discriminatedUnion("type", [
|
|
1994
2011
|
SignatureField,
|
|
1995
2012
|
File,
|
|
1996
2013
|
FileUploadWithOptions
|
|
1997
2014
|
]);
|
|
1998
2015
|
|
|
1999
2016
|
// ../commons/src/events/FormConfig.ts
|
|
2000
|
-
var
|
|
2017
|
+
var import_zod18 = require("zod");
|
|
2001
2018
|
|
|
2002
2019
|
// ../commons/src/events/PageConfig.ts
|
|
2003
|
-
var
|
|
2020
|
+
var import_zod17 = require("zod");
|
|
2004
2021
|
var import_zod_openapi7 = require("zod-openapi");
|
|
2005
|
-
(0, import_zod_openapi7.extendZodWithOpenApi)(
|
|
2006
|
-
var PageTypes =
|
|
2007
|
-
var PageConfigBase =
|
|
2008
|
-
id:
|
|
2022
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod17.z);
|
|
2023
|
+
var PageTypes = import_zod17.z.enum(["FORM", "VERIFICATION"]);
|
|
2024
|
+
var PageConfigBase = import_zod17.z.object({
|
|
2025
|
+
id: import_zod17.z.string().describe("Unique identifier for the page"),
|
|
2009
2026
|
title: TranslationConfig.describe("Header title of the page"),
|
|
2010
|
-
requireCompletionToContinue:
|
|
2027
|
+
requireCompletionToContinue: import_zod17.z.boolean().default(false).describe(
|
|
2011
2028
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2012
2029
|
),
|
|
2013
|
-
fields:
|
|
2030
|
+
fields: import_zod17.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2014
2031
|
conditional: Conditional.optional().describe(
|
|
2015
2032
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
2016
2033
|
)
|
|
@@ -2019,13 +2036,13 @@ var PageConfigBase = import_zod16.z.object({
|
|
|
2019
2036
|
ref: "FormPageConfig"
|
|
2020
2037
|
});
|
|
2021
2038
|
var FormPageConfig = PageConfigBase.extend({
|
|
2022
|
-
type:
|
|
2039
|
+
type: import_zod17.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
|
2023
2040
|
});
|
|
2024
|
-
var VerificationActionConfig =
|
|
2025
|
-
verify:
|
|
2026
|
-
cancel:
|
|
2041
|
+
var VerificationActionConfig = import_zod17.z.object({
|
|
2042
|
+
verify: import_zod17.z.object({ label: TranslationConfig }),
|
|
2043
|
+
cancel: import_zod17.z.object({
|
|
2027
2044
|
label: TranslationConfig,
|
|
2028
|
-
confirmation:
|
|
2045
|
+
confirmation: import_zod17.z.object({
|
|
2029
2046
|
title: TranslationConfig,
|
|
2030
2047
|
body: TranslationConfig
|
|
2031
2048
|
})
|
|
@@ -2035,33 +2052,33 @@ var VerificationActionConfig = import_zod16.z.object({
|
|
|
2035
2052
|
ref: "VerificationActionConfig"
|
|
2036
2053
|
});
|
|
2037
2054
|
var VerificationPageConfig = FormPageConfig.extend({
|
|
2038
|
-
type:
|
|
2055
|
+
type: import_zod17.z.literal(PageTypes.enum.VERIFICATION),
|
|
2039
2056
|
actions: VerificationActionConfig
|
|
2040
2057
|
});
|
|
2041
|
-
var PageConfig =
|
|
2058
|
+
var PageConfig = import_zod17.z.discriminatedUnion("type", [
|
|
2042
2059
|
FormPageConfig,
|
|
2043
2060
|
VerificationPageConfig
|
|
2044
2061
|
]);
|
|
2045
2062
|
|
|
2046
2063
|
// ../commons/src/events/FormConfig.ts
|
|
2047
|
-
var DeclarationFormConfig =
|
|
2064
|
+
var DeclarationFormConfig = import_zod18.z.object({
|
|
2048
2065
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2049
|
-
pages:
|
|
2066
|
+
pages: import_zod18.z.array(FormPageConfig)
|
|
2050
2067
|
}).describe("Configuration of the declaration form.");
|
|
2051
|
-
var ActionFormConfig =
|
|
2068
|
+
var ActionFormConfig = import_zod18.z.object({
|
|
2052
2069
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2053
|
-
pages:
|
|
2070
|
+
pages: import_zod18.z.array(PageConfig)
|
|
2054
2071
|
}).describe(
|
|
2055
2072
|
"Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
|
|
2056
2073
|
);
|
|
2057
|
-
var FormConfig =
|
|
2074
|
+
var FormConfig = import_zod18.z.union([DeclarationFormConfig, ActionFormConfig]);
|
|
2058
2075
|
|
|
2059
2076
|
// ../commons/src/events/DeduplicationConfig.ts
|
|
2060
|
-
var
|
|
2077
|
+
var import_zod19 = require("zod");
|
|
2061
2078
|
var import_zod_openapi8 = require("zod-openapi");
|
|
2062
|
-
(0, import_zod_openapi8.extendZodWithOpenApi)(
|
|
2063
|
-
var FieldReference2 =
|
|
2064
|
-
var Matcher =
|
|
2079
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod19.z);
|
|
2080
|
+
var FieldReference2 = import_zod19.z.string();
|
|
2081
|
+
var Matcher = import_zod19.z.object({
|
|
2065
2082
|
/**
|
|
2066
2083
|
* Reference to the field used in matching.
|
|
2067
2084
|
*
|
|
@@ -2069,68 +2086,68 @@ var Matcher = import_zod18.z.object({
|
|
|
2069
2086
|
* be used as the origin date to calculate the distance from.
|
|
2070
2087
|
*/
|
|
2071
2088
|
fieldId: FieldReference2,
|
|
2072
|
-
options:
|
|
2073
|
-
boost:
|
|
2089
|
+
options: import_zod19.z.object({
|
|
2090
|
+
boost: import_zod19.z.number().optional()
|
|
2074
2091
|
}).optional().default({
|
|
2075
2092
|
boost: 1
|
|
2076
2093
|
})
|
|
2077
2094
|
});
|
|
2078
2095
|
var FuzzyMatcher = Matcher.extend({
|
|
2079
|
-
type:
|
|
2080
|
-
options:
|
|
2096
|
+
type: import_zod19.z.literal("fuzzy"),
|
|
2097
|
+
options: import_zod19.z.object({
|
|
2081
2098
|
/**
|
|
2082
2099
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2083
2100
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2084
2101
|
* Names of length >7 characters = 2 edits allowed
|
|
2085
2102
|
*/
|
|
2086
|
-
fuzziness:
|
|
2087
|
-
boost:
|
|
2103
|
+
fuzziness: import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).optional().default("AUTO:4,7"),
|
|
2104
|
+
boost: import_zod19.z.number().optional().default(1)
|
|
2088
2105
|
}).optional().default({
|
|
2089
2106
|
fuzziness: "AUTO:4,7",
|
|
2090
2107
|
boost: 1
|
|
2091
2108
|
})
|
|
2092
2109
|
});
|
|
2093
2110
|
var StrictMatcher = Matcher.extend({
|
|
2094
|
-
type:
|
|
2095
|
-
options:
|
|
2096
|
-
boost:
|
|
2111
|
+
type: import_zod19.z.literal("strict"),
|
|
2112
|
+
options: import_zod19.z.object({
|
|
2113
|
+
boost: import_zod19.z.number().optional().default(1),
|
|
2097
2114
|
/**
|
|
2098
2115
|
* The constant value to be present in the field for both records
|
|
2099
2116
|
*/
|
|
2100
|
-
value:
|
|
2117
|
+
value: import_zod19.z.string().optional()
|
|
2101
2118
|
}).optional().default({
|
|
2102
2119
|
boost: 1
|
|
2103
2120
|
})
|
|
2104
2121
|
});
|
|
2105
2122
|
var DateRangeMatcher = Matcher.extend({
|
|
2106
|
-
type:
|
|
2107
|
-
options:
|
|
2123
|
+
type: import_zod19.z.literal("dateRange"),
|
|
2124
|
+
options: import_zod19.z.object({
|
|
2108
2125
|
/**
|
|
2109
2126
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2110
2127
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2111
2128
|
*/
|
|
2112
|
-
pivot:
|
|
2113
|
-
days:
|
|
2114
|
-
boost:
|
|
2129
|
+
pivot: import_zod19.z.number().optional(),
|
|
2130
|
+
days: import_zod19.z.number(),
|
|
2131
|
+
boost: import_zod19.z.number().optional().default(1)
|
|
2115
2132
|
})
|
|
2116
2133
|
});
|
|
2117
|
-
var Not =
|
|
2118
|
-
type:
|
|
2134
|
+
var Not = import_zod19.z.object({
|
|
2135
|
+
type: import_zod19.z.literal("not"),
|
|
2119
2136
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2120
|
-
clause:
|
|
2137
|
+
clause: import_zod19.z.lazy(() => Clause)
|
|
2121
2138
|
});
|
|
2122
|
-
var And =
|
|
2123
|
-
type:
|
|
2139
|
+
var And = import_zod19.z.object({
|
|
2140
|
+
type: import_zod19.z.literal("and"),
|
|
2124
2141
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2125
|
-
clauses:
|
|
2142
|
+
clauses: import_zod19.z.lazy(() => Clause.array())
|
|
2126
2143
|
});
|
|
2127
|
-
var Or =
|
|
2128
|
-
type:
|
|
2144
|
+
var Or = import_zod19.z.object({
|
|
2145
|
+
type: import_zod19.z.literal("or"),
|
|
2129
2146
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2130
|
-
clauses:
|
|
2147
|
+
clauses: import_zod19.z.lazy(() => Clause.array())
|
|
2131
2148
|
});
|
|
2132
|
-
var Clause =
|
|
2133
|
-
() =>
|
|
2149
|
+
var Clause = import_zod19.z.lazy(
|
|
2150
|
+
() => import_zod19.z.discriminatedUnion("type", [
|
|
2134
2151
|
Not,
|
|
2135
2152
|
And,
|
|
2136
2153
|
Or,
|
|
@@ -2141,22 +2158,22 @@ var Clause = import_zod18.z.lazy(
|
|
|
2141
2158
|
).openapi({
|
|
2142
2159
|
ref: "Clause"
|
|
2143
2160
|
});
|
|
2144
|
-
var DeduplicationConfig =
|
|
2145
|
-
id:
|
|
2161
|
+
var DeduplicationConfig = import_zod19.z.object({
|
|
2162
|
+
id: import_zod19.z.string(),
|
|
2146
2163
|
label: TranslationConfig,
|
|
2147
2164
|
query: Clause
|
|
2148
2165
|
});
|
|
2149
2166
|
|
|
2150
2167
|
// ../commons/src/events/ActionConfig.ts
|
|
2151
2168
|
var import_zod_openapi9 = require("zod-openapi");
|
|
2152
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(
|
|
2153
|
-
var DeclarationReviewConfig =
|
|
2169
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod20.z);
|
|
2170
|
+
var DeclarationReviewConfig = import_zod20.z.object({
|
|
2154
2171
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2155
|
-
fields:
|
|
2172
|
+
fields: import_zod20.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2156
2173
|
}).describe(
|
|
2157
2174
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2158
2175
|
);
|
|
2159
|
-
var ActionConfigBase =
|
|
2176
|
+
var ActionConfigBase = import_zod20.z.object({
|
|
2160
2177
|
label: TranslationConfig.describe("Human readable description of the action")
|
|
2161
2178
|
});
|
|
2162
2179
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
@@ -2164,66 +2181,66 @@ var DeclarationActionBase = ActionConfigBase.extend({
|
|
|
2164
2181
|
deduplication: DeduplicationConfig.optional()
|
|
2165
2182
|
});
|
|
2166
2183
|
var ReadActionConfig = ActionConfigBase.merge(
|
|
2167
|
-
|
|
2168
|
-
type:
|
|
2184
|
+
import_zod20.z.object({
|
|
2185
|
+
type: import_zod20.z.literal(ActionType.READ),
|
|
2169
2186
|
review: DeclarationReviewConfig.describe(
|
|
2170
2187
|
"Configuration of the review page for read-only view."
|
|
2171
2188
|
)
|
|
2172
2189
|
})
|
|
2173
2190
|
);
|
|
2174
2191
|
var DeclareConfig = DeclarationActionBase.merge(
|
|
2175
|
-
|
|
2176
|
-
type:
|
|
2192
|
+
import_zod20.z.object({
|
|
2193
|
+
type: import_zod20.z.literal(ActionType.DECLARE)
|
|
2177
2194
|
})
|
|
2178
2195
|
);
|
|
2179
2196
|
var ValidateConfig = DeclarationActionBase.merge(
|
|
2180
|
-
|
|
2181
|
-
type:
|
|
2197
|
+
import_zod20.z.object({
|
|
2198
|
+
type: import_zod20.z.literal(ActionType.VALIDATE)
|
|
2182
2199
|
})
|
|
2183
2200
|
);
|
|
2184
2201
|
var RegisterConfig = DeclarationActionBase.merge(
|
|
2185
|
-
|
|
2186
|
-
type:
|
|
2202
|
+
import_zod20.z.object({
|
|
2203
|
+
type: import_zod20.z.literal(ActionType.REGISTER)
|
|
2187
2204
|
})
|
|
2188
2205
|
);
|
|
2189
2206
|
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2190
|
-
|
|
2191
|
-
type:
|
|
2207
|
+
import_zod20.z.object({
|
|
2208
|
+
type: import_zod20.z.literal(ActionType.REJECT)
|
|
2192
2209
|
})
|
|
2193
2210
|
);
|
|
2194
2211
|
var ArchiveConfig = ActionConfigBase.merge(
|
|
2195
|
-
|
|
2196
|
-
type:
|
|
2212
|
+
import_zod20.z.object({
|
|
2213
|
+
type: import_zod20.z.literal(ActionType.ARCHIVE)
|
|
2197
2214
|
})
|
|
2198
2215
|
);
|
|
2199
2216
|
var DeleteConfig = ActionConfigBase.merge(
|
|
2200
|
-
|
|
2201
|
-
type:
|
|
2217
|
+
import_zod20.z.object({
|
|
2218
|
+
type: import_zod20.z.literal(ActionType.DELETE)
|
|
2202
2219
|
})
|
|
2203
2220
|
);
|
|
2204
2221
|
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2205
|
-
|
|
2206
|
-
type:
|
|
2222
|
+
import_zod20.z.object({
|
|
2223
|
+
type: import_zod20.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2207
2224
|
printForm: ActionFormConfig
|
|
2208
2225
|
})
|
|
2209
2226
|
);
|
|
2210
2227
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2211
|
-
|
|
2212
|
-
type:
|
|
2228
|
+
import_zod20.z.object({
|
|
2229
|
+
type: import_zod20.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2213
2230
|
correctionForm: ActionFormConfig
|
|
2214
2231
|
})
|
|
2215
2232
|
);
|
|
2216
2233
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2217
|
-
|
|
2218
|
-
type:
|
|
2234
|
+
import_zod20.z.object({
|
|
2235
|
+
type: import_zod20.z.literal(ActionType.REJECT_CORRECTION)
|
|
2219
2236
|
})
|
|
2220
2237
|
);
|
|
2221
2238
|
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2222
|
-
|
|
2223
|
-
type:
|
|
2239
|
+
import_zod20.z.object({
|
|
2240
|
+
type: import_zod20.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2224
2241
|
})
|
|
2225
2242
|
);
|
|
2226
|
-
var ActionConfig =
|
|
2243
|
+
var ActionConfig = import_zod20.z.discriminatedUnion("type", [
|
|
2227
2244
|
/*
|
|
2228
2245
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2229
2246
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -2244,87 +2261,87 @@ var ActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
|
2244
2261
|
]).describe(
|
|
2245
2262
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2246
2263
|
).openapi({ ref: "ActionConfig" });
|
|
2247
|
-
var DeclarationActionConfig =
|
|
2264
|
+
var DeclarationActionConfig = import_zod20.z.discriminatedUnion("type", [
|
|
2248
2265
|
DeclareConfig,
|
|
2249
2266
|
ValidateConfig,
|
|
2250
2267
|
RegisterConfig
|
|
2251
2268
|
]);
|
|
2252
2269
|
|
|
2253
2270
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2254
|
-
var
|
|
2255
|
-
var FontFamily =
|
|
2256
|
-
normal:
|
|
2257
|
-
bold:
|
|
2258
|
-
italics:
|
|
2259
|
-
bolditalics:
|
|
2271
|
+
var import_zod21 = require("zod");
|
|
2272
|
+
var FontFamily = import_zod21.z.object({
|
|
2273
|
+
normal: import_zod21.z.string(),
|
|
2274
|
+
bold: import_zod21.z.string(),
|
|
2275
|
+
italics: import_zod21.z.string(),
|
|
2276
|
+
bolditalics: import_zod21.z.string()
|
|
2260
2277
|
});
|
|
2261
|
-
var CertificateConfig =
|
|
2262
|
-
id:
|
|
2263
|
-
event:
|
|
2264
|
-
isV2Template:
|
|
2278
|
+
var CertificateConfig = import_zod21.z.object({
|
|
2279
|
+
id: import_zod21.z.string(),
|
|
2280
|
+
event: import_zod21.z.string(),
|
|
2281
|
+
isV2Template: import_zod21.z.boolean().optional(),
|
|
2265
2282
|
label: TranslationConfig,
|
|
2266
|
-
isDefault:
|
|
2267
|
-
fee:
|
|
2268
|
-
onTime:
|
|
2269
|
-
late:
|
|
2270
|
-
delayed:
|
|
2283
|
+
isDefault: import_zod21.z.boolean(),
|
|
2284
|
+
fee: import_zod21.z.object({
|
|
2285
|
+
onTime: import_zod21.z.number(),
|
|
2286
|
+
late: import_zod21.z.number(),
|
|
2287
|
+
delayed: import_zod21.z.number()
|
|
2271
2288
|
}),
|
|
2272
|
-
svgUrl:
|
|
2273
|
-
fonts:
|
|
2274
|
-
conditionals:
|
|
2289
|
+
svgUrl: import_zod21.z.string(),
|
|
2290
|
+
fonts: import_zod21.z.record(FontFamily).optional(),
|
|
2291
|
+
conditionals: import_zod21.z.array(ShowConditional).optional()
|
|
2275
2292
|
});
|
|
2276
2293
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2277
|
-
hash:
|
|
2278
|
-
svg:
|
|
2294
|
+
hash: import_zod21.z.string().optional(),
|
|
2295
|
+
svg: import_zod21.z.string()
|
|
2279
2296
|
});
|
|
2280
2297
|
|
|
2281
2298
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2282
|
-
var
|
|
2283
|
-
var LanguageConfig =
|
|
2284
|
-
lang:
|
|
2299
|
+
var import_zod22 = require("zod");
|
|
2300
|
+
var LanguageConfig = import_zod22.z.object({
|
|
2301
|
+
lang: import_zod22.z.string(),
|
|
2285
2302
|
/**
|
|
2286
2303
|
* client.csv contents
|
|
2287
2304
|
*/
|
|
2288
|
-
messages:
|
|
2305
|
+
messages: import_zod22.z.record(import_zod22.z.string())
|
|
2289
2306
|
});
|
|
2290
2307
|
|
|
2291
2308
|
// ../commons/src/events/EventConfig.ts
|
|
2292
|
-
var
|
|
2309
|
+
var import_zod27 = require("zod");
|
|
2293
2310
|
|
|
2294
2311
|
// ../commons/src/events/SummaryConfig.ts
|
|
2295
|
-
var
|
|
2296
|
-
var BaseField2 =
|
|
2312
|
+
var import_zod23 = require("zod");
|
|
2313
|
+
var BaseField2 = import_zod23.z.object({
|
|
2297
2314
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2298
2315
|
"Default message displayed when the field value is empty."
|
|
2299
2316
|
),
|
|
2300
|
-
conditionals:
|
|
2317
|
+
conditionals: import_zod23.z.array(ShowConditional).default([]).optional()
|
|
2301
2318
|
});
|
|
2302
2319
|
var ReferenceField = BaseField2.extend({
|
|
2303
|
-
fieldId:
|
|
2320
|
+
fieldId: import_zod23.z.string(),
|
|
2304
2321
|
label: TranslationConfig.optional().describe(
|
|
2305
2322
|
"Overrides the default label from the referenced field when provided."
|
|
2306
2323
|
)
|
|
2307
2324
|
}).describe("Field referencing existing event data by field ID.");
|
|
2308
2325
|
var Field = BaseField2.extend({
|
|
2309
|
-
id:
|
|
2326
|
+
id: import_zod23.z.string().describe("Identifier of the summary field."),
|
|
2310
2327
|
value: TranslationConfig.describe(
|
|
2311
2328
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2312
2329
|
),
|
|
2313
2330
|
label: TranslationConfig
|
|
2314
2331
|
}).describe("Custom field defined for the summary view.");
|
|
2315
|
-
var SummaryConfig =
|
|
2316
|
-
fields:
|
|
2332
|
+
var SummaryConfig = import_zod23.z.object({
|
|
2333
|
+
fields: import_zod23.z.array(import_zod23.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2317
2334
|
}).describe("Configuration of the event summary section.");
|
|
2318
2335
|
|
|
2319
2336
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2320
|
-
var
|
|
2321
|
-
var MatchType =
|
|
2322
|
-
var BaseField3 =
|
|
2323
|
-
config:
|
|
2337
|
+
var import_zod24 = require("zod");
|
|
2338
|
+
var MatchType = import_zod24.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2339
|
+
var BaseField3 = import_zod24.z.object({
|
|
2340
|
+
config: import_zod24.z.object({
|
|
2324
2341
|
type: MatchType.describe(
|
|
2325
2342
|
"Determines the search type of field. How to match value."
|
|
2326
2343
|
),
|
|
2327
|
-
searchFields:
|
|
2344
|
+
searchFields: import_zod24.z.array(import_zod24.z.string()).optional().describe(
|
|
2328
2345
|
`
|
|
2329
2346
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2330
2347
|
All specified fields will be combined using OR logic.
|
|
@@ -2334,7 +2351,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2334
2351
|
`
|
|
2335
2352
|
)
|
|
2336
2353
|
}),
|
|
2337
|
-
type:
|
|
2354
|
+
type: import_zod24.z.nativeEnum(FieldType).optional().describe(
|
|
2338
2355
|
`
|
|
2339
2356
|
Explicitly specify the field type for searchFields.
|
|
2340
2357
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2348,7 +2365,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2348
2365
|
This is required when searchFields is defined.
|
|
2349
2366
|
`
|
|
2350
2367
|
),
|
|
2351
|
-
options:
|
|
2368
|
+
options: import_zod24.z.array(SelectOption).optional(),
|
|
2352
2369
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2353
2370
|
`
|
|
2354
2371
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2369,7 +2386,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2369
2386
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2370
2387
|
`
|
|
2371
2388
|
),
|
|
2372
|
-
conditionals:
|
|
2389
|
+
conditionals: import_zod24.z.array(FieldConditional).default([]).optional().describe(
|
|
2373
2390
|
`
|
|
2374
2391
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2375
2392
|
|
|
@@ -2383,20 +2400,20 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2383
2400
|
are always rendered in the advanced search form.
|
|
2384
2401
|
`
|
|
2385
2402
|
),
|
|
2386
|
-
validations:
|
|
2403
|
+
validations: import_zod24.z.array(ValidationConfig).default([]).optional().describe(
|
|
2387
2404
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2388
2405
|
)
|
|
2389
2406
|
});
|
|
2390
|
-
var SearchQueryParams =
|
|
2391
|
-
eventType:
|
|
2407
|
+
var SearchQueryParams = import_zod24.z.object({
|
|
2408
|
+
eventType: import_zod24.z.string().optional().describe(
|
|
2392
2409
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2393
2410
|
)
|
|
2394
2411
|
}).catchall(FieldValue);
|
|
2395
2412
|
var FieldConfigSchema = BaseField3.extend({
|
|
2396
|
-
fieldId:
|
|
2397
|
-
fieldType:
|
|
2413
|
+
fieldId: import_zod24.z.string(),
|
|
2414
|
+
fieldType: import_zod24.z.literal("field")
|
|
2398
2415
|
});
|
|
2399
|
-
var EventFieldIdInput =
|
|
2416
|
+
var EventFieldIdInput = import_zod24.z.enum([
|
|
2400
2417
|
"trackingId",
|
|
2401
2418
|
"status",
|
|
2402
2419
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2405,7 +2422,7 @@ var EventFieldIdInput = import_zod23.z.enum([
|
|
|
2405
2422
|
"updatedAt"
|
|
2406
2423
|
]);
|
|
2407
2424
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2408
|
-
var EventFieldId =
|
|
2425
|
+
var EventFieldId = import_zod24.z.enum([
|
|
2409
2426
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2410
2427
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2411
2428
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2415,29 +2432,29 @@ var EventFieldId = import_zod23.z.enum([
|
|
|
2415
2432
|
]);
|
|
2416
2433
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2417
2434
|
fieldId: EventFieldId,
|
|
2418
|
-
fieldType:
|
|
2435
|
+
fieldType: import_zod24.z.literal("event")
|
|
2419
2436
|
});
|
|
2420
|
-
var AdvancedSearchField =
|
|
2437
|
+
var AdvancedSearchField = import_zod24.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2421
2438
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2422
2439
|
if (!data.label) {
|
|
2423
2440
|
ctx.addIssue({
|
|
2424
|
-
code:
|
|
2441
|
+
code: import_zod24.z.ZodIssueCode.custom,
|
|
2425
2442
|
message: "label is required when config.searchFields is defined.",
|
|
2426
2443
|
path: ["label"]
|
|
2427
2444
|
});
|
|
2428
2445
|
}
|
|
2429
2446
|
if (!data.type) {
|
|
2430
2447
|
ctx.addIssue({
|
|
2431
|
-
code:
|
|
2448
|
+
code: import_zod24.z.ZodIssueCode.custom,
|
|
2432
2449
|
message: "type is required when config.searchFields is defined.",
|
|
2433
2450
|
path: ["type"]
|
|
2434
2451
|
});
|
|
2435
2452
|
}
|
|
2436
2453
|
}
|
|
2437
2454
|
});
|
|
2438
|
-
var AdvancedSearchConfig =
|
|
2455
|
+
var AdvancedSearchConfig = import_zod24.z.object({
|
|
2439
2456
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2440
|
-
fields:
|
|
2457
|
+
fields: import_zod24.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2441
2458
|
});
|
|
2442
2459
|
|
|
2443
2460
|
// ../commons/src/events/utils.ts
|
|
@@ -2446,11 +2463,11 @@ var import_lodash = require("lodash");
|
|
|
2446
2463
|
// ../commons/src/conditionals/validate.ts
|
|
2447
2464
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2448
2465
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2449
|
-
var
|
|
2466
|
+
var import_zod26 = require("zod");
|
|
2450
2467
|
var import_date_fns = require("date-fns");
|
|
2451
2468
|
|
|
2452
2469
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2453
|
-
var
|
|
2470
|
+
var import_zod25 = require("zod");
|
|
2454
2471
|
|
|
2455
2472
|
// ../commons/src/conditionals/validate.ts
|
|
2456
2473
|
var ajv = new import__.default({
|
|
@@ -2459,9 +2476,9 @@ var ajv = new import__.default({
|
|
|
2459
2476
|
strict: false
|
|
2460
2477
|
// Allow minContains and other newer features
|
|
2461
2478
|
});
|
|
2462
|
-
var DataContext =
|
|
2463
|
-
rootData:
|
|
2464
|
-
$leafAdminStructureLocationIds:
|
|
2479
|
+
var DataContext = import_zod26.z.object({
|
|
2480
|
+
rootData: import_zod26.z.object({
|
|
2481
|
+
$leafAdminStructureLocationIds: import_zod26.z.array(import_zod26.z.object({ id: UUID }))
|
|
2465
2482
|
})
|
|
2466
2483
|
});
|
|
2467
2484
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2538,12 +2555,12 @@ ajv.addKeyword({
|
|
|
2538
2555
|
});
|
|
2539
2556
|
|
|
2540
2557
|
// ../commons/src/utils.ts
|
|
2541
|
-
var
|
|
2542
|
-
var FullNameV1 =
|
|
2543
|
-
|
|
2544
|
-
use:
|
|
2545
|
-
family:
|
|
2546
|
-
given:
|
|
2558
|
+
var z27 = __toESM(require("zod"));
|
|
2559
|
+
var FullNameV1 = z27.array(
|
|
2560
|
+
z27.object({
|
|
2561
|
+
use: z27.string(),
|
|
2562
|
+
family: z27.string(),
|
|
2563
|
+
given: z27.array(z27.string())
|
|
2547
2564
|
})
|
|
2548
2565
|
);
|
|
2549
2566
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2599,9 +2616,9 @@ var EXCLUDED_ACTIONS = [
|
|
|
2599
2616
|
|
|
2600
2617
|
// ../commons/src/events/EventConfig.ts
|
|
2601
2618
|
var import_zod_openapi10 = require("zod-openapi");
|
|
2602
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(
|
|
2603
|
-
var EventConfig =
|
|
2604
|
-
id:
|
|
2619
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod27.z);
|
|
2620
|
+
var EventConfig = import_zod27.z.object({
|
|
2621
|
+
id: import_zod27.z.string().describe(
|
|
2605
2622
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2606
2623
|
),
|
|
2607
2624
|
dateOfEvent: FieldReference.optional().describe(
|
|
@@ -2619,13 +2636,13 @@ var EventConfig = import_zod26.z.object({
|
|
|
2619
2636
|
label: TranslationConfig.describe(
|
|
2620
2637
|
"Human-readable label for the event type."
|
|
2621
2638
|
),
|
|
2622
|
-
actions:
|
|
2639
|
+
actions: import_zod27.z.array(ActionConfig).describe(
|
|
2623
2640
|
"Configuration of system-defined actions associated with the event."
|
|
2624
2641
|
),
|
|
2625
2642
|
declaration: DeclarationFormConfig.describe(
|
|
2626
2643
|
"Configuration of the form used to gather event data."
|
|
2627
2644
|
),
|
|
2628
|
-
advancedSearch:
|
|
2645
|
+
advancedSearch: import_zod27.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2629
2646
|
"Configuration of fields available in the advanced search feature."
|
|
2630
2647
|
)
|
|
2631
2648
|
}).superRefine((event2, ctx) => {
|
|
@@ -2682,13 +2699,8 @@ var EventConfig = import_zod26.z.object({
|
|
|
2682
2699
|
ref: "EventConfig"
|
|
2683
2700
|
}).describe("Configuration defining an event type.");
|
|
2684
2701
|
|
|
2685
|
-
// ../commons/src/events/EventConfigInput.ts
|
|
2686
|
-
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
2687
|
-
var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
2688
|
-
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2689
|
-
|
|
2690
2702
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2691
|
-
var
|
|
2703
|
+
var import_zod31 = require("zod");
|
|
2692
2704
|
|
|
2693
2705
|
// ../commons/src/conditionals/conditionals.ts
|
|
2694
2706
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2757,6 +2769,7 @@ function wrapToPathOptional(condition, path) {
|
|
|
2757
2769
|
};
|
|
2758
2770
|
}, condition);
|
|
2759
2771
|
}
|
|
2772
|
+
var now = Object.assign(todayDateTimeValueSerializer, {});
|
|
2760
2773
|
var user = Object.assign(userSerializer, {
|
|
2761
2774
|
hasScope: (scope) => defineConditional({
|
|
2762
2775
|
type: "object",
|
|
@@ -3435,17 +3448,17 @@ var event = Object.assign(eventFn, {
|
|
|
3435
3448
|
});
|
|
3436
3449
|
|
|
3437
3450
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3438
|
-
var
|
|
3451
|
+
var import_zod28 = require("zod");
|
|
3439
3452
|
var WorkqueueColumnKeysArray = [
|
|
3440
3453
|
...EventMetadataKeysArray,
|
|
3441
3454
|
"title",
|
|
3442
3455
|
"outbox"
|
|
3443
3456
|
];
|
|
3444
|
-
var WorkqueueColumnKeys =
|
|
3445
|
-
var WorkqueueColumnValue =
|
|
3457
|
+
var WorkqueueColumnKeys = import_zod28.z.enum(WorkqueueColumnKeysArray);
|
|
3458
|
+
var WorkqueueColumnValue = import_zod28.z.object({
|
|
3446
3459
|
$event: WorkqueueColumnKeys
|
|
3447
3460
|
});
|
|
3448
|
-
var WorkqueueColumn =
|
|
3461
|
+
var WorkqueueColumn = import_zod28.z.object({
|
|
3449
3462
|
label: TranslationConfig,
|
|
3450
3463
|
value: WorkqueueColumnValue
|
|
3451
3464
|
});
|
|
@@ -3456,57 +3469,57 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3456
3469
|
}
|
|
3457
3470
|
|
|
3458
3471
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3459
|
-
var
|
|
3460
|
-
var SerializableExact =
|
|
3461
|
-
type:
|
|
3462
|
-
term:
|
|
3472
|
+
var import_zod29 = require("zod");
|
|
3473
|
+
var SerializableExact = import_zod29.z.object({
|
|
3474
|
+
type: import_zod29.z.literal("exact"),
|
|
3475
|
+
term: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
3463
3476
|
});
|
|
3464
|
-
var SerializableWithin =
|
|
3465
|
-
type:
|
|
3466
|
-
location:
|
|
3477
|
+
var SerializableWithin = import_zod29.z.object({
|
|
3478
|
+
type: import_zod29.z.literal("within"),
|
|
3479
|
+
location: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
3467
3480
|
});
|
|
3468
|
-
var SerializedQueryExpression =
|
|
3469
|
-
eventType:
|
|
3470
|
-
status:
|
|
3471
|
-
createdAt:
|
|
3472
|
-
updatedAt:
|
|
3473
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3474
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3475
|
-
|
|
3481
|
+
var SerializedQueryExpression = import_zod29.z.object({
|
|
3482
|
+
eventType: import_zod29.z.string(),
|
|
3483
|
+
status: import_zod29.z.optional(import_zod29.z.union([AnyOfStatus, ExactStatus])),
|
|
3484
|
+
createdAt: import_zod29.z.optional(DateCondition),
|
|
3485
|
+
updatedAt: import_zod29.z.optional(DateCondition),
|
|
3486
|
+
"legalStatuses.REGISTERED.createdAt": import_zod29.z.optional(DateCondition),
|
|
3487
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod29.z.optional(
|
|
3488
|
+
import_zod29.z.union([Within, Exact])
|
|
3476
3489
|
),
|
|
3477
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3478
|
-
createdAtLocation:
|
|
3479
|
-
|
|
3490
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod29.z.optional(Exact),
|
|
3491
|
+
createdAtLocation: import_zod29.z.optional(
|
|
3492
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
3480
3493
|
),
|
|
3481
|
-
updatedAtLocation:
|
|
3482
|
-
|
|
3494
|
+
updatedAtLocation: import_zod29.z.optional(
|
|
3495
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
3483
3496
|
),
|
|
3484
|
-
assignedTo:
|
|
3485
|
-
createdBy:
|
|
3497
|
+
assignedTo: import_zod29.z.optional(SerializableExact),
|
|
3498
|
+
createdBy: import_zod29.z.optional(SerializableExact),
|
|
3486
3499
|
createdByUserType: ExactUserType,
|
|
3487
|
-
updatedBy:
|
|
3488
|
-
trackingId:
|
|
3489
|
-
flags:
|
|
3500
|
+
updatedBy: import_zod29.z.optional(SerializableExact),
|
|
3501
|
+
trackingId: import_zod29.z.optional(Exact),
|
|
3502
|
+
flags: import_zod29.z.optional(ContainsFlags),
|
|
3490
3503
|
data: QueryInput
|
|
3491
3504
|
}).partial();
|
|
3492
|
-
var Or2 =
|
|
3493
|
-
type:
|
|
3494
|
-
clauses:
|
|
3505
|
+
var Or2 = import_zod29.z.object({
|
|
3506
|
+
type: import_zod29.z.literal("or"),
|
|
3507
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
3495
3508
|
});
|
|
3496
|
-
var And2 =
|
|
3497
|
-
type:
|
|
3498
|
-
clauses:
|
|
3509
|
+
var And2 = import_zod29.z.object({
|
|
3510
|
+
type: import_zod29.z.literal("and"),
|
|
3511
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
3499
3512
|
});
|
|
3500
|
-
var CountryConfigQueryType =
|
|
3501
|
-
var CountryConfigQueryInputType =
|
|
3513
|
+
var CountryConfigQueryType = import_zod29.z.discriminatedUnion("type", [And2, Or2]);
|
|
3514
|
+
var CountryConfigQueryInputType = import_zod29.z.union([
|
|
3502
3515
|
SerializedQueryExpression,
|
|
3503
3516
|
And2,
|
|
3504
3517
|
Or2
|
|
3505
3518
|
]);
|
|
3506
3519
|
|
|
3507
3520
|
// ../commons/src/icons.ts
|
|
3508
|
-
var
|
|
3509
|
-
var AvailableIcons =
|
|
3521
|
+
var import_zod30 = require("zod");
|
|
3522
|
+
var AvailableIcons = import_zod30.z.enum([
|
|
3510
3523
|
"Archived",
|
|
3511
3524
|
"Assigned",
|
|
3512
3525
|
"Certified",
|
|
@@ -3627,23 +3640,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3627
3640
|
value: event.field("updatedAt")
|
|
3628
3641
|
}
|
|
3629
3642
|
]);
|
|
3630
|
-
var WorkqueueActionsWithDefault =
|
|
3643
|
+
var WorkqueueActionsWithDefault = import_zod31.z.enum([
|
|
3631
3644
|
...workqueueActions.options,
|
|
3632
3645
|
"DEFAULT"
|
|
3633
3646
|
]);
|
|
3634
|
-
var WorkqueueConfig =
|
|
3635
|
-
slug:
|
|
3647
|
+
var WorkqueueConfig = import_zod31.z.object({
|
|
3648
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
3636
3649
|
name: TranslationConfig.describe(
|
|
3637
3650
|
"Title of the workflow (both in navigation and on the page)"
|
|
3638
3651
|
),
|
|
3639
3652
|
query: CountryConfigQueryType,
|
|
3640
|
-
actions:
|
|
3641
|
-
|
|
3653
|
+
actions: import_zod31.z.array(
|
|
3654
|
+
import_zod31.z.object({
|
|
3642
3655
|
type: WorkqueueActionsWithDefault,
|
|
3643
|
-
conditionals:
|
|
3656
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3644
3657
|
})
|
|
3645
3658
|
),
|
|
3646
|
-
columns:
|
|
3659
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3647
3660
|
icon: AvailableIcons,
|
|
3648
3661
|
emptyMessage: TranslationConfig.optional()
|
|
3649
3662
|
}).describe("Configuration for workqueue.");
|
|
@@ -3651,26 +3664,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3651
3664
|
query: true,
|
|
3652
3665
|
columns: true
|
|
3653
3666
|
});
|
|
3654
|
-
var WorkqueueConfigInput =
|
|
3655
|
-
slug:
|
|
3667
|
+
var WorkqueueConfigInput = import_zod31.z.object({
|
|
3668
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
3656
3669
|
name: TranslationConfig.describe(
|
|
3657
3670
|
"Title of the workflow (both in navigation and on the page)"
|
|
3658
3671
|
),
|
|
3659
3672
|
query: CountryConfigQueryInputType,
|
|
3660
|
-
actions:
|
|
3661
|
-
|
|
3673
|
+
actions: import_zod31.z.array(
|
|
3674
|
+
import_zod31.z.object({
|
|
3662
3675
|
type: WorkqueueActionsWithDefault,
|
|
3663
|
-
conditionals:
|
|
3676
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3664
3677
|
})
|
|
3665
3678
|
),
|
|
3666
|
-
columns:
|
|
3679
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3667
3680
|
icon: AvailableIcons,
|
|
3668
3681
|
emptyMessage: TranslationConfig.optional()
|
|
3669
3682
|
});
|
|
3670
|
-
var WorkqueueCountInput =
|
|
3671
|
-
|
|
3683
|
+
var WorkqueueCountInput = import_zod31.z.array(
|
|
3684
|
+
import_zod31.z.object({ slug: import_zod31.z.string(), query: QueryType })
|
|
3672
3685
|
);
|
|
3673
|
-
var WorkqueueCountOutput =
|
|
3686
|
+
var WorkqueueCountOutput = import_zod31.z.record(import_zod31.z.string(), import_zod31.z.number());
|
|
3674
3687
|
|
|
3675
3688
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3676
3689
|
var defaultWorkqueueColumns = [
|
|
@@ -3693,45 +3706,45 @@ var defaultWorkqueueColumns = [
|
|
|
3693
3706
|
];
|
|
3694
3707
|
|
|
3695
3708
|
// ../commons/src/events/Draft.ts
|
|
3696
|
-
var
|
|
3709
|
+
var import_zod33 = require("zod");
|
|
3697
3710
|
|
|
3698
3711
|
// ../commons/src/events/ActionInput.ts
|
|
3699
|
-
var
|
|
3712
|
+
var import_zod32 = require("zod");
|
|
3700
3713
|
var import_zod_openapi11 = require("zod-openapi");
|
|
3701
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(
|
|
3702
|
-
var BaseActionInput =
|
|
3714
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod32.z);
|
|
3715
|
+
var BaseActionInput = import_zod32.z.object({
|
|
3703
3716
|
eventId: UUID,
|
|
3704
|
-
transactionId:
|
|
3717
|
+
transactionId: import_zod32.z.string(),
|
|
3705
3718
|
declaration: ActionUpdate.default({}),
|
|
3706
3719
|
annotation: ActionUpdate.optional(),
|
|
3707
3720
|
originalActionId: UUID.optional(),
|
|
3708
3721
|
// should not be part of base action.
|
|
3709
|
-
keepAssignment:
|
|
3722
|
+
keepAssignment: import_zod32.z.boolean().optional(),
|
|
3710
3723
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3711
3724
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3712
3725
|
"A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
|
|
3713
3726
|
)
|
|
3714
3727
|
});
|
|
3715
3728
|
var CreateActionInput = BaseActionInput.merge(
|
|
3716
|
-
|
|
3717
|
-
type:
|
|
3729
|
+
import_zod32.z.object({
|
|
3730
|
+
type: import_zod32.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3718
3731
|
createdAtLocation: CreatedAtLocation
|
|
3719
3732
|
})
|
|
3720
3733
|
);
|
|
3721
3734
|
var RegisterActionInput = BaseActionInput.merge(
|
|
3722
|
-
|
|
3723
|
-
type:
|
|
3724
|
-
registrationNumber:
|
|
3735
|
+
import_zod32.z.object({
|
|
3736
|
+
type: import_zod32.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3737
|
+
registrationNumber: import_zod32.z.string().optional()
|
|
3725
3738
|
})
|
|
3726
3739
|
).strict();
|
|
3727
3740
|
var ValidateActionInput = BaseActionInput.merge(
|
|
3728
|
-
|
|
3729
|
-
type:
|
|
3741
|
+
import_zod32.z.object({
|
|
3742
|
+
type: import_zod32.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3730
3743
|
})
|
|
3731
3744
|
);
|
|
3732
3745
|
var NotifyActionInput = BaseActionInput.merge(
|
|
3733
|
-
|
|
3734
|
-
type:
|
|
3746
|
+
import_zod32.z.object({
|
|
3747
|
+
type: import_zod32.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3735
3748
|
})
|
|
3736
3749
|
).openapi({
|
|
3737
3750
|
default: {
|
|
@@ -3743,86 +3756,86 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
3743
3756
|
}
|
|
3744
3757
|
});
|
|
3745
3758
|
var DeclareActionInput = BaseActionInput.merge(
|
|
3746
|
-
|
|
3747
|
-
type:
|
|
3759
|
+
import_zod32.z.object({
|
|
3760
|
+
type: import_zod32.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3748
3761
|
})
|
|
3749
3762
|
);
|
|
3750
3763
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3764
|
+
import_zod32.z.object({
|
|
3765
|
+
type: import_zod32.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3753
3766
|
content: PrintContent.optional()
|
|
3754
3767
|
})
|
|
3755
3768
|
);
|
|
3756
3769
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3757
|
-
|
|
3758
|
-
type:
|
|
3770
|
+
import_zod32.z.object({
|
|
3771
|
+
type: import_zod32.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3759
3772
|
content: ReasonContent
|
|
3760
3773
|
})
|
|
3761
3774
|
);
|
|
3762
3775
|
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3763
|
-
|
|
3764
|
-
type:
|
|
3765
|
-
content:
|
|
3766
|
-
duplicates:
|
|
3776
|
+
import_zod32.z.object({
|
|
3777
|
+
type: import_zod32.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3778
|
+
content: import_zod32.z.object({
|
|
3779
|
+
duplicates: import_zod32.z.array(PotentialDuplicate)
|
|
3767
3780
|
})
|
|
3768
3781
|
})
|
|
3769
3782
|
);
|
|
3770
3783
|
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3771
|
-
|
|
3772
|
-
type:
|
|
3773
|
-
content:
|
|
3784
|
+
import_zod32.z.object({
|
|
3785
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3786
|
+
content: import_zod32.z.object({
|
|
3774
3787
|
duplicateOf: UUID
|
|
3775
3788
|
}).optional()
|
|
3776
3789
|
})
|
|
3777
3790
|
);
|
|
3778
3791
|
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3779
|
-
|
|
3780
|
-
type:
|
|
3792
|
+
import_zod32.z.object({
|
|
3793
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3781
3794
|
})
|
|
3782
3795
|
);
|
|
3783
3796
|
var ArchiveActionInput = BaseActionInput.merge(
|
|
3784
|
-
|
|
3785
|
-
type:
|
|
3797
|
+
import_zod32.z.object({
|
|
3798
|
+
type: import_zod32.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3786
3799
|
content: ReasonContent
|
|
3787
3800
|
})
|
|
3788
3801
|
);
|
|
3789
3802
|
var AssignActionInput = BaseActionInput.merge(
|
|
3790
|
-
|
|
3791
|
-
type:
|
|
3792
|
-
assignedTo:
|
|
3803
|
+
import_zod32.z.object({
|
|
3804
|
+
type: import_zod32.z.literal(ActionType.ASSIGN),
|
|
3805
|
+
assignedTo: import_zod32.z.string()
|
|
3793
3806
|
})
|
|
3794
3807
|
);
|
|
3795
3808
|
var UnassignActionInput = BaseActionInput.merge(
|
|
3796
|
-
|
|
3797
|
-
type:
|
|
3798
|
-
assignedTo:
|
|
3809
|
+
import_zod32.z.object({
|
|
3810
|
+
type: import_zod32.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3811
|
+
assignedTo: import_zod32.z.literal(null).default(null)
|
|
3799
3812
|
})
|
|
3800
3813
|
);
|
|
3801
3814
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3802
|
-
|
|
3803
|
-
type:
|
|
3815
|
+
import_zod32.z.object({
|
|
3816
|
+
type: import_zod32.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3804
3817
|
})
|
|
3805
3818
|
);
|
|
3806
3819
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3807
|
-
|
|
3808
|
-
requestId:
|
|
3809
|
-
type:
|
|
3820
|
+
import_zod32.z.object({
|
|
3821
|
+
requestId: import_zod32.z.string(),
|
|
3822
|
+
type: import_zod32.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3810
3823
|
content: ReasonContent
|
|
3811
3824
|
})
|
|
3812
3825
|
);
|
|
3813
3826
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3814
|
-
|
|
3815
|
-
requestId:
|
|
3816
|
-
type:
|
|
3827
|
+
import_zod32.z.object({
|
|
3828
|
+
requestId: import_zod32.z.string(),
|
|
3829
|
+
type: import_zod32.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3817
3830
|
})
|
|
3818
3831
|
);
|
|
3819
3832
|
var ReadActionInput = BaseActionInput.merge(
|
|
3820
|
-
|
|
3821
|
-
type:
|
|
3833
|
+
import_zod32.z.object({
|
|
3834
|
+
type: import_zod32.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3822
3835
|
})
|
|
3823
3836
|
);
|
|
3824
|
-
var DeleteActionInput =
|
|
3825
|
-
var ActionInput =
|
|
3837
|
+
var DeleteActionInput = import_zod32.z.object({ eventId: UUID });
|
|
3838
|
+
var ActionInput = import_zod32.z.discriminatedUnion("type", [
|
|
3826
3839
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3827
3840
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3828
3841
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
@@ -3857,11 +3870,11 @@ var ActionInput = import_zod31.z.discriminatedUnion("type", [
|
|
|
3857
3870
|
});
|
|
3858
3871
|
|
|
3859
3872
|
// ../commons/src/events/Draft.ts
|
|
3860
|
-
var Draft =
|
|
3873
|
+
var Draft = import_zod33.z.object({
|
|
3861
3874
|
id: UUID,
|
|
3862
3875
|
eventId: UUID,
|
|
3863
|
-
transactionId:
|
|
3864
|
-
createdAt:
|
|
3876
|
+
transactionId: import_zod33.z.string(),
|
|
3877
|
+
createdAt: import_zod33.z.string().datetime(),
|
|
3865
3878
|
action: ActionBase.extend({
|
|
3866
3879
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
3867
3880
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -3870,7 +3883,7 @@ var Draft = import_zod32.z.object({
|
|
|
3870
3883
|
);
|
|
3871
3884
|
var DraftInput = BaseActionInput.extend({
|
|
3872
3885
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3873
|
-
status:
|
|
3886
|
+
status: import_zod33.z.enum([
|
|
3874
3887
|
ActionStatus.Requested,
|
|
3875
3888
|
ActionStatus.Accepted,
|
|
3876
3889
|
ActionStatus.Rejected
|
|
@@ -3878,26 +3891,26 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3878
3891
|
});
|
|
3879
3892
|
|
|
3880
3893
|
// ../commons/src/events/EventInput.ts
|
|
3881
|
-
var
|
|
3894
|
+
var import_zod34 = require("zod");
|
|
3882
3895
|
var import_uuid10 = require("uuid");
|
|
3883
|
-
var EventInput =
|
|
3884
|
-
transactionId:
|
|
3885
|
-
type:
|
|
3896
|
+
var EventInput = import_zod34.z.object({
|
|
3897
|
+
transactionId: import_zod34.z.string(),
|
|
3898
|
+
type: import_zod34.z.string()
|
|
3886
3899
|
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3887
3900
|
|
|
3888
3901
|
// ../commons/src/events/EventDocument.ts
|
|
3889
|
-
var
|
|
3902
|
+
var import_zod35 = require("zod");
|
|
3890
3903
|
var import_zod_openapi12 = require("zod-openapi");
|
|
3891
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(
|
|
3892
|
-
var EventDocument =
|
|
3904
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod35.z);
|
|
3905
|
+
var EventDocument = import_zod35.z.object({
|
|
3893
3906
|
id: UUID.describe("Unique identifier of the event."),
|
|
3894
|
-
type:
|
|
3895
|
-
createdAt:
|
|
3896
|
-
updatedAt:
|
|
3907
|
+
type: import_zod35.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3908
|
+
createdAt: import_zod35.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3909
|
+
updatedAt: import_zod35.z.string().datetime().describe(
|
|
3897
3910
|
"Timestamp of the last update, excluding changes from actions."
|
|
3898
3911
|
),
|
|
3899
|
-
actions:
|
|
3900
|
-
trackingId:
|
|
3912
|
+
actions: import_zod35.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3913
|
+
trackingId: import_zod35.z.string().describe(
|
|
3901
3914
|
"System-generated tracking identifier used to look up the event."
|
|
3902
3915
|
)
|
|
3903
3916
|
}).openapi({ ref: "EventDocument" });
|
|
@@ -3949,7 +3962,7 @@ function field(fieldId, options = {}) {
|
|
|
3949
3962
|
|
|
3950
3963
|
// ../commons/src/fixtures/forms.ts
|
|
3951
3964
|
var import_date_fns3 = require("date-fns");
|
|
3952
|
-
var PRINT_CERTIFICATE_FORM =
|
|
3965
|
+
var PRINT_CERTIFICATE_FORM = {
|
|
3953
3966
|
label: {
|
|
3954
3967
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
3955
3968
|
defaultMessage: "Tennis club membership certificate collector",
|
|
@@ -4605,7 +4618,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
4605
4618
|
}
|
|
4606
4619
|
}
|
|
4607
4620
|
]
|
|
4608
|
-
}
|
|
4621
|
+
};
|
|
4609
4622
|
var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
4610
4623
|
title: {
|
|
4611
4624
|
id: "event.tennis-club-membership.action.declare.form.review.title",
|
|
@@ -4650,7 +4663,7 @@ function isDomesticAddress() {
|
|
|
4650
4663
|
field("addressType").isEqualTo(AddressType.DOMESTIC)
|
|
4651
4664
|
);
|
|
4652
4665
|
}
|
|
4653
|
-
var TENNIS_CLUB_DECLARATION_FORM =
|
|
4666
|
+
var TENNIS_CLUB_DECLARATION_FORM = {
|
|
4654
4667
|
label: {
|
|
4655
4668
|
id: "event.tennis-club-membership.action.declare.form.label",
|
|
4656
4669
|
defaultMessage: "Tennis club membership application",
|
|
@@ -5135,7 +5148,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5135
5148
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5136
5149
|
}
|
|
5137
5150
|
]
|
|
5138
|
-
}
|
|
5151
|
+
};
|
|
5139
5152
|
var statusOptions = [
|
|
5140
5153
|
{
|
|
5141
5154
|
value: "ALL",
|
|
@@ -5944,7 +5957,7 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5944
5957
|
});
|
|
5945
5958
|
|
|
5946
5959
|
// ../commons/src/fixtures/library-membership-event.ts
|
|
5947
|
-
var libraryMembershipForm =
|
|
5960
|
+
var libraryMembershipForm = {
|
|
5948
5961
|
label: {
|
|
5949
5962
|
id: "event.library-membership.action.declare.form.label",
|
|
5950
5963
|
defaultMessage: "Library membership application",
|
|
@@ -5984,7 +5997,7 @@ var libraryMembershipForm = defineDeclarationForm({
|
|
|
5984
5997
|
]
|
|
5985
5998
|
}
|
|
5986
5999
|
]
|
|
5987
|
-
}
|
|
6000
|
+
};
|
|
5988
6001
|
var libraryMembershipEvent = defineConfig({
|
|
5989
6002
|
id: "library-membership",
|
|
5990
6003
|
label: {
|
|
@@ -6010,7 +6023,7 @@ function generateTranslationConfig(message) {
|
|
|
6010
6023
|
id: message
|
|
6011
6024
|
};
|
|
6012
6025
|
}
|
|
6013
|
-
var child =
|
|
6026
|
+
var child = {
|
|
6014
6027
|
id: "child",
|
|
6015
6028
|
type: PageTypes.enum.FORM,
|
|
6016
6029
|
title: generateTranslationConfig("Child's details"),
|
|
@@ -6033,8 +6046,8 @@ var child = defineFormPage({
|
|
|
6033
6046
|
label: generateTranslationConfig("Date of birth")
|
|
6034
6047
|
}
|
|
6035
6048
|
]
|
|
6036
|
-
}
|
|
6037
|
-
var mother =
|
|
6049
|
+
};
|
|
6050
|
+
var mother = {
|
|
6038
6051
|
id: "mother",
|
|
6039
6052
|
type: PageTypes.enum.FORM,
|
|
6040
6053
|
title: generateTranslationConfig("Mother's details"),
|
|
@@ -6106,7 +6119,7 @@ var mother = defineFormPage({
|
|
|
6106
6119
|
validation: []
|
|
6107
6120
|
}
|
|
6108
6121
|
]
|
|
6109
|
-
}
|
|
6122
|
+
};
|
|
6110
6123
|
var BIRTH_DECLARATION_REVIEW = {
|
|
6111
6124
|
title: generateTranslationConfig(
|
|
6112
6125
|
"{child.name.firstname, select, __EMPTY__ {Birth declaration} other {{child.name.surname, select, __EMPTY__ {Birth declaration for {child.name.firstname}} other {Birth declaration for {child.name.firstname} {child.name.surname}}}}}"
|
|
@@ -6127,10 +6140,10 @@ var BIRTH_DECLARATION_REVIEW = {
|
|
|
6127
6140
|
}
|
|
6128
6141
|
]
|
|
6129
6142
|
};
|
|
6130
|
-
var BIRTH_DECLARATION_FORM =
|
|
6143
|
+
var BIRTH_DECLARATION_FORM = {
|
|
6131
6144
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6132
6145
|
pages: [child, mother]
|
|
6133
|
-
}
|
|
6146
|
+
};
|
|
6134
6147
|
var v2BirthEvent = defineConfig({
|
|
6135
6148
|
id: BIRTH_EVENT,
|
|
6136
6149
|
title: generateTranslationConfig(
|
|
@@ -6167,7 +6180,7 @@ var v2BirthEvent = defineConfig({
|
|
|
6167
6180
|
});
|
|
6168
6181
|
|
|
6169
6182
|
// ../commons/src/fixtures/digital-identity-issuance-event.ts
|
|
6170
|
-
var PRINT_DIGITAL_ID_CERTIFICATE_FORM =
|
|
6183
|
+
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
6171
6184
|
label: {
|
|
6172
6185
|
id: "event.digital-identity.action.certificate.form.label",
|
|
6173
6186
|
defaultMessage: "Digital identity certificate printer",
|
|
@@ -6311,8 +6324,8 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
|
6311
6324
|
]
|
|
6312
6325
|
}
|
|
6313
6326
|
]
|
|
6314
|
-
}
|
|
6315
|
-
var digitalIdentityForm =
|
|
6327
|
+
};
|
|
6328
|
+
var digitalIdentityForm = {
|
|
6316
6329
|
label: {
|
|
6317
6330
|
id: "event.digital-identity.action.declare.form.label",
|
|
6318
6331
|
defaultMessage: "Digital identity issuance",
|
|
@@ -6352,7 +6365,7 @@ var digitalIdentityForm = defineDeclarationForm({
|
|
|
6352
6365
|
]
|
|
6353
6366
|
}
|
|
6354
6367
|
]
|
|
6355
|
-
}
|
|
6368
|
+
};
|
|
6356
6369
|
var digitalIdentityEvent = defineConfig({
|
|
6357
6370
|
id: "digital-identity",
|
|
6358
6371
|
label: {
|
|
@@ -6381,8 +6394,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6381
6394
|
});
|
|
6382
6395
|
|
|
6383
6396
|
// ../commons/src/events/test.utils.ts
|
|
6384
|
-
var
|
|
6385
|
-
var TestUserRole =
|
|
6397
|
+
var import_zod36 = require("zod");
|
|
6398
|
+
var TestUserRole = import_zod36.z.enum([
|
|
6386
6399
|
"FIELD_AGENT",
|
|
6387
6400
|
"LOCAL_REGISTRAR",
|
|
6388
6401
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6485,22 +6498,22 @@ var ACTION_FILTERS = {
|
|
|
6485
6498
|
var import_lodash6 = require("lodash");
|
|
6486
6499
|
|
|
6487
6500
|
// ../commons/src/events/locations.ts
|
|
6488
|
-
var
|
|
6489
|
-
var LocationType =
|
|
6501
|
+
var import_zod37 = require("zod");
|
|
6502
|
+
var LocationType = import_zod37.z.enum([
|
|
6490
6503
|
"ADMIN_STRUCTURE",
|
|
6491
6504
|
"CRVS_OFFICE",
|
|
6492
6505
|
"HEALTH_FACILITY"
|
|
6493
6506
|
]);
|
|
6494
|
-
var Location =
|
|
6507
|
+
var Location = import_zod37.z.object({
|
|
6495
6508
|
id: UUID,
|
|
6496
|
-
name:
|
|
6509
|
+
name: import_zod37.z.string(),
|
|
6497
6510
|
parentId: UUID.nullable(),
|
|
6498
|
-
validUntil:
|
|
6511
|
+
validUntil: import_zod37.z.string().datetime().nullable(),
|
|
6499
6512
|
locationType: LocationType.nullable()
|
|
6500
6513
|
});
|
|
6501
6514
|
|
|
6502
6515
|
// ../commons/src/notification/UserNotifications.ts
|
|
6503
|
-
var
|
|
6516
|
+
var import_zod38 = require("zod");
|
|
6504
6517
|
var TriggerEvent = {
|
|
6505
6518
|
USER_CREATED: "user-created",
|
|
6506
6519
|
USER_UPDATED: "user-updated",
|
|
@@ -6512,50 +6525,50 @@ var TriggerEvent = {
|
|
|
6512
6525
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6513
6526
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6514
6527
|
};
|
|
6515
|
-
var Recipient =
|
|
6528
|
+
var Recipient = import_zod38.z.object({
|
|
6516
6529
|
name: NameFieldValue.optional(),
|
|
6517
|
-
mobile:
|
|
6518
|
-
email:
|
|
6519
|
-
bcc:
|
|
6530
|
+
mobile: import_zod38.z.string().optional(),
|
|
6531
|
+
email: import_zod38.z.string().optional(),
|
|
6532
|
+
bcc: import_zod38.z.array(import_zod38.z.string()).optional()
|
|
6520
6533
|
});
|
|
6521
|
-
var BasePayload =
|
|
6534
|
+
var BasePayload = import_zod38.z.object({
|
|
6522
6535
|
recipient: Recipient
|
|
6523
6536
|
});
|
|
6524
6537
|
var TriggerPayload = {
|
|
6525
6538
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6526
|
-
username:
|
|
6527
|
-
temporaryPassword:
|
|
6539
|
+
username: import_zod38.z.string(),
|
|
6540
|
+
temporaryPassword: import_zod38.z.string()
|
|
6528
6541
|
}),
|
|
6529
6542
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6530
|
-
oldUsername:
|
|
6531
|
-
newUsername:
|
|
6543
|
+
oldUsername: import_zod38.z.string(),
|
|
6544
|
+
newUsername: import_zod38.z.string()
|
|
6532
6545
|
}),
|
|
6533
6546
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6534
|
-
username:
|
|
6547
|
+
username: import_zod38.z.string()
|
|
6535
6548
|
}),
|
|
6536
6549
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6537
|
-
code:
|
|
6550
|
+
code: import_zod38.z.string()
|
|
6538
6551
|
}),
|
|
6539
6552
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6540
|
-
temporaryPassword:
|
|
6541
|
-
admin:
|
|
6542
|
-
id:
|
|
6553
|
+
temporaryPassword: import_zod38.z.string(),
|
|
6554
|
+
admin: import_zod38.z.object({
|
|
6555
|
+
id: import_zod38.z.string(),
|
|
6543
6556
|
name: NameFieldValue,
|
|
6544
|
-
role:
|
|
6557
|
+
role: import_zod38.z.string()
|
|
6545
6558
|
})
|
|
6546
6559
|
}),
|
|
6547
6560
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6548
|
-
code:
|
|
6561
|
+
code: import_zod38.z.string()
|
|
6549
6562
|
}),
|
|
6550
6563
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6551
|
-
subject:
|
|
6552
|
-
body:
|
|
6564
|
+
subject: import_zod38.z.string(),
|
|
6565
|
+
body: import_zod38.z.string()
|
|
6553
6566
|
}),
|
|
6554
6567
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6555
|
-
code:
|
|
6568
|
+
code: import_zod38.z.string()
|
|
6556
6569
|
}),
|
|
6557
6570
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6558
|
-
code:
|
|
6571
|
+
code: import_zod38.z.string()
|
|
6559
6572
|
})
|
|
6560
6573
|
};
|
|
6561
6574
|
async function triggerUserEventNotification({
|