@openapi-flow/n8n 0.0.0-stage → 0.3.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 (332) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -2
  3. package/THIRD_PARTY_NOTICES.md +9 -0
  4. package/dist/legacy/workflow/common/plan-validation.d.ts +1 -0
  5. package/dist/legacy/workflow/common/plan-validation.js +11 -0
  6. package/dist/legacy/workflow/common/workflow-id.d.ts +1 -0
  7. package/dist/legacy/workflow/common/workflow-id.js +8 -0
  8. package/dist/legacy/workflow/inbound/build-inbound-workflow.d.ts +2 -0
  9. package/dist/legacy/workflow/inbound/build-inbound-workflow.js +60 -0
  10. package/dist/legacy/workflow/inbound/compile-inbound-workflow.d.ts +2 -0
  11. package/dist/legacy/workflow/inbound/compile-inbound-workflow.js +25 -0
  12. package/dist/legacy/workflow/inbound/inbound-response.d.ts +2 -0
  13. package/dist/legacy/workflow/inbound/inbound-response.js +51 -0
  14. package/dist/legacy/workflow/request/base-url.d.ts +1 -0
  15. package/dist/legacy/workflow/request/base-url.js +14 -0
  16. package/dist/legacy/workflow/request/build-request-workflow.d.ts +3 -0
  17. package/dist/legacy/workflow/request/build-request-workflow.js +47 -0
  18. package/dist/legacy/workflow/request/build-sequence-workflow.d.ts +3 -0
  19. package/dist/legacy/workflow/request/build-sequence-workflow.js +53 -0
  20. package/dist/legacy/workflow/request/compile-catalog-sequence.d.ts +2 -0
  21. package/dist/legacy/workflow/request/compile-catalog-sequence.js +122 -0
  22. package/dist/legacy/workflow/request/compile-sequence.d.ts +2 -0
  23. package/dist/legacy/workflow/request/compile-sequence.js +41 -0
  24. package/dist/legacy/workflow/request/compile-workflow.d.ts +4 -0
  25. package/dist/legacy/workflow/request/compile-workflow.js +93 -0
  26. package/dist/legacy/workflow/request/credential-binding.d.ts +5 -0
  27. package/dist/legacy/workflow/request/credential-binding.js +31 -0
  28. package/dist/legacy/workflow/request/effect-policy.d.ts +4 -0
  29. package/dist/legacy/workflow/request/effect-policy.js +16 -0
  30. package/dist/legacy/workflow/request/http-request-node.d.ts +2 -0
  31. package/dist/legacy/workflow/request/http-request-node.js +69 -0
  32. package/dist/legacy/workflow/request/prepare-sequence.d.ts +4 -0
  33. package/dist/legacy/workflow/request/prepare-sequence.js +103 -0
  34. package/dist/legacy/workflow/request/request-body.d.ts +4 -0
  35. package/dist/legacy/workflow/request/request-body.js +64 -0
  36. package/dist/legacy/workflow/request/request-headers.d.ts +4 -0
  37. package/dist/legacy/workflow/request/request-headers.js +30 -0
  38. package/dist/legacy/workflow/request/request-url.d.ts +4 -0
  39. package/dist/legacy/workflow/request/request-url.js +34 -0
  40. package/dist/legacy/workflow/request/response-assertion-code.d.ts +3 -0
  41. package/dist/legacy/workflow/request/response-assertion-code.js +28 -0
  42. package/dist/legacy/workflow/request/sequence-url.d.ts +4 -0
  43. package/dist/legacy/workflow/request/sequence-url.js +104 -0
  44. package/dist/legacy-api.d.ts +25 -0
  45. package/dist/legacy-api.js +20 -0
  46. package/dist/nodes/common/validation/compile-standalone-validator.d.ts +3 -0
  47. package/dist/nodes/common/validation/compile-standalone-validator.js +44 -0
  48. package/dist/nodes/gap/create-gap-node.d.ts +3 -0
  49. package/dist/nodes/gap/create-gap-node.js +35 -0
  50. package/dist/nodes/inputs/compile-template-input-validators.d.ts +3 -0
  51. package/dist/nodes/inputs/compile-template-input-validators.js +26 -0
  52. package/dist/nodes/inputs/create-template-input-nodes.d.ts +4 -0
  53. package/dist/nodes/inputs/create-template-input-nodes.js +61 -0
  54. package/dist/nodes/native/arrays/create-array-node-fragment.d.ts +4 -0
  55. package/dist/nodes/native/arrays/create-array-node-fragment.js +42 -0
  56. package/dist/nodes/native/arrays/create-array-reader-code.d.ts +3 -0
  57. package/dist/nodes/native/arrays/create-array-reader-code.js +12 -0
  58. package/dist/nodes/native/arrays/create-bound-native-array-capability.d.ts +4 -0
  59. package/dist/nodes/native/arrays/create-bound-native-array-capability.js +81 -0
  60. package/dist/nodes/native/arrays/create-native-array-capability.d.ts +4 -0
  61. package/dist/nodes/native/arrays/create-native-array-capability.js +12 -0
  62. package/dist/nodes/native/arrays/native-array-definition.d.ts +2 -0
  63. package/dist/nodes/native/arrays/native-array-definition.js +27 -0
  64. package/dist/nodes/native/common/create-material-planning-capability.d.ts +4 -0
  65. package/dist/nodes/native/common/create-material-planning-capability.js +14 -0
  66. package/dist/nodes/native/common/create-native-fragment.d.ts +2 -0
  67. package/dist/nodes/native/common/create-native-fragment.js +10 -0
  68. package/dist/nodes/native/common/define-material-bound-capability.d.ts +4 -0
  69. package/dist/nodes/native/common/define-material-bound-capability.js +33 -0
  70. package/dist/nodes/native/common/resolve-native-runtime-source.d.ts +3 -0
  71. package/dist/nodes/native/common/resolve-native-runtime-source.js +15 -0
  72. package/dist/nodes/native/common/response-reference-bindings.d.ts +4 -0
  73. package/dist/nodes/native/common/response-reference-bindings.js +15 -0
  74. package/dist/nodes/native/common/response-references.d.ts +3 -0
  75. package/dist/nodes/native/common/response-references.js +5 -0
  76. package/dist/nodes/native/create-exclusive-branch-merge-capability.d.ts +3 -0
  77. package/dist/nodes/native/create-exclusive-branch-merge-capability.js +43 -0
  78. package/dist/nodes/native/create-json-output-capability.d.ts +3 -0
  79. package/dist/nodes/native/create-json-output-capability.js +48 -0
  80. package/dist/nodes/native/create-native-capabilities.d.ts +2 -0
  81. package/dist/nodes/native/create-native-capabilities.js +15 -0
  82. package/dist/nodes/native/create-pass-through-capability.d.ts +3 -0
  83. package/dist/nodes/native/create-pass-through-capability.js +32 -0
  84. package/dist/nodes/native/create-response-array-capability.d.ts +3 -0
  85. package/dist/nodes/native/create-response-array-capability.js +78 -0
  86. package/dist/nodes/native/create-response-collection-capability.d.ts +3 -0
  87. package/dist/nodes/native/create-response-collection-capability.js +134 -0
  88. package/dist/nodes/native/if-capability.d.ts +2 -0
  89. package/dist/nodes/native/if-capability.js +80 -0
  90. package/dist/nodes/native/inputs/native-input-runtime.bundle.js +24 -0
  91. package/dist/nodes/native/inputs/prepend-native-parameter-guard.d.ts +4 -0
  92. package/dist/nodes/native/inputs/prepend-native-parameter-guard.js +52 -0
  93. package/dist/nodes/native/item-join/create-bound-item-join-capability.d.ts +3 -0
  94. package/dist/nodes/native/item-join/create-bound-item-join-capability.js +169 -0
  95. package/dist/nodes/native/item-join/create-item-join-capability.d.ts +4 -0
  96. package/dist/nodes/native/item-join/create-item-join-capability.js +10 -0
  97. package/dist/nodes/native/item-join/create-item-join-reader-code.d.ts +2 -0
  98. package/dist/nodes/native/item-join/create-item-join-reader-code.js +18 -0
  99. package/dist/nodes/native/item-join/item-join-definition.d.ts +2 -0
  100. package/dist/nodes/native/item-join/item-join-definition.js +33 -0
  101. package/dist/nodes/native/item-join/runtime/item-join-runtime.bundle.js +24 -0
  102. package/dist/nodes/native/item-join/runtime/join-api-items.d.ts +3 -0
  103. package/dist/nodes/native/item-join/runtime/join-api-items.js +37 -0
  104. package/dist/nodes/native/merge-append-capability.d.ts +2 -0
  105. package/dist/nodes/native/merge-append-capability.js +33 -0
  106. package/dist/nodes/native/registry/native-feature-definitions.d.ts +4 -0
  107. package/dist/nodes/native/registry/native-feature-definitions.js +93 -0
  108. package/dist/nodes/native/registry/native-feature-material-requirements.d.ts +3 -0
  109. package/dist/nodes/native/registry/native-feature-material-requirements.js +10 -0
  110. package/dist/nodes/native/registry/resolve-n8n-native-features.d.ts +3 -0
  111. package/dist/nodes/native/registry/resolve-n8n-native-features.js +6 -0
  112. package/dist/nodes/native/registry/resolve-n8n-native-planning-features.d.ts +3 -0
  113. package/dist/nodes/native/registry/resolve-n8n-native-planning-features.js +5 -0
  114. package/dist/nodes/native/registry/resolve-native-feature-registry.d.ts +3 -0
  115. package/dist/nodes/native/registry/resolve-native-feature-registry.js +99 -0
  116. package/dist/nodes/native/registry/validate-native-feature-context.d.ts +2 -0
  117. package/dist/nodes/native/registry/validate-native-feature-context.js +46 -0
  118. package/dist/nodes/native/response-array-definition.d.ts +2 -0
  119. package/dist/nodes/native/response-array-definition.js +27 -0
  120. package/dist/nodes/native/response-assertion-capability.d.ts +2 -0
  121. package/dist/nodes/native/response-assertion-capability.js +57 -0
  122. package/dist/nodes/native/response-check-code.d.ts +3 -0
  123. package/dist/nodes/native/response-check-code.js +65 -0
  124. package/dist/nodes/native/response-checks/create-response-check-guard.d.ts +4 -0
  125. package/dist/nodes/native/response-checks/create-response-check-guard.js +22 -0
  126. package/dist/nodes/native/response-checks/create-response-check-reader.d.ts +3 -0
  127. package/dist/nodes/native/response-checks/create-response-check-reader.js +23 -0
  128. package/dist/nodes/native/response-collection-definition.d.ts +2 -0
  129. package/dist/nodes/native/response-collection-definition.js +27 -0
  130. package/dist/nodes/native/stop-and-error-capability.d.ts +2 -0
  131. package/dist/nodes/native/stop-and-error-capability.js +43 -0
  132. package/dist/nodes/request/authentication/credential-field-name.d.ts +1 -0
  133. package/dist/nodes/request/authentication/credential-field-name.js +3 -0
  134. package/dist/nodes/request/authentication/resolve-http-request-authentication.d.ts +2 -0
  135. package/dist/nodes/request/authentication/resolve-http-request-authentication.js +42 -0
  136. package/dist/nodes/request/bindings/compile-native-output-validators.d.ts +3 -0
  137. package/dist/nodes/request/bindings/compile-native-output-validators.js +12 -0
  138. package/dist/nodes/request/bindings/compile-request-validator.d.ts +3 -0
  139. package/dist/nodes/request/bindings/compile-request-validator.js +13 -0
  140. package/dist/nodes/request/bindings/compile-source-response-validators.d.ts +2 -0
  141. package/dist/nodes/request/bindings/compile-source-response-validators.js +12 -0
  142. package/dist/nodes/request/bindings/create-bound-request-fragment.d.ts +3 -0
  143. package/dist/nodes/request/bindings/create-bound-request-fragment.js +82 -0
  144. package/dist/nodes/request/bindings/create-output-item-reader-code.d.ts +2 -0
  145. package/dist/nodes/request/bindings/create-output-item-reader-code.js +7 -0
  146. package/dist/nodes/request/bindings/create-output-reader-code.d.ts +3 -0
  147. package/dist/nodes/request/bindings/create-output-reader-code.js +26 -0
  148. package/dist/nodes/request/bindings/resolve-output-binding-sources.d.ts +3 -0
  149. package/dist/nodes/request/bindings/resolve-output-binding-sources.js +36 -0
  150. package/dist/nodes/request/create-http-request-node.d.ts +2 -0
  151. package/dist/nodes/request/create-http-request-node.js +73 -0
  152. package/dist/nodes/request/deployment/create-request-deployment-notes.d.ts +2 -0
  153. package/dist/nodes/request/deployment/create-request-deployment-notes.js +3 -0
  154. package/dist/nodes/request/deployment/resolve-http-request-deployment.d.ts +2 -0
  155. package/dist/nodes/request/deployment/resolve-http-request-deployment.js +33 -0
  156. package/dist/nodes/request/finalize-http-request-fragment.d.ts +3 -0
  157. package/dist/nodes/request/finalize-http-request-fragment.js +22 -0
  158. package/dist/nodes/request/resolve-http-request-node-configuration.d.ts +4 -0
  159. package/dist/nodes/request/resolve-http-request-node-configuration.js +41 -0
  160. package/dist/nodes/request/response/create-http-response-decoder.d.ts +4 -0
  161. package/dist/nodes/request/response/create-http-response-decoder.js +57 -0
  162. package/dist/nodes/request/response/decode-http-response.d.ts +3 -0
  163. package/dist/nodes/request/response/decode-http-response.js +42 -0
  164. package/dist/nodes/request/response/http-response-media.d.ts +2 -0
  165. package/dist/nodes/request/response/http-response-media.js +32 -0
  166. package/dist/nodes/request/response/http-response-node-name.d.ts +2 -0
  167. package/dist/nodes/request/response/http-response-node-name.js +4 -0
  168. package/dist/nodes/request/response/response-runtime.bundle.js +24 -0
  169. package/dist/nodes/request/runtime/materialize-http-request.d.ts +4 -0
  170. package/dist/nodes/request/runtime/materialize-http-request.js +35 -0
  171. package/dist/nodes/request/runtime/request-runtime.bundle.js +24 -0
  172. package/dist/nodes/request/serialization/create-serialized-http-request-node.d.ts +3 -0
  173. package/dist/nodes/request/serialization/create-serialized-http-request-node.js +17 -0
  174. package/dist/nodes/request/serialization/serialize-http-request.d.ts +5 -0
  175. package/dist/nodes/request/serialization/serialize-http-request.js +70 -0
  176. package/dist/public-api.d.ts +43 -0
  177. package/dist/public-api.js +26 -0
  178. package/dist/schemas/batch-execution-schema.d.ts +15 -0
  179. package/dist/schemas/batch-execution-schema.js +14 -0
  180. package/dist/schemas/create-native-comparison-planning-schema.d.ts +81 -0
  181. package/dist/schemas/create-native-comparison-planning-schema.js +36 -0
  182. package/dist/schemas/exclusive-branch-merge-schema.d.ts +4 -0
  183. package/dist/schemas/exclusive-branch-merge-schema.js +7 -0
  184. package/dist/schemas/item-join-schema.d.ts +13 -0
  185. package/dist/schemas/item-join-schema.js +26 -0
  186. package/dist/schemas/native-array-schema.d.ts +11 -0
  187. package/dist/schemas/native-array-schema.js +19 -0
  188. package/dist/schemas/native-capability-schemas.d.ts +100 -0
  189. package/dist/schemas/native-capability-schemas.js +62 -0
  190. package/dist/schemas/native-feature-registry-schema.d.ts +17 -0
  191. package/dist/schemas/native-feature-registry-schema.js +8 -0
  192. package/dist/schemas/native-runtime-input-schema.d.ts +5 -0
  193. package/dist/schemas/native-runtime-input-schema.js +5 -0
  194. package/dist/schemas/request-deployment-schema.d.ts +9 -0
  195. package/dist/schemas/request-deployment-schema.js +27 -0
  196. package/dist/schemas/response-array-schema.d.ts +11 -0
  197. package/dist/schemas/response-array-schema.js +19 -0
  198. package/dist/schemas/response-collection-schema.d.ts +11 -0
  199. package/dist/schemas/response-collection-schema.js +19 -0
  200. package/dist/schemas/template-deployment-selection-schema.d.ts +3 -0
  201. package/dist/schemas/template-deployment-selection-schema.js +10 -0
  202. package/dist/schemas/workflow-input-value-map-schema.d.ts +5 -0
  203. package/dist/schemas/workflow-input-value-map-schema.js +5 -0
  204. package/dist/schemas/workflow-template-schema.d.ts +11 -0
  205. package/dist/schemas/workflow-template-schema.js +10 -0
  206. package/dist/types/array-iteration.d.ts +8 -0
  207. package/dist/types/array-iteration.js +1 -0
  208. package/dist/types/array-split.d.ts +13 -0
  209. package/dist/types/array-split.js +1 -0
  210. package/dist/types/authentication.d.ts +14 -0
  211. package/dist/types/authentication.js +1 -0
  212. package/dist/types/batch-execution.d.ts +23 -0
  213. package/dist/types/batch-execution.js +1 -0
  214. package/dist/types/http-response-decoding.d.ts +16 -0
  215. package/dist/types/http-response-decoding.js +1 -0
  216. package/dist/types/item-join.d.ts +40 -0
  217. package/dist/types/item-join.js +1 -0
  218. package/dist/types/legacy/catalog-workflow.d.ts +37 -0
  219. package/dist/types/legacy/catalog-workflow.js +1 -0
  220. package/dist/types/legacy/inbound-workflow.d.ts +27 -0
  221. package/dist/types/legacy/inbound-workflow.js +1 -0
  222. package/dist/types/legacy/request-node.d.ts +23 -0
  223. package/dist/types/legacy/request-node.js +1 -0
  224. package/dist/types/legacy/request-workflow.d.ts +43 -0
  225. package/dist/types/legacy/request-workflow.js +1 -0
  226. package/dist/types/legacy/sequence-workflow.d.ts +57 -0
  227. package/dist/types/legacy/sequence-workflow.js +1 -0
  228. package/dist/types/native-array.d.ts +8 -0
  229. package/dist/types/native-array.js +1 -0
  230. package/dist/types/native-capability.d.ts +46 -0
  231. package/dist/types/native-capability.js +1 -0
  232. package/dist/types/native-feature-registry.d.ts +70 -0
  233. package/dist/types/native-feature-registry.js +14 -0
  234. package/dist/types/native-material-binding.d.ts +56 -0
  235. package/dist/types/native-material-binding.js +1 -0
  236. package/dist/types/native-runtime-parameters.d.ts +55 -0
  237. package/dist/types/native-runtime-parameters.js +1 -0
  238. package/dist/types/node-fragment.d.ts +51 -0
  239. package/dist/types/node-fragment.js +1 -0
  240. package/dist/types/output-binding-source.d.ts +27 -0
  241. package/dist/types/output-binding-source.js +1 -0
  242. package/dist/types/request-deployment.d.ts +17 -0
  243. package/dist/types/request-deployment.js +1 -0
  244. package/dist/types/request-materialization.d.ts +30 -0
  245. package/dist/types/request-materialization.js +1 -0
  246. package/dist/types/request-node-configuration.d.ts +13 -0
  247. package/dist/types/request-node-configuration.js +1 -0
  248. package/dist/types/response-check-compilation.d.ts +11 -0
  249. package/dist/types/response-check-compilation.js +1 -0
  250. package/dist/types/response-check-guard.d.ts +6 -0
  251. package/dist/types/response-check-guard.js +1 -0
  252. package/dist/types/response-collection.d.ts +7 -0
  253. package/dist/types/response-collection.js +1 -0
  254. package/dist/types/reviewable-workflow.d.ts +29 -0
  255. package/dist/types/reviewable-workflow.js +1 -0
  256. package/dist/types/schema-compilation.d.ts +5 -0
  257. package/dist/types/schema-compilation.js +1 -0
  258. package/dist/types/serialized-http-request.d.ts +4 -0
  259. package/dist/types/serialized-http-request.js +1 -0
  260. package/dist/types/workflow-compilation.d.ts +39 -0
  261. package/dist/types/workflow-compilation.js +1 -0
  262. package/dist/types/workflow-template.d.ts +121 -0
  263. package/dist/types/workflow-template.js +1 -0
  264. package/dist/utils/bundled-license-banner.d.ts +3 -0
  265. package/dist/utils/bundled-license-banner.js +32 -0
  266. package/dist/utils/javascript-json-literal.d.ts +2 -0
  267. package/dist/utils/javascript-json-literal.js +10 -0
  268. package/dist/utils/json-values-equal.cjs +24 -0
  269. package/dist/utils/json-values-equal.d.cts +1 -0
  270. package/dist/workflow/assemble-n8n-workflow.d.ts +2 -0
  271. package/dist/workflow/assemble-n8n-workflow.js +11 -0
  272. package/dist/workflow/batch/compile-batched-n8n-workflow.d.ts +3 -0
  273. package/dist/workflow/batch/compile-batched-n8n-workflow.js +36 -0
  274. package/dist/workflow/batch/create-batch-execution-scopes.d.ts +3 -0
  275. package/dist/workflow/batch/create-batch-execution-scopes.js +59 -0
  276. package/dist/workflow/batch/validate-batch-exclusive-rejoin.d.ts +3 -0
  277. package/dist/workflow/batch/validate-batch-exclusive-rejoin.js +49 -0
  278. package/dist/workflow/batch/validate-batch-item-flow.d.ts +3 -0
  279. package/dist/workflow/batch/validate-batch-item-flow.js +98 -0
  280. package/dist/workflow/build-n8n-workflow.d.ts +2 -0
  281. package/dist/workflow/build-n8n-workflow.js +140 -0
  282. package/dist/workflow/compile-native-material-fragments.d.ts +3 -0
  283. package/dist/workflow/compile-native-material-fragments.js +76 -0
  284. package/dist/workflow/compile-native-workflow-nodes.d.ts +3 -0
  285. package/dist/workflow/compile-native-workflow-nodes.js +25 -0
  286. package/dist/workflow/compile-planned-n8n-workflow.d.ts +3 -0
  287. package/dist/workflow/compile-planned-n8n-workflow.js +42 -0
  288. package/dist/workflow/compile-reviewable-n8n-workflow.d.ts +3 -0
  289. package/dist/workflow/compile-reviewable-n8n-workflow.js +92 -0
  290. package/dist/workflow/compile-validated-workflow-fragments.d.ts +3 -0
  291. package/dist/workflow/compile-validated-workflow-fragments.js +20 -0
  292. package/dist/workflow/compile-workflow-material-fragments.d.ts +4 -0
  293. package/dist/workflow/compile-workflow-material-fragments.js +18 -0
  294. package/dist/workflow/create-n8n-native-output-sources.d.ts +3 -0
  295. package/dist/workflow/create-n8n-native-output-sources.js +58 -0
  296. package/dist/workflow/entrypoint/manual-trigger.d.ts +4 -0
  297. package/dist/workflow/entrypoint/manual-trigger.js +16 -0
  298. package/dist/workflow/find-singleton-api-responses.d.ts +3 -0
  299. package/dist/workflow/find-singleton-api-responses.js +22 -0
  300. package/dist/workflow/inputs/compile-native-runtime-inputs.d.ts +5 -0
  301. package/dist/workflow/inputs/compile-native-runtime-inputs.js +129 -0
  302. package/dist/workflow/inputs/create-runtime-input-native-capabilities.d.ts +4 -0
  303. package/dist/workflow/inputs/create-runtime-input-native-capabilities.js +36 -0
  304. package/dist/workflow/resolve-n8n-native-materials.d.ts +2 -0
  305. package/dist/workflow/resolve-n8n-native-materials.js +16 -0
  306. package/dist/workflow/review/create-gap-review-content.d.ts +2 -0
  307. package/dist/workflow/review/create-gap-review-content.js +28 -0
  308. package/dist/workflow/review/create-gap-review-region.d.ts +2 -0
  309. package/dist/workflow/review/create-gap-review-region.js +23 -0
  310. package/dist/workflow/review/escape-review-markdown.d.ts +1 -0
  311. package/dist/workflow/review/escape-review-markdown.js +7 -0
  312. package/dist/workflow/review/gap-review-region-layout.d.ts +4 -0
  313. package/dist/workflow/review/gap-review-region-layout.js +21 -0
  314. package/dist/workflow/templates/compile-n8n-workflow-template.d.ts +3 -0
  315. package/dist/workflow/templates/compile-n8n-workflow-template.js +211 -0
  316. package/dist/workflow/templates/create-template-artifact-mapping.d.ts +2 -0
  317. package/dist/workflow/templates/create-template-artifact-mapping.js +58 -0
  318. package/dist/workflow/templates/create-template-gap-regions.d.ts +5 -0
  319. package/dist/workflow/templates/create-template-gap-regions.js +22 -0
  320. package/dist/workflow/templates/create-workflow-template-guide.d.ts +3 -0
  321. package/dist/workflow/templates/create-workflow-template-guide.js +44 -0
  322. package/dist/workflow/templates/prepare-template-api-fragments.d.ts +3 -0
  323. package/dist/workflow/templates/prepare-template-api-fragments.js +74 -0
  324. package/dist/workflow/templates/select-n8n-template-deployments.d.ts +3 -0
  325. package/dist/workflow/templates/select-n8n-template-deployments.js +12 -0
  326. package/dist/workflow/templates/workflow-template-identities.d.ts +5 -0
  327. package/dist/workflow/templates/workflow-template-identities.js +5 -0
  328. package/dist/workflow/validate-compiled-binding-sources.d.ts +4 -0
  329. package/dist/workflow/validate-compiled-binding-sources.js +40 -0
  330. package/dist/workflow/validate-node-fragments.d.ts +3 -0
  331. package/dist/workflow/validate-node-fragments.js +58 -0
  332. package/package.json +59 -4
