@opencrvs/toolkit 2.0.0-rc.aff9f72 → 2.0.0-rc.b05abf8
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 +52 -34
- package/dist/cli.js +9 -3
- package/dist/commons/api/router.d.ts +87 -17
- package/dist/commons/application-config/index.d.ts +1 -0
- package/dist/commons/conditionals/conditionals.d.ts +348 -4
- package/dist/commons/conditionals/validate.d.ts +51 -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 +342 -0
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/FieldConfig.d.ts +377 -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/state/flags.d.ts +1 -0
- package/dist/commons/events/state/utils.d.ts +12 -287
- package/dist/commons/events/utils.d.ts +12 -1
- package/dist/conditionals/index.js +48 -1
- package/dist/events/index.js +246 -95
- package/dist/migrations/v2.0/index.js +9 -3
- package/dist/notification/index.js +165 -37
- package/dist/scopes/index.d.ts +4 -6
- package/dist/scopes/index.js +9 -3
- package/opencrvs-toolkit-2.0.0-rc.b05abf8.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.0-rc.aff9f72.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",
|
|
@@ -989,8 +995,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
989
995
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
990
996
|
z13.object({
|
|
991
997
|
type: z13.literal(ActionType.APPROVE_CORRECTION),
|
|
992
|
-
requestId: z13.string()
|
|
998
|
+
requestId: z13.string(),
|
|
993
999
|
// TODO move into 'content' property
|
|
1000
|
+
content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
|
|
994
1001
|
}).shape
|
|
995
1002
|
);
|
|
996
1003
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1410,8 +1417,18 @@ var FieldReference = import_v43.default.object({
|
|
|
1410
1417
|
$$field: FieldId.describe("Id of the field to reference"),
|
|
1411
1418
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1412
1419
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1420
|
+
),
|
|
1421
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1422
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1423
|
+
)
|
|
1424
|
+
}).describe(
|
|
1425
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1426
|
+
);
|
|
1427
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1428
|
+
$$code: import_v43.default.string().describe(
|
|
1429
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1413
1430
|
)
|
|
1414
|
-
}).describe("
|
|
1431
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1415
1432
|
var ValidationConfig = import_v43.default.object({
|
|
1416
1433
|
validator: Conditional.describe(
|
|
1417
1434
|
"Conditional expression that must hold for the field value to be considered valid."
|
|
@@ -1452,7 +1469,7 @@ var BaseField = import_v43.default.object({
|
|
|
1452
1469
|
"Indicates whether the field can be modified during record correction."
|
|
1453
1470
|
),
|
|
1454
1471
|
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."
|
|
1472
|
+
"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
1473
|
),
|
|
1457
1474
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1458
1475
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1466,7 +1483,7 @@ var Divider = BaseField.extend({
|
|
|
1466
1483
|
});
|
|
1467
1484
|
var TextField = BaseField.extend({
|
|
1468
1485
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1469
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1486
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1470
1487
|
configuration: import_v43.default.object({
|
|
1471
1488
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1472
1489
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
@@ -1479,7 +1496,7 @@ var TextField = BaseField.extend({
|
|
|
1479
1496
|
});
|
|
1480
1497
|
var NumberField = BaseField.extend({
|
|
1481
1498
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1482
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1499
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1483
1500
|
configuration: import_v43.default.object({
|
|
1484
1501
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1485
1502
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
@@ -1492,7 +1509,7 @@ var NumberField = BaseField.extend({
|
|
|
1492
1509
|
});
|
|
1493
1510
|
var TextAreaField = BaseField.extend({
|
|
1494
1511
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1495
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1512
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1496
1513
|
configuration: import_v43.default.object({
|
|
1497
1514
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1498
1515
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1526,7 +1543,7 @@ var SignatureField = BaseField.extend({
|
|
|
1526
1543
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1527
1544
|
"Title of the signature modal"
|
|
1528
1545
|
),
|
|
1529
|
-
defaultValue:
|
|
1546
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1530
1547
|
configuration: import_v43.default.object({
|
|
1531
1548
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1532
1549
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
@@ -1542,14 +1559,14 @@ var EmailField = BaseField.extend({
|
|
|
1542
1559
|
configuration: import_v43.default.object({
|
|
1543
1560
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1544
1561
|
}).default({ maxLength: 255 }).optional(),
|
|
1545
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1562
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1546
1563
|
}).meta({
|
|
1547
1564
|
description: "An email input field",
|
|
1548
1565
|
id: "EmailField"
|
|
1549
1566
|
});
|
|
1550
1567
|
var DateField = BaseField.extend({
|
|
1551
1568
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1552
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1569
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1553
1570
|
configuration: import_v43.default.object({
|
|
1554
1571
|
notice: TranslationConfig.describe(
|
|
1555
1572
|
"Text to display above the date input"
|
|
@@ -1561,7 +1578,7 @@ var DateField = BaseField.extend({
|
|
|
1561
1578
|
});
|
|
1562
1579
|
var AgeField = BaseField.extend({
|
|
1563
1580
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1564
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1581
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1565
1582
|
configuration: import_v43.default.object({
|
|
1566
1583
|
asOfDate: FieldReference,
|
|
1567
1584
|
prefix: TranslationConfig.optional(),
|
|
@@ -1573,7 +1590,7 @@ var AgeField = BaseField.extend({
|
|
|
1573
1590
|
});
|
|
1574
1591
|
var TimeField = BaseField.extend({
|
|
1575
1592
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1576
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1593
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1577
1594
|
configuration: import_v43.default.object({
|
|
1578
1595
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1579
1596
|
notice: TranslationConfig.describe(
|
|
@@ -1586,7 +1603,7 @@ var TimeField = BaseField.extend({
|
|
|
1586
1603
|
});
|
|
1587
1604
|
var DateRangeField = BaseField.extend({
|
|
1588
1605
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1589
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1606
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1590
1607
|
configuration: import_v43.default.object({
|
|
1591
1608
|
notice: TranslationConfig.describe(
|
|
1592
1609
|
"Text to display above the date input"
|
|
@@ -1665,7 +1682,7 @@ var PageHeader = BaseField.extend({
|
|
|
1665
1682
|
});
|
|
1666
1683
|
var File = BaseField.extend({
|
|
1667
1684
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1668
|
-
defaultValue: FileFieldValue.optional(),
|
|
1685
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1669
1686
|
configuration: import_v43.default.object({
|
|
1670
1687
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1671
1688
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1692,7 +1709,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1692
1709
|
});
|
|
1693
1710
|
var NumberWithUnitField = BaseField.extend({
|
|
1694
1711
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1695
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1712
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1696
1713
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1697
1714
|
configuration: import_v43.default.object({
|
|
1698
1715
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1707,7 +1724,7 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1707
1724
|
});
|
|
1708
1725
|
var RadioGroup = BaseField.extend({
|
|
1709
1726
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1710
|
-
defaultValue: TextValue.optional(),
|
|
1727
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1711
1728
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1712
1729
|
configuration: import_v43.default.object({
|
|
1713
1730
|
styles: import_v43.default.object({
|
|
@@ -1732,7 +1749,7 @@ var BulletList = BaseField.extend({
|
|
|
1732
1749
|
});
|
|
1733
1750
|
var Select = BaseField.extend({
|
|
1734
1751
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1735
|
-
defaultValue: TextValue.optional(),
|
|
1752
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1736
1753
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1737
1754
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1738
1755
|
`
|
|
@@ -1754,7 +1771,7 @@ var SelectDateRangeOption = import_v43.default.object({
|
|
|
1754
1771
|
});
|
|
1755
1772
|
var SelectDateRangeField = BaseField.extend({
|
|
1756
1773
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1757
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
1774
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1758
1775
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1759
1776
|
}).meta({
|
|
1760
1777
|
description: "A date range selection field",
|
|
@@ -1771,7 +1788,7 @@ var NameField = BaseField.extend({
|
|
|
1771
1788
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1772
1789
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1773
1790
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1774
|
-
}).optional(),
|
|
1791
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1775
1792
|
configuration: import_v43.default.object({
|
|
1776
1793
|
name: NameConfig.default({
|
|
1777
1794
|
firstname: { required: true },
|
|
@@ -1795,14 +1812,14 @@ var NameField = BaseField.extend({
|
|
|
1795
1812
|
id: "NameField"
|
|
1796
1813
|
});
|
|
1797
1814
|
var PhoneField = BaseField.extend({
|
|
1798
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1815
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1799
1816
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1800
1817
|
}).meta({
|
|
1801
1818
|
description: "A field for entering a phone number",
|
|
1802
1819
|
id: "PhoneField"
|
|
1803
1820
|
});
|
|
1804
1821
|
var IdField = BaseField.extend({
|
|
1805
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1822
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1806
1823
|
type: import_v43.default.literal(FieldType.ID)
|
|
1807
1824
|
}).meta({
|
|
1808
1825
|
description: "A field for entering an ID",
|
|
@@ -1810,14 +1827,14 @@ var IdField = BaseField.extend({
|
|
|
1810
1827
|
});
|
|
1811
1828
|
var Checkbox = BaseField.extend({
|
|
1812
1829
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1813
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1830
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
1814
1831
|
}).meta({
|
|
1815
1832
|
description: "A boolean checkbox field",
|
|
1816
1833
|
id: "Checkbox"
|
|
1817
1834
|
});
|
|
1818
1835
|
var Country = BaseField.extend({
|
|
1819
1836
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1820
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1837
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1821
1838
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1822
1839
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1823
1840
|
)
|
|
@@ -1835,7 +1852,7 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1835
1852
|
]);
|
|
1836
1853
|
var AdministrativeAreaField = BaseField.extend({
|
|
1837
1854
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1838
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1855
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1839
1856
|
configuration: import_v43.default.object({
|
|
1840
1857
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
1841
1858
|
type: AdministrativeAreas,
|
|
@@ -1847,7 +1864,7 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
1847
1864
|
});
|
|
1848
1865
|
var LocationInput = BaseField.extend({
|
|
1849
1866
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1850
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1867
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1851
1868
|
configuration: import_v43.default.object({
|
|
1852
1869
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1853
1870
|
allowedLocations: AllowedLocations
|
|
@@ -1859,7 +1876,7 @@ var LocationInput = BaseField.extend({
|
|
|
1859
1876
|
var FileUploadWithOptions = BaseField.extend({
|
|
1860
1877
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1861
1878
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1862
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1879
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
1863
1880
|
configuration: import_v43.default.object({
|
|
1864
1881
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1865
1882
|
maxImageSize: import_v43.default.object({
|
|
@@ -1875,12 +1892,12 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1875
1892
|
});
|
|
1876
1893
|
var Facility = BaseField.extend({
|
|
1877
1894
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1878
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1895
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1879
1896
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1880
1897
|
}).describe("Input field for a facility");
|
|
1881
1898
|
var Office = BaseField.extend({
|
|
1882
1899
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1883
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1900
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1884
1901
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1885
1902
|
}).describe("Input field for an office");
|
|
1886
1903
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -1916,7 +1933,7 @@ var Address = BaseField.extend({
|
|
|
1916
1933
|
).optional(),
|
|
1917
1934
|
allowedLocations: AllowedLocations
|
|
1918
1935
|
}).optional(),
|
|
1919
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
1936
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1920
1937
|
}).meta({
|
|
1921
1938
|
description: "Address input field \u2013 a combination of location and text fields",
|
|
1922
1939
|
id: "Address"
|
|
@@ -1963,7 +1980,7 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
1963
1980
|
});
|
|
1964
1981
|
var ButtonField = BaseField.extend({
|
|
1965
1982
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1966
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
1983
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
1967
1984
|
configuration: ButtonConfiguration
|
|
1968
1985
|
}).meta({
|
|
1969
1986
|
description: "A generic button that can be used to trigger an action",
|
|
@@ -1991,7 +2008,7 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1991
2008
|
});
|
|
1992
2009
|
var HttpField = BaseField.extend({
|
|
1993
2010
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1994
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2011
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
1995
2012
|
configuration: import_v43.default.object({
|
|
1996
2013
|
trigger: FieldReference.optional().describe(
|
|
1997
2014
|
"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 +2094,7 @@ var LinkButtonField = BaseField.extend({
|
|
|
2077
2094
|
});
|
|
2078
2095
|
var VerificationStatus = BaseField.extend({
|
|
2079
2096
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2080
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2097
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2081
2098
|
configuration: import_v43.default.object({
|
|
2082
2099
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2083
2100
|
description: TranslationConfig.describe(
|
|
@@ -2099,7 +2116,7 @@ var QueryParamReaderField = BaseField.extend({
|
|
|
2099
2116
|
});
|
|
2100
2117
|
var QrReaderField = BaseField.extend({
|
|
2101
2118
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2102
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2119
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2103
2120
|
configuration: import_v43.default.object({
|
|
2104
2121
|
validator: import_v43.default.any().meta({
|
|
2105
2122
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2112,7 +2129,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2112
2129
|
});
|
|
2113
2130
|
var IdReaderField = BaseField.extend({
|
|
2114
2131
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2115
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2132
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2116
2133
|
methods: import_v43.default.array(
|
|
2117
2134
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2118
2135
|
)
|
|
@@ -2273,6 +2290,7 @@ var ClientConfig = z20.object({
|
|
|
2273
2290
|
COUNTRY: z20.string(),
|
|
2274
2291
|
LANGUAGES: z20.array(z20.string()),
|
|
2275
2292
|
SENTRY: z20.string().optional(),
|
|
2293
|
+
LOGIN_URL: z20.string().optional(),
|
|
2276
2294
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2277
2295
|
DASHBOARDS: z20.array(
|
|
2278
2296
|
z20.object({
|
package/dist/cli.js
CHANGED
|
@@ -2382,14 +2382,20 @@ var encodeScope = (scope) => {
|
|
|
2382
2382
|
encode: false
|
|
2383
2383
|
});
|
|
2384
2384
|
};
|
|
2385
|
-
var
|
|
2386
|
-
|
|
2385
|
+
var decodedScopeCache = /* @__PURE__ */ new Map();
|
|
2386
|
+
var decodeScope = (encodedScope) => {
|
|
2387
|
+
if (decodedScopeCache.has(encodedScope)) {
|
|
2388
|
+
return decodedScopeCache.get(encodedScope);
|
|
2389
|
+
}
|
|
2390
|
+
const scope = qs.parse(encodedScope, {
|
|
2387
2391
|
ignoreQueryPrefix: true,
|
|
2388
2392
|
comma: true,
|
|
2389
2393
|
allowDots: true
|
|
2390
2394
|
});
|
|
2391
2395
|
const unflattenedScope = unflattenScope(scope);
|
|
2392
|
-
|
|
2396
|
+
const result = Scope2.safeParse(unflattenedScope)?.data;
|
|
2397
|
+
decodedScopeCache.set(encodedScope, result);
|
|
2398
|
+
return result;
|
|
2393
2399
|
};
|
|
2394
2400
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
2395
2401
|
placeOfEvent: JurisdictionFilter.enum.all,
|