n8n 2.37.5 → 2.38.0

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 (725) hide show
  1. package/dist/active-executions.js +2 -1
  2. package/dist/active-executions.js.map +1 -1
  3. package/dist/active-workflow-manager.d.ts +5 -1
  4. package/dist/active-workflow-manager.js +64 -33
  5. package/dist/active-workflow-manager.js.map +1 -1
  6. package/dist/binary-data/binary-data-access.service.d.ts +11 -0
  7. package/dist/binary-data/binary-data-access.service.js +50 -0
  8. package/dist/binary-data/binary-data-access.service.js.map +1 -0
  9. package/dist/build.tsbuildinfo +1 -1
  10. package/dist/commands/base-command.d.ts +2 -0
  11. package/dist/commands/base-command.js +8 -0
  12. package/dist/commands/base-command.js.map +1 -1
  13. package/dist/commands/import/workflow.d.ts +1 -0
  14. package/dist/commands/import/workflow.js +12 -3
  15. package/dist/commands/import/workflow.js.map +1 -1
  16. package/dist/commands/start.d.ts +1 -0
  17. package/dist/commands/start.js +2 -1
  18. package/dist/commands/start.js.map +1 -1
  19. package/dist/constants.d.ts +2 -0
  20. package/dist/constants.js +3 -1
  21. package/dist/constants.js.map +1 -1
  22. package/dist/controllers/binary-data.controller.d.ts +5 -2
  23. package/dist/controllers/binary-data.controller.js +11 -3
  24. package/dist/controllers/binary-data.controller.js.map +1 -1
  25. package/dist/controllers/e2e.controller.d.ts +1 -6
  26. package/dist/controllers/e2e.controller.js +7 -20
  27. package/dist/controllers/e2e.controller.js.map +1 -1
  28. package/dist/controllers/project.controller.d.ts +4 -10
  29. package/dist/controllers/project.controller.js +14 -114
  30. package/dist/controllers/project.controller.js.map +1 -1
  31. package/dist/controllers/telemetry.controller.js +1 -1
  32. package/dist/controllers/telemetry.controller.js.map +1 -1
  33. package/dist/credentials/credentials-finder.service.d.ts +2 -0
  34. package/dist/credentials/credentials-finder.service.js +46 -12
  35. package/dist/credentials/credentials-finder.service.js.map +1 -1
  36. package/dist/credentials/credentials.service.d.ts +5 -2
  37. package/dist/credentials/credentials.service.js +4 -1
  38. package/dist/credentials/credentials.service.js.map +1 -1
  39. package/dist/credentials-helper.d.ts +3 -1
  40. package/dist/credentials-helper.js +10 -2
  41. package/dist/credentials-helper.js.map +1 -1
  42. package/dist/deprecation/deprecation.service.js +5 -0
  43. package/dist/deprecation/deprecation.service.js.map +1 -1
  44. package/dist/errors/http-error-serializers.js +3 -0
  45. package/dist/errors/http-error-serializers.js.map +1 -1
  46. package/dist/errors/variable-validation.error.d.ts +2 -2
  47. package/dist/errors/variable-validation.error.js +1 -1
  48. package/dist/errors/variable-validation.error.js.map +1 -1
  49. package/dist/evaluation.ee/evaluation-config-validator.js +3 -2
  50. package/dist/evaluation.ee/evaluation-config-validator.js.map +1 -1
  51. package/dist/evaluation.ee/evaluation-dataset.service.js +8 -1
  52. package/dist/evaluation.ee/evaluation-dataset.service.js.map +1 -1
  53. package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +96 -45
  54. package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -1
  55. package/dist/execution-lifecycle/execute-error-workflow.js +3 -0
  56. package/dist/execution-lifecycle/execute-error-workflow.js.map +1 -1
  57. package/dist/executions/engine-v2-execution-reader.service.d.ts +11 -0
  58. package/dist/executions/engine-v2-execution-reader.service.js +68 -0
  59. package/dist/executions/engine-v2-execution-reader.service.js.map +1 -0
  60. package/dist/executions/execution-id.d.ts +5 -0
  61. package/dist/executions/execution-id.js +10 -0
  62. package/dist/executions/execution-id.js.map +1 -0
  63. package/dist/executions/execution.service.d.ts +3 -1
  64. package/dist/executions/execution.service.js +16 -8
  65. package/dist/executions/execution.service.js.map +1 -1
  66. package/dist/executions/executions.controller.d.ts +1 -0
  67. package/dist/executions/executions.controller.js +12 -6
  68. package/dist/executions/executions.controller.js.map +1 -1
  69. package/dist/expression-observability/expression-observability.provider.js +3 -2
  70. package/dist/expression-observability/expression-observability.provider.js.map +1 -1
  71. package/dist/license/license.service.js +1 -1
  72. package/dist/license/license.service.js.map +1 -1
  73. package/dist/metrics/prometheus/instance-ai-metrics.service.js.map +1 -1
  74. package/dist/middlewares/content-security-policy.d.ts +10 -0
  75. package/dist/middlewares/content-security-policy.js +53 -0
  76. package/dist/middlewares/content-security-policy.js.map +1 -0
  77. package/dist/middlewares/index.d.ts +1 -0
  78. package/dist/middlewares/index.js +1 -0
  79. package/dist/middlewares/index.js.map +1 -1
  80. package/dist/modules/agents/adapters/agents-credential-provider.js +1 -1
  81. package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -1
  82. package/dist/modules/agents/agent-config.service.js +0 -3
  83. package/dist/modules/agents/agent-config.service.js.map +1 -1
  84. package/dist/modules/agents/agent-default-model-resolver.service.js +3 -5
  85. package/dist/modules/agents/agent-default-model-resolver.service.js.map +1 -1
  86. package/dist/modules/agents/agent-execution-orchestrator.service.js +13 -6
  87. package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
  88. package/dist/modules/agents/agent-execution.service.d.ts +1 -0
  89. package/dist/modules/agents/agent-execution.service.js +3 -0
  90. package/dist/modules/agents/agent-execution.service.js.map +1 -1
  91. package/dist/modules/agents/agent-integrations.controller.d.ts +7 -5
  92. package/dist/modules/agents/agent-integrations.controller.js +10 -17
  93. package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
  94. package/dist/modules/agents/agent-model-catalog.service.js +6 -12
  95. package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
  96. package/dist/modules/agents/agent-publish.service.d.ts +2 -3
  97. package/dist/modules/agents/agent-publish.service.js +12 -5
  98. package/dist/modules/agents/agent-publish.service.js.map +1 -1
  99. package/dist/modules/agents/agent-runtime-cache.service.d.ts +5 -0
  100. package/dist/modules/agents/agent-runtime-cache.service.js +57 -3
  101. package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
  102. package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +14 -7
  103. package/dist/modules/agents/agent-runtime-reconstruction.service.js +89 -36
  104. package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
  105. package/dist/modules/agents/agent-sandbox-runtime.service.d.ts +4 -2
  106. package/dist/modules/agents/agent-sandbox-runtime.service.js +21 -11
  107. package/dist/modules/agents/agent-sandbox-runtime.service.js.map +1 -1
  108. package/dist/modules/agents/agent-validation.service.js +0 -4
  109. package/dist/modules/agents/agent-validation.service.js.map +1 -1
  110. package/dist/modules/agents/agent-workflow-execution.service.js +1 -1
  111. package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
  112. package/dist/modules/agents/agent-workflow-tool-resume.service.d.ts +32 -0
  113. package/dist/modules/agents/agent-workflow-tool-resume.service.js +168 -0
  114. package/dist/modules/agents/agent-workflow-tool-resume.service.js.map +1 -0
  115. package/dist/modules/agents/agent-workspace.service.d.ts +8 -2
  116. package/dist/modules/agents/agent-workspace.service.js +15 -4
  117. package/dist/modules/agents/agent-workspace.service.js.map +1 -1
  118. package/dist/modules/agents/agents.module.d.ts +1 -1
  119. package/dist/modules/agents/agents.module.js +8 -7
  120. package/dist/modules/agents/agents.module.js.map +1 -1
  121. package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +4 -6
  122. package/dist/modules/agents/builder/agents-builder-tools.service.js +16 -21
  123. package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
  124. package/dist/modules/agents/builder/agents-builder.service.d.ts +5 -7
  125. package/dist/modules/agents/builder/agents-builder.service.js +27 -36
  126. package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
  127. package/dist/modules/agents/builder/builder-model-live-lookup.service.js +1 -1
  128. package/dist/modules/agents/builder/builder-model-live-lookup.service.js.map +1 -1
  129. package/dist/modules/agents/builder/call-agent-failure.d.ts +5 -0
  130. package/dist/modules/agents/builder/call-agent-failure.js +28 -0
  131. package/dist/modules/agents/builder/call-agent-failure.js.map +1 -0
  132. package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +3 -2
  133. package/dist/modules/agents/builder/interactive/ask-credential.tool.js +8 -9
  134. package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
  135. package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +3 -2
  136. package/dist/modules/agents/builder/interactive/finish-setup.tool.js +16 -6
  137. package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
  138. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +74 -61
  139. package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
  140. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +5 -4
  141. package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
  142. package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
  143. package/dist/modules/agents/builder/prompts/tools.prompt.js +6 -0
  144. package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
  145. package/dist/modules/agents/builder/skills/external-services.skill.js +51 -8
  146. package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
  147. package/dist/modules/agents/builder/skills/node-tools.skill.js +4 -4
  148. package/dist/modules/agents/builder/skills/node-tools.skill.js.map +1 -1
  149. package/dist/modules/agents/builder/skills/sub-agents.skill.js +15 -12
  150. package/dist/modules/agents/builder/skills/sub-agents.skill.js.map +1 -1
  151. package/dist/modules/agents/builder/skills/target-tasks.skill.js +16 -5
  152. package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -1
  153. package/dist/modules/agents/entities/agent-channel-status.entity.d.ts +16 -0
  154. package/dist/modules/agents/entities/agent-channel-status.entity.js +99 -0
  155. package/dist/modules/agents/entities/agent-channel-status.entity.js.map +1 -0
  156. package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +3 -3
  157. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +17 -7
  158. package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
  159. package/dist/modules/agents/integrations/agent-channel-reconciler.service.d.ts +38 -0
  160. package/dist/modules/agents/integrations/agent-channel-reconciler.service.js +260 -0
  161. package/dist/modules/agents/integrations/agent-channel-reconciler.service.js.map +1 -0
  162. package/dist/modules/agents/integrations/agent-channel-status-reporter.d.ts +23 -0
  163. package/dist/modules/agents/integrations/agent-channel-status-reporter.js +114 -0
  164. package/dist/modules/agents/integrations/agent-channel-status-reporter.js.map +1 -0
  165. package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +9 -0
  166. package/dist/modules/agents/integrations/agent-chat-bridge.js +53 -1
  167. package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
  168. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +1 -1
  169. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +3 -2
  170. package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
  171. package/dist/modules/agents/integrations/agent-chat-integration.d.ts +5 -2
  172. package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
  173. package/dist/modules/agents/integrations/channel-status-report.d.ts +4 -0
  174. package/dist/modules/agents/integrations/channel-status-report.js +58 -0
  175. package/dist/modules/agents/integrations/channel-status-report.js.map +1 -0
  176. package/dist/modules/agents/integrations/chat-integration.service.d.ts +17 -2
  177. package/dist/modules/agents/integrations/chat-integration.service.js +63 -35
  178. package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
  179. package/dist/modules/agents/integrations/credential-claim.d.ts +3 -0
  180. package/dist/modules/agents/integrations/credential-claim.js +12 -0
  181. package/dist/modules/agents/integrations/credential-claim.js.map +1 -0
  182. package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +2 -0
  183. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +25 -0
  184. package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
  185. package/dist/modules/agents/integrations/platforms/discord-integration.d.ts +2 -1
  186. package/dist/modules/agents/integrations/platforms/discord-integration.js +9 -6
  187. package/dist/modules/agents/integrations/platforms/discord-integration.js.map +1 -1
  188. package/dist/modules/agents/integrations/platforms/linear-integration.js +1 -1
  189. package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -1
  190. package/dist/modules/agents/integrations/platforms/slack/slack-integration.d.ts +2 -1
  191. package/dist/modules/agents/integrations/platforms/slack/slack-integration.js +7 -6
  192. package/dist/modules/agents/integrations/platforms/slack/slack-integration.js.map +1 -1
  193. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js +1 -1
  194. package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js.map +1 -1
  195. package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +4 -6
  196. package/dist/modules/agents/integrations/platforms/telegram-integration.js +11 -14
  197. package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
  198. package/dist/modules/agents/json-config/credential-field-mapping.js +3 -0
  199. package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -1
  200. package/dist/modules/agents/json-config/model-config.js +1 -1
  201. package/dist/modules/agents/json-config/model-config.js.map +1 -1
  202. package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.js +1 -1
  203. package/dist/modules/agents/json-config/reconcile-node-tool-gateway-credentials.js.map +1 -1
  204. package/dist/modules/agents/llm-provider-defaults.js +16 -1
  205. package/dist/modules/agents/llm-provider-defaults.js.map +1 -1
  206. package/dist/modules/agents/repositories/agent-channel-status.repository.d.ts +29 -0
  207. package/dist/modules/agents/repositories/agent-channel-status.repository.js +63 -0
  208. package/dist/modules/agents/repositories/agent-channel-status.repository.js.map +1 -0
  209. package/dist/modules/agents/repositories/agent-execution.repository.d.ts +1 -0
  210. package/dist/modules/agents/repositories/agent-execution.repository.js +4 -0
  211. package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
  212. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +29 -19
  213. package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
  214. package/dist/modules/agents/sub-agents/sub-agent-cleanup.service.js.map +1 -1
  215. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +6 -3
  216. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +43 -16
  217. package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
  218. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.d.ts +1 -0
  219. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.js +18 -6
  220. package/dist/modules/agents/sub-agents/sub-agent-source-resolver.js.map +1 -1
  221. package/dist/modules/agents/tools/workflow-tool-factory.d.ts +24 -13
  222. package/dist/modules/agents/tools/workflow-tool-factory.js +147 -9
  223. package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
  224. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.d.ts +10 -2
  225. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js +23 -4
  226. package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js.map +1 -1
  227. package/dist/modules/agents/utils/provider-model-id.d.ts +2 -0
  228. package/dist/modules/agents/utils/provider-model-id.js +21 -0
  229. package/dist/modules/agents/utils/provider-model-id.js.map +1 -0
  230. package/dist/modules/community-packages/community-packages.service.d.ts +4 -0
  231. package/dist/modules/community-packages/community-packages.service.js +96 -92
  232. package/dist/modules/community-packages/community-packages.service.js.map +1 -1
  233. package/dist/modules/community-packages/npm-utils.js +1 -5
  234. package/dist/modules/community-packages/npm-utils.js.map +1 -1
  235. package/dist/modules/data-table/data-table-aggregate.service.d.ts +1 -1
  236. package/dist/modules/data-table/data-table-aggregate.service.js +1 -1
  237. package/dist/modules/data-table/data-table-aggregate.service.js.map +1 -1
  238. package/dist/modules/data-table/data-table.service.d.ts +9 -4
  239. package/dist/modules/data-table/data-table.service.js +34 -4
  240. package/dist/modules/data-table/data-table.service.js.map +1 -1
  241. package/dist/modules/data-table/errors/data-table-access-denied.error.d.ts +4 -0
  242. package/dist/modules/data-table/errors/data-table-access-denied.error.js +13 -0
  243. package/dist/modules/data-table/errors/data-table-access-denied.error.js.map +1 -0
  244. package/dist/modules/dynamic-credentials.ee/config-redaction.d.ts +5 -0
  245. package/dist/modules/dynamic-credentials.ee/config-redaction.js +81 -0
  246. package/dist/modules/dynamic-credentials.ee/config-redaction.js.map +1 -0
  247. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.d.ts +2 -3
  248. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js +2 -4
  249. package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js.map +1 -1
  250. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.d.ts +1 -0
  251. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +18 -4
  252. package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
  253. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +3 -2
  254. package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
  255. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +22 -4
  256. package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -1
  257. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.d.ts +1 -0
  258. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +12 -2
  259. package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
  260. package/dist/modules/encryption-key-manager/key-manager.service.d.ts +7 -2
  261. package/dist/modules/encryption-key-manager/key-manager.service.js +27 -8
  262. package/dist/modules/encryption-key-manager/key-manager.service.js.map +1 -1
  263. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.d.ts +6 -0
  264. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js +31 -0
  265. package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js.map +1 -0
  266. package/dist/modules/engine-v2/engine-control-plane-client.d.ts +9 -0
  267. package/dist/modules/engine-v2/engine-control-plane-client.js +51 -0
  268. package/dist/modules/engine-v2/engine-control-plane-client.js.map +1 -0
  269. package/dist/modules/engine-v2/engine-control-plane-server.d.ts +14 -0
  270. package/dist/modules/engine-v2/engine-control-plane-server.js +84 -0
  271. package/dist/modules/engine-v2/engine-control-plane-server.js.map +1 -0
  272. package/dist/modules/engine-v2/engine-data-plane-client.d.ts +3 -1
  273. package/dist/modules/engine-v2/engine-data-plane-client.js +16 -1
  274. package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -1
  275. package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.d.ts +18 -0
  276. package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.js +150 -0
  277. package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.js.map +1 -0
  278. package/dist/modules/engine-v2/engine-lifecycle-event.controller.d.ts +7 -0
  279. package/dist/modules/engine-v2/engine-lifecycle-event.controller.js +34 -0
  280. package/dist/modules/engine-v2/engine-lifecycle-event.controller.js.map +1 -0
  281. package/dist/modules/engine-v2/engine-v2.constants.d.ts +2 -0
  282. package/dist/modules/engine-v2/engine-v2.constants.js +6 -0
  283. package/dist/modules/engine-v2/engine-v2.constants.js.map +1 -0
  284. package/dist/modules/engine-v2/engine-v2.module.js +4 -0
  285. package/dist/modules/engine-v2/engine-v2.module.js.map +1 -1
  286. package/dist/modules/engine-v2/engine-v2.runtime.d.ts +3 -1
  287. package/dist/modules/engine-v2/engine-v2.runtime.js +6 -2
  288. package/dist/modules/engine-v2/engine-v2.runtime.js.map +1 -1
  289. package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js +1 -1
  290. package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js.map +1 -1
  291. package/dist/modules/external-secrets.ee/providers/infisical.js +1 -1
  292. package/dist/modules/external-secrets.ee/providers/infisical.js.map +1 -1
  293. package/dist/modules/external-secrets.ee/providers/vault.js +1 -1
  294. package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
  295. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.d.ts +5 -3
  296. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js +16 -4
  297. package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js.map +1 -1
  298. package/dist/modules/git-connections.ee/git-connections.service.d.ts +4 -2
  299. package/dist/modules/git-connections.ee/git-connections.service.js +87 -4
  300. package/dist/modules/git-connections.ee/git-connections.service.js.map +1 -1
  301. package/dist/modules/instance-ai/browser/browser-local-mcp-server.d.ts +3 -2
  302. package/dist/modules/instance-ai/browser/browser-local-mcp-server.js +48 -30
  303. package/dist/modules/instance-ai/browser/browser-local-mcp-server.js.map +1 -1
  304. package/dist/modules/instance-ai/event-bus/durable-event-log.js.map +1 -1
  305. package/dist/modules/instance-ai/event-bus/in-process-event-bus.d.ts +2 -28
  306. package/dist/modules/instance-ai/event-bus/in-process-event-bus.js +5 -228
  307. package/dist/modules/instance-ai/event-bus/in-process-event-bus.js.map +1 -1
  308. package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.d.ts +1 -3
  309. package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js +2 -8
  310. package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js.map +1 -1
  311. package/dist/modules/instance-ai/instance-ai-memory.service.js +1 -3
  312. package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
  313. package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +2 -0
  314. package/dist/modules/instance-ai/instance-ai-settings.service.js +10 -2
  315. package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
  316. package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.d.ts +0 -2
  317. package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js +1 -2
  318. package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js.map +1 -1
  319. package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +2 -3
  320. package/dist/modules/instance-ai/instance-ai.adapter.service.js +101 -44
  321. package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
  322. package/dist/modules/instance-ai/instance-ai.controller.d.ts +1 -1
  323. package/dist/modules/instance-ai/instance-ai.controller.js +75 -83
  324. package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
  325. package/dist/modules/instance-ai/instance-ai.module.js +8 -16
  326. package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
  327. package/dist/modules/instance-ai/instance-ai.service.d.ts +2 -0
  328. package/dist/modules/instance-ai/instance-ai.service.js +55 -11
  329. package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
  330. package/dist/modules/instance-ai/internal-messages.d.ts +7 -0
  331. package/dist/modules/instance-ai/internal-messages.js +32 -2
  332. package/dist/modules/instance-ai/internal-messages.js.map +1 -1
  333. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.d.ts +2 -5
  334. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js +4 -7
  335. package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js.map +1 -1
  336. package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js.map +1 -1
  337. package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js.map +1 -1
  338. package/dist/modules/instance-ai/workflow-templates.service.js +1 -1
  339. package/dist/modules/instance-ai/workflow-templates.service.js.map +1 -1
  340. package/dist/modules/ldap.ee/ldap.controller.ee.d.ts +4 -2
  341. package/dist/modules/ldap.ee/ldap.controller.ee.js +9 -2
  342. package/dist/modules/ldap.ee/ldap.controller.ee.js.map +1 -1
  343. package/dist/modules/ldap.ee/ldap.service.ee.js +4 -0
  344. package/dist/modules/ldap.ee/ldap.service.ee.js.map +1 -1
  345. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js +1 -1
  346. package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js.map +1 -1
  347. package/dist/modules/mcp/mcp-scopes.js +1 -1
  348. package/dist/modules/mcp/mcp-server-middleware.service.js +1 -0
  349. package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
  350. package/dist/modules/mcp/mcp.constants.d.ts +3 -1
  351. package/dist/modules/mcp/mcp.constants.js +4 -2
  352. package/dist/modules/mcp/mcp.constants.js.map +1 -1
  353. package/dist/modules/mcp/mcp.controller.js +20 -6
  354. package/dist/modules/mcp/mcp.controller.js.map +1 -1
  355. package/dist/modules/mcp/mcp.service.js +3 -3
  356. package/dist/modules/mcp/mcp.types.d.ts +1 -0
  357. package/dist/modules/mcp/tools/agents/agent-reference.d.ts +1 -1
  358. package/dist/modules/mcp/tools/agents/agent-reference.js +2 -2
  359. package/dist/modules/mcp/tools/agents/agent-tools.service.d.ts +2 -5
  360. package/dist/modules/mcp/tools/agents/agent-tools.service.js +5 -9
  361. package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
  362. package/dist/modules/mcp/tools/list-credentials.tool.d.ts +1 -1
  363. package/dist/modules/mcp/tools/list-credentials.tool.js +5 -5
  364. package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -1
  365. package/dist/modules/mcp/tools/{list-n8n-connect-services.tool.d.ts → list-n8n-gateway-services.tool.d.ts} +1 -1
  366. package/dist/modules/mcp/tools/{list-n8n-connect-services.tool.js → list-n8n-gateway-services.tool.js} +13 -13
  367. package/dist/modules/mcp/tools/list-n8n-gateway-services.tool.js.map +1 -0
  368. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +1 -1
  369. package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
  370. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js +1 -1
  371. package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js.map +1 -1
  372. package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +8 -6
  373. package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
  374. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +1 -1
  375. package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
  376. package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +8 -6
  377. package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
  378. package/dist/modules/n8n-packages/engine/import-result.d.ts +2 -1
  379. package/dist/modules/n8n-packages/engine/import-result.js +1 -0
  380. package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
  381. package/dist/modules/n8n-packages/engine/import-telemetry.d.ts +5 -1
  382. package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
  383. package/dist/modules/n8n-packages/engine/project-package-importer.d.ts +4 -5
  384. package/dist/modules/n8n-packages/engine/project-package-importer.js +9 -7
  385. package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
  386. package/dist/modules/n8n-packages/engine/workflow-package-importer.d.ts +4 -5
  387. package/dist/modules/n8n-packages/engine/workflow-package-importer.js +18 -20
  388. package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
  389. package/dist/modules/n8n-packages/entities/credential/credential-importer.js +1 -0
  390. package/dist/modules/n8n-packages/entities/credential/credential-importer.js.map +1 -1
  391. package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js +12 -12
  392. package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js.map +1 -1
  393. package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.d.ts +4 -0
  394. package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.js +34 -0
  395. package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.js.map +1 -0
  396. package/dist/modules/n8n-packages/entities/project/project-importer.js +1 -1
  397. package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -1
  398. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +22 -14
  399. package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
  400. package/dist/modules/n8n-packages/io/directory/directory-package-reader.d.ts +21 -0
  401. package/dist/modules/n8n-packages/io/directory/directory-package-reader.js +146 -0
  402. package/dist/modules/n8n-packages/io/directory/directory-package-reader.js.map +1 -0
  403. package/dist/modules/n8n-packages/n8n-packages.service.d.ts +5 -1
  404. package/dist/modules/n8n-packages/n8n-packages.service.js +36 -0
  405. package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
  406. package/dist/modules/n8n-packages/n8n-packages.types.d.ts +10 -2
  407. package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
  408. package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.d.ts +1 -0
  409. package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.js +4 -0
  410. package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.js.map +1 -1
  411. package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.d.ts +1 -0
  412. package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.js.map +1 -1
  413. package/dist/modules/oauth-server/oauth-server.service.d.ts +1 -1
  414. package/dist/modules/oauth-server/oauth-server.service.js +12 -16
  415. package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
  416. package/dist/modules/oauth-server/oauth-token.service.d.ts +2 -1
  417. package/dist/modules/oauth-server/oauth-token.service.js +15 -3
  418. package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
  419. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.d.ts +22 -0
  420. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js +60 -0
  421. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js.map +1 -0
  422. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.d.ts +24 -0
  423. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.js +62 -0
  424. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.js.map +1 -0
  425. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.d.ts +22 -0
  426. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.js +56 -0
  427. package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.js.map +1 -0
  428. package/dist/modules/oauth-server/protected-resource-resolvers/index.js +4 -0
  429. package/dist/modules/oauth-server/protected-resource-resolvers/index.js.map +1 -1
  430. package/dist/modules/oauth-server/protected-resource-resolvers/utils.d.ts +4 -0
  431. package/dist/modules/oauth-server/protected-resource-resolvers/utils.js +17 -1
  432. package/dist/modules/oauth-server/protected-resource-resolvers/utils.js.map +1 -1
  433. package/dist/modules/oauth-server/resource-identity.d.ts +2 -0
  434. package/dist/modules/oauth-server/resource-identity.js +15 -0
  435. package/dist/modules/oauth-server/resource-identity.js.map +1 -0
  436. package/dist/modules/otel/otel.service.js +14 -7
  437. package/dist/modules/otel/otel.service.js.map +1 -1
  438. package/dist/modules/policy-infrastructure/policy-decision.service.d.ts +1 -0
  439. package/dist/modules/policy-infrastructure/policy-decision.service.js +3 -0
  440. package/dist/modules/policy-infrastructure/policy-decision.service.js.map +1 -1
  441. package/dist/modules/policy-infrastructure/policy-infrastructure.module.js +1 -0
  442. package/dist/modules/policy-infrastructure/policy-infrastructure.module.js.map +1 -1
  443. package/dist/modules/policy-infrastructure/policy-lifecycle-handler.d.ts +9 -0
  444. package/dist/modules/policy-infrastructure/policy-lifecycle-handler.js +45 -0
  445. package/dist/modules/policy-infrastructure/policy-lifecycle-handler.js.map +1 -0
  446. package/dist/modules/quick-connect/handlers/firecrawl.handler.js +1 -1
  447. package/dist/modules/quick-connect/handlers/firecrawl.handler.js.map +1 -1
  448. package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +18 -1
  449. package/dist/modules/source-control.ee/source-control-import.service.ee.js +11 -3
  450. package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
  451. package/dist/modules/source-control.ee/source-control-status.service.ee.js +2 -0
  452. package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
  453. package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +32 -0
  454. package/dist/modules/source-control.ee/source-control.service.ee.d.ts +16 -0
  455. package/dist/modules/source-control.ee/source-control.service.ee.js +11 -2
  456. package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
  457. package/dist/modules/source-control.ee/types/import-result.d.ts +2 -1
  458. package/dist/modules/sso-oidc/oidc.controller.ee.js +2 -2
  459. package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
  460. package/dist/modules/sso-oidc/oidc.service.ee.js +1 -1
  461. package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
  462. package/dist/modules/sso-oidc/views/oidc-test-result.d.ts +2 -2
  463. package/dist/modules/sso-oidc/views/oidc-test-result.js +10 -4
  464. package/dist/modules/sso-oidc/views/oidc-test-result.js.map +1 -1
  465. package/dist/modules/sso-saml/saml.controller.ee.js +2 -2
  466. package/dist/modules/sso-saml/saml.controller.ee.js.map +1 -1
  467. package/dist/modules/sso-saml/saml.service.ee.js +1 -1
  468. package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
  469. package/dist/modules/sso-saml/views/init-sso-post.d.ts +1 -1
  470. package/dist/modules/sso-saml/views/init-sso-post.js +2 -2
  471. package/dist/modules/sso-saml/views/init-sso-post.js.map +1 -1
  472. package/dist/modules/token-exchange/services/jwks-resolver.js +1 -1
  473. package/dist/modules/token-exchange/services/jwks-resolver.js.map +1 -1
  474. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.d.ts +7 -0
  475. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.js +38 -0
  476. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.js.map +1 -0
  477. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.d.ts +9 -0
  478. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.js +41 -0
  479. package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.js.map +1 -0
  480. package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.d.ts +8 -0
  481. package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js +37 -0
  482. package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js.map +1 -0
  483. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.d.ts +17 -0
  484. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.js +96 -0
  485. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.js.map +1 -0
  486. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.d.ts +20 -0
  487. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js +69 -0
  488. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js.map +1 -0
  489. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.d.ts +18 -0
  490. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js +63 -0
  491. package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js.map +1 -0
  492. package/dist/modules/type-availability-policies/type-availability-policies.module.d.ts +1 -0
  493. package/dist/modules/type-availability-policies/type-availability-policies.module.js +6 -0
  494. package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -1
  495. package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.d.ts +3 -5
  496. package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.js +7 -9
  497. package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.js.map +1 -1
  498. package/dist/modules/workflow-reviews.ee/{workflow-review-access.service.d.ts → workflow-review-authorization.service.d.ts} +12 -3
  499. package/dist/modules/workflow-reviews.ee/{workflow-review-access.service.js → workflow-review-authorization.service.js} +52 -17
  500. package/dist/modules/workflow-reviews.ee/workflow-review-authorization.service.js.map +1 -0
  501. package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.d.ts +14 -0
  502. package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.js +17 -0
  503. package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.js.map +1 -0
  504. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +8 -12
  505. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +28 -82
  506. package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -1
  507. package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.d.ts +7 -6
  508. package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.js +80 -110
  509. package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.js.map +1 -1
  510. package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.d.ts +17 -0
  511. package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.js +69 -0
  512. package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.js.map +1 -0
  513. package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.d.ts +34 -0
  514. package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.js +237 -0
  515. package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.js.map +1 -0
  516. package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.d.ts +10 -0
  517. package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.js +57 -0
  518. package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.js.map +1 -0
  519. package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.d.ts +17 -0
  520. package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.js +93 -0
  521. package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.js.map +1 -0
  522. package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.d.ts +34 -0
  523. package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.js +268 -0
  524. package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.js.map +1 -0
  525. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.d.ts +7 -3
  526. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js +13 -9
  527. package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js.map +1 -1
  528. package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.d.ts +9 -0
  529. package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.js +37 -0
  530. package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.js.map +1 -0
  531. package/dist/oauth/oauth.service.js +0 -1
  532. package/dist/oauth/oauth.service.js.map +1 -1
  533. package/dist/permissions.ee/check-access.js +11 -7
  534. package/dist/permissions.ee/check-access.js.map +1 -1
  535. package/dist/permissions.ee/project-scope.service.d.ts +1 -0
  536. package/dist/permissions.ee/project-scope.service.js +7 -2
  537. package/dist/permissions.ee/project-scope.service.js.map +1 -1
  538. package/dist/policy/evaluate-content-import-safely.d.ts +5 -0
  539. package/dist/policy/evaluate-content-import-safely.js +18 -0
  540. package/dist/policy/evaluate-content-import-safely.js.map +1 -0
  541. package/dist/policy/policy-enforcement-backend.d.ts +1 -0
  542. package/dist/policy/policy-enforcement.service.d.ts +2 -2
  543. package/dist/policy/policy-enforcement.service.js +10 -14
  544. package/dist/policy/policy-enforcement.service.js.map +1 -1
  545. package/dist/policy/policy-violation.error.d.ts +2 -0
  546. package/dist/policy/policy-violation.error.js +10 -0
  547. package/dist/policy/policy-violation.error.js.map +1 -1
  548. package/dist/public-api/types.d.ts +1 -14
  549. package/dist/public-api/v1/controllers/git-connections.public.controller.d.ts +2 -1
  550. package/dist/public-api/v1/controllers/git-connections.public.controller.js +24 -3
  551. package/dist/public-api/v1/controllers/git-connections.public.controller.js.map +1 -1
  552. package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +8 -1
  553. package/dist/public-api/v1/controllers/workflows.public.controller.js +151 -14
  554. package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
  555. package/dist/public-api/v1/handlers/credentials/credentials.handler.js +1 -0
  556. package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
  557. package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +33 -44
  558. package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js.map +1 -1
  559. package/dist/public-api/v1/handlers/discover/discover.handler.d.ts +1 -1
  560. package/dist/public-api/v1/handlers/discover/discover.handler.js +3 -13
  561. package/dist/public-api/v1/handlers/discover/discover.handler.js.map +1 -1
  562. package/dist/public-api/v1/handlers/discover/discover.service.d.ts +2 -3
  563. package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
  564. package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +1 -1
  565. package/dist/public-api/v1/handlers/projects/projects.handler.js +23 -21
  566. package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
  567. package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +1 -1
  568. package/dist/public-api/v1/handlers/variables/variables.handler.js +5 -6
  569. package/dist/public-api/v1/handlers/variables/variables.handler.js.map +1 -1
  570. package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +0 -4
  571. package/dist/public-api/v1/handlers/workflows/workflows.handler.js +0 -102
  572. package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
  573. package/dist/public-api/v1/openapi.yml +4779 -2848
  574. package/dist/response-helper.js +3 -0
  575. package/dist/response-helper.js.map +1 -1
  576. package/dist/scaling/constants.d.ts +2 -2
  577. package/dist/scaling/constants.js +1 -0
  578. package/dist/scaling/constants.js.map +1 -1
  579. package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -1
  580. package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
  581. package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js +2 -7
  582. package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js.map +1 -1
  583. package/dist/security/content-security-policy.d.ts +8 -0
  584. package/dist/security/content-security-policy.js +18 -0
  585. package/dist/security/content-security-policy.js.map +1 -0
  586. package/dist/security-audit/risk-reporters/instance-risk-reporter.js +1 -1
  587. package/dist/security-audit/risk-reporters/instance-risk-reporter.js.map +1 -1
  588. package/dist/server.js +22 -21
  589. package/dist/server.js.map +1 -1
  590. package/dist/services/active-workflows.service.d.ts +3 -1
  591. package/dist/services/active-workflows.service.js +11 -9
  592. package/dist/services/active-workflows.service.js.map +1 -1
  593. package/dist/services/ai-gateway-eligibility.js +1 -1
  594. package/dist/services/ai-gateway-eligibility.js.map +1 -1
  595. package/dist/services/ai-gateway.service.js +14 -14
  596. package/dist/services/ai-gateway.service.js.map +1 -1
  597. package/dist/services/credentials-tester.service.js +7 -1
  598. package/dist/services/credentials-tester.service.js.map +1 -1
  599. package/dist/services/engine-data-plane-proxy.service.d.ts +4 -1
  600. package/dist/services/engine-data-plane-proxy.service.js +5 -0
  601. package/dist/services/engine-data-plane-proxy.service.js.map +1 -1
  602. package/dist/services/engine-v2-dispatcher.service.d.ts +5 -2
  603. package/dist/services/engine-v2-dispatcher.service.js +46 -24
  604. package/dist/services/engine-v2-dispatcher.service.js.map +1 -1
  605. package/dist/services/engine-v2-push-registry.service.d.ts +8 -0
  606. package/dist/services/engine-v2-push-registry.service.js +51 -0
  607. package/dist/services/engine-v2-push-registry.service.js.map +1 -0
  608. package/dist/services/engine-v2-push-session.d.ts +23 -0
  609. package/dist/services/engine-v2-push-session.js +24 -0
  610. package/dist/services/engine-v2-push-session.js.map +1 -0
  611. package/dist/services/folder-finder.service.js +10 -8
  612. package/dist/services/folder-finder.service.js.map +1 -1
  613. package/dist/services/folder.service.d.ts +1 -1
  614. package/dist/services/folder.service.js +1 -7
  615. package/dist/services/folder.service.js.map +1 -1
  616. package/dist/services/import.service.d.ts +14 -3
  617. package/dist/services/import.service.js +27 -2
  618. package/dist/services/import.service.js.map +1 -1
  619. package/dist/services/node-resource-explorer.service.js +1 -1
  620. package/dist/services/node-resource-explorer.service.js.map +1 -1
  621. package/dist/services/ownership-transfer/ownership-transfer.manifest.json +5 -0
  622. package/dist/services/project.service.ee.d.ts +47 -9
  623. package/dist/services/project.service.ee.js +128 -17
  624. package/dist/services/project.service.ee.js.map +1 -1
  625. package/dist/services/role.service.js +10 -5
  626. package/dist/services/role.service.js.map +1 -1
  627. package/dist/task-runners/task-runner-process-py.d.ts +1 -1
  628. package/dist/task-runners/task-runner-process-py.js.map +1 -1
  629. package/dist/telemetry/index.js +1 -1
  630. package/dist/telemetry/index.js.map +1 -1
  631. package/dist/utils/ai-proxy-fetch.d.ts +3 -4
  632. package/dist/utils/ai-proxy-fetch.js +3 -5
  633. package/dist/utils/ai-proxy-fetch.js.map +1 -1
  634. package/dist/utils/strapi-utils.js +1 -1
  635. package/dist/utils/strapi-utils.js.map +1 -1
  636. package/dist/utils/ttl-map.d.ts +1 -0
  637. package/dist/utils/ttl-map.js +9 -0
  638. package/dist/utils/ttl-map.js.map +1 -1
  639. package/dist/webhooks/constants.d.ts +2 -0
  640. package/dist/webhooks/constants.js +2 -1
  641. package/dist/webhooks/constants.js.map +1 -1
  642. package/dist/webhooks/live-webhooks.js +1 -1
  643. package/dist/webhooks/live-webhooks.js.map +1 -1
  644. package/dist/webhooks/test-webhook-registrations.service.d.ts +1 -0
  645. package/dist/webhooks/test-webhook-registrations.service.js.map +1 -1
  646. package/dist/webhooks/test-webhooks.d.ts +6 -2
  647. package/dist/webhooks/test-webhooks.js +29 -6
  648. package/dist/webhooks/test-webhooks.js.map +1 -1
  649. package/dist/webhooks/waiting-forms.js +3 -4
  650. package/dist/webhooks/waiting-forms.js.map +1 -1
  651. package/dist/webhooks/waiting-webhooks.js +4 -0
  652. package/dist/webhooks/waiting-webhooks.js.map +1 -1
  653. package/dist/webhooks/webhook-helpers.d.ts +3 -1
  654. package/dist/webhooks/webhook-helpers.js +24 -1
  655. package/dist/webhooks/webhook-helpers.js.map +1 -1
  656. package/dist/webhooks/webhook-response-headers.d.ts +1 -0
  657. package/dist/webhooks/webhook-response-headers.js +6 -0
  658. package/dist/webhooks/webhook-response-headers.js.map +1 -1
  659. package/dist/workflow-execute-additional-data.js +5 -0
  660. package/dist/workflow-execute-additional-data.js.map +1 -1
  661. package/dist/workflow-helpers.d.ts +3 -2
  662. package/dist/workflow-helpers.js +35 -24
  663. package/dist/workflow-helpers.js.map +1 -1
  664. package/dist/workflows/publication/publication-result.d.ts +5 -0
  665. package/dist/workflows/publication/publication-status-reporter.d.ts +1 -0
  666. package/dist/workflows/publication/publication-status-reporter.js +23 -5
  667. package/dist/workflows/publication/publication-status-reporter.js.map +1 -1
  668. package/dist/workflows/publication/workflow-publication-applier.d.ts +6 -1
  669. package/dist/workflows/publication/workflow-publication-applier.js +63 -10
  670. package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
  671. package/dist/workflows/triggers/poll-backoff.service.d.ts +2 -2
  672. package/dist/workflows/triggers/poll-backoff.service.js +3 -3
  673. package/dist/workflows/triggers/poll-backoff.service.js.map +1 -1
  674. package/dist/workflows/triggers/poll-cursor.service.d.ts +2 -2
  675. package/dist/workflows/triggers/poll-cursor.service.js +4 -1
  676. package/dist/workflows/triggers/poll-cursor.service.js.map +1 -1
  677. package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +6 -4
  678. package/dist/workflows/triggers/trigger-execution-context.factory.js +13 -7
  679. package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
  680. package/dist/workflows/triggers/webhook-trigger-registrar.d.ts +1 -0
  681. package/dist/workflows/triggers/webhook-trigger-registrar.js +3 -0
  682. package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
  683. package/dist/workflows/triggers/workflow-trigger-activator.d.ts +10 -1
  684. package/dist/workflows/triggers/workflow-trigger-activator.js +78 -38
  685. package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
  686. package/dist/workflows/workflow-creation.service.d.ts +17 -4
  687. package/dist/workflows/workflow-creation.service.js +96 -16
  688. package/dist/workflows/workflow-creation.service.js.map +1 -1
  689. package/dist/workflows/workflow-execution.service.js +2 -0
  690. package/dist/workflows/workflow-execution.service.js.map +1 -1
  691. package/dist/workflows/workflow-finder.service.js +67 -56
  692. package/dist/workflows/workflow-finder.service.js.map +1 -1
  693. package/dist/workflows/workflow-validation.service.js +3 -2
  694. package/dist/workflows/workflow-validation.service.js.map +1 -1
  695. package/dist/workflows/workflow.service.d.ts +4 -1
  696. package/dist/workflows/workflow.service.ee.d.ts +9 -3
  697. package/dist/workflows/workflow.service.ee.js +16 -2
  698. package/dist/workflows/workflow.service.ee.js.map +1 -1
  699. package/dist/workflows/workflow.service.js +25 -4
  700. package/dist/workflows/workflow.service.js.map +1 -1
  701. package/dist/workflows/workflows.controller.d.ts +3 -5
  702. package/dist/workflows/workflows.controller.js +3 -7
  703. package/dist/workflows/workflows.controller.js.map +1 -1
  704. package/package.json +39 -39
  705. package/templates/oauth-callback.handlebars +1 -1
  706. package/templates/oauth-error-callback.handlebars +1 -1
  707. package/templates/saml-connection-test-failed.handlebars +4 -1
  708. package/templates/saml-connection-test-success.handlebars +4 -1
  709. package/dist/modules/instance-ai/output-redaction-config.d.ts +0 -3
  710. package/dist/modules/instance-ai/output-redaction-config.js +0 -21
  711. package/dist/modules/instance-ai/output-redaction-config.js.map +0 -1
  712. package/dist/modules/mcp/tools/list-n8n-connect-services.tool.js.map +0 -1
  713. package/dist/modules/workflow-reviews.ee/workflow-review-access.service.js.map +0 -1
  714. package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.d.ts +0 -18
  715. package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.js +0 -77
  716. package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.js.map +0 -1
  717. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +0 -51
  718. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +0 -538
  719. package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +0 -1
  720. package/dist/policy/policy-cleared.d.ts +0 -20
  721. package/dist/policy/policy-cleared.js +0 -22
  722. package/dist/policy/policy-cleared.js.map +0 -1
  723. package/dist/public-api/v1/handlers/data-tables/data-tables.service.d.ts +0 -4
  724. package/dist/public-api/v1/handlers/data-tables/data-tables.service.js +0 -44
  725. package/dist/public-api/v1/handlers/data-tables/data-tables.service.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-availability-policy-scope.repository.js","sourceRoot":"","sources":["../../../../../src/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAA6F;AAC7F,gCAAkC;AAClC,0CAAsD;AAGtD,6GAAgG;AAUzF,IAAM,qCAAqC,GAA3C,MAAM,qCAAsC,SAAQ,mBAA2C;IACrG,YAAY,UAAsB,EAAE,iBAAoC;QACvE,KAAK,CAAC,mEAA2B,EAAE,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAC3E,CAAC;IAMD,KAAK,CAAC,yBAAyB,CAC9B,IAAY,EACZ,SAAwB,EACxB,GAAqB;QAErB,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,mEAA2B,EAAE;YACxE,IAAI;YACJ,SAAS,EAAE,SAAS,IAAI,IAAA,gBAAM,GAAE;SAChC,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,aAAa,CAClB,EAAU,EACV,GAAqB;QAErB,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,mEAA2B,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,KAAK,CAAC,WAAW,CAChB,KAAqB,EACrB,GAAqB;QAErB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QAEpD,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mEAA2B,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;IASD,KAAK,CAAC,mBAAmB,CACxB,EAAU,EACV,aAA2B,EAC3B,SAAiB,EACjB,GAAqB;QAErB,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,EAA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,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;YAC7C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC7B,MAAM,EAAE,CAAC,SAAS,CAAC,mEAA2B,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;YAClF,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;;gDApGY,qCAAqC;IADjD,IAAA,YAAO,GAAE;qCAEe,oBAAU,EAAqB,sBAAiB;GAD5D,qCAAqC,CAoGjD"}
