@opencrvs/toolkit 2.1.0-rc.d7bd264 → 2.1.0-rc.d876831

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 (52) hide show
  1. package/README.md +1 -0
  2. package/dist/application-config/index.js +30 -9
  3. package/dist/cli.js +174 -58
  4. package/dist/commons/api/router.d.ts +269 -11
  5. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  6. package/dist/commons/conditionals/validate.d.ts +9 -3
  7. package/dist/commons/events/ActionConfig.d.ts +0 -21
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +6 -0
  9. package/dist/commons/events/AuditLog.d.ts +147 -0
  10. package/dist/commons/events/CountryConfigQueryInput.d.ts +0 -18
  11. package/dist/commons/events/EventConfig.d.ts +3 -0
  12. package/dist/commons/events/EventIndex.d.ts +2 -6
  13. package/dist/commons/events/EventMetadata.d.ts +0 -1
  14. package/dist/commons/events/FieldConfig.d.ts +65 -53
  15. package/dist/commons/events/FieldValue.d.ts +2 -2
  16. package/dist/commons/events/Flag.d.ts +0 -6
  17. package/dist/commons/events/PlainDate.d.ts +8 -0
  18. package/dist/commons/events/SummaryConfig.d.ts +249 -0
  19. package/dist/commons/events/WorkqueueConfig.d.ts +5 -17
  20. package/dist/commons/events/event.d.ts +12 -0
  21. package/dist/commons/events/index.d.ts +1 -0
  22. package/dist/commons/events/locationPayloads.d.ts +95 -0
  23. package/dist/commons/events/locations.d.ts +106 -16
  24. package/dist/commons/events/mocks.test.utils.d.ts +30 -0
  25. package/dist/conditionals/index.js +2 -2
  26. package/dist/environment/index.d.ts +1 -0
  27. package/dist/environment/index.d.ts.map +1 -1
  28. package/dist/environment/index.js +10 -0
  29. package/dist/environment/logger.d.ts +12 -3
  30. package/dist/environment/logger.d.ts.map +1 -1
  31. package/dist/environment/paths.d.ts +7 -0
  32. package/dist/environment/paths.d.ts.map +1 -0
  33. package/dist/environment/paths.js +72 -0
  34. package/dist/environment/setup-environment.js +2 -1
  35. package/dist/environment/templates.d.ts.map +1 -1
  36. package/dist/environment/templates.js +2 -1
  37. package/dist/environment/update-workflows.d.ts.map +1 -1
  38. package/dist/environment/update-workflows.js +17 -5
  39. package/dist/environment/upgrade.d.ts +2 -0
  40. package/dist/environment/upgrade.d.ts.map +1 -0
  41. package/dist/environment/upgrade.js +82 -0
  42. package/dist/environment/users.js +11 -13
  43. package/dist/events/index.js +502 -211
  44. package/dist/notification/index.js +529 -262
  45. package/dist/scopes/index.d.ts +28 -53
  46. package/dist/scopes/index.js +2 -2
  47. package/dist/templates/charts-values/opencrvs-services/values.yaml +4 -3
  48. package/dist/templates/charts-values/opentelemetry/values.yaml +73 -0
  49. package/opencrvs-toolkit-2.1.0-rc.d876831.tgz +0 -0
  50. package/package.json +5 -4
  51. package/tsconfig.tsbuildinfo +1 -1
  52. package/opencrvs-toolkit-2.1.0-rc.d7bd264.tgz +0 -0
@@ -38,7 +38,7 @@ __export(notification_exports, {
38
38
  triggerUserEventNotification: () => triggerUserEventNotification
39
39
  });
40
40
  module.exports = __toCommonJS(notification_exports);
41
- var z45 = __toESM(require("zod/v4"));
41
+ var z46 = __toESM(require("zod/v4"));
42
42
 
43
43
  // ../commons/src/url.ts
44
44
  function joinUrl(base, path) {
@@ -266,8 +266,7 @@ var InherentFlags = {
266
266
  *
267
267
  * We only use this flag to determine that a NOTIFY, DECLARE or REGISTER action is allowed next.
268
268
  */
269
- EDIT_IN_PROGRESS: "edit-in-progress",
270
- SEALED: "sealed"
269
+ EDIT_IN_PROGRESS: "edit-in-progress"
271
270
  };
272
271
  var actionFlagPattern;
273
272
  function getActionFlagPattern() {
@@ -348,6 +347,7 @@ var PlainScopeType = z6.enum([
348
347
  "integration.create",
349
348
  "record.import",
350
349
  "config.update-all",
350
+ "location.edit",
351
351
  "attachment.upload",
352
352
  "profile.electronic-signature",
353
353
  "user.read-only-my-audit",
@@ -673,6 +673,82 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
673
673
  requestData: z8.object({ id: z8.string() }),
674
674
  responseSummary: z8.object({ clientId: z8.string() })
675
675
  });
676
+ var createdVersionFields = {
677
+ id: z8.string(),
678
+ versionId: z8.string(),
679
+ name: z8.string(),
680
+ externalId: z8.string().nullish(),
681
+ effectiveFrom: z8.string(),
682
+ status: z8.string()
683
+ };
684
+ var LocationCreateEntrySchema = AuditLogEntryBase.extend({
685
+ operation: z8.literal("locations.create"),
686
+ requestData: z8.object({
687
+ ...createdVersionFields,
688
+ administrativeAreaId: z8.string().nullish(),
689
+ locationType: z8.string().nullish()
690
+ })
691
+ });
692
+ var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
693
+ operation: z8.literal("administrativeAreas.create"),
694
+ requestData: z8.object({
695
+ ...createdVersionFields,
696
+ parentId: z8.string().nullish()
697
+ })
698
+ });
699
+ var ChangedStringField = z8.object({ from: z8.string(), to: z8.string() });
700
+ var ChangedNullableStringField = z8.object({
701
+ from: z8.string().nullable(),
702
+ to: z8.string().nullable()
703
+ });
704
+ var updatedVersionRequestData = z8.object({
705
+ id: z8.string(),
706
+ versionId: z8.string(),
707
+ name: z8.string(),
708
+ externalId: z8.string().nullish(),
709
+ status: z8.string(),
710
+ effectiveFrom: z8.string(),
711
+ lastVersionId: z8.string()
712
+ });
713
+ var updatedVersionResponseSummary = z8.object({
714
+ previousVersionId: z8.string(),
715
+ versionId: z8.string(),
716
+ changed: z8.object({
717
+ name: ChangedStringField.optional(),
718
+ externalId: ChangedNullableStringField.optional(),
719
+ status: ChangedStringField.optional()
720
+ })
721
+ });
722
+ var LocationUpdateEntrySchema = AuditLogEntryBase.extend({
723
+ operation: z8.literal("locations.update"),
724
+ requestData: updatedVersionRequestData,
725
+ responseSummary: updatedVersionResponseSummary
726
+ });
727
+ var AdministrativeAreaUpdateEntrySchema = AuditLogEntryBase.extend({
728
+ operation: z8.literal("administrativeAreas.update"),
729
+ requestData: updatedVersionRequestData,
730
+ responseSummary: updatedVersionResponseSummary
731
+ });
732
+ var withdrawVersionRequestData = z8.object({
733
+ id: z8.string(),
734
+ versionId: z8.string()
735
+ });
736
+ var withdrawVersionResponseSummary = z8.object({
737
+ effectiveFrom: z8.string(),
738
+ name: z8.string(),
739
+ externalId: z8.string().nullish(),
740
+ status: z8.string()
741
+ });
742
+ var LocationWithdrawEntrySchema = AuditLogEntryBase.extend({
743
+ operation: z8.literal("locations.withdrawVersion"),
744
+ requestData: withdrawVersionRequestData,
745
+ responseSummary: withdrawVersionResponseSummary
746
+ });
747
+ var AdministrativeAreaWithdrawEntrySchema = AuditLogEntryBase.extend({
748
+ operation: z8.literal("administrativeAreas.withdrawVersion"),
749
+ requestData: withdrawVersionRequestData,
750
+ responseSummary: withdrawVersionResponseSummary
751
+ });
676
752
  var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
