codika 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -0
  3. package/dist/cli/commands/completion.d.ts +15 -0
  4. package/dist/cli/commands/completion.d.ts.map +1 -0
  5. package/dist/cli/commands/completion.js +810 -0
  6. package/dist/cli/commands/completion.js.map +1 -0
  7. package/dist/cli/commands/config/clear.d.ts +12 -0
  8. package/dist/cli/commands/config/clear.d.ts.map +1 -0
  9. package/dist/cli/commands/config/clear.js +35 -0
  10. package/dist/cli/commands/config/clear.js.map +1 -0
  11. package/dist/cli/commands/config/index.d.ts +15 -0
  12. package/dist/cli/commands/config/index.d.ts.map +1 -0
  13. package/dist/cli/commands/config/index.js +21 -0
  14. package/dist/cli/commands/config/index.js.map +1 -0
  15. package/dist/cli/commands/config/set.d.ts +41 -0
  16. package/dist/cli/commands/config/set.d.ts.map +1 -0
  17. package/dist/cli/commands/config/set.js +185 -0
  18. package/dist/cli/commands/config/set.js.map +1 -0
  19. package/dist/cli/commands/config/show.d.ts +12 -0
  20. package/dist/cli/commands/config/show.d.ts.map +1 -0
  21. package/dist/cli/commands/config/show.js +45 -0
  22. package/dist/cli/commands/config/show.js.map +1 -0
  23. package/dist/cli/commands/deploy/documents.d.ts +12 -0
  24. package/dist/cli/commands/deploy/documents.d.ts.map +1 -0
  25. package/dist/cli/commands/deploy/documents.js +217 -0
  26. package/dist/cli/commands/deploy/documents.js.map +1 -0
  27. package/dist/cli/commands/deploy/index.d.ts +14 -0
  28. package/dist/cli/commands/deploy/index.d.ts.map +1 -0
  29. package/dist/cli/commands/deploy/index.js +21 -0
  30. package/dist/cli/commands/deploy/index.js.map +1 -0
  31. package/dist/cli/commands/deploy/process-data-ingestion.d.ts +13 -0
  32. package/dist/cli/commands/deploy/process-data-ingestion.d.ts.map +1 -0
  33. package/dist/cli/commands/deploy/process-data-ingestion.js +226 -0
  34. package/dist/cli/commands/deploy/process-data-ingestion.js.map +1 -0
  35. package/dist/cli/commands/deploy/use-case.d.ts +9 -0
  36. package/dist/cli/commands/deploy/use-case.d.ts.map +1 -0
  37. package/dist/cli/commands/deploy/use-case.js +212 -0
  38. package/dist/cli/commands/deploy/use-case.js.map +1 -0
  39. package/dist/cli/commands/get/execution.d.ts +9 -0
  40. package/dist/cli/commands/get/execution.d.ts.map +1 -0
  41. package/dist/cli/commands/get/execution.js +159 -0
  42. package/dist/cli/commands/get/execution.js.map +1 -0
  43. package/dist/cli/commands/get/index.d.ts +13 -0
  44. package/dist/cli/commands/get/index.d.ts.map +1 -0
  45. package/dist/cli/commands/get/index.js +20 -0
  46. package/dist/cli/commands/get/index.js.map +1 -0
  47. package/dist/cli/commands/get/skills.d.ts +15 -0
  48. package/dist/cli/commands/get/skills.d.ts.map +1 -0
  49. package/dist/cli/commands/get/skills.js +135 -0
  50. package/dist/cli/commands/get/skills.js.map +1 -0
  51. package/dist/cli/commands/get/use-case.d.ts +9 -0
  52. package/dist/cli/commands/get/use-case.d.ts.map +1 -0
  53. package/dist/cli/commands/get/use-case.js +186 -0
  54. package/dist/cli/commands/get/use-case.js.map +1 -0
  55. package/dist/cli/commands/init.d.ts +14 -0
  56. package/dist/cli/commands/init.d.ts.map +1 -0
  57. package/dist/cli/commands/init.js +347 -0
  58. package/dist/cli/commands/init.js.map +1 -0
  59. package/dist/cli/commands/integration/delete.d.ts +13 -0
  60. package/dist/cli/commands/integration/delete.d.ts.map +1 -0
  61. package/dist/cli/commands/integration/delete.js +140 -0
  62. package/dist/cli/commands/integration/delete.js.map +1 -0
  63. package/dist/cli/commands/integration/index.d.ts +13 -0
  64. package/dist/cli/commands/integration/index.d.ts.map +1 -0
  65. package/dist/cli/commands/integration/index.js +20 -0
  66. package/dist/cli/commands/integration/index.js.map +1 -0
  67. package/dist/cli/commands/integration/list.d.ts +13 -0
  68. package/dist/cli/commands/integration/list.d.ts.map +1 -0
  69. package/dist/cli/commands/integration/list.js +129 -0
  70. package/dist/cli/commands/integration/list.js.map +1 -0
  71. package/dist/cli/commands/integration/set.d.ts +13 -0
  72. package/dist/cli/commands/integration/set.d.ts.map +1 -0
  73. package/dist/cli/commands/integration/set.js +253 -0
  74. package/dist/cli/commands/integration/set.js.map +1 -0
  75. package/dist/cli/commands/list/executions.d.ts +12 -0
  76. package/dist/cli/commands/list/executions.d.ts.map +1 -0
  77. package/dist/cli/commands/list/executions.js +168 -0
  78. package/dist/cli/commands/list/executions.js.map +1 -0
  79. package/dist/cli/commands/list/index.d.ts +11 -0
  80. package/dist/cli/commands/list/index.d.ts.map +1 -0
  81. package/dist/cli/commands/list/index.js +14 -0
  82. package/dist/cli/commands/list/index.js.map +1 -0
  83. package/dist/cli/commands/logout.d.ts +12 -0
  84. package/dist/cli/commands/logout.d.ts.map +1 -0
  85. package/dist/cli/commands/logout.js +58 -0
  86. package/dist/cli/commands/logout.js.map +1 -0
  87. package/dist/cli/commands/project/create.d.ts +8 -0
  88. package/dist/cli/commands/project/create.d.ts.map +1 -0
  89. package/dist/cli/commands/project/create.js +109 -0
  90. package/dist/cli/commands/project/create.js.map +1 -0
  91. package/dist/cli/commands/project/index.d.ts +12 -0
  92. package/dist/cli/commands/project/index.d.ts.map +1 -0
  93. package/dist/cli/commands/project/index.js +15 -0
  94. package/dist/cli/commands/project/index.js.map +1 -0
  95. package/dist/cli/commands/publish.d.ts +12 -0
  96. package/dist/cli/commands/publish.d.ts.map +1 -0
  97. package/dist/cli/commands/publish.js +152 -0
  98. package/dist/cli/commands/publish.js.map +1 -0
  99. package/dist/cli/commands/redeploy.d.ts +11 -0
  100. package/dist/cli/commands/redeploy.d.ts.map +1 -0
  101. package/dist/cli/commands/redeploy.js +166 -0
  102. package/dist/cli/commands/redeploy.js.map +1 -0
  103. package/dist/cli/commands/status.d.ts +63 -0
  104. package/dist/cli/commands/status.d.ts.map +1 -0
  105. package/dist/cli/commands/status.js +290 -0
  106. package/dist/cli/commands/status.js.map +1 -0
  107. package/dist/cli/commands/trigger.d.ts +8 -0
  108. package/dist/cli/commands/trigger.d.ts.map +1 -0
  109. package/dist/cli/commands/trigger.js +247 -0
  110. package/dist/cli/commands/trigger.js.map +1 -0
  111. package/dist/cli/commands/use.d.ts +13 -0
  112. package/dist/cli/commands/use.d.ts.map +1 -0
  113. package/dist/cli/commands/use.js +92 -0
  114. package/dist/cli/commands/use.js.map +1 -0
  115. package/dist/cli/commands/verify/index.d.ts +13 -0
  116. package/dist/cli/commands/verify/index.d.ts.map +1 -0
  117. package/dist/cli/commands/verify/index.js +18 -0
  118. package/dist/cli/commands/verify/index.js.map +1 -0
  119. package/dist/cli/commands/verify/use-case.d.ts +23 -0
  120. package/dist/cli/commands/verify/use-case.d.ts.map +1 -0
  121. package/dist/cli/commands/verify/use-case.js +94 -0
  122. package/dist/cli/commands/verify/use-case.js.map +1 -0
  123. package/dist/cli/commands/verify/workflow.d.ts +22 -0
  124. package/dist/cli/commands/verify/workflow.d.ts.map +1 -0
  125. package/dist/cli/commands/verify/workflow.js +82 -0
  126. package/dist/cli/commands/verify/workflow.js.map +1 -0
  127. package/dist/cli/commands/whoami.d.ts +13 -0
  128. package/dist/cli/commands/whoami.d.ts.map +1 -0
  129. package/dist/cli/commands/whoami.js +126 -0
  130. package/dist/cli/commands/whoami.js.map +1 -0
  131. package/dist/cli/index.d.ts +24 -0
  132. package/dist/cli/index.d.ts.map +1 -0
  133. package/dist/cli/index.js +90 -0
  134. package/dist/cli/index.js.map +1 -0
  135. package/dist/cli/templates/claude-md-template.d.ts +12 -0
  136. package/dist/cli/templates/claude-md-template.d.ts.map +1 -0
  137. package/dist/cli/templates/claude-md-template.js +162 -0
  138. package/dist/cli/templates/claude-md-template.js.map +1 -0
  139. package/dist/cli/templates/config-template.d.ts +18 -0
  140. package/dist/cli/templates/config-template.d.ts.map +1 -0
  141. package/dist/cli/templates/config-template.js +350 -0
  142. package/dist/cli/templates/config-template.js.map +1 -0
  143. package/dist/cli/templates/skill-templates.d.ts +24 -0
  144. package/dist/cli/templates/skill-templates.d.ts.map +1 -0
  145. package/dist/cli/templates/skill-templates.js +117 -0
  146. package/dist/cli/templates/skill-templates.js.map +1 -0
  147. package/dist/cli/templates/slug.d.ts +9 -0
  148. package/dist/cli/templates/slug.d.ts.map +1 -0
  149. package/dist/cli/templates/slug.js +17 -0
  150. package/dist/cli/templates/slug.js.map +1 -0
  151. package/dist/cli/templates/workflow-templates.d.ts +693 -0
  152. package/dist/cli/templates/workflow-templates.d.ts.map +1 -0
  153. package/dist/cli/templates/workflow-templates.js +516 -0
  154. package/dist/cli/templates/workflow-templates.js.map +1 -0
  155. package/dist/cli/utils/output.d.ts +65 -0
  156. package/dist/cli/utils/output.d.ts.map +1 -0
  157. package/dist/cli/utils/output.js +188 -0
  158. package/dist/cli/utils/output.js.map +1 -0
  159. package/dist/cli/utils/validation-output.d.ts +21 -0
  160. package/dist/cli/utils/validation-output.d.ts.map +1 -0
  161. package/dist/cli/utils/validation-output.js +204 -0
  162. package/dist/cli/utils/validation-output.js.map +1 -0
  163. package/dist/data/integration-fields.d.ts +27 -0
  164. package/dist/data/integration-fields.d.ts.map +1 -0
  165. package/dist/data/integration-fields.js +361 -0
  166. package/dist/data/integration-fields.js.map +1 -0
  167. package/dist/index.d.ts +25 -0
  168. package/dist/index.d.ts.map +1 -0
  169. package/dist/index.js +39 -0
  170. package/dist/index.js.map +1 -0
  171. package/dist/types/process-types.d.ts +740 -0
  172. package/dist/types/process-types.d.ts.map +1 -0
  173. package/dist/types/process-types.js +22 -0
  174. package/dist/types/process-types.js.map +1 -0
  175. package/dist/utils/config.d.ts +127 -0
  176. package/dist/utils/config.d.ts.map +1 -0
  177. package/dist/utils/config.js +315 -0
  178. package/dist/utils/config.js.map +1 -0
  179. package/dist/utils/data-ingestion-deploy-client.d.ts +53 -0
  180. package/dist/utils/data-ingestion-deploy-client.d.ts.map +1 -0
  181. package/dist/utils/data-ingestion-deploy-client.js +63 -0
  182. package/dist/utils/data-ingestion-deploy-client.js.map +1 -0
  183. package/dist/utils/data-ingestion-deployer.d.ts +78 -0
  184. package/dist/utils/data-ingestion-deployer.d.ts.map +1 -0
  185. package/dist/utils/data-ingestion-deployer.js +119 -0
  186. package/dist/utils/data-ingestion-deployer.js.map +1 -0
  187. package/dist/utils/deploy-client.d.ts +55 -0
  188. package/dist/utils/deploy-client.d.ts.map +1 -0
  189. package/dist/utils/deploy-client.js +73 -0
  190. package/dist/utils/deploy-client.js.map +1 -0
  191. package/dist/utils/deployment-archiver.d.ts +110 -0
  192. package/dist/utils/deployment-archiver.d.ts.map +1 -0
  193. package/dist/utils/deployment-archiver.js +158 -0
  194. package/dist/utils/deployment-archiver.js.map +1 -0
  195. package/dist/utils/document-deploy-client.d.ts +41 -0
  196. package/dist/utils/document-deploy-client.d.ts.map +1 -0
  197. package/dist/utils/document-deploy-client.js +46 -0
  198. package/dist/utils/document-deploy-client.js.map +1 -0
  199. package/dist/utils/encryption.d.ts +85 -0
  200. package/dist/utils/encryption.d.ts.map +1 -0
  201. package/dist/utils/encryption.js +162 -0
  202. package/dist/utils/encryption.js.map +1 -0
  203. package/dist/utils/execution-client.d.ts +71 -0
  204. package/dist/utils/execution-client.d.ts.map +1 -0
  205. package/dist/utils/execution-client.js +56 -0
  206. package/dist/utils/execution-client.js.map +1 -0
  207. package/dist/utils/integration-client.d.ts +134 -0
  208. package/dist/utils/integration-client.d.ts.map +1 -0
  209. package/dist/utils/integration-client.js +109 -0
  210. package/dist/utils/integration-client.js.map +1 -0
  211. package/dist/utils/list-executions-client.d.ts +47 -0
  212. package/dist/utils/list-executions-client.d.ts.map +1 -0
  213. package/dist/utils/list-executions-client.js +50 -0
  214. package/dist/utils/list-executions-client.js.map +1 -0
  215. package/dist/utils/metadata-client.d.ts +90 -0
  216. package/dist/utils/metadata-client.d.ts.map +1 -0
  217. package/dist/utils/metadata-client.js +66 -0
  218. package/dist/utils/metadata-client.js.map +1 -0
  219. package/dist/utils/project-client.d.ts +70 -0
  220. package/dist/utils/project-client.d.ts.map +1 -0
  221. package/dist/utils/project-client.js +63 -0
  222. package/dist/utils/project-client.js.map +1 -0
  223. package/dist/utils/project-json.d.ts +71 -0
  224. package/dist/utils/project-json.d.ts.map +1 -0
  225. package/dist/utils/project-json.js +129 -0
  226. package/dist/utils/project-json.js.map +1 -0
  227. package/dist/utils/publish-client.d.ts +53 -0
  228. package/dist/utils/publish-client.d.ts.map +1 -0
  229. package/dist/utils/publish-client.js +64 -0
  230. package/dist/utils/publish-client.js.map +1 -0
  231. package/dist/utils/redeploy-client.d.ts +39 -0
  232. package/dist/utils/redeploy-client.d.ts.map +1 -0
  233. package/dist/utils/redeploy-client.js +51 -0
  234. package/dist/utils/redeploy-client.js.map +1 -0
  235. package/dist/utils/skill-parser.d.ts +52 -0
  236. package/dist/utils/skill-parser.d.ts.map +1 -0
  237. package/dist/utils/skill-parser.js +127 -0
  238. package/dist/utils/skill-parser.js.map +1 -0
  239. package/dist/utils/skills-client.d.ts +39 -0
  240. package/dist/utils/skills-client.d.ts.map +1 -0
  241. package/dist/utils/skills-client.js +32 -0
  242. package/dist/utils/skills-client.js.map +1 -0
  243. package/dist/utils/trigger-client.d.ts +78 -0
  244. package/dist/utils/trigger-client.d.ts.map +1 -0
  245. package/dist/utils/trigger-client.js +81 -0
  246. package/dist/utils/trigger-client.js.map +1 -0
  247. package/dist/utils/use-case-deployer.d.ts +93 -0
  248. package/dist/utils/use-case-deployer.d.ts.map +1 -0
  249. package/dist/utils/use-case-deployer.js +270 -0
  250. package/dist/utils/use-case-deployer.js.map +1 -0
  251. package/dist/utils/version-manager.d.ts +63 -0
  252. package/dist/utils/version-manager.d.ts.map +1 -0
  253. package/dist/utils/version-manager.js +91 -0
  254. package/dist/utils/version-manager.js.map +1 -0
  255. package/dist/utils/workflow-encoding.d.ts +26 -0
  256. package/dist/utils/workflow-encoding.d.ts.map +1 -0
  257. package/dist/utils/workflow-encoding.js +41 -0
  258. package/dist/utils/workflow-encoding.js.map +1 -0
  259. package/dist/validation/fixer.d.ts +56 -0
  260. package/dist/validation/fixer.d.ts.map +1 -0
  261. package/dist/validation/fixer.js +168 -0
  262. package/dist/validation/fixer.js.map +1 -0
  263. package/dist/validation/rules/codika-init-required.d.ts +18 -0
  264. package/dist/validation/rules/codika-init-required.d.ts.map +1 -0
  265. package/dist/validation/rules/codika-init-required.js +70 -0
  266. package/dist/validation/rules/codika-init-required.js.map +1 -0
  267. package/dist/validation/rules/codika-submit-result.d.ts +22 -0
  268. package/dist/validation/rules/codika-submit-result.d.ts.map +1 -0
  269. package/dist/validation/rules/codika-submit-result.js +144 -0
  270. package/dist/validation/rules/codika-submit-result.js.map +1 -0
  271. package/dist/validation/rules/error-branch-required.d.ts +24 -0
  272. package/dist/validation/rules/error-branch-required.d.ts.map +1 -0
  273. package/dist/validation/rules/error-branch-required.js +103 -0
  274. package/dist/validation/rules/error-branch-required.js.map +1 -0
  275. package/dist/validation/rules/index.d.ts +18 -0
  276. package/dist/validation/rules/index.d.ts.map +1 -0
  277. package/dist/validation/rules/index.js +28 -0
  278. package/dist/validation/rules/index.js.map +1 -0
  279. package/dist/validation/rules/schedule-webhook-convergence.d.ts +24 -0
  280. package/dist/validation/rules/schedule-webhook-convergence.d.ts.map +1 -0
  281. package/dist/validation/rules/schedule-webhook-convergence.js +129 -0
  282. package/dist/validation/rules/schedule-webhook-convergence.js.map +1 -0
  283. package/dist/validation/rules/subworkflow-min-params.d.ts +21 -0
  284. package/dist/validation/rules/subworkflow-min-params.d.ts.map +1 -0
  285. package/dist/validation/rules/subworkflow-min-params.js +84 -0
  286. package/dist/validation/rules/subworkflow-min-params.js.map +1 -0
  287. package/dist/validation/runner.d.ts +43 -0
  288. package/dist/validation/runner.d.ts.map +1 -0
  289. package/dist/validation/runner.js +335 -0
  290. package/dist/validation/runner.js.map +1 -0
  291. package/dist/validation/types.d.ts +155 -0
  292. package/dist/validation/types.d.ts.map +1 -0
  293. package/dist/validation/types.js +8 -0
  294. package/dist/validation/types.js.map +1 -0
  295. package/dist/validation/use-case-scripts/calledby-consistency.d.ts +23 -0
  296. package/dist/validation/use-case-scripts/calledby-consistency.d.ts.map +1 -0
  297. package/dist/validation/use-case-scripts/calledby-consistency.js +236 -0
  298. package/dist/validation/use-case-scripts/calledby-consistency.js.map +1 -0
  299. package/dist/validation/use-case-scripts/config-exports.d.ts +17 -0
  300. package/dist/validation/use-case-scripts/config-exports.d.ts.map +1 -0
  301. package/dist/validation/use-case-scripts/config-exports.js +93 -0
  302. package/dist/validation/use-case-scripts/config-exports.js.map +1 -0
  303. package/dist/validation/use-case-scripts/custom-integration-schema.d.ts +21 -0
  304. package/dist/validation/use-case-scripts/custom-integration-schema.d.ts.map +1 -0
  305. package/dist/validation/use-case-scripts/custom-integration-schema.js +378 -0
  306. package/dist/validation/use-case-scripts/custom-integration-schema.js.map +1 -0
  307. package/dist/validation/use-case-scripts/index.d.ts +27 -0
  308. package/dist/validation/use-case-scripts/index.d.ts.map +1 -0
  309. package/dist/validation/use-case-scripts/index.js +52 -0
  310. package/dist/validation/use-case-scripts/index.js.map +1 -0
  311. package/dist/validation/use-case-scripts/integration-inheritance.d.ts +35 -0
  312. package/dist/validation/use-case-scripts/integration-inheritance.d.ts.map +1 -0
  313. package/dist/validation/use-case-scripts/integration-inheritance.js +348 -0
  314. package/dist/validation/use-case-scripts/integration-inheritance.js.map +1 -0
  315. package/dist/validation/use-case-scripts/schema-types.d.ts +21 -0
  316. package/dist/validation/use-case-scripts/schema-types.d.ts.map +1 -0
  317. package/dist/validation/use-case-scripts/schema-types.js +134 -0
  318. package/dist/validation/use-case-scripts/schema-types.js.map +1 -0
  319. package/dist/validation/use-case-scripts/skill-consistency.d.ts +21 -0
  320. package/dist/validation/use-case-scripts/skill-consistency.d.ts.map +1 -0
  321. package/dist/validation/use-case-scripts/skill-consistency.js +180 -0
  322. package/dist/validation/use-case-scripts/skill-consistency.js.map +1 -0
  323. package/dist/validation/use-case-scripts/subworkflow-references.d.ts +22 -0
  324. package/dist/validation/use-case-scripts/subworkflow-references.d.ts.map +1 -0
  325. package/dist/validation/use-case-scripts/subworkflow-references.js +139 -0
  326. package/dist/validation/use-case-scripts/subworkflow-references.js.map +1 -0
  327. package/dist/validation/use-case-scripts/trigger-type-consistency.d.ts +25 -0
  328. package/dist/validation/use-case-scripts/trigger-type-consistency.d.ts.map +1 -0
  329. package/dist/validation/use-case-scripts/trigger-type-consistency.js +265 -0
  330. package/dist/validation/use-case-scripts/trigger-type-consistency.js.map +1 -0
  331. package/dist/validation/use-case-scripts/trigger-types.d.ts +20 -0
  332. package/dist/validation/use-case-scripts/trigger-types.d.ts.map +1 -0
  333. package/dist/validation/use-case-scripts/trigger-types.js +177 -0
  334. package/dist/validation/use-case-scripts/trigger-types.js.map +1 -0
  335. package/dist/validation/use-case-scripts/triggers-required.d.ts +23 -0
  336. package/dist/validation/use-case-scripts/triggers-required.d.ts.map +1 -0
  337. package/dist/validation/use-case-scripts/triggers-required.js +111 -0
  338. package/dist/validation/use-case-scripts/triggers-required.js.map +1 -0
  339. package/dist/validation/use-case-scripts/webhook-path-consistency.d.ts +28 -0
  340. package/dist/validation/use-case-scripts/webhook-path-consistency.d.ts.map +1 -0
  341. package/dist/validation/use-case-scripts/webhook-path-consistency.js +288 -0
  342. package/dist/validation/use-case-scripts/webhook-path-consistency.js.map +1 -0
  343. package/dist/validation/use-case-scripts/workflow-imports.d.ts +16 -0
  344. package/dist/validation/use-case-scripts/workflow-imports.d.ts.map +1 -0
  345. package/dist/validation/use-case-scripts/workflow-imports.js +206 -0
  346. package/dist/validation/use-case-scripts/workflow-imports.js.map +1 -0
  347. package/dist/validation/workflow-scripts/credential-placeholders.d.ts +21 -0
  348. package/dist/validation/workflow-scripts/credential-placeholders.d.ts.map +1 -0
  349. package/dist/validation/workflow-scripts/credential-placeholders.js +278 -0
  350. package/dist/validation/workflow-scripts/credential-placeholders.js.map +1 -0
  351. package/dist/validation/workflow-scripts/db-always-output.d.ts +16 -0
  352. package/dist/validation/workflow-scripts/db-always-output.d.ts.map +1 -0
  353. package/dist/validation/workflow-scripts/db-always-output.js +95 -0
  354. package/dist/validation/workflow-scripts/db-always-output.js.map +1 -0
  355. package/dist/validation/workflow-scripts/exec-workflow-wait.d.ts +15 -0
  356. package/dist/validation/workflow-scripts/exec-workflow-wait.d.ts.map +1 -0
  357. package/dist/validation/workflow-scripts/exec-workflow-wait.js +85 -0
  358. package/dist/validation/workflow-scripts/exec-workflow-wait.js.map +1 -0
  359. package/dist/validation/workflow-scripts/index.d.ts +31 -0
  360. package/dist/validation/workflow-scripts/index.d.ts.map +1 -0
  361. package/dist/validation/workflow-scripts/index.js +58 -0
  362. package/dist/validation/workflow-scripts/index.js.map +1 -0
  363. package/dist/validation/workflow-scripts/instparm-quoting.d.ts +21 -0
  364. package/dist/validation/workflow-scripts/instparm-quoting.d.ts.map +1 -0
  365. package/dist/validation/workflow-scripts/instparm-quoting.js +59 -0
  366. package/dist/validation/workflow-scripts/instparm-quoting.js.map +1 -0
  367. package/dist/validation/workflow-scripts/llm-model-id.d.ts +17 -0
  368. package/dist/validation/workflow-scripts/llm-model-id.d.ts.map +1 -0
  369. package/dist/validation/workflow-scripts/llm-model-id.js +171 -0
  370. package/dist/validation/workflow-scripts/llm-model-id.js.map +1 -0
  371. package/dist/validation/workflow-scripts/llm-output-access.d.ts +23 -0
  372. package/dist/validation/workflow-scripts/llm-output-access.d.ts.map +1 -0
  373. package/dist/validation/workflow-scripts/llm-output-access.js +274 -0
  374. package/dist/validation/workflow-scripts/llm-output-access.js.map +1 -0
  375. package/dist/validation/workflow-scripts/merge-before-terminal.d.ts +20 -0
  376. package/dist/validation/workflow-scripts/merge-before-terminal.d.ts.map +1 -0
  377. package/dist/validation/workflow-scripts/merge-before-terminal.js +87 -0
  378. package/dist/validation/workflow-scripts/merge-before-terminal.js.map +1 -0
  379. package/dist/validation/workflow-scripts/placeholder-syntax.d.ts +29 -0
  380. package/dist/validation/workflow-scripts/placeholder-syntax.d.ts.map +1 -0
  381. package/dist/validation/workflow-scripts/placeholder-syntax.js +154 -0
  382. package/dist/validation/workflow-scripts/placeholder-syntax.js.map +1 -0
  383. package/dist/validation/workflow-scripts/retry-backoff.d.ts +16 -0
  384. package/dist/validation/workflow-scripts/retry-backoff.d.ts.map +1 -0
  385. package/dist/validation/workflow-scripts/retry-backoff.js +197 -0
  386. package/dist/validation/workflow-scripts/retry-backoff.js.map +1 -0
  387. package/dist/validation/workflow-scripts/webhook-id.d.ts +17 -0
  388. package/dist/validation/workflow-scripts/webhook-id.d.ts.map +1 -0
  389. package/dist/validation/workflow-scripts/webhook-id.js +79 -0
  390. package/dist/validation/workflow-scripts/webhook-id.js.map +1 -0
  391. package/dist/validation/workflow-scripts/workflow-format.d.ts +16 -0
  392. package/dist/validation/workflow-scripts/workflow-format.d.ts.map +1 -0
  393. package/dist/validation/workflow-scripts/workflow-format.js +51 -0
  394. package/dist/validation/workflow-scripts/workflow-format.js.map +1 -0
  395. package/dist/validation/workflow-scripts/workflow-sanitization.d.ts +21 -0
  396. package/dist/validation/workflow-scripts/workflow-sanitization.d.ts.map +1 -0
  397. package/dist/validation/workflow-scripts/workflow-sanitization.js +78 -0
  398. package/dist/validation/workflow-scripts/workflow-sanitization.js.map +1 -0
  399. package/dist/validation/workflow-scripts/workflow-settings.d.ts +19 -0
  400. package/dist/validation/workflow-scripts/workflow-settings.d.ts.map +1 -0
  401. package/dist/validation/workflow-scripts/workflow-settings.js +131 -0
  402. package/dist/validation/workflow-scripts/workflow-settings.js.map +1 -0
  403. package/package.json +64 -0
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Rule: CODIKA-SUBMIT
3
+ *
4
+ * In parent workflows that have a Codika Init node, every terminal node
5
+ * (node with no outgoing edges) that is reachable from the Init node
6
+ * must be a Codika Submit Result or Codika Report Error.
7
+ *
8
+ * This ensures that every execution path that begins tracking (Init)
9
+ * also ends tracking (Submit/Report Error).
10
+ *
11
+ * Terminal nodes NOT reachable from a Codika Init are ignored — they
12
+ * belong to branches that don't participate in execution tracking
13
+ * (e.g., early-exit guard branches in routers).
14
+ *
15
+ * Exception: Sub-workflows (starting with Execute Workflow Trigger) are exempt
16
+ * as they return data to the parent workflow instead.
17
+ */
18
+ export const metadata = {
19
+ id: 'CODIKA-SUBMIT',
20
+ name: 'codika_submit_result',
21
+ severity: 'must',
22
+ description: 'Terminal nodes reachable from Codika Init must be Submit Result or Report Error',
23
+ details: 'Add Codika Submit Result node at the end of success paths, and Codika Report Error at the end of error paths',
24
+ category: 'codika',
25
+ };
26
+ // Valid result operations
27
+ const VALID_RESULT_OPERATIONS = ['submitResult', 'reportError', 'ingestionCallback'];
28
+ // Valid init operations
29
+ const VALID_INIT_OPERATIONS = ['initWorkflow', 'initDataIngestion'];
30
+ /**
31
+ * Check if a node is a sub-workflow trigger (exempt from rule)
32
+ */
33
+ function isSubWorkflowTrigger(node) {
34
+ return node.type.toLowerCase().includes('executeworkflowtrigger');
35
+ }
36
+ /**
37
+ * Check if a node is a Codika result node (Submit Result or Report Error)
38
+ */
39
+ function isCodikaResultNode(node) {
40
+ if (!node.type.toLowerCase().includes('codika')) {
41
+ return false;
42
+ }
43
+ const params = node.params || {};
44
+ const operation = params.operation;
45
+ return VALID_RESULT_OPERATIONS.includes(operation || '');
46
+ }
47
+ /**
48
+ * Check if a node is a Codika Init node
49
+ */
50
+ function isCodikaInitNode(node) {
51
+ if (!node.type.toLowerCase().includes('codika')) {
52
+ return false;
53
+ }
54
+ const params = node.params || {};
55
+ const operation = params.operation;
56
+ return VALID_INIT_OPERATIONS.includes(operation || '');
57
+ }
58
+ /**
59
+ * Find all nodes reachable from a given node via BFS
60
+ */
61
+ function findReachableNodes(graph, startId) {
62
+ const reachable = new Set();
63
+ const queue = [startId];
64
+ while (queue.length > 0) {
65
+ const current = queue.shift();
66
+ if (reachable.has(current))
67
+ continue;
68
+ reachable.add(current);
69
+ for (const edge of graph.edges) {
70
+ if (edge.from === current && !reachable.has(edge.to)) {
71
+ queue.push(edge.to);
72
+ }
73
+ }
74
+ }
75
+ return reachable;
76
+ }
77
+ /**
78
+ * Find all terminal nodes (nodes with no outgoing edges)
79
+ */
80
+ function findTerminalNodes(graph) {
81
+ const nodesWithOutgoing = new Set();
82
+ for (const edge of graph.edges) {
83
+ nodesWithOutgoing.add(edge.from);
84
+ }
85
+ return graph.nodes.filter(n => !nodesWithOutgoing.has(n.id) &&
86
+ !n.type.includes('stickyNote'));
87
+ }
88
+ export const codikaSubmitResult = (graph, ctx) => {
89
+ const findings = [];
90
+ // Check if this is a sub-workflow (exempt from this rule)
91
+ if (graph.nodes.some(n => isSubWorkflowTrigger(n))) {
92
+ return [];
93
+ }
94
+ // Find all Codika Init nodes
95
+ const initNodes = graph.nodes.filter(n => isCodikaInitNode(n));
96
+ // No Init nodes — CODIKA-INIT rule handles that; nothing for us to check
97
+ if (initNodes.length === 0) {
98
+ return [];
99
+ }
100
+ // Find all nodes reachable from any Init node
101
+ const reachableFromInit = new Set();
102
+ for (const initNode of initNodes) {
103
+ const reachable = findReachableNodes(graph, initNode.id);
104
+ for (const id of reachable) {
105
+ reachableFromInit.add(id);
106
+ }
107
+ }
108
+ // Find all terminal nodes
109
+ const terminalNodes = findTerminalNodes(graph);
110
+ // Check terminal nodes that are reachable from Init
111
+ const nonCompliantTerminals = [];
112
+ for (const terminal of terminalNodes) {
113
+ // Skip terminals not reachable from Init (e.g., early-exit guards)
114
+ if (!reachableFromInit.has(terminal.id)) {
115
+ continue;
116
+ }
117
+ // Skip Init nodes themselves (if Init is terminal, that's a different issue)
118
+ if (isCodikaInitNode(terminal)) {
119
+ continue;
120
+ }
121
+ // Check if it's a Codika result node
122
+ if (isCodikaResultNode(terminal)) {
123
+ continue;
124
+ }
125
+ nonCompliantTerminals.push(terminal);
126
+ }
127
+ // Report findings for non-compliant paths
128
+ if (nonCompliantTerminals.length > 0) {
129
+ const terminalNames = nonCompliantTerminals
130
+ .map(n => `"${n.name || n.type}"`)
131
+ .join(', ');
132
+ findings.push({
133
+ rule: metadata.id,
134
+ severity: metadata.severity,
135
+ path: ctx.path,
136
+ message: `Workflow paths reachable from Codika Init end without Submit Result or Report Error: ${terminalNames}`,
137
+ raw_details: `Add a Codika Submit Result node (operation: submitResult) at the end of success paths, and Codika Report Error (operation: reportError) at the end of error paths. This is required for proper execution tracking on the Codika platform. Terminal nodes not reachable from Codika Init are not checked.`,
138
+ nodeId: nonCompliantTerminals[0]?.id,
139
+ line: ctx.nodeLines?.[nonCompliantTerminals[0]?.id || ''],
140
+ });
141
+ }
142
+ return findings;
143
+ };
144
+ //# sourceMappingURL=codika-submit-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codika-submit-result.js","sourceRoot":"","sources":["../../../src/validation/rules/codika-submit-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,sBAAsB;IAC5B,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,iFAAiF;IAC9F,OAAO,EAAE,8GAA8G;IACvH,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,0BAA0B;AAC1B,MAAM,uBAAuB,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC;AAErF,wBAAwB;AACxB,MAAM,qBAAqB,GAAG,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;AAEpE;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAAa;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,IAAa;IACvC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,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AC;AAClB,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Rule: ERROR-BRANCH-REQUIRED
3
+ *
4
+ * Error-prone nodes (HTTP Request, Google Sheets, Execute Workflow, etc.)
5
+ * must have an error branch to handle failures explicitly.
6
+ *
7
+ * This replaces flowlint-core's R12 (unhandled_error_path) which false-
8
+ * positives on LangChain sub-nodes. The upstream R12 uses broad regex
9
+ * matching — e.g. /put/i matches "outputParserStructured" because it
10
+ * contains "put". LangChain sub-nodes (model, parser, memory, embeddings,
11
+ * document loader) execute within their parent chain/agent node and cannot
12
+ * have independent error branches.
13
+ *
14
+ * An error branch is satisfied by either:
15
+ * - An outgoing edge classified as "error" (second output / red connector)
16
+ * - An outgoing edge to a recognized error handler node (stopAndError, etc.)
17
+ */
18
+ import type { RuleRunner } from '@replikanti/flowlint-core';
19
+ import type { RuleMetadata } from '../types.js';
20
+ export declare const RULE_ID = "ERROR-BRANCH-REQUIRED";
21
+ export declare const metadata: RuleMetadata;
22
+ export declare const errorBranchRequired: RuleRunner;
23
+ export default errorBranchRequired;
24
+ //# sourceMappingURL=error-branch-required.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-branch-required.d.ts","sourceRoot":"","sources":["../../../src/validation/rules/error-branch-required.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAkB,UAAU,EAAwB,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,OAAO,0BAA0B,CAAC;AAE/C,eAAO,MAAM,QAAQ,EAAE,YAUtB,CAAC;AA6CF,eAAO,MAAM,mBAAmB,EAAE,UAyCjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Rule: ERROR-BRANCH-REQUIRED
3
+ *
4
+ * Error-prone nodes (HTTP Request, Google Sheets, Execute Workflow, etc.)
5
+ * must have an error branch to handle failures explicitly.
6
+ *
7
+ * This replaces flowlint-core's R12 (unhandled_error_path) which false-
8
+ * positives on LangChain sub-nodes. The upstream R12 uses broad regex
9
+ * matching — e.g. /put/i matches "outputParserStructured" because it
10
+ * contains "put". LangChain sub-nodes (model, parser, memory, embeddings,
11
+ * document loader) execute within their parent chain/agent node and cannot
12
+ * have independent error branches.
13
+ *
14
+ * An error branch is satisfied by either:
15
+ * - An outgoing edge classified as "error" (second output / red connector)
16
+ * - An outgoing edge to a recognized error handler node (stopAndError, etc.)
17
+ */
18
+ export const RULE_ID = 'ERROR-BRANCH-REQUIRED';
19
+ export const metadata = {
20
+ id: RULE_ID,
21
+ name: 'error_branch_required',
22
+ severity: 'must',
23
+ description: 'Error-prone nodes must have an error branch (red connector) for failure handling',
24
+ details: 'Add onError: "continueErrorOutput" to the node and connect the second output (index 1) ' +
25
+ 'to an error handler node. This prevents silent failures in API calls, database operations, ' +
26
+ 'and external service interactions.',
27
+ category: 'reliability',
28
+ };
29
+ /**
30
+ * Patterns matching node types that interact with external services
31
+ * and are likely to fail at runtime.
32
+ *
33
+ * Mirrors flowlint-core's isErrorProneNode() logic.
34
+ */
35
+ const API_PATTERN = /http|request|google|facebook|ads/i;
36
+ const MUTATION_PATTERN = /write|insert|update|delete|post|put|patch|database|mongo|supabase|sheet/i;
37
+ const EXEC_PATTERN = /execute|workflow|function/i;
38
+ /**
39
+ * LangChain sub-node types that should be excluded from error branch checks.
40
+ * These nodes run inside their parent chain/agent and cannot have independent error outputs.
41
+ */
42
+ const LANGCHAIN_SUBNODE_PATTERN = /langchain\.(lmChat|outputParser|memory|embeddings|document|vectorStore|toolCode|toolWorkflow)/i;
43
+ /**
44
+ * Check if a node type represents an error-prone operation.
45
+ */
46
+ function isErrorProneNode(type) {
47
+ return API_PATTERN.test(type) || MUTATION_PATTERN.test(type) || EXEC_PATTERN.test(type);
48
+ }
49
+ /**
50
+ * Check if a node type is a LangChain sub-node (false positive for error branch checks).
51
+ */
52
+ function isLangchainSubnode(type) {
53
+ return LANGCHAIN_SUBNODE_PATTERN.test(type);
54
+ }
55
+ /**
56
+ * Check if a node is a recognized error handler (stopAndError, etc.).
57
+ */
58
+ function isErrorHandlerNode(type, name) {
59
+ const normalizedName = (name || '').toLowerCase();
60
+ return (/stopanderror|errorhandler|raiseerror/i.test(type) ||
61
+ normalizedName.includes('stop and error') ||
62
+ normalizedName.includes('error handler'));
63
+ }
64
+ export const errorBranchRequired = (graph, ctx) => {
65
+ const findings = [];
66
+ for (const node of graph.nodes) {
67
+ // Only check error-prone nodes
68
+ if (!isErrorProneNode(node.type))
69
+ continue;
70
+ // Exclude LangChain sub-nodes (they can't have independent error branches)
71
+ if (isLangchainSubnode(node.type))
72
+ continue;
73
+ // Check if the node has an error path
74
+ const hasErrorPath = graph.edges.some(edge => {
75
+ if (edge.from !== node.id)
76
+ return false;
77
+ // Direct error edge (second output from an error-prone node)
78
+ if (edge.on === 'error')
79
+ return true;
80
+ // Edge to a recognized error handler node
81
+ const targetNode = graph.nodes.find(n => n.id === edge.to);
82
+ return targetNode ? isErrorHandlerNode(targetNode.type, targetNode.name) : false;
83
+ });
84
+ if (!hasErrorPath) {
85
+ findings.push({
86
+ rule: RULE_ID,
87
+ severity: metadata.severity,
88
+ path: ctx.path,
89
+ message: `Node ${node.name} has no error branch (add a red connector to handler)`,
90
+ raw_details: `Add error handling for "${node.name}" (type: ${node.type}).\n\n` +
91
+ `Option 1: Set onError: "continueErrorOutput" on the node and connect the second output ` +
92
+ `(index 1) to an error handler.\n` +
93
+ `Option 2: Connect the node to a Stop And Error node.\n\n` +
94
+ `This prevents silent failures when external API calls or database operations fail.`,
95
+ nodeId: node.id,
96
+ line: ctx.nodeLines?.[node.id],
97
+ });
98
+ }
99
+ }
100
+ return findings;
101
+ };
102
+ export default errorBranchRequired;
103
+ //# sourceMappingURL=error-branch-required.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-branch-required.js","sourceRoot":"","sources":["../../../src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f,IAAI,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;aAC/B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Custom Flowlint Rules for Codika
3
+ *
4
+ * These rules extend flowlint-core with Codika-specific checks.
5
+ * Rules operate on the parsed workflow Graph structure.
6
+ */
7
+ import type { RuleRunner } from '@replikanti/flowlint-core';
8
+ /**
9
+ * All custom Flowlint rules for Codika workflows
10
+ *
11
+ * These are passed to flowlint-core's runAllRules() as extraRules.
12
+ */
13
+ export declare const customRules: RuleRunner[];
14
+ export { codikaInitRequired } from './codika-init-required.js';
15
+ export { codikaSubmitResult } from './codika-submit-result.js';
16
+ export { subworkflowMinParams } from './subworkflow-min-params.js';
17
+ export { scheduleWebhookConvergence } from './schedule-webhook-convergence.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validation/rules/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAM5D;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,UAAU,EAMnC,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Custom Flowlint Rules for Codika
3
+ *
4
+ * These rules extend flowlint-core with Codika-specific checks.
5
+ * Rules operate on the parsed workflow Graph structure.
6
+ */
7
+ import { codikaInitRequired } from './codika-init-required.js';
8
+ import { codikaSubmitResult } from './codika-submit-result.js';
9
+ import { subworkflowMinParams } from './subworkflow-min-params.js';
10
+ import { scheduleWebhookConvergence } from './schedule-webhook-convergence.js';
11
+ /**
12
+ * All custom Flowlint rules for Codika workflows
13
+ *
14
+ * These are passed to flowlint-core's runAllRules() as extraRules.
15
+ */
16
+ export const customRules = [
17
+ codikaInitRequired,
18
+ codikaSubmitResult,
19
+ subworkflowMinParams,
20
+ scheduleWebhookConvergence,
21
+ // Add more custom rules here as they are implemented
22
+ ];
23
+ // Re-export individual rules for direct access
24
+ export { codikaInitRequired } from './codika-init-required.js';
25
+ export { codikaSubmitResult } from './codika-submit-result.js';
26
+ export { subworkflowMinParams } from './subworkflow-min-params.js';
27
+ export { scheduleWebhookConvergence } from './schedule-webhook-convergence.js';
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/rules/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,kBAAkB;IAClB,kBAAkB;IAClB,oBAAoB;IACpB,0BAA0B;IAC1B,qDAAqD;CACtD,CAAC;AAEF,+CAA+C;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Rule: SCHEDULE-WEBHOOK-CONVERGENCE
3
+ *
4
+ * When a workflow has a Schedule Trigger, it must also have a Webhook node
5
+ * for manual execution, and both must connect to the same downstream node.
6
+ *
7
+ * This ensures:
8
+ * - Scheduled workflows can be manually triggered for testing/debugging
9
+ * - Manual execution follows the same processing flow as scheduled execution
10
+ *
11
+ * @see .guides/specific/schedule-triggers.md - "Manual Trigger Webhook"
12
+ */
13
+ import type { RuleRunner } from '@replikanti/flowlint-core';
14
+ import type { RuleMetadata } from '../types.js';
15
+ export declare const RULE_ID = "SCHEDULE-WEBHOOK-CONVERGENCE";
16
+ export declare const metadata: RuleMetadata & {
17
+ guideRef: {
18
+ path: string;
19
+ section: string;
20
+ };
21
+ };
22
+ export declare const scheduleWebhookConvergence: RuleRunner;
23
+ export default scheduleWebhookConvergence;
24
+ //# sourceMappingURL=schedule-webhook-convergence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-webhook-convergence.d.ts","sourceRoot":"","sources":["../../../src/validation/rules/schedule-webhook-convergence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAkB,UAAU,EAA8B,MAAM,2BAA2B,CAAC;AACxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,OAAO,iCAAiC,CAAC;AAEtD,eAAO,MAAM,QAAQ,EAAE,YAAY,GAAG;IAAE,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAYlF,CAAC;AAkCF,eAAO,MAAM,0BAA0B,EAAE,UAyFxC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Rule: SCHEDULE-WEBHOOK-CONVERGENCE
3
+ *
4
+ * When a workflow has a Schedule Trigger, it must also have a Webhook node
5
+ * for manual execution, and both must connect to the same downstream node.
6
+ *
7
+ * This ensures:
8
+ * - Scheduled workflows can be manually triggered for testing/debugging
9
+ * - Manual execution follows the same processing flow as scheduled execution
10
+ *
11
+ * @see .guides/specific/schedule-triggers.md - "Manual Trigger Webhook"
12
+ */
13
+ export const RULE_ID = 'SCHEDULE-WEBHOOK-CONVERGENCE';
14
+ export const metadata = {
15
+ id: RULE_ID,
16
+ name: 'schedule_webhook_convergence',
17
+ severity: 'must',
18
+ description: 'Scheduled workflows must have a webhook node that connects to the same downstream node',
19
+ details: 'Add a webhook node to enable manual triggering, and connect it to the same node as the schedule trigger output',
20
+ category: 'triggers',
21
+ guideRef: {
22
+ path: 'specific/schedule-triggers.md',
23
+ section: 'Manual Trigger Webhook',
24
+ },
25
+ };
26
+ // Node types
27
+ const SCHEDULE_TRIGGER_TYPE = 'n8n-nodes-base.scheduleTrigger';
28
+ const WEBHOOK_TYPE = 'n8n-nodes-base.webhook';
29
+ /**
30
+ * Find all schedule trigger nodes in the workflow
31
+ */
32
+ function findScheduleTriggerNodes(graph) {
33
+ return graph.nodes.filter(node => node.type.toLowerCase().includes('scheduletrigger'));
34
+ }
35
+ /**
36
+ * Find all webhook nodes in the workflow
37
+ */
38
+ function findWebhookNodes(graph) {
39
+ return graph.nodes.filter(node => node.type.toLowerCase().includes('webhook'));
40
+ }
41
+ /**
42
+ * Get the immediate downstream node IDs for a given node
43
+ */
44
+ function getDownstreamNodeIds(graph, nodeId) {
45
+ return graph.edges.filter(edge => edge.from === nodeId).map(edge => edge.to);
46
+ }
47
+ /**
48
+ * Check if two sets of node IDs have at least one common element
49
+ */
50
+ function hasCommonNode(set1, set2) {
51
+ return set1.some(id => set2.includes(id));
52
+ }
53
+ export const scheduleWebhookConvergence = (graph, ctx) => {
54
+ const findings = [];
55
+ // Find schedule trigger nodes
56
+ const scheduleTriggers = findScheduleTriggerNodes(graph);
57
+ // If no schedule triggers, rule doesn't apply
58
+ if (scheduleTriggers.length === 0) {
59
+ return [];
60
+ }
61
+ // Find webhook nodes
62
+ const webhookNodes = findWebhookNodes(graph);
63
+ // Check 1: Must have at least one webhook node when schedule trigger exists
64
+ if (webhookNodes.length === 0) {
65
+ for (const scheduleTrigger of scheduleTriggers) {
66
+ findings.push({
67
+ rule: RULE_ID,
68
+ severity: metadata.severity,
69
+ path: ctx.path,
70
+ message: `Schedule trigger "${scheduleTrigger.name}" requires a webhook node for manual execution`,
71
+ raw_details: `Scheduled workflows must have a webhook node to enable manual triggering.\n\n` +
72
+ `Add a webhook node and connect it to the same downstream node as the schedule trigger.\n\n` +
73
+ `See documentation: .guides/${metadata.guideRef.path} > "${metadata.guideRef.section}"`,
74
+ nodeId: scheduleTrigger.id,
75
+ line: ctx.nodeLines?.[scheduleTrigger.id],
76
+ });
77
+ }
78
+ return findings;
79
+ }
80
+ // Check 2: Schedule trigger and webhook must connect to the same downstream node
81
+ for (const scheduleTrigger of scheduleTriggers) {
82
+ const scheduleDownstream = getDownstreamNodeIds(graph, scheduleTrigger.id);
83
+ // Skip if schedule trigger has no connections (dead end - different rule)
84
+ if (scheduleDownstream.length === 0) {
85
+ continue;
86
+ }
87
+ // Check if any webhook connects to the same downstream node
88
+ let hasMatchingWebhook = false;
89
+ const webhookDownstreams = [];
90
+ for (const webhook of webhookNodes) {
91
+ const webhookDownstream = getDownstreamNodeIds(graph, webhook.id);
92
+ webhookDownstreams.push({ webhook, downstream: webhookDownstream });
93
+ if (hasCommonNode(scheduleDownstream, webhookDownstream)) {
94
+ hasMatchingWebhook = true;
95
+ break;
96
+ }
97
+ }
98
+ if (!hasMatchingWebhook) {
99
+ // Find the downstream node names for better error message
100
+ const scheduleTargetNodes = graph.nodes
101
+ .filter(n => scheduleDownstream.includes(n.id))
102
+ .map(n => n.name || n.type);
103
+ const webhookTargetInfo = webhookDownstreams
104
+ .map(w => {
105
+ const targets = graph.nodes
106
+ .filter(n => w.downstream.includes(n.id))
107
+ .map(n => n.name || n.type);
108
+ return `"${w.webhook.name}" -> [${targets.join(', ') || 'no connections'}]`;
109
+ })
110
+ .join(', ');
111
+ findings.push({
112
+ rule: RULE_ID,
113
+ severity: metadata.severity,
114
+ path: ctx.path,
115
+ message: `Schedule trigger "${scheduleTrigger.name}" and webhook(s) do not connect to the same downstream node`,
116
+ raw_details: `The schedule trigger and webhook must connect to the same node to ensure manual execution follows the same flow.\n\n` +
117
+ `Schedule trigger "${scheduleTrigger.name}" connects to: [${scheduleTargetNodes.join(', ')}]\n` +
118
+ `Webhook connections: ${webhookTargetInfo}\n\n` +
119
+ `Connect both triggers to the same downstream node.\n\n` +
120
+ `See documentation: .guides/${metadata.guideRef.path} > "${metadata.guideRef.section}"`,
121
+ nodeId: scheduleTrigger.id,
122
+ line: ctx.nodeLines?.[scheduleTrigger.id],
123
+ });
124
+ }
125
+ }
126
+ return findings;
127
+ };
128
+ export default scheduleWebhookConvergence;
129
+ //# sourceMappingURL=schedule-webhook-convergence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-webhook-convergence.js","sourceRoot":"","sources":["../../../src/validation/rules/schedule-webhook-convergence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AAEtD,MAAM,CAAC,MAAM,QAAQ,GAAmE;IACtF,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,8BAA8B;IACpC,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,wFAAwF;IACrG,OAAO,EACL,gHAAgH;IAClH,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE;QACR,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,wBAAwB;KAClC;CACF,CAAC;AAEF,aAAa;AACb,MAAM,qBAAqB,GAAG,gCAAgC,CAAC;AAC/D,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAE9C;;GAEG;AACH,SAAS,wBAAwB,CAAC,KAAY;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IA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IAAI,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC;aAC1C,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Rule: SUBWKFL-MIN-PARAMS
3
+ *
4
+ * Every sub-workflow must have at least 1 input parameter.
5
+ * n8n enforces minRequiredFields: 1 on the ExecuteWorkflowTrigger node.
6
+ * Sub-workflows with zero parameters will fail with: "At least 1 field is required."
7
+ *
8
+ * @see .guides/specific/sub-workflows.md - "Input Parameter Requirements" (Section 11)
9
+ */
10
+ import type { RuleRunner } from '@replikanti/flowlint-core';
11
+ import type { RuleMetadata } from '../types.js';
12
+ export declare const RULE_ID = "SUBWKFL-MIN-PARAMS";
13
+ export declare const metadata: RuleMetadata & {
14
+ guideRef: {
15
+ path: string;
16
+ section: string;
17
+ };
18
+ };
19
+ export declare const subworkflowMinParams: RuleRunner;
20
+ export default subworkflowMinParams;
21
+ //# sourceMappingURL=subworkflow-min-params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subworkflow-min-params.d.ts","sourceRoot":"","sources":["../../../src/validation/rules/subworkflow-min-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAS,UAAU,EAAwB,MAAM,2BAA2B,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,OAAO,uBAAuB,CAAC;AAE5C,eAAO,MAAM,QAAQ,EAAE,YAAY,GAAG;IAAE,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAWlF,CAAC;AA6CF,eAAO,MAAM,oBAAoB,EAAE,UA4BlC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Rule: SUBWKFL-MIN-PARAMS
3
+ *
4
+ * Every sub-workflow must have at least 1 input parameter.
5
+ * n8n enforces minRequiredFields: 1 on the ExecuteWorkflowTrigger node.
6
+ * Sub-workflows with zero parameters will fail with: "At least 1 field is required."
7
+ *
8
+ * @see .guides/specific/sub-workflows.md - "Input Parameter Requirements" (Section 11)
9
+ */
10
+ export const RULE_ID = 'SUBWKFL-MIN-PARAMS';
11
+ export const metadata = {
12
+ id: RULE_ID,
13
+ name: 'subworkflow_min_params',
14
+ severity: 'must',
15
+ description: 'Sub-workflows must have at least 1 input parameter',
16
+ details: 'Add at least one input parameter to the Execute Workflow Trigger node. n8n enforces minRequiredFields: 1.',
17
+ category: 'subworkflow',
18
+ guideRef: {
19
+ path: 'specific/sub-workflows.md',
20
+ section: 'Input Parameter Requirements',
21
+ },
22
+ };
23
+ // Sub-workflow trigger type
24
+ const SUBWORKFLOW_TRIGGER = 'executeworkflowtrigger';
25
+ /**
26
+ * Check if a node is a sub-workflow trigger
27
+ */
28
+ function isSubWorkflowTrigger(node) {
29
+ return node.type.toLowerCase().includes(SUBWORKFLOW_TRIGGER);
30
+ }
31
+ /**
32
+ * Count input parameters from the Execute Workflow Trigger node
33
+ */
34
+ function countInputParams(node) {
35
+ const params = node.params || {};
36
+ // Check workflowInputs.values array (newer format)
37
+ const workflowInputs = params.workflowInputs;
38
+ if (workflowInputs?.values && Array.isArray(workflowInputs.values)) {
39
+ return workflowInputs.values.length;
40
+ }
41
+ // Check inputSource with defineBelow mode
42
+ const inputSource = params.inputSource;
43
+ if (inputSource === 'defineBelow') {
44
+ // Look for inputDefinitions or schema
45
+ const schema = params.schema;
46
+ if (schema?.values && Array.isArray(schema.values)) {
47
+ return schema.values.length;
48
+ }
49
+ }
50
+ // No parameters found
51
+ return 0;
52
+ }
53
+ /**
54
+ * Find the sub-workflow trigger node (if any)
55
+ */
56
+ function findSubWorkflowTrigger(graph) {
57
+ return graph.nodes.find(n => isSubWorkflowTrigger(n)) || null;
58
+ }
59
+ export const subworkflowMinParams = (graph, ctx) => {
60
+ const findings = [];
61
+ // Find sub-workflow trigger node
62
+ const triggerNode = findSubWorkflowTrigger(graph);
63
+ // If no sub-workflow trigger, this rule doesn't apply
64
+ if (!triggerNode) {
65
+ return [];
66
+ }
67
+ // Count input parameters
68
+ const paramCount = countInputParams(triggerNode);
69
+ if (paramCount < 1) {
70
+ findings.push({
71
+ rule: RULE_ID,
72
+ severity: metadata.severity,
73
+ path: ctx.path,
74
+ message: `Sub-workflow must have at least 1 input parameter, found ${paramCount}`,
75
+ raw_details: `n8n enforces minRequiredFields: 1 on the ExecuteWorkflowTrigger node. Add at least one input parameter to the workflowInputs.values array. Without this, the workflow will fail with "At least 1 field is required."`,
76
+ nodeId: triggerNode.id,
77
+ line: ctx.nodeLines?.[triggerNode.id],
78
+ guideRef: metadata.guideRef,
79
+ });
80
+ }
81
+ return findings;
82
+ };
83
+ export default subworkflowMinParams;
84
+ //# sourceMappingURL=subworkflow-min-params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subworkflow-min-params.js","sourceRoot":"","sources":["../../../src/validation/rules/subworkflow-min-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,MAAM,CAAC,MAAM,OAAO,GAAG,oBAAoB,CAAC;AAE5C,MAAM,CAAC,MAAM,QAAQ,GAAmE;IACtF,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,wBAAwB;IAC9B,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,oDAAoD;IACjE,OAAO,EAAE,2GAA2G;IACpH,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE;QACR,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,8BAA8B;KACxC;CACF,CAAC;AAEF,4BAA4B;AAC5B,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AAErD;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAAa;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,WAA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