@opencrvs/toolkit 1.9.12-rc.f5ca5e6 → 1.9.12-rc.f687751

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 (128) hide show
  1. package/build.sh +8 -0
  2. package/dist/application-config/index.js +2045 -41
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +4841 -0
  6. package/dist/commons/api/router.d.ts +475 -244
  7. package/dist/commons/application-config/index.d.ts +13 -16
  8. package/dist/commons/conditionals/conditionals.d.ts +8 -8
  9. package/dist/commons/events/ActionDocument.d.ts +196 -196
  10. package/dist/commons/events/ActionInput.d.ts +113 -113
  11. package/dist/commons/events/ActionType.d.ts +3 -3
  12. package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
  13. package/dist/commons/events/AuditLog.d.ts +347 -163
  14. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +461 -190
  16. package/dist/commons/events/Draft.d.ts +9 -9
  17. package/dist/commons/events/DynamicFieldValue.d.ts +37 -19
  18. package/dist/commons/events/EventConfig.d.ts +3 -1
  19. package/dist/commons/events/EventDocument.d.ts +80 -80
  20. package/dist/commons/events/EventIndex.d.ts +35 -27
  21. package/dist/commons/events/EventInput.d.ts +1 -1
  22. package/dist/commons/events/EventMetadata.d.ts +19 -19
  23. package/dist/commons/events/FieldConfig.d.ts +287 -71
  24. package/dist/commons/events/FieldType.d.ts +2 -1
  25. package/dist/commons/events/FieldTypeMapping.d.ts +98 -72
  26. package/dist/commons/events/FieldValue.d.ts +54 -26
  27. package/dist/commons/events/PlainDate.d.ts +1 -1
  28. package/dist/commons/events/WorkqueueColumnConfig.d.ts +7 -7
  29. package/dist/commons/events/WorkqueueConfig.d.ts +443 -199
  30. package/dist/commons/events/defineConfig.d.ts +0 -4
  31. package/dist/commons/events/locations.d.ts +4 -4
  32. package/dist/commons/events/scopes.d.ts +4 -3
  33. package/dist/commons/events/state/index.d.ts +2 -2
  34. package/dist/commons/events/state/utils.d.ts +1 -1
  35. package/dist/commons/events/test.utils.d.ts +2 -2
  36. package/dist/commons/events/utils.d.ts +3 -175
  37. package/dist/commons/notification/UserNotifications.d.ts +21 -1
  38. package/dist/conditionals/index.js +74 -359
  39. package/dist/events/index.js +1207 -1260
  40. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
  41. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
  42. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +404 -0
  43. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +3 -0
  44. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +1 -0
  45. package/dist/migrations/v2.0/add-resend-invite-notification.js +345 -0
  46. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +22 -0
  47. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -0
  48. package/dist/migrations/v2.0/checkout-upstream-files.js +147 -0
  49. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
  50. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
  51. package/dist/migrations/v2.0/convert-config-files-to-ts.js +828 -0
  52. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
  53. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
  54. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +158 -0
  55. package/dist/migrations/v2.0/create-events-index.d.ts +3 -0
  56. package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -0
  57. package/dist/migrations/v2.0/create-events-index.js +325 -0
  58. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +3 -0
  59. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -0
  60. package/dist/migrations/v2.0/delete-infrastructure-directory.js +77 -0
  61. package/dist/migrations/v2.0/index.d.ts +11 -0
  62. package/dist/migrations/v2.0/index.d.ts.map +1 -0
  63. package/dist/migrations/v2.0/index.js +4751 -0
  64. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
  65. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
  66. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +343 -0
  67. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +3 -0
  68. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -0
  69. package/dist/migrations/v2.0/merge-infrastructure-directory.js +221 -0
  70. package/dist/migrations/v2.0/migrate-application-config-url.d.ts +3 -0
  71. package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +1 -0
  72. package/dist/migrations/v2.0/migrate-application-config-url.js +342 -0
  73. package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
  74. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
  75. package/dist/migrations/v2.0/migrate-scopes.js +281 -0
  76. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
  77. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
  78. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +267 -0
  79. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
  80. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
  81. package/dist/migrations/v2.0/migrate-workqueue-configs.js +236 -0
  82. package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
  83. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
  84. package/dist/migrations/v2.0/remove-delete-actions.js +156 -0
  85. package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
  86. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
  87. package/dist/migrations/v2.0/remove-demo-scope.js +74 -0
  88. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
  89. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
  90. package/dist/migrations/v2.0/remove-deprecated-imports.js +96 -0
  91. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +3 -0
  92. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +1 -0
  93. package/dist/migrations/v2.0/remove-fhir-url-helpers.js +163 -0
  94. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +3 -0
  95. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -0
  96. package/dist/migrations/v2.0/remove-hearth-migrations.js +77 -0
  97. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +3 -0
  98. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +1 -0
  99. package/dist/migrations/v2.0/remove-old-statistics-service.js +356 -0
  100. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
  101. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
  102. package/dist/migrations/v2.0/remove-pending-certification-flag.js +109 -0
  103. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
  104. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
  105. package/dist/migrations/v2.0/remove-review-from-register-action.js +163 -0
  106. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +3 -0
  107. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +1 -0
  108. package/dist/migrations/v2.0/remove-unused-environment-variables.js +186 -0
  109. package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
  110. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
  111. package/dist/migrations/v2.0/rename-api-paths.js +187 -0
  112. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
  113. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
  114. package/dist/migrations/v2.0/rename-location-parent-id.js +180 -0
  115. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +3 -0
  116. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -0
  117. package/dist/migrations/v2.0/simplify-analytics-precalculations.js +195 -0
  118. package/dist/migrations/v2.0/update-package-json.d.ts +3 -0
  119. package/dist/migrations/v2.0/update-package-json.d.ts.map +1 -0
  120. package/dist/migrations/v2.0/update-package-json.js +105 -0
  121. package/dist/notification/index.js +1013 -1135
  122. package/dist/scopes/index.d.ts +389 -152
  123. package/dist/scopes/index.js +128 -322
  124. package/opencrvs-toolkit-1.9.12-rc.f687751.tgz +0 -0
  125. package/package.json +11 -7
  126. package/tsconfig.json +3 -0
  127. package/tsconfig.tsbuildinfo +1 -1
  128. package/opencrvs-toolkit-1.9.12-rc.f5ca5e6.tgz +0 -0
@@ -38,7 +38,7 @@ __export(notification_exports, {
38
38
  triggerUserEventNotification: () => triggerUserEventNotification
39
39
  });
40
40
  module.exports = __toCommonJS(notification_exports);
41
- var z46 = __toESM(require("zod/v4"));
41
+ var z45 = __toESM(require("zod/v4"));
42
42
 
43
43
  // ../commons/src/url.ts
