@opencrvs/toolkit 1.9.6-rc.690a282 → 1.9.6-rc.6ae1b5a
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 +26 -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 +45 -0
- package/dist/conditionals/index.js +11 -0
- package/dist/events/deduplication.d.ts +45 -0
- package/dist/events/deduplication.js +41 -0
- package/dist/events/index.js +494 -455
- package/dist/notification/index.js +511 -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,69 @@ 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()
|
|
2074
2083
|
}).optional().default({
|
|
2075
2084
|
boost: 1
|
|
2076
2085
|
})
|
|
2077
2086
|
});
|
|
2078
2087
|
var FuzzyMatcher = Matcher.extend({
|
|
2079
|
-
type:
|
|
2080
|
-
options:
|
|
2088
|
+
type: import_zod19.z.literal("fuzzy"),
|
|
2089
|
+
options: import_zod19.z.object({
|
|
2081
2090
|
/**
|
|
2082
2091
|
* Names of length 3 or less characters = 0 edits allowed
|
|
2083
2092
|
* Names of length 4 - 6 characters = 1 edit allowed
|
|
2084
2093
|
* Names of length >7 characters = 2 edits allowed
|
|
2085
2094
|
*/
|
|
2086
|
-
fuzziness:
|
|
2087
|
-
boost:
|
|
2095
|
+
fuzziness: import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).optional().default("AUTO:4,7"),
|
|
2096
|
+
boost: import_zod19.z.number().optional().default(1)
|
|
2088
2097
|
}).optional().default({
|
|
2089
2098
|
fuzziness: "AUTO:4,7",
|
|
2090
2099
|
boost: 1
|
|
2091
2100
|
})
|
|
2092
2101
|
});
|
|
2093
2102
|
var StrictMatcher = Matcher.extend({
|
|
2094
|
-
type:
|
|
2095
|
-
options:
|
|
2096
|
-
boost:
|
|
2103
|
+
type: import_zod19.z.literal("strict"),
|
|
2104
|
+
options: import_zod19.z.object({
|
|
2105
|
+
boost: import_zod19.z.number().optional().default(1),
|
|
2097
2106
|
/**
|
|
2098
2107
|
* The constant value to be present in the field for both records
|
|
2099
2108
|
*/
|
|
2100
|
-
value:
|
|
2109
|
+
value: import_zod19.z.string().optional()
|
|
2101
2110
|
}).optional().default({
|
|
2102
2111
|
boost: 1
|
|
2103
2112
|
})
|
|
2104
2113
|
});
|
|
2105
2114
|
var DateRangeMatcher = Matcher.extend({
|
|
2106
|
-
type:
|
|
2107
|
-
options:
|
|
2115
|
+
type: import_zod19.z.literal("dateRange"),
|
|
2116
|
+
options: import_zod19.z.object({
|
|
2108
2117
|
/**
|
|
2109
2118
|
* The distance pivot in days. Distance from the origin (the value of
|
|
2110
2119
|
* fieldId) at which relevance scores receive half of the boost value
|
|
2111
2120
|
*/
|
|
2112
|
-
pivot:
|
|
2113
|
-
days:
|
|
2114
|
-
boost:
|
|
2121
|
+
pivot: import_zod19.z.number().optional(),
|
|
2122
|
+
days: import_zod19.z.number(),
|
|
2123
|
+
boost: import_zod19.z.number().optional().default(1),
|
|
2124
|
+
matchAgainst: import_zod19.z.array(FieldReference).optional()
|
|
2115
2125
|
})
|
|
2116
2126
|
});
|
|
2117
|
-
var Not =
|
|
2118
|
-
type:
|
|
2127
|
+
var Not = import_zod19.z.object({
|
|
2128
|
+
type: import_zod19.z.literal("not"),
|
|
2119
2129
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2120
|
-
clause:
|
|
2130
|
+
clause: import_zod19.z.lazy(() => Clause)
|
|
2121
2131
|
});
|
|
2122
|
-
var And =
|
|
2123
|
-
type:
|
|
2132
|
+
var And = import_zod19.z.object({
|
|
2133
|
+
type: import_zod19.z.literal("and"),
|
|
2124
2134
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2125
|
-
clauses:
|
|
2135
|
+
clauses: import_zod19.z.lazy(() => Clause.array())
|
|
2126
2136
|
});
|
|
2127
|
-
var Or =
|
|
2128
|
-
type:
|
|
2137
|
+
var Or = import_zod19.z.object({
|
|
2138
|
+
type: import_zod19.z.literal("or"),
|
|
2129
2139
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2130
|
-
clauses:
|
|
2140
|
+
clauses: import_zod19.z.lazy(() => Clause.array())
|
|
2131
2141
|
});
|
|
2132
|
-
var Clause =
|
|
2133
|
-
() =>
|
|
2142
|
+
var Clause = import_zod19.z.lazy(
|
|
2143
|
+
() => import_zod19.z.discriminatedUnion("type", [
|
|
2134
2144
|
Not,
|
|
2135
2145
|
And,
|
|
2136
2146
|
Or,
|
|
@@ -2141,22 +2151,22 @@ var Clause = import_zod18.z.lazy(
|
|
|
2141
2151
|
).openapi({
|
|
2142
2152
|
ref: "Clause"
|
|
2143
2153
|
});
|
|
2144
|
-
var DeduplicationConfig =
|
|
2145
|
-
id:
|
|
2154
|
+
var DeduplicationConfig = import_zod19.z.object({
|
|
2155
|
+
id: import_zod19.z.string(),
|
|
2146
2156
|
label: TranslationConfig,
|
|
2147
2157
|
query: Clause
|
|
2148
2158
|
});
|
|
2149
2159
|
|
|
2150
2160
|
// ../commons/src/events/ActionConfig.ts
|
|
2151
2161
|
var import_zod_openapi9 = require("zod-openapi");
|
|
2152
|
-
(0, import_zod_openapi9.extendZodWithOpenApi)(
|
|
2153
|
-
var DeclarationReviewConfig =
|
|
2162
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod20.z);
|
|
2163
|
+
var DeclarationReviewConfig = import_zod20.z.object({
|
|
2154
2164
|
title: TranslationConfig.describe("Title of the review page"),
|
|
2155
|
-
fields:
|
|
2165
|
+
fields: import_zod20.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
|
|
2156
2166
|
}).describe(
|
|
2157
2167
|
"Configuration of the declaration review page for collecting event-related metadata."
|
|
2158
2168
|
);
|
|
2159
|
-
var ActionConfigBase =
|
|
2169
|
+
var ActionConfigBase = import_zod20.z.object({
|
|
2160
2170
|
label: TranslationConfig.describe("Human readable description of the action")
|
|
2161
2171
|
});
|
|
2162
2172
|
var DeclarationActionBase = ActionConfigBase.extend({
|
|
@@ -2164,66 +2174,66 @@ var DeclarationActionBase = ActionConfigBase.extend({
|
|
|
2164
2174
|
deduplication: DeduplicationConfig.optional()
|
|
2165
2175
|
});
|
|
2166
2176
|
var ReadActionConfig = ActionConfigBase.merge(
|
|
2167
|
-
|
|
2168
|
-
type:
|
|
2177
|
+
import_zod20.z.object({
|
|
2178
|
+
type: import_zod20.z.literal(ActionType.READ),
|
|
2169
2179
|
review: DeclarationReviewConfig.describe(
|
|
2170
2180
|
"Configuration of the review page for read-only view."
|
|
2171
2181
|
)
|
|
2172
2182
|
})
|
|
2173
2183
|
);
|
|
2174
2184
|
var DeclareConfig = DeclarationActionBase.merge(
|
|
2175
|
-
|
|
2176
|
-
type:
|
|
2185
|
+
import_zod20.z.object({
|
|
2186
|
+
type: import_zod20.z.literal(ActionType.DECLARE)
|
|
2177
2187
|
})
|
|
2178
2188
|
);
|
|
2179
2189
|
var ValidateConfig = DeclarationActionBase.merge(
|
|
2180
|
-
|
|
2181
|
-
type:
|
|
2190
|
+
import_zod20.z.object({
|
|
2191
|
+
type: import_zod20.z.literal(ActionType.VALIDATE)
|
|
2182
2192
|
})
|
|
2183
2193
|
);
|
|
2184
2194
|
var RegisterConfig = DeclarationActionBase.merge(
|
|
2185
|
-
|
|
2186
|
-
type:
|
|
2195
|
+
import_zod20.z.object({
|
|
2196
|
+
type: import_zod20.z.literal(ActionType.REGISTER)
|
|
2187
2197
|
})
|
|
2188
2198
|
);
|
|
2189
2199
|
var RejectDeclarationConfig = ActionConfigBase.merge(
|
|
2190
|
-
|
|
2191
|
-
type:
|
|
2200
|
+
import_zod20.z.object({
|
|
2201
|
+
type: import_zod20.z.literal(ActionType.REJECT)
|
|
2192
2202
|
})
|
|
2193
2203
|
);
|
|
2194
2204
|
var ArchiveConfig = ActionConfigBase.merge(
|
|
2195
|
-
|
|
2196
|
-
type:
|
|
2205
|
+
import_zod20.z.object({
|
|
2206
|
+
type: import_zod20.z.literal(ActionType.ARCHIVE)
|
|
2197
2207
|
})
|
|
2198
2208
|
);
|
|
2199
2209
|
var DeleteConfig = ActionConfigBase.merge(
|
|
2200
|
-
|
|
2201
|
-
type:
|
|
2210
|
+
import_zod20.z.object({
|
|
2211
|
+
type: import_zod20.z.literal(ActionType.DELETE)
|
|
2202
2212
|
})
|
|
2203
2213
|
);
|
|
2204
2214
|
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
2205
|
-
|
|
2206
|
-
type:
|
|
2215
|
+
import_zod20.z.object({
|
|
2216
|
+
type: import_zod20.z.literal(ActionType.PRINT_CERTIFICATE),
|
|
2207
2217
|
printForm: ActionFormConfig
|
|
2208
2218
|
})
|
|
2209
2219
|
);
|
|
2210
2220
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
|
2211
|
-
|
|
2212
|
-
type:
|
|
2221
|
+
import_zod20.z.object({
|
|
2222
|
+
type: import_zod20.z.literal(ActionType.REQUEST_CORRECTION),
|
|
2213
2223
|
correctionForm: ActionFormConfig
|
|
2214
2224
|
})
|
|
2215
2225
|
);
|
|
2216
2226
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
|
2217
|
-
|
|
2218
|
-
type:
|
|
2227
|
+
import_zod20.z.object({
|
|
2228
|
+
type: import_zod20.z.literal(ActionType.REJECT_CORRECTION)
|
|
2219
2229
|
})
|
|
2220
2230
|
);
|
|
2221
2231
|
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
|
2222
|
-
|
|
2223
|
-
type:
|
|
2232
|
+
import_zod20.z.object({
|
|
2233
|
+
type: import_zod20.z.literal(ActionType.APPROVE_CORRECTION)
|
|
2224
2234
|
})
|
|
2225
2235
|
);
|
|
2226
|
-
var ActionConfig =
|
|
2236
|
+
var ActionConfig = import_zod20.z.discriminatedUnion("type", [
|
|
2227
2237
|
/*
|
|
2228
2238
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2229
2239
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
@@ -2244,87 +2254,87 @@ var ActionConfig = import_zod19.z.discriminatedUnion("type", [
|
|
|
2244
2254
|
]).describe(
|
|
2245
2255
|
"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
2256
|
).openapi({ ref: "ActionConfig" });
|
|
2247
|
-
var DeclarationActionConfig =
|
|
2257
|
+
var DeclarationActionConfig = import_zod20.z.discriminatedUnion("type", [
|
|
2248
2258
|
DeclareConfig,
|
|
2249
2259
|
ValidateConfig,
|
|
2250
2260
|
RegisterConfig
|
|
2251
2261
|
]);
|
|
2252
2262
|
|
|
2253
2263
|
// ../commons/src/events/offline/CertificateConfig.ts
|
|
2254
|
-
var
|
|
2255
|
-
var FontFamily =
|
|
2256
|
-
normal:
|
|
2257
|
-
bold:
|
|
2258
|
-
italics:
|
|
2259
|
-
bolditalics:
|
|
2264
|
+
var import_zod21 = require("zod");
|
|
2265
|
+
var FontFamily = import_zod21.z.object({
|
|
2266
|
+
normal: import_zod21.z.string(),
|
|
2267
|
+
bold: import_zod21.z.string(),
|
|
2268
|
+
italics: import_zod21.z.string(),
|
|
2269
|
+
bolditalics: import_zod21.z.string()
|
|
2260
2270
|
});
|
|
2261
|
-
var CertificateConfig =
|
|
2262
|
-
id:
|
|
2263
|
-
event:
|
|
2264
|
-
isV2Template:
|
|
2271
|
+
var CertificateConfig = import_zod21.z.object({
|
|
2272
|
+
id: import_zod21.z.string(),
|
|
2273
|
+
event: import_zod21.z.string(),
|
|
2274
|
+
isV2Template: import_zod21.z.boolean().optional(),
|
|
2265
2275
|
label: TranslationConfig,
|
|
2266
|
-
isDefault:
|
|
2267
|
-
fee:
|
|
2268
|
-
onTime:
|
|
2269
|
-
late:
|
|
2270
|
-
delayed:
|
|
2276
|
+
isDefault: import_zod21.z.boolean(),
|
|
2277
|
+
fee: import_zod21.z.object({
|
|
2278
|
+
onTime: import_zod21.z.number(),
|
|
2279
|
+
late: import_zod21.z.number(),
|
|
2280
|
+
delayed: import_zod21.z.number()
|
|
2271
2281
|
}),
|
|
2272
|
-
svgUrl:
|
|
2273
|
-
fonts:
|
|
2274
|
-
conditionals:
|
|
2282
|
+
svgUrl: import_zod21.z.string(),
|
|
2283
|
+
fonts: import_zod21.z.record(FontFamily).optional(),
|
|
2284
|
+
conditionals: import_zod21.z.array(ShowConditional).optional()
|
|
2275
2285
|
});
|
|
2276
2286
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
|
2277
|
-
hash:
|
|
2278
|
-
svg:
|
|
2287
|
+
hash: import_zod21.z.string().optional(),
|
|
2288
|
+
svg: import_zod21.z.string()
|
|
2279
2289
|
});
|
|
2280
2290
|
|
|
2281
2291
|
// ../commons/src/events/offline/LanguageConfig.ts
|
|
2282
|
-
var
|
|
2283
|
-
var LanguageConfig =
|
|
2284
|
-
lang:
|
|
2292
|
+
var import_zod22 = require("zod");
|
|
2293
|
+
var LanguageConfig = import_zod22.z.object({
|
|
2294
|
+
lang: import_zod22.z.string(),
|
|
2285
2295
|
/**
|
|
2286
2296
|
* client.csv contents
|
|
2287
2297
|
*/
|
|
2288
|
-
messages:
|
|
2298
|
+
messages: import_zod22.z.record(import_zod22.z.string())
|
|
2289
2299
|
});
|
|
2290
2300
|
|
|
2291
2301
|
// ../commons/src/events/EventConfig.ts
|
|
2292
|
-
var
|
|
2302
|
+
var import_zod27 = require("zod");
|
|
2293
2303
|
|
|
2294
2304
|
// ../commons/src/events/SummaryConfig.ts
|
|
2295
|
-
var
|
|
2296
|
-
var BaseField2 =
|
|
2305
|
+
var import_zod23 = require("zod");
|
|
2306
|
+
var BaseField2 = import_zod23.z.object({
|
|
2297
2307
|
emptyValueMessage: TranslationConfig.optional().describe(
|
|
2298
2308
|
"Default message displayed when the field value is empty."
|
|
2299
2309
|
),
|
|
2300
|
-
conditionals:
|
|
2310
|
+
conditionals: import_zod23.z.array(ShowConditional).default([]).optional()
|
|
2301
2311
|
});
|
|
2302
2312
|
var ReferenceField = BaseField2.extend({
|
|
2303
|
-
fieldId:
|
|
2313
|
+
fieldId: import_zod23.z.string(),
|
|
2304
2314
|
label: TranslationConfig.optional().describe(
|
|
2305
2315
|
"Overrides the default label from the referenced field when provided."
|
|
2306
2316
|
)
|
|
2307
2317
|
}).describe("Field referencing existing event data by field ID.");
|
|
2308
2318
|
var Field = BaseField2.extend({
|
|
2309
|
-
id:
|
|
2319
|
+
id: import_zod23.z.string().describe("Identifier of the summary field."),
|
|
2310
2320
|
value: TranslationConfig.describe(
|
|
2311
2321
|
'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
|
|
2312
2322
|
),
|
|
2313
2323
|
label: TranslationConfig
|
|
2314
2324
|
}).describe("Custom field defined for the summary view.");
|
|
2315
|
-
var SummaryConfig =
|
|
2316
|
-
fields:
|
|
2325
|
+
var SummaryConfig = import_zod23.z.object({
|
|
2326
|
+
fields: import_zod23.z.array(import_zod23.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2317
2327
|
}).describe("Configuration of the event summary section.");
|
|
2318
2328
|
|
|
2319
2329
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2320
|
-
var
|
|
2321
|
-
var MatchType =
|
|
2322
|
-
var BaseField3 =
|
|
2323
|
-
config:
|
|
2330
|
+
var import_zod24 = require("zod");
|
|
2331
|
+
var MatchType = import_zod24.z.enum(["fuzzy", "exact", "range", "within"]);
|
|
2332
|
+
var BaseField3 = import_zod24.z.object({
|
|
2333
|
+
config: import_zod24.z.object({
|
|
2324
2334
|
type: MatchType.describe(
|
|
2325
2335
|
"Determines the search type of field. How to match value."
|
|
2326
2336
|
),
|
|
2327
|
-
searchFields:
|
|
2337
|
+
searchFields: import_zod24.z.array(import_zod24.z.string()).optional().describe(
|
|
2328
2338
|
`
|
|
2329
2339
|
Defines multiple form fields that should be searched when this field has a value.
|
|
2330
2340
|
All specified fields will be combined using OR logic.
|
|
@@ -2334,7 +2344,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2334
2344
|
`
|
|
2335
2345
|
)
|
|
2336
2346
|
}),
|
|
2337
|
-
type:
|
|
2347
|
+
type: import_zod24.z.nativeEnum(FieldType).optional().describe(
|
|
2338
2348
|
`
|
|
2339
2349
|
Explicitly specify the field type for searchFields.
|
|
2340
2350
|
This is required when searchFields is defined, to show the correct control in the UI.
|
|
@@ -2348,7 +2358,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2348
2358
|
This is required when searchFields is defined.
|
|
2349
2359
|
`
|
|
2350
2360
|
),
|
|
2351
|
-
options:
|
|
2361
|
+
options: import_zod24.z.array(SelectOption).optional(),
|
|
2352
2362
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
|
2353
2363
|
`
|
|
2354
2364
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
|
@@ -2369,7 +2379,7 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2369
2379
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
|
2370
2380
|
`
|
|
2371
2381
|
),
|
|
2372
|
-
conditionals:
|
|
2382
|
+
conditionals: import_zod24.z.array(FieldConditional).default([]).optional().describe(
|
|
2373
2383
|
`
|
|
2374
2384
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
|
2375
2385
|
|
|
@@ -2383,20 +2393,20 @@ var BaseField3 = import_zod23.z.object({
|
|
|
2383
2393
|
are always rendered in the advanced search form.
|
|
2384
2394
|
`
|
|
2385
2395
|
),
|
|
2386
|
-
validations:
|
|
2396
|
+
validations: import_zod24.z.array(ValidationConfig).default([]).optional().describe(
|
|
2387
2397
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2388
2398
|
)
|
|
2389
2399
|
});
|
|
2390
|
-
var SearchQueryParams =
|
|
2391
|
-
eventType:
|
|
2400
|
+
var SearchQueryParams = import_zod24.z.object({
|
|
2401
|
+
eventType: import_zod24.z.string().optional().describe(
|
|
2392
2402
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
|
2393
2403
|
)
|
|
2394
2404
|
}).catchall(FieldValue);
|
|
2395
2405
|
var FieldConfigSchema = BaseField3.extend({
|
|
2396
|
-
fieldId:
|
|
2397
|
-
fieldType:
|
|
2406
|
+
fieldId: import_zod24.z.string(),
|
|
2407
|
+
fieldType: import_zod24.z.literal("field")
|
|
2398
2408
|
});
|
|
2399
|
-
var EventFieldIdInput =
|
|
2409
|
+
var EventFieldIdInput = import_zod24.z.enum([
|
|
2400
2410
|
"trackingId",
|
|
2401
2411
|
"status",
|
|
2402
2412
|
"legalStatuses.REGISTERED.acceptedAt",
|
|
@@ -2405,7 +2415,7 @@ var EventFieldIdInput = import_zod23.z.enum([
|
|
|
2405
2415
|
"updatedAt"
|
|
2406
2416
|
]);
|
|
2407
2417
|
var METADATA_FIELD_PREFIX = "event.";
|
|
2408
|
-
var EventFieldId =
|
|
2418
|
+
var EventFieldId = import_zod24.z.enum([
|
|
2409
2419
|
`${METADATA_FIELD_PREFIX}trackingId`,
|
|
2410
2420
|
`${METADATA_FIELD_PREFIX}status`,
|
|
2411
2421
|
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
|
@@ -2415,29 +2425,29 @@ var EventFieldId = import_zod23.z.enum([
|
|
|
2415
2425
|
]);
|
|
2416
2426
|
var EventFieldConfigSchema = BaseField3.extend({
|
|
2417
2427
|
fieldId: EventFieldId,
|
|
2418
|
-
fieldType:
|
|
2428
|
+
fieldType: import_zod24.z.literal("event")
|
|
2419
2429
|
});
|
|
2420
|
-
var AdvancedSearchField =
|
|
2430
|
+
var AdvancedSearchField = import_zod24.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
|
|
2421
2431
|
if (data.config.searchFields && data.config.searchFields.length > 0) {
|
|
2422
2432
|
if (!data.label) {
|
|
2423
2433
|
ctx.addIssue({
|
|
2424
|
-
code:
|
|
2434
|
+
code: import_zod24.z.ZodIssueCode.custom,
|
|
2425
2435
|
message: "label is required when config.searchFields is defined.",
|
|
2426
2436
|
path: ["label"]
|
|
2427
2437
|
});
|
|
2428
2438
|
}
|
|
2429
2439
|
if (!data.type) {
|
|
2430
2440
|
ctx.addIssue({
|
|
2431
|
-
code:
|
|
2441
|
+
code: import_zod24.z.ZodIssueCode.custom,
|
|
2432
2442
|
message: "type is required when config.searchFields is defined.",
|
|
2433
2443
|
path: ["type"]
|
|
2434
2444
|
});
|
|
2435
2445
|
}
|
|
2436
2446
|
}
|
|
2437
2447
|
});
|
|
2438
|
-
var AdvancedSearchConfig =
|
|
2448
|
+
var AdvancedSearchConfig = import_zod24.z.object({
|
|
2439
2449
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2440
|
-
fields:
|
|
2450
|
+
fields: import_zod24.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2441
2451
|
});
|
|
2442
2452
|
|
|
2443
2453
|
// ../commons/src/events/utils.ts
|
|
@@ -2446,11 +2456,11 @@ var import_lodash = require("lodash");
|
|
|
2446
2456
|
// ../commons/src/conditionals/validate.ts
|
|
2447
2457
|
var import__ = __toESM(require("ajv/dist/2019"));
|
|
2448
2458
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
2449
|
-
var
|
|
2459
|
+
var import_zod26 = require("zod");
|
|
2450
2460
|
var import_date_fns = require("date-fns");
|
|
2451
2461
|
|
|
2452
2462
|
// ../commons/src/events/DynamicFieldValue.ts
|
|
2453
|
-
var
|
|
2463
|
+
var import_zod25 = require("zod");
|
|
2454
2464
|
|
|
2455
2465
|
// ../commons/src/conditionals/validate.ts
|
|
2456
2466
|
var ajv = new import__.default({
|
|
@@ -2459,9 +2469,9 @@ var ajv = new import__.default({
|
|
|
2459
2469
|
strict: false
|
|
2460
2470
|
// Allow minContains and other newer features
|
|
2461
2471
|
});
|
|
2462
|
-
var DataContext =
|
|
2463
|
-
rootData:
|
|
2464
|
-
$leafAdminStructureLocationIds:
|
|
2472
|
+
var DataContext = import_zod26.z.object({
|
|
2473
|
+
rootData: import_zod26.z.object({
|
|
2474
|
+
$leafAdminStructureLocationIds: import_zod26.z.array(import_zod26.z.object({ id: UUID }))
|
|
2465
2475
|
})
|
|
2466
2476
|
});
|
|
2467
2477
|
function resolveDataPath(rootData, dataPath, instancePath) {
|
|
@@ -2538,12 +2548,12 @@ ajv.addKeyword({
|
|
|
2538
2548
|
});
|
|
2539
2549
|
|
|
2540
2550
|
// ../commons/src/utils.ts
|
|
2541
|
-
var
|
|
2542
|
-
var FullNameV1 =
|
|
2543
|
-
|
|
2544
|
-
use:
|
|
2545
|
-
family:
|
|
2546
|
-
given:
|
|
2551
|
+
var z27 = __toESM(require("zod"));
|
|
2552
|
+
var FullNameV1 = z27.array(
|
|
2553
|
+
z27.object({
|
|
2554
|
+
use: z27.string(),
|
|
2555
|
+
family: z27.string(),
|
|
2556
|
+
given: z27.array(z27.string())
|
|
2547
2557
|
})
|
|
2548
2558
|
);
|
|
2549
2559
|
function omitKeyDeep(obj, keyToRemove) {
|
|
@@ -2599,9 +2609,9 @@ var EXCLUDED_ACTIONS = [
|
|
|
2599
2609
|
|
|
2600
2610
|
// ../commons/src/events/EventConfig.ts
|
|
2601
2611
|
var import_zod_openapi10 = require("zod-openapi");
|
|
2602
|
-
(0, import_zod_openapi10.extendZodWithOpenApi)(
|
|
2603
|
-
var EventConfig =
|
|
2604
|
-
id:
|
|
2612
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod27.z);
|
|
2613
|
+
var EventConfig = import_zod27.z.object({
|
|
2614
|
+
id: import_zod27.z.string().describe(
|
|
2605
2615
|
'Machine-readable identifier of the event (e.g. "birth", "death").'
|
|
2606
2616
|
),
|
|
2607
2617
|
dateOfEvent: FieldReference.optional().describe(
|
|
@@ -2619,13 +2629,13 @@ var EventConfig = import_zod26.z.object({
|
|
|
2619
2629
|
label: TranslationConfig.describe(
|
|
2620
2630
|
"Human-readable label for the event type."
|
|
2621
2631
|
),
|
|
2622
|
-
actions:
|
|
2632
|
+
actions: import_zod27.z.array(ActionConfig).describe(
|
|
2623
2633
|
"Configuration of system-defined actions associated with the event."
|
|
2624
2634
|
),
|
|
2625
2635
|
declaration: DeclarationFormConfig.describe(
|
|
2626
2636
|
"Configuration of the form used to gather event data."
|
|
2627
2637
|
),
|
|
2628
|
-
advancedSearch:
|
|
2638
|
+
advancedSearch: import_zod27.z.array(AdvancedSearchConfig).optional().default([]).describe(
|
|
2629
2639
|
"Configuration of fields available in the advanced search feature."
|
|
2630
2640
|
)
|
|
2631
2641
|
}).superRefine((event2, ctx) => {
|
|
@@ -2688,7 +2698,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
|
2688
2698
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2689
2699
|
|
|
2690
2700
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2691
|
-
var
|
|
2701
|
+
var import_zod31 = require("zod");
|
|
2692
2702
|
|
|
2693
2703
|
// ../commons/src/conditionals/conditionals.ts
|
|
2694
2704
|
var objectHash = __toESM(require("object-hash"));
|
|
@@ -2757,6 +2767,7 @@ function wrapToPathOptional(condition, path) {
|
|
|
2757
2767
|
};
|
|
2758
2768
|
}, condition);
|
|
2759
2769
|
}
|
|
2770
|
+
var now = Object.assign(todayDateTimeValueSerializer, {});
|
|
2760
2771
|
var user = Object.assign(userSerializer, {
|
|
2761
2772
|
hasScope: (scope) => defineConditional({
|
|
2762
2773
|
type: "object",
|
|
@@ -3435,17 +3446,17 @@ var event = Object.assign(eventFn, {
|
|
|
3435
3446
|
});
|
|
3436
3447
|
|
|
3437
3448
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
|
3438
|
-
var
|
|
3449
|
+
var import_zod28 = require("zod");
|
|
3439
3450
|
var WorkqueueColumnKeysArray = [
|
|
3440
3451
|
...EventMetadataKeysArray,
|
|
3441
3452
|
"title",
|
|
3442
3453
|
"outbox"
|
|
3443
3454
|
];
|
|
3444
|
-
var WorkqueueColumnKeys =
|
|
3445
|
-
var WorkqueueColumnValue =
|
|
3455
|
+
var WorkqueueColumnKeys = import_zod28.z.enum(WorkqueueColumnKeysArray);
|
|
3456
|
+
var WorkqueueColumnValue = import_zod28.z.object({
|
|
3446
3457
|
$event: WorkqueueColumnKeys
|
|
3447
3458
|
});
|
|
3448
|
-
var WorkqueueColumn =
|
|
3459
|
+
var WorkqueueColumn = import_zod28.z.object({
|
|
3449
3460
|
label: TranslationConfig,
|
|
3450
3461
|
value: WorkqueueColumnValue
|
|
3451
3462
|
});
|
|
@@ -3456,57 +3467,57 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
|
3456
3467
|
}
|
|
3457
3468
|
|
|
3458
3469
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
|
3459
|
-
var
|
|
3460
|
-
var SerializableExact =
|
|
3461
|
-
type:
|
|
3462
|
-
term:
|
|
3470
|
+
var import_zod29 = require("zod");
|
|
3471
|
+
var SerializableExact = import_zod29.z.object({
|
|
3472
|
+
type: import_zod29.z.literal("exact"),
|
|
3473
|
+
term: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
3463
3474
|
});
|
|
3464
|
-
var SerializableWithin =
|
|
3465
|
-
type:
|
|
3466
|
-
location:
|
|
3475
|
+
var SerializableWithin = import_zod29.z.object({
|
|
3476
|
+
type: import_zod29.z.literal("within"),
|
|
3477
|
+
location: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
|
|
3467
3478
|
});
|
|
3468
|
-
var SerializedQueryExpression =
|
|
3469
|
-
eventType:
|
|
3470
|
-
status:
|
|
3471
|
-
createdAt:
|
|
3472
|
-
updatedAt:
|
|
3473
|
-
"legalStatuses.REGISTERED.createdAt":
|
|
3474
|
-
"legalStatuses.REGISTERED.createdAtLocation":
|
|
3475
|
-
|
|
3479
|
+
var SerializedQueryExpression = import_zod29.z.object({
|
|
3480
|
+
eventType: import_zod29.z.string(),
|
|
3481
|
+
status: import_zod29.z.optional(import_zod29.z.union([AnyOfStatus, ExactStatus])),
|
|
3482
|
+
createdAt: import_zod29.z.optional(DateCondition),
|
|
3483
|
+
updatedAt: import_zod29.z.optional(DateCondition),
|
|
3484
|
+
"legalStatuses.REGISTERED.createdAt": import_zod29.z.optional(DateCondition),
|
|
3485
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod29.z.optional(
|
|
3486
|
+
import_zod29.z.union([Within, Exact])
|
|
3476
3487
|
),
|
|
3477
|
-
"legalStatuses.REGISTERED.registrationNumber":
|
|
3478
|
-
createdAtLocation:
|
|
3479
|
-
|
|
3488
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod29.z.optional(Exact),
|
|
3489
|
+
createdAtLocation: import_zod29.z.optional(
|
|
3490
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
3480
3491
|
),
|
|
3481
|
-
updatedAtLocation:
|
|
3482
|
-
|
|
3492
|
+
updatedAtLocation: import_zod29.z.optional(
|
|
3493
|
+
import_zod29.z.union([SerializableWithin, SerializableExact])
|
|
3483
3494
|
),
|
|
3484
|
-
assignedTo:
|
|
3485
|
-
createdBy:
|
|
3495
|
+
assignedTo: import_zod29.z.optional(SerializableExact),
|
|
3496
|
+
createdBy: import_zod29.z.optional(SerializableExact),
|
|
3486
3497
|
createdByUserType: ExactUserType,
|
|
3487
|
-
updatedBy:
|
|
3488
|
-
trackingId:
|
|
3489
|
-
flags:
|
|
3498
|
+
updatedBy: import_zod29.z.optional(SerializableExact),
|
|
3499
|
+
trackingId: import_zod29.z.optional(Exact),
|
|
3500
|
+
flags: import_zod29.z.optional(ContainsFlags),
|
|
3490
3501
|
data: QueryInput
|
|
3491
3502
|
}).partial();
|
|
3492
|
-
var Or2 =
|
|
3493
|
-
type:
|
|
3494
|
-
clauses:
|
|
3503
|
+
var Or2 = import_zod29.z.object({
|
|
3504
|
+
type: import_zod29.z.literal("or"),
|
|
3505
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
3495
3506
|
});
|
|
3496
|
-
var And2 =
|
|
3497
|
-
type:
|
|
3498
|
-
clauses:
|
|
3507
|
+
var And2 = import_zod29.z.object({
|
|
3508
|
+
type: import_zod29.z.literal("and"),
|
|
3509
|
+
clauses: import_zod29.z.array(SerializedQueryExpression)
|
|
3499
3510
|
});
|
|
3500
|
-
var CountryConfigQueryType =
|
|
3501
|
-
var CountryConfigQueryInputType =
|
|
3511
|
+
var CountryConfigQueryType = import_zod29.z.discriminatedUnion("type", [And2, Or2]);
|
|
3512
|
+
var CountryConfigQueryInputType = import_zod29.z.union([
|
|
3502
3513
|
SerializedQueryExpression,
|
|
3503
3514
|
And2,
|
|
3504
3515
|
Or2
|
|
3505
3516
|
]);
|
|
3506
3517
|
|
|
3507
3518
|
// ../commons/src/icons.ts
|
|
3508
|
-
var
|
|
3509
|
-
var AvailableIcons =
|
|
3519
|
+
var import_zod30 = require("zod");
|
|
3520
|
+
var AvailableIcons = import_zod30.z.enum([
|
|
3510
3521
|
"Archived",
|
|
3511
3522
|
"Assigned",
|
|
3512
3523
|
"Certified",
|
|
@@ -3627,23 +3638,23 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
|
3627
3638
|
value: event.field("updatedAt")
|
|
3628
3639
|
}
|
|
3629
3640
|
]);
|
|
3630
|
-
var WorkqueueActionsWithDefault =
|
|
3641
|
+
var WorkqueueActionsWithDefault = import_zod31.z.enum([
|
|
3631
3642
|
...workqueueActions.options,
|
|
3632
3643
|
"DEFAULT"
|
|
3633
3644
|
]);
|
|
3634
|
-
var WorkqueueConfig =
|
|
3635
|
-
slug:
|
|
3645
|
+
var WorkqueueConfig = import_zod31.z.object({
|
|
3646
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
3636
3647
|
name: TranslationConfig.describe(
|
|
3637
3648
|
"Title of the workflow (both in navigation and on the page)"
|
|
3638
3649
|
),
|
|
3639
3650
|
query: CountryConfigQueryType,
|
|
3640
|
-
actions:
|
|
3641
|
-
|
|
3651
|
+
actions: import_zod31.z.array(
|
|
3652
|
+
import_zod31.z.object({
|
|
3642
3653
|
type: WorkqueueActionsWithDefault,
|
|
3643
|
-
conditionals:
|
|
3654
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3644
3655
|
})
|
|
3645
3656
|
),
|
|
3646
|
-
columns:
|
|
3657
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3647
3658
|
icon: AvailableIcons,
|
|
3648
3659
|
emptyMessage: TranslationConfig.optional()
|
|
3649
3660
|
}).describe("Configuration for workqueue.");
|
|
@@ -3651,26 +3662,26 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
3651
3662
|
query: true,
|
|
3652
3663
|
columns: true
|
|
3653
3664
|
});
|
|
3654
|
-
var WorkqueueConfigInput =
|
|
3655
|
-
slug:
|
|
3665
|
+
var WorkqueueConfigInput = import_zod31.z.object({
|
|
3666
|
+
slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
|
|
3656
3667
|
name: TranslationConfig.describe(
|
|
3657
3668
|
"Title of the workflow (both in navigation and on the page)"
|
|
3658
3669
|
),
|
|
3659
3670
|
query: CountryConfigQueryInputType,
|
|
3660
|
-
actions:
|
|
3661
|
-
|
|
3671
|
+
actions: import_zod31.z.array(
|
|
3672
|
+
import_zod31.z.object({
|
|
3662
3673
|
type: WorkqueueActionsWithDefault,
|
|
3663
|
-
conditionals:
|
|
3674
|
+
conditionals: import_zod31.z.array(Conditional).optional()
|
|
3664
3675
|
})
|
|
3665
3676
|
),
|
|
3666
|
-
columns:
|
|
3677
|
+
columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
|
|
3667
3678
|
icon: AvailableIcons,
|
|
3668
3679
|
emptyMessage: TranslationConfig.optional()
|
|
3669
3680
|
});
|
|
3670
|
-
var WorkqueueCountInput =
|
|
3671
|
-
|
|
3681
|
+
var WorkqueueCountInput = import_zod31.z.array(
|
|
3682
|
+
import_zod31.z.object({ slug: import_zod31.z.string(), query: QueryType })
|
|
3672
3683
|
);
|
|
3673
|
-
var WorkqueueCountOutput =
|
|
3684
|
+
var WorkqueueCountOutput = import_zod31.z.record(import_zod31.z.string(), import_zod31.z.number());
|
|
3674
3685
|
|
|
3675
3686
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
|
3676
3687
|
var defaultWorkqueueColumns = [
|
|
@@ -3693,45 +3704,45 @@ var defaultWorkqueueColumns = [
|
|
|
3693
3704
|
];
|
|
3694
3705
|
|
|
3695
3706
|
// ../commons/src/events/Draft.ts
|
|
3696
|
-
var
|
|
3707
|
+
var import_zod33 = require("zod");
|
|
3697
3708
|
|
|
3698
3709
|
// ../commons/src/events/ActionInput.ts
|
|
3699
|
-
var
|
|
3710
|
+
var import_zod32 = require("zod");
|
|
3700
3711
|
var import_zod_openapi11 = require("zod-openapi");
|
|
3701
|
-
(0, import_zod_openapi11.extendZodWithOpenApi)(
|
|
3702
|
-
var BaseActionInput =
|
|
3712
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod32.z);
|
|
3713
|
+
var BaseActionInput = import_zod32.z.object({
|
|
3703
3714
|
eventId: UUID,
|
|
3704
|
-
transactionId:
|
|
3715
|
+
transactionId: import_zod32.z.string(),
|
|
3705
3716
|
declaration: ActionUpdate.default({}),
|
|
3706
3717
|
annotation: ActionUpdate.optional(),
|
|
3707
3718
|
originalActionId: UUID.optional(),
|
|
3708
3719
|
// should not be part of base action.
|
|
3709
|
-
keepAssignment:
|
|
3720
|
+
keepAssignment: import_zod32.z.boolean().optional(),
|
|
3710
3721
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
3711
3722
|
createdAtLocation: CreatedAtLocation.describe(
|
|
3712
3723
|
"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
3724
|
)
|
|
3714
3725
|
});
|
|
3715
3726
|
var CreateActionInput = BaseActionInput.merge(
|
|
3716
|
-
|
|
3717
|
-
type:
|
|
3727
|
+
import_zod32.z.object({
|
|
3728
|
+
type: import_zod32.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
|
3718
3729
|
createdAtLocation: CreatedAtLocation
|
|
3719
3730
|
})
|
|
3720
3731
|
);
|
|
3721
3732
|
var RegisterActionInput = BaseActionInput.merge(
|
|
3722
|
-
|
|
3723
|
-
type:
|
|
3724
|
-
registrationNumber:
|
|
3733
|
+
import_zod32.z.object({
|
|
3734
|
+
type: import_zod32.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
|
3735
|
+
registrationNumber: import_zod32.z.string().optional()
|
|
3725
3736
|
})
|
|
3726
3737
|
).strict();
|
|
3727
3738
|
var ValidateActionInput = BaseActionInput.merge(
|
|
3728
|
-
|
|
3729
|
-
type:
|
|
3739
|
+
import_zod32.z.object({
|
|
3740
|
+
type: import_zod32.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
|
|
3730
3741
|
})
|
|
3731
3742
|
);
|
|
3732
3743
|
var NotifyActionInput = BaseActionInput.merge(
|
|
3733
|
-
|
|
3734
|
-
type:
|
|
3744
|
+
import_zod32.z.object({
|
|
3745
|
+
type: import_zod32.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
|
3735
3746
|
})
|
|
3736
3747
|
).openapi({
|
|
3737
3748
|
default: {
|
|
@@ -3743,86 +3754,86 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
|
3743
3754
|
}
|
|
3744
3755
|
});
|
|
3745
3756
|
var DeclareActionInput = BaseActionInput.merge(
|
|
3746
|
-
|
|
3747
|
-
type:
|
|
3757
|
+
import_zod32.z.object({
|
|
3758
|
+
type: import_zod32.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
|
3748
3759
|
})
|
|
3749
3760
|
);
|
|
3750
3761
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
|
3751
|
-
|
|
3752
|
-
type:
|
|
3762
|
+
import_zod32.z.object({
|
|
3763
|
+
type: import_zod32.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
|
|
3753
3764
|
content: PrintContent.optional()
|
|
3754
3765
|
})
|
|
3755
3766
|
);
|
|
3756
3767
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
|
3757
|
-
|
|
3758
|
-
type:
|
|
3768
|
+
import_zod32.z.object({
|
|
3769
|
+
type: import_zod32.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
|
3759
3770
|
content: ReasonContent
|
|
3760
3771
|
})
|
|
3761
3772
|
);
|
|
3762
3773
|
var DuplicateDetectedActionInput = BaseActionInput.merge(
|
|
3763
|
-
|
|
3764
|
-
type:
|
|
3765
|
-
content:
|
|
3766
|
-
duplicates:
|
|
3774
|
+
import_zod32.z.object({
|
|
3775
|
+
type: import_zod32.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
|
|
3776
|
+
content: import_zod32.z.object({
|
|
3777
|
+
duplicates: import_zod32.z.array(PotentialDuplicate)
|
|
3767
3778
|
})
|
|
3768
3779
|
})
|
|
3769
3780
|
);
|
|
3770
3781
|
var MarkAsDuplicateActionInput = BaseActionInput.merge(
|
|
3771
|
-
|
|
3772
|
-
type:
|
|
3773
|
-
content:
|
|
3782
|
+
import_zod32.z.object({
|
|
3783
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
|
|
3784
|
+
content: import_zod32.z.object({
|
|
3774
3785
|
duplicateOf: UUID
|
|
3775
3786
|
}).optional()
|
|
3776
3787
|
})
|
|
3777
3788
|
);
|
|
3778
3789
|
var MarkNotDuplicateActionInput = BaseActionInput.merge(
|
|
3779
|
-
|
|
3780
|
-
type:
|
|
3790
|
+
import_zod32.z.object({
|
|
3791
|
+
type: import_zod32.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3781
3792
|
})
|
|
3782
3793
|
);
|
|
3783
3794
|
var ArchiveActionInput = BaseActionInput.merge(
|
|
3784
|
-
|
|
3785
|
-
type:
|
|
3795
|
+
import_zod32.z.object({
|
|
3796
|
+
type: import_zod32.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
|
3786
3797
|
content: ReasonContent
|
|
3787
3798
|
})
|
|
3788
3799
|
);
|
|
3789
3800
|
var AssignActionInput = BaseActionInput.merge(
|
|
3790
|
-
|
|
3791
|
-
type:
|
|
3792
|
-
assignedTo:
|
|
3801
|
+
import_zod32.z.object({
|
|
3802
|
+
type: import_zod32.z.literal(ActionType.ASSIGN),
|
|
3803
|
+
assignedTo: import_zod32.z.string()
|
|
3793
3804
|
})
|
|
3794
3805
|
);
|
|
3795
3806
|
var UnassignActionInput = BaseActionInput.merge(
|
|
3796
|
-
|
|
3797
|
-
type:
|
|
3798
|
-
assignedTo:
|
|
3807
|
+
import_zod32.z.object({
|
|
3808
|
+
type: import_zod32.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
|
3809
|
+
assignedTo: import_zod32.z.literal(null).default(null)
|
|
3799
3810
|
})
|
|
3800
3811
|
);
|
|
3801
3812
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3802
|
-
|
|
3803
|
-
type:
|
|
3813
|
+
import_zod32.z.object({
|
|
3814
|
+
type: import_zod32.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
|
3804
3815
|
})
|
|
3805
3816
|
);
|
|
3806
3817
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
|
3807
|
-
|
|
3808
|
-
requestId:
|
|
3809
|
-
type:
|
|
3818
|
+
import_zod32.z.object({
|
|
3819
|
+
requestId: import_zod32.z.string(),
|
|
3820
|
+
type: import_zod32.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
|
3810
3821
|
content: ReasonContent
|
|
3811
3822
|
})
|
|
3812
3823
|
);
|
|
3813
3824
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
|
3814
|
-
|
|
3815
|
-
requestId:
|
|
3816
|
-
type:
|
|
3825
|
+
import_zod32.z.object({
|
|
3826
|
+
requestId: import_zod32.z.string(),
|
|
3827
|
+
type: import_zod32.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
3817
3828
|
})
|
|
3818
3829
|
);
|
|
3819
3830
|
var ReadActionInput = BaseActionInput.merge(
|
|
3820
|
-
|
|
3821
|
-
type:
|
|
3831
|
+
import_zod32.z.object({
|
|
3832
|
+
type: import_zod32.z.literal(ActionType.READ).default(ActionType.READ)
|
|
3822
3833
|
})
|
|
3823
3834
|
);
|
|
3824
|
-
var DeleteActionInput =
|
|
3825
|
-
var ActionInput =
|
|
3835
|
+
var DeleteActionInput = import_zod32.z.object({ eventId: UUID });
|
|
3836
|
+
var ActionInput = import_zod32.z.discriminatedUnion("type", [
|
|
3826
3837
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
|
3827
3838
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
|
3828
3839
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
|
@@ -3857,11 +3868,11 @@ var ActionInput = import_zod31.z.discriminatedUnion("type", [
|
|
|
3857
3868
|
});
|
|
3858
3869
|
|
|
3859
3870
|
// ../commons/src/events/Draft.ts
|
|
3860
|
-
var Draft =
|
|
3871
|
+
var Draft = import_zod33.z.object({
|
|
3861
3872
|
id: UUID,
|
|
3862
3873
|
eventId: UUID,
|
|
3863
|
-
transactionId:
|
|
3864
|
-
createdAt:
|
|
3874
|
+
transactionId: import_zod33.z.string(),
|
|
3875
|
+
createdAt: import_zod33.z.string().datetime(),
|
|
3865
3876
|
action: ActionBase.extend({
|
|
3866
3877
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
|
|
3867
3878
|
}).omit({ id: true, createdAtLocation: true })
|
|
@@ -3870,7 +3881,7 @@ var Draft = import_zod32.z.object({
|
|
|
3870
3881
|
);
|
|
3871
3882
|
var DraftInput = BaseActionInput.extend({
|
|
3872
3883
|
type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
|
|
3873
|
-
status:
|
|
3884
|
+
status: import_zod33.z.enum([
|
|
3874
3885
|
ActionStatus.Requested,
|
|
3875
3886
|
ActionStatus.Accepted,
|
|
3876
3887
|
ActionStatus.Rejected
|
|
@@ -3878,26 +3889,26 @@ var DraftInput = BaseActionInput.extend({
|
|
|
3878
3889
|
});
|
|
3879
3890
|
|
|
3880
3891
|
// ../commons/src/events/EventInput.ts
|
|
3881
|
-
var
|
|
3892
|
+
var import_zod34 = require("zod");
|
|
3882
3893
|
var import_uuid10 = require("uuid");
|
|
3883
|
-
var EventInput =
|
|
3884
|
-
transactionId:
|
|
3885
|
-
type:
|
|
3894
|
+
var EventInput = import_zod34.z.object({
|
|
3895
|
+
transactionId: import_zod34.z.string(),
|
|
3896
|
+
type: import_zod34.z.string()
|
|
3886
3897
|
}).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
|
|
3887
3898
|
|
|
3888
3899
|
// ../commons/src/events/EventDocument.ts
|
|
3889
|
-
var
|
|
3900
|
+
var import_zod35 = require("zod");
|
|
3890
3901
|
var import_zod_openapi12 = require("zod-openapi");
|
|
3891
|
-
(0, import_zod_openapi12.extendZodWithOpenApi)(
|
|
3892
|
-
var EventDocument =
|
|
3902
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod35.z);
|
|
3903
|
+
var EventDocument = import_zod35.z.object({
|
|
3893
3904
|
id: UUID.describe("Unique identifier of the event."),
|
|
3894
|
-
type:
|
|
3895
|
-
createdAt:
|
|
3896
|
-
updatedAt:
|
|
3905
|
+
type: import_zod35.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
|
|
3906
|
+
createdAt: import_zod35.z.string().datetime().describe("Timestamp indicating when the event was created."),
|
|
3907
|
+
updatedAt: import_zod35.z.string().datetime().describe(
|
|
3897
3908
|
"Timestamp of the last update, excluding changes from actions."
|
|
3898
3909
|
),
|
|
3899
|
-
actions:
|
|
3900
|
-
trackingId:
|
|
3910
|
+
actions: import_zod35.z.array(Action).describe("Ordered list of actions associated with the event."),
|
|
3911
|
+
trackingId: import_zod35.z.string().describe(
|
|
3901
3912
|
"System-generated tracking identifier used to look up the event."
|
|
3902
3913
|
)
|
|
3903
3914
|
}).openapi({ ref: "EventDocument" });
|
|
@@ -6056,8 +6067,35 @@ var mother = defineFormPage({
|
|
|
6056
6067
|
secured: true,
|
|
6057
6068
|
validation: [],
|
|
6058
6069
|
label: generateTranslationConfig("Date of birth"),
|
|
6070
|
+
conditionals: [
|
|
6071
|
+
{
|
|
6072
|
+
type: "SHOW",
|
|
6073
|
+
conditional: not(field("mother.dobUnknown").isEqualTo(true))
|
|
6074
|
+
}
|
|
6075
|
+
]
|
|
6076
|
+
},
|
|
6077
|
+
{
|
|
6078
|
+
id: "mother.dobUnknown",
|
|
6079
|
+
type: "CHECKBOX",
|
|
6080
|
+
label: generateTranslationConfig("Exact date of birth unknown"),
|
|
6059
6081
|
conditionals: []
|
|
6060
6082
|
},
|
|
6083
|
+
{
|
|
6084
|
+
id: "mother.age",
|
|
6085
|
+
type: FieldType.AGE,
|
|
6086
|
+
required: true,
|
|
6087
|
+
analytics: true,
|
|
6088
|
+
label: generateTranslationConfig("Age of mother"),
|
|
6089
|
+
configuration: {
|
|
6090
|
+
asOfDate: field("child.dob")
|
|
6091
|
+
},
|
|
6092
|
+
conditionals: [
|
|
6093
|
+
{
|
|
6094
|
+
type: "SHOW",
|
|
6095
|
+
conditional: field("mother.dobUnknown").isEqualTo(true)
|
|
6096
|
+
}
|
|
6097
|
+
]
|
|
6098
|
+
},
|
|
6061
6099
|
{
|
|
6062
6100
|
id: "mother.idType",
|
|
6063
6101
|
type: FieldType.SELECT,
|
|
@@ -6381,8 +6419,8 @@ var digitalIdentityEvent = defineConfig({
|
|
|
6381
6419
|
});
|
|
6382
6420
|
|
|
6383
6421
|
// ../commons/src/events/test.utils.ts
|
|
6384
|
-
var
|
|
6385
|
-
var TestUserRole =
|
|
6422
|
+
var import_zod36 = require("zod");
|
|
6423
|
+
var TestUserRole = import_zod36.z.enum([
|
|
6386
6424
|
"FIELD_AGENT",
|
|
6387
6425
|
"LOCAL_REGISTRAR",
|
|
6388
6426
|
"LOCAL_SYSTEM_ADMIN",
|
|
@@ -6485,22 +6523,22 @@ var ACTION_FILTERS = {
|
|
|
6485
6523
|
var import_lodash6 = require("lodash");
|
|
6486
6524
|
|
|
6487
6525
|
// ../commons/src/events/locations.ts
|
|
6488
|
-
var
|
|
6489
|
-
var LocationType =
|
|
6526
|
+
var import_zod37 = require("zod");
|
|
6527
|
+
var LocationType = import_zod37.z.enum([
|
|
6490
6528
|
"ADMIN_STRUCTURE",
|
|
6491
6529
|
"CRVS_OFFICE",
|
|
6492
6530
|
"HEALTH_FACILITY"
|
|
6493
6531
|
]);
|
|
6494
|
-
var Location =
|
|
6532
|
+
var Location = import_zod37.z.object({
|
|
6495
6533
|
id: UUID,
|
|
6496
|
-
name:
|
|
6534
|
+
name: import_zod37.z.string(),
|
|
6497
6535
|
parentId: UUID.nullable(),
|
|
6498
|
-
validUntil:
|
|
6536
|
+
validUntil: import_zod37.z.string().datetime().nullable(),
|
|
6499
6537
|
locationType: LocationType.nullable()
|
|
6500
6538
|
});
|
|
6501
6539
|
|
|
6502
6540
|
// ../commons/src/notification/UserNotifications.ts
|
|
6503
|
-
var
|
|
6541
|
+
var import_zod38 = require("zod");
|
|
6504
6542
|
var TriggerEvent = {
|
|
6505
6543
|
USER_CREATED: "user-created",
|
|
6506
6544
|
USER_UPDATED: "user-updated",
|
|
@@ -6512,50 +6550,50 @@ var TriggerEvent = {
|
|
|
6512
6550
|
CHANGE_PHONE_NUMBER: "change-phone-number",
|
|
6513
6551
|
CHANGE_EMAIL_ADDRESS: "change-email-address"
|
|
6514
6552
|
};
|
|
6515
|
-
var Recipient =
|
|
6553
|
+
var Recipient = import_zod38.z.object({
|
|
6516
6554
|
name: NameFieldValue.optional(),
|
|
6517
|
-
mobile:
|
|
6518
|
-
email:
|
|
6519
|
-
bcc:
|
|
6555
|
+
mobile: import_zod38.z.string().optional(),
|
|
6556
|
+
email: import_zod38.z.string().optional(),
|
|
6557
|
+
bcc: import_zod38.z.array(import_zod38.z.string()).optional()
|
|
6520
6558
|
});
|
|
6521
|
-
var BasePayload =
|
|
6559
|
+
var BasePayload = import_zod38.z.object({
|
|
6522
6560
|
recipient: Recipient
|
|
6523
6561
|
});
|
|
6524
6562
|
var TriggerPayload = {
|
|
6525
6563
|
[TriggerEvent.USER_CREATED]: BasePayload.extend({
|
|
6526
|
-
username:
|
|
6527
|
-
temporaryPassword:
|
|
6564
|
+
username: import_zod38.z.string(),
|
|
6565
|
+
temporaryPassword: import_zod38.z.string()
|
|
6528
6566
|
}),
|
|
6529
6567
|
[TriggerEvent.USER_UPDATED]: BasePayload.extend({
|
|
6530
|
-
oldUsername:
|
|
6531
|
-
newUsername:
|
|
6568
|
+
oldUsername: import_zod38.z.string(),
|
|
6569
|
+
newUsername: import_zod38.z.string()
|
|
6532
6570
|
}),
|
|
6533
6571
|
[TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
|
|
6534
|
-
username:
|
|
6572
|
+
username: import_zod38.z.string()
|
|
6535
6573
|
}),
|
|
6536
6574
|
[TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
|
|
6537
|
-
code:
|
|
6575
|
+
code: import_zod38.z.string()
|
|
6538
6576
|
}),
|
|
6539
6577
|
[TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
|
|
6540
|
-
temporaryPassword:
|
|
6541
|
-
admin:
|
|
6542
|
-
id:
|
|
6578
|
+
temporaryPassword: import_zod38.z.string(),
|
|
6579
|
+
admin: import_zod38.z.object({
|
|
6580
|
+
id: import_zod38.z.string(),
|
|
6543
6581
|
name: NameFieldValue,
|
|
6544
|
-
role:
|
|
6582
|
+
role: import_zod38.z.string()
|
|
6545
6583
|
})
|
|
6546
6584
|
}),
|
|
6547
6585
|
[TriggerEvent.TWO_FA]: BasePayload.extend({
|
|
6548
|
-
code:
|
|
6586
|
+
code: import_zod38.z.string()
|
|
6549
6587
|
}),
|
|
6550
6588
|
[TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
|
|
6551
|
-
subject:
|
|
6552
|
-
body:
|
|
6589
|
+
subject: import_zod38.z.string(),
|
|
6590
|
+
body: import_zod38.z.string()
|
|
6553
6591
|
}),
|
|
6554
6592
|
[TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
|
|
6555
|
-
code:
|
|
6593
|
+
code: import_zod38.z.string()
|
|
6556
6594
|
}),
|
|
6557
6595
|
[TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
|
|
6558
|
-
code:
|
|
6596
|
+
code: import_zod38.z.string()
|
|
6559
6597
|
})
|
|
6560
6598
|
};
|
|
6561
6599
|
async function triggerUserEventNotification({
|