@opencrvs/toolkit 2.1.0-rc.12673aa → 2.1.0-rc.14fb6a5

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 (188) hide show
  1. package/build.sh +14 -4
  2. package/create-countryconfig/index.js +59 -30
  3. package/dist/application-config/index.js +26 -13
  4. package/dist/authentication/index.d.ts +8 -9
  5. package/dist/authentication/index.js +23 -8
  6. package/dist/cli.js +2268 -1385
  7. package/dist/commons/api/router.d.ts +252 -290
  8. package/dist/commons/application-config/index.d.ts +0 -2
  9. package/dist/commons/conditionals/conditionals.d.ts +6 -6
  10. package/dist/commons/conditionals/validate.d.ts +18 -3
  11. package/dist/commons/events/ActionConfig.d.ts +5 -14
  12. package/dist/commons/events/ActionDocument.d.ts +30 -4
  13. package/dist/commons/events/AdvancedSearchConfig.d.ts +24 -12
  14. package/dist/commons/events/AuditLog.d.ts +1 -0
  15. package/dist/commons/events/Draft.d.ts +1 -21
  16. package/dist/commons/events/EventDocument.d.ts +4 -4
  17. package/dist/commons/events/FieldConfig.d.ts +20 -10
  18. package/dist/commons/events/FieldTypeMapping.d.ts +10 -10
  19. package/dist/commons/events/FieldValue.d.ts +1 -0
  20. package/dist/commons/events/FormConfig.d.ts +6 -0
  21. package/dist/commons/events/PageConfig.d.ts +4 -0
  22. package/dist/commons/events/scopes.d.ts +21 -1
  23. package/dist/commons/events/test.utils.d.ts +53 -21
  24. package/dist/commons/events/utils.d.ts +26 -2
  25. package/dist/conditionals/index.js +21 -7
  26. package/dist/environment/index.d.ts.map +1 -1
  27. package/dist/environment/index.js +2 -1
  28. package/dist/environment/setup-environment.d.ts +1 -1
  29. package/dist/environment/setup-environment.d.ts.map +1 -1
  30. package/dist/environment/setup-environment.js +586 -569
  31. package/dist/environment/swarm-to-k8s.js +3 -4
  32. package/dist/events/index.js +282 -138
  33. package/dist/migrations/v2.1/add-recovery-link-notifications.js +4 -4
  34. package/dist/migrations/v2.1/add-translations.d.ts.map +1 -1
  35. package/dist/migrations/v2.1/add-translations.js +4 -68
  36. package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -1
  37. package/dist/migrations/v2.1/enable-telemetry.js +30 -13
  38. package/dist/migrations/v2.1/index.d.ts.map +1 -1
  39. package/dist/migrations/v2.1/index.js +927 -33
  40. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +14 -0
  41. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +1 -0
  42. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.js +348 -0
  43. package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +2 -0
  44. package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +1 -0
  45. package/dist/migrations/v2.1/remove-metabase-package-installs.js +161 -0
  46. package/dist/migrations/{v2.0/migrate-scopes.d.ts → v2.1/remove-sentry.d.ts} +1 -1
  47. package/dist/migrations/v2.1/remove-sentry.d.ts.map +1 -0
  48. package/dist/migrations/v2.1/remove-sentry.js +354 -0
  49. package/dist/migrations/{v2.0/rename-api-paths.d.ts → v2.1/rename-trigger-paths.d.ts} +1 -1
  50. package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +1 -0
  51. package/dist/migrations/{v2.0/rename-api-paths.js → v2.1/rename-trigger-paths.js} +69 -40
  52. package/dist/migrations/v2.1/template-files.d.ts +8 -0
  53. package/dist/migrations/v2.1/template-files.d.ts.map +1 -0
  54. package/dist/migrations/v2.1/template-files.js +49 -0
  55. package/dist/migrations/v2.1/upgrade-tilt.d.ts +8 -0
  56. package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +1 -0
  57. package/dist/migrations/v2.1/upgrade-tilt.js +139 -0
  58. package/dist/notification/index.js +105 -61
  59. package/dist/scopes/index.d.ts +288 -5
  60. package/dist/scopes/index.js +22 -7
  61. package/dist/telemetry/index.js +4 -0
  62. package/dist/templates/charts-values/dependencies/values.yaml +6 -0
  63. package/dist/templates/charts-values/opencrvs-services/values.yaml +6 -0
  64. package/dist/templates/charts-values/opentelemetry/values.yaml +7 -0
  65. package/dist/templates/countryconfig-template/.tiltignore +1 -0
  66. package/dist/templates/countryconfig-template/Dockerfile.assets +7 -0
  67. package/dist/templates/countryconfig-template/Tiltfile +112 -0
  68. package/dist/templates/countryconfig-template/assets/README.md +1 -0
  69. package/dist/templates/countryconfig-template/assets/clear-all-data-dev.sh +61 -0
  70. package/dist/templates/countryconfig-template/assets/deployment/deploy.sh +455 -0
  71. package/dist/templates/countryconfig-template/assets/deployment/reindex.sh +168 -0
  72. package/dist/templates/countryconfig-template/assets/deployment/validate-required-variables-in-compose-files.ts +67 -0
  73. package/dist/templates/countryconfig-template/assets/elasticsearch/reindex.sh +168 -0
  74. package/dist/templates/countryconfig-template/assets/metabase/README.md +34 -0
  75. package/dist/templates/countryconfig-template/assets/metabase/environment-configuration.sql +36 -0
  76. package/dist/templates/countryconfig-template/assets/metabase/initialize-database.sh +46 -0
  77. package/dist/templates/countryconfig-template/assets/metabase/metabase.init.db.sql +27737 -0
  78. package/dist/templates/countryconfig-template/assets/metabase/open-shell.sh +21 -0
  79. package/dist/templates/countryconfig-template/assets/metabase/package.json +13 -0
  80. package/dist/templates/countryconfig-template/assets/metabase/run-dev.sh +108 -0
  81. package/dist/templates/countryconfig-template/assets/metabase/run.sh +120 -0
  82. package/dist/templates/countryconfig-template/assets/metabase/update-database.sh +40 -0
  83. package/dist/templates/countryconfig-template/assets/postgres/setup-analytics.sh +135 -0
  84. package/dist/templates/countryconfig-template/assets/postgres/setup-reference-data.sh +108 -0
  85. package/dist/templates/countryconfig-template/tilt/clear-all-data.ps1 +50 -0
  86. package/dist/templates/countryconfig-template/tilt/clear-all-data.sh +35 -0
  87. package/dist/templates/countryconfig-template/tilt/common.tilt +145 -0
  88. package/dist/templates/countryconfig-template/tilt/examples/dependencies/values.yaml +15 -0
  89. package/dist/templates/countryconfig-template/tilt/examples/opencrvs-services/values.yaml +56 -0
  90. package/dist/templates/countryconfig-template/tilt/examples/traefik/values-minikube.yaml +21 -0
  91. package/dist/templates/countryconfig-template/tilt/examples/traefik/values.yaml +38 -0
  92. package/dist/templates/countryconfig-template/tilt/helm/dependencies/values.yaml +17 -0
  93. package/dist/templates/countryconfig-template/tilt/helm/opencrvs-services/values.yaml +16 -0
  94. package/dist/templates/countryconfig-template/tilt/lib.tilt +95 -0
  95. package/dist/templates/countryconfig-template/tilt/opencrvs.tilt +136 -0
  96. package/dist/translations/template.d.ts +11 -0
  97. package/dist/translations/template.d.ts.map +1 -0
  98. package/dist/translations/template.js +100 -0
  99. package/dist/verify/endpoints.d.ts.map +1 -1
  100. package/dist/verify/endpoints.js +179 -14
  101. package/opencrvs-toolkit-2.1.0-rc.14fb6a5.tgz +0 -0
  102. package/package.json +2 -1
  103. package/tsconfig.build.tsbuildinfo +1 -1
  104. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
  105. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
  106. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -429
  107. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +0 -3
  108. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +0 -1
  109. package/dist/migrations/v2.0/add-resend-invite-notification.js +0 -373
  110. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +0 -22
  111. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +0 -1
  112. package/dist/migrations/v2.0/checkout-upstream-files.js +0 -146
  113. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
  114. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
  115. package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -838
  116. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
  117. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
  118. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -158
  119. package/dist/migrations/v2.0/create-events-index.d.ts +0 -3
  120. package/dist/migrations/v2.0/create-events-index.d.ts.map +0 -1
  121. package/dist/migrations/v2.0/create-events-index.js +0 -325
  122. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +0 -11
  123. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +0 -1
  124. package/dist/migrations/v2.0/delete-infrastructure-directory.js +0 -123
  125. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +0 -3
  126. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +0 -1
  127. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +0 -110
  128. package/dist/migrations/v2.0/index.d.ts +0 -13
  129. package/dist/migrations/v2.0/index.d.ts.map +0 -1
  130. package/dist/migrations/v2.0/index.js +0 -103
  131. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
  132. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
  133. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -432
  134. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +0 -13
  135. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +0 -1
  136. package/dist/migrations/v2.0/merge-infrastructure-directory.js +0 -222
  137. package/dist/migrations/v2.0/migrate-application-config-url.d.ts +0 -3
  138. package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +0 -1
  139. package/dist/migrations/v2.0/migrate-application-config-url.js +0 -343
  140. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
  141. package/dist/migrations/v2.0/migrate-scopes.js +0 -305
  142. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
  143. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
  144. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -267
  145. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +0 -3
  146. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +0 -1
  147. package/dist/migrations/v2.0/migrate-workqueue-configs.js +0 -317
  148. package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
  149. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
  150. package/dist/migrations/v2.0/remove-delete-actions.js +0 -156
  151. package/dist/migrations/v2.0/remove-demo-scope.d.ts +0 -3
  152. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +0 -1
  153. package/dist/migrations/v2.0/remove-demo-scope.js +0 -74
  154. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
  155. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
  156. package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -96
  157. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +0 -3
  158. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +0 -1
  159. package/dist/migrations/v2.0/remove-fhir-url-helpers.js +0 -163
  160. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +0 -3
  161. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +0 -1
  162. package/dist/migrations/v2.0/remove-hearth-migrations.js +0 -87
  163. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +0 -3
  164. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +0 -1
  165. package/dist/migrations/v2.0/remove-old-statistics-service.js +0 -356
  166. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
  167. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
  168. package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -109
  169. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
  170. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
  171. package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -163
  172. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +0 -3
  173. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +0 -1
  174. package/dist/migrations/v2.0/remove-unused-environment-variables.js +0 -186
  175. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
  176. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
  177. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
  178. package/dist/migrations/v2.0/rename-location-parent-id.js +0 -180
  179. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +0 -3
  180. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +0 -1
  181. package/dist/migrations/v2.0/simplify-analytics-precalculations.js +0 -195
  182. package/dist/migrations/v2.0/update-package-json.d.ts +0 -3
  183. package/dist/migrations/v2.0/update-package-json.d.ts.map +0 -1
  184. package/dist/migrations/v2.0/update-package-json.js +0 -105
  185. package/dist/translations/check.d.ts +0 -21
  186. package/dist/translations/check.d.ts.map +0 -1
  187. package/dist/translations/check.js +0 -132
  188. package/opencrvs-toolkit-2.1.0-rc.12673aa.tgz +0 -0
