@opencrvs/toolkit 2.0.0-rc.c07ca60 → 2.0.0-rc.c0a396f

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.
Files changed (102) hide show
  1. package/README.md +15 -0
  2. package/build.sh +3 -2
  3. package/dist/application-config/index.js +70 -40
  4. package/dist/cli.js +3262 -50
  5. package/dist/commons/api/router.d.ts +102 -17
  6. package/dist/commons/application-config/index.d.ts +1 -0
  7. package/dist/commons/conditionals/conditionals.d.ts +351 -7
  8. package/dist/commons/conditionals/validate.d.ts +51 -2
  9. package/dist/commons/events/ActionConfig.d.ts +28 -2
  10. package/dist/commons/events/ActionDocument.d.ts +6 -0
  11. package/dist/commons/events/ActionInput.d.ts +6 -0
  12. package/dist/commons/events/AdvancedSearchConfig.d.ts +354 -0
  13. package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
  14. package/dist/commons/events/EventConfig.d.ts +2 -0
  15. package/dist/commons/events/EventDocument.d.ts +3 -0
  16. package/dist/commons/events/EventIndex.d.ts +25 -0
  17. package/dist/commons/events/EventMetadata.d.ts +26 -0
  18. package/dist/commons/events/FieldConfig.d.ts +388 -50
  19. package/dist/commons/events/FieldType.d.ts +1 -0
  20. package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
  21. package/dist/commons/events/FieldValue.d.ts +6 -0
  22. package/dist/commons/events/WorkqueueConfig.d.ts +39 -0
  23. package/dist/commons/events/field.d.ts +53 -1
  24. package/dist/commons/events/index.d.ts +1 -0
  25. package/dist/commons/events/locations.d.ts +1 -0
  26. package/dist/commons/events/state/flags.d.ts +16 -0
  27. package/dist/commons/events/state/index.d.ts +8 -0
  28. package/dist/commons/events/state/utils.d.ts +21 -287
  29. package/dist/commons/events/utils.d.ts +12 -1
  30. package/dist/conditionals/index.js +58 -6
  31. package/dist/environment/custom-types.d.ts +33 -0
  32. package/dist/environment/custom-types.d.ts.map +1 -0
  33. package/dist/environment/custom-types.js +12 -0
  34. package/dist/environment/derived-variables.d.ts +134 -0
  35. package/dist/environment/derived-variables.d.ts.map +1 -0
  36. package/dist/environment/derived-variables.js +169 -0
  37. package/dist/environment/editor-questions.d.ts +4 -0
  38. package/dist/environment/editor-questions.d.ts.map +1 -0
  39. package/dist/environment/editor-questions.js +67 -0
  40. package/dist/environment/git.d.ts +5 -0
  41. package/dist/environment/git.d.ts.map +1 -0
  42. package/dist/environment/git.js +38 -0
  43. package/dist/environment/github.d.ts +26 -0
  44. package/dist/environment/github.d.ts.map +1 -0
  45. package/dist/environment/github.js +247 -0
  46. package/dist/environment/index.d.ts +5 -0
  47. package/dist/environment/index.d.ts.map +1 -0
  48. package/dist/environment/index.js +71 -0
  49. package/dist/environment/logger.d.ts +15 -0
  50. package/dist/environment/logger.d.ts.map +1 -0
  51. package/dist/environment/logger.js +25 -0
  52. package/dist/environment/manage-users.d.ts +11 -0
  53. package/dist/environment/manage-users.d.ts.map +1 -0
  54. package/dist/environment/manage-users.js +497 -0
  55. package/dist/environment/questions-helper.d.ts +15 -0
  56. package/dist/environment/questions-helper.d.ts.map +1 -0
  57. package/dist/environment/questions-helper.js +70 -0
  58. package/dist/environment/questions.d.ts +199 -0
  59. package/dist/environment/questions.d.ts.map +1 -0
  60. package/dist/environment/questions.js +412 -0
  61. package/dist/environment/setup-environment.d.ts +2 -0
  62. package/dist/environment/setup-environment.d.ts.map +1 -0
  63. package/dist/environment/setup-environment.js +794 -0
  64. package/dist/environment/ssh-keygen.d.ts +5 -0
  65. package/dist/environment/ssh-keygen.d.ts.map +1 -0
  66. package/dist/environment/ssh-keygen.js +21 -0
  67. package/dist/environment/swarm-to-k8s.d.ts +2 -0
  68. package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
  69. package/dist/environment/swarm-to-k8s.js +173 -0
  70. package/dist/environment/templates.d.ts +27 -0
  71. package/dist/environment/templates.d.ts.map +1 -0
  72. package/dist/environment/templates.js +163 -0
  73. package/dist/environment/update-workflows.d.ts +2 -0
  74. package/dist/environment/update-workflows.d.ts.map +1 -0
  75. package/dist/environment/update-workflows.js +169 -0
  76. package/dist/environment/users.d.ts +2 -0
  77. package/dist/environment/users.d.ts.map +1 -0
  78. package/dist/environment/users.js +112 -0
  79. package/dist/environment/utils.d.ts +18 -0
  80. package/dist/environment/utils.d.ts.map +1 -0
  81. package/dist/environment/utils.js +100 -0
  82. package/dist/events/index.js +446 -147
  83. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  84. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  85. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  86. package/dist/migrations/v2.0/index.js +20 -9
  87. package/dist/notification/index.js +265 -45
  88. package/dist/scopes/index.d.ts +93 -7
  89. package/dist/scopes/index.js +19 -8
  90. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  91. package/dist/templates/charts-values/dependencies/values.yaml +83 -0
  92. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  93. package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
  94. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  95. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  96. package/dist/templates/inventory/inventory.template.yml +100 -0
  97. package/dist/templates/inventory/production.example.yml +77 -0
  98. package/dist/templates/inventory/qa.example.yml +48 -0
  99. package/opencrvs-toolkit-2.0.0-rc.c0a396f.tgz +0 -0
  100. package/package.json +15 -1
  101. package/tsconfig.tsbuildinfo +1 -1
  102. package/opencrvs-toolkit-2.0.0-rc.c07ca60.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 = TextValue.min(1);
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 scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
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 = scopeOptionsDeclared.extend({
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: scopeOptionsDeclared.optional()
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
- registeredIn: JurisdictionFilter.enum.all,
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",
@@ -1253,7 +1270,8 @@ var Range = import_v4.z.object({
1253
1270
  });
1254
1271
  var ContainsFlags = import_v4.z.object({
1255
1272
  anyOf: import_v4.z.array(Flag).optional(),
1256
- noneOf: import_v4.z.array(Flag).optional()
1273
+ noneOf: import_v4.z.array(Flag).optional(),
1274
+ allOf: import_v4.z.array(Flag).optional()
1257
1275
  }).meta({
1258
1276
  id: "ContainsFlags"
1259
1277
  });
@@ -1410,8 +1428,18 @@ var FieldReference = import_v43.default.object({
1410
1428
  $$field: FieldId.describe("Id of the field to reference"),
1411
1429
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
1412
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."
1413
1441
  )
1414
- }).describe("Reference to a field by its ID");
1442
+ }).describe("A context-only computation used as a field default value.");
1415
1443
  var ValidationConfig = import_v43.default.object({
1416
1444
  validator: Conditional.describe(
1417
1445
  "Conditional expression that must hold for the field value to be considered valid."
@@ -1452,7 +1480,7 @@ var BaseField = import_v43.default.object({
1452
1480
  "Indicates whether the field can be modified during record correction."
1453
1481
  ),
1454
1482
  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."
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."
1456
1484
  ),
1457
1485
  analytics: import_v43.default.boolean().default(false).optional().describe(
1458
1486
  "Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
@@ -1466,7 +1494,7 @@ var Divider = BaseField.extend({
1466
1494
  });
1467
1495
  var TextField = BaseField.extend({
1468
1496
  type: import_v43.default.literal(FieldType.TEXT),
1469
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1497
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1470
1498
  configuration: import_v43.default.object({
1471
1499
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
1472
1500
  type: import_v43.default.enum(["text", "password"]).optional(),
@@ -1479,10 +1507,11 @@ var TextField = BaseField.extend({
1479
1507
  });
1480
1508
  var NumberField = BaseField.extend({
1481
1509
  type: import_v43.default.literal(FieldType.NUMBER),
1482
- defaultValue: NumberFieldValue.optional(),
1510
+ defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
1483
1511
  configuration: import_v43.default.object({
1484
1512
  min: import_v43.default.number().optional().describe("Minimum value"),
1485
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"),
1486
1515
  prefix: TranslationConfig.optional(),
1487
1516
  postfix: TranslationConfig.optional()
1488
1517
  }).optional()
@@ -1492,7 +1521,7 @@ var NumberField = BaseField.extend({
1492
1521
  });
1493
1522
  var TextAreaField = BaseField.extend({
1494
1523
  type: import_v43.default.literal(FieldType.TEXTAREA),
1495
- defaultValue: NonEmptyTextValue.optional(),
1524
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1496
1525
  configuration: import_v43.default.object({
1497
1526
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
1498
1527
  rows: import_v43.default.number().optional().describe("Number of visible text lines"),
@@ -1526,7 +1555,7 @@ var SignatureField = BaseField.extend({
1526
1555
  signaturePromptLabel: TranslationConfig.describe(
1527
1556
  "Title of the signature modal"
1528
1557
  ),
1529
- defaultValue: FieldValue.optional(),
1558
+ defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
1530
1559
  configuration: import_v43.default.object({
1531
1560
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1532
1561
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
@@ -1542,14 +1571,14 @@ var EmailField = BaseField.extend({
1542
1571
  configuration: import_v43.default.object({
1543
1572
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
1544
1573
  }).default({ maxLength: 255 }).optional(),
1545
- defaultValue: NonEmptyTextValue.optional()
1574
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
1546
1575
  }).meta({
1547
1576
  description: "An email input field",
1548
1577
  id: "EmailField"
1549
1578
  });
1550
1579
  var DateField = BaseField.extend({
1551
1580
  type: import_v43.default.literal(FieldType.DATE),
1552
- 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)"),
1553
1582
  configuration: import_v43.default.object({
1554
1583
  notice: TranslationConfig.describe(
1555
1584
  "Text to display above the date input"
@@ -1561,7 +1590,7 @@ var DateField = BaseField.extend({
1561
1590
  });
1562
1591
  var AgeField = BaseField.extend({
1563
1592
  type: import_v43.default.literal(FieldType.AGE),
1564
- defaultValue: NumberFieldValue.optional(),
1593
+ defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
1565
1594
  configuration: import_v43.default.object({
1566
1595
  asOfDate: FieldReference,
1567
1596
  prefix: TranslationConfig.optional(),
@@ -1573,7 +1602,7 @@ var AgeField = BaseField.extend({
1573
1602
  });
1574
1603
  var TimeField = BaseField.extend({
1575
1604
  type: import_v43.default.literal(FieldType.TIME),
1576
- 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)"),
1577
1606
  configuration: import_v43.default.object({
1578
1607
  use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
1579
1608
  notice: TranslationConfig.describe(
@@ -1586,7 +1615,7 @@ var TimeField = BaseField.extend({
1586
1615
  });
1587
1616
  var DateRangeField = BaseField.extend({
1588
1617
  type: import_v43.default.literal(FieldType.DATE_RANGE),
1589
- defaultValue: DateRangeFieldValue.optional(),
1618
+ defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
1590
1619
  configuration: import_v43.default.object({
1591
1620
  notice: TranslationConfig.describe(
1592
1621
  "Text to display above the date input"
@@ -1665,7 +1694,7 @@ var PageHeader = BaseField.extend({
1665
1694
  });
1666
1695
  var File = BaseField.extend({
1667
1696
  type: import_v43.default.literal(FieldType.FILE),
1668
- defaultValue: FileFieldValue.optional(),
1697
+ defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
1669
1698
  configuration: import_v43.default.object({
1670
1699
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1671
1700
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
@@ -1692,7 +1721,7 @@ var SelectOption = import_v43.default.object({
1692
1721
  });
1693
1722
  var NumberWithUnitField = BaseField.extend({
1694
1723
  type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
1695
- defaultValue: NumberWithUnitFieldValue.optional(),
1724
+ defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
1696
1725
  options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
1697
1726
  configuration: import_v43.default.object({
1698
1727
  min: import_v43.default.number().optional().describe("Minimum value of the number field"),
@@ -1707,7 +1736,7 @@ var NumberWithUnitField = BaseField.extend({
1707
1736
  });
1708
1737
  var RadioGroup = BaseField.extend({
1709
1738
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
1710
- defaultValue: TextValue.optional(),
1739
+ defaultValue: TextValue.or(ComputedDefaultValue).optional(),
1711
1740
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1712
1741
  configuration: import_v43.default.object({
1713
1742
  styles: import_v43.default.object({
@@ -1732,7 +1761,7 @@ var BulletList = BaseField.extend({
1732
1761
  });
1733
1762
  var Select = BaseField.extend({
1734
1763
  type: import_v43.default.literal(FieldType.SELECT),
1735
- defaultValue: TextValue.optional(),
1764
+ defaultValue: TextValue.or(ComputedDefaultValue).optional(),
1736
1765
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1737
1766
  noOptionsMessage: TranslationConfig.optional().describe(
1738
1767
  `
@@ -1754,7 +1783,7 @@ var SelectDateRangeOption = import_v43.default.object({
1754
1783
  });
1755
1784
  var SelectDateRangeField = BaseField.extend({
1756
1785
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
1757
- defaultValue: SelectDateRangeValue.optional(),
1786
+ defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
1758
1787
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
1759
1788
  }).meta({
1760
1789
  description: "A date range selection field",
@@ -1771,7 +1800,7 @@ var NameField = BaseField.extend({
1771
1800
  firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
1772
1801
  middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
1773
1802
  surname: SerializedUserField.or(NonEmptyTextValue).optional()
1774
- }).optional(),
1803
+ }).or(ComputedDefaultValue).optional(),
1775
1804
  configuration: import_v43.default.object({
1776
1805
  name: NameConfig.default({
1777
1806
  firstname: { required: true },
@@ -1795,14 +1824,14 @@ var NameField = BaseField.extend({
1795
1824
  id: "NameField"
1796
1825
  });
1797
1826
  var PhoneField = BaseField.extend({
1798
- defaultValue: NonEmptyTextValue.optional(),
1827
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1799
1828
  type: import_v43.default.literal(FieldType.PHONE)
1800
1829
  }).meta({
1801
1830
  description: "A field for entering a phone number",
1802
1831
  id: "PhoneField"
1803
1832
  });
1804
1833
  var IdField = BaseField.extend({
1805
- defaultValue: NonEmptyTextValue.optional(),
1834
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1806
1835
  type: import_v43.default.literal(FieldType.ID)
1807
1836
  }).meta({
1808
1837
  description: "A field for entering an ID",
@@ -1810,14 +1839,14 @@ var IdField = BaseField.extend({
1810
1839
  });
1811
1840
  var Checkbox = BaseField.extend({
1812
1841
  type: import_v43.default.literal(FieldType.CHECKBOX),
1813
- defaultValue: CheckboxFieldValue.default(false)
1842
+ defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
1814
1843
  }).meta({
1815
1844
  description: "A boolean checkbox field",
1816
1845
  id: "Checkbox"
1817
1846
  });
1818
1847
  var Country = BaseField.extend({
1819
1848
  type: import_v43.default.literal(FieldType.COUNTRY),
1820
- defaultValue: NonEmptyTextValue.optional(),
1849
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1821
1850
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
1822
1851
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
1823
1852
  )
@@ -1835,7 +1864,7 @@ var AdministrativeAreas = import_v43.default.enum([
1835
1864
  ]);
1836
1865
  var AdministrativeAreaField = BaseField.extend({
1837
1866
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
1838
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1867
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1839
1868
  configuration: import_v43.default.object({
1840
1869
  partOf: FieldReference.optional().describe("Parent location"),
1841
1870
  type: AdministrativeAreas,
@@ -1847,7 +1876,7 @@ var AdministrativeAreaField = BaseField.extend({
1847
1876
  });
1848
1877
  var LocationInput = BaseField.extend({
1849
1878
  type: import_v43.default.literal(FieldType.LOCATION),
1850
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1879
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1851
1880
  configuration: import_v43.default.object({
1852
1881
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
1853
1882
  allowedLocations: AllowedLocations
@@ -1859,7 +1888,7 @@ var LocationInput = BaseField.extend({
1859
1888
  var FileUploadWithOptions = BaseField.extend({
1860
1889
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
1861
1890
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1862
- defaultValue: FileFieldWithOptionValue.optional(),
1891
+ defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
1863
1892
  configuration: import_v43.default.object({
1864
1893
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1865
1894
  maxImageSize: import_v43.default.object({
@@ -1875,12 +1904,12 @@ var FileUploadWithOptions = BaseField.extend({
1875
1904
  });
1876
1905
  var Facility = BaseField.extend({
1877
1906
  type: import_v43.default.literal(FieldType.FACILITY),
1878
- defaultValue: NonEmptyTextValue.optional(),
1907
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1879
1908
  configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
1880
1909
  }).describe("Input field for a facility");
1881
1910
  var Office = BaseField.extend({
1882
1911
  type: import_v43.default.literal(FieldType.OFFICE),
1883
- defaultValue: NonEmptyTextValue.optional(),
1912
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1884
1913
  configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
1885
1914
  }).describe("Input field for an office");
1886
1915
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
@@ -1916,7 +1945,7 @@ var Address = BaseField.extend({
1916
1945
  ).optional(),
1917
1946
  allowedLocations: AllowedLocations
1918
1947
  }).optional(),
1919
- defaultValue: DefaultAddressFieldValue.optional()
1948
+ defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
1920
1949
  }).meta({
1921
1950
  description: "Address input field \u2013 a combination of location and text fields",
1922
1951
  id: "Address"
@@ -1963,7 +1992,7 @@ var ButtonConfiguration = import_v43.default.object({
1963
1992
  });
1964
1993
  var ButtonField = BaseField.extend({
1965
1994
  type: import_v43.default.literal(FieldType.BUTTON),
1966
- defaultValue: ButtonFieldValue.optional(),
1995
+ defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
1967
1996
  configuration: ButtonConfiguration
1968
1997
  }).meta({
1969
1998
  description: "A generic button that can be used to trigger an action",
@@ -1991,7 +2020,7 @@ var AlphaPrintButton = BaseField.extend({
1991
2020
  });
1992
2021
  var HttpField = BaseField.extend({
1993
2022
  type: import_v43.default.literal(FieldType.HTTP),
1994
- defaultValue: HttpFieldValue.optional(),
2023
+ defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
1995
2024
  configuration: import_v43.default.object({
1996
2025
  trigger: FieldReference.optional().describe(
1997
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."
@@ -2077,7 +2106,7 @@ var LinkButtonField = BaseField.extend({
2077
2106
  });
2078
2107
  var VerificationStatus = BaseField.extend({
2079
2108
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
2080
- defaultValue: VerificationStatusValue.optional(),
2109
+ defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
2081
2110
  configuration: import_v43.default.object({
2082
2111
  status: TranslationConfig.describe("Text to display on the status pill."),
2083
2112
  description: TranslationConfig.describe(
@@ -2099,7 +2128,7 @@ var QueryParamReaderField = BaseField.extend({
2099
2128
  });
2100
2129
  var QrReaderField = BaseField.extend({
2101
2130
  type: import_v43.default.literal(FieldType.QR_READER),
2102
- defaultValue: QrReaderFieldValue.optional(),
2131
+ defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
2103
2132
  configuration: import_v43.default.object({
2104
2133
  validator: import_v43.default.any().meta({
2105
2134
  description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
@@ -2112,7 +2141,7 @@ var QrReaderField = BaseField.extend({
2112
2141
  });
2113
2142
  var IdReaderField = BaseField.extend({
2114
2143
  type: import_v43.default.literal(FieldType.ID_READER),
2115
- defaultValue: IdReaderFieldValue.optional(),
2144
+ defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
2116
2145
  methods: import_v43.default.array(
2117
2146
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2118
2147
  )
@@ -2273,6 +2302,7 @@ var ClientConfig = z20.object({
2273
2302
  COUNTRY: z20.string(),
2274
2303
  LANGUAGES: z20.array(z20.string()),
2275
2304
  SENTRY: z20.string().optional(),
2305
+ LOGIN_URL: z20.string().optional(),
2276
2306
  REGISTER_BACKGROUND: BackgroundConfig,
2277
2307
  DASHBOARDS: z20.array(
2278
2308
  z20.object({