@opencrvs/toolkit 2.0.0-rc.a4cf9f6 → 2.0.0-rc.a541c60
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/README.md +15 -0
- package/build.sh +3 -2
- package/dist/application-config/index.js +53 -34
- package/dist/cli.js +3252 -45
- package/dist/commons/api/router.d.ts +28 -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/ActionConfig.d.ts +28 -2
- package/dist/commons/events/AdvancedSearchConfig.d.ts +342 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/EventIndex.d.ts +14 -0
- package/dist/commons/events/FieldConfig.d.ts +378 -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/WorkqueueConfig.d.ts +39 -0
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/state/utils.d.ts +12 -290
- package/dist/commons/events/utils.d.ts +1 -1
- package/dist/conditionals/index.js +48 -1
- package/dist/environment/custom-types.d.ts +33 -0
- package/dist/environment/custom-types.d.ts.map +1 -0
- package/dist/environment/custom-types.js +12 -0
- package/dist/environment/derived-variables.d.ts +134 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +169 -0
- package/dist/environment/editor-questions.d.ts +4 -0
- package/dist/environment/editor-questions.d.ts.map +1 -0
- package/dist/environment/editor-questions.js +67 -0
- package/dist/environment/git.d.ts +5 -0
- package/dist/environment/git.d.ts.map +1 -0
- package/dist/environment/git.js +38 -0
- package/dist/environment/github.d.ts +26 -0
- package/dist/environment/github.d.ts.map +1 -0
- package/dist/environment/github.js +247 -0
- package/dist/environment/index.d.ts +5 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +71 -0
- package/dist/environment/logger.d.ts +15 -0
- package/dist/environment/logger.d.ts.map +1 -0
- package/dist/environment/logger.js +25 -0
- package/dist/environment/manage-users.d.ts +11 -0
- package/dist/environment/manage-users.d.ts.map +1 -0
- package/dist/environment/manage-users.js +497 -0
- package/dist/environment/questions-helper.d.ts +15 -0
- package/dist/environment/questions-helper.d.ts.map +1 -0
- package/dist/environment/questions-helper.js +70 -0
- package/dist/environment/questions.d.ts +199 -0
- package/dist/environment/questions.d.ts.map +1 -0
- package/dist/environment/questions.js +412 -0
- package/dist/environment/setup-environment.d.ts +2 -0
- package/dist/environment/setup-environment.d.ts.map +1 -0
- package/dist/environment/setup-environment.js +794 -0
- package/dist/environment/ssh-keygen.d.ts +5 -0
- package/dist/environment/ssh-keygen.d.ts.map +1 -0
- package/dist/environment/ssh-keygen.js +21 -0
- package/dist/environment/swarm-to-k8s.d.ts +2 -0
- package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
- package/dist/environment/swarm-to-k8s.js +173 -0
- package/dist/environment/templates.d.ts +27 -0
- package/dist/environment/templates.d.ts.map +1 -0
- package/dist/environment/templates.js +163 -0
- package/dist/environment/update-workflows.d.ts +2 -0
- package/dist/environment/update-workflows.d.ts.map +1 -0
- package/dist/environment/update-workflows.js +169 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +112 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +100 -0
- package/dist/events/index.js +359 -146
- 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 +10 -4
- package/dist/notification/index.js +246 -38
- package/dist/scopes/index.d.ts +4 -6
- package/dist/scopes/index.js +9 -3
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +83 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +115 -0
- package/dist/templates/inventory/inventory.template.yml +100 -0
- package/dist/templates/inventory/production.example.yml +77 -0
- package/dist/templates/inventory/qa.example.yml +48 -0
- package/opencrvs-toolkit-2.0.0-rc.a541c60.tgz +0 -0
- package/package.json +15 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.a4cf9f6.tgz +0 -0
package/README.md
CHANGED
|
@@ -14,6 +14,21 @@ src/
|
|
|
14
14
|
|
|
15
15
|
## Getting started
|
|
16
16
|
|
|
17
|
+
### Manage GitHub environments
|
|
18
|
+
|
|
19
|
+
All commands should be executed within infrastructure repository.
|
|
20
|
+
|
|
21
|
+
Run `opencrvs environment init` from the root of a infrastructure
|
|
22
|
+
repository to create new GitHub environment. Command requires valid GitHub token.
|
|
23
|
+
|
|
24
|
+
Other environment operations are available as separate commands:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
opencrvs environment update-workflows
|
|
28
|
+
opencrvs environment users
|
|
29
|
+
opencrvs environment swarm-to-k8s
|
|
30
|
+
```
|
|
31
|
+
|
|
17
32
|
### Development using yarn link
|
|
18
33
|
|
|
19
34
|
```
|
package/build.sh
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
1
3
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
4
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
5
|
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
@@ -7,8 +9,6 @@
|
|
|
7
9
|
#
|
|
8
10
|
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
11
|
|
|
10
|
-
#!/bin/bash
|
|
11
|
-
|
|
12
12
|
set -e
|
|
13
13
|
|
|
14
14
|
rm -rf dist
|
|
@@ -64,6 +64,7 @@ fi
|
|
|
64
64
|
|
|
65
65
|
# Build CLI
|
|
66
66
|
npx esbuild src/cli.ts --bundle --format=cjs --outdir=./dist --allow-overwrite --packages=external --banner:js="#!/usr/bin/env node"
|
|
67
|
+
cp -R src/environment/templates dist/templates
|
|
67
68
|
chmod +x ./dist/cli.js
|
|
68
69
|
|
|
69
70
|
echo "Build completed successfully."
|
|
@@ -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",
|
|
@@ -1254,7 +1260,8 @@ var Range = import_v4.z.object({
|
|
|
1254
1260
|
});
|
|
1255
1261
|
var ContainsFlags = import_v4.z.object({
|
|
1256
1262
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
1257
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1263
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
1264
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
1258
1265
|
}).meta({
|
|
1259
1266
|
id: "ContainsFlags"
|
|
1260
1267
|
});
|
|
@@ -1411,8 +1418,18 @@ var FieldReference = import_v43.default.object({
|
|
|
1411
1418
|
$$field: FieldId.describe("Id of the field to reference"),
|
|
1412
1419
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1413
1420
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1421
|
+
),
|
|
1422
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1423
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1424
|
+
)
|
|
1425
|
+
}).describe(
|
|
1426
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1427
|
+
);
|
|
1428
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1429
|
+
$$code: import_v43.default.string().describe(
|
|
1430
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1414
1431
|
)
|
|
1415
|
-
}).describe("
|
|
1432
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1416
1433
|
var ValidationConfig = import_v43.default.object({
|
|
1417
1434
|
validator: Conditional.describe(
|
|
1418
1435
|
"Conditional expression that must hold for the field value to be considered valid."
|
|
@@ -1453,7 +1470,7 @@ var BaseField = import_v43.default.object({
|
|
|
1453
1470
|
"Indicates whether the field can be modified during record correction."
|
|
1454
1471
|
),
|
|
1455
1472
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1456
|
-
"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."
|
|
1473
|
+
"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."
|
|
1457
1474
|
),
|
|
1458
1475
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1459
1476
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1467,7 +1484,7 @@ var Divider = BaseField.extend({
|
|
|
1467
1484
|
});
|
|
1468
1485
|
var TextField = BaseField.extend({
|
|
1469
1486
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1470
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1487
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1471
1488
|
configuration: import_v43.default.object({
|
|
1472
1489
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1473
1490
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
@@ -1480,10 +1497,11 @@ var TextField = BaseField.extend({
|
|
|
1480
1497
|
});
|
|
1481
1498
|
var NumberField = BaseField.extend({
|
|
1482
1499
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1483
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1500
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1484
1501
|
configuration: import_v43.default.object({
|
|
1485
1502
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1486
1503
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1504
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1487
1505
|
prefix: TranslationConfig.optional(),
|
|
1488
1506
|
postfix: TranslationConfig.optional()
|
|
1489
1507
|
}).optional()
|
|
@@ -1493,7 +1511,7 @@ var NumberField = BaseField.extend({
|
|
|
1493
1511
|
});
|
|
1494
1512
|
var TextAreaField = BaseField.extend({
|
|
1495
1513
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1496
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1514
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1497
1515
|
configuration: import_v43.default.object({
|
|
1498
1516
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1499
1517
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1527,7 +1545,7 @@ var SignatureField = BaseField.extend({
|
|
|
1527
1545
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1528
1546
|
"Title of the signature modal"
|
|
1529
1547
|
),
|
|
1530
|
-
defaultValue:
|
|
1548
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1531
1549
|
configuration: import_v43.default.object({
|
|
1532
1550
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1533
1551
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
@@ -1543,14 +1561,14 @@ var EmailField = BaseField.extend({
|
|
|
1543
1561
|
configuration: import_v43.default.object({
|
|
1544
1562
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1545
1563
|
}).default({ maxLength: 255 }).optional(),
|
|
1546
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1564
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1547
1565
|
}).meta({
|
|
1548
1566
|
description: "An email input field",
|
|
1549
1567
|
id: "EmailField"
|
|
1550
1568
|
});
|
|
1551
1569
|
var DateField = BaseField.extend({
|
|
1552
1570
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1553
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1571
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1554
1572
|
configuration: import_v43.default.object({
|
|
1555
1573
|
notice: TranslationConfig.describe(
|
|
1556
1574
|
"Text to display above the date input"
|
|
@@ -1562,7 +1580,7 @@ var DateField = BaseField.extend({
|
|
|
1562
1580
|
});
|
|
1563
1581
|
var AgeField = BaseField.extend({
|
|
1564
1582
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1565
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1583
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1566
1584
|
configuration: import_v43.default.object({
|
|
1567
1585
|
asOfDate: FieldReference,
|
|
1568
1586
|
prefix: TranslationConfig.optional(),
|
|
@@ -1574,7 +1592,7 @@ var AgeField = BaseField.extend({
|
|
|
1574
1592
|
});
|
|
1575
1593
|
var TimeField = BaseField.extend({
|
|
1576
1594
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1577
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1595
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1578
1596
|
configuration: import_v43.default.object({
|
|
1579
1597
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1580
1598
|
notice: TranslationConfig.describe(
|
|
@@ -1587,7 +1605,7 @@ var TimeField = BaseField.extend({
|
|
|
1587
1605
|
});
|
|
1588
1606
|
var DateRangeField = BaseField.extend({
|
|
1589
1607
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1590
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1608
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1591
1609
|
configuration: import_v43.default.object({
|
|
1592
1610
|
notice: TranslationConfig.describe(
|
|
1593
1611
|
"Text to display above the date input"
|
|
@@ -1666,7 +1684,7 @@ var PageHeader = BaseField.extend({
|
|
|
1666
1684
|
});
|
|
1667
1685
|
var File = BaseField.extend({
|
|
1668
1686
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1669
|
-
defaultValue: FileFieldValue.optional(),
|
|
1687
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1670
1688
|
configuration: import_v43.default.object({
|
|
1671
1689
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1672
1690
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1693,7 +1711,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1693
1711
|
});
|
|
1694
1712
|
var NumberWithUnitField = BaseField.extend({
|
|
1695
1713
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1696
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1714
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1697
1715
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1698
1716
|
configuration: import_v43.default.object({
|
|
1699
1717
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1708,7 +1726,7 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1708
1726
|
});
|
|
1709
1727
|
var RadioGroup = BaseField.extend({
|
|
1710
1728
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1711
|
-
defaultValue: TextValue.optional(),
|
|
1729
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1712
1730
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1713
1731
|
configuration: import_v43.default.object({
|
|
1714
1732
|
styles: import_v43.default.object({
|
|
@@ -1733,7 +1751,7 @@ var BulletList = BaseField.extend({
|
|
|
1733
1751
|
});
|
|
1734
1752
|
var Select = BaseField.extend({
|
|
1735
1753
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1736
|
-
defaultValue: TextValue.optional(),
|
|
1754
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1737
1755
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1738
1756
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1739
1757
|
`
|
|
@@ -1755,7 +1773,7 @@ var SelectDateRangeOption = import_v43.default.object({
|
|
|
1755
1773
|
});
|
|
1756
1774
|
var SelectDateRangeField = BaseField.extend({
|
|
1757
1775
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1758
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
1776
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1759
1777
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1760
1778
|
}).meta({
|
|
1761
1779
|
description: "A date range selection field",
|
|
@@ -1772,7 +1790,7 @@ var NameField = BaseField.extend({
|
|
|
1772
1790
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1773
1791
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1774
1792
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1775
|
-
}).optional(),
|
|
1793
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1776
1794
|
configuration: import_v43.default.object({
|
|
1777
1795
|
name: NameConfig.default({
|
|
1778
1796
|
firstname: { required: true },
|
|
@@ -1796,14 +1814,14 @@ var NameField = BaseField.extend({
|
|
|
1796
1814
|
id: "NameField"
|
|
1797
1815
|
});
|
|
1798
1816
|
var PhoneField = BaseField.extend({
|
|
1799
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1817
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1800
1818
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1801
1819
|
}).meta({
|
|
1802
1820
|
description: "A field for entering a phone number",
|
|
1803
1821
|
id: "PhoneField"
|
|
1804
1822
|
});
|
|
1805
1823
|
var IdField = BaseField.extend({
|
|
1806
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1824
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1807
1825
|
type: import_v43.default.literal(FieldType.ID)
|
|
1808
1826
|
}).meta({
|
|
1809
1827
|
description: "A field for entering an ID",
|
|
@@ -1811,14 +1829,14 @@ var IdField = BaseField.extend({
|
|
|
1811
1829
|
});
|
|
1812
1830
|
var Checkbox = BaseField.extend({
|
|
1813
1831
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1814
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1832
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
1815
1833
|
}).meta({
|
|
1816
1834
|
description: "A boolean checkbox field",
|
|
1817
1835
|
id: "Checkbox"
|
|
1818
1836
|
});
|
|
1819
1837
|
var Country = BaseField.extend({
|
|
1820
1838
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1821
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1839
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1822
1840
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1823
1841
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1824
1842
|
)
|
|
@@ -1836,7 +1854,7 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1836
1854
|
]);
|
|
1837
1855
|
var AdministrativeAreaField = BaseField.extend({
|
|
1838
1856
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1839
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1857
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1840
1858
|
configuration: import_v43.default.object({
|
|
1841
1859
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
1842
1860
|
type: AdministrativeAreas,
|
|
@@ -1848,7 +1866,7 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
1848
1866
|
});
|
|
1849
1867
|
var LocationInput = BaseField.extend({
|
|
1850
1868
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1851
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1869
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1852
1870
|
configuration: import_v43.default.object({
|
|
1853
1871
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1854
1872
|
allowedLocations: AllowedLocations
|
|
@@ -1860,7 +1878,7 @@ var LocationInput = BaseField.extend({
|
|
|
1860
1878
|
var FileUploadWithOptions = BaseField.extend({
|
|
1861
1879
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1862
1880
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1863
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1881
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
1864
1882
|
configuration: import_v43.default.object({
|
|
1865
1883
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1866
1884
|
maxImageSize: import_v43.default.object({
|
|
@@ -1876,12 +1894,12 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1876
1894
|
});
|
|
1877
1895
|
var Facility = BaseField.extend({
|
|
1878
1896
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1879
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1897
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1880
1898
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1881
1899
|
}).describe("Input field for a facility");
|
|
1882
1900
|
var Office = BaseField.extend({
|
|
1883
1901
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1884
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1902
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1885
1903
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1886
1904
|
}).describe("Input field for an office");
|
|
1887
1905
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -1917,7 +1935,7 @@ var Address = BaseField.extend({
|
|
|
1917
1935
|
).optional(),
|
|
1918
1936
|
allowedLocations: AllowedLocations
|
|
1919
1937
|
}).optional(),
|
|
1920
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
1938
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1921
1939
|
}).meta({
|
|
1922
1940
|
description: "Address input field \u2013 a combination of location and text fields",
|
|
1923
1941
|
id: "Address"
|
|
@@ -1964,7 +1982,7 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
1964
1982
|
});
|
|
1965
1983
|
var ButtonField = BaseField.extend({
|
|
1966
1984
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1967
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
1985
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
1968
1986
|
configuration: ButtonConfiguration
|
|
1969
1987
|
}).meta({
|
|
1970
1988
|
description: "A generic button that can be used to trigger an action",
|
|
@@ -1992,7 +2010,7 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1992
2010
|
});
|
|
1993
2011
|
var HttpField = BaseField.extend({
|
|
1994
2012
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1995
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2013
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
1996
2014
|
configuration: import_v43.default.object({
|
|
1997
2015
|
trigger: FieldReference.optional().describe(
|
|
1998
2016
|
"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."
|
|
@@ -2078,7 +2096,7 @@ var LinkButtonField = BaseField.extend({
|
|
|
2078
2096
|
});
|
|
2079
2097
|
var VerificationStatus = BaseField.extend({
|
|
2080
2098
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2081
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2099
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2082
2100
|
configuration: import_v43.default.object({
|
|
2083
2101
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2084
2102
|
description: TranslationConfig.describe(
|
|
@@ -2100,7 +2118,7 @@ var QueryParamReaderField = BaseField.extend({
|
|
|
2100
2118
|
});
|
|
2101
2119
|
var QrReaderField = BaseField.extend({
|
|
2102
2120
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2103
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2121
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2104
2122
|
configuration: import_v43.default.object({
|
|
2105
2123
|
validator: import_v43.default.any().meta({
|
|
2106
2124
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2113,7 +2131,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2113
2131
|
});
|
|
2114
2132
|
var IdReaderField = BaseField.extend({
|
|
2115
2133
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2116
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2134
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2117
2135
|
methods: import_v43.default.array(
|
|
2118
2136
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2119
2137
|
)
|
|
@@ -2274,6 +2292,7 @@ var ClientConfig = z20.object({
|
|
|
2274
2292
|
COUNTRY: z20.string(),
|
|
2275
2293
|
LANGUAGES: z20.array(z20.string()),
|
|
2276
2294
|
SENTRY: z20.string().optional(),
|
|
2295
|
+
LOGIN_URL: z20.string().optional(),
|
|
2277
2296
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2278
2297
|
DASHBOARDS: z20.array(
|
|
2279
2298
|
z20.object({
|