@@ -29,11 +29,12 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
29
29
  }> | z.ZodNumber | z.ZodObject<Readonly<{
30
30
  [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
31
31
  }>, z.core.$strip> | z.ZodObject<{
32
+ age: z.ZodNumber;
33
+ asOfDateRef: z.ZodString;
34
+ }, z.core.$strip> | z.ZodObject<{
32
35
  path: z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">;
33
36
  originalFilename: z.ZodString;
34
37
  type: z.ZodString;
35
- }, z.core.$strip> | z.ZodObject<{
36
- data: z.ZodRecord<z.ZodString, z.ZodString>;
37
38
  }, z.core.$strip> | z.ZodObject<{
38
39
  data: z.ZodAny;
39
40
  }, z.core.$strip> | z.ZodObject<{
@@ -42,12 +43,11 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
42
43
  }, z.core.$strip> | z.ZodObject<{
43
44
  numericValue: z.ZodOptional<z.ZodNumber>;
44
45
  unit: z.ZodOptional<z.ZodString>;
45
- }, z.core.$strip> | z.ZodObject<{
46
- age: z.ZodNumber;
47
- asOfDateRef: z.ZodString;
48
46
  }, z.core.$strip> | z.ZodObject<{
49
47
  label: z.ZodString;
50
48
  value: z.ZodString;
49
+ }, z.core.$strip> | z.ZodObject<{
50
+ data: z.ZodRecord<z.ZodString, z.ZodString>;
51
51
  }, z.core.$strip> | z.ZodObject<{
52
52
  firstname: z.ZodString;
53
53
  surname: z.ZodString;
@@ -65,11 +65,12 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
65
65
  }>>> | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodOptional<z.ZodNullable<z.ZodObject<Readonly<{
66
66
  [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
67
67
  }>, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
68
+ age: z.ZodNumber;
69
+ asOfDateRef: z.ZodString;
70
+ }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
68
71
  path: z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">;
69
72
  originalFilename: z.ZodString;
70
73
  type: z.ZodString;
71
- }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
72
- data: z.ZodRecord<z.ZodString, z.ZodString>;
73
74
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
74
75
  data: z.ZodAny;
