{"_id":"@dawsonjdv/elysia-trpc","_rev":"4-bd35d81954dc024102feaf8a507a3d23","name":"@dawsonjdv/elysia-trpc","dist-tags":{"latest":"1.1.7"},"versions":{"1.1.0":{"name":"@dawsonjdv/elysia-trpc","version":"1.1.0","keywords":["elysia","trpc"],"author":{"url":"https://github.com/SaltyAom","name":"saltyAom","email":"saltyaom@gmail.com"},"license":"MIT","_id":"@dawsonjdv/elysia-trpc@1.1.0","maintainers":[{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"}],"homepage":"https://github.com/elysiajs/elysia-trpc","bugs":{"url":"https://github.com/elysiajs/elysia-trpc/issues"},"dist":{"shasum":"9757444c5043b47338b632f0583b902229046c6d","tarball":"https://registry.npmjs.org/@dawsonjdv/elysia-trpc/-/elysia-trpc-1.1.0.tgz","fileCount":15,"integrity":"sha512-cxdl1YEhcmyu3pQE3APAc4BncOzbqXC5MH+1euskiV/TuJKhBqE/RSxsIut7kA8BuR+hsreL5nC8H/llEwgMWg==","signatures":[{"sig":"MEYCIQCUJJN4B1jsbW234roDPOyHjbJ05JlYMLzF0LJ//Jm6VgIhAJogWFSKmDy6lBXYNp3vlntQryWO4ccjwBI8QgTQNfCU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":182311},"main":"./dist/cjs/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/cjs/index.js"},"./package.json":"./package.json"},"gitHead":"7ba89b1ba082bc2e0d24db542ec2dcfc6b72a958","scripts":{"dev":"bun run --hot example/index.ts","test":"bun test && npm run test:node","build":"bun build.ts","release":"npm run build && npm run test && npm publish --access public","test:node":"npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js"},"_npmUser":{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"},"repository":{"url":"git+https://github.com/elysiajs/elysia-trpc.git","type":"git"},"_npmVersion":"9.6.7","description":"A plugin for Elysia that add support for using tRPC","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","elysia":">= 1.1.0-rc.2","eslint":"9.6.0","@types/ws":"^8.5.4","@types/bun":"1.1.6","typescript":"^5.5.3","@trpc/client":"^11.0.0-rc.477","@trpc/server":"^11.0.0-rc.477"},"peerDependencies":{"elysia":">= 1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/elysia-trpc_1.1.0_1723029121435_0.9303802887402228","host":"s3://npm-registry-packages"}},"1.1.4":{"name":"@dawsonjdv/elysia-trpc","version":"1.1.4","keywords":["elysia","trpc","openapi"],"license":"MIT","_id":"@dawsonjdv/elysia-trpc@1.1.4","maintainers":[{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"}],"contributors":[{"url":"https://github.com/SaltyAom","name":"saltyAom","email":"saltyaom@gmail.com"},{"url":"https://github.com/lobomfz","name":"lobomfz","email":"lobomfz@protonmail.com"}],"homepage":"https://github.com/lobomfz/elysia-trpc","bugs":{"url":"https://github.com/lobomfz/elysia-trpc/issues"},"dist":{"shasum":"50ca0ef2358b928992a18cd8eba1336f8af3f97f","tarball":"https://registry.npmjs.org/@dawsonjdv/elysia-trpc/-/elysia-trpc-1.1.4.tgz","fileCount":16,"integrity":"sha512-7mBgqTvvc/p4MTp7EnXkpdk9o4c4P7OoQrAisBIOVP3GHtysU84DjzQd/skSs0IVonpo1+09epSiUt3kn2g52A==","signatures":[{"sig":"MEUCIHuhYgNAVtjVZA9/eSVy3oDHn6jRpx/yQyX88zaV7hKlAiEAzmNBxxgfnkbwjLX5TKxTWY72iQYBEtHlmUXs+Lht+8E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42594},"main":"./dist/index.js","types":"./src/index.ts","exports":{"bun":"./dist/index.js","node":"./dist/cjs/index.js","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/cjs/index.js"},"gitHead":"8521cdc7f04293fd4bc2eb65a48f06e5c1cc8393","scripts":{"dev":"bun run --hot example/index.ts","test":"bun test && npm run test:node","release":"bunx tsc && npm publish --access public","prettier":"bun x prettier . --write","test:node":"npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js"},"_npmUser":{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"},"repository":{"url":"git+https://github.com/lobomfz/elysia-trpc.git","type":"git"},"_npmVersion":"9.6.7","description":"A plugin for Elysia that add support for using tRPC and OpenAPI","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.40.0","rimraf":"4.4.1","@types/ws":"^8.5.4","@types/bun":"^1.0.10","@types/node":"^20.1.4","@sinclair/typebox":"^0.32.35","@lobomfz/trpc-docgen":"^1.1.0"},"peerDependencies":{"elysia":"^1.1.5","@trpc/server":"^11.0.0-rc.477"},"_npmOperationalInternal":{"tmp":"tmp/elysia-trpc_1.1.4_1723029701759_0.023358749199705597","host":"s3://npm-registry-packages"}},"1.1.5":{"name":"@dawsonjdv/elysia-trpc","version":"1.1.5","keywords":["elysia","trpc","openapi"],"license":"MIT","_id":"@dawsonjdv/elysia-trpc@1.1.5","maintainers":[{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"}],"contributors":[{"url":"https://github.com/SaltyAom","name":"saltyAom","email":"saltyaom@gmail.com"},{"url":"https://github.com/lobomfz","name":"lobomfz","email":"lobomfz@protonmail.com"}],"homepage":"https://github.com/lobomfz/elysia-trpc","bugs":{"url":"https://github.com/lobomfz/elysia-trpc/issues"},"dist":{"shasum":"488e0ff246baed78815428d474e1cea635c1f654","tarball":"https://registry.npmjs.org/@dawsonjdv/elysia-trpc/-/elysia-trpc-1.1.5.tgz","fileCount":16,"integrity":"sha512-1YJcXqpzp9Awv5q94RqpHIi6X9T91uaiJMa0ZIXBJxWXRJntNJmdLmCLaiCPI4zEvo/nloopqv14U1HaDbz9sA==","signatures":[{"sig":"MEYCIQD/cdhhSUHAMcZDi3V1BsT2zT/tlAr5o4veCynikU4f0AIhALrFB5nrnu05S5+0FzBgQaTA7vP60ZFVpvEc8H4waEcn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42598},"main":"./dist/index.js","types":"./src/index.ts","exports":{"bun":"./dist/index.js","node":"./dist/cjs/index.js","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/cjs/index.js"},"gitHead":"8521cdc7f04293fd4bc2eb65a48f06e5c1cc8393","scripts":{"dev":"bun run --hot example/index.ts","test":"bun test && npm run test:node","release":"bunx tsc && npm publish --access public","prettier":"bun x prettier . --write","test:node":"npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js"},"_npmUser":{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"},"repository":{"url":"git+https://github.com/lobomfz/elysia-trpc.git","type":"git"},"_npmVersion":"9.6.7","description":"A plugin for Elysia that add support for using tRPC and OpenAPI","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.40.0","rimraf":"4.4.1","@types/ws":"^8.5.4","@types/bun":"^1.0.10","@types/node":"^20.1.4","@sinclair/typebox":"^0.32.35","@lobomfz/trpc-docgen":"^1.1.0"},"peerDependencies":{"elysia":"^1.1.5","@trpc/server":"^11.0.0-rc.477"},"_npmOperationalInternal":{"tmp":"tmp/elysia-trpc_1.1.5_1723127156337_0.9775609908912886","host":"s3://npm-registry-packages"}},"1.1.6":{"name":"@dawsonjdv/elysia-trpc","version":"1.1.6","keywords":["elysia","trpc","openapi"],"license":"MIT","_id":"@dawsonjdv/elysia-trpc@1.1.6","maintainers":[{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"}],"contributors":[{"url":"https://github.com/SaltyAom","name":"saltyAom","email":"saltyaom@gmail.com"},{"url":"https://github.com/lobomfz","name":"lobomfz","email":"lobomfz@protonmail.com"}],"homepage":"https://github.com/lobomfz/elysia-trpc","bugs":{"url":"https://github.com/lobomfz/elysia-trpc/issues"},"dist":{"shasum":"b515c2499f477c1989f2e1e6851b821c45b2820b","tarball":"https://registry.npmjs.org/@dawsonjdv/elysia-trpc/-/elysia-trpc-1.1.6.tgz","fileCount":16,"integrity":"sha512-Z4bUfdwwFAT+c3HMYNthxYmfW+yf2lsismOkb7uJFqSBQYra+43s46X1FNw8r4vz9DGjQ7c9pc+FikRcqiKbXA==","signatures":[{"sig":"MEUCIQDg28AFpk9LyzH036bN6t1GgivLRboMh77N+FQojQaijQIgFrZsj1jR0nCwPuivSFYs5G7UgD9aWP7pmVdSybBcNDc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42614},"main":"./dist/index.js","types":"./src/index.ts","exports":{"bun":"./dist/index.js","node":"./dist/cjs/index.js","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/cjs/index.js"},"gitHead":"8521cdc7f04293fd4bc2eb65a48f06e5c1cc8393","scripts":{"dev":"bun run --hot example/index.ts","test":"bun test && npm run test:node","release":"bunx tsc && npm publish --access public","prettier":"bun x prettier . --write","test:node":"npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js"},"_npmUser":{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"},"repository":{"url":"git+https://github.com/lobomfz/elysia-trpc.git","type":"git"},"_npmVersion":"9.6.7","description":"A plugin for Elysia that add support for using tRPC and OpenAPI","directories":{},"_nodeVersion":"18.17.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.40.0","rimraf":"4.4.1","@types/ws":"^8.5.4","@types/bun":"^1.0.10","@types/node":"^20.1.4","@sinclair/typebox":"^0.32.35","@lobomfz/trpc-docgen":"^1.1.0"},"peerDependencies":{"elysia":"^1.1.5","@trpc/server":"^11.0.0-rc.477"},"_npmOperationalInternal":{"tmp":"tmp/elysia-trpc_1.1.6_1723127271732_0.1742692171019795","host":"s3://npm-registry-packages"}},"1.1.7":{"name":"@dawsonjdv/elysia-trpc","version":"1.1.7","description":"A plugin for Elysia that add support for using tRPC and OpenAPI","contributors":[{"name":"saltyAom","email":"saltyaom@gmail.com","url":"https://github.com/SaltyAom"},{"name":"lobomfz","email":"lobomfz@protonmail.com","url":"https://github.com/lobomfz"}],"repository":{"type":"git","url":"git+https://github.com/lobomfz/elysia-trpc.git"},"main":"./dist/index.js","exports":{"bun":"./dist/index.js","node":"./dist/cjs/index.js","require":"./dist/cjs/index.js","import":"./dist/index.js","default":"./dist/index.js"},"types":"./src/index.ts","bugs":{"url":"https://github.com/lobomfz/elysia-trpc/issues"},"homepage":"https://github.com/lobomfz/elysia-trpc","keywords":["elysia","trpc","openapi"],"license":"MIT","scripts":{"dev":"bun run --hot example/index.ts","test":"bun test && npm run test:node","test:node":"npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js","release":"bunx tsc && npm publish --access public","prettier":"bun x prettier . --write"},"devDependencies":{"@lobomfz/trpc-docgen":"^1.1.0","@types/bun":"^1.0.10","@types/node":"^20.1.4","@types/ws":"^8.5.4","eslint":"^8.40.0","rimraf":"4.4.1","@sinclair/typebox":"^0.32.35"},"peerDependencies":{"@trpc/server":"^11.0.0-rc.477","elysia":"^1.1.5"},"gitHead":"8521cdc7f04293fd4bc2eb65a48f06e5c1cc8393","_id":"@dawsonjdv/elysia-trpc@1.1.7","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-22ITkBI3n0qIV37oYIlAnW3n6BZRbLokk1HRD1uOz1512w9KCjRCxCaEybjBMTdI5RSs0g2hqUsBlLamJucK2A==","shasum":"94e22b9822443b5684d39a9fac7d7f0539aed710","tarball":"https://registry.npmjs.org/@dawsonjdv/elysia-trpc/-/elysia-trpc-1.1.7.tgz","fileCount":16,"unpackedSize":43239,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/b98LGvrtrYl5EKm3Y2YCjQtiFJ0eV3IJZzpC1/vNiQIgIaOIZEZPTmakgoJvu7wsWLvXUmXuBKOQDCBzMypohi4="}]},"_npmUser":{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"},"directories":{},"maintainers":[{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elysia-trpc_1.1.7_1723127502852_0.835679501938017"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-07T11:12:01.319Z","modified":"2024-08-08T14:31:43.167Z","1.1.0":"2024-08-07T11:12:01.644Z","1.1.4":"2024-08-07T11:21:41.948Z","1.1.5":"2024-08-08T14:25:56.520Z","1.1.6":"2024-08-08T14:27:51.948Z","1.1.7":"2024-08-08T14:31:43.003Z"},"bugs":{"url":"https://github.com/lobomfz/elysia-trpc/issues"},"license":"MIT","homepage":"https://github.com/lobomfz/elysia-trpc","keywords":["elysia","trpc","openapi"],"repository":{"type":"git","url":"git+https://github.com/lobomfz/elysia-trpc.git"},"description":"A plugin for Elysia that add support for using tRPC and OpenAPI","contributors":[{"name":"saltyAom","email":"saltyaom@gmail.com","url":"https://github.com/SaltyAom"},{"name":"lobomfz","email":"lobomfz@protonmail.com","url":"https://github.com/lobomfz"}],"maintainers":[{"name":"dawsonjdv04","email":"dawsondellavalle@gmail.com"}],"readme":"# @lobomfz/elysia-trpc\n\nA plugin for [elysia](https://github.com/elysiajs/elysia) that adds support for using tRPC, integrated with [trpc-docgen](https://github.com/lobomfz/trpc-docgen).\n\n## Notes:\n- The OpenAPI router removes tRPC's weird body input, so it accepts exactly what the procedure schema expects. \n- This requires a patched version of tRPC, see [this PR](https://github.com/trpc/trpc/pull/5909).\n\n\n## Installation\n\n```bash\nbun add @lobomfz/elysia-trpc\n```\n\n## Example\n\n```typescript\nimport { initTRPC } from \"@trpc/server\";\nimport { generateTrpcDocs, type OpenApiMeta } from \"@lobomfz/trpc-docgen\";\nimport { Type } from \"@sinclair/typebox\";\nimport Elysia from \"elysia\";\nimport { trpc } from \"../src\";\n\n// this meta optional, but highly recommended\nconst t = initTRPC.meta<OpenApiMeta>().create();\n\nconst router = t.router;\n\nconst appRouter = router({\n\tcreateDate: t.procedure\n\t\t.input(\n\t\t\tType.Object({\n\t\t\t\tdate: Type.String(),\n\t\t\t}),\n\t\t)\n\t\t.mutation(({ input }) => ({\n\t\t\tdate: input.date,\n\t\t})),\n});\n\n```\n## You can integrate with [trpc-docgen](https://github.com/lobomfz/trpc-docgen) to serve your restful OpenAPI router\n\n```ts\nconst { mappings } = await generateTrpcDocs(appRouter, {\n\tbaseUrl: \"http://localhost:3000\",\n\ttitle: \"My API\",\n\tversion: \"1.0.0\",\n});\n\nnew Elysia()\n\t.use(\n\t\ttrpc(appRouter, {\n\t\t\tendpoint: \"/trpc\",\n\t\t}),\n\t)\n\t.use(\n\t\ttrpc(appRouter, {\n\t\t\tendpoint: \"/openapi\",\n\t\t\topenApi: {\n\t\t\t\t// in this example, createDate will be mapped to a POST /trpc/date\n\t\t\t\tmappings,\n\t\t\t\ttrpcEndpoint: \"/trpc\",\n\t\t\t},\n\t\t}),\n\t).listen(3000);\n```\n\n","readmeFilename":"README.md"}