@opencrvs/toolkit 2.0.0-rc.57eca4e → 2.0.0-rc.57fff6f
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/application-config/index.js +65 -36
- package/dist/cli.js +17 -6
- package/dist/commons/api/router.d.ts +100 -17
- package/dist/commons/application-config/index.d.ts +1 -0
- package/dist/commons/conditionals/conditionals.d.ts +351 -7
- package/dist/commons/conditionals/validate.d.ts +51 -2
- package/dist/commons/events/ActionConfig.d.ts +28 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +6 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +354 -0
- package/dist/commons/events/EventConfig.d.ts +2 -0
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/EventIndex.d.ts +11 -0
- package/dist/commons/events/EventMetadata.d.ts +26 -0
- package/dist/commons/events/FieldConfig.d.ts +388 -50
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- package/dist/commons/events/FieldValue.d.ts +6 -0
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locations.d.ts +1 -0
- package/dist/commons/events/state/flags.d.ts +1 -0
- package/dist/commons/events/state/index.d.ts +8 -0
- package/dist/commons/events/state/utils.d.ts +21 -287
- package/dist/commons/events/utils.d.ts +12 -1
- package/dist/conditionals/index.js +55 -3
- package/dist/events/index.js +417 -149
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
- package/dist/migrations/v2.0/index.js +17 -6
- package/dist/notification/index.js +260 -41
- package/dist/scopes/index.d.ts +92 -6
- package/dist/scopes/index.js +16 -5
- package/opencrvs-toolkit-2.0.0-rc.57fff6f.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.0-rc.57eca4e.tgz +0 -0
|
@@ -206,6 +206,11 @@ var FieldTypesToHideInReview = [
|
|
|
206
206
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
207
207
|
FieldType.ALPHA_HIDDEN
|
|
208
208
|
];
|
|
209
|
+
var HiddenFieldTypes = [
|
|
210
|
+
FieldType.HTTP,
|
|
211
|
+
FieldType.QUERY_PARAM_READER,
|
|
212
|
+
FieldType.ALPHA_HIDDEN
|
|
213
|
+
];
|
|
209
214
|
|
|
210
215
|
// ../commons/src/events/FieldValue.ts
|
|
211
216
|
var z7 = __toESM(require("zod/v4"));
|
|
@@ -324,7 +329,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
324
329
|
// ../commons/src/events/FieldValue.ts
|
|
325
330
|
var TextValue = z7.string();
|
|
326
331
|
var HiddenFieldValue = z7.string();
|
|
327
|
-
var NonEmptyTextValue =
|
|
332
|
+
var NonEmptyTextValue = z7.string().trim().min(1);
|
|
328
333
|
var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
329
334
|
var AgeValue = z7.object({
|
|
330
335
|
age: z7.number(),
|
|
@@ -353,6 +358,7 @@ var DateRangeFieldValue = z7.object({
|
|
|
353
358
|
var EmailValue = z7.email();
|
|
354
359
|
var CheckboxFieldValue = z7.boolean();
|
|
355
360
|
var NumberFieldValue = z7.number();
|
|
361
|
+
var SignatureFieldValue = FileFieldValue;
|
|
356
362
|
var ButtonFieldValue = z7.number();
|
|
357
363
|
var VerificationStatusValue = z7.enum([
|
|
358
364
|
"verified",
|
|
@@ -660,6 +666,8 @@ var scopeOptionsPlaceEvent = z11.object({
|
|
|
660
666
|
placeOfEvent: JurisdictionFilter.optional()
|
|
661
667
|
}).describe("Options applicable to all record scopes.");
|
|
662
668
|
var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
669
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
670
|
+
notifiedBy: UserFilter.optional(),
|
|
663
671
|
declaredIn: JurisdictionFilter.optional(),
|
|
664
672
|
declaredBy: UserFilter.optional()
|
|
665
673
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
@@ -701,6 +709,8 @@ var ResolvedScopeOptionsPlaceEvent = z11.object({
|
|
|
701
709
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
702
710
|
);
|
|
703
711
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
712
|
+
notifiedIn: UUID.nullish(),
|
|
713
|
+
notifiedBy: z11.string().optional(),
|
|
704
714
|
declaredIn: UUID.nullish(),
|
|
705
715
|
declaredBy: z11.string().optional()
|
|
706
716
|
}).describe(
|
|
@@ -835,8 +845,9 @@ var EncodedScope = z11.string().brand("EncodedScope");
|
|
|
835
845
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
836
846
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
837
847
|
accessLevel: JurisdictionFilter.enum.all,
|
|
838
|
-
|
|
839
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
848
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
849
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
850
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
840
851
|
};
|
|
841
852
|
|
|
842
853
|
// ../commons/src/authentication.ts
|
|
@@ -989,8 +1000,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
989
1000
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
990
1001
|
z13.object({
|
|
991
1002
|
type: z13.literal(ActionType.APPROVE_CORRECTION),
|
|
992
|
-
requestId: z13.string()
|
|
1003
|
+
requestId: z13.string(),
|
|
993
1004
|
// TODO move into 'content' property
|
|
1005
|
+
content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
|
|
994
1006
|
}).shape
|
|
995
1007
|
);
|
|
996
1008
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1124,6 +1136,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1124
1136
|
)
|
|
1125
1137
|
});
|
|
1126
1138
|
var LegalStatuses = z15.object({
|
|
1139
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1127
1140
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1128
1141
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1129
1142
|
});
|
|
@@ -1183,6 +1196,8 @@ var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
|
|
|
1183
1196
|
var EventMetadataDateFieldIdInput = z15.enum([
|
|
1184
1197
|
"createdAt",
|
|
1185
1198
|
"updatedAt",
|
|
1199
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1200
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1186
1201
|
"legalStatuses.DECLARED.createdAt",
|
|
1187
1202
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1188
1203
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1191,6 +1206,8 @@ var EventMetadataDateFieldIdInput = z15.enum([
|
|
|
1191
1206
|
var EventMetadataDateFieldId = z15.enum([
|
|
1192
1207
|
"event.createdAt",
|
|
1193
1208
|
"event.updatedAt",
|
|
1209
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1210
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1194
1211
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1195
1212
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1196
1213
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1410,8 +1427,18 @@ var FieldReference = import_v43.default.object({
|
|
|
1410
1427
|
$$field: FieldId.describe("Id of the field to reference"),
|
|
1411
1428
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1412
1429
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1430
|
+
),
|
|
1431
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1432
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1433
|
+
)
|
|
1434
|
+
}).describe(
|
|
1435
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1436
|
+
);
|
|
1437
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1438
|
+
$$code: import_v43.default.string().describe(
|
|
1439
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1413
1440
|
)
|
|
1414
|
-
}).describe("
|
|
1441
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1415
1442
|
var ValidationConfig = import_v43.default.object({
|
|
1416
1443
|
validator: Conditional.describe(
|
|
1417
1444
|
"Conditional expression that must hold for the field value to be considered valid."
|
|
@@ -1452,7 +1479,7 @@ var BaseField = import_v43.default.object({
|
|
|
1452
1479
|
"Indicates whether the field can be modified during record correction."
|
|
1453
1480
|
),
|
|
1454
1481
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1455
|
-
"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."
|
|
1482
|
+
"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. A FieldReference with $$code computes the value via a custom client-side function."
|
|
1456
1483
|
),
|
|
1457
1484
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1458
1485
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1466,7 +1493,7 @@ var Divider = BaseField.extend({
|
|
|
1466
1493
|
});
|
|
1467
1494
|
var TextField = BaseField.extend({
|
|
1468
1495
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1469
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1496
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1470
1497
|
configuration: import_v43.default.object({
|
|
1471
1498
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1472
1499
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
@@ -1479,10 +1506,11 @@ var TextField = BaseField.extend({
|
|
|
1479
1506
|
});
|
|
1480
1507
|
var NumberField = BaseField.extend({
|
|
1481
1508
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1482
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1509
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1483
1510
|
configuration: import_v43.default.object({
|
|
1484
1511
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1485
1512
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1513
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1486
1514
|
prefix: TranslationConfig.optional(),
|
|
1487
1515
|
postfix: TranslationConfig.optional()
|
|
1488
1516
|
}).optional()
|
|
@@ -1492,7 +1520,7 @@ var NumberField = BaseField.extend({
|
|
|
1492
1520
|
});
|
|
1493
1521
|
var TextAreaField = BaseField.extend({
|
|
1494
1522
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1495
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1523
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1496
1524
|
configuration: import_v43.default.object({
|
|
1497
1525
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1498
1526
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1526,7 +1554,7 @@ var SignatureField = BaseField.extend({
|
|
|
1526
1554
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1527
1555
|
"Title of the signature modal"
|
|
1528
1556
|
),
|
|
1529
|
-
defaultValue:
|
|
1557
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1530
1558
|
configuration: import_v43.default.object({
|
|
1531
1559
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1532
1560
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
@@ -1542,14 +1570,14 @@ var EmailField = BaseField.extend({
|
|
|
1542
1570
|
configuration: import_v43.default.object({
|
|
1543
1571
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1544
1572
|
}).default({ maxLength: 255 }).optional(),
|
|
1545
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1573
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1546
1574
|
}).meta({
|
|
1547
1575
|
description: "An email input field",
|
|
1548
1576
|
id: "EmailField"
|
|
1549
1577
|
});
|
|
1550
1578
|
var DateField = BaseField.extend({
|
|
1551
1579
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1552
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1580
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1553
1581
|
configuration: import_v43.default.object({
|
|
1554
1582
|
notice: TranslationConfig.describe(
|
|
1555
1583
|
"Text to display above the date input"
|
|
@@ -1561,7 +1589,7 @@ var DateField = BaseField.extend({
|
|
|
1561
1589
|
});
|
|
1562
1590
|
var AgeField = BaseField.extend({
|
|
1563
1591
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1564
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1592
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1565
1593
|
configuration: import_v43.default.object({
|
|
1566
1594
|
asOfDate: FieldReference,
|
|
1567
1595
|
prefix: TranslationConfig.optional(),
|
|
@@ -1573,7 +1601,7 @@ var AgeField = BaseField.extend({
|
|
|
1573
1601
|
});
|
|
1574
1602
|
var TimeField = BaseField.extend({
|
|
1575
1603
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1576
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1604
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1577
1605
|
configuration: import_v43.default.object({
|
|
1578
1606
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1579
1607
|
notice: TranslationConfig.describe(
|
|
@@ -1586,7 +1614,7 @@ var TimeField = BaseField.extend({
|
|
|
1586
1614
|
});
|
|
1587
1615
|
var DateRangeField = BaseField.extend({
|
|
1588
1616
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1589
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1617
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1590
1618
|
configuration: import_v43.default.object({
|
|
1591
1619
|
notice: TranslationConfig.describe(
|
|
1592
1620
|
"Text to display above the date input"
|
|
@@ -1665,7 +1693,7 @@ var PageHeader = BaseField.extend({
|
|
|
1665
1693
|
});
|
|
1666
1694
|
var File = BaseField.extend({
|
|
1667
1695
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1668
|
-
defaultValue: FileFieldValue.optional(),
|
|
1696
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1669
1697
|
configuration: import_v43.default.object({
|
|
1670
1698
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1671
1699
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1692,7 +1720,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1692
1720
|
});
|
|
1693
1721
|
var NumberWithUnitField = BaseField.extend({
|
|
1694
1722
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1695
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1723
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1696
1724
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1697
1725
|
configuration: import_v43.default.object({
|
|
1698
1726
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1707,7 +1735,7 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1707
1735
|
});
|
|
1708
1736
|
var RadioGroup = BaseField.extend({
|
|
1709
1737
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1710
|
-
defaultValue: TextValue.optional(),
|
|
1738
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1711
1739
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1712
1740
|
configuration: import_v43.default.object({
|
|
1713
1741
|
styles: import_v43.default.object({
|
|
@@ -1732,7 +1760,7 @@ var BulletList = BaseField.extend({
|
|
|
1732
1760
|
});
|
|
1733
1761
|
var Select = BaseField.extend({
|
|
1734
1762
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1735
|
-
defaultValue: TextValue.optional(),
|
|
1763
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1736
1764
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1737
1765
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1738
1766
|
`
|
|
@@ -1754,7 +1782,7 @@ var SelectDateRangeOption = import_v43.default.object({
|
|
|
1754
1782
|
});
|
|
1755
1783
|
var SelectDateRangeField = BaseField.extend({
|
|
1756
1784
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1757
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
1785
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1758
1786
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1759
1787
|
}).meta({
|
|
1760
1788
|
description: "A date range selection field",
|
|
@@ -1771,7 +1799,7 @@ var NameField = BaseField.extend({
|
|
|
1771
1799
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1772
1800
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1773
1801
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1774
|
-
}).optional(),
|
|
1802
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1775
1803
|
configuration: import_v43.default.object({
|
|
1776
1804
|
name: NameConfig.default({
|
|
1777
1805
|
firstname: { required: true },
|
|
@@ -1795,14 +1823,14 @@ var NameField = BaseField.extend({
|
|
|
1795
1823
|
id: "NameField"
|
|
1796
1824
|
});
|
|
1797
1825
|
var PhoneField = BaseField.extend({
|
|
1798
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1826
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1799
1827
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1800
1828
|
}).meta({
|
|
1801
1829
|
description: "A field for entering a phone number",
|
|
1802
1830
|
id: "PhoneField"
|
|
1803
1831
|
});
|
|
1804
1832
|
var IdField = BaseField.extend({
|
|
1805
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1833
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1806
1834
|
type: import_v43.default.literal(FieldType.ID)
|
|
1807
1835
|
}).meta({
|
|
1808
1836
|
description: "A field for entering an ID",
|
|
@@ -1810,14 +1838,14 @@ var IdField = BaseField.extend({
|
|
|
1810
1838
|
});
|
|
1811
1839
|
var Checkbox = BaseField.extend({
|
|
1812
1840
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1813
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1841
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
1814
1842
|
}).meta({
|
|
1815
1843
|
description: "A boolean checkbox field",
|
|
1816
1844
|
id: "Checkbox"
|
|
1817
1845
|
});
|
|
1818
1846
|
var Country = BaseField.extend({
|
|
1819
1847
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1820
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1848
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1821
1849
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1822
1850
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1823
1851
|
)
|
|
@@ -1835,7 +1863,7 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1835
1863
|
]);
|
|
1836
1864
|
var AdministrativeAreaField = BaseField.extend({
|
|
1837
1865
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1838
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1866
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1839
1867
|
configuration: import_v43.default.object({
|
|
1840
1868
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
1841
1869
|
type: AdministrativeAreas,
|
|
@@ -1847,7 +1875,7 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
1847
1875
|
});
|
|
1848
1876
|
var LocationInput = BaseField.extend({
|
|
1849
1877
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1850
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1878
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1851
1879
|
configuration: import_v43.default.object({
|
|
1852
1880
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1853
1881
|
allowedLocations: AllowedLocations
|
|
@@ -1859,7 +1887,7 @@ var LocationInput = BaseField.extend({
|
|
|
1859
1887
|
var FileUploadWithOptions = BaseField.extend({
|
|
1860
1888
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1861
1889
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1862
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1890
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
1863
1891
|
configuration: import_v43.default.object({
|
|
1864
1892
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1865
1893
|
maxImageSize: import_v43.default.object({
|
|
@@ -1875,12 +1903,12 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1875
1903
|
});
|
|
1876
1904
|
var Facility = BaseField.extend({
|
|
1877
1905
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1878
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1906
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1879
1907
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1880
1908
|
}).describe("Input field for a facility");
|
|
1881
1909
|
var Office = BaseField.extend({
|
|
1882
1910
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1883
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1911
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1884
1912
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1885
1913
|
}).describe("Input field for an office");
|
|
1886
1914
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -1916,7 +1944,7 @@ var Address = BaseField.extend({
|
|
|
1916
1944
|
).optional(),
|
|
1917
1945
|
allowedLocations: AllowedLocations
|
|
1918
1946
|
}).optional(),
|
|
1919
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
1947
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1920
1948
|
}).meta({
|
|
1921
1949
|
description: "Address input field \u2013 a combination of location and text fields",
|
|
1922
1950
|
id: "Address"
|
|
@@ -1963,7 +1991,7 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
1963
1991
|
});
|
|
1964
1992
|
var ButtonField = BaseField.extend({
|
|
1965
1993
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1966
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
1994
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
1967
1995
|
configuration: ButtonConfiguration
|
|
1968
1996
|
}).meta({
|
|
1969
1997
|
description: "A generic button that can be used to trigger an action",
|
|
@@ -1991,7 +2019,7 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1991
2019
|
});
|
|
1992
2020
|
var HttpField = BaseField.extend({
|
|
1993
2021
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1994
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2022
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
1995
2023
|
configuration: import_v43.default.object({
|
|
1996
2024
|
trigger: FieldReference.optional().describe(
|
|
1997
2025
|
"Reference to the field that triggers the HTTP request when its value changes. If not provided, the HTTP request is triggered once on component mount."
|
|
@@ -2077,7 +2105,7 @@ var LinkButtonField = BaseField.extend({
|
|
|
2077
2105
|
});
|
|
2078
2106
|
var VerificationStatus = BaseField.extend({
|
|
2079
2107
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2080
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2108
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2081
2109
|
configuration: import_v43.default.object({
|
|
2082
2110
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2083
2111
|
description: TranslationConfig.describe(
|
|
@@ -2099,7 +2127,7 @@ var QueryParamReaderField = BaseField.extend({
|
|
|
2099
2127
|
});
|
|
2100
2128
|
var QrReaderField = BaseField.extend({
|
|
2101
2129
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2102
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2130
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2103
2131
|
configuration: import_v43.default.object({
|
|
2104
2132
|
validator: import_v43.default.any().meta({
|
|
2105
2133
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2112,7 +2140,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2112
2140
|
});
|
|
2113
2141
|
var IdReaderField = BaseField.extend({
|
|
2114
2142
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2115
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2143
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2116
2144
|
methods: import_v43.default.array(
|
|
2117
2145
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2118
2146
|
)
|
|
@@ -2273,6 +2301,7 @@ var ClientConfig = z20.object({
|
|
|
2273
2301
|
COUNTRY: z20.string(),
|
|
2274
2302
|
LANGUAGES: z20.array(z20.string()),
|
|
2275
2303
|
SENTRY: z20.string().optional(),
|
|
2304
|
+
LOGIN_URL: z20.string().optional(),
|
|
2276
2305
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2277
2306
|
DASHBOARDS: z20.array(
|
|
2278
2307
|
z20.object({
|
package/dist/cli.js
CHANGED
|
@@ -2193,6 +2193,8 @@ var scopeOptionsPlaceEvent = z3.object({
|
|
|
2193
2193
|
placeOfEvent: JurisdictionFilter.optional()
|
|
2194
2194
|
}).describe("Options applicable to all record scopes.");
|
|
2195
2195
|
var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
|
|
2196
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
2197
|
+
notifiedBy: UserFilter.optional(),
|
|
2196
2198
|
declaredIn: JurisdictionFilter.optional(),
|
|
2197
2199
|
declaredBy: UserFilter.optional()
|
|
2198
2200
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
@@ -2234,6 +2236,8 @@ var ResolvedScopeOptionsPlaceEvent = z3.object({
|
|
|
2234
2236
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
2235
2237
|
);
|
|
2236
2238
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
2239
|
+
notifiedIn: UUID.nullish(),
|
|
2240
|
+
notifiedBy: z3.string().optional(),
|
|
2237
2241
|
declaredIn: UUID.nullish(),
|
|
2238
2242
|
declaredBy: z3.string().optional()
|
|
2239
2243
|
}).describe(
|
|
@@ -2382,20 +2386,27 @@ var encodeScope = (scope) => {
|
|
|
2382
2386
|
encode: false
|
|
2383
2387
|
});
|
|
2384
2388
|
};
|
|
2385
|
-
var
|
|
2386
|
-
|
|
2389
|
+
var decodedScopeCache = /* @__PURE__ */ new Map();
|
|
2390
|
+
var decodeScope = (encodedScope) => {
|
|
2391
|
+
if (decodedScopeCache.has(encodedScope)) {
|
|
2392
|
+
return decodedScopeCache.get(encodedScope);
|
|
2393
|
+
}
|
|
2394
|
+
const scope = qs.parse(encodedScope, {
|
|
2387
2395
|
ignoreQueryPrefix: true,
|
|
2388
2396
|
comma: true,
|
|
2389
2397
|
allowDots: true
|
|
2390
2398
|
});
|
|
2391
2399
|
const unflattenedScope = unflattenScope(scope);
|
|
2392
|
-
|
|
2400
|
+
const result = Scope2.safeParse(unflattenedScope)?.data;
|
|
2401
|
+
decodedScopeCache.set(encodedScope, result);
|
|
2402
|
+
return result;
|
|
2393
2403
|
};
|
|
2394
2404
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
2395
2405
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
2396
2406
|
accessLevel: JurisdictionFilter.enum.all,
|
|
2397
|
-
|
|
2398
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
2407
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
2408
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
2409
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
2399
2410
|
};
|
|
2400
2411
|
|
|
2401
2412
|
// ../commons/src/scopes.deprecated.do-not-use.ts
|
|
@@ -4294,7 +4305,7 @@ Saved ${handlerRelPath}.`);
|
|
|
4294
4305
|
// src/migrations/v2.0/checkout-upstream-files.ts
|
|
4295
4306
|
var import_child_process = require("child_process");
|
|
4296
4307
|
var UPSTREAM_URL = "https://github.com/opencrvs/opencrvs-countryconfig.git";
|
|
4297
|
-
var UPSTREAM_BRANCH = "release
|
|
4308
|
+
var UPSTREAM_BRANCH = "release/2.0.0";
|
|
4298
4309
|
var TEMP_REMOTE = "opencrvs-upgrade-v19-v20-codemod";
|
|
4299
4310
|
var FILES_TO_CHECKOUT = [
|
|
4300
4311
|
"src/analytics/analytics.ts",
|