75
76
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -78,9 +79,6 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
78
79
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
79
80
  numericValue: z.ZodOptional<z.ZodNumber>;
80
81
  unit: z.ZodOptional<z.ZodString>;
81
- }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
82
- age: z.ZodNumber;
83
- asOfDateRef: z.ZodString;
84
82
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
85
83
  label: z.ZodString;
86
84
  value: z.ZodString;
@@ -154,6 +152,8 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
154
152
  label: z.ZodString;
155
153
  value: z.ZodString;
156
154
  }, z.core.$strip>>>]>>;
155
+ }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
156
+ data: z.ZodRecord<z.ZodString, z.ZodString>;
157
157
  }, z.core.$strip>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
158
158
  firstname: z.ZodString;
159
159
  surname: z.ZodString;
@@ -19,6 +19,7 @@ export declare const HiddenFieldValue: z.ZodString;
19
19
  export declare const NonEmptyTextValue: z.ZodString;
20
20
  export declare const DateValue: z.ZodISODate;
21
21
  export type DateValue = z.infer<typeof DateValue>;
22
+ export declare const AGE_MAX_VALUE = 999;
22
23
  export declare const AgeValue: z.ZodObject<{
23
24
  age: z.ZodNumber;
24
25
  asOfDateRef: z.ZodString;
@@ -5,6 +5,7 @@ export declare const DeclarationFormConfig: z.ZodObject<{
5
5
  id: z.ZodString;
6
6
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
7
7
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
8
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
8
9
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
9
10
  conditional: z.ZodOptional<z.ZodAny>;
10
11
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -18,6 +19,7 @@ export declare const ActionFormConfig: z.ZodObject<{
18
19
  id: z.ZodString;
19
20
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
20
21
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
22
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
21
23
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
22
24
  conditional: z.ZodOptional<z.ZodAny>;
23
25
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -25,6 +27,7 @@ export declare const ActionFormConfig: z.ZodObject<{
25
27
  id: z.ZodString;
26
28
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
27
29
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
30
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
28
31
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
29
32
  conditional: z.ZodOptional<z.ZodAny>;
30
33
  type: z.ZodLiteral<"VERIFICATION">;
@@ -50,6 +53,7 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
50
53
  id: z.ZodString;
51
54
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
52
55
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
56
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
53
57
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
54
58
  conditional: z.ZodOptional<z.ZodAny>;
55
59
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -60,6 +64,7 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
60
64
  id: z.ZodString;
61
65
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
62
66
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
67
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
63
68
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
64
69
  conditional: z.ZodOptional<z.ZodAny>;
65
70
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -67,6 +72,7 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
67
72
  id: z.ZodString;
68
73
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
69
74
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
75
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
70
76
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
71
77
  conditional: z.ZodOptional<z.ZodAny>;
72
78
  type: z.ZodLiteral<"VERIFICATION">;
@@ -9,6 +9,7 @@ export declare const FormPageConfig: z.ZodObject<{
9
9
  id: z.ZodString;
10
10
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
11
11
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
12
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
12
13
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
13
14
  conditional: z.ZodOptional<z.ZodAny>;
14
15
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -31,6 +32,7 @@ export declare const VerificationPageConfig: z.ZodObject<{
31
32
  id: z.ZodString;
32
33
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
33
34
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
35
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
34
36
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
35
37
  conditional: z.ZodOptional<z.ZodAny>;
36
38
  type: z.ZodLiteral<"VERIFICATION">;
@@ -52,6 +54,7 @@ export declare const PageConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
52
54
  id: z.ZodString;
53
55
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
54
56
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
57
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
55
58
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
56
59
  conditional: z.ZodOptional<z.ZodAny>;
57
60
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -59,6 +62,7 @@ export declare const PageConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
59
62
  id: z.ZodString;
60
63
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
61
64
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
65
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
62
66
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
63
67
  conditional: z.ZodOptional<z.ZodAny>;
64
68
  type: z.ZodLiteral<"VERIFICATION">;
@@ -1,5 +1,5 @@
1
1
  import { DisplayableAction } from './ActionType';
2
- import { EncodedScope, UserScopeV2 } from '../scopes';
2
+ import { EncodedScope, RecordScopeTypeV2, ScopeType, UserScopeV2 } from '../scopes';
3
3
  import { EventIndexWithAdministrativeHierarchy } from './locations';
4
4
  import { UserContext } from '../users/User';
5
5
  import { EventIndex } from './EventIndex';
@@ -27,6 +27,26 @@ export declare const ACTION_SCOPE_MAP: {
27
27
  DUPLICATE_DETECTED: never[];
28
28
  CUSTOM: never[];
29
29
  };
30
+ /**
31
+ * The scopes of every action that can write to a record. Each of them can
32
+ * trigger a sweep of the record's prefix, so each of them has to be able to
33
+ * delete. `record.read` is absent: reading a record is not grounds for erasing
34
+ * it.
35
+ */
36
+ export declare const RECORD_WRITE_SCOPES: RecordScopeTypeV2[];
37
+ /**
38
+ * Scopes that authorize deleting objects held by the documents service.
39
+ *
40
+ * Documents records no link between an object and the record it belongs to, so
41
+ * it cannot check that the caller owns a prefix. It checks instead that the
42
+ * caller holds a scope that lets them change a record or edit a user, and the
43
+ * service that forwarded the request has already checked that this particular
44
+ * record or user is theirs to act on.
45
+ *
46
+ * Listed rather than derived, so that adding an action to `ACTION_SCOPE_MAP`
47
+ * cannot silently grant deletion. `scopes.test.ts` fails when the two drift.
48
+ */
49
+ export declare const DOCUMENT_DELETE_SCOPES: ScopeType[];
30
50
  export declare function hasAnyOfScopes(a: string[], b: string[]): boolean;
31
51
  export declare const AssignmentStatus: {
32
52
  readonly ASSIGNED_TO_SELF: 'ASSIGNED_TO_SELF';
@@ -4,7 +4,7 @@ import { ValidatorContext } from '../conditionals/validate';
4
4
  import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, EditActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnarchiveActionInput, UnassignActionInput } from './ActionInput';
5
5
  import { ActionType } from './ActionType';
6
6
  import { Draft } from './Draft';
7
- import { EventConfig } from './EventConfig';
7
+ import { EventConfig, EventConfigInput } from './EventConfig';
8
8
  import { EventDocument } from './EventDocument';
9
9
  import { EventIndex } from './EventIndex';
10
10
  import { EventInput } from './EventInput';
@@ -85,8 +85,11 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
85
85
  omitFields?: string[];
86
86
  }, input?: Partial<Draft>) => Draft;
87
87
  actions: {
88
- declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
88
+ declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
89
89
  keepAssignment?: boolean | undefined;
90
+ keepAssignmentIfAccepted?: boolean | undefined;
91
+ keepAssignmentIfRejected?: boolean | undefined;
92
+ waitFor?: boolean | undefined;
90
93
  type: "DECLARE";
91
94
  transactionId: string;
92
95
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
@@ -96,53 +99,70 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
96
99
  /**
97
100
  * Notify allows sending incomplete data. Think it as 'partial declare' for now.
98
101
  */
99
- notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
102
+ notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, 'transactionId' | 'declaration' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
100
103
  type: "NOTIFY";
101
104
  transactionId: string;
102
105
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
103
106
  eventId: string;
104
107
  keepAssignment: boolean | undefined;
108
+ keepAssignmentIfAccepted: boolean | undefined;
109
+ keepAssignmentIfRejected: boolean | undefined;
110
+ waitFor: boolean | undefined;
105
111
  };
106
- edit: (eventId: string, input?: Partial<Pick<EditActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
112
+ edit: (eventId: string, input?: Partial<Pick<EditActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
107
113
  keepAssignment?: boolean | undefined;
114
+ keepAssignmentIfAccepted?: boolean | undefined;
115
+ keepAssignmentIfRejected?: boolean | undefined;
116
+ waitFor?: boolean | undefined;
108
117
  type: "EDIT";
109
118
  transactionId: string;
110
119
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
111
120
  annotation: {};
112
121
  eventId: string;
113
122
  };
114
- assign: (eventId: string, input?: Partial<Pick<AssignActionInput, 'transactionId' | 'assignedTo'>>) => {
123
+ assign: (eventId: string, input?: Partial<Pick<AssignActionInput, 'transactionId' | 'assignedTo' | 'waitFor'>>) => {
115
124
  type: "ASSIGN";
116
125
  transactionId: string;
117
126
  declaration: {};
118
127
  assignedTo: string;
119
128
  eventId: string;
129
+ waitFor: boolean | undefined;
120
130
  };
121
- unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, 'transactionId'>>) => {
131
+ unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, 'transactionId' | 'waitFor'>>) => {
122
132
  type: "UNASSIGN";
123
133
  transactionId: string;
124
134
  declaration: {};
125
135
  assignedTo: null;
126
136
  eventId: string;
137
+ waitFor: boolean | undefined;
127
138
  };
128
- archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
139
+ archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
129
140
  keepAssignment?: boolean | undefined;
141
+ keepAssignmentIfAccepted?: boolean | undefined;
142
+ keepAssignmentIfRejected?: boolean | undefined;
143
+ waitFor?: boolean | undefined;
130
144
  type: "ARCHIVE";
131
145
  transactionId: string;
132
146
  declaration: {};
133
147
  annotation: {};
134
148
  eventId: string;
135
149
  };
136
- unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment'>>) => {
150
+ unarchive: (eventId: string, input?: Partial<Pick<UnarchiveActionInput, 'transactionId' | 'declaration' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
137
151
  keepAssignment?: boolean | undefined;
152
+ keepAssignmentIfAccepted?: boolean | undefined;
153
+ keepAssignmentIfRejected?: boolean | undefined;
154
+ waitFor?: boolean | undefined;
138
155
  type: "UNARCHIVE";
139
156
  transactionId: string;
140
157
  declaration: {};
141
158
  annotation: {};
142
159
  eventId: string;
143
160
  };
144
- reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
161
+ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
145
162
  keepAssignment?: boolean | undefined;
163
+ keepAssignmentIfAccepted?: boolean | undefined;
164
+ keepAssignmentIfRejected?: boolean | undefined;
165
+ waitFor?: boolean | undefined;
146
166
  type: "REJECT";
147
167
  transactionId: string;
148
168
  declaration: {};
@@ -152,8 +172,11 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
152
172
  reason: string;
153
173
  };
154
174
  };
155
- register: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'registrationNumber'>>) => {
175
+ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'registrationNumber' | 'keepAssignmentIfAccepted' | 'keepAssignmentIfRejected' | 'waitFor'>>) => {
156
176
  keepAssignment?: boolean | undefined;
177
+ keepAssignmentIfAccepted?: boolean | undefined;
178
+ keepAssignmentIfRejected?: boolean | undefined;
179
+ waitFor?: boolean | undefined;
157
180
  registrationNumber?: string | undefined;
158
181
  type: "REGISTER";
159
182
  transactionId: string;
@@ -161,8 +184,11 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
161
184
  annotation: {};
162
185
  eventId: string;
163
186
  };
164
- printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
187
+ printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
165
188
  keepAssignment?: boolean | undefined;
189
+ keepAssignmentIfAccepted?: boolean | undefined;
190
+ keepAssignmentIfRejected?: boolean | undefined;
191
+ waitFor?: boolean | undefined;
166
192
  type: "PRINT_CERTIFICATE";
167
193
  transactionId: string;
168
194
  declaration: {};
@@ -170,15 +196,18 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
170
196
  eventId: string;
171
197
  };
