@opencrvs/toolkit 1.9.6-rc.f7b878f → 1.9.6-rc.fbe6e5b

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 (58) hide show
  1. package/dist/commons/api/router.d.ts +29384 -2317
  2. package/dist/commons/conditionals/conditionals.d.ts +10 -1
  3. package/dist/commons/conditionals/validate.d.ts +11 -4
  4. package/dist/commons/events/ActionConfig.d.ts +24973 -1552
  5. package/dist/commons/events/ActionDocument.d.ts +803 -1856
  6. package/dist/commons/events/ActionInput.d.ts +277 -1073
  7. package/dist/commons/events/ActionType.d.ts +86 -9
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +228 -1238
  9. package/dist/commons/events/CompositeFieldValue.d.ts +29 -190
  10. package/dist/commons/events/Conditional.d.ts +26 -38
  11. package/dist/commons/events/Constants.d.ts +1 -1
  12. package/dist/commons/events/CountryConfigQueryInput.d.ts +1195 -4223
  13. package/dist/commons/events/CreatedAtLocation.d.ts +1 -1
  14. package/dist/commons/events/DeduplicationConfig.d.ts +15 -150
  15. package/dist/commons/events/Draft.d.ts +70 -105
  16. package/dist/commons/events/DynamicFieldValue.d.ts +7 -91
  17. package/dist/commons/events/EventConfig.d.ts +19932 -2120
  18. package/dist/commons/events/EventConfigInput.d.ts +1 -1
  19. package/dist/commons/events/EventDocument.d.ts +320 -1332
  20. package/dist/commons/events/EventIndex.d.ts +193 -980
  21. package/dist/commons/events/EventInput.d.ts +2 -8
  22. package/dist/commons/events/EventMetadata.d.ts +106 -347
  23. package/dist/commons/events/FieldConfig.d.ts +4522 -12443
  24. package/dist/commons/events/FieldType.d.ts +20 -4
  25. package/dist/commons/events/FieldTypeMapping.d.ts +193 -897
  26. package/dist/commons/events/FieldValue.d.ts +87 -396
  27. package/dist/commons/events/Flag.d.ts +67 -0
  28. package/dist/commons/events/FormConfig.d.ts +13980 -721
  29. package/dist/commons/events/PageConfig.d.ts +9340 -319
  30. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  31. package/dist/commons/events/TemplateConfig.d.ts +2 -3
  32. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  33. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  34. package/dist/commons/events/WorkqueueConfig.d.ts +1867 -7176
  35. package/dist/commons/events/deduplication.d.ts +3 -3
  36. package/dist/commons/events/defineConfig.d.ts +26563 -147
  37. package/dist/commons/events/eventConfigValidation.d.ts +8 -0
  38. package/dist/commons/events/index.d.ts +1 -0
  39. package/dist/commons/events/locations.d.ts +26 -19
  40. package/dist/commons/events/scopes.d.ts +5 -4
  41. package/dist/commons/events/state/availableActions.d.ts +0 -2
  42. package/dist/commons/events/state/flags.d.ts +21 -3
  43. package/dist/commons/events/state/index.d.ts +23 -19
  44. package/dist/commons/events/state/utils.d.ts +130 -112
  45. package/dist/commons/events/test.utils.d.ts +17 -8
  46. package/dist/commons/events/transactions.d.ts +1 -1
  47. package/dist/commons/events/utils.d.ts +53164 -367
  48. package/dist/commons/notification/UserNotifications.d.ts +55 -636
  49. package/dist/conditionals/index.d.ts.map +1 -1
  50. package/dist/conditionals/index.js +45 -11
  51. package/dist/events/deduplication.d.ts +3 -3
  52. package/dist/events/index.js +1985 -1711
  53. package/dist/notification/index.d.ts.map +1 -1
  54. package/dist/notification/index.js +1650 -1571
  55. package/dist/scopes/index.d.ts +193 -129
  56. package/dist/scopes/index.d.ts.map +1 -1
  57. package/dist/scopes/index.js +141 -95
  58. package/package.json +5 -5
@@ -38,6 +38,7 @@ __export(notification_exports, {
38
38
  triggerUserEventNotification: () => triggerUserEventNotification
39
39
  });
40
40
  module.exports = __toCommonJS(notification_exports);
41
+ var z41 = __toESM(require("zod/v4"));
41
42
 
42
43
  // ../commons/src/url.ts
