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,91 @@
1
+ /**
2
+ * Version Manager
3
+ * Utilities for managing version.json files and semver operations.
4
+ */
5
+ import { readFileSync, writeFileSync, existsSync } from 'fs';
6
+ import { join } from 'path';
7
+ /**
8
+ * Read version from version.json in a use case folder.
9
+ * Returns "1.0.0" if the file doesn't exist.
10
+ */
11
+ export function readVersion(useCasePath) {
12
+ const versionPath = join(useCasePath, 'version.json');
13
+ if (!existsSync(versionPath)) {
14
+ return '1.0.0';
15
+ }
16
+ const data = JSON.parse(readFileSync(versionPath, 'utf-8'));
17
+ return data.version;
18
+ }
19
+ /**
20
+ * Write version to version.json in a use case folder.
21
+ */
22
+ export function writeVersion(useCasePath, version) {
23
+ const versionPath = join(useCasePath, 'version.json');
24
+ writeFileSync(versionPath, JSON.stringify({ version }, null, 2) + '\n');
25
+ }
26
+ /**
27
+ * Parse a semver string (X.Y.Z) into parts.
28
+ */
29
+ export function parseSemver(version) {
30
+ const parts = version.split('.');
31
+ if (parts.length !== 3) {
32
+ throw new Error(`Invalid semver format: ${version}. Expected X.Y.Z format.`);
33
+ }
34
+ const [major, minor, patch] = parts.map((p) => parseInt(p, 10));
35
+ if (isNaN(major) || isNaN(minor) || isNaN(patch)) {
36
+ throw new Error(`Invalid semver format: ${version}. All parts must be numbers.`);
37
+ }
38
+ return { major, minor, patch };
39
+ }
40
+ /**
41
+ * Format semver parts back to string.
42
+ */
43
+ export function formatSemver(version) {
44
+ return `${version.major}.${version.minor}.${version.patch}`;
45
+ }
46
+ /**
47
+ * Increment a semver version based on strategy.
48
+ */
49
+ export function incrementSemver(version, strategy) {
50
+ switch (strategy) {
51
+ case 'major':
52
+ return { major: version.major + 1, minor: 0, patch: 0 };
53
+ case 'minor':
54
+ return { major: version.major, minor: version.minor + 1, patch: 0 };
55
+ case 'patch':
56
+ default:
57
+ return { major: version.major, minor: version.minor, patch: version.patch + 1 };
58
+ }
59
+ }
60
+ /**
61
+ * Resolve shorthand CLI flags to API and local version strategies.
62
+ *
63
+ * | Flag | API strategy | Local strategy |
64
+ * |--------------------|---------------|----------------|
65
+ * | (default / --patch)| minor_bump | patch |
66
+ * | --minor | minor_bump | minor |
67
+ * | --major | major_bump | major |
68
+ * | --version X.Y | explicit | patch |
69
+ */
70
+ export function resolveVersionStrategies(flags) {
71
+ if (flags.major) {
72
+ return { apiStrategy: 'major_bump', localStrategy: 'major' };
73
+ }
74
+ if (flags.minor) {
75
+ return { apiStrategy: 'minor_bump', localStrategy: 'minor' };
76
+ }
77
+ if (flags.version) {
78
+ const parts = flags.version.split('.');
79
+ if (parts.length !== 2 || isNaN(parseInt(parts[0])) || isNaN(parseInt(parts[1]))) {
80
+ throw new Error(`Invalid version format "${flags.version}". Expected "X.Y" format (e.g., "1.0").`);
81
+ }
82
+ return {
83
+ apiStrategy: 'explicit',
84
+ localStrategy: 'patch',
85
+ explicitVersion: flags.version,
86
+ };
87
+ }
88
+ // Default: --patch or no flags
89
+ return { apiStrategy: 'minor_bump', localStrategy: 'patch' };
90
+ }
91
+ //# sourceMappingURL=version-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-manager.js","sourceRoot":"","sources":["../../src/utils/version-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA0B5B;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,WAAmB;IAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACtD,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5D,OAAO,IAAI,CAAC,OAAO,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,WAAmB,EAAE,OAAe;IAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACtD,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED;;GAEG;AACH,M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E,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;IACpF,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAKxC;IACC,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;IAC/D,CAAC;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;IAC/D,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACjF,MAAM,IAAI,KAAK,CACb,2BAA2B,KAAK,CAAC,OAAO,yCAAyC,CAClF,CAAC;QACJ,CAAC;QACD,OAAO;YACL,WAAW,EAAE,UAAU;YACvB,aAAa,EAAE,OAAO;YACtB,eAAe,EAAE,KAAK,CAAC,OAAO;SAC/B,CAAC;IACJ,CAAC;IAED,+BAA+B;IAC/B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Workflow Encoding Utilities
3
+ * Handles loading, encoding, and decoding of n8n workflow JSON files
4
+ */
5
+ /**
6
+ * Load a workflow JSON file and return as parsed object
7
+ */
8
+ export declare function loadWorkflowJson(filePath: string): object;
9
+ /**
10
+ * Encode a workflow object to base64 string
11
+ */
12
+ export declare function encodeWorkflowToBase64(workflow: object): string;
13
+ /**
14
+ * Decode a base64 string back to workflow object
15
+ */
16
+ export declare function decodeWorkflowFromBase64(base64String: string): object;
17
+ /**
18
+ * Encode a JSON string directly to base64
19
+ */
20
+ export declare function encodeWorkflowFromString(jsonString: string): string;
21
+ /**
22
+ * Load a workflow JSON file and return as base64 encoded string
23
+ * Convenience function combining load + encode
24
+ */
25
+ export declare function loadAndEncodeWorkflow(filePath: string): string;
26
+ //# sourceMappingURL=workflow-encoding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-encoding.d.ts","sourceRoot":"","sources":["../../src/utils/workflow-encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGzD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAGrE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG9D"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Workflow Encoding Utilities
3
+ * Handles loading, encoding, and decoding of n8n workflow JSON files
4
+ */
5
+ import { readFileSync } from 'fs';
6
+ /**
7
+ * Load a workflow JSON file and return as parsed object
8
+ */
9
+ export function loadWorkflowJson(filePath) {
10
+ const content = readFileSync(filePath, 'utf-8');
11
+ return JSON.parse(content);
12
+ }
13
+ /**
14
+ * Encode a workflow object to base64 string
15
+ */
16
+ export function encodeWorkflowToBase64(workflow) {
17
+ const jsonString = JSON.stringify(workflow);
18
+ return Buffer.from(jsonString, 'utf-8').toString('base64');
19
+ }
20
+ /**
21
+ * Decode a base64 string back to workflow object
22
+ */
23
+ export function decodeWorkflowFromBase64(base64String) {
24
+ const jsonString = Buffer.from(base64String, 'base64').toString('utf-8');
25
+ return JSON.parse(jsonString);
26
+ }
27
+ /**
28
+ * Encode a JSON string directly to base64
29
+ */
30
+ export function encodeWorkflowFromString(jsonString) {
31
+ return Buffer.from(jsonString, 'utf-8').toString('base64');
32
+ }
33
+ /**
34
+ * Load a workflow JSON file and return as base64 encoded string
35
+ * Convenience function combining load + encode
36
+ */
37
+ export function loadAndEncodeWorkflow(filePath) {
38
+ const content = readFileSync(filePath, 'utf-8');
39
+ return encodeWorkflowFromString(content);
40
+ }
41
+ //# sourceMappingURL=workflow-encoding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-encoding.js","sourceRoot":"","sources":["../../src/utils/workflow-encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAElC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,YAAoB;IAC3D,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzE,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAkB;IACzD,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Auto-Fix Orchestrator
3
+ *
4
+ * Applies automatic fixes to files based on findings.
5
+ * Follows ESLint-style fixing pattern where each finding
6
+ * can optionally include a fix function.
7
+ */
8
+ import type { Finding, FixResult } from './types.js';
9
+ /**
10
+ * Options for applying fixes
11
+ */
12
+ export interface FixerOptions {
13
+ /** If true, don't actually write changes to disk */
14
+ dryRun?: boolean;
15
+ }
16
+ /**
17
+ * Apply all available fixes to a file
18
+ *
19
+ * @param filePath - Path to the file to fix
20
+ * @param findings - Array of findings, some of which may have fix functions
21
+ * @param options - Fixer options (dryRun, etc.)
22
+ * @returns Result with number of fixes applied and new content
23
+ */
24
+ export declare function applyFixes(filePath: string, findings: Finding[], options?: FixerOptions): FixResult;
25
+ /**
26
+ * Apply fixes to multiple files
27
+ *
28
+ * @param fileFindings - Map of file path to findings
29
+ * @param options - Fixer options
30
+ * @returns Array of fix results for each file
31
+ */
32
+ export declare function applyFixesToMultipleFiles(fileFindings: Map<string, Finding[]>, options?: FixerOptions): FixResult[];
33
+ /**
34
+ * Group findings by file path
35
+ *
36
+ * @param findings - Array of findings from multiple files
37
+ * @returns Map of file path to findings for that file
38
+ */
39
+ export declare function groupFindingsByFile(findings: Finding[]): Map<string, Finding[]>;
40
+ /**
41
+ * Preview what fixes would be applied to a file
42
+ *
43
+ * @param filePath - Path to the file
44
+ * @param findings - Findings with potential fixes
45
+ * @returns Preview of changes that would be made
46
+ */
47
+ export declare function previewFixes(filePath: string, findings: Finding[]): {
48
+ file: string;
49
+ fixes: Array<{
50
+ rule: string;
51
+ description: string;
52
+ before?: string;
53
+ after?: string;
54
+ }>;
55
+ };
56
+ //# sourceMappingURL=fixer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixer.d.ts","sourceRoot":"","sources":["../../src/validation/fixer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,GAAE,YAAiB,GACzB,SAAS,CA6EX;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EACpC,OAAO,GAAE,YAAiB,GACzB,SAAS,EAAE,CASb;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAU/E;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EAAE,GAClB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ,CAgDA"}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Auto-Fix Orchestrator
3
+ *
4
+ * Applies automatic fixes to files based on findings.
5
+ * Follows ESLint-style fixing pattern where each finding
6
+ * can optionally include a fix function.
7
+ */
8
+ import { readFileSync, writeFileSync } from 'fs';
9
+ /**
10
+ * Apply all available fixes to a file
11
+ *
12
+ * @param filePath - Path to the file to fix
13
+ * @param findings - Array of findings, some of which may have fix functions
14
+ * @param options - Fixer options (dryRun, etc.)
15
+ * @returns Result with number of fixes applied and new content
16
+ */
17
+ export function applyFixes(filePath, findings, options = {}) {
18
+ // Get fixable findings
19
+ const fixableFindings = findings.filter(f => f.fixable && f.fix);
20
+ if (fixableFindings.length === 0) {
21
+ return {
22
+ filePath,
23
+ applied: 0,
24
+ content: '',
25
+ wouldFix: [],
26
+ };
27
+ }
28
+ // In dry-run mode, just return what would be fixed
29
+ if (options.dryRun) {
30
+ return {
31
+ filePath,
32
+ applied: 0,
33
+ content: '',
34
+ wouldFix: fixableFindings,
35
+ };
36
+ }
37
+ // Read current file content
38
+ let content;
39
+ try {
40
+ content = readFileSync(filePath, 'utf-8');
41
+ }
42
+ catch (error) {
43
+ // If we can't read the file, we can't fix it
44
+ return {
45
+ filePath,
46
+ applied: 0,
47
+ content: '',
48
+ wouldFix: fixableFindings,
49
+ };
50
+ }
51
+ // Apply fixes in order
52
+ let applied = 0;
53
+ const originalContent = content;
54
+ for (const finding of fixableFindings) {
55
+ if (!finding.fix)
56
+ continue;
57
+ try {
58
+ const newContent = finding.fix.apply(content);
59
+ // Only count as applied if content actually changed
60
+ if (newContent !== content) {
61
+ content = newContent;
62
+ applied++;
63
+ }
64
+ }
65
+ catch (error) {
66
+ // Skip fixes that throw errors
67
+ console.error(`Fix for ${finding.rule} failed: ${error.message}`);
68
+ }
69
+ }
70
+ // Write back to file if changes were made
71
+ if (applied > 0 && content !== originalContent) {
72
+ try {
73
+ writeFileSync(filePath, content, 'utf-8');
74
+ }
75
+ catch (error) {
76
+ console.error(`Failed to write fixes to ${filePath}: ${error.message}`);
77
+ return {
78
+ filePath,
79
+ applied: 0,
80
+ content: originalContent,
81
+ };
82
+ }
83
+ }
84
+ return {
85
+ filePath,
86
+ applied,
87
+ content,
88
+ };
89
+ }
90
+ /**
91
+ * Apply fixes to multiple files
92
+ *
93
+ * @param fileFindings - Map of file path to findings
94
+ * @param options - Fixer options
95
+ * @returns Array of fix results for each file
96
+ */
97
+ export function applyFixesToMultipleFiles(fileFindings, options = {}) {
98
+ const results = [];
99
+ for (const [filePath, findings] of fileFindings) {
100
+ const result = applyFixes(filePath, findings, options);
101
+ results.push(result);
102
+ }
103
+ return results;
104
+ }
105
+ /**
106
+ * Group findings by file path
107
+ *
108
+ * @param findings - Array of findings from multiple files
109
+ * @returns Map of file path to findings for that file
110
+ */
111
+ export function groupFindingsByFile(findings) {
112
+ const grouped = new Map();
113
+ for (const finding of findings) {
114
+ const existing = grouped.get(finding.path) || [];
115
+ existing.push(finding);
116
+ grouped.set(finding.path, existing);
117
+ }
118
+ return grouped;
119
+ }
120
+ /**
121
+ * Preview what fixes would be applied to a file
122
+ *
123
+ * @param filePath - Path to the file
124
+ * @param findings - Findings with potential fixes
125
+ * @returns Preview of changes that would be made
126
+ */
127
+ export function previewFixes(filePath, findings) {
128
+ const fixableFindings = findings.filter(f => f.fixable && f.fix);
129
+ let content;
130
+ try {
131
+ content = readFileSync(filePath, 'utf-8');
132
+ }
133
+ catch {
134
+ return {
135
+ file: filePath,
136
+ fixes: fixableFindings.map(f => ({
137
+ rule: f.rule,
138
+ description: f.fix?.description || 'Unknown fix',
139
+ })),
140
+ };
141
+ }
142
+ const fixes = [];
143
+ for (const finding of fixableFindings) {
144
+ if (!finding.fix)
145
+ continue;
146
+ try {
147
+ const newContent = finding.fix.apply(content);
148
+ if (newContent !== content) {
149
+ // Extract relevant lines for before/after preview
150
+ // This is a simplified version - could be enhanced
151
+ fixes.push({
152
+ rule: finding.rule,
153
+ description: finding.fix.description,
154
+ // For line-specific changes, we could extract just those lines
155
+ // For now, we just note that a change would be made
156
+ });
157
+ }
158
+ }
159
+ catch {
160
+ // Skip preview for fixes that would fail
161
+ }
162
+ }
163
+ return {
164
+ file: filePath,
165
+ fixes,
166
+ };
167
+ }
168
+ //# sourceMappingURL=fixer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixer.js","sourceRoot":"","sources":["../../src/validation/fixer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAWjD;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACxB,QAAgB,EAChB,QAAmB,EACnB,UAAwB,EAAE;IAE1B,uBAAuB;IACvB,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAEjE,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO;YACL,QAAQ;YACR,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IAED,mDAAmD;IACnD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO;YACL,QAAQ;YACR,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,eAAe;SAC1B,CAAC;IACJ,CAAC;IAED,4BAA4B;IAC5B,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,6CAA6C;QAC7C,OAAO;YACL,QAAQ;YACR,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,eAAe;SAC1B,CAAC;IACJ,CAAC;IAED,uBAAuB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,EAAE,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,GAAG;YAAE,SAAS;QAE3B,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAE9C,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;gBAC3B,kDAAkD;gBAClD,mDAAmD;gBACnD,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;oBACpC,+DAA+D;oBAC/D,oDAAoD;iBACrD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,yCAAyC;QAC3C,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Rule: CODIKA-INIT
3
+ *
4
+ * Every parent workflow must contain at least one Codika Init node.
5
+ * This ensures execution tracking is initialized before business logic runs.
6
+ *
7
+ * Valid init operations:
8
+ * - initWorkflow (standard workflows)
9
+ * - initDataIngestion (RAG ingestion workflows)
10
+ *
11
+ * Exception: Sub-workflows (starting with Execute Workflow Trigger) are exempt
12
+ * as they inherit execution context from the parent workflow.
13
+ */
14
+ import type { RuleRunner } from '@replikanti/flowlint-core';
15
+ import type { RuleMetadata } from '../types.js';
16
+ export declare const metadata: RuleMetadata;
17
+ export declare const codikaInitRequired: RuleRunner;
18
+ //# sourceMappingURL=codika-init-required.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codika-init-required.d.ts","sourceRoot":"","sources":["../../../src/validation/rules/codika-init-required.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAkB,UAAU,EAAwB,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,QAAQ,EAAE,YAOtB,CAAC;AAuCF,eAAO,MAAM,kBAAkB,EAAE,UAsBhC,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Rule: CODIKA-INIT
3
+ *
4
+ * Every parent workflow must contain at least one Codika Init node.
5
+ * This ensures execution tracking is initialized before business logic runs.
6
+ *
7
+ * Valid init operations:
8
+ * - initWorkflow (standard workflows)
9
+ * - initDataIngestion (RAG ingestion workflows)
10
+ *
11
+ * Exception: Sub-workflows (starting with Execute Workflow Trigger) are exempt
12
+ * as they inherit execution context from the parent workflow.
13
+ */
14
+ export const metadata = {
15
+ id: 'CODIKA-INIT',
16
+ name: 'codika_init_required',
17
+ severity: 'must',
18
+ description: 'Parent workflows must contain a Codika Init node',
19
+ details: 'Add a Codika Init node to enable execution tracking on the Codika platform',
20
+ category: 'codika',
21
+ };
22
+ // Sub-workflow trigger - exempt from this rule
23
+ const SUBWORKFLOW_TRIGGER = 'n8n-nodes-base.executeWorkflowTrigger';
24
+ // Codika node type
25
+ const CODIKA_NODE_TYPE = 'n8n-nodes-codika.codika';
26
+ // Valid init operations
27
+ const VALID_INIT_OPERATIONS = ['initWorkflow', 'initDataIngestion'];
28
+ /**
29
+ * Check if a node is a sub-workflow trigger (exempt from rule)
30
+ */
31
+ function isSubWorkflowTrigger(node) {
32
+ return node.type.toLowerCase().includes('executeworkflowtrigger');
33
+ }
34
+ /**
35
+ * Check if a node is a valid Codika Init node
36
+ */
37
+ function isCodikaInitNode(node) {
38
+ if (!node.type.toLowerCase().includes('codika')) {
39
+ return false;
40
+ }
41
+ const params = node.params || {};
42
+ const operation = params.operation;
43
+ return VALID_INIT_OPERATIONS.includes(operation || '');
44
+ }
45
+ /**
46
+ * Check if the workflow is a sub-workflow (has an executeWorkflowTrigger)
47
+ */
48
+ function isSubWorkflow(graph) {
49
+ return graph.nodes.some(n => isSubWorkflowTrigger(n));
50
+ }
51
+ export const codikaInitRequired = (graph, ctx) => {
52
+ const findings = [];
53
+ // Empty workflows and sub-workflows are exempt
54
+ if (graph.nodes.length === 0 || isSubWorkflow(graph)) {
55
+ return [];
56
+ }
57
+ // Check if ANY node in the workflow is a valid Codika Init
58
+ const hasCodikaInit = graph.nodes.some(n => isCodikaInitNode(n));
59
+ if (!hasCodikaInit) {
60
+ findings.push({
61
+ rule: metadata.id,
62
+ severity: metadata.severity,
63
+ path: ctx.path,
64
+ message: `Workflow is missing a Codika Init node`,
65
+ raw_details: `Add a Codika Init node (operation: initWorkflow or initDataIngestion) to enable execution tracking on the Codika platform. Sub-workflows are exempt from this rule.`,
66
+ });
67
+ }
68
+ return findings;
69
+ };
70
+ //# sourceMappingURL=codika-init-required.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codika-init-required.js","sourceRoot":"","sources":["../../../src/validation/rules/codika-init-required.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,sBAAsB;IAC5B,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,kDAAkD;IAC/D,OAAO,EAAE,4EAA4E;IACrF,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,+CAA+C;AAC/C,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AAEpE,mBAAmB;AACnB,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAEnD,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,gBAAgB,CAAC,IAAa;IACrC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,CA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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
+ import type { RuleRunner } from '@replikanti/flowlint-core';
19
+ import type { RuleMetadata } from '../types.js';
20
+ export declare const metadata: RuleMetadata;
21
+ export declare const codikaSubmitResult: RuleRunner;
22
+ //# sourceMappingURL=codika-submit-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codika-submit-result.d.ts","sourceRoot":"","sources":["../../../src/validation/rules/codika-submit-result.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,QAAQ,EAAE,YAOtB,CAAC;AAgFF,eAAO,MAAM,kBAAkB,EAAE,UAoEhC,CAAC"}