@opencrvs/toolkit 2.1.1-rc.52250d8 → 2.2.0-rc.3af310b

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 (141) hide show
  1. package/build.sh +2 -12
  2. package/create-countryconfig/package.json +1 -1
  3. package/dist/application-config/index.js +36 -4
  4. package/dist/authentication/index.js +14 -2
  5. package/dist/cli.js +833 -2019
  6. package/dist/commons/api/router.d.ts +1374 -71
  7. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  8. package/dist/commons/events/ActionConfig.d.ts +146 -20
  9. package/dist/commons/events/ActionDocument.d.ts +88 -0
  10. package/dist/commons/events/ActionInput.d.ts +52 -0
  11. package/dist/commons/events/ActionType.d.ts +11 -1
  12. package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
  13. package/dist/commons/events/AuditLog.d.ts +4 -0
  14. package/dist/commons/events/CountryConfigQueryInput.d.ts +192 -18
  15. package/dist/commons/events/Draft.d.ts +2 -0
  16. package/dist/commons/events/EventConfig.d.ts +36 -6
  17. package/dist/commons/events/EventDocument.d.ts +88 -0
  18. package/dist/commons/events/EventIndex.d.ts +41 -4
  19. package/dist/commons/events/EventMetadata.d.ts +23 -1
  20. package/dist/commons/events/EventStatus.d.ts +1 -0
  21. package/dist/commons/events/FieldConfig.d.ts +10 -0
  22. package/dist/commons/events/Flag.d.ts +0 -6
  23. package/dist/commons/events/WorkqueueConfig.d.ts +224 -33
  24. package/dist/commons/events/eventConfigValidation.d.ts +26 -1
  25. package/dist/commons/events/notificationFormFallback.d.ts +10 -0
  26. package/dist/commons/events/scopes.d.ts +2 -0
  27. package/dist/commons/events/state/flags.d.ts +1 -1
  28. package/dist/commons/events/state/index.d.ts +10 -2
  29. package/dist/commons/events/state/utils.d.ts +11 -1
  30. package/dist/commons/events/test.utils.d.ts +31 -1
  31. package/dist/commons/events/utils.d.ts +53 -20
  32. package/dist/conditionals/index.js +14 -2
  33. package/dist/environment/derived-variables.d.ts +6 -0
  34. package/dist/environment/derived-variables.d.ts.map +1 -1
  35. package/dist/environment/derived-variables.js +7 -0
  36. package/dist/environment/dockerhub.d.ts +15 -0
  37. package/dist/environment/dockerhub.d.ts.map +1 -0
  38. package/dist/environment/dockerhub.js +104 -0
  39. package/dist/environment/questions.d.ts +1 -1
  40. package/dist/environment/questions.d.ts.map +1 -1
  41. package/dist/environment/questions.js +4 -7
  42. package/dist/environment/setup-environment.d.ts.map +1 -1
  43. package/dist/environment/setup-environment.js +41 -2
  44. package/dist/environment/templates.d.ts.map +1 -1
  45. package/dist/events/index.js +461 -83
  46. package/dist/migrations/index.d.ts +9 -0
  47. package/dist/migrations/index.d.ts.map +1 -0
  48. package/dist/migrations/index.js +847 -0
  49. package/dist/migrations/move-declaration-to-declare-action.d.ts +38 -0
  50. package/dist/migrations/move-declaration-to-declare-action.d.ts.map +1 -0
  51. package/dist/migrations/move-declaration-to-declare-action.js +377 -0
  52. package/dist/migrations/{v2.1 → persistent}/add-translations.d.ts +7 -1
  53. package/dist/migrations/persistent/add-translations.d.ts.map +1 -0
  54. package/dist/migrations/{v2.1 → persistent}/add-translations.js +14 -12
  55. package/dist/migrations/persistent/check-upgrade-path.d.ts +36 -0
  56. package/dist/migrations/persistent/check-upgrade-path.d.ts.map +1 -0
  57. package/dist/migrations/persistent/check-upgrade-path.js +105 -0
  58. package/dist/migrations/persistent/update-toolkit-dependency.d.ts +7 -0
  59. package/dist/migrations/persistent/update-toolkit-dependency.d.ts.map +1 -0
  60. package/dist/migrations/persistent/update-toolkit-dependency.js +77 -0
  61. package/dist/migrations/read-declaration-through-helper.d.ts +39 -0
  62. package/dist/migrations/read-declaration-through-helper.d.ts.map +1 -0
  63. package/dist/migrations/read-declaration-through-helper.js +257 -0
  64. package/dist/migrations/replace-incomplete-flag.d.ts +26 -0
  65. package/dist/migrations/replace-incomplete-flag.d.ts.map +1 -0
  66. package/dist/migrations/replace-incomplete-flag.js +126 -0
  67. package/dist/notification/index.js +401 -100
  68. package/dist/scopes/index.d.ts +29 -39
  69. package/dist/scopes/index.js +14 -2
  70. package/dist/templates/charts-values/dependencies/values.yaml +1 -1
  71. package/dist/templates/charts-values/opencrvs-services/values.yaml +1 -2
  72. package/dist/templates/charts-values/traefik/values.yaml +4 -3
  73. package/opencrvs-toolkit-2.2.0-rc.3af310b.tgz +0 -0
  74. package/package.json +1 -1
  75. package/tsconfig.build.tsbuildinfo +1 -1
  76. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +0 -3
  77. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +0 -1
  78. package/dist/migrations/v2.1/add-explicit-correction-flags.js +0 -234
  79. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +0 -3
  80. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +0 -1
  81. package/dist/migrations/v2.1/add-recovery-link-notifications.js +0 -511
  82. package/dist/migrations/v2.1/add-translations.d.ts.map +0 -1
  83. package/dist/migrations/v2.1/enable-telemetry.d.ts +0 -3
  84. package/dist/migrations/v2.1/enable-telemetry.d.ts.map +0 -1
  85. package/dist/migrations/v2.1/enable-telemetry.js +0 -455
  86. package/dist/migrations/v2.1/index.d.ts +0 -6
  87. package/dist/migrations/v2.1/index.d.ts.map +0 -1
  88. package/dist/migrations/v2.1/index.js +0 -2233
  89. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +0 -14
  90. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +0 -1
  91. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.js +0 -348
  92. package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +0 -2
  93. package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +0 -1
  94. package/dist/migrations/v2.1/remove-metabase-package-installs.js +0 -161
  95. package/dist/migrations/v2.1/remove-sentry.d.ts +0 -3
  96. package/dist/migrations/v2.1/remove-sentry.d.ts.map +0 -1
  97. package/dist/migrations/v2.1/remove-sentry.js +0 -354
  98. package/dist/migrations/v2.1/remove-typings-from-dockerfile.d.ts +0 -3
  99. package/dist/migrations/v2.1/remove-typings-from-dockerfile.d.ts.map +0 -1
  100. package/dist/migrations/v2.1/remove-typings-from-dockerfile.js +0 -121
  101. package/dist/migrations/v2.1/rename-trigger-paths.d.ts +0 -3
  102. package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +0 -1
  103. package/dist/migrations/v2.1/rename-trigger-paths.js +0 -216
  104. package/dist/migrations/v2.1/template-files.d.ts +0 -8
  105. package/dist/migrations/v2.1/template-files.d.ts.map +0 -1
  106. package/dist/migrations/v2.1/template-files.js +0 -49
  107. package/dist/migrations/v2.1/upgrade-tilt.d.ts +0 -8
  108. package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +0 -1
  109. package/dist/migrations/v2.1/upgrade-tilt.js +0 -139
  110. package/dist/templates/countryconfig-template/.tiltignore +0 -1
  111. package/dist/templates/countryconfig-template/Dockerfile.assets +0 -7
  112. package/dist/templates/countryconfig-template/Tiltfile +0 -112
  113. package/dist/templates/countryconfig-template/assets/README.md +0 -1
  114. package/dist/templates/countryconfig-template/assets/clear-all-data-dev.sh +0 -61
  115. package/dist/templates/countryconfig-template/assets/deployment/deploy.sh +0 -455
  116. package/dist/templates/countryconfig-template/assets/deployment/reindex.sh +0 -168
  117. package/dist/templates/countryconfig-template/assets/deployment/validate-required-variables-in-compose-files.ts +0 -67
  118. package/dist/templates/countryconfig-template/assets/elasticsearch/reindex.sh +0 -168
  119. package/dist/templates/countryconfig-template/assets/metabase/README.md +0 -34
  120. package/dist/templates/countryconfig-template/assets/metabase/environment-configuration.sql +0 -36
  121. package/dist/templates/countryconfig-template/assets/metabase/initialize-database.sh +0 -46
  122. package/dist/templates/countryconfig-template/assets/metabase/metabase.init.db.sql +0 -27737
  123. package/dist/templates/countryconfig-template/assets/metabase/open-shell.sh +0 -21
  124. package/dist/templates/countryconfig-template/assets/metabase/package.json +0 -13
  125. package/dist/templates/countryconfig-template/assets/metabase/run-dev.sh +0 -108
  126. package/dist/templates/countryconfig-template/assets/metabase/run.sh +0 -120
  127. package/dist/templates/countryconfig-template/assets/metabase/update-database.sh +0 -40
  128. package/dist/templates/countryconfig-template/assets/postgres/setup-analytics.sh +0 -135
  129. package/dist/templates/countryconfig-template/assets/postgres/setup-reference-data.sh +0 -108
  130. package/dist/templates/countryconfig-template/tilt/clear-all-data.ps1 +0 -50
  131. package/dist/templates/countryconfig-template/tilt/clear-all-data.sh +0 -35
  132. package/dist/templates/countryconfig-template/tilt/common.tilt +0 -145
  133. package/dist/templates/countryconfig-template/tilt/examples/dependencies/values.yaml +0 -15
  134. package/dist/templates/countryconfig-template/tilt/examples/opencrvs-services/values.yaml +0 -56
  135. package/dist/templates/countryconfig-template/tilt/examples/traefik/values-minikube.yaml +0 -21
  136. package/dist/templates/countryconfig-template/tilt/examples/traefik/values.yaml +0 -38
  137. package/dist/templates/countryconfig-template/tilt/helm/dependencies/values.yaml +0 -17
  138. package/dist/templates/countryconfig-template/tilt/helm/opencrvs-services/values.yaml +0 -16
  139. package/dist/templates/countryconfig-template/tilt/lib.tilt +0 -95
  140. package/dist/templates/countryconfig-template/tilt/opencrvs.tilt +0 -136
  141. package/opencrvs-toolkit-2.1.1-rc.52250d8.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 z47 = __toESM(require("zod/v4"));
