{"_id":"@adhd/apigen-plugin-api-fastify","_rev":"13-92cfbc174dc64d70c12c4419cd69d3a8","name":"@adhd/apigen-plugin-api-fastify","dist-tags":{"latest":"0.2.3"},"versions":{"0.1.0":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.1.0","_id":"@adhd/apigen-plugin-api-fastify@0.1.0","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"a05a9599c4dcaf0206f1e0c81312668bf547f151","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.1.0.tgz","fileCount":9,"integrity":"sha512-JSymhWDc7UeWzViy/Oo0g/GzL+EmzJ81vsK0q3aIDF4XVe5ua4YnVJBsNgvzu7DXX3mHaK+qv2GrQehHIGZNVQ==","signatures":[{"sig":"MEUCIAJWHOewh+ve4L9h0TPr4vLsQMNgEfVd5YcQVcvpS6ArAiEAwL2JeXhzkt7yLo1XJefZhpsoI53LsYu0sEyGBTX0ebQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26003291},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"70af56163bc48ddfa898e1202c9bd768e7372a33","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"apigen target plugin (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. One `POST /<namespace>/<fn>` route per export. Generates `routes.ts` to disk *and* runs a live server.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-core":"^0.1.0","@adhd/apigen-runtime":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.1.0_1782256655274_0.89530383020065","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.1.1","_id":"@adhd/apigen-plugin-api-fastify@0.1.1","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"6277676dd6e44a2dd52c3dba462a098c2b063c6c","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.1.1.tgz","fileCount":9,"integrity":"sha512-A/I7ykDSXRY0WKj3fZrUYL0j4AwxSTfKJSA1uJsgBf3mabipj69tAIu3kqw2PdHxji/x0oNAU6N8bnPV7b+CcA==","signatures":[{"sig":"MEUCIGAegclGaIMxrLEf4RUjArHyetMZt+6Vxw2mJaQB7IELAiEA/R65HUEqaXUaNKCylBgpNXxVb5nHbF2eQ+9meSIhifc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60596},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"36e7fe6e3b1dd5a9356fb1dab93d9eb1746df8b0","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"apigen target plugin (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. One `POST /<namespace>/<fn>` route per export. Generates `routes.ts` to disk _and_ runs a live server.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.1.1","@adhd/apigen-core-client":"^0.1.0","@adhd/apigen-engine-naming":"^0.1.1","@adhd/apigen-engine-runtime":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.1.1_1784686916777_0.7123059770834195","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.1.2","_id":"@adhd/apigen-plugin-api-fastify@0.1.2","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"f4c3bb41a9338171e5409be9751ebb55f158c3c3","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.1.2.tgz","fileCount":10,"integrity":"sha512-+Z9u2zcT/jNbqHO3Ou+EZWgJdBQvw//M7dNqeXjoJy1ymLGQbCqLHeUP38v6hbeKboLTs2PkOpzWBDWBum8aHw==","signatures":[{"sig":"MEUCICiIyMske6QuFD8BTategi3nukphAa8xBumlP9wssG/LAiEAm2FjQSdcoN2/sNcb6g4//vnxiHszpsQb6k9UaUSzeHY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66480},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"afca4fc9097845a32a9e371ce6cd1252cbc0be6b","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.1.2","@adhd/apigen-core-client":"^0.1.1","@adhd/apigen-engine-naming":"^0.1.2","@adhd/apigen-engine-runtime":"^0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.1.2_1784773923769_0.7914943724223038","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.1.3","_id":"@adhd/apigen-plugin-api-fastify@0.1.3","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"7a1875c7cdbe1a3ec6d5b420839466f5cbefb4e7","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.1.3.tgz","fileCount":11,"integrity":"sha512-IerRO/10+UfwI7jl+dtsKv6MJ7/EmL4Huf2jEpYKuOJsth89JqoMaZT22dItVSF/qMf9hpM55dLWdndUE32ZzQ==","signatures":[{"sig":"MEUCICcny5pGgDfidcaHuIC3njKfGSwBk8KoV0up5GuX3fM2AiEA39niKIyFjxKhznvu2OOjXH800xo3X9Ff3r06/FyYlR8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76253},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"eb0fd170825539850ae91a64393f8a8f376d8c7b","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.1.3","@adhd/apigen-core-client":"^0.1.2","@adhd/apigen-engine-naming":"^0.1.3","@adhd/apigen-engine-runtime":"^0.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.1.3_1784831131640_0.7267526428828668","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.1.4","_id":"@adhd/apigen-plugin-api-fastify@0.1.4","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"b1be26688e392ec8b7d478701392908af57f2fb6","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.1.4.tgz","fileCount":11,"integrity":"sha512-TRTDSdzI66oTfvwf3Gk6q1kC2Xj9aawuAq+rB5oV98obx4R02uVgHP85F0UemEfJWNPFXgG+0N+4x/eETj6Meg==","signatures":[{"sig":"MEUCIA9WJYbZaFQd1t3TM8HhhIWGYFjPfCL6vDOjbnFndoM8AiEAnZRM8UJXf+isjIEQI+jTuN3dnY1w9ogrO5wZP73vX20=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83988},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"60d30f61a52a3cb55285346e534382df02258264","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.1.4","@adhd/apigen-core-client":"^0.1.3","@adhd/apigen-engine-naming":"^0.1.4","@adhd/apigen-engine-runtime":"^0.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.1.4_1784934773752_0.4399167415183738","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.1.5","_id":"@adhd/apigen-plugin-api-fastify@0.1.5","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"5df225074a6510a989e40066e18c07b4edac23b4","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.1.5.tgz","fileCount":11,"integrity":"sha512-FrRpYWIrq0y5nQbA+FdHFpLTiRRwwrpSCY/0ISpvWManxCbcoFrRGudVe0uV070a9ZeDW3W6upr4qO4fp/bmuw==","signatures":[{"sig":"MEYCIQC68MMyTeiuIlC/hoUul/lqtM/oe2L6gGqK80bEYYDDuQIhAI45vQ5CEDg2kdDeRrOKp072KBz5vMCYS1LI681X969c","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83988},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"4a55390e41abde59d4b6c1f420851503ff727386","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.1.5","@adhd/apigen-core-client":"^0.1.4","@adhd/apigen-engine-naming":"^0.1.4","@adhd/apigen-engine-runtime":"^0.1.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.1.5_1784937252554_0.7829746199677998","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.1.6","_id":"@adhd/apigen-plugin-api-fastify@0.1.6","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"02456fd2d44a53a809ed934c58c3c54321dee0ed","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.1.6.tgz","fileCount":11,"integrity":"sha512-9YR8GYGxM1nNbd4OrFpkTPBdu2pf4h6NIP9uZJ/uDGWuTAY585MiuHNNZoYBJjB4ARdROUkPRSLOSsWPhVeG/Q==","signatures":[{"sig":"MEUCIQCAJGtKpB4bltZTF7MIlPdahBdKPO3g34rI4692B5ETIAIgZP/yYIVaQr4p4hW3E4cGhclO/yQ3zkrpz78GO5BZHtw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85227},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"936d50dc3a4c827b29a00dcd8686ba968775cd06","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.1.6","@adhd/apigen-core-client":"^0.1.5","@adhd/apigen-engine-naming":"^0.1.4","@adhd/apigen-engine-runtime":"^0.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.1.6_1784948664921_0.7113292792026391","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.2.0","_id":"@adhd/apigen-plugin-api-fastify@0.2.0","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"82286c16c6585826dd12344556bc19e2c1d21fc1","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.2.0.tgz","fileCount":11,"integrity":"sha512-lhRzWPu6zq21TzZ4jZlHf5NsnO6m4nwiBqGp4o9P7yaULlhEOsOwAZMKSkSZzkbZ3FepuXDQztkH9cFEv1Y1rQ==","signatures":[{"sig":"MEUCIQCBKcQiXgd+2Syox6rQ4kl1qscA/Ze/ZOmIcJZgGZLchAIgMqDfkB7LuNXYtevl9y5MiMxNr5a4hEznF9YxxAHcHRY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85227},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"1dbc0638f8eb1b7c961bc9359def6f4425da5c15","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.2.0","@adhd/apigen-core-client":"^0.2.0","@adhd/apigen-engine-naming":"^0.2.0","@adhd/apigen-engine-runtime":"^0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.2.0_1785136538827_0.13863850744045947","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.2.1","_id":"@adhd/apigen-plugin-api-fastify@0.2.1","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"4c64da431b6cae0e059381c04a1d6c84569e54b3","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.2.1.tgz","fileCount":11,"integrity":"sha512-jsP+T65lvnJ8ERarH6d78YRhsowdwA3Q3gYRGgh4Go427oNuSWqDler3HMAkoiyfHw0xA9hur6VuhdqeyB1zKg==","signatures":[{"sig":"MEYCIQDCZnI+f9A0e9uvUxScMYcibpnhG/YIUZyC6gEEuSbOYwIhANpU5Qq90bW7OG8Lvoo5uo6zOtnDcY9goriFns+zjMi5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86220},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"ecb6695cd4d5b19b334cd27975ad61f1a100fb25","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.2.0","@adhd/apigen-core-client":"^0.2.1","@adhd/apigen-engine-naming":"^0.2.1","@adhd/apigen-engine-runtime":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.2.1_1785204980769_0.9267804880456669","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.2.2","_id":"@adhd/apigen-plugin-api-fastify@0.2.2","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"6010f280058a4f830005d88febf75370701b8fca","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.2.2.tgz","fileCount":11,"integrity":"sha512-kwjDCmvwRpxMM3/jyZfpTuSGpE3zIsKZQwOwmxQrcDFI2UNt8Mgx3Y5I6g1xUHBEbbqp0QjKady9KyrCqKzzxg==","signatures":[{"sig":"MEUCIBRScDM6/Cm6L97pA2dRxT3B2jWo/VGcTZlUVAbzsaMKAiEAvonVVZA+Z9OrETfbs8XE0Ig2hqP4ZQuzKbupfT9lINM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86909},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","gitHead":"35ecbc8a788f13903c5e421e4c511010ed24b11f","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","directories":{},"_nodeVersion":"24.11.1","dependencies":{"fastify":"^4.0.0","@adhd/apigen-base-errors":"^0.2.0","@adhd/apigen-core-client":"^0.2.2","@adhd/apigen-engine-naming":"^0.2.1","@adhd/apigen-engine-runtime":"^0.2.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/apigen-plugin-api-fastify_0.2.2_1785433194880_0.8827273085810088","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@adhd/apigen-plugin-api-fastify","version":"0.2.3","main":"./index.js","dependencies":{"fastify":"^4.0.0","@adhd/apigen-core-client":"^0.3.0","@adhd/apigen-base-errors":"^0.2.0","@adhd/apigen-engine-runtime":"^0.2.3","@adhd/apigen-engine-naming":"^0.2.2"},"publishConfig":{"access":"public"},"module":"./index.mjs","types":"./index.d.ts","gitHead":"7edc5d58575a24fb9695bb3474d3e169f20eac58","_id":"@adhd/apigen-plugin-api-fastify@0.2.3","description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-AnX0ytyAjKgHt2IgL3HhALfIMsdOz+phaPQaIQQeZ9bB96ruz32rqqH+O9iKJPqbkHkODRoPvTtLlmj+V3msPg==","shasum":"29d1d3cedfefd197a7efd3dda8f5f2f0af0a2959","tarball":"https://registry.npmjs.org/@adhd/apigen-plugin-api-fastify/-/apigen-plugin-api-fastify-0.2.3.tgz","fileCount":11,"unpackedSize":91951,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDnKswJ2BJD+e3EbWxRb7JLnhaKNLa54mzI8F7FEXaU9AIhAO5jQrsFbLXOscZpBQS1PvGHWmnD/65unR8vE6/QR8Qg"}]},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"directories":{},"maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/apigen-plugin-api-fastify_0.2.3_1786144616991_0.13568472757870964"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T22:40:27.868Z","modified":"2026-08-07T23:16:57.348Z","0.0.1":"2026-06-23T22:40:28.184Z","0.1.0":"2026-06-23T23:17:35.590Z","0.1.1":"2026-07-22T02:21:56.917Z","0.1.2":"2026-07-23T02:32:03.906Z","0.1.3":"2026-07-23T18:25:31.806Z","0.1.4":"2026-07-24T23:12:53.942Z","0.1.5":"2026-07-24T23:54:12.798Z","0.1.6":"2026-07-25T03:04:25.064Z","0.2.0":"2026-07-27T07:15:38.980Z","0.2.1":"2026-07-28T02:16:20.916Z","0.2.2":"2026-07-30T17:39:55.053Z","0.2.3":"2026-08-07T23:16:57.161Z"},"description":"**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"readme":"# @adhd/apigen-plugin-api-fastify\n\n**Target plugin** (`--type api-fastify`) — exposes a source file's exports as a **Fastify HTTP API**. Every exported function becomes an HTTP route with inferred JSON Schema for validation. Supports both live (`run`) and code generation (`generate`) modes.\n\nPart of [apigen](../README.md). Driven via [`@adhd/apigen-cli`](../../../entrypoint/apigen-cli/README.md).\n\n---\n\n## How it works\n\nEvery exported function becomes an HTTP route:\n\n```ts\n// api.ts\nexport async function getUser(id: string): Promise<{ id: string; name: string }> {\n  return { id, name: `User ${id}` };\n}\n\nexport async function createUser(name: string): Promise<{ id: string }> {\n  return { id: Math.random().toString(36).slice(2) };\n}\n```\n\nBecomes two routes:\n\n| Operation | Route | Method | How to call |\n|---|---|---|---|\n| Safe (primitives only) | `GET /<namespace>/<fn>?param=val` | GET | Query params |\n| Unsafe (complex params) | `POST /<namespace>/<fn>` | POST | `{\"data\":{…}}` body |\n\n---\n\n## CLI usage\n\n```bash\n# Run a live server\nnpx @adhd/apigen-cli run --source api.ts --type api-fastify --namespace api --opt port=3000\n\n# With OpenAPI doc + health check + logging\nnpx @adhd/apigen-cli run --source api.ts --type api-fastify --opt port=3000 \\\n  --use openapi --use health --use logger\n\n# Custom route prefix\nnpx @adhd/apigen-cli run --source api.ts --type api-fastify --opt routePrefix=/v1\n\n# Generate a deployable project to disk\nnpx @adhd/apigen-cli generate --source api.ts --type api-fastify --out-dir ./out\n```\n\n### Calling the server\n\n```bash\n# Safe operation → GET with query params\ncurl http://localhost:3000/api/getUser?id=abc\n\n# Unsafe operation → POST with body envelope\ncurl -X POST http://localhost:3000/api/createUser \\\n  -H 'content-type: application/json' \\\n  -d '{\"data\":{\"name\":\"Ada\"}}'\n# → {\"result\":{\"id\":\"...\"}}\n```\n\n---\n\n## Programmatic usage\n\n```ts\nimport { extract, composeSchemas } from '@adhd/apigen-core-client';\nimport { apiFastifyPlugin } from '@adhd/apigen-plugin-api-fastify';\nimport { openapiPlugin } from '@adhd/apigen-plugin-openapi';\nimport { healthPlugin } from '@adhd/apigen-plugin-health';\n\nasync function start() {\n  const ops = await extract({ sourceFile: './api.ts', namespace: 'api' });\n  const generated = {\n    metadata: { namespace: 'api', phase: '' },\n    schemas: Object.fromEntries(\n      ops.filter(o => o.kind === 'action').map(op => [\n        op.path[op.path.length - 1].raw,\n        { input: op.input, output: op.output, hasCtx: op.hasCtx, 'x-apigen-safe': op.safe },\n      ])\n    ),\n  };\n  const schemas = composeSchemas(generated, []);\n  const mod = await import('./api.ts');\n\n  const abort = new AbortController();\n  process.on('SIGINT', () => abort.abort());\n\n  await apiFastifyPlugin.run({\n    packages: [{\n      id: 'api',\n      schemas,\n      importPath: './api.ts',\n      fns: mod,\n      createClient: async () => ({}),\n    }],\n    outputDir: '',\n    options: {\n      port: 3000,\n      host: '0.0.0.0',\n      routePrefix: '',\n      usePlugins: [openapiPlugin, healthPlugin],\n      useOptions: {\n        openapi: { title: 'User API', version: '1.0.0' },\n      },\n    },\n    signal: abort.signal,\n    operations: ops,\n  });\n}\n```\n\n---\n\n## Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `port` | `number` | `3000` | Listen port |\n| `host` | `string` | `'127.0.0.1'` | Bind address |\n| `routePrefix` | `string` | `''` | Path prefix before `/<namespace>/<fn>` |\n| `usePlugins` | `Plugin[]` | `[]` | Mount/layer/envelope plugins |\n| `useOptions` | `Record<string, Record<string, unknown>>` | `{}` | Per-plugin options, keyed by plugin id |\n| `projection` | `ProjectionConfig` | `{}` | HTTP verb and naming overrides |\n\n---\n\n## Route mapping\n\nThe Fastify server registers routes following this pattern:\n\n| Source export | Route | Method | Request format |\n|---|---|---|---|\n| Safe function | `GET /<ns>/<fn>?param=val` | GET | Query string params |\n| Unsafe function | `POST /<ns>/<fn>` | POST | `{\"data\":{…}}` body |\n| Mount plugin contribution | `GET /_meta/<name>` | GET | — |\n\n**Safe vs unsafe** is determined automatically:\n\n```ts\n// Safe → GET /api/searchUsers?q=ada&limit=10\nexport async function searchUsers(q: string, limit?: number) { ... }\n\n// Unsafe → POST /api/createUser (body: {\"data\":{\"name\":\"Ada\"}})\nexport async function createUser(name: string) { ... }\n```\n\nSee the [Writing Source Files guide](../apigen-core-client/docs/how-to/writing-source-files.md#safe-vs-unsafe--get-vs-post) for details.\n\n---\n\n## Error handling\n\nErrors are returned as JSON with an `ApiError` shape:\n\n```json\n// 400 — invalid argument\n{\"code\":\"invalid_argument\",\"message\":\"Expected string, got number\"}\n\n// 404 — not found\n{\"code\":\"not_found\",\"message\":\"User not found\"}\n\n// 500 — internal error\n{\"code\":\"internal\",\"message\":\"Something went wrong\"}\n```\n\n---\n\n## Multi-package (multi-namespace)\n\nPass multiple source files — each becomes a separate route prefix:\n\n```bash\nnpx @adhd/apigen-cli run --source users.ts --source orders.ts --type api-fastify --opt port=3000\n```\n\n```\nPOST /users/createUser\nPOST /orders/createOrder\nGET  /users/getUser?id=abc\nGET  /orders/getOrder?id=xyz\n```\n\n---\n\n## Exports\n\n| Export | Kind |\n|--------|------|\n| `apiFastifyPlugin` | v1 `OutputPlugin` — `generate()` + `run()` |\n| `default` | Same as `apiFastifyPlugin` |\n| `generate(input)` | Raw generate function |\n| `run(input)` | Raw run function |\n| `sendStreamSse(…)` | SSE stream utility |\n\n```ts\nimport { apiFastifyPlugin, run, generate } from '@adhd/apigen-plugin-api-fastify';\n```\n","readmeFilename":"README.md"}