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