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