172
198
  correction: {
173
- request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment'>>) => {
199
+ request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, 'transactionId' | 'declaration' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
174
200
  type: "REQUEST_CORRECTION";
175
201
  transactionId: string;
176
202
  declaration: import("lodash").Omit<Record<string, import("./FieldValue").FieldUpdateValue>, "applicant.email" | "applicant.image">;
177
203
  annotation: {};
178
204
  eventId: string;
179
205
  keepAssignment: boolean | undefined;
206
+ keepAssignmentIfAccepted: boolean | undefined;
207
+ keepAssignmentIfRejected: boolean | undefined;
208
+ waitFor: boolean | undefined;
180
209
  };
181
- approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment'>>) => {
210
+ approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
182
211
  type: "APPROVE_CORRECTION";
183
212
  transactionId: string;
184
213
  declaration: {};
@@ -186,18 +215,24 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
186
215
  eventId: string;
187
216
  requestId: string;
188
217
  keepAssignment: boolean | undefined;
218
+ keepAssignmentIfAccepted: boolean | undefined;
219
+ keepAssignmentIfRejected: boolean | undefined;
220
+ waitFor: boolean | undefined;
189
221
  };
190
- reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, 'transactionId' | 'annotation' | 'keepAssignment' | 'content'>>) => {
222
+ reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, 'transactionId' | 'annotation' | 'content' | 'keepAssignment' | 'keepAssignmentIfRejected' | 'keepAssignmentIfAccepted' | 'waitFor'>>) => {
191
223
  type: "REJECT_CORRECTION";
192
224
  transactionId: string;
193
225
  declaration: {};
194
226
  annotation: {};
195
227
  eventId: string;
196
228
  requestId: string;
197
- keepAssignment: boolean | undefined;
198
229
  content: {
199
230
  reason: string;
200
231
  };
232
+ keepAssignment: boolean | undefined;
233
+ keepAssignmentIfAccepted: boolean | undefined;
234
+ keepAssignmentIfRejected: boolean | undefined;
235
+ waitFor: boolean | undefined;
201
236
  };
