@wildo-ai/saas-models 1.1.2 → 1.1.3

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 (410) hide show
  1. package/dist/esm/applications/applications-context.schemas.d.ts +14 -10
  2. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  3. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  4. package/dist/esm/applications/applications.shared.resources-config.schemas.js +4 -3
  5. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  6. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts +0 -4
  7. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  8. package/dist/esm/billing/billing-configuration.shared.schemas.js +59 -17
  9. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  10. package/dist/esm/billing/billing-enums.shared.schemas.d.ts +77 -21
  11. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  12. package/dist/esm/billing/billing-enums.shared.schemas.js +85 -23
  13. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  14. package/dist/esm/billing/billing-types.shared.schemas.d.ts +3 -3
  15. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  16. package/dist/esm/billing/price.shared.schemas.js +7 -1
  17. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  18. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  19. package/dist/esm/billing/product-behavior-policy.shared.schemas.js +52 -11
  20. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  21. package/dist/esm/billing/product-definition.shared.schemas.d.ts +2 -2
  22. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +2 -2
  23. package/dist/esm/billing/product.shared.schemas.d.ts +2 -2
  24. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  25. package/dist/esm/billing/product.shared.schemas.js +7 -3
  26. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  27. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +1 -1
  28. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  29. package/dist/esm/billing/subscription.shared.resources-config.schemas.js +15 -1
  30. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  31. package/dist/esm/billing/usage-record.shared.schemas.d.ts +7 -3
  32. package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
  33. package/dist/esm/billing/usage-record.shared.schemas.js +22 -3
  34. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  35. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +69 -2
  36. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  37. package/dist/esm/companion/provider-discovery.shared.schemas.js +20 -1
  38. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  39. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +85 -0
  40. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -0
  41. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +157 -0
  42. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -0
  43. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +23 -0
  44. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  45. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +56 -0
  46. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  47. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +480 -20
  48. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  49. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +547 -23
  50. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  51. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  52. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +82 -3
  53. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  54. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +31 -30
  55. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
  56. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +98 -3
  57. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
  58. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts +17 -0
  59. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
  60. package/dist/esm/compliance/privacy/privacy.shared.schemas.js +27 -4
  61. package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
  62. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts +82 -29
  63. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
  64. package/dist/esm/compliance/privacy/redaction.shared.schemas.js +95 -29
  65. package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
  66. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  67. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js +12 -5
  68. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  69. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts +21 -0
  70. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
  71. package/dist/esm/config/analytics-value-moments.shared.schemas.js +20 -0
  72. package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
  73. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +7 -5
  74. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  75. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts +8 -1
  76. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
  77. package/dist/esm/config/auth-config-resolution.shared.utils.js +29 -0
  78. package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
  79. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +95 -17
  80. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  81. package/dist/esm/config/entity-identity-config.shared.schemas.js +86 -8
  82. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  83. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +12 -12
  84. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +28 -0
  85. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  86. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +28 -0
  87. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  88. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +45 -12
  89. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  90. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  91. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +103 -58
  92. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  93. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +176 -15
  94. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  95. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts +15 -3
  96. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  97. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +32 -5
  98. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  99. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +83 -7
  100. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  101. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +59 -0
  102. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -0
  103. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +61 -0
  104. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -0
  105. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts +97 -0
  106. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -0
  107. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js +41 -0
  108. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -0
  109. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +148 -2
  110. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  111. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js +56 -1
  112. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  113. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +5 -28
  114. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  115. package/dist/esm/external-providers/provider-capability.shared.schemas.js +4 -2
  116. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  117. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts +18 -8
  118. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  119. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js +9 -4
  120. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  121. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +338 -0
  122. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -0
  123. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +332 -0
  124. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -0
  125. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +178 -9
  126. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
  127. package/dist/esm/external-providers/provider-metadata.shared.schemas.js +181 -9
  128. package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
  129. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts +7 -5
  130. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  131. package/dist/esm/external-providers/provider-protocol.shared.schemas.js +7 -5
  132. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  133. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts +40 -0
  134. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -0
  135. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js +80 -0
  136. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -0
  137. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  138. package/dist/esm/features/core-feature-definitions.shared.js +7 -1
  139. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  140. package/dist/esm/features/feature-builders.shared.d.ts +32 -0
  141. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  142. package/dist/esm/features/feature-builders.shared.js +32 -0
  143. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  144. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts +14 -2
  145. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -1
  146. package/dist/esm/files/file-upload-grant.shared.schemas.js +44 -5
  147. package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -1
  148. package/dist/esm/files/files.shared.schemas.d.ts +15 -8
  149. package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
  150. package/dist/esm/files/files.shared.schemas.js +15 -8
  151. package/dist/esm/files/files.shared.schemas.js.map +1 -1
  152. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  153. package/dist/esm/flows-actors/actors.shared.schemas.js +3 -2
  154. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  155. package/dist/esm/flows-actors/agents.shared.schemas.d.ts +54 -5
  156. package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
  157. package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
  158. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts +6 -6
  159. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +0 -3
  160. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
  161. package/dist/esm/flows-actors/deliberation.shared.schemas.js +0 -5
  162. package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
  163. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +14 -0
  164. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  165. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +40 -3
  166. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  167. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +19 -0
  168. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  169. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js +33 -0
  170. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  171. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts +14 -9
  172. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
  173. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js +14 -9
  174. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  175. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  176. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js +3 -2
  177. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
  178. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  179. package/dist/esm/flows-actors/flows.shared.schemas.js +3 -2
  180. package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
  181. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts +128 -0
  182. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -0
  183. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js +142 -0
  184. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -0
  185. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts +0 -3
  186. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts.map +1 -1
  187. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js +1 -4
  188. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js.map +1 -1
  189. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts +0 -16
  190. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
  191. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js +1 -17
  192. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
  193. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts +3 -3
  194. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js +3 -3
  195. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  196. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts +2 -8
  197. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts.map +1 -1
  198. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js +4 -15
  199. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js.map +1 -1
  200. package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
  201. package/dist/esm/guidance/guidance-state.shared.utils.js +1 -0
  202. package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
  203. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +8 -0
  204. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
  205. package/dist/esm/guidance/progression-state.shared.schemas.d.ts +46 -0
  206. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  207. package/dist/esm/guidance/progression-state.shared.schemas.js +49 -0
  208. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  209. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +320 -50
  210. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  211. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +137 -36
  212. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  213. package/dist/esm/index.d.ts +9 -0
  214. package/dist/esm/index.d.ts.map +1 -1
  215. package/dist/esm/index.js +9 -0
  216. package/dist/esm/index.js.map +1 -1
  217. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +11 -2
  218. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  219. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  220. package/dist/esm/notifications/email/email-template.shared.enums.d.ts +15 -0
  221. package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
  222. package/dist/esm/notifications/email/email-template.shared.enums.js +15 -0
  223. package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
  224. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts +1 -0
  225. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  226. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +19 -0
  227. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  228. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts +30 -0
  229. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  230. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js +65 -1
  231. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  232. package/dist/esm/notifications/notification-badges.core.definitions.d.ts +6 -4
  233. package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
  234. package/dist/esm/notifications/notification-badges.core.definitions.js +6 -4
  235. package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
  236. package/dist/esm/notifications/notification-badges.schemas.d.ts +167 -5
  237. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  238. package/dist/esm/notifications/notification-badges.schemas.js +191 -6
  239. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  240. package/dist/esm/notifications/notifications.shared.schemas.d.ts +107 -0
  241. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  242. package/dist/esm/notifications/notifications.shared.schemas.js +149 -1
  243. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  244. package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
  245. package/dist/esm/organizations/organization-notifications.shared.schemas.js +22 -1
  246. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  247. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts +26 -0
  248. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
  249. package/dist/esm/organizations/organization-preferences.shared.schemas.js +25 -0
  250. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  251. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +25 -0
  252. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  253. package/dist/esm/organizations/organization-profile.shared.schemas.js +42 -17
  254. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  255. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts +3 -2
  256. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  257. package/dist/esm/organizations/organization-unit-narrowing.shared.js +9 -2
  258. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  259. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  260. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +18 -3
  261. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  262. package/dist/esm/public-runtime/index.d.ts +49 -2
  263. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  264. package/dist/esm/public-runtime/index.js +48 -1
  265. package/dist/esm/public-runtime/index.js.map +1 -1
  266. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts +6 -5
  267. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
  268. package/dist/esm/queue/jobs.shared.resources-config.schemas.js +6 -5
  269. package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
  270. package/dist/esm/queue/jobs.shared.schemas.d.ts +16 -3
  271. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  272. package/dist/esm/queue/jobs.shared.schemas.js +16 -3
  273. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  274. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts +137 -0
  275. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -0
  276. package/dist/esm/requests/manual-controllers-routes-documentation.js +1201 -0
  277. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -0
  278. package/dist/esm/requests/manual-controllers-routes-urls.d.ts +67 -0
  279. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  280. package/dist/esm/requests/manual-controllers-routes-urls.js +78 -0
  281. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  282. package/dist/esm/requests/rate-limits.shared.schemas.d.ts +11 -1
  283. package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
  284. package/dist/esm/requests/rate-limits.shared.schemas.js +11 -1
  285. package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
  286. package/dist/esm/requests/websocket.shared.schemas.d.ts +27 -4
  287. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  288. package/dist/esm/requests/websocket.shared.schemas.js +35 -0
  289. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  290. package/dist/esm/resources/resources-config.shared.factory.d.ts +1 -0
  291. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  292. package/dist/esm/resources/resources-config.shared.factory.js +105 -20
  293. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  294. package/dist/esm/resources/resources-config.shared.schemas.d.ts +254 -72
  295. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  296. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  297. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  298. package/dist/esm/resources/resources-registry.shared.core.definitions.js +97 -5
  299. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  300. package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
  301. package/dist/esm/resources/resources-relationships.shared.factory.js +15 -0
  302. package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
  303. package/dist/esm/resources/resources.shared.core.definitions.d.ts +37 -0
  304. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  305. package/dist/esm/resources/resources.shared.core.definitions.js +51 -0
  306. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  307. package/dist/esm/resources/resources.shared.schemas.d.ts +11 -2
  308. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  309. package/dist/esm/resources/resources.shared.schemas.js +34 -3
  310. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  311. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts +51 -0
  312. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -0
  313. package/dist/esm/resources/utils/field-value-disclosure.utils.js +53 -0
  314. package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -0
  315. package/dist/esm/resources/utils/resources-summary.utils.d.ts +16 -2
  316. package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
  317. package/dist/esm/resources/utils/resources-summary.utils.js +19 -5
  318. package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
  319. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  320. package/dist/esm/resources/utils/shared-persistence-collection.utils.js +11 -0
  321. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  322. package/dist/esm/runtime/domain-module.shared.definitions.d.ts +25 -0
  323. package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
  324. package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
  325. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts +1 -0
  326. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  327. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +38 -0
  328. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  329. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts +1 -0
  330. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  331. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +38 -0
  332. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  333. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +4 -11
  334. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  335. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +0 -1
  336. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  337. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +84 -5
  338. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
  339. package/dist/esm/security/authentications/authentication.shared.schemas.js +83 -3
  340. package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
  341. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts +1 -0
  342. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
  343. package/dist/esm/security/authentications/registration.shared.dto.schemas.js +11 -0
  344. package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
  345. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +15 -0
  346. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
  347. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +21 -4
  348. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  349. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts +61 -1
  350. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  351. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js +208 -6
  352. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  353. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts +37 -27
  354. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  355. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js +134 -12
  356. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  357. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +0 -6
  358. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  359. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js +17 -8
  360. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  361. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  362. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +27 -0
  363. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  364. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts +52 -7
  365. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
  366. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js +45 -8
  367. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
  368. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +31 -0
  369. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -0
  370. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js +198 -0
  371. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -0
  372. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +31 -0
  373. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -0
  374. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +191 -0
  375. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -0
  376. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +250 -0
  377. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -0
  378. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +486 -0
  379. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -0
  380. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts +4 -1
  381. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  382. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js +29 -0
  383. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  384. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts +4 -1
  385. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  386. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js +29 -0
  387. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  388. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts +6 -0
  389. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  390. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +31 -0
  391. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  392. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts +13 -0
  393. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
  394. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js +24 -3
  395. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
  396. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +4 -4
  397. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +4 -4
  398. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
  399. package/dist/esm/users/user-self.shared.resources-config.schemas.js +33 -3
  400. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  401. package/dist/esm/users/users.shared.resources-config.schemas.d.ts +17 -1
  402. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  403. package/dist/esm/users/users.shared.resources-config.schemas.js +136 -5
  404. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  405. package/dist/esm/users/users.shared.schemas.d.ts +43 -12
  406. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  407. package/dist/esm/users/users.shared.schemas.js +38 -7
  408. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  409. package/dist/tsconfig.build.tsbuildinfo +1 -1
  410. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"websocket.shared.schemas.js","sourceRoot":"","sources":["../../../../src/requests/websocket.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,wDAAwD;AACxD,gDAAgD;AAChD,wDAAwD;AAExD;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAoEX;AApED,WAAY,kBAAkB;IAC5B,mDAAmD;IACnD,+DAAyC,CAAA;IACzC,mEAA6C,CAAA;IAC7C,iEAA2C,CAAA;IAC3C,qEAA+C,CAAA;IAE/C,iFAAiF;IACjF,qEAA+C,CAAA;IAC/C,6DAAuC,CAAA;IACvC,mDAA6B,CAAA;IAC7B,6CAAuB,CAAA;IACvB,qDAA+B,CAAA;IAE/B,mEAAmE;IACnE,2DAAqC,CAAA;IACrC,2DA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CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAAgB;IACxD,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,mBAAmB,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;QAChE,sDAAsD;QACtD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,wDAAwD;AACxD,qBAAqB;AACrB,wDAAwD;AAExD;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAQ,EACR,OAAgB;IAEhB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAiF,CAAC;AAC/G,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,KAAQ,EACR,OAAgB;IAEhB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAoF,EAAE,CAAC;IAC9H,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACjD,CAAC","sourcesContent":["import { z } from 'zod';\nimport { DataMode } from '../resources/resources-config.shared.schemas';\nimport { FrontendDisplayHintsSchema } from '../notifications/notifications.shared.schemas';\nimport { ValueMomentRole, ValueMomentScope } from '../config/analytics-value-moments.shared.schemas';\nimport { OnboardingStatus } from '../config/frontend/onboarding.shared.schemas';\nimport { GuidanceFlowScope, GuidanceRenderMode } from '../guidance/guidance-flow.shared.schemas';\nimport { ProgressionScope, MilestoneRewardType } from '../guidance/milestone-definition.shared.schemas';\nimport { LifecycleStage, LifecycleScope } from '../guidance/lifecycle-state.shared.schemas';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\n\n// =====================================================\n// WebSocket Event Types (Core Framework Events)\n// =====================================================\n\n/**\n * Core WebSocket events defined by the engine.\n * Custom events use the RESOURCE_CUSTOM type with eventName field.\n */\nexport enum CoreWebSocketEvent {\n // === Room Management Events (client → server) ===\n RESOURCE_SUBSCRIBE = 'resource:subscribe',\n RESOURCE_UNSUBSCRIBE = 'resource:unsubscribe',\n RESOURCE_SUBSCRIBED = 'resource:subscribed', // Server confirmation\n RESOURCE_UNSUBSCRIBED = 'resource:unsubscribed', // Server confirmation\n\n // === Target-Based Notification Events (server → client, via identity rooms) ===\n RESOURCE_NOTIFICATION = 'resource:notification',\n USER_NOTIFICATION = 'user:notification', // Direct user notification (not tied to resource operation)\n BADGE_UPDATE = 'badge:update',\n BADGE_GET = 'badge:get',\n BADGE_GET_ALL = 'badge:get-all',\n\n // === Resource Room Events (bidirectional, via resource rooms) ===\n RESOURCE_UPDATED = 'resource:updated',\n RESOURCE_DELETED = 'resource:deleted',\n RESOURCE_EDITING_START = 'resource:editing:start',\n RESOURCE_EDITING_END = 'resource:editing:end',\n RESOURCE_EDITING_STARTED = 'resource:editing:started', // Server confirmation\n RESOURCE_EDITING_ERROR = 'resource:editing:error',\n RESOURCE_LOCKED = 'resource:locked',\n RESOURCE_UNLOCKED = 'resource:unlocked',\n RESOURCE_CUSTOM = 'resource:custom',\n RESOURCE_CUSTOM_ERROR = 'resource:custom:error',\n\n // === FlowsActors Events (bidirectional) ===\n FLOWS_ACTORS_START = 'flows-actors:start',\n FLOWS_ACTORS_STARTED = 'flows-actors:started',\n FLOWS_ACTORS_MESSAGE = 'flows-actors:message',\n FLOWS_ACTORS_APPROVAL_REQUEST = 'flows-actors:approval-request',\n FLOWS_ACTORS_APPROVAL_RESPONSE = 'flows-actors:approval-response',\n FLOWS_ACTORS_STATUS_UPDATE = 'flows-actors:status-update',\n FLOWS_ACTORS_COMPLETED = 'flows-actors:completed',\n FLOWS_ACTORS_ERROR = 'flows-actors:error',\n\n // === Billing Events (server → client, invalidation triggers) ===\n BILLING_STATUS_CHANGED = 'billing:status_changed',\n BILLING_SUBSCRIPTION_UPDATED = 'billing:subscription_updated',\n BILLING_ACCOUNT_CHANGED = 'billing:account_changed',\n BILLING_USAGE_UPDATED = 'billing:usage_updated',\n BILLING_CREDIT_POOL_UPDATED = 'billing:credit_pool_updated',\n BILLING_FEATURES_UPDATED = 'billing:features_updated',\n\n // === Analytics Events ===\n ANALYTICS_MOMENT_ACHIEVED = 'analytics:moment-achieved',\n\n // === Guidance Events ===\n GUIDANCE_STATE_CHANGED = 'guidance:state-changed',\n\n // === Progression Events ===\n MILESTONE_ACHIEVED = 'progression:milestone-achieved',\n /**\n * Emitted after a milestone-triggering operation increments a scope's\n * `operationCounts` — even when NO milestone was achieved. Lets the frontend\n * advance in-progress milestone bars live (e.g. 8/10 → 9/10) instead of only\n * on achievement or a page reload.\n */\n PROGRESSION_UPDATED = 'progression:updated',\n\n // === Lifecycle Events ===\n LIFECYCLE_STAGE_CHANGED = 'lifecycle:stage-changed',\n\n // === System Events ===\n AUTH_REFRESH = 'auth:refresh',\n ORGANIZATION_SWITCH = 'organization:switch',\n SYSTEM_TOKEN_REFRESHED = 'system:token-refreshed',\n SYSTEM_ERROR = 'system:error',\n}\n\n/**\n * Machine-readable codes attached to a Socket.IO handshake rejection.\n *\n * A rejecting server-side auth middleware calls `next(err)`; Socket.IO forwards\n * the error's `data` field verbatim to the client's `connect_error` handler as\n * `err.data`. Emitting a stable code there lets the client react to WHY the\n * handshake was rejected WITHOUT matching on the human-readable error message\n * (which is localisation- and refactor-fragile).\n *\n * `AUTHENTICATION_FAILED` specifically flags an access-token problem the client\n * can self-heal: the frontend re-runs its token-renewal handler and reconnects\n * with a fresh token. This is what keeps a backgrounded / unfocused tab's socket\n * alive across access-token expiry, when no HTTP traffic is flowing to trigger a\n * reactive refresh (background real-time jobs keep delivering instead of stalling\n * until the user refocuses the window).\n */\nexport enum CoreWebSocketConnectionErrorCode {\n AUTHENTICATION_FAILED = 'AUTHENTICATION_FAILED',\n}\n\nexport enum ResourceAction {\n CREATED = 'created',\n UPDATED = 'updated',\n DELETED = 'deleted',\n}\n\nexport const ResourceActionSchema = z.union([z.enum(ResourceAction), z.string()]);\n\nexport enum WebSocketResourceDeliveryTarget {\n RESOURCE_ROOM_SYNC = 'resource-room-sync',\n RESOURCE_ROOM_NOTIFICATION = 'resource-room-notification',\n SCOPE_ROOM_NOTIFICATION = 'scope-room-notification',\n}\n\nexport const WebSocketResourceDeliveryTargetSchema = z.enum(WebSocketResourceDeliveryTarget);\n\n/**\n * Union type for WebSocket event names (core + custom string events)\n */\nexport type WebSocketEventName = CoreWebSocketEvent | `custom:${string}`;\n\n// =====================================================\n// Common Schemas (reusable across payloads)\n// =====================================================\n\nexport const ContextResourceIdentifiersSchema = z.record(z.string(), z.string());\nexport type ContextResourceIdentifiers = z.infer<typeof ContextResourceIdentifiersSchema>;\n\nconst WebSocketTimestampInputSchema = z.union([\n z.date(),\n z.string().datetime({ offset: true }),\n]);\nconst WebSocketTimestampSchema = WebSocketTimestampInputSchema.pipe(z.coerce.date());\nconst WebSocketOptionalTimestampSchema = WebSocketTimestampSchema.optional();\n\n\n// =====================================================\n// Room Management Payloads (client → server)\n// =====================================================\n\nconst WS_ResourceSubscribePayloadBaseSchema = z.object({\n resourceType: z.string().min(1),\n contextResourceIdentifiers: ContextResourceIdentifiersSchema,\n});\n\n/** Subscribe to a specific resource room. */\nconst WS_ResourceSubscribeSinglePayloadSchema = WS_ResourceSubscribePayloadBaseSchema.extend({\n resourceId: z.string().min(1),\n scopeKey: z.undefined().optional(),\n scopeId: z.undefined().optional(),\n});\n\n/** Subscribe to a scoped collection room. */\nconst WS_ResourceSubscribeScopePayloadSchema = WS_ResourceSubscribePayloadBaseSchema.extend({\n resourceId: z.undefined().optional(),\n scopeKey: z.string().min(1),\n scopeId: z.string().min(1),\n});\n\n/** Subscribe to a resource room - either single-resource or scoped collection. */\nexport const WS_ResourceSubscribePayloadSchema = z.union([\n WS_ResourceSubscribeSinglePayloadSchema,\n WS_ResourceSubscribeScopePayloadSchema,\n]);\nexport type WS_ResourceSubscribePayload = z.infer<typeof WS_ResourceSubscribePayloadSchema>;\n\n/** Server confirmation of subscription */\nexport const WS_ResourceSubscribedPayloadSchema = z.object({\n roomName: z.string(),\n success: z.boolean(),\n error: z.string().optional(),\n /** List of user IDs currently editing this resource (only for single resource subscriptions) */\n editingUsers: z.array(z.string()).optional(),\n});\nexport type WS_ResourceSubscribedPayload = z.infer<typeof WS_ResourceSubscribedPayloadSchema>;\n\n// =====================================================\n// Notification Payloads (server → client, target-based)\n// =====================================================\n\n/**\n * Notification level enum for typed notifications\n */\nexport enum NotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n ERROR = 'error',\n}\n\nexport const NotificationLevelSchema = z.enum(NotificationLevel);\n\n/** Resource notification via identity rooms (org, role, user) */\nexport const WS_ResourceNotificationPayloadSchema = z.object({\n // Operation path fields (for EventBus matching)\n resourceType: z.string(),\n operationIdentifier: z.string(),\n operationPathKey: z.string().optional(),\n variantType: z.enum(ResourceOperationVariantType).optional(),\n isOperationDefault: z.boolean().default(false),\n isBulkOperation: z.boolean().default(false),\n variantKey: z.string().optional(),\n\n // Context for scoped matching\n contextResourceIdentifiers: ContextResourceIdentifiersSchema.optional(),\n\n // Notification data\n action: ResourceActionSchema,\n /** Explicit notification level (overrides action-based default) */\n notificationLevel: NotificationLevelSchema.optional(),\n affectedIds: z.array(z.string()),\n notificationIdentifier: z.string().optional(),\n initiatorUserId: z.string().optional(),\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n\n /**\n * Frontend display hints (only populated for FRONT_END_SUCCESS channel).\n * Contains optional celebration mode and next-step suggestion.\n * Backend passes these through without interpreting them — the frontend\n * reads them to decide rendering (toast vs overlay vs confetti, with or without CTA).\n */\n frontendDisplayHints: FrontendDisplayHintsSchema.optional(),\n});\nexport type WS_ResourceNotificationPayload = z.infer<typeof WS_ResourceNotificationPayloadSchema>;\n\n/** Badge count update */\nexport const WS_BadgeUpdatePayloadSchema = z.object({\n badgeReference: z.string(),\n badgeCount: z.number().int().min(0),\n organizationId: z.string().optional(),\n});\nexport type WS_BadgeUpdatePayload = z.infer<typeof WS_BadgeUpdatePayloadSchema>;\n\n/**\n * Display target enum for user notifications\n */\nexport enum NotificationDisplayTarget {\n TOAST = 'toast',\n CENTER = 'center',\n BOTH = 'both',\n}\n\nexport const NotificationDisplayTargetSchema = z.enum(NotificationDisplayTarget);\n\n/**\n * Direct user notification (not tied to resource operation)\n * Used for arbitrary backend-initiated notifications like:\n * - \"Your export is ready\"\n * - \"Payment received\"\n * - \"System maintenance scheduled\"\n */\nexport const WS_UserNotificationPayloadSchema = z.object({\n /** Notification level (info, success, warning, error) */\n notificationLevel: NotificationLevelSchema,\n /** i18n identifier for message lookup (FrontendNotificationCustomMessageRefs) */\n identifier: z.string().optional(),\n /** Direct message (fallback if identifier not found or not provided) */\n message: z.string().optional(),\n /** Optional notification title */\n title: z.string().optional(),\n /** Additional context data */\n data: z.record(z.string(), z.unknown()).optional(),\n /** Where to display the notification */\n displayTarget: NotificationDisplayTargetSchema.default(NotificationDisplayTarget.BOTH),\n /** Organization context (if notification is org-scoped) */\n organizationId: z.string().optional(),\n /** Timestamp */\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n});\nexport type WS_UserNotificationPayload = z.infer<typeof WS_UserNotificationPayloadSchema>;\n\n// =====================================================\n// Analytics Payloads (server → client)\n// =====================================================\n\n/** Analytics moment achievement notification */\nexport const WS_AnalyticsMomentAchievedPayloadSchema = z.object({\n momentIdentifier: z.string(),\n role: z.enum(ValueMomentRole),\n scope: z.enum(ValueMomentScope),\n scopeEntityId: z.string(),\n achievedAt: WebSocketTimestampSchema,\n triggerSource: z.enum(['frontend', 'backend'] as const),\n});\nexport type WS_AnalyticsMomentAchievedPayload = z.infer<typeof WS_AnalyticsMomentAchievedPayloadSchema>;\n\n// =====================================================\n// Guidance Event Payloads\n// =====================================================\n\n/** Guidance state changed event — pushed by backend or frontend for real-time sync */\nexport const GuidanceRealtimeStatusSchema = z.union([\n z.literal(OnboardingStatus.IN_PROGRESS),\n z.literal(OnboardingStatus.COMPLETED),\n z.literal(OnboardingStatus.DISMISSED),\n]);\n\n/** Guidance state changed event — only statuses broadcast through the realtime bridge. */\nexport const WS_GuidanceStateChangedPayloadSchema = z.object({\n flowRef: z.string(),\n status: GuidanceRealtimeStatusSchema,\n elementRef: z.string().optional(),\n triggerSource: z.enum(['frontend', 'backend'] as const),\n /** Which scope this event pertains to — determines how frontend routes state updates */\n scope: z.enum(GuidanceFlowScope),\n renderMode: z.enum(GuidanceRenderMode).optional(),\n});\nexport type WS_GuidanceStateChangedPayload = z.infer<typeof WS_GuidanceStateChangedPayloadSchema>;\n\n// =====================================================\n// Progression Event Payloads\n// =====================================================\n\n/** Milestone achieved event — pushed by backend when a milestone condition is met */\nexport const WS_MilestoneAchievedPayloadSchema = z.object({\n milestoneRef: z.string(),\n category: z.string(),\n points: z.number().int().optional(),\n /** Which scope this milestone belongs to — determines how frontend routes state updates */\n scope: z.enum(ProgressionScope),\n reward: z.object({\n type: z.enum(MilestoneRewardType),\n featureRef: z.string().optional(),\n guidanceFlowRef: z.string().optional(),\n celebrationLevel: z.enum(['low', 'medium', 'high']).optional(),\n }),\n /** Phase 5 integration: lifecycle transition triggered by this milestone */\n lifecycleTransition: z.object({\n from: z.string(),\n to: z.string(),\n }).optional(),\n /** Timestamp of achievement */\n achievedAt: WebSocketTimestampSchema,\n /** Updated total points (post-achievement) */\n totalPoints: z.number().int(),\n});\nexport type WS_MilestoneAchievedPayload = z.infer<typeof WS_MilestoneAchievedPayloadSchema>;\n\n/**\n * Progression progress event — pushed by backend after a milestone-triggering\n * operation increments the scope's `operationCounts`, regardless of whether a\n * milestone was achieved. Carries the authoritative post-increment counts so\n * the frontend can advance in-progress bars without a refetch (the backend\n * evaluation is fire-and-forget, so the frontend cannot re-read counts\n * race-free on its own).\n */\nexport const WS_ProgressionUpdatedPayloadSchema = z.object({\n /** Which scope's progression state changed. */\n scope: z.enum(ProgressionScope),\n /** Full post-increment operation-count map for the scope (`{ 'todos:create': 9 }`). */\n operationCounts: z.record(z.string(), z.number().int()),\n /** Current total points for the scope (unchanged unless a milestone also fired). */\n totalPoints: z.number().int(),\n /** When the increment was applied. */\n updatedAt: WebSocketTimestampSchema,\n});\nexport type WS_ProgressionUpdatedPayload = z.infer<typeof WS_ProgressionUpdatedPayloadSchema>;\n\n// =====================================================\n// Lifecycle Event Payloads\n// =====================================================\n\n/** Lifecycle stage changed event — pushed by backend when a lifecycle transition occurs */\nexport const WS_LifecycleStageChangedPayloadSchema = z.object({\n /** Previous stage before transition */\n previousStage: z.enum(LifecycleStage),\n /** New stage after transition */\n newStage: z.enum(LifecycleStage),\n /** Which scope this lifecycle state belongs to */\n scope: z.enum(LifecycleScope),\n /** What triggered the transition */\n trigger: z.string().optional(),\n /** When the transition occurred */\n changedAt: WebSocketTimestampSchema,\n /** Activation progress snapshot (for SIGNED_UP → ACTIVATED tracking) */\n activationCriteriaMet: z.record(z.string(), z.boolean()).optional(),\n});\nexport type WS_LifecycleStageChangedPayload = z.infer<typeof WS_LifecycleStageChangedPayloadSchema>;\n\n// =====================================================\n// CRDT Field Metadata (shared between backend + frontend)\n// =====================================================\n\n/**\n * Per-field CRDT metadata: server-authoritative timestamp + last editor.\n * `meta` is an extensibility slot for future per-field metadata (e.g. merge strategy hints,\n * conflict resolution context) without requiring a schema migration.\n */\nexport const FieldMetaEntrySchema = z.object({\n ts: z.number(),\n by: z.string(),\n meta: z.record(z.string(), z.unknown()).optional(),\n});\nexport type FieldMetaEntry = z.infer<typeof FieldMetaEntrySchema>;\n\nexport const FieldMetaMapSchema = z.record(z.string(), FieldMetaEntrySchema);\nexport type FieldMetaMap = z.infer<typeof FieldMetaMapSchema>;\n\n// =====================================================\n// Resource Room Payloads (path-independent collaboration)\n// =====================================================\n\nconst ResourceUpdateSyncActionSchema = z.union([\n z.literal(ResourceAction.CREATED),\n z.literal(ResourceAction.UPDATED),\n]);\n\nconst WS_ResourceEventCommonPayloadSchema = z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n contextResourceIdentifiers: ContextResourceIdentifiersSchema,\n affectedIds: z.array(z.string()).optional(),\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n});\n\nconst WS_ResourceUpdateNotificationPayloadCommonSchema = WS_ResourceEventCommonPayloadSchema.extend({\n affectedIds: z.array(z.string()).min(1),\n action: ResourceActionSchema,\n operationIdentifier: z.string().optional(),\n operationPathKey: z.string().optional(),\n variantType: z.enum(ResourceOperationVariantType).optional(),\n isOperationDefault: z.boolean().optional(),\n isBulkOperation: z.boolean().optional(),\n variantKey: z.string().optional(),\n initiatorUserId: z.string().optional(),\n version: z.number().optional(),\n resourceData: z.unknown().optional(),\n fieldMeta: FieldMetaMapSchema.optional(),\n // DataMode values match directly: DataMode.RAW === 'raw', etc.\n dataMode: z.enum(DataMode).optional(),\n});\n/** Notification-grade resource update event delivered to scope rooms. */\nexport const WS_ScopeRoomUpdateNotificationPayloadSchema = WS_ResourceUpdateNotificationPayloadCommonSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.SCOPE_ROOM_NOTIFICATION),\n});\nexport type WS_ScopeRoomUpdateNotificationPayload = z.infer<typeof WS_ScopeRoomUpdateNotificationPayloadSchema>;\n\n/** Notification-grade resource update event delivered to resource rooms. */\nexport const WS_ResourceRoomUpdateNotificationPayloadSchema = WS_ResourceUpdateNotificationPayloadCommonSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.RESOURCE_ROOM_NOTIFICATION),\n});\nexport type WS_ResourceRoomUpdateNotificationPayload = z.infer<typeof WS_ResourceRoomUpdateNotificationPayloadSchema>;\n\nexport const WS_ResourceUpdateNotificationPayloadSchema = z.discriminatedUnion('deliveryTarget', [\n WS_ScopeRoomUpdateNotificationPayloadSchema,\n WS_ResourceRoomUpdateNotificationPayloadSchema,\n]);\nexport type WS_ResourceUpdateNotificationPayload = z.infer<typeof WS_ResourceUpdateNotificationPayloadSchema>;\n\n/** Synchronization-grade resource update event (resource rooms, RMM replay). */\nexport const WS_ResourceSyncUpdatedPayloadSchema = WS_ResourceEventCommonPayloadSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC),\n action: ResourceUpdateSyncActionSchema,\n operationIdentifier: z.string().min(1),\n operationPathKey: z.string().optional(),\n variantType: z.enum(ResourceOperationVariantType).optional(),\n isOperationDefault: z.boolean().optional(),\n isBulkOperation: z.boolean().optional(),\n variantKey: z.string().optional(),\n initiatorUserId: z.string().optional(),\n version: z.number(),\n resourceData: z.record(z.string(), z.unknown()),\n fieldMeta: FieldMetaMapSchema.optional(),\n dataMode: z.enum(DataMode).optional(),\n});\nexport type WS_ResourceSyncUpdatedPayload = z.infer<typeof WS_ResourceSyncUpdatedPayloadSchema>;\n\n/** Update events can be either notification-grade or sync-grade, distinguished explicitly. */\nexport const WS_ResourceUpdatedPayloadSchema = z.discriminatedUnion('deliveryTarget', [\n WS_ScopeRoomUpdateNotificationPayloadSchema,\n WS_ResourceRoomUpdateNotificationPayloadSchema,\n WS_ResourceSyncUpdatedPayloadSchema,\n]);\nexport type WS_ResourceUpdatedPayload = z.infer<typeof WS_ResourceUpdatedPayloadSchema>;\n\n/** Resource deleted event for resource rooms. */\nexport const WS_ResourceDeletedPayloadSchema = WS_ResourceEventCommonPayloadSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC),\n action: z.literal(ResourceAction.DELETED),\n operationIdentifier: z.string().min(1),\n operationPathKey: z.string().optional(),\n variantType: z.enum(ResourceOperationVariantType).optional(),\n isOperationDefault: z.boolean().optional(),\n isBulkOperation: z.boolean().optional(),\n variantKey: z.string().optional(),\n initiatorUserId: z.string().optional(),\n});\nexport type WS_ResourceDeletedPayload = z.infer<typeof WS_ResourceDeletedPayloadSchema>;\n\n/** Lightweight resource-room state payload for lock/unlock style events. */\nexport const WS_ResourceRoomStatePayloadSchema = WS_ResourceEventCommonPayloadSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC),\n action: ResourceActionSchema.optional(),\n operationIdentifier: z.string().optional(),\n initiatorUserId: z.string().optional(),\n});\nexport type WS_ResourceRoomStatePayload = z.infer<typeof WS_ResourceRoomStatePayloadSchema>;\n\n/**\n * Editing start/end payload\n * - Incoming: contextResourceIdentifiers REQUIRED for UPDATE authorization\n * - Outgoing (broadcast): contextResourceIdentifiers omitted\n */\nexport const WS_ResourceEditingPayloadSchema = z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n contextResourceIdentifiers: ContextResourceIdentifiersSchema.optional(), // Required on input\n initiatorUserId: z.string().optional(),\n timestamp: WebSocketOptionalTimestampSchema,\n reason: z.enum(['manual', 'disconnect', 'timeout', 'auth_refresh', 'organization_switch']).optional(), // For editing:end\n});\nexport type WS_ResourceEditingPayload = z.infer<typeof WS_ResourceEditingPayloadSchema>;\n\n/** Editing confirmation/error */\nexport const WS_ResourceEditingResultPayloadSchema = z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n success: z.boolean(),\n error: z.string().optional(),\n});\nexport type WS_ResourceEditingResultPayload = z.infer<typeof WS_ResourceEditingResultPayloadSchema>;\n\n/**\n * Custom collaboration event\n * - Incoming: contextResourceIdentifiers REQUIRED for READ authorization\n * - Outgoing (broadcast): contextResourceIdentifiers omitted\n */\nexport const WS_ResourceCustomEventPayloadSchema = z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n eventName: z.string().min(1), // Custom event name (e.g., 'cursor:move', 'comment:add')\n data: z.unknown().optional(),\n contextResourceIdentifiers: ContextResourceIdentifiersSchema.optional(), // Required on input\n initiatorUserId: z.string().optional(),\n includeSelf: z.boolean().optional(), // Only for outgoing\n timestamp: WebSocketOptionalTimestampSchema,\n // Phase 7.1: Optional resource data for custom events with resource context\n // When included, will be validated against appropriate DTO based on dataMode.\n resourceData: z.unknown().optional(),\n // DataMode values match directly: DataMode.RAW === 'raw', etc.\n dataMode: z.enum(DataMode).optional(),\n});\nexport type WS_ResourceCustomEventPayload = z.infer<typeof WS_ResourceCustomEventPayloadSchema>;\n\n/** Error response for custom events */\nexport const WS_ResourceCustomErrorPayloadSchema = z.object({\n eventName: z.string(),\n error: z.string(),\n});\nexport type WS_ResourceCustomErrorPayload = z.infer<typeof WS_ResourceCustomErrorPayloadSchema>;\n\n// =====================================================\n// Badge Request/Response Payloads\n// =====================================================\n\n/** Badge get request (client → server) */\nexport const WS_BadgeGetRequestSchema = z.object({\n identifier: z.string(),\n scope: z.string(),\n scopeId: z.string(),\n});\n\nexport type WS_BadgeGetRequest = z.infer<typeof WS_BadgeGetRequestSchema>;\n\n/** Badge get-all request (client → server) */\nexport const WS_BadgeGetAllRequestSchema = z.object({\n scope: z.string(),\n scopeId: z.string(),\n});\nexport type WS_BadgeGetAllRequest = z.infer<typeof WS_BadgeGetAllRequestSchema>;\n\n/** Badge get-all response (server → client) */\nexport const WS_BadgeGetAllResponseSchema = z.array(z.object({\n identifier: z.string(),\n count: z.number().min(0),\n}));\nexport type WS_BadgeGetAllResponse = z.infer<typeof WS_BadgeGetAllResponseSchema>;\n\n// =====================================================\n// FlowsActors Payloads (bidirectional)\n// =====================================================\n\n/** Start a FlowActorSystem execution (client → server) */\nexport const WS_FlowsActorsStartPayloadSchema = z.object({\n systemRef: z.string().min(1),\n executionId: z.string().optional(), // Server generates if not provided\n contextResourceIdentifiers: ContextResourceIdentifiersSchema,\n initialInput: z.record(z.string(), z.unknown()).optional(),\n});\nexport type WS_FlowsActorsStartPayload = z.infer<typeof WS_FlowsActorsStartPayloadSchema>;\n\n/** Confirmation of FlowActorSystem start (server → client) */\nexport const WS_FlowsActorsStartedPayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n success: z.boolean(),\n error: z.string().optional(),\n});\nexport type WS_FlowsActorsStartedPayload = z.infer<typeof WS_FlowsActorsStartedPayloadSchema>;\n\n/** Message from agent/flow (server → client) */\nexport const WS_FlowsActorsMessagePayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n messageType: z.enum(['text', 'markdown', 'progress', 'data']),\n content: z.string(),\n data: z.record(z.string(), z.unknown()).optional(),\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n\n /**\n * Correlates streamed token deltas to a single logical message. When present,\n * consecutive `messageId`-sharing events belong to the same assistant turn:\n * non-final events (`isFinal !== true`) carry an incremental delta to APPEND to\n * that message's content; the final event (`isFinal === true`) carries the FULL\n * assembled content as the authoritative value. When absent, the event is a\n * standalone message (legacy/one-shot behavior — append a new entry).\n */\n messageId: z.string().optional(),\n /** True on the terminal event of a streamed message (`content` is the full text). */\n isFinal: z.boolean().optional(),\n});\nexport type WS_FlowsActorsMessagePayload = z.infer<typeof WS_FlowsActorsMessagePayloadSchema>;\n\n/** Human approval request (server → client) */\nexport const WS_FlowsActorsApprovalRequestPayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n approvalId: z.string(),\n actionDescription: z.string(),\n riskLevel: z.enum(['low', 'medium', 'high', 'critical']),\n requiredRoles: z.array(z.string()).optional(),\n expiresAt: WebSocketOptionalTimestampSchema,\n});\n\nexport type WS_FlowsActorsApprovalRequestPayload = z.infer<typeof WS_FlowsActorsApprovalRequestPayloadSchema>;\n\n/** Human approval response (client → server) */\nexport const WS_FlowsActorsApprovalResponsePayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n approvalId: z.string(),\n approved: z.boolean(),\n comment: z.string().optional(),\n /**\n * The agent instance the paused conversation belongs to — ECHOED from the approval REQUEST.\n *\n * A conversation is isolated by owner FK, machine credential AND agent instance, so a resume that\n * omits this axis is filtered against the DEFAULT instance sentinel. An approval raised on a NAMED\n * A2A agent instance therefore matched no row and the decision was dropped silently — logged as\n * \"no pending approval matches\" and returned, with the turn left paused forever.\n *\n * Optional because the in-app conversational plane runs on the default instance and has nothing to\n * echo; absent means default, which is the value those executions were written with.\n */\n resourceServerInstanceRef: z.string().optional(),\n});\nexport type WS_FlowsActorsApprovalResponsePayload = z.infer<typeof WS_FlowsActorsApprovalResponsePayloadSchema>;\n\n/** Status update during execution (server → client) */\nexport const WS_FlowsActorsStatusUpdatePayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n status: z.string(),\n progress: z.number().min(0).max(100).optional(),\n currentStep: z.string().optional(),\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n});\nexport type WS_FlowsActorsStatusUpdatePayload = z.infer<typeof WS_FlowsActorsStatusUpdatePayloadSchema>;\n\n/** Execution completed (server → client) */\nexport const WS_FlowsActorsCompletedPayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n success: z.boolean(),\n result: z.record(z.string(), z.unknown()).optional(),\n duration: z.number().optional(), // in ms\n});\nexport type WS_FlowsActorsCompletedPayload = z.infer<typeof WS_FlowsActorsCompletedPayloadSchema>;\n\n/** Execution error (server → client) */\nexport const WS_FlowsActorsErrorPayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n errorCode: z.string(),\n errorMessage: z.string(),\n recoverable: z.boolean().default(false),\n});\nexport type WS_FlowsActorsErrorPayload = z.infer<typeof WS_FlowsActorsErrorPayloadSchema>;\n\n// =====================================================\n// System Payloads\n// =====================================================\n\nexport const WS_AuthRefreshPayloadSchema = z.object({\n token: z.string(),\n});\nexport type WS_AuthRefreshPayload = z.infer<typeof WS_AuthRefreshPayloadSchema>;\n\nexport const WS_SystemTokenRefreshedPayloadSchema = z.object({\n success: z.literal(true),\n});\nexport type WS_SystemTokenRefreshedPayload = z.infer<typeof WS_SystemTokenRefreshedPayloadSchema>;\n\nexport const WS_OrganizationSwitchPayloadSchema = z.object({\n organizationId: z.string(),\n previousOrganizationId: z.string().optional(),\n});\nexport type WS_OrganizationSwitchPayload = z.infer<typeof WS_OrganizationSwitchPayloadSchema>;\n\nexport const WS_SystemErrorPayloadSchema = z.object({\n code: z.string(),\n message: z.string(),\n details: z.unknown().optional(),\n});\nexport type WS_SystemErrorPayload = z.infer<typeof WS_SystemErrorPayloadSchema>;\n\n// =====================================================\n// Billing Payloads (server → client, invalidation triggers)\n// =====================================================\n\nexport const WS_BillingEventPayloadSchema = z.object({\n scopeType: z.enum(ResourcePrimaryScope),\n scopeEntityId: z.string(),\n billingAccountId: z.string(),\n});\n export type WS_BillingEventPayload = z.infer<typeof WS_BillingEventPayloadSchema>;\n\n// =====================================================\n// Event-to-Schema Map (for validation)\n// =====================================================\n\nexport const WebSocketEventSchemas = {\n // Room management\n [CoreWebSocketEvent.RESOURCE_SUBSCRIBE]: WS_ResourceSubscribePayloadSchema,\n [CoreWebSocketEvent.RESOURCE_UNSUBSCRIBE]: WS_ResourceSubscribePayloadSchema,\n [CoreWebSocketEvent.RESOURCE_SUBSCRIBED]: WS_ResourceSubscribedPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_UNSUBSCRIBED]: WS_ResourceSubscribedPayloadSchema,\n\n // Notifications\n [CoreWebSocketEvent.RESOURCE_NOTIFICATION]: WS_ResourceNotificationPayloadSchema,\n [CoreWebSocketEvent.USER_NOTIFICATION]: WS_UserNotificationPayloadSchema,\n [CoreWebSocketEvent.BADGE_UPDATE]: WS_BadgeUpdatePayloadSchema,\n [CoreWebSocketEvent.BADGE_GET]: WS_BadgeGetRequestSchema,\n [CoreWebSocketEvent.BADGE_GET_ALL]: WS_BadgeGetAllRequestSchema,\n\n // Resource room events\n [CoreWebSocketEvent.RESOURCE_UPDATED]: WS_ResourceUpdatedPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_DELETED]: WS_ResourceDeletedPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_EDITING_START]: WS_ResourceEditingPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_EDITING_END]: WS_ResourceEditingPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_EDITING_STARTED]: WS_ResourceEditingResultPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_EDITING_ERROR]: WS_ResourceEditingResultPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_LOCKED]: WS_ResourceRoomStatePayloadSchema,\n [CoreWebSocketEvent.RESOURCE_UNLOCKED]: WS_ResourceRoomStatePayloadSchema,\n [CoreWebSocketEvent.RESOURCE_CUSTOM]: WS_ResourceCustomEventPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_CUSTOM_ERROR]: WS_ResourceCustomErrorPayloadSchema,\n\n // FlowsActors\n [CoreWebSocketEvent.FLOWS_ACTORS_START]: WS_FlowsActorsStartPayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_STARTED]: WS_FlowsActorsStartedPayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_MESSAGE]: WS_FlowsActorsMessagePayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_REQUEST]: WS_FlowsActorsApprovalRequestPayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_RESPONSE]: WS_FlowsActorsApprovalResponsePayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_STATUS_UPDATE]: WS_FlowsActorsStatusUpdatePayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_COMPLETED]: WS_FlowsActorsCompletedPayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_ERROR]: WS_FlowsActorsErrorPayloadSchema,\n\n // Billing\n [CoreWebSocketEvent.BILLING_STATUS_CHANGED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_SUBSCRIPTION_UPDATED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_ACCOUNT_CHANGED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_USAGE_UPDATED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_CREDIT_POOL_UPDATED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_FEATURES_UPDATED]: WS_BillingEventPayloadSchema,\n\n // Analytics\n [CoreWebSocketEvent.ANALYTICS_MOMENT_ACHIEVED]: WS_AnalyticsMomentAchievedPayloadSchema,\n\n // Guidance\n [CoreWebSocketEvent.GUIDANCE_STATE_CHANGED]: WS_GuidanceStateChangedPayloadSchema,\n\n // Progression\n [CoreWebSocketEvent.MILESTONE_ACHIEVED]: WS_MilestoneAchievedPayloadSchema,\n [CoreWebSocketEvent.PROGRESSION_UPDATED]: WS_ProgressionUpdatedPayloadSchema,\n\n // Lifecycle\n [CoreWebSocketEvent.LIFECYCLE_STAGE_CHANGED]: WS_LifecycleStageChangedPayloadSchema,\n\n // System\n [CoreWebSocketEvent.AUTH_REFRESH]: WS_AuthRefreshPayloadSchema,\n [CoreWebSocketEvent.ORGANIZATION_SWITCH]: WS_OrganizationSwitchPayloadSchema,\n [CoreWebSocketEvent.SYSTEM_TOKEN_REFRESHED]: WS_SystemTokenRefreshedPayloadSchema,\n [CoreWebSocketEvent.SYSTEM_ERROR]: WS_SystemErrorPayloadSchema,\n} as const;\n\n// =====================================================\n// Typed Payload Map (for TypeScript inference)\n// =====================================================\n\nexport type WebSocketEventPayloads = {\n [CoreWebSocketEvent.RESOURCE_SUBSCRIBE]: WS_ResourceSubscribePayload;\n [CoreWebSocketEvent.RESOURCE_UNSUBSCRIBE]: WS_ResourceSubscribePayload;\n [CoreWebSocketEvent.RESOURCE_SUBSCRIBED]: WS_ResourceSubscribedPayload;\n [CoreWebSocketEvent.RESOURCE_UNSUBSCRIBED]: WS_ResourceSubscribedPayload;\n\n [CoreWebSocketEvent.RESOURCE_NOTIFICATION]: WS_ResourceNotificationPayload;\n [CoreWebSocketEvent.USER_NOTIFICATION]: WS_UserNotificationPayload;\n [CoreWebSocketEvent.BADGE_UPDATE]: WS_BadgeUpdatePayload;\n [CoreWebSocketEvent.BADGE_GET]: WS_BadgeGetRequest;\n [CoreWebSocketEvent.BADGE_GET_ALL]: WS_BadgeGetAllRequest;\n\n [CoreWebSocketEvent.RESOURCE_UPDATED]: WS_ResourceUpdatedPayload;\n [CoreWebSocketEvent.RESOURCE_DELETED]: WS_ResourceDeletedPayload;\n [CoreWebSocketEvent.RESOURCE_EDITING_START]: WS_ResourceEditingPayload;\n [CoreWebSocketEvent.RESOURCE_EDITING_END]: WS_ResourceEditingPayload;\n [CoreWebSocketEvent.RESOURCE_EDITING_STARTED]: WS_ResourceEditingResultPayload;\n [CoreWebSocketEvent.RESOURCE_EDITING_ERROR]: WS_ResourceEditingResultPayload;\n [CoreWebSocketEvent.RESOURCE_LOCKED]: WS_ResourceRoomStatePayload;\n [CoreWebSocketEvent.RESOURCE_UNLOCKED]: WS_ResourceRoomStatePayload;\n [CoreWebSocketEvent.RESOURCE_CUSTOM]: WS_ResourceCustomEventPayload;\n [CoreWebSocketEvent.RESOURCE_CUSTOM_ERROR]: WS_ResourceCustomErrorPayload;\n\n [CoreWebSocketEvent.FLOWS_ACTORS_START]: WS_FlowsActorsStartPayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_STARTED]: WS_FlowsActorsStartedPayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_MESSAGE]: WS_FlowsActorsMessagePayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_REQUEST]: WS_FlowsActorsApprovalRequestPayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_RESPONSE]: WS_FlowsActorsApprovalResponsePayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_STATUS_UPDATE]: WS_FlowsActorsStatusUpdatePayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_COMPLETED]: WS_FlowsActorsCompletedPayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_ERROR]: WS_FlowsActorsErrorPayload;\n\n [CoreWebSocketEvent.BILLING_STATUS_CHANGED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_SUBSCRIPTION_UPDATED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_ACCOUNT_CHANGED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_USAGE_UPDATED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_CREDIT_POOL_UPDATED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_FEATURES_UPDATED]: WS_BillingEventPayload;\n\n [CoreWebSocketEvent.ANALYTICS_MOMENT_ACHIEVED]: WS_AnalyticsMomentAchievedPayload;\n\n [CoreWebSocketEvent.GUIDANCE_STATE_CHANGED]: WS_GuidanceStateChangedPayload;\n\n [CoreWebSocketEvent.MILESTONE_ACHIEVED]: WS_MilestoneAchievedPayload;\n [CoreWebSocketEvent.PROGRESSION_UPDATED]: WS_ProgressionUpdatedPayload;\n\n [CoreWebSocketEvent.LIFECYCLE_STAGE_CHANGED]: WS_LifecycleStageChangedPayload;\n\n [CoreWebSocketEvent.AUTH_REFRESH]: WS_AuthRefreshPayload;\n [CoreWebSocketEvent.ORGANIZATION_SWITCH]: WS_OrganizationSwitchPayload;\n [CoreWebSocketEvent.SYSTEM_TOKEN_REFRESHED]: WS_SystemTokenRefreshedPayload;\n [CoreWebSocketEvent.SYSTEM_ERROR]: WS_SystemErrorPayload;\n};\n\n// =====================================================\n// Room Naming Utilities\n// =====================================================\n\n/**\n * WebSocket room name prefixes for different room types.\n * These prefixes are used to create room names for Socket.IO.\n */\nexport enum WebSocketRoomPrefix {\n /** User-specific room: user:{userId} */\n USER = 'user',\n /** Organization room: org:{organizationId} */\n ORGANIZATION = 'org',\n /** Organization role room: org:{organizationId}:role:{role} */\n ORGANIZATION_ROLE = 'role',\n /** Application-level role room: app:role:{role} */\n APP_ROLE = 'app:role',\n /** Resource room: resource:{resourceType}:{resourceId} */\n RESOURCE = 'resource',\n /** Public room for unauthenticated users */\n PUBLIC = 'public',\n}\n\n/**\n * Build a user room name\n */\nexport function buildUserRoomName(userId: string): string {\n return `${WebSocketRoomPrefix.USER}:${userId}`;\n}\n\n/**\n * Build an organization room name\n */\nexport function buildOrganizationRoomName(organizationId: string): string {\n return `${WebSocketRoomPrefix.ORGANIZATION}:${organizationId}`;\n}\n\n/**\n * Build an organization role room name\n */\nexport function buildOrganizationRoleRoomName(organizationId: string, role: string): string {\n return `${WebSocketRoomPrefix.ORGANIZATION}:${organizationId}:${WebSocketRoomPrefix.ORGANIZATION_ROLE}:${role}`;\n}\n\n/**\n * Build an application-level role room name\n */\nexport function buildAppRoleRoomName(role: string): string {\n return `${WebSocketRoomPrefix.APP_ROLE}:${role}`;\n}\n\n/**\n * Build a resource room name\n */\nexport function buildResourceRoomName(resourceType: string, resourceId: string): string {\n return `${WebSocketRoomPrefix.RESOURCE}:${resourceType}:${resourceId}`;\n}\n\n/**\n * Build a scope room name for collection subscriptions\n */\nexport function buildScopeRoomName(resourceType: string, scopeKey: string, scopeId: string): string {\n return `${WebSocketRoomPrefix.RESOURCE}:${resourceType}:${scopeKey}:${scopeId}`;\n}\n\n/**\n * The scope keys a resource room can be qualified by that the FRAMEWORK owns.\n *\n * Closed, and named because each member carries a different meaning that a bare string cannot: `app`\n * scopes a resource to the whole application, `user` to one principal's own rows, `org` to a tenant.\n * A resource can additionally be scoped by a PARENT RESOURCE, and those keys are genuinely open —\n * they are derived from the application's own resource names — so they stay strings.\n */\nexport enum ResourceScopeRoomKey {\n /**\n * The whole application.\n *\n * **`'app'`, while the APPLICATION resource's field identifier is `applicationId`** — and that\n * mismatch is load-bearing rather than sloppy, so it is stated here instead of being \"tidied\".\n *\n * `mapScopeKeyToResourceType` on the server resolves a scope key by searching the registry for a\n * resource whose field identifier is `<scopeKey>Id`. Renaming this member to `'application'` would\n * make that search succeed and route APPLICATION scope through the generic PARENT-scope branch,\n * which authorizes READ on the `applications` row — a row `ORG_MEMBER` may read, while ten of the\n * eleven APPLICATION-scoped resource configs require `APP_ADMIN_SUPER_ADMIN`. The rename would\n * therefore hand every org member notification streams naming rows of SSO connections, SIEM\n * configuration and webhook configs (issue #247).\n *\n * APPLICATION scope has its own branch in `verifyScopeAccess` that authorizes the SUBSCRIBED\n * resource instead, because a single constant discriminates nothing and so cannot stand in for\n * authorization the way a tenant or a parent row does.\n */\n APPLICATION = 'app',\n /** One principal's own rows. */\n USER = 'user',\n /** One tenant. */\n ORGANIZATION = 'org',\n}\n\n/** One scope a resource room can be qualified by. */\nexport interface ResourceScopeRoomQualifier {\n readonly scopeKey: string;\n readonly scopeId: string;\n}\n\n/**\n * Which scope rooms a resource operation's rows belong to.\n *\n * ## Why this lives in the SHARED models rather than on the backend\n *\n * Both ends need the same answer and for opposite reasons: the backend emits a list/cache-refresh\n * notification INTO these rooms after a mutation, and a client that caches a read has to be IN them\n * to hear it. Two implementations of one rule would agree only until one side gained a case — the\n * shape this repository refuses everywhere else — and the failure would be silent, because a client\n * subscribed to the wrong room does not error, it simply never hears that its cache is stale.\n *\n * Ported verbatim from the notifications dispatcher, quirks included, because moving code must not\n * change which rooms are emitted to. Two of those quirks are worth naming so the next reader does not\n * \"fix\" them into a behaviour change:\n *\n * - the parent-scope branch tests `key.endsWith('Id') && !key.includes('Parent')` with a CAPITAL P,\n * so `myParentId` is excluded while `parentTodoListId` is not;\n * - `organizationId` enters that branch and is then skipped by the inner test, having already been\n * pushed above.\n */\nexport function deriveResourceScopeRoomQualifiers(\n contextResourceIdentifiers: Record<string, string>,\n primaryScope: ResourcePrimaryScope,\n): ResourceScopeRoomQualifier[] {\n const scopes: ResourceScopeRoomQualifier[] = [];\n const seenScopes = new Set<string>();\n const pushScope = (scopeKey: string, scopeId: string | undefined): void => {\n if (!scopeId) {\n return;\n }\n const dedupeKey = `${scopeKey}:${scopeId}`;\n if (seenScopes.has(dedupeKey)) {\n return;\n }\n seenScopes.add(dedupeKey);\n scopes.push({ scopeKey, scopeId });\n };\n\n if (primaryScope === ResourcePrimaryScope.APPLICATION && contextResourceIdentifiers.applicationId) {\n pushScope(ResourceScopeRoomKey.APPLICATION, contextResourceIdentifiers.applicationId);\n }\n\n if (primaryScope === ResourcePrimaryScope.USER_SELF && contextResourceIdentifiers.userId) {\n pushScope(ResourceScopeRoomKey.USER, contextResourceIdentifiers.userId);\n }\n\n if (contextResourceIdentifiers.organizationId) {\n pushScope(ResourceScopeRoomKey.ORGANIZATION, contextResourceIdentifiers.organizationId);\n }\n\n for (const [key, value] of Object.entries(contextResourceIdentifiers)) {\n if (key === 'organizationId' || (key.endsWith('Id') && !key.includes('Parent'))) {\n const scopeKey = key.replace(/Id$/, '').toLowerCase();\n /*\n * `organization` and `application` are SKIPPED because the dedicated branches above already\n * emitted their rooms under the keys the server actually knows — `org` and `app`.\n *\n * Stripping `Id` yields the FIELD's name, not the room's: `applicationId` becomes\n * `application`, and `ResourceScopeRoomKey.APPLICATION` is `'app'`. That divergence is\n * deliberate and documented on the enum, so the generic loop cannot be allowed to invent the\n * long form beside the short one.\n *\n * It was inert for as long as no caller put an `applicationId` into this map. The moment one\n * did (issue #283, so a client could name its own APPLICATION room), every such read claimed a\n * FIFTH room the server refuses — measured live:\n * `resource:workbenchDomainResources:application:… -> success: false`. A refused room is not\n * merely wasted: the read cache's `covers()` requires EVERY room confirmed, so one permanently\n * unconfirmable room disabled the cache outright for every APPLICATION-scoped resource.\n */\n if (scopeKey !== 'organization' && scopeKey !== 'application' && value) {\n pushScope(scopeKey, value);\n }\n }\n }\n\n return scopes;\n}\n\n/**\n * Parse a resource room name into its components\n */\nexport function parseResourceRoomName(roomName: string): {\n resourceType: string;\n resourceId?: string;\n scopeKey?: string;\n scopeId?: string;\n} | null {\n const parts = roomName.split(':');\n if (parts.length < 3 || parts[0] !== WebSocketRoomPrefix.RESOURCE) return null;\n\n if (parts.length === 3) {\n return { resourceType: parts[1], resourceId: parts[2] };\n } else if (parts.length === 4) {\n return { resourceType: parts[1], scopeKey: parts[2], scopeId: parts[3] };\n }\n return null;\n}\n\n/**\n * Extract organization ID from an organization room name\n */\nexport function parseOrganizationRoomName(roomName: string): string | null {\n if (roomName.startsWith(`${WebSocketRoomPrefix.ORGANIZATION}:`)) {\n // Handle both org:{orgId} and org:{orgId}:role:{role}\n const parts = roomName.split(':');\n return parts[1] || null;\n }\n return null;\n}\n\n// =====================================================\n// Validation Helpers\n// =====================================================\n\n/**\n * Validate an incoming WebSocket event payload\n */\nexport function validateWebSocketPayload<E extends keyof typeof WebSocketEventSchemas>(\n event: E,\n payload: unknown\n): E extends keyof WebSocketEventPayloads ? WebSocketEventPayloads[E] : unknown {\n const schema = WebSocketEventSchemas[event];\n return schema.parse(payload) as E extends keyof WebSocketEventPayloads ? WebSocketEventPayloads[E] : unknown;\n}\n\n/**\n * Safe validation (returns result instead of throwing)\n */\nexport function safeValidateWebSocketPayload<E extends keyof typeof WebSocketEventSchemas>(\n event: E,\n payload: unknown\n): { success: true; data: E extends keyof WebSocketEventPayloads ? WebSocketEventPayloads[E] : unknown } | { success: false; error: z.ZodError } {\n const schema = WebSocketEventSchemas[event];\n const result = schema.safeParse(payload);\n if (result.success) {\n return { success: true, data: result.data as E extends keyof WebSocketEventPayloads ? WebSocketEventPayloads[E] : unknown };\n }\n return { success: false, error: result.error };\n}\n"]}
