n8n-atom-mcp 0.0.1

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 (794) hide show
  1. package/.env.example +220 -0
  2. package/LICENSE +21 -0
  3. package/README.md +78 -0
  4. package/data/nodes.db +0 -0
  5. package/dist/community/community-node-fetcher.d.ts +118 -0
  6. package/dist/community/community-node-fetcher.d.ts.map +1 -0
  7. package/dist/community/community-node-fetcher.js +239 -0
  8. package/dist/community/community-node-fetcher.js.map +1 -0
  9. package/dist/community/community-node-service.d.ts +42 -0
  10. package/dist/community/community-node-service.d.ts.map +1 -0
  11. package/dist/community/community-node-service.js +210 -0
  12. package/dist/community/community-node-service.js.map +1 -0
  13. package/dist/community/documentation-batch-processor.d.ts +33 -0
  14. package/dist/community/documentation-batch-processor.d.ts.map +1 -0
  15. package/dist/community/documentation-batch-processor.js +156 -0
  16. package/dist/community/documentation-batch-processor.js.map +1 -0
  17. package/dist/community/documentation-generator.d.ts +65 -0
  18. package/dist/community/documentation-generator.d.ts.map +1 -0
  19. package/dist/community/documentation-generator.js +220 -0
  20. package/dist/community/documentation-generator.js.map +1 -0
  21. package/dist/community/index.d.ts +5 -0
  22. package/dist/community/index.d.ts.map +1 -0
  23. package/dist/community/index.js +14 -0
  24. package/dist/community/index.js.map +1 -0
  25. package/dist/config/n8n-api.d.ts +15 -0
  26. package/dist/config/n8n-api.d.ts.map +1 -0
  27. package/dist/config/n8n-api.js +53 -0
  28. package/dist/config/n8n-api.js.map +1 -0
  29. package/dist/constants/type-structures.d.ts +123 -0
  30. package/dist/constants/type-structures.d.ts.map +1 -0
  31. package/dist/constants/type-structures.js +654 -0
  32. package/dist/constants/type-structures.js.map +1 -0
  33. package/dist/database/database-adapter.d.ts +33 -0
  34. package/dist/database/database-adapter.d.ts.map +1 -0
  35. package/dist/database/database-adapter.js +420 -0
  36. package/dist/database/database-adapter.js.map +1 -0
  37. package/dist/database/node-repository.d.ts +152 -0
  38. package/dist/database/node-repository.d.ts.map +1 -0
  39. package/dist/database/node-repository.js +791 -0
  40. package/dist/database/node-repository.js.map +1 -0
  41. package/dist/errors/validation-service-error.d.ts +10 -0
  42. package/dist/errors/validation-service-error.d.ts.map +1 -0
  43. package/dist/errors/validation-service-error.js +26 -0
  44. package/dist/errors/validation-service-error.js.map +1 -0
  45. package/dist/http-server-single-session.d.ts +52 -0
  46. package/dist/http-server-single-session.d.ts.map +1 -0
  47. package/dist/http-server-single-session.js +1180 -0
  48. package/dist/http-server-single-session.js.map +1 -0
  49. package/dist/http-server.d.ts +9 -0
  50. package/dist/http-server.d.ts.map +1 -0
  51. package/dist/http-server.js +481 -0
  52. package/dist/http-server.js.map +1 -0
  53. package/dist/index.d.ts +11 -0
  54. package/dist/index.d.ts.map +1 -0
  55. package/dist/index.js +20 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/loaders/node-loader.d.ts +11 -0
  58. package/dist/loaders/node-loader.d.ts.map +1 -0
  59. package/dist/loaders/node-loader.js +79 -0
  60. package/dist/loaders/node-loader.js.map +1 -0
  61. package/dist/mappers/docs-mapper.d.ts +7 -0
  62. package/dist/mappers/docs-mapper.d.ts.map +1 -0
  63. package/dist/mappers/docs-mapper.js +106 -0
  64. package/dist/mappers/docs-mapper.js.map +1 -0
  65. package/dist/mcp/handlers-n8n-manager.d.ts +58 -0
  66. package/dist/mcp/handlers-n8n-manager.d.ts.map +1 -0
  67. package/dist/mcp/handlers-n8n-manager.js +3299 -0
  68. package/dist/mcp/handlers-n8n-manager.js.map +1 -0
  69. package/dist/mcp/handlers-workflow-diff.d.ts +5 -0
  70. package/dist/mcp/handlers-workflow-diff.d.ts.map +1 -0
  71. package/dist/mcp/handlers-workflow-diff.js +461 -0
  72. package/dist/mcp/handlers-workflow-diff.js.map +1 -0
  73. package/dist/mcp/index.d.ts +3 -0
  74. package/dist/mcp/index.d.ts.map +1 -0
  75. package/dist/mcp/index.js +228 -0
  76. package/dist/mcp/index.js.map +1 -0
  77. package/dist/mcp/server.d.ts +82 -0
  78. package/dist/mcp/server.d.ts.map +1 -0
  79. package/dist/mcp/server.js +3006 -0
  80. package/dist/mcp/server.js.map +1 -0
  81. package/dist/mcp/stdio-wrapper.d.ts +3 -0
  82. package/dist/mcp/stdio-wrapper.d.ts.map +1 -0
  83. package/dist/mcp/stdio-wrapper.js +81 -0
  84. package/dist/mcp/stdio-wrapper.js.map +1 -0
  85. package/dist/mcp/tool-docs/configuration/get-node.d.ts +3 -0
  86. package/dist/mcp/tool-docs/configuration/get-node.d.ts.map +1 -0
  87. package/dist/mcp/tool-docs/configuration/get-node.js +90 -0
  88. package/dist/mcp/tool-docs/configuration/get-node.js.map +1 -0
  89. package/dist/mcp/tool-docs/configuration/index.d.ts +2 -0
  90. package/dist/mcp/tool-docs/configuration/index.d.ts.map +1 -0
  91. package/dist/mcp/tool-docs/configuration/index.js +6 -0
  92. package/dist/mcp/tool-docs/configuration/index.js.map +1 -0
  93. package/dist/mcp/tool-docs/discovery/index.d.ts +2 -0
  94. package/dist/mcp/tool-docs/discovery/index.d.ts.map +1 -0
  95. package/dist/mcp/tool-docs/discovery/index.js +6 -0
  96. package/dist/mcp/tool-docs/discovery/index.js.map +1 -0
  97. package/dist/mcp/tool-docs/discovery/search-nodes.d.ts +3 -0
  98. package/dist/mcp/tool-docs/discovery/search-nodes.d.ts.map +1 -0
  99. package/dist/mcp/tool-docs/discovery/search-nodes.js +70 -0
  100. package/dist/mcp/tool-docs/discovery/search-nodes.js.map +1 -0
  101. package/dist/mcp/tool-docs/guides/ai-agents-guide.d.ts +3 -0
  102. package/dist/mcp/tool-docs/guides/ai-agents-guide.d.ts.map +1 -0
  103. package/dist/mcp/tool-docs/guides/ai-agents-guide.js +739 -0
  104. package/dist/mcp/tool-docs/guides/ai-agents-guide.js.map +1 -0
  105. package/dist/mcp/tool-docs/guides/index.d.ts +2 -0
  106. package/dist/mcp/tool-docs/guides/index.d.ts.map +1 -0
  107. package/dist/mcp/tool-docs/guides/index.js +6 -0
  108. package/dist/mcp/tool-docs/guides/index.js.map +1 -0
  109. package/dist/mcp/tool-docs/index.d.ts +4 -0
  110. package/dist/mcp/tool-docs/index.d.ts.map +1 -0
  111. package/dist/mcp/tool-docs/index.js +34 -0
  112. package/dist/mcp/tool-docs/index.js.map +1 -0
  113. package/dist/mcp/tool-docs/system/index.d.ts +3 -0
  114. package/dist/mcp/tool-docs/system/index.d.ts.map +1 -0
  115. package/dist/mcp/tool-docs/system/index.js +8 -0
  116. package/dist/mcp/tool-docs/system/index.js.map +1 -0
  117. package/dist/mcp/tool-docs/system/n8n-diagnostic.d.ts +3 -0
  118. package/dist/mcp/tool-docs/system/n8n-diagnostic.d.ts.map +1 -0
  119. package/dist/mcp/tool-docs/system/n8n-diagnostic.js +99 -0
  120. package/dist/mcp/tool-docs/system/n8n-diagnostic.js.map +1 -0
  121. package/dist/mcp/tool-docs/system/n8n-health-check.d.ts +3 -0
  122. package/dist/mcp/tool-docs/system/n8n-health-check.d.ts.map +1 -0
  123. package/dist/mcp/tool-docs/system/n8n-health-check.js +102 -0
  124. package/dist/mcp/tool-docs/system/n8n-health-check.js.map +1 -0
  125. package/dist/mcp/tool-docs/system/n8n-list-available-tools.d.ts +3 -0
  126. package/dist/mcp/tool-docs/system/n8n-list-available-tools.d.ts.map +1 -0
  127. package/dist/mcp/tool-docs/system/n8n-list-available-tools.js +75 -0
  128. package/dist/mcp/tool-docs/system/n8n-list-available-tools.js.map +1 -0
  129. package/dist/mcp/tool-docs/system/tools-documentation.d.ts +3 -0
  130. package/dist/mcp/tool-docs/system/tools-documentation.d.ts.map +1 -0
  131. package/dist/mcp/tool-docs/system/tools-documentation.js +65 -0
  132. package/dist/mcp/tool-docs/system/tools-documentation.js.map +1 -0
  133. package/dist/mcp/tool-docs/templates/get-template.d.ts +3 -0
  134. package/dist/mcp/tool-docs/templates/get-template.d.ts.map +1 -0
  135. package/dist/mcp/tool-docs/templates/get-template.js +84 -0
  136. package/dist/mcp/tool-docs/templates/get-template.js.map +1 -0
  137. package/dist/mcp/tool-docs/templates/index.d.ts +3 -0
  138. package/dist/mcp/tool-docs/templates/index.d.ts.map +1 -0
  139. package/dist/mcp/tool-docs/templates/index.js +8 -0
  140. package/dist/mcp/tool-docs/templates/index.js.map +1 -0
  141. package/dist/mcp/tool-docs/templates/search-templates.d.ts +3 -0
  142. package/dist/mcp/tool-docs/templates/search-templates.d.ts.map +1 -0
  143. package/dist/mcp/tool-docs/templates/search-templates.js +143 -0
  144. package/dist/mcp/tool-docs/templates/search-templates.js.map +1 -0
  145. package/dist/mcp/tool-docs/types.d.ts +32 -0
  146. package/dist/mcp/tool-docs/types.d.ts.map +1 -0
  147. package/dist/mcp/tool-docs/types.js +3 -0
  148. package/dist/mcp/tool-docs/types.js.map +1 -0
  149. package/dist/mcp/tool-docs/validation/index.d.ts +3 -0
  150. package/dist/mcp/tool-docs/validation/index.d.ts.map +1 -0
  151. package/dist/mcp/tool-docs/validation/index.js +8 -0
  152. package/dist/mcp/tool-docs/validation/index.js.map +1 -0
  153. package/dist/mcp/tool-docs/validation/validate-node.d.ts +3 -0
  154. package/dist/mcp/tool-docs/validation/validate-node.d.ts.map +1 -0
  155. package/dist/mcp/tool-docs/validation/validate-node.js +82 -0
  156. package/dist/mcp/tool-docs/validation/validate-node.js.map +1 -0
  157. package/dist/mcp/tool-docs/validation/validate-workflow.d.ts +3 -0
  158. package/dist/mcp/tool-docs/validation/validate-workflow.d.ts.map +1 -0
  159. package/dist/mcp/tool-docs/validation/validate-workflow.js +86 -0
  160. package/dist/mcp/tool-docs/validation/validate-workflow.js.map +1 -0
  161. package/dist/mcp/tool-docs/workflow_management/index.d.ts +13 -0
  162. package/dist/mcp/tool-docs/workflow_management/index.d.ts.map +1 -0
  163. package/dist/mcp/tool-docs/workflow_management/index.js +28 -0
  164. package/dist/mcp/tool-docs/workflow_management/index.js.map +1 -0
  165. package/dist/mcp/tool-docs/workflow_management/n8n-autofix-workflow.d.ts +3 -0
  166. package/dist/mcp/tool-docs/workflow_management/n8n-autofix-workflow.d.ts.map +1 -0
  167. package/dist/mcp/tool-docs/workflow_management/n8n-autofix-workflow.js +162 -0
  168. package/dist/mcp/tool-docs/workflow_management/n8n-autofix-workflow.js.map +1 -0
  169. package/dist/mcp/tool-docs/workflow_management/n8n-create-workflow.d.ts +3 -0
  170. package/dist/mcp/tool-docs/workflow_management/n8n-create-workflow.d.ts.map +1 -0
  171. package/dist/mcp/tool-docs/workflow_management/n8n-create-workflow.js +102 -0
  172. package/dist/mcp/tool-docs/workflow_management/n8n-create-workflow.js.map +1 -0
  173. package/dist/mcp/tool-docs/workflow_management/n8n-delete-workflow.d.ts +3 -0
  174. package/dist/mcp/tool-docs/workflow_management/n8n-delete-workflow.d.ts.map +1 -0
  175. package/dist/mcp/tool-docs/workflow_management/n8n-delete-workflow.js +52 -0
  176. package/dist/mcp/tool-docs/workflow_management/n8n-delete-workflow.js.map +1 -0
  177. package/dist/mcp/tool-docs/workflow_management/n8n-deploy-template.d.ts +3 -0
  178. package/dist/mcp/tool-docs/workflow_management/n8n-deploy-template.d.ts.map +1 -0
  179. package/dist/mcp/tool-docs/workflow_management/n8n-deploy-template.js +73 -0
  180. package/dist/mcp/tool-docs/workflow_management/n8n-deploy-template.js.map +1 -0
  181. package/dist/mcp/tool-docs/workflow_management/n8n-executions.d.ts +3 -0
  182. package/dist/mcp/tool-docs/workflow_management/n8n-executions.d.ts.map +1 -0
  183. package/dist/mcp/tool-docs/workflow_management/n8n-executions.js +109 -0
  184. package/dist/mcp/tool-docs/workflow_management/n8n-executions.js.map +1 -0
  185. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow.d.ts +3 -0
  186. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow.d.ts.map +1 -0
  187. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow.js +68 -0
  188. package/dist/mcp/tool-docs/workflow_management/n8n-get-workflow.js.map +1 -0
  189. package/dist/mcp/tool-docs/workflow_management/n8n-list-workflows.d.ts +3 -0
  190. package/dist/mcp/tool-docs/workflow_management/n8n-list-workflows.d.ts.map +1 -0
  191. package/dist/mcp/tool-docs/workflow_management/n8n-list-workflows.js +57 -0
  192. package/dist/mcp/tool-docs/workflow_management/n8n-list-workflows.js.map +1 -0
  193. package/dist/mcp/tool-docs/workflow_management/n8n-test-workflow.d.ts +3 -0
  194. package/dist/mcp/tool-docs/workflow_management/n8n-test-workflow.d.ts.map +1 -0
  195. package/dist/mcp/tool-docs/workflow_management/n8n-test-workflow.js +140 -0
  196. package/dist/mcp/tool-docs/workflow_management/n8n-test-workflow.js.map +1 -0
  197. package/dist/mcp/tool-docs/workflow_management/n8n-update-full-workflow.d.ts +3 -0
  198. package/dist/mcp/tool-docs/workflow_management/n8n-update-full-workflow.d.ts.map +1 -0
  199. package/dist/mcp/tool-docs/workflow_management/n8n-update-full-workflow.js +61 -0
  200. package/dist/mcp/tool-docs/workflow_management/n8n-update-full-workflow.js.map +1 -0
  201. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.d.ts +3 -0
  202. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.d.ts.map +1 -0
  203. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.js +420 -0
  204. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.js.map +1 -0
  205. package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.d.ts +3 -0
  206. package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.d.ts.map +1 -0
  207. package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.js +73 -0
  208. package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.js.map +1 -0
  209. package/dist/mcp/tool-docs/workflow_management/n8n-workflow-versions.d.ts +3 -0
  210. package/dist/mcp/tool-docs/workflow_management/n8n-workflow-versions.d.ts.map +1 -0
  211. package/dist/mcp/tool-docs/workflow_management/n8n-workflow-versions.js +170 -0
  212. package/dist/mcp/tool-docs/workflow_management/n8n-workflow-versions.js.map +1 -0
  213. package/dist/mcp/tools-documentation.d.ts +6 -0
  214. package/dist/mcp/tools-documentation.d.ts.map +1 -0
  215. package/dist/mcp/tools-documentation.js +682 -0
  216. package/dist/mcp/tools-documentation.js.map +1 -0
  217. package/dist/mcp/tools-file-operations.d.ts +154 -0
  218. package/dist/mcp/tools-file-operations.d.ts.map +1 -0
  219. package/dist/mcp/tools-file-operations.js +213 -0
  220. package/dist/mcp/tools-file-operations.js.map +1 -0
  221. package/dist/mcp/tools-n8n-friendly.d.ts +6 -0
  222. package/dist/mcp/tools-n8n-friendly.d.ts.map +1 -0
  223. package/dist/mcp/tools-n8n-friendly.js +89 -0
  224. package/dist/mcp/tools-n8n-friendly.js.map +1 -0
  225. package/dist/mcp/tools-n8n-manager.d.ts +3 -0
  226. package/dist/mcp/tools-n8n-manager.d.ts.map +1 -0
  227. package/dist/mcp/tools-n8n-manager.js +1320 -0
  228. package/dist/mcp/tools-n8n-manager.js.map +1 -0
  229. package/dist/mcp/tools.d.ts +3 -0
  230. package/dist/mcp/tools.d.ts.map +1 -0
  231. package/dist/mcp/tools.js +424 -0
  232. package/dist/mcp/tools.js.map +1 -0
  233. package/dist/mcp/workflow-examples.d.ts +76 -0
  234. package/dist/mcp/workflow-examples.d.ts.map +1 -0
  235. package/dist/mcp/workflow-examples.js +111 -0
  236. package/dist/mcp/workflow-examples.js.map +1 -0
  237. package/dist/mcp-engine.d.ts +36 -0
  238. package/dist/mcp-engine.d.ts.map +1 -0
  239. package/dist/mcp-engine.js +77 -0
  240. package/dist/mcp-engine.js.map +1 -0
  241. package/dist/mcp-tools-engine.d.ts +47 -0
  242. package/dist/mcp-tools-engine.d.ts.map +1 -0
  243. package/dist/mcp-tools-engine.js +89 -0
  244. package/dist/mcp-tools-engine.js.map +1 -0
  245. package/dist/n8n/MCPApi.credentials.d.ts +8 -0
  246. package/dist/n8n/MCPApi.credentials.d.ts.map +1 -0
  247. package/dist/n8n/MCPApi.credentials.js +53 -0
  248. package/dist/n8n/MCPApi.credentials.js.map +1 -0
  249. package/dist/n8n/MCPNode.node.d.ts +13 -0
  250. package/dist/n8n/MCPNode.node.d.ts.map +1 -0
  251. package/dist/n8n/MCPNode.node.js +260 -0
  252. package/dist/n8n/MCPNode.node.js.map +1 -0
  253. package/dist/parsers/node-parser.d.ts +38 -0
  254. package/dist/parsers/node-parser.d.ts.map +1 -0
  255. package/dist/parsers/node-parser.js +250 -0
  256. package/dist/parsers/node-parser.js.map +1 -0
  257. package/dist/parsers/property-extractor.d.ts +11 -0
  258. package/dist/parsers/property-extractor.d.ts.map +1 -0
  259. package/dist/parsers/property-extractor.js +172 -0
  260. package/dist/parsers/property-extractor.js.map +1 -0
  261. package/dist/parsers/simple-parser.d.ts +25 -0
  262. package/dist/parsers/simple-parser.d.ts.map +1 -0
  263. package/dist/parsers/simple-parser.js +212 -0
  264. package/dist/parsers/simple-parser.js.map +1 -0
  265. package/dist/scripts/debug-http-search.d.ts +3 -0
  266. package/dist/scripts/debug-http-search.d.ts.map +1 -0
  267. package/dist/scripts/debug-http-search.js +57 -0
  268. package/dist/scripts/debug-http-search.js.map +1 -0
  269. package/dist/scripts/extract-from-docker.d.ts +3 -0
  270. package/dist/scripts/extract-from-docker.d.ts.map +1 -0
  271. package/dist/scripts/extract-from-docker.js +210 -0
  272. package/dist/scripts/extract-from-docker.js.map +1 -0
  273. package/dist/scripts/fetch-community-nodes.d.ts +3 -0
  274. package/dist/scripts/fetch-community-nodes.d.ts.map +1 -0
  275. package/dist/scripts/fetch-community-nodes.js +114 -0
  276. package/dist/scripts/fetch-community-nodes.js.map +1 -0
  277. package/dist/scripts/fetch-templates-robust.d.ts +4 -0
  278. package/dist/scripts/fetch-templates-robust.d.ts.map +1 -0
  279. package/dist/scripts/fetch-templates-robust.js +132 -0
  280. package/dist/scripts/fetch-templates-robust.js.map +1 -0
  281. package/dist/scripts/fetch-templates.d.ts +4 -0
  282. package/dist/scripts/fetch-templates.d.ts.map +1 -0
  283. package/dist/scripts/fetch-templates.js +411 -0
  284. package/dist/scripts/fetch-templates.js.map +1 -0
  285. package/dist/scripts/generate-community-docs.d.ts +3 -0
  286. package/dist/scripts/generate-community-docs.d.ts.map +1 -0
  287. package/dist/scripts/generate-community-docs.js +183 -0
  288. package/dist/scripts/generate-community-docs.js.map +1 -0
  289. package/dist/scripts/migrate-readme-columns.d.ts +2 -0
  290. package/dist/scripts/migrate-readme-columns.d.ts.map +1 -0
  291. package/dist/scripts/migrate-readme-columns.js +62 -0
  292. package/dist/scripts/migrate-readme-columns.js.map +1 -0
  293. package/dist/scripts/rebuild-database.d.ts +4 -0
  294. package/dist/scripts/rebuild-database.d.ts.map +1 -0
  295. package/dist/scripts/rebuild-database.js +95 -0
  296. package/dist/scripts/rebuild-database.js.map +1 -0
  297. package/dist/scripts/rebuild-optimized.d.ts +3 -0
  298. package/dist/scripts/rebuild-optimized.d.ts.map +1 -0
  299. package/dist/scripts/rebuild-optimized.js +198 -0
  300. package/dist/scripts/rebuild-optimized.js.map +1 -0
  301. package/dist/scripts/rebuild.d.ts +3 -0
  302. package/dist/scripts/rebuild.d.ts.map +1 -0
  303. package/dist/scripts/rebuild.js +258 -0
  304. package/dist/scripts/rebuild.js.map +1 -0
  305. package/dist/scripts/sanitize-templates.d.ts +3 -0
  306. package/dist/scripts/sanitize-templates.d.ts.map +1 -0
  307. package/dist/scripts/sanitize-templates.js +88 -0
  308. package/dist/scripts/sanitize-templates.js.map +1 -0
  309. package/dist/scripts/seed-canonical-ai-examples.d.ts +4 -0
  310. package/dist/scripts/seed-canonical-ai-examples.d.ts.map +1 -0
  311. package/dist/scripts/seed-canonical-ai-examples.js +121 -0
  312. package/dist/scripts/seed-canonical-ai-examples.js.map +1 -0
  313. package/dist/scripts/test-autofix-documentation.d.ts +3 -0
  314. package/dist/scripts/test-autofix-documentation.d.ts.map +1 -0
  315. package/dist/scripts/test-autofix-documentation.js +103 -0
  316. package/dist/scripts/test-autofix-documentation.js.map +1 -0
  317. package/dist/scripts/test-autofix-workflow.d.ts +2 -0
  318. package/dist/scripts/test-autofix-workflow.d.ts.map +1 -0
  319. package/dist/scripts/test-autofix-workflow.js +223 -0
  320. package/dist/scripts/test-autofix-workflow.js.map +1 -0
  321. package/dist/scripts/test-execution-filtering.d.ts +3 -0
  322. package/dist/scripts/test-execution-filtering.d.ts.map +1 -0
  323. package/dist/scripts/test-execution-filtering.js +206 -0
  324. package/dist/scripts/test-execution-filtering.js.map +1 -0
  325. package/dist/scripts/test-node-suggestions.d.ts +3 -0
  326. package/dist/scripts/test-node-suggestions.d.ts.map +1 -0
  327. package/dist/scripts/test-node-suggestions.js +165 -0
  328. package/dist/scripts/test-node-suggestions.js.map +1 -0
  329. package/dist/scripts/test-protocol-negotiation.d.ts +3 -0
  330. package/dist/scripts/test-protocol-negotiation.d.ts.map +1 -0
  331. package/dist/scripts/test-protocol-negotiation.js +154 -0
  332. package/dist/scripts/test-protocol-negotiation.js.map +1 -0
  333. package/dist/scripts/test-summary.d.ts +3 -0
  334. package/dist/scripts/test-summary.d.ts.map +1 -0
  335. package/dist/scripts/test-summary.js +77 -0
  336. package/dist/scripts/test-summary.js.map +1 -0
  337. package/dist/scripts/test-telemetry-mutations-verbose.d.ts +2 -0
  338. package/dist/scripts/test-telemetry-mutations-verbose.d.ts.map +1 -0
  339. package/dist/scripts/test-telemetry-mutations-verbose.js +133 -0
  340. package/dist/scripts/test-telemetry-mutations-verbose.js.map +1 -0
  341. package/dist/scripts/test-telemetry-mutations.d.ts +2 -0
  342. package/dist/scripts/test-telemetry-mutations.d.ts.map +1 -0
  343. package/dist/scripts/test-telemetry-mutations.js +129 -0
  344. package/dist/scripts/test-telemetry-mutations.js.map +1 -0
  345. package/dist/scripts/test-webhook-autofix.d.ts +3 -0
  346. package/dist/scripts/test-webhook-autofix.d.ts.map +1 -0
  347. package/dist/scripts/test-webhook-autofix.js +117 -0
  348. package/dist/scripts/test-webhook-autofix.js.map +1 -0
  349. package/dist/scripts/validate.d.ts +3 -0
  350. package/dist/scripts/validate.d.ts.map +1 -0
  351. package/dist/scripts/validate.js +121 -0
  352. package/dist/scripts/validate.js.map +1 -0
  353. package/dist/scripts/validation-summary.d.ts +3 -0
  354. package/dist/scripts/validation-summary.d.ts.map +1 -0
  355. package/dist/scripts/validation-summary.js +135 -0
  356. package/dist/scripts/validation-summary.js.map +1 -0
  357. package/dist/services/ai-node-validator.d.ts +12 -0
  358. package/dist/services/ai-node-validator.d.ts.map +1 -0
  359. package/dist/services/ai-node-validator.js +429 -0
  360. package/dist/services/ai-node-validator.js.map +1 -0
  361. package/dist/services/ai-tool-validators.d.ts +58 -0
  362. package/dist/services/ai-tool-validators.d.ts.map +1 -0
  363. package/dist/services/ai-tool-validators.js +438 -0
  364. package/dist/services/ai-tool-validators.js.map +1 -0
  365. package/dist/services/breaking-change-detector.d.ts +38 -0
  366. package/dist/services/breaking-change-detector.d.ts.map +1 -0
  367. package/dist/services/breaking-change-detector.js +184 -0
  368. package/dist/services/breaking-change-detector.js.map +1 -0
  369. package/dist/services/breaking-changes-registry.d.ts +28 -0
  370. package/dist/services/breaking-changes-registry.d.ts.map +1 -0
  371. package/dist/services/breaking-changes-registry.js +200 -0
  372. package/dist/services/breaking-changes-registry.js.map +1 -0
  373. package/dist/services/community-package-service.d.ts +69 -0
  374. package/dist/services/community-package-service.d.ts.map +1 -0
  375. package/dist/services/community-package-service.js +202 -0
  376. package/dist/services/community-package-service.js.map +1 -0
  377. package/dist/services/confidence-scorer.d.ts +24 -0
  378. package/dist/services/confidence-scorer.d.ts.map +1 -0
  379. package/dist/services/confidence-scorer.js +139 -0
  380. package/dist/services/confidence-scorer.js.map +1 -0
  381. package/dist/services/config-validator.d.ts +49 -0
  382. package/dist/services/config-validator.d.ts.map +1 -0
  383. package/dist/services/config-validator.js +724 -0
  384. package/dist/services/config-validator.js.map +1 -0
  385. package/dist/services/enhanced-config-validator.d.ts +54 -0
  386. package/dist/services/enhanced-config-validator.d.ts.map +1 -0
  387. package/dist/services/enhanced-config-validator.js +789 -0
  388. package/dist/services/enhanced-config-validator.js.map +1 -0
  389. package/dist/services/error-execution-processor.d.ts +9 -0
  390. package/dist/services/error-execution-processor.d.ts.map +1 -0
  391. package/dist/services/error-execution-processor.js +380 -0
  392. package/dist/services/error-execution-processor.js.map +1 -0
  393. package/dist/services/example-generator.d.ts +14 -0
  394. package/dist/services/example-generator.d.ts.map +1 -0
  395. package/dist/services/example-generator.js +970 -0
  396. package/dist/services/example-generator.js.map +1 -0
  397. package/dist/services/execution-processor.d.ts +8 -0
  398. package/dist/services/execution-processor.d.ts.map +1 -0
  399. package/dist/services/execution-processor.js +381 -0
  400. package/dist/services/execution-processor.js.map +1 -0
  401. package/dist/services/expression-format-validator.d.ts +33 -0
  402. package/dist/services/expression-format-validator.d.ts.map +1 -0
  403. package/dist/services/expression-format-validator.js +209 -0
  404. package/dist/services/expression-format-validator.js.map +1 -0
  405. package/dist/services/expression-validator.d.ts +27 -0
  406. package/dist/services/expression-validator.d.ts.map +1 -0
  407. package/dist/services/expression-validator.js +187 -0
  408. package/dist/services/expression-validator.js.map +1 -0
  409. package/dist/services/installed-node-sync-service.d.ts +32 -0
  410. package/dist/services/installed-node-sync-service.d.ts.map +1 -0
  411. package/dist/services/installed-node-sync-service.js +190 -0
  412. package/dist/services/installed-node-sync-service.js.map +1 -0
  413. package/dist/services/n8n-api-client.d.ts +48 -0
  414. package/dist/services/n8n-api-client.d.ts.map +1 -0
  415. package/dist/services/n8n-api-client.js +458 -0
  416. package/dist/services/n8n-api-client.js.map +1 -0
  417. package/dist/services/n8n-file-format.d.ts +58 -0
  418. package/dist/services/n8n-file-format.d.ts.map +1 -0
  419. package/dist/services/n8n-file-format.js +203 -0
  420. package/dist/services/n8n-file-format.js.map +1 -0
  421. package/dist/services/n8n-validation.d.ts +273 -0
  422. package/dist/services/n8n-validation.d.ts.map +1 -0
  423. package/dist/services/n8n-validation.js +491 -0
  424. package/dist/services/n8n-validation.js.map +1 -0
  425. package/dist/services/n8n-version.d.ts +23 -0
  426. package/dist/services/n8n-version.d.ts.map +1 -0
  427. package/dist/services/n8n-version.js +151 -0
  428. package/dist/services/n8n-version.js.map +1 -0
  429. package/dist/services/node-documentation-service.d.ts +70 -0
  430. package/dist/services/node-documentation-service.d.ts.map +1 -0
  431. package/dist/services/node-documentation-service.js +518 -0
  432. package/dist/services/node-documentation-service.js.map +1 -0
  433. package/dist/services/node-migration-service.d.ts +44 -0
  434. package/dist/services/node-migration-service.d.ts.map +1 -0
  435. package/dist/services/node-migration-service.js +231 -0
  436. package/dist/services/node-migration-service.js.map +1 -0
  437. package/dist/services/node-sanitizer.d.ts +5 -0
  438. package/dist/services/node-sanitizer.d.ts.map +1 -0
  439. package/dist/services/node-sanitizer.js +225 -0
  440. package/dist/services/node-sanitizer.js.map +1 -0
  441. package/dist/services/node-similarity-service.d.ts +51 -0
  442. package/dist/services/node-similarity-service.d.ts.map +1 -0
  443. package/dist/services/node-similarity-service.js +352 -0
  444. package/dist/services/node-similarity-service.js.map +1 -0
  445. package/dist/services/node-specific-validators.d.ts +37 -0
  446. package/dist/services/node-specific-validators.d.ts.map +1 -0
  447. package/dist/services/node-specific-validators.js +1331 -0
  448. package/dist/services/node-specific-validators.js.map +1 -0
  449. package/dist/services/node-version-service.d.ts +63 -0
  450. package/dist/services/node-version-service.d.ts.map +1 -0
  451. package/dist/services/node-version-service.js +215 -0
  452. package/dist/services/node-version-service.js.map +1 -0
  453. package/dist/services/operation-similarity-service.d.ts +32 -0
  454. package/dist/services/operation-similarity-service.d.ts.map +1 -0
  455. package/dist/services/operation-similarity-service.js +341 -0
  456. package/dist/services/operation-similarity-service.js.map +1 -0
  457. package/dist/services/post-update-validator.d.ts +59 -0
  458. package/dist/services/post-update-validator.d.ts.map +1 -0
  459. package/dist/services/post-update-validator.js +231 -0
  460. package/dist/services/post-update-validator.js.map +1 -0
  461. package/dist/services/property-dependencies.d.ts +36 -0
  462. package/dist/services/property-dependencies.d.ts.map +1 -0
  463. package/dist/services/property-dependencies.js +168 -0
  464. package/dist/services/property-dependencies.js.map +1 -0
  465. package/dist/services/property-filter.d.ts +44 -0
  466. package/dist/services/property-filter.d.ts.map +1 -0
  467. package/dist/services/property-filter.js +395 -0
  468. package/dist/services/property-filter.js.map +1 -0
  469. package/dist/services/resource-similarity-service.d.ts +33 -0
  470. package/dist/services/resource-similarity-service.d.ts.map +1 -0
  471. package/dist/services/resource-similarity-service.js +358 -0
  472. package/dist/services/resource-similarity-service.js.map +1 -0
  473. package/dist/services/sqlite-storage-service.d.ts +11 -0
  474. package/dist/services/sqlite-storage-service.d.ts.map +1 -0
  475. package/dist/services/sqlite-storage-service.js +74 -0
  476. package/dist/services/sqlite-storage-service.js.map +1 -0
  477. package/dist/services/task-templates.d.ts +27 -0
  478. package/dist/services/task-templates.d.ts.map +1 -0
  479. package/dist/services/task-templates.js +1397 -0
  480. package/dist/services/task-templates.js.map +1 -0
  481. package/dist/services/tool-variant-generator.d.ts +10 -0
  482. package/dist/services/tool-variant-generator.d.ts.map +1 -0
  483. package/dist/services/tool-variant-generator.js +93 -0
  484. package/dist/services/tool-variant-generator.js.map +1 -0
  485. package/dist/services/type-structure-service.d.ts +23 -0
  486. package/dist/services/type-structure-service.d.ts.map +1 -0
  487. package/dist/services/type-structure-service.js +109 -0
  488. package/dist/services/type-structure-service.js.map +1 -0
  489. package/dist/services/universal-expression-validator.d.ts +20 -0
  490. package/dist/services/universal-expression-validator.d.ts.map +1 -0
  491. package/dist/services/universal-expression-validator.js +192 -0
  492. package/dist/services/universal-expression-validator.js.map +1 -0
  493. package/dist/services/workflow-analytics-service.d.ts +34 -0
  494. package/dist/services/workflow-analytics-service.d.ts.map +1 -0
  495. package/dist/services/workflow-analytics-service.js +144 -0
  496. package/dist/services/workflow-analytics-service.js.map +1 -0
  497. package/dist/services/workflow-auto-fixer.d.ts +74 -0
  498. package/dist/services/workflow-auto-fixer.d.ts.map +1 -0
  499. package/dist/services/workflow-auto-fixer.js +557 -0
  500. package/dist/services/workflow-auto-fixer.js.map +1 -0
  501. package/dist/services/workflow-comparison.d.ts +13 -0
  502. package/dist/services/workflow-comparison.d.ts.map +1 -0
  503. package/dist/services/workflow-comparison.js +306 -0
  504. package/dist/services/workflow-comparison.js.map +1 -0
  505. package/dist/services/workflow-debugging-service.d.ts +62 -0
  506. package/dist/services/workflow-debugging-service.d.ts.map +1 -0
  507. package/dist/services/workflow-debugging-service.js +153 -0
  508. package/dist/services/workflow-debugging-service.js.map +1 -0
  509. package/dist/services/workflow-diff-engine.d.ts +45 -0
  510. package/dist/services/workflow-diff-engine.d.ts.map +1 -0
  511. package/dist/services/workflow-diff-engine.js +830 -0
  512. package/dist/services/workflow-diff-engine.js.map +1 -0
  513. package/dist/services/workflow-validator.d.ts +112 -0
  514. package/dist/services/workflow-validator.d.ts.map +1 -0
  515. package/dist/services/workflow-validator.js +1328 -0
  516. package/dist/services/workflow-validator.js.map +1 -0
  517. package/dist/services/workflow-versioning-service.d.ts +102 -0
  518. package/dist/services/workflow-versioning-service.d.ts.map +1 -0
  519. package/dist/services/workflow-versioning-service.js +264 -0
  520. package/dist/services/workflow-versioning-service.js.map +1 -0
  521. package/dist/telemetry/batch-processor.d.ts +34 -0
  522. package/dist/telemetry/batch-processor.d.ts.map +1 -0
  523. package/dist/telemetry/batch-processor.js +337 -0
  524. package/dist/telemetry/batch-processor.js.map +1 -0
  525. package/dist/telemetry/config-manager.d.ts +32 -0
  526. package/dist/telemetry/config-manager.d.ts.map +1 -0
  527. package/dist/telemetry/config-manager.js +289 -0
  528. package/dist/telemetry/config-manager.js.map +1 -0
  529. package/dist/telemetry/early-error-logger.d.ts +26 -0
  530. package/dist/telemetry/early-error-logger.d.ts.map +1 -0
  531. package/dist/telemetry/early-error-logger.js +187 -0
  532. package/dist/telemetry/early-error-logger.js.map +1 -0
  533. package/dist/telemetry/error-sanitization-utils.d.ts +2 -0
  534. package/dist/telemetry/error-sanitization-utils.d.ts.map +1 -0
  535. package/dist/telemetry/error-sanitization-utils.js +37 -0
  536. package/dist/telemetry/error-sanitization-utils.js.map +1 -0
  537. package/dist/telemetry/error-sanitizer.d.ts +4 -0
  538. package/dist/telemetry/error-sanitizer.d.ts.map +1 -0
  539. package/dist/telemetry/error-sanitizer.js +45 -0
  540. package/dist/telemetry/error-sanitizer.js.map +1 -0
  541. package/dist/telemetry/event-tracker.d.ts +71 -0
  542. package/dist/telemetry/event-tracker.d.ts.map +1 -0
  543. package/dist/telemetry/event-tracker.js +356 -0
  544. package/dist/telemetry/event-tracker.js.map +1 -0
  545. package/dist/telemetry/event-validator.d.ts +78 -0
  546. package/dist/telemetry/event-validator.d.ts.map +1 -0
  547. package/dist/telemetry/event-validator.js +227 -0
  548. package/dist/telemetry/event-validator.js.map +1 -0
  549. package/dist/telemetry/index.d.ts +5 -0
  550. package/dist/telemetry/index.d.ts.map +1 -0
  551. package/dist/telemetry/index.js +11 -0
  552. package/dist/telemetry/index.js.map +1 -0
  553. package/dist/telemetry/intent-classifier.d.ts +11 -0
  554. package/dist/telemetry/intent-classifier.d.ts.map +1 -0
  555. package/dist/telemetry/intent-classifier.js +141 -0
  556. package/dist/telemetry/intent-classifier.js.map +1 -0
  557. package/dist/telemetry/intent-sanitizer.d.ts +9 -0
  558. package/dist/telemetry/intent-sanitizer.d.ts.map +1 -0
  559. package/dist/telemetry/intent-sanitizer.js +103 -0
  560. package/dist/telemetry/intent-sanitizer.js.map +1 -0
  561. package/dist/telemetry/mutation-tracker.d.ts +15 -0
  562. package/dist/telemetry/mutation-tracker.d.ts.map +1 -0
  563. package/dist/telemetry/mutation-tracker.js +177 -0
  564. package/dist/telemetry/mutation-tracker.js.map +1 -0
  565. package/dist/telemetry/mutation-types.d.ts +106 -0
  566. package/dist/telemetry/mutation-types.d.ts.map +1 -0
  567. package/dist/telemetry/mutation-types.js +18 -0
  568. package/dist/telemetry/mutation-types.js.map +1 -0
  569. package/dist/telemetry/mutation-validator.d.ts +20 -0
  570. package/dist/telemetry/mutation-validator.d.ts.map +1 -0
  571. package/dist/telemetry/mutation-validator.js +144 -0
  572. package/dist/telemetry/mutation-validator.js.map +1 -0
  573. package/dist/telemetry/performance-monitor.d.ts +113 -0
  574. package/dist/telemetry/performance-monitor.d.ts.map +1 -0
  575. package/dist/telemetry/performance-monitor.js +208 -0
  576. package/dist/telemetry/performance-monitor.js.map +1 -0
  577. package/dist/telemetry/rate-limiter.d.ts +30 -0
  578. package/dist/telemetry/rate-limiter.d.ts.map +1 -0
  579. package/dist/telemetry/rate-limiter.js +103 -0
  580. package/dist/telemetry/rate-limiter.js.map +1 -0
  581. package/dist/telemetry/startup-checkpoints.d.ts +26 -0
  582. package/dist/telemetry/startup-checkpoints.d.ts.map +1 -0
  583. package/dist/telemetry/startup-checkpoints.js +65 -0
  584. package/dist/telemetry/startup-checkpoints.js.map +1 -0
  585. package/dist/telemetry/telemetry-error.d.ts +44 -0
  586. package/dist/telemetry/telemetry-error.d.ts.map +1 -0
  587. package/dist/telemetry/telemetry-error.js +153 -0
  588. package/dist/telemetry/telemetry-error.js.map +1 -0
  589. package/dist/telemetry/telemetry-manager.d.ts +130 -0
  590. package/dist/telemetry/telemetry-manager.d.ts.map +1 -0
  591. package/dist/telemetry/telemetry-manager.js +257 -0
  592. package/dist/telemetry/telemetry-manager.js.map +1 -0
  593. package/dist/telemetry/telemetry-types.d.ts +103 -0
  594. package/dist/telemetry/telemetry-types.d.ts.map +1 -0
  595. package/dist/telemetry/telemetry-types.js +29 -0
  596. package/dist/telemetry/telemetry-types.js.map +1 -0
  597. package/dist/telemetry/workflow-sanitizer.d.ts +34 -0
  598. package/dist/telemetry/workflow-sanitizer.d.ts.map +1 -0
  599. package/dist/telemetry/workflow-sanitizer.js +242 -0
  600. package/dist/telemetry/workflow-sanitizer.js.map +1 -0
  601. package/dist/templates/batch-processor.d.ts +35 -0
  602. package/dist/templates/batch-processor.d.ts.map +1 -0
  603. package/dist/templates/batch-processor.js +320 -0
  604. package/dist/templates/batch-processor.js.map +1 -0
  605. package/dist/templates/metadata-generator.d.ts +52 -0
  606. package/dist/templates/metadata-generator.d.ts.map +1 -0
  607. package/dist/templates/metadata-generator.js +252 -0
  608. package/dist/templates/metadata-generator.js.map +1 -0
  609. package/dist/templates/template-fetcher.d.ts +45 -0
  610. package/dist/templates/template-fetcher.d.ts.map +1 -0
  611. package/dist/templates/template-fetcher.js +122 -0
  612. package/dist/templates/template-fetcher.js.map +1 -0
  613. package/dist/templates/template-repository.d.ts +93 -0
  614. package/dist/templates/template-repository.d.ts.map +1 -0
  615. package/dist/templates/template-repository.js +644 -0
  616. package/dist/templates/template-repository.js.map +1 -0
  617. package/dist/templates/template-service.d.ts +79 -0
  618. package/dist/templates/template-service.d.ts.map +1 -0
  619. package/dist/templates/template-service.js +300 -0
  620. package/dist/templates/template-service.js.map +1 -0
  621. package/dist/triggers/handlers/base-handler.d.ts +21 -0
  622. package/dist/triggers/handlers/base-handler.d.ts.map +1 -0
  623. package/dist/triggers/handlers/base-handler.js +60 -0
  624. package/dist/triggers/handlers/base-handler.js.map +1 -0
  625. package/dist/triggers/handlers/chat-handler.d.ts +38 -0
  626. package/dist/triggers/handlers/chat-handler.d.ts.map +1 -0
  627. package/dist/triggers/handlers/chat-handler.js +129 -0
  628. package/dist/triggers/handlers/chat-handler.js.map +1 -0
  629. package/dist/triggers/handlers/form-handler.d.ts +35 -0
  630. package/dist/triggers/handlers/form-handler.d.ts.map +1 -0
  631. package/dist/triggers/handlers/form-handler.js +362 -0
  632. package/dist/triggers/handlers/form-handler.js.map +1 -0
  633. package/dist/triggers/handlers/webhook-handler.d.ts +38 -0
  634. package/dist/triggers/handlers/webhook-handler.d.ts.map +1 -0
  635. package/dist/triggers/handlers/webhook-handler.js +115 -0
  636. package/dist/triggers/handlers/webhook-handler.js.map +1 -0
  637. package/dist/triggers/index.d.ts +5 -0
  638. package/dist/triggers/index.d.ts.map +1 -0
  639. package/dist/triggers/index.js +14 -0
  640. package/dist/triggers/index.js.map +1 -0
  641. package/dist/triggers/trigger-detector.d.ts +6 -0
  642. package/dist/triggers/trigger-detector.d.ts.map +1 -0
  643. package/dist/triggers/trigger-detector.js +201 -0
  644. package/dist/triggers/trigger-detector.js.map +1 -0
  645. package/dist/triggers/trigger-registry.d.ts +18 -0
  646. package/dist/triggers/trigger-registry.d.ts.map +1 -0
  647. package/dist/triggers/trigger-registry.js +87 -0
  648. package/dist/triggers/trigger-registry.js.map +1 -0
  649. package/dist/triggers/types.d.ts +76 -0
  650. package/dist/triggers/types.d.ts.map +1 -0
  651. package/dist/triggers/types.js +3 -0
  652. package/dist/triggers/types.js.map +1 -0
  653. package/dist/types/index.d.ts +49 -0
  654. package/dist/types/index.d.ts.map +1 -0
  655. package/dist/types/index.js +21 -0
  656. package/dist/types/index.js.map +1 -0
  657. package/dist/types/instance-context.d.ts +20 -0
  658. package/dist/types/instance-context.d.ts.map +1 -0
  659. package/dist/types/instance-context.js +153 -0
  660. package/dist/types/instance-context.js.map +1 -0
  661. package/dist/types/n8n-api.d.ts +376 -0
  662. package/dist/types/n8n-api.d.ts.map +1 -0
  663. package/dist/types/n8n-api.js +10 -0
  664. package/dist/types/n8n-api.js.map +1 -0
  665. package/dist/types/node-types.d.ts +19 -0
  666. package/dist/types/node-types.d.ts.map +1 -0
  667. package/dist/types/node-types.js +62 -0
  668. package/dist/types/node-types.js.map +1 -0
  669. package/dist/types/session-state.d.ts +15 -0
  670. package/dist/types/session-state.d.ts.map +1 -0
  671. package/dist/types/session-state.js +3 -0
  672. package/dist/types/session-state.js.map +1 -0
  673. package/dist/types/type-structures.d.ts +42 -0
  674. package/dist/types/type-structures.d.ts.map +1 -0
  675. package/dist/types/type-structures.js +32 -0
  676. package/dist/types/type-structures.js.map +1 -0
  677. package/dist/types/workflow-comparison.d.ts +51 -0
  678. package/dist/types/workflow-comparison.d.ts.map +1 -0
  679. package/dist/types/workflow-comparison.js +3 -0
  680. package/dist/types/workflow-comparison.js.map +1 -0
  681. package/dist/types/workflow-diff.d.ts +148 -0
  682. package/dist/types/workflow-diff.d.ts.map +1 -0
  683. package/dist/types/workflow-diff.js +15 -0
  684. package/dist/types/workflow-diff.js.map +1 -0
  685. package/dist/utils/auth.d.ts +13 -0
  686. package/dist/utils/auth.d.ts.map +1 -0
  687. package/dist/utils/auth.js +82 -0
  688. package/dist/utils/auth.js.map +1 -0
  689. package/dist/utils/bridge.d.ts +12 -0
  690. package/dist/utils/bridge.d.ts.map +1 -0
  691. package/dist/utils/bridge.js +127 -0
  692. package/dist/utils/bridge.js.map +1 -0
  693. package/dist/utils/cache-utils.d.ts +58 -0
  694. package/dist/utils/cache-utils.d.ts.map +1 -0
  695. package/dist/utils/cache-utils.js +243 -0
  696. package/dist/utils/cache-utils.js.map +1 -0
  697. package/dist/utils/console-manager.d.ts +10 -0
  698. package/dist/utils/console-manager.d.ts.map +1 -0
  699. package/dist/utils/console-manager.js +63 -0
  700. package/dist/utils/console-manager.js.map +1 -0
  701. package/dist/utils/documentation-fetcher.d.ts +2 -0
  702. package/dist/utils/documentation-fetcher.d.ts.map +1 -0
  703. package/dist/utils/documentation-fetcher.js +18 -0
  704. package/dist/utils/documentation-fetcher.js.map +1 -0
  705. package/dist/utils/enhanced-documentation-fetcher.d.ts +74 -0
  706. package/dist/utils/enhanced-documentation-fetcher.d.ts.map +1 -0
  707. package/dist/utils/enhanced-documentation-fetcher.js +521 -0
  708. package/dist/utils/enhanced-documentation-fetcher.js.map +1 -0
  709. package/dist/utils/error-handler.d.ts +24 -0
  710. package/dist/utils/error-handler.d.ts.map +1 -0
  711. package/dist/utils/error-handler.js +84 -0
  712. package/dist/utils/error-handler.js.map +1 -0
  713. package/dist/utils/example-generator.d.ts +8 -0
  714. package/dist/utils/example-generator.d.ts.map +1 -0
  715. package/dist/utils/example-generator.js +106 -0
  716. package/dist/utils/example-generator.js.map +1 -0
  717. package/dist/utils/expression-utils.d.ts +6 -0
  718. package/dist/utils/expression-utils.d.ts.map +1 -0
  719. package/dist/utils/expression-utils.js +47 -0
  720. package/dist/utils/expression-utils.js.map +1 -0
  721. package/dist/utils/fixed-collection-validator.d.ts +35 -0
  722. package/dist/utils/fixed-collection-validator.d.ts.map +1 -0
  723. package/dist/utils/fixed-collection-validator.js +358 -0
  724. package/dist/utils/fixed-collection-validator.js.map +1 -0
  725. package/dist/utils/logger.d.ts +33 -0
  726. package/dist/utils/logger.d.ts.map +1 -0
  727. package/dist/utils/logger.js +101 -0
  728. package/dist/utils/logger.js.map +1 -0
  729. package/dist/utils/mcp-client.d.ts +21 -0
  730. package/dist/utils/mcp-client.d.ts.map +1 -0
  731. package/dist/utils/mcp-client.js +96 -0
  732. package/dist/utils/mcp-client.js.map +1 -0
  733. package/dist/utils/n8n-errors.d.ts +27 -0
  734. package/dist/utils/n8n-errors.d.ts.map +1 -0
  735. package/dist/utils/n8n-errors.js +138 -0
  736. package/dist/utils/n8n-errors.js.map +1 -0
  737. package/dist/utils/node-classification.d.ts +5 -0
  738. package/dist/utils/node-classification.d.ts.map +1 -0
  739. package/dist/utils/node-classification.js +31 -0
  740. package/dist/utils/node-classification.js.map +1 -0
  741. package/dist/utils/node-source-extractor.d.ts +21 -0
  742. package/dist/utils/node-source-extractor.d.ts.map +1 -0
  743. package/dist/utils/node-source-extractor.js +377 -0
  744. package/dist/utils/node-source-extractor.js.map +1 -0
  745. package/dist/utils/node-type-normalizer.d.ts +17 -0
  746. package/dist/utils/node-type-normalizer.d.ts.map +1 -0
  747. package/dist/utils/node-type-normalizer.js +87 -0
  748. package/dist/utils/node-type-normalizer.js.map +1 -0
  749. package/dist/utils/node-type-utils.d.ts +12 -0
  750. package/dist/utils/node-type-utils.d.ts.map +1 -0
  751. package/dist/utils/node-type-utils.js +126 -0
  752. package/dist/utils/node-type-utils.js.map +1 -0
  753. package/dist/utils/node-utils.d.ts +4 -0
  754. package/dist/utils/node-utils.d.ts.map +1 -0
  755. package/dist/utils/node-utils.js +81 -0
  756. package/dist/utils/node-utils.js.map +1 -0
  757. package/dist/utils/npm-version-checker.d.ts +14 -0
  758. package/dist/utils/npm-version-checker.d.ts.map +1 -0
  759. package/dist/utils/npm-version-checker.js +125 -0
  760. package/dist/utils/npm-version-checker.js.map +1 -0
  761. package/dist/utils/protocol-version.d.ts +19 -0
  762. package/dist/utils/protocol-version.d.ts.map +1 -0
  763. package/dist/utils/protocol-version.js +95 -0
  764. package/dist/utils/protocol-version.js.map +1 -0
  765. package/dist/utils/simple-cache.d.ts +10 -0
  766. package/dist/utils/simple-cache.d.ts.map +1 -0
  767. package/dist/utils/simple-cache.js +42 -0
  768. package/dist/utils/simple-cache.js.map +1 -0
  769. package/dist/utils/ssrf-protection.d.ts +7 -0
  770. package/dist/utils/ssrf-protection.d.ts.map +1 -0
  771. package/dist/utils/ssrf-protection.js +118 -0
  772. package/dist/utils/ssrf-protection.js.map +1 -0
  773. package/dist/utils/template-node-resolver.d.ts +2 -0
  774. package/dist/utils/template-node-resolver.d.ts.map +1 -0
  775. package/dist/utils/template-node-resolver.js +161 -0
  776. package/dist/utils/template-node-resolver.js.map +1 -0
  777. package/dist/utils/template-sanitizer.d.ts +21 -0
  778. package/dist/utils/template-sanitizer.d.ts.map +1 -0
  779. package/dist/utils/template-sanitizer.js +126 -0
  780. package/dist/utils/template-sanitizer.js.map +1 -0
  781. package/dist/utils/url-detector.d.ts +9 -0
  782. package/dist/utils/url-detector.d.ts.map +1 -0
  783. package/dist/utils/url-detector.js +79 -0
  784. package/dist/utils/url-detector.js.map +1 -0
  785. package/dist/utils/validation-schemas.d.ts +32 -0
  786. package/dist/utils/validation-schemas.d.ts.map +1 -0
  787. package/dist/utils/validation-schemas.js +219 -0
  788. package/dist/utils/validation-schemas.js.map +1 -0
  789. package/dist/utils/version.d.ts +2 -0
  790. package/dist/utils/version.d.ts.map +1 -0
  791. package/dist/utils/version.js +18 -0
  792. package/dist/utils/version.js.map +1 -0
  793. package/package.json +178 -0
  794. package/package.runtime.json +24 -0