44
44
  function joinUrl(base, path) {
@@ -47,111 +47,231 @@ function joinUrl(base, path) {
47
47
  }
48
48
 
49
49
  // ../commons/src/events/AuditLog.ts
50
+ var z5 = __toESM(require("zod/v4"));
51
+
52
+ // ../commons/src/authentication.ts
53
+ var import_jwt_decode = __toESM(require("jwt-decode"));
54
+ var z3 = __toESM(require("zod/v4"));
55
+
56
+ // ../commons/src/scopes.ts
57
+ var z2 = __toESM(require("zod/v4"));
58
+ var qs = __toESM(require("qs"));
59
+
60
+ // ../commons/src/uuid.ts
61
+ var import_uuid = require("uuid");
50
62
  var z = __toESM(require("zod/v4"));
51
- var UserAuditRecordInput = z.discriminatedUnion("operation", [
52
- z.object({
53
- operation: z.literal("user.create_user"),
54
- requestData: z.object({
55
- subjectId: z.string(),
56
- role: z.string(),
57
- primaryOfficeId: z.string()
58
- }),
59
- responseSummary: z.object({})
60
- }),
61
- z.object({
62
- operation: z.literal("user.deactivate"),
63
- requestData: z.object({
64
- subjectId: z.string(),
65
- reason: z.string(),
66
- comment: z.string().optional()
67
- }),
68
- responseSummary: z.object({})
69
- }),
70
- z.object({
71
- operation: z.literal("user.reactivate"),
72
- requestData: z.object({
73
- subjectId: z.string(),
74
- reason: z.string(),
75
- comment: z.string().optional()
76
- }),
77
- responseSummary: z.object({})
78
- }),
79
- z.object({
80
- operation: z.literal("user.edit_user"),
81
- requestData: z.object({ subjectId: z.string() }),
82
- responseSummary: z.object({})
83
- }),
84
- z.object({
85
- operation: z.literal("user.email_address_changed"),
86
- requestData: z.object({ subjectId: z.string() }),
87
- responseSummary: z.object({ email: z.string() })
63
+ var UUID = z.uuid().brand("UUID");
64
+ function getUUID() {
65
+ return (0, import_uuid.v4)();
66
+ }
67
+
68
+ // ../commons/src/scopes.ts
69
+ var JurisdictionFilter = z2.enum(["administrativeArea", "location", "all"]).describe(
70
+ "Filters based on user jurisdiction relative to their office location in hierarchy."
71
+ );
72
+ var UserFilter = z2.enum(["user"]).describe("Filters based on the user. Limits to self.");
73
+ var RecordScopeTypeV2 = z2.enum([
74
+ "record.search",
75
+ "record.create",
76
+ "record.read",
77
+ "record.declare",
78
+ "record.notify",
79
+ "record.edit",
80
+ "record.reject",
81
+ "record.archive",
82
+ "record.review-duplicates",
83
+ "record.register",
84
+ "record.print-certified-copies",
85
+ "record.request-correction",
86
+ "record.correct",
87
+ "record.unassign-others",
88
+ "record.custom-action"
89
+ ]);
90
+ var PlainScopeType = z2.enum([
91
+ // Misc. system scopes
92
+ "bypassratelimit",
93
+ "record.reindex",
94
+ "user.data-seeding",
95
+ "integration.create",
96
+ "record.import",
97
+ "config.update-all",
98
+ "attachment.upload",
99
+ "profile.electronic-signature",
100
+ "user.read-only-my-audit",
101
+ // Performance dashboard
102
+ "performance.read",
103
+ "performance.read-dashboards",
104
+ "performance.vital-statistics-export",
105
+ // Scopes used exclusively by countryconfig integration token
106
+ "record.confirm-registration",
107
+ "record.reject-registration"
108
+ ]);
109
+ var scopeByEvent = z2.preprocess(
110
+ (val) => val === void 0 ? void 0 : [val].flat(),
111
+ z2.array(z2.string()).optional()
112
+ ).describe("Event type, e.g. birth, death");
113
+ var scopeOptionsPlaceEvent = z2.object({
114
+ event: scopeByEvent,
115
+ placeOfEvent: JurisdictionFilter.optional()
116
+ }).describe("Options applicable to all record scopes.");
117
+ var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
118
+ declaredIn: JurisdictionFilter.optional(),
119
+ declaredBy: UserFilter.optional()
120
+ }).describe("Options applicable to actions that may take place after DECLARE");
121
+ var AllRecordScopeOptions = scopeOptionsDeclared.extend({
122
+ registeredIn: JurisdictionFilter.optional(),
123
+ registeredBy: UserFilter.optional()
124
+ }).describe(
125
+ "Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
126
+ );
127
+ var CustomActionScopeOptions = AllRecordScopeOptions.extend({
128
+ customActionTypes: z2.preprocess(
129
+ (val) => val === void 0 ? void 0 : [val].flat(),
130
+ z2.array(z2.string()).optional()
131
+ ).describe("Allowed custom action types")
132
+ });
133
+ var AccessLevelOptions = z2.object({
134
+ accessLevel: JurisdictionFilter.optional()
135
+ });
136
+ var WorkqueueOrDashboardOptions = z2.object({
137
+ ids: z2.preprocess(
138
+ (val) => val === void 0 ? void 0 : [val].flat(),
139
+ z2.array(z2.string())
140
+ ).describe("Must contain a list of workqueue or dashboard ids.")
141
+ });
142
+ var AllScopeOptions = z2.object({
143
+ ...AllRecordScopeOptions.shape,
144
+ ...AccessLevelOptions.shape,
145
+ ...WorkqueueOrDashboardOptions.shape
146
+ });
147
+ var ScopeOptionKey = AllScopeOptions.keyof();
148
+ var ResolvedScopeOptionsPlaceEvent = z2.object({
149
+ event: scopeByEvent,
150
+ placeOfEvent: UUID.nullish()
151
+ }).describe(
152
+ "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
153
+ );
154
+ var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
155
+ declaredIn: UUID.nullish(),
156
+ declaredBy: z2.string().optional()
157
+ }).describe(
158
+ "Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
159
+ );
160
+ var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
161
+ registeredIn: UUID.nullish(),
162
+ registeredBy: z2.string().optional()
163
+ }).describe(
164
+ "Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
165
+ );
166
+ var ScopesWithPlaceEventOptions = RecordScopeTypeV2.extract([
167
+ "record.create",
168
+ "record.declare",
169
+ "record.notify"
170
+ ]);
171
+ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
172
+ "record.edit",
173
+ "record.reject",
174
+ "record.archive",
175
+ "record.review-duplicates",
176
+ "record.register"
177
+ ]);
178
+ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
179
+ "record.search",
180
+ "record.read",
181
+ "record.request-correction",
182
+ "record.correct",
183
+ "record.unassign-others"
184
+ ]);
185
+ var ScopeOptionsPrintCertifiedCopies = AllRecordScopeOptions.extend({
186
+ templates: z2.preprocess(
187
+ (val) => val === void 0 ? void 0 : [val].flat(),
188
+ z2.array(z2.string()).optional()
189
+ ).describe(
190
+ "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."
191
+ )
192
+ });
193
+ var RecordScopeV2 = z2.discriminatedUnion("type", [
194
+ z2.object({
195
+ type: ScopesWithPlaceEventOptions,
196
+ options: scopeOptionsPlaceEvent.optional()
88
197
  }),
89
- z.object({
90
- operation: z.literal("user.logged_in"),
91
- requestData: z.object({ subjectId: z.string() }),
92
- responseSummary: z.object({})
198
+ z2.object({
199
+ type: ScopesWithDeclaredOptions,
200
+ options: scopeOptionsDeclared.optional()
93
201
  }),
94
- z.object({
95
- operation: z.literal("user.logged_out"),
96
- requestData: z.object({ subjectId: z.string() }),
97
- responseSummary: z.object({})
202
+ z2.object({
203
+ type: ScopesWithFullOptions,
204
+ options: AllRecordScopeOptions.optional()
98
205
  }),
99
- z.object({
100
- operation: z.literal("user.password_changed"),
101
- requestData: z.object({ subjectId: z.string() }),
102
- responseSummary: z.object({})
206
+ z2.object({
207
+ type: z2.literal("record.custom-action"),
208
+ options: CustomActionScopeOptions.optional()
103
209
  }),
104
- z.object({
105
- operation: z.literal("user.password_reset"),
106
- requestData: z.object({ subjectId: z.string() }),
107
- responseSummary: z.object({})
210
+ z2.object({
211
+ type: z2.literal("record.print-certified-copies"),
212
+ options: ScopeOptionsPrintCertifiedCopies.optional()
213
+ })
214
+ ]).describe(
215
+ "Scopes used to check user's permission to perform actions on a record."
216
+ );
217
+ var ResolvedRecordScopeV2 = z2.discriminatedUnion("type", [
218
+ z2.object({
219
+ type: ScopesWithPlaceEventOptions,
220
+ options: ResolvedScopeOptionsPlaceEvent.optional()
108
221
  }),
109
- z.object({
110
- operation: z.literal("user.password_reset_by_admin"),
111
- requestData: z.object({ subjectId: z.string() }),
112
- responseSummary: z.object({})
222
+ z2.object({
223
+ type: ScopesWithDeclaredOptions,
224
+ options: ResolvedScopeOptionsDeclared.optional()
113
225
  }),
114
- z.object({
115
- operation: z.literal("user.phone_number_changed"),
116
- requestData: z.object({ subjectId: z.string() }),
117
- responseSummary: z.object({ phoneNumber: z.string() })
226
+ z2.object({
227
+ type: ScopesWithFullOptions,
228
+ options: ResolvedScopeOptionsFull.optional()
118
229
  }),
119
- z.object({
120
- operation: z.literal("user.username_reminder"),
121
- requestData: z.object({ subjectId: z.string() }),
122
- responseSummary: z.object({})
230
+ z2.object({
231
+ type: z2.literal("record.print-certified-copies"),
232
+ options: ResolvedScopeOptionsFull.extend({
233
+ templates: z2.array(z2.string()).optional()
234
+ }).optional()
235
+ })
236
+ ]).describe("Resolved scope with location/user IDs instead of filters.");
237
+ var SystemScopeType = z2.enum([
238
+ "organisation.read-locations",
239
+ "user.read",
240
+ "user.create",
241
+ "user.edit"
242
+ ]);
243
+ var Scope = z2.discriminatedUnion("type", [
244
+ z2.object({ type: PlainScopeType }),
245
+ ...RecordScopeV2.options,
246
+ z2.object({ type: SystemScopeType, options: AccessLevelOptions.optional() }),
247
+ z2.object({
248
+ type: z2.literal("workqueue"),
249
+ options: WorkqueueOrDashboardOptions
123
250
  }),
124
- z.object({
125
- operation: z.literal("user.username_reminder_by_admin"),
126
- requestData: z.object({ subjectId: z.string() }),
127
- responseSummary: z.object({})
251
+ z2.object({
252
+ type: z2.literal("dashboard.view"),
253
+ options: WorkqueueOrDashboardOptions
128
254
  })
129
255
  ]);
256
+ var ScopeType = z2.enum([
257
+ ...SystemScopeType.options,
258
+ ...RecordScopeTypeV2.options,
259
+ ...PlainScopeType.options,
260
+ "workqueue",
261
+ "dashboard.view"
262
+ ]);
263
+ var EncodedScope = z2.string().brand("EncodedScope");
264
+ var DEFAULT_SCOPE_OPTIONS = {
265
+ placeOfEvent: JurisdictionFilter.enum.all,
266
+ accessLevel: JurisdictionFilter.enum.all
267
+ };
130
268
 
131
- // ../commons/src/events/Constants.ts
132
- var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
133
- var CHILD_ONBOARDING_EVENT = "child-onboarding";
134
-
135
- // ../commons/src/events/ActionConfig.ts
136
- var z25 = __toESM(require("zod/v4"));
137
-
138
- // ../commons/src/events/TranslationConfig.ts
139
- var z2 = __toESM(require("zod/v4"));
140
- var TranslationConfig = z2.object({
141
- id: z2.string().describe(
142
- "The identifier of the translation referred in translation CSV files"
143
- ),
144
- defaultMessage: z2.string().describe("Default translation message"),
145
- description: z2.string().describe(
146
- "Describe the translation for a translator to be able to identify it."
147
- )
148
- }).meta({
149
- description: "Translation configuration",
150
- id: "TranslationConfig"
151
- });
269
+ // ../commons/src/authentication.ts
270
+ var TokenUserType = z3.enum(["user", "system"]);
271
+ var TokenWithBearer = z3.string().regex(/^Bearer\s/);
152
272
 
153
273
  // ../commons/src/events/ActionType.ts
154
- var z3 = __toESM(require("zod/v4"));
274
+ var z4 = __toESM(require("zod/v4"));
155
275
  var ActionType = {
156
276
  // Pre-declaration actions
157
277
  DELETE: "DELETE",
@@ -193,7 +313,7 @@ var ConfirmableActions = [
193
313
  ActionType.REJECT_CORRECTION,
194
314
  ActionType.CUSTOM
195
315
  ];
196
- var ActionTypes = z3.enum([
316
+ var ActionTypes = z4.enum([
197
317
  "DELETE",
198
318
  "CREATE",
199
319
  "NOTIFY",
@@ -257,12 +377,226 @@ var META_ACTIONS = [
257
377
  ActionType.READ
258
378
  ];
259
379
 
380
+ // ../commons/src/events/AuditLog.ts
381
+ var AuditLogEntryBase = z5.object({
382
+ id: z5.string(),
383
+ clientId: z5.string(),
384
+ clientType: TokenUserType,
385
+ createdAt: z5.string()
386
+ });
387
+ var EventCreateEntrySchema = AuditLogEntryBase.extend({
388
+ operation: z5.literal("event.create"),
389
+ requestData: z5.object({
390
+ transactionId: z5.string(),
391
+ type: z5.string(),
392
+ createdAtLocation: z5.string().nullable()
393
+ }),
394
+ responseSummary: z5.object({
395
+ eventId: z5.string(),
396
+ trackingId: z5.string()
397
+ })
398
+ });
399
+ var EventGetEntrySchema = AuditLogEntryBase.extend({
400
+ operation: z5.literal("event.get"),
401
+ requestData: z5.object({ eventId: z5.string() }),
402
+ responseSummary: z5.object({
403
+ eventType: z5.string(),
404
+ trackingId: z5.string()
405
+ })
406
+ });
407
+ var EventSearchEntrySchema = AuditLogEntryBase.extend({
408
+ operation: z5.literal("event.search"),
409
+ clientType: z5.literal("system"),
410
+ requestData: z5.object({
411
+ query: z5.record(z5.string(), z5.unknown()).nullable(),
412
+ limit: z5.number().nullable(),
413
+ offset: z5.number().nullable()
414
+ }),
415
+ responseSummary: z5.object({
416
+ total: z5.number(),
417
+ eventIds: z5.array(z5.string())
418
+ })
419
+ });
420
+ var EventActionEntrySchema = AuditLogEntryBase.extend({
421
+ operation: z5.enum([
422
+ "event.actions.notify.request",
423
+ "event.actions.declare.request",
424
+ "event.actions.register.request",
425
+ "event.actions.reject.request",
426
+ "event.actions.validate.request",
427
+ "event.actions.edit.request",
428
+ "event.actions.assign.request",
429
+ "event.actions.unassign.request",
430
+ "event.actions.read.request",
431
+ "event.actions.archive.request",
432
+ "event.actions.reinstate.request",
433
+ "event.actions.print_certificate.request",
434
+ "event.actions.correction.request.request",
435
+ "event.actions.correction.approve.request",
436
+ "event.actions.correction.reject.request",
437
+ "event.actions.mark_as_duplicate.request",
438
+ "event.actions.mark_as_not_duplicate.request"
439
+ ]),
440
+ requestData: z5.object({
441
+ eventId: z5.string(),
442
+ actionType: z5.string(),
443
+ eventType: z5.string(),
444
+ trackingId: z5.string(),
445
+ transactionId: z5.string()
446
+ })
447
+ });
448
+ var EventCustomActionEntrySchema = AuditLogEntryBase.extend({
449
+ operation: z5.literal("event.actions.custom.request"),
450
+ requestData: z5.object({
451
+ eventId: z5.string(),
452
+ actionType: z5.literal(ActionType.CUSTOM),
453
+ customAction: z5.string(),
454
+ eventType: z5.string(),
455
+ trackingId: z5.string(),
456
+ transactionId: z5.string()
457
+ })
458
+ });
459
+ var IntegrationCreateEntrySchema = AuditLogEntryBase.extend({
460
+ operation: z5.literal("integrations.create"),
461
+ requestData: z5.object({ name: z5.string(), scopes: z5.array(z5.string()) }),
462
+ responseSummary: z5.object({ clientId: z5.string() })
463
+ });
464
+ var IntegrationRefreshTokenEntrySchema = AuditLogEntryBase.extend({
465
+ operation: z5.literal("integrations.refreshToken"),
466
+ requestData: z5.object({ clientId: z5.string() }),
467
+ responseSummary: z5.object({ clientId: z5.string() })
468
+ });
469
+ var IntegrationDeactivateEntrySchema = AuditLogEntryBase.extend({
470
+ operation: z5.literal("integrations.deactivate"),
471
+ requestData: z5.object({ id: z5.string() }),
472
+ responseSummary: z5.object({ id: z5.string(), status: z5.string() })
473
+ });
474
+ var IntegrationActivateEntrySchema = AuditLogEntryBase.extend({
475
+ operation: z5.literal("integrations.activate"),
476
+ requestData: z5.object({ id: z5.string() }),
477
+ responseSummary: z5.object({ id: z5.string(), status: z5.string() })
478
+ });
479
+ var IntegrationDeleteEntrySchema = AuditLogEntryBase.extend({
480
+ operation: z5.literal("integrations.delete"),
481
+ requestData: z5.object({ id: z5.string() }),
482
+ responseSummary: z5.object({ id: z5.string(), name: z5.string() })
483
+ });
484
+ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
485
+ operation: z5.literal("integrations.refreshSecret"),
486
+ requestData: z5.object({ id: z5.string() }),
487
+ responseSummary: z5.object({ clientId: z5.string() })
488
+ });
489
+ var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
490
+ operation: z5.literal("attachments.upload"),
491
+ requestData: z5.object({
492
+ transactionId: z5.string(),
493
+ path: z5.string().nullable()
494
+ }),
495
+ responseSummary: z5.object({ fileUrl: z5.string() })
496
+ });
497
+ var subjectOnly = z5.object({ subjectId: z5.string() });
498
+ var subjectWithReason = z5.object({
499
+ subjectId: z5.string(),
500
+ reason: z5.string(),
501
+ comment: z5.string().optional()
502
+ });
503
+ var UserCreateEntrySchema = AuditLogEntryBase.extend({
504
+ operation: z5.literal("user.create_user"),
505
+ requestData: z5.object({
506
+ subjectId: z5.string(),
507
+ role: z5.string(),
508
+ primaryOfficeId: z5.string()
509
+ })
510
+ });
511
+ var UserReasonEntrySchema = AuditLogEntryBase.extend({
512
+ operation: z5.enum(["user.deactivate", "user.reactivate"]),
513
+ requestData: subjectWithReason
514
+ });
515
+ var UserSubjectOnlyEntrySchema = AuditLogEntryBase.extend({
516
+ operation: z5.enum([
517
+ "user.edit_user",
518
+ "user.logged_in",
519
+ "user.logged_out",
520
+ "user.password_changed",
521
+ "user.password_reset",
522
+ "user.password_reset_by_admin",
523
+ "user.resend_invite",
524
+ "user.username_reminder",
525
+ "user.username_reminder_by_admin"
526
+ ]),
527
+ requestData: subjectOnly
528
+ });
529
+ var UserEmailChangedEntrySchema = AuditLogEntryBase.extend({
530
+ operation: z5.literal("user.email_address_changed"),
531
+ requestData: subjectOnly,
532
+ responseSummary: z5.object({ email: z5.string() })
533
+ });
534
+ var UserPhoneChangedEntrySchema = AuditLogEntryBase.extend({
535
+ operation: z5.literal("user.phone_number_changed"),
536
+ requestData: subjectOnly,
537
+ responseSummary: z5.object({ phoneNumber: z5.string() })
538
+ });
539
+ var userBaseOmit = {
540
+ id: true,
541
+ clientId: true,
542
+ clientType: true,
543
+ createdAt: true
544
+ };
545
+ var UserAuditRecordInput = z5.discriminatedUnion("operation", [
546
+ UserCreateEntrySchema.omit(userBaseOmit),
547
+ UserReasonEntrySchema.omit(userBaseOmit),
548
+ UserSubjectOnlyEntrySchema.omit(userBaseOmit),
549
+ UserEmailChangedEntrySchema.omit(userBaseOmit),
550
+ UserPhoneChangedEntrySchema.omit(userBaseOmit)
551
+ ]);
552
+ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
553
+ EventCreateEntrySchema,
554
+ EventGetEntrySchema,
555
+ EventSearchEntrySchema,
556
+ EventActionEntrySchema,
557
+ EventCustomActionEntrySchema,
558
+ IntegrationCreateEntrySchema,
559
+ IntegrationRefreshTokenEntrySchema,
560
+ IntegrationDeactivateEntrySchema,
561
+ IntegrationActivateEntrySchema,
562
+ IntegrationDeleteEntrySchema,
563
+ IntegrationRefreshSecretEntrySchema,
564
+ AttachmentUploadEntrySchema,
565
+ UserCreateEntrySchema,
566
+ UserReasonEntrySchema,
567
+ UserSubjectOnlyEntrySchema,
568
+ UserEmailChangedEntrySchema,
569
+ UserPhoneChangedEntrySchema
570
+ ]);
571
+
572
+ // ../commons/src/events/Constants.ts
573
+ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
574
+ var CHILD_ONBOARDING_EVENT = "child-onboarding";
575
+
576
+ // ../commons/src/events/ActionConfig.ts
577
+ var z24 = __toESM(require("zod/v4"));
578
+
579
+ // ../commons/src/events/TranslationConfig.ts
580
+ var z6 = __toESM(require("zod/v4"));
581
+ var TranslationConfig = z6.object({
582
+ id: z6.string().describe(
583
+ "The identifier of the translation referred in translation CSV files"
584
+ ),
585
+ defaultMessage: z6.string().describe("Default translation message"),
586
+ description: z6.string().describe(
587
+ "Describe the translation for a translator to be able to identify it."
588
+ )
589
+ }).meta({
590
+ description: "Translation configuration",
591
+ id: "TranslationConfig"
592
+ });
593
+
260
594
  // ../commons/src/events/FieldConfig.ts
261
595
  var import_v43 = __toESM(require("zod/v4"));
262
596
 
263
597
  // ../commons/src/events/Conditional.ts
264
- var z4 = __toESM(require("zod/v4"));
265
- var Conditional = z4.any().describe("JSONSchema").meta({
598
+ var z7 = __toESM(require("zod/v4"));
599
+ var Conditional = z7.any().describe("JSONSchema").meta({
266
600
  description: "JSON schema conditional configuration",
267
601
  id: "Conditional"
268
602
  });
@@ -271,31 +605,31 @@ var ConditionalType = {
271
605
  ENABLE: "ENABLE",
272
606
  DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
273
607
  };
274
- var ShowConditional = z4.object({
275
- type: z4.literal(ConditionalType.SHOW),
608
+ var ShowConditional = z7.object({
609
+ type: z7.literal(ConditionalType.SHOW),
276
610
  conditional: Conditional
277
611
  }).describe(
278
612
  "If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
279
613
  );
280
- var EnableConditional = z4.object({
281
- type: z4.literal(ConditionalType.ENABLE),
614
+ var EnableConditional = z7.object({
615
+ type: z7.literal(ConditionalType.ENABLE),
282
616
  conditional: Conditional
283
617
  }).describe(
284
618
  "If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
285
619
  );
286
- var ActionConditional = z4.discriminatedUnion("type", [
620
+ var ActionConditional = z7.discriminatedUnion("type", [
287
621
  // Action can be shown / hidden
288
622
  ShowConditional,
289
623
  // Action can be shown to the user in the list but as disabled
290
624
  EnableConditional
291
625
  ]);
292
- var DisplayOnReviewConditional = z4.object({
293
- type: z4.literal(ConditionalType.DISPLAY_ON_REVIEW),
626
+ var DisplayOnReviewConditional = z7.object({
627
+ type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
294
628
  conditional: Conditional
295
629
  }).describe(
296
630
  "If 'DISPLAY_ON_REVIEW' conditional is defined, the component is shown on the review page only if both the 'DISPLAY_ON_REVIEW' and 'SHOW' conditions are met. This should only be used for fields within declaration forms, as they are the only ones with review pages."
297
631
  );
298
- var FieldConditional = z4.discriminatedUnion("type", [
632
+ var FieldConditional = z7.discriminatedUnion("type", [
299
633
  // Field input can be shown / hidden
300
634
  ShowConditional,
301
635
  // Field input can be shown to the user but as disabled
@@ -308,7 +642,7 @@ var FieldConditional = z4.discriminatedUnion("type", [
308
642
  });
309
643
 
310
644
  // ../commons/src/events/FieldType.ts
311
- var z5 = __toESM(require("zod/v4"));
645
+ var z8 = __toESM(require("zod/v4"));
312
646
  var FieldType = {
313
647
  NAME: "NAME",
314
648
  PHONE: "PHONE",
@@ -348,6 +682,7 @@ var FieldType = {
348
682
  SIGNATURE: "SIGNATURE",
349
683
  DATA: "DATA",
350
684
  BUTTON: "BUTTON",
685
+ AUTOCOMPLETE: "AUTOCOMPLETE",
351
686
  SEARCH: "SEARCH",
352
687
  ALPHA_PRINT_BUTTON: "ALPHA_PRINT_BUTTON",
353
688
  HTTP: "HTTP",
@@ -371,7 +706,7 @@ var FieldType = {
371
706
  */
372
707
  _EXPERIMENTAL_CUSTOM: "CUSTOM"
373
708
  };
374
- var FileFieldType = z5.enum([
709
+ var FileFieldType = z8.enum([
375
710
  FieldType.FILE,
376
711
  FieldType.FILE_WITH_OPTIONS,
377
712
  FieldType.SIGNATURE
@@ -402,154 +737,159 @@ var FieldTypesToHideInReview = [
402
737
  ];
403
738
 
404
739
  // ../commons/src/events/FieldValue.ts
405
- var z9 = __toESM(require("zod/v4"));
740
+ var z12 = __toESM(require("zod/v4"));
406
741
 
407
742
  // ../commons/src/documents.ts
408
- var z6 = __toESM(require("zod/v4"));
409
- var FullDocumentUrl = z6.string().brand("FullDocumentUrl").describe(
743
+ var z9 = __toESM(require("zod/v4"));
744
+ var FullDocumentUrl = z9.string().brand("FullDocumentUrl").describe(
410
745
  "A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio.opencrvs.com/bucket-name/document-id.jpg"
411
746
  );
412
- var FullDocumentPath = z6.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
747
+ var FullDocumentPath = z9.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
413
748
  "A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
414
749
  );
415
- var DocumentPath = z6.string().brand("DocumentPath").describe(
750
+ var DocumentPath = z9.string().brand("DocumentPath").describe(
416
751
  "A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."
417
752
  );
418
753
 
419
754
  // ../commons/src/events/CompositeFieldValue.ts
420
- var z7 = __toESM(require("zod/v4"));
755
+ var z10 = __toESM(require("zod/v4"));
421
756
  var AddressType = {
422
757
  DOMESTIC: "DOMESTIC",
423
758
  INTERNATIONAL: "INTERNATIONAL"
424
759
  };
425
- var FileFieldValue = z7.object({
760
+ var FileFieldValue = z10.object({
426
761
  path: DocumentPath,
427
- originalFilename: z7.string(),
428
- type: z7.string()
429
- });
430
- var NameFieldValue = z7.object({
431
- firstname: z7.string(),
432
- surname: z7.string(),
433
- middlename: z7.string().optional()
434
- });
435
- var NameFieldUpdateValue = z7.object({
436
- firstname: z7.string().nullish(),
437
- surname: z7.string().nullish(),
438
- middlename: z7.string().nullish()
439
- }).or(z7.null()).or(z7.undefined());
440
- var StreetLevelDetailsValue = z7.record(z7.string(), z7.string()).optional();
441
- var StreetLevelDetailsUpdateValue = z7.record(z7.string(), z7.string().nullable()).nullish();
442
- var BaseAddressFieldValue = z7.object({
443
- country: z7.string(),
762
+ originalFilename: z10.string(),
763
+ type: z10.string()
764
+ });
765
+ var NameFieldValue = z10.object({
766
+ firstname: z10.string(),
767
+ surname: z10.string(),
768
+ middlename: z10.string().optional()
769
+ });
770
+ var NameFieldUpdateValue = z10.object({
771
+ firstname: z10.string().nullish(),
772
+ surname: z10.string().nullish(),
773
+ middlename: z10.string().nullish()
774
+ }).or(z10.null()).or(z10.undefined());
775
+ var StreetLevelDetailsValue = z10.record(z10.string(), z10.string()).optional();
776
+ var StreetLevelDetailsUpdateValue = z10.record(z10.string(), z10.string().nullable()).nullish();
777
+ var BaseAddressFieldValue = z10.object({
778
+ country: z10.string(),
444
779
  streetLevelDetails: StreetLevelDetailsValue
445
780
  });
446
- var BaseAddressFieldUpdateValue = z7.object({
447
- country: z7.string().nullish(),
781
+ var BaseAddressFieldUpdateValue = z10.object({
782
+ country: z10.string().nullish(),
448
783
  streetLevelDetails: StreetLevelDetailsUpdateValue
449
784
  });
450
785
  var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
451
- addressType: z7.literal(AddressType.DOMESTIC),
452
- administrativeArea: z7.string().uuid()
786
+ addressType: z10.literal(AddressType.DOMESTIC),
787
+ administrativeArea: z10.string().uuid()
453
788
  });
454
789
  var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
455
- addressType: z7.literal(AddressType.INTERNATIONAL)
790
+ addressType: z10.literal(AddressType.INTERNATIONAL)
456
791
  });
457
- var AddressFieldValue = z7.discriminatedUnion("addressType", [
792
+ var AddressFieldValue = z10.discriminatedUnion("addressType", [
458
793
  DomesticAddressFieldValue,
459
794
  InternationalAddressFieldValue
460
795
  ]);
461
796
  var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
462
- addressType: z7.literal(AddressType.DOMESTIC),
463
- administrativeArea: z7.string().uuid().nullish()
797
+ addressType: z10.literal(AddressType.DOMESTIC),
798
+ administrativeArea: z10.string().uuid().nullish()
464
799
  /* Leaf level admin structure */
465
800
  });
466
801
  var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
467
802
  {
468
- addressType: z7.literal(AddressType.INTERNATIONAL)
803
+ addressType: z10.literal(AddressType.INTERNATIONAL)
469
804
  }
470
805
  );
471
- var AddressFieldUpdateValue = z7.discriminatedUnion("addressType", [
806
+ var AddressFieldUpdateValue = z10.discriminatedUnion("addressType", [
472
807
  DomesticAddressUpdateFieldValue,
473
808
  InternationalAddressUpdateFieldValue
474
809
  ]).nullish();
475
- var FileFieldValueWithOption = z7.object({
810
+ var FileFieldValueWithOption = z10.object({
476
811
  path: DocumentPath,
477
- originalFilename: z7.string(),
478
- type: z7.string(),
479
- option: z7.string()
480
- });
481
- var FileFieldWithOptionValue = z7.array(FileFieldValueWithOption);
482
- var HttpFieldValue = z7.object({
483
- loading: z7.boolean(),
484
- error: z7.object({ statusCode: z7.number(), message: z7.string() }).nullish(),
485
- data: z7.any()
486
- });
487
- var HttpFieldUpdateValue = z7.object({
488
- loading: z7.boolean().nullish(),
489
- error: z7.object({ statusCode: z7.number(), message: z7.string() }).nullish(),
490
- data: z7.any().nullish()
491
- }).or(z7.null()).or(z7.undefined());
492
- var QueryParamReaderFieldValue = z7.object({
493
- data: z7.record(z7.string(), z7.string()),
494
- updatedAt: z7.iso.datetime()
812
+ originalFilename: z10.string(),
813
+ type: z10.string(),
814
+ option: z10.string()
815
+ });
816
+ var FileFieldWithOptionValue = z10.array(FileFieldValueWithOption);
817
+ var HttpFieldValue = z10.object({
818
+ loading: z10.boolean(),
819
+ error: z10.object({ statusCode: z10.number(), message: z10.string() }).nullish(),
820
+ data: z10.any()
821
+ });
822
+ var HttpFieldUpdateValue = z10.object({
823
+ loading: z10.boolean().nullish(),
824
+ error: z10.object({ statusCode: z10.number(), message: z10.string() }).nullish(),
825
+ data: z10.any().nullish()
826
+ }).or(z10.null()).or(z10.undefined());
827
+ var QueryParamReaderFieldValue = z10.object({
828
+ data: z10.record(z10.string(), z10.string()),
829
+ updatedAt: z10.iso.datetime()
495
830
  }).nullish();
496
- var QueryParamReaderFieldUpdateValue = z7.object({
497
- data: z7.record(z7.string(), z7.string())
831
+ var QueryParamReaderFieldUpdateValue = z10.object({
832
+ data: z10.record(z10.string(), z10.string())
498
833
  });
499
- var ReadDataValue = z7.object({
500
- data: z7.any()
834
+ var ReadDataValue = z10.object({
835
+ data: z10.any()
501
836
  });
502
837
  var QrReaderFieldValue = ReadDataValue;
503
838
  var IdReaderFieldValue = ReadDataValue;
504
- var NumberWithUnitFieldValue = z7.object({
505
- numericValue: z7.number(),
506
- unit: z7.string()
839
+ var NumberWithUnitFieldValue = z10.object({
840
+ numericValue: z10.number(),
841
+ unit: z10.string()
507
842
  });
508
- var NumberWithUnitFieldUpdateValue = z7.object({
509
- numericValue: z7.number().optional(),
510
- unit: z7.string().optional()
843
+ var NumberWithUnitFieldUpdateValue = z10.object({
844
+ numericValue: z10.number().optional(),
845
+ unit: z10.string().optional()
511
846
  });
512
- var CustomFieldValue = z7.unknown().brand("CustomFieldValue");
847
+ var CustomFieldValue = z10.unknown().brand("CustomFieldValue");
513
848
 
514
849
  // ../commons/src/events/PlainDate.ts
515
850
  var import_zod = require("zod");
516
851
  var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date in the format YYYY-MM-DD");
517
852
 
518
853
  // ../commons/src/events/FieldValue.ts
519
- var TextValue = z9.string();
520
- var HiddenFieldValue = z9.string();
854
+ var TextValue = z12.string();
855
+ var HiddenFieldValue = z12.string();
521
856
  var NonEmptyTextValue = TextValue.min(1);
522
- var DateValue = z9.iso.date().describe("Date in the format YYYY-MM-DD");
523
- var AgeValue = z9.object({
524
- age: z9.number(),
525
- asOfDateRef: z9.string()
857
+ var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
858
+ var AgeValue = z12.object({
859
+ age: z12.number(),
860
+ asOfDateRef: z12.string()
526
861
  });
527
862
  var AgeUpdateValue = AgeValue.optional().nullable();
528
- var TimeValue = z9.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
529
- var DatetimeValue = z9.iso.datetime();
530
- var SelectDateRangeValue = z9.enum([
863
+ var AutocompleteValue = z12.object({
864
+ label: z12.string(),
865
+ value: z12.string()
866
+ });
867
+ var AutocompleteUpdateValue = AutocompleteValue.optional().nullable();
868
+ var TimeValue = z12.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
869
+ var DatetimeValue = z12.iso.datetime();
870
+ var SelectDateRangeValue = z12.enum([
531
871
  "last7Days",
532
872
  "last30Days",
533
873
  "last90Days",
534
874
  "last365Days"
535
875
  ]);
536
- var DateRangeFieldValue = z9.object({
876
+ var DateRangeFieldValue = z12.object({
537
877
  start: PlainDate,
538
878
  end: PlainDate
539
879
  }).or(PlainDate).describe(
540
880
  "Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
541
881
  );
542
- var EmailValue = z9.email();
543
- var CheckboxFieldValue = z9.boolean();
544
- var NumberFieldValue = z9.number();
545
- var ButtonFieldValue = z9.number();
546
- var VerificationStatusValue = z9.enum([
882
+ var EmailValue = z12.email();
883
+ var CheckboxFieldValue = z12.boolean();
884
+ var NumberFieldValue = z12.number();
885
+ var ButtonFieldValue = z12.number();
886
+ var VerificationStatusValue = z12.enum([
547
887
  "verified",
548
888
  "authenticated",
549
889
  "failed",
550
890
  "pending"
551
891
  ]);
552
- var LeafFieldValues = z9.union([
892
+ var LeafFieldValues = z12.union([
553
893
  AddressFieldValue,
554
894
  TextValue,
555
895
  PlainDate,
@@ -571,13 +911,15 @@ var LeafFieldValues = z9.union([
571
911
  IdReaderFieldValue,
572
912
  NumberWithUnitFieldValue,
573
913
  NumberWithUnitFieldUpdateValue,
574
- CustomFieldValue
914
+ CustomFieldValue,
915
+ AutocompleteValue,
916
+ AutocompleteUpdateValue
575
917
  ]);
576
- var FieldGroupValue = z9.record(z9.string(), LeafFieldValues);
577
- var DataFieldValue = z9.object({
578
- data: z9.record(z9.string(), LeafFieldValues)
918
+ var FieldGroupValue = z12.record(z12.string(), LeafFieldValues);
919
+ var DataFieldValue = z12.object({
920
+ data: z12.record(z12.string(), LeafFieldValues)
579
921
  }).nullish();
580
- var FieldValue = z9.union([
922
+ var FieldValue = z12.union([
581
923
  LeafFieldValues,
582
924
  DataFieldValue,
583
925
  FieldGroupValue
@@ -608,7 +950,7 @@ function schemaPriority(schema) {
608
950
  return idx === -1 ? 9999 : idx;
609
951
  }
610
952
  function safeUnion(schemas) {
611
- return z9.any().superRefine((val, ctx) => {
953
+ return z12.any().superRefine((val, ctx) => {
612
954
  const successful = schemas.filter((s) => s.safeParse(val).success);
613
955
  if (successful.length === 1) {
614
956
  return;
@@ -653,21 +995,14 @@ var FieldUpdateValue = safeUnion([
653
995
  HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
654
996
  QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
655
997
  CustomFieldValue.describe("CustomFieldValue"),
656
- HiddenFieldValue.describe("HiddenFieldValue")
998
+ HiddenFieldValue.describe("HiddenFieldValue"),
999
+ AutocompleteUpdateValue.describe("AutocompleteUpdateValue")
657
1000
  ]);
658
1001
 
659
- // ../commons/src/uuid.ts
660
- var import_uuid = require("uuid");
661
- var z10 = __toESM(require("zod/v4"));
662
- var UUID = z10.uuid().brand("UUID");
663
- function getUUID() {
664
- return (0, import_uuid.v4)();
665
- }
666
-
667
1002
  // ../commons/src/events/serializers/user/serializer.ts
668
- var z11 = __toESM(require("zod/v4"));
669
- var SerializedUserField = z11.object({
670
- $userField: z11.enum([
1003
+ var z13 = __toESM(require("zod/v4"));
1004
+ var SerializedUserField = z13.object({
1005
+ $userField: z13.enum([
671
1006
  "id",
672
1007
  "name",
673
1008
  "role",
@@ -681,7 +1016,7 @@ var SerializedUserField = z11.object({
681
1016
  "primaryOfficeId",
682
1017
  "administrativeAreaId"
683
1018
  ]),
684
- $location: z11.string().optional()
1019
+ $location: z13.string().optional()
685
1020
  });
686
1021
  function userSerializer(userField) {
687
1022
  return {
@@ -704,514 +1039,14 @@ function userSerializer(userField) {
704
1039
  var import_v4 = require("zod/v4");
705
1040
 
706
1041
  // ../commons/src/events/EventMetadata.ts
707
- var z17 = __toESM(require("zod/v4"));
1042
+ var z16 = __toESM(require("zod/v4"));
708
1043
 
709
1044
  // ../commons/src/events/ActionDocument.ts
710
- var z15 = __toESM(require("zod/v4"));
711
-
712
- // ../commons/src/authentication.ts
713
- var import_jwt_decode = __toESM(require("jwt-decode"));
714
1045
  var z14 = __toESM(require("zod/v4"));
715
-
716
- // ../commons/src/scopes.ts
717
- var z13 = __toESM(require("zod/v4"));
718
- var qs = __toESM(require("qs"));
719
-
720
- // ../commons/src/scopes.deprecated.do-not-use.ts
721
- var z12 = __toESM(require("zod/v4"));
722
- var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
723
- var rawConfigurableScope = z12.string().regex(rawConfigurableScopeRegex);
724
- var SearchScope = z12.object({
725
- type: z12.literal("search"),
726
- options: z12.object({
727
- event: z12.array(z12.string()).length(1),
728
- access: z12.array(z12.enum(["my-jurisdiction", "all"])).length(1)
729
- })
730
- });
731
- var CreateUserScope = z12.object({
732
- type: z12.literal("user.create"),
733
- options: z12.object({
734
- role: z12.array(z12.string())
735
- })
736
- });
737
- var EditUserScope = z12.object({
738
- type: z12.literal("user.edit"),
739
- options: z12.object({
740
- role: z12.array(z12.string())
741
- })
742
- });
743
- var WorkqueueScope = z12.object({
744
- type: z12.literal("workqueue"),
745
- options: z12.object({
746
- id: z12.array(z12.string())
747
- })
748
- });
749
- var PrintCertifiedCopiesScope = z12.object({
750
- type: z12.literal("record.registered.print-certified-copies"),
751
- options: z12.object({
752
- event: z12.array(z12.string()).describe("Event type, e.g. birth, death"),
753
- templates: z12.array(z12.string()).optional().describe(
754
- "Template IDs for certified copies. If not provided, all templates will be used."
755
- )
756
- })
757
- });
758
- var LegacyRecordScope = z12.object({
759
- type: z12.enum([
760
- "record.create",
761
- "record.read",
762
- "record.declare",
763
- "record.notify",
764
- "record.declared.edit",
765
- "record.declared.validate",
766
- "record.declared.reject",
767
- "record.declared.archive",
768
- "record.declared.review-duplicates",
769
- "record.register",
770
- "record.registered.request-correction",
771
- "record.registered.correct",
772
- "record.unassign-others"
773
- ]),
774
- options: z12.object({
775
- event: z12.array(z12.string()).describe("Event type, e.g. birth, death")
776
- })
777
- }).describe(
778
- "Scopes used to check user's permission to perform actions on a record."
779
- );
780
- var ConfigurableRawScopes = z12.discriminatedUnion("type", [
781
- SearchScope,
782
- LegacyRecordScope,
783
- PrintCertifiedCopiesScope,
784
- CreateUserScope,
785
- EditUserScope,
786
- WorkqueueScope
787
- ]);
788
-
789
- // ../commons/src/scopes.ts
790
- var SCOPES = {
791
- // TODO v1.8 legacy scopes
792
- BYPASSRATELIMIT: "bypassratelimit",
793
- REGISTER: "register",
794
- DEMO: "demo",
795
- CONFIG: "config",
796
- // systems / integrations
797
- WEBHOOK: "webhook",
798
- NATIONALID: "nationalId",
799
- NOTIFICATION_API: "notification-api",
800
- RECORDSEARCH: "recordsearch",
801
- RECORD_IMPORT: "record.import",
802
- RECORD_EXPORT: "record.export",
803
- RECORD_REINDEX: "record.reindex",
804
- INTEGRATION_CREATE: "integration.create",
805
- // declare
806
- RECORD_DECLARE_BIRTH: "record.declare-birth",
807
- RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
808
- RECORD_DECLARE_DEATH: "record.declare-death",
809
- RECORD_DECLARE_DEATH_MY_JURISDICTION: "record.declare-death:my-jurisdiction",
810
- RECORD_DECLARE_MARRIAGE: "record.declare-marriage",
811
- RECORD_DECLARE_MARRIAGE_MY_JURISDICTION: "record.declare-marriage:my-jurisdiction",
812
- RECORD_SUBMIT_INCOMPLETE: "record.declaration-submit-incomplete",
813
- // @todo: should this record be removed from events v2?
814
- RECORD_SUBMIT_FOR_REVIEW: "record.declaration-submit-for-review",
815
- RECORD_UNASSIGN_OTHERS: "record.unassign-others",
816
- // validate
817
- RECORD_SUBMIT_FOR_APPROVAL: "record.declaration-submit-for-approval",
818
- RECORD_SUBMIT_FOR_UPDATES: "record.declaration-submit-for-updates",
819
- RECORD_DECLARATION_EDIT: "record.declaration-edit",
820
- RECORD_REVIEW_DUPLICATES: "record.review-duplicates",
821
- RECORD_DECLARATION_ARCHIVE: "record.declaration-archive",
822
- RECORD_DECLARATION_REINSTATE: "record.declaration-reinstate",
823
- // register
824
- RECORD_REGISTER: "record.register",
825
- /**
826
- * This scope is used to **print and **issue certified copies of a record
827
- * after it has been registered. Previously Registrars had this permission.
828
- */
829
- RECORD_PRINT_ISSUE_CERTIFIED_COPIES: "record.registration-print&issue-certified-copies",
830
- // correct
831
- RECORD_REGISTRATION_REQUEST_CORRECTION: "record.registration-request-correction",
832
- RECORD_REGISTRATION_CORRECT: "record.registration-correct",
833
- RECORD_CONFIRM_REGISTRATION: "record.confirm-registration",
834
- RECORD_REJECT_REGISTRATION: "record.reject-registration",
835
- // search
836
- SEARCH_BIRTH_MY_JURISDICTION: "search.birth:my-jurisdiction",
837
- SEARCH_BIRTH: "search.birth",
838
- SEARCH_DEATH_MY_JURISDICTION: "search.death:my-jurisdiction",
839
- SEARCH_DEATH: "search.death",
840
- SEARCH_MARRIAGE_MY_JURISDICTION: "search.marriage:my-jurisdiction",
841
- SEARCH_MARRIAGE: "search.marriage",
842
- // audit v1.8
843
- RECORD_READ: "record.read",
844
- // profile
845
- PROFILE_ELECTRONIC_SIGNATURE: "profile.electronic-signature",
846
- // performance
847
- PERFORMANCE_READ: "performance.read",
848
- PERFORMANCE_READ_DASHBOARDS: "performance.read-dashboards",
849
- PERFORMANCE_EXPORT_VITAL_STATISTICS: "performance.vital-statistics-export",
850
- // organisation
851
- ORGANISATION_READ_LOCATIONS: "organisation.read-locations:all",
852
- ORGANISATION_READ_LOCATIONS_MY_OFFICE: "organisation.read-locations:my-office",
853
- ORGANISATION_READ_LOCATIONS_MY_JURISDICTION: "organisation.read-locations:my-jurisdiction",
854
- // user
855
- USER_READ: "user.read:all",
856
- USER_READ_MY_OFFICE: "user.read:my-office",
857
- USER_READ_MY_JURISDICTION: "user.read:my-jurisdiction",
858
- USER_READ_ONLY_MY_AUDIT: "user.read:only-my-audit",
859
- //v1.8
860
- USER_CREATE: "user.create:all",
861
- USER_CREATE_MY_JURISDICTION: "user.create:my-jurisdiction",
862
- USER_UPDATE: "user.update:all",
863
- USER_UPDATE_MY_JURISDICTION: "user.update:my-jurisdiction",
864
- // config
865
- CONFIG_UPDATE_ALL: "config.update:all",
866
- // data seeding
867
- USER_DATA_SEEDING: "user.data-seeding",
868
- // attachment
869
- ATTACHMENT_UPLOAD: "attachment.upload"
870
- };
871
- var LegacyScopes = z13.union([
872
- z13.literal(SCOPES.BYPASSRATELIMIT),
873
- z13.literal(SCOPES.REGISTER),
874
- z13.literal(SCOPES.DEMO),
875
- z13.literal(SCOPES.CONFIG)
876
- ]);
877
- var IntegrationScopes = z13.union([
878
- z13.literal(SCOPES.WEBHOOK),
879
- z13.literal(SCOPES.NATIONALID),
880
- z13.literal(SCOPES.NOTIFICATION_API),
881
- z13.literal(SCOPES.RECORDSEARCH),
882
- z13.literal(SCOPES.INTEGRATION_CREATE)
883
- ]);
884
- var InternalOperationsScopes = z13.union([
885
- z13.literal(SCOPES.RECORD_REINDEX),
886
- z13.literal(SCOPES.RECORD_IMPORT)
887
- ]);
888
- var PerformanceScopes = z13.union([
889
- z13.literal(SCOPES.PERFORMANCE_READ),
890
- z13.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
891
- z13.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
892
- ]);
893
- var OrganisationScopes = z13.union([
894
- z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
895
- z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
896
- z13.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
897
- ]);
898
- var UserScopes = z13.union([
899
- z13.literal(SCOPES.USER_READ),
900
- z13.literal(SCOPES.USER_READ_MY_OFFICE),
901
- z13.literal(SCOPES.USER_READ_MY_JURISDICTION),
902
- z13.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
903
- z13.literal(SCOPES.USER_CREATE),
904
- z13.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
905
- z13.literal(SCOPES.USER_UPDATE),
906
- z13.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
907
- ]);
908
- var ConfigScope = z13.literal(SCOPES.CONFIG_UPDATE_ALL);
909
- var DataSeedingScope = z13.literal(SCOPES.USER_DATA_SEEDING);
910
- var AttachmentScope = z13.literal(SCOPES.ATTACHMENT_UPLOAD);
911
- var LiteralScopes = z13.union([
912
- LegacyScopes,
913
- IntegrationScopes,
914
- z13.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
915
- z13.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
916
- PerformanceScopes,
917
- OrganisationScopes,
918
- UserScopes,
919
- ConfigScope,
920
- DataSeedingScope,
921
- InternalOperationsScopes,
922
- AttachmentScope
923
- ]);
924
- var JurisdictionFilter = z13.enum(["administrativeArea", "location", "all"]).describe(
925
- "Filters based on user jurisdiction relative to their office location in hierarchy."
926
- );
927
- var UserFilter = z13.enum(["user"]).describe("Filters based on the user. Limits to self.");
928
- var RecordScopeTypeV2 = z13.enum([
929
- "record.search",
930
- "record.create",
931
- "record.read",
932
- "record.declare",
933
- "record.notify",
934
- "record.edit",
935
- "record.reject",
936
- "record.archive",
937
- "record.review-duplicates",
938
- "record.register",
939
- "record.print-certified-copies",
940
- "record.request-correction",
941
- "record.correct",
942
- "record.unassign-others",
943
- "record.custom-action"
944
- ]);
945
- var scopeByEvent = z13.preprocess(
946
- (val) => val === void 0 ? void 0 : [val].flat(),
947
- z13.array(z13.string()).optional()
948
- ).describe("Event type, e.g. birth, death");
949
- var scopeOptionsPlaceEvent = z13.object({
950
- event: scopeByEvent,
951
- placeOfEvent: JurisdictionFilter.optional()
952
- }).describe("Options applicable to all record scopes.");
953
- var scopeOptionsDeclared = scopeOptionsPlaceEvent.extend({
954
- declaredIn: JurisdictionFilter.optional(),
955
- declaredBy: UserFilter.optional()
956
- }).describe("Options applicable to actions that may take place after DECLARE");
957
- var ScopeOptionsFull = scopeOptionsDeclared.extend({
958
- registeredIn: JurisdictionFilter.optional(),
959
- registeredBy: UserFilter.optional()
960
- }).describe(
961
- "Options applicable to actions that may take place after REGISTER, with full filtering capabilities."
962
- );
963
- var CustomActionScopeOptions = ScopeOptionsFull.extend({
964
- customActionTypes: z13.preprocess(
965
- (val) => val === void 0 ? void 0 : [val].flat(),
966
- z13.array(z13.string()).optional()
967
- ).describe("Allowed custom action types")
968
- });
969
- var ScopeOptionKey = ScopeOptionsFull.keyof();
970
- var ResolvedScopeOptionsPlaceEvent = z13.object({
971
- event: scopeByEvent,
972
- placeOfEvent: UUID.nullish()
973
- }).describe(
974
- "Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
975
- );
976
- var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
977
- declaredIn: UUID.nullish(),
978
- declaredBy: z13.string().optional()
979
- }).describe(
980
- "Resolved options applicable to actions that may take place after DECLARE, with location ID and user ID instead of filters."
981
- );
982
- var ResolvedScopeOptionsFull = ResolvedScopeOptionsDeclared.extend({
983
- registeredIn: UUID.nullish(),
984
- registeredBy: z13.string().optional()
985
- }).describe(
986
- "Resolved options applicable to actions that may take place after REGISTER, with full filtering capabilities and location/user IDs instead of filters."
987
- );
988
- var ScopesWithPlaceEventOptions = RecordScopeTypeV2.extract([
989
- "record.create",
990
- "record.declare",
991
- "record.notify"
992
- ]);
993
- var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
994
- "record.edit",
995
- "record.reject",
996
- "record.archive",
997
- "record.review-duplicates",
998
- "record.register"
999
- ]);
1000
- var ScopesWithFullOptions = RecordScopeTypeV2.extract([
1001
- "record.search",
1002
- "record.read",
1003
- "record.request-correction",
1004
- "record.correct",
1005
- "record.unassign-others"
1006
- ]);
1007
- var ScopeOptionsPrintCertifiedCopies = ScopeOptionsFull.extend({
1008
- templates: z13.preprocess(
1009
- (val) => val === void 0 ? void 0 : [val].flat(),
1010
- z13.array(z13.string()).optional()
1011
- ).describe(
1012
- "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."
1013
- )
1014
- });
1015
- var RecordScopeV2 = z13.discriminatedUnion("type", [
1016
- z13.object({
1017
- type: ScopesWithPlaceEventOptions,
1018
- options: scopeOptionsPlaceEvent.optional()
1019
- }),
1020
- z13.object({
1021
- type: ScopesWithDeclaredOptions,
1022
- options: scopeOptionsDeclared.optional()
1023
- }),
1024
- z13.object({
1025
- type: ScopesWithFullOptions,
1026
- options: ScopeOptionsFull.optional()
1027
- }),
1028
- z13.object({
1029
- type: z13.literal("record.custom-action"),
1030
- options: CustomActionScopeOptions.optional()
1031
- }),
1032
- z13.object({
1033
- type: z13.literal("record.print-certified-copies"),
1034
- options: ScopeOptionsPrintCertifiedCopies.optional()
1035
- })
1036
- ]).describe(
1037
- "Scopes used to check user's permission to perform actions on a record."
1038
- );
1039
- var ResolvedRecordScopeV2 = z13.discriminatedUnion("type", [
1040
- z13.object({
1041
- type: ScopesWithPlaceEventOptions,
1042
- options: ResolvedScopeOptionsPlaceEvent.optional()
1043
- }),
1044
- z13.object({
1045
- type: ScopesWithDeclaredOptions,
1046
- options: ResolvedScopeOptionsDeclared.optional()
1047
- }),
1048
- z13.object({
1049
- type: ScopesWithFullOptions,
1050
- options: ResolvedScopeOptionsFull.optional()
1051
- }),
1052
- z13.object({
1053
- type: z13.literal("record.print-certified-copies"),
1054
- options: ResolvedScopeOptionsFull.extend({
1055
- templates: z13.array(z13.string()).optional()
1056
- }).optional()
1057
- })
1058
- ]).describe("Resolved scope with location/user IDs instead of filters.");
1059
- var flattenScope = (scope) => ({
1060
- type: scope.type,
1061
- ...scope.options
1062
- });
1063
- var encodeScope = (scope) => {
1064
- const flattened = flattenScope(scope);
1065
- return qs.stringify(flattened, {
1066
- arrayFormat: "comma",
1067
- allowDots: true,
1068
- addQueryPrefix: false,
1069
- encode: false
1070
- });
1071
- };
1072
- var DEFAULT_SCOPE_OPTIONS = {
1073
- placeOfEvent: JurisdictionFilter.enum.all
1074
- };
1075
-
1076
- // ../commons/src/authentication.ts
1077
- var DEFAULT_ROLES_DEFINITION = [
1078
- {
1079
- id: "FIELD_AGENT",
1080
- label: {
1081
- defaultMessage: "Field Agent",
1082
- description: "Name for user role Field Agent",
1083
- id: "userRole.fieldAgent"
1084
- },
1085
- scopes: [
1086
- encodeScope({
1087
- type: "record.create",
1088
- options: {
1089
- event: ["birth", "death", "tennis-club-membership"]
1090
- }
1091
- }),
1092
- encodeScope({
1093
- type: "record.declare",
1094
- options: {
1095
- event: ["birth", "death", "tennis-club-membership"]
1096
- }
1097
- })
1098
- ]
1099
- },
1100
- {
1101
- id: "REGISTRATION_AGENT",
1102
- label: {
1103
- defaultMessage: "Registration Agent",
1104
- description: "Name for user role Registration Agent",
1105
- id: "userRole.registrationAgent"
1106
- },
1107
- scopes: [
1108
- encodeScope({
1109
- type: "record.create",
1110
- options: {
1111
- event: ["birth", "death", "tennis-club-membership"]
1112
- }
1113
- }),
1114
- encodeScope({
1115
- type: "record.declare",
1116
- options: {
1117
- event: ["birth", "death", "tennis-club-membership"]
1118
- }
1119
- }),
1120
- SCOPES.PERFORMANCE_READ,
1121
- SCOPES.PERFORMANCE_READ_DASHBOARDS,
1122
- SCOPES.ORGANISATION_READ_LOCATIONS,
1123
- SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE
1124
- ]
1125
- },
1126
- {
1127
- id: "LOCAL_REGISTRAR",
1128
- label: {
1129
- defaultMessage: "Local Registrar",
1130
- description: "Name for user role Local Registrar",
1131
- id: "userRole.localRegistrar"
1132
- },
1133
- scopes: [
1134
- encodeScope({
1135
- type: "record.create",
1136
- options: {
1137
- event: ["birth", "death", "tennis-club-membership"]
1138
- }
1139
- }),
1140
- encodeScope({
1141
- type: "record.declare",
1142
- options: {
1143
- event: ["birth", "death", "tennis-club-membership"]
1144
- }
1145
- }),
1146
- encodeScope({
1147
- type: "record.review-duplicates",
1148
- options: {
1149
- event: ["birth", "death", "tennis-club-membership"]
1150
- }
1151
- }),
1152
- SCOPES.PERFORMANCE_READ,
1153
- SCOPES.PERFORMANCE_READ_DASHBOARDS,
1154
- SCOPES.ORGANISATION_READ_LOCATIONS,
1155
- SCOPES.PROFILE_ELECTRONIC_SIGNATURE,
1156
- SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE
1157
- ]
1158
- },
1159
- {
1160
- id: "LOCAL_SYSTEM_ADMIN",
1161
- label: {
1162
- defaultMessage: "Local System Admin",
1163
- description: "Name for user role Local System Admin",
1164
- id: "userRole.localSystemAdmin"
1165
- },
1166
- scopes: [
1167
- SCOPES.USER_READ_MY_OFFICE,
1168
- SCOPES.USER_CREATE_MY_JURISDICTION,
1169
- SCOPES.USER_UPDATE_MY_JURISDICTION,
1170
- SCOPES.ORGANISATION_READ_LOCATIONS,
1171
- SCOPES.PERFORMANCE_READ,
1172
- SCOPES.PERFORMANCE_READ_DASHBOARDS,
1173
- SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
1174
- ]
1175
- },
1176
- {
1177
- id: "NATIONAL_SYSTEM_ADMIN",
1178
- label: {
1179
- defaultMessage: "National System Admin",
1180
- description: "Name for user role National System Admin",
1181
- id: "userRole.nationalSystemAdmin"
1182
- },
1183
- scopes: [
1184
- SCOPES.USER_CREATE,
1185
- SCOPES.USER_READ,
1186
- SCOPES.USER_UPDATE,
1187
- SCOPES.ORGANISATION_READ_LOCATIONS,
1188
- SCOPES.PERFORMANCE_READ,
1189
- SCOPES.PERFORMANCE_READ_DASHBOARDS,
1190
- SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
1191
- ]
1192
- },
1193
- {
1194
- id: "PERFORMANCE_MANAGER",
1195
- label: {
1196
- defaultMessage: "Performance Manager",
1197
- description: "Name for user role Performance Manager",
1198
- id: "userRole.performanceManager"
1199
- },
1200
- scopes: [
1201
- SCOPES.PERFORMANCE_READ,
1202
- SCOPES.PERFORMANCE_READ_DASHBOARDS,
1203
- SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS
1204
- ]
1205
- }
1206
- ];
1207
- var TokenUserType = z14.enum(["user", "system"]);
1208
- var TokenWithBearer = z14.string().regex(/^Bearer\s/);
1209
-
1210
- // ../commons/src/events/ActionDocument.ts
1211
- var ActionUpdate = z15.record(z15.string(), FieldUpdateValue).describe(
1046
+ var ActionUpdate = z14.record(z14.string(), FieldUpdateValue).describe(
1212
1047
  "Record of field-level changes made by an action. Supports partial updates and nullable values."
1213
1048
  );
1214
- var EventState = z15.record(z15.string(), FieldValue).describe(
1049
+ var EventState = z14.record(z14.string(), FieldValue).describe(
1215
1050
  "Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
1216
1051
  );
1217
1052
  var ActionStatus = {
@@ -1219,15 +1054,15 @@ var ActionStatus = {
1219
1054
  Accepted: "Accepted",
1220
1055
  Rejected: "Rejected"
1221
1056
  };
1222
- var ActionBase = z15.object({
1057
+ var ActionBase = z14.object({
1223
1058
  id: UUID.describe("Unique identifier of the action."),
1224
- transactionId: z15.string().describe("Unique identifier of the transaction."),
1059
+ transactionId: z14.string().describe("Unique identifier of the transaction."),
1225
1060
  createdByUserType: TokenUserType.describe(
1226
1061
  "Indicates whether the action was created by a human-user or by a system-user."
1227
1062
  ),
1228
- createdAt: z15.string().datetime().describe("Timestamp indicating when the action was created."),
1229
- createdBy: z15.string().describe("Identifier of the user who created the action."),
1230
- createdByRole: z15.string().optional().describe("Role of the user who created the action."),
1063
+ createdAt: z14.string().datetime().describe("Timestamp indicating when the action was created."),
1064
+ createdBy: z14.string().describe("Identifier of the user who created the action."),
1065
+ createdByRole: z14.string().optional().describe("Role of the user who created the action."),
1231
1066
  createdBySignature: DocumentPath.nullish().describe(
1232
1067
  "Reference to the signature of the user who created the action."
1233
1068
  ),
@@ -1239,7 +1074,7 @@ var ActionBase = z15.object({
1239
1074
  "Declaration data defined by the ActionConfig. Supports partial updates."
1240
1075
  ),
1241
1076
  annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
1242
- status: z15.enum([
1077
+ status: z14.enum([
1243
1078
  ActionStatus.Requested,
1244
1079
  ActionStatus.Accepted,
1245
1080
  ActionStatus.Rejected
@@ -1251,132 +1086,132 @@ var ActionBase = z15.object({
1251
1086
  )
1252
1087
  });
1253
1088
  var AssignedAction = ActionBase.extend(
1254
- z15.object({
1255
- type: z15.literal(ActionType.ASSIGN),
1256
- assignedTo: z15.string().describe("Identifier of the user to whom the action is assigned.")
1089
+ z14.object({
1090
+ type: z14.literal(ActionType.ASSIGN),
1091
+ assignedTo: z14.string().describe("Identifier of the user to whom the action is assigned.")
1257
1092
  // TODO move into 'content' property
1258
1093
  }).shape
1259
1094
  );
1260
1095
  var UnassignedAction = ActionBase.extend(
1261
- z15.object({
1262
- type: z15.literal(ActionType.UNASSIGN)
1096
+ z14.object({
1097
+ type: z14.literal(ActionType.UNASSIGN)
1263
1098
  }).shape
1264
1099
  );
1265
1100
  var RegisterAction = ActionBase.extend(
1266
- z15.object({
1267
- type: z15.literal(ActionType.REGISTER),
1268
- registrationNumber: z15.string().optional().describe(
1101
+ z14.object({
1102
+ type: z14.literal(ActionType.REGISTER),
1103
+ registrationNumber: z14.string().optional().describe(
1269
1104
  "Registration number of the event. Always present for accepted registrations."
1270
1105
  )
1271
1106
  // TODO move into 'content' property
1272
1107
  }).shape
1273
1108
  );
1274
1109
  var DeclareAction = ActionBase.extend(
1275
- z15.object({
1276
- type: z15.literal(ActionType.DECLARE)
1110
+ z14.object({
1111
+ type: z14.literal(ActionType.DECLARE)
1277
1112
  }).shape
1278
1113
  );
1279
- var ReasonContent = z15.object({
1280
- reason: z15.string().min(1, { error: "Message cannot be empty" }).describe(
1114
+ var ReasonContent = z14.object({
1115
+ reason: z14.string().min(1, { error: "Message cannot be empty" }).describe(
1281
1116
  "Message describing the reason for rejecting or archiving the event."
1282
1117
  )
1283
1118
  });
1284
1119
  var RejectAction = ActionBase.extend(
1285
- z15.object({
1286
- type: z15.literal(ActionType.REJECT),
1120
+ z14.object({
1121
+ type: z14.literal(ActionType.REJECT),
1287
1122
  content: ReasonContent
1288
1123
  }).shape
1289
1124
  );
1290
- var PotentialDuplicate = z15.object({
1125
+ var PotentialDuplicate = z14.object({
1291
1126
  id: UUID,
1292
- trackingId: z15.string()
1127
+ trackingId: z14.string()
1293
1128
  });
1294
1129
  var DuplicateDetectedAction = ActionBase.extend(
1295
- z15.object({
1296
- type: z15.literal(ActionType.DUPLICATE_DETECTED),
1297
- content: z15.object({
1298
- duplicates: z15.array(PotentialDuplicate)
1130
+ z14.object({
1131
+ type: z14.literal(ActionType.DUPLICATE_DETECTED),
1132
+ content: z14.object({
1133
+ duplicates: z14.array(PotentialDuplicate)
1299
1134
  })
1300
1135
  }).shape
1301
1136
  );
1302
1137
  var MarkNotDuplicateAction = ActionBase.extend(
1303
- z15.object({
1304
- type: z15.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1138
+ z14.object({
1139
+ type: z14.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1305
1140
  }).shape
1306
1141
  );
1307
1142
  var MarkAsDuplicateAction = ActionBase.extend(
1308
- z15.object({
1309
- type: z15.literal(ActionType.MARK_AS_DUPLICATE),
1310
- content: z15.object({
1143
+ z14.object({
1144
+ type: z14.literal(ActionType.MARK_AS_DUPLICATE),
1145
+ content: z14.object({
1311
1146
  duplicateOf: UUID
1312
1147
  }).optional()
1313
1148
  }).shape
1314
1149
  );
1315
1150
  var ArchiveAction = ActionBase.extend(
1316
- z15.object({
1317
- type: z15.literal(ActionType.ARCHIVE),
1151
+ z14.object({
1152
+ type: z14.literal(ActionType.ARCHIVE),
1318
1153
  content: ReasonContent
1319
1154
  }).shape
1320
1155
  );
1321
1156
  var CreatedAction = ActionBase.extend(
1322
- z15.object({
1323
- type: z15.literal(ActionType.CREATE)
1157
+ z14.object({
1158
+ type: z14.literal(ActionType.CREATE)
1324
1159
  }).shape
1325
1160
  );
1326
1161
  var NotifiedAction = ActionBase.extend(
1327
- z15.object({
1328
- type: z15.literal(ActionType.NOTIFY)
1162
+ z14.object({
1163
+ type: z14.literal(ActionType.NOTIFY)
1329
1164
  }).shape
1330
1165
  );
1331
1166
  var EditAction = ActionBase.extend(
1332
- z15.object({
1333
- type: z15.literal(ActionType.EDIT),
1334
- content: z15.object({
1335
- comment: z15.string().describe("Comment for the edit action.").optional()
1167
+ z14.object({
1168
+ type: z14.literal(ActionType.EDIT),
1169
+ content: z14.object({
1170
+ comment: z14.string().describe("Comment for the edit action.").optional()
1336
1171
  })
1337
1172
  }).shape
1338
1173
  );
1339
- var PrintContent = z15.object({
1340
- templateId: z15.string().optional()
1174
+ var PrintContent = z14.object({
1175
+ templateId: z14.string().optional()
1341
1176
  });
1342
1177
  var PrintCertificateAction = ActionBase.extend(
1343
- z15.object({
1344
- type: z15.literal(ActionType.PRINT_CERTIFICATE),
1178
+ z14.object({
1179
+ type: z14.literal(ActionType.PRINT_CERTIFICATE),
1345
1180
  content: PrintContent.optional().nullable()
1346
1181
  }).shape
1347
1182
  );
1348
1183
  var RequestedCorrectionAction = ActionBase.extend(
1349
- z15.object({
1350
- type: z15.literal(ActionType.REQUEST_CORRECTION)
1184
+ z14.object({
1185
+ type: z14.literal(ActionType.REQUEST_CORRECTION)
1351
1186
  }).shape
1352
1187
  );
1353
1188
  var ApprovedCorrectionAction = ActionBase.extend(
1354
- z15.object({
1355
- type: z15.literal(ActionType.APPROVE_CORRECTION),
1356
- requestId: z15.string()
1189
+ z14.object({
1190
+ type: z14.literal(ActionType.APPROVE_CORRECTION),
1191
+ requestId: z14.string()
1357
1192
  // TODO move into 'content' property
1358
1193
  }).shape
1359
1194
  );
1360
1195
  var RejectedCorrectionAction = ActionBase.extend(
1361
- z15.object({
1362
- type: z15.literal(ActionType.REJECT_CORRECTION),
1363
- requestId: z15.string(),
1196
+ z14.object({
1197
+ type: z14.literal(ActionType.REJECT_CORRECTION),
1198
+ requestId: z14.string(),
1364
1199
  // TODO move into 'content' property
1365
1200
  content: ReasonContent
1366
1201
  }).shape
1367
1202
  );
1368
1203
  var ReadAction = ActionBase.extend(
1369
- z15.object({
1370
- type: z15.literal(ActionType.READ)
1204
+ z14.object({
1205
+ type: z14.literal(ActionType.READ)
1371
1206
  }).shape
1372
1207
  );
1373
1208
  var CustomAction = ActionBase.merge(
1374
- z15.object({
1375
- type: z15.literal(ActionType.CUSTOM),
1376
- customActionType: z15.string()
1209
+ z14.object({
1210
+ type: z14.literal(ActionType.CUSTOM),
1211
+ customActionType: z14.string()
1377
1212
  })
1378
1213
  );
1379
- var ActionDocument = z15.discriminatedUnion("type", [
1214
+ var ActionDocument = z14.discriminatedUnion("type", [
1380
1215
  CreatedAction.meta({ id: "CreatedAction" }),
1381
1216
  RejectAction.meta({ id: "RejectAction" }),
1382
1217
  DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
@@ -1402,15 +1237,15 @@ var AsyncRejectActionDocument = ActionBase.omit({
1402
1237
  declaration: true,
1403
1238
  annotation: true
1404
1239
  }).extend(
1405
- z15.object({
1406
- type: z15.enum(ConfirmableActions),
1407
- status: z15.literal(ActionStatus.Rejected)
1240
+ z14.object({
1241
+ type: z14.enum(ConfirmableActions),
1242
+ status: z14.literal(ActionStatus.Rejected)
1408
1243
  }).shape
1409
1244
  );
1410
- var Action = z15.union([ActionDocument, AsyncRejectActionDocument]);
1245
+ var Action = z14.union([ActionDocument, AsyncRejectActionDocument]);
1411
1246
 
1412
1247
  // ../commons/src/events/Flag.ts
1413
- var z16 = __toESM(require("zod/v4"));
1248
+ var z15 = __toESM(require("zod/v4"));
1414
1249
  var InherentFlags = {
1415
1250
  INCOMPLETE: "incomplete",
1416
1251
  REJECTED: "rejected",
@@ -1424,7 +1259,7 @@ var InherentFlags = {
1424
1259
  */
1425
1260
  EDIT_IN_PROGRESS: "edit-in-progress"
1426
1261
  };
1427
- var ActionFlag = z16.string().regex(
1262
+ var ActionFlag = z15.string().regex(
1428
1263
  new RegExp(
1429
1264
  `^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
1430
1265
  ActionStatus
@@ -1432,73 +1267,73 @@ var ActionFlag = z16.string().regex(
1432
1267
  ),
1433
1268
  "Flag must be in the format ActionType:ActionStatus (lowerCase)"
1434
1269
  );
1435
- var CustomFlag = z16.string().refine((val) => !Object.values(InherentFlags).includes(val), {
1270
+ var CustomFlag = z15.string().refine((val) => !Object.values(InherentFlags).includes(val), {
1436
1271
  message: `Custom flag cannot be one of the inherent flags: ${Object.values(
1437
1272
  InherentFlags
1438
1273
  ).join(", ")}`
1439
1274
  }).refine((val) => !ActionFlag.safeParse(val).success, {
1440
1275
  message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
1441
1276
  }).describe("Custom flag identifier defined by the country config.");
1442
- var Flag = ActionFlag.or(z16.enum(InherentFlags)).or(CustomFlag);
1443
- var FlagConfig = z16.object({
1277
+ var Flag = ActionFlag.or(z15.enum(InherentFlags)).or(CustomFlag);
1278
+ var FlagConfig = z15.object({
1444
1279
  id: CustomFlag,
1445
- requiresAction: z16.boolean().describe(
1280
+ requiresAction: z15.boolean().describe(
1446
1281
  "Indicates if this flag expects an action to be performed to be cleared."
1447
1282
  ),
1448
1283
  label: TranslationConfig.describe("Human readable label of the flag.")
1449
1284
  });
1450
- var ActionFlagConfig = z16.object({
1285
+ var ActionFlagConfig = z15.object({
1451
1286
  id: Flag,
1452
- operation: z16.enum(["add", "remove"]).describe("Operation to perform on the flag."),
1287
+ operation: z15.enum(["add", "remove"]).describe("Operation to perform on the flag."),
1453
1288
  conditional: Conditional.optional().describe(
1454
1289
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1455
1290
  )
1456
1291
  });
1457
1292
 
1458
1293
  // ../commons/src/events/EventMetadata.ts
1459
- var EventStatus = z17.enum([
1294
+ var EventStatus = z16.enum([
1460
1295
  "CREATED",
1461
1296
  "NOTIFIED",
1462
1297
  "DECLARED",
1463
1298
  "REGISTERED",
1464
1299
  "ARCHIVED"
1465
1300
  ]);
1466
- var ZodDate = z17.iso.date();
1467
- var ZodDateTime = z17.string().datetime();
1468
- var ActionCreationMetadata = z17.object({
1469
- createdAt: z17.iso.datetime().describe("The timestamp when the action request was created."),
1470
- createdBy: z17.string().describe("ID of the user who created the action request."),
1301
+ var ZodDate = z16.iso.date();
1302
+ var ZodDateTime = z16.string().datetime();
1303
+ var ActionCreationMetadata = z16.object({
1304
+ createdAt: z16.iso.datetime().describe("The timestamp when the action request was created."),
1305
+ createdBy: z16.string().describe("ID of the user who created the action request."),
1471
1306
  // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1472
1307
  createdAtLocation: UUID.nullish().describe(
1473
1308
  "Location of the user who created the action request."
1474
1309
  ),
1475
- createdByUserType: z17.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1476
- acceptedAt: z17.iso.datetime().describe("Timestamp when the action request was accepted."),
1477
- createdByRole: z17.string().optional().describe("Role of the user at the time of action request creation."),
1478
- createdBySignature: z17.string().nullish().describe("Signature of the user who created the action request.")
1310
+ createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1311
+ acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
1312
+ createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation."),
1313
+ createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
1479
1314
  });
1480
1315
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1481
- registrationNumber: z17.string().describe(
1316
+ registrationNumber: z16.string().describe(
1482
1317
  "Registration number of the event. Always present for accepted registrations."
1483
1318
  )
1484
1319
  });
1485
- var LegalStatuses = z17.object({
1320
+ var LegalStatuses = z16.object({
1486
1321
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
1487
1322
  [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
1488
1323
  });
1489
- var EventMetadata = z17.object({
1324
+ var EventMetadata = z16.object({
1490
1325
  id: UUID,
1491
- type: z17.string().describe("The type of event, such as birth, death, or marriage."),
1326
+ type: z16.string().describe("The type of event, such as birth, death, or marriage."),
1492
1327
  status: EventStatus,
1493
1328
  legalStatuses: LegalStatuses.describe(
1494
1329
  "Metadata related to the legal registration of the event, such as who registered it and when."
1495
1330
  ),
1496
- createdAt: z17.iso.datetime().describe("The timestamp when the event was first created and saved."),
1331
+ createdAt: z16.iso.datetime().describe("The timestamp when the event was first created and saved."),
1497
1332
  dateOfEvent: ZodDate.nullish(),
1498
1333
  placeOfEvent: UUID.nullish(),
1499
- createdBy: z17.string().describe("ID of the user who created the event."),
1500
- createdByUserType: z17.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1501
- updatedByUserRole: z17.string().nullish().describe("Role of the user who last changed the status."),
1334
+ createdBy: z16.string().describe("ID of the user who created the event."),
1335
+ createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1336
+ updatedByUserRole: z16.string().nullish().describe("Role of the user who last changed the status."),
1502
1337
  // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1503
1338
  createdAtLocation: UUID.nullish().describe(
1504
1339
  "Location of the user who created the event."
@@ -1509,18 +1344,18 @@ var EventMetadata = z17.object({
1509
1344
  updatedAtLocation: UUID.nullish().describe(
1510
1345
  "Location of the user who last changed the status."
1511
1346
  ),
1512
- updatedAt: z17.iso.datetime().describe(
1347
+ updatedAt: z16.iso.datetime().describe(
1513
1348
  "Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
1514
1349
  ),
1515
- assignedTo: z17.string().nullish().describe("ID of the user currently assigned to the event."),
1516
- updatedBy: z17.string().nullish().describe("ID of the user who last changed the status."),
1517
- trackingId: z17.string().describe(
1350
+ assignedTo: z16.string().nullish().describe("ID of the user currently assigned to the event."),
1351
+ updatedBy: z16.string().nullish().describe("ID of the user who last changed the status."),
1352
+ trackingId: z16.string().describe(
1518
1353
  "System-generated tracking ID used by informants or registrars to look up the event."
1519
1354
  ),
1520
- potentialDuplicates: z17.array(PotentialDuplicate).describe(
1355
+ potentialDuplicates: z16.array(PotentialDuplicate).describe(
1521
1356
  "List of event IDs and their tracking IDs that this event could be a duplicate of."
1522
1357
  ),
1523
- flags: z17.array(Flag)
1358
+ flags: z16.array(Flag)
1524
1359
  });
1525
1360
  var EventMetadataKeysArray = [
1526
1361
  "id",
@@ -1541,8 +1376,8 @@ var EventMetadataKeysArray = [
1541
1376
  "legalStatuses",
1542
1377
  "flags"
1543
1378
  ];
1544
- var EventMetadataKeys = z17.enum(EventMetadataKeysArray);
1545
- var EventMetadataDateFieldIdInput = z17.enum([
1379
+ var EventMetadataKeys = z16.enum(EventMetadataKeysArray);
1380
+ var EventMetadataDateFieldIdInput = z16.enum([
1546
1381
  "createdAt",
1547
1382
  "updatedAt",
1548
1383
  "legalStatuses.DECLARED.createdAt",
@@ -1550,7 +1385,7 @@ var EventMetadataDateFieldIdInput = z17.enum([
1550
1385
  "legalStatuses.REGISTERED.createdAt",
1551
1386
  "legalStatuses.REGISTERED.acceptedAt"
1552
1387
  ]);
1553
- var EventMetadataDateFieldId = z17.enum([
1388
+ var EventMetadataDateFieldId = z16.enum([
1554
1389
  "event.createdAt",
1555
1390
  "event.updatedAt",
1556
1391
  "event.legalStatuses.DECLARED.createdAt",
@@ -1658,8 +1493,8 @@ var QueryExpression = import_v4.z.object({
1658
1493
  "legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
1659
1494
  "legalStatuses.REGISTERED.createdByRole": import_v4.z.optional(AnyOf),
1660
1495
  "legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
1661
- createdAtLocation: import_v4.z.optional(Within),
1662
- updatedAtLocation: import_v4.z.optional(Within),
1496
+ createdAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
1497
+ updatedAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
1663
1498
  assignedTo: import_v4.z.optional(Exact),
1664
1499
  createdByUserType: import_v4.z.optional(ExactUserType),
1665
1500
  updatedByUserRole: import_v4.z.optional(Exact),
@@ -1752,7 +1587,7 @@ function todayDateTimeValueSerializer() {
1752
1587
  // ../commons/src/users/userReferences.ts
1753
1588
  var import_v42 = __toESM(require("zod/v4"));
1754
1589
  var ScopeOptionReference = import_v42.default.object({
1755
- $scope: RecordScopeTypeV2,
1590
+ $scope: ScopeType,
1756
1591
  $option: ScopeOptionKey
1757
1592
  });
1758
1593
  var JurisdictionReference = import_v42.default.object({
@@ -1996,17 +1831,14 @@ var ImageViewField = BaseField.extend({
1996
1831
  }).describe("A read-only image component for form pages");
1997
1832
  var Paragraph = BaseField.extend({
1998
1833
  type: import_v43.default.literal(FieldType.PARAGRAPH),
1999
- defaultValue: NonEmptyTextValue.optional(),
2000
1834
  configuration: ParagraphConfiguration
2001
1835
  }).describe("A read-only HTML <p> paragraph");
2002
1836
  var Heading = BaseField.extend({
2003
1837
  type: import_v43.default.literal(FieldType.HEADING),
2004
- defaultValue: NonEmptyTextValue.optional(),
2005
1838
  configuration: HeadingConfiguration
2006
1839
  }).describe("A read-only heading component for form pages");
2007
1840
  var PageHeader = BaseField.extend({
2008
- type: import_v43.default.literal(FieldType.PAGE_HEADER),
2009
- defaultValue: NonEmptyTextValue.optional()
1841
+ type: import_v43.default.literal(FieldType.PAGE_HEADER)
2010
1842
  }).describe("A read-only header component for form pages");
2011
1843
  var File = BaseField.extend({
2012
1844
  type: import_v43.default.literal(FieldType.FILE),
@@ -2056,7 +1888,6 @@ var RadioGroup = BaseField.extend({
2056
1888
  }).describe("Grouped radio options");
2057
1889
  var BulletList = BaseField.extend({
2058
1890
  type: import_v43.default.literal(FieldType.BULLET_LIST),
2059
- defaultValue: TextValue.optional(),
2060
1891
  items: import_v43.default.array(TranslationConfig).describe("A list of items"),
2061
1892
  configuration: import_v43.default.object({
2062
1893
  styles: import_v43.default.object({
@@ -2162,7 +1993,7 @@ var LocationInput = BaseField.extend({
2162
1993
  configuration: import_v43.default.object({
2163
1994
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
2164
1995
  allowedLocations: AllowedLocations
2165
- })
1996
+ }).optional()
2166
1997
  }).describe("Input field for a location");
2167
1998
  var FileUploadWithOptions = BaseField.extend({
2168
1999
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
@@ -2238,16 +2069,32 @@ var DataField = BaseField.extend({
2238
2069
  data: import_v43.default.array(DataEntry)
2239
2070
  })
2240
2071
  }).describe("Data field for displaying read-only data");
2072
+ var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
2073
+ var ButtonType = import_v43.default.enum([
2074
+ "primary",
2075
+ "secondary",
2076
+ "tertiary",
2077
+ "positive",
2078
+ "negative",
2079
+ "secondaryNegative",
2080
+ "icon",
2081
+ "iconPrimary"
2082
+ ]);
2083
+ var TextColor = import_v43.default.enum(["primary", "copy"]);
2084
+ var TextVariant = import_v43.default.enum(["bold14", "reg14"]);
2085
+ var ButtonConfiguration = import_v43.default.object({
2086
+ icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit."),
2087
+ loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
2088
+ buttonSize: ButtonSize.optional().describe("Size of the button."),
2089
+ buttonType: ButtonType.optional().describe("Type of the button."),
2090
+ textColor: TextColor.optional().describe("Color of the text."),
2091
+ textVariant: TextVariant.optional().describe("Variant of the text."),
2092
+ text: TranslationConfig.describe("Text to display on the button")
2093
+ });
2241
2094
  var ButtonField = BaseField.extend({
2242
2095
  type: import_v43.default.literal(FieldType.BUTTON),
2243
2096
  defaultValue: ButtonFieldValue.optional(),
2244
- configuration: import_v43.default.object({
2245
- icon: import_v43.default.string().optional().describe(
2246
- "Icon for the button. You can find icons from OpenCRVS UI-Kit."
2247
- ),
2248
- loading: import_v43.default.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
2249
- text: TranslationConfig.describe("Text to display on the button")
2250
- })
2097
+ configuration: ButtonConfiguration
2251
2098
  }).describe("Generic button without any built-in functionality");
2252
2099
  var FieldGroup = BaseField.extend({
2253
2100
  type: import_v43.default.literal(FieldType.FIELD_GROUP),
@@ -2279,6 +2126,19 @@ var HttpField = BaseField.extend({
2279
2126
  timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
2280
2127
  })
2281
2128
  }).describe("HTTP request function triggered by a button click or other event");
2129
+ var AutocompleteField = BaseField.extend({
2130
+ type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
2131
+ configuration: import_v43.default.object({
2132
+ url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
2133
+ method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
2134
+ defaultOptions: import_v43.default.array(
2135
+ import_v43.default.object({
2136
+ label: import_v43.default.string(),
2137
+ value: import_v43.default.string()
2138
+ })
2139
+ ).optional()
2140
+ })
2141
+ }).describe("Autocomplete input field");
2282
2142
  var SearchField = HttpField.extend({
2283
2143
  type: import_v43.default.literal(FieldType.SEARCH),
2284
2144
  configuration: SearchQuery.pick({
@@ -2364,8 +2224,11 @@ var CustomField = BaseField.extend({
2364
2224
  src: import_v43.default.string().describe("Module source path for the custom field component"),
2365
2225
  configuration: import_v43.default.unknown().optional()
2366
2226
  });
2227
+ var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
2367
2228
  var LoaderField = BaseField.extend({
2368
2229
  type: import_v43.default.literal(FieldType.LOADER),
2230
+ variant: FieldStyleVariant.default("default").optional(),
2231
+ hideLabel: import_v43.default.boolean().default(true).optional().describe("Loader field does not show a label by default"),
2369
2232
  configuration: import_v43.default.object({
2370
2233
  text: TranslationConfig.describe("Display text above the loading spinner")
2371
2234
  })
@@ -2422,6 +2285,7 @@ var FieldConfig = import_v43.default.discriminatedUnion("type", [
2422
2285
  ButtonField,
2423
2286
  AlphaPrintButton,
2424
2287
  HttpField,
2288
+ AutocompleteField,
2425
2289
  LinkButtonField,
2426
2290
  VerificationStatus,
2427
2291
  QrReaderField,
@@ -2443,18 +2307,18 @@ var AnyFileField = import_v43.default.discriminatedUnion("type", [
2443
2307
  ]);
2444
2308
 
2445
2309
  // ../commons/src/events/FormConfig.ts
2446
- var z23 = __toESM(require("zod/v4"));
2310
+ var z22 = __toESM(require("zod/v4"));
2447
2311
 
2448
2312
  // ../commons/src/events/PageConfig.ts
2449
- var z22 = __toESM(require("zod/v4"));
2450
- var PageTypes = z22.enum(["FORM", "VERIFICATION"]);
2451
- var PageConfigBase = z22.object({
2452
- id: z22.string().describe("Unique identifier for the page"),
2313
+ var z21 = __toESM(require("zod/v4"));
2314
+ var PageTypes = z21.enum(["FORM", "VERIFICATION"]);
2315
+ var PageConfigBase = z21.object({
2316
+ id: z21.string().describe("Unique identifier for the page"),
2453
2317
  title: TranslationConfig.describe("Header title of the page"),
2454
- requireCompletionToContinue: z22.boolean().default(false).describe(
2318
+ requireCompletionToContinue: z21.boolean().default(false).describe(
2455
2319
  "If true, all required fields must be filled before continuing to the next page"
2456
2320
  ),
2457
- fields: z22.array(FieldConfig).describe("Fields to be rendered on the page"),
2321
+ fields: z21.array(FieldConfig).describe("Fields to be rendered on the page"),
2458
2322
  conditional: Conditional.optional().describe(
2459
2323
  "Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
2460
2324
  )
@@ -2463,13 +2327,13 @@ var PageConfigBase = z22.object({
2463
2327
  id: "FormPageConfig"
2464
2328
  });
2465
2329
  var FormPageConfig = PageConfigBase.extend({
2466
- type: z22.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
2330
+ type: z21.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
2467
2331
  });
2468
- var VerificationActionConfig = z22.object({
2469
- verify: z22.object({ label: TranslationConfig }),
2470
- cancel: z22.object({
2332
+ var VerificationActionConfig = z21.object({
2333
+ verify: z21.object({ label: TranslationConfig }),
2334
+ cancel: z21.object({
2471
2335
  label: TranslationConfig,
2472
- confirmation: z22.object({
2336
+ confirmation: z21.object({
2473
2337
  title: TranslationConfig,
2474
2338
  body: TranslationConfig
2475
2339
  })
@@ -2479,31 +2343,31 @@ var VerificationActionConfig = z22.object({
2479
2343
  id: "VerificationActionConfig"
2480
2344
  });
2481
2345
  var VerificationPageConfig = FormPageConfig.extend({
2482
- type: z22.literal(PageTypes.enum.VERIFICATION),
2346
+ type: z21.literal(PageTypes.enum.VERIFICATION),
2483
2347
  actions: VerificationActionConfig
2484
2348
  });
2485
- var PageConfig = z22.discriminatedUnion("type", [
2349
+ var PageConfig = z21.discriminatedUnion("type", [
2486
2350
  FormPageConfig,
2487
2351
  VerificationPageConfig
2488
2352
  ]);
2489
2353
 
2490
2354
  // ../commons/src/events/FormConfig.ts
2491
- var DeclarationFormConfig = z23.object({
2355
+ var DeclarationFormConfig = z22.object({
2492
2356
  label: TranslationConfig.describe("Human readable description of the form"),
2493
- pages: z23.array(FormPageConfig)
2357
+ pages: z22.array(FormPageConfig)
2494
2358
  }).describe("Configuration of the declaration form.");
2495
- var ActionFormConfig = z23.object({
2359
+ var ActionFormConfig = z22.object({
2496
2360
  label: TranslationConfig.describe("Human readable description of the form"),
2497
- pages: z23.array(PageConfig)
2361
+ pages: z22.array(PageConfig)
2498
2362
  }).describe(
2499
2363
  "Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
2500
2364
  );
2501
- var FormConfig = z23.union([DeclarationFormConfig, ActionFormConfig]);
2365
+ var FormConfig = z22.union([DeclarationFormConfig, ActionFormConfig]);
2502
2366
 
2503
2367
  // ../commons/src/events/DeduplicationConfig.ts
2504
- var z24 = __toESM(require("zod/v4"));
2505
- var FieldReference2 = z24.string();
2506
- var Matcher = z24.object({
2368
+ var z23 = __toESM(require("zod/v4"));
2369
+ var FieldReference2 = z23.string();
2370
+ var Matcher = z23.object({
2507
2371
  /**
2508
2372
  * Reference to the field used in matching.
2509
2373
  *
@@ -2511,23 +2375,23 @@ var Matcher = z24.object({
2511
2375
  * be used as the origin date to calculate the distance from.
2512
2376
  */
2513
2377
  fieldId: FieldReference2,
2514
- options: z24.object({
2515
- boost: z24.number().optional(),
2378
+ options: z23.object({
2379
+ boost: z23.number().optional(),
2516
2380
  matchAgainst: FieldReference2.optional()
2517
2381
  }).optional().default({
2518
2382
  boost: 1
2519
2383
  })
2520
2384
  });
2521
2385
  var FuzzyMatcher = Matcher.extend({
2522
- type: z24.literal("fuzzy"),
2523
- options: z24.object({
2386
+ type: z23.literal("fuzzy"),
2387
+ options: z23.object({
2524
2388
  /**
2525
2389
  * Names of length 3 or less characters = 0 edits allowed
2526
2390
  * Names of length 4 - 6 characters = 1 edit allowed
2527
2391
  * Names of length >7 characters = 2 edits allowed
2528
2392
  */
2529
- fuzziness: z24.union([z24.string(), z24.number()]).optional().default("AUTO:4,7"),
2530
- boost: z24.number().optional().default(1),
2393
+ fuzziness: z23.union([z23.string(), z23.number()]).optional().default("AUTO:4,7"),
2394
+ boost: z23.number().optional().default(1),
2531
2395
  matchAgainst: FieldReference2.optional()
2532
2396
  }).optional().default({
2533
2397
  fuzziness: "AUTO:4,7",
@@ -2535,48 +2399,48 @@ var FuzzyMatcher = Matcher.extend({
2535
2399
  })
2536
2400
  });
2537
2401
  var StrictMatcher = Matcher.extend({
2538
- type: z24.literal("strict"),
2539
- options: z24.object({
2540
- boost: z24.number().optional().default(1),
2402
+ type: z23.literal("strict"),
2403
+ options: z23.object({
2404
+ boost: z23.number().optional().default(1),
2541
2405
  /**
2542
2406
  * The constant value to be present in the field for both records
2543
2407
  */
2544
- value: z24.string().optional(),
2408
+ value: z23.string().optional(),
2545
2409
  matchAgainst: FieldReference2.optional()
2546
2410
  }).optional().default({
2547
2411
  boost: 1
2548
2412
  })
2549
2413
  });
2550
2414
  var DateRangeMatcher = Matcher.extend({
2551
- type: z24.literal("dateRange"),
2552
- options: z24.object({
2415
+ type: z23.literal("dateRange"),
2416
+ options: z23.object({
2553
2417
  /**
2554
2418
  * The distance pivot in days. Distance from the origin (the value of
2555
2419
  * fieldId) at which relevance scores receive half of the boost value
2556
2420
  */
2557
- pivot: z24.number().optional(),
2558
- days: z24.number(),
2559
- boost: z24.number().optional().default(1),
2421
+ pivot: z23.number().optional(),
2422
+ days: z23.number(),
2423
+ boost: z23.number().optional().default(1),
2560
2424
  matchAgainst: FieldReference2.optional()
2561
2425
  })
2562
2426
  });
2563
- var Not = z24.object({
2564
- type: z24.literal("not"),
2427
+ var Not = z23.object({
2428
+ type: z23.literal("not"),
2565
2429
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2566
- clause: z24.lazy(() => Clause)
2430
+ clause: z23.lazy(() => Clause)
2567
2431
  });
2568
- var And = z24.object({
2569
- type: z24.literal("and"),
2432
+ var And = z23.object({
2433
+ type: z23.literal("and"),
2570
2434
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2571
- clauses: z24.lazy(() => Clause.array())
2435
+ clauses: z23.lazy(() => Clause.array())
2572
2436
  });
2573
- var Or = z24.object({
2574
- type: z24.literal("or"),
2437
+ var Or = z23.object({
2438
+ type: z23.literal("or"),
2575
2439
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2576
- clauses: z24.lazy(() => Clause.array())
2440
+ clauses: z23.lazy(() => Clause.array())
2577
2441
  });
2578
- var Clause = z24.lazy(
2579
- () => z24.discriminatedUnion("type", [
2442
+ var Clause = z23.lazy(
2443
+ () => z23.discriminatedUnion("type", [
2580
2444
  Not,
2581
2445
  And,
2582
2446
  Or,
@@ -2587,22 +2451,22 @@ var Clause = z24.lazy(
2587
2451
  ).meta({
2588
2452
  id: "Clause"
2589
2453
  });
2590
- var DeduplicationConfig = z24.object({
2591
- id: z24.string(),
2454
+ var DeduplicationConfig = z23.object({
2455
+ id: z23.string(),
2592
2456
  label: TranslationConfig,
2593
2457
  query: Clause
2594
2458
  });
2595
2459
 
2596
2460
  // ../commons/src/events/ActionConfig.ts
2597
- var DeclarationReviewConfig = z25.object({
2461
+ var DeclarationReviewConfig = z24.object({
2598
2462
  title: TranslationConfig.describe("Title of the review page"),
2599
- fields: z25.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
2463
+ fields: z24.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
2600
2464
  }).describe(
2601
2465
  "Configuration of the declaration review page for collecting event-related metadata."
2602
2466
  );
2603
- var ActionConfigBase = z25.object({
2467
+ var ActionConfigBase = z24.object({
2604
2468
  label: TranslationConfig.describe("Human readable description of the action"),
2605
- flags: z25.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
2469
+ flags: z24.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
2606
2470
  supportingCopy: TranslationConfig.optional().describe(
2607
2471
  "Text displayed on the confirmation dialog"
2608
2472
  ),
@@ -2613,28 +2477,28 @@ var ActionConfigBase = z25.object({
2613
2477
  * "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."
2614
2478
  * for EventConfig.d.ts.
2615
2479
  */
2616
- icon: z25.string().describe("Icon representing the action").optional(),
2617
- conditionals: z25.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
2480
+ icon: z24.string().describe("Icon representing the action").optional(),
2481
+ conditionals: z24.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
2618
2482
  });
2619
2483
  var DeclarationActionBase = ActionConfigBase.extend({
2620
2484
  deduplication: DeduplicationConfig.optional()
2621
2485
  });
2622
2486
  var ReadActionConfig = ActionConfigBase.extend(
2623
- z25.object({
2624
- type: z25.literal(ActionType.READ),
2487
+ z24.object({
2488
+ type: z24.literal(ActionType.READ),
2625
2489
  review: DeclarationReviewConfig.describe(
2626
2490
  "Configuration of the review page for read-only view."
2627
2491
  ),
2628
- conditionals: z25.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
2492
+ conditionals: z24.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
2629
2493
  }).shape
2630
2494
  );
2631
2495
  var DeclareConfig = DeclarationActionBase.extend(
2632
- z25.object({
2633
- type: z25.literal(ActionType.DECLARE),
2496
+ z24.object({
2497
+ type: z24.literal(ActionType.DECLARE),
2634
2498
  review: DeclarationReviewConfig.describe(
2635
2499
  "Configuration of the review page fields."
2636
2500
  ),
2637
- dialogCopy: z25.object({
2501
+ dialogCopy: z24.object({
2638
2502
  notify: TranslationConfig.describe(
2639
2503
  "Confirmation text for the notify action"
2640
2504
  ),
@@ -2648,14 +2512,14 @@ var DeclareConfig = DeclarationActionBase.extend(
2648
2512
  }).shape
2649
2513
  );
2650
2514
  var ArchiveConfig = ActionConfigBase.extend(
2651
- z25.object({
2652
- type: z25.literal(ActionType.ARCHIVE)
2515
+ z24.object({
2516
+ type: z24.literal(ActionType.ARCHIVE)
2653
2517
  }).shape
2654
2518
  );
2655
2519
  var EditActionConfig = ActionConfigBase.extend(
2656
- z25.object({
2657
- type: z25.literal(ActionType.EDIT),
2658
- dialogCopy: z25.object({
2520
+ z24.object({
2521
+ type: z24.literal(ActionType.EDIT),
2522
+ dialogCopy: z24.object({
2659
2523
  notify: TranslationConfig.describe(
2660
2524
  "Confirmation text for the notify with edits action"
2661
2525
  ),
@@ -2669,33 +2533,33 @@ var EditActionConfig = ActionConfigBase.extend(
2669
2533
  }).shape
2670
2534
  );
2671
2535
  var RejectConfig = ActionConfigBase.extend(
2672
- z25.object({
2673
- type: z25.literal(ActionType.REJECT)
2536
+ z24.object({
2537
+ type: z24.literal(ActionType.REJECT)
2674
2538
  }).shape
2675
2539
  );
2676
2540
  var RegisterConfig = DeclarationActionBase.extend(
2677
- z25.object({
2678
- type: z25.literal(ActionType.REGISTER)
2541
+ z24.object({
2542
+ type: z24.literal(ActionType.REGISTER)
2679
2543
  }).shape
2680
2544
  );
2681
2545
  var PrintCertificateActionConfig = ActionConfigBase.extend(
2682
- z25.object({
2683
- type: z25.literal(ActionType.PRINT_CERTIFICATE),
2546
+ z24.object({
2547
+ type: z24.literal(ActionType.PRINT_CERTIFICATE),
2684
2548
  printForm: ActionFormConfig
2685
2549
  }).shape
2686
2550
  );
2687
2551
  var RequestCorrectionConfig = ActionConfigBase.extend(
2688
- z25.object({
2689
- type: z25.literal(ActionType.REQUEST_CORRECTION),
2552
+ z24.object({
2553
+ type: z24.literal(ActionType.REQUEST_CORRECTION),
2690
2554
  correctionForm: ActionFormConfig
2691
2555
  }).shape
2692
2556
  );
2693
2557
  var CustomActionConfig = ActionConfigBase.merge(
2694
- z25.object({
2695
- type: z25.literal(ActionType.CUSTOM),
2696
- customActionType: z25.string().describe("Type identifier of the custom action."),
2558
+ z24.object({
2559
+ type: z24.literal(ActionType.CUSTOM),
2560
+ customActionType: z24.string().describe("Type identifier of the custom action."),
2697
2561
  /** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
2698
- form: z25.array(FieldConfig).describe(
2562
+ form: z24.array(FieldConfig).describe(
2699
2563
  "Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
2700
2564
  ),
2701
2565
  auditHistoryLabel: TranslationConfig.describe(
@@ -2703,7 +2567,7 @@ var CustomActionConfig = ActionConfigBase.merge(
2703
2567
  )
2704
2568
  })
2705
2569
  );
2706
- var ActionConfig = z25.discriminatedUnion("type", [
2570
+ var ActionConfig = z24.discriminatedUnion("type", [
2707
2571
  /*
2708
2572
  * OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
2709
2573
  * and treat them as "models" instead of duplicating the data structure in each endpoint.
@@ -2725,86 +2589,86 @@ var ActionConfig = z25.discriminatedUnion("type", [
2725
2589
  var actionConfigTypes = new Set(
2726
2590
  ActionConfig.options.map((opt) => opt.shape.type.value)
2727
2591
  );
2728
- var DeclarationActionConfig = z25.discriminatedUnion("type", [
2592
+ var DeclarationActionConfig = z24.discriminatedUnion("type", [
2729
2593
  DeclareConfig,
2730
2594
  RegisterConfig
2731
2595
  ]);
2732
2596
 
2733
2597
  // ../commons/src/events/offline/CertificateConfig.ts
2734
- var z26 = __toESM(require("zod/v4"));
2735
- var FontFamily = z26.object({
2736
- normal: z26.string(),
2737
- bold: z26.string(),
2738
- italics: z26.string(),
2739
- bolditalics: z26.string()
2740
- });
2741
- var CertificateConfig = z26.object({
2742
- id: z26.string(),
2743
- event: z26.string(),
2744
- isV2Template: z26.boolean().optional(),
2598
+ var z25 = __toESM(require("zod/v4"));
2599
+ var FontFamily = z25.object({
2600
+ normal: z25.string(),
2601
+ bold: z25.string(),
2602
+ italics: z25.string(),
2603
+ bolditalics: z25.string()
2604
+ });
2605
+ var CertificateConfig = z25.object({
2606
+ id: z25.string(),
2607
+ event: z25.string(),
2608
+ isV2Template: z25.boolean().optional(),
2745
2609
  label: TranslationConfig,
2746
- isDefault: z26.boolean(),
2747
- fee: z26.object({
2748
- onTime: z26.number(),
2749
- late: z26.number(),
2750
- delayed: z26.number()
2610
+ isDefault: z25.boolean(),
2611
+ fee: z25.object({
2612
+ onTime: z25.number(),
2613
+ late: z25.number(),
2614
+ delayed: z25.number()
2751
2615
  }),
2752
- svgUrl: z26.string(),
2753
- fonts: z26.record(z26.string(), FontFamily).optional(),
2754
- conditionals: z26.array(ShowConditional).optional()
2616
+ svgUrl: z25.string(),
2617
+ fonts: z25.record(z25.string(), FontFamily).optional(),
2618
+ conditionals: z25.array(ShowConditional).optional()
2755
2619
  });
2756
2620
  var CertificateTemplateConfig = CertificateConfig.extend({
2757
- hash: z26.string().optional(),
2758
- svg: z26.string()
2621
+ hash: z25.string().optional(),
2622
+ svg: z25.string()
2759
2623
  });
2760
2624
 
2761
2625
  // ../commons/src/events/offline/LanguageConfig.ts
2762
- var z27 = __toESM(require("zod/v4"));
2763
- var LanguageConfig = z27.object({
2764
- lang: z27.string(),
2626
+ var z26 = __toESM(require("zod/v4"));
2627
+ var LanguageConfig = z26.object({
2628
+ lang: z26.string(),
2765
2629
  /**
2766
2630
  * client.csv contents
2767
2631
  */
2768
- messages: z27.record(z27.string(), z27.string())
2632
+ messages: z26.record(z26.string(), z26.string())
2769
2633
  });
2770
2634
 
2771
2635
  // ../commons/src/events/EventConfig.ts
2772
- var z34 = __toESM(require("zod/v4"));
2636
+ var z33 = __toESM(require("zod/v4"));
2773
2637
 
2774
2638
  // ../commons/src/events/SummaryConfig.ts
2775
- var z28 = __toESM(require("zod/v4"));
2776
- var BaseField2 = z28.object({
2639
+ var z27 = __toESM(require("zod/v4"));
2640
+ var BaseField2 = z27.object({
2777
2641
  emptyValueMessage: TranslationConfig.optional().describe(
2778
2642
  "Default message displayed when the field value is empty."
2779
2643
  ),
2780
- conditionals: z28.array(ShowConditional).default([]).optional()
2644
+ conditionals: z27.array(ShowConditional).default([]).optional()
2781
2645
  });
2782
2646
  var ReferenceField = BaseField2.extend({
2783
- fieldId: z28.string(),
2647
+ fieldId: z27.string(),
2784
2648
  label: TranslationConfig.optional().describe(
2785
2649
  "Overrides the default label from the referenced field when provided."
2786
2650
  )
2787
2651
  }).describe("Field referencing existing event data by field ID.");
2788
2652
  var Field = BaseField2.extend({
2789
- id: z28.string().describe("Identifier of the summary field."),
2653
+ id: z27.string().describe("Identifier of the summary field."),
2790
2654
  value: TranslationConfig.describe(
2791
2655
  'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
2792
2656
  ),
2793
2657
  label: TranslationConfig
2794
2658
  }).describe("Custom field defined for the summary view.");
2795
- var SummaryConfig = z28.object({
2796
- fields: z28.array(z28.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2659
+ var SummaryConfig = z27.object({
2660
+ fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2797
2661
  }).describe("Configuration of the event summary section.");
2798
2662
 
2799
2663
  // ../commons/src/events/AdvancedSearchConfig.ts
2800
- var z29 = __toESM(require("zod/v4"));
2801
- var MatchType = z29.enum(["fuzzy", "exact", "range", "within"]);
2802
- var BaseField3 = z29.object({
2803
- config: z29.object({
2664
+ var z28 = __toESM(require("zod/v4"));
2665
+ var MatchType = z28.enum(["fuzzy", "exact", "range", "within"]);
2666
+ var BaseField3 = z28.object({
2667
+ config: z28.object({
2804
2668
  type: MatchType.describe(
2805
2669
  "Determines the search type of field. How to match value."
2806
2670
  ),
2807
- searchFields: z29.array(z29.string()).optional().describe(
2671
+ searchFields: z28.array(z28.string()).optional().describe(
2808
2672
  `
2809
2673
  Defines multiple form fields that should be searched when this field has a value.
2810
2674
  All specified fields will be combined using OR logic.
@@ -2814,7 +2678,7 @@ var BaseField3 = z29.object({
2814
2678
  `
2815
2679
  )
2816
2680
  }),
2817
- type: z29.nativeEnum(FieldType).optional().describe(
2681
+ type: z28.nativeEnum(FieldType).optional().describe(
2818
2682
  `
2819
2683
  Explicitly specify the field type for searchFields.
2820
2684
  This is required when searchFields is defined, to show the correct control in the UI.
@@ -2828,7 +2692,7 @@ var BaseField3 = z29.object({
2828
2692
  This is required when searchFields is defined.
2829
2693
  `
2830
2694
  ),
2831
- options: z29.array(SelectOption).optional(),
2695
+ options: z28.array(SelectOption).optional(),
2832
2696
  searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
2833
2697
  `
2834
2698
  This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
@@ -2849,7 +2713,7 @@ var BaseField3 = z29.object({
2849
2713
  in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
2850
2714
  `
2851
2715
  ),
2852
- conditionals: z29.array(FieldConditional).optional().describe(
2716
+ conditionals: z28.array(FieldConditional).optional().describe(
2853
2717
  `
2854
2718
  In advanced search, we sometimes need to override the default field visibility conditionals.
2855
2719
 
@@ -2863,20 +2727,20 @@ var BaseField3 = z29.object({
2863
2727
  are always rendered in the advanced search form.
2864
2728
  `
2865
2729
  ),
2866
- validations: z29.array(ValidationConfig).optional().describe(
2730
+ validations: z28.array(ValidationConfig).optional().describe(
2867
2731
  `Option for overriding the field validations specifically for advanced search form.`
2868
2732
  )
2869
2733
  });
2870
- var SearchQueryParams = z29.object({
2871
- eventType: z29.string().optional().describe(
2734
+ var SearchQueryParams = z28.object({
2735
+ eventType: z28.string().optional().describe(
2872
2736
  "Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
2873
2737
  )
2874
2738
  }).catchall(FieldValue);
2875
2739
  var FieldConfigSchema = BaseField3.extend({
2876
- fieldId: z29.string(),
2877
- fieldType: z29.literal("field")
2740
+ fieldId: z28.string(),
2741
+ fieldType: z28.literal("field")
2878
2742
  });
2879
- var EventFieldIdInput = z29.enum([
2743
+ var EventFieldIdInput = z28.enum([
2880
2744
  "trackingId",
2881
2745
  "status",
2882
2746
  "legalStatuses.REGISTERED.acceptedAt",
@@ -2885,7 +2749,7 @@ var EventFieldIdInput = z29.enum([
2885
2749
  "updatedAt"
2886
2750
  ]);
2887
2751
  var METADATA_FIELD_PREFIX = "event.";
2888
- var EventFieldId = z29.enum([
2752
+ var EventFieldId = z28.enum([
2889
2753
  `${METADATA_FIELD_PREFIX}trackingId`,
2890
2754
  `${METADATA_FIELD_PREFIX}status`,
2891
2755
  `${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
@@ -2895,29 +2759,29 @@ var EventFieldId = z29.enum([
2895
2759
  ]);
2896
2760
  var EventFieldConfigSchema = BaseField3.extend({
2897
2761
  fieldId: EventFieldId,
2898
- fieldType: z29.literal("event")
2762
+ fieldType: z28.literal("event")
2899
2763
  });
2900
- var AdvancedSearchField = z29.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
2764
+ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
2901
2765
  if (data.config.searchFields && data.config.searchFields.length > 0) {
2902
2766
  if (!data.label) {
2903
2767
  ctx.addIssue({
2904
- code: z29.ZodIssueCode.custom,
2768
+ code: z28.ZodIssueCode.custom,
2905
2769
  message: "label is required when config.searchFields is defined.",
2906
2770
  path: ["label"]
2907
2771
  });
2908
2772
  }
2909
2773
  if (!data.type) {
2910
2774
  ctx.addIssue({
2911
- code: z29.ZodIssueCode.custom,
2775
+ code: z28.ZodIssueCode.custom,
2912
2776
  message: "type is required when config.searchFields is defined.",
2913
2777
  path: ["type"]
2914
2778
  });
2915
2779
  }
2916
2780
  }
2917
2781
  });
2918
- var AdvancedSearchConfig = z29.object({
2782
+ var AdvancedSearchConfig = z28.object({
2919
2783
  title: TranslationConfig.describe("Advanced search tab title"),
2920
- fields: z29.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2784
+ fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2921
2785
  });
2922
2786
 
2923
2787
  // ../commons/src/events/utils.ts
@@ -2926,14 +2790,14 @@ var import_lodash = require("lodash");
2926
2790
  // ../commons/src/conditionals/validate.ts
2927
2791
  var import__ = __toESM(require("ajv/dist/2019"));
2928
2792
  var import_ajv_formats = __toESM(require("ajv-formats"));
2929
- var z32 = __toESM(require("zod/v4"));
2793
+ var z31 = __toESM(require("zod/v4"));
2930
2794
  var import_date_fns = require("date-fns");
2931
2795
 
2932
2796
  // ../commons/src/events/FieldTypeMapping.ts
2933
- var z31 = __toESM(require("zod/v4"));
2797
+ var z30 = __toESM(require("zod/v4"));
2934
2798
 
2935
2799
  // ../commons/src/events/DynamicFieldValue.ts
2936
- var z30 = __toESM(require("zod/v4"));
2800
+ var z29 = __toESM(require("zod/v4"));
2937
2801
 
2938
2802
  // ../commons/src/conditionals/validate.ts
2939
2803
  var ajv = new import__.default({
@@ -2942,9 +2806,9 @@ var ajv = new import__.default({
2942
2806
  strict: false
2943
2807
  // Allow minContains and other newer features
2944
2808
  });
2945
- var DataContext = z32.object({
2946
- rootData: z32.object({
2947
- $leafAdminStructureLocationIds: z32.array(z32.object({ id: UUID }))
2809
+ var DataContext = z31.object({
2810
+ rootData: z31.object({
2811
+ $leafAdminStructureLocationIds: z31.array(z31.object({ id: UUID }))
2948
2812
  })
2949
2813
  });
2950
2814
  function resolveDataPath(rootData, dataPath, instancePath) {
@@ -3021,13 +2885,13 @@ ajv.addKeyword({
3021
2885
  });
3022
2886
 
3023
2887
  // ../commons/src/utils.ts
3024
- var z33 = __toESM(require("zod/v4"));
2888
+ var z32 = __toESM(require("zod/v4"));
3025
2889
  var _ = __toESM(require("lodash"));
3026
- var FullNameV1 = z33.array(
3027
- z33.object({
3028
- use: z33.string(),
3029
- family: z33.string(),
3030
- given: z33.array(z33.string())
2890
+ var FullNameV1 = z32.array(
2891
+ z32.object({
2892
+ use: z32.string(),
2893
+ family: z32.string(),
2894
+ given: z32.array(z32.string())
3031
2895
  })
3032
2896
  );
3033
2897
  function omitKeyDeep(obj, keyToRemove) {
@@ -3761,11 +3625,11 @@ function validateActionOrder(event2, ctx) {
3761
3625
  }
3762
3626
 
3763
3627
  // ../commons/src/events/EventConfig.ts
3764
- var EventFieldReference = z34.object({ $$event: EventMetadataDateFieldIdInput }).describe(
3628
+ var EventFieldReference = z33.object({ $$event: EventMetadataDateFieldIdInput }).describe(
3765
3629
  "Reference to a field defined in the event metadata, using the field id."
3766
3630
  );
3767
- var _EventConfigBase = z34.object({
3768
- id: z34.string().describe(
3631
+ var _EventConfigBase = z33.object({
3632
+ id: z33.string().describe(
3769
3633
  'Machine-readable identifier of the event (e.g. "birth", "death").'
3770
3634
  ),
3771
3635
  dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
@@ -3784,20 +3648,23 @@ var _EventConfigBase = z34.object({
3784
3648
  "Summary information displayed in the event overview."
3785
3649
  ),
3786
3650
  label: TranslationConfig.describe("Human-readable label for the event type."),
3787
- actions: z34.array(ActionConfig).describe(
3651
+ actions: z33.array(ActionConfig).describe(
3788
3652
  "Configuration of system-defined actions associated with the event."
3789
3653
  ),
3790
- actionOrder: z34.array(z34.string()).optional().describe(
3654
+ actionOrder: z33.array(z33.string()).optional().describe(
3791
3655
  "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
3792
3656
  ),
3793
3657
  declaration: DeclarationFormConfig.describe(
3794
3658
  "Configuration of the form used to gather event data."
3795
3659
  ),
3796
- advancedSearch: z34.array(AdvancedSearchConfig).optional().default([]).describe(
3660
+ advancedSearch: z33.array(AdvancedSearchConfig).optional().default([]).describe(
3797
3661
  "Configuration of fields available in the advanced search feature."
3798
3662
  ),
3799
- flags: z34.array(FlagConfig).optional().default([]).describe(
3663
+ flags: z33.array(FlagConfig).optional().default([]).describe(
3800
3664
  "Configuration of flags associated with the actions of this event type."
3665
+ ),
3666
+ analytics: z33.boolean().optional().default(true).describe(
3667
+ "Indicates whether the records of this event type are included in analytics"
3801
3668
  )
3802
3669
  });
3803
3670
  var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
@@ -3816,7 +3683,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
3816
3683
  var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
3817
3684
 
3818
3685
  // ../commons/src/events/WorkqueueConfig.ts
3819
- var z38 = __toESM(require("zod/v4"));
3686
+ var z37 = __toESM(require("zod/v4"));
3820
3687
 
3821
3688
  // ../commons/src/searchConfigs.ts
3822
3689
  function createSearchConfig(baseField) {
@@ -4017,17 +3884,17 @@ var event = Object.assign(eventFn, {
4017
3884
  });
4018
3885
 
4019
3886
  // ../commons/src/events/WorkqueueColumnConfig.ts
4020
- var z35 = __toESM(require("zod/v4"));
3887
+ var z34 = __toESM(require("zod/v4"));
4021
3888
  var WorkqueueColumnKeysArray = [
4022
3889
  ...EventMetadataKeysArray,
4023
3890
  "title",
4024
3891
  "outbox"
4025
3892
  ];
4026
- var WorkqueueColumnKeys = z35.enum(WorkqueueColumnKeysArray);
4027
- var WorkqueueColumnValue = z35.object({
3893
+ var WorkqueueColumnKeys = z34.enum(WorkqueueColumnKeysArray);
3894
+ var WorkqueueColumnValue = z34.object({
4028
3895
  $event: WorkqueueColumnKeys
4029
3896
  });
4030
- var WorkqueueColumn = z35.object({
3897
+ var WorkqueueColumn = z34.object({
4031
3898
  label: TranslationConfig,
4032
3899
  value: WorkqueueColumnValue
4033
3900
  });
@@ -4038,55 +3905,59 @@ function defineWorkqueuesColumns(workqueueColumns) {
4038
3905
  }
4039
3906
 
4040
3907
  // ../commons/src/events/CountryConfigQueryInput.ts
4041
- var z36 = __toESM(require("zod/v4"));
4042
- var SerializableExact = z36.object({
4043
- type: z36.literal("exact"),
4044
- term: z36.union([z36.string(), SerializedUserField])
4045
- });
4046
- var SerializableWithin = z36.object({
4047
- type: z36.literal("within"),
4048
- location: z36.union([z36.string(), SerializedUserField])
4049
- });
4050
- var SerializedQueryExpression = z36.object({
4051
- eventType: z36.string(),
4052
- status: z36.optional(z36.union([AnyOfStatus, ExactStatus])),
4053
- createdAt: z36.optional(DateCondition),
4054
- updatedAt: z36.optional(DateCondition),
4055
- "legalStatuses.DECLARED.createdAtLocation": z36.optional(SerializableWithin),
4056
- "legalStatuses.DECLARED.createdByRole": z36.optional(AnyOf),
4057
- "legalStatuses.REGISTERED.createdAt": z36.optional(DateCondition),
4058
- "legalStatuses.REGISTERED.createdAtLocation": z36.optional(SerializableWithin),
4059
- "legalStatuses.REGISTERED.createdByRole": z36.optional(AnyOf),
4060
- "legalStatuses.REGISTERED.registrationNumber": z36.optional(Exact),
4061
- createdAtLocation: z36.optional(SerializableWithin),
4062
- updatedAtLocation: z36.optional(SerializableWithin),
4063
- updatedByUserRole: z36.optional(SerializableExact),
4064
- assignedTo: z36.optional(SerializableExact),
4065
- createdBy: z36.optional(SerializableExact),
3908
+ var z35 = __toESM(require("zod/v4"));
3909
+ var SerializableExact = z35.object({
3910
+ type: z35.literal("exact"),
3911
+ term: z35.union([z35.string(), SerializedUserField])
3912
+ });
3913
+ var SerializableWithin = z35.object({
3914
+ type: z35.literal("within"),
3915
+ location: z35.union([z35.string(), SerializedUserField])
3916
+ });
3917
+ var SerializedQueryExpression = z35.object({
3918
+ eventType: z35.string(),
3919
+ status: z35.optional(z35.union([AnyOfStatus, ExactStatus])),
3920
+ createdAt: z35.optional(DateCondition),
3921
+ updatedAt: z35.optional(DateCondition),
3922
+ "legalStatuses.DECLARED.createdAtLocation": z35.optional(SerializableWithin),
3923
+ "legalStatuses.DECLARED.createdByRole": z35.optional(AnyOf),
3924
+ "legalStatuses.REGISTERED.createdAt": z35.optional(DateCondition),
3925
+ "legalStatuses.REGISTERED.createdAtLocation": z35.optional(SerializableWithin),
3926
+ "legalStatuses.REGISTERED.createdByRole": z35.optional(AnyOf),
3927
+ "legalStatuses.REGISTERED.registrationNumber": z35.optional(Exact),
3928
+ createdAtLocation: z35.optional(
3929
+ z35.union([SerializableWithin, SerializableExact])
3930
+ ),
3931
+ updatedAtLocation: z35.optional(
3932
+ z35.union([SerializableWithin, SerializableExact])
3933
+ ),
3934
+ updatedByUserRole: z35.optional(SerializableExact),
3935
+ assignedTo: z35.optional(SerializableExact),
3936
+ createdBy: z35.optional(SerializableExact),
4066
3937
  createdByUserType: ExactUserType,
4067
- updatedBy: z36.optional(SerializableExact),
4068
- trackingId: z36.optional(Exact),
4069
- flags: z36.optional(ContainsFlags),
3938
+ updatedBy: z35.optional(SerializableExact),
3939
+ trackingId: z35.optional(Exact),
3940
+ flags: z35.optional(ContainsFlags),
4070
3941
  data: QueryInput
4071
3942
  }).partial();
4072
- var Or2 = z36.object({
4073
- type: z36.literal("or"),
4074
- clauses: z36.array(SerializedQueryExpression)
3943
+ var Or2 = z35.object({
3944
+ type: z35.literal("or"),
3945
+ clauses: z35.array(SerializedQueryExpression)
4075
3946
  });
4076
- var And2 = z36.object({
4077
- type: z36.literal("and"),
4078
- clauses: z36.array(SerializedQueryExpression)
3947
+ var And2 = z35.object({
3948
+ type: z35.literal("and"),
3949
+ clauses: z35.array(SerializedQueryExpression)
4079
3950
  });
4080
- var CountryConfigQueryType = z36.discriminatedUnion("type", [And2, Or2]);
4081
- var CountryConfigQueryInputType = z36.union([
3951
+ var CountryConfigQueryType = z35.discriminatedUnion("type", [And2, Or2]);
3952
+ var CountryConfigQueryInputType = z35.union([
4082
3953
  SerializedQueryExpression,
4083
3954
  And2,
4084
3955
  Or2
4085
3956
  ]);
4086
3957
 
4087
3958
  // ../commons/src/icons.ts
4088
- var z37 = __toESM(require("zod/v4"));
4089
- var AvailableIcons = z37.enum([
3959
+ var z36 = __toESM(require("zod/v4"));
3960
+ var AvailableIcons = z36.enum([
4090
3961
  "Archived",
4091
3962
  "Assigned",
4092
3963
  "Briefcase",
@@ -4211,16 +4082,16 @@ var mandatoryColumns = defineWorkqueuesColumns([
4211
4082
  value: event.field("updatedAt")
4212
4083
  }
4213
4084
  ]);
4214
- var WorkqueueConfig = z38.object({
4215
- slug: z38.string().describe("Determines the url of the workqueue."),
4085
+ var WorkqueueConfig = z37.object({
4086
+ slug: z37.string().describe("Determines the url of the workqueue."),
4216
4087
  name: TranslationConfig.describe(
4217
4088
  "Title of the workflow (both in navigation and on the page)"
4218
4089
  ),
4219
4090
  query: CountryConfigQueryType,
4220
- action: z38.object({ type: WorkqueueActionType }).optional().describe(
4091
+ action: z37.object({ type: WorkqueueActionType }).optional().describe(
4221
4092
  "Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
4222
4093
  ),
4223
- columns: z38.array(WorkqueueColumn).default(mandatoryColumns),
4094
+ columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
4224
4095
  icon: AvailableIcons,
4225
4096
  emptyMessage: TranslationConfig.optional()
4226
4097
  }).describe("Configuration for workqueue.");
@@ -4228,23 +4099,23 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
4228
4099
  query: true,
4229
4100
  columns: true
4230
4101
  });
4231
- var WorkqueueConfigInput = z38.object({
4232
- slug: z38.string().describe("Determines the url of the workqueue."),
4102
+ var WorkqueueConfigInput = z37.object({
4103
+ slug: z37.string().describe("Determines the url of the workqueue."),
4233
4104
  name: TranslationConfig.describe(
4234
4105
  "Title of the workflow (both in navigation and on the page)"
4235
4106
  ),
4236
4107
  query: CountryConfigQueryInputType,
4237
- action: z38.object({ type: WorkqueueActionType }).optional().describe(
4108
+ action: z37.object({ type: WorkqueueActionType }).optional().describe(
4238
4109
  "Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
4239
4110
  ),
4240
- columns: z38.array(WorkqueueColumn).default(mandatoryColumns),
4111
+ columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
4241
4112
  icon: AvailableIcons,
4242
4113
  emptyMessage: TranslationConfig.optional()
4243
4114
  });
4244
- var WorkqueueCountInput = z38.array(
4245
- z38.object({ slug: z38.string(), query: QueryType })
4115
+ var WorkqueueCountInput = z37.array(
4116
+ z37.object({ slug: z37.string(), query: QueryType })
4246
4117
  );
4247
- var WorkqueueCountOutput = z38.record(z38.string(), z38.number());
4118
+ var WorkqueueCountOutput = z37.record(z37.string(), z37.number());
4248
4119
 
4249
4120
  // ../commons/src/events/workqueueDefaultColumns.ts
4250
4121
  var defaultWorkqueueColumns = [
@@ -4267,18 +4138,18 @@ var defaultWorkqueueColumns = [
4267
4138
  ];
4268
4139
 
4269
4140
  // ../commons/src/events/Draft.ts
4270
- var z40 = __toESM(require("zod/v4"));
4141
+ var z39 = __toESM(require("zod/v4"));
4271
4142
 
4272
4143
  // ../commons/src/events/ActionInput.ts
4273
- var z39 = __toESM(require("zod/v4"));
4274
- var BaseActionInput = z39.object({
4144
+ var z38 = __toESM(require("zod/v4"));
4145
+ var BaseActionInput = z38.object({
4275
4146
  eventId: UUID,
4276
- transactionId: z39.string(),
4147
+ transactionId: z38.string(),
4277
4148
  declaration: ActionUpdate.default({}),
4278
4149
  annotation: ActionUpdate.optional(),
4279
4150
  originalActionId: UUID.optional(),
4280
4151
  // should not be part of base action.
4281
- keepAssignment: z39.boolean().optional(),
4152
+ keepAssignment: z38.boolean().optional(),
4282
4153
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
4283
4154
  // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
4284
4155
  createdAtLocation: UUID.nullish().describe(
@@ -4286,8 +4157,8 @@ var BaseActionInput = z39.object({
4286
4157
  )
4287
4158
  });
4288
4159
  var CreateActionInput = BaseActionInput.extend(
4289
- z39.object({
4290
- type: z39.literal(ActionType.CREATE).default(ActionType.CREATE),
4160
+ z38.object({
4161
+ type: z38.literal(ActionType.CREATE).default(ActionType.CREATE),
4291
4162
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
4292
4163
  createdAtLocation: UUID.nullish().describe(
4293
4164
  "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
@@ -4295,14 +4166,14 @@ var CreateActionInput = BaseActionInput.extend(
4295
4166
  }).shape
4296
4167
  );
4297
4168
  var RegisterActionInput = BaseActionInput.extend(
4298
- z39.strictObject({
4299
- type: z39.literal(ActionType.REGISTER).default(ActionType.REGISTER),
4300
- registrationNumber: z39.string().optional()
4169
+ z38.strictObject({
4170
+ type: z38.literal(ActionType.REGISTER).default(ActionType.REGISTER),
4171
+ registrationNumber: z38.string().optional()
4301
4172
  }).shape
4302
4173
  );
4303
4174
  var NotifyActionInput = BaseActionInput.extend(
4304
- z39.object({
4305
- type: z39.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
4175
+ z38.object({
4176
+ type: z38.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
4306
4177
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
4307
4178
  createdAtLocation: UUID.nullish().describe(
4308
4179
  "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
@@ -4318,100 +4189,100 @@ var NotifyActionInput = BaseActionInput.extend(
4318
4189
  }
4319
4190
  });
4320
4191
  var DeclareActionInput = BaseActionInput.extend(
4321
- z39.object({
4322
- type: z39.literal(ActionType.DECLARE).default(ActionType.DECLARE)
4192
+ z38.object({
4193
+ type: z38.literal(ActionType.DECLARE).default(ActionType.DECLARE)
4323
4194
  }).shape
4324
4195
  );
4325
4196
  var EditActionInput = BaseActionInput.extend(
4326
- z39.object({
4327
- type: z39.literal(ActionType.EDIT).default(ActionType.EDIT),
4328
- content: z39.object({
4329
- comment: z39.string().describe("Comment for the edit action.").optional()
4197
+ z38.object({
4198
+ type: z38.literal(ActionType.EDIT).default(ActionType.EDIT),
4199
+ content: z38.object({
4200
+ comment: z38.string().describe("Comment for the edit action.").optional()
4330
4201
  })
4331
4202
  }).shape
4332
4203
  );
4333
4204
  var PrintCertificateActionInput = BaseActionInput.extend(
4334
- z39.object({
4335
- type: z39.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
4205
+ z38.object({
4206
+ type: z38.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
4336
4207
  content: PrintContent.optional()
4337
4208
  }).shape
4338
4209
  );
4339
4210
  var RejectDeclarationActionInput = BaseActionInput.extend(
4340
- z39.object({
4341
- type: z39.literal(ActionType.REJECT).default(ActionType.REJECT),
4211
+ z38.object({
4212
+ type: z38.literal(ActionType.REJECT).default(ActionType.REJECT),
4342
4213
  content: ReasonContent
4343
4214
  }).shape
4344
4215
  );
4345
4216
  var DuplicateDetectedActionInput = BaseActionInput.extend(
4346
- z39.object({
4347
- type: z39.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
4348
- content: z39.object({
4349
- duplicates: z39.array(PotentialDuplicate)
4217
+ z38.object({
4218
+ type: z38.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
4219
+ content: z38.object({
4220
+ duplicates: z38.array(PotentialDuplicate)
4350
4221
  })
4351
4222
  }).shape
4352
4223
  );
4353
4224
  var MarkAsDuplicateActionInput = BaseActionInput.extend(
4354
- z39.object({
4355
- type: z39.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
4356
- content: z39.object({
4225
+ z38.object({
4226
+ type: z38.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
4227
+ content: z38.object({
4357
4228
  duplicateOf: UUID
4358
4229
  }).optional()
4359
4230
  }).shape
4360
4231
  );
4361
4232
  var MarkNotDuplicateActionInput = BaseActionInput.extend(
4362
- z39.object({
4363
- type: z39.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
4233
+ z38.object({
4234
+ type: z38.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
4364
4235
  }).shape
4365
4236
  );
4366
4237
  var ArchiveActionInput = BaseActionInput.extend(
4367
- z39.object({
4368
- type: z39.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
4238
+ z38.object({
4239
+ type: z38.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
4369
4240
  content: ReasonContent
4370
4241
  }).shape
4371
4242
  );
4372
4243
  var AssignActionInput = BaseActionInput.extend(
4373
- z39.object({
4374
- type: z39.literal(ActionType.ASSIGN),
4375
- assignedTo: z39.string()
4244
+ z38.object({
4245
+ type: z38.literal(ActionType.ASSIGN),
4246
+ assignedTo: z38.string()
4376
4247
  }).shape
4377
4248
  );
4378
4249
  var UnassignActionInput = BaseActionInput.extend(
4379
- z39.object({
4380
- type: z39.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
4381
- assignedTo: z39.literal(null).default(null)
4250
+ z38.object({
4251
+ type: z38.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
4252
+ assignedTo: z38.literal(null).default(null)
4382
4253
  }).shape
4383
4254
  );
4384
4255
  var RequestCorrectionActionInput = BaseActionInput.extend(
4385
- z39.object({
4386
- type: z39.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
4256
+ z38.object({
4257
+ type: z38.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
4387
4258
  }).shape
4388
4259
  );
4389
4260
  var RejectCorrectionActionInput = BaseActionInput.extend(
4390
- z39.object({
4391
- requestId: z39.string(),
4392
- type: z39.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
4261
+ z38.object({
4262
+ requestId: z38.string(),
4263
+ type: z38.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
4393
4264
  content: ReasonContent
4394
4265
  }).shape
4395
4266
  );
4396
4267
  var ApproveCorrectionActionInput = BaseActionInput.extend(
4397
- z39.object({
4398
- requestId: z39.string(),
4399
- type: z39.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
4268
+ z38.object({
4269
+ requestId: z38.string(),
4270
+ type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
4400
4271
  }).shape
4401
4272
  );
4402
4273
  var ReadActionInput = BaseActionInput.extend(
4403
- z39.object({
4404
- type: z39.literal(ActionType.READ).default(ActionType.READ)
4274
+ z38.object({
4275
+ type: z38.literal(ActionType.READ).default(ActionType.READ)
4405
4276
  }).shape
4406
4277
  );
4407
- var DeleteActionInput = z39.object({ eventId: UUID });
4278
+ var DeleteActionInput = z38.object({ eventId: UUID });
4408
4279
  var CustomActionInput = BaseActionInput.extend(
4409
- z39.object({
4410
- type: z39.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
4411
- customActionType: z39.string().describe("Name of the custom action.")
4280
+ z38.object({
4281
+ type: z38.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
4282
+ customActionType: z38.string().describe("Name of the custom action.")
4412
4283
  }).shape
4413
4284
  );
4414
- var ActionInput = z39.discriminatedUnion("type", [
4285
+ var ActionInput = z38.discriminatedUnion("type", [
4415
4286
  CreateActionInput.meta({ id: "CreateActionInput" }),
4416
4287
  RegisterActionInput.meta({ id: "RegisterActionInput" }),
4417
4288
  NotifyActionInput.meta({ id: "NotifyActionInput" }),
@@ -4447,11 +4318,11 @@ var ActionInput = z39.discriminatedUnion("type", [
4447
4318
  });
4448
4319
 
4449
4320
  // ../commons/src/events/Draft.ts
4450
- var Draft = z40.object({
4321
+ var Draft = z39.object({
4451
4322
  id: UUID,
4452
4323
  eventId: UUID,
4453
- transactionId: z40.string(),
4454
- createdAt: z40.string().datetime(),
4324
+ transactionId: z39.string(),
4325
+ createdAt: z39.string().datetime(),
4455
4326
  action: ActionBase.extend({
4456
4327
  type: ActionTypes.exclude([ActionTypes.enum.DELETE])
4457
4328
  }).omit({ id: true, createdAtLocation: true })
@@ -4460,7 +4331,7 @@ var Draft = z40.object({
4460
4331
  );
4461
4332
  var DraftInput = BaseActionInput.extend({
4462
4333
  type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
4463
- status: z40.enum([
4334
+ status: z39.enum([
4464
4335
  ActionStatus.Requested,
4465
4336
  ActionStatus.Accepted,
4466
4337
  ActionStatus.Rejected
@@ -4468,27 +4339,27 @@ var DraftInput = BaseActionInput.extend({
4468
4339
  });
4469
4340
 
4470
4341
  // ../commons/src/events/EventInput.ts
4471
- var z41 = __toESM(require("zod/v4"));
4342
+ var z40 = __toESM(require("zod/v4"));
4472
4343
  var import_uuid10 = require("uuid");
4473
- var EventInput = z41.object({
4474
- transactionId: z41.string(),
4475
- type: z41.string(),
4344
+ var EventInput = z40.object({
4345
+ transactionId: z40.string(),
4346
+ type: z40.string(),
4476
4347
  createdAtLocation: UUID.nullish().describe(
4477
4348
  "Location where the event occurred. Required for system users."
4478
4349
  )
4479
4350
  }).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
4480
4351
 
4481
4352
  // ../commons/src/events/EventDocument.ts
4482
- var z42 = __toESM(require("zod/v4"));
4483
- var EventDocument = z42.object({
4353
+ var z41 = __toESM(require("zod/v4"));
4354
+ var EventDocument = z41.object({
4484
4355
  id: UUID.describe("Unique identifier of the event."),
4485
- type: z42.string().describe("Type of the event (e.g. birth, death, marriage)."),
4486
- createdAt: z42.string().datetime().describe("Timestamp indicating when the event was created."),
4487
- updatedAt: z42.string().datetime().describe(
4356
+ type: z41.string().describe("Type of the event (e.g. birth, death, marriage)."),
4357
+ createdAt: z41.string().datetime().describe("Timestamp indicating when the event was created."),
4358
+ updatedAt: z41.string().datetime().describe(
4488
4359
  "Timestamp of the last update, excluding changes from actions."
4489
4360
  ),
4490
- actions: z42.array(Action).describe("Ordered list of actions associated with the event."),
4491
- trackingId: z42.string().describe(
4361
+ actions: z41.array(Action).describe("Ordered list of actions associated with the event."),
4362
+ trackingId: z41.string().describe(
4492
4363
  "System-generated tracking identifier used to look up the event."
4493
4364
  )
4494
4365
  }).meta({ id: "EventDocument" });
@@ -4501,6 +4372,7 @@ var import_lodash2 = require("lodash");
4501
4372
  var updateActions = ActionTypes.extract([
4502
4373
  ActionType.CREATE,
4503
4374
  ActionType.NOTIFY,
4375
+ ActionType.EDIT,
4504
4376
  ActionType.DECLARE,
4505
4377
  ActionType.REGISTER,
4506
4378
  ActionType.REJECT,
@@ -4520,7 +4392,8 @@ var IGNORED_EVENT_TYPES = [
4520
4392
  "tennis-club-membership",
4521
4393
  "library-membership",
4522
4394
  "child-onboarding",
4523
- "digital-identity"
4395
+ "digital-identity",
4396
+ "event-with-optional-address"
4524
4397
  ];
4525
4398
  function warnOnConfigurationIssues(config) {
4526
4399
  const eventId = config.id;
@@ -6932,8 +6805,8 @@ var digitalIdentityEvent = defineConfig({
6932
6805
  });
6933
6806
 
6934
6807
  // ../commons/src/events/test.utils.ts
6935
- var z43 = __toESM(require("zod/v4"));
6936
- var TestUserRole = z43.enum([
6808
+ var z42 = __toESM(require("zod/v4"));
6809
+ var TestUserRole = z42.enum([
6937
6810
  "FIELD_AGENT",
6938
6811
  "LOCAL_REGISTRAR",
6939
6812
  "LOCAL_SYSTEM_ADMIN",
@@ -6949,26 +6822,26 @@ var TestUserRole = z43.enum([
6949
6822
  var import_lodash6 = require("lodash");
6950
6823
 
6951
6824
  // ../commons/src/events/locations.ts
6952
- var z44 = __toESM(require("zod/v4"));
6953
- var LocationTypeV1 = z44.enum([
6825
+ var z43 = __toESM(require("zod/v4"));
6826
+ var LocationTypeV1 = z43.enum([
6954
6827
  "ADMIN_STRUCTURE",
6955
6828
  "CRVS_OFFICE",
6956
6829
  "HEALTH_FACILITY"
6957
6830
  ]);
6958
- var AdministrativeArea = z44.object({
6831
+ var AdministrativeArea = z43.object({
6959
6832
  id: UUID,
6960
- name: z44.string(),
6961
- externalId: z44.string().nullish(),
6833
+ name: z43.string(),
6834
+ externalId: z43.string().nullish(),
6962
6835
  parentId: UUID.nullable(),
6963
- validUntil: z44.iso.datetime().nullable()
6836
+ validUntil: z43.iso.datetime().nullable()
6964
6837
  });
6965
- var Location = z44.object({
6838
+ var Location = z43.object({
6966
6839
  id: UUID,
6967
- name: z44.string(),
6968
- externalId: z44.string().nullish(),
6840
+ name: z43.string(),
6841
+ externalId: z43.string().nullish(),
6969
6842
  administrativeAreaId: UUID.nullable(),
6970
- validUntil: z44.iso.datetime().nullable(),
6971
- locationType: z44.string().nullable()
6843
+ validUntil: z43.iso.datetime().nullable(),
6844
+ locationType: z43.string().nullable()
6972
6845
  });
6973
6846
 
6974
6847
  // ../commons/src/events/scopes.ts
@@ -6978,7 +6851,7 @@ var ACTION_SCOPE_MAP = {
6978
6851
  [ActionType.NOTIFY]: ["record.notify"],
6979
6852
  [ActionType.DECLARE]: ["record.declare", "record.register"],
6980
6853
  [ActionType.EDIT]: ["record.edit"],
6981
- [ActionType.DELETE]: ["record.declare"],
6854
+ [ActionType.DELETE]: ["record.declare", "record.notify"],
6982
6855
  [ActionType.REGISTER]: ["record.register"],
6983
6856
  [ActionType.PRINT_CERTIFICATE]: ["record.print-certified-copies"],
6984
6857
  [ActionType.REQUEST_CORRECTION]: [
@@ -7055,62 +6928,67 @@ var ACTION_FILTERS = {
7055
6928
  var import_lodash7 = require("lodash");
7056
6929
 
7057
6930
  // ../commons/src/notification/UserNotifications.ts
7058
- var z45 = __toESM(require("zod/v4"));
6931
+ var z44 = __toESM(require("zod/v4"));
7059
6932
  var TriggerEvent = {
7060
6933
  USER_CREATED: "user-created",
7061
6934
  USER_UPDATED: "user-updated",
7062
6935
  USERNAME_REMINDER: "username-reminder",
7063
6936
  RESET_PASSWORD: "reset-password",
7064
6937
  RESET_PASSWORD_BY_ADMIN: "reset-password-by-admin",
6938
+ RESEND_INVITE: "resend-invite",
7065
6939
  TWO_FA: "2fa",
7066
6940
  ALL_USER_NOTIFICATION: "all-user-notification",
7067
6941
  CHANGE_PHONE_NUMBER: "change-phone-number",
7068
6942
  CHANGE_EMAIL_ADDRESS: "change-email-address"
7069
6943
  };
7070
- var Recipient = z45.object({
6944
+ var Recipient = z44.object({
7071
6945
  name: NameFieldValue.optional(),
7072
- mobile: z45.string().optional(),
7073
- email: z45.string().optional(),
7074
- bcc: z45.array(z45.string()).optional()
6946
+ mobile: z44.string().optional(),
6947
+ email: z44.string().optional(),
6948
+ bcc: z44.array(z44.string()).optional()
7075
6949
  });
7076
- var BasePayload = z45.object({
6950
+ var BasePayload = z44.object({
7077
6951
  recipient: Recipient
7078
6952
  });
7079
6953
  var TriggerPayload = {
7080
6954
  [TriggerEvent.USER_CREATED]: BasePayload.extend({
7081
- username: z45.string(),
7082
- temporaryPassword: z45.string()
6955
+ username: z44.string(),
6956
+ temporaryPassword: z44.string()
7083
6957
  }),
7084
6958
  [TriggerEvent.USER_UPDATED]: BasePayload.extend({
7085
- oldUsername: z45.string(),
7086
- newUsername: z45.string()
6959
+ oldUsername: z44.string(),
6960
+ newUsername: z44.string()
7087
6961
  }),
7088
6962
  [TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
7089
- username: z45.string()
6963
+ username: z44.string()
7090
6964
  }),
7091
6965
  [TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
7092
- code: z45.string()
6966
+ code: z44.string()
7093
6967
  }),
7094
6968
  [TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
7095
- temporaryPassword: z45.string(),
7096
- admin: z45.object({
7097
- id: z45.string(),
6969
+ temporaryPassword: z44.string(),
6970
+ admin: z44.object({
6971
+ id: z44.string(),
7098
6972
  name: NameFieldValue,
7099
- role: z45.string()
6973
+ role: z44.string()
7100
6974
  })
7101
6975
  }),
6976
+ [TriggerEvent.RESEND_INVITE]: BasePayload.extend({
6977
+ username: z44.string(),
6978
+ temporaryPassword: z44.string()
6979
+ }),
7102
6980
  [TriggerEvent.TWO_FA]: BasePayload.extend({
7103
- code: z45.string()
6981
+ code: z44.string()
7104
6982
  }),
7105
6983
  [TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
7106
- subject: z45.string(),
7107
- body: z45.string()
6984
+ subject: z44.string(),
6985
+ body: z44.string()
7108
6986
  }),
7109
6987
  [TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
7110
- code: z45.string()
6988
+ code: z44.string()
7111
6989
  }),
7112
6990
  [TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
7113
- code: z45.string()
6991
+ code: z44.string()
7114
6992
  })
7115
6993
  };
7116
6994
  async function triggerUserEventNotification({
@@ -7134,4 +7012,4 @@ function parseUserEventTrigger(event2, body) {
7134
7012
  }
7135
7013
 
7136
7014
  // src/notification/index.ts
7137
- z46.globalRegistry.clear();
7015
+ z45.globalRegistry.clear();