43
44
  function joinUrl(base, path) {
@@ -47,30 +48,28 @@ function joinUrl(base, path) {
47
48
 
48
49
  // ../commons/src/events/Constants.ts
49
50
  var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
50
- var BIRTH_EVENT = "birth";
51
+ var CHILD_ONBOARDING_EVENT = "child-onboarding";
51
52
 
52
53
  // ../commons/src/events/ActionConfig.ts
53
- var import_zod20 = require("zod");
54
+ var z22 = __toESM(require("zod/v4"));
54
55
 
55
56
  // ../commons/src/events/TranslationConfig.ts
56
- var import_zod = require("zod");
57
- var import_zod_openapi = require("zod-openapi");
58
- (0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
59
- var TranslationConfig = import_zod.z.object({
60
- id: import_zod.z.string().describe(
57
+ var z = __toESM(require("zod/v4"));
58
+ var TranslationConfig = z.object({
59
+ id: z.string().describe(
61
60
  "The identifier of the translation referred in translation CSV files"
62
61
  ),
63
- defaultMessage: import_zod.z.string().describe("Default translation message"),
64
- description: import_zod.z.string().describe(
62
+ defaultMessage: z.string().describe("Default translation message"),
63
+ description: z.string().describe(
65
64
  "Describe the translation for a translator to be able to identify it."
66
65
  )
67
- }).openapi({
66
+ }).meta({
68
67
  description: "Translation configuration",
69
- ref: "TranslationConfig"
68
+ id: "TranslationConfig"
70
69
  });
71
70
 
72
71
  // ../commons/src/events/ActionType.ts
73
- var import_zod2 = require("zod");
72
+ var z2 = __toESM(require("zod/v4"));
74
73
  var ActionType = {
75
74
  // Pre-declaration actions
76
75
  DELETE: "DELETE",
@@ -78,8 +77,8 @@ var ActionType = {
78
77
  NOTIFY: "NOTIFY",
79
78
  // Declaration actions
80
79
  DECLARE: "DECLARE",
81
- VALIDATE: "VALIDATE",
82
80
  REGISTER: "REGISTER",
81
+ EDIT: "EDIT",
83
82
  // Declaration system actions. Non-configurable.
84
83
  DUPLICATE_DETECTED: "DUPLICATE_DETECTED",
85
84
  REJECT: "REJECT",
@@ -95,26 +94,29 @@ var ActionType = {
95
94
  // General actions
96
95
  READ: "READ",
97
96
  ASSIGN: "ASSIGN",
98
- UNASSIGN: "UNASSIGN"
97
+ UNASSIGN: "UNASSIGN",
98
+ // Custom action
99
+ CUSTOM: "CUSTOM"
99
100
  };
100
101
  var ConfirmableActions = [
101
102
  ActionType.NOTIFY,
102
103
  ActionType.DECLARE,
103
- ActionType.VALIDATE,
104
+ ActionType.EDIT,
104
105
  ActionType.REGISTER,
105
106
  ActionType.REJECT,
106
107
  ActionType.ARCHIVE,
107
108
  ActionType.PRINT_CERTIFICATE,
108
109
  ActionType.REQUEST_CORRECTION,
109
110
  ActionType.APPROVE_CORRECTION,
110
- ActionType.REJECT_CORRECTION
111
+ ActionType.REJECT_CORRECTION,
112
+ ActionType.CUSTOM
111
113
  ];
112
- var ActionTypes = import_zod2.z.enum([
114
+ var ActionTypes = z2.enum([
113
115
  "DELETE",
114
116
  "CREATE",
115
117
  "NOTIFY",
116
118
  "DECLARE",
117
- "VALIDATE",
119
+ "EDIT",
118
120
  "REGISTER",
119
121
  "DUPLICATE_DETECTED",
120
122
  "REJECT",
@@ -127,14 +129,15 @@ var ActionTypes = import_zod2.z.enum([
127
129
  "APPROVE_CORRECTION",
128
130
  "READ",
129
131
  "ASSIGN",
130
- "UNASSIGN"
132
+ "UNASSIGN",
133
+ "CUSTOM"
131
134
  ]);
132
135
  var ClientSpecificAction = {
133
136
  REVIEW_CORRECTION_REQUEST: "REVIEW_CORRECTION_REQUEST"
134
137
  };
135
138
  var declarationActionValues = [
136
139
  ActionTypes.enum.DECLARE,
137
- ActionTypes.enum.VALIDATE,
140
+ ActionTypes.enum.EDIT,
138
141
  ActionTypes.enum.REGISTER,
139
142
  ActionTypes.enum.NOTIFY,
140
143
  ActionTypes.enum.DUPLICATE_DETECTED
@@ -155,13 +158,14 @@ var writeActions = ActionTypes.exclude([
155
158
  ActionType.UNASSIGN
156
159
  ]);
157
160
  var workqueueActions = ActionTypes.exclude([
161
+ ActionType.READ,
158
162
  ActionType.CREATE,
159
163
  ActionType.NOTIFY,
160
164
  ActionType.DUPLICATE_DETECTED,
161
- ActionType.REJECT,
162
165
  ActionType.MARK_AS_NOT_DUPLICATE,
163
166
  ActionType.REJECT_CORRECTION,
164
- ActionType.APPROVE_CORRECTION
167
+ ActionType.APPROVE_CORRECTION,
168
+ ActionType.CUSTOM
165
169
  ]);
166
170
  var META_ACTIONS = [
167
171
  ActionType.ASSIGN,
@@ -170,59 +174,57 @@ var META_ACTIONS = [
170
174
  ];
171
175
 
172
176
  // ../commons/src/events/FieldConfig.ts
173
- var import_zod16 = require("zod");
177
+ var z17 = __toESM(require("zod/v4"));
174
178
 
175
179
  // ../commons/src/events/Conditional.ts
176
- var import_zod3 = require("zod");
177
- var import_zod_openapi2 = require("zod-openapi");
178
- (0, import_zod_openapi2.extendZodWithOpenApi)(import_zod3.z);
179
- var Conditional = import_zod3.z.custom((val) => typeof val === "object" && val !== null).openapi({
180
+ var z3 = __toESM(require("zod/v4"));
181
+ var Conditional = z3.any().describe("JSONSchema").meta({
180
182
  description: "JSON schema conditional configuration",
181
- ref: "Conditional"
183
+ id: "Conditional"
182
184
  });
183
185
  var ConditionalType = {
184
186
  SHOW: "SHOW",
185
187
  ENABLE: "ENABLE",
186
188
  DISPLAY_ON_REVIEW: "DISPLAY_ON_REVIEW"
187
189
  };
188
- var ShowConditional = import_zod3.z.object({
189
- type: import_zod3.z.literal(ConditionalType.SHOW),
190
+ var ShowConditional = z3.object({
191
+ type: z3.literal(ConditionalType.SHOW),
190
192
  conditional: Conditional
191
193
  }).describe(
192
194
  "If 'SHOW' conditional is defined, the component is shown to the user only if the condition is met"
193
195
  );
194
- var EnableConditional = import_zod3.z.object({
195
- type: import_zod3.z.literal(ConditionalType.ENABLE),
196
+ var EnableConditional = z3.object({
197
+ type: z3.literal(ConditionalType.ENABLE),
196
198
  conditional: Conditional
197
199
  }).describe(
198
200
  "If 'ENABLE' conditional is defined, the component is enabled only if the condition is met"
199
201
  );
200
- var ActionConditional = import_zod3.z.discriminatedUnion("type", [
202
+ var ActionConditional = z3.discriminatedUnion("type", [
201
203
  // Action can be shown / hidden
202
204
  ShowConditional,
203
205
  // Action can be shown to the user in the list but as disabled
204
206
  EnableConditional
205
207
  ]);
206
- var DisplayOnReviewConditional = import_zod3.z.object({
207
- type: import_zod3.z.literal(ConditionalType.DISPLAY_ON_REVIEW),
208
+ var DisplayOnReviewConditional = z3.object({
209
+ type: z3.literal(ConditionalType.DISPLAY_ON_REVIEW),
208
210
  conditional: Conditional
209
211
  }).describe(
210
212
  "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."
211
213
  );
212
- var FieldConditional = import_zod3.z.discriminatedUnion("type", [
214
+ var FieldConditional = z3.discriminatedUnion("type", [
213
215
  // Field input can be shown / hidden
214
216
  ShowConditional,
215
217
  // Field input can be shown to the user but as disabled
216
218
  EnableConditional,
217
219
  // Field output can be shown / hidden on the review page
218
220
  DisplayOnReviewConditional
219
- ]).openapi({
221
+ ]).meta({
220
222
  description: "Field conditional configuration",
221
- ref: "FieldConditional"
223
+ id: "FieldConditional"
222
224
  });
223
225
 
224
226
  // ../commons/src/events/FieldType.ts
225
- var import_zod4 = require("zod");
227
+ var z4 = __toESM(require("zod/v4"));
226
228
  var FieldType = {
227
229
  NAME: "NAME",
228
230
  PHONE: "PHONE",
@@ -265,9 +267,21 @@ var FieldType = {
265
267
  QUERY_PARAM_READER: "QUERY_PARAM_READER",
266
268
  QR_READER: "QR_READER",
267
269
  ID_READER: "ID_READER",
268
- LOADER: "LOADER"
270
+ LOADER: "LOADER",
271
+ ALPHA_HIDDEN: "ALPHA_HIDDEN",
272
+ /**
273
+ * @internal
274
+ * @experimental
275
+ *
276
+ * Internal API used by the OpenCRVS core team for experimentation.
277
+ *
278
+ * This component is not part of the public, stable API.
279
+ * Its shape, behavior, or existence may change at any time or be removed
280
+ * entirely without notice.
281
+ */
282
+ _EXPERIMENTAL_CUSTOM: "CUSTOM"
269
283
  };
270
- var FileFieldType = import_zod4.z.enum([
284
+ var FileFieldType = z4.enum([
271
285
  FieldType.FILE,
272
286
  FieldType.FILE_WITH_OPTIONS,
273
287
  FieldType.SIGNATURE
@@ -291,154 +305,155 @@ var FieldTypesToHideInReview = [
291
305
  FieldType.LOADER,
292
306
  FieldType.HTTP,
293
307
  FieldType.QUERY_PARAM_READER,
294
- FieldType.DATA
308
+ FieldType.DATA,
309
+ FieldType.ALPHA_HIDDEN
295
310
  ];
296
311
 
297
312
  // ../commons/src/events/FieldValue.ts
298
- var import_zod7 = require("zod");
313
+ var z7 = __toESM(require("zod/v4"));
299
314
 
300
315
  // ../commons/src/documents.ts
301
- var import_zod5 = require("zod");
302
- var import_zod_openapi3 = require("zod-openapi");
303
- (0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
304
- var FullDocumentUrl = import_zod5.z.string().brand("FullDocumentUrl").describe(
316
+ var z5 = __toESM(require("zod/v4"));
317
+ var FullDocumentUrl = z5.string().brand("FullDocumentUrl").describe(
305
318
  "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"
306
319
  );
307
- var FullDocumentPath = import_zod5.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
320
+ var FullDocumentPath = z5.string().overwrite((val) => val.startsWith("/") ? val : `/${val}`).meta({ effectType: "input", type: "string" }).describe(
308
321
  "A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
309
322
  );
310
- var DocumentPath = import_zod5.z.string().brand("DocumentPath").describe(
323
+ var DocumentPath = z5.string().brand("DocumentPath").describe(
311
324
  "A full identifier starting from the root of the S3 bucket, e.g. /document-id.jpg or /directory/document-id.jpg but never /bucket-name/document-id.jpg"
312
325
  );
313
326
 
314
327
  // ../commons/src/events/CompositeFieldValue.ts
315
- var import_zod6 = require("zod");
328
+ var z6 = __toESM(require("zod/v4"));
316
329
  var AddressType = {
317
330
  DOMESTIC: "DOMESTIC",
318
331
  INTERNATIONAL: "INTERNATIONAL"
319
332
  };
320
- var FileFieldValue = import_zod6.z.object({
333
+ var FileFieldValue = z6.object({
321
334
  path: FullDocumentPath,
322
- originalFilename: import_zod6.z.string(),
323
- type: import_zod6.z.string()
324
- });
325
- var NameFieldValue = import_zod6.z.object({
326
- firstname: import_zod6.z.string(),
327
- surname: import_zod6.z.string(),
328
- middlename: import_zod6.z.string().optional()
329
- });
330
- var NameFieldUpdateValue = import_zod6.z.object({
331
- firstname: import_zod6.z.string().nullish(),
332
- surname: import_zod6.z.string().nullish(),
333
- middlename: import_zod6.z.string().nullish()
334
- }).or(import_zod6.z.null()).or(import_zod6.z.undefined());
335
- var StreetLevelDetailsValue = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string()).optional();
336
- var StreetLevelDetailsUpdateValue = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string().nullable()).nullish();
337
- var BaseAddressFieldValue = import_zod6.z.object({
338
- country: import_zod6.z.string(),
335
+ originalFilename: z6.string(),
336
+ type: z6.string()
337
+ });
338
+ var NameFieldValue = z6.object({
339
+ firstname: z6.string(),
340
+ surname: z6.string(),
341
+ middlename: z6.string().optional()
342
+ });
343
+ var NameFieldUpdateValue = z6.object({
344
+ firstname: z6.string().nullish(),
345
+ surname: z6.string().nullish(),
346
+ middlename: z6.string().nullish()
347
+ }).or(z6.null()).or(z6.undefined());
348
+ var StreetLevelDetailsValue = z6.record(z6.string(), z6.string()).optional();
349
+ var StreetLevelDetailsUpdateValue = z6.record(z6.string(), z6.string().nullable()).nullish();
350
+ var BaseAddressFieldValue = z6.object({
351
+ country: z6.string(),
339
352
  streetLevelDetails: StreetLevelDetailsValue
340
353
  });
341
- var BaseAddressFieldUpdateValue = import_zod6.z.object({
342
- country: import_zod6.z.string().nullish(),
354
+ var BaseAddressFieldUpdateValue = z6.object({
355
+ country: z6.string().nullish(),
343
356
  streetLevelDetails: StreetLevelDetailsUpdateValue
344
357
  });
345
358
  var DomesticAddressFieldValue = BaseAddressFieldValue.extend({
346
- addressType: import_zod6.z.literal(AddressType.DOMESTIC),
347
- administrativeArea: import_zod6.z.string().uuid()
359
+ addressType: z6.literal(AddressType.DOMESTIC),
360
+ administrativeArea: z6.string().uuid()
348
361
  });
349
362
  var InternationalAddressFieldValue = BaseAddressFieldValue.extend({
350
- addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
363
+ addressType: z6.literal(AddressType.INTERNATIONAL)
351
364
  });
352
- var AddressFieldValue = import_zod6.z.discriminatedUnion("addressType", [
365
+ var AddressFieldValue = z6.discriminatedUnion("addressType", [
353
366
  DomesticAddressFieldValue,
354
367
  InternationalAddressFieldValue
355
368
  ]);
356
369
  var DomesticAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend({
357
- addressType: import_zod6.z.literal(AddressType.DOMESTIC),
358
- administrativeArea: import_zod6.z.string().uuid().nullish()
370
+ addressType: z6.literal(AddressType.DOMESTIC),
371
+ administrativeArea: z6.string().uuid().nullish()
359
372
  /* Leaf level admin structure */
360
373
  });
361
374
  var InternationalAddressUpdateFieldValue = BaseAddressFieldUpdateValue.extend(
362
375
  {
363
- addressType: import_zod6.z.literal(AddressType.INTERNATIONAL)
376
+ addressType: z6.literal(AddressType.INTERNATIONAL)
364
377
  }
365
378
  );
366
- var AddressFieldUpdateValue = import_zod6.z.discriminatedUnion("addressType", [
379
+ var AddressFieldUpdateValue = z6.discriminatedUnion("addressType", [
367
380
  DomesticAddressUpdateFieldValue,
368
381
  InternationalAddressUpdateFieldValue
369
382
  ]).nullish();
370
- var FileFieldValueWithOption = import_zod6.z.object({
383
+ var FileFieldValueWithOption = z6.object({
371
384
  path: FullDocumentPath,
372
- originalFilename: import_zod6.z.string(),
373
- type: import_zod6.z.string(),
374
- option: import_zod6.z.string()
375
- });
376
- var FileFieldWithOptionValue = import_zod6.z.array(FileFieldValueWithOption);
377
- var HttpFieldValue = import_zod6.z.object({
378
- loading: import_zod6.z.boolean(),
379
- error: import_zod6.z.object({ statusCode: import_zod6.z.number(), message: import_zod6.z.string() }).nullish(),
380
- data: import_zod6.z.any()
381
- });
382
- var HttpFieldUpdateValue = import_zod6.z.object({
383
- loading: import_zod6.z.boolean().nullish(),
384
- error: import_zod6.z.object({ statusCode: import_zod6.z.number(), message: import_zod6.z.string() }).nullish(),
385
- data: import_zod6.z.any().nullish()
386
- }).or(import_zod6.z.null()).or(import_zod6.z.undefined());
387
- var QueryParamReaderFieldValue = import_zod6.z.object({
388
- data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
385
+ originalFilename: z6.string(),
386
+ type: z6.string(),
387
+ option: z6.string()
388
+ });
389
+ var FileFieldWithOptionValue = z6.array(FileFieldValueWithOption);
390
+ var HttpFieldValue = z6.object({
391
+ loading: z6.boolean(),
392
+ error: z6.object({ statusCode: z6.number(), message: z6.string() }).nullish(),
393
+ data: z6.any()
394
+ });
395
+ var HttpFieldUpdateValue = z6.object({
396
+ loading: z6.boolean().nullish(),
397
+ error: z6.object({ statusCode: z6.number(), message: z6.string() }).nullish(),
398
+ data: z6.any().nullish()
399
+ }).or(z6.null()).or(z6.undefined());
400
+ var QueryParamReaderFieldValue = z6.object({
401
+ data: z6.record(z6.string(), z6.string())
389
402
  }).nullish();
390
- var QueryParamReaderFieldUpdateValue = import_zod6.z.object({
391
- data: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string())
403
+ var QueryParamReaderFieldUpdateValue = z6.object({
404
+ data: z6.record(z6.string(), z6.string())
392
405
  });
393
- var ReadDataValue = import_zod6.z.object({
394
- data: import_zod6.z.any()
406
+ var ReadDataValue = z6.object({
407
+ data: z6.any()
395
408
  });
396
409
  var QrReaderFieldValue = ReadDataValue;
397
410
  var IdReaderFieldValue = ReadDataValue;
398
- var NumberWithUnitFieldValue = import_zod6.z.object({
399
- numericValue: import_zod6.z.number(),
400
- unit: import_zod6.z.string()
411
+ var NumberWithUnitFieldValue = z6.object({
412
+ numericValue: z6.number(),
413
+ unit: z6.string()
401
414
  });
402
- var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
403
- numericValue: import_zod6.z.number().optional(),
404
- unit: import_zod6.z.string().optional()
415
+ var NumberWithUnitFieldUpdateValue = z6.object({
416
+ numericValue: z6.number().optional(),
417
+ unit: z6.string().optional()
405
418
  });
419
+ var CustomFieldValue = z6.unknown().brand("CustomFieldValue");
406
420
 
407
421
  // ../commons/src/events/FieldValue.ts
408
- var TextValue = import_zod7.z.string();
422
+ var TextValue = z7.string();
423
+ var HiddenFieldValue = z7.string();
409
424
  var NonEmptyTextValue = TextValue.min(1);
410
- var DateValue = import_zod7.z.string().date().describe("Date in the format YYYY-MM-DD");
411
- var AgeValue = import_zod7.z.object({
412
- age: import_zod7.z.number(),
413
- asOfDateRef: import_zod7.z.string()
425
+ var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
426
+ var AgeValue = z7.object({
427
+ age: z7.number(),
428
+ asOfDateRef: z7.string()
414
429
  });
415
430
  var AgeUpdateValue = AgeValue.optional().nullable();
416
- var TimeValue = import_zod7.z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
417
- var DatetimeValue = import_zod7.z.string().datetime();
418
- var SelectDateRangeValue = import_zod7.z.enum([
431
+ var TimeValue = z7.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
432
+ var DatetimeValue = z7.iso.datetime();
433
+ var SelectDateRangeValue = z7.enum([
419
434
  "last7Days",
420
435
  "last30Days",
421
436
  "last90Days",
422
437
  "last365Days"
423
438
  ]);
424
- var DateRangeFieldValue = import_zod7.z.object({
439
+ var DateRangeFieldValue = z7.object({
425
440
  start: DateValue,
426
441
  end: DateValue
427
442
  }).or(DateValue).describe(
428
443
  "Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
429
444
  );
430
- var EmailValue = import_zod7.z.string().email();
431
- var CheckboxFieldValue = import_zod7.z.boolean();
432
- var NumberFieldValue = import_zod7.z.number();
433
- var SignatureFieldValue = import_zod7.z.string();
434
- var ButtonFieldValue = import_zod7.z.number();
435
- var VerificationStatusValue = import_zod7.z.enum([
445
+ var EmailValue = z7.email();
446
+ var CheckboxFieldValue = z7.boolean();
447
+ var NumberFieldValue = z7.number();
448
+ var SignatureFieldValue = z7.string();
449
+ var ButtonFieldValue = z7.number();
450
+ var VerificationStatusValue = z7.enum([
436
451
  "verified",
437
452
  "authenticated",
438
453
  "failed",
439
454
  "pending"
440
455
  ]);
441
- var FieldValuesWithoutDataField = import_zod7.z.union([
456
+ var FieldValuesWithoutDataField = z7.union([
442
457
  AddressFieldValue,
443
458
  TextValue,
444
459
  DateValue,
@@ -459,12 +474,13 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
459
474
  QrReaderFieldValue,
460
475
  IdReaderFieldValue,
461
476
  NumberWithUnitFieldValue,
462
- NumberWithUnitFieldUpdateValue
477
+ NumberWithUnitFieldUpdateValue,
478
+ CustomFieldValue
463
479
  ]);
464
- var DataFieldValue = import_zod7.z.object({
465
- data: import_zod7.z.record(import_zod7.z.string(), FieldValuesWithoutDataField)
480
+ var DataFieldValue = z7.object({
481
+ data: z7.record(z7.string(), FieldValuesWithoutDataField)
466
482
  }).nullish();
467
- var FieldValue = import_zod7.z.union([
483
+ var FieldValue = z7.union([
468
484
  FieldValuesWithoutDataField,
469
485
  DataFieldValue
470
486
  ]);
@@ -485,22 +501,38 @@ var PRIORITY_ORDER = [
485
501
  "DataFieldValue"
486
502
  ];
487
503
  function schemaPriority(schema) {
488
- const name = schema._def?.description;
504
+ const name = schema.description;
505
+ if (!name) {
506
+ return 9999;
507
+ }
489
508
  const idx = PRIORITY_ORDER.indexOf(name);
490
509
  return idx === -1 ? 9999 : idx;
491
510
  }
492
511
  function safeUnion(schemas) {
493
- return import_zod7.z.custom((val) => {
512
+ return z7.any().superRefine((val, ctx) => {
494
513
  const successful = schemas.filter((s) => s.safeParse(val).success);
495
514
  if (successful.length === 1) {
496
- return true;
515
+ return;
497
516
  }
498
517
  if (successful.length === 0) {
499
- return false;
518
+ ctx.addIssue({
519
+ code: "invalid_type",
520
+ expected: "custom",
521
+ message: "Value does not match any schema"
522
+ });
523
+ return;
500
524
  }
501
525
  successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
502
526
  const best = successful[0];
503
- return best.safeParse(val).success;
527
+ if (!best.safeParse(val).success) {
528
+ ctx.addIssue({
529
+ expected: "custom",
530
+ code: "invalid_type",
531
+ message: "Value did not match the best schema"
532
+ });
533
+ }
534
+ }).meta({
535
+ description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
504
536
  });
505
537
  }
506
538
  var FieldUpdateValue = safeUnion([
@@ -519,24 +551,23 @@ var FieldUpdateValue = safeUnion([
519
551
  DataFieldValue.describe("DataFieldValue"),
520
552
  NameFieldUpdateValue.describe("NameFieldUpdateValue"),
521
553
  HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
522
- QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
554
+ QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
555
+ CustomFieldValue.describe("CustomFieldValue"),
556
+ HiddenFieldValue.describe("HiddenFieldValue")
523
557
  ]);
524
558
 
525
- // ../commons/src/events/FieldConfig.ts
526
- var import_zod_openapi6 = require("zod-openapi");
527
-
528
559
  // ../commons/src/uuid.ts
529
560
  var import_uuid = require("uuid");
530
- var import_zod8 = require("zod");
531
- var UUID = import_zod8.z.string().uuid().brand("UUID");
561
+ var z8 = __toESM(require("zod/v4"));
562
+ var UUID = z8.uuid().brand("UUID");
532
563
  function getUUID() {
533
564
  return (0, import_uuid.v4)();
534
565
  }
535
566
 
536
567
  // ../commons/src/events/serializers/user/serializer.ts
537
- var import_zod9 = require("zod");
538
- var SerializedUserField = import_zod9.z.object({
539
- $userField: import_zod9.z.enum([
568
+ var z9 = __toESM(require("zod/v4"));
569
+ var SerializedUserField = z9.object({
570
+ $userField: z9.enum([
540
571
  "id",
541
572
  "name",
542
573
  "role",
@@ -545,11 +576,12 @@ var SerializedUserField = import_zod9.z.object({
545
576
  "firstname",
546
577
  "middlename",
547
578
  "surname",
548
- "district",
549
- "province",
550
- "primaryOfficeId"
579
+ "signature",
580
+ "avatar",
581
+ "primaryOfficeId",
582
+ "administrativeAreaId"
551
583
  ]),
552
- $location: import_zod9.z.string().optional()
584
+ $location: z9.string().optional()
553
585
  });
554
586
  function userSerializer(userField) {
555
587
  return {
@@ -569,24 +601,23 @@ function userSerializer(userField) {
569
601
  }
570
602
 
571
603
  // ../commons/src/events/EventIndex.ts
572
- var import_zod14 = require("zod");
604
+ var import_v4 = require("zod/v4");
573
605
 
574
606
  // ../commons/src/events/EventMetadata.ts
575
- var import_zod13 = require("zod");
607
+ var z14 = __toESM(require("zod/v4"));
576
608
 
577
609
  // ../commons/src/events/ActionDocument.ts
578
- var import_zod12 = require("zod");
579
- var import_zod_openapi4 = require("zod-openapi");
610
+ var z12 = __toESM(require("zod/v4"));
580
611
 
581
612
  // ../commons/src/events/CreatedAtLocation.ts
582
613
  var CreatedAtLocation = UUID.nullish();
583
614
 
584
615
  // ../commons/src/authentication.ts
585
616
  var import_jwt_decode = __toESM(require("jwt-decode"));
586
- var import_zod11 = require("zod");
617
+ var z11 = __toESM(require("zod/v4"));
587
618
 
588
619
  // ../commons/src/scopes.ts
589
- var import_zod10 = require("zod");
620
+ var z10 = __toESM(require("zod/v4"));
590
621
  var SCOPES = {
591
622
  // TODO v1.8 legacy scopes
592
623
  BYPASSRATELIMIT: "bypassratelimit",
@@ -665,91 +696,91 @@ var SCOPES = {
665
696
  // data seeding
666
697
  USER_DATA_SEEDING: "user.data-seeding"
667
698
  };
668
- var LegacyScopes = import_zod10.z.union([
669
- import_zod10.z.literal(SCOPES.BYPASSRATELIMIT),
670
- import_zod10.z.literal(SCOPES.REGISTER),
671
- import_zod10.z.literal(SCOPES.DEMO),
672
- import_zod10.z.literal(SCOPES.CONFIG)
699
+ var LegacyScopes = z10.union([
700
+ z10.literal(SCOPES.BYPASSRATELIMIT),
701
+ z10.literal(SCOPES.REGISTER),
702
+ z10.literal(SCOPES.DEMO),
703
+ z10.literal(SCOPES.CONFIG)
673
704
  ]);
674
- var IntegrationScopes = import_zod10.z.union([
675
- import_zod10.z.literal(SCOPES.WEBHOOK),
676
- import_zod10.z.literal(SCOPES.NATIONALID),
677
- import_zod10.z.literal(SCOPES.NOTIFICATION_API),
678
- import_zod10.z.literal(SCOPES.RECORDSEARCH)
705
+ var IntegrationScopes = z10.union([
706
+ z10.literal(SCOPES.WEBHOOK),
707
+ z10.literal(SCOPES.NATIONALID),
708
+ z10.literal(SCOPES.NOTIFICATION_API),
709
+ z10.literal(SCOPES.RECORDSEARCH)
679
710
  ]);
680
- var InternalOperationsScopes = import_zod10.z.union([
681
- import_zod10.z.literal(SCOPES.RECORD_REINDEX),
682
- import_zod10.z.literal(SCOPES.RECORD_IMPORT)
711
+ var InternalOperationsScopes = z10.union([
712
+ z10.literal(SCOPES.RECORD_REINDEX),
713
+ z10.literal(SCOPES.RECORD_IMPORT)
683
714
  ]);
684
- var DeclareScopes = import_zod10.z.union([
685
- import_zod10.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
686
- import_zod10.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
687
- import_zod10.z.literal(SCOPES.RECORD_DECLARE_DEATH),
688
- import_zod10.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
689
- import_zod10.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
690
- import_zod10.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
691
- import_zod10.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
692
- import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
715
+ var DeclareScopes = z10.union([
716
+ z10.literal(SCOPES.RECORD_DECLARE_BIRTH),
717
+ z10.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
718
+ z10.literal(SCOPES.RECORD_DECLARE_DEATH),
719
+ z10.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
720
+ z10.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
721
+ z10.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
722
+ z10.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
723
+ z10.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
693
724
  ]);
694
- var UnassignScope = import_zod10.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
695
- var ValidateScopes = import_zod10.z.union([
696
- import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
697
- import_zod10.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
698
- import_zod10.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
699
- import_zod10.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
700
- import_zod10.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
701
- import_zod10.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
725
+ var UnassignScope = z10.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
726
+ var ValidateScopes = z10.union([
727
+ z10.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
728
+ z10.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
729
+ z10.literal(SCOPES.RECORD_DECLARATION_EDIT),
730
+ z10.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
731
+ z10.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
732
+ z10.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
702
733
  ]);
703
- var RegisterScope = import_zod10.z.literal(SCOPES.RECORD_REGISTER);
704
- var CorrectionScopes = import_zod10.z.union([
705
- import_zod10.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
706
- import_zod10.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
707
- import_zod10.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
708
- import_zod10.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
734
+ var RegisterScope = z10.literal(SCOPES.RECORD_REGISTER);
735
+ var CorrectionScopes = z10.union([
736
+ z10.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
737
+ z10.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
738
+ z10.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
739
+ z10.literal(SCOPES.RECORD_REJECT_REGISTRATION)
709
740
  ]);
710
- var SearchScopes = import_zod10.z.union([
711
- import_zod10.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
712
- import_zod10.z.literal(SCOPES.SEARCH_BIRTH),
713
- import_zod10.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
714
- import_zod10.z.literal(SCOPES.SEARCH_DEATH),
715
- import_zod10.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
716
- import_zod10.z.literal(SCOPES.SEARCH_MARRIAGE)
741
+ var SearchScopes = z10.union([
742
+ z10.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
743
+ z10.literal(SCOPES.SEARCH_BIRTH),
744
+ z10.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
745
+ z10.literal(SCOPES.SEARCH_DEATH),
746
+ z10.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
747
+ z10.literal(SCOPES.SEARCH_MARRIAGE)
717
748
  ]);
718
- var AuditScopes = import_zod10.z.literal(SCOPES.RECORD_READ);
719
- var PerformanceScopes = import_zod10.z.union([
720
- import_zod10.z.literal(SCOPES.PERFORMANCE_READ),
721
- import_zod10.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
722
- import_zod10.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
749
+ var AuditScopes = z10.literal(SCOPES.RECORD_READ);
750
+ var PerformanceScopes = z10.union([
751
+ z10.literal(SCOPES.PERFORMANCE_READ),
752
+ z10.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
753
+ z10.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
723
754
  ]);
724
- var OrganisationScopes = import_zod10.z.union([
725
- import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
726
- import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
727
- import_zod10.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
755
+ var OrganisationScopes = z10.union([
756
+ z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
757
+ z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
758
+ z10.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
728
759
  ]);
729
- var UserScopes = import_zod10.z.union([
730
- import_zod10.z.literal(SCOPES.USER_READ),
731
- import_zod10.z.literal(SCOPES.USER_READ_MY_OFFICE),
732
- import_zod10.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
733
- import_zod10.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
734
- import_zod10.z.literal(SCOPES.USER_CREATE),
735
- import_zod10.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
736
- import_zod10.z.literal(SCOPES.USER_UPDATE),
737
- import_zod10.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
760
+ var UserScopes = z10.union([
761
+ z10.literal(SCOPES.USER_READ),
762
+ z10.literal(SCOPES.USER_READ_MY_OFFICE),
763
+ z10.literal(SCOPES.USER_READ_MY_JURISDICTION),
764
+ z10.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
765
+ z10.literal(SCOPES.USER_CREATE),
766
+ z10.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
767
+ z10.literal(SCOPES.USER_UPDATE),
768
+ z10.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
738
769
  ]);
739
- var ConfigScope = import_zod10.z.literal(SCOPES.CONFIG_UPDATE_ALL);
740
- var DataSeedingScope = import_zod10.z.literal(SCOPES.USER_DATA_SEEDING);
741
- var LiteralScopes = import_zod10.z.union([
770
+ var ConfigScope = z10.literal(SCOPES.CONFIG_UPDATE_ALL);
771
+ var DataSeedingScope = z10.literal(SCOPES.USER_DATA_SEEDING);
772
+ var LiteralScopes = z10.union([
742
773
  LegacyScopes,
743
774
  IntegrationScopes,
744
775
  UnassignScope,
745
776
  DeclareScopes,
746
777
  ValidateScopes,
747
778
  RegisterScope,
748
- import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
779
+ z10.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
749
780
  CorrectionScopes,
750
781
  SearchScopes,
751
782
  AuditScopes,
752
- import_zod10.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
783
+ z10.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
753
784
  PerformanceScopes,
754
785
  OrganisationScopes,
755
786
  UserScopes,
@@ -758,38 +789,44 @@ var LiteralScopes = import_zod10.z.union([
758
789
  InternalOperationsScopes
759
790
  ]);
760
791
  var rawConfigurableScopeRegex = /^([a-zA-Z][a-zA-Z0-9.-]*(?:\.[a-zA-Z0-9.-]+)*)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
761
- var rawConfigurableScope = import_zod10.z.string().regex(rawConfigurableScopeRegex);
762
- var CreateUserScope = import_zod10.z.object({
763
- type: import_zod10.z.literal("user.create"),
764
- options: import_zod10.z.object({
765
- role: import_zod10.z.array(import_zod10.z.string())
792
+ var rawConfigurableScope = z10.string().regex(rawConfigurableScopeRegex);
793
+ var CreateUserScope = z10.object({
794
+ type: z10.literal("user.create"),
795
+ options: z10.object({
796
+ role: z10.array(z10.string())
766
797
  })
767
798
  });
768
- var EditUserScope = import_zod10.z.object({
769
- type: import_zod10.z.literal("user.edit"),
770
- options: import_zod10.z.object({
771
- role: import_zod10.z.array(import_zod10.z.string())
799
+ var EditUserScope = z10.object({
800
+ type: z10.literal("user.edit"),
801
+ options: z10.object({
802
+ role: z10.array(z10.string())
772
803
  })
773
804
  });
774
- var WorkqueueScope = import_zod10.z.object({
775
- type: import_zod10.z.literal("workqueue"),
776
- options: import_zod10.z.object({
777
- id: import_zod10.z.array(import_zod10.z.string())
805
+ var WorkqueueScope = z10.object({
806
+ type: z10.literal("workqueue"),
807
+ options: z10.object({
808
+ id: z10.array(z10.string())
778
809
  })
779
810
  });
780
- var SearchScope = import_zod10.z.object({
781
- type: import_zod10.z.literal("search"),
782
- options: import_zod10.z.object({
783
- event: import_zod10.z.array(import_zod10.z.string()).length(1),
784
- access: import_zod10.z.array(import_zod10.z.enum(["my-jurisdiction", "all"])).length(1)
811
+ var SearchScope = z10.object({
812
+ type: z10.literal("search"),
813
+ options: z10.object({
814
+ event: z10.array(z10.string()).length(1),
815
+ access: z10.array(z10.enum(["my-jurisdiction", "all"])).length(1)
785
816
  })
786
817
  });
787
- var RecordScopeType = import_zod10.z.enum([
818
+ var DashboardScope = z10.object({
819
+ type: z10.literal("dashboard.view"),
820
+ options: z10.object({
821
+ id: z10.array(z10.string())
822
+ })
823
+ });
824
+ var RecordScopeType = z10.enum([
788
825
  "record.create",
789
826
  "record.read",
790
827
  "record.declare",
791
828
  "record.notify",
792
- "record.declared.validate",
829
+ "record.declared.edit",
793
830
  "record.declared.reject",
794
831
  "record.declared.archive",
795
832
  "record.declared.review-duplicates",
@@ -799,27 +836,41 @@ var RecordScopeType = import_zod10.z.enum([
799
836
  "record.registered.correct",
800
837
  "record.unassign-others"
801
838
  ]);
802
- var RecordScope = import_zod10.z.object({
839
+ var RecordScope = z10.object({
803
840
  type: RecordScopeType,
804
- options: import_zod10.z.object({
805
- event: import_zod10.z.array(import_zod10.z.string()).describe("Event type, e.g. birth, death")
841
+ options: z10.object({
842
+ event: z10.array(z10.string()).describe("Event type, e.g. birth, death")
806
843
  })
807
844
  }).describe(
808
845
  "Scopes used to check user's permission to perform actions on a record."
809
846
  );
810
- var ConfigurableRawScopes = import_zod10.z.discriminatedUnion("type", [
847
+ var CustomActionScope = z10.object({
848
+ type: z10.literal("record.custom-action"),
849
+ options: z10.object({
850
+ event: z10.array(z10.string()).describe("Allowed event type, e.g. birth, death"),
851
+ customActionType: z10.array(z10.string()).describe("Allowed custom action types")
852
+ })
853
+ });
854
+ var ConfigurableRawScopes = z10.discriminatedUnion("type", [
811
855
  SearchScope,
812
856
  CreateUserScope,
813
857
  EditUserScope,
814
858
  WorkqueueScope,
815
- RecordScope
859
+ DashboardScope,
860
+ RecordScope,
861
+ CustomActionScope
862
+ ]);
863
+ var ConfigurableActionScopes = z10.discriminatedUnion("type", [
864
+ // @TODO - Record scope holds non-action scopes as well e.g., `record.read`
865
+ RecordScope,
866
+ CustomActionScope
816
867
  ]);
817
868
  var scopes = Object.values(SCOPES);
818
- var ActionScopes = import_zod10.z.union([
869
+ var ActionScopes = z10.union([
819
870
  DeclareScopes,
820
871
  ValidateScopes,
821
872
  RegisterScope,
822
- import_zod10.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
873
+ z10.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
823
874
  CorrectionScopes
824
875
  ]);
825
876
 
@@ -953,15 +1004,14 @@ var DEFAULT_ROLES_DEFINITION = [
953
1004
  ]
954
1005
  }
955
1006
  ];
956
- var TokenUserType = import_zod11.z.enum(["user", "system"]);
957
- var TokenWithBearer = import_zod11.z.string().regex(/^Bearer\s/);
1007
+ var TokenUserType = z11.enum(["user", "system"]);
1008
+ var TokenWithBearer = z11.string().regex(/^Bearer\s/);
958
1009
 
959
1010
  // ../commons/src/events/ActionDocument.ts
960
- (0, import_zod_openapi4.extendZodWithOpenApi)(import_zod12.z);
961
- var ActionUpdate = import_zod12.z.record(import_zod12.z.string(), FieldUpdateValue).describe(
1011
+ var ActionUpdate = z12.record(z12.string(), FieldUpdateValue).describe(
962
1012
  "Record of field-level changes made by an action. Supports partial updates and nullable values."
963
1013
  );
964
- var EventState = import_zod12.z.record(import_zod12.z.string(), FieldValue).describe(
1014
+ var EventState = z12.record(z12.string(), FieldValue).describe(
965
1015
  "Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."
966
1016
  );
967
1017
  var ActionStatus = {
@@ -969,16 +1019,16 @@ var ActionStatus = {
969
1019
  Accepted: "Accepted",
970
1020
  Rejected: "Rejected"
971
1021
  };
972
- var ActionBase = import_zod12.z.object({
1022
+ var ActionBase = z12.object({
973
1023
  id: UUID.describe("Unique identifier of the action."),
974
- transactionId: import_zod12.z.string().describe("Unique identifier of the transaction."),
1024
+ transactionId: z12.string().describe("Unique identifier of the transaction."),
975
1025
  createdByUserType: TokenUserType.describe(
976
1026
  "Indicates whether the action was created by a human-user or by a system-user."
977
1027
  ),
978
- createdAt: import_zod12.z.string().datetime().describe("Timestamp indicating when the action was created."),
979
- createdBy: import_zod12.z.string().describe("Identifier of the user who created the action."),
980
- createdByRole: import_zod12.z.string().describe("Role of the user who created the action."),
981
- createdBySignature: import_zod12.z.string().nullish().describe("Reference to the signature of the user who created the action."),
1028
+ createdAt: z12.string().datetime().describe("Timestamp indicating when the action was created."),
1029
+ createdBy: z12.string().describe("Identifier of the user who created the action."),
1030
+ createdByRole: z12.string().describe("Role of the user who created the action."),
1031
+ createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
982
1032
  createdAtLocation: CreatedAtLocation.describe(
983
1033
  "Reference to the location of the user who created the action."
984
1034
  ),
@@ -986,7 +1036,7 @@ var ActionBase = import_zod12.z.object({
986
1036
  "Declaration data defined by the ActionConfig. Supports partial updates."
987
1037
  ),
988
1038
  annotation: ActionUpdate.optional().nullable().describe("Action-specific metadata used to annotate the event."),
989
- status: import_zod12.z.enum([
1039
+ status: z12.enum([
990
1040
  ActionStatus.Requested,
991
1041
  ActionStatus.Accepted,
992
1042
  ActionStatus.Rejected
@@ -997,172 +1047,181 @@ var ActionBase = import_zod12.z.object({
997
1047
  "Reference to the original action asynchronously accepted or rejected by a third-party integration."
998
1048
  )
999
1049
  });
1000
- var AssignedAction = ActionBase.merge(
1001
- import_zod12.z.object({
1002
- type: import_zod12.z.literal(ActionType.ASSIGN),
1003
- assignedTo: import_zod12.z.string().describe("Identifier of the user to whom the action is assigned.")
1050
+ var AssignedAction = ActionBase.extend(
1051
+ z12.object({
1052
+ type: z12.literal(ActionType.ASSIGN),
1053
+ assignedTo: z12.string().describe("Identifier of the user to whom the action is assigned.")
1004
1054
  // TODO move into 'content' property
1005
- })
1055
+ }).shape
1006
1056
  );
1007
- var UnassignedAction = ActionBase.merge(
1008
- import_zod12.z.object({
1009
- type: import_zod12.z.literal(ActionType.UNASSIGN)
1010
- })
1057
+ var UnassignedAction = ActionBase.extend(
1058
+ z12.object({
1059
+ type: z12.literal(ActionType.UNASSIGN)
1060
+ }).shape
1011
1061
  );
1012
- var RegisterAction = ActionBase.merge(
1013
- import_zod12.z.object({
1014
- type: import_zod12.z.literal(ActionType.REGISTER),
1015
- registrationNumber: import_zod12.z.string().optional().describe(
1062
+ var RegisterAction = ActionBase.extend(
1063
+ z12.object({
1064
+ type: z12.literal(ActionType.REGISTER),
1065
+ registrationNumber: z12.string().optional().describe(
1016
1066
  "Registration number of the event. Always present for accepted registrations."
1017
1067
  )
1018
1068
  // TODO move into 'content' property
1019
- })
1020
- );
1021
- var DeclareAction = ActionBase.merge(
1022
- import_zod12.z.object({
1023
- type: import_zod12.z.literal(ActionType.DECLARE)
1024
- })
1069
+ }).shape
1025
1070
  );
1026
- var ValidateAction = ActionBase.merge(
1027
- import_zod12.z.object({
1028
- type: import_zod12.z.literal(ActionType.VALIDATE)
1029
- })
1071
+ var DeclareAction = ActionBase.extend(
1072
+ z12.object({
1073
+ type: z12.literal(ActionType.DECLARE)
1074
+ }).shape
1030
1075
  );
1031
- var ReasonContent = import_zod12.z.object({
1032
- reason: import_zod12.z.string().min(1, { message: "Message cannot be empty" }).describe(
1076
+ var ReasonContent = z12.object({
1077
+ reason: z12.string().min(1, { error: "Message cannot be empty" }).describe(
1033
1078
  "Message describing the reason for rejecting or archiving the event."
1034
1079
  )
1035
1080
  });
1036
- var RejectAction = ActionBase.merge(
1037
- import_zod12.z.object({
1038
- type: import_zod12.z.literal(ActionType.REJECT),
1081
+ var RejectAction = ActionBase.extend(
1082
+ z12.object({
1083
+ type: z12.literal(ActionType.REJECT),
1039
1084
  content: ReasonContent
1040
- })
1085
+ }).shape
1041
1086
  );
1042
- var PotentialDuplicate = import_zod12.z.object({
1087
+ var PotentialDuplicate = z12.object({
1043
1088
  id: UUID,
1044
- trackingId: import_zod12.z.string()
1089
+ trackingId: z12.string()
1045
1090
  });
1046
- var DuplicateDetectedAction = ActionBase.merge(
1047
- import_zod12.z.object({
1048
- type: import_zod12.z.literal(ActionType.DUPLICATE_DETECTED),
1049
- content: import_zod12.z.object({
1050
- duplicates: import_zod12.z.array(PotentialDuplicate)
1091
+ var DuplicateDetectedAction = ActionBase.extend(
1092
+ z12.object({
1093
+ type: z12.literal(ActionType.DUPLICATE_DETECTED),
1094
+ content: z12.object({
1095
+ duplicates: z12.array(PotentialDuplicate)
1051
1096
  })
1052
- })
1097
+ }).shape
1053
1098
  );
1054
- var MarkNotDuplicateAction = ActionBase.merge(
1055
- import_zod12.z.object({
1056
- type: import_zod12.z.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1057
- })
1099
+ var MarkNotDuplicateAction = ActionBase.extend(
1100
+ z12.object({
1101
+ type: z12.literal(ActionType.MARK_AS_NOT_DUPLICATE)
1102
+ }).shape
1058
1103
  );
1059
- var MarkAsDuplicateAction = ActionBase.merge(
1060
- import_zod12.z.object({
1061
- type: import_zod12.z.literal(ActionType.MARK_AS_DUPLICATE),
1062
- content: import_zod12.z.object({
1104
+ var MarkAsDuplicateAction = ActionBase.extend(
1105
+ z12.object({
1106
+ type: z12.literal(ActionType.MARK_AS_DUPLICATE),
1107
+ content: z12.object({
1063
1108
  duplicateOf: UUID
1064
1109
  }).optional()
1065
- })
1110
+ }).shape
1066
1111
  );
1067
- var ArchiveAction = ActionBase.merge(
1068
- import_zod12.z.object({
1069
- type: import_zod12.z.literal(ActionType.ARCHIVE),
1112
+ var ArchiveAction = ActionBase.extend(
1113
+ z12.object({
1114
+ type: z12.literal(ActionType.ARCHIVE),
1070
1115
  content: ReasonContent
1071
- })
1116
+ }).shape
1072
1117
  );
1073
- var CreatedAction = ActionBase.merge(
1074
- import_zod12.z.object({
1075
- type: import_zod12.z.literal(ActionType.CREATE)
1076
- })
1118
+ var CreatedAction = ActionBase.extend(
1119
+ z12.object({
1120
+ type: z12.literal(ActionType.CREATE)
1121
+ }).shape
1077
1122
  );
1078
- var NotifiedAction = ActionBase.merge(
1079
- import_zod12.z.object({
1080
- type: import_zod12.z.literal(ActionType.NOTIFY)
1081
- })
1123
+ var NotifiedAction = ActionBase.extend(
1124
+ z12.object({
1125
+ type: z12.literal(ActionType.NOTIFY)
1126
+ }).shape
1082
1127
  );
1083
- var PrintContent = import_zod12.z.object({
1084
- templateId: import_zod12.z.string().optional()
1128
+ var EditAction = ActionBase.extend(
1129
+ z12.object({
1130
+ type: z12.literal(ActionType.EDIT),
1131
+ content: z12.object({
1132
+ comment: z12.string().describe("Comment for the edit action.").optional()
1133
+ })
1134
+ }).shape
1135
+ );
1136
+ var PrintContent = z12.object({
1137
+ templateId: z12.string().optional()
1085
1138
  });
1086
- var PrintCertificateAction = ActionBase.merge(
1087
- import_zod12.z.object({
1088
- type: import_zod12.z.literal(ActionType.PRINT_CERTIFICATE),
1139
+ var PrintCertificateAction = ActionBase.extend(
1140
+ z12.object({
1141
+ type: z12.literal(ActionType.PRINT_CERTIFICATE),
1089
1142
  content: PrintContent.optional().nullable()
1090
- })
1143
+ }).shape
1091
1144
  );
1092
- var RequestedCorrectionAction = ActionBase.merge(
1093
- import_zod12.z.object({
1094
- type: import_zod12.z.literal(ActionType.REQUEST_CORRECTION)
1095
- })
1145
+ var RequestedCorrectionAction = ActionBase.extend(
1146
+ z12.object({
1147
+ type: z12.literal(ActionType.REQUEST_CORRECTION)
1148
+ }).shape
1096
1149
  );
1097
- var ApprovedCorrectionAction = ActionBase.merge(
1098
- import_zod12.z.object({
1099
- type: import_zod12.z.literal(ActionType.APPROVE_CORRECTION),
1100
- requestId: import_zod12.z.string()
1150
+ var ApprovedCorrectionAction = ActionBase.extend(
1151
+ z12.object({
1152
+ type: z12.literal(ActionType.APPROVE_CORRECTION),
1153
+ requestId: z12.string()
1101
1154
  // TODO move into 'content' property
1102
- })
1155
+ }).shape
1103
1156
  );
1104
- var RejectedCorrectionAction = ActionBase.merge(
1105
- import_zod12.z.object({
1106
- type: import_zod12.z.literal(ActionType.REJECT_CORRECTION),
1107
- requestId: import_zod12.z.string(),
1157
+ var RejectedCorrectionAction = ActionBase.extend(
1158
+ z12.object({
1159
+ type: z12.literal(ActionType.REJECT_CORRECTION),
1160
+ requestId: z12.string(),
1108
1161
  // TODO move into 'content' property
1109
1162
  content: ReasonContent
1110
- })
1163
+ }).shape
1111
1164
  );
1112
- var ReadAction = ActionBase.merge(
1113
- import_zod12.z.object({
1114
- type: import_zod12.z.literal(ActionType.READ)
1165
+ var ReadAction = ActionBase.extend(
1166
+ z12.object({
1167
+ type: z12.literal(ActionType.READ)
1168
+ }).shape
1169
+ );
1170
+ var CustomAction = ActionBase.merge(
1171
+ z12.object({
1172
+ type: z12.literal(ActionType.CUSTOM),
1173
+ customActionType: z12.string()
1115
1174
  })
1116
1175
  );
1117
- var ActionDocument = import_zod12.z.discriminatedUnion("type", [
1118
- CreatedAction.openapi({ ref: "CreatedAction" }),
1119
- ValidateAction.openapi({ ref: "ValidateAction" }),
1120
- RejectAction.openapi({ ref: "RejectAction" }),
1121
- DuplicateDetectedAction.openapi({ ref: "DuplicateDetectedAction" }),
1122
- MarkNotDuplicateAction.openapi({ ref: "MarkNotDuplicateAction" }),
1123
- MarkAsDuplicateAction.openapi({ ref: "MarkAsDuplicateAction" }),
1124
- ArchiveAction.openapi({ ref: "ArchiveAction" }),
1125
- NotifiedAction.openapi({ ref: "NotifiedAction" }),
1126
- RegisterAction.openapi({ ref: "RegisterAction" }),
1127
- DeclareAction.openapi({ ref: "DeclareAction" }),
1128
- AssignedAction.openapi({ ref: "AssignedAction" }),
1129
- RequestedCorrectionAction.openapi({ ref: "RequestedCorrectionAction" }),
1130
- ApprovedCorrectionAction.openapi({ ref: "ApprovedCorrectionAction" }),
1131
- RejectedCorrectionAction.openapi({ ref: "RejectedCorrectionAction" }),
1132
- UnassignedAction.openapi({ ref: "UnassignedAction" }),
1133
- PrintCertificateAction.openapi({ ref: "PrintCertificateAction" }),
1134
- ReadAction.openapi({ ref: "ReadAction" })
1135
- ]).openapi({
1136
- ref: "ActionDocument"
1176
+ var ActionDocument = z12.discriminatedUnion("type", [
1177
+ CreatedAction.meta({ id: "CreatedAction" }),
1178
+ RejectAction.meta({ id: "RejectAction" }),
1179
+ DuplicateDetectedAction.meta({ id: "DuplicateDetectedAction" }),
1180
+ MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
1181
+ MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
1182
+ ArchiveAction.meta({ id: "ArchiveAction" }),
1183
+ NotifiedAction.meta({ id: "NotifiedAction" }),
1184
+ RegisterAction.meta({ id: "RegisterAction" }),
1185
+ DeclareAction.meta({ id: "DeclareAction" }),
1186
+ AssignedAction.meta({ id: "AssignedAction" }),
1187
+ RequestedCorrectionAction.meta({ id: "RequestedCorrectionAction" }),
1188
+ ApprovedCorrectionAction.meta({ id: "ApprovedCorrectionAction" }),
1189
+ RejectedCorrectionAction.meta({ id: "RejectedCorrectionAction" }),
1190
+ UnassignedAction.meta({ id: "UnassignedAction" }),
1191
+ PrintCertificateAction.meta({ id: "PrintCertificateAction" }),
1192
+ ReadAction.meta({ id: "ReadAction" }),
1193
+ EditAction.meta({ id: "EditAction" }),
1194
+ CustomAction.meta({ id: "CustomAction" })
1195
+ ]).meta({
1196
+ id: "ActionDocument"
1137
1197
  });
1138
1198
  var AsyncRejectActionDocument = ActionBase.omit({
1139
1199
  declaration: true,
1140
1200
  annotation: true
1141
- }).merge(
1142
- import_zod12.z.object({
1143
- type: import_zod12.z.enum(ConfirmableActions),
1144
- status: import_zod12.z.literal(ActionStatus.Rejected)
1145
- })
1201
+ }).extend(
1202
+ z12.object({
1203
+ type: z12.enum(ConfirmableActions),
1204
+ status: z12.literal(ActionStatus.Rejected)
1205
+ }).shape
1146
1206
  );
1147
- var Action = import_zod12.z.union([ActionDocument, AsyncRejectActionDocument]);
1207
+ var Action = z12.union([ActionDocument, AsyncRejectActionDocument]);
1148
1208
 
1149
- // ../commons/src/events/EventMetadata.ts
1150
- var EventStatus = import_zod13.z.enum([
1151
- "CREATED",
1152
- "NOTIFIED",
1153
- "DECLARED",
1154
- "VALIDATED",
1155
- "REGISTERED",
1156
- "ARCHIVED"
1157
- ]);
1209
+ // ../commons/src/events/Flag.ts
1210
+ var z13 = __toESM(require("zod/v4"));
1158
1211
  var InherentFlags = {
1159
- PENDING_CERTIFICATION: "pending-certification",
1160
1212
  INCOMPLETE: "incomplete",
1161
1213
  REJECTED: "rejected",
1162
1214
  CORRECTION_REQUESTED: "correction-requested",
1163
- POTENTIAL_DUPLICATE: "potential-duplicate"
1215
+ POTENTIAL_DUPLICATE: "potential-duplicate",
1216
+ /**
1217
+ * This flag is set by the Edit-action and removed after the declaration or registration.
1218
+ * A record should never stay with the EDIT_IN_PROGRESS flag, since it should always be declared or registered right after.
1219
+ *
1220
+ * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
1221
+ */
1222
+ EDIT_IN_PROGRESS: "edit-in-progress"
1164
1223
  };
1165
- var ActionFlag = import_zod13.z.string().regex(
1224
+ var ActionFlag = z13.string().regex(
1166
1225
  new RegExp(
1167
1226
  `^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
1168
1227
  ActionStatus
@@ -1170,59 +1229,90 @@ var ActionFlag = import_zod13.z.string().regex(
1170
1229
  ),
1171
1230
  "Flag must be in the format ActionType:ActionStatus (lowerCase)"
1172
1231
  );
1173
- var Flag = ActionFlag.or(import_zod13.z.nativeEnum(InherentFlags));
1174
- var ZodDate = import_zod13.z.string().date();
1175
- var ActionCreationMetadata = import_zod13.z.object({
1176
- createdAt: import_zod13.z.string().datetime().describe("The timestamp when the action request was created."),
1177
- createdBy: import_zod13.z.string().describe("ID of the user who created the action request."),
1232
+ var CustomFlag = z13.string().refine((val) => !Object.values(InherentFlags).includes(val), {
1233
+ message: `Custom flag cannot be one of the inherent flags: ${Object.values(
1234
+ InherentFlags
1235
+ ).join(", ")}`
1236
+ }).refine((val) => !ActionFlag.safeParse(val).success, {
1237
+ message: "Custom flag cannot match the ActionFlag pattern (ActionType:ActionStatus)."
1238
+ }).describe("Custom flag identifier defined by the country config.");
1239
+ var Flag = ActionFlag.or(z13.enum(InherentFlags)).or(CustomFlag);
1240
+ var FlagConfig = z13.object({
1241
+ id: CustomFlag,
1242
+ requiresAction: z13.boolean().describe(
1243
+ "Indicates if this flag expects an action to be performed to be cleared."
1244
+ ),
1245
+ label: TranslationConfig.describe("Human readable label of the flag.")
1246
+ });
1247
+ var ActionFlagConfig = z13.object({
1248
+ id: Flag,
1249
+ operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
1250
+ conditional: Conditional.optional().describe(
1251
+ "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1252
+ )
1253
+ });
1254
+
1255
+ // ../commons/src/events/EventMetadata.ts
1256
+ var EventStatus = z14.enum([
1257
+ "CREATED",
1258
+ "NOTIFIED",
1259
+ "DECLARED",
1260
+ "REGISTERED",
1261
+ "ARCHIVED"
1262
+ ]);
1263
+ var ZodDate = z14.iso.date();
1264
+ var ActionCreationMetadata = z14.object({
1265
+ createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
1266
+ createdBy: z14.string().describe("ID of the user who created the action request."),
1178
1267
  createdAtLocation: CreatedAtLocation.describe(
1179
1268
  "Location of the user who created the action request."
1180
1269
  ),
1181
- createdByUserType: import_zod13.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1182
- acceptedAt: import_zod13.z.string().datetime().describe("Timestamp when the action request was accepted."),
1183
- createdByRole: import_zod13.z.string().describe("Role of the user at the time of action request creation."),
1184
- createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the action request.")
1270
+ createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1271
+ acceptedAt: z14.iso.datetime().describe("Timestamp when the action request was accepted."),
1272
+ createdByRole: z14.string().describe("Role of the user at the time of action request creation."),
1273
+ createdBySignature: z14.string().nullish().describe("Signature of the user who created the action request.")
1185
1274
  });
1186
1275
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1187
- registrationNumber: import_zod13.z.string().describe(
1276
+ registrationNumber: z14.string().describe(
1188
1277
  "Registration number of the event. Always present for accepted registrations."
1189
1278
  )
1190
1279
  });
1191
- var LegalStatuses = import_zod13.z.object({
1280
+ var LegalStatuses = z14.object({
1192
1281
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
1193
1282
  [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
1194
1283
  });
1195
- var EventMetadata = import_zod13.z.object({
1284
+ var EventMetadata = z14.object({
1196
1285
  id: UUID,
1197
- type: import_zod13.z.string().describe("The type of event, such as birth, death, or marriage."),
1286
+ type: z14.string().describe("The type of event, such as birth, death, or marriage."),
1198
1287
  status: EventStatus,
1199
1288
  legalStatuses: LegalStatuses.describe(
1200
1289
  "Metadata related to the legal registration of the event, such as who registered it and when."
1201
1290
  ),
1202
- createdAt: import_zod13.z.string().datetime().describe("The timestamp when the event was first created and saved."),
1291
+ createdAt: z14.iso.datetime().describe("The timestamp when the event was first created and saved."),
1203
1292
  dateOfEvent: ZodDate.nullish(),
1204
- createdBy: import_zod13.z.string().describe("ID of the user who created the event."),
1205
- createdByUserType: import_zod13.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1206
- updatedByUserRole: import_zod13.z.string().describe("Role of the user who last changed the status."),
1293
+ placeOfEvent: CreatedAtLocation,
1294
+ createdBy: z14.string().describe("ID of the user who created the event."),
1295
+ createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1296
+ updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
1207
1297
  createdAtLocation: CreatedAtLocation.describe(
1208
1298
  "Location of the user who created the event."
1209
1299
  ),
1210
- createdBySignature: import_zod13.z.string().nullish().describe("Signature of the user who created the event."),
1300
+ createdBySignature: z14.string().nullish().describe("Signature of the user who created the event."),
1211
1301
  updatedAtLocation: UUID.nullish().describe(
1212
1302
  "Location of the user who last changed the status."
1213
1303
  ),
1214
- updatedAt: import_zod13.z.string().datetime().describe(
1304
+ updatedAt: z14.iso.datetime().describe(
1215
1305
  "Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
1216
1306
  ),
1217
- assignedTo: import_zod13.z.string().nullish().describe("ID of the user currently assigned to the event."),
1218
- updatedBy: import_zod13.z.string().nullish().describe("ID of the user who last changed the status."),
1219
- trackingId: import_zod13.z.string().describe(
1307
+ assignedTo: z14.string().nullish().describe("ID of the user currently assigned to the event."),
1308
+ updatedBy: z14.string().nullish().describe("ID of the user who last changed the status."),
1309
+ trackingId: z14.string().describe(
1220
1310
  "System-generated tracking ID used by informants or registrars to look up the event."
1221
1311
  ),
1222
- potentialDuplicates: import_zod13.z.array(PotentialDuplicate).describe(
1312
+ potentialDuplicates: z14.array(PotentialDuplicate).describe(
1223
1313
  "List of event IDs and their tracking IDs that this event could be a duplicate of."
1224
1314
  ),
1225
- flags: import_zod13.z.array(Flag)
1315
+ flags: z14.array(Flag)
1226
1316
  });
1227
1317
  var EventMetadataKeysArray = [
1228
1318
  "id",
@@ -1230,6 +1320,7 @@ var EventMetadataKeysArray = [
1230
1320
  "status",
1231
1321
  "createdAt",
1232
1322
  "dateOfEvent",
1323
+ "placeOfEvent",
1233
1324
  "createdBy",
1234
1325
  "createdByUserType",
1235
1326
  "updatedByUserRole",
@@ -1242,130 +1333,124 @@ var EventMetadataKeysArray = [
1242
1333
  "legalStatuses",
1243
1334
  "flags"
1244
1335
  ];
1245
- var EventMetadataKeys = import_zod13.z.enum(EventMetadataKeysArray);
1336
+ var EventMetadataKeys = z14.enum(EventMetadataKeysArray);
1246
1337
 
1247
1338
  // ../commons/src/events/EventIndex.ts
1248
- var import_zod_openapi5 = require("zod-openapi");
1249
- (0, import_zod_openapi5.extendZodWithOpenApi)(import_zod14.z);
1250
1339
  var EventIndex = EventMetadata.extend({
1251
1340
  declaration: EventState
1252
- }).openapi({
1253
- ref: "EventIndex"
1341
+ }).meta({
1342
+ id: "EventIndex"
1254
1343
  });
1255
- var EventSearchIndex = import_zod14.z.record(import_zod14.z.string(), import_zod14.z.any()).and(
1256
- import_zod14.z.object({
1257
- type: import_zod14.z.string()
1344
+ var EventSearchIndex = import_v4.z.record(import_v4.z.string(), import_v4.z.any()).and(
1345
+ import_v4.z.object({
1346
+ type: import_v4.z.string()
1258
1347
  // Ensures "type" (event-id) exists and is a string
1259
1348
  })
1260
- ).openapi({
1261
- ref: "EventSearchIndex"
1349
+ ).meta({
1350
+ id: "EventSearchIndex"
1262
1351
  });
1263
- var Fuzzy = import_zod14.z.object({ type: import_zod14.z.literal("fuzzy"), term: import_zod14.z.string() }).openapi({
1264
- ref: "Fuzzy"
1352
+ var Fuzzy = import_v4.z.object({ type: import_v4.z.literal("fuzzy"), term: import_v4.z.string() }).meta({
1353
+ id: "Fuzzy"
1265
1354
  });
1266
- var Exact = import_zod14.z.object({ type: import_zod14.z.literal("exact"), term: import_zod14.z.string() }).openapi({
1267
- ref: "Exact"
1355
+ var Exact = import_v4.z.object({ type: import_v4.z.literal("exact"), term: import_v4.z.string() }).meta({
1356
+ id: "Exact"
1268
1357
  });
1269
- var ExactStatus = import_zod14.z.object({
1270
- type: import_zod14.z.literal("exact"),
1358
+ var ExactStatus = import_v4.z.object({
1359
+ type: import_v4.z.literal("exact"),
1271
1360
  term: EventStatus
1272
- }).openapi({
1273
- ref: "ExactStatus"
1361
+ }).meta({
1362
+ id: "ExactStatus"
1274
1363
  });
1275
- var ExactUserType = import_zod14.z.object({
1276
- type: import_zod14.z.literal("exact"),
1364
+ var ExactUserType = import_v4.z.object({
1365
+ type: import_v4.z.literal("exact"),
1277
1366
  term: TokenUserType
1278
- }).openapi({
1279
- ref: "ExactUserType"
1280
- });
1281
- var AnyOf = import_zod14.z.object({
1282
- type: import_zod14.z.literal("anyOf"),
1283
- terms: import_zod14.z.array(import_zod14.z.string())
1284
- }).openapi({
1285
- ref: "AnyOf"
1286
- });
1287
- var AnyOfStatus = import_zod14.z.object({
1288
- type: import_zod14.z.literal("anyOf"),
1289
- terms: import_zod14.z.array(EventStatus)
1290
- }).openapi({
1291
- ref: "AnyOfStatus"
1292
- });
1293
- var Range = import_zod14.z.object({
1294
- type: import_zod14.z.literal("range"),
1295
- gte: import_zod14.z.string(),
1296
- lte: import_zod14.z.string()
1297
- }).openapi({
1298
- ref: "Range"
1299
- });
1300
- var ContainsFlags = import_zod14.z.object({
1301
- anyOf: import_zod14.z.array(Flag).optional(),
1302
- noneOf: import_zod14.z.array(Flag).optional()
1303
- }).openapi({
1304
- ref: "ContainsFlags"
1305
- });
1306
- var Within = import_zod14.z.object({ type: import_zod14.z.literal("within"), location: import_zod14.z.string() }).openapi({
1307
- ref: "Within"
1308
- });
1309
- var RangeDate = import_zod14.z.object({
1310
- type: import_zod14.z.literal("range"),
1311
- gte: import_zod14.z.string().date().or(import_zod14.z.string().datetime()),
1312
- lte: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
1313
- }).openapi({ ref: "RangeDate" });
1367
+ }).meta({
1368
+ id: "ExactUserType"
1369
+ });
1370
+ var AnyOf = import_v4.z.object({
1371
+ type: import_v4.z.literal("anyOf"),
1372
+ terms: import_v4.z.array(import_v4.z.string())
1373
+ }).meta({
1374
+ id: "AnyOf"
1375
+ });
1376
+ var AnyOfStatus = import_v4.z.object({
1377
+ type: import_v4.z.literal("anyOf"),
1378
+ terms: import_v4.z.array(EventStatus)
1379
+ }).meta({
1380
+ id: "AnyOfStatus"
1381
+ });
1382
+ var Range = import_v4.z.object({
1383
+ type: import_v4.z.literal("range"),
1384
+ gte: import_v4.z.string(),
1385
+ lte: import_v4.z.string()
1386
+ }).meta({
1387
+ id: "Range"
1388
+ });
1389
+ var ContainsFlags = import_v4.z.object({
1390
+ anyOf: import_v4.z.array(Flag).optional(),
1391
+ noneOf: import_v4.z.array(Flag).optional()
1392
+ }).meta({
1393
+ id: "ContainsFlags"
1394
+ });
1395
+ var Within = import_v4.z.object({ type: import_v4.z.literal("within"), location: import_v4.z.string() }).meta({
1396
+ id: "Within"
1397
+ });
1398
+ var RangeDate = import_v4.z.object({
1399
+ type: import_v4.z.literal("range"),
1400
+ gte: import_v4.z.iso.date().or(import_v4.z.iso.datetime()),
1401
+ lte: import_v4.z.iso.date().or(import_v4.z.iso.datetime())
1402
+ }).meta({ id: "RangeDate" });
1314
1403
  var ExactDate = Exact.extend({
1315
- term: import_zod14.z.string().date().or(import_zod14.z.string().datetime())
1316
- }).openapi({
1317
- ref: "ExactDate"
1404
+ term: import_v4.z.iso.date().or(import_v4.z.iso.datetime())
1405
+ }).meta({
1406
+ id: "ExactDate"
1318
1407
  });
1319
- var TimePeriod = import_zod14.z.object({
1320
- type: import_zod14.z.literal("timePeriod"),
1408
+ var TimePeriod = import_v4.z.object({
1409
+ type: import_v4.z.literal("timePeriod"),
1321
1410
  term: SelectDateRangeValue
1322
- }).openapi({
1323
- ref: "TimePeriod"
1411
+ }).meta({
1412
+ id: "TimePeriod"
1324
1413
  });
1325
- var DateCondition = import_zod14.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
1326
- ref: "DateCondition"
1414
+ var DateCondition = import_v4.z.union([ExactDate, RangeDate, TimePeriod]).meta({
1415
+ id: "DateCondition"
1327
1416
  });
1328
- var QueryInput = import_zod14.z.lazy(
1329
- () => import_zod14.z.union([
1330
- import_zod14.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
1331
- import_zod14.z.record(import_zod14.z.string(), QueryInput)
1417
+ var QueryInput = import_v4.z.lazy(
1418
+ () => import_v4.z.union([
1419
+ import_v4.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
1420
+ import_v4.z.record(import_v4.z.string(), QueryInput)
1332
1421
  ])
1333
- ).openapi({
1334
- ref: "QueryInput"
1335
- });
1336
- var QueryExpression = import_zod14.z.object({
1337
- id: import_zod14.z.optional(import_zod14.z.string()),
1338
- eventType: import_zod14.z.string(),
1339
- status: import_zod14.z.optional(import_zod14.z.union([AnyOfStatus, ExactStatus])),
1340
- createdAt: import_zod14.z.optional(DateCondition),
1341
- updatedAt: import_zod14.z.optional(DateCondition),
1342
- "legalStatuses.REGISTERED.acceptedAt": import_zod14.z.optional(DateCondition),
1343
- "legalStatuses.DECLARED.createdAtLocation": import_zod14.z.optional(
1344
- import_zod14.z.union([Within, Exact])
1345
- ),
1346
- "legalStatuses.REGISTERED.createdAtLocation": import_zod14.z.optional(
1347
- import_zod14.z.union([Within, Exact])
1348
- ),
1349
- "legalStatuses.REGISTERED.registrationNumber": import_zod14.z.optional(Exact),
1350
- createdAtLocation: import_zod14.z.optional(import_zod14.z.union([Within, Exact])),
1351
- updatedAtLocation: import_zod14.z.optional(import_zod14.z.union([Within, Exact])),
1352
- assignedTo: import_zod14.z.optional(Exact),
1353
- createdByUserType: import_zod14.z.optional(ExactUserType),
1354
- createdBy: import_zod14.z.optional(Exact),
1355
- updatedBy: import_zod14.z.optional(Exact),
1356
- trackingId: import_zod14.z.optional(Exact),
1357
- flags: import_zod14.z.optional(ContainsFlags),
1422
+ ).meta({
1423
+ id: "QueryInput"
1424
+ });
1425
+ var QueryExpression = import_v4.z.object({
1426
+ id: import_v4.z.optional(import_v4.z.string()),
1427
+ eventType: import_v4.z.string(),
1428
+ status: import_v4.z.optional(import_v4.z.union([AnyOfStatus, ExactStatus])),
1429
+ createdAt: import_v4.z.optional(DateCondition),
1430
+ updatedAt: import_v4.z.optional(DateCondition),
1431
+ "legalStatuses.REGISTERED.acceptedAt": import_v4.z.optional(DateCondition),
1432
+ "legalStatuses.DECLARED.createdAtLocation": import_v4.z.optional(Within).nullable(),
1433
+ "legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
1434
+ "legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
1435
+ createdAtLocation: import_v4.z.optional(Within),
1436
+ updatedAtLocation: import_v4.z.optional(Within),
1437
+ assignedTo: import_v4.z.optional(Exact),
1438
+ createdByUserType: import_v4.z.optional(ExactUserType),
1439
+ createdBy: import_v4.z.optional(Exact),
1440
+ updatedBy: import_v4.z.optional(Exact),
1441
+ trackingId: import_v4.z.optional(Exact),
1442
+ flags: import_v4.z.optional(ContainsFlags),
1358
1443
  // @todo: The type for this comes out as "any"
1359
1444
  data: QueryInput
1360
1445
  }).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
1361
- message: "At least one query field must be specified."
1362
- }).openapi({
1363
- ref: "QueryExpression"
1364
- });
1365
- var QueryType = import_zod14.z.lazy(
1366
- () => import_zod14.z.object({
1367
- type: import_zod14.z.literal("and").or(import_zod14.z.literal("or")).openapi({ default: "and" }),
1368
- clauses: import_zod14.z.array(import_zod14.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").openapi({
1446
+ error: "At least one query field must be specified."
1447
+ }).meta({
1448
+ id: "QueryExpression"
1449
+ });
1450
+ var QueryType = import_v4.z.lazy(
1451
+ () => import_v4.z.object({
1452
+ type: import_v4.z.literal("and").or(import_v4.z.literal("or")).meta({ default: "and" }),
1453
+ clauses: import_v4.z.array(import_v4.z.union([QueryExpression, QueryType])).nonempty("At least one clause is required.").meta({
1369
1454
  default: [
1370
1455
  {
1371
1456
  eventType: TENNIS_CLUB_MEMBERSHIP,
@@ -1383,8 +1468,8 @@ var QueryType = import_zod14.z.lazy(
1383
1468
  ]
1384
1469
  })
1385
1470
  })
1386
- ).openapi({
1387
- ref: "QueryType"
1471
+ ).meta({
1472
+ id: "QueryType"
1388
1473
  });
1389
1474
  function parseStringifiedQueryField(val) {
1390
1475
  if (typeof val === "string") {
@@ -1392,8 +1477,8 @@ function parseStringifiedQueryField(val) {
1392
1477
  }
1393
1478
  return val;
1394
1479
  }
1395
- var SearchQuery = import_zod14.z.object({
1396
- query: import_zod14.z.preprocess(parseStringifiedQueryField, QueryType).openapi({
1480
+ var SearchQuery = import_v4.z.object({
1481
+ query: import_v4.z.preprocess(parseStringifiedQueryField, QueryType).meta({
1397
1482
  default: {
1398
1483
  type: "and",
1399
1484
  clauses: [
@@ -1413,204 +1498,193 @@ var SearchQuery = import_zod14.z.object({
1413
1498
  ]
1414
1499
  }
1415
1500
  }),
1416
- limit: import_zod14.z.number().optional().default(100),
1417
- offset: import_zod14.z.number().optional().default(0),
1418
- sort: import_zod14.z.preprocess(
1501
+ limit: import_v4.z.number().optional().default(100),
1502
+ offset: import_v4.z.number().optional().default(0),
1503
+ sort: import_v4.z.preprocess(
1419
1504
  parseStringifiedQueryField,
1420
- import_zod14.z.array(
1421
- import_zod14.z.object({
1422
- field: import_zod14.z.string(),
1423
- direction: import_zod14.z.enum(["asc", "desc"]).default("asc")
1505
+ import_v4.z.array(
1506
+ import_v4.z.object({
1507
+ field: import_v4.z.string(),
1508
+ direction: import_v4.z.enum(["asc", "desc"]).default("asc")
1424
1509
  })
1425
1510
  )
1426
1511
  ).optional()
1427
- }).openapi({
1428
- ref: "SearchQuery"
1512
+ }).meta({
1513
+ id: "SearchQuery"
1429
1514
  });
1430
1515
 
1431
1516
  // ../commons/src/events/serializers/date/serializer.ts
1432
- var import_zod15 = require("zod");
1433
- var SerializedNowDateTime = import_zod15.z.object({
1434
- $$now: import_zod15.z.literal(true)
1517
+ var import_zod = require("zod");
1518
+ var SerializedNowDateTime = import_zod.z.object({
1519
+ $$now: import_zod.z.literal(true)
1435
1520
  });
1436
1521
  function todayDateTimeValueSerializer() {
1437
1522
  return { $$now: true };
1438
1523
  }
1439
1524
 
1440
1525
  // ../commons/src/events/FieldConfig.ts
1441
- (0, import_zod_openapi6.extendZodWithOpenApi)(import_zod16.z);
1442
- var FieldId = import_zod16.z.string().refine(
1443
- /*
1444
- * Disallow underscores '_' in field ids.
1445
- * Why? Theres two reasons:
1446
- * 1. We transform dots to underscores as separator in Formik field ids, so this avoids any issues with the Formik transformations.
1447
- * 2. On Kysely-SQL queries, we use the CamelCasePlugin. This plugin transforms snake_case to camelCase also on nested (jsonb) object keys.
1448
- * This could be disabled via 'maintainNestedObjectKeys: true', but this would also affect SQL queries which use e.g. json_agg() or to_jsonb() to aggregate results.
1449
- */
1450
- (val) => !val.includes("_"),
1451
- (val) => ({
1452
- message: `id: '${val}' must not contain underscores '_'`
1453
- })
1454
- ).describe("Unique identifier for the field");
1455
- var FieldReference = import_zod16.z.object({
1526
+ var FieldId = z17.string().superRefine((val, ctx) => {
1527
+ if (val.includes("_")) {
1528
+ ctx.addIssue({
1529
+ code: z17.ZodIssueCode.custom,
1530
+ message: `id: '${val}' must not contain underscores '_'`
1531
+ });
1532
+ }
1533
+ }).describe("Unique identifier for the field");
1534
+ var FieldReference = z17.object({
1456
1535
  $$field: FieldId,
1457
- $$subfield: import_zod16.z.array(import_zod16.z.string()).optional().describe(
1536
+ $$subfield: z17.array(z17.string()).optional().describe(
1458
1537
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
1459
1538
  )
1460
1539
  }).describe("Reference to a field by its ID");
1461
- var ValidationConfig = import_zod16.z.object({
1540
+ var ValidationConfig = z17.object({
1462
1541
  validator: Conditional,
1463
1542
  message: TranslationConfig
1464
1543
  });
1465
- var requiredSchema = import_zod16.z.union([
1466
- import_zod16.z.boolean(),
1467
- import_zod16.z.object({
1544
+ var requiredSchema = z17.union([
1545
+ z17.boolean(),
1546
+ z17.object({
1468
1547
  message: TranslationConfig.describe("Custom required validation message")
1469
1548
  })
1470
1549
  ]).default(false).optional();
1471
- var BaseField = import_zod16.z.object({
1550
+ var BaseField = z17.object({
1472
1551
  id: FieldId.describe("Unique identifier of the field."),
1473
1552
  label: TranslationConfig.describe("Human-readable label of the field."),
1474
- parent: FieldReference.or(import_zod16.z.array(FieldReference)).optional().describe(
1553
+ parent: FieldReference.or(z17.array(FieldReference)).optional().describe(
1475
1554
  "Reference to the parent field or fields. When a parent field changes, this field is reset."
1476
1555
  ),
1477
1556
  required: requiredSchema.describe(
1478
1557
  "Indicates whether the field is mandatory."
1479
1558
  ),
1480
- conditionals: import_zod16.z.array(FieldConditional).default([]).optional().describe(
1559
+ conditionals: z17.array(FieldConditional).default([]).optional().describe(
1481
1560
  "Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
1482
1561
  ),
1483
- secured: import_zod16.z.boolean().default(false).optional().describe(
1562
+ secured: z17.boolean().default(false).optional().describe(
1484
1563
  "Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
1485
1564
  ),
1486
1565
  placeholder: TranslationConfig.optional(),
1487
- validation: import_zod16.z.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
1566
+ validation: z17.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
1488
1567
  helperText: TranslationConfig.optional(),
1489
- hideLabel: import_zod16.z.boolean().default(false).optional(),
1490
- hideErrorLabel: import_zod16.z.boolean().default(false).optional().describe(
1491
- `If true, hides the field's validation error message. Useful for composite components like ADDRESS or NAME where errors are shown at the sub-field level instead of the parent
1492
- field level. When enabled, errors are hidden at the composite component level on the form page but remain visible on the review page. It doesn't interfere with the sub-field's
1493
- validation error messages.`
1494
- ),
1495
- uncorrectable: import_zod16.z.boolean().default(false).optional().describe(
1568
+ hideLabel: z17.boolean().default(false).optional(),
1569
+ uncorrectable: z17.boolean().default(false).optional().describe(
1496
1570
  "Indicates whether the field can be modified during record correction."
1497
1571
  ),
1498
- value: FieldReference.or(import_zod16.z.array(FieldReference)).optional().describe(
1572
+ value: FieldReference.or(z17.array(FieldReference)).optional().describe(
1499
1573
  "Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
1500
1574
  ),
1501
- analytics: import_zod16.z.boolean().default(false).optional().describe(
1575
+ analytics: z17.boolean().default(false).optional().describe(
1502
1576
  "Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
1503
1577
  )
1504
1578
  }).describe("Common properties shared across all field types.");
1505
1579
  var Divider = BaseField.extend({
1506
- type: import_zod16.z.literal(FieldType.DIVIDER)
1580
+ type: z17.literal(FieldType.DIVIDER)
1507
1581
  });
1508
1582
  var TextField = BaseField.extend({
1509
- type: import_zod16.z.literal(FieldType.TEXT),
1510
- defaultValue: import_zod16.z.union([NonEmptyTextValue, SerializedUserField]).optional(),
1511
- configuration: import_zod16.z.object({
1512
- maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
1513
- type: import_zod16.z.enum(["text", "password"]).optional(),
1583
+ type: z17.literal(FieldType.TEXT),
1584
+ defaultValue: z17.union([NonEmptyTextValue, SerializedUserField]).optional(),
1585
+ configuration: z17.object({
1586
+ maxLength: z17.number().optional().describe("Maximum length of the text"),
1587
+ type: z17.enum(["text", "password"]).optional(),
1514
1588
  prefix: TranslationConfig.optional(),
1515
1589
  postfix: TranslationConfig.optional()
1516
1590
  }).default({ type: "text" }).optional()
1517
1591
  }).describe("Text input");
1518
1592
  var NumberField = BaseField.extend({
1519
- type: import_zod16.z.literal(FieldType.NUMBER),
1593
+ type: z17.literal(FieldType.NUMBER),
1520
1594
  defaultValue: NumberFieldValue.optional(),
1521
- configuration: import_zod16.z.object({
1522
- min: import_zod16.z.number().optional().describe("Minimum value"),
1523
- max: import_zod16.z.number().optional().describe("Maximum value"),
1595
+ configuration: z17.object({
1596
+ min: z17.number().optional().describe("Minimum value"),
1597
+ max: z17.number().optional().describe("Maximum value"),
1524
1598
  prefix: TranslationConfig.optional(),
1525
1599
  postfix: TranslationConfig.optional()
1526
1600
  }).optional()
1527
1601
  }).describe("Number input");
1528
1602
  var TextAreaField = BaseField.extend({
1529
- type: import_zod16.z.literal(FieldType.TEXTAREA),
1603
+ type: z17.literal(FieldType.TEXTAREA),
1530
1604
  defaultValue: NonEmptyTextValue.optional(),
1531
- configuration: import_zod16.z.object({
1532
- maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
1533
- rows: import_zod16.z.number().optional().describe("Number of visible text lines"),
1534
- cols: import_zod16.z.number().optional().describe("Number of visible columns"),
1605
+ configuration: z17.object({
1606
+ maxLength: z17.number().optional().describe("Maximum length of the text"),
1607
+ rows: z17.number().optional().describe("Number of visible text lines"),
1608
+ cols: z17.number().optional().describe("Number of visible columns"),
1535
1609
  prefix: TranslationConfig.optional(),
1536
1610
  postfix: TranslationConfig.optional()
1537
1611
  }).default({ rows: 4 }).optional()
1538
1612
  }).describe("Multiline text input");
1539
- var ImageMimeType = import_zod16.z.enum([
1613
+ var ImageMimeType = z17.enum([
1540
1614
  "image/png",
1541
1615
  "image/jpg",
1542
1616
  "image/jpeg",
1543
1617
  "image/svg+xml"
1544
1618
  ]);
1545
- var DocumentMimeType = import_zod16.z.enum([
1619
+ var DocumentMimeType = z17.enum([
1546
1620
  "application/pdf",
1547
1621
  "application/msword",
1548
1622
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1549
1623
  "application/vnd.oasis.opendocument.text"
1550
1624
  ]);
1551
- var MimeType = import_zod16.z.enum([
1625
+ var MimeType = z17.enum([
1552
1626
  ...ImageMimeType.options,
1553
1627
  ...DocumentMimeType.options
1554
1628
  ]);
1555
1629
  var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
1556
1630
  var SignatureField = BaseField.extend({
1557
- type: import_zod16.z.literal(FieldType.SIGNATURE),
1631
+ type: z17.literal(FieldType.SIGNATURE),
1558
1632
  signaturePromptLabel: TranslationConfig.describe(
1559
1633
  "Title of the signature modal"
1560
1634
  ),
1561
1635
  defaultValue: SignatureFieldValue.optional(),
1562
- configuration: import_zod16.z.object({
1563
- maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1636
+ configuration: z17.object({
1637
+ maxFileSize: z17.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1564
1638
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
1565
1639
  }).default({
1566
1640
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1567
1641
  })
1568
1642
  }).describe("Signature input field");
1569
1643
  var EmailField = BaseField.extend({
1570
- type: import_zod16.z.literal(FieldType.EMAIL),
1571
- configuration: import_zod16.z.object({
1572
- maxLength: import_zod16.z.number().optional().describe("Maximum length of the text")
1573
- }).default({ maxLength: 10 }).optional(),
1644
+ type: z17.literal(FieldType.EMAIL),
1645
+ configuration: z17.object({
1646
+ maxLength: z17.number().optional().describe("Maximum length of the text")
1647
+ }).default({ maxLength: 255 }).optional(),
1574
1648
  defaultValue: NonEmptyTextValue.optional()
1575
1649
  });
1576
1650
  var DateField = BaseField.extend({
1577
- type: import_zod16.z.literal(FieldType.DATE),
1578
- defaultValue: SerializedNowDateTime.or(DateValue).optional().openapi({ effectType: "input", type: "string" }).describe("Default date value(yyyy-MM-dd)"),
1579
- configuration: import_zod16.z.object({
1651
+ type: z17.literal(FieldType.DATE),
1652
+ defaultValue: SerializedNowDateTime.or(DateValue).optional().describe("Default date value(yyyy-MM-dd)"),
1653
+ configuration: z17.object({
1580
1654
  notice: TranslationConfig.describe(
1581
1655
  "Text to display above the date input"
1582
1656
  ).optional()
1583
1657
  }).optional()
1584
1658
  }).describe("A single date input (yyyy-MM-dd)");
1585
1659
  var AgeField = BaseField.extend({
1586
- type: import_zod16.z.literal(FieldType.AGE),
1660
+ type: z17.literal(FieldType.AGE),
1587
1661
  defaultValue: NumberFieldValue.optional(),
1588
- configuration: import_zod16.z.object({
1662
+ configuration: z17.object({
1589
1663
  asOfDate: FieldReference,
1590
1664
  prefix: TranslationConfig.optional(),
1591
1665
  postfix: TranslationConfig.optional()
1592
1666
  })
1593
1667
  }).describe("An age input field which uses the current date as the asOfDate");
1594
1668
  var TimeField = BaseField.extend({
1595
- type: import_zod16.z.literal(FieldType.TIME),
1596
- defaultValue: SerializedNowDateTime.or(TimeValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default time value (HH-mm)"),
1597
- configuration: import_zod16.z.object({
1598
- use12HourFormat: import_zod16.z.boolean().optional().describe("Whether to use 12-hour format"),
1669
+ type: z17.literal(FieldType.TIME),
1670
+ defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
1671
+ configuration: z17.object({
1672
+ use12HourFormat: z17.boolean().optional().describe("Whether to use 12-hour format"),
1599
1673
  notice: TranslationConfig.describe(
1600
1674
  "Text to display above the time input"
1601
1675
  ).optional()
1602
1676
  }).optional()
1603
1677
  }).describe("A single date input (HH-mm)");
1604
1678
  var DateRangeField = BaseField.extend({
1605
- type: import_zod16.z.literal(FieldType.DATE_RANGE),
1679
+ type: z17.literal(FieldType.DATE_RANGE),
1606
1680
  defaultValue: DateRangeFieldValue.optional(),
1607
- configuration: import_zod16.z.object({
1681
+ configuration: z17.object({
1608
1682
  notice: TranslationConfig.describe(
1609
1683
  "Text to display above the date input"
1610
1684
  ).optional()
1611
1685
  }).optional()
1612
1686
  }).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
1613
- var HtmlFontVariant = import_zod16.z.enum([
1687
+ var HtmlFontVariant = z17.enum([
1614
1688
  "reg12",
1615
1689
  "reg14",
1616
1690
  "reg16",
@@ -1620,34 +1694,34 @@ var HtmlFontVariant = import_zod16.z.enum([
1620
1694
  "h2",
1621
1695
  "h1"
1622
1696
  ]);
1623
- var ParagraphConfiguration = import_zod16.z.object({
1624
- styles: import_zod16.z.object({
1697
+ var ParagraphConfiguration = z17.object({
1698
+ styles: z17.object({
1625
1699
  fontVariant: HtmlFontVariant.optional().describe(
1626
1700
  "Font variant to use for the paragraph text"
1627
1701
  ),
1628
- hint: import_zod16.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
1702
+ hint: z17.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
1629
1703
  }).optional()
1630
1704
  }).default({});
1631
1705
  var Paragraph = BaseField.extend({
1632
- type: import_zod16.z.literal(FieldType.PARAGRAPH),
1706
+ type: z17.literal(FieldType.PARAGRAPH),
1633
1707
  defaultValue: NonEmptyTextValue.optional(),
1634
1708
  configuration: ParagraphConfiguration
1635
1709
  }).describe("A read-only HTML <p> paragraph");
1636
1710
  var PageHeader = BaseField.extend({
1637
- type: import_zod16.z.literal(FieldType.PAGE_HEADER),
1711
+ type: z17.literal(FieldType.PAGE_HEADER),
1638
1712
  defaultValue: NonEmptyTextValue.optional()
1639
1713
  }).describe("A read-only header component for form pages");
1640
1714
  var File = BaseField.extend({
1641
- type: import_zod16.z.literal(FieldType.FILE),
1715
+ type: z17.literal(FieldType.FILE),
1642
1716
  defaultValue: FileFieldValue.optional(),
1643
- configuration: import_zod16.z.object({
1644
- maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1717
+ configuration: z17.object({
1718
+ maxFileSize: z17.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1645
1719
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
1646
- maxImageSize: import_zod16.z.object({
1647
- targetSize: import_zod16.z.object({ width: import_zod16.z.number(), height: import_zod16.z.number() })
1720
+ maxImageSize: z17.object({
1721
+ targetSize: z17.object({ width: z17.number(), height: z17.number() })
1648
1722
  }).optional(),
1649
- style: import_zod16.z.object({
1650
- width: import_zod16.z.enum(["full", "auto"]).optional().describe(
1723
+ style: z17.object({
1724
+ width: z17.enum(["full", "auto"]).optional().describe(
1651
1725
  "Whether the file upload button should take the full width of the container or not"
1652
1726
  )
1653
1727
  }).optional(),
@@ -1656,46 +1730,46 @@ var File = BaseField.extend({
1656
1730
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1657
1731
  })
1658
1732
  }).describe("File upload");
1659
- var SelectOption = import_zod16.z.object({
1660
- value: import_zod16.z.string().describe("The value of the option"),
1661
- label: import_zod16.z.union([import_zod16.z.string(), TranslationConfig]).describe("The label of the option")
1733
+ var SelectOption = z17.object({
1734
+ value: z17.string().describe("The value of the option"),
1735
+ label: z17.union([z17.string(), TranslationConfig]).describe("The label of the option")
1662
1736
  });
1663
1737
  var NumberWithUnitField = BaseField.extend({
1664
- type: import_zod16.z.literal(FieldType.NUMBER_WITH_UNIT),
1738
+ type: z17.literal(FieldType.NUMBER_WITH_UNIT),
1665
1739
  defaultValue: NumberWithUnitFieldValue.optional(),
1666
- options: import_zod16.z.array(SelectOption).describe("A list of options for the unit select"),
1667
- configuration: import_zod16.z.object({
1668
- min: import_zod16.z.number().optional().describe("Minimum value of the number field"),
1669
- max: import_zod16.z.number().optional().describe("Maximum value of the number field"),
1740
+ options: z17.array(SelectOption).describe("A list of options for the unit select"),
1741
+ configuration: z17.object({
1742
+ min: z17.number().optional().describe("Minimum value of the number field"),
1743
+ max: z17.number().optional().describe("Maximum value of the number field"),
1670
1744
  numberFieldPlaceholder: TranslationConfig.optional().describe(
1671
1745
  "Placeholder for the number field"
1672
1746
  )
1673
1747
  }).optional()
1674
1748
  }).describe("Number with unit input");
1675
1749
  var RadioGroup = BaseField.extend({
1676
- type: import_zod16.z.literal(FieldType.RADIO_GROUP),
1750
+ type: z17.literal(FieldType.RADIO_GROUP),
1677
1751
  defaultValue: TextValue.optional(),
1678
- options: import_zod16.z.array(SelectOption).describe("A list of options"),
1679
- configuration: import_zod16.z.object({
1680
- styles: import_zod16.z.object({
1681
- size: import_zod16.z.enum(["NORMAL", "LARGE"]).optional()
1752
+ options: z17.array(SelectOption).describe("A list of options"),
1753
+ configuration: z17.object({
1754
+ styles: z17.object({
1755
+ size: z17.enum(["NORMAL", "LARGE"]).optional()
1682
1756
  }).optional()
1683
1757
  }).optional()
1684
1758
  }).describe("Grouped radio options");
1685
1759
  var BulletList = BaseField.extend({
1686
- type: import_zod16.z.literal(FieldType.BULLET_LIST),
1760
+ type: z17.literal(FieldType.BULLET_LIST),
1687
1761
  defaultValue: TextValue.optional(),
1688
- items: import_zod16.z.array(TranslationConfig).describe("A list of items"),
1689
- configuration: import_zod16.z.object({
1690
- styles: import_zod16.z.object({
1762
+ items: z17.array(TranslationConfig).describe("A list of items"),
1763
+ configuration: z17.object({
1764
+ styles: z17.object({
1691
1765
  fontVariant: HtmlFontVariant.optional()
1692
1766
  }).optional()
1693
1767
  }).default({})
1694
1768
  }).describe("A list of bullet points");
1695
1769
  var Select = BaseField.extend({
1696
- type: import_zod16.z.literal(FieldType.SELECT),
1770
+ type: z17.literal(FieldType.SELECT),
1697
1771
  defaultValue: TextValue.optional(),
1698
- options: import_zod16.z.array(SelectOption).describe("A list of options"),
1772
+ options: z17.array(SelectOption).describe("A list of options"),
1699
1773
  noOptionsMessage: TranslationConfig.optional().describe(
1700
1774
  `
1701
1775
  A translation configuration object used to display a message when no options are available.
@@ -1707,34 +1781,34 @@ var Select = BaseField.extend({
1707
1781
  `
1708
1782
  )
1709
1783
  }).describe("Select input");
1710
- var SelectDateRangeOption = import_zod16.z.object({
1784
+ var SelectDateRangeOption = z17.object({
1711
1785
  value: SelectDateRangeValue.describe("The value of the option"),
1712
1786
  label: TranslationConfig.describe("The label of the option")
1713
1787
  });
1714
1788
  var SelectDateRangeField = BaseField.extend({
1715
- type: import_zod16.z.literal(FieldType.SELECT_DATE_RANGE),
1789
+ type: z17.literal(FieldType.SELECT_DATE_RANGE),
1716
1790
  defaultValue: SelectDateRangeValue.optional(),
1717
- options: import_zod16.z.array(SelectDateRangeOption).describe("A list of options")
1791
+ options: z17.array(SelectDateRangeOption).describe("A list of options")
1718
1792
  }).describe("Select input with date range options");
1719
- var NameConfig = import_zod16.z.object({
1720
- firstname: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
1721
- middlename: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
1722
- surname: import_zod16.z.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
1793
+ var NameConfig = z17.object({
1794
+ firstname: z17.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
1795
+ middlename: z17.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
1796
+ surname: z17.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional()
1723
1797
  });
1724
1798
  var NameField = BaseField.extend({
1725
- type: import_zod16.z.literal(FieldType.NAME),
1726
- defaultValue: import_zod16.z.object({
1799
+ type: z17.literal(FieldType.NAME),
1800
+ defaultValue: z17.object({
1727
1801
  firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
1728
1802
  middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
1729
1803
  surname: SerializedUserField.or(NonEmptyTextValue).optional()
1730
1804
  }).optional(),
1731
- configuration: import_zod16.z.object({
1805
+ configuration: z17.object({
1732
1806
  name: NameConfig.default({
1733
1807
  firstname: { required: true },
1734
1808
  surname: { required: true }
1735
1809
  }).optional(),
1736
- order: import_zod16.z.array(import_zod16.z.enum(["firstname", "middlename", "surname"])).optional(),
1737
- maxLength: import_zod16.z.number().optional().describe("Maximum length of the text"),
1810
+ order: z17.array(z17.enum(["firstname", "middlename", "surname"])).optional(),
1811
+ maxLength: z17.number().optional().describe("Maximum length of the text"),
1738
1812
  prefix: TranslationConfig.optional(),
1739
1813
  postfix: TranslationConfig.optional()
1740
1814
  }).default({
@@ -1746,51 +1820,51 @@ var NameField = BaseField.extend({
1746
1820
  }).describe("Name input field");
1747
1821
  var PhoneField = BaseField.extend({
1748
1822
  defaultValue: NonEmptyTextValue.optional(),
1749
- type: import_zod16.z.literal(FieldType.PHONE)
1823
+ type: z17.literal(FieldType.PHONE)
1750
1824
  }).describe("Phone input field");
1751
1825
  var IdField = BaseField.extend({
1752
1826
  defaultValue: NonEmptyTextValue.optional(),
1753
- type: import_zod16.z.literal(FieldType.ID)
1827
+ type: z17.literal(FieldType.ID)
1754
1828
  }).describe("ID input field");
1755
1829
  var Checkbox = BaseField.extend({
1756
- type: import_zod16.z.literal(FieldType.CHECKBOX),
1830
+ type: z17.literal(FieldType.CHECKBOX),
1757
1831
  defaultValue: CheckboxFieldValue.default(false)
1758
1832
  }).describe("Boolean checkbox field");
1759
1833
  var Country = BaseField.extend({
1760
- type: import_zod16.z.literal(FieldType.COUNTRY),
1834
+ type: z17.literal(FieldType.COUNTRY),
1761
1835
  defaultValue: NonEmptyTextValue.optional()
1762
1836
  }).describe("Country select field");
1763
- var AdministrativeAreas = import_zod16.z.enum([
1837
+ var AdministrativeAreas = z17.enum([
1764
1838
  "ADMIN_STRUCTURE",
1765
1839
  "HEALTH_FACILITY",
1766
1840
  "CRVS_OFFICE"
1767
1841
  ]);
1768
- var AdministrativeAreaConfiguration = import_zod16.z.object({
1769
- partOf: import_zod16.z.object({
1770
- $declaration: import_zod16.z.string()
1842
+ var AdministrativeAreaConfiguration = z17.object({
1843
+ partOf: z17.object({
1844
+ $declaration: z17.string()
1771
1845
  }).optional().describe("Parent location"),
1772
1846
  type: AdministrativeAreas
1773
1847
  }).describe("Administrative area options");
1774
- var AdministrativeArea = BaseField.extend({
1775
- type: import_zod16.z.literal(FieldType.ADMINISTRATIVE_AREA),
1848
+ var AdministrativeAreaField = BaseField.extend({
1849
+ type: z17.literal(FieldType.ADMINISTRATIVE_AREA),
1776
1850
  defaultValue: NonEmptyTextValue.optional(),
1777
1851
  configuration: AdministrativeAreaConfiguration
1778
1852
  }).describe("Administrative area input field e.g. facility, office");
1779
1853
  var LocationInput = BaseField.extend({
1780
- type: import_zod16.z.literal(FieldType.LOCATION),
1854
+ type: z17.literal(FieldType.LOCATION),
1781
1855
  defaultValue: NonEmptyTextValue.optional(),
1782
- configuration: import_zod16.z.object({
1783
- searchableResource: import_zod16.z.array(import_zod16.z.enum(["locations", "facilities", "offices"]))
1856
+ configuration: z17.object({
1857
+ searchableResource: z17.array(z17.enum(["locations", "facilities", "offices"]))
1784
1858
  })
1785
1859
  }).describe("Input field for a location");
1786
1860
  var FileUploadWithOptions = BaseField.extend({
1787
- type: import_zod16.z.literal(FieldType.FILE_WITH_OPTIONS),
1788
- options: import_zod16.z.array(SelectOption).describe("A list of options"),
1861
+ type: z17.literal(FieldType.FILE_WITH_OPTIONS),
1862
+ options: z17.array(SelectOption).describe("A list of options"),
1789
1863
  defaultValue: FileFieldWithOptionValue.optional(),
1790
- configuration: import_zod16.z.object({
1791
- maxFileSize: import_zod16.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1792
- maxImageSize: import_zod16.z.object({
1793
- targetSize: import_zod16.z.object({ width: import_zod16.z.number(), height: import_zod16.z.number() })
1864
+ configuration: z17.object({
1865
+ maxFileSize: z17.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1866
+ maxImageSize: z17.object({
1867
+ targetSize: z17.object({ width: z17.number(), height: z17.number() })
1794
1868
  }).optional(),
1795
1869
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
1796
1870
  }).default({
@@ -1798,93 +1872,93 @@ var FileUploadWithOptions = BaseField.extend({
1798
1872
  })
1799
1873
  });
1800
1874
  var Facility = BaseField.extend({
1801
- type: import_zod16.z.literal(FieldType.FACILITY),
1875
+ type: z17.literal(FieldType.FACILITY),
1802
1876
  defaultValue: NonEmptyTextValue.optional()
1803
1877
  }).describe("Input field for a facility");
1804
1878
  var Office = BaseField.extend({
1805
- type: import_zod16.z.literal(FieldType.OFFICE),
1879
+ type: z17.literal(FieldType.OFFICE),
1806
1880
  defaultValue: NonEmptyTextValue.optional()
1807
1881
  }).describe("Input field for an office");
1808
1882
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
1809
- administrativeArea: import_zod16.z.union([UUID, SerializedUserField]).optional()
1883
+ administrativeArea: z17.union([UUID, SerializedUserField]).optional()
1810
1884
  });
1811
1885
  var Address = BaseField.extend({
1812
- type: import_zod16.z.literal(FieldType.ADDRESS),
1813
- configuration: import_zod16.z.object({
1814
- lineSeparator: import_zod16.z.string().optional(),
1815
- fields: import_zod16.z.array(import_zod16.z.enum(["country", "administrativeArea"])).optional(),
1816
- administrativeLevels: import_zod16.z.array(import_zod16.z.string()).optional(),
1817
- streetAddressForm: import_zod16.z.array(
1818
- import_zod16.z.object({
1819
- id: import_zod16.z.string(),
1886
+ type: z17.literal(FieldType.ADDRESS),
1887
+ configuration: z17.object({
1888
+ lineSeparator: z17.string().optional(),
1889
+ fields: z17.array(z17.enum(["country", "administrativeArea"])).optional(),
1890
+ administrativeLevels: z17.array(z17.string()).optional(),
1891
+ streetAddressForm: z17.array(
1892
+ z17.object({
1893
+ id: z17.string(),
1820
1894
  required: requiredSchema,
1821
1895
  label: TranslationConfig,
1822
- type: import_zod16.z.literal(FieldType.TEXT),
1823
- conditionals: import_zod16.z.array(FieldConditional).default([]).optional(),
1896
+ type: z17.literal(FieldType.TEXT),
1897
+ conditionals: z17.array(FieldConditional).default([]).optional(),
1824
1898
  parent: FieldReference.optional()
1825
1899
  })
1826
1900
  ).optional()
1827
1901
  }).optional(),
1828
1902
  defaultValue: DefaultAddressFieldValue.optional()
1829
1903
  }).describe("Address input field \u2013 a combination of location and text fields");
1830
- var StaticDataEntry = import_zod16.z.object({
1831
- id: import_zod16.z.string().describe("ID for the data entry."),
1904
+ var StaticDataEntry = z17.object({
1905
+ id: z17.string().describe("ID for the data entry."),
1832
1906
  label: TranslationConfig,
1833
- value: TranslationConfig.or(import_zod16.z.string()).or(FieldReference)
1907
+ value: TranslationConfig.or(z17.string()).or(FieldReference)
1834
1908
  }).describe("Static data entry");
1835
- var DataEntry = import_zod16.z.union([StaticDataEntry, import_zod16.z.object({ fieldId: import_zod16.z.string() })]).describe(
1909
+ var DataEntry = z17.union([StaticDataEntry, z17.object({ fieldId: z17.string() })]).describe(
1836
1910
  "Data entry can be either a static data entry, or a reference to another field in the current form or the declaration."
1837
1911
  );
1838
1912
  var DataField = BaseField.extend({
1839
- type: import_zod16.z.literal(FieldType.DATA),
1840
- configuration: import_zod16.z.object({
1913
+ type: z17.literal(FieldType.DATA),
1914
+ configuration: z17.object({
1841
1915
  subtitle: TranslationConfig.optional(),
1842
- data: import_zod16.z.array(DataEntry)
1916
+ data: z17.array(DataEntry)
1843
1917
  })
1844
1918
  }).describe("Data field for displaying read-only data");
1845
1919
  var ButtonField = BaseField.extend({
1846
- type: import_zod16.z.literal(FieldType.BUTTON),
1920
+ type: z17.literal(FieldType.BUTTON),
1847
1921
  defaultValue: ButtonFieldValue.optional(),
1848
- configuration: import_zod16.z.object({
1849
- icon: import_zod16.z.string().optional().describe(
1922
+ configuration: z17.object({
1923
+ icon: z17.string().optional().describe(
1850
1924
  "Icon for the button. You can find icons from OpenCRVS UI-Kit."
1851
1925
  ),
1852
- loading: import_zod16.z.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
1926
+ loading: z17.boolean().optional().describe("Whether the button is in a loading state and shows a spinner"),
1853
1927
  text: TranslationConfig.describe("Text to display on the button")
1854
1928
  })
1855
1929
  }).describe("Generic button without any built-in functionality");
1856
1930
  var AlphaPrintButton = BaseField.extend({
1857
- type: import_zod16.z.literal(FieldType.ALPHA_PRINT_BUTTON),
1858
- configuration: import_zod16.z.object({
1859
- template: import_zod16.z.string().describe("Template ID from countryconfig templates to use for printing"),
1931
+ type: z17.literal(FieldType.ALPHA_PRINT_BUTTON),
1932
+ configuration: z17.object({
1933
+ template: z17.string().describe("Template ID from countryconfig templates to use for printing"),
1860
1934
  buttonLabel: TranslationConfig.optional().describe(
1861
1935
  "Label for the print button"
1862
1936
  )
1863
1937
  })
1864
1938
  }).describe("Print button field for printing certificates");
1865
1939
  var HttpField = BaseField.extend({
1866
- type: import_zod16.z.literal(FieldType.HTTP),
1940
+ type: z17.literal(FieldType.HTTP),
1867
1941
  defaultValue: HttpFieldValue.optional(),
1868
- configuration: import_zod16.z.object({
1942
+ configuration: z17.object({
1869
1943
  trigger: FieldReference,
1870
- url: import_zod16.z.string().describe("URL to send the HTTP request to"),
1871
- method: import_zod16.z.enum(["GET", "POST", "PUT", "DELETE"]),
1872
- headers: import_zod16.z.record(import_zod16.z.string()).optional(),
1873
- body: import_zod16.z.record(import_zod16.z.any()).optional(),
1874
- errorValue: import_zod16.z.any().optional().describe("Value to set if the request fails"),
1875
- params: import_zod16.z.record(import_zod16.z.string(), import_zod16.z.union([import_zod16.z.string(), FieldReference])).optional(),
1876
- timeout: import_zod16.z.number().default(15e3).describe("Request timeout in milliseconds")
1944
+ url: z17.string().describe("URL to send the HTTP request to"),
1945
+ method: z17.enum(["GET", "POST", "PUT", "DELETE"]),
1946
+ headers: z17.record(z17.string(), z17.string()).optional(),
1947
+ body: z17.record(z17.string(), z17.any()).optional(),
1948
+ errorValue: z17.any().optional().describe("Value to set if the request fails"),
1949
+ params: z17.record(z17.string(), z17.union([z17.string(), FieldReference])).optional(),
1950
+ timeout: z17.number().default(15e3).describe("Request timeout in milliseconds")
1877
1951
  })
1878
1952
  }).describe("HTTP request function triggered by a button click or other event");
1879
1953
  var SearchField = HttpField.extend({
1880
- type: import_zod16.z.literal(FieldType.SEARCH),
1954
+ type: z17.literal(FieldType.SEARCH),
1881
1955
  configuration: SearchQuery.pick({
1882
1956
  query: true,
1883
1957
  limit: true,
1884
1958
  offset: true
1885
1959
  }).extend({
1886
1960
  validation: ValidationConfig,
1887
- indicators: import_zod16.z.object({
1961
+ indicators: z17.object({
1888
1962
  loading: TranslationConfig.optional().describe(
1889
1963
  "Text to display while the search is in progress"
1890
1964
  ),
@@ -1899,7 +1973,7 @@ var SearchField = HttpField.extend({
1899
1973
  ),
1900
1974
  confirmButton: TranslationConfig.optional(),
1901
1975
  clearButton: TranslationConfig.optional(),
1902
- clearModal: import_zod16.z.object({
1976
+ clearModal: z17.object({
1903
1977
  title: TranslationConfig.optional(),
1904
1978
  description: TranslationConfig.optional(),
1905
1979
  cancel: TranslationConfig.optional(),
@@ -1910,17 +1984,17 @@ var SearchField = HttpField.extend({
1910
1984
  })
1911
1985
  });
1912
1986
  var LinkButtonField = BaseField.extend({
1913
- type: import_zod16.z.literal(FieldType.LINK_BUTTON),
1914
- configuration: import_zod16.z.object({
1915
- url: import_zod16.z.string().describe("URL to open"),
1987
+ type: z17.literal(FieldType.LINK_BUTTON),
1988
+ configuration: z17.object({
1989
+ url: z17.string().describe("URL to open"),
1916
1990
  text: TranslationConfig.describe("Text to display on the button"),
1917
- icon: import_zod16.z.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
1991
+ icon: z17.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
1918
1992
  })
1919
1993
  }).describe("Button that opens a link");
1920
1994
  var VerificationStatus = BaseField.extend({
1921
- type: import_zod16.z.literal(FieldType.VERIFICATION_STATUS),
1995
+ type: z17.literal(FieldType.VERIFICATION_STATUS),
1922
1996
  defaultValue: VerificationStatusValue.optional(),
1923
- configuration: import_zod16.z.object({
1997
+ configuration: z17.object({
1924
1998
  status: TranslationConfig.describe("Text to display on the status pill."),
1925
1999
  description: TranslationConfig.describe(
1926
2000
  "Explaining text on the banner in form."
@@ -1928,38 +2002,55 @@ var VerificationStatus = BaseField.extend({
1928
2002
  })
1929
2003
  });
1930
2004
  var QueryParamReaderField = BaseField.extend({
1931
- type: import_zod16.z.literal(FieldType.QUERY_PARAM_READER),
1932
- configuration: import_zod16.z.object({
1933
- pickParams: import_zod16.z.array(import_zod16.z.string()).describe("List of query parameters to read from the URL")
2005
+ type: z17.literal(FieldType.QUERY_PARAM_READER),
2006
+ configuration: z17.object({
2007
+ pickParams: z17.array(z17.string()).describe("List of query parameters to read from the URL")
1934
2008
  })
1935
2009
  }).describe(
1936
2010
  "A field that maps URL query params into form values and clears them afterward"
1937
2011
  );
1938
2012
  var QrReaderField = BaseField.extend({
1939
- type: import_zod16.z.literal(FieldType.QR_READER),
2013
+ type: z17.literal(FieldType.QR_READER),
1940
2014
  defaultValue: QrReaderFieldValue.optional(),
1941
- configuration: import_zod16.z.object({
1942
- validator: import_zod16.z.custom(
1943
- (val) => typeof val === "object" && val !== null
1944
- )
2015
+ configuration: z17.object({
2016
+ validator: z17.any().meta({
2017
+ description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
2018
+ id: "QrReaderFieldValidator"
2019
+ })
1945
2020
  }).optional()
2021
+ }).meta({
2022
+ description: "Configuration for QR code reader field, including optional JSON Schema validator.",
2023
+ id: "QrReaderField"
1946
2024
  });
1947
2025
  var IdReaderField = BaseField.extend({
1948
- type: import_zod16.z.literal(FieldType.ID_READER),
2026
+ type: z17.literal(FieldType.ID_READER),
1949
2027
  defaultValue: IdReaderFieldValue.optional(),
1950
- methods: import_zod16.z.array(
1951
- import_zod16.z.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2028
+ methods: z17.array(
2029
+ z17.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
1952
2030
  )
1953
2031
  });
2032
+ var CustomField = BaseField.extend({
2033
+ type: z17.literal(FieldType._EXPERIMENTAL_CUSTOM),
2034
+ defaultValue: CustomFieldValue.optional(),
2035
+ src: z17.string().describe("Module source path for the custom field component"),
2036
+ configuration: z17.unknown().optional()
2037
+ });
1954
2038
  var LoaderField = BaseField.extend({
1955
- type: import_zod16.z.literal(FieldType.LOADER),
1956
- configuration: import_zod16.z.object({
2039
+ type: z17.literal(FieldType.LOADER),
2040
+ configuration: z17.object({
1957
2041
  text: TranslationConfig.describe("Display text above the loading spinner")
1958
2042
  })
1959
2043
  }).describe(
1960
2044
  "A non-interactive field that indicates an in progress operation in form"
1961
2045
  );
1962
- var FieldConfig = import_zod16.z.discriminatedUnion("type", [
2046
+ var HiddenField = BaseField.extend({
2047
+ type: z17.literal(FieldType.ALPHA_HIDDEN),
2048
+ required: z17.boolean().default(false).optional(),
2049
+ defaultValue: TextValue.optional()
2050
+ }).describe(
2051
+ "A non-interactive, hidden field that only hold a value in the form"
2052
+ );
2053
+ var FieldConfig = z17.discriminatedUnion("type", [
1963
2054
  Address,
1964
2055
  TextField,
1965
2056
  NumberField,
@@ -1981,7 +2072,7 @@ var FieldConfig = import_zod16.z.discriminatedUnion("type", [
1981
2072
  Checkbox,
1982
2073
  File,
1983
2074
  Country,
1984
- AdministrativeArea,
2075
+ AdministrativeAreaField,
1985
2076
  Divider,
1986
2077
  LocationInput,
1987
2078
  Facility,
@@ -1999,83 +2090,81 @@ var FieldConfig = import_zod16.z.discriminatedUnion("type", [
1999
2090
  IdReaderField,
2000
2091
  QueryParamReaderField,
2001
2092
  LoaderField,
2002
- SearchField
2003
- ]).openapi({
2093
+ SearchField,
2094
+ CustomField,
2095
+ HiddenField
2096
+ ]).meta({
2004
2097
  description: "Form field configuration",
2005
- ref: "FieldConfig"
2098
+ id: "FieldConfig"
2006
2099
  });
2007
- var AnyFileField = import_zod16.z.discriminatedUnion("type", [
2100
+ var AnyFileField = z17.discriminatedUnion("type", [
2008
2101
  SignatureField,
2009
2102
  File,
2010
2103
  FileUploadWithOptions
2011
2104
  ]);
2012
2105
 
2013
2106
  // ../commons/src/events/FormConfig.ts
2014
- var import_zod18 = require("zod");
2107
+ var z19 = __toESM(require("zod/v4"));
2015
2108
 
2016
2109
  // ../commons/src/events/PageConfig.ts
2017
- var import_zod17 = require("zod");
2018
- var import_zod_openapi7 = require("zod-openapi");
2019
- (0, import_zod_openapi7.extendZodWithOpenApi)(import_zod17.z);
2020
- var PageTypes = import_zod17.z.enum(["FORM", "VERIFICATION"]);
2021
- var PageConfigBase = import_zod17.z.object({
2022
- id: import_zod17.z.string().describe("Unique identifier for the page"),
2110
+ var z18 = __toESM(require("zod/v4"));
2111
+ var PageTypes = z18.enum(["FORM", "VERIFICATION"]);
2112
+ var PageConfigBase = z18.object({
2113
+ id: z18.string().describe("Unique identifier for the page"),
2023
2114
  title: TranslationConfig.describe("Header title of the page"),
2024
- requireCompletionToContinue: import_zod17.z.boolean().default(false).describe(
2115
+ requireCompletionToContinue: z18.boolean().default(false).describe(
2025
2116
  "If true, all required fields must be filled before continuing to the next page"
2026
2117
  ),
2027
- fields: import_zod17.z.array(FieldConfig).describe("Fields to be rendered on the page"),
2118
+ fields: z18.array(FieldConfig).describe("Fields to be rendered on the page"),
2028
2119
  conditional: Conditional.optional().describe(
2029
2120
  "Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
2030
2121
  )
2031
- }).openapi({
2122
+ }).meta({
2032
2123
  description: "Form page configuration",
2033
- ref: "FormPageConfig"
2124
+ id: "FormPageConfig"
2034
2125
  });
2035
2126
  var FormPageConfig = PageConfigBase.extend({
2036
- type: import_zod17.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
2127
+ type: z18.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
2037
2128
  });
2038
- var VerificationActionConfig = import_zod17.z.object({
2039
- verify: import_zod17.z.object({ label: TranslationConfig }),
2040
- cancel: import_zod17.z.object({
2129
+ var VerificationActionConfig = z18.object({
2130
+ verify: z18.object({ label: TranslationConfig }),
2131
+ cancel: z18.object({
2041
2132
  label: TranslationConfig,
2042
- confirmation: import_zod17.z.object({
2133
+ confirmation: z18.object({
2043
2134
  title: TranslationConfig,
2044
2135
  body: TranslationConfig
2045
2136
  })
2046
2137
  })
2047
- }).describe("Actions available on the verification page").openapi({
2138
+ }).describe("Actions available on the verification page").meta({
2048
2139
  description: "Verification action configuration",
2049
- ref: "VerificationActionConfig"
2140
+ id: "VerificationActionConfig"
2050
2141
  });
2051
2142
  var VerificationPageConfig = FormPageConfig.extend({
2052
- type: import_zod17.z.literal(PageTypes.enum.VERIFICATION),
2143
+ type: z18.literal(PageTypes.enum.VERIFICATION),
2053
2144
  actions: VerificationActionConfig
2054
2145
  });
2055
- var PageConfig = import_zod17.z.discriminatedUnion("type", [
2146
+ var PageConfig = z18.discriminatedUnion("type", [
2056
2147
  FormPageConfig,
2057
2148
  VerificationPageConfig
2058
2149
  ]);
2059
2150
 
2060
2151
  // ../commons/src/events/FormConfig.ts
2061
- var DeclarationFormConfig = import_zod18.z.object({
2152
+ var DeclarationFormConfig = z19.object({
2062
2153
  label: TranslationConfig.describe("Human readable description of the form"),
2063
- pages: import_zod18.z.array(FormPageConfig)
2154
+ pages: z19.array(FormPageConfig)
2064
2155
  }).describe("Configuration of the declaration form.");
2065
- var ActionFormConfig = import_zod18.z.object({
2156
+ var ActionFormConfig = z19.object({
2066
2157
  label: TranslationConfig.describe("Human readable description of the form"),
2067
- pages: import_zod18.z.array(PageConfig)
2158
+ pages: z19.array(PageConfig)
2068
2159
  }).describe(
2069
2160
  "Configuration of the form used for system actions beyond declaration, supporting a wider range of page types."
2070
2161
  );
2071
- var FormConfig = import_zod18.z.union([DeclarationFormConfig, ActionFormConfig]);
2162
+ var FormConfig = z19.union([DeclarationFormConfig, ActionFormConfig]);
2072
2163
 
2073
2164
  // ../commons/src/events/DeduplicationConfig.ts
2074
- var import_zod19 = require("zod");
2075
- var import_zod_openapi8 = require("zod-openapi");
2076
- (0, import_zod_openapi8.extendZodWithOpenApi)(import_zod19.z);
2077
- var FieldReference2 = import_zod19.z.string();
2078
- var Matcher = import_zod19.z.object({
2165
+ var z20 = __toESM(require("zod/v4"));
2166
+ var FieldReference2 = z20.string();
2167
+ var Matcher = z20.object({
2079
2168
  /**
2080
2169
  * Reference to the field used in matching.
2081
2170
  *
@@ -2083,68 +2172,68 @@ var Matcher = import_zod19.z.object({
2083
2172
  * be used as the origin date to calculate the distance from.
2084
2173
  */
2085
2174
  fieldId: FieldReference2,
2086
- options: import_zod19.z.object({
2087
- boost: import_zod19.z.number().optional()
2175
+ options: z20.object({
2176
+ boost: z20.number().optional()
2088
2177
  }).optional().default({
2089
2178
  boost: 1
2090
2179
  })
2091
2180
  });
2092
2181
  var FuzzyMatcher = Matcher.extend({
2093
- type: import_zod19.z.literal("fuzzy"),
2094
- options: import_zod19.z.object({
2182
+ type: z20.literal("fuzzy"),
2183
+ options: z20.object({
2095
2184
  /**
2096
2185
  * Names of length 3 or less characters = 0 edits allowed
2097
2186
  * Names of length 4 - 6 characters = 1 edit allowed
2098
2187
  * Names of length >7 characters = 2 edits allowed
2099
2188
  */
2100
- fuzziness: import_zod19.z.union([import_zod19.z.string(), import_zod19.z.number()]).optional().default("AUTO:4,7"),
2101
- boost: import_zod19.z.number().optional().default(1)
2189
+ fuzziness: z20.union([z20.string(), z20.number()]).optional().default("AUTO:4,7"),
2190
+ boost: z20.number().optional().default(1)
2102
2191
  }).optional().default({
2103
2192
  fuzziness: "AUTO:4,7",
2104
2193
  boost: 1
2105
2194
  })
2106
2195
  });
2107
2196
  var StrictMatcher = Matcher.extend({
2108
- type: import_zod19.z.literal("strict"),
2109
- options: import_zod19.z.object({
2110
- boost: import_zod19.z.number().optional().default(1),
2197
+ type: z20.literal("strict"),
2198
+ options: z20.object({
2199
+ boost: z20.number().optional().default(1),
2111
2200
  /**
2112
2201
  * The constant value to be present in the field for both records
2113
2202
  */
2114
- value: import_zod19.z.string().optional()
2203
+ value: z20.string().optional()
2115
2204
  }).optional().default({
2116
2205
  boost: 1
2117
2206
  })
2118
2207
  });
2119
2208
  var DateRangeMatcher = Matcher.extend({
2120
- type: import_zod19.z.literal("dateRange"),
2121
- options: import_zod19.z.object({
2209
+ type: z20.literal("dateRange"),
2210
+ options: z20.object({
2122
2211
  /**
2123
2212
  * The distance pivot in days. Distance from the origin (the value of
2124
2213
  * fieldId) at which relevance scores receive half of the boost value
2125
2214
  */
2126
- pivot: import_zod19.z.number().optional(),
2127
- days: import_zod19.z.number(),
2128
- boost: import_zod19.z.number().optional().default(1)
2215
+ pivot: z20.number().optional(),
2216
+ days: z20.number(),
2217
+ boost: z20.number().optional().default(1)
2129
2218
  })
2130
2219
  });
2131
- var Not = import_zod19.z.object({
2132
- type: import_zod19.z.literal("not"),
2220
+ var Not = z20.object({
2221
+ type: z20.literal("not"),
2133
2222
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2134
- clause: import_zod19.z.lazy(() => Clause)
2223
+ clause: z20.lazy(() => Clause)
2135
2224
  });
2136
- var And = import_zod19.z.object({
2137
- type: import_zod19.z.literal("and"),
2225
+ var And = z20.object({
2226
+ type: z20.literal("and"),
2138
2227
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2139
- clauses: import_zod19.z.lazy(() => Clause.array())
2228
+ clauses: z20.lazy(() => Clause.array())
2140
2229
  });
2141
- var Or = import_zod19.z.object({
2142
- type: import_zod19.z.literal("or"),
2230
+ var Or = z20.object({
2231
+ type: z20.literal("or"),
2143
2232
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2144
- clauses: import_zod19.z.lazy(() => Clause.array())
2233
+ clauses: z20.lazy(() => Clause.array())
2145
2234
  });
2146
- var Clause = import_zod19.z.lazy(
2147
- () => import_zod19.z.discriminatedUnion("type", [
2235
+ var Clause = z20.lazy(
2236
+ () => z20.discriminatedUnion("type", [
2148
2237
  Not,
2149
2238
  And,
2150
2239
  Or,
@@ -2152,193 +2241,328 @@ var Clause = import_zod19.z.lazy(
2152
2241
  StrictMatcher,
2153
2242
  DateRangeMatcher
2154
2243
  ])
2155
- ).openapi({
2156
- ref: "Clause"
2244
+ ).meta({
2245
+ id: "Clause"
2157
2246
  });
2158
- var DeduplicationConfig = import_zod19.z.object({
2159
- id: import_zod19.z.string(),
2247
+ var DeduplicationConfig = z20.object({
2248
+ id: z20.string(),
2160
2249
  label: TranslationConfig,
2161
2250
  query: Clause
2162
2251
  });
2163
2252
 
2253
+ // ../commons/src/icons.ts
2254
+ var z21 = __toESM(require("zod/v4"));
2255
+ var AvailableIcons = z21.enum([
2256
+ "Archived",
2257
+ "Assigned",
2258
+ "Briefcase",
2259
+ "Certified",
2260
+ "Close",
2261
+ "Collapse",
2262
+ "Draft",
2263
+ "DuplicateYellow",
2264
+ "Expand",
2265
+ "ExternalValidate",
2266
+ "FilledCheck",
2267
+ "InReview",
2268
+ "Offline",
2269
+ "Registered",
2270
+ "RequiresUpdates",
2271
+ "Sent",
2272
+ "Validated",
2273
+ "WaitingApproval",
2274
+ "ChartActivity",
2275
+ "Activity",
2276
+ "Archive",
2277
+ "ArchiveTray",
2278
+ "ArrowLeft",
2279
+ "ArrowRight",
2280
+ "Buildings",
2281
+ "Circle",
2282
+ "CaretDown",
2283
+ "CaretLeft",
2284
+ "CaretRight",
2285
+ "ChartBar",
2286
+ "ChartLine",
2287
+ "ChatCircle",
2288
+ "CheckSquare",
2289
+ "Compass",
2290
+ "Check",
2291
+ "Copy",
2292
+ "Database",
2293
+ "DotsThreeVertical",
2294
+ "ArrowCounterClockwise",
2295
+ "MagnifyingGlassMinus",
2296
+ "MagnifyingGlassPlus",
2297
+ "Export",
2298
+ "Eye",
2299
+ "EyeSlash",
2300
+ "Envelope",
2301
+ "File",
2302
+ "FileSearch",
2303
+ "FileMinus",
2304
+ "FilePlus",
2305
+ "FileText",
2306
+ "FileX",
2307
+ "Handshake",
2308
+ "Gear",
2309
+ "GitBranch",
2310
+ "IdentificationCard",
2311
+ "List",
2312
+ "ListBullets",
2313
+ "Lock",
2314
+ "MagnifyingGlass",
2315
+ "MapPin",
2316
+ "Medal",
2317
+ "NotePencil",
2318
+ "Paperclip",
2319
+ "PaperPlaneTilt",
2320
+ "Pen",
2321
+ "PenNib",
2322
+ "Pencil",
2323
+ "PencilSimpleLine",
2324
+ "Phone",
2325
+ "Plus",
2326
+ "Printer",
2327
+ "SignOut",
2328
+ "Stamp",
2329
+ "Star",
2330
+ "Target",
2331
+ "TextT",
2332
+ "Trash",
2333
+ "UploadSimple",
2334
+ "User",
2335
+ "UserPlus",
2336
+ "Users",
2337
+ "WarningCircle",
2338
+ "X",
2339
+ "ChatText",
2340
+ "CircleWavyCheck",
2341
+ "CircleWavyQuestion",
2342
+ "ArchiveBox",
2343
+ "ArrowCircleDown",
2344
+ "FileArrowUp",
2345
+ "FileDotted",
2346
+ "Files",
2347
+ "PencilLine",
2348
+ "PencilCircle",
2349
+ "UserCircle",
2350
+ "Clock",
2351
+ "QrCode",
2352
+ "Webcam",
2353
+ "Sun",
2354
+ "DeviceTabletCamera",
2355
+ "Globe",
2356
+ "Fingerprint",
2357
+ "PushPin",
2358
+ "Timer"
2359
+ ]);
2360
+
2164
2361
  // ../commons/src/events/ActionConfig.ts
2165
- var import_zod_openapi9 = require("zod-openapi");
2166
- (0, import_zod_openapi9.extendZodWithOpenApi)(import_zod20.z);
2167
- var DeclarationReviewConfig = import_zod20.z.object({
2362
+ var DeclarationReviewConfig = z22.object({
2168
2363
  title: TranslationConfig.describe("Title of the review page"),
2169
- fields: import_zod20.z.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
2364
+ fields: z22.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
2170
2365
  }).describe(
2171
2366
  "Configuration of the declaration review page for collecting event-related metadata."
2172
2367
  );
2173
- var ActionConfigBase = import_zod20.z.object({
2174
- label: TranslationConfig.describe("Human readable description of the action")
2368
+ var ActionConfigBase = z22.object({
2369
+ label: TranslationConfig.describe("Human readable description of the action"),
2370
+ flags: z22.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
2371
+ supportingCopy: TranslationConfig.optional().describe(
2372
+ "Text displayed on the confirmation dialog"
2373
+ ),
2374
+ icon: AvailableIcons.describe("Icon representing the action").optional(),
2375
+ conditionals: z22.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
2175
2376
  });
2176
2377
  var DeclarationActionBase = ActionConfigBase.extend({
2177
- review: DeclarationReviewConfig,
2178
2378
  deduplication: DeduplicationConfig.optional()
2179
2379
  });
2180
- var ReadActionConfig = ActionConfigBase.merge(
2181
- import_zod20.z.object({
2182
- type: import_zod20.z.literal(ActionType.READ),
2380
+ var ReadActionConfig = ActionConfigBase.extend(
2381
+ z22.object({
2382
+ type: z22.literal(ActionType.READ),
2183
2383
  review: DeclarationReviewConfig.describe(
2184
2384
  "Configuration of the review page for read-only view."
2185
- )
2186
- })
2187
- );
2188
- var DeclareConfig = DeclarationActionBase.merge(
2189
- import_zod20.z.object({
2190
- type: import_zod20.z.literal(ActionType.DECLARE)
2191
- })
2385
+ ),
2386
+ conditionals: z22.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
2387
+ }).shape
2192
2388
  );
2193
- var ValidateConfig = DeclarationActionBase.merge(
2194
- import_zod20.z.object({
2195
- type: import_zod20.z.literal(ActionType.VALIDATE)
2196
- })
2389
+ var DeclareConfig = DeclarationActionBase.extend(
2390
+ z22.object({
2391
+ type: z22.literal(ActionType.DECLARE),
2392
+ review: DeclarationReviewConfig.describe(
2393
+ "Configuration of the review page fields."
2394
+ ),
2395
+ dialogCopy: z22.object({
2396
+ notify: TranslationConfig.describe(
2397
+ "Confirmation text for the notify action"
2398
+ ),
2399
+ declare: TranslationConfig.describe(
2400
+ "Confirmation text for the declare action"
2401
+ ),
2402
+ register: TranslationConfig.describe(
2403
+ "Confirmation text for the register action"
2404
+ )
2405
+ }).optional()
2406
+ }).shape
2197
2407
  );
2198
- var RegisterConfig = DeclarationActionBase.merge(
2199
- import_zod20.z.object({
2200
- type: import_zod20.z.literal(ActionType.REGISTER)
2201
- })
2408
+ var ArchiveConfig = ActionConfigBase.extend(
2409
+ z22.object({
2410
+ type: z22.literal(ActionType.ARCHIVE)
2411
+ }).shape
2202
2412
  );
2203
- var RejectDeclarationConfig = ActionConfigBase.merge(
2204
- import_zod20.z.object({
2205
- type: import_zod20.z.literal(ActionType.REJECT)
2206
- })
2413
+ var EditActionConfig = ActionConfigBase.extend(
2414
+ z22.object({
2415
+ type: z22.literal(ActionType.EDIT),
2416
+ dialogCopy: z22.object({
2417
+ notify: TranslationConfig.describe(
2418
+ "Confirmation text for the notify with edits action"
2419
+ ),
2420
+ declare: TranslationConfig.describe(
2421
+ "Confirmation text for the declare with edits action"
2422
+ ),
2423
+ register: TranslationConfig.describe(
2424
+ "Confirmation text for the register with edits action"
2425
+ )
2426
+ })
2427
+ }).shape
2207
2428
  );
2208
- var ArchiveConfig = ActionConfigBase.merge(
2209
- import_zod20.z.object({
2210
- type: import_zod20.z.literal(ActionType.ARCHIVE)
2211
- })
2429
+ var RejectConfig = ActionConfigBase.extend(
2430
+ z22.object({
2431
+ type: z22.literal(ActionType.REJECT)
2432
+ }).shape
2212
2433
  );
2213
- var DeleteConfig = ActionConfigBase.merge(
2214
- import_zod20.z.object({
2215
- type: import_zod20.z.literal(ActionType.DELETE)
2216
- })
2434
+ var RegisterConfig = DeclarationActionBase.extend(
2435
+ z22.object({
2436
+ type: z22.literal(ActionType.REGISTER)
2437
+ }).shape
2217
2438
  );
2218
- var PrintCertificateActionConfig = ActionConfigBase.merge(
2219
- import_zod20.z.object({
2220
- type: import_zod20.z.literal(ActionType.PRINT_CERTIFICATE),
2439
+ var PrintCertificateActionConfig = ActionConfigBase.extend(
2440
+ z22.object({
2441
+ type: z22.literal(ActionType.PRINT_CERTIFICATE),
2221
2442
  printForm: ActionFormConfig
2222
- })
2443
+ }).shape
2223
2444
  );
2224
- var RequestCorrectionConfig = ActionConfigBase.merge(
2225
- import_zod20.z.object({
2226
- type: import_zod20.z.literal(ActionType.REQUEST_CORRECTION),
2445
+ var RequestCorrectionConfig = ActionConfigBase.extend(
2446
+ z22.object({
2447
+ type: z22.literal(ActionType.REQUEST_CORRECTION),
2227
2448
  correctionForm: ActionFormConfig
2228
- })
2229
- );
2230
- var RejectCorrectionConfig = ActionConfigBase.merge(
2231
- import_zod20.z.object({
2232
- type: import_zod20.z.literal(ActionType.REJECT_CORRECTION)
2233
- })
2449
+ }).shape
2234
2450
  );
2235
- var ApproveCorrectionConfig = ActionConfigBase.merge(
2236
- import_zod20.z.object({
2237
- type: import_zod20.z.literal(ActionType.APPROVE_CORRECTION)
2451
+ var CustomActionConfig = ActionConfigBase.merge(
2452
+ z22.object({
2453
+ type: z22.literal(ActionType.CUSTOM),
2454
+ customActionType: z22.string().describe("Type identifier of the custom action."),
2455
+ /** 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. */
2456
+ form: z22.array(FieldConfig).describe(
2457
+ "Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
2458
+ ),
2459
+ auditHistoryLabel: TranslationConfig.describe(
2460
+ 'The label to show in audit history for this action. For example "Approved".'
2461
+ )
2238
2462
  })
2239
2463
  );
2240
- var ActionConfig = import_zod20.z.discriminatedUnion("type", [
2464
+ var ActionConfig = z22.discriminatedUnion("type", [
2241
2465
  /*
2242
2466
  * OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
2243
2467
  * and treat them as "models" instead of duplicating the data structure in each endpoint.
2244
2468
  */
2245
- ReadActionConfig.openapi({ ref: "ReadActionConfig" }),
2246
- DeclareConfig.openapi({ ref: "DeclareActionConfig" }),
2247
- ValidateConfig.openapi({ ref: "ValidateActionConfig" }),
2248
- RejectDeclarationConfig.openapi({ ref: "RejectDeclarationActionConfig" }),
2249
- ArchiveConfig.openapi({ ref: "ArchiveActionConfig" }),
2250
- RegisterConfig.openapi({ ref: "RegisterActionConfig" }),
2251
- DeleteConfig.openapi({ ref: "DeleteActionConfig" }),
2252
- PrintCertificateActionConfig.openapi({
2253
- ref: "PrintCertificateActionConfig"
2469
+ ReadActionConfig.meta({ id: "ReadActionConfig" }),
2470
+ DeclareConfig.meta({ id: "DeclareActionConfig" }),
2471
+ RejectConfig.meta({ id: "RejectActionConfig" }),
2472
+ RegisterConfig.meta({ id: "RegisterActionConfig" }),
2473
+ PrintCertificateActionConfig.meta({
2474
+ id: "PrintCertificateActionConfig"
2254
2475
  }),
2255
- RequestCorrectionConfig.openapi({ ref: "RequestCorrectionActionConfig" }),
2256
- RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
2257
- ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
2476
+ RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
2477
+ EditActionConfig.meta({ id: "EditActionConfig" }),
2478
+ ArchiveConfig.meta({ id: "ArchiveActionConfig" }),
2479
+ CustomActionConfig.meta({ id: "CustomActionConfig" })
2258
2480
  ]).describe(
2259
2481
  "Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
2260
- ).openapi({ ref: "ActionConfig" });
2261
- var DeclarationActionConfig = import_zod20.z.discriminatedUnion("type", [
2482
+ ).meta({ id: "ActionConfig" });
2483
+ var actionConfigTypes = new Set(
2484
+ ActionConfig.options.map((opt) => opt.shape.type.value)
2485
+ );
2486
+ var DeclarationActionConfig = z22.discriminatedUnion("type", [
2262
2487
  DeclareConfig,
2263
- ValidateConfig,
2264
2488
  RegisterConfig
2265
2489
  ]);
2266
2490
 
2267
2491
  // ../commons/src/events/offline/CertificateConfig.ts
2268
- var import_zod21 = require("zod");
2269
- var FontFamily = import_zod21.z.object({
2270
- normal: import_zod21.z.string(),
2271
- bold: import_zod21.z.string(),
2272
- italics: import_zod21.z.string(),
2273
- bolditalics: import_zod21.z.string()
2274
- });
2275
- var CertificateConfig = import_zod21.z.object({
2276
- id: import_zod21.z.string(),
2277
- event: import_zod21.z.string(),
2278
- isV2Template: import_zod21.z.boolean().optional(),
2492
+ var z23 = __toESM(require("zod/v4"));
2493
+ var FontFamily = z23.object({
2494
+ normal: z23.string(),
2495
+ bold: z23.string(),
2496
+ italics: z23.string(),
2497
+ bolditalics: z23.string()
2498
+ });
2499
+ var CertificateConfig = z23.object({
2500
+ id: z23.string(),
2501
+ event: z23.string(),
2502
+ isV2Template: z23.boolean().optional(),
2279
2503
  label: TranslationConfig,
2280
- isDefault: import_zod21.z.boolean(),
2281
- fee: import_zod21.z.object({
2282
- onTime: import_zod21.z.number(),
2283
- late: import_zod21.z.number(),
2284
- delayed: import_zod21.z.number()
2504
+ isDefault: z23.boolean(),
2505
+ fee: z23.object({
2506
+ onTime: z23.number(),
2507
+ late: z23.number(),
2508
+ delayed: z23.number()
2285
2509
  }),
2286
- svgUrl: import_zod21.z.string(),
2287
- fonts: import_zod21.z.record(FontFamily).optional(),
2288
- conditionals: import_zod21.z.array(ShowConditional).optional()
2510
+ svgUrl: z23.string(),
2511
+ fonts: z23.record(z23.string(), FontFamily).optional(),
2512
+ conditionals: z23.array(ShowConditional).optional()
2289
2513
  });
2290
2514
  var CertificateTemplateConfig = CertificateConfig.extend({
2291
- hash: import_zod21.z.string().optional(),
2292
- svg: import_zod21.z.string()
2515
+ hash: z23.string().optional(),
2516
+ svg: z23.string()
2293
2517
  });
2294
2518
 
2295
2519
  // ../commons/src/events/offline/LanguageConfig.ts
2296
- var import_zod22 = require("zod");
2297
- var LanguageConfig = import_zod22.z.object({
2298
- lang: import_zod22.z.string(),
2520
+ var z24 = __toESM(require("zod/v4"));
2521
+ var LanguageConfig = z24.object({
2522
+ lang: z24.string(),
2299
2523
  /**
2300
2524
  * client.csv contents
2301
2525
  */
2302
- messages: import_zod22.z.record(import_zod22.z.string())
2526
+ messages: z24.record(z24.string(), z24.string())
2303
2527
  });
2304
2528
 
2305
2529
  // ../commons/src/events/EventConfig.ts
2306
- var import_zod27 = require("zod");
2530
+ var z30 = __toESM(require("zod/v4"));
2307
2531
 
2308
2532
  // ../commons/src/events/SummaryConfig.ts
2309
- var import_zod23 = require("zod");
2310
- var BaseField2 = import_zod23.z.object({
2533
+ var z25 = __toESM(require("zod/v4"));
2534
+ var BaseField2 = z25.object({
2311
2535
  emptyValueMessage: TranslationConfig.optional().describe(
2312
2536
  "Default message displayed when the field value is empty."
2313
2537
  ),
2314
- conditionals: import_zod23.z.array(ShowConditional).default([]).optional()
2538
+ conditionals: z25.array(ShowConditional).default([]).optional()
2315
2539
  });
2316
2540
  var ReferenceField = BaseField2.extend({
2317
- fieldId: import_zod23.z.string(),
2541
+ fieldId: z25.string(),
2318
2542
  label: TranslationConfig.optional().describe(
2319
2543
  "Overrides the default label from the referenced field when provided."
2320
2544
  )
2321
2545
  }).describe("Field referencing existing event data by field ID.");
2322
2546
  var Field = BaseField2.extend({
2323
- id: import_zod23.z.string().describe("Identifier of the summary field."),
2547
+ id: z25.string().describe("Identifier of the summary field."),
2324
2548
  value: TranslationConfig.describe(
2325
2549
  'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
2326
2550
  ),
2327
2551
  label: TranslationConfig
2328
2552
  }).describe("Custom field defined for the summary view.");
2329
- var SummaryConfig = import_zod23.z.object({
2330
- fields: import_zod23.z.array(import_zod23.z.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2553
+ var SummaryConfig = z25.object({
2554
+ fields: z25.array(z25.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2331
2555
  }).describe("Configuration of the event summary section.");
2332
2556
 
2333
2557
  // ../commons/src/events/AdvancedSearchConfig.ts
2334
- var import_zod24 = require("zod");
2335
- var MatchType = import_zod24.z.enum(["fuzzy", "exact", "range", "within"]);
2336
- var BaseField3 = import_zod24.z.object({
2337
- config: import_zod24.z.object({
2558
+ var z26 = __toESM(require("zod/v4"));
2559
+ var MatchType = z26.enum(["fuzzy", "exact", "range", "within"]);
2560
+ var BaseField3 = z26.object({
2561
+ config: z26.object({
2338
2562
  type: MatchType.describe(
2339
2563
  "Determines the search type of field. How to match value."
2340
2564
  ),
2341
- searchFields: import_zod24.z.array(import_zod24.z.string()).optional().describe(
2565
+ searchFields: z26.array(z26.string()).optional().describe(
2342
2566
  `
2343
2567
  Defines multiple form fields that should be searched when this field has a value.
2344
2568
  All specified fields will be combined using OR logic.
@@ -2348,7 +2572,7 @@ var BaseField3 = import_zod24.z.object({
2348
2572
  `
2349
2573
  )
2350
2574
  }),
2351
- type: import_zod24.z.nativeEnum(FieldType).optional().describe(
2575
+ type: z26.nativeEnum(FieldType).optional().describe(
2352
2576
  `
2353
2577
  Explicitly specify the field type for searchFields.
2354
2578
  This is required when searchFields is defined, to show the correct control in the UI.
@@ -2362,7 +2586,7 @@ var BaseField3 = import_zod24.z.object({
2362
2586
  This is required when searchFields is defined.
2363
2587
  `
2364
2588
  ),
2365
- options: import_zod24.z.array(SelectOption).optional(),
2589
+ options: z26.array(SelectOption).optional(),
2366
2590
  searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
2367
2591
  `
2368
2592
  This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
@@ -2383,7 +2607,7 @@ var BaseField3 = import_zod24.z.object({
2383
2607
  in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
2384
2608
  `
2385
2609
  ),
2386
- conditionals: import_zod24.z.array(FieldConditional).default([]).optional().describe(
2610
+ conditionals: z26.array(FieldConditional).optional().describe(
2387
2611
  `
2388
2612
  In advanced search, we sometimes need to override the default field visibility conditionals.
2389
2613
 
@@ -2397,20 +2621,20 @@ var BaseField3 = import_zod24.z.object({
2397
2621
  are always rendered in the advanced search form.
2398
2622
  `
2399
2623
  ),
2400
- validations: import_zod24.z.array(ValidationConfig).default([]).optional().describe(
2624
+ validations: z26.array(ValidationConfig).optional().describe(
2401
2625
  `Option for overriding the field validations specifically for advanced search form.`
2402
2626
  )
2403
2627
  });
2404
- var SearchQueryParams = import_zod24.z.object({
2405
- eventType: import_zod24.z.string().optional().describe(
2628
+ var SearchQueryParams = z26.object({
2629
+ eventType: z26.string().optional().describe(
2406
2630
  "Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
2407
2631
  )
2408
2632
  }).catchall(FieldValue);
2409
2633
  var FieldConfigSchema = BaseField3.extend({
2410
- fieldId: import_zod24.z.string(),
2411
- fieldType: import_zod24.z.literal("field")
2634
+ fieldId: z26.string(),
2635
+ fieldType: z26.literal("field")
2412
2636
  });
2413
- var EventFieldIdInput = import_zod24.z.enum([
2637
+ var EventFieldIdInput = z26.enum([
2414
2638
  "trackingId",
2415
2639
  "status",
2416
2640
  "legalStatuses.REGISTERED.acceptedAt",
@@ -2419,7 +2643,7 @@ var EventFieldIdInput = import_zod24.z.enum([
2419
2643
  "updatedAt"
2420
2644
  ]);
2421
2645
  var METADATA_FIELD_PREFIX = "event.";
2422
- var EventFieldId = import_zod24.z.enum([
2646
+ var EventFieldId = z26.enum([
2423
2647
  `${METADATA_FIELD_PREFIX}trackingId`,
2424
2648
  `${METADATA_FIELD_PREFIX}status`,
2425
2649
  `${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
@@ -2429,29 +2653,29 @@ var EventFieldId = import_zod24.z.enum([
2429
2653
  ]);
2430
2654
  var EventFieldConfigSchema = BaseField3.extend({
2431
2655
  fieldId: EventFieldId,
2432
- fieldType: import_zod24.z.literal("event")
2656
+ fieldType: z26.literal("event")
2433
2657
  });
2434
- var AdvancedSearchField = import_zod24.z.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
2658
+ var AdvancedSearchField = z26.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
2435
2659
  if (data.config.searchFields && data.config.searchFields.length > 0) {
2436
2660
  if (!data.label) {
2437
2661
  ctx.addIssue({
2438
- code: import_zod24.z.ZodIssueCode.custom,
2662
+ code: z26.ZodIssueCode.custom,
2439
2663
  message: "label is required when config.searchFields is defined.",
2440
2664
  path: ["label"]
2441
2665
  });
2442
2666
  }
2443
2667
  if (!data.type) {
2444
2668
  ctx.addIssue({
2445
- code: import_zod24.z.ZodIssueCode.custom,
2669
+ code: z26.ZodIssueCode.custom,
2446
2670
  message: "type is required when config.searchFields is defined.",
2447
2671
  path: ["type"]
2448
2672
  });
2449
2673
  }
2450
2674
  }
2451
2675
  });
2452
- var AdvancedSearchConfig = import_zod24.z.object({
2676
+ var AdvancedSearchConfig = z26.object({
2453
2677
  title: TranslationConfig.describe("Advanced search tab title"),
2454
- fields: import_zod24.z.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2678
+ fields: z26.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2455
2679
  });
2456
2680
 
2457
2681
  // ../commons/src/events/utils.ts
@@ -2460,11 +2684,11 @@ var import_lodash = require("lodash");
2460
2684
  // ../commons/src/conditionals/validate.ts
2461
2685
  var import__ = __toESM(require("ajv/dist/2019"));
2462
2686
  var import_ajv_formats = __toESM(require("ajv-formats"));
2463
- var import_zod26 = require("zod");
2687
+ var z28 = __toESM(require("zod/v4"));
2464
2688
  var import_date_fns = require("date-fns");
2465
2689
 
2466
2690
  // ../commons/src/events/DynamicFieldValue.ts
2467
- var import_zod25 = require("zod");
2691
+ var z27 = __toESM(require("zod/v4"));
2468
2692
 
2469
2693
  // ../commons/src/conditionals/validate.ts
2470
2694
  var ajv = new import__.default({
@@ -2473,9 +2697,9 @@ var ajv = new import__.default({
2473
2697
  strict: false
2474
2698
  // Allow minContains and other newer features
2475
2699
  });
2476
- var DataContext = import_zod26.z.object({
2477
- rootData: import_zod26.z.object({
2478
- $leafAdminStructureLocationIds: import_zod26.z.array(import_zod26.z.object({ id: UUID }))
2700
+ var DataContext = z28.object({
2701
+ rootData: z28.object({
2702
+ $leafAdminStructureLocationIds: z28.array(z28.object({ id: UUID }))
2479
2703
  })
2480
2704
  });
2481
2705
  function resolveDataPath(rootData, dataPath, instancePath) {
@@ -2552,12 +2776,12 @@ ajv.addKeyword({
2552
2776
  });
2553
2777
 
2554
2778
  // ../commons/src/utils.ts
2555
- var z27 = __toESM(require("zod"));
2556
- var FullNameV1 = z27.array(
2557
- z27.object({
2558
- use: z27.string(),
2559
- family: z27.string(),
2560
- given: z27.array(z27.string())
2779
+ var z29 = __toESM(require("zod/v4"));
2780
+ var FullNameV1 = z29.array(
2781
+ z29.object({
2782
+ use: z29.string(),
2783
+ family: z29.string(),
2784
+ given: z29.array(z29.string())
2561
2785
  })
2562
2786
  );
2563
2787
  function omitKeyDeep(obj, keyToRemove) {
@@ -2578,9 +2802,6 @@ function omitKeyDeep(obj, keyToRemove) {
2578
2802
 
2579
2803
  // ../commons/src/events/utils.ts
2580
2804
  var import_date_fns2 = require("date-fns");
2581
- function isDeclarationActionConfig(action) {
2582
- return DeclarationActions.safeParse(action.type).success;
2583
- }
2584
2805
  function getDeclarationFields(configuration) {
2585
2806
  return configuration.declaration.pages.flatMap(({ fields }) => fields);
2586
2807
  }
@@ -2591,7 +2812,10 @@ var getActionAnnotationFields = (actionConfig) => {
2591
2812
  if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
2592
2813
  return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
2593
2814
  }
2594
- if (isDeclarationActionConfig(actionConfig)) {
2815
+ if (actionConfig.type === ActionType.CUSTOM) {
2816
+ return actionConfig.form;
2817
+ }
2818
+ if ("review" in actionConfig) {
2595
2819
  return actionConfig.review.fields;
2596
2820
  }
2597
2821
  return [];
@@ -2611,38 +2835,8 @@ var EXCLUDED_ACTIONS = [
2611
2835
  ActionType.REJECT_CORRECTION
2612
2836
  ];
2613
2837
 
2614
- // ../commons/src/events/EventConfig.ts
2615
- var import_zod_openapi10 = require("zod-openapi");
2616
- (0, import_zod_openapi10.extendZodWithOpenApi)(import_zod27.z);
2617
- var EventConfig = import_zod27.z.object({
2618
- id: import_zod27.z.string().describe(
2619
- 'Machine-readable identifier of the event (e.g. "birth", "death").'
2620
- ),
2621
- dateOfEvent: FieldReference.optional().describe(
2622
- "Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
2623
- ),
2624
- title: TranslationConfig.describe(
2625
- 'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
2626
- ),
2627
- fallbackTitle: TranslationConfig.optional().describe(
2628
- "Fallback title shown when the main title resolves to an empty value."
2629
- ),
2630
- summary: SummaryConfig.describe(
2631
- "Summary information displayed in the event overview."
2632
- ),
2633
- label: TranslationConfig.describe(
2634
- "Human-readable label for the event type."
2635
- ),
2636
- actions: import_zod27.z.array(ActionConfig).describe(
2637
- "Configuration of system-defined actions associated with the event."
2638
- ),
2639
- declaration: DeclarationFormConfig.describe(
2640
- "Configuration of the form used to gather event data."
2641
- ),
2642
- advancedSearch: import_zod27.z.array(AdvancedSearchConfig).optional().default([]).describe(
2643
- "Configuration of fields available in the advanced search feature."
2644
- )
2645
- }).superRefine((event2, ctx) => {
2838
+ // ../commons/src/events/eventConfigValidation.ts
2839
+ function validateAdvancedSearchConfig(event2, ctx) {
2646
2840
  const allFields = findAllFields(event2);
2647
2841
  const fieldIds = allFields.map((field3) => field3.id);
2648
2842
  const advancedSearchFields = event2.advancedSearch.flatMap(
@@ -2669,10 +2863,12 @@ var EventConfig = import_zod27.z.object({
2669
2863
  ctx.addIssue({
2670
2864
  code: "custom",
2671
2865
  message: `Advanced search id must match a field id of form fields or pre-defined metadata fields.
2672
- Invalid AdvancedSearch field IDs for event ${event2.id}: ${invalidFields.map((f) => f.fieldId).join(", ")}`,
2866
+ Invalid AdvancedSearch field IDs for event ${event2.id}: ${invalidFields.map((f) => f.fieldId).join(", ")}`,
2673
2867
  path: ["advancedSearch"]
2674
2868
  });
2675
2869
  }
2870
+ }
2871
+ function validateDateOfEvent(event2, ctx) {
2676
2872
  if (event2.dateOfEvent) {
2677
2873
  const eventDateFieldId = getDeclarationFields(event2).find(
2678
2874
  ({ id }) => id === event2.dateOfEvent?.$$field
@@ -2681,7 +2877,7 @@ var EventConfig = import_zod27.z.object({
2681
2877
  ctx.addIssue({
2682
2878
  code: "custom",
2683
2879
  message: `Date of event field id must match a field id in fields array.
2684
- Invalid date of event field ID for event ${event2.id}: ${event2.dateOfEvent.$$field}`,
2880
+ Invalid date of event field ID for event ${event2.id}: ${event2.dateOfEvent.$$field}`,
2685
2881
  path: ["dateOfEvent"]
2686
2882
  });
2687
2883
  } else if (eventDateFieldId.type !== FieldType.DATE) {
@@ -2692,8 +2888,105 @@ var EventConfig = import_zod27.z.object({
2692
2888
  });
2693
2889
  }
2694
2890
  }
2695
- }).openapi({
2696
- ref: "EventConfig"
2891
+ }
2892
+ function validatePlaceOfEvent(event2, ctx) {
2893
+ if (event2.placeOfEvent) {
2894
+ const eventPlaceFieldId = getDeclarationFields(event2).find(
2895
+ ({ id }) => id === event2.placeOfEvent?.$$field
2896
+ );
2897
+ if (!eventPlaceFieldId) {
2898
+ ctx.addIssue({
2899
+ code: "custom",
2900
+ message: `Place of event field id must match a field id in the event.declaration fields.
2901
+ Invalid place of event field ID for event ${event2.id}: ${event2.placeOfEvent.$$field}`,
2902
+ path: ["placeOfEvent"]
2903
+ });
2904
+ }
2905
+ }
2906
+ }
2907
+ function validateActionFlags(event2, ctx) {
2908
+ const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
2909
+ const configuredFlagIds = event2.flags.map((flag) => flag.id);
2910
+ const actionFlagIds = event2.actions.flatMap(
2911
+ (action) => action.flags.map((flag) => flag.id)
2912
+ );
2913
+ for (const actionFlagId of actionFlagIds) {
2914
+ const isConfigured = configuredFlagIds.includes(actionFlagId);
2915
+ const isInherent = isInherentFlag(actionFlagId);
2916
+ if (!isConfigured && !isInherent) {
2917
+ ctx.addIssue({
2918
+ code: "custom",
2919
+ message: `Action flag id must match an inherent flag or a configured flag in the flags array. Invalid action flag ID for event '${event2.id}': '${actionFlagId}'`,
2920
+ path: ["actions"]
2921
+ });
2922
+ }
2923
+ }
2924
+ }
2925
+ function validateActionOrder(event2, ctx) {
2926
+ if (event2.actionOrder) {
2927
+ const customActionTypes = event2.actions.filter((action) => action.type === ActionType.CUSTOM).map((action) => action.customActionType);
2928
+ const validActionTypes = [
2929
+ ...workqueueActions.options,
2930
+ ...customActionTypes
2931
+ ];
2932
+ for (const actionType of event2.actionOrder) {
2933
+ if (!validActionTypes.includes(actionType)) {
2934
+ ctx.addIssue({
2935
+ code: "custom",
2936
+ message: `Invalid action type in action order: ${actionType}`,
2937
+ path: ["actionOrder"]
2938
+ });
2939
+ }
2940
+ }
2941
+ }
2942
+ }
2943
+
2944
+ // ../commons/src/events/EventConfig.ts
2945
+ var EventConfig = z30.object({
2946
+ id: z30.string().describe(
2947
+ 'Machine-readable identifier of the event (e.g. "birth", "death").'
2948
+ ),
2949
+ dateOfEvent: FieldReference.optional().describe(
2950
+ "Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
2951
+ ),
2952
+ placeOfEvent: FieldReference.optional().describe(
2953
+ "Reference to the field capturing the place of the event (e.g. place of birth). Defaults to the meta.createdAtLocation if unspecified."
2954
+ ),
2955
+ title: TranslationConfig.describe(
2956
+ 'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
2957
+ ),
2958
+ fallbackTitle: TranslationConfig.optional().describe(
2959
+ "Fallback title shown when the main title resolves to an empty value."
2960
+ ),
2961
+ summary: SummaryConfig.describe(
2962
+ "Summary information displayed in the event overview."
2963
+ ),
2964
+ label: TranslationConfig.describe(
2965
+ "Human-readable label for the event type."
2966
+ ),
2967
+ actions: z30.array(ActionConfig).describe(
2968
+ "Configuration of system-defined actions associated with the event."
2969
+ ),
2970
+ actionOrder: z30.array(z30.string()).optional().describe(
2971
+ "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
2972
+ ),
2973
+ declaration: DeclarationFormConfig.describe(
2974
+ "Configuration of the form used to gather event data."
2975
+ ),
2976
+ advancedSearch: z30.array(AdvancedSearchConfig).optional().default([]).describe(
2977
+ "Configuration of fields available in the advanced search feature."
2978
+ ),
2979
+ flags: z30.array(FlagConfig).optional().default([]).describe(
2980
+ "Configuration of flags associated with the actions of this event type."
2981
+ )
2982
+ }).superRefine((event2, ctx) => {
2983
+ validateAdvancedSearchConfig(event2, ctx);
2984
+ validateDateOfEvent(event2, ctx);
2985
+ validatePlaceOfEvent(event2, ctx);
2986
+ validateActionFlags(event2, ctx);
2987
+ validateActionOrder(event2, ctx);
2988
+ }).meta({
2989
+ id: "EventConfig"
2697
2990
  }).describe("Configuration defining an event type.");
2698
2991
 
2699
2992
  // ../commons/src/events/EventConfigInput.ts
@@ -2702,7 +2995,7 @@ var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
2702
2995
  var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
2703
2996
 
2704
2997
  // ../commons/src/events/WorkqueueConfig.ts
2705
- var import_zod31 = require("zod");
2998
+ var z33 = __toESM(require("zod/v4"));
2706
2999
 
2707
3000
  // ../commons/src/conditionals/conditionals.ts
2708
3001
  var objectHash = __toESM(require("object-hash"));
@@ -2740,7 +3033,7 @@ function not(condition) {
2740
3033
  required: []
2741
3034
  });
2742
3035
  }
2743
- function never() {
3036
+ function never2() {
2744
3037
  return not(alwaysTrue());
2745
3038
  }
2746
3039
  function jsonFieldPath(field3) {
@@ -3403,224 +3696,115 @@ var event = Object.assign(eventFn, {
3403
3696
  required: ["actions"]
3404
3697
  }
3405
3698
  },
3406
- required: ["$event"]
3407
- });
3408
- };
3409
- const withMinMax = (additionalFields) => {
3410
- return {
3411
- /**
3412
- * Creates a conditional that checks if the event contains a specific action type
3413
- * with a minimum count of occurrences.
3414
- *
3415
- * @param minCount - The minimum number of actions required.
3416
- */
3417
- minCount: (minCount) => createCountConditional("minContains", minCount, additionalFields),
3418
- /**
3419
- * Builds a conditional that sets a maximum count for the number of actions.
3420
- * This is useful for limiting the number of actions of a specific type in a single event.
3421
- */
3422
- maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
3423
- };
3424
- };
3425
- const chainableMethods = {
3426
- /**
3427
- * Adds additional field constraints to the action matching.
3428
- *
3429
- * @param fields - Object containing additional fields to match on the action.
3430
- */
3431
- withFields: (fields) => withMinMax(fields),
3432
- /**
3433
- * Adds template ID constraint to the action matching.
3434
- * This is a convenience method that adds content.templateId to the fields.
3435
- *
3436
- * @param id - The template ID to match against.
3437
- */
3438
- withTemplate: (id) => withMinMax({
3439
- content: { templateId: id }
3440
- }),
3441
- ...withMinMax()
3442
- };
3443
- return { ...basicConditional, ...chainableMethods };
3444
- },
3445
- field(field3) {
3446
- return {
3447
- $event: field3
3448
- };
3449
- }
3450
- });
3451
-
3452
- // ../commons/src/events/WorkqueueColumnConfig.ts
3453
- var import_zod28 = require("zod");
3454
- var WorkqueueColumnKeysArray = [
3455
- ...EventMetadataKeysArray,
3456
- "title",
3457
- "outbox"
3458
- ];
3459
- var WorkqueueColumnKeys = import_zod28.z.enum(WorkqueueColumnKeysArray);
3460
- var WorkqueueColumnValue = import_zod28.z.object({
3461
- $event: WorkqueueColumnKeys
3462
- });
3463
- var WorkqueueColumn = import_zod28.z.object({
3464
- label: TranslationConfig,
3465
- value: WorkqueueColumnValue
3466
- });
3467
- function defineWorkqueuesColumns(workqueueColumns) {
3468
- return workqueueColumns.map(
3469
- (workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
3470
- );
3471
- }
3472
-
3473
- // ../commons/src/events/CountryConfigQueryInput.ts
3474
- var import_zod29 = require("zod");
3475
- var SerializableExact = import_zod29.z.object({
3476
- type: import_zod29.z.literal("exact"),
3477
- term: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
3478
- });
3479
- var SerializableWithin = import_zod29.z.object({
3480
- type: import_zod29.z.literal("within"),
3481
- location: import_zod29.z.union([import_zod29.z.string(), SerializedUserField])
3482
- });
3483
- var SerializedQueryExpression = import_zod29.z.object({
3484
- eventType: import_zod29.z.string(),
3485
- status: import_zod29.z.optional(import_zod29.z.union([AnyOfStatus, ExactStatus])),
3486
- createdAt: import_zod29.z.optional(DateCondition),
3487
- updatedAt: import_zod29.z.optional(DateCondition),
3488
- "legalStatuses.REGISTERED.createdAt": import_zod29.z.optional(DateCondition),
3489
- "legalStatuses.REGISTERED.createdAtLocation": import_zod29.z.optional(
3490
- import_zod29.z.union([Within, Exact])
3491
- ),
3492
- "legalStatuses.REGISTERED.registrationNumber": import_zod29.z.optional(Exact),
3493
- createdAtLocation: import_zod29.z.optional(
3494
- import_zod29.z.union([SerializableWithin, SerializableExact])
3495
- ),
3496
- updatedAtLocation: import_zod29.z.optional(
3497
- import_zod29.z.union([SerializableWithin, SerializableExact])
3498
- ),
3499
- assignedTo: import_zod29.z.optional(SerializableExact),
3500
- createdBy: import_zod29.z.optional(SerializableExact),
3501
- createdByUserType: ExactUserType,
3502
- updatedBy: import_zod29.z.optional(SerializableExact),
3503
- trackingId: import_zod29.z.optional(Exact),
3504
- flags: import_zod29.z.optional(ContainsFlags),
3505
- data: QueryInput
3506
- }).partial();
3507
- var Or2 = import_zod29.z.object({
3508
- type: import_zod29.z.literal("or"),
3509
- clauses: import_zod29.z.array(SerializedQueryExpression)
3510
- });
3511
- var And2 = import_zod29.z.object({
3512
- type: import_zod29.z.literal("and"),
3513
- clauses: import_zod29.z.array(SerializedQueryExpression)
3514
- });
3515
- var CountryConfigQueryType = import_zod29.z.discriminatedUnion("type", [And2, Or2]);
3516
- var CountryConfigQueryInputType = import_zod29.z.union([
3517
- SerializedQueryExpression,
3518
- And2,
3519
- Or2
3520
- ]);
3521
-
3522
- // ../commons/src/icons.ts
3523
- var import_zod30 = require("zod");
3524
- var AvailableIcons = import_zod30.z.enum([
3525
- "Archived",
3526
- "Assigned",
3527
- "Certified",
3528
- "Close",
3529
- "Collapse",
3530
- "Draft",
3531
- "DuplicateYellow",
3532
- "Expand",
3533
- "ExternalValidate",
3534
- "FilledCheck",
3535
- "InReview",
3536
- "Offline",
3537
- "Registered",
3538
- "RequiresUpdates",
3539
- "Sent",
3540
- "Validated",
3541
- "WaitingApproval",
3542
- "ChartActivity",
3543
- "Activity",
3544
- "Archive",
3545
- "ArchiveTray",
3546
- "ArrowLeft",
3547
- "ArrowRight",
3548
- "Buildings",
3549
- "Circle",
3550
- "CaretDown",
3551
- "CaretLeft",
3552
- "CaretRight",
3553
- "ChartBar",
3554
- "ChartLine",
3555
- "ChatCircle",
3556
- "CheckSquare",
3557
- "Compass",
3558
- "Check",
3559
- "Copy",
3560
- "Database",
3561
- "DotsThreeVertical",
3562
- "ArrowCounterClockwise",
3563
- "MagnifyingGlassMinus",
3564
- "MagnifyingGlassPlus",
3565
- "Export",
3566
- "Eye",
3567
- "EyeSlash",
3568
- "Envelope",
3569
- "File",
3570
- "FileSearch",
3571
- "FileMinus",
3572
- "FilePlus",
3573
- "FileText",
3574
- "FileX",
3575
- "Handshake",
3576
- "Gear",
3577
- "GitBranch",
3578
- "IdentificationCard",
3579
- "List",
3580
- "ListBullets",
3581
- "Lock",
3582
- "MagnifyingGlass",
3583
- "MapPin",
3584
- "Medal",
3585
- "NotePencil",
3586
- "Paperclip",
3587
- "PaperPlaneTilt",
3588
- "Pen",
3589
- "Pencil",
3590
- "PencilSimpleLine",
3591
- "Phone",
3592
- "Plus",
3593
- "Printer",
3594
- "SignOut",
3595
- "Star",
3596
- "Target",
3597
- "TextT",
3598
- "Trash",
3599
- "UploadSimple",
3600
- "User",
3601
- "UserPlus",
3602
- "Users",
3603
- "WarningCircle",
3604
- "X",
3605
- "CircleWavyCheck",
3606
- "CircleWavyQuestion",
3607
- "ArchiveBox",
3608
- "ArrowCircleDown",
3609
- "FileArrowUp",
3610
- "FileDotted",
3611
- "Files",
3612
- "PencilLine",
3613
- "PencilCircle",
3614
- "UserCircle",
3615
- "Clock",
3616
- "QrCode",
3617
- "Webcam",
3618
- "Sun",
3619
- "DeviceTabletCamera",
3620
- "Globe",
3621
- "Fingerprint",
3622
- "PushPin",
3623
- "Timer"
3699
+ required: ["$event"]
3700
+ });
3701
+ };
3702
+ const withMinMax = (additionalFields) => {
3703
+ return {
3704
+ /**
3705
+ * Creates a conditional that checks if the event contains a specific action type
3706
+ * with a minimum count of occurrences.
3707
+ *
3708
+ * @param minCount - The minimum number of actions required.
3709
+ */
3710
+ minCount: (minCount) => createCountConditional("minContains", minCount, additionalFields),
3711
+ /**
3712
+ * Builds a conditional that sets a maximum count for the number of actions.
3713
+ * This is useful for limiting the number of actions of a specific type in a single event.
3714
+ */
3715
+ maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
3716
+ };
3717
+ };
3718
+ const chainableMethods = {
3719
+ /**
3720
+ * Adds additional field constraints to the action matching.
3721
+ *
3722
+ * @param fields - Object containing additional fields to match on the action.
3723
+ */
3724
+ withFields: (fields) => withMinMax(fields),
3725
+ /**
3726
+ * Adds template ID constraint to the action matching.
3727
+ * This is a convenience method that adds content.templateId to the fields.
3728
+ *
3729
+ * @param id - The template ID to match against.
3730
+ */
3731
+ withTemplate: (id) => withMinMax({
3732
+ content: { templateId: id }
3733
+ }),
3734
+ ...withMinMax()
3735
+ };
3736
+ return { ...basicConditional, ...chainableMethods };
3737
+ },
3738
+ field(field3) {
3739
+ return {
3740
+ $event: field3
3741
+ };
3742
+ }
3743
+ });
3744
+
3745
+ // ../commons/src/events/WorkqueueColumnConfig.ts
3746
+ var z31 = __toESM(require("zod/v4"));
3747
+ var WorkqueueColumnKeysArray = [
3748
+ ...EventMetadataKeysArray,
3749
+ "title",
3750
+ "outbox"
3751
+ ];
3752
+ var WorkqueueColumnKeys = z31.enum(WorkqueueColumnKeysArray);
3753
+ var WorkqueueColumnValue = z31.object({
3754
+ $event: WorkqueueColumnKeys
3755
+ });
3756
+ var WorkqueueColumn = z31.object({
3757
+ label: TranslationConfig,
3758
+ value: WorkqueueColumnValue
3759
+ });
3760
+ function defineWorkqueuesColumns(workqueueColumns) {
3761
+ return workqueueColumns.map(
3762
+ (workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
3763
+ );
3764
+ }
3765
+
3766
+ // ../commons/src/events/CountryConfigQueryInput.ts
3767
+ var z32 = __toESM(require("zod/v4"));
3768
+ var SerializableExact = z32.object({
3769
+ type: z32.literal("exact"),
3770
+ term: z32.union([z32.string(), SerializedUserField])
3771
+ });
3772
+ var SerializableWithin = z32.object({
3773
+ type: z32.literal("within"),
3774
+ location: z32.union([z32.string(), SerializedUserField])
3775
+ });
3776
+ var SerializedQueryExpression = z32.object({
3777
+ eventType: z32.string(),
3778
+ status: z32.optional(z32.union([AnyOfStatus, ExactStatus])),
3779
+ createdAt: z32.optional(DateCondition),
3780
+ updatedAt: z32.optional(DateCondition),
3781
+ "legalStatuses.REGISTERED.createdAt": z32.optional(DateCondition),
3782
+ "legalStatuses.DECLARED.createdAtLocation": z32.optional(SerializableWithin),
3783
+ "legalStatuses.REGISTERED.createdAtLocation": z32.optional(SerializableWithin),
3784
+ "legalStatuses.REGISTERED.registrationNumber": z32.optional(Exact),
3785
+ createdAtLocation: z32.optional(SerializableWithin),
3786
+ updatedAtLocation: z32.optional(SerializableWithin),
3787
+ assignedTo: z32.optional(SerializableExact),
3788
+ createdBy: z32.optional(SerializableExact),
3789
+ createdByUserType: ExactUserType,
3790
+ updatedBy: z32.optional(SerializableExact),
3791
+ trackingId: z32.optional(Exact),
3792
+ flags: z32.optional(ContainsFlags),
3793
+ data: QueryInput
3794
+ }).partial();
3795
+ var Or2 = z32.object({
3796
+ type: z32.literal("or"),
3797
+ clauses: z32.array(SerializedQueryExpression)
3798
+ });
3799
+ var And2 = z32.object({
3800
+ type: z32.literal("and"),
3801
+ clauses: z32.array(SerializedQueryExpression)
3802
+ });
3803
+ var CountryConfigQueryType = z32.discriminatedUnion("type", [And2, Or2]);
3804
+ var CountryConfigQueryInputType = z32.union([
3805
+ SerializedQueryExpression,
3806
+ And2,
3807
+ Or2
3624
3808
  ]);
3625
3809
 
3626
3810
  // ../commons/src/events/WorkqueueConfig.ts
@@ -3642,23 +3826,21 @@ var mandatoryColumns = defineWorkqueuesColumns([
3642
3826
  value: event.field("updatedAt")
3643
3827
  }
3644
3828
  ]);
3645
- var WorkqueueActionsWithDefault = import_zod31.z.enum([
3829
+ var WorkqueueActionsWithDefault = z33.enum([
3646
3830
  ...workqueueActions.options,
3647
- "DEFAULT"
3831
+ "DEFAULT",
3832
+ ActionType.READ
3648
3833
  ]);
3649
- var WorkqueueConfig = import_zod31.z.object({
3650
- slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
3834
+ var WorkqueueConfig = z33.object({
3835
+ slug: z33.string().describe("Determines the url of the workqueue."),
3651
3836
  name: TranslationConfig.describe(
3652
3837
  "Title of the workflow (both in navigation and on the page)"
3653
3838
  ),
3654
3839
  query: CountryConfigQueryType,
3655
- actions: import_zod31.z.array(
3656
- import_zod31.z.object({
3657
- type: WorkqueueActionsWithDefault,
3658
- conditionals: import_zod31.z.array(Conditional).optional()
3659
- })
3660
- ),
3661
- columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
3840
+ /** This action object used to contain a conditionals option, but it was not used anywhere.
3841
+ * It's also debatable whether it should be an array, or just a single action. */
3842
+ actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
3843
+ columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
3662
3844
  icon: AvailableIcons,
3663
3845
  emptyMessage: TranslationConfig.optional()
3664
3846
  }).describe("Configuration for workqueue.");
@@ -3666,26 +3848,21 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
3666
3848
  query: true,
3667
3849
  columns: true
3668
3850
  });
3669
- var WorkqueueConfigInput = import_zod31.z.object({
3670
- slug: import_zod31.z.string().describe("Determines the url of the workqueue."),
3851
+ var WorkqueueConfigInput = z33.object({
3852
+ slug: z33.string().describe("Determines the url of the workqueue."),
3671
3853
  name: TranslationConfig.describe(
3672
3854
  "Title of the workflow (both in navigation and on the page)"
3673
3855
  ),
3674
3856
  query: CountryConfigQueryInputType,
3675
- actions: import_zod31.z.array(
3676
- import_zod31.z.object({
3677
- type: WorkqueueActionsWithDefault,
3678
- conditionals: import_zod31.z.array(Conditional).optional()
3679
- })
3680
- ),
3681
- columns: import_zod31.z.array(WorkqueueColumn).default(mandatoryColumns),
3857
+ actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
3858
+ columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
3682
3859
  icon: AvailableIcons,
3683
3860
  emptyMessage: TranslationConfig.optional()
3684
3861
  });
3685
- var WorkqueueCountInput = import_zod31.z.array(
3686
- import_zod31.z.object({ slug: import_zod31.z.string(), query: QueryType })
3862
+ var WorkqueueCountInput = z33.array(
3863
+ z33.object({ slug: z33.string(), query: QueryType })
3687
3864
  );
3688
- var WorkqueueCountOutput = import_zod31.z.record(import_zod31.z.string(), import_zod31.z.number());
3865
+ var WorkqueueCountOutput = z33.record(z33.string(), z33.number());
3689
3866
 
3690
3867
  // ../commons/src/events/workqueueDefaultColumns.ts
3691
3868
  var defaultWorkqueueColumns = [
@@ -3708,47 +3885,40 @@ var defaultWorkqueueColumns = [
3708
3885
  ];
3709
3886
 
3710
3887
  // ../commons/src/events/Draft.ts
3711
- var import_zod33 = require("zod");
3888
+ var z35 = __toESM(require("zod/v4"));
3712
3889
 
3713
3890
  // ../commons/src/events/ActionInput.ts
3714
- var import_zod32 = require("zod");
3715
- var import_zod_openapi11 = require("zod-openapi");
3716
- (0, import_zod_openapi11.extendZodWithOpenApi)(import_zod32.z);
3717
- var BaseActionInput = import_zod32.z.object({
3891
+ var z34 = __toESM(require("zod/v4"));
3892
+ var BaseActionInput = z34.object({
3718
3893
  eventId: UUID,
3719
- transactionId: import_zod32.z.string(),
3894
+ transactionId: z34.string(),
3720
3895
  declaration: ActionUpdate.default({}),
3721
3896
  annotation: ActionUpdate.optional(),
3722
3897
  originalActionId: UUID.optional(),
3723
3898
  // should not be part of base action.
3724
- keepAssignment: import_zod32.z.boolean().optional(),
3899
+ keepAssignment: z34.boolean().optional(),
3725
3900
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
3726
3901
  createdAtLocation: CreatedAtLocation.describe(
3727
3902
  "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."
3728
3903
  )
3729
3904
  });
3730
- var CreateActionInput = BaseActionInput.merge(
3731
- import_zod32.z.object({
3732
- type: import_zod32.z.literal(ActionType.CREATE).default(ActionType.CREATE),
3905
+ var CreateActionInput = BaseActionInput.extend(
3906
+ z34.object({
3907
+ type: z34.literal(ActionType.CREATE).default(ActionType.CREATE),
3733
3908
  createdAtLocation: CreatedAtLocation
3734
- })
3909
+ }).shape
3735
3910
  );
3736
- var RegisterActionInput = BaseActionInput.merge(
3737
- import_zod32.z.object({
3738
- type: import_zod32.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
3739
- registrationNumber: import_zod32.z.string().optional()
3740
- })
3741
- ).strict();
3742
- var ValidateActionInput = BaseActionInput.merge(
3743
- import_zod32.z.object({
3744
- type: import_zod32.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE)
3745
- })
3911
+ var RegisterActionInput = BaseActionInput.extend(
3912
+ z34.strictObject({
3913
+ type: z34.literal(ActionType.REGISTER).default(ActionType.REGISTER),
3914
+ registrationNumber: z34.string().optional()
3915
+ }).shape
3746
3916
  );
3747
- var NotifyActionInput = BaseActionInput.merge(
3748
- import_zod32.z.object({
3749
- type: import_zod32.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
3750
- })
3751
- ).openapi({
3917
+ var NotifyActionInput = BaseActionInput.extend(
3918
+ z34.object({
3919
+ type: z34.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
3920
+ }).shape
3921
+ ).meta({
3752
3922
  default: {
3753
3923
  eventId: "<event-id-here>",
3754
3924
  transactionId: getUUID(),
@@ -3757,135 +3927,150 @@ var NotifyActionInput = BaseActionInput.merge(
3757
3927
  type: ActionType.NOTIFY
3758
3928
  }
3759
3929
  });
3760
- var DeclareActionInput = BaseActionInput.merge(
3761
- import_zod32.z.object({
3762
- type: import_zod32.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
3763
- })
3930
+ var DeclareActionInput = BaseActionInput.extend(
3931
+ z34.object({
3932
+ type: z34.literal(ActionType.DECLARE).default(ActionType.DECLARE)
3933
+ }).shape
3764
3934
  );
3765
- var PrintCertificateActionInput = BaseActionInput.merge(
3766
- import_zod32.z.object({
3767
- type: import_zod32.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
3935
+ var EditActionInput = BaseActionInput.extend(
3936
+ z34.object({
3937
+ type: z34.literal(ActionType.EDIT).default(ActionType.EDIT),
3938
+ content: z34.object({
3939
+ comment: z34.string().describe("Comment for the edit action.").optional()
3940
+ })
3941
+ }).shape
3942
+ );
3943
+ var PrintCertificateActionInput = BaseActionInput.extend(
3944
+ z34.object({
3945
+ type: z34.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
3768
3946
  content: PrintContent.optional()
3769
- })
3947
+ }).shape
3770
3948
  );
3771
- var RejectDeclarationActionInput = BaseActionInput.merge(
3772
- import_zod32.z.object({
3773
- type: import_zod32.z.literal(ActionType.REJECT).default(ActionType.REJECT),
3949
+ var RejectDeclarationActionInput = BaseActionInput.extend(
3950
+ z34.object({
3951
+ type: z34.literal(ActionType.REJECT).default(ActionType.REJECT),
3774
3952
  content: ReasonContent
3775
- })
3953
+ }).shape
3776
3954
  );
3777
- var DuplicateDetectedActionInput = BaseActionInput.merge(
3778
- import_zod32.z.object({
3779
- type: import_zod32.z.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
3780
- content: import_zod32.z.object({
3781
- duplicates: import_zod32.z.array(PotentialDuplicate)
3955
+ var DuplicateDetectedActionInput = BaseActionInput.extend(
3956
+ z34.object({
3957
+ type: z34.literal(ActionType.DUPLICATE_DETECTED).default(ActionType.DUPLICATE_DETECTED),
3958
+ content: z34.object({
3959
+ duplicates: z34.array(PotentialDuplicate)
3782
3960
  })
3783
- })
3961
+ }).shape
3784
3962
  );
3785
- var MarkAsDuplicateActionInput = BaseActionInput.merge(
3786
- import_zod32.z.object({
3787
- type: import_zod32.z.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
3788
- content: import_zod32.z.object({
3963
+ var MarkAsDuplicateActionInput = BaseActionInput.extend(
3964
+ z34.object({
3965
+ type: z34.literal(ActionType.MARK_AS_DUPLICATE).default(ActionType.MARK_AS_DUPLICATE),
3966
+ content: z34.object({
3789
3967
  duplicateOf: UUID
3790
3968
  }).optional()
3791
- })
3969
+ }).shape
3792
3970
  );
3793
- var MarkNotDuplicateActionInput = BaseActionInput.merge(
3794
- import_zod32.z.object({
3795
- type: import_zod32.z.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
3796
- })
3971
+ var MarkNotDuplicateActionInput = BaseActionInput.extend(
3972
+ z34.object({
3973
+ type: z34.literal(ActionType.MARK_AS_NOT_DUPLICATE).default(ActionType.MARK_AS_NOT_DUPLICATE)
3974
+ }).shape
3797
3975
  );
3798
- var ArchiveActionInput = BaseActionInput.merge(
3799
- import_zod32.z.object({
3800
- type: import_zod32.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
3976
+ var ArchiveActionInput = BaseActionInput.extend(
3977
+ z34.object({
3978
+ type: z34.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
3801
3979
  content: ReasonContent
3802
- })
3980
+ }).shape
3803
3981
  );
3804
- var AssignActionInput = BaseActionInput.merge(
3805
- import_zod32.z.object({
3806
- type: import_zod32.z.literal(ActionType.ASSIGN),
3807
- assignedTo: import_zod32.z.string()
3808
- })
3982
+ var AssignActionInput = BaseActionInput.extend(
3983
+ z34.object({
3984
+ type: z34.literal(ActionType.ASSIGN),
3985
+ assignedTo: z34.string()
3986
+ }).shape
3809
3987
  );
3810
- var UnassignActionInput = BaseActionInput.merge(
3811
- import_zod32.z.object({
3812
- type: import_zod32.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
3813
- assignedTo: import_zod32.z.literal(null).default(null)
3814
- })
3988
+ var UnassignActionInput = BaseActionInput.extend(
3989
+ z34.object({
3990
+ type: z34.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
3991
+ assignedTo: z34.literal(null).default(null)
3992
+ }).shape
3815
3993
  );
3816
- var RequestCorrectionActionInput = BaseActionInput.merge(
3817
- import_zod32.z.object({
3818
- type: import_zod32.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
3819
- })
3994
+ var RequestCorrectionActionInput = BaseActionInput.extend(
3995
+ z34.object({
3996
+ type: z34.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
3997
+ }).shape
3820
3998
  );
3821
- var RejectCorrectionActionInput = BaseActionInput.merge(
3822
- import_zod32.z.object({
3823
- requestId: import_zod32.z.string(),
3824
- type: import_zod32.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
3999
+ var RejectCorrectionActionInput = BaseActionInput.extend(
4000
+ z34.object({
4001
+ requestId: z34.string(),
4002
+ type: z34.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
3825
4003
  content: ReasonContent
3826
- })
4004
+ }).shape
3827
4005
  );
3828
- var ApproveCorrectionActionInput = BaseActionInput.merge(
3829
- import_zod32.z.object({
3830
- requestId: import_zod32.z.string(),
3831
- type: import_zod32.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
3832
- })
4006
+ var ApproveCorrectionActionInput = BaseActionInput.extend(
4007
+ z34.object({
4008
+ requestId: z34.string(),
4009
+ type: z34.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
4010
+ }).shape
3833
4011
  );
3834
- var ReadActionInput = BaseActionInput.merge(
3835
- import_zod32.z.object({
3836
- type: import_zod32.z.literal(ActionType.READ).default(ActionType.READ)
3837
- })
4012
+ var ReadActionInput = BaseActionInput.extend(
4013
+ z34.object({
4014
+ type: z34.literal(ActionType.READ).default(ActionType.READ)
4015
+ }).shape
3838
4016
  );
3839
- var DeleteActionInput = import_zod32.z.object({ eventId: UUID });
3840
- var ActionInput = import_zod32.z.discriminatedUnion("type", [
3841
- CreateActionInput.openapi({ ref: "CreateActionInput" }),
3842
- ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
3843
- RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
3844
- NotifyActionInput.openapi({ ref: "NotifyActionInput" }),
3845
- DeclareActionInput.openapi({ ref: "DeclareActionInput" }),
3846
- RejectDeclarationActionInput.openapi({
3847
- ref: "RejectDeclarationActionInput"
4017
+ var DeleteActionInput = z34.object({ eventId: UUID });
4018
+ var CustomActionInput = BaseActionInput.extend(
4019
+ z34.object({
4020
+ type: z34.literal(ActionType.CUSTOM).default(ActionType.CUSTOM),
4021
+ customActionType: z34.string().describe("Name of the custom action.")
4022
+ }).shape
4023
+ );
4024
+ var ActionInput = z34.discriminatedUnion("type", [
4025
+ CreateActionInput.meta({ id: "CreateActionInput" }),
4026
+ RegisterActionInput.meta({ id: "RegisterActionInput" }),
4027
+ NotifyActionInput.meta({ id: "NotifyActionInput" }),
4028
+ DeclareActionInput.meta({ id: "DeclareActionInput" }),
4029
+ RejectDeclarationActionInput.meta({
4030
+ id: "RejectDeclarationActionInput"
3848
4031
  }),
3849
- DuplicateDetectedActionInput.openapi({
3850
- ref: "DuplicateDetectedActionInput"
4032
+ DuplicateDetectedActionInput.meta({
4033
+ id: "DuplicateDetectedActionInput"
3851
4034
  }),
3852
- MarkAsDuplicateActionInput.openapi({
3853
- ref: "MarkAsDuplicateActionInput"
4035
+ MarkAsDuplicateActionInput.meta({
4036
+ id: "MarkAsDuplicateActionInput"
3854
4037
  }),
3855
- MarkNotDuplicateActionInput.openapi({
3856
- ref: "MarkNotDuplicateActionInput"
4038
+ MarkNotDuplicateActionInput.meta({
4039
+ id: "MarkNotDuplicateActionInput"
3857
4040
  }),
3858
- ArchiveActionInput.openapi({ ref: "ArchiveActionInput" }),
3859
- AssignActionInput.openapi({ ref: "AssignActionInput" }),
3860
- UnassignActionInput.openapi({ ref: "UnassignActionInput" }),
3861
- PrintCertificateActionInput.openapi({ ref: "PrintCertificateActionInput" }),
3862
- RequestCorrectionActionInput.openapi({
3863
- ref: "RequestCorrectionActionInput"
4041
+ ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
4042
+ AssignActionInput.meta({ id: "AssignActionInput" }),
4043
+ UnassignActionInput.meta({ id: "UnassignActionInput" }),
4044
+ PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
4045
+ RequestCorrectionActionInput.meta({
4046
+ id: "RequestCorrectionActionInput"
3864
4047
  }),
3865
- RejectCorrectionActionInput.openapi({ ref: "RejectCorrectionActionInput" }),
3866
- ApproveCorrectionActionInput.openapi({
3867
- ref: "ApproveCorrectionActionInput"
4048
+ RejectCorrectionActionInput.meta({ id: "RejectCorrectionActionInput" }),
4049
+ ApproveCorrectionActionInput.meta({
4050
+ id: "ApproveCorrectionActionInput"
3868
4051
  }),
3869
- ReadActionInput.openapi({ ref: "ReadActionInput" })
3870
- ]).openapi({
3871
- ref: "ActionInput"
4052
+ ReadActionInput.meta({ id: "ReadActionInput" }),
4053
+ CustomActionInput.meta({ id: "CustomActionInput" }),
4054
+ EditActionInput.meta({ id: "EditActionInput" })
4055
+ ]).meta({
4056
+ id: "ActionInput"
3872
4057
  });
3873
4058
 
3874
4059
  // ../commons/src/events/Draft.ts
3875
- var Draft = import_zod33.z.object({
4060
+ var Draft = z35.object({
3876
4061
  id: UUID,
3877
4062
  eventId: UUID,
3878
- transactionId: import_zod33.z.string(),
3879
- createdAt: import_zod33.z.string().datetime(),
4063
+ transactionId: z35.string(),
4064
+ createdAt: z35.string().datetime(),
3880
4065
  action: ActionBase.extend({
3881
- type: ActionTypes.exclude([ActionTypes.Enum.DELETE])
4066
+ type: ActionTypes.exclude([ActionTypes.enum.DELETE])
3882
4067
  }).omit({ id: true, createdAtLocation: true })
3883
4068
  }).describe(
3884
4069
  "A temporary storage for an action. Stored with details of the event, creator and creation time."
3885
4070
  );
3886
4071
  var DraftInput = BaseActionInput.extend({
3887
- type: ActionTypes.exclude([ActionTypes.Enum.DELETE]),
3888
- status: import_zod33.z.enum([
4072
+ type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
4073
+ status: z35.enum([
3889
4074
  ActionStatus.Requested,
3890
4075
  ActionStatus.Accepted,
3891
4076
  ActionStatus.Rejected
@@ -3893,32 +4078,30 @@ var DraftInput = BaseActionInput.extend({
3893
4078
  });
3894
4079
 
3895
4080
  // ../commons/src/events/EventInput.ts
3896
- var import_zod34 = require("zod");
4081
+ var z36 = __toESM(require("zod/v4"));
3897
4082
  var import_uuid10 = require("uuid");
3898
- var EventInput = import_zod34.z.object({
3899
- transactionId: import_zod34.z.string(),
3900
- type: import_zod34.z.string()
3901
- }).openapi({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
4083
+ var EventInput = z36.object({
4084
+ transactionId: z36.string(),
4085
+ type: z36.string()
4086
+ }).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
3902
4087
 
3903
4088
  // ../commons/src/events/EventDocument.ts
3904
- var import_zod35 = require("zod");
3905
- var import_zod_openapi12 = require("zod-openapi");
3906
- (0, import_zod_openapi12.extendZodWithOpenApi)(import_zod35.z);
3907
- var EventDocument = import_zod35.z.object({
4089
+ var z37 = __toESM(require("zod/v4"));
4090
+ var EventDocument = z37.object({
3908
4091
  id: UUID.describe("Unique identifier of the event."),
3909
- type: import_zod35.z.string().describe("Type of the event (e.g. birth, death, marriage)."),
3910
- createdAt: import_zod35.z.string().datetime().describe("Timestamp indicating when the event was created."),
3911
- updatedAt: import_zod35.z.string().datetime().describe(
4092
+ type: z37.string().describe("Type of the event (e.g. birth, death, marriage)."),
4093
+ createdAt: z37.string().datetime().describe("Timestamp indicating when the event was created."),
4094
+ updatedAt: z37.string().datetime().describe(
3912
4095
  "Timestamp of the last update, excluding changes from actions."
3913
4096
  ),
3914
- actions: import_zod35.z.array(Action).describe("Ordered list of actions associated with the event."),
3915
- trackingId: import_zod35.z.string().describe(
4097
+ actions: z37.array(Action).describe("Ordered list of actions associated with the event."),
4098
+ trackingId: z37.string().describe(
3916
4099
  "System-generated tracking identifier used to look up the event."
3917
4100
  )
3918
- }).openapi({ ref: "EventDocument" });
4101
+ }).meta({ id: "EventDocument" });
3919
4102
 
3920
4103
  // ../commons/src/events/state/index.ts
3921
- var import_lodash3 = require("lodash");
4104
+ var import_lodash4 = require("lodash");
3922
4105
 
3923
4106
  // ../commons/src/events/state/utils.ts
3924
4107
  var import_lodash2 = require("lodash");
@@ -3926,14 +4109,18 @@ var updateActions = ActionTypes.extract([
3926
4109
  ActionType.CREATE,
3927
4110
  ActionType.NOTIFY,
3928
4111
  ActionType.DECLARE,
3929
- ActionType.VALIDATE,
3930
4112
  ActionType.REGISTER,
3931
4113
  ActionType.REJECT,
3932
4114
  ActionType.ARCHIVE,
3933
4115
  ActionType.PRINT_CERTIFICATE,
3934
- ActionType.REQUEST_CORRECTION
4116
+ ActionType.REQUEST_CORRECTION,
4117
+ ActionType.CUSTOM
3935
4118
  ]);
3936
4119
 
4120
+ // ../commons/src/events/state/flags.ts
4121
+ var import_lodash3 = require("lodash");
4122
+ var import_date_fns3 = require("date-fns");
4123
+
3937
4124
  // ../commons/src/events/defineConfig.ts
3938
4125
  var defineConfig = (config) => {
3939
4126
  const input = EventConfig.parse(config);
@@ -3941,7 +4128,7 @@ var defineConfig = (config) => {
3941
4128
  };
3942
4129
 
3943
4130
  // ../commons/src/events/test.utils.ts
3944
- var import_lodash4 = require("lodash");
4131
+ var import_lodash5 = require("lodash");
3945
4132
  var import_date_fns4 = require("date-fns");
3946
4133
 
3947
4134
  // ../commons/src/field-config/field-configuration.ts
@@ -3963,7 +4150,6 @@ function field(fieldId, options = {}) {
3963
4150
  }
3964
4151
 
3965
4152
  // ../commons/src/fixtures/forms.ts
3966
- var import_date_fns3 = require("date-fns");
3967
4153
  var PRINT_CERTIFICATE_FORM = defineActionForm({
3968
4154
  label: {
3969
4155
  id: "event.tennis-club-membership.action.certificate.form.label",
@@ -4763,7 +4949,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
4763
4949
  conditionals: [
4764
4950
  {
4765
4951
  type: ConditionalType.DISPLAY_ON_REVIEW,
4766
- conditional: never()
4952
+ conditional: never2()
4767
4953
  }
4768
4954
  ]
4769
4955
  },
@@ -5146,119 +5332,16 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
5146
5332
  }
5147
5333
  }
5148
5334
  ],
5149
- conditional: not(never())
5335
+ conditional: not(never2())
5150
5336
  // Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
5151
5337
  }
5152
5338
  ]
5153
5339
  });
5154
- var statusOptions = [
5155
- {
5156
- value: "ALL",
5157
- label: {
5158
- defaultMessage: "Any status",
5159
- description: "Option for form field: status of record",
5160
- id: "advancedSearch.form.recordStatusAny"
5161
- }
5162
- },
5163
- {
5164
- value: EventStatus.enum.CREATED,
5165
- label: {
5166
- defaultMessage: "Draft",
5167
- description: "Option for form field: status of record",
5168
- id: "advancedSearch.form.recordStatusCreated"
5169
- }
5170
- },
5171
- {
5172
- value: EventStatus.enum.NOTIFIED,
5173
- label: {
5174
- defaultMessage: "Notified",
5175
- description: "Option for form field: status of record",
5176
- id: "advancedSearch.form.recordStatusNotified"
5177
- }
5178
- },
5179
- {
5180
- value: EventStatus.enum.DECLARED,
5181
- label: {
5182
- defaultMessage: "Declared",
5183
- description: "Option for form field: status of record",
5184
- id: "advancedSearch.form.recordStatusDeclared"
5185
- }
5186
- },
5187
- {
5188
- value: EventStatus.enum.VALIDATED,
5189
- label: {
5190
- defaultMessage: "Validated",
5191
- description: "Option for form field: status of record",
5192
- id: "advancedSearch.form.recordStatusValidated"
5193
- }
5194
- },
5195
- {
5196
- value: EventStatus.enum.REGISTERED,
5197
- label: {
5198
- defaultMessage: "Registered",
5199
- description: "Option for form field: status of record",
5200
- id: "advancedSearch.form.recordStatusRegistered"
5201
- }
5202
- },
5203
- {
5204
- value: EventStatus.enum.ARCHIVED,
5205
- label: {
5206
- defaultMessage: "Archived",
5207
- description: "Option for form field: status of record",
5208
- id: "advancedSearch.form.recordStatusArchived"
5209
- }
5210
- }
5211
- ];
5212
- var timePeriodOptions = [
5213
- {
5214
- label: {
5215
- defaultMessage: "Last 7 days",
5216
- description: "Label for option of time period select: last 7 days",
5217
- id: "form.section.label.timePeriodLast7Days"
5218
- },
5219
- value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
5220
- /* @__PURE__ */ new Date(),
5221
- "yyyy-MM-dd"
5222
- )}`
5223
- },
5224
- {
5225
- label: {
5226
- defaultMessage: "Last 30 days",
5227
- description: "Label for option of time period select: last 30 days",
5228
- id: "form.section.label.timePeriodLast30Days"
5229
- },
5230
- value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
5231
- /* @__PURE__ */ new Date(),
5232
- "yyyy-MM-dd"
5233
- )}`
5234
- },
5235
- {
5236
- label: {
5237
- defaultMessage: "Last 90 days",
5238
- description: "Label for option of time period select: last 90 days",
5239
- id: "form.section.label.timePeriodLast90Days"
5240
- },
5241
- value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
5242
- /* @__PURE__ */ new Date(),
5243
- "yyyy-MM-dd"
5244
- )}`
5245
- },
5246
- {
5247
- label: {
5248
- defaultMessage: "Last year",
5249
- description: "Label for option of time period select: last year",
5250
- id: "form.section.label.timePeriodLastYear"
5251
- },
5252
- value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
5253
- /* @__PURE__ */ new Date(),
5254
- "yyyy-MM-dd"
5255
- )}`
5256
- }
5257
- ];
5258
5340
 
5259
5341
  // ../commons/src/fixtures/tennis-club-membership-event.ts
5260
5342
  var tennisClubMembershipEvent = defineConfig({
5261
5343
  id: TENNIS_CLUB_MEMBERSHIP,
5344
+ declaration: TENNIS_CLUB_DECLARATION_FORM,
5262
5345
  label: {
5263
5346
  defaultMessage: "Tennis club membership application",
5264
5347
  description: "This is what this event is referred as in the system",
@@ -5309,13 +5392,12 @@ var tennisClubMembershipEvent = defineConfig({
5309
5392
  review: TENNIS_CLUB_DECLARATION_REVIEW
5310
5393
  },
5311
5394
  {
5312
- type: ActionType.VALIDATE,
5395
+ type: ActionType.REJECT,
5313
5396
  label: {
5314
- defaultMessage: "Validate",
5397
+ defaultMessage: "Reject",
5315
5398
  description: "This is shown as the action name anywhere the user can trigger the action from",
5316
- id: "event.tennis-club-membership.action.validate.label"
5317
- },
5318
- review: TENNIS_CLUB_DECLARATION_REVIEW
5399
+ id: "event.tennis-club-membership.action.reject.label"
5400
+ }
5319
5401
  },
5320
5402
  {
5321
5403
  type: ActionType.REGISTER,
@@ -5323,8 +5405,7 @@ var tennisClubMembershipEvent = defineConfig({
5323
5405
  defaultMessage: "Register",
5324
5406
  description: "This is shown as the action name anywhere the user can trigger the action from",
5325
5407
  id: "event.tennis-club-membership.action.register.label"
5326
- },
5327
- review: TENNIS_CLUB_DECLARATION_REVIEW
5408
+ }
5328
5409
  },
5329
5410
  {
5330
5411
  type: ActionType.REQUEST_CORRECTION,
@@ -5527,14 +5608,6 @@ var tennisClubMembershipEvent = defineConfig({
5527
5608
  ]
5528
5609
  }
5529
5610
  },
5530
- {
5531
- type: ActionType.APPROVE_CORRECTION,
5532
- label: {
5533
- defaultMessage: "Approve correction",
5534
- description: "This is shown as the action name anywhere the user can trigger the action from",
5535
- id: "event.tennis-club-membership.action.correction.approve.label"
5536
- }
5537
- },
5538
5611
  {
5539
5612
  type: ActionType.PRINT_CERTIFICATE,
5540
5613
  label: {
@@ -5543,22 +5616,6 @@ var tennisClubMembershipEvent = defineConfig({
5543
5616
  description: "This is shown as the action name anywhere the user can trigger the action from"
5544
5617
  },
5545
5618
  printForm: PRINT_CERTIFICATE_FORM
5546
- },
5547
- {
5548
- type: ActionType.ARCHIVE,
5549
- label: {
5550
- id: "event.tennis-club-membership.action.archive.label",
5551
- defaultMessage: "Archive",
5552
- description: "This is shown as the action name anywhere the user can trigger the action from"
5553
- }
5554
- },
5555
- {
5556
- type: ActionType.REJECT,
5557
- label: {
5558
- id: "event.tennis-club-membership.action.reject.label",
5559
- defaultMessage: "Reject",
5560
- description: "This is shown as the action name anywhere the user can trigger the action from"
5561
- }
5562
5619
  }
5563
5620
  ],
5564
5621
  advancedSearch: [
@@ -5595,8 +5652,7 @@ var tennisClubMembershipEvent = defineConfig({
5595
5652
  },
5596
5653
  fields: [field("recommender.name").fuzzy()]
5597
5654
  }
5598
- ],
5599
- declaration: TENNIS_CLUB_DECLARATION_FORM
5655
+ ]
5600
5656
  });
5601
5657
 
5602
5658
  // ../commons/src/fixtures/football-club-membership-event.ts
@@ -5664,23 +5720,13 @@ var footballClubMembershipEvent = defineConfig({
5664
5720
  },
5665
5721
  review: TENNIS_CLUB_DECLARATION_REVIEW
5666
5722
  },
5667
- {
5668
- type: ActionType.VALIDATE,
5669
- label: {
5670
- defaultMessage: "Validate",
5671
- description: "This is shown as the action name anywhere the user can trigger the action from",
5672
- id: "event.football-club-membership.action.validate.label"
5673
- },
5674
- review: TENNIS_CLUB_DECLARATION_REVIEW
5675
- },
5676
5723
  {
5677
5724
  type: ActionType.REGISTER,
5678
5725
  label: {
5679
5726
  defaultMessage: "Register",
5680
5727
  description: "This is shown as the action name anywhere the user can trigger the action from",
5681
5728
  id: "event.football-club-membership.action.register.label"
5682
- },
5683
- review: TENNIS_CLUB_DECLARATION_REVIEW
5729
+ }
5684
5730
  },
5685
5731
  {
5686
5732
  type: ActionType.REQUEST_CORRECTION,
@@ -5886,14 +5932,6 @@ var footballClubMembershipEvent = defineConfig({
5886
5932
  ]
5887
5933
  }
5888
5934
  },
5889
- {
5890
- type: ActionType.APPROVE_CORRECTION,
5891
- label: {
5892
- defaultMessage: "Approve correction",
5893
- description: "This is shown as the action name anywhere the user can trigger the action from",
5894
- id: "event.football-club-membership.action.correction.approve.label"
5895
- }
5896
- },
5897
5935
  {
5898
5936
  type: ActionType.PRINT_CERTIFICATE,
5899
5937
  label: {
@@ -5902,22 +5940,6 @@ var footballClubMembershipEvent = defineConfig({
5902
5940
  description: "This is shown as the action name anywhere the user can trigger the action from"
5903
5941
  },
5904
5942
  printForm: PRINT_CERTIFICATE_FORM
5905
- },
5906
- {
5907
- type: ActionType.ARCHIVE,
5908
- label: {
5909
- id: "event.football-club-membership.action.archive.label",
5910
- defaultMessage: "Archive",
5911
- description: "This is shown as the action name anywhere the user can trigger the action from"
5912
- }
5913
- },
5914
- {
5915
- type: ActionType.REJECT,
5916
- label: {
5917
- id: "event.football-club-membership.action.reject.label",
5918
- defaultMessage: "Reject",
5919
- description: "This is shown as the action name anywhere the user can trigger the action from"
5920
- }
5921
5943
  }
5922
5944
  ],
5923
5945
  advancedSearch: [
@@ -6017,7 +6039,7 @@ var libraryMembershipEvent = defineConfig({
6017
6039
  declaration: libraryMembershipForm
6018
6040
  });
6019
6041
 
6020
- // ../commons/src/fixtures/v2-birth-event.ts
6042
+ // ../commons/src/fixtures/child-onboarding-event.ts
6021
6043
  function generateTranslationConfig(message) {
6022
6044
  return {
6023
6045
  defaultMessage: message,
@@ -6046,6 +6068,61 @@ var child = defineFormPage({
6046
6068
  secured: true,
6047
6069
  validation: [],
6048
6070
  label: generateTranslationConfig("Date of birth")
6071
+ },
6072
+ {
6073
+ id: "child.placeOfBirth",
6074
+ analytics: true,
6075
+ type: FieldType.SELECT,
6076
+ required: true,
6077
+ secured: true,
6078
+ label: {
6079
+ defaultMessage: "Place of delivery",
6080
+ description: "This is the label for the field",
6081
+ id: "event.birth.action.declare.form.section.child.field.placeOfBirth.label"
6082
+ },
6083
+ options: [
6084
+ {
6085
+ value: "child.placeOfBirth-SELECT-2",
6086
+ label: generateTranslationConfig("Health Institution")
6087
+ },
6088
+ {
6089
+ value: "PRIVATE_HOME",
6090
+ label: generateTranslationConfig("Residential address")
6091
+ }
6092
+ ]
6093
+ },
6094
+ {
6095
+ id: "child.birthLocation",
6096
+ analytics: true,
6097
+ type: "FACILITY",
6098
+ required: true,
6099
+ secured: true,
6100
+ label: generateTranslationConfig("Health Institution"),
6101
+ conditionals: [
6102
+ {
6103
+ type: "SHOW",
6104
+ conditional: field("child.placeOfBirth").isEqualTo(
6105
+ "child.placeOfBirth-SELECT-2"
6106
+ )
6107
+ }
6108
+ ]
6109
+ },
6110
+ {
6111
+ id: "child.birthLocation.privateHome",
6112
+ analytics: true,
6113
+ type: FieldType.ADDRESS,
6114
+ secured: true,
6115
+ hideLabel: true,
6116
+ label: generateTranslationConfig("Child's address"),
6117
+ conditionals: [
6118
+ {
6119
+ type: "SHOW",
6120
+ conditional: field("child.placeOfBirth").isEqualTo("PRIVATE_HOME")
6121
+ }
6122
+ ],
6123
+ configuration: {
6124
+ streetAddressForm: []
6125
+ }
6049
6126
  }
6050
6127
  ]
6051
6128
  });
@@ -6122,7 +6199,7 @@ var mother = defineFormPage({
6122
6199
  }
6123
6200
  ]
6124
6201
  });
6125
- var BIRTH_DECLARATION_REVIEW = {
6202
+ var CHILD_ONBOARDING_DECLARATION_REVIEW = {
6126
6203
  title: generateTranslationConfig(
6127
6204
  "{child.name.firstname, select, __EMPTY__ {Birth declaration} other {{child.name.surname, select, __EMPTY__ {Birth declaration for {child.name.firstname}} other {Birth declaration for {child.name.firstname} {child.name.surname}}}}}"
6128
6205
  ),
@@ -6142,12 +6219,12 @@ var BIRTH_DECLARATION_REVIEW = {
6142
6219
  }
6143
6220
  ]
6144
6221
  };
6145
- var BIRTH_DECLARATION_FORM = defineDeclarationForm({
6222
+ var CHILD_ONBOARDING_DECLARATION_FORM = defineDeclarationForm({
6146
6223
  label: generateTranslationConfig("Birth decalration form"),
6147
6224
  pages: [child, mother]
6148
6225
  });
6149
- var v2BirthEvent = defineConfig({
6150
- id: BIRTH_EVENT,
6226
+ var ChildOnboardingEvent = defineConfig({
6227
+ id: CHILD_ONBOARDING_EVENT,
6151
6228
  title: generateTranslationConfig(
6152
6229
  "{child.name.firstname} {child.name.surname}"
6153
6230
  ),
@@ -6155,27 +6232,21 @@ var v2BirthEvent = defineConfig({
6155
6232
  summary: {
6156
6233
  fields: []
6157
6234
  },
6158
- declaration: BIRTH_DECLARATION_FORM,
6235
+ declaration: CHILD_ONBOARDING_DECLARATION_FORM,
6159
6236
  actions: [
6160
6237
  {
6161
6238
  type: ActionType.READ,
6162
6239
  label: generateTranslationConfig("Read"),
6163
- review: BIRTH_DECLARATION_REVIEW
6240
+ review: CHILD_ONBOARDING_DECLARATION_REVIEW
6164
6241
  },
6165
6242
  {
6166
6243
  type: ActionType.DECLARE,
6167
6244
  label: generateTranslationConfig("Declare"),
6168
- review: BIRTH_DECLARATION_REVIEW
6169
- },
6170
- {
6171
- type: ActionType.VALIDATE,
6172
- label: generateTranslationConfig("Validate"),
6173
- review: BIRTH_DECLARATION_REVIEW
6245
+ review: CHILD_ONBOARDING_DECLARATION_REVIEW
6174
6246
  },
6175
6247
  {
6176
6248
  type: ActionType.REGISTER,
6177
- label: generateTranslationConfig("Register"),
6178
- review: BIRTH_DECLARATION_REVIEW
6249
+ label: generateTranslationConfig("Register")
6179
6250
  }
6180
6251
  ],
6181
6252
  advancedSearch: []
@@ -6263,7 +6334,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
6263
6334
  conditionals: [
6264
6335
  {
6265
6336
  type: ConditionalType.ENABLE,
6266
- conditional: never()
6337
+ conditional: never2()
6267
6338
  },
6268
6339
  {
6269
6340
  type: ConditionalType.SHOW,
@@ -6290,7 +6361,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
6290
6361
  conditionals: [
6291
6362
  {
6292
6363
  type: ConditionalType.ENABLE,
6293
- conditional: never()
6364
+ conditional: never2()
6294
6365
  },
6295
6366
  {
6296
6367
  type: ConditionalType.SHOW,
@@ -6318,7 +6389,7 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
6318
6389
  conditionals: [
6319
6390
  {
6320
6391
  type: ConditionalType.ENABLE,
6321
- conditional: never()
6392
+ conditional: never2()
6322
6393
  }
6323
6394
  ],
6324
6395
  value: field("identity.http-fetch").get("data.certificateId")
@@ -6396,8 +6467,8 @@ var digitalIdentityEvent = defineConfig({
6396
6467
  });
6397
6468
 
6398
6469
  // ../commons/src/events/test.utils.ts
6399
- var import_zod36 = require("zod");
6400
- var TestUserRole = import_zod36.z.enum([
6470
+ var z38 = __toESM(require("zod/v4"));
6471
+ var TestUserRole = z38.enum([
6401
6472
  "FIELD_AGENT",
6402
6473
  "LOCAL_REGISTRAR",
6403
6474
  "LOCAL_SYSTEM_ADMIN",
@@ -6408,18 +6479,14 @@ var TestUserRole = import_zod36.z.enum([
6408
6479
  ]);
6409
6480
 
6410
6481
  // ../commons/src/events/scopes.ts
6411
- var import_lodash5 = require("lodash");
6482
+ var import_lodash6 = require("lodash");
6412
6483
  var ACTION_SCOPE_MAP = {
6413
6484
  [ActionType.READ]: ["record.read"],
6414
6485
  [ActionType.CREATE]: ["record.create"],
6415
6486
  [ActionType.NOTIFY]: ["record.notify"],
6416
- [ActionType.DECLARE]: [
6417
- "record.declare",
6418
- "record.declared.validate",
6419
- "record.register"
6420
- ],
6487
+ [ActionType.DECLARE]: ["record.declare", "record.register"],
6488
+ [ActionType.EDIT]: ["record.declared.edit"],
6421
6489
  [ActionType.DELETE]: ["record.declare"],
6422
- [ActionType.VALIDATE]: ["record.declared.validate", "record.register"],
6423
6490
  [ActionType.REGISTER]: ["record.register"],
6424
6491
  [ActionType.PRINT_CERTIFICATE]: ["record.registered.print-certified-copies"],
6425
6492
  [ActionType.REQUEST_CORRECTION]: [
@@ -6437,7 +6504,8 @@ var ACTION_SCOPE_MAP = {
6437
6504
  [ActionType.REJECT]: ["record.declared.reject"],
6438
6505
  [ActionType.ASSIGN]: null,
6439
6506
  [ActionType.UNASSIGN]: null,
6440
- [ActionType.DUPLICATE_DETECTED]: []
6507
+ [ActionType.DUPLICATE_DETECTED]: [],
6508
+ [ActionType.CUSTOM]: []
6441
6509
  };
6442
6510
 
6443
6511
  // ../commons/src/events/state/availableActions.ts
@@ -6446,28 +6514,25 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
6446
6514
  ActionType.READ,
6447
6515
  ActionType.DECLARE,
6448
6516
  ActionType.NOTIFY,
6449
- ActionType.DELETE
6517
+ ActionType.DELETE,
6518
+ ActionType.CUSTOM
6450
6519
  ],
6451
6520
  [EventStatus.enum.NOTIFIED]: [
6452
6521
  ActionType.READ,
6453
- ActionType.DECLARE,
6522
+ ActionType.EDIT,
6454
6523
  ActionType.MARK_AS_DUPLICATE,
6455
6524
  ActionType.ARCHIVE,
6456
- ActionType.REJECT
6525
+ ActionType.REJECT,
6526
+ ActionType.CUSTOM
6457
6527
  ],
6458
6528
  [EventStatus.enum.DECLARED]: [
6459
- ActionType.READ,
6460
- ActionType.VALIDATE,
6461
- ActionType.MARK_AS_DUPLICATE,
6462
- ActionType.ARCHIVE,
6463
- ActionType.REJECT
6464
- ],
6465
- [EventStatus.enum.VALIDATED]: [
6466
6529
  ActionType.READ,
6467
6530
  ActionType.REGISTER,
6468
6531
  ActionType.MARK_AS_DUPLICATE,
6469
6532
  ActionType.ARCHIVE,
6470
- ActionType.REJECT
6533
+ ActionType.REJECT,
6534
+ ActionType.CUSTOM,
6535
+ ActionType.EDIT
6471
6536
  ],
6472
6537
  [EventStatus.enum.REGISTERED]: [
6473
6538
  ActionType.READ,
@@ -6475,12 +6540,14 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
6475
6540
  ActionType.REQUEST_CORRECTION,
6476
6541
  ActionType.APPROVE_CORRECTION,
6477
6542
  ActionType.REJECT_CORRECTION,
6543
+ ActionType.CUSTOM,
6478
6544
  ClientSpecificAction.REVIEW_CORRECTION_REQUEST
6479
6545
  ],
6480
6546
  [EventStatus.enum.ARCHIVED]: [
6481
6547
  ActionType.READ,
6482
6548
  ActionType.ASSIGN,
6483
- ActionType.UNASSIGN
6549
+ ActionType.UNASSIGN,
6550
+ ActionType.CUSTOM
6484
6551
  ]
6485
6552
  };
6486
6553
  var ACTION_FILTERS = {
@@ -6490,32 +6557,41 @@ var ACTION_FILTERS = {
6490
6557
  [ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
6491
6558
  [ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
6492
6559
  [ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
6493
- [ActionType.VALIDATE]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
6560
+ [ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
6494
6561
  [ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
6495
6562
  [ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
6496
6563
  [ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
6497
6564
  };
6498
6565
 
6499
6566
  // ../commons/src/events/FileUtils.ts
6500
- var import_lodash6 = require("lodash");
6567
+ var import_lodash7 = require("lodash");
6501
6568
 
6502
6569
  // ../commons/src/events/locations.ts
6503
- var import_zod37 = require("zod");
6504
- var LocationType = import_zod37.z.enum([
6570
+ var z39 = __toESM(require("zod/v4"));
6571
+ var LocationTypeV1 = z39.enum([
6505
6572
  "ADMIN_STRUCTURE",
6506
6573
  "CRVS_OFFICE",
6507
6574
  "HEALTH_FACILITY"
6508
6575
  ]);
6509
- var Location = import_zod37.z.object({
6576
+ var LocationType = z39.enum(["CRVS_OFFICE", "HEALTH_FACILITY"]);
6577
+ var AdministrativeArea = z39.object({
6510
6578
  id: UUID,
6511
- name: import_zod37.z.string(),
6579
+ name: z39.string(),
6580
+ externalId: z39.string().nullish(),
6512
6581
  parentId: UUID.nullable(),
6513
- validUntil: import_zod37.z.string().datetime().nullable(),
6514
- locationType: LocationType.nullable()
6582
+ validUntil: z39.iso.datetime().nullable()
6583
+ });
6584
+ var Location = z39.object({
6585
+ id: UUID,
6586
+ name: z39.string(),
6587
+ externalId: z39.string().nullish(),
6588
+ administrativeAreaId: UUID.nullable(),
6589
+ validUntil: z39.iso.datetime().nullable(),
6590
+ locationType: z39.string().nullable()
6515
6591
  });
6516
6592
 
6517
6593
  // ../commons/src/notification/UserNotifications.ts
6518
- var import_zod38 = require("zod");
6594
+ var z40 = __toESM(require("zod/v4"));
6519
6595
  var TriggerEvent = {
6520
6596
  USER_CREATED: "user-created",
6521
6597
  USER_UPDATED: "user-updated",
@@ -6527,50 +6603,50 @@ var TriggerEvent = {
6527
6603
  CHANGE_PHONE_NUMBER: "change-phone-number",
6528
6604
  CHANGE_EMAIL_ADDRESS: "change-email-address"
6529
6605
  };
6530
- var Recipient = import_zod38.z.object({
6606
+ var Recipient = z40.object({
6531
6607
  name: NameFieldValue.optional(),
6532
- mobile: import_zod38.z.string().optional(),
6533
- email: import_zod38.z.string().optional(),
6534
- bcc: import_zod38.z.array(import_zod38.z.string()).optional()
6608
+ mobile: z40.string().optional(),
6609
+ email: z40.string().optional(),
6610
+ bcc: z40.array(z40.string()).optional()
6535
6611
  });
6536
- var BasePayload = import_zod38.z.object({
6612
+ var BasePayload = z40.object({
6537
6613
  recipient: Recipient
6538
6614
  });
6539
6615
  var TriggerPayload = {
6540
6616
  [TriggerEvent.USER_CREATED]: BasePayload.extend({
6541
- username: import_zod38.z.string(),
6542
- temporaryPassword: import_zod38.z.string()
6617
+ username: z40.string(),
6618
+ temporaryPassword: z40.string()
6543
6619
  }),
6544
6620
  [TriggerEvent.USER_UPDATED]: BasePayload.extend({
6545
- oldUsername: import_zod38.z.string(),
6546
- newUsername: import_zod38.z.string()
6621
+ oldUsername: z40.string(),
6622
+ newUsername: z40.string()
6547
6623
  }),
6548
6624
  [TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
6549
- username: import_zod38.z.string()
6625
+ username: z40.string()
6550
6626
  }),
6551
6627
  [TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
6552
- code: import_zod38.z.string()
6628
+ code: z40.string()
6553
6629
  }),
6554
6630
  [TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
6555
- temporaryPassword: import_zod38.z.string(),
6556
- admin: import_zod38.z.object({
6557
- id: import_zod38.z.string(),
6631
+ temporaryPassword: z40.string(),
6632
+ admin: z40.object({
6633
+ id: z40.string(),
6558
6634
  name: NameFieldValue,
6559
- role: import_zod38.z.string()
6635
+ role: z40.string()
6560
6636
  })
6561
6637
  }),
6562
6638
  [TriggerEvent.TWO_FA]: BasePayload.extend({
6563
- code: import_zod38.z.string()
6639
+ code: z40.string()
6564
6640
  }),
6565
6641
  [TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
6566
- subject: import_zod38.z.string(),
6567
- body: import_zod38.z.string()
6642
+ subject: z40.string(),
6643
+ body: z40.string()
6568
6644
  }),
6569
6645
  [TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
6570
- code: import_zod38.z.string()
6646
+ code: z40.string()
6571
6647
  }),
6572
6648
  [TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
6573
- code: import_zod38.z.string()
6649
+ code: z40.string()
6574
6650
  })
6575
6651
  };
6576
6652
  async function triggerUserEventNotification({
@@ -6592,3 +6668,6 @@ function parseUserEventTrigger(event2, body) {
6592
6668
  const schema = TriggerPayload[event2];
6593
6669
  return schema.parse(body);
6594
6670
  }
6671
+
6672
+ // src/notification/index.ts
6673
+ z41.globalRegistry.clear();