@@ -0,0 +1,18 @@
1
+ import { BaseRepository, TransactionRunner, type OperationContext } from '@n8n/db';
2
+ import { DataSource } from '@n8n/typeorm';
3
+ import type { PolicyRule } from '../../policy-rule.types';
4
+ import { TypeAvailabilityPolicy } from '../entities/type-availability-policy.entity';
5
+ type NewPolicy = {
6
+ kind: string;
7
+ rules: readonly PolicyRule[];
8
+ updatedBy: string;
9
+ };
10
+ export declare class TypeAvailabilityPolicyRepository extends BaseRepository<TypeAvailabilityPolicy> {
11
+ constructor(dataSource: DataSource, transactionRunner: TransactionRunner);
12
+ findById(id: string, ctx: OperationContext): Promise<TypeAvailabilityPolicy | null>;
13
+ findManyByIds(ids: string[], ctx: OperationContext): Promise<TypeAvailabilityPolicy[]>;
14
+ createPolicy(input: NewPolicy, ctx: OperationContext): Promise<TypeAvailabilityPolicy>;
15
+ updateRules(id: string, rules: readonly PolicyRule[], updatedBy: string, ctx: OperationContext): Promise<TypeAvailabilityPolicy | null>;
16
+ deletePolicy(id: string, ctx: OperationContext): Promise<void>;
17
+ }
18
+ export {};
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TypeAvailabilityPolicyRepository = void 0;
13
+ const db_1 = require("@n8n/db");
14
+ const di_1 = require("@n8n/di");
15
+ const typeorm_1 = require("@n8n/typeorm");
16
+ const node_util_1 = require("node:util");
17
+ const type_availability_policy_entity_1 = require("../entities/type-availability-policy.entity");
18
+ function rulesEqual(a, b) {
19
+ return (0, node_util_1.isDeepStrictEqual)([...a], [...b]);
20
+ }
21
+ let TypeAvailabilityPolicyRepository = class TypeAvailabilityPolicyRepository extends db_1.BaseRepository {
22
+ constructor(dataSource, transactionRunner) {
23
+ super(type_availability_policy_entity_1.TypeAvailabilityPolicy, dataSource.manager, transactionRunner);
24
+ }
25
+ async findById(id, ctx) {
26
+ return await this.managerFor(ctx).findOneBy(type_availability_policy_entity_1.TypeAvailabilityPolicy, { id });
27
+ }
28
+ async findManyByIds(ids, ctx) {
29
+ if (ids.length === 0)
30
+ return [];
31
+ return await this.managerFor(ctx).findBy(type_availability_policy_entity_1.TypeAvailabilityPolicy, { id: (0, typeorm_1.In)(ids) });
32
+ }
33
+ async createPolicy(input, ctx) {
34
+ const policy = this.create({
35
+ kind: input.kind,
36
+ rules: [...input.rules],
37
+ updatedBy: input.updatedBy,
38
+ version: 1,
39
+ });
40
+ return await this.managerFor(ctx).save(type_availability_policy_entity_1.TypeAvailabilityPolicy, policy);
41
+ }
42
+ async updateRules(id, rules, updatedBy, ctx) {
43
+ return await this.runInTransaction(ctx, async (tx) => {
44
+ const policy = await tx.findOneBy(type_availability_policy_entity_1.TypeAvailabilityPolicy, { id });
45
+ if (!policy)
46
+ return null;
47
+ if (rulesEqual(policy.rules, rules))
48
+ return policy;
49
+ await tx.update(type_availability_policy_entity_1.TypeAvailabilityPolicy, { id }, { rules: [...rules], updatedBy });
50
+ await tx.increment(type_availability_policy_entity_1.TypeAvailabilityPolicy, { id }, 'version', 1);
51
+ return await tx.findOneBy(type_availability_policy_entity_1.TypeAvailabilityPolicy, { id });
52
+ });
53
+ }
54
+ async deletePolicy(id, ctx) {
55
+ await this.managerFor(ctx).delete(type_availability_policy_entity_1.TypeAvailabilityPolicy, { id });
56
+ }
57
+ };
58
+ exports.TypeAvailabilityPolicyRepository = TypeAvailabilityPolicyRepository;
59
+ exports.TypeAvailabilityPolicyRepository = TypeAvailabilityPolicyRepository = __decorate([
60
+ (0, di_1.Service)(),
61
+ __metadata("design:paramtypes", [typeorm_1.DataSource, db_1.TransactionRunner])
62
+ ], TypeAvailabilityPolicyRepository);
63
+ //# sourceMappingURL=type-availability-policy.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-availability-policy.repository.js","sourceRoot":"","sources":["../../../../../src/modules/type-availability-policies/database/repositories/type-availability-policy.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAmF;AACnF,gCAAkC;AAClC,0CAA8C;AAC9C,yCAA8C;AAG9C,iGAAqF;AAcrF,SAAS,UAAU,CAAC,CAAwB,EAAE,CAAwB;IACrE,OAAO,IAAA,6BAAiB,EAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC;AAGM,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,mBAAsC;IAC3F,YAAY,UAAsB,EAAE,iBAAoC;QACvE,KAAK,CAAC,wDAAsB,EAAE,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU,EAAE,GAAqB;QAC/C,OAAO,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E,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;YAClF,MAAM,EAAE,CAAC,SAAS,CAAC,wDAAsB,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;YAEjE,OAAO,MAAM,EAAE,CAAC,SAAS,CAAC,wDAAsB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACJ,CAAC;IAOD,KAAK,CAAC,YAAY,CAAC,EAAU,EAAE,GAAqB;QACnD,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,wDAAsB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;CACD,CAAA;;2CA/DY,gCAAgC;IAD5C,IAAA,YAAO,GAAE;qCAEe,oBAAU,EAAqB,sBAAiB;GAD5D,gCAAgC,CA+D5C"}
@@ -1,4 +1,5 @@
1
1
  import type { ModuleInterface } from '@n8n/decorators';
