@opencrvs/toolkit 2.0.0-rc.9954a7c → 2.0.0-rc.99921a2

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 (113) hide show
  1. package/README.md +15 -0
  2. package/build.sh +5 -4
  3. package/dist/application-config/index.js +82 -40
  4. package/dist/cli.js +3186 -4915
  5. package/dist/commons/api/router.d.ts +700 -22
  6. package/dist/commons/application-config/index.d.ts +1 -0
  7. package/dist/commons/conditionals/conditionals.d.ts +354 -10
  8. package/dist/commons/conditionals/validate.d.ts +51 -2
  9. package/dist/commons/events/ActionConfig.d.ts +230 -2
  10. package/dist/commons/events/ActionDocument.d.ts +50 -0
  11. package/dist/commons/events/ActionInput.d.ts +32 -0
  12. package/dist/commons/events/ActionType.d.ts +6 -1
  13. package/dist/commons/events/AdvancedSearchConfig.d.ts +360 -0
  14. package/dist/commons/events/AuditLog.d.ts +2 -0
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
  16. package/dist/commons/events/Draft.d.ts +2 -0
  17. package/dist/commons/events/EventConfig.d.ts +2 -0
  18. package/dist/commons/events/EventDocument.d.ts +25 -0
  19. package/dist/commons/events/EventIndex.d.ts +25 -0
  20. package/dist/commons/events/EventMetadata.d.ts +26 -0
  21. package/dist/commons/events/FieldConfig.d.ts +393 -50
  22. package/dist/commons/events/FieldType.d.ts +1 -0
  23. package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
  24. package/dist/commons/events/FieldValue.d.ts +6 -0
  25. package/dist/commons/events/WorkqueueConfig.d.ts +44 -2
  26. package/dist/commons/events/field.d.ts +53 -1
  27. package/dist/commons/events/index.d.ts +1 -0
  28. package/dist/commons/events/locations.d.ts +1 -0
  29. package/dist/commons/events/scopes.d.ts +1 -0
  30. package/dist/commons/events/state/flags.d.ts +14 -0
  31. package/dist/commons/events/state/index.d.ts +8 -0
  32. package/dist/commons/events/state/utils.d.ts +21 -287
  33. package/dist/commons/events/test.utils.d.ts +9 -1
  34. package/dist/commons/events/utils.d.ts +27 -2
  35. package/dist/conditionals/index.js +60 -6
  36. package/dist/environment/custom-types.d.ts +33 -0
  37. package/dist/environment/custom-types.d.ts.map +1 -0
  38. package/dist/environment/custom-types.js +12 -0
  39. package/dist/environment/derived-variables.d.ts +134 -0
  40. package/dist/environment/derived-variables.d.ts.map +1 -0
  41. package/dist/environment/derived-variables.js +169 -0
  42. package/dist/environment/editor-questions.d.ts +4 -0
  43. package/dist/environment/editor-questions.d.ts.map +1 -0
  44. package/dist/environment/editor-questions.js +67 -0
  45. package/dist/environment/git.d.ts +5 -0
  46. package/dist/environment/git.d.ts.map +1 -0
  47. package/dist/environment/git.js +38 -0
  48. package/dist/environment/github.d.ts +26 -0
  49. package/dist/environment/github.d.ts.map +1 -0
  50. package/dist/environment/github.js +247 -0
  51. package/dist/environment/index.d.ts +5 -0
  52. package/dist/environment/index.d.ts.map +1 -0
  53. package/dist/environment/index.js +71 -0
  54. package/dist/environment/logger.d.ts +15 -0
  55. package/dist/environment/logger.d.ts.map +1 -0
  56. package/dist/environment/logger.js +25 -0
  57. package/dist/environment/manage-users.d.ts +11 -0
  58. package/dist/environment/manage-users.d.ts.map +1 -0
  59. package/dist/environment/manage-users.js +497 -0
  60. package/dist/environment/questions-helper.d.ts +15 -0
  61. package/dist/environment/questions-helper.d.ts.map +1 -0
  62. package/dist/environment/questions-helper.js +70 -0
  63. package/dist/environment/questions.d.ts +199 -0
  64. package/dist/environment/questions.d.ts.map +1 -0
  65. package/dist/environment/questions.js +412 -0
  66. package/dist/environment/setup-environment.d.ts +2 -0
  67. package/dist/environment/setup-environment.d.ts.map +1 -0
  68. package/dist/environment/setup-environment.js +794 -0
  69. package/dist/environment/ssh-keygen.d.ts +5 -0
  70. package/dist/environment/ssh-keygen.d.ts.map +1 -0
  71. package/dist/environment/ssh-keygen.js +21 -0
  72. package/dist/environment/swarm-to-k8s.d.ts +2 -0
  73. package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
  74. package/dist/environment/swarm-to-k8s.js +173 -0
  75. package/dist/environment/templates.d.ts +27 -0
  76. package/dist/environment/templates.d.ts.map +1 -0
  77. package/dist/environment/templates.js +163 -0
  78. package/dist/environment/update-workflows.d.ts +2 -0
  79. package/dist/environment/update-workflows.d.ts.map +1 -0
  80. package/dist/environment/update-workflows.js +169 -0
  81. package/dist/environment/users.d.ts +2 -0
  82. package/dist/environment/users.d.ts.map +1 -0
  83. package/dist/environment/users.js +112 -0
  84. package/dist/environment/utils.d.ts +18 -0
  85. package/dist/environment/utils.d.ts.map +1 -0
  86. package/dist/environment/utils.js +100 -0
  87. package/dist/events/index.js +600 -158
  88. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  89. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  90. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  91. package/dist/migrations/v2.0/index.js +88 -5133
  92. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
  93. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
  94. package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
  95. package/dist/migrations/v2.1/index.d.ts +6 -0
  96. package/dist/migrations/v2.1/index.d.ts.map +1 -0
  97. package/dist/migrations/v2.1/index.js +218 -0
  98. package/dist/notification/index.js +389 -49
  99. package/dist/scopes/index.d.ts +100 -8
  100. package/dist/scopes/index.js +21 -8
  101. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  102. package/dist/templates/charts-values/dependencies/values.yaml +83 -0
  103. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  104. package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
  105. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  106. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  107. package/dist/templates/inventory/inventory.template.yml +100 -0
  108. package/dist/templates/inventory/production.example.yml +77 -0
  109. package/dist/templates/inventory/qa.example.yml +48 -0
  110. package/opencrvs-toolkit-2.0.0-rc.99921a2.tgz +0 -0
  111. package/package.json +15 -1
  112. package/tsconfig.tsbuildinfo +1 -1
  113. package/opencrvs-toolkit-2.0.0-rc.9954a7c.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