202
237
  };
203
238
  duplicate: {
@@ -276,11 +311,6 @@ export declare function createPrng(seed: number): () => number;
276
311
  */
277
312
  export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
278
313
  export declare const generateTranslationConfig: (message: string) => TranslationConfig;
279
- export declare const BearerTokenByUserType: {
280
- fieldAgent: string;
281
- registrationAgent: string;
282
- localRegistrar: string;
283
- };
284
314
  export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
285
315
  /**
286
316
  * Backend focused event config generator for testing fields in a lightweight way.
@@ -290,11 +320,13 @@ export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
290
320
  * @param placeOfEventId - Optional place of event field id.
291
321
  * @param dateOfEventId - Optional date of event field id.
292
322
  */
293
- export declare const generateEventConfig: ({ id, fields, placeOfEventId, dateOfEventId }: {
323
+ export declare const generateEventConfig: ({ id, fields, placeOfEventId, dateOfEventId, actions }: {
294
324
  id: string;
295
325
  fields: FieldConfig[];
296
326
  placeOfEventId?: string;
297
327
  dateOfEventId?: string;
328
+ /** Extra actions appended to the default READ + DECLARE pair, e.g. a REQUEST_CORRECTION action with its own correctionForm. */
329
+ actions?: EventConfigInput['actions'];
298
330
  }) => EventConfig;
299
331
  /**
300
332
  * Get the leaf administrative area IDs from a list of administrative areas.
@@ -21,6 +21,7 @@ export declare function getDeclarationPages(configuration: EventConfig): {
21
21
  description: string;
22
22
  };
23
23
  requireCompletionToContinue: boolean;
24
+ showClearButton?: boolean | undefined;
24
25
  fields: FieldConfig[];
25
26
  conditional?: any;
26
27
  type: "FORM";
@@ -39,6 +40,7 @@ export declare function getDeclaration(configuration: EventConfig): {
39
40
  description: string;
40
41
  };
41
42
  requireCompletionToContinue: boolean;
43
+ showClearButton?: boolean | undefined;
42
44
  fields: FieldConfig[];
43
45
  conditional?: any;
44
46
  type: "FORM";
@@ -67,6 +69,7 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
67
69
  description: string;
68
70
  };
69
71
  requireCompletionToContinue: boolean;
72
+ showClearButton?: boolean | undefined;
70
73
  fields: FieldConfig[];
71
74
  conditional?: any;
72
75
  type: "FORM";
@@ -78,6 +81,7 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
78
81
  description: string;
79
82
  };
80
83
  requireCompletionToContinue: boolean;
84
+ showClearButton?: boolean | undefined;
81
85
  fields: FieldConfig[];
82
86
  conditional?: any;
83
87
  type: "VERIFICATION";
@@ -359,7 +363,7 @@ export declare function findLastAssignmentAction(actions: Action[]): {
359
363
  status: "Accepted" | "Rejected" | "Requested";
360
364
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
361
365
  type: "APPROVE_CORRECTION";
362
- requestId: string;
366
+ requestId: string & import("zod").$brand<"UUID">;
363
367
  content?: {
364
368
  immediateCorrection?: boolean | undefined;
365
369
  } | undefined;
@@ -377,7 +381,7 @@ export declare function findLastAssignmentAction(actions: Action[]): {
377
381
  status: "Accepted" | "Rejected" | "Requested";
378
382
  originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
379
383
  type: "REJECT_CORRECTION";
380
- requestId: string;
384
+ requestId: string & import("zod").$brand<"UUID">;
381
385
  content: {
382
386
  reason: string;
383
387
  };
@@ -597,6 +601,26 @@ export declare function getCompleteActionContent(event: EventDocument, action: A
597
601
  export declare function getCompleteActionDeclaration<T extends EventState | ActionUpdate>(declaration: T, event: EventDocument, action: ActionDocument): T;
598
602
  export declare function getAcceptedActions(event: EventDocument): ActionDocument[];
599
603
  export declare function aggregateActionDeclarations(event: EventDocument): EventState;
604
+ /**
605
+ * Returns the declaration after each of `event.actions`, which must be in chronological order.
606
+ * Index `i` equals `aggregateActionDeclarations` of the first `i + 1` actions, in linear time.
607
+ */
608
+ export declare function getDeclarationAfterEachAction(event: EventDocument): EventState[];
609
+ /**
610
+ * Returns the event's declaration state as it will be once the single pending
611
+ * action is accepted — i.e. the aggregate of all accepted declarations with the
612
+ * pending action's changes applied on top.
613
+ *
614
+ * Country configuration confirmation handlers (and notifications) need the
615
+ * up-to-date declaration at confirmation time, before core has accepted the
616
+ * action. Reaching for `aggregateActionDeclarations` alone is not enough for
617
+ * corrections: when confirming an APPROVE_CORRECTION the changed fields live on
618
+ * the linked REQUEST_CORRECTION, not on the pending action's own (empty)
619
+ * declaration. This helper applies the same correction-aware merge that
620
+ * `aggregateActionDeclarations` uses for already-accepted approvals, so callers
621
+ * do not have to reimplement the `requestId`/`originalActionId` resolution.
622
+ */
623
+ export declare function getDeclarationWithPendingAction(event: EventDocument): EventState;
600
624
  export declare function aggregateActionAnnotations(event: EventDocument): EventState;
601
625
  /**
602
626
  * 2.1. onwards secured fields have accepted conditionals.
@@ -414,7 +414,9 @@ var RecordScopeTypeV2 = z11.enum([
414
414
  "record.request-correction",
415
415
  "record.correct",
416
416
  "record.unassign-others",
417
- "record.custom-action"
417
+ "record.custom-action",
418
+ "record.action.accept",
419
+ "record.action.reject"
418
420
  ]);
419
421
  var PlainScopeType = z11.enum([
420
422
  // Misc. system scopes
@@ -436,10 +438,7 @@ var PlainScopeType = z11.enum([
436
438
  // Performance dashboard
437
439
  "performance.read",
438
440
  "performance.read-dashboards",
439
- "performance.vital-statistics-export",
440
- // Scopes used exclusively by countryconfig integration token
441
- "record.confirm-registration",
442
- "record.reject-registration"
441
+ "performance.vital-statistics-export"
443
442
  ]);
444
443
  var scopeByEvent = z11.preprocess(
445
444
  (val) => val === void 0 ? void 0 : [val].flat(),
@@ -457,7 +456,9 @@ var userRole = z11.preprocess(
457
456
  ).describe("User role, e.g. admin, field agent");
458
457
  var scopeOptionsPlaceEvent = z11.object({
459
458
  event: scopeByEvent,
460
- placeOfEvent: JurisdictionFilter.optional()
459
+ placeOfEvent: JurisdictionFilter.optional(),
460
+ createdBy: UserFilter.optional(),
461
+ createdIn: JurisdictionFilter.optional()
461
462
  }).describe("Options applicable to all record scopes.");
462
463
  var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
463
464
  notifiedIn: JurisdictionFilter.optional(),
@@ -500,7 +501,9 @@ var AllScopeOptions = z11.object({
500
501
  var ScopeOptionKey = AllScopeOptions.keyof();
501
502
  var ResolvedScopeOptionsPlaceEvent = z11.object({
502
503
  event: scopeByEvent,
503
- placeOfEvent: UUID.nullish()
504
+ placeOfEvent: UUID.nullish(),
505
+ createdBy: z11.string().optional(),
506
+ createdIn: UUID.nullish()
504
507
  }).describe(
505
508
  "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
506
509
  );
@@ -547,6 +550,13 @@ var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
547
550
  "Template IDs for certified copies. Controls which certificate templates are returned to the client via the config service. Certificate printing is a client-side operation \u2014 this option is not validated when the printCertificate action is submitted."
548
551
  )
549
552
  });
553
+ var ActionConfirmationScopeType = RecordScopeTypeV2.extract([
554
+ "record.action.accept",
555
+ "record.action.reject"
556
+ ]);
557
+ var ActionConfirmationScopeOptions = AllRecordScopeOptions.describe(
558
+ "Options for confirming (accepting or rejecting) an action."
559
+ );
550
560
  var RecordScopeV2 = z11.discriminatedUnion("type", [
551
561
  z11.object({
552
562
  type: ScopesWithPlaceEventOptions,
@@ -567,6 +577,10 @@ var RecordScopeV2 = z11.discriminatedUnion("type", [
567
577
  z11.object({
568
578
  type: z11.literal("record.print-certified-copies"),
569
579
  options: ScopeOptionsPrintCertifiedCopies.optional()
580
+ }),
581
+ z11.object({
582
+ type: ActionConfirmationScopeType,
583
+ options: ActionConfirmationScopeOptions.optional()
570
584
  })
571
585
  ]).describe(
572
586
  "Scopes used to check user's permission to perform actions on a record."
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"AAyCA,wBAAsB,kBAAkB,kBAIvC;AAED,wBAAsB,qBAAqB,kBAI1C;AAED,wBAAsB,6BAA6B,kBAIlD;AAED,wBAAsB,mBAAmB,kBAIxC;AAED,wBAAsB,wBAAwB,kBAG7C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"AAyCA,wBAAsB,kBAAkB,kBAKvC;AAED,wBAAsB,qBAAqB,kBAI1C;AAED,wBAAsB,6BAA6B,kBAIlD;AAED,wBAAsB,mBAAmB,kBAIxC;AAED,wBAAsB,wBAAwB,kBAG7C"}
@@ -49,7 +49,8 @@ function runEnvironmentInit() {
49
49
  return __awaiter(this, void 0, void 0, function* () {
50
50
  validateRepositoryStructure();
51
51
  (0, paths_1.assertNoOldInventoryLayout)();
52
- yield import('./setup-environment.js');
52
+ const { runSetupEnvironment } = yield import('./setup-environment.js');
53
+ yield runSetupEnvironment();
53
54
  });
54
55
  }
55
56
  function runEnvironmentUpgrade() {
@@ -1,2 +1,2 @@
1
- export {};
1
+ export declare function runSetupEnvironment(): Promise<void>;
2
2
  //# sourceMappingURL=setup-environment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-environment.d.ts","sourceRoot":"","sources":["../../src/environment/setup-environment.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"setup-environment.d.ts","sourceRoot":"","sources":["../../src/environment/setup-environment.ts"],"names":[],"mappings":"AAwSA,wBAAsB,mBAAmB,kBAkmCxC"}