1
+ {"version":3,"file":"websocket.shared.schemas.js","sourceRoot":"","sources":["../../../../src/requests/websocket.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACh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AAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAAgB;IACxD,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,mBAAmB,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;QAChE,sDAAsD;QACtD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,wDAAwD;AACxD,qBAAqB;AACrB,wDAAwD;AAExD;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAQ,EACR,OAAgB;IAEhB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAiF,CAAC;AAC/G,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,KAAQ,EACR,OAAgB;IAEhB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAoF,EAAE,CAAC;IAC9H,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACjD,CAAC","sourcesContent":["import { z } from 'zod';\nimport { DataMode } from '../resources/resources-config.shared.schemas';\nimport { FrontendDisplayHintsSchema } from '../notifications/notifications.shared.schemas';\nimport { ValueMomentRole, ValueMomentScope } from '../config/analytics-value-moments.shared.schemas';\nimport { OnboardingStatus } from '../config/frontend/onboarding.shared.schemas';\nimport { GuidanceFlowScope, GuidanceRenderMode } from '../guidance/guidance-flow.shared.schemas';\nimport { ProgressionScope, MilestoneRewardType } from '../guidance/milestone-definition.shared.schemas';\nimport { LifecycleStage, LifecycleScope } from '../guidance/lifecycle-state.shared.schemas';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\n\n// =====================================================\n// WebSocket Event Types (Core Framework Events)\n// =====================================================\n\n/**\n * Core WebSocket events defined by the engine.\n * Custom events use the RESOURCE_CUSTOM type with eventName field.\n */\nexport enum CoreWebSocketEvent {\n // === Room Management Events (client → server) ===\n RESOURCE_SUBSCRIBE = 'resource:subscribe',\n RESOURCE_UNSUBSCRIBE = 'resource:unsubscribe',\n RESOURCE_SUBSCRIBED = 'resource:subscribed', // Server confirmation\n RESOURCE_UNSUBSCRIBED = 'resource:unsubscribed', // Server confirmation\n\n // === Target-Based Notification Events (server → client, via identity rooms) ===\n RESOURCE_NOTIFICATION = 'resource:notification',\n USER_NOTIFICATION = 'user:notification', // Direct user notification (not tied to resource operation)\n BADGE_UPDATE = 'badge:update',\n BADGE_GET = 'badge:get',\n BADGE_GET_ALL = 'badge:get-all',\n\n // === Resource Room Events (bidirectional, via resource rooms) ===\n RESOURCE_UPDATED = 'resource:updated',\n RESOURCE_DELETED = 'resource:deleted',\n RESOURCE_EDITING_START = 'resource:editing:start',\n RESOURCE_EDITING_END = 'resource:editing:end',\n RESOURCE_EDITING_STARTED = 'resource:editing:started', // Server confirmation\n RESOURCE_EDITING_ERROR = 'resource:editing:error',\n RESOURCE_LOCKED = 'resource:locked',\n RESOURCE_UNLOCKED = 'resource:unlocked',\n RESOURCE_CUSTOM = 'resource:custom',\n RESOURCE_CUSTOM_ERROR = 'resource:custom:error',\n\n // === FlowsActors Events (bidirectional) ===\n FLOWS_ACTORS_START = 'flows-actors:start',\n FLOWS_ACTORS_STARTED = 'flows-actors:started',\n FLOWS_ACTORS_MESSAGE = 'flows-actors:message',\n FLOWS_ACTORS_APPROVAL_REQUEST = 'flows-actors:approval-request',\n FLOWS_ACTORS_APPROVAL_RESPONSE = 'flows-actors:approval-response',\n FLOWS_ACTORS_STATUS_UPDATE = 'flows-actors:status-update',\n FLOWS_ACTORS_COMPLETED = 'flows-actors:completed',\n FLOWS_ACTORS_ERROR = 'flows-actors:error',\n\n // === Billing Events (server → client, invalidation triggers) ===\n BILLING_STATUS_CHANGED = 'billing:status_changed',\n BILLING_SUBSCRIPTION_UPDATED = 'billing:subscription_updated',\n BILLING_ACCOUNT_CHANGED = 'billing:account_changed',\n BILLING_USAGE_UPDATED = 'billing:usage_updated',\n BILLING_CREDIT_POOL_UPDATED = 'billing:credit_pool_updated',\n BILLING_FEATURES_UPDATED = 'billing:features_updated',\n\n // === Analytics Events ===\n ANALYTICS_MOMENT_ACHIEVED = 'analytics:moment-achieved',\n\n // === Guidance Events ===\n GUIDANCE_STATE_CHANGED = 'guidance:state-changed',\n\n // === Progression Events ===\n MILESTONE_ACHIEVED = 'progression:milestone-achieved',\n /**\n * Emitted after a milestone-triggering operation increments a scope's\n * `operationCounts` — even when NO milestone was achieved. Lets the frontend\n * advance in-progress milestone bars live (e.g. 8/10 → 9/10) instead of only\n * on achievement or a page reload.\n */\n PROGRESSION_UPDATED = 'progression:updated',\n\n // === Lifecycle Events ===\n LIFECYCLE_STAGE_CHANGED = 'lifecycle:stage-changed',\n\n // === System Events ===\n AUTH_REFRESH = 'auth:refresh',\n ORGANIZATION_SWITCH = 'organization:switch',\n SYSTEM_TOKEN_REFRESHED = 'system:token-refreshed',\n SYSTEM_ERROR = 'system:error',\n}\n\n/**\n * Machine-readable codes attached to a Socket.IO handshake rejection.\n *\n * A rejecting server-side auth middleware calls `next(err)`; Socket.IO forwards\n * the error's `data` field verbatim to the client's `connect_error` handler as\n * `err.data`. Emitting a stable code there lets the client react to WHY the\n * handshake was rejected WITHOUT matching on the human-readable error message\n * (which is localisation- and refactor-fragile).\n *\n * `AUTHENTICATION_FAILED` specifically flags an access-token problem the client\n * can self-heal: the frontend re-runs its token-renewal handler and reconnects\n * with a fresh token. This is what keeps a backgrounded / unfocused tab's socket\n * alive across access-token expiry, when no HTTP traffic is flowing to trigger a\n * reactive refresh (background real-time jobs keep delivering instead of stalling\n * until the user refocuses the window).\n */\nexport enum CoreWebSocketConnectionErrorCode {\n AUTHENTICATION_FAILED = 'AUTHENTICATION_FAILED',\n}\n\nexport enum ResourceAction {\n CREATED = 'created',\n UPDATED = 'updated',\n DELETED = 'deleted',\n}\n\nexport const ResourceActionSchema = z.union([z.enum(ResourceAction), z.string()]);\n\nexport enum WebSocketResourceDeliveryTarget {\n RESOURCE_ROOM_SYNC = 'resource-room-sync',\n RESOURCE_ROOM_NOTIFICATION = 'resource-room-notification',\n SCOPE_ROOM_NOTIFICATION = 'scope-room-notification',\n}\n\nexport const WebSocketResourceDeliveryTargetSchema = z.enum(WebSocketResourceDeliveryTarget);\n\n/**\n * Union type for WebSocket event names (core + custom string events)\n */\nexport type WebSocketEventName = CoreWebSocketEvent | `custom:${string}`;\n\n// =====================================================\n// Common Schemas (reusable across payloads)\n// =====================================================\n\nexport const ContextResourceIdentifiersSchema = z.record(z.string(), z.string());\nexport type ContextResourceIdentifiers = z.infer<typeof ContextResourceIdentifiersSchema>;\n\nconst WebSocketTimestampInputSchema = z.union([\n z.date(),\n z.string().datetime({ offset: true }),\n]);\nconst WebSocketTimestampSchema = WebSocketTimestampInputSchema.pipe(z.coerce.date());\nconst WebSocketOptionalTimestampSchema = WebSocketTimestampSchema.optional();\n\n\n// =====================================================\n// Room Management Payloads (client → server)\n// =====================================================\n\nconst WS_ResourceSubscribePayloadBaseSchema = z.object({\n resourceType: z.string().min(1),\n contextResourceIdentifiers: ContextResourceIdentifiersSchema,\n});\n\n/** Subscribe to a specific resource room. */\nconst WS_ResourceSubscribeSinglePayloadSchema = WS_ResourceSubscribePayloadBaseSchema.extend({\n resourceId: z.string().min(1),\n scopeKey: z.undefined().optional(),\n scopeId: z.undefined().optional(),\n});\n\n/** Subscribe to a scoped collection room. */\nconst WS_ResourceSubscribeScopePayloadSchema = WS_ResourceSubscribePayloadBaseSchema.extend({\n resourceId: z.undefined().optional(),\n scopeKey: z.string().min(1),\n scopeId: z.string().min(1),\n});\n\n/** Subscribe to a resource room - either single-resource or scoped collection. */\nexport const WS_ResourceSubscribePayloadSchema = z.union([\n WS_ResourceSubscribeSinglePayloadSchema,\n WS_ResourceSubscribeScopePayloadSchema,\n]);\nexport type WS_ResourceSubscribePayload = z.infer<typeof WS_ResourceSubscribePayloadSchema>;\n\n/** Server confirmation of subscription */\nexport const WS_ResourceSubscribedPayloadSchema = z.object({\n roomName: z.string(),\n success: z.boolean(),\n error: z.string().optional(),\n /** List of user IDs currently editing this resource (only for single resource subscriptions) */\n editingUsers: z.array(z.string()).optional(),\n});\nexport type WS_ResourceSubscribedPayload = z.infer<typeof WS_ResourceSubscribedPayloadSchema>;\n\n// =====================================================\n// Notification Payloads (server → client, target-based)\n// =====================================================\n\n/**\n * Notification level enum for typed notifications\n */\nexport enum NotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n ERROR = 'error',\n}\n\nexport const NotificationLevelSchema = z.enum(NotificationLevel);\n\n/** Resource notification via identity rooms (org, role, user) */\nexport const WS_ResourceNotificationPayloadSchema = z.object({\n // Operation path fields (for EventBus matching)\n resourceType: z.string(),\n operationIdentifier: z.string(),\n operationPathKey: z.string().optional(),\n variantType: z.enum(ResourceOperationVariantType).optional(),\n isOperationDefault: z.boolean().default(false),\n isBulkOperation: z.boolean().default(false),\n variantKey: z.string().optional(),\n\n // Context for scoped matching\n contextResourceIdentifiers: ContextResourceIdentifiersSchema.optional(),\n\n // Notification data\n action: ResourceActionSchema,\n /** Explicit notification level (overrides action-based default) */\n notificationLevel: NotificationLevelSchema.optional(),\n affectedIds: z.array(z.string()),\n notificationIdentifier: z.string().optional(),\n initiatorUserId: z.string().optional(),\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n\n /**\n * Frontend display hints (only populated for FRONT_END_SUCCESS channel).\n * Contains optional celebration mode and next-step suggestion.\n * Backend passes these through without interpreting them — the frontend\n * reads them to decide rendering (toast vs overlay vs confetti, with or without CTA).\n */\n frontendDisplayHints: FrontendDisplayHintsSchema.optional(),\n});\nexport type WS_ResourceNotificationPayload = z.infer<typeof WS_ResourceNotificationPayloadSchema>;\n\n/** Badge count update */\nexport const WS_BadgeUpdatePayloadSchema = z.object({\n badgeReference: z.string(),\n badgeCount: z.number().int().min(0),\n organizationId: z.string().optional(),\n});\nexport type WS_BadgeUpdatePayload = z.infer<typeof WS_BadgeUpdatePayloadSchema>;\n\n/**\n * Display target enum for user notifications\n */\nexport enum NotificationDisplayTarget {\n TOAST = 'toast',\n CENTER = 'center',\n BOTH = 'both',\n}\n\nexport const NotificationDisplayTargetSchema = z.enum(NotificationDisplayTarget);\n\n/**\n * Direct user notification (not tied to resource operation)\n * Used for arbitrary backend-initiated notifications like:\n * - \"Your export is ready\"\n * - \"Payment received\"\n * - \"System maintenance scheduled\"\n */\nexport const WS_UserNotificationPayloadSchema = z.object({\n /** Notification level (info, success, warning, error) */\n notificationLevel: NotificationLevelSchema,\n /** i18n identifier for message lookup (FrontendNotificationCustomMessageRefs) */\n identifier: z.string().optional(),\n /** Direct message (fallback if identifier not found or not provided) */\n message: z.string().optional(),\n /** Optional notification title */\n title: z.string().optional(),\n /** Additional context data */\n data: z.record(z.string(), z.unknown()).optional(),\n /** Where to display the notification */\n displayTarget: NotificationDisplayTargetSchema.default(NotificationDisplayTarget.BOTH),\n /** Organization context (if notification is org-scoped) */\n organizationId: z.string().optional(),\n /** Timestamp */\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n});\nexport type WS_UserNotificationPayload = z.infer<typeof WS_UserNotificationPayloadSchema>;\n\n// =====================================================\n// Analytics Payloads (server → client)\n// =====================================================\n\n/** Analytics moment achievement notification */\nexport const WS_AnalyticsMomentAchievedPayloadSchema = z.object({\n momentIdentifier: z.string(),\n role: z.enum(ValueMomentRole),\n scope: z.enum(ValueMomentScope),\n scopeEntityId: z.string(),\n achievedAt: WebSocketTimestampSchema,\n triggerSource: z.enum(['frontend', 'backend'] as const),\n});\nexport type WS_AnalyticsMomentAchievedPayload = z.infer<typeof WS_AnalyticsMomentAchievedPayloadSchema>;\n\n// =====================================================\n// Guidance Event Payloads\n// =====================================================\n\n/** Guidance state changed event — pushed by backend or frontend for real-time sync */\nexport const GuidanceRealtimeStatusSchema = z.union([\n z.literal(OnboardingStatus.IN_PROGRESS),\n z.literal(OnboardingStatus.COMPLETED),\n z.literal(OnboardingStatus.DISMISSED),\n]);\n\n/** Guidance state changed event — only statuses broadcast through the realtime bridge. */\nexport const WS_GuidanceStateChangedPayloadSchema = z.object({\n flowRef: z.string(),\n status: GuidanceRealtimeStatusSchema,\n elementRef: z.string().optional(),\n triggerSource: z.enum(['frontend', 'backend'] as const),\n /** Which scope this event pertains to — determines how frontend routes state updates */\n scope: z.enum(GuidanceFlowScope),\n renderMode: z.enum(GuidanceRenderMode).optional(),\n});\nexport type WS_GuidanceStateChangedPayload = z.infer<typeof WS_GuidanceStateChangedPayloadSchema>;\n\n// =====================================================\n// Progression Event Payloads\n// =====================================================\n\n/** Milestone achieved event — pushed by backend when a milestone condition is met */\nexport const WS_MilestoneAchievedPayloadSchema = z.object({\n milestoneRef: z.string(),\n category: z.string(),\n points: z.number().int().optional(),\n /** Which scope this milestone belongs to — determines how frontend routes state updates */\n scope: z.enum(ProgressionScope),\n reward: z.object({\n type: z.enum(MilestoneRewardType),\n featureRef: z.string().optional(),\n guidanceFlowRef: z.string().optional(),\n celebrationLevel: z.enum(['low', 'medium', 'high']).optional(),\n }),\n /** Phase 5 integration: lifecycle transition triggered by this milestone */\n lifecycleTransition: z.object({\n from: z.string(),\n to: z.string(),\n }).optional(),\n /** Timestamp of achievement */\n achievedAt: WebSocketTimestampSchema,\n /** Updated total points (post-achievement) */\n totalPoints: z.number().int(),\n});\nexport type WS_MilestoneAchievedPayload = z.infer<typeof WS_MilestoneAchievedPayloadSchema>;\n\n/**\n * Progression progress event — pushed by backend after a milestone-triggering\n * operation increments the scope's `operationCounts`, regardless of whether a\n * milestone was achieved. Carries the authoritative post-increment counts so\n * the frontend can advance in-progress bars without a refetch (the backend\n * evaluation is fire-and-forget, so the frontend cannot re-read counts\n * race-free on its own).\n */\nexport const WS_ProgressionUpdatedPayloadSchema = z.object({\n /** Which scope's progression state changed. */\n scope: z.enum(ProgressionScope),\n /** Full post-increment operation-count map for the scope (`{ 'todos:create': 9 }`). */\n operationCounts: z.record(z.string(), z.number().int()),\n /** Current total points for the scope (unchanged unless a milestone also fired). */\n totalPoints: z.number().int(),\n /** When the increment was applied. */\n updatedAt: WebSocketTimestampSchema,\n});\nexport type WS_ProgressionUpdatedPayload = z.infer<typeof WS_ProgressionUpdatedPayloadSchema>;\n\n// =====================================================\n// Lifecycle Event Payloads\n// =====================================================\n\n/** Lifecycle stage changed event — pushed by backend when a lifecycle transition occurs */\nexport const WS_LifecycleStageChangedPayloadSchema = z.object({\n /** Previous stage before transition */\n previousStage: z.enum(LifecycleStage),\n /** New stage after transition */\n newStage: z.enum(LifecycleStage),\n /** Which scope this lifecycle state belongs to */\n scope: z.enum(LifecycleScope),\n /** What triggered the transition */\n trigger: z.string().optional(),\n /** When the transition occurred */\n changedAt: WebSocketTimestampSchema,\n /** Activation progress snapshot (for SIGNED_UP → ACTIVATED tracking) */\n activationCriteriaMet: z.record(z.string(), z.boolean()).optional(),\n});\nexport type WS_LifecycleStageChangedPayload = z.infer<typeof WS_LifecycleStageChangedPayloadSchema>;\n\n// =====================================================\n// CRDT Field Metadata (shared between backend + frontend)\n// =====================================================\n\n/**\n * Per-field CRDT metadata: server-authoritative timestamp + last editor.\n * `meta` is an extensibility slot for future per-field metadata (e.g. merge strategy hints,\n * conflict resolution context) without requiring a schema migration.\n */\nexport const FieldMetaEntrySchema = z.object({\n ts: z.number(),\n by: z.string(),\n meta: z.record(z.string(), z.unknown()).optional(),\n});\nexport type FieldMetaEntry = z.infer<typeof FieldMetaEntrySchema>;\n\nexport const FieldMetaMapSchema = z.record(z.string(), FieldMetaEntrySchema);\nexport type FieldMetaMap = z.infer<typeof FieldMetaMapSchema>;\n\n// =====================================================\n// Resource Room Payloads (path-independent collaboration)\n// =====================================================\n\nconst ResourceUpdateSyncActionSchema = z.union([\n z.literal(ResourceAction.CREATED),\n z.literal(ResourceAction.UPDATED),\n]);\n\nconst WS_ResourceEventCommonPayloadSchema = z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n contextResourceIdentifiers: ContextResourceIdentifiersSchema,\n affectedIds: z.array(z.string()).optional(),\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n});\n\nconst WS_ResourceUpdateNotificationPayloadCommonSchema = WS_ResourceEventCommonPayloadSchema.extend({\n affectedIds: z.array(z.string()).min(1),\n action: ResourceActionSchema,\n operationIdentifier: z.string().optional(),\n operationPathKey: z.string().optional(),\n variantType: z.enum(ResourceOperationVariantType).optional(),\n isOperationDefault: z.boolean().optional(),\n isBulkOperation: z.boolean().optional(),\n variantKey: z.string().optional(),\n initiatorUserId: z.string().optional(),\n version: z.number().optional(),\n resourceData: z.unknown().optional(),\n fieldMeta: FieldMetaMapSchema.optional(),\n // DataMode values match directly: DataMode.RAW === 'raw', etc.\n dataMode: z.enum(DataMode).optional(),\n});\n/** Notification-grade resource update event delivered to scope rooms. */\nexport const WS_ScopeRoomUpdateNotificationPayloadSchema = WS_ResourceUpdateNotificationPayloadCommonSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.SCOPE_ROOM_NOTIFICATION),\n});\nexport type WS_ScopeRoomUpdateNotificationPayload = z.infer<typeof WS_ScopeRoomUpdateNotificationPayloadSchema>;\n\n/** Notification-grade resource update event delivered to resource rooms. */\nexport const WS_ResourceRoomUpdateNotificationPayloadSchema = WS_ResourceUpdateNotificationPayloadCommonSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.RESOURCE_ROOM_NOTIFICATION),\n});\nexport type WS_ResourceRoomUpdateNotificationPayload = z.infer<typeof WS_ResourceRoomUpdateNotificationPayloadSchema>;\n\nexport const WS_ResourceUpdateNotificationPayloadSchema = z.discriminatedUnion('deliveryTarget', [\n WS_ScopeRoomUpdateNotificationPayloadSchema,\n WS_ResourceRoomUpdateNotificationPayloadSchema,\n]);\nexport type WS_ResourceUpdateNotificationPayload = z.infer<typeof WS_ResourceUpdateNotificationPayloadSchema>;\n\n/** Synchronization-grade resource update event (resource rooms, RMM replay). */\nexport const WS_ResourceSyncUpdatedPayloadSchema = WS_ResourceEventCommonPayloadSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC),\n action: ResourceUpdateSyncActionSchema,\n operationIdentifier: z.string().min(1),\n operationPathKey: z.string().optional(),\n variantType: z.enum(ResourceOperationVariantType).optional(),\n isOperationDefault: z.boolean().optional(),\n isBulkOperation: z.boolean().optional(),\n variantKey: z.string().optional(),\n initiatorUserId: z.string().optional(),\n version: z.number(),\n resourceData: z.record(z.string(), z.unknown()),\n fieldMeta: FieldMetaMapSchema.optional(),\n dataMode: z.enum(DataMode).optional(),\n});\nexport type WS_ResourceSyncUpdatedPayload = z.infer<typeof WS_ResourceSyncUpdatedPayloadSchema>;\n\n/** Update events can be either notification-grade or sync-grade, distinguished explicitly. */\nexport const WS_ResourceUpdatedPayloadSchema = z.discriminatedUnion('deliveryTarget', [\n WS_ScopeRoomUpdateNotificationPayloadSchema,\n WS_ResourceRoomUpdateNotificationPayloadSchema,\n WS_ResourceSyncUpdatedPayloadSchema,\n]);\nexport type WS_ResourceUpdatedPayload = z.infer<typeof WS_ResourceUpdatedPayloadSchema>;\n\n/** Resource deleted event for resource rooms. */\nexport const WS_ResourceDeletedPayloadSchema = WS_ResourceEventCommonPayloadSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC),\n action: z.literal(ResourceAction.DELETED),\n operationIdentifier: z.string().min(1),\n operationPathKey: z.string().optional(),\n variantType: z.enum(ResourceOperationVariantType).optional(),\n isOperationDefault: z.boolean().optional(),\n isBulkOperation: z.boolean().optional(),\n variantKey: z.string().optional(),\n initiatorUserId: z.string().optional(),\n});\nexport type WS_ResourceDeletedPayload = z.infer<typeof WS_ResourceDeletedPayloadSchema>;\n\n/** Lightweight resource-room state payload for lock/unlock style events. */\nexport const WS_ResourceRoomStatePayloadSchema = WS_ResourceEventCommonPayloadSchema.extend({\n deliveryTarget: z.literal(WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC),\n action: ResourceActionSchema.optional(),\n operationIdentifier: z.string().optional(),\n initiatorUserId: z.string().optional(),\n});\nexport type WS_ResourceRoomStatePayload = z.infer<typeof WS_ResourceRoomStatePayloadSchema>;\n\n/**\n * Editing start/end payload\n * - Incoming: contextResourceIdentifiers REQUIRED for UPDATE authorization\n * - Outgoing (broadcast): contextResourceIdentifiers omitted\n */\nexport const WS_ResourceEditingPayloadSchema = z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n contextResourceIdentifiers: ContextResourceIdentifiersSchema.optional(), // Required on input\n initiatorUserId: z.string().optional(),\n timestamp: WebSocketOptionalTimestampSchema,\n reason: z.enum(['manual', 'disconnect', 'timeout', 'auth_refresh', 'organization_switch']).optional(), // For editing:end\n});\nexport type WS_ResourceEditingPayload = z.infer<typeof WS_ResourceEditingPayloadSchema>;\n\n/** Editing confirmation/error */\nexport const WS_ResourceEditingResultPayloadSchema = z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n success: z.boolean(),\n error: z.string().optional(),\n});\nexport type WS_ResourceEditingResultPayload = z.infer<typeof WS_ResourceEditingResultPayloadSchema>;\n\n/**\n * Custom collaboration event\n * - Incoming: contextResourceIdentifiers REQUIRED for READ authorization\n * - Outgoing (broadcast): contextResourceIdentifiers omitted\n */\nexport const WS_ResourceCustomEventPayloadSchema = z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n eventName: z.string().min(1), // Custom event name (e.g., 'cursor:move', 'comment:add')\n data: z.unknown().optional(),\n contextResourceIdentifiers: ContextResourceIdentifiersSchema.optional(), // Required on input\n initiatorUserId: z.string().optional(),\n includeSelf: z.boolean().optional(), // Only for outgoing\n timestamp: WebSocketOptionalTimestampSchema,\n // Phase 7.1: Optional resource data for custom events with resource context\n // When included, will be validated against appropriate DTO based on dataMode.\n resourceData: z.unknown().optional(),\n // DataMode values match directly: DataMode.RAW === 'raw', etc.\n dataMode: z.enum(DataMode).optional(),\n});\nexport type WS_ResourceCustomEventPayload = z.infer<typeof WS_ResourceCustomEventPayloadSchema>;\n\n/** Error response for custom events */\nexport const WS_ResourceCustomErrorPayloadSchema = z.object({\n eventName: z.string(),\n error: z.string(),\n});\nexport type WS_ResourceCustomErrorPayload = z.infer<typeof WS_ResourceCustomErrorPayloadSchema>;\n\n// =====================================================\n// Badge Request/Response Payloads\n// =====================================================\n\n/** Badge get request (client → server) */\nexport const WS_BadgeGetRequestSchema = z.object({\n identifier: z.string(),\n scope: z.string(),\n scopeId: z.string(),\n});\n\nexport type WS_BadgeGetRequest = z.infer<typeof WS_BadgeGetRequestSchema>;\n\n/** Badge get-all request (client → server) */\nexport const WS_BadgeGetAllRequestSchema = z.object({\n scope: z.string(),\n scopeId: z.string(),\n});\nexport type WS_BadgeGetAllRequest = z.infer<typeof WS_BadgeGetAllRequestSchema>;\n\n/** Badge get-all response (server → client) */\nexport const WS_BadgeGetAllResponseSchema = z.array(z.object({\n identifier: z.string(),\n count: z.number().min(0),\n}));\nexport type WS_BadgeGetAllResponse = z.infer<typeof WS_BadgeGetAllResponseSchema>;\n\n// =====================================================\n// FlowsActors Payloads (bidirectional)\n// =====================================================\n\n/** Start a FlowActorSystem execution (client → server) */\nexport const WS_FlowsActorsStartPayloadSchema = z.object({\n systemRef: z.string().min(1),\n executionId: z.string().optional(), // Server generates if not provided\n contextResourceIdentifiers: ContextResourceIdentifiersSchema,\n initialInput: z.record(z.string(), z.unknown()).optional(),\n});\nexport type WS_FlowsActorsStartPayload = z.infer<typeof WS_FlowsActorsStartPayloadSchema>;\n\n/** Confirmation of FlowActorSystem start (server → client) */\nexport const WS_FlowsActorsStartedPayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n success: z.boolean(),\n error: z.string().optional(),\n});\nexport type WS_FlowsActorsStartedPayload = z.infer<typeof WS_FlowsActorsStartedPayloadSchema>;\n\n/** Message from agent/flow (server → client) */\nexport const WS_FlowsActorsMessagePayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n messageType: z.enum(['text', 'markdown', 'progress', 'data']),\n content: z.string(),\n data: z.record(z.string(), z.unknown()).optional(),\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n\n /**\n * Correlates streamed token deltas to a single logical message. When present,\n * consecutive `messageId`-sharing events belong to the same assistant turn:\n * non-final events (`isFinal !== true`) carry an incremental delta to APPEND to\n * that message's content; the final event (`isFinal === true`) carries the FULL\n * assembled content as the authoritative value. When absent, the event is a\n * standalone message (legacy/one-shot behavior — append a new entry).\n */\n messageId: z.string().optional(),\n /** True on the terminal event of a streamed message (`content` is the full text). */\n isFinal: z.boolean().optional(),\n});\nexport type WS_FlowsActorsMessagePayload = z.infer<typeof WS_FlowsActorsMessagePayloadSchema>;\n\n/**\n * The approval announcement that is ACTUALLY sent, carried in the `data` bag of a\n * `FLOWS_ACTORS_MESSAGE` of type `PROGRESS`.\n *\n * It is a named schema rather than a shape both ends open-code, because the `data` bag is\n * `z.record(z.string(), z.unknown())` — so nothing typed the announcement, and the browser\n * listened on `FLOWS_ACTORS_APPROVAL_REQUEST` instead, an event **nothing has ever emitted**.\n * The result: `pendingApproval` was never set, no shipped screen could observe a paused turn,\n * and `resourceServerInstanceRef` — which the server sends precisely so a decision can echo it —\n * was discarded, leaving an approval raised on a NAMED agent instance unresumable (#528).\n *\n * Producer: `persistApprovalSuspension`. Consumer: `FlowsActorsContext`.\n */\nexport const WS_FlowsActorsApprovalAnnouncementDataSchema = z.object({\n /** Discriminator. The `data` bag carries other kinds of payload on other messages. */\n approvalRequested: z.literal(true),\n approvalId: z.string(),\n /** The tool call being gated. */\n toolName: z.string(),\n /**\n * The tool call's ARGUMENTS — the structured thing a person is actually being asked to approve.\n * Loose here because the shape belongs to the tool, not to the transport; a surface that renders\n * these gets their schema from the tool declaration.\n */\n toolArgs: z.record(z.string(), z.unknown()).optional(),\n requestedAt: z.string(),\n /** When the pause lapses. Written since #465; it reaches a client only through this block. */\n expiresAt: z.string().optional(),\n /**\n * The isolation axis the DECISION must carry back, sent unconditionally — including when it is\n * the default sentinel — so a client echoes one field rather than branching on whether the value\n * is meaningful.\n */\n resourceServerInstanceRef: z.string(),\n});\nexport type WS_FlowsActorsApprovalAnnouncementData = z.infer<typeof WS_FlowsActorsApprovalAnnouncementDataSchema>;\n\n/** Human approval request (server → client) */\nexport const WS_FlowsActorsApprovalRequestPayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n approvalId: z.string(),\n actionDescription: z.string(),\n riskLevel: z.enum(['low', 'medium', 'high', 'critical']),\n requiredRoles: z.array(z.string()).optional(),\n expiresAt: WebSocketOptionalTimestampSchema,\n});\n\nexport type WS_FlowsActorsApprovalRequestPayload = z.infer<typeof WS_FlowsActorsApprovalRequestPayloadSchema>;\n\n/** Human approval response (client → server) */\nexport const WS_FlowsActorsApprovalResponsePayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n approvalId: z.string(),\n approved: z.boolean(),\n comment: z.string().optional(),\n /**\n * The agent instance the paused conversation belongs to — ECHOED from the approval REQUEST.\n *\n * A conversation is isolated by owner FK, machine credential AND agent instance, so a resume that\n * omits this axis is filtered against the DEFAULT instance sentinel. An approval raised on a NAMED\n * A2A agent instance therefore matched no row and the decision was dropped silently — logged as\n * \"no pending approval matches\" and returned, with the turn left paused forever.\n *\n * Optional because the in-app conversational plane runs on the default instance and has nothing to\n * echo; absent means default, which is the value those executions were written with.\n */\n resourceServerInstanceRef: z.string().optional(),\n});\nexport type WS_FlowsActorsApprovalResponsePayload = z.infer<typeof WS_FlowsActorsApprovalResponsePayloadSchema>;\n\n/** Status update during execution (server → client) */\nexport const WS_FlowsActorsStatusUpdatePayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n status: z.string(),\n progress: z.number().min(0).max(100).optional(),\n currentStep: z.string().optional(),\n timestamp: WebSocketTimestampSchema.default(() => new Date()),\n});\nexport type WS_FlowsActorsStatusUpdatePayload = z.infer<typeof WS_FlowsActorsStatusUpdatePayloadSchema>;\n\n/** Execution completed (server → client) */\nexport const WS_FlowsActorsCompletedPayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n success: z.boolean(),\n result: z.record(z.string(), z.unknown()).optional(),\n duration: z.number().optional(), // in ms\n});\nexport type WS_FlowsActorsCompletedPayload = z.infer<typeof WS_FlowsActorsCompletedPayloadSchema>;\n\n/** Execution error (server → client) */\nexport const WS_FlowsActorsErrorPayloadSchema = z.object({\n systemRef: z.string(),\n executionId: z.string(),\n errorCode: z.string(),\n errorMessage: z.string(),\n recoverable: z.boolean().default(false),\n});\nexport type WS_FlowsActorsErrorPayload = z.infer<typeof WS_FlowsActorsErrorPayloadSchema>;\n\n// =====================================================\n// System Payloads\n// =====================================================\n\nexport const WS_AuthRefreshPayloadSchema = z.object({\n token: z.string(),\n});\nexport type WS_AuthRefreshPayload = z.infer<typeof WS_AuthRefreshPayloadSchema>;\n\nexport const WS_SystemTokenRefreshedPayloadSchema = z.object({\n success: z.literal(true),\n});\nexport type WS_SystemTokenRefreshedPayload = z.infer<typeof WS_SystemTokenRefreshedPayloadSchema>;\n\nexport const WS_OrganizationSwitchPayloadSchema = z.object({\n organizationId: z.string(),\n previousOrganizationId: z.string().optional(),\n});\nexport type WS_OrganizationSwitchPayload = z.infer<typeof WS_OrganizationSwitchPayloadSchema>;\n\nexport const WS_SystemErrorPayloadSchema = z.object({\n code: z.string(),\n message: z.string(),\n details: z.unknown().optional(),\n});\nexport type WS_SystemErrorPayload = z.infer<typeof WS_SystemErrorPayloadSchema>;\n\n// =====================================================\n// Billing Payloads (server → client, invalidation triggers)\n// =====================================================\n\nexport const WS_BillingEventPayloadSchema = z.object({\n scopeType: z.enum(ResourcePrimaryScope),\n scopeEntityId: z.string(),\n billingAccountId: z.string(),\n});\n export type WS_BillingEventPayload = z.infer<typeof WS_BillingEventPayloadSchema>;\n\n// =====================================================\n// Event-to-Schema Map (for validation)\n// =====================================================\n\nexport const WebSocketEventSchemas = {\n // Room management\n [CoreWebSocketEvent.RESOURCE_SUBSCRIBE]: WS_ResourceSubscribePayloadSchema,\n [CoreWebSocketEvent.RESOURCE_UNSUBSCRIBE]: WS_ResourceSubscribePayloadSchema,\n [CoreWebSocketEvent.RESOURCE_SUBSCRIBED]: WS_ResourceSubscribedPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_UNSUBSCRIBED]: WS_ResourceSubscribedPayloadSchema,\n\n // Notifications\n [CoreWebSocketEvent.RESOURCE_NOTIFICATION]: WS_ResourceNotificationPayloadSchema,\n [CoreWebSocketEvent.USER_NOTIFICATION]: WS_UserNotificationPayloadSchema,\n [CoreWebSocketEvent.BADGE_UPDATE]: WS_BadgeUpdatePayloadSchema,\n [CoreWebSocketEvent.BADGE_GET]: WS_BadgeGetRequestSchema,\n [CoreWebSocketEvent.BADGE_GET_ALL]: WS_BadgeGetAllRequestSchema,\n\n // Resource room events\n [CoreWebSocketEvent.RESOURCE_UPDATED]: WS_ResourceUpdatedPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_DELETED]: WS_ResourceDeletedPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_EDITING_START]: WS_ResourceEditingPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_EDITING_END]: WS_ResourceEditingPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_EDITING_STARTED]: WS_ResourceEditingResultPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_EDITING_ERROR]: WS_ResourceEditingResultPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_LOCKED]: WS_ResourceRoomStatePayloadSchema,\n [CoreWebSocketEvent.RESOURCE_UNLOCKED]: WS_ResourceRoomStatePayloadSchema,\n [CoreWebSocketEvent.RESOURCE_CUSTOM]: WS_ResourceCustomEventPayloadSchema,\n [CoreWebSocketEvent.RESOURCE_CUSTOM_ERROR]: WS_ResourceCustomErrorPayloadSchema,\n\n // FlowsActors\n [CoreWebSocketEvent.FLOWS_ACTORS_START]: WS_FlowsActorsStartPayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_STARTED]: WS_FlowsActorsStartedPayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_MESSAGE]: WS_FlowsActorsMessagePayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_REQUEST]: WS_FlowsActorsApprovalRequestPayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_RESPONSE]: WS_FlowsActorsApprovalResponsePayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_STATUS_UPDATE]: WS_FlowsActorsStatusUpdatePayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_COMPLETED]: WS_FlowsActorsCompletedPayloadSchema,\n [CoreWebSocketEvent.FLOWS_ACTORS_ERROR]: WS_FlowsActorsErrorPayloadSchema,\n\n // Billing\n [CoreWebSocketEvent.BILLING_STATUS_CHANGED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_SUBSCRIPTION_UPDATED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_ACCOUNT_CHANGED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_USAGE_UPDATED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_CREDIT_POOL_UPDATED]: WS_BillingEventPayloadSchema,\n [CoreWebSocketEvent.BILLING_FEATURES_UPDATED]: WS_BillingEventPayloadSchema,\n\n // Analytics\n [CoreWebSocketEvent.ANALYTICS_MOMENT_ACHIEVED]: WS_AnalyticsMomentAchievedPayloadSchema,\n\n // Guidance\n [CoreWebSocketEvent.GUIDANCE_STATE_CHANGED]: WS_GuidanceStateChangedPayloadSchema,\n\n // Progression\n [CoreWebSocketEvent.MILESTONE_ACHIEVED]: WS_MilestoneAchievedPayloadSchema,\n [CoreWebSocketEvent.PROGRESSION_UPDATED]: WS_ProgressionUpdatedPayloadSchema,\n\n // Lifecycle\n [CoreWebSocketEvent.LIFECYCLE_STAGE_CHANGED]: WS_LifecycleStageChangedPayloadSchema,\n\n // System\n [CoreWebSocketEvent.AUTH_REFRESH]: WS_AuthRefreshPayloadSchema,\n [CoreWebSocketEvent.ORGANIZATION_SWITCH]: WS_OrganizationSwitchPayloadSchema,\n [CoreWebSocketEvent.SYSTEM_TOKEN_REFRESHED]: WS_SystemTokenRefreshedPayloadSchema,\n [CoreWebSocketEvent.SYSTEM_ERROR]: WS_SystemErrorPayloadSchema,\n} as const;\n\n// =====================================================\n// Typed Payload Map (for TypeScript inference)\n// =====================================================\n\nexport type WebSocketEventPayloads = {\n [CoreWebSocketEvent.RESOURCE_SUBSCRIBE]: WS_ResourceSubscribePayload;\n [CoreWebSocketEvent.RESOURCE_UNSUBSCRIBE]: WS_ResourceSubscribePayload;\n [CoreWebSocketEvent.RESOURCE_SUBSCRIBED]: WS_ResourceSubscribedPayload;\n [CoreWebSocketEvent.RESOURCE_UNSUBSCRIBED]: WS_ResourceSubscribedPayload;\n\n [CoreWebSocketEvent.RESOURCE_NOTIFICATION]: WS_ResourceNotificationPayload;\n [CoreWebSocketEvent.USER_NOTIFICATION]: WS_UserNotificationPayload;\n [CoreWebSocketEvent.BADGE_UPDATE]: WS_BadgeUpdatePayload;\n [CoreWebSocketEvent.BADGE_GET]: WS_BadgeGetRequest;\n [CoreWebSocketEvent.BADGE_GET_ALL]: WS_BadgeGetAllRequest;\n\n [CoreWebSocketEvent.RESOURCE_UPDATED]: WS_ResourceUpdatedPayload;\n [CoreWebSocketEvent.RESOURCE_DELETED]: WS_ResourceDeletedPayload;\n [CoreWebSocketEvent.RESOURCE_EDITING_START]: WS_ResourceEditingPayload;\n [CoreWebSocketEvent.RESOURCE_EDITING_END]: WS_ResourceEditingPayload;\n [CoreWebSocketEvent.RESOURCE_EDITING_STARTED]: WS_ResourceEditingResultPayload;\n [CoreWebSocketEvent.RESOURCE_EDITING_ERROR]: WS_ResourceEditingResultPayload;\n [CoreWebSocketEvent.RESOURCE_LOCKED]: WS_ResourceRoomStatePayload;\n [CoreWebSocketEvent.RESOURCE_UNLOCKED]: WS_ResourceRoomStatePayload;\n [CoreWebSocketEvent.RESOURCE_CUSTOM]: WS_ResourceCustomEventPayload;\n [CoreWebSocketEvent.RESOURCE_CUSTOM_ERROR]: WS_ResourceCustomErrorPayload;\n\n [CoreWebSocketEvent.FLOWS_ACTORS_START]: WS_FlowsActorsStartPayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_STARTED]: WS_FlowsActorsStartedPayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_MESSAGE]: WS_FlowsActorsMessagePayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_REQUEST]: WS_FlowsActorsApprovalRequestPayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_RESPONSE]: WS_FlowsActorsApprovalResponsePayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_STATUS_UPDATE]: WS_FlowsActorsStatusUpdatePayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_COMPLETED]: WS_FlowsActorsCompletedPayload;\n [CoreWebSocketEvent.FLOWS_ACTORS_ERROR]: WS_FlowsActorsErrorPayload;\n\n [CoreWebSocketEvent.BILLING_STATUS_CHANGED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_SUBSCRIPTION_UPDATED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_ACCOUNT_CHANGED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_USAGE_UPDATED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_CREDIT_POOL_UPDATED]: WS_BillingEventPayload;\n [CoreWebSocketEvent.BILLING_FEATURES_UPDATED]: WS_BillingEventPayload;\n\n [CoreWebSocketEvent.ANALYTICS_MOMENT_ACHIEVED]: WS_AnalyticsMomentAchievedPayload;\n\n [CoreWebSocketEvent.GUIDANCE_STATE_CHANGED]: WS_GuidanceStateChangedPayload;\n\n [CoreWebSocketEvent.MILESTONE_ACHIEVED]: WS_MilestoneAchievedPayload;\n [CoreWebSocketEvent.PROGRESSION_UPDATED]: WS_ProgressionUpdatedPayload;\n\n [CoreWebSocketEvent.LIFECYCLE_STAGE_CHANGED]: WS_LifecycleStageChangedPayload;\n\n [CoreWebSocketEvent.AUTH_REFRESH]: WS_AuthRefreshPayload;\n [CoreWebSocketEvent.ORGANIZATION_SWITCH]: WS_OrganizationSwitchPayload;\n [CoreWebSocketEvent.SYSTEM_TOKEN_REFRESHED]: WS_SystemTokenRefreshedPayload;\n [CoreWebSocketEvent.SYSTEM_ERROR]: WS_SystemErrorPayload;\n};\n\n// =====================================================\n// Room Naming Utilities\n// =====================================================\n\n/**\n * WebSocket room name prefixes for different room types.\n * These prefixes are used to create room names for Socket.IO.\n */\nexport enum WebSocketRoomPrefix {\n /** User-specific room: user:{userId} */\n USER = 'user',\n /** Organization room: org:{organizationId} */\n ORGANIZATION = 'org',\n /** Organization role room: org:{organizationId}:role:{role} */\n ORGANIZATION_ROLE = 'role',\n /** Application-level role room: app:role:{role} */\n APP_ROLE = 'app:role',\n /** Resource room: resource:{resourceType}:{resourceId} */\n RESOURCE = 'resource',\n /** Public room for unauthenticated users */\n PUBLIC = 'public',\n}\n\n/**\n * Build a user room name\n */\nexport function buildUserRoomName(userId: string): string {\n return `${WebSocketRoomPrefix.USER}:${userId}`;\n}\n\n/**\n * Build an organization room name\n */\nexport function buildOrganizationRoomName(organizationId: string): string {\n return `${WebSocketRoomPrefix.ORGANIZATION}:${organizationId}`;\n}\n\n/**\n * Build an organization role room name\n */\nexport function buildOrganizationRoleRoomName(organizationId: string, role: string): string {\n return `${WebSocketRoomPrefix.ORGANIZATION}:${organizationId}:${WebSocketRoomPrefix.ORGANIZATION_ROLE}:${role}`;\n}\n\n/**\n * Build an application-level role room name\n */\nexport function buildAppRoleRoomName(role: string): string {\n return `${WebSocketRoomPrefix.APP_ROLE}:${role}`;\n}\n\n/**\n * Build a resource room name\n */\nexport function buildResourceRoomName(resourceType: string, resourceId: string): string {\n return `${WebSocketRoomPrefix.RESOURCE}:${resourceType}:${resourceId}`;\n}\n\n/**\n * Build a scope room name for collection subscriptions\n */\nexport function buildScopeRoomName(resourceType: string, scopeKey: string, scopeId: string): string {\n return `${WebSocketRoomPrefix.RESOURCE}:${resourceType}:${scopeKey}:${scopeId}`;\n}\n\n/**\n * The scope keys a resource room can be qualified by that the FRAMEWORK owns.\n *\n * Closed, and named because each member carries a different meaning that a bare string cannot: `app`\n * scopes a resource to the whole application, `user` to one principal's own rows, `org` to a tenant.\n * A resource can additionally be scoped by a PARENT RESOURCE, and those keys are genuinely open —\n * they are derived from the application's own resource names — so they stay strings.\n */\nexport enum ResourceScopeRoomKey {\n /**\n * The whole application.\n *\n * **`'app'`, while the APPLICATION resource's field identifier is `applicationId`** — and that\n * mismatch is load-bearing rather than sloppy, so it is stated here instead of being \"tidied\".\n *\n * `mapScopeKeyToResourceType` on the server resolves a scope key by searching the registry for a\n * resource whose field identifier is `<scopeKey>Id`. Renaming this member to `'application'` would\n * make that search succeed and route APPLICATION scope through the generic PARENT-scope branch,\n * which authorizes READ on the `applications` row — a row `ORG_MEMBER` may read, while ten of the\n * eleven APPLICATION-scoped resource configs require `APP_ADMIN_SUPER_ADMIN`. The rename would\n * therefore hand every org member notification streams naming rows of SSO connections, SIEM\n * configuration and webhook configs (issue #247).\n *\n * APPLICATION scope has its own branch in `verifyScopeAccess` that authorizes the SUBSCRIBED\n * resource instead, because a single constant discriminates nothing and so cannot stand in for\n * authorization the way a tenant or a parent row does.\n */\n APPLICATION = 'app',\n /** One principal's own rows. */\n USER = 'user',\n /** One tenant. */\n ORGANIZATION = 'org',\n}\n\n/** One scope a resource room can be qualified by. */\nexport interface ResourceScopeRoomQualifier {\n readonly scopeKey: string;\n readonly scopeId: string;\n}\n\n/**\n * Which scope rooms a resource operation's rows belong to.\n *\n * ## Why this lives in the SHARED models rather than on the backend\n *\n * Both ends need the same answer and for opposite reasons: the backend emits a list/cache-refresh\n * notification INTO these rooms after a mutation, and a client that caches a read has to be IN them\n * to hear it. Two implementations of one rule would agree only until one side gained a case — the\n * shape this repository refuses everywhere else — and the failure would be silent, because a client\n * subscribed to the wrong room does not error, it simply never hears that its cache is stale.\n *\n * Ported verbatim from the notifications dispatcher, quirks included, because moving code must not\n * change which rooms are emitted to. Two of those quirks are worth naming so the next reader does not\n * \"fix\" them into a behaviour change:\n *\n * - the parent-scope branch tests `key.endsWith('Id') && !key.includes('Parent')` with a CAPITAL P,\n * so `myParentId` is excluded while `parentTodoListId` is not;\n * - `organizationId` enters that branch and is then skipped by the inner test, having already been\n * pushed above.\n */\nexport function deriveResourceScopeRoomQualifiers(\n contextResourceIdentifiers: Record<string, string>,\n primaryScope: ResourcePrimaryScope,\n): ResourceScopeRoomQualifier[] {\n const scopes: ResourceScopeRoomQualifier[] = [];\n const seenScopes = new Set<string>();\n const pushScope = (scopeKey: string, scopeId: string | undefined): void => {\n if (!scopeId) {\n return;\n }\n const dedupeKey = `${scopeKey}:${scopeId}`;\n if (seenScopes.has(dedupeKey)) {\n return;\n }\n seenScopes.add(dedupeKey);\n scopes.push({ scopeKey, scopeId });\n };\n\n if (primaryScope === ResourcePrimaryScope.APPLICATION && contextResourceIdentifiers.applicationId) {\n pushScope(ResourceScopeRoomKey.APPLICATION, contextResourceIdentifiers.applicationId);\n }\n\n if (primaryScope === ResourcePrimaryScope.USER_SELF && contextResourceIdentifiers.userId) {\n pushScope(ResourceScopeRoomKey.USER, contextResourceIdentifiers.userId);\n }\n\n if (contextResourceIdentifiers.organizationId) {\n pushScope(ResourceScopeRoomKey.ORGANIZATION, contextResourceIdentifiers.organizationId);\n }\n\n for (const [key, value] of Object.entries(contextResourceIdentifiers)) {\n if (key === 'organizationId' || (key.endsWith('Id') && !key.includes('Parent'))) {\n const scopeKey = key.replace(/Id$/, '').toLowerCase();\n /*\n * `organization` and `application` are SKIPPED because the dedicated branches above already\n * emitted their rooms under the keys the server actually knows — `org` and `app`.\n *\n * Stripping `Id` yields the FIELD's name, not the room's: `applicationId` becomes\n * `application`, and `ResourceScopeRoomKey.APPLICATION` is `'app'`. That divergence is\n * deliberate and documented on the enum, so the generic loop cannot be allowed to invent the\n * long form beside the short one.\n *\n * It was inert for as long as no caller put an `applicationId` into this map. The moment one\n * did (issue #283, so a client could name its own APPLICATION room), every such read claimed a\n * FIFTH room the server refuses — measured live:\n * `resource:workbenchDomainResources:application:… -> success: false`. A refused room is not\n * merely wasted: the read cache's `covers()` requires EVERY room confirmed, so one permanently\n * unconfirmable room disabled the cache outright for every APPLICATION-scoped resource.\n */\n if (scopeKey !== 'organization' && scopeKey !== 'application' && value) {\n pushScope(scopeKey, value);\n }\n }\n }\n\n return scopes;\n}\n\n/**\n * Parse a resource room name into its components\n */\nexport function parseResourceRoomName(roomName: string): {\n resourceType: string;\n resourceId?: string;\n scopeKey?: string;\n scopeId?: string;\n} | null {\n const parts = roomName.split(':');\n if (parts.length < 3 || parts[0] !== WebSocketRoomPrefix.RESOURCE) return null;\n\n if (parts.length === 3) {\n return { resourceType: parts[1], resourceId: parts[2] };\n } else if (parts.length === 4) {\n return { resourceType: parts[1], scopeKey: parts[2], scopeId: parts[3] };\n }\n return null;\n}\n\n/**\n * Extract organization ID from an organization room name\n */\nexport function parseOrganizationRoomName(roomName: string): string | null {\n if (roomName.startsWith(`${WebSocketRoomPrefix.ORGANIZATION}:`)) {\n // Handle both org:{orgId} and org:{orgId}:role:{role}\n const parts = roomName.split(':');\n return parts[1] || null;\n }\n return null;\n}\n\n// =====================================================\n// Validation Helpers\n// =====================================================\n\n/**\n * Validate an incoming WebSocket event payload\n */\nexport function validateWebSocketPayload<E extends keyof typeof WebSocketEventSchemas>(\n event: E,\n payload: unknown\n): E extends keyof WebSocketEventPayloads ? WebSocketEventPayloads[E] : unknown {\n const schema = WebSocketEventSchemas[event];\n return schema.parse(payload) as E extends keyof WebSocketEventPayloads ? WebSocketEventPayloads[E] : unknown;\n}\n\n/**\n * Safe validation (returns result instead of throwing)\n */\nexport function safeValidateWebSocketPayload<E extends keyof typeof WebSocketEventSchemas>(\n event: E,\n payload: unknown\n): { success: true; data: E extends keyof WebSocketEventPayloads ? WebSocketEventPayloads[E] : unknown } | { success: false; error: z.ZodError } {\n const schema = WebSocketEventSchemas[event];\n const result = schema.safeParse(payload);\n if (result.success) {\n return { success: true, data: result.data as E extends keyof WebSocketEventPayloads ? WebSocketEventPayloads[E] : unknown };\n }\n return { success: false, error: result.error };\n}\n"]}
@@ -9,6 +9,7 @@ import { type AnyResourceConfiguration, ResourceConfiguration, ResourceConfigura
9
9
  import { CoreResourceOperation, ResourceType } from './resources.shared.core.definitions';
10
10
  import { ResourceRelationship } from './resources.shared.schemas';
11
11
  export declare function reconcileGeneratedRelationshipBulkOperations(resourceConfigurations: Record<string, AnyResourceConfiguration>, allResourceRelationships: ResourceRelationship[], allResourceFieldIdentifiers: Partial<Record<ResourceType, string>> | Record<string, string>): void;
12
+ /** @wildo_source:part:end saas.models.resource-config.system-managed-fields */
12
13
  /**
13
14
  * Build a CREATE request DTO from the main schema using decorators.
14
15
  *
@@ -1 +1 @@
1
- {"version":3,"file":"resources-config.shared.factory.d.ts","sourceRoot":"","sources":["../../../../src/resources/resources-config.shared.factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EAEZ,gBAAgB,EAoBjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;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GAAG,gCAAgC,CAAC,aAAa,EAAE,WAAW,CAAC,CAuF/D;AA4GD;;;;GAIG;AACH,wBAAgB,0CAA0C,CACxD,oBAAoB,SAAS,YAAY,GAAG,SAAS,EACrD,kBAAkB,SAAS,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,EACrE,WAAW,SAAS,CAAC,CAAC,UAAU,EAChC,MAAM,EAAE,uCAAuC,CAC/C,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,CACtD,GAAG,qBAAqB,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAi8D/E"}
1
+ {"version":3,"file":"resources-config.shared.factory.d.ts","sourceRoot":"","sources":["../../../../src/resources/resources-config.shared.factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EAEZ,gBAAgB,EAoBjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6CxB,OAAO,EAEL,KAAK,wBAAwB,EAU7B,qBAAqB,EAKrB,uCAAuC,EAKvC,gCAAgC,EAQjC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAwD,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAChJ,OAAO,EAUL,oBAAoB,EAarB,MAAM,4BAA4B,CAAC;AA6OpC,wBAAgB,4CAA4C,CAC1D,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,EAChE,wBAAwB,EAAE,oBAAoB,EAAE,EAChD,2BAA2B,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1F,IAAI,CA0BN;AA8bD,+EAA+E;AAI/E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAC1D,UAAU,EAAE,CAAC,EACb,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAC1B,CAAC,CAAC,UAAU,CA4Cd;AA6ED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EACrD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,CAAC,EACb,WAAW,CAAC,EAAE,CAAC,CAAC,UAAU,GACzB,CAAC,CAAC,UAAU,CAqBd;AA4sBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sCAAsC,CACpD,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,SAAS,EAClE,WAAW,SAAS,SAAS,MAAM,EAAE,GAAG,SAAS,EACjD,MAAM,EAAE;IACR,YAAY,EAAE,aAAa,CAAC;IAC5B,iBAAiB,EAAE,WAAW,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;OAUG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,GAAG,gCAAgC,CAAC,aAAa,EAAE,WAAW,CAAC,CAuF/D;AA4GD;;;;GAIG;AACH,wBAAgB,0CAA0C,CACxD,oBAAoB,SAAS,YAAY,GAAG,SAAS,EACrD,kBAAkB,SAAS,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,EACrE,WAAW,SAAS,CAAC,CAAC,UAAU,EAChC,MAAM,EAAE,uCAAuC,CAC/C,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,CACtD,GAAG,qBAAqB,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAq8D/E"}
@@ -31,7 +31,7 @@ import { HttpApiResourceBindingSchema, HttpApiTransportDialect, assertHttpApiBin
31
31
  import { ExternalDataDestinationPopulation, ExternalDataFieldCoercion, ExternalDataMappingEntryKind, ExternalDataPipelineDeclarationSchema, assertExternalDataPipelineDeclarationCoherence, } from '../external-data/external-data-pipeline.shared.schemas.js';
32
32
  import { HttpMethod } from '../requests/http-requests.shared.js';
33
33
  import { ConsumableToken_ConsumptionMode, TokenAuthenticationPolicy } from '../security/authentications/consumable-token.shared.schemas.js';
34
- import { OPERATION_VARIANT_KEY, Resources_BulkOperationBaseSchema, Resources_Filter_BaseSchema, Resources_Filter_DateRangeSchema, createPaginationRequestSchema, createPaginationResponseMetadataSchema, ResourceGeneratedOperationKind, ResourceSystemAccessMode, PersistenceAdapter, SortOrder, ResourceCollectionExportResponseSchema, } from './resources-config.shared.schemas.js';
34
+ import { OPERATION_VARIANT_KEY, Resources_BulkOperationBaseSchema, Resources_Filter_BaseSchema, Resources_Filter_DateRangeSchema, createPaginationRequestSchema, createPaginationResponseMetadataSchema, ResourceGeneratedOperationKind, ResourceSystemAccessMode, PersistenceAdapter, isPersistenceAdapter, SortOrder, ResourceCollectionExportResponseSchema, } from './resources-config.shared.schemas.js';
35
35
  import { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from './resources.shared.core.definitions.js';
36
36
  import { PRIMARY_SCOPE_FIELD_IDENTIFIERS, PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE, FIELD_IDENTIFIER_TO_PRIMARY_SCOPE, RelationshipNature, ResourceOperationRiskLevel, ResourceOperationVariantType, ResourceOperation_ServiceRuntimeMode, ResourceParentResourceRequirement, ResourcePrimaryScope, ResourceRelationshipBulkAction, ResourceRelationshipBulkActionResultSchema, ResourceRelationshipBulkClearOperationRequestSchema, ResourceRelationshipBulkCreateOperationRequestSchema, ResourceRelationshipBulkLinkOperationRequestSchema, ResourceRelationshipBulkReplaceOperationRequestSchema, ResourceRelationshipBulkSetOperationRequestSchema, ResourceRelationshipBulkUnlinkOperationRequestSchema, ResourceRelationshipAccessScopeStrategy, ResourceRelationshipCardinality, ResourceTranspositionPolicy } from './resources.shared.schemas.js';
37
37
  import { createResourcesRelationship } from './resources-relationships.shared.factory.js';
@@ -39,6 +39,7 @@ import { Resources_SharedUtils } from './resources.shared.utils.js';
39
39
  import { ResourcesConfigOperationsDtosBuilderUtils } from './utils/resources-config-operations.dtos-builder.utils.js';
40
40
  import { ResourcesSummaryUtils } from './utils/resources-summary.utils.js';
41
41
  import { collectTemplatableFileFieldPaths, stripTemplatableFileFieldsRecursively } from './utils/templatable-file-fields.shared.utils.js';
42
+ import { selectByPersistenceAdapter } from './utils/persistence-adapter-discrimination.shared.utils.js';
42
43
  import { isServiceResolvableDefaultOperation, SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES, URL_BEARING_OPERATION_VARIANT_TYPES, } from './utils/resource-operation-type-guards.utils.js';
43
44
  // --------------------------------
44
45
  // Error Helpers
@@ -326,15 +327,79 @@ function createGeneratedFileRegenerateOperations(params) {
326
327
  return [];
327
328
  }
328
329
  /**
329
- * Generated PDF file fields are MongoDB-only in v1, so the guard names what IS supported rather
330
- * than one adapter that is not: `=== POSTGRESQL` would let any future backing kind slip past as
331
- * if it were supported. `undefined` stays admitted it means "the application's default
332
- * adapter", which this shared-tier factory cannot resolve; the backend registry is where an
333
- * undeclared adapter gets its concrete answer.
330
+ * A generated document is MATERIALIZED: rendering it writes a FILES metadata row that must
331
+ * commit in the SAME native transaction as the row that owns it, or a failure between the two
332
+ * leaves either a dangling document reference or an orphaned blob. So the only question this
333
+ * guard can honestly ask of a DECLARATION is whether the declared adapter is one that HAS a
334
+ * transactional local store at all.
335
+ *
336
+ * ## What changed, and why the old shape was wrong rather than merely conservative
337
+ *
338
+ * This refused every adapter except MongoDB, on the grounds that file metadata was pinned to
339
+ * MongoDB, so a generated PDF on a PostgreSQL resource would have crossed adapters. That reason
340
+ * is gone: FILES was un-pinned and now FOLLOWS the application's default adapter
341
+ * (`files.shared.resources-config.schemas.ts:43-67`), precisely so a resource and its file
342
+ * metadata share one native transaction. A PostgreSQL application whose FILES is therefore also
343
+ * PostgreSQL was being refused at authoring time for a boundary that no longer exists.
344
+ *
345
+ * The ASYMMETRY was the tell, and it is the reason this could not be left alone: `undefined` —
346
+ * "follow the application default" — was and is admitted, so the identical resource in the
347
+ * identical PostgreSQL application was already authorable by SAYING LESS. A guard whose answer
348
+ * depends on whether a redundant declaration was written is testing the declaration, not the
349
+ * capability.
350
+ *
351
+ * ## What still refuses, and why that half is load-bearing
352
+ *
353
+ * `INTROSPECTION` rows are recomputed per read — there is no store and no transaction. `HTTP_API`
354
+ * rows live in someone else's system and are read-only by construction. Neither can own a
355
+ * locally-materialized document row, and unlike the PostgreSQL case that is knowable from the
356
+ * declaration alone, so refusing at authoring time is strictly better than discovering it on the
357
+ * first write. `getDatabaseServiceForAdapter` says the same thing at runtime, for the same two
358
+ * adapters, in the same words.
359
+ *
360
+ * ## Shape
361
+ *
362
+ * Expressed as an exhaustive `PersistenceAdapterCases` map rather than a comparison, so a fifth
363
+ * backing kind is a COMPILE error here instead of silently inheriting whichever arm an `else`
364
+ * happened to mean — the failure mode `selectByPersistenceAdapter` exists to remove, and the one
365
+ * the previous `!== MONGODB` shape genuinely had in the other direction (it would have refused a
366
+ * future stored adapter without anyone deciding to).
367
+ *
368
+ * `isPersistenceAdapter` runs FIRST so an erased or unknown declaration keeps refusing through
369
+ * `createConfigurationError` with the resource and the field list named, rather than through the
370
+ * selector's plain `Error`. This factory is a shared-tier authoring surface: its refusals are
371
+ * read by an application author, and the field list is the actionable half.
372
+ *
373
+ * ## What this guard deliberately does NOT decide
374
+ *
375
+ * It cannot see the application's default adapter, so it cannot tell whether THIS resource and
376
+ * FILES resolve to the same store — a resource declaring `POSTGRESQL` inside a MongoDB-default
377
+ * application is a real cross-adapter boundary and must still be refused. That refusal is made
378
+ * where the resolved adapters are actually known, at
379
+ * `services-registry-handler.backend.service.ts` →
380
+ * `assertGeneratedFileMaterializationCommitsWithRow`, which asks the persistence unit of work
381
+ * whether `{this resource, FILES-as-ATOMIC}` can commit atomically and throws
382
+ * `MIXED_PERSISTENCE_ADAPTERS` when it cannot. It gates all three materialization entry points
383
+ * (create, createMany, regenerate) and, unlike this one, also covers the undeclared case this
384
+ * guard has always waved through — which is why relaxing here narrows nothing.
334
385
  */
335
- if (params.persistenceAdapter !== undefined && params.persistenceAdapter !== PersistenceAdapter.MONGODB) {
336
- throw createConfigurationError(`[${params.resourceIdentifier}] generated PDF file fields are only supported for MongoDB-backed resources in v1 `
337
- + `(declared adapter: '${String(params.persistenceAdapter)}'): ${generatedFields.map((field) => field.fieldName).join(', ')}`);
386
+ const GENERATED_DOCUMENT_MATERIALIZATION_SUPPORT = {
387
+ [PersistenceAdapter.MONGODB]: true,
388
+ [PersistenceAdapter.POSTGRESQL]: true,
389
+ [PersistenceAdapter.INTROSPECTION]: false,
390
+ [PersistenceAdapter.HTTP_API]: false,
391
+ };
392
+ if (params.persistenceAdapter !== undefined) {
393
+ const declaredAdapter = params.persistenceAdapter;
394
+ const materializationIsSupported = isPersistenceAdapter(declaredAdapter)
395
+ && selectByPersistenceAdapter(declaredAdapter, GENERATED_DOCUMENT_MATERIALIZATION_SUPPORT);
396
+ if (!materializationIsSupported) {
397
+ throw createConfigurationError(`[${params.resourceIdentifier}] generated PDF file fields require a persistence adapter with a transactional local store, `
398
+ + `so that the generated file's metadata row commits with the row that owns it `
399
+ + `(declared adapter: '${String(declaredAdapter)}'; supported: `
400
+ + `'${PersistenceAdapter.MONGODB}', '${PersistenceAdapter.POSTGRESQL}', or no declaration to follow the application default): `
401
+ + `${generatedFields.map((field) => field.fieldName).join(', ')}`);
402
+ }
338
403
  }
339
404
  const baseUpdateOperation = params.operations.find((operation) => isUrlisableOperationVariantType(operation.variantType)
340
405
  && operation.operationIdentifier === CoreResourceOperation.UPDATE
@@ -480,19 +545,35 @@ function normalizeRequiredFeatures(input) {
480
545
  // DTO Auto-Derivation Utilities
481
546
  // --------------------------------
482
547
  /**
483
- * Fields always excluded from create/update DTOs (system-managed)
484
- * These are hardcoded because they are universal across all resources.
548
+ * @wildo_source:part:start saas.models.resource-config.system-managed-fields facet:layer:shared facet:audience:app-developer
549
+ *
550
+ * The field names the framework owns. They are removed from every generated CREATE and UPDATE
551
+ * request contract, for every resource, whatever your schema declares and whatever a caller sends.
552
+ *
553
+ * Declaring one of these in a resource schema is fine and often necessary — the framework maintains
554
+ * the value. What you cannot do is accept it from a client, default it in a form, or require it on a
555
+ * create: the field is stripped before validation runs, so a form that collects it submits a value
556
+ * that is discarded, and a schema that requires it rejects every request.
557
+ *
558
+ * | field | who writes it |
559
+ * |---|---|
560
+ * | `_id` | the persistence layer (or your own `.isPrimaryKey()` field, stored beneath it) |
561
+ * | `createdAt` / `updatedAt` / `deletedAt` | the repository, on write |
562
+ * | `createdByUserId` | the repository, stamped from the execution context on CREATE, immutable afterwards |
563
+ * | `_version_db_doc` | the framework's optimistic-concurrency marker |
564
+ *
565
+ * The failure this prevents is quiet and was paid for once: a create form validating against a
566
+ * reserved field that no form collects fails every submit with `expected string, received undefined`,
567
+ * and the schema looks correct while it does. So the exclusion is unconditional and does not depend
568
+ * on the resource author remembering `.excludeFromCreate()`.
485
569
  *
486
- * `createdByUserId` is a reserved audit FK by framework convention: the
487
- * repository layer auto-stamps it from the execution context on CREATE
488
- * (see RepositoryResource data enrichment) and it is immutable afterwards,
489
- * so clients never author it. Request DTOs must omit it even when the app
490
- * schema forgets `.excludeFromCreate()` — otherwise create forms validate
491
- * against a field no form collects and every submit fails
492
- * ("expected string, received undefined"; recovered 2026-06-11 on the
493
- * Wonder Todos todoLists create form).
570
+ * ⚠️ A NARROWER set `_id`, `createdAt`, `updatedAt`, `deletedAt`, `_version_db_doc` — is
571
+ * additionally *mandatory-discard*: even a trusted in-process system write cannot re-attach those
572
+ * through `preserveServerInjectedFields`. `createdByUserId` is deliberately not in that set, because
573
+ * an engine flow creating a row on somebody's behalf legitimately needs to stamp it.
494
574
  */
495
575
  const SYSTEM_MANAGED_FIELDS = ['_id', 'createdAt', 'updatedAt', 'deletedAt', 'createdByUserId', '_version_db_doc'];
576
+ /** @wildo_source:part:end saas.models.resource-config.system-managed-fields */
496
577
  // PRIMARY_SCOPE_FIELD_IDENTIFIERS and getPrimaryScopeFieldIdentifier imported from resources.shared.schemas
497
578
  /**
498
579
  * Build a CREATE request DTO from the main schema using decorators.
@@ -1453,7 +1534,7 @@ export function createResourceConfiguration_Initialization(params) {
1453
1534
  throw createConfigurationError(`[${resourceIdentifier}] 'persistenceAdapterIsolation' is declared alongside persistenceAdapter 'http-api', where it is never read — an http-api resource is admitted past the one-adapter rule on the adapter's own nature, not on an isolation claim. Remove the isolation declaration.`);
1454
1535
  }
1455
1536
  // The RESOLVED binding, not the authored one. An author writes the schema's INPUT shape
1456
- // (`HttpApiResourceBindingAuthored`), so defaults like `verifyMetadataAtBoot`, `identityMode` and
1537
+ // (`HttpApiResourceBindingAuthored`), so defaults like `verifyMetadataAtBoot`, `connection` and
1457
1538
  // `remoteCallSemantics` may be absent from what they typed; every consumer reads the parsed shape
1458
1539
  // and is entitled to find them. The parse result used to be DISCARDED — harmless only because
1459
1540
  // authoring demanded every field, which is precisely the burden the authored shape removes.
@@ -2429,6 +2510,10 @@ export function createResourceConfiguration_Initialization(params) {
2429
2510
  notificationBadgeOperations: config.notificationBadgeOperations || [],
2430
2511
  userNotifications,
2431
2512
  m2mNotifications,
2513
+ // Carried verbatim rather than normalized: it is one authored object with no derived
2514
+ // parts, unlike the notification families above, which the factory stamps with scope and
2515
+ // identifier. `undefined` means the operation consumes no metered product.
2516
+ recordsUsage: config.recordsUsage,
2432
2517
  // Fields from ResourceConfiguration_OperationVariant_Base
2433
2518
  variantType: variantParams.variantType,
2434
2519
  resourceOperationLike: variantParams.resourceOperationLike,