@@ -51,8 +51,8 @@ mkdir -p ./dist/commons/application-config
51
51
  cp -r ../commons/build/dist/common/application-config.d.ts ./dist/commons/application-config/index.d.ts
52
52
 
53
53
  # Build migration CLI
54
- npx esbuild src/migrations/v2.0/index.ts --bundle --format=cjs --outdir=./dist/migrations/v2.0 --allow-overwrite --packages=external --banner:js="#!/usr/bin/env node"
55
- chmod +x ./dist/migrations/v2.0/index.js
54
+ npx esbuild src/migrations/v2.1/index.ts --bundle --format=cjs --outdir=./dist/migrations/v2.1 --allow-overwrite --packages=external --banner:js="#!/usr/bin/env node"
55
+ chmod +x ./dist/migrations/v2.1/index.js
56
56
 
57
57
  if [[ "$OSTYPE" == "darwin"* ]]; then
58
58
  sed -i '' 's|@opencrvs/events/build/types|../commons/api|g' dist/api/index.d.ts
@@ -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",
@@ -514,6 +520,7 @@ var ActionType = {
514
520
  MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE",
515
521
  MARK_AS_NOT_DUPLICATE: "MARK_AS_NOT_DUPLICATE",
516
522
  ARCHIVE: "ARCHIVE",
523
+ UNARCHIVE: "UNARCHIVE",
517
524
  // Record actions
518
525
  PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
519
526
  REQUEST_CORRECTION: "REQUEST_CORRECTION",
@@ -533,6 +540,7 @@ var ConfirmableActions = [
533
540
  ActionType.REGISTER,
534
541
  ActionType.REJECT,
535
542
  ActionType.ARCHIVE,
543
+ ActionType.UNARCHIVE,
536
544
  ActionType.PRINT_CERTIFICATE,
537
545
  ActionType.REQUEST_CORRECTION,
538
546
  ActionType.APPROVE_CORRECTION,
@@ -551,6 +559,7 @@ var ActionTypes = z10.enum([
551
559
  "MARK_AS_DUPLICATE",
552
560
  "MARK_AS_NOT_DUPLICATE",
553
561
  "ARCHIVE",
562
+ "UNARCHIVE",
554
563
  "PRINT_CERTIFICATE",
555
564
  "REQUEST_CORRECTION",
556
565
  "REJECT_CORRECTION",
@@ -591,6 +600,7 @@ var WorkqueueActionType = ActionTypes.extract([
591
600
  ActionType.REJECT,
592
601
  ActionType.MARK_AS_DUPLICATE,
593
602
  ActionType.ARCHIVE,
603
+ ActionType.UNARCHIVE,
594
604
  ActionType.PRINT_CERTIFICATE,
595
605
  ActionType.REQUEST_CORRECTION
596
606
  ]);
@@ -620,6 +630,7 @@ var RecordScopeTypeV2 = z11.enum([
620
630
  "record.edit",
621
631
  "record.reject",
622
632
  "record.archive",
633
+ "record.unarchive",
623
634
  "record.review-duplicates",
624
635
  "record.register",
625
636
  "record.print-certified-copies",
@@ -659,11 +670,13 @@ var scopeOptionsPlaceEvent = z11.object({
659
670
  event: scopeByEvent,
660
671
  placeOfEvent: JurisdictionFilter.optional()
661
672
  }).describe("Options applicable to all record scopes.");
662
- var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
673
+ var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
674
+ notifiedIn: JurisdictionFilter.optional(),
675
+ notifiedBy: UserFilter.optional(),
663
676
  declaredIn: JurisdictionFilter.optional(),
664
677
  declaredBy: UserFilter.optional()
665
678
  }).describe("Options applicable to actions that may take place after DECLARE");
666
- var AllRecordScopeOptions = scopeOptionsDeclared.extend({
679
+ var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
667
680
  registeredIn: JurisdictionFilter.optional(),
668
681
  registeredBy: UserFilter.optional()
669
682
  }).describe(
@@ -701,6 +714,8 @@ var ResolvedScopeOptionsPlaceEvent = z11.object({
701
714
  "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
702
715
  );
703
716
  var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
717
+ notifiedIn: UUID.nullish(),
718
+ notifiedBy: z11.string().optional(),
704
719
  declaredIn: UUID.nullish(),
705
720
  declaredBy: z11.string().optional()
706
721
  }).describe(
@@ -721,6 +736,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
721
736
  "record.edit",
722
737
  "record.reject",
723
738
  "record.archive",
739
+ "record.unarchive",
724
740
  "record.review-duplicates",
725
741
  "record.register"
726
742
  ]);
@@ -746,7 +762,7 @@ var RecordScopeV2 = z11.discriminatedUnion("type", [
746
762
  }),
747
763
  z11.object({
748
764
  type: ScopesWithDeclaredOptions,
749
- options: scopeOptionsDeclared.optional()
765
+ options: scopeOptionsDeclaredOrNotified.optional()
750
766
  }),
751
767
  z11.object({
752
768
  type: ScopesWithFullOptions,
@@ -835,8 +851,9 @@ var EncodedScope = z11.string().brand("EncodedScope");
835
851
  var DEFAULT_SCOPE_OPTIONS = {
836
852
  placeOfEvent: JurisdictionFilter.enum.all,
837
853
  accessLevel: JurisdictionFilter.enum.all,
838
- registeredIn: JurisdictionFilter.enum.all,
839
- declaredIn: JurisdictionFilter.enum.all
854
+ notifiedIn: JurisdictionFilter.enum.all,
855
+ declaredIn: JurisdictionFilter.enum.all,
856
+ registeredIn: JurisdictionFilter.enum.all
840
857
  };
841
858
 
842
859
  // ../commons/src/authentication.ts
@@ -954,6 +971,11 @@ var ArchiveAction = ActionBase.extend(
954
971
  content: ReasonContent
955
972
  }).shape
956
973
  );
974
+ var UnarchiveAction = ActionBase.extend(
975
+ z13.object({
976
+ type: z13.literal(ActionType.UNARCHIVE)
977
+ }).shape
978
+ );
957
979
  var CreatedAction = ActionBase.extend(
958
980
  z13.object({
959
981
  type: z13.literal(ActionType.CREATE)
@@ -989,8 +1011,9 @@ var RequestedCorrectionAction = ActionBase.extend(
989
1011
  var ApprovedCorrectionAction = ActionBase.extend(
990
1012
  z13.object({
991
1013
  type: z13.literal(ActionType.APPROVE_CORRECTION),
992
- requestId: z13.string()
1014
+ requestId: z13.string(),
993
1015
  // TODO move into 'content' property
1016
+ content: z13.object({ immediateCorrection: z13.boolean().optional() }).optional()
994
1017
  }).shape
995
1018
  );
996
1019
  var RejectedCorrectionAction = ActionBase.extend(
@@ -1019,6 +1042,7 @@ var ActionDocument = z13.discriminatedUnion("type", [
1019
1042
  MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
1020
1043
  MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
1021
1044
  ArchiveAction.meta({ id: "ArchiveAction" }),
1045
+ UnarchiveAction.meta({ id: "UnarchiveAction" }),
1022
1046
  NotifiedAction.meta({ id: "NotifiedAction" }),
1023
1047
  RegisterAction.meta({ id: "RegisterAction" }),
1024
1048
  DeclareAction.meta({ id: "DeclareAction" }),
@@ -1124,6 +1148,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1124
1148
  )
1125
1149
  });
1126
1150
  var LegalStatuses = z15.object({
1151
+ [EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
1127
1152
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
1128
1153
  [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
1129
1154
  });
@@ -1183,6 +1208,8 @@ var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
1183
1208
  var EventMetadataDateFieldIdInput = z15.enum([
1184
1209
  "createdAt",
1185
1210
  "updatedAt",
1211
+ "legalStatuses.NOTIFIED.createdAt",
1212
+ "legalStatuses.NOTIFIED.acceptedAt",
1186
1213
  "legalStatuses.DECLARED.createdAt",
1187
1214
  "legalStatuses.DECLARED.acceptedAt",
1188
1215
  "legalStatuses.REGISTERED.createdAt",
@@ -1191,6 +1218,8 @@ var EventMetadataDateFieldIdInput = z15.enum([
1191
1218
  var EventMetadataDateFieldId = z15.enum([
1192
1219
  "event.createdAt",
1193
1220
  "event.updatedAt",
1221
+ "event.legalStatuses.NOTIFIED.createdAt",
1222
+ "event.legalStatuses.NOTIFIED.acceptedAt",
1194
1223
  "event.legalStatuses.DECLARED.createdAt",
1195
1224
  "event.legalStatuses.DECLARED.acceptedAt",
1196
1225
  "event.legalStatuses.REGISTERED.createdAt",
@@ -1253,7 +1282,8 @@ var Range = import_v4.z.object({
1253
1282
  });
1254
1283
  var ContainsFlags = import_v4.z.object({
1255
1284
  anyOf: import_v4.z.array(Flag).optional(),
1256
- noneOf: import_v4.z.array(Flag).optional()
1285
+ noneOf: import_v4.z.array(Flag).optional(),
1286
+ allOf: import_v4.z.array(Flag).optional()
1257
1287
  }).meta({
1258
1288
  id: "ContainsFlags"
1259
1289
  });
@@ -1410,8 +1440,18 @@ var FieldReference = import_v43.default.object({
1410
1440
  $$field: FieldId.describe("Id of the field to reference"),
1411
1441
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
1412
1442
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
1443
+ ),
1444
+ $$code: import_v43.default.string().optional().describe(
1445
+ "Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
1413
1446
  )
1414
- }).describe("Reference to a field by its ID");
1447
+ }).describe(
1448
+ "Reference to a field value, with an optional client-side computation applied."
1449
+ );
1450
+ var ComputedDefaultValue = import_v43.default.object({
1451
+ $$code: import_v43.default.string().describe(
1452
+ "Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
1453
+ )
1454
+ }).describe("A context-only computation used as a field default value.");
1415
1455
  var ValidationConfig = import_v43.default.object({
1416
1456
  validator: Conditional.describe(
1417
1457
  "Conditional expression that must hold for the field value to be considered valid."
@@ -1452,7 +1492,7 @@ var BaseField = import_v43.default.object({
1452
1492
  "Indicates whether the field can be modified during record correction."
1453
1493
  ),
1454
1494
  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."
1495
+ "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
1496
  ),
1457
1497
  analytics: import_v43.default.boolean().default(false).optional().describe(
1458
1498
  "Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
@@ -1466,7 +1506,7 @@ var Divider = BaseField.extend({
1466
1506
  });
1467
1507
  var TextField = BaseField.extend({
1468
1508
  type: import_v43.default.literal(FieldType.TEXT),
1469
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1509
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1470
1510
  configuration: import_v43.default.object({
1471
1511
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
1472
1512
  type: import_v43.default.enum(["text", "password"]).optional(),
@@ -1479,10 +1519,11 @@ var TextField = BaseField.extend({
1479
1519
  });
1480
1520
  var NumberField = BaseField.extend({
1481
1521
  type: import_v43.default.literal(FieldType.NUMBER),
1482
- defaultValue: NumberFieldValue.optional(),
1522
+ defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
1483
1523
  configuration: import_v43.default.object({
1484
1524
  min: import_v43.default.number().optional().describe("Minimum value"),
1485
1525
  max: import_v43.default.number().optional().describe("Maximum value"),
1526
+ integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
1486
1527
  prefix: TranslationConfig.optional(),
1487
1528
  postfix: TranslationConfig.optional()
1488
1529
  }).optional()
@@ -1492,7 +1533,7 @@ var NumberField = BaseField.extend({
1492
1533
  });
1493
1534
  var TextAreaField = BaseField.extend({
1494
1535
  type: import_v43.default.literal(FieldType.TEXTAREA),
1495
- defaultValue: NonEmptyTextValue.optional(),
1536
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1496
1537
  configuration: import_v43.default.object({
1497
1538
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
1498
1539
  rows: import_v43.default.number().optional().describe("Number of visible text lines"),
@@ -1526,7 +1567,7 @@ var SignatureField = BaseField.extend({
1526
1567
  signaturePromptLabel: TranslationConfig.describe(
1527
1568
  "Title of the signature modal"
1528
1569
  ),
1529
- defaultValue: FieldValue.optional(),
1570
+ defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
1530
1571
  configuration: import_v43.default.object({
1531
1572
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1532
1573
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
@@ -1542,14 +1583,14 @@ var EmailField = BaseField.extend({
1542
1583
  configuration: import_v43.default.object({
1543
1584
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
1544
1585
  }).default({ maxLength: 255 }).optional(),
1545
- defaultValue: NonEmptyTextValue.optional()
1586
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
1546
1587
  }).meta({
1547
1588
  description: "An email input field",
1548
1589
  id: "EmailField"
1549
1590
  });
1550
1591
  var DateField = BaseField.extend({
1551
1592
  type: import_v43.default.literal(FieldType.DATE),
1552
- defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
1593
+ defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
1553
1594
  configuration: import_v43.default.object({
1554
1595
  notice: TranslationConfig.describe(
1555
1596
  "Text to display above the date input"
@@ -1561,7 +1602,7 @@ var DateField = BaseField.extend({
1561
1602
  });
1562
1603
  var AgeField = BaseField.extend({
1563
1604
  type: import_v43.default.literal(FieldType.AGE),
1564
- defaultValue: NumberFieldValue.optional(),
1605
+ defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
1565
1606
  configuration: import_v43.default.object({
1566
1607
  asOfDate: FieldReference,
1567
1608
  prefix: TranslationConfig.optional(),
@@ -1573,7 +1614,7 @@ var AgeField = BaseField.extend({
1573
1614
  });
1574
1615
  var TimeField = BaseField.extend({
1575
1616
  type: import_v43.default.literal(FieldType.TIME),
1576
- defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
1617
+ defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
1577
1618
  configuration: import_v43.default.object({
1578
1619
  use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
1579
1620
  notice: TranslationConfig.describe(
@@ -1586,7 +1627,7 @@ var TimeField = BaseField.extend({
1586
1627
  });
1587
1628
  var DateRangeField = BaseField.extend({
1588
1629
  type: import_v43.default.literal(FieldType.DATE_RANGE),
1589
- defaultValue: DateRangeFieldValue.optional(),
1630
+ defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
1590
1631
  configuration: import_v43.default.object({
1591
1632
  notice: TranslationConfig.describe(
1592
1633
  "Text to display above the date input"
@@ -1665,7 +1706,7 @@ var PageHeader = BaseField.extend({
1665
1706
  });
1666
1707
  var File = BaseField.extend({
1667
1708
  type: import_v43.default.literal(FieldType.FILE),
1668
- defaultValue: FileFieldValue.optional(),
1709
+ defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
1669
1710
  configuration: import_v43.default.object({
1670
1711
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1671
1712
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
@@ -1692,7 +1733,7 @@ var SelectOption = import_v43.default.object({
1692
1733
  });
1693
1734
  var NumberWithUnitField = BaseField.extend({
1694
1735
  type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
1695
- defaultValue: NumberWithUnitFieldValue.optional(),
1736
+ defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
1696
1737
  options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
1697
1738
  configuration: import_v43.default.object({
1698
1739
  min: import_v43.default.number().optional().describe("Minimum value of the number field"),
@@ -1707,7 +1748,7 @@ var NumberWithUnitField = BaseField.extend({
1707
1748
  });
1708
1749
  var RadioGroup = BaseField.extend({
1709
1750
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
1710
- defaultValue: TextValue.optional(),
1751
+ defaultValue: TextValue.or(ComputedDefaultValue).optional(),
1711
1752
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1712
1753
  configuration: import_v43.default.object({
1713
1754
  styles: import_v43.default.object({
@@ -1732,7 +1773,7 @@ var BulletList = BaseField.extend({
1732
1773
  });
1733
1774
  var Select = BaseField.extend({
1734
1775
  type: import_v43.default.literal(FieldType.SELECT),
1735
- defaultValue: TextValue.optional(),
1776
+ defaultValue: TextValue.or(ComputedDefaultValue).optional(),
1736
1777
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1737
1778
  noOptionsMessage: TranslationConfig.optional().describe(
1738
1779
  `
@@ -1754,7 +1795,7 @@ var SelectDateRangeOption = import_v43.default.object({
1754
1795
  });
1755
1796
  var SelectDateRangeField = BaseField.extend({
1756
1797
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
1757
- defaultValue: SelectDateRangeValue.optional(),
1798
+ defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
1758
1799
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
1759
1800
  }).meta({
1760
1801
  description: "A date range selection field",
@@ -1771,7 +1812,7 @@ var NameField = BaseField.extend({
1771
1812
  firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
1772
1813
  middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
1773
1814
  surname: SerializedUserField.or(NonEmptyTextValue).optional()
1774
- }).optional(),
1815
+ }).or(ComputedDefaultValue).optional(),
1775
1816
  configuration: import_v43.default.object({
1776
1817
  name: NameConfig.default({
1777
1818
  firstname: { required: true },
@@ -1795,14 +1836,14 @@ var NameField = BaseField.extend({
1795
1836
  id: "NameField"
1796
1837
  });
1797
1838
  var PhoneField = BaseField.extend({
1798
- defaultValue: NonEmptyTextValue.optional(),
1839
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1799
1840
  type: import_v43.default.literal(FieldType.PHONE)
1800
1841
  }).meta({
1801
1842
  description: "A field for entering a phone number",
1802
1843
  id: "PhoneField"
1803
1844
  });
1804
1845
  var IdField = BaseField.extend({
1805
- defaultValue: NonEmptyTextValue.optional(),
1846
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1806
1847
  type: import_v43.default.literal(FieldType.ID)
1807
1848
  }).meta({
1808
1849
  description: "A field for entering an ID",
@@ -1810,14 +1851,14 @@ var IdField = BaseField.extend({
1810
1851
  });
1811
1852
  var Checkbox = BaseField.extend({
1812
1853
  type: import_v43.default.literal(FieldType.CHECKBOX),
1813
- defaultValue: CheckboxFieldValue.default(false)
1854
+ defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
1814
1855
  }).meta({
1815
1856
  description: "A boolean checkbox field",
1816
1857
  id: "Checkbox"
1817
1858
  });
1818
1859
  var Country = BaseField.extend({
1819
1860
  type: import_v43.default.literal(FieldType.COUNTRY),
1820
- defaultValue: NonEmptyTextValue.optional(),
1861
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1821
1862
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
1822
1863
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
1823
1864
  )
@@ -1835,7 +1876,7 @@ var AdministrativeAreas = import_v43.default.enum([
1835
1876
  ]);
1836
1877
  var AdministrativeAreaField = BaseField.extend({
1837
1878
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
1838
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1879
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1839
1880
  configuration: import_v43.default.object({
1840
1881
  partOf: FieldReference.optional().describe("Parent location"),
1841
1882
  type: AdministrativeAreas,
@@ -1847,7 +1888,7 @@ var AdministrativeAreaField = BaseField.extend({
1847
1888
  });
1848
1889
  var LocationInput = BaseField.extend({
1849
1890
  type: import_v43.default.literal(FieldType.LOCATION),
1850
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1891
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1851
1892
  configuration: import_v43.default.object({
1852
1893
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
1853
1894
  allowedLocations: AllowedLocations
@@ -1859,7 +1900,7 @@ var LocationInput = BaseField.extend({
1859
1900
  var FileUploadWithOptions = BaseField.extend({
1860
1901
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
1861
1902
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1862
- defaultValue: FileFieldWithOptionValue.optional(),
1903
+ defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
1863
1904
  configuration: import_v43.default.object({
1864
1905
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1865
1906
  maxImageSize: import_v43.default.object({
@@ -1875,12 +1916,12 @@ var FileUploadWithOptions = BaseField.extend({
1875
1916
  });
1876
1917
  var Facility = BaseField.extend({
1877
1918
  type: import_v43.default.literal(FieldType.FACILITY),
1878
- defaultValue: NonEmptyTextValue.optional(),
1919
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1879
1920
  configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
1880
1921
  }).describe("Input field for a facility");
1881
1922
  var Office = BaseField.extend({
1882
1923
  type: import_v43.default.literal(FieldType.OFFICE),
1883
- defaultValue: NonEmptyTextValue.optional(),
1924
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1884
1925
  configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
1885
1926
  }).describe("Input field for an office");
1886
1927
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
@@ -1916,7 +1957,7 @@ var Address = BaseField.extend({
1916
1957
  ).optional(),
1917
1958
  allowedLocations: AllowedLocations
1918
1959
  }).optional(),
1919
- defaultValue: DefaultAddressFieldValue.optional()
1960
+ defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
1920
1961
  }).meta({
1921
1962
  description: "Address input field \u2013 a combination of location and text fields",
1922
1963
  id: "Address"
@@ -1963,7 +2004,7 @@ var ButtonConfiguration = import_v43.default.object({
1963
2004
  });
1964
2005
  var ButtonField = BaseField.extend({
1965
2006
  type: import_v43.default.literal(FieldType.BUTTON),
1966
- defaultValue: ButtonFieldValue.optional(),
2007
+ defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
1967
2008
  configuration: ButtonConfiguration
1968
2009
  }).meta({
1969
2010
  description: "A generic button that can be used to trigger an action",
@@ -1991,7 +2032,7 @@ var AlphaPrintButton = BaseField.extend({
1991
2032
  });
1992
2033
  var HttpField = BaseField.extend({
1993
2034
  type: import_v43.default.literal(FieldType.HTTP),
1994
- defaultValue: HttpFieldValue.optional(),
2035
+ defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
1995
2036
  configuration: import_v43.default.object({
1996
2037
  trigger: FieldReference.optional().describe(
1997
2038
  "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 +2118,7 @@ var LinkButtonField = BaseField.extend({
2077
2118
  });
2078
2119
  var VerificationStatus = BaseField.extend({
2079
2120
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
2080
- defaultValue: VerificationStatusValue.optional(),
2121
+ defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
2081
2122
  configuration: import_v43.default.object({
2082
2123
  status: TranslationConfig.describe("Text to display on the status pill."),
2083
2124
  description: TranslationConfig.describe(
@@ -2099,7 +2140,7 @@ var QueryParamReaderField = BaseField.extend({
2099
2140
  });
2100
2141
  var QrReaderField = BaseField.extend({
2101
2142
  type: import_v43.default.literal(FieldType.QR_READER),
2102
- defaultValue: QrReaderFieldValue.optional(),
2143
+ defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
2103
2144
  configuration: import_v43.default.object({
2104
2145
  validator: import_v43.default.any().meta({
2105
2146
  description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
@@ -2112,7 +2153,7 @@ var QrReaderField = BaseField.extend({
2112
2153
  });
2113
2154
  var IdReaderField = BaseField.extend({
2114
2155
  type: import_v43.default.literal(FieldType.ID_READER),
2115
- defaultValue: IdReaderFieldValue.optional(),
2156
+ defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
2116
2157
  methods: import_v43.default.array(
2117
2158
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2118
2159
  )
@@ -2273,6 +2314,7 @@ var ClientConfig = z20.object({
2273
2314
  COUNTRY: z20.string(),
2274
2315
  LANGUAGES: z20.array(z20.string()),
2275
2316
  SENTRY: z20.string().optional(),
2317
+ LOGIN_URL: z20.string().optional(),
2276
2318
  REGISTER_BACKGROUND: BackgroundConfig,
2277
2319
  DASHBOARDS: z20.array(
2278
2320
  z20.object({