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