@@ -0,0 +1,1331 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodeSpecificValidators = void 0;
4
+ class NodeSpecificValidators {
5
+ static validateSlack(context) {
6
+ const { config, errors, warnings, suggestions, autofix } = context;
7
+ const { resource, operation } = config;
8
+ if (resource === 'message') {
9
+ switch (operation) {
10
+ case 'send':
11
+ this.validateSlackSendMessage(context);
12
+ break;
13
+ case 'update':
14
+ this.validateSlackUpdateMessage(context);
15
+ break;
16
+ case 'delete':
17
+ this.validateSlackDeleteMessage(context);
18
+ break;
19
+ }
20
+ }
21
+ else if (resource === 'channel') {
22
+ switch (operation) {
23
+ case 'create':
24
+ this.validateSlackCreateChannel(context);
25
+ break;
26
+ case 'get':
27
+ case 'getAll':
28
+ break;
29
+ }
30
+ }
31
+ else if (resource === 'user') {
32
+ if (operation === 'get' && !config.user) {
33
+ errors.push({
34
+ type: 'missing_required',
35
+ property: 'user',
36
+ message: 'User identifier required - use email, user ID, or username',
37
+ fix: 'Set user to an email like "john@example.com" or user ID like "U1234567890"'
38
+ });
39
+ }
40
+ }
41
+ if (!config.onError && !config.retryOnFail && !config.continueOnFail) {
42
+ warnings.push({
43
+ type: 'best_practice',
44
+ property: 'errorHandling',
45
+ message: 'Slack API can have rate limits and transient failures',
46
+ suggestion: 'Add onError: "continueRegularOutput" with retryOnFail for resilience'
47
+ });
48
+ autofix.onError = 'continueRegularOutput';
49
+ autofix.retryOnFail = true;
50
+ autofix.maxTries = 2;
51
+ autofix.waitBetweenTries = 3000;
52
+ }
53
+ if (config.continueOnFail !== undefined) {
54
+ warnings.push({
55
+ type: 'deprecated',
56
+ property: 'continueOnFail',
57
+ message: 'continueOnFail is deprecated. Use onError instead',
58
+ suggestion: 'Replace with onError: "continueRegularOutput"'
59
+ });
60
+ }
61
+ }
62
+ static validateSlackSendMessage(context) {
63
+ const { config, errors, warnings, suggestions, autofix } = context;
64
+ if (!config.channel && !config.channelId) {
65
+ errors.push({
66
+ type: 'missing_required',
67
+ property: 'channel',
68
+ message: 'Channel is required to send a message',
69
+ fix: 'Set channel to a channel name (e.g., "#general") or ID (e.g., "C1234567890")'
70
+ });
71
+ }
72
+ if (!config.text && !config.blocks && !config.attachments) {
73
+ errors.push({
74
+ type: 'missing_required',
75
+ property: 'text',
76
+ message: 'Message content is required - provide text, blocks, or attachments',
77
+ fix: 'Add text field with your message content'
78
+ });
79
+ }
80
+ if (config.text && config.text.length > 40000) {
81
+ warnings.push({
82
+ type: 'inefficient',
83
+ property: 'text',
84
+ message: 'Message text exceeds Slack\'s 40,000 character limit',
85
+ suggestion: 'Split into multiple messages or use a file upload'
86
+ });
87
+ }
88
+ if (config.replyToThread && !config.threadTs) {
89
+ warnings.push({
90
+ type: 'missing_common',
91
+ property: 'threadTs',
92
+ message: 'Thread timestamp required when replying to thread',
93
+ suggestion: 'Set threadTs to the timestamp of the thread parent message'
94
+ });
95
+ }
96
+ if (config.text?.includes('@') && !config.linkNames) {
97
+ suggestions.push('Set linkNames=true to convert @mentions to user links');
98
+ autofix.linkNames = true;
99
+ }
100
+ }
101
+ static validateSlackUpdateMessage(context) {
102
+ const { config, errors } = context;
103
+ if (!config.ts) {
104
+ errors.push({
105
+ type: 'missing_required',
106
+ property: 'ts',
107
+ message: 'Message timestamp (ts) is required to update a message',
108
+ fix: 'Provide the timestamp of the message to update'
109
+ });
110
+ }
111
+ if (!config.channel && !config.channelId) {
112
+ errors.push({
113
+ type: 'missing_required',
114
+ property: 'channel',
115
+ message: 'Channel is required to update a message',
116
+ fix: 'Provide the channel where the message exists'
117
+ });
118
+ }
119
+ }
120
+ static validateSlackDeleteMessage(context) {
121
+ const { config, errors, warnings } = context;
122
+ if (!config.ts) {
123
+ errors.push({
124
+ type: 'missing_required',
125
+ property: 'ts',
126
+ message: 'Message timestamp (ts) is required to delete a message',
127
+ fix: 'Provide the timestamp of the message to delete'
128
+ });
129
+ }
130
+ if (!config.channel && !config.channelId) {
131
+ errors.push({
132
+ type: 'missing_required',
133
+ property: 'channel',
134
+ message: 'Channel is required to delete a message',
135
+ fix: 'Provide the channel where the message exists'
136
+ });
137
+ }
138
+ warnings.push({
139
+ type: 'security',
140
+ message: 'Message deletion is permanent and cannot be undone',
141
+ suggestion: 'Consider archiving or updating the message instead if you need to preserve history'
142
+ });
143
+ }
144
+ static validateSlackCreateChannel(context) {
145
+ const { config, errors, warnings } = context;
146
+ if (!config.name) {
147
+ errors.push({
148
+ type: 'missing_required',
149
+ property: 'name',
150
+ message: 'Channel name is required',
151
+ fix: 'Provide a channel name (lowercase, no spaces, 1-80 characters)'
152
+ });
153
+ }
154
+ else {
155
+ const name = config.name;
156
+ if (name.includes(' ')) {
157
+ errors.push({
158
+ type: 'invalid_value',
159
+ property: 'name',
160
+ message: 'Channel names cannot contain spaces',
161
+ fix: 'Use hyphens or underscores instead of spaces'
162
+ });
163
+ }
164
+ if (name !== name.toLowerCase()) {
165
+ errors.push({
166
+ type: 'invalid_value',
167
+ property: 'name',
168
+ message: 'Channel names must be lowercase',
169
+ fix: 'Convert the channel name to lowercase'
170
+ });
171
+ }
172
+ if (name.length > 80) {
173
+ errors.push({
174
+ type: 'invalid_value',
175
+ property: 'name',
176
+ message: 'Channel name exceeds 80 character limit',
177
+ fix: 'Shorten the channel name'
178
+ });
179
+ }
180
+ }
181
+ }
182
+ static validateGoogleSheets(context) {
183
+ const { config, errors, warnings, suggestions } = context;
184
+ const { operation } = config;
185
+ switch (operation) {
186
+ case 'append':
187
+ this.validateGoogleSheetsAppend(context);
188
+ break;
189
+ case 'read':
190
+ this.validateGoogleSheetsRead(context);
191
+ break;
192
+ case 'update':
193
+ this.validateGoogleSheetsUpdate(context);
194
+ break;
195
+ case 'delete':
196
+ this.validateGoogleSheetsDelete(context);
197
+ break;
198
+ }
199
+ if (config.range) {
200
+ this.validateGoogleSheetsRange(config.range, errors, warnings);
201
+ }
202
+ const filteredErrors = [];
203
+ for (const error of errors) {
204
+ if (error.property === 'sheetId' && error.type === 'missing_required') {
205
+ continue;
206
+ }
207
+ if (error.property && error.property.includes('sheetId') && error.type === 'missing_required') {
208
+ continue;
209
+ }
210
+ filteredErrors.push(error);
211
+ }
212
+ errors.length = 0;
213
+ errors.push(...filteredErrors);
214
+ }
215
+ static validateGoogleSheetsAppend(context) {
216
+ const { config, errors, warnings, autofix } = context;
217
+ if (!config.range && !config.columns) {
218
+ errors.push({
219
+ type: 'missing_required',
220
+ property: 'range',
221
+ message: 'Range or columns mapping is required for append operation',
222
+ fix: 'Specify range like "Sheet1!A:B" OR use columns with mappingMode'
223
+ });
224
+ }
225
+ if (!config.options?.valueInputMode) {
226
+ warnings.push({
227
+ type: 'missing_common',
228
+ property: 'options.valueInputMode',
229
+ message: 'Consider setting valueInputMode for proper data formatting',
230
+ suggestion: 'Use "USER_ENTERED" to parse formulas and dates, or "RAW" for literal values'
231
+ });
232
+ autofix.options = { ...config.options, valueInputMode: 'USER_ENTERED' };
233
+ }
234
+ }
235
+ static validateGoogleSheetsRead(context) {
236
+ const { config, errors, suggestions } = context;
237
+ if (!config.range) {
238
+ errors.push({
239
+ type: 'missing_required',
240
+ property: 'range',
241
+ message: 'Range is required for read operation',
242
+ fix: 'Specify range like "Sheet1!A:B" or "Sheet1!A1:B10"'
243
+ });
244
+ }
245
+ if (!config.options?.dataStructure) {
246
+ suggestions.push('Consider setting options.dataStructure to "object" for easier data manipulation');
247
+ }
248
+ }
249
+ static validateGoogleSheetsUpdate(context) {
250
+ const { config, errors } = context;
251
+ if (!config.range) {
252
+ errors.push({
253
+ type: 'missing_required',
254
+ property: 'range',
255
+ message: 'Range is required for update operation',
256
+ fix: 'Specify the exact range to update like "Sheet1!A1:B10"'
257
+ });
258
+ }
259
+ if (!config.values && !config.rawData) {
260
+ errors.push({
261
+ type: 'missing_required',
262
+ property: 'values',
263
+ message: 'Values are required for update operation',
264
+ fix: 'Provide the data to write to the spreadsheet'
265
+ });
266
+ }
267
+ }
268
+ static validateGoogleSheetsDelete(context) {
269
+ const { config, errors, warnings } = context;
270
+ if (!config.toDelete) {
271
+ errors.push({
272
+ type: 'missing_required',
273
+ property: 'toDelete',
274
+ message: 'Specify what to delete (rows or columns)',
275
+ fix: 'Set toDelete to "rows" or "columns"'
276
+ });
277
+ }
278
+ if (config.toDelete === 'rows' && !config.startIndex && config.startIndex !== 0) {
279
+ errors.push({
280
+ type: 'missing_required',
281
+ property: 'startIndex',
282
+ message: 'Start index is required when deleting rows',
283
+ fix: 'Specify the starting row index (0-based)'
284
+ });
285
+ }
286
+ warnings.push({
287
+ type: 'security',
288
+ message: 'Deletion is permanent. Consider backing up data first',
289
+ suggestion: 'Read the data before deletion to create a backup'
290
+ });
291
+ }
292
+ static validateGoogleSheetsRange(range, errors, warnings) {
293
+ if (!range.includes('!')) {
294
+ warnings.push({
295
+ type: 'inefficient',
296
+ property: 'range',
297
+ message: 'Range should include sheet name for clarity',
298
+ suggestion: 'Format: "SheetName!A1:B10" or "SheetName!A:B"'
299
+ });
300
+ }
301
+ if (range.includes(' ') && !range.match(/^'[^']+'/)) {
302
+ errors.push({
303
+ type: 'invalid_value',
304
+ property: 'range',
305
+ message: 'Sheet names with spaces must be quoted',
306
+ fix: 'Use single quotes around sheet name: \'Sheet Name\'!A1:B10'
307
+ });
308
+ }
309
+ const a1Pattern = /^('[^']+'|[^!]+)!([A-Z]+\d*:?[A-Z]*\d*|[A-Z]+:[A-Z]+|\d+:\d+)$/i;
310
+ if (!a1Pattern.test(range)) {
311
+ warnings.push({
312
+ type: 'inefficient',
313
+ property: 'range',
314
+ message: 'Range may not be in valid A1 notation',
315
+ suggestion: 'Examples: "Sheet1!A1:B10", "Sheet1!A:B", "Sheet1!1:10"'
316
+ });
317
+ }
318
+ }
319
+ static validateOpenAI(context) {
320
+ const { config, errors, warnings, suggestions, autofix } = context;
321
+ const { resource, operation } = config;
322
+ if (resource === 'chat' && operation === 'create') {
323
+ if (!config.model) {
324
+ errors.push({
325
+ type: 'missing_required',
326
+ property: 'model',
327
+ message: 'Model selection is required',
328
+ fix: 'Choose a model like "gpt-4", "gpt-3.5-turbo", etc.'
329
+ });
330
+ }
331
+ else {
332
+ const deprecatedModels = ['text-davinci-003', 'text-davinci-002'];
333
+ if (deprecatedModels.includes(config.model)) {
334
+ warnings.push({
335
+ type: 'deprecated',
336
+ property: 'model',
337
+ message: `Model ${config.model} is deprecated`,
338
+ suggestion: 'Use "gpt-3.5-turbo" or "gpt-4" instead'
339
+ });
340
+ }
341
+ }
342
+ if (!config.messages && !config.prompt) {
343
+ errors.push({
344
+ type: 'missing_required',
345
+ property: 'messages',
346
+ message: 'Messages or prompt required for chat completion',
347
+ fix: 'Add messages array or use the prompt field'
348
+ });
349
+ }
350
+ if (config.maxTokens && config.maxTokens > 4000) {
351
+ warnings.push({
352
+ type: 'inefficient',
353
+ property: 'maxTokens',
354
+ message: 'High token limit may increase costs significantly',
355
+ suggestion: 'Consider if you really need more than 4000 tokens'
356
+ });
357
+ }
358
+ if (config.temperature !== undefined) {
359
+ if (config.temperature < 0 || config.temperature > 2) {
360
+ errors.push({
361
+ type: 'invalid_value',
362
+ property: 'temperature',
363
+ message: 'Temperature must be between 0 and 2',
364
+ fix: 'Set temperature between 0 (deterministic) and 2 (creative)'
365
+ });
366
+ }
367
+ }
368
+ }
369
+ if (!config.onError && !config.retryOnFail && !config.continueOnFail) {
370
+ warnings.push({
371
+ type: 'best_practice',
372
+ property: 'errorHandling',
373
+ message: 'AI APIs have rate limits and can return errors',
374
+ suggestion: 'Add onError: "continueRegularOutput" with retryOnFail and longer wait times'
375
+ });
376
+ autofix.onError = 'continueRegularOutput';
377
+ autofix.retryOnFail = true;
378
+ autofix.maxTries = 3;
379
+ autofix.waitBetweenTries = 5000;
380
+ autofix.alwaysOutputData = true;
381
+ }
382
+ if (config.continueOnFail !== undefined) {
383
+ warnings.push({
384
+ type: 'deprecated',
385
+ property: 'continueOnFail',
386
+ message: 'continueOnFail is deprecated. Use onError instead',
387
+ suggestion: 'Replace with onError: "continueRegularOutput"'
388
+ });
389
+ }
390
+ }
391
+ static validateMongoDB(context) {
392
+ const { config, errors, warnings, autofix } = context;
393
+ const { operation } = config;
394
+ if (!config.collection) {
395
+ errors.push({
396
+ type: 'missing_required',
397
+ property: 'collection',
398
+ message: 'Collection name is required',
399
+ fix: 'Specify the MongoDB collection to work with'
400
+ });
401
+ }
402
+ switch (operation) {
403
+ case 'find':
404
+ if (config.query) {
405
+ try {
406
+ JSON.parse(config.query);
407
+ }
408
+ catch (e) {
409
+ errors.push({
410
+ type: 'invalid_value',
411
+ property: 'query',
412
+ message: 'Query must be valid JSON',
413
+ fix: 'Ensure query is valid JSON like: {"name": "John"}'
414
+ });
415
+ }
416
+ }
417
+ break;
418
+ case 'insert':
419
+ if (!config.fields && !config.documents) {
420
+ errors.push({
421
+ type: 'missing_required',
422
+ property: 'fields',
423
+ message: 'Document data is required for insert',
424
+ fix: 'Provide the data to insert'
425
+ });
426
+ }
427
+ break;
428
+ case 'update':
429
+ if (!config.query) {
430
+ warnings.push({
431
+ type: 'security',
432
+ message: 'Update without query will affect all documents',
433
+ suggestion: 'Add a query to target specific documents'
434
+ });
435
+ }
436
+ break;
437
+ case 'delete':
438
+ if (!config.query || config.query === '{}') {
439
+ errors.push({
440
+ type: 'invalid_value',
441
+ property: 'query',
442
+ message: 'Delete without query would remove all documents - this is a critical security issue',
443
+ fix: 'Add a query to specify which documents to delete'
444
+ });
445
+ }
446
+ break;
447
+ }
448
+ if (!config.onError && !config.retryOnFail && !config.continueOnFail) {
449
+ if (operation === 'find') {
450
+ warnings.push({
451
+ type: 'best_practice',
452
+ property: 'errorHandling',
453
+ message: 'MongoDB queries can fail due to connection issues',
454
+ suggestion: 'Add onError: "continueRegularOutput" with retryOnFail'
455
+ });
456
+ autofix.onError = 'continueRegularOutput';
457
+ autofix.retryOnFail = true;
458
+ autofix.maxTries = 3;
459
+ }
460
+ else if (['insert', 'update', 'delete'].includes(operation)) {
461
+ warnings.push({
462
+ type: 'best_practice',
463
+ property: 'errorHandling',
464
+ message: 'MongoDB write operations should handle errors carefully',
465
+ suggestion: 'Add onError: "continueErrorOutput" to handle write failures separately'
466
+ });
467
+ autofix.onError = 'continueErrorOutput';
468
+ autofix.retryOnFail = true;
469
+ autofix.maxTries = 2;
470
+ autofix.waitBetweenTries = 1000;
471
+ }
472
+ }
473
+ if (config.continueOnFail !== undefined) {
474
+ warnings.push({
475
+ type: 'deprecated',
476
+ property: 'continueOnFail',
477
+ message: 'continueOnFail is deprecated. Use onError instead',
478
+ suggestion: 'Replace with onError: "continueRegularOutput" or "continueErrorOutput"'
479
+ });
480
+ }
481
+ }
482
+ static validatePostgres(context) {
483
+ const { config, errors, warnings, suggestions, autofix } = context;
484
+ const { operation } = config;
485
+ if (['execute', 'select', 'insert', 'update', 'delete'].includes(operation)) {
486
+ this.validateSQLQuery(context, 'postgres');
487
+ }
488
+ switch (operation) {
489
+ case 'insert':
490
+ if (!config.table) {
491
+ errors.push({
492
+ type: 'missing_required',
493
+ property: 'table',
494
+ message: 'Table name is required for insert operation',
495
+ fix: 'Specify the table to insert data into'
496
+ });
497
+ }
498
+ if (!config.columns && !config.dataMode) {
499
+ warnings.push({
500
+ type: 'missing_common',
501
+ property: 'columns',
502
+ message: 'No columns specified for insert',
503
+ suggestion: 'Define which columns to insert data into'
504
+ });
505
+ }
506
+ break;
507
+ case 'update':
508
+ if (!config.table) {
509
+ errors.push({
510
+ type: 'missing_required',
511
+ property: 'table',
512
+ message: 'Table name is required for update operation',
513
+ fix: 'Specify the table to update'
514
+ });
515
+ }
516
+ if (!config.updateKey) {
517
+ warnings.push({
518
+ type: 'missing_common',
519
+ property: 'updateKey',
520
+ message: 'No update key specified',
521
+ suggestion: 'Set updateKey to identify which rows to update (e.g., "id")'
522
+ });
523
+ }
524
+ break;
525
+ case 'delete':
526
+ if (!config.table) {
527
+ errors.push({
528
+ type: 'missing_required',
529
+ property: 'table',
530
+ message: 'Table name is required for delete operation',
531
+ fix: 'Specify the table to delete from'
532
+ });
533
+ }
534
+ if (!config.deleteKey) {
535
+ errors.push({
536
+ type: 'missing_required',
537
+ property: 'deleteKey',
538
+ message: 'Delete key is required to identify rows',
539
+ fix: 'Set deleteKey (e.g., "id") to specify which rows to delete'
540
+ });
541
+ }
542
+ break;
543
+ case 'execute':
544
+ if (!config.query) {
545
+ errors.push({
546
+ type: 'missing_required',
547
+ property: 'query',
548
+ message: 'SQL query is required',
549
+ fix: 'Provide the SQL query to execute'
550
+ });
551
+ }
552
+ break;
553
+ }
554
+ if (config.connectionTimeout === undefined) {
555
+ suggestions.push('Consider setting connectionTimeout to handle slow connections');
556
+ }
557
+ if (!config.onError && !config.retryOnFail && !config.continueOnFail) {
558
+ if (operation === 'execute' && config.query?.toLowerCase().includes('select')) {
559
+ warnings.push({
560
+ type: 'best_practice',
561
+ property: 'errorHandling',
562
+ message: 'Database reads can fail due to connection issues',
563
+ suggestion: 'Add onError: "continueRegularOutput" and retryOnFail: true'
564
+ });
565
+ autofix.onError = 'continueRegularOutput';
566
+ autofix.retryOnFail = true;
567
+ autofix.maxTries = 3;
568
+ }
569
+ else if (['insert', 'update', 'delete'].includes(operation)) {
570
+ warnings.push({
571
+ type: 'best_practice',
572
+ property: 'errorHandling',
573
+ message: 'Database writes should handle errors carefully',
574
+ suggestion: 'Add onError: "stopWorkflow" with retryOnFail for transient failures'
575
+ });
576
+ autofix.onError = 'stopWorkflow';
577
+ autofix.retryOnFail = true;
578
+ autofix.maxTries = 2;
579
+ autofix.waitBetweenTries = 2000;
580
+ }
581
+ }
582
+ if (config.continueOnFail !== undefined) {
583
+ warnings.push({
584
+ type: 'deprecated',
585
+ property: 'continueOnFail',
586
+ message: 'continueOnFail is deprecated. Use onError instead',
587
+ suggestion: 'Replace with onError: "continueRegularOutput" or "stopWorkflow"'
588
+ });
589
+ }
590
+ }
591
+ static validateAIAgent(context) {
592
+ const { config, errors, warnings, suggestions, autofix } = context;
593
+ if (config.promptType === 'define') {
594
+ if (!config.text || (typeof config.text === 'string' && config.text.trim() === '')) {
595
+ errors.push({
596
+ type: 'missing_required',
597
+ property: 'text',
598
+ message: 'Custom prompt text is required when promptType is "define"',
599
+ fix: 'Provide a custom prompt in the text field, or change promptType to "auto"'
600
+ });
601
+ }
602
+ }
603
+ if (!config.systemMessage || (typeof config.systemMessage === 'string' && config.systemMessage.trim() === '')) {
604
+ suggestions.push('AI Agent works best with a system message that defines the agent\'s role, capabilities, and constraints. Set systemMessage to provide context.');
605
+ }
606
+ else if (typeof config.systemMessage === 'string' && config.systemMessage.trim().length < 20) {
607
+ warnings.push({
608
+ type: 'inefficient',
609
+ property: 'systemMessage',
610
+ message: 'System message is very short (< 20 characters)',
611
+ suggestion: 'Consider a more detailed system message to guide the agent\'s behavior'
612
+ });
613
+ }
614
+ if (config.hasOutputParser === true) {
615
+ warnings.push({
616
+ type: 'best_practice',
617
+ property: 'hasOutputParser',
618
+ message: 'Output parser is enabled. Ensure an ai_outputParser connection is configured in the workflow.',
619
+ suggestion: 'Connect an output parser node (e.g., Structured Output Parser) via ai_outputParser connection type'
620
+ });
621
+ }
622
+ if (config.needsFallback === true) {
623
+ warnings.push({
624
+ type: 'best_practice',
625
+ property: 'needsFallback',
626
+ message: 'Fallback model is enabled. Ensure 2 language models are connected via ai_languageModel connections.',
627
+ suggestion: 'Connect a primary model and a fallback model to handle failures gracefully'
628
+ });
629
+ }
630
+ if (config.maxIterations !== undefined) {
631
+ const maxIter = Number(config.maxIterations);
632
+ if (isNaN(maxIter) || maxIter < 1) {
633
+ errors.push({
634
+ type: 'invalid_value',
635
+ property: 'maxIterations',
636
+ message: 'maxIterations must be a positive number',
637
+ fix: 'Set maxIterations to a value >= 1 (e.g., 10)'
638
+ });
639
+ }
640
+ else if (maxIter > 50) {
641
+ warnings.push({
642
+ type: 'inefficient',
643
+ property: 'maxIterations',
644
+ message: `maxIterations is set to ${maxIter}. High values can lead to long execution times and high costs.`,
645
+ suggestion: 'Consider reducing maxIterations to 10-20 for most use cases'
646
+ });
647
+ }
648
+ }
649
+ if (!config.onError && !config.retryOnFail && !config.continueOnFail) {
650
+ warnings.push({
651
+ type: 'best_practice',
652
+ property: 'errorHandling',
653
+ message: 'AI models can fail due to API limits, rate limits, or invalid responses',
654
+ suggestion: 'Add onError: "continueRegularOutput" with retryOnFail for resilience'
655
+ });
656
+ autofix.onError = 'continueRegularOutput';
657
+ autofix.retryOnFail = true;
658
+ autofix.maxTries = 2;
659
+ autofix.waitBetweenTries = 5000;
660
+ }
661
+ if (config.continueOnFail !== undefined) {
662
+ warnings.push({
663
+ type: 'deprecated',
664
+ property: 'continueOnFail',
665
+ message: 'continueOnFail is deprecated. Use onError instead',
666
+ suggestion: 'Replace with onError: "continueRegularOutput" or "stopWorkflow"'
667
+ });
668
+ }
669
+ }
670
+ static validateMySQL(context) {
671
+ const { config, errors, warnings, suggestions } = context;
672
+ const { operation } = config;
673
+ if (['execute', 'insert', 'update', 'delete'].includes(operation)) {
674
+ this.validateSQLQuery(context, 'mysql');
675
+ }
676
+ switch (operation) {
677
+ case 'insert':
678
+ if (!config.table) {
679
+ errors.push({
680
+ type: 'missing_required',
681
+ property: 'table',
682
+ message: 'Table name is required for insert operation',
683
+ fix: 'Specify the table to insert data into'
684
+ });
685
+ }
686
+ break;
687
+ case 'update':
688
+ if (!config.table) {
689
+ errors.push({
690
+ type: 'missing_required',
691
+ property: 'table',
692
+ message: 'Table name is required for update operation',
693
+ fix: 'Specify the table to update'
694
+ });
695
+ }
696
+ if (!config.updateKey) {
697
+ warnings.push({
698
+ type: 'missing_common',
699
+ property: 'updateKey',
700
+ message: 'No update key specified',
701
+ suggestion: 'Set updateKey to identify which rows to update'
702
+ });
703
+ }
704
+ break;
705
+ case 'delete':
706
+ if (!config.table) {
707
+ errors.push({
708
+ type: 'missing_required',
709
+ property: 'table',
710
+ message: 'Table name is required for delete operation',
711
+ fix: 'Specify the table to delete from'
712
+ });
713
+ }
714
+ break;
715
+ case 'execute':
716
+ if (!config.query) {
717
+ errors.push({
718
+ type: 'missing_required',
719
+ property: 'query',
720
+ message: 'SQL query is required',
721
+ fix: 'Provide the SQL query to execute'
722
+ });
723
+ }
724
+ break;
725
+ }
726
+ if (config.timezone === undefined) {
727
+ suggestions.push('Consider setting timezone to ensure consistent date/time handling');
728
+ }
729
+ if (!config.onError && !config.retryOnFail && !config.continueOnFail) {
730
+ if (operation === 'execute' && config.query?.toLowerCase().includes('select')) {
731
+ warnings.push({
732
+ type: 'best_practice',
733
+ property: 'errorHandling',
734
+ message: 'Database queries can fail due to connection issues',
735
+ suggestion: 'Add onError: "continueRegularOutput" and retryOnFail: true'
736
+ });
737
+ }
738
+ else if (['insert', 'update', 'delete'].includes(operation)) {
739
+ warnings.push({
740
+ type: 'best_practice',
741
+ property: 'errorHandling',
742
+ message: 'Database modifications should handle errors carefully',
743
+ suggestion: 'Add onError: "stopWorkflow" with retryOnFail for transient failures'
744
+ });
745
+ }
746
+ }
747
+ }
748
+ static validateSQLQuery(context, dbType = 'generic') {
749
+ const { config, errors, warnings, suggestions } = context;
750
+ const query = config.query || config.deleteQuery || config.updateQuery || '';
751
+ if (!query)
752
+ return;
753
+ const lowerQuery = query.toLowerCase();
754
+ if (query.includes('${') || query.includes('{{')) {
755
+ warnings.push({
756
+ type: 'security',
757
+ message: 'Query contains template expressions that might be vulnerable to SQL injection',
758
+ suggestion: 'Use parameterized queries with query parameters instead of string interpolation'
759
+ });
760
+ suggestions.push('Example: Use "SELECT * FROM users WHERE id = $1" with queryParams: [userId]');
761
+ }
762
+ if (lowerQuery.includes('delete') && !lowerQuery.includes('where')) {
763
+ errors.push({
764
+ type: 'invalid_value',
765
+ property: 'query',
766
+ message: 'DELETE query without WHERE clause will delete all records',
767
+ fix: 'Add a WHERE clause to specify which records to delete'
768
+ });
769
+ }
770
+ if (lowerQuery.includes('update') && !lowerQuery.includes('where')) {
771
+ warnings.push({
772
+ type: 'security',
773
+ message: 'UPDATE query without WHERE clause will update all records',
774
+ suggestion: 'Add a WHERE clause to specify which records to update'
775
+ });
776
+ }
777
+ if (lowerQuery.includes('truncate')) {
778
+ warnings.push({
779
+ type: 'security',
780
+ message: 'TRUNCATE will remove all data from the table',
781
+ suggestion: 'Consider using DELETE with WHERE clause if you need to keep some data'
782
+ });
783
+ }
784
+ if (lowerQuery.includes('drop')) {
785
+ errors.push({
786
+ type: 'invalid_value',
787
+ property: 'query',
788
+ message: 'DROP operations are extremely dangerous and will permanently delete database objects',
789
+ fix: 'Use this only if you really intend to delete tables/databases permanently'
790
+ });
791
+ }
792
+ if (lowerQuery.includes('select *')) {
793
+ suggestions.push('Consider selecting specific columns instead of * for better performance');
794
+ }
795
+ if (dbType === 'postgres') {
796
+ if (query.includes('$$')) {
797
+ suggestions.push('Dollar-quoted strings detected - ensure they are properly closed');
798
+ }
799
+ }
800
+ else if (dbType === 'mysql') {
801
+ if (query.includes('`')) {
802
+ suggestions.push('Using backticks for identifiers - ensure they are properly paired');
803
+ }
804
+ }
805
+ }
806
+ static validateHttpRequest(context) {
807
+ const { config, errors, warnings, suggestions, autofix } = context;
808
+ const { method = 'GET', url, sendBody, authentication } = config;
809
+ if (!url) {
810
+ errors.push({
811
+ type: 'missing_required',
812
+ property: 'url',
813
+ message: 'URL is required for HTTP requests',
814
+ fix: 'Provide the full URL including protocol (https://...)'
815
+ });
816
+ }
817
+ else if (!url.startsWith('http://') && !url.startsWith('https://') && !url.includes('{{')) {
818
+ warnings.push({
819
+ type: 'invalid_value',
820
+ property: 'url',
821
+ message: 'URL should start with http:// or https://',
822
+ suggestion: 'Use https:// for secure connections'
823
+ });
824
+ }
825
+ if (['POST', 'PUT', 'PATCH'].includes(method) && !sendBody) {
826
+ warnings.push({
827
+ type: 'missing_common',
828
+ property: 'sendBody',
829
+ message: `${method} requests typically include a body`,
830
+ suggestion: 'Set sendBody: true and configure the body content'
831
+ });
832
+ }
833
+ if (!config.retryOnFail && !config.onError && !config.continueOnFail) {
834
+ warnings.push({
835
+ type: 'best_practice',
836
+ property: 'errorHandling',
837
+ message: 'HTTP requests can fail due to network issues or server errors',
838
+ suggestion: 'Add onError: "continueRegularOutput" and retryOnFail: true for resilience'
839
+ });
840
+ autofix.onError = 'continueRegularOutput';
841
+ autofix.retryOnFail = true;
842
+ autofix.maxTries = 3;
843
+ autofix.waitBetweenTries = 1000;
844
+ }
845
+ if (config.continueOnFail !== undefined) {
846
+ warnings.push({
847
+ type: 'deprecated',
848
+ property: 'continueOnFail',
849
+ message: 'continueOnFail is deprecated. Use onError instead',
850
+ suggestion: 'Replace with onError: "continueRegularOutput"'
851
+ });
852
+ autofix.onError = config.continueOnFail ? 'continueRegularOutput' : 'stopWorkflow';
853
+ delete autofix.continueOnFail;
854
+ }
855
+ if (config.retryOnFail) {
856
+ if (!['GET', 'HEAD', 'OPTIONS'].includes(method) && (!config.maxTries || config.maxTries > 3)) {
857
+ warnings.push({
858
+ type: 'best_practice',
859
+ property: 'maxTries',
860
+ message: `${method} requests might not be idempotent. Use fewer retries.`,
861
+ suggestion: 'Set maxTries: 2 for non-idempotent operations'
862
+ });
863
+ }
864
+ if (!config.alwaysOutputData) {
865
+ suggestions.push('Enable alwaysOutputData to capture error responses for debugging');
866
+ autofix.alwaysOutputData = true;
867
+ }
868
+ }
869
+ if (url && url.includes('api') && !authentication) {
870
+ warnings.push({
871
+ type: 'security',
872
+ property: 'authentication',
873
+ message: 'API endpoints typically require authentication',
874
+ suggestion: 'Configure authentication method (Bearer token, API key, etc.)'
875
+ });
876
+ }
877
+ if (!config.timeout) {
878
+ suggestions.push('Consider setting a timeout to prevent hanging requests');
879
+ }
880
+ }
881
+ static validateWebhook(context) {
882
+ const { config, errors, warnings, suggestions, autofix } = context;
883
+ const { path, httpMethod = 'POST', responseMode } = config;
884
+ if (!path) {
885
+ errors.push({
886
+ type: 'missing_required',
887
+ property: 'path',
888
+ message: 'Webhook path is required',
889
+ fix: 'Provide a unique path like "my-webhook" or "github-events"'
890
+ });
891
+ }
892
+ else if (path.startsWith('/')) {
893
+ warnings.push({
894
+ type: 'invalid_value',
895
+ property: 'path',
896
+ message: 'Webhook path should not start with /',
897
+ suggestion: 'Use "webhook-name" instead of "/webhook-name"'
898
+ });
899
+ }
900
+ if (!config.onError && !config.continueOnFail) {
901
+ warnings.push({
902
+ type: 'best_practice',
903
+ property: 'onError',
904
+ message: 'Webhooks should always send a response, even on error',
905
+ suggestion: 'Set onError: "continueRegularOutput" to ensure webhook responses'
906
+ });
907
+ autofix.onError = 'continueRegularOutput';
908
+ }
909
+ if (config.continueOnFail !== undefined) {
910
+ warnings.push({
911
+ type: 'deprecated',
912
+ property: 'continueOnFail',
913
+ message: 'continueOnFail is deprecated. Use onError instead',
914
+ suggestion: 'Replace with onError: "continueRegularOutput"'
915
+ });
916
+ autofix.onError = 'continueRegularOutput';
917
+ delete autofix.continueOnFail;
918
+ }
919
+ if (!config.alwaysOutputData) {
920
+ suggestions.push('Enable alwaysOutputData to debug webhook payloads');
921
+ autofix.alwaysOutputData = true;
922
+ }
923
+ suggestions.push('Consider adding webhook validation (HMAC signature verification)');
924
+ suggestions.push('Implement rate limiting for public webhooks');
925
+ }
926
+ static validateCode(context) {
927
+ const { config, errors, warnings, suggestions, autofix } = context;
928
+ const language = config.language || 'javaScript';
929
+ const codeField = language === 'python' ? 'pythonCode' : 'jsCode';
930
+ const code = config[codeField] || '';
931
+ if (!code || code.trim() === '') {
932
+ errors.push({
933
+ type: 'missing_required',
934
+ property: codeField,
935
+ message: 'Code cannot be empty',
936
+ fix: 'Add your code logic. Start with: return [{json: {result: "success"}}]'
937
+ });
938
+ return;
939
+ }
940
+ if (language === 'javaScript') {
941
+ this.validateJavaScriptCode(code, errors, warnings, suggestions);
942
+ }
943
+ else if (language === 'python') {
944
+ this.validatePythonCode(code, errors, warnings, suggestions);
945
+ }
946
+ this.validateReturnStatement(code, language, errors, warnings, suggestions);
947
+ this.validateN8nVariables(code, language, warnings, suggestions, errors);
948
+ this.validateCodeSecurity(code, language, warnings);
949
+ if (!config.onError && code.length > 100) {
950
+ warnings.push({
951
+ type: 'best_practice',
952
+ property: 'errorHandling',
953
+ message: 'Code nodes can throw errors - consider error handling',
954
+ suggestion: 'Add onError: "continueRegularOutput" to handle errors gracefully'
955
+ });
956
+ autofix.onError = 'continueRegularOutput';
957
+ }
958
+ if (config.mode === 'runOnceForEachItem' && code.includes('items')) {
959
+ warnings.push({
960
+ type: 'best_practice',
961
+ message: 'In "Run Once for Each Item" mode, use $json instead of items array',
962
+ suggestion: 'Access current item data with $json.fieldName'
963
+ });
964
+ }
965
+ if (!config.mode && code.includes('$json')) {
966
+ warnings.push({
967
+ type: 'best_practice',
968
+ message: '$json only works in "Run Once for Each Item" mode',
969
+ suggestion: 'Either set mode: "runOnceForEachItem" or use items[0].json'
970
+ });
971
+ }
972
+ }
973
+ static validateJavaScriptCode(code, errors, warnings, suggestions) {
974
+ const syntaxPatterns = [
975
+ { pattern: /const\s+const/, message: 'Duplicate const declaration' },
976
+ { pattern: /let\s+let/, message: 'Duplicate let declaration' },
977
+ { pattern: /}\s*}\s*}\s*}$/, message: 'Multiple closing braces at end - check your nesting' }
978
+ ];
979
+ syntaxPatterns.forEach(({ pattern, message }) => {
980
+ if (pattern.test(code)) {
981
+ errors.push({
982
+ type: 'invalid_value',
983
+ property: 'jsCode',
984
+ message: `Syntax error: ${message}`,
985
+ fix: 'Check your JavaScript syntax'
986
+ });
987
+ }
988
+ });
989
+ const functionWithAwait = /function\s+\w*\s*\([^)]*\)\s*{[^}]*await/;
990
+ const arrowWithAwait = /\([^)]*\)\s*=>\s*{[^}]*await/;
991
+ if ((functionWithAwait.test(code) || arrowWithAwait.test(code)) && !code.includes('async')) {
992
+ warnings.push({
993
+ type: 'best_practice',
994
+ message: 'Using await inside a non-async function',
995
+ suggestion: 'Add async keyword to the function, or use top-level await (Code nodes support it)'
996
+ });
997
+ }
998
+ if (code.includes('$helpers.httpRequest')) {
999
+ suggestions.push('$helpers.httpRequest is async - use: const response = await $helpers.httpRequest(...)');
1000
+ }
1001
+ if (code.includes('DateTime') && !code.includes('DateTime.')) {
1002
+ warnings.push({
1003
+ type: 'best_practice',
1004
+ message: 'DateTime is from Luxon library',
1005
+ suggestion: 'Use DateTime.now() or DateTime.fromISO() for date operations'
1006
+ });
1007
+ }
1008
+ }
1009
+ static validatePythonCode(code, errors, warnings, suggestions) {
1010
+ const lines = code.split('\n');
1011
+ if (code.includes('__name__') && code.includes('__main__')) {
1012
+ warnings.push({
1013
+ type: 'inefficient',
1014
+ message: 'if __name__ == "__main__" is not needed in Code nodes',
1015
+ suggestion: 'Code node Python runs directly - remove the main check'
1016
+ });
1017
+ }
1018
+ const unavailableImports = [
1019
+ { module: 'requests', suggestion: 'Use JavaScript Code node with $helpers.httpRequest for HTTP requests' },
1020
+ { module: 'pandas', suggestion: 'Use built-in list/dict operations or JavaScript for data manipulation' },
1021
+ { module: 'numpy', suggestion: 'Use standard Python math operations' },
1022
+ { module: 'pip', suggestion: 'External packages cannot be installed in Code nodes' }
1023
+ ];
1024
+ unavailableImports.forEach(({ module, suggestion }) => {
1025
+ if (code.includes(`import ${module}`) || code.includes(`from ${module}`)) {
1026
+ errors.push({
1027
+ type: 'invalid_value',
1028
+ property: 'pythonCode',
1029
+ message: `Module '${module}' is not available in Code nodes`,
1030
+ fix: suggestion
1031
+ });
1032
+ }
1033
+ });
1034
+ lines.forEach((line, i) => {
1035
+ if (line.trim().endsWith(':') && i < lines.length - 1) {
1036
+ const nextLine = lines[i + 1];
1037
+ if (nextLine.trim() && !nextLine.startsWith(' ') && !nextLine.startsWith('\t')) {
1038
+ errors.push({
1039
+ type: 'invalid_value',
1040
+ property: 'pythonCode',
1041
+ message: `Missing indentation after line ${i + 1}`,
1042
+ fix: 'Indent the line after the colon'
1043
+ });
1044
+ }
1045
+ }
1046
+ });
1047
+ }
1048
+ static validateReturnStatement(code, language, errors, warnings, suggestions) {
1049
+ const hasReturn = /return\s+/.test(code);
1050
+ if (!hasReturn) {
1051
+ errors.push({
1052
+ type: 'missing_required',
1053
+ property: language === 'python' ? 'pythonCode' : 'jsCode',
1054
+ message: 'Code must return data for the next node',
1055
+ fix: language === 'python'
1056
+ ? 'Add: return [{"json": {"result": "success"}}]'
1057
+ : 'Add: return [{json: {result: "success"}}]'
1058
+ });
1059
+ return;
1060
+ }
1061
+ if (language === 'javaScript') {
1062
+ if (/return\s+{(?!.*\[).*}\s*;?$/s.test(code) && !code.includes('json:')) {
1063
+ errors.push({
1064
+ type: 'invalid_value',
1065
+ property: 'jsCode',
1066
+ message: 'Return value must be an array of objects',
1067
+ fix: 'Wrap in array: return [{json: yourObject}]'
1068
+ });
1069
+ }
1070
+ if (/return\s+(true|false|null|undefined|\d+|['"`])/m.test(code)) {
1071
+ errors.push({
1072
+ type: 'invalid_value',
1073
+ property: 'jsCode',
1074
+ message: 'Cannot return primitive values directly',
1075
+ fix: 'Return array of objects: return [{json: {value: yourData}}]'
1076
+ });
1077
+ }
1078
+ if (/return\s+\[[\s\n]*['"`\d]/.test(code)) {
1079
+ errors.push({
1080
+ type: 'invalid_value',
1081
+ property: 'jsCode',
1082
+ message: 'Array items must be objects with json property',
1083
+ fix: 'Use: return [{json: {value: "data"}}] not return ["data"]'
1084
+ });
1085
+ }
1086
+ if (/return\s+items\s*;?$/.test(code) && !code.includes('map')) {
1087
+ suggestions.push('Returning items directly is fine if they already have {json: ...} structure. ' +
1088
+ 'To modify: return items.map(item => ({json: {...item.json, newField: "value"}}))');
1089
+ }
1090
+ }
1091
+ if (language === 'python') {
1092
+ if (/return\s+{(?!.*\[).*}$/s.test(code)) {
1093
+ errors.push({
1094
+ type: 'invalid_value',
1095
+ property: 'pythonCode',
1096
+ message: 'Return value must be a list of dicts',
1097
+ fix: 'Wrap in list: return [{"json": your_dict}]'
1098
+ });
1099
+ }
1100
+ if (/return\s+(True|False|None|\d+|['"`])/m.test(code)) {
1101
+ errors.push({
1102
+ type: 'invalid_value',
1103
+ property: 'pythonCode',
1104
+ message: 'Cannot return primitive values directly',
1105
+ fix: 'Return list of dicts: return [{"json": {"value": your_data}}]'
1106
+ });
1107
+ }
1108
+ }
1109
+ }
1110
+ static validateN8nVariables(code, language, warnings, suggestions, errors) {
1111
+ const inputPatterns = language === 'javaScript'
1112
+ ? ['items', '$input', '$json', '$node', '$prevNode']
1113
+ : ['items', '_input'];
1114
+ const usesInput = inputPatterns.some(pattern => code.includes(pattern));
1115
+ if (!usesInput && code.length > 50) {
1116
+ warnings.push({
1117
+ type: 'missing_common',
1118
+ message: 'Code doesn\'t reference input data',
1119
+ suggestion: language === 'javaScript'
1120
+ ? 'Access input with: items, $input.all(), or $json (single-item mode)'
1121
+ : 'Access input with: items variable'
1122
+ });
1123
+ }
1124
+ if (code.includes('{{') && code.includes('}}')) {
1125
+ errors.push({
1126
+ type: 'invalid_value',
1127
+ property: language === 'python' ? 'pythonCode' : 'jsCode',
1128
+ message: 'Expression syntax {{...}} is not valid in Code nodes',
1129
+ fix: 'Use regular JavaScript/Python syntax without double curly braces'
1130
+ });
1131
+ }
1132
+ if (code.includes('$node[')) {
1133
+ warnings.push({
1134
+ type: 'invalid_value',
1135
+ property: language === 'python' ? 'pythonCode' : 'jsCode',
1136
+ message: 'Use $(\'Node Name\') instead of $node[\'Node Name\'] in Code nodes',
1137
+ suggestion: 'Replace $node[\'NodeName\'] with $(\'NodeName\')'
1138
+ });
1139
+ }
1140
+ const expressionOnlyFunctions = ['$now()', '$today()', '$tomorrow()', '.unique()', '.pluck(', '.keys()', '.hash('];
1141
+ expressionOnlyFunctions.forEach(func => {
1142
+ if (code.includes(func)) {
1143
+ warnings.push({
1144
+ type: 'invalid_value',
1145
+ property: language === 'python' ? 'pythonCode' : 'jsCode',
1146
+ message: `${func} is an expression-only function not available in Code nodes`,
1147
+ suggestion: 'See Code node documentation for alternatives'
1148
+ });
1149
+ }
1150
+ });
1151
+ if (language === 'javaScript') {
1152
+ if (/\$(?![a-zA-Z])/.test(code) && !code.includes('${')) {
1153
+ warnings.push({
1154
+ type: 'best_practice',
1155
+ message: 'Invalid $ usage detected',
1156
+ suggestion: 'n8n variables start with $: $json, $input, $node, $workflow, $execution'
1157
+ });
1158
+ }
1159
+ if (code.includes('helpers.') && !code.includes('$helpers')) {
1160
+ warnings.push({
1161
+ type: 'invalid_value',
1162
+ property: 'jsCode',
1163
+ message: 'Use $helpers not helpers',
1164
+ suggestion: 'Change helpers. to $helpers.'
1165
+ });
1166
+ }
1167
+ if (code.includes('$helpers') && !code.includes('typeof $helpers')) {
1168
+ warnings.push({
1169
+ type: 'best_practice',
1170
+ message: '$helpers availability varies by n8n version',
1171
+ suggestion: 'Check availability first: if (typeof $helpers !== "undefined" && $helpers.httpRequest) { ... }'
1172
+ });
1173
+ }
1174
+ if (code.includes('$helpers')) {
1175
+ suggestions.push('Common $helpers methods: httpRequest(), prepareBinaryData(). Note: getWorkflowStaticData is a standalone function - use $getWorkflowStaticData() instead');
1176
+ }
1177
+ if (code.includes('$helpers.getWorkflowStaticData')) {
1178
+ errors.push({
1179
+ type: 'invalid_value',
1180
+ property: 'jsCode',
1181
+ message: '$helpers.getWorkflowStaticData() will cause "$helpers is not defined" error',
1182
+ fix: 'Use $getWorkflowStaticData("global") or $getWorkflowStaticData("node") directly'
1183
+ });
1184
+ }
1185
+ if (code.includes('$jmespath(') && /\$jmespath\s*\(\s*['"`]/.test(code)) {
1186
+ warnings.push({
1187
+ type: 'invalid_value',
1188
+ property: 'jsCode',
1189
+ message: 'Code node $jmespath has reversed parameter order: $jmespath(data, query)',
1190
+ suggestion: 'Use: $jmespath(dataObject, "query.path") not $jmespath("query.path", dataObject)'
1191
+ });
1192
+ }
1193
+ if (code.includes('items[0].json') && !code.includes('.json.body')) {
1194
+ if (code.includes('Webhook') || code.includes('webhook') ||
1195
+ code.includes('$("Webhook")') || code.includes("$('Webhook')")) {
1196
+ warnings.push({
1197
+ type: 'invalid_value',
1198
+ property: 'jsCode',
1199
+ message: 'Webhook data is nested under .body property',
1200
+ suggestion: 'Use items[0].json.body.fieldName instead of items[0].json.fieldName for webhook data'
1201
+ });
1202
+ }
1203
+ else if (/items\[0\]\.json\.(payload|data|command|action|event|message)\b/.test(code)) {
1204
+ warnings.push({
1205
+ type: 'best_practice',
1206
+ message: 'If processing webhook data, remember it\'s nested under .body',
1207
+ suggestion: 'Webhook payloads are at items[0].json.body, not items[0].json'
1208
+ });
1209
+ }
1210
+ }
1211
+ }
1212
+ const jmespathFunction = language === 'javaScript' ? '$jmespath' : '_jmespath';
1213
+ if (code.includes(jmespathFunction + '(')) {
1214
+ const filterPattern = /\[?\?[^[\]]*(?:>=?|<=?|==|!=)\s*(\d+(?:\.\d+)?)\s*\]/g;
1215
+ let match;
1216
+ while ((match = filterPattern.exec(code)) !== null) {
1217
+ const number = match[1];
1218
+ const beforeNumber = code.substring(match.index, match.index + match[0].indexOf(number));
1219
+ const afterNumber = code.substring(match.index + match[0].indexOf(number) + number.length);
1220
+ if (!beforeNumber.includes('`') || !afterNumber.startsWith('`')) {
1221
+ errors.push({
1222
+ type: 'invalid_value',
1223
+ property: language === 'python' ? 'pythonCode' : 'jsCode',
1224
+ message: `JMESPath numeric literal ${number} must be wrapped in backticks`,
1225
+ fix: `Change [?field >= ${number}] to [?field >= \`${number}\`]`
1226
+ });
1227
+ }
1228
+ }
1229
+ suggestions.push('JMESPath in n8n requires backticks around numeric literals in filters: [?age >= `18`]');
1230
+ }
1231
+ }
1232
+ static validateCodeSecurity(code, language, warnings) {
1233
+ const dangerousPatterns = [
1234
+ { pattern: /eval\s*\(/, message: 'Avoid eval() - it\'s a security risk' },
1235
+ { pattern: /Function\s*\(/, message: 'Avoid Function constructor - use regular functions' },
1236
+ { pattern: language === 'python' ? /exec\s*\(/ : /exec\s*\(/, message: 'Avoid exec() - it\'s a security risk' },
1237
+ { pattern: /process\.env/, message: 'Limited environment access in Code nodes' },
1238
+ { pattern: /import\s+\*/, message: 'Avoid import * - be specific about imports' }
1239
+ ];
1240
+ dangerousPatterns.forEach(({ pattern, message }) => {
1241
+ if (pattern.test(code)) {
1242
+ warnings.push({
1243
+ type: 'security',
1244
+ message,
1245
+ suggestion: 'Use safer alternatives or built-in functions'
1246
+ });
1247
+ }
1248
+ });
1249
+ if (code.includes('require(')) {
1250
+ const builtinModules = ['crypto', 'util', 'querystring', 'url', 'buffer'];
1251
+ const requirePattern = /require\s*\(\s*['"`](\w+)['"`]\s*\)/g;
1252
+ let match;
1253
+ while ((match = requirePattern.exec(code)) !== null) {
1254
+ const moduleName = match[1];
1255
+ if (!builtinModules.includes(moduleName)) {
1256
+ warnings.push({
1257
+ type: 'security',
1258
+ message: `Cannot require('${moduleName}') - only built-in Node.js modules are available`,
1259
+ suggestion: `Available modules: ${builtinModules.join(', ')}`
1260
+ });
1261
+ }
1262
+ }
1263
+ if (/require\s*\([^'"`]/.test(code)) {
1264
+ warnings.push({
1265
+ type: 'security',
1266
+ message: 'Dynamic require() not supported',
1267
+ suggestion: 'Use static require with string literals: require("crypto")'
1268
+ });
1269
+ }
1270
+ }
1271
+ if ((code.includes('crypto.') || code.includes('randomBytes') || code.includes('randomUUID')) &&
1272
+ !code.includes('require') && language === 'javaScript') {
1273
+ warnings.push({
1274
+ type: 'invalid_value',
1275
+ message: 'Using crypto without require statement',
1276
+ suggestion: 'Add: const crypto = require("crypto"); at the beginning (ignore editor warnings)'
1277
+ });
1278
+ }
1279
+ if (/\b(fs|path|child_process)\b/.test(code)) {
1280
+ warnings.push({
1281
+ type: 'security',
1282
+ message: 'File system and process access not available in Code nodes',
1283
+ suggestion: 'Use other n8n nodes for file operations (e.g., Read/Write Files node)'
1284
+ });
1285
+ }
1286
+ }
1287
+ static validateSet(context) {
1288
+ const { config, errors, warnings } = context;
1289
+ if (config.jsonOutput !== undefined && config.jsonOutput !== null && config.jsonOutput !== '') {
1290
+ try {
1291
+ const parsed = JSON.parse(config.jsonOutput);
1292
+ if (Array.isArray(parsed)) {
1293
+ errors.push({
1294
+ type: 'invalid_value',
1295
+ property: 'jsonOutput',
1296
+ message: 'Set node expects a JSON object {}, not an array []',
1297
+ fix: 'Either wrap array items as object properties: {"items": [...]}, OR use a different approach for multiple items'
1298
+ });
1299
+ }
1300
+ if (typeof parsed === 'object' && !Array.isArray(parsed) && Object.keys(parsed).length === 0) {
1301
+ warnings.push({
1302
+ type: 'inefficient',
1303
+ property: 'jsonOutput',
1304
+ message: 'jsonOutput is an empty object - this node will output no data',
1305
+ suggestion: 'Add properties to the object or remove this node if not needed'
1306
+ });
1307
+ }
1308
+ }
1309
+ catch (e) {
1310
+ errors.push({
1311
+ type: 'syntax_error',
1312
+ property: 'jsonOutput',
1313
+ message: `Invalid JSON in jsonOutput: ${e instanceof Error ? e.message : 'Syntax error'}`,
1314
+ fix: 'Ensure jsonOutput contains valid JSON syntax'
1315
+ });
1316
+ }
1317
+ }
1318
+ if (config.mode === 'manual') {
1319
+ const hasFields = config.values && Object.keys(config.values).length > 0;
1320
+ if (!hasFields && !config.jsonOutput) {
1321
+ warnings.push({
1322
+ type: 'missing_common',
1323
+ message: 'Set node has no fields configured - will output empty items',
1324
+ suggestion: 'Add fields in the Values section or use JSON mode'
1325
+ });
1326
+ }
1327
+ }
1328
+ }
1329
+ }
1330
+ exports.NodeSpecificValidators = NodeSpecificValidators;
1331
+ //# sourceMappingURL=node-specific-validators.js.map