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