{"_id":"@avantguardllc/n8n-openapi-node","_rev":"8-312a5f20ce85d32b91d3330e94e76cdb","name":"@avantguardllc/n8n-openapi-node","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.4":{"name":"@avantguardllc/n8n-openapi-node","version":"0.1.4","keywords":["n8n","openapi"],"author":{"name":"AvantGuardLLC"},"license":"MIT","_id":"@avantguardllc/n8n-openapi-node@0.1.4","maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"dist":{"shasum":"cbdb8b9a6f708608c99021b5da7c9c8daf17b544","tarball":"https://registry.npmjs.org/@avantguardllc/n8n-openapi-node/-/n8n-openapi-node-0.1.4.tgz","fileCount":46,"integrity":"sha512-z5k9NUGgH9r/Hl5WHxQ+Wq7YejjsFayTTRxfWGtNtBP0c/xE1xAEPGa8iFX+kdflUmCHi6eQJIOjTrQoAYxh0w==","signatures":[{"sig":"MEUCIQDBBkkOmnwnWEwX1wj3oZXyzSucz7Y7/8fABsILvTJ5rQIgZTI2afk9Vnx8HJ53J0zUKfpX05fcNfTeOSPUBeZfins=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":177042},"main":"dist/src/index.js","types":"dist/src/index.d.ts","module":"dist/src/index.js","exports":{".":{"import":"./dist/src/index.js","require":"./dist/src/index.js"}},"gitHead":"02823b4c2aff51788041675d9ef3d7cb3cc5768a","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"avantguardllc","email":"appadmin@avantguard.it"},"repository":{"url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git","type":"git"},"_npmVersion":"10.9.2","description":"Turn OpenAPI specs into n8n node","directories":{},"_nodeVersion":"22.14.0","dependencies":{"pino":"^9.4.0","lodash":"^4.17.21","pino-pretty":"^11.2.2","openapi-types":"^12.1.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","n8n-core":"*","typescript":"^5.6.2","@types/jest":"^29.5.13","n8n-workflow":"*","@types/lodash":"^4.17.7"},"_npmOperationalInternal":{"tmp":"tmp/n8n-openapi-node_0.1.4_1743264913617_0.6822912513517061","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@avantguardllc/n8n-openapi-node","version":"0.1.5","keywords":["n8n","openapi"],"author":{"name":"AvantGuardLLC"},"license":"MIT","_id":"@avantguardllc/n8n-openapi-node@0.1.5","maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"dist":{"shasum":"b224ef551f99a65d8132313bb92a38edd70771e1","tarball":"https://registry.npmjs.org/@avantguardllc/n8n-openapi-node/-/n8n-openapi-node-0.1.5.tgz","fileCount":46,"integrity":"sha512-ekxZI+Vtrp+1gkXYcJERDXY+Sc93Oy7WwYfpue2lXbbQGWMqCKRi8XvNToYRGfDpI7TnRE63c2kSobLYf7VKQw==","signatures":[{"sig":"MEQCIBwDabyPHDsCvEt01JrW0GJsA+77iwm3dnQeuNSucJfGAiBXcqEwz2/nUqmMOOcIkQEBbKMs/7jTziWF+xYwJaNycg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":177243},"main":"dist/src/index.js","types":"dist/src/index.d.ts","module":"dist/src/index.js","exports":{".":{"import":"./dist/src/index.js","require":"./dist/src/index.js"}},"gitHead":"bf75377ee2554bbe2efd7034e6b7f0907ebfeccf","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"avantguardllc","email":"appadmin@avantguard.it"},"repository":{"url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git","type":"git"},"_npmVersion":"10.9.2","description":"Turn OpenAPI specs into n8n node","directories":{},"_nodeVersion":"22.14.0","dependencies":{"pino":"^9.4.0","lodash":"^4.17.21","pino-pretty":"^11.2.2","openapi-types":"^12.1.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","n8n-core":"*","typescript":"^5.6.2","@types/jest":"^29.5.13","n8n-workflow":"*","@types/lodash":"^4.17.7"},"_npmOperationalInternal":{"tmp":"tmp/n8n-openapi-node_0.1.5_1743692181931_0.26908921856482326","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@avantguardllc/n8n-openapi-node","version":"0.1.6","keywords":["n8n","openapi"],"author":{"name":"AvantGuardLLC"},"license":"MIT","_id":"@avantguardllc/n8n-openapi-node@0.1.6","maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"dist":{"shasum":"2fe760cb6c3d747e2aa0e8fd09ba6fe3b1af319d","tarball":"https://registry.npmjs.org/@avantguardllc/n8n-openapi-node/-/n8n-openapi-node-0.1.6.tgz","fileCount":49,"integrity":"sha512-UI7OhNDSzYx2aIrcBgyMXjFxf3mwIpQ9xQK1DfRRwDLtvh3SC8++3dZz4SliRukA8d0ugCQY3Tj536J+WpqctA==","signatures":[{"sig":"MEQCID3Bw34KA1b/wpCoL3y8kluFwcWmZjQJ65Mf6m1KdPAIAiBOszcGFSQ2dRVIccnHdHwdb44Z2zfofxGV0v5S0A6mmw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":180655},"main":"dist/src/index.js","types":"dist/src/index.d.ts","module":"dist/src/index.js","exports":{".":{"import":"./dist/src/index.js","require":"./dist/src/index.js"}},"gitHead":"6ee7ba95fcda5b15c93e3c0e95a7c77144b876c1","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"avantguardllc","email":"appadmin@avantguard.it"},"repository":{"url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git","type":"git"},"_npmVersion":"10.9.2","description":"Turn OpenAPI specs into n8n node","directories":{},"_nodeVersion":"22.14.0","dependencies":{"pino":"^9.4.0","lodash":"^4.17.21","pino-pretty":"^11.2.2","openapi-types":"^12.1.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","n8n-core":"*","typescript":"^5.6.2","@types/jest":"^29.5.13","n8n-workflow":"*","@types/lodash":"^4.17.7"},"_npmOperationalInternal":{"tmp":"tmp/n8n-openapi-node_0.1.6_1743716747118_0.740984969281471","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@avantguardllc/n8n-openapi-node","version":"0.1.7","keywords":["n8n","openapi"],"author":{"name":"AvantGuardLLC"},"license":"MIT","_id":"@avantguardllc/n8n-openapi-node@0.1.7","maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"dist":{"shasum":"b333b1bdadbef18bbf84cd7b9165ed704112a912","tarball":"https://registry.npmjs.org/@avantguardllc/n8n-openapi-node/-/n8n-openapi-node-0.1.7.tgz","fileCount":49,"integrity":"sha512-5niCeAZbmeiL3XTrzYGbnuQsIqBNzisR2l69Ly+e+uo69s4XQ8VPuhqOlPP80WRW4pp1xITWPtW2nV3sP5H8Lg==","signatures":[{"sig":"MEQCIAQyFv73p1GfhVZTVbBYUfMhkw3pzTTfwiUzWYczUfDFAiAhUjcXNABczIy/3AH6WmzZDhFlC2M1a2mcg+9YuZzUqQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":180798},"main":"dist/src/index.js","types":"dist/src/index.d.ts","module":"dist/src/index.js","exports":{".":{"import":"./dist/src/index.js","require":"./dist/src/index.js"}},"gitHead":"094ecc3af2a687de782116fa890b6fe30d5f3d93","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"avantguardllc","email":"appadmin@avantguard.it"},"repository":{"url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git","type":"git"},"_npmVersion":"10.9.2","description":"Turn OpenAPI specs into n8n node","directories":{},"_nodeVersion":"22.14.0","dependencies":{"pino":"^9.4.0","lodash":"^4.17.21","pino-pretty":"^11.2.2","openapi-types":"^12.1.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","n8n-core":"*","typescript":"^5.6.2","@types/jest":"^29.5.13","n8n-workflow":"*","@types/lodash":"^4.17.7"},"_npmOperationalInternal":{"tmp":"tmp/n8n-openapi-node_0.1.7_1743780152958_0.5824948614728835","host":"s3://npm-registry-packages-npm-production"}},"0.1.8":{"name":"@avantguardllc/n8n-openapi-node","version":"0.1.8","keywords":["n8n","openapi"],"author":{"name":"AvantGuardLLC"},"license":"MIT","_id":"@avantguardllc/n8n-openapi-node@0.1.8","maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"dist":{"shasum":"eaaeeb9edb7b0150ce0060a9fa041c55d429ca37","tarball":"https://registry.npmjs.org/@avantguardllc/n8n-openapi-node/-/n8n-openapi-node-0.1.8.tgz","fileCount":49,"integrity":"sha512-OAlZa20T10CarF+vSGohRGqwT/mlocE44ab8RQeRSlvn4TnyvwAy4SdNGXr43dBDG6qQLEBZdC3O6gYcx24s2w==","signatures":[{"sig":"MEUCIQDk5alO4Dmd+DKC3cBTFL/EPCJ1fZuhgvru0cmW7xASxwIgOLwE2bEIYSlaLziNODTJ9Un6dcvlCSWdReFstEAe4uE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":181193},"main":"dist/src/index.js","types":"dist/src/index.d.ts","module":"dist/src/index.js","exports":{".":{"import":"./dist/src/index.js","require":"./dist/src/index.js"}},"gitHead":"115b62b9b4a39ba46841dd3b7656ad05f6cfb37f","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"avantguardllc","email":"appadmin@avantguard.it"},"repository":{"url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git","type":"git"},"_npmVersion":"10.9.2","description":"Turn OpenAPI specs into n8n node","directories":{},"_nodeVersion":"22.14.0","dependencies":{"pino":"^9.4.0","lodash":"^4.17.21","pino-pretty":"^11.2.2","openapi-types":"^12.1.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","n8n-core":"*","typescript":"^5.6.2","@types/jest":"^29.5.13","n8n-workflow":"*","@types/lodash":"^4.17.7"},"_npmOperationalInternal":{"tmp":"tmp/n8n-openapi-node_0.1.8_1743788424333_0.38907581762231924","host":"s3://npm-registry-packages-npm-production"}},"0.1.9":{"name":"@avantguardllc/n8n-openapi-node","version":"0.1.9","keywords":["n8n","openapi"],"author":{"name":"AvantGuardLLC"},"license":"MIT","_id":"@avantguardllc/n8n-openapi-node@0.1.9","maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"dist":{"shasum":"fda36d7646d375c165d0441471108cee4fca49a1","tarball":"https://registry.npmjs.org/@avantguardllc/n8n-openapi-node/-/n8n-openapi-node-0.1.9.tgz","fileCount":49,"integrity":"sha512-KXkR9WfL308Xq5nJyoora6FcMCjw66WtBUA07nMpbp/Qj1Q3fJ/Asq/wlR5+e7I3tG30jl5ojM8a/SHa81PmKA==","signatures":[{"sig":"MEQCIAPabrxHPasQIpMyofB3wY2TRBiCtKhSN3RrLBJ67F5TAiANT5kcvfIz0KhegTOk2DdCwP5CPjy0HCpdeGvRkp6bMA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":181023},"main":"dist/src/index.js","types":"dist/src/index.d.ts","module":"dist/src/index.js","exports":{".":{"import":"./dist/src/index.js","require":"./dist/src/index.js"}},"gitHead":"bf09317a6c614c3bbbdb72b1261d1bfdbdb79571","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"avantguardllc","email":"appadmin@avantguard.it"},"repository":{"url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git","type":"git"},"_npmVersion":"10.9.2","description":"Turn OpenAPI specs into n8n node","directories":{},"_nodeVersion":"22.14.0","dependencies":{"pino":"^9.4.0","lodash":"^4.17.21","pino-pretty":"^11.2.2","openapi-types":"^12.1.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","n8n-core":"*","typescript":"^5.6.2","@types/jest":"^29.5.13","n8n-workflow":"*","@types/lodash":"^4.17.7"},"_npmOperationalInternal":{"tmp":"tmp/n8n-openapi-node_0.1.9_1743800601958_0.3793226699165828","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@avantguardllc/n8n-openapi-node","version":"0.2.1","keywords":["n8n","openapi"],"author":{"name":"AvantGuardLLC"},"license":"MIT","_id":"@avantguardllc/n8n-openapi-node@0.2.1","maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"dist":{"shasum":"fa5b29fc3797be4e8f2cbee404aa2b7a80efa242","tarball":"https://registry.npmjs.org/@avantguardllc/n8n-openapi-node/-/n8n-openapi-node-0.2.1.tgz","fileCount":49,"integrity":"sha512-bSjdxEPX/G57KtFesgRr7DyVOYXC+XaM5xNdSKLwPPxzlOA97l9RsABl11Oi2WL2tn4sXpo7jZ0jpeUWSDWZEQ==","signatures":[{"sig":"MEUCIDpbjZ4ovZF66bLFF0wuUby8eKMoeen6rI8nT32WiJ6AAiEA4mzxt1wf0BgxiEcRxa8ZpRLJRKuUSOI0QNV+bZOAVGA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":185758},"main":"dist/src/index.js","types":"dist/src/index.d.ts","module":"dist/src/index.js","exports":{".":{"import":"./dist/src/index.js","require":"./dist/src/index.js"}},"gitHead":"b924e317373b68efcc1aec36c8b7969ce158362f","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"avantguardllc","email":"appadmin@avantguard.it"},"repository":{"url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git","type":"git"},"_npmVersion":"10.9.2","description":"Turn OpenAPI specs into n8n node","directories":{},"_nodeVersion":"22.14.0","dependencies":{"pino":"^9.4.0","lodash":"^4.17.21","pino-pretty":"^11.2.2","openapi-types":"^12.1.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","n8n-core":"*","typescript":"^5.6.2","@types/jest":"^29.5.13","n8n-workflow":"*","@types/lodash":"^4.17.7"},"_npmOperationalInternal":{"tmp":"tmp/n8n-openapi-node_0.2.1_1743803079480_0.5102848005114731","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@avantguardllc/n8n-openapi-node","version":"0.2.2","description":"Turn OpenAPI specs into n8n node","main":"dist/src/index.js","module":"dist/src/index.js","types":"dist/src/index.d.ts","scripts":{"build":"tsc","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git"},"keywords":["n8n","openapi"],"author":{"name":"AvantGuardLLC"},"license":"MIT","bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"exports":{".":{"import":"./dist/src/index.js","require":"./dist/src/index.js"}},"homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","devDependencies":{"@types/jest":"^29.5.13","@types/lodash":"^4.17.7","jest":"^29.7.0","n8n-core":"*","n8n-workflow":"*","ts-jest":"^29.2.5","typescript":"^5.6.2"},"dependencies":{"lodash":"^4.17.21","openapi-types":"^12.1.3","pino":"^9.4.0","pino-pretty":"^11.2.2"},"_id":"@avantguardllc/n8n-openapi-node@0.2.2","gitHead":"8ca5e6a139577de7614489315af5fa66c5be07bf","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-NFS1U0CHDCEXf2WL/ZQFtdhun3hb0LTe3ZSNqDj3cs8u3j/gcEEwYiSr+9VqJhoXn/wd3ogmlC4KhtBdjkdbEQ==","shasum":"bbd9b88eed9856a6ce0dca3d56b10c6f2666baba","tarball":"https://registry.npmjs.org/@avantguardllc/n8n-openapi-node/-/n8n-openapi-node-0.2.2.tgz","fileCount":52,"unpackedSize":199925,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDnobxCLB8TZdRbA0FX6LIRIvljuFNn+Hwv0LpRLrLjFQIgTCZV4+XJFkIKbo1KzBenN4Xj1pm5QQG6xUAtDiHPgMc="}]},"_npmUser":{"name":"avantguardllc","email":"appadmin@avantguard.it"},"directories":{},"maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/n8n-openapi-node_0.2.2_1744079379372_0.07635844478391118"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-29T16:15:13.506Z","modified":"2025-04-08T02:29:39.725Z","0.1.4":"2025-03-29T16:15:13.816Z","0.1.5":"2025-04-03T14:56:22.136Z","0.1.6":"2025-04-03T21:45:47.334Z","0.1.7":"2025-04-04T15:22:33.131Z","0.1.8":"2025-04-04T17:40:24.567Z","0.1.9":"2025-04-04T21:03:22.182Z","0.2.1":"2025-04-04T21:44:39.706Z","0.2.2":"2025-04-08T02:29:39.552Z"},"bugs":{"url":"https://github.com/AvantGuardLLC/n8n-openapi-node/issues"},"author":{"name":"AvantGuardLLC"},"license":"MIT","homepage":"https://github.com/AvantGuardLLC/n8n-openapi-node#readme","keywords":["n8n","openapi"],"repository":{"type":"git","url":"git+https://github.com/AvantGuardLLC/n8n-openapi-node.git"},"description":"Turn OpenAPI specs into n8n node","maintainers":[{"name":"avantguardllc","email":"appadmin@avantguard.it"}],"readme":"# @AvantGuardLLC/n8n-openapi-node\n\n\n![openapi logo](openapi.png)\n![n8n logo](n8n.png)\n\nTurn Your **OpenAPI** (**Swagger**) spec into a **n8n node**!\n\n[![npm version](https://img.shields.io/npm/v/@avantguardllc/n8n-openapi-node.svg)](https://www.npmjs.com/package/@avantguardllc/n8n-openapi-node)\n\n---\n\n<!-- toc -->\n\n- [Quick Start](#quick-start)\n  * [Installation](#installation)\n  * [Usage](#usage)\n- [How it works](#how-it-works)\n  * [Resource](#resource)\n  * [Operation](#operation)\n  * [Query Parameters](#query-parameters)\n  * [Request Body](#request-body)\n  * [Headers](#headers)\n- [Customization](#customization)\n  * [Resource](#resource-1)\n  * [Operation](#operation-1)\n  * [Fields](#fields)\n- [Use Cases](#use-cases)\n- [FAQ](#faq)\n  * [I have only OpenAPI v2 spec, what can I do?](#i-have-only-openapi-v2-spec-what-can-i-do)\n  * [I have openapi.yaml spec, what can I do?](#i-have-openapiyaml-spec-what-can-i-do)\n  * [How to set up credentials from OpenAPI v3 spec?](#how-to-set-up-credentials-from-openapi-v3-spec)\n  * [Why it doesn't work with my OpenAPI spec?](#why-it-doesnt-work-with-my-openapi-spec)\n- [Support the project](#support-the-project)\n\n<!-- tocstop -->\n\n# Quick Start\n\nIf you have OpenAPI specification - you can easily in few minutes create\n[your community node](https://docs.n8n.io/integrations/community-nodes/usage/) for n8n!\n\nIt'll still require to create and publish `n8n-nodes-<yourproject>` npm package,\nbut you can use this package to generate most of the code.\n\n\n👉 We recommend using one of repo for the `n8n-nodes-<yourproject>` package:\n\n- https://github.com/AvantGuardLLC/n8n-nodes-petstore - Petstore example generated from OpenAPI v3 spec\n- https://github.com/n8n-io/n8n-nodes-starter - Official n8n nodes starter template\n\nFind more real-world examples in [Use Cases](#use-cases) section.\n\n![example](node.png)\n\n## Installation\n\nAdd `@AvantGuardLLC/n8n-openapi-node` as dependency\n\n```bash\nnpm install @AvantGuardLLC/n8n-openapi-node\n# OR\npnpm add @AvantGuardLLC/n8n-openapi-node\n# OR\nyarn add @AvantGuardLLC/n8n-openapi-node\n```\n\n\n## Usage\n\n1. Add your `openapi.json` to `src/{NodeName}` folder\n   (use **OpenAPI v3** and **json**, see [FAQ](#faq) if you don't have it)\n\n2. Get your `Node.properties` from OpenAPI v3 spec:\n\n```typescript\nimport {INodeType, INodeTypeDescription, NodeConnectionType} from 'n8n-workflow';\nimport {N8NPropertiesBuilder, N8NPropertiesBuilderConfig} from '@AvantGuardLLC/n8n-openapi-node';\nimport * as doc from './openapi.json'; // <=== Your OpenAPI v3 spec\n\nconst config: N8NPropertiesBuilderConfig = {}\nconst parser = new N8NPropertiesBuilder(doc, config);\nconst properties = parser.build()\n\nexport class Petstore implements INodeType {\n  description: INodeTypeDescription = {\n    displayName: 'Petstore',\n    name: 'petstore',\n    icon: 'file:petstore.svg',\n    group: ['transform'],\n    version: 1,\n    subtitle: '={{$parameter[\"operation\"] + \": \" + $parameter[\"resource\"]}}',\n    description: 'Interact with Petstore API',\n    defaults: {\n      name: 'Petstore',\n    },\n    inputs: [NodeConnectionType.Main],\n    outputs: [NodeConnectionType.Main],\n    credentials: [\n      {\n        name: 'petstoreApi',\n        required: false,\n      },\n    ],\n    requestDefaults: {\n      headers: {\n        Accept: 'application/json',\n        'Content-Type': 'application/json',\n      },\n      baseURL: '={{$credentials.url}}',\n    },\n    properties: properties, // <==== HERE\n  };\n}\n```\n\n# How it works\n\n`N8NPropertiesBuilder` extracts few entities from OpenAPI v3 to your n8n community node:\n\n1. **Resource** - a list of **Tags** from OpenAPI spec\n2. **Operation** - a list of **Operations** from OpenAPI spec (aka **Actions** in n8n)\n3. **Query Parameters** - a list of `operation.parameters` from OpenAPI spec\n4. **Request Body** - a list of `operation.requestBody.content` from OpenAPI spec (only for `application/json`)\n5. **Headers** - a list of `operation.parameters` from OpenAPI spec\n\n## Resource\n\nBy default, it get **Tags** from OpenAPI spec and converts them to **Resource** in n8n.\n\n## Operation\n\nBy default, it gets **Operations** from OpenAPI spec and converts them to **Actions** in n8n.\n\n## Query Parameters\n\nIt gets `operation.parameters` from OpenAPI spec and converts them to **Query Parameters** in n8n.\n\n## Request Body\n\nIt doesn't create the full structure of the request body, only the first level of properties.\nSo if you have request body as\n\n```json\n{\n  \"name\": \"string\",\n  \"config\": {\n    \"id\": 0,\n    \"name\": \"string\"\n  }\n}\n```\n\nit creates 2 fields in n8n:\n\n- `name` - with default value `string`\n- `config` - with default value `{\"id\": 0, \"name\": \"string\"}`\n\n## Headers\n\nIt gets `operation.parameters` from OpenAPI spec and converts them to **Headers** in n8n.\n\n# Customization\n\n## Resource\n\nYou can override the way how to extract **Resource** from **OpenAPI Tag** defining your custom `IResourceParser`:\n\n```typescript\nimport {IResourceParser} from '@AvantGuardLLC/n8n-openapi-node';\n\nexport class CustomResourceParser {\n  CUSTOM_DESCRIPTION = {\n    \"cats\": \"Cats are cute\",\n  }\n\n  name(tag: OpenAPIV3.TagObject): string {\n    // Your custom logic here\n    if (tag['X-Visible-Name']) {\n      return tag['X-Visible-Name'];\n    }\n    return lodash.startCase(tag.name);\n  }\n\n  value(tag: Pick<OpenAPIV3.TagObject, \"name\">): string {\n    // Remove all non-alphanumeric characters\n    const name = tag.name.replace(/[^a-zA-Z0-9_-]/g, '')\n    return lodash.startCase(name)\n  }\n\n  description(tag: OpenAPIV3.TagObject): string {\n    // Your custom logic here\n    return this.CUSTOM_DESCRIPTION[tag.name] || tag.description || '';\n  }\n}\n```\n\nAlternatively, you can use `DefaultResourceParser` and override only the methods you need.\nThe default implementation you can find in [src/ResourceParser.ts](src/ResourceParser.ts)\n\n```typescript\nimport {OpenAPIV3} from 'openapi-types';\nimport * as lodash from 'lodash';\nimport {DefaultResourceParser} from '@AvantGuardLLC/n8n-openapi-node';\n\nexport class CustomResourceParser extends DefaultResourceParser {\n  value(tag: OpenAPIV3.TagObject): string {\n    return lodash.startCase(tag.name.replace(/[^a-zA-Z0-9_-]/g, ''));\n  }\n}\n```\n\nThen you use it in `N8NPropertiesBuilder` in `config.resource`:\n\n```typescript\nimport {N8NPropertiesBuilder, N8NPropertiesBuilderConfig} from '@AvantGuardLLC/n8n-openapi-node';\nimport * as doc from './openapi.json';\n\nimport {CustomResourceParser} from './CustomResourceParser';\n\nconst config: N8NPropertiesBuilderConfig = {\n  resource: new CustomResourceParser()\n}\nconst parser = new N8NPropertiesBuilder(doc, config);\nconst properties = parser.build()\n```\n\nFind real example in [@AvantGuardLLC/n8n-nodes-waha](https://github.com/AvantGuardLLC/n8n-nodes-waha) repository.\n\n## Operation\n\nYou can override the way how to extract **Operation** from **OpenAPI Operation** defining your custom\n`IOperationParser`:\n\n```typescript\nimport {IOperationParser} from '@AvantGuardLLC/n8n-openapi-node';\n\nexport class CustomOperationParser implements IOperationParser {\n  shouldSkip(operation: OpenAPIV3.OperationObject, context: OperationContext): boolean {\n    // By default it skips operation.deprecated\n    // But we can include all operations\n    return false\n  }\n\n  name(operation: OpenAPIV3.OperationObject, context: OperationContext): string {\n    if (operation['X-Visible-Name']) {\n      return operation['X-Visible-Name'];\n    }\n    return lodash.startCase(operation.operationId)\n  }\n\n  value(operation: OpenAPIV3.OperationObject, context: OperationContext): string {\n    return lodash.startCase(operation.operationId)\n  }\n\n  action(operation: OpenAPIV3.OperationObject, context: OperationContext): string {\n    // How operation is displayed in n8n when you select your node (right form)\n    return operation.summary || this.name(operation, context)\n  }\n\n  description(operation: OpenAPIV3.OperationObject, context: OperationContext): string {\n    return operation.description || operation.summary || '';\n  }\n}\n```\n\nAlternatively, you can use `DefaultOperationParser` and override only the methods you need.\nThe default implementation you can find in [src/OperationParser.ts](src/OperationParser.ts)\n\n```typescript\nimport {DefaultOperationParser} from '@AvantGuardLLC/n8n-openapi-node';\n\nexport class CustomOperationParser extends DefaultOperationParser {\n  name(operation: OpenAPIV3.OperationObject, context: OperationContext): string {\n    // NestJS add operationId in format CatController_findOne\n    let operationId: string = operation.operationId!!.split('_').slice(1).join('_');\n    if (!operationId) {\n      operationId = operation.operationId as string;\n    }\n    return lodash.startCase(operationId);\n  }\n}\n```\n\nThen you use it in `N8NPropertiesBuilder` in `config.operation`:\n\n```typescript\nimport {N8NPropertiesBuilder, N8NPropertiesBuilderConfig} from '@AvantGuardLLC/n8n-openapi-node';\nimport * as doc from './openapi.json';\nimport {CustomOperationParser} from './CustomOperationParser';\n\nconst config: N8NPropertiesBuilderConfig = {\n  operation: new CustomOperationParser()\n}\nconst parser = new N8NPropertiesBuilder(doc, config);\nconst properties = parser.build()\n```\n\nFind real example in [@AvantGuardLLC/n8n-nodes-waha](https://github.com/AvantGuardLLC/n8n-nodes-waha) repository.\n\n## Fields\n\nYou can override some values for fields at the end, when full `properties` are ready.\n\nHere's example how you can override `session` field value (which has `'default'` string default value) to more n8n\nsuitable `=${$json.session}}`:\n\n```typescript\nimport {Override} from '@AvantGuardLLC/n8n-openapi-node';\n\nexport const customDefaults: Override[] = [\n  {\n    // Find field by fields matching\n    find: {\n      name: 'session',\n      required: true,\n      type: 'string',\n    },\n    // Replace 'default' field value\n    replace: {\n      default: '={{ $json.session }}',\n    },\n  },\n];\n```\n\nThen you use it in `N8NPropertiesBuilder`:\n\n```typescript\n\nimport {N8NPropertiesBuilder, N8NPropertiesBuilderConfig} from '@AvantGuardLLC/n8n-openapi-node';\nimport * as doc from './openapi.json';\nimport {customDefaults} from './customDefaults';\n\nconst parser = new N8NPropertiesBuilder(doc);\nconst properties = parser.build(customDefaults);\n```\n\nFind real example in [@AvantGuardLLC/n8n-nodes-waha](https://github.com/AvantGuardLLC/n8n-nodes-waha) repository.\n\n# Use Cases\n\nHere's n8n community nodes generated from OpenAPI specifications you can use for reference:\n\n- [@AvantGuardLLC/n8n-nodes-petstore](https://github.com/AvantGuardLLC/n8n-nodes-petstore) - Petstore example generated from\n  [Petstore openapi.json](https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore.yaml)\n- [@AvantGuardLLC/n8n-nodes-chatwoot](https://github.com/AvantGuardLLC/n8n-nodes-chatwoot) - ChatWoot n8n community node\n  from\n  [https://www.chatwoot.com/developers/api/](https://www.chatwoot.com/developers/api/). Defines credentials as well (\n  manually)\n- [@AvantGuardLLC/n8n-nodes-waha](https://github.com/AvantGuardLLC/n8n-nodes-waha) - **WAHA** - Self-hosted **WhatsApp HTTP\n  API** you can run in a click!\n\n# FAQ\n\n## I have only OpenAPI v2 spec, what can I do?\n\nPaste your OpenAPI 2.0 definition into https://editor.swagger.io and select **Edit > Convert to OpenAPI 3** from the\nmenu.\n\nhttps://stackoverflow.com/a/59749691\n\n## I have openapi.yaml spec, what can I do?\n\nPaste your yaml spec to https://editor.swagger.io and select **File > Save as JSON** from the menu.\n\n## How to set up credentials from OpenAPI v3 spec?\n\nRight now you need to define it manually.\nCheck [ChatWoot node](https://github.com/AvantGuardLLC/n8n-nodes-chatwoot)\nfor an example.\n\n## Why it doesn't work with my OpenAPI spec?\n\nOpen [a new issue](https://github.com/AvantGuardLLC/n8n-openapi-node/issues) and please attach\nyour openapi.json file and describe the problem (logs are helpful too).\n\n# Support the project\n\nYou can support the project by donating a small amount to help us improve the project even more.\n\n- [https://patreon.com/AvantGuardLLC](https://patreon.com/AvantGuardLLC)\n","readmeFilename":"README.md"}