2
2
  export declare class TypeAvailabilityPoliciesModule implements ModuleInterface {
3
3
  init(): Promise<void>;
4
+ entities(): Promise<(typeof import("./database/entities/type-availability-policy.entity.js").TypeAvailabilityPolicy | typeof import("./database/entities/type-availability-policy-scope.entity.js").TypeAvailabilityPolicyScope | typeof import("./database/entities/type-availability-policy-attachment.entity.js").TypeAvailabilityPolicyAttachment)[]>;
4
5
  }
@@ -10,6 +10,12 @@ exports.TypeAvailabilityPoliciesModule = void 0;
10
10
  const decorators_1 = require("@n8n/decorators");
11
11
  let TypeAvailabilityPoliciesModule = class TypeAvailabilityPoliciesModule {
12
12
  async init() { }
13
+ async entities() {
14
+ const { TypeAvailabilityPolicy } = await import('./database/entities/type-availability-policy.entity.js');
15
+ const { TypeAvailabilityPolicyScope } = await import('./database/entities/type-availability-policy-scope.entity.js');
16
+ const { TypeAvailabilityPolicyAttachment } = await import('./database/entities/type-availability-policy-attachment.entity.js');
17
+ return [TypeAvailabilityPolicy, TypeAvailabilityPolicyScope, TypeAvailabilityPolicyAttachment];
18
+ }
13
19
  };