677
753
  operation: z8.literal("attachments.upload"),
678
754
  requestData: z8.object({
@@ -748,6 +824,12 @@ var AuditLogEntrySchema = z8.discriminatedUnion("operation", [
748
824
  IntegrationActivateEntrySchema,
749
825
  IntegrationDeleteEntrySchema,
750
826
  IntegrationRefreshSecretEntrySchema,
827
+ LocationCreateEntrySchema,
828
+ LocationUpdateEntrySchema,
829
+ AdministrativeAreaUpdateEntrySchema,
830
+ LocationWithdrawEntrySchema,
831
+ AdministrativeAreaWithdrawEntrySchema,
832
+ AdministrativeAreaCreateEntrySchema,
751
833
  AttachmentUploadEntrySchema,
752
834
  UserCreateEntrySchema,
753
835
  UserReasonEntrySchema,
@@ -1756,8 +1838,8 @@ var BaseField = import_v43.default.object({
1756
1838
  conditionals: import_v43.default.array(FieldConditional).default([]).optional().describe(
1757
1839
  "Conditions determining when the field is shown or enabled. By default, the field is always shown and enabled."
1758
1840
  ),
1759
- secured: import_v43.default.boolean().default(false).optional().describe(
1760
- "Indicates whether the field is secured. Secured fields are not indexed for search and are only visible when explicitly assigned."
1841
+ secured: import_v43.default.union([import_v43.default.boolean(), Conditional]).default(false).optional().describe(
1842
+ "Indicates whether the field is secured, either always (boolean) or conditionally, evaluated against the event (a JSONSchema conditional, e.g. flag('sealed')). Secured fields are not indexed for search and are only visible when explicitly assigned."
1761
1843
  ),
1762
1844
  placeholder: TranslationConfig.optional(),
1763
1845
  validation: import_v43.default.array(ValidationConfig).default([]).optional().describe("Additional validation rules applied to the field."),
@@ -2155,7 +2237,13 @@ var AdministrativeAreaField = BaseField.extend({
2155
2237
  configuration: import_v43.default.object({
2156
2238
  partOf: FieldReference.optional().describe("Parent location"),
2157
2239
  type: AdministrativeAreas,
2158
- allowedLocations: AllowedLocations
2240
+ allowedLocations: AllowedLocations,
2241
+ listHistoricalNames: import_v43.default.boolean().optional().describe(
2242
+ "Advanced search: list every historical name a location has had as a separate, selectable option."
2243
+ ),
2244
+ activeOnly: import_v43.default.boolean().optional().describe(
2245
+ "Advanced search: offer only currently-active locations; inactivated ones are excluded."
2246
+ )
2159
2247
  }).describe("Administrative area options")
2160
2248
  }).meta({
2161
2249
  description: "Administrative area input field",
@@ -2166,7 +2254,10 @@ var LocationInput = BaseField.extend({
2166
2254
  defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
2167
2255
  configuration: import_v43.default.object({
2168
2256
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
2169
- allowedLocations: AllowedLocations
2257
+ allowedLocations: AllowedLocations,
2258
+ listHistoricalNames: import_v43.default.boolean().optional().describe(
2259
+ "Advanced search: list every historical name a location has had as a separate, selectable option."
2260
+ )
2170
2261
  }).optional()
2171
2262
  }).meta({
2172
2263
  description: "A field for selecting a location",
@@ -2192,12 +2283,18 @@ var FileUploadWithOptions = BaseField.extend({
2192
2283
  var Facility = BaseField.extend({
2193
2284
  type: import_v43.default.literal(FieldType.FACILITY),
2194
2285
  defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2195
- configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
2286
+ configuration: import_v43.default.object({
2287
+ allowedLocations: AllowedLocations,
2288
+ listHistoricalNames: import_v43.default.boolean().optional()
2289
+ }).optional()
2196
2290
  }).describe("Input field for a facility");
2197
2291
  var Office = BaseField.extend({
2198
2292
  type: import_v43.default.literal(FieldType.OFFICE),
2199
2293
  defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2200
- configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
2294
+ configuration: import_v43.default.object({
2295
+ allowedLocations: AllowedLocations,
2296
+ listHistoricalNames: import_v43.default.boolean().optional()
2297
+ }).optional()
2201
2298
  }).describe("Input field for an office");
2202
2299
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
2203
2300
  administrativeArea: import_v43.default.union([UUID, SerializedUserField]).optional()
@@ -2230,7 +2327,13 @@ var Address = BaseField.extend({
2230
2327
  parent: FieldReference.optional()
2231
2328
  })
2232
2329
  ).optional(),
2233
- allowedLocations: AllowedLocations
2330
+ allowedLocations: AllowedLocations,
2331
+ listHistoricalNames: import_v43.default.boolean().optional().describe(
2332
+ "Advanced search: list every historical name a location has had as a separate, selectable option. Propagated to the embedded admin-area selectors."
2333
+ ),
2334
+ activeOnly: import_v43.default.boolean().optional().describe(
2335
+ "Advanced search: offer only currently-active admin areas; inactivated ones are excluded. Propagated to the embedded admin-area selectors."
2336
+ )
2234
2337
  }).optional(),
2235
2338
  defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
2236
2339
  }).meta({
@@ -3002,45 +3105,181 @@ var LanguageConfig = z26.object({
3002
3105
  });
3003
3106
 
3004
3107
  // ../commons/src/events/EventConfig.ts
3005
- var z33 = __toESM(require("zod/v4"));
3108
+ var z34 = __toESM(require("zod/v4"));
3006
3109
 
3007
3110
  // ../commons/src/events/SummaryConfig.ts
3111
+ var z28 = __toESM(require("zod/v4"));
3112
+
3113
+ // ../commons/src/icons.ts
3008
3114
  var z27 = __toESM(require("zod/v4"));
3009
- var BaseField2 = z27.object({
3115
+ var AvailableIcons = z27.enum([
3116
+ "Archived",
3117
+ "Assigned",
3118
+ "Briefcase",
3119
+ "Certified",
3120
+ "Close",
3121
+ "Collapse",
3122
+ "Draft",
3123
+ "DuplicateYellow",
3124
+ "Expand",
3125
+ "ExternalValidate",
3126
+ "FilledCheck",
3127
+ "InReview",
3128
+ "Offline",
3129
+ "Registered",
3130
+ "RequiresUpdates",
3131
+ "Sent",
3132
+ "Validated",
3133
+ "WaitingApproval",
3134
+ "ChartActivity",
3135
+ "Activity",
3136
+ "Archive",
3137
+ "ArchiveTray",
3138
+ "ArrowLeft",
3139
+ "ArrowRight",
3140
+ "Buildings",
3141
+ "Circle",
3142
+ "CaretDown",
3143
+ "CaretLeft",
3144
+ "CaretRight",
3145
+ "ChartBar",
3146
+ "ChartLine",
3147
+ "ChatCircle",
3148
+ "CheckSquare",
3149
+ "Compass",
3150
+ "Check",
3151
+ "Copy",
3152
+ "Database",
3153
+ "DotsThreeVertical",
3154
+ "ArrowCounterClockwise",
3155
+ "MagnifyingGlassMinus",
3156
+ "MagnifyingGlassPlus",
3157
+ "Export",
3158
+ "Eye",
3159
+ "EyeSlash",
3160
+ "Envelope",
3161
+ "File",
3162
+ "FileLock",
3163
+ "FileSearch",
3164
+ "FileMinus",
3165
+ "FilePlus",
3166
+ "FileText",
3167
+ "FileX",
3168
+ "Handshake",
3169
+ "Gear",
3170
+ "GitBranch",
3171
+ "IdentificationCard",
3172
+ "List",
3173
+ "ListBullets",
3174
+ "Lock",
3175
+ "MagnifyingGlass",
3176
+ "MapPin",
3177
+ "Medal",
3178
+ "NotePencil",
3179
+ "Paperclip",
3180
+ "PaperPlaneTilt",
3181
+ "Pen",
3182
+ "PenNib",
3183
+ "Pencil",
3184
+ "PencilSimpleLine",
3185
+ "Phone",
3186
+ "Plus",
3187
+ "Printer",
3188
+ "SignOut",
3189
+ "Stamp",
3190
+ "Star",
3191
+ "Target",
3192
+ "TextT",
3193
+ "Trash",
3194
+ "UploadSimple",
3195
+ "User",
3196
+ "UserPlus",
3197
+ "Users",
3198
+ "WarningCircle",
3199
+ "X",
3200
+ "ChatText",
3201
+ "CircleWavyCheck",
3202
+ "CircleWavyQuestion",
3203
+ "ArchiveBox",
3204
+ "ArrowCircleDown",
3205
+ "FileArrowUp",
3206
+ "FileDotted",
3207
+ "Files",
3208
+ "PencilLine",
3209
+ "PencilCircle",
3210
+ "UserCircle",
3211
+ "Clock",
3212
+ "QrCode",
3213
+ "Webcam",
3214
+ "Sun",
3215
+ "DeviceTabletCamera",
3216
+ "Globe",
3217
+ "Fingerprint",
3218
+ "PushPin",
3219
+ "Timer"
3220
+ ]);
3221
+
3222
+ // ../commons/src/events/SummaryConfig.ts
3223
+ var InfoBox = z28.object({
3224
+ type: z28.enum(["info", "positive", "warning", "negative"]).describe(
3225
+ "Semantic tint of the icon block: info (blue), positive (green), warning (orange), negative (red)."
3226
+ ),
3227
+ background: z28.enum(["tinted", "white"]).default("tinted").optional().describe(
3228
+ "tinted reads as a recessed empty state; white reads as a standalone card."
3229
+ ),
3230
+ icon: AvailableIcons.optional().describe(
3231
+ "Icon displayed inside the icon block. Defaults to FileSearch."
3232
+ ),
3233
+ heading: TranslationConfig.describe(
3234
+ "Primary message. Short, sentence-case."
3235
+ ),
3236
+ description: TranslationConfig.optional().describe(
3237
+ "Secondary copy displayed below the heading, typically a suggested next step."
3238
+ ),
3239
+ conditionals: z28.array(ShowConditional).default([]).optional().describe(
3240
+ "Conditions under which the info box is shown. When omitted, it is always shown."
3241
+ )
3242
+ }).describe(
3243
+ "A compact icon-block + heading + description block displayed above the summary fields in the event overview."
3244
+ );
3245
+ var BaseField2 = z28.object({
3010
3246
  emptyValueMessage: TranslationConfig.optional().describe(
3011
3247
  "Default message displayed when the field value is empty."
3012
3248
  ),
3013
- conditionals: z27.array(ShowConditional).default([]).optional()
3249
+ conditionals: z28.array(ShowConditional).default([]).optional()
3014
3250
  });
3015
3251
  var ReferenceField = BaseField2.extend({
3016
- fieldId: z27.string(),
3252
+ fieldId: z28.string(),
3017
3253
  label: TranslationConfig.optional().describe(
3018
3254
  "Overrides the default label from the referenced field when provided."
3019
3255
  )
3020
3256
  }).describe("Field referencing existing event data by field ID.");
3021
3257
  var Field = BaseField2.extend({
3022
- id: z27.string().describe("Identifier of the summary field."),
3258
+ id: z28.string().describe("Identifier of the summary field."),
3023
3259
  value: TranslationConfig.describe(
3024
3260
  'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
3025
3261
  ),
3026
3262
  label: TranslationConfig
3027
3263
  }).describe("Custom field defined for the summary view.");
3028
- var SummaryConfig = z27.object({
3029
- fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
3264
+ var SummaryConfig = z28.object({
3265
+ banners: z28.array(InfoBox).default([]).optional().describe(
3266
+ "Info boxes displayed above the summary fields in the event overview."
3267
+ ),
3268
+ fields: z28.array(z28.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
3030
3269
  }).meta({
3031
3270
  id: "SummaryConfig",
3032
3271
  description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
3033
3272
  });
3034
3273
 
3035
3274
  // ../commons/src/events/AdvancedSearchConfig.ts
3036
- var z28 = __toESM(require("zod/v4"));
3037
- var MatchType = z28.enum(["fuzzy", "exact", "range", "within"]);
3038
- var BaseField3 = z28.object({
3039
- config: z28.object({
3275
+ var z29 = __toESM(require("zod/v4"));
3276
+ var MatchType = z29.enum(["fuzzy", "exact", "range", "within"]);
3277
+ var BaseField3 = z29.object({
3278
+ config: z29.object({
3040
3279
  type: MatchType.describe(
3041
3280
  "Determines the search type of field. How to match value."
3042
3281
  ),
3043
- searchFields: z28.array(z28.string()).optional().describe(
3282
+ searchFields: z29.array(z29.string()).optional().describe(
3044
3283
  `
3045
3284
  Defines multiple form fields that should be searched when this field has a value.
3046
3285
  All specified fields will be combined using OR logic.
@@ -3050,7 +3289,7 @@ var BaseField3 = z28.object({
3050
3289
  `
3051
3290
  )
3052
3291
  }),
3053
- type: z28.nativeEnum(FieldType).optional().describe(
3292
+ type: z29.nativeEnum(FieldType).optional().describe(
3054
3293
  `
3055
3294
  Explicitly specify the field type for searchFields.
3056
3295
  This is required when searchFields is defined, to show the correct control in the UI.
@@ -3064,7 +3303,7 @@ var BaseField3 = z28.object({
3064
3303
  This is required when searchFields is defined.
3065
3304
  `
3066
3305
  ),
3067
- options: z28.array(SelectOption).optional(),
3306
+ options: z29.array(SelectOption).optional(),
3068
3307
  searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
3069
3308
  `
3070
3309
  This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
@@ -3085,7 +3324,7 @@ var BaseField3 = z28.object({
3085
3324
  in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
3086
3325
  `
3087
3326
  ),
3088
- conditionals: z28.array(FieldConditional).optional().describe(
3327
+ conditionals: z29.array(FieldConditional).optional().describe(
3089
3328
  `
3090
3329
  In advanced search, we sometimes need to override the default field visibility conditionals.
3091
3330
 
@@ -3099,23 +3338,23 @@ var BaseField3 = z28.object({
3099
3338
  are always rendered in the advanced search form.
3100
3339
  `
3101
3340
  ),
3102
- validations: z28.array(ValidationConfig).optional().describe(
3341
+ validations: z29.array(ValidationConfig).optional().describe(
3103
3342
  `Option for overriding the field validations specifically for advanced search form.`
3104
3343
  ),
3105
3344
  allowedLocations: JurisdictionReference.optional().describe(
3106
3345
  `Override the allowedLocations for a location field in advanced search. Use this when the declaration form's allowedLocations references a scope (e.g. record.create) that search-only users don't have \u2014 specify record.search scope instead.`
3107
3346
  )
3108
3347
  });
3109
- var SearchQueryParams = z28.object({
3110
- eventType: z28.string().optional().describe(
3348
+ var SearchQueryParams = z29.object({
3349
+ eventType: z29.string().optional().describe(
3111
3350
  "Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
3112
3351
  )
3113
3352
  }).catchall(FieldValue);
3114
3353
  var FieldConfigSchema = BaseField3.extend({
3115
- fieldId: z28.string(),
3116
- fieldType: z28.literal("field")
3354
+ fieldId: z29.string(),
3355
+ fieldType: z29.literal("field")
3117
3356
  });
3118
- var EventFieldIdInput = z28.enum([
3357
+ var EventFieldIdInput = z29.enum([
3119
3358
  "trackingId",
3120
3359
  "status",
3121
3360
  "legalStatuses.REGISTERED.acceptedAt",
@@ -3124,7 +3363,7 @@ var EventFieldIdInput = z28.enum([
3124
3363
  "updatedAt"
3125
3364
  ]);
3126
3365
  var METADATA_FIELD_PREFIX = "event.";
3127
- var EventFieldId = z28.enum([
3366
+ var EventFieldId = z29.enum([
3128
3367
  `${METADATA_FIELD_PREFIX}trackingId`,
3129
3368
  `${METADATA_FIELD_PREFIX}status`,
3130
3369
  `${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
@@ -3134,29 +3373,29 @@ var EventFieldId = z28.enum([
3134
3373
  ]);
3135
3374
  var EventFieldConfigSchema = BaseField3.extend({
3136
3375
  fieldId: EventFieldId,
3137
- fieldType: z28.literal("event")
3376
+ fieldType: z29.literal("event")
3138
3377
  });
3139
- var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
3378
+ var AdvancedSearchField = z29.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
3140
3379
  if (data.config.searchFields && data.config.searchFields.length > 0) {
3141
3380
  if (!data.label) {
3142
3381
  ctx.addIssue({
3143
- code: z28.ZodIssueCode.custom,
3382
+ code: z29.ZodIssueCode.custom,
3144
3383
  message: "label is required when config.searchFields is defined.",
3145
3384
  path: ["label"]
3146
3385
  });
3147
3386
  }
3148
3387
  if (!data.type) {
3149
3388
  ctx.addIssue({
3150
- code: z28.ZodIssueCode.custom,
3389
+ code: z29.ZodIssueCode.custom,
3151
3390
  message: "type is required when config.searchFields is defined.",
3152
3391
  path: ["type"]
3153
3392
  });
3154
3393
  }
3155
3394
  }
3156
3395
  });
3157
- var AdvancedSearchConfig = z28.object({
3396
+ var AdvancedSearchConfig = z29.object({
3158
3397
  title: TranslationConfig.describe("Advanced search tab title"),
3159
- fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
3398
+ fields: z29.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
3160
3399
  }).meta({
3161
3400
  id: "AdvancedSearchConfig",
3162
3401
  description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
@@ -3168,20 +3407,20 @@ var import_lodash4 = require("lodash");
3168
3407
  // ../commons/src/conditionals/validate.ts
3169
3408
  var import__ = __toESM(require("ajv/dist/2019"));
3170
3409
  var import_ajv_formats = __toESM(require("ajv-formats"));
3171
- var z32 = __toESM(require("zod/v4"));
3410
+ var z33 = __toESM(require("zod/v4"));
3172
3411
  var import_date_fns2 = require("date-fns");
3173
3412
 
3174
3413
  // ../commons/src/events/FieldTypeMapping.ts
3175
- var z30 = __toESM(require("zod/v4"));
3414
+ var z31 = __toESM(require("zod/v4"));
3176
3415
 
3177
3416
  // ../commons/src/events/DynamicFieldValue.ts
3178
- var z29 = __toESM(require("zod/v4"));
3417
+ var z30 = __toESM(require("zod/v4"));
3179
3418
 
3180
3419
  // ../commons/src/events/state/index.ts
3181
3420
  var import_lodash3 = require("lodash");
3182
3421
 
3183
3422
  // ../commons/src/utils.ts
3184
- var z31 = __toESM(require("zod/v4"));
3423
+ var z32 = __toESM(require("zod/v4"));
3185
3424
  var _ = __toESM(require("lodash"));
3186
3425
  function getOrThrow(x, message) {
3187
3426
  if (x === void 0 || x === null) {
@@ -3192,11 +3431,11 @@ function getOrThrow(x, message) {
3192
3431
  function joinValues(values, separator = " ") {
3193
3432
  return values.filter((value) => !!value).join(separator).trim();
3194
3433
  }
3195
- var FullNameV1 = z31.array(
3196
- z31.object({
3197
- use: z31.string(),
3198
- family: z31.string(),
3199
- given: z31.array(z31.string())
3434
+ var FullNameV1 = z32.array(
3435
+ z32.object({
3436
+ use: z32.string(),
3437
+ family: z32.string(),
3438
+ given: z32.array(z32.string())
3200
3439
  })
3201
3440
  );
3202
3441
  function omitKeyDeep(obj, keyToRemove) {
@@ -3444,24 +3683,24 @@ function resolveEventCustomFlags(event2, eventConfiguration) {
3444
3683
  }
3445
3684
  function getActionStatusFlags(sortedActions) {
3446
3685
  const actionStatus = sortedActions.reduce(
3447
- (actionStatuses, { type, status }) => ({
3686
+ (actionStatuses, { type, status: status2 }) => ({
3448
3687
  ...actionStatuses,
3449
- [type]: status
3688
+ [type]: status2
3450
3689
  }),
3451
3690
  {}
3452
3691
  );
3453
- return Object.entries(actionStatus).filter(([, status]) => status !== ActionStatus.Accepted).map(([type, status]) => {
3454
- const flag = joinValues([type, status], ":").toLowerCase();
3455
- return flag;
3692
+ return Object.entries(actionStatus).filter(([, status2]) => status2 !== ActionStatus.Accepted).map(([type, status2]) => {
3693
+ const flag2 = joinValues([type, status2], ":").toLowerCase();
3694
+ return flag2;
3456
3695
  });
3457
3696
  }
3458
3697
  function getInherentFlags(sortedActions, event2, eventConfiguration) {
3459
3698
  const acceptedActions = sortedActions.filter(
3460
- ({ status }) => status === ActionStatus.Accepted
3699
+ ({ status: status2 }) => status2 === ActionStatus.Accepted
3461
3700
  );
3462
3701
  return INHERENT_FLAG_RULES.filter(
3463
3702
  (rule) => resolveInherentFlag(rule, acceptedActions, event2, eventConfiguration)
3464
- ).map(({ flag }) => flag);
3703
+ ).map(({ flag: flag2 }) => flag2);
3465
3704
  }
3466
3705
  function getEventFlags(event2, config) {
3467
3706
  const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
@@ -3678,6 +3917,33 @@ function defineComparison(field3, value, keyword) {
3678
3917
  required: [field3.$$field]
3679
3918
  });
3680
3919
  }
3920
+ function flag(flagvalue) {
3921
+ return defineConditional({
3922
+ type: "object",
3923
+ properties: {
3924
+ $flags: {
3925
+ type: "array",
3926
+ contains: {
3927
+ type: "string",
3928
+ const: flagvalue
3929
+ }
3930
+ }
3931
+ },
3932
+ required: ["$flags"]
3933
+ });
3934
+ }
3935
+ function status(statusValue) {
3936
+ return defineConditional({
3937
+ type: "object",
3938
+ properties: {
3939
+ $status: {
3940
+ type: "string",
3941
+ const: statusValue
3942
+ }
3943
+ },
3944
+ required: ["$status"]
3945
+ });
3946
+ }
3681
3947
  function createFieldConditionals(fieldId) {
3682
3948
  const getDayRange = (field3, days, clause, referenceDate) => ({
3683
3949
  type: "object",
@@ -4082,7 +4348,7 @@ function createFieldConditionals(fieldId) {
4082
4348
  // ../commons/src/events/state/index.ts
4083
4349
  function getStatusFromActions(actions) {
4084
4350
  const acceptedActions = actions.filter(
4085
- ({ status }) => status === ActionStatus.Accepted
4351
+ ({ status: status2 }) => status2 === ActionStatus.Accepted
4086
4352
  );
4087
4353
  const isCurrentlyArchived = acceptedActions.reduce(
4088
4354
  (archived, action) => {
@@ -4101,7 +4367,7 @@ function getStatusFromActions(actions) {
4101
4367
  }
4102
4368
  return acceptedActions.filter(
4103
4369
  ({ type }) => type !== ActionType.ARCHIVE && type !== ActionType.UNARCHIVE
4104
- ).reduce((status, action) => {
4370
+ ).reduce((status2, action) => {
4105
4371
  switch (action.type) {
4106
4372
  case ActionType.CREATE:
4107
4373
  return EventStatus.enum.CREATED;
@@ -4128,7 +4394,7 @@ function getStatusFromActions(actions) {
4128
4394
  case ActionType.READ:
4129
4395
  case ActionType.EDIT:
4130
4396
  default:
4131
- return status;
4397
+ return status2;
4132
4398
  }
4133
4399
  }, EventStatus.enum.CREATED);
4134
4400
  }
@@ -4224,12 +4490,12 @@ function getCurrentEventState(event2, config) {
4224
4490
  const requestActionMetadata = getActionUpdateMetadata(sortedActions);
4225
4491
  const acceptedActionMetadata = getActionUpdateMetadata(acceptedActions);
4226
4492
  const declaration = aggregateActionDeclarations(event2);
4227
- const status = getStatusFromActions(sortedActions);
4493
+ const status2 = getStatusFromActions(sortedActions);
4228
4494
  const legalStatuses = getLegalStatuses(sortedActions);
4229
4495
  const base = deepDropNulls({
4230
4496
  id: event2.id,
4231
4497
  type: event2.type,
4232
- status,
4498
+ status: status2,
4233
4499
  legalStatuses,
4234
4500
  createdAt: creationAction.createdAt,
4235
4501
  createdBy: creationAction.createdBy,
@@ -4263,9 +4529,9 @@ var ajv = new import__.default({
4263
4529
  strict: false
4264
4530
  // Allow minContains and other newer features
4265
4531
  });
4266
- var DataContext = z32.object({
4267
- rootData: z32.object({
4268
- $leafAdminStructureLocationIds: z32.array(z32.object({ id: UUID }))
4532
+ var DataContext = z33.object({
4533
+ rootData: z33.object({
4534
+ $leafAdminStructureLocationIds: z33.array(z33.object({ id: UUID }))
4269
4535
  })
4270
4536
  });
4271
4537
  function resolveDataPath(rootData, dataPath, instancePath) {
@@ -4302,8 +4568,22 @@ function compileClientFunction(code) {
4302
4568
  return fn;
4303
4569
  }
4304
4570
  (0, import_ajv_formats.default)(ajv);
4571
+ var inMemoryEventStateCache = /* @__PURE__ */ new WeakMap();
4572
+ function getInMemoryEventState(event2, config) {
4573
+ let stateByConfig = inMemoryEventStateCache.get(event2);
4574
+ if (!stateByConfig) {
4575
+ stateByConfig = /* @__PURE__ */ new WeakMap();
4576
+ inMemoryEventStateCache.set(event2, stateByConfig);
4577
+ }
4578
+ let state = stateByConfig.get(config);
4579
+ if (!state) {
4580
+ state = getCurrentEventState(event2, config);
4581
+ stateByConfig.set(config, state);
4582
+ }
4583
+ return state;
4584
+ }
4305
4585
  function buildClientFunctionContext(input) {
4306
- const flags = input.validatorContext?.event && input.validatorContext?.eventConfig ? getCurrentEventState(
4586
+ const flags = input.validatorContext?.event && input.validatorContext?.eventConfig ? getInMemoryEventState(
4307
4587
  input.validatorContext?.event,
4308
4588
  input.validatorContext?.eventConfig
4309
4589
  )?.flags : [];
@@ -4667,9 +4947,9 @@ function validatePlaceOfEvent(event2, ctx) {
4667
4947
  }
4668
4948
  function validateActionFlags(event2, ctx) {
4669
4949
  const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
4670
- const configuredFlagIds = event2.flags.map((flag) => flag.id);
4950
+ const configuredFlagIds = event2.flags.map((flag2) => flag2.id);
4671
4951
  const actionFlagIds = event2.actions.flatMap(
4672
- (action) => (action.flags ?? []).map((flag) => flag.id)
4952
+ (action) => (action.flags ?? []).map((flag2) => flag2.id)
4673
4953
  );
4674
4954
  for (const actionFlagId of actionFlagIds) {
4675
4955
  const isConfigured = configuredFlagIds.includes(actionFlagId);
@@ -4705,11 +4985,11 @@ function validateActionOrder(event2, ctx) {
4705
4985
  }
4706
4986
 
4707
4987
  // ../commons/src/events/EventConfig.ts
4708
- var EventFieldReference = z33.object({ $$event: EventMetadataDateFieldIdInput }).describe(
4988
+ var EventFieldReference = z34.object({ $$event: EventMetadataDateFieldIdInput }).describe(
4709
4989
  "Reference to a field defined in the event metadata, using the field id."
4710
4990
  );
4711
- var _EventConfigBase = z33.object({
4712
- id: z33.string().describe(
4991
+ var _EventConfigBase = z34.object({
4992
+ id: z34.string().describe(
4713
4993
  'Machine-readable identifier of the event (e.g. "birth", "death").'
4714
4994
  ),
4715
4995
  dateOfEvent: FieldReference.or(EventFieldReference).optional().describe(
@@ -4728,23 +5008,26 @@ var _EventConfigBase = z33.object({
4728
5008
  "Summary information displayed in the event overview."
4729
5009
  ),
4730
5010
  label: TranslationConfig.describe("Human-readable label for the event type."),
4731
- actions: z33.array(ActionConfig).describe(
5011
+ actions: z34.array(ActionConfig).describe(
4732
5012
  "Configuration of core and custom actions associated with the event."
4733
5013
  ),
4734
- actionOrder: z33.array(z33.string()).optional().describe(
5014
+ actionOrder: z34.array(z34.string()).optional().describe(
4735
5015
  "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
4736
5016
  ),
4737
5017
  declaration: DeclarationFormConfig.describe(
4738
5018
  "Configuration of the form used to gather event data."
4739
5019
  ),
4740
- advancedSearch: z33.array(AdvancedSearchConfig).optional().default([]).describe(
5020
+ advancedSearch: z34.array(AdvancedSearchConfig).optional().default([]).describe(
4741
5021
  "Configuration of fields available in the advanced search feature."
4742
5022
  ),
4743
- flags: z33.array(FlagConfig).optional().default([]).describe(
5023
+ flags: z34.array(FlagConfig).optional().default([]).describe(
4744
5024
  "Configuration of custom flags associated with the actions of this event type."
4745
5025
  ),
4746
- analytics: z33.boolean().optional().default(true).describe(
5026
+ analytics: z34.boolean().optional().default(true).describe(
4747
5027
  "Indicates whether the records of this event type are included in analytics"
5028
+ ),
5029
+ icon: z34.partialRecord(AvailableIcons, Conditional).optional().describe(
5030
+ 'Maps an icon name to a conditional. The icon of the first entry (in definition order) whose conditional matches the event is used when rendering it (e.g. in the "iconWithName"/"iconWithNameEvent" workqueue columns). Falls back to the default status-based icon when unset or when no conditional matches.'
4748
5031
  )
4749
5032
  });
4750
5033
  var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
@@ -4961,21 +5244,31 @@ var event = Object.assign(eventFn, {
4961
5244
  return {
4962
5245
  $event: field3
4963
5246
  };
4964
- }
5247
+ },
5248
+ /**
5249
+ * Checks if the event currently has the given status.
5250
+ * @param eventStatus - The status to check for.
5251
+ */
5252
+ hasStatus: (eventStatus) => status(eventStatus),
5253
+ /**
5254
+ * Checks if the event currently carries the given flag.
5255
+ * @param flagValue - The flag to check for.
5256
+ */
5257
+ hasFlag: (flagValue) => flag(flagValue)
4965
5258
  });
4966
5259
 
4967
5260
  // ../commons/src/events/WorkqueueColumnConfig.ts
4968
- var z34 = __toESM(require("zod/v4"));
5261
+ var z35 = __toESM(require("zod/v4"));
4969
5262
  var WorkqueueColumnKeysArray = [
4970
5263
  ...EventMetadataKeysArray,
4971
5264
  "title",
4972
5265
  "outbox"
4973
5266
  ];
4974
- var WorkqueueColumnKeys = z34.enum(WorkqueueColumnKeysArray);
4975
- var WorkqueueColumnValue = z34.object({
5267
+ var WorkqueueColumnKeys = z35.enum(WorkqueueColumnKeysArray);
5268
+ var WorkqueueColumnValue = z35.object({
4976
5269
  $event: WorkqueueColumnKeys
4977
5270
  });
4978
- var WorkqueueColumn = z34.object({
5271
+ var WorkqueueColumn = z35.object({
4979
5272
  label: TranslationConfig,
4980
5273
  value: WorkqueueColumnValue
4981
5274
  }).meta({
@@ -4989,164 +5282,56 @@ function defineWorkqueuesColumns(workqueueColumns) {
4989
5282
  }
4990
5283
 
4991
5284
  // ../commons/src/events/CountryConfigQueryInput.ts
4992
- var z35 = __toESM(require("zod/v4"));
4993
- var SerializableExact = z35.object({
4994
- type: z35.literal("exact"),
4995
- term: z35.union([z35.string(), SerializedUserField])
4996
- });
4997
- var SerializableWithin = z35.object({
4998
- type: z35.literal("within"),
4999
- location: z35.union([z35.string(), SerializedUserField])
5000
- });
5001
- var SerializedQueryExpression = z35.object({
5002
- eventType: z35.string(),
5003
- status: z35.optional(z35.union([AnyOfStatus, ExactStatus])),
5004
- createdAt: z35.optional(DateCondition),
5005
- updatedAt: z35.optional(DateCondition),
5006
- "legalStatuses.DECLARED.createdAtLocation": z35.optional(SerializableWithin),
5007
- "legalStatuses.DECLARED.createdByRole": z35.optional(AnyOf),
5008
- "legalStatuses.REGISTERED.createdAt": z35.optional(DateCondition),
5009
- "legalStatuses.REGISTERED.createdAtLocation": z35.optional(SerializableWithin),
5010
- "legalStatuses.REGISTERED.createdByRole": z35.optional(AnyOf),
5011
- "legalStatuses.REGISTERED.registrationNumber": z35.optional(Exact),
5012
- createdAtLocation: z35.optional(
5013
- z35.union([SerializableWithin, SerializableExact])
5285
+ var z36 = __toESM(require("zod/v4"));
5286
+ var SerializableExact = z36.object({
5287
+ type: z36.literal("exact"),
5288
+ term: z36.union([z36.string(), SerializedUserField])
5289
+ });
5290
+ var SerializableWithin = z36.object({
5291
+ type: z36.literal("within"),
5292
+ location: z36.union([z36.string(), SerializedUserField])
5293
+ });
5294
+ var SerializedQueryExpression = z36.object({
5295
+ eventType: z36.string(),
5296
+ status: z36.optional(z36.union([AnyOfStatus, ExactStatus])),
5297
+ createdAt: z36.optional(DateCondition),
5298
+ updatedAt: z36.optional(DateCondition),
5299
+ "legalStatuses.DECLARED.createdAtLocation": z36.optional(SerializableWithin),
5300
+ "legalStatuses.DECLARED.createdByRole": z36.optional(AnyOf),
5301
+ "legalStatuses.REGISTERED.createdAt": z36.optional(DateCondition),
5302
+ "legalStatuses.REGISTERED.createdAtLocation": z36.optional(SerializableWithin),
5303
+ "legalStatuses.REGISTERED.createdByRole": z36.optional(AnyOf),
5304
+ "legalStatuses.REGISTERED.registrationNumber": z36.optional(Exact),
5305
+ createdAtLocation: z36.optional(
5306
+ z36.union([SerializableWithin, SerializableExact])
5014
5307
  ),
5015
- updatedAtLocation: z35.optional(
5016
- z35.union([SerializableWithin, SerializableExact])
5308
+ updatedAtLocation: z36.optional(
5309
+ z36.union([SerializableWithin, SerializableExact])
5017
5310
  ),
5018
- updatedByUserRole: z35.optional(SerializableExact),
5019
- assignedTo: z35.optional(SerializableExact),
5020
- createdBy: z35.optional(SerializableExact),
5311
+ updatedByUserRole: z36.optional(SerializableExact),
5312
+ assignedTo: z36.optional(SerializableExact),
5313
+ createdBy: z36.optional(SerializableExact),
5021
5314
  createdByUserType: ExactUserType,
5022
- updatedBy: z35.optional(SerializableExact),
5023
- trackingId: z35.optional(Exact),
5024
- flags: z35.optional(ContainsFlags),
5315
+ updatedBy: z36.optional(SerializableExact),
5316
+ trackingId: z36.optional(Exact),
5317
+ flags: z36.optional(ContainsFlags),
5025
5318
  data: QueryInput
5026
5319
  }).partial();
5027
- var Or2 = z35.object({
5028
- type: z35.literal("or"),
5029
- clauses: z35.array(SerializedQueryExpression)
5320
+ var Or2 = z36.object({
5321
+ type: z36.literal("or"),
5322
+ clauses: z36.array(SerializedQueryExpression)
5030
5323
  });
5031
- var And2 = z35.object({
5032
- type: z35.literal("and"),
5033
- clauses: z35.array(SerializedQueryExpression)
5324
+ var And2 = z36.object({
5325
+ type: z36.literal("and"),
5326
+ clauses: z36.array(SerializedQueryExpression)
5034
5327
  });
5035
- var CountryConfigQueryType = z35.discriminatedUnion("type", [And2, Or2]);
5036
- var CountryConfigQueryInputType = z35.union([
5328
+ var CountryConfigQueryType = z36.discriminatedUnion("type", [And2, Or2]);
5329
+ var CountryConfigQueryInputType = z36.union([
5037
5330
  SerializedQueryExpression,
5038
5331
  And2,
5039
5332
  Or2
5040
5333
  ]);
5041
5334
 
5042
- // ../commons/src/icons.ts
5043
- var z36 = __toESM(require("zod/v4"));
5044
- var AvailableIcons = z36.enum([
5045
- "Archived",
5046
- "Assigned",
5047
- "Briefcase",
5048
- "Certified",
5049
- "Close",
5050
- "Collapse",
5051
- "Draft",
5052
- "DuplicateYellow",
5053
- "Expand",
5054
- "ExternalValidate",
5055
- "FilledCheck",
5056
- "InReview",
5057
- "Offline",
5058
- "Registered",
5059
- "RequiresUpdates",
5060
- "Sent",
5061
- "Validated",
5062
- "WaitingApproval",
5063
- "ChartActivity",
5064
- "Activity",
5065
- "Archive",
5066
- "ArchiveTray",
5067
- "ArrowLeft",
5068
- "ArrowRight",
5069
- "Buildings",
5070
- "Circle",
5071
- "CaretDown",
5072
- "CaretLeft",
5073
- "CaretRight",
5074
- "ChartBar",
5075
- "ChartLine",
5076
- "ChatCircle",
5077
- "CheckSquare",
5078
- "Compass",
5079
- "Check",
5080
- "Copy",
5081
- "Database",
5082
- "DotsThreeVertical",
5083
- "ArrowCounterClockwise",
5084
- "MagnifyingGlassMinus",
5085
- "MagnifyingGlassPlus",
5086
- "Export",
5087
- "Eye",
5088
- "EyeSlash",
5089
- "Envelope",
5090
- "File",
5091
- "FileSearch",
5092
- "FileMinus",
5093
- "FilePlus",
5094
- "FileText",
5095
- "FileX",
5096
- "Handshake",
5097
- "Gear",
5098
- "GitBranch",
5099
- "IdentificationCard",
5100
- "List",
5101
- "ListBullets",
5102
- "Lock",
5103
- "MagnifyingGlass",
5104
- "MapPin",
5105
- "Medal",
5106
- "NotePencil",
5107
- "Paperclip",
5108
- "PaperPlaneTilt",
5109
- "Pen",
5110
- "PenNib",
5111
- "Pencil",
5112
- "PencilSimpleLine",
5113
- "Phone",
5114
- "Plus",
5115
- "Printer",
5116
- "SignOut",
5117
- "Stamp",
5118
- "Star",
5119
- "Target",
5120
- "TextT",
5121
- "Trash",
5122
- "UploadSimple",
5123
- "User",
5124
- "UserPlus",
5125
- "Users",
5126
- "WarningCircle",
5127
- "X",
5128
- "ChatText",
5129
- "CircleWavyCheck",
5130
- "CircleWavyQuestion",
5131
- "ArchiveBox",
5132
- "ArrowCircleDown",
5133
- "FileArrowUp",
5134
- "FileDotted",
5135
- "Files",
5136
- "PencilLine",
5137
- "PencilCircle",
5138
- "UserCircle",
5139
- "Clock",
5140
- "QrCode",
5141
- "Webcam",
5142
- "Sun",
5143
- "DeviceTabletCamera",
5144
- "Globe",
5145
- "Fingerprint",
5146
- "PushPin",
5147
- "Timer"
5148
- ]);
5149
-
5150
5335
  // ../commons/src/events/WorkqueueConfig.ts
5151
5336
  var mandatoryColumns = defineWorkqueuesColumns([
5152
5337
  {
@@ -7947,6 +8132,31 @@ var Location = z43.object({
7947
8132
  status: LocationStatus,
7948
8133
  versions: z43.array(LocationVersion)
7949
8134
  });
8135
+ var ClientAdministrativeArea = AdministrativeArea.omit({
8136
+ name: true,
8137
+ status: true,
8138
+ externalId: true
8139
+ });
8140
+ var ClientLocation = Location.omit({
8141
+ name: true,
8142
+ status: true,
8143
+ externalId: true
8144
+ });
8145
+ function toClientLocation(location) {
8146
+ return {
8147
+ id: location.id,
8148
+ administrativeAreaId: location.administrativeAreaId,
8149
+ locationType: location.locationType,
8150
+ versions: location.versions
8151
+ };
8152
+ }
8153
+ function toClientAdministrativeArea(area) {
8154
+ return {
8155
+ id: area.id,
8156
+ parentId: area.parentId,
8157
+ versions: area.versions
8158
+ };
8159
+ }
7950
8160
  var SetLocationPayload = z43.object({
7951
8161
  id: UUID,
7952
8162
  name: z43.string(),
@@ -8031,20 +8241,20 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
8031
8241
  ]
8032
8242
  };
8033
8243
  var ACTION_FILTERS = {
8034
- [ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
8035
- [ActionType.REQUEST_CORRECTION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
8036
- [ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
8037
- [ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
8038
- [ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag) => flag.endsWith(":requested")),
8039
- [ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
8040
- [ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
8041
- [ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag) => flag.endsWith(":requested")),
8042
- [ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag) => flag.endsWith(":requested")),
8043
- [ActionType.ARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
8044
- [ActionType.UNARCHIVE]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
8045
- [ActionType.ASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
8046
- [ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
8047
- [ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
8244
+ [ActionType.PRINT_CERTIFICATE]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8245
+ [ActionType.REQUEST_CORRECTION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8246
+ [ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8247
+ [ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8248
+ [ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8249
+ [ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
8250
+ [ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
8251
+ [ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
8252
+ [ActionType.REJECT]: (flags) => !flags.includes(InherentFlags.REJECTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8253
+ [ActionType.ARCHIVE]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
8254
+ [ActionType.UNARCHIVE]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
8255
+ [ActionType.ASSIGN]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
8256
+ [ActionType.UNASSIGN]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
8257
+ [ActionType.CUSTOM]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested"))
8048
8258
  };
8049
8259
  var REJECTED_ACTIONS = [
8050
8260
  ActionType.READ,
@@ -8389,9 +8599,66 @@ var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
8389
8599
  var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
8390
8600
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
8391
8601
  );
8602
+ var V2_DEFAULT_MOCK_CLIENT_LOCATIONS_MAP = new Map(
8603
+ V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, toClientLocation(l)])
8604
+ );
8605
+ var V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP = new Map(
8606
+ V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [
8607
+ a.id,
8608
+ toClientAdministrativeArea(a)
8609
+ ])
8610
+ );
8392
8611
 
8393
- // ../commons/src/notification/UserNotifications.ts
8612
+ // ../commons/src/events/locationPayloads.ts
8394
8613
  var z44 = __toESM(require("zod/v4"));
8614
+ var CreateLocationPayload = z44.object({
8615
+ id: UUID.optional(),
8616
+ versionId: UUID.optional(),
8617
+ name: z44.string(),
8618
+ externalId: z44.string().nullish(),
8619
+ administrativeAreaId: UUID.nullable(),
8620
+ locationType: z44.string().nullable(),
8621
+ effectiveFrom: z44.iso.date().optional(),
8622
+ status: LocationStatus.default("active")
8623
+ });
8624
+ var UpdateLocationPayload = z44.strictObject({
8625
+ id: UUID,
8626
+ versionId: UUID.optional(),
8627
+ name: z44.string(),
8628
+ externalId: z44.string().nullish(),
8629
+ status: LocationStatus,
8630
+ effectiveFrom: z44.iso.date().optional(),
8631
+ lastVersionId: UUID
8632
+ });
8633
+ var WithdrawLocationVersionPayload = z44.object({
8634
+ id: UUID,
8635
+ versionId: UUID
8636
+ });
8637
+ var CreateAdministrativeAreaPayload = z44.object({
8638
+ id: UUID.optional(),
8639
+ versionId: UUID.optional(),
8640
+ name: z44.string(),
8641
+ externalId: z44.string().nullish(),
8642
+ parentId: UUID.nullable(),
8643
+ effectiveFrom: z44.iso.date().optional(),
8644
+ status: LocationStatus.default("active")
8645
+ });
8646
+ var UpdateAdministrativeAreaPayload = z44.strictObject({
8647
+ id: UUID,
8648
+ versionId: UUID.optional(),
8649
+ name: z44.string(),
8650
+ externalId: z44.string().nullish(),
8651
+ status: LocationStatus,
8652
+ effectiveFrom: z44.iso.date().optional(),
8653
+ lastVersionId: UUID
8654
+ });
8655
+ var WithdrawAdministrativeAreaVersionPayload = z44.object({
8656
+ id: UUID,
8657
+ versionId: UUID
8658
+ });
8659
+
8660
+ // ../commons/src/notification/UserNotifications.ts
8661
+ var z45 = __toESM(require("zod/v4"));
8395
8662
  var TriggerEvent = {
8396
8663
  USER_CREATED: "user-created",
8397
8664
  USER_UPDATED: "user-updated",
@@ -8404,54 +8671,54 @@ var TriggerEvent = {
8404
8671
  CHANGE_PHONE_NUMBER: "change-phone-number",
8405
8672
  CHANGE_EMAIL_ADDRESS: "change-email-address"
8406
8673
  };
8407
- var Recipient = z44.object({
8674
+ var Recipient = z45.object({
8408
8675
  name: NameFieldValue.optional(),
8409
- mobile: z44.string().optional(),
8410
- email: z44.string().optional(),
8411
- bcc: z44.array(z44.string()).optional()
8676
+ mobile: z45.string().optional(),
8677
+ email: z45.string().optional(),
8678
+ bcc: z45.array(z45.string()).optional()
8412
8679
  });
8413
- var BasePayload = z44.object({
8680
+ var BasePayload = z45.object({
8414
8681
  recipient: Recipient
8415
8682
  });
8416
8683
  var TriggerPayload = {
8417
8684
  [TriggerEvent.USER_CREATED]: BasePayload.extend({
8418
- username: z44.string(),
8419
- temporaryPassword: z44.string()
8685
+ username: z45.string(),
8686
+ temporaryPassword: z45.string()
8420
8687
  }),
8421
8688
  [TriggerEvent.USER_UPDATED]: BasePayload.extend({
8422
- oldUsername: z44.string(),
8423
- newUsername: z44.string()
8689
+ oldUsername: z45.string(),
8690
+ newUsername: z45.string()
8424
8691
  }),
8425
8692
  [TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
8426
- username: z44.string()
8693
+ username: z45.string()
8427
8694
  }),
8428
8695
  [TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
8429
- code: z44.string()
8696
+ code: z45.string()
8430
8697
  }),
8431
8698
  [TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
8432
- temporaryPassword: z44.string(),
8433
- admin: z44.object({
8434
- id: z44.string(),
8699
+ temporaryPassword: z45.string(),
8700
+ admin: z45.object({
8701
+ id: z45.string(),
8435
8702
  name: NameFieldValue,
8436
- role: z44.string()
8703
+ role: z45.string()
8437
8704
  })
8438
8705
  }),
8439
8706
  [TriggerEvent.RESEND_INVITE]: BasePayload.extend({
8440
- username: z44.string(),
8441
- temporaryPassword: z44.string()
8707
+ username: z45.string(),
8708
+ temporaryPassword: z45.string()
8442
8709
  }),
8443
8710
  [TriggerEvent.TWO_FA]: BasePayload.extend({
8444
- code: z44.string()
8711
+ code: z45.string()
8445
8712
  }),
8446
8713
  [TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
8447
- subject: z44.string(),
8448
- body: z44.string()
8714
+ subject: z45.string(),
8715
+ body: z45.string()
8449
8716
  }),
8450
8717
  [TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
8451
- code: z44.string()
8718
+ code: z45.string()
8452
8719
  }),
8453
8720
  [TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
8454
- code: z44.string()
8721
+ code: z45.string()
8455
8722
  })
8456
8723
  };
8457
8724
  async function triggerUserEventNotification({
@@ -8475,4 +8742,4 @@ function parseUserEventTrigger(event2, body) {
8475
8742
  }
8476
8743
 
8477
8744
  // src/notification/index.ts
8478
- z45.globalRegistry.clear();
8745
+ z46.globalRegistry.clear();