@opencrvs/toolkit 2.0.0-rc.fd1d25d → 2.0.0-rc.fd2511e
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 +68 -39
- package/dist/cli.js +3262 -50
- package/dist/commons/api/router.d.ts +36 -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/AdvancedSearchConfig.d.ts +354 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/EventConfig.d.ts +2 -0
- package/dist/commons/events/EventIndex.d.ts +25 -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/WorkqueueConfig.d.ts +39 -0
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/locations.d.ts +1 -0
- package/dist/commons/events/state/index.d.ts +8 -0
- package/dist/commons/events/state/utils.d.ts +21 -290
- package/dist/commons/events/utils.d.ts +1 -1
- package/dist/conditionals/index.js +58 -6
- 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 +393 -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 +20 -9
- package/dist/notification/index.js +261 -43
- package/dist/scopes/index.d.ts +93 -7
- package/dist/scopes/index.js +19 -8
- 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.fd2511e.tgz +0 -0
- package/package.json +15 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.fd1d25d.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",
|
|
@@ -659,11 +665,13 @@ var scopeOptionsPlaceEvent = z11.object({
|
|
|
659
665
|
event: scopeByEvent,
|
|
660
666
|
placeOfEvent: JurisdictionFilter.optional()
|
|
661
667
|
}).describe("Options applicable to all record scopes.");
|
|
662
|
-
var
|
|
668
|
+
var scopeOptionsDeclaredOrNotified = 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");
|
|
666
|
-
var AllRecordScopeOptions =
|
|
674
|
+
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
667
675
|
registeredIn: JurisdictionFilter.optional(),
|
|
668
676
|
registeredBy: UserFilter.optional()
|
|
669
677
|
}).describe(
|
|
@@ -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(
|
|
@@ -746,7 +756,7 @@ var RecordScopeV2 = z11.discriminatedUnion("type", [
|
|
|
746
756
|
}),
|
|
747
757
|
z11.object({
|
|
748
758
|
type: ScopesWithDeclaredOptions,
|
|
749
|
-
options:
|
|
759
|
+
options: scopeOptionsDeclaredOrNotified.optional()
|
|
750
760
|
}),
|
|
751
761
|
z11.object({
|
|
752
762
|
type: ScopesWithFullOptions,
|
|
@@ -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
|
|
@@ -1125,6 +1136,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1125
1136
|
)
|
|
1126
1137
|
});
|
|
1127
1138
|
var LegalStatuses = z15.object({
|
|
1139
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1128
1140
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1129
1141
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1130
1142
|
});
|
|
@@ -1184,6 +1196,8 @@ var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
|
|
|
1184
1196
|
var EventMetadataDateFieldIdInput = z15.enum([
|
|
1185
1197
|
"createdAt",
|
|
1186
1198
|
"updatedAt",
|
|
1199
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1200
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1187
1201
|
"legalStatuses.DECLARED.createdAt",
|
|
1188
1202
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1189
1203
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1192,6 +1206,8 @@ var EventMetadataDateFieldIdInput = z15.enum([
|
|
|
1192
1206
|
var EventMetadataDateFieldId = z15.enum([
|
|
1193
1207
|
"event.createdAt",
|
|
1194
1208
|
"event.updatedAt",
|
|
1209
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1210
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1195
1211
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1196
1212
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1197
1213
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1254,7 +1270,8 @@ var Range = import_v4.z.object({
|
|
|
1254
1270
|
});
|
|
1255
1271
|
var ContainsFlags = import_v4.z.object({
|
|
1256
1272
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
1257
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1273
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
1274
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
1258
1275
|
}).meta({
|
|
1259
1276
|
id: "ContainsFlags"
|
|
1260
1277
|
});
|
|
@@ -1411,8 +1428,18 @@ var FieldReference = import_v43.default.object({
|
|
|
1411
1428
|
$$field: FieldId.describe("Id of the field to reference"),
|
|
1412
1429
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1413
1430
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1431
|
+
),
|
|
1432
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1433
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1434
|
+
)
|
|
1435
|
+
}).describe(
|
|
1436
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1437
|
+
);
|
|
1438
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1439
|
+
$$code: import_v43.default.string().describe(
|
|
1440
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1414
1441
|
)
|
|
1415
|
-
}).describe("
|
|
1442
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1416
1443
|
var ValidationConfig = import_v43.default.object({
|
|
1417
1444
|
validator: Conditional.describe(
|
|
1418
1445
|
"Conditional expression that must hold for the field value to be considered valid."
|
|
@@ -1453,7 +1480,7 @@ var BaseField = import_v43.default.object({
|
|
|
1453
1480
|
"Indicates whether the field can be modified during record correction."
|
|
1454
1481
|
),
|
|
1455
1482
|
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."
|
|
1483
|
+
"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
1484
|
),
|
|
1458
1485
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1459
1486
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1467,7 +1494,7 @@ var Divider = BaseField.extend({
|
|
|
1467
1494
|
});
|
|
1468
1495
|
var TextField = BaseField.extend({
|
|
1469
1496
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1470
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1497
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1471
1498
|
configuration: import_v43.default.object({
|
|
1472
1499
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1473
1500
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
@@ -1480,10 +1507,11 @@ var TextField = BaseField.extend({
|
|
|
1480
1507
|
});
|
|
1481
1508
|
var NumberField = BaseField.extend({
|
|
1482
1509
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1483
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1510
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1484
1511
|
configuration: import_v43.default.object({
|
|
1485
1512
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1486
1513
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1514
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1487
1515
|
prefix: TranslationConfig.optional(),
|
|
1488
1516
|
postfix: TranslationConfig.optional()
|
|
1489
1517
|
}).optional()
|
|
@@ -1493,7 +1521,7 @@ var NumberField = BaseField.extend({
|
|
|
1493
1521
|
});
|
|
1494
1522
|
var TextAreaField = BaseField.extend({
|
|
1495
1523
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1496
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1524
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1497
1525
|
configuration: import_v43.default.object({
|
|
1498
1526
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1499
1527
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1527,7 +1555,7 @@ var SignatureField = BaseField.extend({
|
|
|
1527
1555
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1528
1556
|
"Title of the signature modal"
|
|
1529
1557
|
),
|
|
1530
|
-
defaultValue:
|
|
1558
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1531
1559
|
configuration: import_v43.default.object({
|
|
1532
1560
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1533
1561
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
@@ -1543,14 +1571,14 @@ var EmailField = BaseField.extend({
|
|
|
1543
1571
|
configuration: import_v43.default.object({
|
|
1544
1572
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1545
1573
|
}).default({ maxLength: 255 }).optional(),
|
|
1546
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1574
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1547
1575
|
}).meta({
|
|
1548
1576
|
description: "An email input field",
|
|
1549
1577
|
id: "EmailField"
|
|
1550
1578
|
});
|
|
1551
1579
|
var DateField = BaseField.extend({
|
|
1552
1580
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1553
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1581
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1554
1582
|
configuration: import_v43.default.object({
|
|
1555
1583
|
notice: TranslationConfig.describe(
|
|
1556
1584
|
"Text to display above the date input"
|
|
@@ -1562,7 +1590,7 @@ var DateField = BaseField.extend({
|
|
|
1562
1590
|
});
|
|
1563
1591
|
var AgeField = BaseField.extend({
|
|
1564
1592
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1565
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1593
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1566
1594
|
configuration: import_v43.default.object({
|
|
1567
1595
|
asOfDate: FieldReference,
|
|
1568
1596
|
prefix: TranslationConfig.optional(),
|
|
@@ -1574,7 +1602,7 @@ var AgeField = BaseField.extend({
|
|
|
1574
1602
|
});
|
|
1575
1603
|
var TimeField = BaseField.extend({
|
|
1576
1604
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1577
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1605
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1578
1606
|
configuration: import_v43.default.object({
|
|
1579
1607
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1580
1608
|
notice: TranslationConfig.describe(
|
|
@@ -1587,7 +1615,7 @@ var TimeField = BaseField.extend({
|
|
|
1587
1615
|
});
|
|
1588
1616
|
var DateRangeField = BaseField.extend({
|
|
1589
1617
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1590
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1618
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1591
1619
|
configuration: import_v43.default.object({
|
|
1592
1620
|
notice: TranslationConfig.describe(
|
|
1593
1621
|
"Text to display above the date input"
|
|
@@ -1666,7 +1694,7 @@ var PageHeader = BaseField.extend({
|
|
|
1666
1694
|
});
|
|
1667
1695
|
var File = BaseField.extend({
|
|
1668
1696
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1669
|
-
defaultValue: FileFieldValue.optional(),
|
|
1697
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1670
1698
|
configuration: import_v43.default.object({
|
|
1671
1699
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1672
1700
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1693,7 +1721,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1693
1721
|
});
|
|
1694
1722
|
var NumberWithUnitField = BaseField.extend({
|
|
1695
1723
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1696
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1724
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1697
1725
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1698
1726
|
configuration: import_v43.default.object({
|
|
1699
1727
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1708,7 +1736,7 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1708
1736
|
});
|
|
1709
1737
|
var RadioGroup = BaseField.extend({
|
|
1710
1738
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1711
|
-
defaultValue: TextValue.optional(),
|
|
1739
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1712
1740
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1713
1741
|
configuration: import_v43.default.object({
|
|
1714
1742
|
styles: import_v43.default.object({
|
|
@@ -1733,7 +1761,7 @@ var BulletList = BaseField.extend({
|
|
|
1733
1761
|
});
|
|
1734
1762
|
var Select = BaseField.extend({
|
|
1735
1763
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1736
|
-
defaultValue: TextValue.optional(),
|
|
1764
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1737
1765
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1738
1766
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1739
1767
|
`
|
|
@@ -1755,7 +1783,7 @@ var SelectDateRangeOption = import_v43.default.object({
|
|
|
1755
1783
|
});
|
|
1756
1784
|
var SelectDateRangeField = BaseField.extend({
|
|
1757
1785
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
1758
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
1786
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
1759
1787
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
1760
1788
|
}).meta({
|
|
1761
1789
|
description: "A date range selection field",
|
|
@@ -1772,7 +1800,7 @@ var NameField = BaseField.extend({
|
|
|
1772
1800
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1773
1801
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
1774
1802
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
1775
|
-
}).optional(),
|
|
1803
|
+
}).or(ComputedDefaultValue).optional(),
|
|
1776
1804
|
configuration: import_v43.default.object({
|
|
1777
1805
|
name: NameConfig.default({
|
|
1778
1806
|
firstname: { required: true },
|
|
@@ -1796,14 +1824,14 @@ var NameField = BaseField.extend({
|
|
|
1796
1824
|
id: "NameField"
|
|
1797
1825
|
});
|
|
1798
1826
|
var PhoneField = BaseField.extend({
|
|
1799
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1827
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1800
1828
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
1801
1829
|
}).meta({
|
|
1802
1830
|
description: "A field for entering a phone number",
|
|
1803
1831
|
id: "PhoneField"
|
|
1804
1832
|
});
|
|
1805
1833
|
var IdField = BaseField.extend({
|
|
1806
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1834
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1807
1835
|
type: import_v43.default.literal(FieldType.ID)
|
|
1808
1836
|
}).meta({
|
|
1809
1837
|
description: "A field for entering an ID",
|
|
@@ -1811,14 +1839,14 @@ var IdField = BaseField.extend({
|
|
|
1811
1839
|
});
|
|
1812
1840
|
var Checkbox = BaseField.extend({
|
|
1813
1841
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
1814
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
1842
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
1815
1843
|
}).meta({
|
|
1816
1844
|
description: "A boolean checkbox field",
|
|
1817
1845
|
id: "Checkbox"
|
|
1818
1846
|
});
|
|
1819
1847
|
var Country = BaseField.extend({
|
|
1820
1848
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
1821
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1849
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1822
1850
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
1823
1851
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
1824
1852
|
)
|
|
@@ -1836,7 +1864,7 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
1836
1864
|
]);
|
|
1837
1865
|
var AdministrativeAreaField = BaseField.extend({
|
|
1838
1866
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
1839
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1867
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1840
1868
|
configuration: import_v43.default.object({
|
|
1841
1869
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
1842
1870
|
type: AdministrativeAreas,
|
|
@@ -1848,7 +1876,7 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
1848
1876
|
});
|
|
1849
1877
|
var LocationInput = BaseField.extend({
|
|
1850
1878
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
1851
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1879
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1852
1880
|
configuration: import_v43.default.object({
|
|
1853
1881
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
1854
1882
|
allowedLocations: AllowedLocations
|
|
@@ -1860,7 +1888,7 @@ var LocationInput = BaseField.extend({
|
|
|
1860
1888
|
var FileUploadWithOptions = BaseField.extend({
|
|
1861
1889
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
1862
1890
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1863
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
1891
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
1864
1892
|
configuration: import_v43.default.object({
|
|
1865
1893
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1866
1894
|
maxImageSize: import_v43.default.object({
|
|
@@ -1876,12 +1904,12 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
1876
1904
|
});
|
|
1877
1905
|
var Facility = BaseField.extend({
|
|
1878
1906
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
1879
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1907
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1880
1908
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1881
1909
|
}).describe("Input field for a facility");
|
|
1882
1910
|
var Office = BaseField.extend({
|
|
1883
1911
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
1884
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1912
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1885
1913
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
1886
1914
|
}).describe("Input field for an office");
|
|
1887
1915
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -1917,7 +1945,7 @@ var Address = BaseField.extend({
|
|
|
1917
1945
|
).optional(),
|
|
1918
1946
|
allowedLocations: AllowedLocations
|
|
1919
1947
|
}).optional(),
|
|
1920
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
1948
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
1921
1949
|
}).meta({
|
|
1922
1950
|
description: "Address input field \u2013 a combination of location and text fields",
|
|
1923
1951
|
id: "Address"
|
|
@@ -1964,7 +1992,7 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
1964
1992
|
});
|
|
1965
1993
|
var ButtonField = BaseField.extend({
|
|
1966
1994
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
1967
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
1995
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
1968
1996
|
configuration: ButtonConfiguration
|
|
1969
1997
|
}).meta({
|
|
1970
1998
|
description: "A generic button that can be used to trigger an action",
|
|
@@ -1992,7 +2020,7 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
1992
2020
|
});
|
|
1993
2021
|
var HttpField = BaseField.extend({
|
|
1994
2022
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
1995
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2023
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
1996
2024
|
configuration: import_v43.default.object({
|
|
1997
2025
|
trigger: FieldReference.optional().describe(
|
|
1998
2026
|
"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 +2106,7 @@ var LinkButtonField = BaseField.extend({
|
|
|
2078
2106
|
});
|
|
2079
2107
|
var VerificationStatus = BaseField.extend({
|
|
2080
2108
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2081
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2109
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2082
2110
|
configuration: import_v43.default.object({
|
|
2083
2111
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2084
2112
|
description: TranslationConfig.describe(
|
|
@@ -2100,7 +2128,7 @@ var QueryParamReaderField = BaseField.extend({
|
|
|
2100
2128
|
});
|
|
2101
2129
|
var QrReaderField = BaseField.extend({
|
|
2102
2130
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2103
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2131
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2104
2132
|
configuration: import_v43.default.object({
|
|
2105
2133
|
validator: import_v43.default.any().meta({
|
|
2106
2134
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2113,7 +2141,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2113
2141
|
});
|
|
2114
2142
|
var IdReaderField = BaseField.extend({
|
|
2115
2143
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2116
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2144
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2117
2145
|
methods: import_v43.default.array(
|
|
2118
2146
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2119
2147
|
)
|
|
@@ -2274,6 +2302,7 @@ var ClientConfig = z20.object({
|
|
|
2274
2302
|
COUNTRY: z20.string(),
|
|
2275
2303
|
LANGUAGES: z20.array(z20.string()),
|
|
2276
2304
|
SENTRY: z20.string().optional(),
|
|
2305
|
+
LOGIN_URL: z20.string().optional(),
|
|
2277
2306
|
REGISTER_BACKGROUND: BackgroundConfig,
|
|
2278
2307
|
DASHBOARDS: z20.array(
|
|
2279
2308
|
z20.object({
|