14
20
  exports.TypeAvailabilityPoliciesModule = TypeAvailabilityPoliciesModule;
15
21
  exports.TypeAvailabilityPoliciesModule = TypeAvailabilityPoliciesModule = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"type-availability-policies.module.js","sourceRoot":"","sources":["../../../src/modules/type-availability-policies/type-availability-policies.module.ts"],"names":[],"mappings":";;;;;;;;;AACA,gDAAgD;AAGzC,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAC1C,KAAK,CAAC,IAAI,KAAI,CAAC;CACf,CAAA;;yCAFY,8BAA8B;IAD1C,IAAA,0BAAa,EAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC;GACzC,8BAA8B,CAE1C"}
1
+ {"version":3,"file":"type-availability-policies.module.js","sourceRoot":"","sources":["../../../src/modules/type-availability-policies/type-availability-policies.module.ts"],"names":[],"mappings":";;;;;;;;;AACA,gDAAgD;AAGzC,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAC1C,KAAK,CAAC,IAAI,KAAI,CAAC;IAEf,KAAK,CAAC,QAAQ;QACb,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,MAAM,CAC9C,wDAAwD,CACxD,CAAC;QACF,MAAM,EAAE,2BAA2B,EAAE,GAAG,MAAM,MAAM,CACnD,8DAA8D,CAC9D,CAAC;QACF,MAAM,EAAE,gCAAgC,EAAE,GAAG,MAAM,MAAM,CACxD,mEAAmE,CACnE,CAAC;QAEF,OAAO,CAAC,sBAAsB,EAAE,2BAA2B,EAAE,gCAAgC,CAAC,CAAC;IAChG,CAAC;CACD,CAAA;;yCAhBY,8BAA8B;IAD1C,IAAA,0BAAa,EAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC;GACzC,8BAA8B,CAgB1C"}
@@ -2,13 +2,11 @@ import type { CreateWorkflowReviewCommentDto, ListWorkflowReviewActivityQueryDto
2
2
  import { Logger } from '@n8n/backend-common';
3
3
  import { TransactionRunner, UserRepository, WorkflowReviewActivityCommentRepository, WorkflowReviewActivityRepository, WorkflowReviewRequestRepository, type User } from '@n8n/db';
4
4
  import { EventService } from '../../events/event.service';
5
- import { WorkflowReviewAccessService } from './workflow-review-access.service';
6
- import { WorkflowReviewEligibilityService } from './workflow-review-eligibility.service';
5
+ import { WorkflowReviewAuthorizationService } from './workflow-review-authorization.service';
7
6
  import { WorkflowReviewFeatureGate } from './workflow-review-feature-gate.service';
8
7
  export declare class WorkflowReviewActivityService {
9
8
  private readonly featureGate;
10
- private readonly accessService;
11
- private readonly eligibilityService;
9
+ private readonly authorizationService;
12
10
  private readonly activityRepository;
13
11
  private readonly activityCommentRepository;
14
12
  private readonly requestRepository;
@@ -16,7 +14,7 @@ export declare class WorkflowReviewActivityService {
16
14
  private readonly txRunner;
17
15
  private readonly logger;
18
16
  private readonly eventService;
19
- constructor(featureGate: WorkflowReviewFeatureGate, accessService: WorkflowReviewAccessService, eligibilityService: WorkflowReviewEligibilityService, activityRepository: WorkflowReviewActivityRepository, activityCommentRepository: WorkflowReviewActivityCommentRepository, requestRepository: WorkflowReviewRequestRepository, userRepository: UserRepository, txRunner: TransactionRunner, logger: Logger, eventService: EventService);
17
+ constructor(featureGate: WorkflowReviewFeatureGate, authorizationService: WorkflowReviewAuthorizationService, activityRepository: WorkflowReviewActivityRepository, activityCommentRepository: WorkflowReviewActivityCommentRepository, requestRepository: WorkflowReviewRequestRepository, userRepository: UserRepository, txRunner: TransactionRunner, logger: Logger, eventService: EventService);
20
18
  listActivity(user: User, workflowReviewRequestId: string, query: ListWorkflowReviewActivityQueryDto): Promise<ListWorkflowReviewActivityResponse>;
21
19
  createComment(user: User, workflowReviewRequestId: string, dto: CreateWorkflowReviewCommentDto): Promise<WorkflowReviewActivityEntry>;
22
20
  private hydrate;
@@ -17,15 +17,13 @@ const bad_request_error_1 = require("../../errors/response-errors/bad-request.er
17
17
  const conflict_error_1 = require("../../errors/response-errors/conflict.error");
18
18
  const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
19
19
  const event_service_1 = require("../../events/event.service");
20
- const workflow_review_access_service_1 = require("./workflow-review-access.service");
21
- const workflow_review_eligibility_service_1 = require("./workflow-review-eligibility.service");
20
+ const workflow_review_authorization_service_1 = require("./workflow-review-authorization.service");
22
21
  const workflow_review_feature_gate_service_1 = require("./workflow-review-feature-gate.service");
23
22
  const workflow_review_mapper_1 = require("./workflow-review.mapper");
24
23
  let WorkflowReviewActivityService = class WorkflowReviewActivityService {
25
- constructor(featureGate, accessService, eligibilityService, activityRepository, activityCommentRepository, requestRepository, userRepository, txRunner, logger, eventService) {
24
+ constructor(featureGate, authorizationService, activityRepository, activityCommentRepository, requestRepository, userRepository, txRunner, logger, eventService) {
26
25
  this.featureGate = featureGate;
27
- this.accessService = accessService;
28
- this.eligibilityService = eligibilityService;
26
+ this.authorizationService = authorizationService;
29
27
  this.activityRepository = activityRepository;
30
28
  this.activityCommentRepository = activityCommentRepository;
31
29
  this.requestRepository = requestRepository;
@@ -36,7 +34,7 @@ let WorkflowReviewActivityService = class WorkflowReviewActivityService {
36
34
  }
37
35
  async listActivity(user, workflowReviewRequestId, query) {
38
36
  await this.featureGate.assertAvailable();
39
- await this.accessService.findReadableRequestOrFail(user, workflowReviewRequestId);
37
+ await this.authorizationService.findReadableRequestOrFail(user, workflowReviewRequestId);
40
38
  const { entries, hasMore } = await this.activityRepository.findFeedPage({
41
39
  workflowReviewRequestId,
42
40
  limit: query.limit,
@@ -48,8 +46,8 @@ let WorkflowReviewActivityService = class WorkflowReviewActivityService {
48
46
  }
49
47
  async createComment(user, workflowReviewRequestId, dto) {
50
48
  await this.featureGate.assertAvailable();
51
- const access = await this.accessService.findReadableRequestOrFail(user, workflowReviewRequestId);
52
- const eligibility = await this.eligibilityService.resolveViewerEligibility(user, access);
49
+ const access = await this.authorizationService.findReadableRequestOrFail(user, workflowReviewRequestId);
50
+ const eligibility = await this.authorizationService.resolveViewerEligibility(user, access);
53
51
  if (!eligibility.canComment) {
54
52
  throw new forbidden_error_1.ForbiddenError('You are not allowed to comment on this review');
55
53
  }
@@ -106,6 +104,6 @@ let WorkflowReviewActivityService = class WorkflowReviewActivityService {
106
104
  exports.WorkflowReviewActivityService = WorkflowReviewActivityService;
107
105
  exports.WorkflowReviewActivityService = WorkflowReviewActivityService = __decorate([
108
106
  (0, di_1.Service)(),
109
- __metadata("design:paramtypes", [workflow_review_feature_gate_service_1.WorkflowReviewFeatureGate, workflow_review_access_service_1.WorkflowReviewAccessService, workflow_review_eligibility_service_1.WorkflowReviewEligibilityService, db_1.WorkflowReviewActivityRepository, db_1.WorkflowReviewActivityCommentRepository, db_1.WorkflowReviewRequestRepository, db_1.UserRepository, db_1.TransactionRunner, backend_common_1.Logger, event_service_1.EventService])
107
+ __metadata("design:paramtypes", [workflow_review_feature_gate_service_1.WorkflowReviewFeatureGate, workflow_review_authorization_service_1.WorkflowReviewAuthorizationService, db_1.WorkflowReviewActivityRepository, db_1.WorkflowReviewActivityCommentRepository, db_1.WorkflowReviewRequestRepository, db_1.UserRepository, db_1.TransactionRunner, backend_common_1.Logger, event_service_1.EventService])
110
108
  ], WorkflowReviewActivityService);
111
109
  //# sourceMappingURL=workflow-review-activity.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-review-activity.service.js","sourceRoot":"","sources":["../../../src/modules/workflow-reviews.ee/workflow-review-activity.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,wDAA6C;AAC7C,gCAQiB;AACjB,gCAAkC;AAElC,kFAA6E;AAC7E,4EAAwE;AACxE,8EAA0E;AAC1E,0DAAsD;AAEtD,qFAA+E;AAC/E,+FAAyF;AACzF,iGAAmF;AACnF,qEAA+E;AAGxE,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACzC,YACkB,WAAsC,EACtC,aAA0C,EAC1C,kBAAoD,EACpD,kBAAoD,EACpD,yBAAkE,EAClE,iBAAkD,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AAC,CAAC,CAAC;IAC1E,CAAC;IAEO,YAAY,CAAC,EAAU;QAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;IAMO,YAAY,CAAC,MAAc;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAClE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,mCAAe,CAAC,2BAA2B,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,mCAAe,CAAC,2BAA2B,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAAA;;wCAhJY,6BAA6B;IADzC,IAAA,YAAO,GAAE;qCAGsB,gEAAyB,EACvB,4DAA2B,EACtB,sEAAgC,EAChC,qCAAgC,EACzB,4CAAuC,EAC/C,oCAA+B,EAClC,mBAAc,EACpB,sBAAiB,EACnB,uBAAM,EACA,4BAAY;GAXhC,6BAA6B,CAgJzC"}
1
+ {"version":3,"file":"workflow-review-activity.service.js","sourceRoot":"","sources":["../../../src/modules/workflow-reviews.ee/workflow-review-activity.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,wDAA6C;AAC7C,gCAQiB;AACjB,gCAAkC;AAElC,kFAA6E;AAC7E,4EAAwE;AACxE,8EAA0E;AAC1E,0DAAsD;AAEtD,mGAA6F;AAC7F,iGAAmF;AACnF,qEAA+E;AAGxE,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACzC,YAC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IAAI,CAAC,EAAE,EAAE,IAAA,2CAAkB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAEO,YAAY,CAAC,EAAU;QAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;IAMO,YAAY,CAAC,MAAc;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAClE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,mCAAe,CAAC,2BAA2B,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,mCAAe,CAAC,2BAA2B,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAAA;;wCA/IY,6BAA6B;IADzC,IAAA,YAAO,GAAE;qCAGsB,gEAAyB,EAChB,0EAAkC,EACpC,qCAAgC,EACzB,4CAAuC,EAC/C,oCAA+B,EAClC,mBAAc,EACpB,sBAAiB,EACnB,uBAAM,EACA,4BAAY;GAVhC,6BAA6B,CA+IzC"}
@@ -1,14 +1,19 @@
1
+ import type { WorkflowReviewDecisionIneligibilityReason } from '@n8n/api-types';
1
2
  import { ProjectRelationRepository, ProjectRepository, WorkflowReviewRequestAuthorRepository, WorkflowReviewRequestRepository, WorkflowReviewRequestReviewerRepository, WorkflowReviewRequestWorkflowRepository, type InboxVisibility, type User, type WorkflowReviewRequest, type WorkflowReviewRequestWorkflowDetailRow } from '@n8n/db';
2
3
  import { ProjectService } from '../../services/project.service.ee';
3
4
  import { RoleService } from '../../services/role.service';
4
5
  import { WorkflowFinderService } from '../../workflows/workflow-finder.service';
5
6
  export interface ReadableWorkflowReviewRequest {
6
7
  request: WorkflowReviewRequest;
8
+ workflowRows: WorkflowReviewRequestWorkflowDetailRow[];
7
9
  readableWorkflowRows: WorkflowReviewRequestWorkflowDetailRow[];
8
- pinnedWorkflowId: string | null;
9
- canReadPinnedWorkflow: boolean;
10
10
  }
11
- export declare class WorkflowReviewAccessService {
11
+ export interface WorkflowReviewViewerEligibility {
12
+ canDecide: boolean;
13
+ decisionIneligibilityReason: WorkflowReviewDecisionIneligibilityReason | null;
14
+ canComment: boolean;
15
+ }
16
+ export declare class WorkflowReviewAuthorizationService {
12
17
  private readonly workflowFinderService;
13
18
  private readonly projectService;
14
19
  private readonly roleService;
@@ -19,6 +24,9 @@ export declare class WorkflowReviewAccessService {
19
24
  private readonly workflowReviewRequestAuthorRepository;
20
25
  private readonly workflowReviewRequestReviewerRepository;
21
26
  constructor(workflowFinderService: WorkflowFinderService, projectService: ProjectService, roleService: RoleService, projectRepository: ProjectRepository, projectRelationRepository: ProjectRelationRepository, workflowReviewRequestRepository: WorkflowReviewRequestRepository, workflowReviewRequestWorkflowRepository: WorkflowReviewRequestWorkflowRepository, workflowReviewRequestAuthorRepository: WorkflowReviewRequestAuthorRepository, workflowReviewRequestReviewerRepository: WorkflowReviewRequestReviewerRepository);
27
+ isAdminForProject(user: User, projectId: string): Promise<boolean>;
28
+ private isGlobalAdmin;
29
+ private findAdminProjectIds;
22
30
  resolveInboxVisibility(user: User): Promise<InboxVisibility>;
23
31
  private resolveReadableProjectIds;
24
32
  findReadableRequestOrFail(user: User, workflowReviewRequestId: string): Promise<ReadableWorkflowReviewRequest>;
@@ -28,4 +36,5 @@ export declare class WorkflowReviewAccessService {
28
36
  projectId: string;
29
37
  }>): Promise<Set<string>>;
30
38
  private filterReadableWorkflowRows;
39
+ resolveViewerEligibility(user: User, access: Pick<ReadableWorkflowReviewRequest, 'request' | 'workflowRows' | 'readableWorkflowRows'>): Promise<WorkflowReviewViewerEligibility>;
31
40
  }
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.WorkflowReviewAccessService = void 0;
12
+ exports.WorkflowReviewAuthorizationService = void 0;
13
13
  const db_1 = require("@n8n/db");
14
14
  const di_1 = require("@n8n/di");
15
15
  const permissions_1 = require("@n8n/permissions");
@@ -17,7 +17,8 @@ const not_found_error_1 = require("../../errors/response-errors/not-found.error"
17
17
  const project_service_ee_1 = require("../../services/project.service.ee");
18
18
  const role_service_1 = require("../../services/role.service");
19
19
  const workflow_finder_service_1 = require("../../workflows/workflow-finder.service");
20
- let WorkflowReviewAccessService = class WorkflowReviewAccessService {
20
+ const workflow_review_decision_policy_1 = require("./workflow-review-decision-policy");
21
+ let WorkflowReviewAuthorizationService = class WorkflowReviewAuthorizationService {
21
22
  constructor(workflowFinderService, projectService, roleService, projectRepository, projectRelationRepository, workflowReviewRequestRepository, workflowReviewRequestWorkflowRepository, workflowReviewRequestAuthorRepository, workflowReviewRequestReviewerRepository) {
22
23
  this.workflowFinderService = workflowFinderService;
23
24
  this.projectService = projectService;
@@ -29,14 +30,26 @@ let WorkflowReviewAccessService = class WorkflowReviewAccessService {
29
30
  this.workflowReviewRequestAuthorRepository = workflowReviewRequestAuthorRepository;
30
31
  this.workflowReviewRequestReviewerRepository = workflowReviewRequestReviewerRepository;
31
32
  }
33
+ async isAdminForProject(user, projectId) {
34
+ if (this.isGlobalAdmin(user)) {
35
+ return true;
36
+ }
37
+ return (await this.findAdminProjectIds(user)).includes(projectId);
38
+ }
39
+ isGlobalAdmin(user) {
40
+ return user.role.slug === permissions_1.GLOBAL_ADMIN_ROLE_SLUG || user.role.slug === permissions_1.GLOBAL_OWNER_ROLE_SLUG;
41
+ }
42
+ async findAdminProjectIds(user) {
43
+ return await this.projectRelationRepository.getAccessibleProjectsByRoles(user.id, [
44
+ permissions_1.PROJECT_ADMIN_ROLE_SLUG,
45
+ ]);
46
+ }
32
47
  async resolveInboxVisibility(user) {
33
- if (user.role.slug === permissions_1.GLOBAL_ADMIN_ROLE_SLUG || user.role.slug === permissions_1.GLOBAL_OWNER_ROLE_SLUG) {
48
+ if (this.isGlobalAdmin(user)) {
34
49
  return { scope: 'all' };
35
50
  }
36
51
  const [adminProjectIds, readableProjectIds, readableWorkflowRoles] = await Promise.all([
37
- this.projectRelationRepository.getAccessibleProjectsByRoles(user.id, [
38
- permissions_1.PROJECT_ADMIN_ROLE_SLUG,
39
- ]),
52
+ this.findAdminProjectIds(user),
40
53
  this.resolveReadableProjectIds(user),
41
54
  this.roleService.rolesWithScope('workflow', ['workflow:read']),
42
55
  ]);
@@ -68,13 +81,7 @@ let WorkflowReviewAccessService = class WorkflowReviewAccessService {
68
81
  if (workflowRows.length > 0 && readableWorkflowRows.length === 0) {
69
82
  throw new not_found_error_1.NotFoundError('Could not find review request');
70
83
  }
71
- const pinnedWorkflowId = workflowRows.at(0)?.workflowId ?? null;
72
- return {
73
- request,
74
- readableWorkflowRows,
75
- pinnedWorkflowId,
76
- canReadPinnedWorkflow: readableWorkflowRows.some((row) => row.workflowId === pinnedWorkflowId),
77
- };
84
+ return { request, workflowRows, readableWorkflowRows };
78
85
  }
79
86
  async canAccessRequest(user, request) {
80
87
  const visibility = await this.resolveInboxVisibility(user);
@@ -124,10 +131,38 @@ let WorkflowReviewAccessService = class WorkflowReviewAccessService {
124
131
  : null));
125
132
  return readable.filter((row) => row !== null);
126
133
  }
134
+ async resolveViewerEligibility(user, access) {
135
+ const { request, workflowRows, readableWorkflowRows } = access;
136
+ const canReadEveryWorkflow = workflowRows.length > 0 && readableWorkflowRows.length === workflowRows.length;
137
+ if (!canReadEveryWorkflow) {
138
+ return {
139
+ canDecide: false,
140
+ decisionIneligibilityReason: 'missing_permission',
141
+ canComment: false,
142
+ };
143
+ }
144
+ const participant = { workflowReviewRequestId: request.id, userId: user.id };
145
+ const [isAuthor, isAssignedReviewer, hasAdminOverride] = await Promise.all([
146
+ this.workflowReviewRequestAuthorRepository.isAuthor(participant, {}),
147
+ this.workflowReviewRequestReviewerRepository.isReviewer(participant, {}),
148
+ this.isAdminForProject(user, request.projectId),
149
+ ]);
150
+ const capability = (0, workflow_review_decision_policy_1.resolveDecisionCapability)({
151
+ canReadEveryWorkflow,
152
+ isAuthor,
153
+ isAssignedReviewer,
154
+ hasAdminOverride,
155
+ });
156
+ return {
157
+ canDecide: capability.allowed,
158
+ decisionIneligibilityReason: capability.allowed ? null : capability.reason,
159
+ canComment: capability.allowed || isAuthor,
160
+ };
161
+ }
127
162
  };
128
- exports.WorkflowReviewAccessService = WorkflowReviewAccessService;
129
- exports.WorkflowReviewAccessService = WorkflowReviewAccessService = __decorate([
163
+ exports.WorkflowReviewAuthorizationService = WorkflowReviewAuthorizationService;
164
+ exports.WorkflowReviewAuthorizationService = WorkflowReviewAuthorizationService = __decorate([
130
165
  (0, di_1.Service)(),
131
166
  __metadata("design:paramtypes", [workflow_finder_service_1.WorkflowFinderService, project_service_ee_1.ProjectService, role_service_1.RoleService, db_1.ProjectRepository, db_1.ProjectRelationRepository, db_1.WorkflowReviewRequestRepository, db_1.WorkflowReviewRequestWorkflowRepository, db_1.WorkflowReviewRequestAuthorRepository, db_1.WorkflowReviewRequestReviewerRepository])
132
- ], WorkflowReviewAccessService);
133
- //# sourceMappingURL=workflow-review-access.service.js.map
167
+ ], WorkflowReviewAuthorizationService);
168
+ //# sourceMappingURL=workflow-review-authorization.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-review-authorization.service.js","sourceRoot":"","sources":["../../../src/modules/workflow-reviews.ee/workflow-review-authorization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gCAWiB;AACjB,gCAAkC;AAClC,kDAK0B;AAE1B,8EA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CAAC,qCAAqC,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;YACpE,IAAI,CAAC,uCAAuC,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;YACxE,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC;SAC/C,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,IAAA,2DAAyB,EAAC;YAC5C,oBAAoB;YACpB,QAAQ;YACR,kBAAkB;YAClB,gBAAgB;SAChB,CAAC,CAAC;QAEH,OAAO;YACN,SAAS,EAAE,UAAU,CAAC,OAAO;YAC7B,2BAA2B,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM;YAE1E,UAAU,EAAE,UAAU,CAAC,OAAO,IAAI,QAAQ;SAC1C,CAAC;IACH,CAAC;CAGD,CAAA;;6CA1QY,kCAAkC;IAD9C,IAAA,YAAO,GAAE;qCAGgC,+CAAqB,EAC5B,mCAAc,EACjB,0BAAW,EACL,sBAAiB,EACT,8BAAyB,EACnB,oCAA+B,EACvB,4CAAuC,EACzC,0CAAqC,EACnC,4CAAuC;GAVtF,kCAAkC,CA0Q9C"}
@@ -0,0 +1,14 @@
1
+ import type { WorkflowReviewDecisionIneligibilityReason } from '@n8n/api-types';
2
+ export interface WorkflowReviewDecisionFacts {
3
+ canReadEveryWorkflow: boolean;
4
+ isAuthor: boolean;
5
+ isAssignedReviewer: boolean;
6
+ hasAdminOverride: boolean;
7
+ }
8
+ export type WorkflowReviewDecisionCapability = {
9
+ allowed: true;
10
+ } | {
11
+ allowed: false;
12
+ reason: WorkflowReviewDecisionIneligibilityReason;
13
+ };
14
+ export declare function resolveDecisionCapability(facts: WorkflowReviewDecisionFacts): WorkflowReviewDecisionCapability;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveDecisionCapability = resolveDecisionCapability;
4
+ const ALLOWED = { allowed: true };
5
+ function resolveDecisionCapability(facts) {
6
+ if (!facts.canReadEveryWorkflow) {
7
+ return { allowed: false, reason: 'missing_permission' };
8
+ }
9
+ if (facts.hasAdminOverride || facts.isAssignedReviewer) {
10
+ return ALLOWED;
11
+ }
12
+ if (facts.isAuthor) {
13
+ return { allowed: false, reason: 'author' };
14
+ }
15
+ return { allowed: false, reason: 'missing_reviewer_permission' };
16
+ }
17
+ //# sourceMappingURL=workflow-review-decision-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-review-decision-policy.js","sourceRoot":"","sources":["../../../src/modules/workflow-reviews.ee/workflow-review-decision-policy.ts"],"names":[],"mappings":";;;AAkBA,MAAM,OAAO,GAAqC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAapE,mCACC,KAAkC;IAIlC,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE,CAAC;QACjC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC;IACzD,CAAC;IAED,IAAI,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC;QACxD,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC7C,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,6BAA6B,EAAE,CAAC;AAClE,CAAC"}
@@ -1,29 +1,25 @@
1
1
  import type { GetWorkflowReviewInboxSummaryResponse, ListWorkflowReviewInboxQueryDto, ListWorkflowReviewInboxResponse, WorkflowReviewRequestDetail } from '@n8n/api-types';
2
- import { UserRepository, WorkflowReviewRequestAuthorRepository, WorkflowReviewRequestRepository, WorkflowReviewRequestReviewerRepository, WorkflowReviewRequestWorkflowRepository, type User } from '@n8n/db';
2
+ import { WorkflowReviewInboxRepository, WorkflowReviewRequestWorkflowRepository, type User } from '@n8n/db';
3
3
  import { WorkflowHistoryService } from '../../workflows/workflow-history/workflow-history.service';
4
- import { WorkflowReviewAccessService } from './workflow-review-access.service';
5
- import { WorkflowReviewEligibilityService } from './workflow-review-eligibility.service';
4
+ import { WorkflowReviewAuthorizationService } from './workflow-review-authorization.service';
6
5
  import { WorkflowReviewFeatureGate } from './workflow-review-feature-gate.service';
6
+ import { WorkflowReviewParticipantResolver } from './workflow-review-participant.resolver';
7
7
  export declare class WorkflowReviewInboxService {
8
8
  private readonly featureGate;
9
- private readonly accessService;
9
+ private readonly authorizationService;
10
10
  private readonly workflowHistoryService;
11
- private readonly workflowReviewRequestRepository;
11
+ private readonly workflowReviewInboxRepository;
12
12
  private readonly workflowReviewRequestWorkflowRepository;
13
- private readonly workflowReviewRequestReviewerRepository;
14
- private readonly workflowReviewRequestAuthorRepository;
15
- private readonly userRepository;
16
- private readonly eligibilityService;
17
- constructor(featureGate: WorkflowReviewFeatureGate, accessService: WorkflowReviewAccessService, workflowHistoryService: WorkflowHistoryService, workflowReviewRequestRepository: WorkflowReviewRequestRepository, workflowReviewRequestWorkflowRepository: WorkflowReviewRequestWorkflowRepository, workflowReviewRequestReviewerRepository: WorkflowReviewRequestReviewerRepository, workflowReviewRequestAuthorRepository: WorkflowReviewRequestAuthorRepository, userRepository: UserRepository, eligibilityService: WorkflowReviewEligibilityService);
13
+ private readonly participantResolver;
14
+ constructor(featureGate: WorkflowReviewFeatureGate, authorizationService: WorkflowReviewAuthorizationService, workflowHistoryService: WorkflowHistoryService, workflowReviewInboxRepository: WorkflowReviewInboxRepository, workflowReviewRequestWorkflowRepository: WorkflowReviewRequestWorkflowRepository, participantResolver: WorkflowReviewParticipantResolver);
18
15
  listForInbox(user: User, query: ListWorkflowReviewInboxQueryDto): Promise<ListWorkflowReviewInboxResponse>;
19
16
  getInboxSummaryForUser(user: User): Promise<GetWorkflowReviewInboxSummaryResponse>;
20
17
  getDetail(user: User, workflowReviewRequestId: string): Promise<WorkflowReviewRequestDetail>;
21
- private resolveParticipants;
22
18
  private toWorkflowDetail;
23
19
  private findVersionSnapshot;
24
20
  private toVersionSnapshot;
25
- private hydrateParticipants;
26
21
  private encodeInboxCursor;
27
22
  private decodeInboxCursor;
23
+ private toReviewSummary;
28
24
  private toInboxItem;
29
25
  }