@opencrvs/toolkit 1.9.6-rc.7b05346 → 1.9.6-rc.8a2de14
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 +45 -6
- package/dist/commons/events/TemplateConfig.d.ts +2 -0
- package/dist/conditionals/index.js +15 -0
- package/dist/events/index.js +474 -454
- package/dist/notification/index.js +491 -473
- 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").optional(),
|
|
1435
|
+
$$time: import_zod15.z.literal("now").optional()
|
|
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: "object" }).describe("Default date value(yyyy-MM-dd)"),
|
|
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: "object" }).describe("Default time value (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) => {
|
|
@@ -2688,7 +2705,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2688
2705
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2689
2706
|
|
|
2690
2707
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2691
|
-
var
|
|
2708
|
+
var import_zod31 = require("zod");
|
|
2692
2709
|
|
|
2693
2710
|
// ../commons/src/conditionals/conditionals.ts
|
|
2694
2711
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2757,6 +2774,7 @@ function wrapToPathOptional(condition, path) {
|
|
|
2757
2774
|
};
|
|
2758
2775
|
}, condition);
|
|
2759
2776
|
}
|
|
2777
|
+
var now = Object.assign(todayDateTimeValueSerializer, {});
|
|
2760
2778
|
var user = Object.assign(userSerializer, {
|
|
2761
2779
|
hasScope: (scope) => defineConditional({
|
|
2762
2780
|
type: "object",
|
|
@@ -3435,17 +3453,17 @@ var event = Object.assign(eventFn, {
|
|
|
3435
3453
|
});
|
|
3436
3454
|
|
|
3437
3455
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3438
|
-
var
|
|
3456
|
+
var import_zod28 = require("zod");
|
|
3439
3457
|
var WorkqueueColumnKeysArray = [
|
|
3440
3458
|
...EventMetadataKeysArray,
|
|
3441
3459
|
"title",
|
|
3442
3460
|
"outbox"
|
|
3443
3461
|
];
|
|
3444
|
-
var WorkqueueColumnKeys =
|
|
3445
|
-
var WorkqueueColumnValue =
|
|
3462
|
+
var WorkqueueColumnKeys = import_zod28.z.enum(WorkqueueColumnKeysArray);
|
|
3463
|
+
var WorkqueueColumnValue = import_zod28.z.object({
|
|
3446
3464
|
$event: WorkqueueColumnKeys
|
|
3447
3465
|
});
|
|
3448
|
-
var WorkqueueColumn =
|
|
3466
|
+
var WorkqueueColumn = import_zod28.z.object({
|
|
3449
3467
|
label: TranslationConfig,
|
|
3450
3468
|
value: WorkqueueColumnValue
|
|
3451
3469
|
});
|
|
@@ -3456,57 +3474,57 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3456
3474
|
}
|
|
3457
3475
|
|
|
3458
3476
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3459
|
-
var
|
|
3460
|
-
var SerializableExact =
|
|
3461
|
-
type:
|
|
3462
|
-
term:
|
|
3477
|
+
var import_zod29 = require("zod");
|
|
3478
|
+
var SerializableExact = import_zod29.z.object({
|
|
3479
|
+
type: import_zod29.z.literal("exact"),
|
|
3480
|
+
term: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
3463
3481
|
});
|
|
3464
|
-
var SerializableWithin =
|
|
3465
|
-
type:
|
|
3466
|
-
location:
|
|
3482
|
+
var SerializableWithin = import_zod29.z.object({
|
|
3483
|
+
type: import_zod29.z.literal("within"),
|
|
3484
|
+
location: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
3467
3485
|
});
|
|
3468
|
-
var SerializedQueryExpression =
|
|
3469
|
-
eventType:
|
|
3470
|
-
status:
|
|
3471
|
-
createdAt:
|
|
3472
|
-
updatedAt:
|
|
3473
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3474
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3475
|
-
|
|
3486
|
+
var SerializedQueryExpression = import_zod29.z.object({
|
|
3487
|
+
eventType: import_zod29.z.string(),
|
|
3488
|
+
status: import_zod29.z.optional(import_zod29.z.union([AnyOfStatus, ExactStatus])),
|
|
3489
|
+
createdAt: import_zod29.z.optional(DateCondition),
|
|
3490
|
+
updatedAt: import_zod29.z.optional(DateCondition),
|
|
3491
|
+
"legalStatuses.REGISTERED.createdAt": import_zod29.z.optional(DateCondition),
|
|
3492
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod29.z.optional(
|
|
3493
|
+
import_zod29.z.union([Within, Exact])
|
|
3476
3494
|
),
|
|
3477
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3478
|
-
createdAtLocation:
|
|
3479
|
-
|
|
3495
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod29.z.optional(Exact),
|
|
3496
|
+
createdAtLocation: import_zod29.z.optional(
|
|
3497
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
3480
3498
|
),
|
|
3481
|
-
updatedAtLocation:
|
|
3482
|
-
|
|
3499
|
+
updatedAtLocation: import_zod29.z.optional(
|
|
3500
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
3483
3501
|
),
|
|
3484
|
-
assignedTo:
|
|
3485
|
-
createdBy:
|
|
3502
|
+
assignedTo: import_zod29.z.optional(SerializableExact),
|
|
3503
|
+
createdBy: import_zod29.z.optional(SerializableExact),
|
|
3486
3504
|
createdByUserType: ExactUserType,
|
|
3487
|
-
updatedBy:
|
|
3488
|
-
trackingId:
|
|
3489
|
-
flags:
|
|
3505
|
+
updatedBy: import_zod29.z.optional(SerializableExact),
|
|
3506
|
+
trackingId: import_zod29.z.optional(Exact),
|
|
3507
|
+
flags: import_zod29.z.optional(ContainsFlags),
|
|
3490
3508
|
data: QueryInput
|
|
3491
3509
|
}).partial();
|
|
3492
|
-
var Or2 =
|
|
3493
|
-
type:
|
|
3494
|
-
clauses:
|
|
3510
|
+
var Or2 = import_zod29.z.object({
|
|
3511
|
+
type: import_zod29.z.literal("or"),
|
|
3512
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
3495
3513
|
});
|
|
3496
|
-
var And2 =
|
|
3497
|
-
type:
|
|
3498
|
-
clauses:
|
|
3514
|
+
var And2 = import_zod29.z.object({
|
|
3515
|
+
type: import_zod29.z.literal("and"),
|
|
3516
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
3499
3517
|
});
|
|
3500
|
-
var CountryConfigQueryType =
|
|
3501
|
-
var CountryConfigQueryInputType =
|
|
3518
|
+
var CountryConfigQueryType = import_zod29.z.discriminatedUnion("type", [And2, Or2]);
|
|
3519
|
+
var CountryConfigQueryInputType = import_zod29.z.union([
|
|
3502
3520
|
SerializedQueryExpression,
|
|
3503
3521
|
And2,
|
|
3504
3522
|
Or2
|
|
3505
3523
|
]);
|
|
3506
3524
|
|
|
3507
3525
|
// ../commons/src/icons.ts
|
|
3508
|
-
var
|
|
3509
|
-
var AvailableIcons =
|
|
3526
|
+
var import_zod30 = require("zod");
|
|
3527
|
+
var AvailableIcons = import_zod30.z.enum([
|
|
3510
3528
|
"Archived",
|
|
3511
3529
|
"Assigned",
|
|
3512
3530
|
"Certified",
|
|
@@ -3627,23 +3645,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3627
3645
|
value: event.field("updatedAt")
|
|
3628
3646
|
}
|
|
3629
3647
|
]);
|
|
3630
|
-
var WorkqueueActionsWithDefault =
|
|
3648
|
+
var WorkqueueActionsWithDefault = import_zod31.z.enum([
|
|
3631
3649
|
...workqueueActions.options,
|
|
3632
3650
|
"DEFAULT"
|
|
3633
3651
|
]);
|
|
3634
|
-
var WorkqueueConfig =
|
|
3635
|
-
slug:
|
|
3652
|
+
var WorkqueueConfig = import_zod31.z.object({
|
|
3653
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
3636
3654
|
name: TranslationConfig.describe(
|
|
3637
3655
|
"Title of the workflow (both in navigation and on the page)"
|
|
3638
3656
|
),
|
|
3639
3657
|
query: CountryConfigQueryType,
|
|
3640
|
-
actions:
|
|
3641
|
-
|
|
3658
|
+
actions: import_zod31.z.array(
|
|
3659
|
+
import_zod31.z.object({
|
|
3642
3660
|
type: WorkqueueActionsWithDefault,
|
|
3643
|
-
conditionals:
|
|
3661
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3644
3662
|
})
|
|
3645
3663
|
),
|
|
3646
|
-
columns:
|
|
3664
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3647
3665
|
icon: AvailableIcons,
|
|
3648
3666
|
emptyMessage: TranslationConfig.optional()
|
|
3649
3667
|
}).describe("Configuration for workqueue.");
|
|
@@ -3651,26 +3669,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3651
3669
|
query: true,
|
|
3652
3670
|
columns: true
|
|
3653
3671
|
});
|
|
3654
|
-
var WorkqueueConfigInput =
|
|
3655
|
-
slug:
|
|
3672
|
+
var WorkqueueConfigInput = import_zod31.z.object({
|
|
3673
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
3656
3674
|
name: TranslationConfig.describe(
|
|
3657
3675
|
"Title of the workflow (both in navigation and on the page)"
|
|
3658
3676
|
),
|
|
3659
3677
|
query: CountryConfigQueryInputType,
|
|
3660
|
-
actions:
|
|
3661
|
-
|
|
3678
|
+
actions: import_zod31.z.array(
|
|
3679
|
+
import_zod31.z.object({
|
|
3662
3680
|
type: WorkqueueActionsWithDefault,
|
|
3663
|
-
conditionals:
|
|
3681
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3664
3682
|
})
|
|
3665
3683
|
),
|
|
3666
|
-
columns:
|
|
3684
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3667
3685
|
icon: AvailableIcons,
|
|
3668
3686
|
emptyMessage: TranslationConfig.optional()
|
|
3669
3687
|
});
|
|
3670
|
-
var WorkqueueCountInput =
|
|
3671
|
-
|
|
3688
|
+
var WorkqueueCountInput = import_zod31.z.array(
|
|
3689
|
+
import_zod31.z.object({ slug: import_zod31.z.string(), query: QueryType })
|
|
3672
3690
|
);
|
|
3673
|
-
var WorkqueueCountOutput =
|
|
3691
|
+
var WorkqueueCountOutput = import_zod31.z.record(import_zod31.z.string(), import_zod31.z.number());
|
|
3674
3692
|
|
|
3675
3693
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3676
3694
|
var defaultWorkqueueColumns = [
|
|
@@ -3693,45 +3711,45 @@ var defaultWorkqueueColumns = [
|
|
|
3693
3711
|
];
|
|
3694
3712
|
|
|
3695
3713
|
// ../commons/src/events/Draft.ts
|
|
3696
|
-
var
|
|
3714
|
+
var import_zod33 = require("zod");
|
|
3697
3715
|
|
|
3698
3716
|
// ../commons/src/events/ActionInput.ts
|
|
3699
|
-
var
|
|
3717
|
+
var import_zod32 = require("zod");
|
|
3700
3718
|
var import_zod_openapi11 = require("zod-openapi");
|
|
3701
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(
|
|
3702
|
-
var BaseActionInput =
|
|
3719
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod32.z);
|
|
3720
|
+
var BaseActionInput = import_zod32.z.object({
|
|
3703
3721
|
eventId: UUID,
|
|
3704
|
-
transactionId:
|
|
3722
|
+
transactionId: import_zod32.z.string(),
|
|
3705
3723
|
declaration: ActionUpdate.default({}),
|
|
3706
3724
|
annotation: ActionUpdate.optional(),
|
|
3707
3725
|
originalActionId: UUID.optional(),
|
|
3708
3726
|
// should not be part of base action.
|
|
3709
|
-
keepAssignment:
|
|
3727
|
+
keepAssignment: import_zod32.z.boolean().optional(),
|
|
3710
3728
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3711
3729
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3712
3730
|
"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
3731
|
)
|
|
3714
3732
|
});
|
|
3715
3733
|
var CreateActionInput = BaseActionInput.merge(
|
|
3716
|
-
|
|
3717
|
-
type:
|
|
3734
|
+
import_zod32.z.object({
|
|
3735
|
+
type: import_zod32.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3718
3736
|
createdAtLocation: CreatedAtLocation
|
|
3719
3737
|
})
|
|
3720
3738
|
);
|
|
3721
3739
|
var RegisterActionInput = BaseActionInput.merge(
|
|
3722
|
-
|
|
3723
|
-
type:
|
|
3724
|
-
registrationNumber:
|
|
3740
|
+
import_zod32.z.object({
|
|
3741
|
+
type: import_zod32.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3742
|
+
registrationNumber: import_zod32.z.string().optional()
|
|
3725
3743
|
})
|
|
3726
3744
|
).strict();
|
|
3727
3745
|
var ValidateActionInput = BaseActionInput.merge(
|
|
3728
|
-
|
|
3729
|
-
type:
|
|
3746
|
+
import_zod32.z.object({
|
|
3747
|
+
type: import_zod32.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3730
3748
|
})
|
|
3731
3749
|
);
|
|
3732
3750
|
var NotifyActionInput = BaseActionInput.merge(
|
|
3733
|
-
|
|
3734
|
-
type:
|
|
3751
|
+
import_zod32.z.object({
|
|
3752
|
+
type: import_zod32.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3735
3753
|
})
|
|
3736
3754
|
).openapi({
|
|
3737
3755
|
default: {
|
|
@@ -3743,86 +3761,86 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
3743
3761
|
}
|
|
3744
3762
|
});
|
|
3745
3763
|
var DeclareActionInput = BaseActionInput.merge(
|
|
3746
|
-
|
|
3747
|
-
type:
|
|
3764
|
+
import_zod32.z.object({
|
|
3765
|
+
type: import_zod32.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3748
3766
|
})
|
|
3749
3767
|
);
|
|
3750
3768
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3769
|
+
import_zod32.z.object({
|
|
3770
|
+
type: import_zod32.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3753
3771
|
content: PrintContent.optional()
|
|
3754
3772
|
})
|
|
3755
3773
|
);
|
|
3756
3774
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3757
|
-
|
|
3758
|
-
type:
|
|
3775
|
+
import_zod32.z.object({
|
|
3776
|
+
type: import_zod32.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3759
3777
|
content: ReasonContent
|
|
3760
3778
|
})
|
|
3761
3779
|
);
|
|
3762
3780
|
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3763
|
-
|
|
3764
|
-
type:
|
|
3765
|
-
content:
|
|
3766
|
-
duplicates:
|
|
3781
|
+
import_zod32.z.object({
|
|
3782
|
+
type: import_zod32.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3783
|
+
content: import_zod32.z.object({
|
|
3784
|
+
duplicates: import_zod32.z.array(PotentialDuplicate)
|
|
3767
3785
|
})
|
|
3768
3786
|
})
|
|
3769
3787
|
);
|
|
3770
3788
|
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3771
|
-
|
|
3772
|
-
type:
|
|
3773
|
-
content:
|
|
3789
|
+
import_zod32.z.object({
|
|
3790
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3791
|
+
content: import_zod32.z.object({
|
|
3774
3792
|
duplicateOf: UUID
|
|
3775
3793
|
}).optional()
|
|
3776
3794
|
})
|
|
3777
3795
|
);
|
|
3778
3796
|
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3779
|
-
|
|
3780
|
-
type:
|
|
3797
|
+
import_zod32.z.object({
|
|
3798
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3781
3799
|
})
|
|
3782
3800
|
);
|
|
3783
3801
|
var ArchiveActionInput = BaseActionInput.merge(
|
|
3784
|
-
|
|
3785
|
-
type:
|
|
3802
|
+
import_zod32.z.object({
|
|
3803
|
+
type: import_zod32.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3786
3804
|
content: ReasonContent
|
|
3787
3805
|
})
|
|
3788
3806
|
);
|
|
3789
3807
|
var AssignActionInput = BaseActionInput.merge(
|
|
3790
|
-
|
|
3791
|
-
type:
|
|
3792
|
-
assignedTo:
|
|
3808
|
+
import_zod32.z.object({
|
|
3809
|
+
type: import_zod32.z.literal(ActionType.ASSIGN),
|
|
3810
|
+
assignedTo: import_zod32.z.string()
|
|
3793
3811
|
})
|
|
3794
3812
|
);
|
|
3795
3813
|
var UnassignActionInput = BaseActionInput.merge(
|
|
3796
|
-
|
|
3797
|
-
type:
|
|
3798
|
-
assignedTo:
|
|
3814
|
+
import_zod32.z.object({
|
|
3815
|
+
type: import_zod32.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3816
|
+
assignedTo: import_zod32.z.literal(null).default(null)
|
|
3799
3817
|
})
|
|
3800
3818
|
);
|
|
3801
3819
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3802
|
-
|
|
3803
|
-
type:
|
|
3820
|
+
import_zod32.z.object({
|
|
3821
|
+
type: import_zod32.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3804
3822
|
})
|
|
3805
3823
|
);
|
|
3806
3824
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3807
|
-
|
|
3808
|
-
requestId:
|
|
3809
|
-
type:
|
|
3825
|
+
import_zod32.z.object({
|
|
3826
|
+
requestId: import_zod32.z.string(),
|
|
3827
|
+
type: import_zod32.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3810
3828
|
content: ReasonContent
|
|
3811
3829
|
})
|
|
3812
3830
|
);
|
|
3813
3831
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3814
|
-
|
|
3815
|
-
requestId:
|
|
3816
|
-
type:
|
|
3832
|
+
import_zod32.z.object({
|
|
3833
|
+
requestId: import_zod32.z.string(),
|
|
3834
|
+
type: import_zod32.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3817
3835
|
})
|
|
3818
3836
|
);
|
|
3819
3837
|
var ReadActionInput = BaseActionInput.merge(
|
|
3820
|
-
|
|
3821
|
-
type:
|
|
3838
|
+
import_zod32.z.object({
|
|
3839
|
+
type: import_zod32.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3822
3840
|
})
|
|
3823
3841
|
);
|
|
3824
|
-
var DeleteActionInput =
|
|
3825
|
-
var ActionInput =
|
|
3842
|
+
var DeleteActionInput = import_zod32.z.object({ eventId: UUID });
|
|
3843
|
+
var ActionInput = import_zod32.z.discriminatedUnion("type", [
|
|
3826
3844
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3827
3845
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3828
3846
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
@@ -3857,11 +3875,11 @@ var ActionInput = import_zod31.z.discriminatedUnion("type", [
|
|
|
3857
3875
|
});
|
|
3858
3876
|
|
|
3859
3877
|
// ../commons/src/events/Draft.ts
|
|
3860
|
-
var Draft =
|
|
3878
|
+
var Draft = import_zod33.z.object({
|
|
3861
3879
|
id: UUID,
|
|
3862
3880
|
eventId: UUID,
|
|
3863
|
-
transactionId:
|
|
3864
|
-
createdAt:
|
|
3881
|
+
transactionId: import_zod33.z.string(),
|
|
3882
|
+
createdAt: import_zod33.z.string().datetime(),
|
|
3865
3883
|
action: ActionBase.extend({
|
|
3866
3884
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
3867
3885
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -3870,7 +3888,7 @@ var Draft = import_zod32.z.object({
|
|
|
3870
3888
|
);
|
|
3871
3889
|
var DraftInput = BaseActionInput.extend({
|
|
3872
3890
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3873
|
-
status:
|
|
3891
|
+
status: import_zod33.z.enum([
|
|
3874
3892
|
ActionStatus.Requested,
|
|
3875
3893
|
ActionStatus.Accepted,
|
|
3876
3894
|
ActionStatus.Rejected
|
|
@@ -3878,26 +3896,26 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3878
3896
|
});
|
|
3879
3897
|
|
|
3880
3898
|
// ../commons/src/events/EventInput.ts
|
|
3881
|
-
var
|
|
3899
|
+
var import_zod34 = require("zod");
|
|
3882
3900
|
var import_uuid10 = require("uuid");
|
|
3883
|
-
var EventInput =
|
|
3884
|
-
transactionId:
|
|
3885
|
-
type:
|
|
3901
|
+
var EventInput = import_zod34.z.object({
|
|
3902
|
+
transactionId: import_zod34.z.string(),
|
|
3903
|
+
type: import_zod34.z.string()
|
|
3886
3904
|
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3887
3905
|
|
|
3888
3906
|
// ../commons/src/events/EventDocument.ts
|
|
3889
|
-
var
|
|
3907
|
+
var import_zod35 = require("zod");
|
|
3890
3908
|
var import_zod_openapi12 = require("zod-openapi");
|
|
3891
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(
|
|
3892
|
-
var EventDocument =
|
|
3909
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod35.z);
|
|
3910
|
+
var EventDocument = import_zod35.z.object({
|
|
3893
3911
|
id: UUID.describe("Unique identifier of the event."),
|
|
3894
|
-
type:
|
|
3895
|
-
createdAt:
|
|
3896
|
-
updatedAt:
|
|
3912
|
+
type: import_zod35.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3913
|
+
createdAt: import_zod35.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3914
|
+
updatedAt: import_zod35.z.string().datetime().describe(
|
|
3897
3915
|
"Timestamp of the last update, excluding changes from actions."
|
|
3898
3916
|
),
|
|
3899
|
-
actions:
|
|
3900
|
-
trackingId:
|
|
3917
|
+
actions: import_zod35.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3918
|
+
trackingId: import_zod35.z.string().describe(
|
|
3901
3919
|
"System-generated tracking identifier used to look up the event."
|
|
3902
3920
|
)
|
|
3903
3921
|
}).openapi({ ref: "EventDocument" });
|
|
@@ -6381,8 +6399,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6381
6399
|
});
|
|
6382
6400
|
|
|
6383
6401
|
// ../commons/src/events/test.utils.ts
|
|
6384
|
-
var
|
|
6385
|
-
var TestUserRole =
|
|
6402
|
+
var import_zod36 = require("zod");
|
|
6403
|
+
var TestUserRole = import_zod36.z.enum([
|
|
6386
6404
|
"FIELD_AGENT",
|
|
6387
6405
|
"LOCAL_REGISTRAR",
|
|
6388
6406
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6485,22 +6503,22 @@ var ACTION_FILTERS = {
|
|
|
6485
6503
|
var import_lodash6 = require("lodash");
|
|
6486
6504
|
|
|
6487
6505
|
// ../commons/src/events/locations.ts
|
|
6488
|
-
var
|
|
6489
|
-
var LocationType =
|
|
6506
|
+
var import_zod37 = require("zod");
|
|
6507
|
+
var LocationType = import_zod37.z.enum([
|
|
6490
6508
|
"ADMIN_STRUCTURE",
|
|
6491
6509
|
"CRVS_OFFICE",
|
|
6492
6510
|
"HEALTH_FACILITY"
|
|
6493
6511
|
]);
|
|
6494
|
-
var Location =
|
|
6512
|
+
var Location = import_zod37.z.object({
|
|
6495
6513
|
id: UUID,
|
|
6496
|
-
name:
|
|
6514
|
+
name: import_zod37.z.string(),
|
|
6497
6515
|
parentId: UUID.nullable(),
|
|
6498
|
-
validUntil:
|
|
6516
|
+
validUntil: import_zod37.z.string().datetime().nullable(),
|
|
6499
6517
|
locationType: LocationType.nullable()
|
|
6500
6518
|
});
|
|
6501
6519
|
|
|
6502
6520
|
// ../commons/src/notification/UserNotifications.ts
|
|
6503
|
-
var
|
|
6521
|
+
var import_zod38 = require("zod");
|
|
6504
6522
|
var TriggerEvent = {
|
|
6505
6523
|
USER_CREATED: "user-created",
|
|
6506
6524
|
USER_UPDATED: "user-updated",
|
|
@@ -6512,50 +6530,50 @@ var TriggerEvent = {
|
|
|
6512
6530
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6513
6531
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6514
6532
|
};
|
|
6515
|
-
var Recipient =
|
|
6533
|
+
var Recipient = import_zod38.z.object({
|
|
6516
6534
|
name: NameFieldValue.optional(),
|
|
6517
|
-
mobile:
|
|
6518
|
-
email:
|
|
6519
|
-
bcc:
|
|
6535
|
+
mobile: import_zod38.z.string().optional(),
|
|
6536
|
+
email: import_zod38.z.string().optional(),
|
|
6537
|
+
bcc: import_zod38.z.array(import_zod38.z.string()).optional()
|
|
6520
6538
|
});
|
|
6521
|
-
var BasePayload =
|
|
6539
|
+
var BasePayload = import_zod38.z.object({
|
|
6522
6540
|
recipient: Recipient
|
|
6523
6541
|
});
|
|
6524
6542
|
var TriggerPayload = {
|
|
6525
6543
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6526
|
-
username:
|
|
6527
|
-
temporaryPassword:
|
|
6544
|
+
username: import_zod38.z.string(),
|
|
6545
|
+
temporaryPassword: import_zod38.z.string()
|
|
6528
6546
|
}),
|
|
6529
6547
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6530
|
-
oldUsername:
|
|
6531
|
-
newUsername:
|
|
6548
|
+
oldUsername: import_zod38.z.string(),
|
|
6549
|
+
newUsername: import_zod38.z.string()
|
|
6532
6550
|
}),
|
|
6533
6551
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6534
|
-
username:
|
|
6552
|
+
username: import_zod38.z.string()
|
|
6535
6553
|
}),
|
|
6536
6554
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6537
|
-
code:
|
|
6555
|
+
code: import_zod38.z.string()
|
|
6538
6556
|
}),
|
|
6539
6557
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6540
|
-
temporaryPassword:
|
|
6541
|
-
admin:
|
|
6542
|
-
id:
|
|
6558
|
+
temporaryPassword: import_zod38.z.string(),
|
|
6559
|
+
admin: import_zod38.z.object({
|
|
6560
|
+
id: import_zod38.z.string(),
|
|
6543
6561
|
name: NameFieldValue,
|
|
6544
|
-
role:
|
|
6562
|
+
role: import_zod38.z.string()
|
|
6545
6563
|
})
|
|
6546
6564
|
}),
|
|
6547
6565
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6548
|
-
code:
|
|
6566
|
+
code: import_zod38.z.string()
|
|
6549
6567
|
}),
|
|
6550
6568
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6551
|
-
subject:
|
|
6552
|
-
body:
|
|
6569
|
+
subject: import_zod38.z.string(),
|
|
6570
|
+
body: import_zod38.z.string()
|
|
6553
6571
|
}),
|
|
6554
6572
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6555
|
-
code:
|
|
6573
|
+
code: import_zod38.z.string()
|
|
6556
6574
|
}),
|
|
6557
6575
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6558
|
-
code:
|
|
6576
|
+
code: import_zod38.z.string()
|
|
6559
6577
|
})
|
|
6560
6578
|
};
|
|
6561
6579
|
async function triggerUserEventNotification({
|