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