@trpc/server 11.0.0-next.92 → 11.0.0-rc.329
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.
- package/README.md +6 -6
- package/adapters/next-app-dir/index.d.ts +1 -0
- package/adapters/next-app-dir/index.js +1 -0
- package/dist/@trpc/server/http.d.ts +8 -0
- package/dist/@trpc/server/http.d.ts.map +1 -0
- package/dist/@trpc/server/index.d.ts +61 -0
- package/dist/@trpc/server/index.d.ts.map +1 -0
- package/dist/@trpc/server/rpc.d.ts +3 -0
- package/dist/@trpc/server/rpc.d.ts.map +1 -0
- package/dist/adapters/aws-lambda/index.d.ts +11 -2
- package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/index.js +28 -106
- package/dist/adapters/aws-lambda/index.mjs +15 -91
- package/dist/adapters/aws-lambda/utils.d.ts +14 -14
- package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/utils.js +101 -0
- package/dist/adapters/aws-lambda/utils.mjs +94 -0
- package/dist/adapters/express.d.ts +11 -2
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/express.js +2 -14
- package/dist/adapters/express.mjs +2 -12
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +4 -4
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyRequestHandler.js +81 -0
- package/dist/adapters/fastify/fastifyRequestHandler.mjs +79 -0
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +13 -4
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.js +48 -0
- package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +46 -0
- package/dist/adapters/fastify/index.js +4 -126
- package/dist/adapters/fastify/index.mjs +2 -126
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +11 -2
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fetch/fetchRequestHandler.js +119 -0
- package/dist/adapters/fetch/fetchRequestHandler.mjs +117 -0
- package/dist/adapters/fetch/index.js +2 -106
- package/dist/adapters/fetch/index.mjs +1 -107
- package/dist/adapters/fetch/types.d.ts +13 -4
- package/dist/adapters/fetch/types.d.ts.map +1 -1
- package/dist/adapters/next-app-dir/formDataToObject.d.ts +2 -0
- package/dist/adapters/next-app-dir/formDataToObject.d.ts.map +1 -0
- package/dist/adapters/next-app-dir/formDataToObject.js +34 -0
- package/dist/adapters/next-app-dir/formDataToObject.mjs +32 -0
- package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts +24 -0
- package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts.map +1 -0
- package/dist/adapters/next-app-dir/nextAppDirCaller.js +86 -0
- package/dist/adapters/next-app-dir/nextAppDirCaller.mjs +84 -0
- package/dist/adapters/next-app-dir/notFound.d.ts +7 -0
- package/dist/adapters/next-app-dir/notFound.d.ts.map +1 -0
- package/dist/adapters/next-app-dir/notFound.js +16 -0
- package/dist/adapters/next-app-dir/notFound.mjs +14 -0
- package/dist/adapters/next-app-dir/redirect.d.ts +18 -0
- package/dist/adapters/next-app-dir/redirect.d.ts.map +1 -0
- package/dist/adapters/next-app-dir/redirect.js +34 -0
- package/dist/adapters/next-app-dir/redirect.mjs +31 -0
- package/dist/adapters/next-app-dir/rethrowNextErrors.d.ts +6 -0
- package/dist/adapters/next-app-dir/rethrowNextErrors.d.ts.map +1 -0
- package/dist/adapters/next-app-dir/rethrowNextErrors.js +23 -0
- package/dist/adapters/next-app-dir/rethrowNextErrors.mjs +21 -0
- package/dist/adapters/next-app-dir.d.ts +4 -0
- package/dist/adapters/next-app-dir.d.ts.map +1 -0
- package/dist/adapters/next-app-dir.js +11 -0
- package/dist/adapters/next-app-dir.mjs +3 -0
- package/dist/adapters/next.d.ts +16 -3
- package/dist/adapters/next.d.ts.map +1 -1
- package/dist/adapters/next.js +20 -19
- package/dist/adapters/next.mjs +19 -16
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts +6 -3
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.js +161 -0
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.mjs +157 -0
- package/dist/adapters/node-http/content-type/form-data/index.d.ts +6 -8
- package/dist/adapters/node-http/content-type/form-data/index.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/index.js +21 -647
- package/dist/adapters/node-http/content-type/form-data/index.mjs +10 -632
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts +2 -2
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.js +29 -0
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.mjs +27 -0
- package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts +2 -1
- package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/streamSlice.js +46 -0
- package/dist/adapters/node-http/content-type/form-data/streamSlice.mjs +44 -0
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts +2 -2
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.js +30 -0
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.mjs +26 -0
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +2 -2
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.js +54 -0
- package/dist/adapters/node-http/content-type/json/getPostBody.mjs +52 -0
- package/dist/adapters/node-http/content-type/json/index.js +6 -42
- package/dist/adapters/node-http/content-type/json/index.mjs +5 -39
- package/dist/adapters/node-http/index.js +1 -14
- package/dist/adapters/node-http/index.mjs +1 -12
- package/dist/adapters/node-http/internals/contentType.d.ts +3 -3
- package/dist/adapters/node-http/internals/contentType.d.ts.map +1 -1
- package/dist/{contentType-8c16408e.js → adapters/node-http/internals/contentType.js} +1 -0
- package/dist/{contentType-3194ed5f.mjs → adapters/node-http/internals/contentType.mjs} +2 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +11 -2
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
- package/dist/{nodeHTTPRequestHandler-18f3370e.js → adapters/node-http/nodeHTTPRequestHandler.js} +19 -10
- package/dist/{nodeHTTPRequestHandler-0986c5a1.mjs → adapters/node-http/nodeHTTPRequestHandler.mjs} +19 -10
- package/dist/adapters/node-http/types.d.ts +18 -9
- package/dist/adapters/node-http/types.d.ts.map +1 -1
- package/dist/adapters/standalone.d.ts +11 -2
- package/dist/adapters/standalone.d.ts.map +1 -1
- package/dist/adapters/standalone.js +10 -22
- package/dist/adapters/standalone.mjs +10 -16
- package/dist/adapters/ws.d.ts +18 -17
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +35 -22
- package/dist/adapters/ws.mjs +28 -14
- package/dist/bundle-analysis.json +383 -493
- package/dist/http.d.ts +2 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +18 -0
- package/dist/http.mjs +7 -0
- package/dist/index.d.ts +1 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -86
- package/dist/index.mjs +9 -81
- package/dist/observable/index.d.ts +4 -4
- package/dist/observable/index.d.ts.map +1 -1
- package/dist/observable/index.js +6 -149
- package/dist/observable/index.mjs +2 -147
- package/dist/observable/observable.d.ts +9 -1
- package/dist/observable/observable.d.ts.map +1 -1
- package/dist/{observable-464116ac.js → observable/observable.js} +50 -20
- package/dist/{observable-ade1bad8.mjs → observable/observable.mjs} +50 -21
- package/dist/observable/operators.d.ts +8 -0
- package/dist/observable/operators.d.ts.map +1 -0
- package/dist/observable/operators.js +99 -0
- package/dist/observable/operators.mjs +95 -0
- package/dist/observable/types.d.ts +2 -5
- package/dist/observable/types.d.ts.map +1 -1
- package/dist/rpc.d.ts +2 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +12 -0
- package/dist/rpc.mjs +4 -0
- package/dist/shared.d.ts +26 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +11 -0
- package/dist/shared.mjs +4 -0
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts +17 -0
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts +32 -0
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts +62 -0
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts.map +1 -0
- package/dist/{shared/createProxy/index.d.ts → unstable-core-do-not-import/createProxy.d.ts} +1 -1
- package/dist/unstable-core-do-not-import/createProxy.d.ts.map +1 -0
- package/dist/{index-784ff647.js → unstable-core-do-not-import/createProxy.js} +0 -51
- package/dist/unstable-core-do-not-import/createProxy.mjs +49 -0
- package/dist/{error → unstable-core-do-not-import/error}/TRPCError.d.ts +3 -2
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -0
- package/dist/{TRPCError-ae7b67e8.js → unstable-core-do-not-import/error/TRPCError.js} +25 -25
- package/dist/{TRPCError-816ff32e.mjs → unstable-core-do-not-import/error/TRPCError.mjs} +24 -25
- package/dist/{error → unstable-core-do-not-import/error}/formatter.d.ts +11 -6
- package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/formatter.js +7 -0
- package/dist/unstable-core-do-not-import/error/formatter.mjs +5 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +15 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.js +32 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +30 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +1 -0
- package/dist/{batchStreamFormatter-fc1ffb26.mjs → unstable-core-do-not-import/http/batchStreamFormatter.mjs} +1 -1
- package/dist/{http → unstable-core-do-not-import/http}/contentType.d.ts +3 -3
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +1 -0
- package/dist/{contentType-90bad7bb.js → unstable-core-do-not-import/http/contentType.js} +1 -1
- package/dist/{contentType-93515a46.mjs → unstable-core-do-not-import/http/contentType.mjs} +2 -2
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +5 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +53 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +50 -0
- package/dist/unstable-core-do-not-import/http/index.d.ts +12 -0
- package/dist/unstable-core-do-not-import/http/index.d.ts.map +1 -0
- package/dist/{http → unstable-core-do-not-import/http}/resolveHTTPResponse.d.ts +4 -5
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +1 -0
- package/dist/{resolveHTTPResponse-5def1b0c.js → unstable-core-do-not-import/http/resolveHTTPResponse.js} +60 -63
- package/dist/{resolveHTTPResponse-55c648bd.mjs → unstable-core-do-not-import/http/resolveHTTPResponse.mjs} +54 -57
- package/dist/unstable-core-do-not-import/http/toURL.d.ts +2 -0
- package/dist/unstable-core-do-not-import/http/toURL.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/toURL.js +8 -0
- package/dist/unstable-core-do-not-import/http/toURL.mjs +6 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts +109 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +102 -0
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/initTRPC.js +82 -0
- package/dist/unstable-core-do-not-import/initTRPC.mjs +80 -0
- package/dist/unstable-core-do-not-import/middleware.d.ts +106 -0
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/middleware.js +96 -0
- package/dist/unstable-core-do-not-import/middleware.mjs +90 -0
- package/dist/{core → unstable-core-do-not-import}/parser.d.ts +3 -7
- package/dist/unstable-core-do-not-import/parser.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/parser.js +37 -0
- package/dist/unstable-core-do-not-import/parser.mjs +35 -0
- package/dist/{core → unstable-core-do-not-import}/procedure.d.ts +26 -27
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/procedure.js +9 -0
- package/dist/unstable-core-do-not-import/procedure.mjs +7 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +134 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.js +204 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +201 -0
- package/dist/{core/internals/config.d.ts → unstable-core-do-not-import/rootConfig.d.ts} +19 -27
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rootConfig.js +8 -0
- package/dist/unstable-core-do-not-import/rootConfig.mjs +6 -0
- package/dist/unstable-core-do-not-import/router.d.ts +81 -0
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/router.js +168 -0
- package/dist/unstable-core-do-not-import/router.mjs +163 -0
- package/dist/{rpc → unstable-core-do-not-import/rpc}/codes.d.ts +8 -16
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -0
- package/dist/{codes-87f6824b.js → unstable-core-do-not-import/rpc/codes.js} +19 -13
- package/dist/{codes-c924c3db.mjs → unstable-core-do-not-import/rpc/codes.mjs} +20 -13
- package/dist/{rpc → unstable-core-do-not-import/rpc}/envelopes.d.ts +6 -4
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/index.d.ts +5 -0
- package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +1 -0
- package/dist/{parseTRPCMessage-1377f305.js → unstable-core-do-not-import/rpc/parseTRPCMessage.js} +5 -2
- package/dist/{parseTRPCMessage-a0f17853.mjs → unstable-core-do-not-import/rpc/parseTRPCMessage.mjs} +6 -3
- package/dist/unstable-core-do-not-import/transformer.d.ts +101 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/transformer.js +106 -0
- package/dist/unstable-core-do-not-import/transformer.mjs +101 -0
- package/dist/unstable-core-do-not-import/types.d.ts +103 -0
- package/dist/unstable-core-do-not-import/types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/types.js +11 -0
- package/dist/unstable-core-do-not-import/types.mjs +9 -0
- package/dist/unstable-core-do-not-import/utils.d.ts +24 -0
- package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/utils.js +46 -0
- package/dist/unstable-core-do-not-import/utils.mjs +40 -0
- package/dist/unstable-core-do-not-import.d.ts +31 -0
- package/dist/unstable-core-do-not-import.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import.js +67 -0
- package/dist/unstable-core-do-not-import.mjs +21 -0
- package/package.json +51 -69
- package/src/@trpc/server/http.ts +27 -0
- package/src/@trpc/server/index.ts +100 -0
- package/src/@trpc/server/rpc.ts +26 -0
- package/src/adapters/aws-lambda/index.ts +21 -10
- package/src/adapters/aws-lambda/utils.ts +33 -26
- package/src/adapters/express.ts +18 -4
- package/src/adapters/fastify/fastifyRequestHandler.ts +22 -12
- package/src/adapters/fastify/fastifyTRPCPlugin.ts +21 -9
- package/src/adapters/fetch/fetchRequestHandler.ts +36 -12
- package/src/adapters/fetch/types.ts +18 -4
- package/src/adapters/next-app-dir/formDataToObject.ts +36 -0
- package/src/adapters/next-app-dir/nextAppDirCaller.ts +129 -0
- package/src/adapters/next-app-dir/notFound.ts +12 -0
- package/src/adapters/next-app-dir/redirect.ts +30 -0
- package/src/adapters/next-app-dir/rethrowNextErrors.ts +25 -0
- package/src/adapters/next-app-dir.ts +3 -0
- package/src/adapters/next.ts +30 -14
- package/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts +11 -4
- package/src/adapters/node-http/content-type/form-data/index.ts +18 -18
- package/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts +3 -2
- package/src/adapters/node-http/content-type/form-data/streamSlice.ts +7 -2
- package/src/adapters/node-http/content-type/form-data/uploadHandler.ts +2 -2
- package/src/adapters/node-http/content-type/json/getPostBody.ts +20 -3
- package/src/adapters/node-http/content-type/json/index.ts +1 -1
- package/src/adapters/node-http/internals/contentType.ts +5 -3
- package/src/adapters/node-http/nodeHTTPRequestHandler.ts +28 -16
- package/src/adapters/node-http/types.ts +24 -9
- package/src/adapters/standalone.ts +22 -8
- package/src/adapters/ws.ts +68 -39
- package/src/http.ts +1 -0
- package/src/index.ts +1 -20
- package/src/observable/index.ts +10 -4
- package/src/observable/observable.ts +63 -3
- package/src/observable/operators.ts +114 -0
- package/src/observable/types.ts +1 -5
- package/src/rpc.ts +1 -0
- package/src/shared.ts +26 -0
- package/src/unstable-core-do-not-import/clientish/inference.ts +60 -0
- package/src/unstable-core-do-not-import/clientish/inferrable.ts +49 -0
- package/src/unstable-core-do-not-import/clientish/serialize.ts +122 -0
- package/src/{error → unstable-core-do-not-import/error}/TRPCError.ts +33 -27
- package/src/{error → unstable-core-do-not-import/error}/formatter.ts +12 -19
- package/src/{shared → unstable-core-do-not-import/error}/getErrorShape.ts +8 -8
- package/src/{http → unstable-core-do-not-import/http}/contentType.ts +4 -4
- package/src/{http → unstable-core-do-not-import/http}/getHTTPStatusCode.ts +8 -8
- package/src/unstable-core-do-not-import/http/index.ts +29 -0
- package/src/{http → unstable-core-do-not-import/http}/resolveHTTPResponse.ts +69 -69
- package/src/unstable-core-do-not-import/http/toURL.ts +7 -0
- package/src/unstable-core-do-not-import/http/types.ts +126 -0
- package/src/unstable-core-do-not-import/initTRPC.ts +152 -0
- package/src/unstable-core-do-not-import/middleware.ts +238 -0
- package/src/unstable-core-do-not-import/parser.ts +94 -0
- package/src/{core → unstable-core-do-not-import}/procedure.ts +37 -35
- package/src/unstable-core-do-not-import/procedureBuilder.ts +623 -0
- package/src/{core/internals/config.ts → unstable-core-do-not-import/rootConfig.ts} +22 -33
- package/src/unstable-core-do-not-import/router.ts +363 -0
- package/src/{rpc → unstable-core-do-not-import/rpc}/codes.ts +30 -3
- package/src/{rpc → unstable-core-do-not-import/rpc}/envelopes.ts +6 -9
- package/src/unstable-core-do-not-import/rpc/index.ts +21 -0
- package/src/{rpc → unstable-core-do-not-import/rpc}/parseTRPCMessage.ts +4 -3
- package/src/unstable-core-do-not-import/transformer.ts +194 -0
- package/src/unstable-core-do-not-import/types.ts +157 -0
- package/src/unstable-core-do-not-import/utils.ts +55 -0
- package/src/unstable-core-do-not-import.ts +30 -0
- package/unstable-core-do-not-import/index.d.ts +1 -0
- package/unstable-core-do-not-import/index.js +1 -0
- package/dist/TRPCError-efecb077.js +0 -63
- package/dist/batchStreamFormatter-2c1405a1.js +0 -31
- package/dist/codes-e5bb4d58.js +0 -48
- package/dist/config-5de7eae5.js +0 -10
- package/dist/config-60fc2667.js +0 -7
- package/dist/config-ab4c1c6b.mjs +0 -5
- package/dist/contentType-24c44bba.js +0 -5
- package/dist/contentType-9940f5d7.js +0 -58
- package/dist/core/index.d.ts +0 -9
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/initTRPC.d.ts +0 -105
- package/dist/core/initTRPC.d.ts.map +0 -1
- package/dist/core/internals/builderTypes.d.ts +0 -11
- package/dist/core/internals/builderTypes.d.ts.map +0 -1
- package/dist/core/internals/config.d.ts.map +0 -1
- package/dist/core/internals/getParseFn.d.ts +0 -4
- package/dist/core/internals/getParseFn.d.ts.map +0 -1
- package/dist/core/internals/mergeRouters.d.ts +0 -15
- package/dist/core/internals/mergeRouters.d.ts.map +0 -1
- package/dist/core/internals/mergeWithoutOverrides.d.ts +0 -5
- package/dist/core/internals/mergeWithoutOverrides.d.ts.map +0 -1
- package/dist/core/internals/omitPrototype.d.ts +0 -6
- package/dist/core/internals/omitPrototype.d.ts.map +0 -1
- package/dist/core/internals/procedureBuilder.d.ts +0 -113
- package/dist/core/internals/procedureBuilder.d.ts.map +0 -1
- package/dist/core/internals/utils.d.ts +0 -51
- package/dist/core/internals/utils.d.ts.map +0 -1
- package/dist/core/middleware.d.ts +0 -158
- package/dist/core/middleware.d.ts.map +0 -1
- package/dist/core/parser.d.ts.map +0 -1
- package/dist/core/procedure.d.ts.map +0 -1
- package/dist/core/router.d.ts +0 -65
- package/dist/core/router.d.ts.map +0 -1
- package/dist/core/types.d.ts +0 -24
- package/dist/core/types.d.ts.map +0 -1
- package/dist/error/TRPCError.d.ts.map +0 -1
- package/dist/error/formatter.d.ts.map +0 -1
- package/dist/error/utils.d.ts +0 -9
- package/dist/error/utils.d.ts.map +0 -1
- package/dist/http/batchStreamFormatter.d.ts.map +0 -1
- package/dist/http/contentType.d.ts.map +0 -1
- package/dist/http/getHTTPStatusCode.d.ts +0 -24
- package/dist/http/getHTTPStatusCode.d.ts.map +0 -1
- package/dist/http/index.d.ts +0 -5
- package/dist/http/index.d.ts.map +0 -1
- package/dist/http/index.js +0 -21
- package/dist/http/index.mjs +0 -9
- package/dist/http/internals/types.d.ts +0 -32
- package/dist/http/internals/types.d.ts.map +0 -1
- package/dist/http/resolveHTTPResponse.d.ts.map +0 -1
- package/dist/http/types.d.ts +0 -46
- package/dist/http/types.d.ts.map +0 -1
- package/dist/index-46cb3130.js +0 -94
- package/dist/index-f91d720c.mjs +0 -97
- package/dist/internals/invert.d.ts +0 -12
- package/dist/internals/invert.d.ts.map +0 -1
- package/dist/internals/types.d.ts +0 -26
- package/dist/internals/types.d.ts.map +0 -1
- package/dist/nodeHTTPRequestHandler-388f5fce.js +0 -107
- package/dist/observable/internals/identity.d.ts +0 -2
- package/dist/observable/internals/identity.d.ts.map +0 -1
- package/dist/observable/internals/observableToPromise.d.ts +0 -10
- package/dist/observable/internals/observableToPromise.d.ts.map +0 -1
- package/dist/observable/internals/pipe.d.ts +0 -4
- package/dist/observable/internals/pipe.d.ts.map +0 -1
- package/dist/observable/operators/index.d.ts +0 -4
- package/dist/observable/operators/index.d.ts.map +0 -1
- package/dist/observable/operators/map.d.ts +0 -3
- package/dist/observable/operators/map.d.ts.map +0 -1
- package/dist/observable/operators/share.d.ts +0 -6
- package/dist/observable/operators/share.d.ts.map +0 -1
- package/dist/observable/operators/tap.d.ts +0 -3
- package/dist/observable/operators/tap.d.ts.map +0 -1
- package/dist/observable-15588f28.js +0 -83
- package/dist/parseTRPCMessage-95955211.js +0 -63
- package/dist/resolveHTTPResponse-8d474952.js +0 -267
- package/dist/router-3c22fe56.js +0 -159
- package/dist/router-5274e533.mjs +0 -153
- package/dist/router-a1635eab.js +0 -147
- package/dist/rpc/codes.d.ts.map +0 -1
- package/dist/rpc/envelopes.d.ts.map +0 -1
- package/dist/rpc/index.d.ts +0 -4
- package/dist/rpc/index.d.ts.map +0 -1
- package/dist/rpc/index.js +0 -12
- package/dist/rpc/index.mjs +0 -2
- package/dist/rpc/parseTRPCMessage.d.ts.map +0 -1
- package/dist/shared/createProxy/index.d.ts.map +0 -1
- package/dist/shared/getErrorShape.d.ts +0 -15
- package/dist/shared/getErrorShape.d.ts.map +0 -1
- package/dist/shared/index.d.ts +0 -7
- package/dist/shared/index.d.ts.map +0 -1
- package/dist/shared/index.js +0 -14
- package/dist/shared/index.mjs +0 -3
- package/dist/shared/internal/serialize.d.ts +0 -30
- package/dist/shared/internal/serialize.d.ts.map +0 -1
- package/dist/shared/jsonify.d.ts +0 -11
- package/dist/shared/jsonify.d.ts.map +0 -1
- package/dist/shared/transformTRPCResponse.d.ts +0 -9
- package/dist/shared/transformTRPCResponse.d.ts.map +0 -1
- package/dist/shared/types.d.ts +0 -6
- package/dist/shared/types.d.ts.map +0 -1
- package/dist/transformTRPCResponse-1153b421.mjs +0 -53
- package/dist/transformTRPCResponse-20ce3b68.js +0 -54
- package/dist/transformTRPCResponse-e65f34e9.js +0 -56
- package/dist/transformer.d.ts +0 -74
- package/dist/transformer.d.ts.map +0 -1
- package/dist/types.d.ts +0 -83
- package/dist/types.d.ts.map +0 -1
- package/dist/unstableInternalsExport-10cc2bae.mjs +0 -353
- package/dist/unstableInternalsExport-a064a7dd.js +0 -349
- package/dist/unstableInternalsExport-bf8496ea.js +0 -363
- package/dist/unstableInternalsExport.d.ts +0 -11
- package/dist/unstableInternalsExport.d.ts.map +0 -1
- package/dist/unstableInternalsExport.js +0 -16
- package/dist/unstableInternalsExport.mjs +0 -5
- package/src/core/index.ts +0 -28
- package/src/core/initTRPC.ts +0 -169
- package/src/core/internals/builderTypes.ts +0 -11
- package/src/core/internals/getParseFn.ts +0 -43
- package/src/core/internals/mergeRouters.ts +0 -90
- package/src/core/internals/mergeWithoutOverrides.ts +0 -19
- package/src/core/internals/omitPrototype.ts +0 -9
- package/src/core/internals/procedureBuilder.ts +0 -394
- package/src/core/internals/utils.ts +0 -84
- package/src/core/middleware.ts +0 -295
- package/src/core/parser.ts +0 -57
- package/src/core/router.ts +0 -226
- package/src/core/types.ts +0 -67
- package/src/error/utils.ts +0 -23
- package/src/http/index.ts +0 -4
- package/src/http/internals/types.ts +0 -40
- package/src/http/types.ts +0 -51
- package/src/internals/invert.ts +0 -21
- package/src/internals/types.ts +0 -27
- package/src/observable/internals/identity.ts +0 -3
- package/src/observable/internals/observableToPromise.ts +0 -49
- package/src/observable/internals/pipe.ts +0 -23
- package/src/observable/operators/index.ts +0 -3
- package/src/observable/operators/map.ts +0 -25
- package/src/observable/operators/share.ts +0 -65
- package/src/observable/operators/tap.ts +0 -26
- package/src/rpc/index.ts +0 -3
- package/src/shared/index.ts +0 -10
- package/src/shared/internal/serialize.ts +0 -65
- package/src/shared/jsonify.ts +0 -22
- package/src/shared/transformTRPCResponse.ts +0 -40
- package/src/shared/types.ts +0 -9
- package/src/transformer.ts +0 -94
- package/src/types.ts +0 -125
- package/src/unstableInternalsExport.ts +0 -10
- package/subscription/index.d.ts +0 -1
- package/subscription/index.js +0 -1
- package/unstableInternalsExport/index.d.ts +0 -1
- package/unstableInternalsExport/index.js +0 -1
- /package/dist/{http → unstable-core-do-not-import/http}/batchStreamFormatter.d.ts +0 -0
- /package/dist/{batchStreamFormatter-93cdcdd4.js → unstable-core-do-not-import/http/batchStreamFormatter.js} +0 -0
- /package/dist/{rpc → unstable-core-do-not-import/rpc}/parseTRPCMessage.d.ts +0 -0
- /package/src/{shared/createProxy/index.ts → unstable-core-do-not-import/createProxy.ts} +0 -0
- /package/src/{http → unstable-core-do-not-import/http}/batchStreamFormatter.ts +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { createFlatProxy, createRecursiveProxy } from './unstable-core-do-not-import/createProxy.mjs';
|
|
2
|
+
export { defaultFormatter } from './unstable-core-do-not-import/error/formatter.mjs';
|
|
3
|
+
export { getErrorShape } from './unstable-core-do-not-import/error/getErrorShape.mjs';
|
|
4
|
+
export { TRPCError, getCauseFromUnknown, getTRPCErrorFromUnknown } from './unstable-core-do-not-import/error/TRPCError.mjs';
|
|
5
|
+
export { getHTTPStatusCode, getHTTPStatusCodeFromError } from './unstable-core-do-not-import/http/getHTTPStatusCode.mjs';
|
|
6
|
+
export { resolveHTTPResponse } from './unstable-core-do-not-import/http/resolveHTTPResponse.mjs';
|
|
7
|
+
export { getBatchStreamFormatter } from './unstable-core-do-not-import/http/batchStreamFormatter.mjs';
|
|
8
|
+
export { getJsonContentTypeInputs } from './unstable-core-do-not-import/http/contentType.mjs';
|
|
9
|
+
export { toURL } from './unstable-core-do-not-import/http/toURL.mjs';
|
|
10
|
+
export { initTRPC } from './unstable-core-do-not-import/initTRPC.mjs';
|
|
11
|
+
export { createInputMiddleware, createMiddlewareFactory, createOutputMiddleware, experimental_standaloneMiddleware, middlewareMarker } from './unstable-core-do-not-import/middleware.mjs';
|
|
12
|
+
export { getParseFn } from './unstable-core-do-not-import/parser.mjs';
|
|
13
|
+
export { procedureTypes } from './unstable-core-do-not-import/procedure.mjs';
|
|
14
|
+
export { createBuilder, unsetMarker } from './unstable-core-do-not-import/procedureBuilder.mjs';
|
|
15
|
+
export { isServerDefault } from './unstable-core-do-not-import/rootConfig.mjs';
|
|
16
|
+
export { callProcedure, createCallerFactory, createRouterFactory, mergeRouters } from './unstable-core-do-not-import/router.mjs';
|
|
17
|
+
export { TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER } from './unstable-core-do-not-import/rpc/codes.mjs';
|
|
18
|
+
export { parseTRPCMessage } from './unstable-core-do-not-import/rpc/parseTRPCMessage.mjs';
|
|
19
|
+
export { defaultTransformer, getDataTransformer, transformResult, transformTRPCResponse } from './unstable-core-do-not-import/transformer.mjs';
|
|
20
|
+
export { ERROR_SYMBOL } from './unstable-core-do-not-import/types.mjs';
|
|
21
|
+
export { $typesProxy, isFunction, isObject, mergeWithoutOverrides, omitPrototype } from './unstable-core-do-not-import/utils.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-
|
|
3
|
+
"version": "11.0.0-rc.329+fdcb4a7d8",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,29 +13,13 @@
|
|
|
13
13
|
"url": "git+https://github.com/trpc/trpc.git",
|
|
14
14
|
"directory": "packages/server"
|
|
15
15
|
},
|
|
16
|
-
"eslintConfig": {
|
|
17
|
-
"overrides": [
|
|
18
|
-
{
|
|
19
|
-
"files": [
|
|
20
|
-
"src"
|
|
21
|
-
],
|
|
22
|
-
"rules": {
|
|
23
|
-
"explicit-module-boundary-types": "off",
|
|
24
|
-
"no-restricted-imports": [
|
|
25
|
-
"error",
|
|
26
|
-
"@trpc/server"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
16
|
"scripts": {
|
|
33
17
|
"build": "rollup --config rollup.config.ts --configPlugin rollup-plugin-swc3",
|
|
34
18
|
"dev": "pnpm build --watch",
|
|
35
19
|
"codegen-entrypoints": "tsx entrypoints.script.ts",
|
|
36
20
|
"benchmark": "tsc --project tsconfig.benchmark.json",
|
|
37
|
-
"lint": "eslint --cache --ext \".js,.ts,.tsx\" --ignore-path ../../.gitignore
|
|
38
|
-
"ts-watch": "tsc --
|
|
21
|
+
"lint": "eslint --cache --ext \".js,.ts,.tsx\" --ignore-path ../../.gitignore src",
|
|
22
|
+
"ts-watch": "tsc --watch"
|
|
39
23
|
},
|
|
40
24
|
"exports": {
|
|
41
25
|
"./package.json": "./package.json",
|
|
@@ -59,25 +43,35 @@
|
|
|
59
43
|
"require": "./dist/adapters/fastify/index.js",
|
|
60
44
|
"default": "./dist/adapters/fastify/index.js"
|
|
61
45
|
},
|
|
46
|
+
"./adapters/fetch": {
|
|
47
|
+
"import": "./dist/adapters/fetch/index.mjs",
|
|
48
|
+
"require": "./dist/adapters/fetch/index.js",
|
|
49
|
+
"default": "./dist/adapters/fetch/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./adapters/next-app-dir": {
|
|
52
|
+
"import": "./dist/adapters/next-app-dir.mjs",
|
|
53
|
+
"require": "./dist/adapters/next-app-dir.js",
|
|
54
|
+
"default": "./dist/adapters/next-app-dir.js"
|
|
55
|
+
},
|
|
62
56
|
"./adapters/next": {
|
|
63
57
|
"import": "./dist/adapters/next.mjs",
|
|
64
58
|
"require": "./dist/adapters/next.js",
|
|
65
59
|
"default": "./dist/adapters/next.js"
|
|
66
60
|
},
|
|
67
|
-
"./adapters/node-http": {
|
|
68
|
-
"import": "./dist/adapters/node-http/index.mjs",
|
|
69
|
-
"require": "./dist/adapters/node-http/index.js",
|
|
70
|
-
"default": "./dist/adapters/node-http/index.js"
|
|
61
|
+
"./adapters/node-http/content-type/form-data": {
|
|
62
|
+
"import": "./dist/adapters/node-http/content-type/form-data/index.mjs",
|
|
63
|
+
"require": "./dist/adapters/node-http/content-type/form-data/index.js",
|
|
64
|
+
"default": "./dist/adapters/node-http/content-type/form-data/index.js"
|
|
71
65
|
},
|
|
72
66
|
"./adapters/node-http/content-type/json": {
|
|
73
67
|
"import": "./dist/adapters/node-http/content-type/json/index.mjs",
|
|
74
68
|
"require": "./dist/adapters/node-http/content-type/json/index.js",
|
|
75
69
|
"default": "./dist/adapters/node-http/content-type/json/index.js"
|
|
76
70
|
},
|
|
77
|
-
"./adapters/node-http
|
|
78
|
-
"import": "./dist/adapters/node-http/
|
|
79
|
-
"require": "./dist/adapters/node-http/
|
|
80
|
-
"default": "./dist/adapters/node-http/
|
|
71
|
+
"./adapters/node-http": {
|
|
72
|
+
"import": "./dist/adapters/node-http/index.mjs",
|
|
73
|
+
"require": "./dist/adapters/node-http/index.js",
|
|
74
|
+
"default": "./dist/adapters/node-http/index.js"
|
|
81
75
|
},
|
|
82
76
|
"./adapters/standalone": {
|
|
83
77
|
"import": "./dist/adapters/standalone.mjs",
|
|
@@ -89,40 +83,30 @@
|
|
|
89
83
|
"require": "./dist/adapters/ws.js",
|
|
90
84
|
"default": "./dist/adapters/ws.js"
|
|
91
85
|
},
|
|
92
|
-
"./adapters/fetch": {
|
|
93
|
-
"import": "./dist/adapters/fetch/index.mjs",
|
|
94
|
-
"require": "./dist/adapters/fetch/index.js",
|
|
95
|
-
"default": "./dist/adapters/fetch/index.js"
|
|
96
|
-
},
|
|
97
86
|
"./http": {
|
|
98
|
-
"import": "./dist/http
|
|
99
|
-
"require": "./dist/http
|
|
100
|
-
"default": "./dist/http
|
|
101
|
-
},
|
|
102
|
-
"./rpc": {
|
|
103
|
-
"import": "./dist/rpc/index.mjs",
|
|
104
|
-
"require": "./dist/rpc/index.js",
|
|
105
|
-
"default": "./dist/rpc/index.js"
|
|
87
|
+
"import": "./dist/http.mjs",
|
|
88
|
+
"require": "./dist/http.js",
|
|
89
|
+
"default": "./dist/http.js"
|
|
106
90
|
},
|
|
107
91
|
"./observable": {
|
|
108
92
|
"import": "./dist/observable/index.mjs",
|
|
109
93
|
"require": "./dist/observable/index.js",
|
|
110
94
|
"default": "./dist/observable/index.js"
|
|
111
95
|
},
|
|
112
|
-
"./
|
|
113
|
-
"import": "./dist/
|
|
114
|
-
"require": "./dist/
|
|
115
|
-
"default": "./dist/
|
|
96
|
+
"./rpc": {
|
|
97
|
+
"import": "./dist/rpc.mjs",
|
|
98
|
+
"require": "./dist/rpc.js",
|
|
99
|
+
"default": "./dist/rpc.js"
|
|
116
100
|
},
|
|
117
101
|
"./shared": {
|
|
118
|
-
"import": "./dist/shared
|
|
119
|
-
"require": "./dist/shared
|
|
120
|
-
"default": "./dist/shared
|
|
121
|
-
},
|
|
122
|
-
"./
|
|
123
|
-
"import": "./dist/
|
|
124
|
-
"require": "./dist/
|
|
125
|
-
"default": "./dist/
|
|
102
|
+
"import": "./dist/shared.mjs",
|
|
103
|
+
"require": "./dist/shared.js",
|
|
104
|
+
"default": "./dist/shared.js"
|
|
105
|
+
},
|
|
106
|
+
"./unstable-core-do-not-import": {
|
|
107
|
+
"import": "./dist/unstable-core-do-not-import.mjs",
|
|
108
|
+
"require": "./dist/unstable-core-do-not-import.js",
|
|
109
|
+
"default": "./dist/unstable-core-do-not-import.js"
|
|
126
110
|
}
|
|
127
111
|
},
|
|
128
112
|
"files": [
|
|
@@ -132,46 +116,44 @@
|
|
|
132
116
|
"package.json",
|
|
133
117
|
"adapters",
|
|
134
118
|
"http",
|
|
135
|
-
"rpc",
|
|
136
119
|
"observable",
|
|
137
|
-
"
|
|
120
|
+
"rpc",
|
|
138
121
|
"shared",
|
|
139
|
-
"
|
|
122
|
+
"unstable-core-do-not-import",
|
|
140
123
|
"!**/*.test.*"
|
|
141
124
|
],
|
|
142
125
|
"publishConfig": {
|
|
143
126
|
"access": "public"
|
|
144
127
|
},
|
|
145
128
|
"devDependencies": {
|
|
146
|
-
"@fastify/websocket": "^
|
|
147
|
-
"@tanstack/react-query": "^5.
|
|
129
|
+
"@fastify/websocket": "^10.0.1",
|
|
130
|
+
"@tanstack/react-query": "^5.25.0",
|
|
148
131
|
"@types/aws-lambda": "^8.10.97",
|
|
149
132
|
"@types/express": "^4.17.17",
|
|
150
133
|
"@types/hash-sum": "^1.0.0",
|
|
151
|
-
"@types/node": "^
|
|
152
|
-
"@types/react": "^18.2.
|
|
153
|
-
"@types/react-dom": "^18.2.
|
|
134
|
+
"@types/node": "^20.10.0",
|
|
135
|
+
"@types/react": "^18.2.33",
|
|
136
|
+
"@types/react-dom": "^18.2.14",
|
|
154
137
|
"@types/ws": "^8.2.0",
|
|
155
138
|
"@web3-storage/multipart-parser": "^1.0.0",
|
|
156
139
|
"aws-lambda": "^1.0.7",
|
|
157
140
|
"devalue": "^4.0.0",
|
|
158
|
-
"eslint": "^8.
|
|
141
|
+
"eslint": "^8.56.0",
|
|
159
142
|
"express": "^4.17.1",
|
|
160
|
-
"fastify": "^4.
|
|
143
|
+
"fastify": "^4.16.0",
|
|
161
144
|
"fastify-plugin": "^4.5.0",
|
|
162
145
|
"hash-sum": "^2.0.0",
|
|
163
146
|
"myzod": "^1.3.1",
|
|
164
|
-
"next": "^
|
|
147
|
+
"next": "^14.1.4",
|
|
165
148
|
"react": "^18.2.0",
|
|
166
149
|
"react-dom": "^18.2.0",
|
|
167
|
-
"rollup": "^
|
|
150
|
+
"rollup": "^4.9.5",
|
|
168
151
|
"superjson": "^1.12.4",
|
|
169
152
|
"superstruct": "^1.0.0",
|
|
170
153
|
"tslib": "^2.5.0",
|
|
171
|
-
"tsx": "^
|
|
172
|
-
"typescript": "^5.
|
|
173
|
-
"valibot": "^0.
|
|
174
|
-
"vitest": "^0.32.0",
|
|
154
|
+
"tsx": "^4.0.0",
|
|
155
|
+
"typescript": "^5.4.0",
|
|
156
|
+
"valibot": "^0.30.0",
|
|
175
157
|
"ws": "^8.0.0",
|
|
176
158
|
"yup": "^1.0.0",
|
|
177
159
|
"zod": "^3.0.0"
|
|
@@ -179,5 +161,5 @@
|
|
|
179
161
|
"funding": [
|
|
180
162
|
"https://trpc.io/sponsor"
|
|
181
163
|
],
|
|
182
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "fdcb4a7d8168d19f9bcbc816b80db815b06a134c"
|
|
183
165
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export {
|
|
2
|
+
getHTTPStatusCode,
|
|
3
|
+
getHTTPStatusCodeFromError,
|
|
4
|
+
} from '../../unstable-core-do-not-import';
|
|
5
|
+
export { resolveHTTPResponse } from '../../unstable-core-do-not-import';
|
|
6
|
+
export type {
|
|
7
|
+
BaseHandlerOptions,
|
|
8
|
+
HTTPBaseHandlerOptions,
|
|
9
|
+
HTTPHeaders,
|
|
10
|
+
HTTPRequest,
|
|
11
|
+
HTTPResponse,
|
|
12
|
+
OnErrorFunction,
|
|
13
|
+
ProcedureCall,
|
|
14
|
+
ResolveHTTPRequestOptionsContextFn,
|
|
15
|
+
ResponseChunk,
|
|
16
|
+
ResponseMeta,
|
|
17
|
+
ResponseMetaFn,
|
|
18
|
+
TRPCRequestInfo,
|
|
19
|
+
} from '../../unstable-core-do-not-import';
|
|
20
|
+
|
|
21
|
+
export { getBatchStreamFormatter } from '../../unstable-core-do-not-import';
|
|
22
|
+
export type {
|
|
23
|
+
BaseContentTypeHandler,
|
|
24
|
+
BodyResult,
|
|
25
|
+
} from '../../unstable-core-do-not-import';
|
|
26
|
+
export { getJsonContentTypeInputs } from '../../unstable-core-do-not-import';
|
|
27
|
+
export { toURL } from '../../unstable-core-do-not-import';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export {
|
|
2
|
+
TRPCError,
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated use `experimental_trpcMiddleware` instead
|
|
5
|
+
*/
|
|
6
|
+
experimental_standaloneMiddleware,
|
|
7
|
+
experimental_standaloneMiddleware as experimental_trpcMiddleware,
|
|
8
|
+
initTRPC,
|
|
9
|
+
// --- FIXME a bunch of these exports are only useful for plugins - move them somewhere else? ----
|
|
10
|
+
callProcedure as callTRPCProcedure,
|
|
11
|
+
getTRPCErrorFromUnknown,
|
|
12
|
+
transformTRPCResponse,
|
|
13
|
+
createFlatProxy as createTRPCFlatProxy,
|
|
14
|
+
type inferProcedureInput,
|
|
15
|
+
type inferProcedureOutput,
|
|
16
|
+
type inferProcedureBuilderResolverOptions,
|
|
17
|
+
type inferRouterError,
|
|
18
|
+
type inferRouterInputs,
|
|
19
|
+
type inferRouterOutputs,
|
|
20
|
+
type inferRouterContext,
|
|
21
|
+
type inferClientTypes as inferTRPCClientTypes,
|
|
22
|
+
type AnyClientTypes as AnyTRPCClientTypes,
|
|
23
|
+
type inferTransformedProcedureOutput,
|
|
24
|
+
type inferTransformedSubscriptionOutput,
|
|
25
|
+
type AnyProcedure as AnyTRPCProcedure,
|
|
26
|
+
type AnyRouter as AnyTRPCRouter,
|
|
27
|
+
type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction,
|
|
28
|
+
type CombinedDataTransformer as TRPCCombinedDataTransformer,
|
|
29
|
+
type ProcedureType as TRPCProcedureType,
|
|
30
|
+
type AnyMutationProcedure as AnyTRPCMutationProcedure,
|
|
31
|
+
type AnyQueryProcedure as AnyTRPCQueryProcedure,
|
|
32
|
+
type RouterRecord as TRPCRouterRecord,
|
|
33
|
+
type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure,
|
|
34
|
+
type ProcedureOptions as TRPCProcedureOptions,
|
|
35
|
+
} from '../../unstable-core-do-not-import';
|
|
36
|
+
|
|
37
|
+
export type {
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated use `AnyTRPCProcedure` instead
|
|
40
|
+
*/
|
|
41
|
+
AnyProcedure,
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated use `AnyTRPCRouter` instead
|
|
44
|
+
*/
|
|
45
|
+
AnyRouter,
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated use `AnyTRPCMiddlewareFunction` instead
|
|
48
|
+
*/
|
|
49
|
+
AnyMiddlewareFunction,
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated use `TRPCCombinedDataTransformer` instead
|
|
52
|
+
*/
|
|
53
|
+
CombinedDataTransformer,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated This is a utility type will be removed in v12
|
|
57
|
+
*/
|
|
58
|
+
Dict,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated This is a utility type will be removed in v12
|
|
62
|
+
*/
|
|
63
|
+
DeepPartial,
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated use `TRPCProcedureType` instead
|
|
66
|
+
*/
|
|
67
|
+
ProcedureType,
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated use `AnyTRPCMutationProcedure` instead
|
|
70
|
+
*/
|
|
71
|
+
AnyMutationProcedure,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated use `AnyTRPCQueryProcedure` instead
|
|
75
|
+
*/
|
|
76
|
+
AnyQueryProcedure,
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated use `AnyTRPCSubscriptionProcedure` instead
|
|
79
|
+
*/
|
|
80
|
+
AnySubscriptionProcedure,
|
|
81
|
+
} from '../../unstable-core-do-not-import';
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated use `getTRPCErrorShape` instead
|
|
86
|
+
*/
|
|
87
|
+
getErrorShape,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated use `callTRPCProcedure` instead
|
|
91
|
+
*/
|
|
92
|
+
callProcedure,
|
|
93
|
+
} from '../../unstable-core-do-not-import';
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated
|
|
97
|
+
* Use `Awaited<ReturnType<typeof myFunction>>` instead
|
|
98
|
+
*/
|
|
99
|
+
export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> =
|
|
100
|
+
Awaited<ReturnType<TFunction>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Note: this should likely be moved to a sort of `@trpc/plugin` package
|
|
2
|
+
export type {
|
|
3
|
+
JSONRPC2,
|
|
4
|
+
TRPCClientIncomingMessage,
|
|
5
|
+
TRPCClientIncomingRequest,
|
|
6
|
+
TRPCClientOutgoingMessage,
|
|
7
|
+
TRPCClientOutgoingRequest,
|
|
8
|
+
TRPCErrorResponse,
|
|
9
|
+
TRPCErrorShape,
|
|
10
|
+
TRPCReconnectNotification,
|
|
11
|
+
TRPCRequest,
|
|
12
|
+
TRPCRequestMessage,
|
|
13
|
+
TRPCResponse,
|
|
14
|
+
TRPCResponseMessage,
|
|
15
|
+
TRPCResult,
|
|
16
|
+
TRPCResultMessage,
|
|
17
|
+
TRPCSubscriptionStopNotification,
|
|
18
|
+
TRPCSuccessResponse,
|
|
19
|
+
TRPC_ERROR_CODE_KEY,
|
|
20
|
+
TRPC_ERROR_CODE_NUMBER,
|
|
21
|
+
} from '../../unstable-core-do-not-import';
|
|
22
|
+
export {
|
|
23
|
+
TRPC_ERROR_CODES_BY_KEY,
|
|
24
|
+
TRPC_ERROR_CODES_BY_NUMBER,
|
|
25
|
+
parseTRPCMessage,
|
|
26
|
+
} from '../../unstable-core-do-not-import';
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
7
|
+
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
import type {
|
|
2
11
|
APIGatewayProxyEvent,
|
|
3
12
|
APIGatewayProxyEventV2,
|
|
@@ -5,18 +14,22 @@ import type {
|
|
|
5
14
|
APIGatewayProxyStructuredResultV2,
|
|
6
15
|
Context as APIGWContext,
|
|
7
16
|
} from 'aws-lambda';
|
|
8
|
-
|
|
9
|
-
import { AnyRouter } from '
|
|
10
|
-
|
|
17
|
+
// @trpc/server
|
|
18
|
+
import type { AnyRouter } from '../../@trpc/server';
|
|
19
|
+
// @trpc/server
|
|
20
|
+
import { TRPCError } from '../../@trpc/server';
|
|
21
|
+
import type {
|
|
11
22
|
HTTPRequest,
|
|
23
|
+
HTTPResponse,
|
|
12
24
|
ResolveHTTPRequestOptionsContextFn,
|
|
13
|
-
|
|
14
|
-
} from '
|
|
15
|
-
import type {
|
|
16
|
-
import {
|
|
25
|
+
} from '../../@trpc/server/http';
|
|
26
|
+
import { resolveHTTPResponse } from '../../@trpc/server/http';
|
|
27
|
+
import type {
|
|
17
28
|
APIGatewayEvent,
|
|
18
29
|
APIGatewayResult,
|
|
19
30
|
AWSLambdaOptions,
|
|
31
|
+
} from './utils';
|
|
32
|
+
import {
|
|
20
33
|
getHTTPMethod,
|
|
21
34
|
getPath,
|
|
22
35
|
isPayloadV1,
|
|
@@ -103,9 +116,7 @@ export function awsLambdaRequestHandler<
|
|
|
103
116
|
};
|
|
104
117
|
|
|
105
118
|
const response = await resolveHTTPResponse({
|
|
106
|
-
|
|
107
|
-
batching: opts.batching,
|
|
108
|
-
responseMeta: opts?.responseMeta,
|
|
119
|
+
...opts,
|
|
109
120
|
createContext,
|
|
110
121
|
req,
|
|
111
122
|
path,
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
7
|
+
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
import type {
|
|
2
11
|
APIGatewayProxyEvent,
|
|
3
12
|
APIGatewayProxyEventV2,
|
|
@@ -5,11 +14,15 @@ import type {
|
|
|
5
14
|
APIGatewayProxyStructuredResultV2,
|
|
6
15
|
Context as APIGWContext,
|
|
7
16
|
} from 'aws-lambda';
|
|
8
|
-
import type { AnyRouter, inferRouterContext } from '
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
17
|
+
import type { AnyRouter, inferRouterContext } from '../../@trpc/server'; // import @trpc/server
|
|
18
|
+
|
|
19
|
+
// @trpc/server
|
|
20
|
+
import { TRPCError } from '../../@trpc/server';
|
|
21
|
+
import type {
|
|
22
|
+
HTTPBaseHandlerOptions,
|
|
23
|
+
HTTPHeaders,
|
|
24
|
+
TRPCRequestInfo,
|
|
25
|
+
} from '../../@trpc/server/http';
|
|
13
26
|
|
|
14
27
|
export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
|
|
15
28
|
export type APIGatewayResult =
|
|
@@ -36,27 +49,21 @@ export type AWSLambdaOptions<
|
|
|
36
49
|
TRouter extends AnyRouter,
|
|
37
50
|
TEvent extends APIGatewayEvent,
|
|
38
51
|
> =
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @link https://trpc.io/docs/context
|
|
56
|
-
**/
|
|
57
|
-
createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
58
|
-
}
|
|
59
|
-
);
|
|
52
|
+
| HTTPBaseHandlerOptions<TRouter, TEvent> &
|
|
53
|
+
(
|
|
54
|
+
| {
|
|
55
|
+
/**
|
|
56
|
+
* @link https://trpc.io/docs/v11/context
|
|
57
|
+
**/
|
|
58
|
+
createContext: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
59
|
+
}
|
|
60
|
+
| {
|
|
61
|
+
/**
|
|
62
|
+
* @link https://trpc.io/docs/v11/context
|
|
63
|
+
**/
|
|
64
|
+
createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
|
|
65
|
+
}
|
|
66
|
+
);
|
|
60
67
|
|
|
61
68
|
export function isPayloadV1(
|
|
62
69
|
event: APIGatewayEvent,
|
package/src/adapters/express.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
7
|
+
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
import type * as express from 'express';
|
|
2
|
-
import { AnyRouter } from '
|
|
3
|
-
import {
|
|
11
|
+
import type { AnyRouter } from '../@trpc/server';
|
|
12
|
+
import type {
|
|
4
13
|
NodeHTTPCreateContextFnOptions,
|
|
5
14
|
NodeHTTPHandlerOptions,
|
|
6
|
-
nodeHTTPRequestHandler,
|
|
7
15
|
} from './node-http';
|
|
16
|
+
import { nodeHTTPRequestHandler } from './node-http';
|
|
8
17
|
|
|
9
18
|
export type CreateExpressContextOptions = NodeHTTPCreateContextFnOptions<
|
|
10
19
|
express.Request,
|
|
@@ -18,7 +27,12 @@ export function createExpressMiddleware<TRouter extends AnyRouter>(
|
|
|
18
27
|
const endpoint = req.path.slice(1);
|
|
19
28
|
|
|
20
29
|
await nodeHTTPRequestHandler({
|
|
21
|
-
|
|
30
|
+
// FIXME: no typecasting should be needed here
|
|
31
|
+
...(opts as NodeHTTPHandlerOptions<
|
|
32
|
+
AnyRouter,
|
|
33
|
+
express.Request,
|
|
34
|
+
express.Response
|
|
35
|
+
>),
|
|
22
36
|
req,
|
|
23
37
|
res,
|
|
24
38
|
path: endpoint,
|
|
@@ -1,15 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
7
|
+
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
import { Readable } from 'node:stream';
|
|
2
|
-
import { FastifyReply, FastifyRequest } from 'fastify';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
11
|
+
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
12
|
+
// @trpc/server
|
|
13
|
+
import type { AnyRouter } from '../../@trpc/server';
|
|
14
|
+
import type {
|
|
6
15
|
HTTPBaseHandlerOptions,
|
|
7
16
|
HTTPRequest,
|
|
17
|
+
HTTPResponse,
|
|
8
18
|
ResolveHTTPRequestOptionsContextFn,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
|
|
19
|
+
ResponseChunk,
|
|
20
|
+
} from '../../@trpc/server/http';
|
|
21
|
+
import {
|
|
22
|
+
getBatchStreamFormatter,
|
|
23
|
+
resolveHTTPResponse,
|
|
24
|
+
} from '../../@trpc/server/http';
|
|
25
|
+
import type { NodeHTTPCreateContextOption } from '../node-http';
|
|
13
26
|
|
|
14
27
|
export type FastifyHandlerOptions<
|
|
15
28
|
TRouter extends AnyRouter,
|
|
@@ -96,12 +109,9 @@ export async function fastifyRequestHandler<
|
|
|
96
109
|
};
|
|
97
110
|
|
|
98
111
|
resolveHTTPResponse({
|
|
112
|
+
...opts,
|
|
99
113
|
req,
|
|
100
114
|
createContext,
|
|
101
|
-
path: opts.path,
|
|
102
|
-
router: opts.router,
|
|
103
|
-
batching: opts.batching,
|
|
104
|
-
responseMeta: opts.responseMeta,
|
|
105
115
|
onError(o) {
|
|
106
116
|
opts?.onError?.({ ...o, req: opts.req });
|
|
107
117
|
},
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
7
|
+
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
1
10
|
/// <reference types="@fastify/websocket" />
|
|
2
|
-
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
3
|
-
import { FastifyHandlerOptions } from '.';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
11
|
+
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
12
|
+
import type { FastifyHandlerOptions } from '.';
|
|
13
|
+
// @trpc/server
|
|
14
|
+
import type { AnyRouter } from '../../@trpc/server';
|
|
15
|
+
import type { NodeHTTPCreateContextFnOptions } from '../node-http';
|
|
16
|
+
import type { WSSHandlerOptions } from '../ws';
|
|
17
|
+
import { getWSConnectionHandler } from '../ws';
|
|
7
18
|
import { fastifyRequestHandler } from './fastifyRequestHandler';
|
|
8
19
|
|
|
9
20
|
export interface FastifyTRPCPluginOptions<TRouter extends AnyRouter> {
|
|
@@ -45,12 +56,13 @@ export function fastifyTRPCPlugin<TRouter extends AnyRouter>(
|
|
|
45
56
|
});
|
|
46
57
|
|
|
47
58
|
if (opts.useWSS) {
|
|
48
|
-
|
|
59
|
+
const onConnection = getWSConnectionHandler<TRouter>({
|
|
49
60
|
...(opts.trpcOptions as unknown as WSSHandlerOptions<TRouter>),
|
|
50
|
-
wss: fastify.websocketServer,
|
|
51
61
|
});
|
|
52
|
-
|
|
53
|
-
fastify.get(prefix ?? '/', { websocket: true }, () =>
|
|
62
|
+
|
|
63
|
+
fastify.get(prefix ?? '/', { websocket: true }, (socket, req) =>
|
|
64
|
+
onConnection(socket, req.raw),
|
|
65
|
+
);
|
|
54
66
|
}
|
|
55
67
|
|
|
56
68
|
done();
|