41
+ var z48 = __toESM(require("zod/v4"));
42
42
 
43
43
  // ../commons/src/events/AuditLog.ts
44
44
  var z9 = __toESM(require("zod/v4"));
@@ -83,6 +83,8 @@ var ActionType = {
83
83
  REQUEST_CORRECTION: "REQUEST_CORRECTION",
84
84
  REJECT_CORRECTION: "REJECT_CORRECTION",
85
85
  APPROVE_CORRECTION: "APPROVE_CORRECTION",
86
+ REVOKE_REGISTRATION: "REVOKE_REGISTRATION",
87
+ REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION",
86
88
  // General actions
87
89
  READ: "READ",
88
90
  ASSIGN: "ASSIGN",
@@ -102,6 +104,8 @@ var ConfirmableActions = [
102
104
  ActionType.REQUEST_CORRECTION,
103
105
  ActionType.APPROVE_CORRECTION,
104
106
  ActionType.REJECT_CORRECTION,
107
+ ActionType.REVOKE_REGISTRATION,
108
+ ActionType.REINSTATE_REGISTRATION,
105
109
  ActionType.CUSTOM
106
110
  ];
107
111
  var ActionTypes = z2.enum([
@@ -121,6 +125,8 @@ var ActionTypes = z2.enum([
121
125
  "REQUEST_CORRECTION",
122
126
  "REJECT_CORRECTION",
123
127
  "APPROVE_CORRECTION",
128
+ "REVOKE_REGISTRATION",
129
+ "REINSTATE_REGISTRATION",
124
130
  "READ",
125
131
  "ASSIGN",
126
132
  "UNASSIGN",
@@ -162,7 +168,9 @@ var WorkqueueActionType = ActionTypes.extract([
162
168
  ActionType.ARCHIVE,
163
169
  ActionType.UNARCHIVE,
164
170
  ActionType.PRINT_CERTIFICATE,
165
- ActionType.REQUEST_CORRECTION
171
+ ActionType.REQUEST_CORRECTION,
172
+ ActionType.REVOKE_REGISTRATION,
173
+ ActionType.REINSTATE_REGISTRATION
166
174
  ]);
167
175
  var META_ACTIONS = [
168
176
  ActionType.ASSIGN,
@@ -247,7 +255,6 @@ var FieldConditional = z4.discriminatedUnion("type", [
247
255
 
248
256
  // ../commons/src/events/Flag.ts
249
257
  var InherentFlags = {
250
- INCOMPLETE: "incomplete",
251
258
  REJECTED: "rejected",
252
259
  CORRECTION_REQUESTED: "correction-requested",
253
260
  POTENTIAL_DUPLICATE: "potential-duplicate",
@@ -314,6 +321,7 @@ var EventStatus = z6.enum([
314
321
  "NOTIFIED",
315
322
  "DECLARED",
316
323
  "REGISTERED",
324
+ "REVOKED",
317
325
  "ARCHIVED"
318
326
  ]);
319
327
 
@@ -337,6 +345,8 @@ var RecordScopeTypeV2 = z7.enum([
337
345
  "record.print-certified-copies",
338
346
  "record.request-correction",
339
347
  "record.correct",
348
+ "record.revoke-registration",
349
+ "record.reinstate-registration",
340
350
  "record.unassign-others",
341
351
  "record.custom-action",
342
352
  "record.action.accept",
@@ -463,6 +473,8 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
463
473
  "record.read",
464
474
  "record.request-correction",
465
475
  "record.correct",
476
+ "record.revoke-registration",
477
+ "record.reinstate-registration",
466
478
  "record.unassign-others",
467
479
  "record.review-duplicates"
468
480
  ]);
@@ -648,6 +660,8 @@ var EventActionEntrySchema = AuditLogEntryBase.extend({
648
660
  "event.actions.correction.request.request",
649
661
  "event.actions.correction.approve.request",
650
662
  "event.actions.correction.reject.request",
663
+ "event.actions.revoke_registration.request",
664
+ "event.actions.reinstate_registration.request",
651
665
  "event.actions.mark_as_duplicate.request",
652
666
  "event.actions.mark_as_not_duplicate.request"
653
667
  ]),
@@ -1391,6 +1405,16 @@ var UnarchiveAction = ActionBase.extend(
1391
1405
  type: z16.literal(ActionType.UNARCHIVE)
1392
1406
  }).shape
1393
1407
  );
1408
+ var RevokeRegistrationAction = ActionBase.extend(
1409
+ z16.object({
1410
+ type: z16.literal(ActionType.REVOKE_REGISTRATION)
1411
+ }).shape
1412
+ );
1413
+ var ReinstateRegistrationAction = ActionBase.extend(
1414
+ z16.object({
1415
+ type: z16.literal(ActionType.REINSTATE_REGISTRATION)
1416
+ }).shape
1417
+ );
1394
1418
  var CreatedAction = ActionBase.extend(
1395
1419
  z16.object({
1396
1420
  type: z16.literal(ActionType.CREATE)
@@ -1459,6 +1483,8 @@ var ActionDocument = z16.discriminatedUnion("type", [
1459
1483
  MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
1460
1484
  ArchiveAction.meta({ id: "ArchiveAction" }),
1461
1485
  UnarchiveAction.meta({ id: "UnarchiveAction" }),
1486
+ RevokeRegistrationAction.meta({ id: "RevokeRegistrationAction" }),
1487
+ ReinstateRegistrationAction.meta({ id: "ReinstateRegistrationAction" }),
1462
1488
  NotifiedAction.meta({ id: "NotifiedAction" }),
1463
1489
  RegisterAction.meta({ id: "RegisterAction" }),
1464
1490
  DeclareAction.meta({ id: "DeclareAction" }),
@@ -1507,7 +1533,8 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1507
1533
  var LegalStatuses = z17.object({
1508
1534
  [EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
1509
1535
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
1510
- [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
1536
+ [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish(),
1537
+ [EventStatus.enum.REVOKED]: ActionCreationMetadata.nullish()
1511
1538
  });
1512
1539
  var EventMetadata = z17.object({
1513
1540
  id: UUID,
@@ -1627,6 +1654,12 @@ var AnyOfStatus = import_v4.z.object({
1627
1654
  }).meta({
1628
1655
  id: "AnyOfStatus"
1629
1656
  });
1657
+ var NoneOfStatus = import_v4.z.object({
1658
+ type: import_v4.z.literal("noneOf"),
1659
+ terms: import_v4.z.array(EventStatus)
1660
+ }).meta({
1661
+ id: "NoneOfStatus"
1662
+ });
1630
1663
  var Range = import_v4.z.object({
1631
1664
  type: import_v4.z.literal("range"),
1632
1665
  gte: import_v4.z.string(),
@@ -1667,7 +1700,7 @@ var QueryInput = import_v4.z.lazy(
1667
1700
  var QueryExpression = import_v4.z.object({
1668
1701
  id: import_v4.z.optional(import_v4.z.string()),
1669
1702
  eventType: import_v4.z.string(),
1670
- status: import_v4.z.optional(import_v4.z.union([AnyOfStatus, ExactStatus])),
1703
+ status: import_v4.z.optional(import_v4.z.union([AnyOfStatus, NoneOfStatus, ExactStatus])),
1671
1704
  createdAt: import_v4.z.optional(DateCondition),
1672
1705
  updatedAt: import_v4.z.optional(DateCondition),
1673
1706
  "legalStatuses.DECLARED.createdAtLocation": import_v4.z.optional(Within).nullable(),
@@ -1676,6 +1709,7 @@ var QueryExpression = import_v4.z.object({
1676
1709
  "legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
1677
1710
  "legalStatuses.REGISTERED.createdByRole": import_v4.z.optional(AnyOf),
1678
1711
  "legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
1712
+ "legalStatuses.REVOKED.createdAtLocation": import_v4.z.optional(Within).nullable(),
1679
1713
  createdAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
1680
1714
  updatedAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
1681
1715
  assignedTo: import_v4.z.optional(Exact),
@@ -2873,6 +2907,12 @@ var ReadActionConfig = ActionConfigBase.extend(
2873
2907
  var NotifyConfig = ActionConfigBase.extend(
2874
2908
  z25.object({
2875
2909
  type: z25.literal(ActionType.NOTIFY),
2910
+ notificationForm: DeclarationFormConfig.optional().describe(
2911
+ "Notification form configuration. Its fields must be a subset of the declaration form fields, with matching types. The values submitted on the notification form pre-fill the declaration. If not defined, the declare action's declaration is used (with all fields optional)."
2912
+ ),
2913
+ review: DeclarationReviewConfig.describe(
2914
+ "Review page configuration for the notify action. Values of its fields are stored as the NOTIFY action annotation. If not defined, defineConfig generates it from the declare action's review (with all fields optional)."
2915
+ ),
2876
2916
  form: actionConfirmationForm
2877
2917
  }).shape
2878
2918
  );
@@ -2925,6 +2965,9 @@ var DeleteConfig = ActionConfigBase.extend(
2925
2965
  var DeclareConfig = DeclarationActionBase.extend(
2926
2966
  z25.object({
2927
2967
  type: z25.literal(ActionType.DECLARE),
2968
+ declaration: DeclarationFormConfig.describe(
2969
+ "Configuration of the form used to gather event data."
2970
+ ),
2928
2971
  review: DeclarationReviewConfig.describe(
2929
2972
  "Configuration of the review page fields."
2930
2973
  ),
@@ -2953,6 +2996,18 @@ var UnarchiveConfig = ActionConfigBase.extend(
2953
2996
  type: z25.literal(ActionType.UNARCHIVE)
2954
2997
  }).shape
2955
2998
  );
2999
+ var RevokeRegistrationConfig = ActionConfigBase.extend(
3000
+ z25.object({
3001
+ type: z25.literal(ActionType.REVOKE_REGISTRATION),
3002
+ form: actionConfirmationForm
3003
+ }).shape
3004
+ );
3005
+ var ReinstateRegistrationConfig = ActionConfigBase.extend(
3006
+ z25.object({
3007
+ type: z25.literal(ActionType.REINSTATE_REGISTRATION),
3008
+ form: actionConfirmationForm
3009
+ }).shape
3010
+ );
2956
3011
  var EditActionConfig = ActionConfigBase.extend(
2957
3012
  z25.object({
2958
3013
  type: z25.literal(ActionType.EDIT),
@@ -3039,11 +3094,11 @@ var ActionConfig = z25.discriminatedUnion("type", [
3039
3094
  }),
3040
3095
  NotifyConfig.meta({
3041
3096
  id: "NotifyActionConfig",
3042
- description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
3097
+ description: "Configuration for the notify action, including the notification form and its review page. When undefined, it is generated using the DeclareActionConfig."
3043
3098
  }),
3044
3099
  DeclareConfig.meta({
3045
3100
  id: "DeclareActionConfig",
3046
- description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
3101
+ description: "Configuration for the declare action. Includes the declaration form and review-page fields."
3047
3102
  }),
3048
3103
  DuplicateDetectedConfig.meta({
3049
3104
  id: "DuplicateDetectedActionConfig",
@@ -3093,6 +3148,14 @@ var ActionConfig = z25.discriminatedUnion("type", [
3093
3148
  id: "UnarchiveActionConfig",
3094
3149
  description: "Configuration for unarchiving a record."
3095
3150
  }),
3151
+ RevokeRegistrationConfig.meta({
3152
+ id: "RevokeRegistrationActionConfig",
3153
+ description: "Configuration for revoking a registered record."
3154
+ }),
3155
+ ReinstateRegistrationConfig.meta({
3156
+ id: "ReinstateRegistrationActionConfig",
3157
+ description: "Configuration for reinstating a revoked record back to registered."
3158
+ }),
3096
3159
  CustomActionConfig.meta({
3097
3160
  id: "CustomActionConfig",
3098
3161
  description: "Configuration for a country-defined custom action. An event may include any number of these."
@@ -3503,6 +3566,8 @@ var updateActions = new Set(
3503
3566
  ActionType.REQUEST_CORRECTION,
3504
3567
  ActionType.APPROVE_CORRECTION,
3505
3568
  ActionType.REJECT_CORRECTION,
3569
+ ActionType.REVOKE_REGISTRATION,
3570
+ ActionType.REINSTATE_REGISTRATION,
3506
3571
  ActionType.CUSTOM
3507
3572
  ]).options
3508
3573
  );
@@ -3516,15 +3581,6 @@ var INHERENT_FLAG_RULES = [
3516
3581
  setOn: [ActionType.REQUEST_CORRECTION],
3517
3582
  resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
3518
3583
  },
3519
- {
3520
- // INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
3521
- // other status-changing action (see getStatusFromActions). ARCHIVE/UNARCHIVE
3522
- // are deliberately excluded so the flag freezes across an archive/unarchive
3523
- // round trip and comes back exactly as it was.
3524
- flag: InherentFlags.INCOMPLETE,
3525
- setOn: [ActionType.NOTIFY],
3526
- resetOn: [ActionType.CREATE, ActionType.DECLARE, ActionType.REGISTER]
3527
- },
3528
3584
  {
3529
3585
  flag: InherentFlags.REJECTED,
3530
3586
  setOn: [ActionType.REJECT],
@@ -4320,10 +4376,49 @@ function isOnline() {
4320
4376
  return true;
4321
4377
  }
4322
4378
 
4379
+ // ../commons/src/events/notificationFormFallback.ts
4380
+ function toOptionalField(field3) {
4381
+ const { validation: _validation, ...rest } = field3;
4382
+ if (rest.type === FieldType.FIELD_GROUP && "fields" in rest) {
4383
+ return {
4384
+ ...rest,
4385
+ required: false,
4386
+ fields: rest.fields.map(toOptionalField)
4387
+ };
4388
+ }
4389
+ return { ...rest, required: false };
4390
+ }
4391
+ function generateNotifyReview(declareReview) {
4392
+ return {
4393
+ ...declareReview,
4394
+ fields: declareReview.fields.map(toOptionalField)
4395
+ };
4396
+ }
4397
+
4323
4398
  // ../commons/src/events/utils.ts
4324
4399
  var import_date_fns3 = require("date-fns");
4400
+ function getDeclaration(configuration) {
4401
+ const declareAction = configuration.actions.find(
4402
+ (action) => action.type === ActionType.DECLARE
4403
+ );
4404
+ if (!declareAction) {
4405
+ throw new Error(
4406
+ `Event '${configuration.id}' has no ${ActionType.DECLARE} action to read the declaration from`
4407
+ );
4408
+ }
4409
+ return declareAction.declaration;
4410
+ }
4411
+ function getDeclarationPages(configuration) {
4412
+ return getDeclaration(configuration).pages;
4413
+ }
4325
4414
  function getDeclarationFields(configuration) {
4326
- return configuration.declaration.pages.flatMap(({ fields }) => fields);
4415
+ return getDeclarationPages(configuration).flatMap(({ fields }) => fields);
4416
+ }
4417
+ function getConfiguredNotificationForm(configuration) {
4418
+ const notifyAction = configuration.actions.find(
4419
+ (action) => action.type === ActionType.NOTIFY
4420
+ );
4421
+ return notifyAction?.type === ActionType.NOTIFY ? notifyAction.notificationForm : void 0;
4327
4422
  }
4328
4423
  var getActionAnnotationFields = (actionConfig) => {
4329
4424
  if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
@@ -4342,6 +4437,10 @@ function getAllAnnotationFields(config) {
4342
4437
  var findAllFields = (config) => {
4343
4438
  return (0, import_lodash4.flattenDeep)([
4344
4439
  ...getDeclarationFields(config),
4440
+ // Only a configured notification form: a derived one repeats the declaration fields.
4441
+ ...getConfiguredNotificationForm(config)?.pages.flatMap(
4442
+ ({ fields }) => fields
4443
+ ) ?? [],
4345
4444
  ...getAllAnnotationFields(config)
4346
4445
  ]);
4347
4446
  };
@@ -4469,6 +4568,82 @@ function validateActionOrder(event2, ctx) {
4469
4568
  }
4470
4569
  }
4471
4570
  }
4571
+ function validateExactlyOneDeclareAction(event2, ctx) {
4572
+ const declareActionCount = event2.actions.filter(
4573
+ (action) => action.type === ActionType.DECLARE
4574
+ ).length;
4575
+ if (declareActionCount !== 1) {
4576
+ ctx.addIssue({
4577
+ code: "custom",
4578
+ message: `Event must have exactly one ${ActionType.DECLARE} action. Found ${declareActionCount} for event ${event2.id}`,
4579
+ path: ["actions"]
4580
+ });
4581
+ return false;
4582
+ }
4583
+ return true;
4584
+ }
4585
+ function validateDeclarationGivenExactlyOnce(config, ctx) {
4586
+ const declareActionIndex = config.actions.findIndex(
4587
+ (action) => action.type === ActionType.DECLARE
4588
+ );
4589
+ const declareAction = config.actions[declareActionIndex];
4590
+ const onDeclareAction = declareAction.type === ActionType.DECLARE && !!declareAction.declaration;
4591
+ const onTopLevel = !!config.declaration;
4592
+ const declareActionPath = `actions[${declareActionIndex}].declaration`;
4593
+ if (onTopLevel && onDeclareAction) {
4594
+ ctx.addIssue({
4595
+ code: "custom",
4596
+ message: `Event '${config.id}' defines \`declaration\` both at the top level and on the ${ActionType.DECLARE} action (\`${declareActionPath}\`). Define it in only one of these places.`,
4597
+ path: ["declaration"]
4598
+ });
4599
+ }
4600
+ if (!onTopLevel && !onDeclareAction) {
4601
+ ctx.addIssue({
4602
+ code: "custom",
4603
+ message: `Event '${config.id}' does not define \`declaration\`. Define it either at the top level or on the ${ActionType.DECLARE} action (\`${declareActionPath}\`).`,
4604
+ path: ["declaration"]
4605
+ });
4606
+ }
4607
+ }
4608
+ function validateNotificationForm(event2, ctx) {
4609
+ const declarationFields = getDeclarationFields(event2);
4610
+ event2.actions.forEach((action, actionIndex) => {
4611
+ if (action.type !== ActionType.NOTIFY || !action.notificationForm) {
4612
+ return;
4613
+ }
4614
+ action.notificationForm.pages.forEach((page, pageIndex) => {
4615
+ page.fields.forEach((field3, fieldIndex) => {
4616
+ const path = [
4617
+ "actions",
4618
+ actionIndex,
4619
+ "notificationForm",
4620
+ "pages",
4621
+ pageIndex,
4622
+ "fields",
4623
+ fieldIndex
4624
+ ];
4625
+ const matchingFields = declarationFields.filter(
4626
+ ({ id }) => id === field3.id
4627
+ );
4628
+ if (matchingFields.length === 0) {
4629
+ ctx.addIssue({
4630
+ code: "custom",
4631
+ message: `Notification form field '${field3.id}' does not exist in the declaration form of event '${event2.id}'. Notification form fields must also be defined in the ${ActionType.DECLARE} action's declaration.`,
4632
+ path
4633
+ });
4634
+ return;
4635
+ }
4636
+ if (!matchingFields.some(({ type }) => type === field3.type)) {
4637
+ ctx.addIssue({
4638
+ code: "custom",
4639
+ message: `Notification form field '${field3.id}' is of type ${field3.type}, but the declaration form field with the same id in event '${event2.id}' is of type ${matchingFields[0].type}.`,
4640
+ path
4641
+ });
4642
+ }
4643
+ });
4644
+ });
4645
+ });
4646
+ }
4472
4647
 
4473
4648
  // ../commons/src/events/EventConfig.ts
4474
4649
  var EventFieldReference = z35.object({ $$event: EventMetadataDateFieldIdInput }).describe(
@@ -4493,16 +4668,15 @@ var _EventConfigBase = z35.object({
4493
4668
  summary: SummaryConfig.describe(
4494
4669
  "Summary information displayed in the event overview."
4495
4670
  ),
4496
- label: TranslationConfig.describe("Human-readable label for the event type."),
4671
+ label: TranslationConfig.describe(
4672
+ "Human-readable label for the event type."
4673
+ ),
4497
4674
  actions: z35.array(ActionConfig).describe(
4498
4675
  "Configuration of core and custom actions associated with the event."
4499
4676
  ),
4500
4677
  actionOrder: z35.array(z35.string()).optional().describe(
4501
4678
  "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
4502
4679
  ),
4503
- declaration: DeclarationFormConfig.describe(
4504
- "Configuration of the form used to gather event data."
4505
- ),
4506
4680
  advancedSearch: z35.array(AdvancedSearchConfig).optional().default([]).describe(
4507
4681
  "Configuration of fields available in the advanced search feature."
4508
4682
  ),
@@ -4517,6 +4691,10 @@ var _EventConfigBase = z35.object({
4517
4691
  )
4518
4692
  });
4519
4693
  var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
4694
+ if (!validateExactlyOneDeclareAction(event2, ctx)) {
4695
+ return;
4696
+ }
4697
+ validateNotificationForm(event2, ctx);
4520
4698
  validateAdvancedSearchConfig(event2, ctx);
4521
4699
  validateDateOfEvent(event2, ctx);
4522
4700
  validatePlaceOfEvent(event2, ctx);
@@ -4779,7 +4957,7 @@ var SerializableWithin = z37.object({
4779
4957
  });
4780
4958
  var SerializedQueryExpression = z37.object({
4781
4959
  eventType: z37.string(),
4782
- status: z37.optional(z37.union([AnyOfStatus, ExactStatus])),
4960
+ status: z37.optional(z37.union([AnyOfStatus, NoneOfStatus, ExactStatus])),
4783
4961
  createdAt: z37.optional(DateCondition),
4784
4962
  updatedAt: z37.optional(DateCondition),
4785
4963
  "legalStatuses.DECLARED.createdAtLocation": z37.optional(SerializableWithin),
@@ -4788,6 +4966,7 @@ var SerializedQueryExpression = z37.object({
4788
4966
  "legalStatuses.REGISTERED.createdAtLocation": z37.optional(SerializableWithin),
4789
4967
  "legalStatuses.REGISTERED.createdByRole": z37.optional(AnyOf),
4790
4968
  "legalStatuses.REGISTERED.registrationNumber": z37.optional(Exact),
4969
+ "legalStatuses.REVOKED.createdAtLocation": z37.optional(SerializableWithin),
4791
4970
  createdAtLocation: z37.optional(
4792
4971
  z37.union([SerializableWithin, SerializableExact])
4793
4972
  ),
@@ -4999,6 +5178,16 @@ var UnarchiveActionInput = BaseActionInput.extend(
4999
5178
  type: z39.literal(ActionType.UNARCHIVE).default(ActionType.UNARCHIVE)
5000
5179
  }).shape
5001
5180
  );
5181
+ var RevokeRegistrationActionInput = BaseActionInput.extend(
5182
+ z39.object({
5183
+ type: z39.literal(ActionType.REVOKE_REGISTRATION).default(ActionType.REVOKE_REGISTRATION)
5184
+ }).shape
5185
+ );
5186
+ var ReinstateRegistrationActionInput = BaseActionInput.extend(
5187
+ z39.object({
5188
+ type: z39.literal(ActionType.REINSTATE_REGISTRATION).default(ActionType.REINSTATE_REGISTRATION)
5189
+ }).shape
5190
+ );
5002
5191
  var AssignActionInput = BaseActionInput.extend(
5003
5192
  z39.object({
5004
5193
  type: z39.literal(ActionType.ASSIGN),
@@ -5061,6 +5250,12 @@ var ActionInput = z39.discriminatedUnion("type", [
5061
5250
  }),
5062
5251
  ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
5063
5252
  UnarchiveActionInput.meta({ id: "UnarchiveActionInput" }),
5253
+ RevokeRegistrationActionInput.meta({
5254
+ id: "RevokeRegistrationActionInput"
5255
+ }),
5256
+ ReinstateRegistrationActionInput.meta({
5257
+ id: "ReinstateRegistrationActionInput"
5258
+ }),
5064
5259
  AssignActionInput.meta({ id: "AssignActionInput" }),
5065
5260
  UnassignActionInput.meta({ id: "UnassignActionInput" }),
5066
5261
  PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
@@ -5136,10 +5331,74 @@ var EventDocumentOnlyLastAction = EventDocument.extend({
5136
5331
  }).brand("EventDocumentOnlyLastAction");
5137
5332
 
5138
5333
  // ../commons/src/events/defineConfig.ts
5139
- var defineConfig = (config) => {
5140
- const input = EventConfig.parse(config);
5141
- return input;
5142
- };
5334
+ var z43 = __toESM(require("zod/v4"));
5335
+ function moveDeclarationToDeclareAction({
5336
+ declaration,
5337
+ ...config
5338
+ }) {
5339
+ if (declaration) {
5340
+ console.warn(
5341
+ `Event '${config.id}' defines \`declaration\` at the top level, which is deprecated and will be removed in a future release. Define it on the ${ActionType.DECLARE} action instead.`
5342
+ );
5343
+ }
5344
+ return {
5345
+ ...config,
5346
+ actions: config.actions.map(
5347
+ (action) => action.type === ActionType.DECLARE && declaration ? { ...action, declaration } : action
5348
+ )
5349
+ };
5350
+ }
5351
+ function generateNotificationFormFallback(config) {
5352
+ const declareAction = config.actions.find(
5353
+ (action) => action.type === ActionType.DECLARE
5354
+ );
5355
+ const notifyAction = config.actions.find(
5356
+ (action) => action.type === ActionType.NOTIFY
5357
+ );
5358
+ if (!notifyAction?.notificationForm) {
5359
+ console.warn(
5360
+ `Event '${config.id}' has no ${ActionType.NOTIFY} form. Using the ${ActionType.DECLARE} form with all fields optional. Configure \`actions[${ActionType.NOTIFY}].notificationForm\`. This fallback will be removed in a future release.`
5361
+ );
5362
+ }
5363
+ if (notifyAction?.review) {
5364
+ return config;
5365
+ }
5366
+ if (!declareAction?.declaration) {
5367
+ throw new Error(
5368
+ `Event '${config.id}' has no ${ActionType.DECLARE} form. Configure \`actions[${ActionType.DECLARE}].declaration\`.`
5369
+ );
5370
+ }
5371
+ const review = generateNotifyReview(declareAction.review);
5372
+ if (notifyAction) {
5373
+ return {
5374
+ ...config,
5375
+ actions: config.actions.map(
5376
+ (action) => action === notifyAction ? { ...notifyAction, review } : action
5377
+ )
5378
+ };
5379
+ }
5380
+ const notifyFromDeclare = {
5381
+ type: ActionType.NOTIFY,
5382
+ label: declareAction.label,
5383
+ icon: declareAction.icon,
5384
+ conditionals: declareAction.conditionals,
5385
+ flags: declareAction.flags,
5386
+ supportingCopy: declareAction.dialogCopy?.notify,
5387
+ review
5388
+ };
5389
+ return {
5390
+ ...config,
5391
+ actions: config.actions.flatMap(
5392
+ (action) => action === declareAction ? [notifyFromDeclare, action] : [action]
5393
+ )
5394
+ };
5395
+ }
5396
+ var EventConfigDefinition = z43.custom().superRefine((config, ctx) => {
5397
+ if (validateExactlyOneDeclareAction(config, ctx)) {
5398
+ validateDeclarationGivenExactlyOnce(config, ctx);
5399
+ }
5400
+ }).transform(moveDeclarationToDeclareAction).transform(generateNotificationFormFallback).pipe(EventConfig);
5401
+ var defineConfig = (config) => EventConfigDefinition.parse(config);
5143
5402
 
5144
5403
  // ../commons/src/events/test.utils.ts
5145
5404
  var import_lodash5 = require("lodash");
@@ -7125,7 +7384,24 @@ var libraryMembershipEvent = defineConfig({
7125
7384
  id: "event.library-membership.title"
7126
7385
  },
7127
7386
  summary: { fields: [] },
7128
- actions: [],
7387
+ actions: [
7388
+ {
7389
+ type: ActionType.DECLARE,
7390
+ label: {
7391
+ defaultMessage: "Declare",
7392
+ description: "This is shown as the action name anywhere the user can trigger the action from",
7393
+ id: "event.library-membership.action.declare.label"
7394
+ },
7395
+ review: {
7396
+ title: {
7397
+ defaultMessage: "Library membership application",
7398
+ description: "Title of the review page",
7399
+ id: "event.library-membership.action.declare.form.review.title"
7400
+ },
7401
+ fields: []
7402
+ }
7403
+ }
7404
+ ],
7129
7405
  declaration: libraryMembershipForm
7130
7406
  });
7131
7407
 
@@ -7571,6 +7847,22 @@ var digitalIdentityEvent = defineConfig({
7571
7847
  },
7572
7848
  summary: { fields: [] },
7573
7849
  actions: [
7850
+ {
7851
+ type: ActionType.DECLARE,
7852
+ label: {
7853
+ defaultMessage: "Declare",
7854
+ description: "This is shown as the action name anywhere the user can trigger the action from",
7855
+ id: "event.digital-identity.action.declare.label"
7856
+ },
7857
+ review: {
7858
+ title: {
7859
+ defaultMessage: "Digital identity issuance",
7860
+ description: "Title of the review page",
7861
+ id: "event.digital-identity.action.declare.form.review.title"
7862
+ },
7863
+ fields: []
7864
+ }
7865
+ },
7574
7866
  {
7575
7867
  type: ActionType.PRINT_CERTIFICATE,
7576
7868
  label: {
@@ -7585,39 +7877,39 @@ var digitalIdentityEvent = defineConfig({
7585
7877
  });
7586
7878
 
7587
7879
  // ../commons/src/events/test.utils.ts
7588
- var z44 = __toESM(require("zod/v4"));
7880
+ var z45 = __toESM(require("zod/v4"));
7589
7881
 
7590
7882
  // ../commons/src/events/locations.ts
7591
- var z43 = __toESM(require("zod/v4"));
7592
- var LocationTypeV1 = z43.enum([
7883
+ var z44 = __toESM(require("zod/v4"));
7884
+ var LocationTypeV1 = z44.enum([
7593
7885
  "ADMIN_STRUCTURE",
7594
7886
  "CRVS_OFFICE",
7595
7887
  "HEALTH_FACILITY"
7596
7888
  ]);
7597
- var LocationStatus = z43.enum(["active", "inactive"]);
7598
- var LocationVersion = z43.object({
7889
+ var LocationStatus = z44.enum(["active", "inactive"]);
7890
+ var LocationVersion = z44.object({
7599
7891
  versionId: UUID,
7600
- effectiveFrom: z43.iso.date(),
7601
- name: z43.string(),
7602
- externalId: z43.string().nullish(),
7892
+ effectiveFrom: z44.iso.date(),
7893
+ name: z44.string(),
7894
+ externalId: z44.string().nullish(),
7603
7895
  status: LocationStatus
7604
7896
  });
7605
- var AdministrativeArea = z43.object({
7897
+ var AdministrativeArea = z44.object({
7606
7898
  id: UUID,
7607
- name: z43.string(),
7608
- externalId: z43.string().nullish(),
7899
+ name: z44.string(),
7900
+ externalId: z44.string().nullish(),
7609
7901
  parentId: UUID.nullable(),
7610
7902
  status: LocationStatus,
7611
- versions: z43.array(LocationVersion)
7903
+ versions: z44.array(LocationVersion)
7612
7904
  });
7613
- var Location = z43.object({
7905
+ var Location = z44.object({
7614
7906
  id: UUID,
7615
- name: z43.string(),
7616
- externalId: z43.string().nullish(),
7907
+ name: z44.string(),
7908
+ externalId: z44.string().nullish(),
7617
7909
  administrativeAreaId: UUID.nullable(),
7618
- locationType: z43.string().nullable(),
7910
+ locationType: z44.string().nullable(),
7619
7911
  status: LocationStatus,
7620
- versions: z43.array(LocationVersion)
7912
+ versions: z44.array(LocationVersion)
7621
7913
  });
7622
7914
  var ClientAdministrativeArea = AdministrativeArea.omit({
7623
7915
  name: true,
@@ -7658,22 +7950,22 @@ function validateUniqueIds(versions, ctx) {
7658
7950
  ctx.addIssue("versions must not repeat a versionId");
7659
7951
  }
7660
7952
  }
7661
- var SeededLocationVersions = z43.array(LocationVersion).min(1).superRefine((versions, ctx) => {
7953
+ var SeededLocationVersions = z44.array(LocationVersion).min(1).superRefine((versions, ctx) => {
7662
7954
  validateAscendingDates(versions, ctx);
7663
7955
  validateUniqueIds(versions, ctx);
7664
7956
  });
7665
- var SetLocationPayload = z43.object({
7957
+ var SetLocationPayload = z44.object({
7666
7958
  id: UUID,
7667
- name: z43.string(),
7668
- externalId: z43.string().nullish(),
7959
+ name: z44.string(),
7960
+ externalId: z44.string().nullish(),
7669
7961
  administrativeAreaId: UUID.nullable(),
7670
- locationType: z43.string().nullable(),
7962
+ locationType: z44.string().nullable(),
7671
7963
  versions: SeededLocationVersions.optional()
7672
7964
  });
7673
- var SetAdministrativeAreaPayload = z43.object({
7965
+ var SetAdministrativeAreaPayload = z44.object({
7674
7966
  id: UUID,
7675
- name: z43.string(),
7676
- externalId: z43.string().nullish(),
7967
+ name: z44.string(),
7968
+ externalId: z44.string().nullish(),
7677
7969
  parentId: UUID.nullable(),
7678
7970
  versions: SeededLocationVersions.optional()
7679
7971
  });
@@ -8021,7 +8313,7 @@ var V2_DEFAULT_MOCK_CLIENT_ADMINISTRATIVE_AREAS_MAP = new Map(
8021
8313
  );
8022
8314
 
8023
8315
  // ../commons/src/events/test.utils.ts
8024
- var TestUserRole = z44.enum([
8316
+ var TestUserRole = z45.enum([
8025
8317
  "FIELD_AGENT",
8026
8318
  "LOCAL_REGISTRAR",
8027
8319
  "LOCAL_SYSTEM_ADMIN",
@@ -8051,6 +8343,8 @@ var ACTION_SCOPE_MAP = {
8051
8343
  [ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: ["record.correct"],
8052
8344
  [ActionType.REJECT_CORRECTION]: ["record.correct"],
8053
8345
  [ActionType.APPROVE_CORRECTION]: ["record.correct"],
8346
+ [ActionType.REVOKE_REGISTRATION]: ["record.revoke-registration"],
8347
+ [ActionType.REINSTATE_REGISTRATION]: ["record.reinstate-registration"],
8054
8348
  [ActionType.MARK_AS_DUPLICATE]: ["record.review-duplicates"],
8055
8349
  [ActionType.MARK_AS_NOT_DUPLICATE]: ["record.review-duplicates"],
8056
8350
  [ActionType.ARCHIVE]: ["record.archive"],
@@ -8097,7 +8391,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
8097
8391
  ActionType.APPROVE_CORRECTION,
8098
8392
  ActionType.REJECT_CORRECTION,
8099
8393
  ActionType.CUSTOM,
8100
- ClientSpecificAction.REVIEW_CORRECTION_REQUEST
8394
+ ClientSpecificAction.REVIEW_CORRECTION_REQUEST,
8395
+ ActionType.REVOKE_REGISTRATION
8396
+ ],
8397
+ [EventStatus.enum.REVOKED]: [
8398
+ ActionType.READ,
8399
+ ActionType.REINSTATE_REGISTRATION
8101
8400
  ],
8102
8401
  [EventStatus.enum.ARCHIVED]: [
8103
8402
  ActionType.READ,
@@ -8111,6 +8410,8 @@ var ACTION_FILTERS = {
8111
8410
  [ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8112
8411
  [ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8113
8412
  [ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8413
+ [ActionType.REVOKE_REGISTRATION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
8414
+ [ActionType.REINSTATE_REGISTRATION]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
8114
8415
  [ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
8115
8416
  [ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
8116
8417
  [ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
@@ -8133,55 +8434,55 @@ var REJECTED_ACTIONS = [
8133
8434
  var import_lodash7 = require("lodash");
8134
8435
 
8135
8436
  // ../commons/src/events/locationPayloads.ts
8136
- var z45 = __toESM(require("zod/v4"));
8137
- var CreateLocationPayload = z45.object({
8437
+ var z46 = __toESM(require("zod/v4"));
8438
+ var CreateLocationPayload = z46.object({
8138
8439
  id: UUID.optional(),
8139
8440
  versionId: UUID.optional(),
8140
- name: z45.string(),
8141
- externalId: z45.string().nullish(),
8441
+ name: z46.string(),
8442
+ externalId: z46.string().nullish(),
8142
8443
  administrativeAreaId: UUID.nullable(),
8143
- locationType: z45.string().nullable(),
8144
- effectiveFrom: z45.iso.date().optional(),
8444
+ locationType: z46.string().nullable(),
8445
+ effectiveFrom: z46.iso.date().optional(),
8145
8446
  status: LocationStatus.default("active")
8146
8447
  });
8147
- var UpdateLocationPayload = z45.strictObject({
8448
+ var UpdateLocationPayload = z46.strictObject({
8148
8449
  id: UUID,
8149
8450
  versionId: UUID.optional(),
8150
- name: z45.string(),
8151
- externalId: z45.string().nullish(),
8451
+ name: z46.string(),
8452
+ externalId: z46.string().nullish(),
8152
8453
  status: LocationStatus,
8153
- effectiveFrom: z45.iso.date().optional(),
8454
+ effectiveFrom: z46.iso.date().optional(),
8154
8455
  lastVersionId: UUID
8155
8456
  });
8156
- var WithdrawLocationVersionPayload = z45.object({
8457
+ var WithdrawLocationVersionPayload = z46.object({
8157
8458
  id: UUID,
8158
8459
  versionId: UUID
8159
8460
  });
8160
- var CreateAdministrativeAreaPayload = z45.object({
8461
+ var CreateAdministrativeAreaPayload = z46.object({
8161
8462
  id: UUID.optional(),
8162
8463
  versionId: UUID.optional(),
8163
- name: z45.string(),
8164
- externalId: z45.string().nullish(),
8464
+ name: z46.string(),
8465
+ externalId: z46.string().nullish(),
8165
8466
  parentId: UUID.nullable(),
8166
- effectiveFrom: z45.iso.date().optional(),
8467
+ effectiveFrom: z46.iso.date().optional(),
8167
8468
  status: LocationStatus.default("active")
8168
8469
  });
8169
- var UpdateAdministrativeAreaPayload = z45.strictObject({
8470
+ var UpdateAdministrativeAreaPayload = z46.strictObject({
8170
8471
  id: UUID,
8171
8472
  versionId: UUID.optional(),
8172
- name: z45.string(),
8173
- externalId: z45.string().nullish(),
8473
+ name: z46.string(),
8474
+ externalId: z46.string().nullish(),
8174
8475
  status: LocationStatus,
8175
- effectiveFrom: z45.iso.date().optional(),
8476
+ effectiveFrom: z46.iso.date().optional(),
8176
8477
  lastVersionId: UUID
8177
8478
  });
8178
- var WithdrawAdministrativeAreaVersionPayload = z45.object({
8479
+ var WithdrawAdministrativeAreaVersionPayload = z46.object({
8179
8480
  id: UUID,
8180
8481
  versionId: UUID
8181
8482
  });
8182
8483
 
8183
8484
  // ../commons/src/notification/UserNotifications.ts
8184
- var z46 = __toESM(require("zod/v4"));
8485
+ var z47 = __toESM(require("zod/v4"));
8185
8486
  var TriggerEvent = {
8186
8487
  USER_CREATED: "user-created",
8187
8488
  USER_UPDATED: "user-updated",
@@ -8196,60 +8497,60 @@ var TriggerEvent = {
8196
8497
  CHANGE_PHONE_NUMBER: "change-phone-number",
8197
8498
  CHANGE_EMAIL_ADDRESS: "change-email-address"
8198
8499
  };
8199
- var Recipient = z46.object({
8500
+ var Recipient = z47.object({
8200
8501
  name: NameFieldValue.optional(),
8201
- mobile: z46.string().optional(),
8202
- email: z46.string().optional(),
8203
- bcc: z46.array(z46.string()).optional()
8502
+ mobile: z47.string().optional(),
8503
+ email: z47.string().optional(),
8504
+ bcc: z47.array(z47.string()).optional()
8204
8505
  });
8205
- var BasePayload = z46.object({
8506
+ var BasePayload = z47.object({
8206
8507
  recipient: Recipient
8207
8508
  });
8208
8509
  var TriggerPayload = {
8209
8510
  [TriggerEvent.USER_CREATED]: BasePayload.extend({
8210
- username: z46.string(),
8211
- temporaryPassword: z46.string()
8511
+ username: z47.string(),
8512
+ temporaryPassword: z47.string()
8212
8513
  }),
8213
8514
  [TriggerEvent.USER_UPDATED]: BasePayload.extend({
8214
- oldUsername: z46.string(),
8215
- newUsername: z46.string()
8515
+ oldUsername: z47.string(),
8516
+ newUsername: z47.string()
8216
8517
  }),
8217
8518
  [TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
8218
- username: z46.string()
8519
+ username: z47.string()
8219
8520
  }),
8220
8521
  [TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
8221
- code: z46.string()
8522
+ code: z47.string()
8222
8523
  }),
8223
8524
  [TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
8224
- temporaryPassword: z46.string(),
8225
- admin: z46.object({
8226
- id: z46.string(),
8525
+ temporaryPassword: z47.string(),
8526
+ admin: z47.object({
8527
+ id: z47.string(),
8227
8528
  name: NameFieldValue,
8228
- role: z46.string()
8529
+ role: z47.string()
8229
8530
  })
8230
8531
  }),
8231
8532
  [TriggerEvent.PASSWORD_RESET_LINK]: BasePayload.extend({
8232
- token: z46.string()
8533
+ token: z47.string()
8233
8534
  }),
8234
8535
  [TriggerEvent.USERNAME_REMINDER_LINK]: BasePayload.extend({
8235
- token: z46.string()
8536
+ token: z47.string()
8236
8537
  }),
8237
8538
  [TriggerEvent.RESEND_INVITE]: BasePayload.extend({
8238
- username: z46.string(),
8239
- temporaryPassword: z46.string()
8539
+ username: z47.string(),
8540
+ temporaryPassword: z47.string()
8240
8541
  }),
8241
8542
  [TriggerEvent.TWO_FA]: BasePayload.extend({
8242
- code: z46.string()
8543
+ code: z47.string()
8243
8544
  }),
8244
8545
  [TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
8245
- subject: z46.string(),
8246
- body: z46.string()
8546
+ subject: z47.string(),
8547
+ body: z47.string()
8247
8548
  }),
8248
8549
  [TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
8249
- code: z46.string()
8550
+ code: z47.string()
8250
8551
  }),
8251
8552
  [TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
8252
- code: z46.string()
8553
+ code: z47.string()
8253
8554
  })
8254
8555
  };
8255
8556
  function parseUserEventTrigger(event2, body) {
@@ -8352,7 +8653,7 @@ async function triggerUserEventNotification({
8352
8653
  }
8353
8654
 
8354
8655
  // src/notification/index.ts
8355
- z47.globalRegistry.clear();
8656
+ z48.globalRegistry.clear();
8356
8657
  // Annotate the CommonJS export names for ESM import in node:
8357
8658
  0 && (module.exports = {
8358
8659
  BasePayload,