@@ -0,0 +1,24 @@
1
+ /*! MIT License
2
+
3
+ Copyright (c) 2026 carefreelife98
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+ */
23
+ var OpenApiFlowRequestRuntime;
24
+ (()=>{function b(e){if(e==="")return[];if(!e.startsWith("/")||/~(?![01])/u.test(e))throw new Error(`Invalid JSON Pointer: ${e}`);return e.slice(1).split("/").map(t=>t.replaceAll("~1","/").replaceAll("~0","~"))}function A(e,t){let r=e;for(let i of b(t)){if(r===null||typeof r!="object"||!Object.hasOwn(r,i))return;r=Reflect.get(r,i)}return r}function H(e,t){return A(e,t)!==void 0}function y(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function x(e){if(e.includes(!1))return!1;let t=e.filter(r=>r!==!0);return t.length?t.length===1?t[0]:{allOf:t}:!0}function M(e){if(e.includes(!0))return!0;let t=e.filter(r=>r!==!1);return t.length?t.length===1?t[0]:{anyOf:t}:!1}function q(e,t){if(typeof e=="boolean")return e;if(e.type!==void 0&&!(Array.isArray(e.type)?e.type:[e.type]).includes(t))return!1;for(let r of["allOf","anyOf","oneOf"]){if(!Array.isArray(e[r]))continue;let i=e[r].map(o=>(typeof o=="boolean"||y(o))&&q(o,t));if(r==="allOf"?!i.every(Boolean):!i.some(Boolean))return!1}return!0}function B(e,t,r){let i=new Map;function o(n,a,s=["object","array"]){if(typeof n=="boolean")return n;if(!a.length)return r?r.reference(n):n;if(r&&typeof n.$ref=="string"){let p=JSON.stringify([a,s]),u=i.get(n)??new Set;if(u.has(p))throw new Error(`Native pointer projection has a non-progressing reference cycle at ${t}`);u.add(p),i.set(n,u);let m={...n};delete m.$ref;try{return x([o(r.resolve(n),a,s),o(m,a,s)])}finally{u.delete(p)}}let[f,...l]=a,d=s.filter(p=>q(n,p)),j=[];if(d.includes("object")){let p=[];if(y(n.properties)&&Object.hasOwn(n.properties,f)){let u=n.properties[f];(typeof u=="boolean"||y(u))&&p.push(o(u,l))}if(y(n.patternProperties))for(let[u,m]of Object.entries(n.patternProperties))new RegExp(u).test(f)&&(typeof m=="boolean"||y(m))&&p.push(o(m,l));if(!p.length){let u=n.additionalProperties;p.push(u===void 0?!0:typeof u=="boolean"||y(u)?o(u,l):!1)}j.push(x(p))}if(d.includes("array")&&/^(0|[1-9][0-9]*)$/.test(f)){let p=Number(f),u=Array.isArray(n.prefixItems)?n.prefixItems:[],m=p<u.length?u[p]:n.items;j.push(typeof n.maxItems=="number"&&p>=n.maxItems?!1:m===void 0?!0:typeof m=="boolean"||y(m)?o(m,l):!1)}let R=[M(j)];for(let p of["allOf","anyOf","oneOf"]){if(!Array.isArray(n[p]))continue;let u=n[p].map(m=>typeof m=="boolean"||y(m)?o(m,a,d):!1);R.push(p==="allOf"?x(u):M(u))}return x(R)}let c=o(e,b(t));return c===!1?[]:[c]}function w(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function I(e,t){let r=w(e,t);if(r.$ref!==void 0)throw new Error(`${t} has an unresolved $ref`);return r}function U(e,t){if(e.operation.requestBody===void 0){if(t!==void 0)throw new Error(`${e.key.operationRef} has no requestBody for ${t}`);return}let r=w(e.operation.requestBody,`${e.key.operationRef}.requestBody`),i=w(r.content,`${e.key.operationRef}.requestBody.content`),o=Object.keys(i),c=t===void 0&&o.length===1?o[0]:t;if(c===void 0)throw new Error(`${e.key.operationRef}.requestMediaType must explicitly select one of ${o.join(", ")}`);if(!Object.hasOwn(i,c))throw new Error(`${e.key.operationRef}.requestBody.content has no ${c}`);let n=w(i[c],`${e.key.operationRef}.requestBody.content.${c}`);return n.schema===void 0?!0:typeof n.schema=="boolean"?n.schema:w(n.schema,`${c}.schema`)}function v(e,t){if(e.schema!==void 0)return typeof e.schema=="boolean"?e.schema:w(e.schema,`${t}.schema`);let r=w(e.content,`${t}.content`),i=Object.keys(r);if(i.length!==1)throw new Error(`${t}.content must have one media type`);let o=w(r[i[0]],`${t}.content.${i[0]}`);return o.schema===void 0?!0:typeof o.schema=="boolean"?o.schema:w(o.schema,`${t}.schema`)}function D(e,t){let[r,i,...o]=b(t);if(r==="body"){let s=U(e.operation,e.requestMediaType);return s===void 0?[]:B(s,t.slice(5))}let c=e.operation.effective.parameters.find(s=>s.in===r&&s.name===i);if(!c)return[];let n=v(c,t),a=o.length?"/"+o.map(s=>s.replaceAll("~","~0").replaceAll("/","~1")).join("/"):"";return B(n,a)}function P(e,t){if(["/path","/query","/header","/cookie","/querystring"].includes(t))return"object";let r=new Set;for(let i of D(e,t))q(i,"object")&&r.add("object"),q(i,"array")&&r.add("array");if(r.size!==1)throw new Error(`Request ${e.callId}${t} needs an explicit literal container: OAS does not determine object versus array`);return r.has("array")?"array":"object"}function C(e,t,r,i){function o(n){if(Array.isArray(n))return n.map(o);if(n===null||typeof n!="object")return n;let a=Object.create(null);for(let[s,f]of Object.entries(n))a[s]=o(f);return a}let c=o(JSON.parse(JSON.stringify(e)));for(let n of t){if(!Object.hasOwn(r,n.sourceNodeId))throw new Error(`Missing response node ${n.sourceNodeId}`);let a=A(r[n.sourceNodeId],n.sourcePointer);if(a===void 0)throw new Error(`Missing response pointer ${n.sourceNodeId}${n.sourcePointer}`);let s=b(n.targetPointer);if(!s.length)throw new Error("binding target must identify a request field");let f=c;for(let[l,d]of s.entries())if(l===s.length-1){if(Object.hasOwn(f,d))throw new Error(`Literal conflicts with binding ${n.targetPointer}`);if(Array.isArray(f)&&!/^(0|[1-9][0-9]*)$/.test(d))throw new Error(`Binding array index is invalid ${n.targetPointer}`);Reflect.set(f,d,o(a))}else{if(!Object.hasOwn(f,d)){let R="/"+s.slice(0,l+1).map(u=>u.replaceAll("~","~0").replaceAll("/","~1")).join("/"),p=P(i,R)==="array"?[]:Object.create(null);Reflect.set(f,d,p)}let j=Reflect.get(f,d);if(!j||typeof j!="object")throw new Error(`Binding traverses non-container ${n.targetPointer}`);f=j}}return JSON.parse(JSON.stringify(c))}var h=class extends Error{operationRef;constructor(t,r){super(r),this.name="UnsupportedOperationError",this.operationRef=t}};function g(e,t,r){throw new h(t,`operationRef ${t} parameter ${e.in}.${e.name} ${r}`)}function z(e,t,r){return typeof r=="string"||typeof r=="boolean"||typeof r=="number"&&Number.isFinite(r)?r:g(e,t,"requires a scalar value")}function $(e,t){let r=encodeURIComponent(String(e)).replace(/[!'()*]/g,i=>"%"+i.charCodeAt(0).toString(16).toUpperCase());return t?r.replace(/%(3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)/gi,i=>String.fromCharCode(Number.parseInt(i.slice(1),16))):r}function S(e,t,r,i){return Array.isArray(r)?r.map(o=>i(z(e,t,o))):y(r)?Object.entries(r).flatMap(([o,c])=>[i(o),i(z(e,t,c))]):[i(z(e,t,r))]}function J(e,t,r){if(e.contentMediaType!=="application/json")return g(e,t,"has no content mapping");let i=JSON.stringify(r);return i===void 0?g(e,t,"cannot be JSON serialized"):i}function L(e,t,r){if(e.contentMediaType)return $(J(e,t,r),!1);let o=S(e,t,r,n=>$(n,e.allowReserved)),c=y(r);if(e.style==="simple")return!c||!e.explode?o.join(","):o.flatMap((n,a)=>a%2===0?[n+"="+o[a+1]]:[]).join(",");if(e.style==="label")return!c||!e.explode?"."+o.join(e.explode?".":","):"."+o.flatMap((n,a)=>a%2===0?[n+"="+o[a+1]]:[]).join(".");if(e.style==="matrix"){let n=$(e.name,!1);return e.explode?c?o.flatMap((a,s)=>s%2===0?[";"+a+"="+o[s+1]]:[]).join(""):o.map(a=>";"+n+"="+a).join(""):";"+n+"="+o.join(",")}return g(e,t,`style ${e.style} is not a path style`)}function N(e,t,r){let i=$(e.name,!1);if(e.contentMediaType)return[i+"="+$(J(e,t,r),!1)];let c=S(e,t,r,a=>$(a,e.allowReserved)),n=y(r);return e.style==="deepObject"?n?c.flatMap((a,s)=>s%2===0?[i+"%5B"+a+"%5D="+c[s+1]]:[]):g(e,t,"deepObject requires an object"):e.style==="form"?e.explode?n?c.flatMap((a,s)=>s%2===0?[a+"="+c[s+1]]:[]):c.map(a=>i+"="+a):[i+"="+c.join(",")]:(e.style==="spaceDelimited"||e.style==="pipeDelimited")&&!e.explode&&(n||Array.isArray(r))?[i+"="+c.join(e.style==="spaceDelimited"?"%20":"%7C")]:g(e,t,`style ${e.style} is not mapped for query`)}function K(e,t,r){if(e.contentMediaType)return J(e,t,r);if(e.style!=="simple")return g(e,t,`style ${e.style} is not a header style`);let i=S(e,t,r,String),o=y(r)&&e.explode?i.flatMap((c,n)=>n%2===0?[c+"="+i[n+1]]:[]).join(","):i.join(",");if(/[\r\n]/.test(o))throw new Error(`plan.inputs.header.${e.name} must not contain a newline`);return o}function Q(e,t,r){if(e.contentMediaType)return g(e,t,"cookie content needs a declared escaping strategy");if(e.style!=="form"&&e.style!=="cookie")return g(e,t,`style ${e.style} is not a cookie style`);let i=e.style==="cookie"?a=>String(a):a=>$(a,e.allowReserved),o=S(e,t,r,i),c=i(e.name);if(!e.explode&&(y(r)||Array.isArray(r)))return g(e,t,"explode:false produces invalid Cookie syntax");let n=y(r)?o.flatMap((a,s)=>s%2===0?[a+"="+o[s+1]]:[]):o.map(a=>c+"="+a);return n.some(a=>[...a].some(s=>{let f=s.charCodeAt(0);return f<=32||f===34||f===44||f===59||f===92||f===127}))?g(e,t,"value is not valid Cookie syntax"):n}function k(e){return encodeURIComponent(e.toWellFormed()).replace(/[!'()~]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase()).replaceAll("%20","+")}function Y(e){let t=e.type==="array"&&y(e.items)?e.items.type:e.type;if(t==="object"||t==="array")return"application/json";if(["string","number","integer","boolean"].includes(String(t)))return"text/plain"}function Z(e,t,r,i,o){if(i!=="application/json"&&i!=="text/plain")throw new h(o,`operationRef ${o}.requestBody field ${e} contentType ${i} has no form mapping`);let c=Array.isArray(t)?t:[t];if(c.length===0)return[];let n=[];for(let a of c){if(i==="text/plain"&&typeof a=="object")throw new h(o,`operationRef ${o}.requestBody field ${e} cannot use text/plain for a complex value`);i==="application/json"?n.push(k(e)+"="+k(JSON.stringify(a))):n.push(k(e)+"="+k(String(a)))}if(r.contentEncoding!==void 0)throw new h(o,`operationRef ${o}.requestBody field ${e} contentEncoding requires explicit binary serialization`);return n}function _(e,t,r){let i=`operationRef ${e}.requestBody.schema.properties.${r}`,o=t.properties[r];if(o!==void 0){if(typeof o=="boolean")throw new h(e,`${i} does not define a form encoding type`);return I(o,i)}if(y(t.schema)&&t.schema.additionalProperties!==void 0&&typeof t.schema.additionalProperties!="boolean")return I(t.schema.additionalProperties,`operationRef ${e}.requestBody.schema.additionalProperties`);throw new h(e,`operationRef ${e}.requestBody field ${r} has no schema to determine form encoding`)}function T(e,t,r){let i=[];for(let[o,c]of Object.entries(r)){let n=_(e,t,o),a=t.encoding?.[o],s=a===void 0?void 0:I(a,`operationRef ${e}.requestBody.encoding.${o}`);if(s?.encoding!==void 0||s?.prefixEncoding!==void 0||s?.itemEncoding!==void 0)throw new h(e,`operationRef ${e}.requestBody field ${o} needs nested encoding`);if(s?.style!==void 0||s?.explode!==void 0||s?.allowReserved!==void 0){let d=typeof s?.style=="string"?s.style:"form",j={name:o,in:"query",required:!1,schema:n,style:d,explode:typeof s?.explode=="boolean"?s.explode:d==="form",allowReserved:s?.allowReserved===!0};i.push(...N(j,e,c));continue}let l=typeof s?.contentType=="string"?s.contentType:Y(n);if(l===void 0)throw new h(e,`operationRef ${e}.requestBody field ${o} has no form content mapping`);i.push(...Z(o,c,n,l,e))}return i.join("&")}function V(e){if(!e||!Number.isInteger(e.statusCode))throw new Error("API response.statusCode is required");if(!e.headers||typeof e.headers!="object"||Array.isArray(e.headers))throw new Error("API response.headers is required");let t=Object.entries(e.headers).filter(([i])=>i.toLowerCase()==="content-type");if(t.length>1)throw new Error("API response.headers has ambiguous Content-Type");let r={statusCode:e.statusCode};if(t.length){if(typeof t[0][1]!="string")throw new Error("API response Content-Type must be a string");r.mediaType=t[0][1].split(";")[0].trim().toLowerCase()}return Object.hasOwn(e,"body")&&(r.body=e.body),r}function E(e){if(b(e.rootPointer),e.requestedInputs===void 0)return[];if(!Array.isArray(e.requestedInputs))throw new Error(`${e.source}.requestedInputs must be an array`);let t=new Set;return e.requestedInputs.filter(r=>{if(typeof r!="string"||!b(r).length||t.has(r))throw new Error(`${e.source}.requestedInputs must contain distinct non-root JSON Pointers`);if(t.add(r),r!==e.rootPointer&&!r.startsWith(e.rootPointer+"/"))throw new Error(`${e.source}.requestedInputs contains ${r} outside ${e.rootPointer}`);return!H(e.value,r.slice(e.rootPointer.length))})}function O(e){if(Array.isArray(e))return e.map(O);if(e===null||typeof e!="object")return e;let t=Object.create(null);for(let[r,i]of Object.entries(e))t[r]=O(i);return t}function F(e,t,r,i){let o=b(t);if(!o.length||!["path","query","header","cookie","querystring","body"].includes(o[0]))throw new Error("confirmed input must identify a request field");let c=O(JSON.parse(JSON.stringify(e))),n=c;for(let[a,s]of o.entries()){if(Array.isArray(n)&&(!/^(0|[1-9][0-9]*)$/.test(s)||Number(s)>n.length))throw new Error(`confirmed input ${t} requires an explicit complete array prefix`);if(a===o.length-1){if(Object.hasOwn(n,s))throw new Error(`Request value conflicts with confirmed input ${t}`);Reflect.set(n,s,O(r))}else{if(!Object.hasOwn(n,s)){let l="/"+o.slice(0,a+1).map(d=>d.replaceAll("~","~0").replaceAll("/","~1")).join("/");Reflect.set(n,s,P(i,l)==="array"?[]:Object.create(null))}let f=Reflect.get(n,s);if(f===null||typeof f!="object")throw new Error(`confirmed input traverses non-container ${t}`);n=f}}return JSON.parse(JSON.stringify(c))}function W(e){return/(token|secret|password|authorization|api.?key)/i.test(e)}function G(e,t,r,i){let o=t,c=[],n=[],a=[];for(let l of e.parameters){let d=r[l.in]?.[l.name];if(d!==void 0)switch(l.in){case"path":o=o.replace(encodeURIComponent("{"+l.name+"}"),L(l,e.operationRef,d));break;case"query":c.push(...N(l,e.operationRef,d));break;case"header":n.push({name:l.name,value:K(l,e.operationRef,d)});break;case"cookie":a.push(...Q(l,e.operationRef,d));break}}if(c.length&&(o+="?"+c.join("&")),a.length&&n.push({name:"Cookie",value:a.join("; ")}),r.body===void 0)return{url:o,headers:n};if(!e.body)throw new Error(`${e.operationRef} has no request body`);let s=Object.keys(e.body.mediaTypes),f=i??(s.length===1?s[0]:void 0);if(!f||!Object.hasOwn(e.body.mediaTypes,f))throw new Error(`${e.operationRef}: requestMediaType must select a declared body media type`);if(n.push({name:"Content-Type",value:f}),r.body!==null&&typeof r.body=="object"&&!Array.isArray(r.body)){for(let l of Object.keys(r.body))if(W(l))throw new Error(`body.${l} looks like a credential; use credentialBindings`)}if(f==="application/json")return{url:o,headers:n,body:{contentType:"json",value:JSON.stringify(r.body)}};if(f!=="application/x-www-form-urlencoded")throw new h(e.operationRef,`requestBody media type ${f} has no n8n mapping`);if(!r.body||typeof r.body!="object"||Array.isArray(r.body))throw new Error("form-urlencoded body must be an object");return{url:o,headers:n,body:{contentType:"form-urlencoded",value:T(e.operationRef,e.body.mediaTypes[f],r.body)}}}function X(e,t,r,i){let o=JSON.parse(JSON.stringify(e.arguments.values));for(let s of e.deferredInputs?.slots??[]){if(!i||!Object.hasOwn(i,s.id))throw new Error(`Missing runtime input ${s.id} for ${s.callId}${s.targetPointer}`);o=F(o,s.targetPointer,i[s.id],{callId:e.arguments.callId,operation:e.contract,requestMediaType:e.arguments.requestMediaType})}let c=C(o,e.arguments.bindings,t,{callId:e.arguments.callId,operation:e.contract,requestMediaType:e.arguments.requestMediaType});if(!r(c))throw new Error(`Runtime request ${e.arguments.callId} does not match the OAS schema: ${JSON.stringify(r.errors)}`);let n=E({source:`Runtime request ${e.arguments.callId}`,rootPointer:"",value:c,requestedInputs:e.arguments.requestedInputs});if(n.length)throw new Error(`Runtime request ${e.arguments.callId} omits scenario-requested inputs: ${n.join(", ")}`);let a=G(e.operation,e.templateUrl,c,e.arguments.requestMediaType);return{...a,headersJson:JSON.stringify(Object.fromEntries(a.headers.map(s=>[s.name,s.value])))}}OpenApiFlowRequestRuntime={materializeHttpRequest:X,apiResponseValidationValue:V,pointerValue:A,listMissingRequestedApiInputs:E};})();
@@ -0,0 +1,3 @@
1
+ import type { SerializedHttpRequestNodeInput } from '../../../types/serialized-http-request.js';
2
+ /** File response mode disables n8n JSON transport encoding, so send serialized text. */
3
+ export declare function createSerializedHttpRequestNode(input: SerializedHttpRequestNodeInput): import("@n8n/workflow-sdk").NodeInstance<string, `${number}`, unknown>;
@@ -0,0 +1,17 @@
1
+ import { httpRequestNode } from '../../../legacy/workflow/request/http-request-node.js';
2
+ /** File response mode disables n8n JSON transport encoding, so send serialized text. */
3
+ export function createSerializedHttpRequestNode(input) {
4
+ const request = httpRequestNode(input);
5
+ if (input.body === undefined || input.body.contentType !== 'json')
6
+ return request;
7
+ // JSON Body is itself a JSON-encoded node parameter. n8n parses this envelope
8
+ // into the serializer's wire text, then sends that text with json=false.
9
+ // Keep JSON mode: unlike Raw mode, it also sends DELETE request bodies.
10
+ request.config.parameters = {
11
+ ...request.config.parameters,
12
+ jsonBody: input.bodySource === 'literal'
13
+ ? JSON.stringify(input.body.value)
14
+ : '={{ JSON.stringify($json.body.value) }}',
15
+ };
16
+ return request;
17
+ }
@@ -0,0 +1,5 @@
1
+ import type { ApiArgumentValues } from '@openapi-flow/core';
2
+ import type { Operation } from '@openapi-flow/core/internal';
3
+ import type { MaterializedHttpRequest } from '../../../types/request-materialization.js';
4
+ /** Pure transport mapping, shared by literal and runtime-bound requests. */
5
+ export declare function serializeHttpRequest(operation: Operation, templateUrl: string, values: ApiArgumentValues, requestMediaType?: string): MaterializedHttpRequest;
@@ -0,0 +1,70 @@
1
+ import { serializePathParameter, serializeQueryParameter, serializeHeaderParameter, serializeCookieParameter, serializeFormBody, UnsupportedOperationError, } from '@openapi-flow/core/runtime';
2
+ import { looksLikeCredential } from '../authentication/credential-field-name.js';
3
+ /** Pure transport mapping, shared by literal and runtime-bound requests. */
4
+ export function serializeHttpRequest(operation, templateUrl, values, requestMediaType) {
5
+ let url = templateUrl;
6
+ const query = [];
7
+ const headers = [];
8
+ const cookies = [];
9
+ for (const parameter of operation.parameters) {
10
+ const value = values[parameter.in]?.[parameter.name];
11
+ if (value === undefined)
12
+ continue;
13
+ switch (parameter.in) {
14
+ case 'path':
15
+ url = url.replace(encodeURIComponent('{' + parameter.name + '}'), serializePathParameter(parameter, operation.operationRef, value));
16
+ break;
17
+ case 'query':
18
+ query.push(...serializeQueryParameter(parameter, operation.operationRef, value));
19
+ break;
20
+ case 'header':
21
+ headers.push({
22
+ name: parameter.name,
23
+ value: serializeHeaderParameter(parameter, operation.operationRef, value),
24
+ });
25
+ break;
26
+ case 'cookie':
27
+ cookies.push(...serializeCookieParameter(parameter, operation.operationRef, value));
28
+ break;
29
+ }
30
+ }
31
+ if (query.length)
32
+ url += '?' + query.join('&');
33
+ if (cookies.length)
34
+ headers.push({ name: 'Cookie', value: cookies.join('; ') });
35
+ if (values.body === undefined)
36
+ return { url, headers };
37
+ if (!operation.body)
38
+ throw new Error(`${operation.operationRef} has no request body`);
39
+ const declared = Object.keys(operation.body.mediaTypes);
40
+ const mediaType = requestMediaType ?? (declared.length === 1 ? declared[0] : undefined);
41
+ if (!mediaType || !Object.hasOwn(operation.body.mediaTypes, mediaType))
42
+ throw new Error(`${operation.operationRef}: requestMediaType must select a declared body media type`);
43
+ headers.push({ name: 'Content-Type', value: mediaType });
44
+ if (values.body !== null &&
45
+ typeof values.body === 'object' &&
46
+ !Array.isArray(values.body))
47
+ for (const name of Object.keys(values.body))
48
+ if (looksLikeCredential(name))
49
+ throw new Error(`body.${name} looks like a credential; use credentialBindings`);
50
+ if (mediaType === 'application/json')
51
+ return {
52
+ url,
53
+ headers,
54
+ body: { contentType: 'json', value: JSON.stringify(values.body) },
55
+ };
56
+ if (mediaType !== 'application/x-www-form-urlencoded')
57
+ throw new UnsupportedOperationError(operation.operationRef, `requestBody media type ${mediaType} has no n8n mapping`);
58
+ if (!values.body ||
59
+ typeof values.body !== 'object' ||
60
+ Array.isArray(values.body))
61
+ throw new Error('form-urlencoded body must be an object');
62
+ return {
63
+ url,
64
+ headers,
65
+ body: {
66
+ contentType: 'form-urlencoded',
67
+ value: serializeFormBody(operation.operationRef, operation.body.mediaTypes[mediaType], values.body),
68
+ },
69
+ };
70
+ }
@@ -0,0 +1,43 @@
1
+ export { compileInboundWorkflow } from './legacy/workflow/inbound/compile-inbound-workflow.js';
2
+ export type * from './types/legacy/inbound-workflow.js';
3
+ export { createHttpRequestNode } from './nodes/request/create-http-request-node.js';
4
+ export { assembleN8nWorkflow } from './workflow/assemble-n8n-workflow.js';
5
+ export type * from './types/node-fragment.js';
6
+ export type * from './types/request-deployment.js';
7
+ export { httpRequestDeploymentOptionsSchema } from './schemas/request-deployment-schema.js';
8
+ export type * from './types/workflow-compilation.js';
9
+ export { compileReviewableN8nWorkflow } from './workflow/compile-reviewable-n8n-workflow.js';
10
+ export type * from './types/reviewable-workflow.js';
11
+ export { createN8nNativeCapabilities } from './nodes/native/create-native-capabilities.js';
12
+ export { resolveN8nNativeFeatures } from './nodes/native/registry/resolve-n8n-native-features.js';
13
+ export { resolveN8nNativePlanningFeatures } from './nodes/native/registry/resolve-n8n-native-planning-features.js';
14
+ export { N8nNativeFeature } from './types/native-feature-registry.js';
15
+ export type { N8nNativeFeatureContext, ResolveN8nNativeFeaturesInput, ReadyN8nNativeFeature, PendingN8nNativeFeature, N8nNativeFeatureRegistration, N8nNativeFeatureRegistry, N8nNativePlanningFeatureRegistry, N8nNativeFeaturePlanningDefinition, N8nNativeArrayContextRequirement, N8nNativeJsonOutputContextRequirement, N8nNativeFeatureContextRequirement, } from './types/native-feature-registry.js';
16
+ export { createJsonOutputCapability } from './nodes/native/create-json-output-capability.js';
17
+ export { createPassThroughCapability } from './nodes/native/create-pass-through-capability.js';
18
+ export { createExclusiveBranchMergeCapability } from './nodes/native/create-exclusive-branch-merge-capability.js';
19
+ export { createN8nNativeOutputSources } from './workflow/create-n8n-native-output-sources.js';
20
+ export type * from './types/output-binding-source.js';
21
+ export { compilePlannedN8nWorkflow } from './workflow/compile-planned-n8n-workflow.js';
22
+ export { n8nNativeInputConfigurationSchema } from './schemas/native-runtime-input-schema.js';
23
+ export { compileN8nWorkflowTemplate } from './workflow/templates/compile-n8n-workflow-template.js';
24
+ export type { CompileN8nWorkflowTemplateInput, N8nTemplateContext, N8nTemplateDeployment, N8nTemplateInputSlot, N8nTemplateNodeMapping, N8nTemplateDeploymentRequirement, N8nWorkflowTemplateResult, } from './types/workflow-template.js';
25
+ export type * from './types/native-capability.js';
26
+ export type { N8nNativeRuntimeInput, PrependNativeParameterGuardInput, N8nNativeInputConfiguration, N8nNativeInputSlot, N8nNativeInputTemplate, } from './types/native-runtime-parameters.js';
27
+ export { prependNativeParameterGuard } from './nodes/native/inputs/prepend-native-parameter-guard.js';
28
+ export { resolveHttpRequestAuthentication } from './nodes/request/authentication/resolve-http-request-authentication.js';
29
+ export type * from './types/authentication.js';
30
+ export { createResponseArrayCapability } from './nodes/native/create-response-array-capability.js';
31
+ export type * from './types/array-iteration.js';
32
+ export { createNativeArrayCapability } from './nodes/native/arrays/create-native-array-capability.js';
33
+ export type * from './types/native-array.js';
34
+ export { createResponseCollectionCapability } from './nodes/native/create-response-collection-capability.js';
35
+ export type * from './types/response-collection.js';
36
+ export { createItemJoinCapability } from './nodes/native/item-join/create-item-join-capability.js';
37
+ export type * from './types/item-join.js';
38
+ export { compileBatchedN8nWorkflow } from './workflow/batch/compile-batched-n8n-workflow.js';
39
+ export type { N8nBatchExecutionScope, CompileBatchedN8nWorkflowInput, } from './types/batch-execution.js';
40
+ export { describeN8nManualTrigger } from './workflow/entrypoint/manual-trigger.js';
41
+ export { selectN8nTemplateDeployments } from './workflow/templates/select-n8n-template-deployments.js';
42
+ export { resolveN8nNativeMaterials } from './workflow/resolve-n8n-native-materials.js';
43
+ export type { ResolveN8nNativeMaterialsInput, ResolvedN8nNativeMaterials, } from './types/native-material-binding.js';
@@ -0,0 +1,26 @@
1
+ export { compileInboundWorkflow } from './legacy/workflow/inbound/compile-inbound-workflow.js';
2
+ export { createHttpRequestNode } from './nodes/request/create-http-request-node.js';
3
+ export { assembleN8nWorkflow } from './workflow/assemble-n8n-workflow.js';
4
+ export { httpRequestDeploymentOptionsSchema } from './schemas/request-deployment-schema.js';
5
+ export { compileReviewableN8nWorkflow } from './workflow/compile-reviewable-n8n-workflow.js';
6
+ export { createN8nNativeCapabilities } from './nodes/native/create-native-capabilities.js';
7
+ export { resolveN8nNativeFeatures } from './nodes/native/registry/resolve-n8n-native-features.js';
8
+ export { resolveN8nNativePlanningFeatures } from './nodes/native/registry/resolve-n8n-native-planning-features.js';
9
+ export { N8nNativeFeature } from './types/native-feature-registry.js';
10
+ export { createJsonOutputCapability } from './nodes/native/create-json-output-capability.js';
11
+ export { createPassThroughCapability } from './nodes/native/create-pass-through-capability.js';
12
+ export { createExclusiveBranchMergeCapability } from './nodes/native/create-exclusive-branch-merge-capability.js';
13
+ export { createN8nNativeOutputSources } from './workflow/create-n8n-native-output-sources.js';
14
+ export { compilePlannedN8nWorkflow } from './workflow/compile-planned-n8n-workflow.js';
15
+ export { n8nNativeInputConfigurationSchema } from './schemas/native-runtime-input-schema.js';
16
+ export { compileN8nWorkflowTemplate } from './workflow/templates/compile-n8n-workflow-template.js';
17
+ export { prependNativeParameterGuard } from './nodes/native/inputs/prepend-native-parameter-guard.js';
18
+ export { resolveHttpRequestAuthentication } from './nodes/request/authentication/resolve-http-request-authentication.js';
19
+ export { createResponseArrayCapability } from './nodes/native/create-response-array-capability.js';
20
+ export { createNativeArrayCapability } from './nodes/native/arrays/create-native-array-capability.js';
21
+ export { createResponseCollectionCapability } from './nodes/native/create-response-collection-capability.js';
22
+ export { createItemJoinCapability } from './nodes/native/item-join/create-item-join-capability.js';
23
+ export { compileBatchedN8nWorkflow } from './workflow/batch/compile-batched-n8n-workflow.js';
24
+ export { describeN8nManualTrigger } from './workflow/entrypoint/manual-trigger.js';
25
+ export { selectN8nTemplateDeployments } from './workflow/templates/select-n8n-template-deployments.js';
26
+ export { resolveN8nNativeMaterials } from './workflow/resolve-n8n-native-materials.js';
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export declare const batchExecutionScopeSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ batchSize: z.ZodNumber;
5
+ nodeIds: z.ZodArray<z.ZodString>;
6
+ entryNodeId: z.ZodString;
7
+ exitNodeId: z.ZodString;
8
+ }, z.core.$strict>;
9
+ export declare const batchExecutionScopesSchema: z.ZodArray<z.ZodObject<{
10
+ id: z.ZodString;
11
+ batchSize: z.ZodNumber;
12
+ nodeIds: z.ZodArray<z.ZodString>;
13
+ entryNodeId: z.ZodString;
14
+ exitNodeId: z.ZodString;
15
+ }, z.core.$strict>>;
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export const batchExecutionScopeSchema = z.strictObject({
3
+ id: z
4
+ .string()
5
+ .min(1)
6
+ .regex(/\S/, 'batch id must not contain only whitespace'),
7
+ batchSize: z.number().int().positive().max(Number.MAX_SAFE_INTEGER),
8
+ nodeIds: z.array(z.string().min(1)).min(1),
9
+ entryNodeId: z.string().min(1),
10
+ exitNodeId: z.string().min(1),
11
+ });
12
+ export const batchExecutionScopesSchema = z
13
+ .array(batchExecutionScopeSchema)
14
+ .min(1);
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ import type { WorkflowCapabilityPlanningContext } from '@openapi-flow/core';
3
+ export declare function createIfPlanningParametersSchema(context: WorkflowCapabilityPlanningContext): z.ZodObject<{
4
+ combinator: z.ZodEnum<{
5
+ and: "and";
6
+ or: "or";
7
+ }>;
8
+ conditions: z.ZodArray<z.ZodObject<{
9
+ operator: z.ZodEnum<{
10
+ equals: "equals";
11
+ notEquals: "notEquals";
12
+ greaterThan: "greaterThan";
13
+ lessThan: "lessThan";
14
+ keysEqual: "keysEqual";
15
+ }>;
16
+ left: z.ZodObject<{
17
+ source: z.ZodLiteral<"literal">;
18
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
19
+ }, z.core.$strict> | z.ZodUnion<readonly [z.ZodObject<{
20
+ source: z.ZodLiteral<"response">;
21
+ pointer: z.ZodString;
22
+ nodeId: z.ZodEnum<{
23
+ [x: string]: string;
24
+ }>;
25
+ }, z.core.$strict>, z.ZodObject<{
26
+ source: z.ZodLiteral<"literal">;
27
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
28
+ }, z.core.$strict>]>;
29
+ right: z.ZodObject<{
30
+ source: z.ZodLiteral<"literal">;
31
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
32
+ }, z.core.$strict> | z.ZodUnion<readonly [z.ZodObject<{
33
+ source: z.ZodLiteral<"response">;
34
+ pointer: z.ZodString;
35
+ nodeId: z.ZodEnum<{
36
+ [x: string]: string;
37
+ }>;
38
+ }, z.core.$strict>, z.ZodObject<{
39
+ source: z.ZodLiteral<"literal">;
40
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
41
+ }, z.core.$strict>]>;
42
+ }, z.core.$strict>>;
43
+ }, z.core.$strict>;
44
+ export declare function createAssertionPlanningParametersSchema(context: WorkflowCapabilityPlanningContext): z.ZodObject<{
45
+ checks: z.ZodArray<z.ZodObject<{
46
+ operator: z.ZodEnum<{
47
+ equals: "equals";
48
+ notEquals: "notEquals";
49
+ greaterThan: "greaterThan";
50
+ lessThan: "lessThan";
51
+ keysEqual: "keysEqual";
52
+ }>;
53
+ message: z.ZodString;
54
+ left: z.ZodObject<{
55
+ source: z.ZodLiteral<"literal">;
56
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
57
+ }, z.core.$strict> | z.ZodUnion<readonly [z.ZodObject<{
58
+ source: z.ZodLiteral<"response">;
59
+ pointer: z.ZodString;
60
+ nodeId: z.ZodEnum<{
61
+ [x: string]: string;
62
+ }>;
63
+ }, z.core.$strict>, z.ZodObject<{
64
+ source: z.ZodLiteral<"literal">;
65
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
66
+ }, z.core.$strict>]>;
67
+ right: z.ZodObject<{
68
+ source: z.ZodLiteral<"literal">;
69
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
70
+ }, z.core.$strict> | z.ZodUnion<readonly [z.ZodObject<{
71
+ source: z.ZodLiteral<"response">;
72
+ pointer: z.ZodString;
73
+ nodeId: z.ZodEnum<{
74
+ [x: string]: string;
75
+ }>;
76
+ }, z.core.$strict>, z.ZodObject<{
77
+ source: z.ZodLiteral<"literal">;
78
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
79
+ }, z.core.$strict>]>;
80
+ }, z.core.$strict>>;
81
+ }, z.core.$strict>;
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ import { nativeOperandSchema, nativeCheckSchema, ifParametersSchema, assertionParametersSchema, } from './native-capability-schemas.js';
3
+ function createPlanningCheckSchema({ apiCallIds, }) {
4
+ const literal = nativeOperandSchema.options[1];
5
+ const operand = apiCallIds.length === 0
6
+ ? literal
7
+ : z.union([
8
+ nativeOperandSchema.options[0].extend({
9
+ nodeId: z
10
+ .enum(apiCallIds)
11
+ .describe('Exact supplied API callId; choose a response source, never create an ID.'),
12
+ }),
13
+ literal,
14
+ ]);
15
+ return nativeCheckSchema.extend({ left: operand, right: operand });
16
+ }
17
+ export function createIfPlanningParametersSchema(context) {
18
+ return ifParametersSchema.extend({
19
+ conditions: z
20
+ .array(createPlanningCheckSchema(context))
21
+ .min(1)
22
+ .describe('Only conditions required by the scenario, with supplied API callIds and OAS-derived response pointers.'),
23
+ });
24
+ }
25
+ export function createAssertionPlanningParametersSchema(context) {
26
+ const check = createPlanningCheckSchema(context);
27
+ return assertionParametersSchema.extend({
28
+ checks: z
29
+ .array(assertionParametersSchema.shape.checks.element.extend({
30
+ left: check.shape.left,
31
+ right: check.shape.right,
32
+ }))
33
+ .min(1)
34
+ .describe('Declarative assertions over supplied API responses. Exact API callIds only; no invented references or model-written JavaScript.'),
35
+ });
36
+ }
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const exclusiveBranchMergeParametersSchema: z.ZodObject<{
3
+ sourceNodeId: z.ZodString;
4
+ }, z.core.$strict>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export const exclusiveBranchMergeParametersSchema = z.strictObject({
3
+ sourceNodeId: z
4
+ .string()
5
+ .min(1)
6
+ .describe('Existing IF instance whose true and false paths both reach this merge. Do not merge independent branches or discard an alternative.'),
7
+ });
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const itemJoinParametersSchema: z.ZodObject<{
3
+ scopeNodeId: z.ZodString;
4
+ sourceCallIds: z.ZodArray<z.ZodString>;
5
+ }, z.core.$strict>;
6
+ export declare function createItemJoinParametersSchema(scopeIds: string[], callIds: string[]): z.ZodObject<{
7
+ scopeNodeId: z.ZodEnum<{
8
+ [x: string]: string;
9
+ }>;
10
+ sourceCallIds: z.ZodArray<z.ZodEnum<{
11
+ [x: string]: string;
12
+ }>>;
13
+ }, z.core.$strict>;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export const itemJoinParametersSchema = z.strictObject({
3
+ scopeNodeId: z
4
+ .string()
5
+ .min(1)
6
+ .describe('The supplied native item scope shared by every API branch.'),
7
+ sourceCallIds: z
8
+ .array(z.string().min(1))
9
+ .min(2)
10
+ .refine((ids) => new Set(ids).size === ids.length, 'sourceCallIds must be unique')
11
+ .describe('API call IDs in input-port order. Each participating scope item requires exactly one response from every call. Never business IDs or array-position matching.'),
12
+ });
13
+ export function createItemJoinParametersSchema(scopeIds, callIds) {
14
+ if (!scopeIds.length || callIds.length < 2)
15
+ throw new Error('item join requires supplied scopes and at least two API calls');
16
+ return itemJoinParametersSchema.extend({
17
+ scopeNodeId: z
18
+ .enum(scopeIds)
19
+ .describe('Only a supplied native scope, resolved through n8n item ancestry.'),
20
+ sourceCallIds: z
21
+ .array(z.enum(callIds))
22
+ .min(2)
23
+ .refine((ids) => new Set(ids).size === ids.length, 'sourceCallIds must be unique')
24
+ .describe('Existing API call IDs. input1 receives the first call, input2 the second, and so on. Code derives OAS contracts and linking metadata.'),
25
+ });
26
+ }
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const nativeArrayParametersSchema: z.ZodObject<{
3
+ sourceNodeId: z.ZodString;
4
+ pointer: z.ZodString;
5
+ }, z.core.$strict>;
6
+ export declare function createNativeArrayParametersSchema(nodeIds: string[]): z.ZodObject<{
7
+ pointer: z.ZodString;
8
+ sourceNodeId: z.ZodEnum<{
9
+ [x: string]: string;
10
+ }>;
11
+ }, z.core.$strict>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ export const nativeArrayParametersSchema = z.strictObject({
3
+ sourceNodeId: z
4
+ .string()
5
+ .min(1)
6
+ .describe('Existing native node ID with a declared JSON output contract containing the scenario-required array.'),
7
+ pointer: z
8
+ .string()
9
+ .describe('RFC 6901 pointer into the native JSON root selecting an array. Do not use an HTTP body prefix, flatten values or select a first element.'),
10
+ });
11
+ export function createNativeArrayParametersSchema(nodeIds) {
12
+ if (!nodeIds.length)
13
+ throw new Error('native array parameters require source node IDs');
14
+ return nativeArrayParametersSchema.extend({
15
+ sourceNodeId: z
16
+ .enum(nodeIds)
17
+ .describe('Only a supplied native node ID; code derives and validates its original output contract.'),
18
+ });
19
+ }
@@ -0,0 +1,100 @@
1
+ import { z } from 'zod';
2
+ export declare const nativeOperandSchema: z.ZodUnion<readonly [z.ZodObject<{
3
+ source: z.ZodLiteral<"response">;
4
+ nodeId: z.ZodString;
5
+ pointer: z.ZodString;
6
+ }, z.core.$strict>, z.ZodObject<{
7
+ source: z.ZodLiteral<"literal">;
8
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
9
+ }, z.core.$strict>]>;
10
+ export declare const nativeCheckSchema: z.ZodObject<{
11
+ left: z.ZodUnion<readonly [z.ZodObject<{
12
+ source: z.ZodLiteral<"response">;
13
+ nodeId: z.ZodString;
14
+ pointer: z.ZodString;
15
+ }, z.core.$strict>, z.ZodObject<{
16
+ source: z.ZodLiteral<"literal">;
17
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
18
+ }, z.core.$strict>]>;
19
+ operator: z.ZodEnum<{
20
+ equals: "equals";
21
+ notEquals: "notEquals";
22
+ greaterThan: "greaterThan";
23
+ lessThan: "lessThan";
24
+ keysEqual: "keysEqual";
25
+ }>;
26
+ right: z.ZodUnion<readonly [z.ZodObject<{
27
+ source: z.ZodLiteral<"response">;
28
+ nodeId: z.ZodString;
29
+ pointer: z.ZodString;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ source: z.ZodLiteral<"literal">;
32
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
33
+ }, z.core.$strict>]>;
34
+ }, z.core.$strict>;
35
+ export declare const ifParametersSchema: z.ZodObject<{
36
+ combinator: z.ZodEnum<{
37
+ and: "and";
38
+ or: "or";
39
+ }>;
40
+ conditions: z.ZodArray<z.ZodObject<{
41
+ left: z.ZodUnion<readonly [z.ZodObject<{
42
+ source: z.ZodLiteral<"response">;
43
+ nodeId: z.ZodString;
44
+ pointer: z.ZodString;
45
+ }, z.core.$strict>, z.ZodObject<{
46
+ source: z.ZodLiteral<"literal">;
47
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
48
+ }, z.core.$strict>]>;
49
+ operator: z.ZodEnum<{
50
+ equals: "equals";
51
+ notEquals: "notEquals";
52
+ greaterThan: "greaterThan";
53
+ lessThan: "lessThan";
54
+ keysEqual: "keysEqual";
55
+ }>;
56
+ right: z.ZodUnion<readonly [z.ZodObject<{
57
+ source: z.ZodLiteral<"response">;
58
+ nodeId: z.ZodString;
59
+ pointer: z.ZodString;
60
+ }, z.core.$strict>, z.ZodObject<{
61
+ source: z.ZodLiteral<"literal">;
62
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
63
+ }, z.core.$strict>]>;
64
+ }, z.core.$strict>>;
65
+ }, z.core.$strict>;
66
+ export declare const mergeParametersSchema: z.ZodObject<{
67
+ numberInputs: z.ZodNumber;
68
+ }, z.core.$strict>;
69
+ export declare const assertionParametersSchema: z.ZodObject<{
70
+ checks: z.ZodArray<z.ZodObject<{
71
+ left: z.ZodUnion<readonly [z.ZodObject<{
72
+ source: z.ZodLiteral<"response">;
73
+ nodeId: z.ZodString;
74
+ pointer: z.ZodString;
75
+ }, z.core.$strict>, z.ZodObject<{
76
+ source: z.ZodLiteral<"literal">;
77
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
78
+ }, z.core.$strict>]>;
79
+ operator: z.ZodEnum<{
80
+ equals: "equals";
81
+ notEquals: "notEquals";
82
+ greaterThan: "greaterThan";
83
+ lessThan: "lessThan";
84
+ keysEqual: "keysEqual";
85
+ }>;
86
+ right: z.ZodUnion<readonly [z.ZodObject<{
87
+ source: z.ZodLiteral<"response">;
88
+ nodeId: z.ZodString;
89
+ pointer: z.ZodString;
90
+ }, z.core.$strict>, z.ZodObject<{
91
+ source: z.ZodLiteral<"literal">;
92
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
93
+ }, z.core.$strict>]>;
94
+ message: z.ZodString;
95
+ }, z.core.$strict>>;
96
+ }, z.core.$strict>;
97
+ export declare const stopParametersSchema: z.ZodObject<{
98
+ message: z.ZodString;
99
+ }, z.core.$strict>;
100
+ export declare const passThroughParametersSchema: z.ZodObject<{}, z.core.$strict>;
@@ -0,0 +1,62 @@
1
+ import { z } from 'zod';
2
+ // Disjoint source literals retain the same validation contract with anyOf.
3
+ // OpenAI-compatible strict tools reject the oneOf emitted by discriminatedUnion.
4
+ export const nativeOperandSchema = z.union([
5
+ z.strictObject({
6
+ source: z.literal('response'),
7
+ nodeId: z
8
+ .string()
9
+ .min(1)
10
+ .describe('API callId whose response is guaranteed to have executed.'),
11
+ pointer: z
12
+ .string()
13
+ .describe('RFC 6901 pointer into the response body. Empty string means the whole body.'),
14
+ }),
15
+ z.strictObject({
16
+ source: z.literal('literal'),
17
+ value: z
18
+ .union([z.string(), z.number(), z.boolean(), z.null()])
19
+ .describe('An explicitly requested scalar comparison value; no expressions or code.'),
20
+ }),
21
+ ]);
22
+ export const nativeCheckSchema = z.strictObject({
23
+ left: nativeOperandSchema,
24
+ operator: z
25
+ .enum(['equals', 'notEquals', 'greaterThan', 'lessThan', 'keysEqual'])
26
+ .describe('equals is deep, type-strict JSON equality. keysEqual compares object key sets. Numeric operators require numbers.'),
27
+ right: nativeOperandSchema,
28
+ });
29
+ export const ifParametersSchema = z.strictObject({
30
+ combinator: z
31
+ .enum(['and', 'or'])
32
+ .describe('Combine all conditions. Outputs: true, false; input: main.'),
33
+ conditions: z
34
+ .array(nativeCheckSchema)
35
+ .min(1)
36
+ .describe('Only conditions required by the scenario, with OAS-derived response pointers.'),
37
+ });
38
+ export const mergeParametersSchema = z.strictObject({
39
+ numberInputs: z
40
+ .number()
41
+ .int()
42
+ .min(2)
43
+ .describe('Append waits for ALL inputs named input1..inputN. Output: main. Never join mutually exclusive branches.'),
44
+ });
45
+ export const assertionParametersSchema = z.strictObject({
46
+ checks: z
47
+ .array(nativeCheckSchema.extend({
48
+ message: z
49
+ .string()
50
+ .min(1)
51
+ .describe('Actionable failure message for this scenario assertion.'),
52
+ }))
53
+ .min(1)
54
+ .describe('Declarative assertions over API responses; compiled to Code by the library, never model-written JavaScript. Input/output: main.'),
55
+ });
56
+ export const stopParametersSchema = z.strictObject({
57
+ message: z
58
+ .string()
59
+ .min(1)
60
+ .describe('StopAndError message when this branch executes. Input: main; no output.'),
61
+ });
62
+ export const passThroughParametersSchema = z.strictObject({});