@trpc/server 11.0.0-alpha-tmp-export-from-main-nuke-core.240 → 11.0.0-alpha-tmp-export-from-main.222
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/dist/adapters/aws-lambda/index.d.mts +68 -0
- package/dist/adapters/aws-lambda/index.d.ts +55 -6
- package/dist/adapters/aws-lambda/index.js +111 -23
- package/dist/adapters/aws-lambda/index.mjs +95 -7
- package/dist/adapters/express.d.mts +19 -0
- package/dist/adapters/express.d.ts +10 -6
- package/dist/adapters/express.js +3 -3
- package/dist/adapters/express.mjs +1 -1
- package/dist/adapters/fastify/index.d.mts +33 -0
- package/dist/adapters/fastify/index.d.ts +33 -3
- package/dist/adapters/fastify/index.js +124 -5
- package/dist/adapters/fastify/index.mjs +125 -2
- package/dist/adapters/fetch/index.d.mts +51 -0
- package/dist/adapters/fetch/index.d.ts +51 -3
- package/dist/adapters/fetch/index.js +115 -4
- package/dist/adapters/fetch/index.mjs +116 -1
- package/dist/adapters/next.d.mts +21 -0
- package/dist/adapters/next.d.ts +12 -6
- package/dist/adapters/next.js +7 -9
- package/dist/adapters/next.mjs +3 -5
- package/dist/adapters/node-http/content-type/form-data/index.d.mts +219 -0
- package/dist/adapters/node-http/content-type/form-data/index.d.ts +201 -10
- package/dist/adapters/node-http/content-type/form-data/index.js +662 -23
- package/dist/adapters/node-http/content-type/form-data/index.mjs +646 -10
- package/dist/adapters/node-http/{types.d.ts → content-type/json/index.d.mts} +22 -15
- package/dist/adapters/node-http/content-type/json/index.d.ts +89 -2
- package/dist/adapters/node-http/content-type/json/index.js +48 -9
- package/dist/adapters/node-http/content-type/json/index.mjs +44 -5
- package/dist/adapters/node-http/index.d.mts +100 -0
- package/dist/adapters/node-http/index.d.ts +100 -3
- package/dist/adapters/node-http/index.js +106 -4
- package/dist/adapters/node-http/index.mjs +107 -1
- package/dist/adapters/standalone.d.mts +21 -0
- package/dist/adapters/standalone.d.ts +12 -9
- package/dist/adapters/standalone.js +9 -6
- package/dist/adapters/standalone.mjs +2 -3
- package/dist/adapters/ws.d.mts +36 -0
- package/dist/adapters/ws.d.ts +12 -14
- package/dist/adapters/ws.js +33 -38
- package/dist/adapters/ws.mjs +12 -17
- package/dist/http.d.mts +1 -0
- package/dist/http.d.ts +1 -2
- package/dist/http.js +22 -12
- package/dist/http.mjs +1 -6
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.js +809 -23
- package/dist/index.mjs +798 -8
- package/dist/observable.d.mts +1 -0
- package/dist/observable.d.ts +1 -0
- package/dist/observable.js +30 -0
- package/dist/observable.mjs +1 -0
- package/dist/rpc.d.mts +1 -0
- package/dist/rpc.d.ts +1 -2
- package/dist/rpc.js +14 -7
- package/dist/rpc.mjs +1 -3
- package/dist/shared.d.mts +1 -0
- package/dist/shared.d.ts +1 -26
- package/dist/shared.js +10 -7
- package/dist/shared.mjs +1 -4
- package/dist/unstableDontImportMe.d.mts +1 -0
- package/dist/unstableDontImportMe.d.ts +1 -0
- package/dist/unstableDontImportMe.js +1549 -0
- package/dist/unstableDontImportMe.mjs +1514 -0
- package/package.json +138 -53
- package/src/@trpc-server/http.ts +2 -0
- package/src/adapters/aws-lambda/index.ts +5 -4
- package/src/adapters/aws-lambda/utils.ts +4 -3
- package/src/adapters/express.ts +3 -1
- package/src/adapters/fastify/fastifyRequestHandler.ts +4 -6
- package/src/adapters/fastify/fastifyTRPCPlugin.ts +2 -1
- package/src/adapters/fetch/fetchRequestHandler.ts +4 -6
- package/src/adapters/fetch/types.ts +3 -2
- package/src/adapters/next.ts +4 -2
- package/src/adapters/node-http/content-type/form-data/index.ts +1 -1
- package/src/adapters/node-http/content-type/json/getPostBody.ts +2 -2
- package/src/adapters/node-http/content-type/json/index.ts +1 -1
- package/src/adapters/node-http/internals/contentType.ts +2 -2
- package/src/adapters/node-http/nodeHTTPRequestHandler.ts +4 -6
- package/src/adapters/node-http/types.ts +5 -4
- package/src/adapters/standalone.ts +2 -2
- package/src/adapters/ws.ts +13 -14
- package/src/http.ts +26 -1
- package/src/index.ts +106 -1
- package/src/observable.ts +16 -0
- package/src/rpc.ts +26 -1
- package/src/shared.ts +1 -1
- package/src/unstableDontImportMe.ts +146 -0
- package/unstableDontImportMe/index.d.ts +1 -0
- package/unstableDontImportMe/index.js +1 -0
- package/dist/@trpc/server/http.d.ts +0 -7
- package/dist/@trpc/server/http.d.ts.map +0 -1
- package/dist/@trpc/server/index.d.ts +0 -69
- package/dist/@trpc/server/index.d.ts.map +0 -1
- package/dist/@trpc/server/rpc.d.ts +0 -3
- package/dist/@trpc/server/rpc.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/index.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/utils.d.ts +0 -47
- package/dist/adapters/aws-lambda/utils.d.ts.map +0 -1
- package/dist/adapters/aws-lambda/utils.js +0 -101
- package/dist/adapters/aws-lambda/utils.mjs +0 -94
- package/dist/adapters/express.d.ts.map +0 -1
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +0 -13
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +0 -1
- package/dist/adapters/fastify/fastifyRequestHandler.js +0 -84
- package/dist/adapters/fastify/fastifyRequestHandler.mjs +0 -82
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +0 -21
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +0 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.js +0 -50
- package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +0 -48
- package/dist/adapters/fastify/index.d.ts.map +0 -1
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +0 -17
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +0 -1
- package/dist/adapters/fetch/fetchRequestHandler.js +0 -120
- package/dist/adapters/fetch/fetchRequestHandler.mjs +0 -118
- package/dist/adapters/fetch/index.d.ts.map +0 -1
- package/dist/adapters/fetch/types.d.ts +0 -30
- package/dist/adapters/fetch/types.d.ts.map +0 -1
- package/dist/adapters/next.d.ts.map +0 -1
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts +0 -70
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts.map +0 -1
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.js +0 -161
- package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.mjs +0 -157
- package/dist/adapters/node-http/content-type/form-data/index.d.ts.map +0 -1
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts +0 -31
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts.map +0 -1
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.js +0 -29
- package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.mjs +0 -27
- package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts +0 -16
- package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts.map +0 -1
- package/dist/adapters/node-http/content-type/form-data/streamSlice.js +0 -46
- package/dist/adapters/node-http/content-type/form-data/streamSlice.mjs +0 -44
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts +0 -45
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts.map +0 -1
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.js +0 -30
- package/dist/adapters/node-http/content-type/form-data/uploadHandler.mjs +0 -26
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +0 -7
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +0 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.js +0 -44
- package/dist/adapters/node-http/content-type/json/getPostBody.mjs +0 -42
- package/dist/adapters/node-http/content-type/json/index.d.ts.map +0 -1
- package/dist/adapters/node-http/index.d.ts.map +0 -1
- package/dist/adapters/node-http/internals/contentType.d.ts +0 -9
- package/dist/adapters/node-http/internals/contentType.d.ts.map +0 -1
- package/dist/adapters/node-http/internals/contentType.js +0 -8
- package/dist/adapters/node-http/internals/contentType.mjs +0 -6
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +0 -13
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +0 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.js +0 -111
- package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +0 -109
- package/dist/adapters/node-http/types.d.ts.map +0 -1
- package/dist/adapters/standalone.d.ts.map +0 -1
- package/dist/adapters/ws.d.ts.map +0 -1
- package/dist/bundle-analysis.json +0 -757
- package/dist/http.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/index.js +0 -203
- package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/index.mjs +0 -201
- package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/search.js +0 -167
- package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/search.mjs +0 -163
- package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/utils.js +0 -35
- package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/utils.mjs +0 -30
- package/dist/observable/index.d.ts +0 -5
- package/dist/observable/index.d.ts.map +0 -1
- package/dist/observable/index.js +0 -13
- package/dist/observable/index.mjs +0 -2
- package/dist/observable/observable.d.ts +0 -13
- package/dist/observable/observable.d.ts.map +0 -1
- package/dist/observable/observable.js +0 -126
- package/dist/observable/observable.mjs +0 -122
- package/dist/observable/operators.d.ts +0 -8
- package/dist/observable/operators.d.ts.map +0 -1
- package/dist/observable/operators.js +0 -103
- package/dist/observable/operators.mjs +0 -99
- package/dist/observable/types.d.ts +0 -26
- package/dist/observable/types.d.ts.map +0 -1
- package/dist/rpc.d.ts.map +0 -1
- package/dist/shared.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +0 -6
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/createProxy.d.ts +0 -19
- package/dist/unstable-core-do-not-import/createProxy.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/createProxy.js +0 -52
- package/dist/unstable-core-do-not-import/createProxy.mjs +0 -49
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +0 -13
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.js +0 -67
- package/dist/unstable-core-do-not-import/error/TRPCError.mjs +0 -63
- package/dist/unstable-core-do-not-import/error/formatter.d.ts +0 -33
- package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/formatter.js +0 -7
- package/dist/unstable-core-do-not-import/error/formatter.mjs +0 -5
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +0 -15
- package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/error/getErrorShape.js +0 -31
- package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +0 -29
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +0 -24
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.js +0 -32
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.mjs +0 -30
- package/dist/unstable-core-do-not-import/http/contentType.d.ts +0 -29
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/contentType.js +0 -54
- package/dist/unstable-core-do-not-import/http/contentType.mjs +0 -52
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +0 -5
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +0 -51
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +0 -48
- package/dist/unstable-core-do-not-import/http/index.d.ts +0 -7
- package/dist/unstable-core-do-not-import/http/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +0 -51
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.js +0 -295
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs +0 -293
- package/dist/unstable-core-do-not-import/http/types.d.ts +0 -96
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/index.d.ts +0 -37
- package/dist/unstable-core-do-not-import/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/index.js +0 -48
- package/dist/unstable-core-do-not-import/index.mjs +0 -16
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +0 -96
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/initTRPC.js +0 -95
- package/dist/unstable-core-do-not-import/initTRPC.mjs +0 -93
- package/dist/unstable-core-do-not-import/middleware.d.ts +0 -105
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/middleware.js +0 -95
- package/dist/unstable-core-do-not-import/middleware.mjs +0 -89
- package/dist/unstable-core-do-not-import/parser.d.ts +0 -30
- package/dist/unstable-core-do-not-import/parser.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/parser.js +0 -37
- package/dist/unstable-core-do-not-import/parser.mjs +0 -35
- package/dist/unstable-core-do-not-import/procedure.d.ts +0 -72
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/procedure.js +0 -9
- package/dist/unstable-core-do-not-import/procedure.mjs +0 -7
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +0 -101
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.js +0 -176
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +0 -173
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +0 -75
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rootConfig.js +0 -8
- package/dist/unstable-core-do-not-import/rootConfig.mjs +0 -6
- package/dist/unstable-core-do-not-import/router.d.ts +0 -85
- package/dist/unstable-core-do-not-import/router.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/router.js +0 -156
- package/dist/unstable-core-do-not-import/router.mjs +0 -151
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +0 -51
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/codes.js +0 -38
- package/dist/unstable-core-do-not-import/rpc/codes.mjs +0 -35
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +0 -97
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/index.d.ts +0 -5
- package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +0 -5
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +0 -59
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +0 -57
- package/dist/unstable-core-do-not-import/serialize.d.ts +0 -62
- package/dist/unstable-core-do-not-import/serialize.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/transformer.d.ts +0 -107
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/transformer.js +0 -107
- package/dist/unstable-core-do-not-import/transformer.mjs +0 -102
- package/dist/unstable-core-do-not-import/types.d.ts +0 -98
- package/dist/unstable-core-do-not-import/types.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/utils.d.ts +0 -27
- package/dist/unstable-core-do-not-import/utils.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/utils.js +0 -44
- package/dist/unstable-core-do-not-import/utils.mjs +0 -39
- package/src/@trpc/server/http.ts +0 -26
- package/src/@trpc/server/index.ts +0 -105
- package/src/@trpc/server/rpc.ts +0 -26
- package/src/observable/index.ts +0 -10
- package/src/observable/observable.ts +0 -158
- package/src/observable/operators.ts +0 -119
- package/src/observable/types.ts +0 -76
- package/src/unstable-core-do-not-import/TRPCInferrable.ts +0 -9
- package/src/unstable-core-do-not-import/createProxy.ts +0 -59
- package/src/unstable-core-do-not-import/error/TRPCError.ts +0 -82
- package/src/unstable-core-do-not-import/error/formatter.ts +0 -51
- package/src/unstable-core-do-not-import/error/getErrorShape.ts +0 -36
- package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +0 -29
- package/src/unstable-core-do-not-import/http/contentType.ts +0 -99
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +0 -57
- package/src/unstable-core-do-not-import/http/index.ts +0 -23
- package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +0 -458
- package/src/unstable-core-do-not-import/http/types.ts +0 -111
- package/src/unstable-core-do-not-import/index.ts +0 -110
- package/src/unstable-core-do-not-import/initTRPC.ts +0 -206
- package/src/unstable-core-do-not-import/middleware.ts +0 -233
- package/src/unstable-core-do-not-import/parser.ts +0 -94
- package/src/unstable-core-do-not-import/procedure.ts +0 -108
- package/src/unstable-core-do-not-import/procedureBuilder.ts +0 -458
- package/src/unstable-core-do-not-import/rootConfig.ts +0 -90
- package/src/unstable-core-do-not-import/router.ts +0 -370
- package/src/unstable-core-do-not-import/rpc/codes.ts +0 -44
- package/src/unstable-core-do-not-import/rpc/envelopes.ts +0 -136
- package/src/unstable-core-do-not-import/rpc/index.ts +0 -21
- package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +0 -85
- package/src/unstable-core-do-not-import/serialize.ts +0 -122
- package/src/unstable-core-do-not-import/transformer.ts +0 -202
- package/src/unstable-core-do-not-import/types.ts +0 -151
- package/src/unstable-core-do-not-import/utils.ts +0 -59
- package/unstable-core-do-not-import/index.d.ts +0 -1
- package/unstable-core-do-not-import/index.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-alpha-tmp-export-from-main
|
|
3
|
+
"version": "11.0.0-alpha-tmp-export-from-main.222+af7867f57",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"directory": "packages/server"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "
|
|
17
|
+
"build": "bunchee",
|
|
18
|
+
"build-r": "rollup --config rollup.config.ts --configPlugin rollup-plugin-swc3",
|
|
18
19
|
"dev": "pnpm build --watch",
|
|
19
20
|
"codegen-entrypoints": "tsx entrypoints.script.ts",
|
|
20
21
|
"benchmark": "tsc --project tsconfig.benchmark.json",
|
|
@@ -24,84 +25,164 @@
|
|
|
24
25
|
"exports": {
|
|
25
26
|
"./package.json": "./package.json",
|
|
26
27
|
".": {
|
|
27
|
-
"import":
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.mjs"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
}
|
|
30
36
|
},
|
|
31
37
|
"./adapters/aws-lambda": {
|
|
32
|
-
"import":
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
"import": {
|
|
39
|
+
"types": "./dist/adapters/aws-lambda/index.d.ts",
|
|
40
|
+
"default": "./dist/adapters/aws-lambda/index.mjs"
|
|
41
|
+
},
|
|
42
|
+
"require": {
|
|
43
|
+
"types": "./dist/adapters/aws-lambda/index.d.ts",
|
|
44
|
+
"default": "./dist/adapters/aws-lambda/index.js"
|
|
45
|
+
}
|
|
35
46
|
},
|
|
36
47
|
"./adapters/express": {
|
|
37
|
-
"import":
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
"import": {
|
|
49
|
+
"types": "./dist/adapters/express.d.ts",
|
|
50
|
+
"default": "./dist/adapters/express.mjs"
|
|
51
|
+
},
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./dist/adapters/express.d.ts",
|
|
54
|
+
"default": "./dist/adapters/express.js"
|
|
55
|
+
}
|
|
40
56
|
},
|
|
41
57
|
"./adapters/fastify": {
|
|
42
|
-
"import":
|
|
43
|
-
|
|
44
|
-
|
|
58
|
+
"import": {
|
|
59
|
+
"types": "./dist/adapters/fastify/index.d.ts",
|
|
60
|
+
"default": "./dist/adapters/fastify/index.mjs"
|
|
61
|
+
},
|
|
62
|
+
"require": {
|
|
63
|
+
"types": "./dist/adapters/fastify/index.d.ts",
|
|
64
|
+
"default": "./dist/adapters/fastify/index.js"
|
|
65
|
+
}
|
|
45
66
|
},
|
|
46
67
|
"./adapters/fetch": {
|
|
47
|
-
"import":
|
|
48
|
-
|
|
49
|
-
|
|
68
|
+
"import": {
|
|
69
|
+
"types": "./dist/adapters/fetch/index.d.ts",
|
|
70
|
+
"default": "./dist/adapters/fetch/index.mjs"
|
|
71
|
+
},
|
|
72
|
+
"require": {
|
|
73
|
+
"types": "./dist/adapters/fetch/index.d.ts",
|
|
74
|
+
"default": "./dist/adapters/fetch/index.js"
|
|
75
|
+
}
|
|
50
76
|
},
|
|
51
77
|
"./adapters/next": {
|
|
52
|
-
"import":
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
"import": {
|
|
79
|
+
"types": "./dist/adapters/next.d.ts",
|
|
80
|
+
"default": "./dist/adapters/next.mjs"
|
|
81
|
+
},
|
|
82
|
+
"require": {
|
|
83
|
+
"types": "./dist/adapters/next.d.ts",
|
|
84
|
+
"default": "./dist/adapters/next.js"
|
|
85
|
+
}
|
|
55
86
|
},
|
|
56
87
|
"./adapters/node-http/content-type/form-data": {
|
|
57
|
-
"import":
|
|
58
|
-
|
|
59
|
-
|
|
88
|
+
"import": {
|
|
89
|
+
"types": "./dist/adapters/node-http/content-type/form-data/index.d.ts",
|
|
90
|
+
"default": "./dist/adapters/node-http/content-type/form-data/index.mjs"
|
|
91
|
+
},
|
|
92
|
+
"require": {
|
|
93
|
+
"types": "./dist/adapters/node-http/content-type/form-data/index.d.ts",
|
|
94
|
+
"default": "./dist/adapters/node-http/content-type/form-data/index.js"
|
|
95
|
+
}
|
|
60
96
|
},
|
|
61
97
|
"./adapters/node-http/content-type/json": {
|
|
62
|
-
"import":
|
|
63
|
-
|
|
64
|
-
|
|
98
|
+
"import": {
|
|
99
|
+
"types": "./dist/adapters/node-http/content-type/json/index.d.ts",
|
|
100
|
+
"default": "./dist/adapters/node-http/content-type/json/index.mjs"
|
|
101
|
+
},
|
|
102
|
+
"require": {
|
|
103
|
+
"types": "./dist/adapters/node-http/content-type/json/index.d.ts",
|
|
104
|
+
"default": "./dist/adapters/node-http/content-type/json/index.js"
|
|
105
|
+
}
|
|
65
106
|
},
|
|
66
107
|
"./adapters/node-http": {
|
|
67
|
-
"import":
|
|
68
|
-
|
|
69
|
-
|
|
108
|
+
"import": {
|
|
109
|
+
"types": "./dist/adapters/node-http/index.d.ts",
|
|
110
|
+
"default": "./dist/adapters/node-http/index.mjs"
|
|
111
|
+
},
|
|
112
|
+
"require": {
|
|
113
|
+
"types": "./dist/adapters/node-http/index.d.ts",
|
|
114
|
+
"default": "./dist/adapters/node-http/index.js"
|
|
115
|
+
}
|
|
70
116
|
},
|
|
71
117
|
"./adapters/standalone": {
|
|
72
|
-
"import":
|
|
73
|
-
|
|
74
|
-
|
|
118
|
+
"import": {
|
|
119
|
+
"types": "./dist/adapters/standalone.d.ts",
|
|
120
|
+
"default": "./dist/adapters/standalone.mjs"
|
|
121
|
+
},
|
|
122
|
+
"require": {
|
|
123
|
+
"types": "./dist/adapters/standalone.d.ts",
|
|
124
|
+
"default": "./dist/adapters/standalone.js"
|
|
125
|
+
}
|
|
75
126
|
},
|
|
76
127
|
"./adapters/ws": {
|
|
77
|
-
"import":
|
|
78
|
-
|
|
79
|
-
|
|
128
|
+
"import": {
|
|
129
|
+
"types": "./dist/adapters/ws.d.ts",
|
|
130
|
+
"default": "./dist/adapters/ws.mjs"
|
|
131
|
+
},
|
|
132
|
+
"require": {
|
|
133
|
+
"types": "./dist/adapters/ws.d.ts",
|
|
134
|
+
"default": "./dist/adapters/ws.js"
|
|
135
|
+
}
|
|
80
136
|
},
|
|
81
137
|
"./http": {
|
|
82
|
-
"import":
|
|
83
|
-
|
|
84
|
-
|
|
138
|
+
"import": {
|
|
139
|
+
"types": "./dist/http.d.ts",
|
|
140
|
+
"default": "./dist/http.mjs"
|
|
141
|
+
},
|
|
142
|
+
"require": {
|
|
143
|
+
"types": "./dist/http.d.ts",
|
|
144
|
+
"default": "./dist/http.js"
|
|
145
|
+
}
|
|
85
146
|
},
|
|
86
147
|
"./observable": {
|
|
87
|
-
"import":
|
|
88
|
-
|
|
89
|
-
|
|
148
|
+
"import": {
|
|
149
|
+
"types": "./dist/observable.d.ts",
|
|
150
|
+
"default": "./dist/observable.mjs"
|
|
151
|
+
},
|
|
152
|
+
"require": {
|
|
153
|
+
"types": "./dist/observable.d.ts",
|
|
154
|
+
"default": "./dist/observable.js"
|
|
155
|
+
}
|
|
90
156
|
},
|
|
91
157
|
"./rpc": {
|
|
92
|
-
"import":
|
|
93
|
-
|
|
94
|
-
|
|
158
|
+
"import": {
|
|
159
|
+
"types": "./dist/rpc.d.ts",
|
|
160
|
+
"default": "./dist/rpc.mjs"
|
|
161
|
+
},
|
|
162
|
+
"require": {
|
|
163
|
+
"types": "./dist/rpc.d.ts",
|
|
164
|
+
"default": "./dist/rpc.js"
|
|
165
|
+
}
|
|
95
166
|
},
|
|
96
167
|
"./shared": {
|
|
97
|
-
"import":
|
|
98
|
-
|
|
99
|
-
|
|
168
|
+
"import": {
|
|
169
|
+
"types": "./dist/shared.d.ts",
|
|
170
|
+
"default": "./dist/shared.mjs"
|
|
171
|
+
},
|
|
172
|
+
"require": {
|
|
173
|
+
"types": "./dist/shared.d.ts",
|
|
174
|
+
"default": "./dist/shared.js"
|
|
175
|
+
}
|
|
100
176
|
},
|
|
101
|
-
"./
|
|
102
|
-
"import":
|
|
103
|
-
|
|
104
|
-
|
|
177
|
+
"./unstableDontImportMe": {
|
|
178
|
+
"import": {
|
|
179
|
+
"types": "./dist/unstableDontImportMe.d.ts",
|
|
180
|
+
"default": "./dist/unstableDontImportMe.mjs"
|
|
181
|
+
},
|
|
182
|
+
"require": {
|
|
183
|
+
"types": "./dist/unstableDontImportMe.d.ts",
|
|
184
|
+
"default": "./dist/unstableDontImportMe.js"
|
|
185
|
+
}
|
|
105
186
|
}
|
|
106
187
|
},
|
|
107
188
|
"files": [
|
|
@@ -114,12 +195,15 @@
|
|
|
114
195
|
"observable",
|
|
115
196
|
"rpc",
|
|
116
197
|
"shared",
|
|
117
|
-
"
|
|
198
|
+
"unstableDontImportMe",
|
|
118
199
|
"!**/*.test.*"
|
|
119
200
|
],
|
|
120
201
|
"publishConfig": {
|
|
121
202
|
"access": "public"
|
|
122
203
|
},
|
|
204
|
+
"dependencies": {
|
|
205
|
+
"@trpc/core": "11.0.0-alpha-tmp-export-from-main.222+af7867f57"
|
|
206
|
+
},
|
|
123
207
|
"devDependencies": {
|
|
124
208
|
"@fastify/websocket": "^7.1.2",
|
|
125
209
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -132,6 +216,7 @@
|
|
|
132
216
|
"@types/ws": "^8.2.0",
|
|
133
217
|
"@web3-storage/multipart-parser": "^1.0.0",
|
|
134
218
|
"aws-lambda": "^1.0.7",
|
|
219
|
+
"bunchee": "4.4.1",
|
|
135
220
|
"devalue": "^4.0.0",
|
|
136
221
|
"eslint": "^8.40.0",
|
|
137
222
|
"express": "^4.17.1",
|
|
@@ -157,5 +242,5 @@
|
|
|
157
242
|
"funding": [
|
|
158
243
|
"https://trpc.io/sponsor"
|
|
159
244
|
],
|
|
160
|
-
"gitHead": "
|
|
245
|
+
"gitHead": "af7867f578c243ea1e10f0a8357094d43756d7d4"
|
|
161
246
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -15,15 +16,15 @@ import type {
|
|
|
15
16
|
Context as APIGWContext,
|
|
16
17
|
} from 'aws-lambda';
|
|
17
18
|
// @trpc/server
|
|
18
|
-
import type { AnyRouter } from '
|
|
19
|
+
import type { AnyRouter } from '../..';
|
|
19
20
|
// @trpc/server
|
|
20
|
-
import { TRPCError } from '
|
|
21
|
+
import { TRPCError } from '../..';
|
|
21
22
|
import type {
|
|
22
23
|
HTTPRequest,
|
|
23
24
|
HTTPResponse,
|
|
24
25
|
ResolveHTTPRequestOptionsContextFn,
|
|
25
|
-
} from '
|
|
26
|
-
import { resolveHTTPResponse } from '
|
|
26
|
+
} from '../../http';
|
|
27
|
+
import { resolveHTTPResponse } from '../../http';
|
|
27
28
|
import type {
|
|
28
29
|
APIGatewayEvent,
|
|
29
30
|
APIGatewayResult,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -14,16 +15,16 @@ import type {
|
|
|
14
15
|
APIGatewayProxyStructuredResultV2,
|
|
15
16
|
Context as APIGWContext,
|
|
16
17
|
} from 'aws-lambda';
|
|
17
|
-
import type { AnyRouter, inferRouterContext } from '
|
|
18
|
+
import type { AnyRouter, inferRouterContext } from '../..'; // import @trpc/server
|
|
18
19
|
|
|
19
20
|
// @trpc/server
|
|
20
|
-
import { TRPCError } from '
|
|
21
|
+
import { TRPCError } from '../..';
|
|
21
22
|
import type {
|
|
22
23
|
HTTPHeaders,
|
|
23
24
|
OnErrorFunction,
|
|
24
25
|
ResponseMetaFn,
|
|
25
26
|
TRPCRequestInfo,
|
|
26
|
-
} from '
|
|
27
|
+
} from '../../http';
|
|
27
28
|
|
|
28
29
|
export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
|
|
29
30
|
export type APIGatewayResult =
|
package/src/adapters/express.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -8,7 +9,8 @@
|
|
|
8
9
|
* ```
|
|
9
10
|
*/
|
|
10
11
|
import type * as express from 'express';
|
|
11
|
-
|
|
12
|
+
// @trpc/server
|
|
13
|
+
import type { AnyRouter } from '..';
|
|
12
14
|
import type {
|
|
13
15
|
NodeHTTPCreateContextFnOptions,
|
|
14
16
|
NodeHTTPHandlerOptions,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -10,18 +11,15 @@
|
|
|
10
11
|
import { Readable } from 'node:stream';
|
|
11
12
|
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
12
13
|
// @trpc/server
|
|
13
|
-
import type { AnyRouter } from '
|
|
14
|
+
import type { AnyRouter } from '../..';
|
|
14
15
|
import type {
|
|
15
16
|
HTTPBaseHandlerOptions,
|
|
16
17
|
HTTPRequest,
|
|
17
18
|
HTTPResponse,
|
|
18
19
|
ResolveHTTPRequestOptionsContextFn,
|
|
19
20
|
ResponseChunk,
|
|
20
|
-
} from '
|
|
21
|
-
import {
|
|
22
|
-
getBatchStreamFormatter,
|
|
23
|
-
resolveHTTPResponse,
|
|
24
|
-
} from '../../@trpc/server/http';
|
|
21
|
+
} from '../../http';
|
|
22
|
+
import { getBatchStreamFormatter, resolveHTTPResponse } from '../../http';
|
|
25
23
|
import type { NodeHTTPCreateContextOption } from '../node-http';
|
|
26
24
|
|
|
27
25
|
export type FastifyHandlerOptions<
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
12
13
|
import type { FastifyHandlerOptions } from '.';
|
|
13
14
|
// @trpc/server
|
|
14
|
-
import type { AnyRouter } from '
|
|
15
|
+
import type { AnyRouter } from '../..';
|
|
15
16
|
import type { NodeHTTPCreateContextFnOptions } from '../node-http';
|
|
16
17
|
import type { WSSHandlerOptions } from '../ws';
|
|
17
18
|
import { applyWSSHandler } from '../ws';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -8,17 +9,14 @@
|
|
|
8
9
|
* ```
|
|
9
10
|
*/
|
|
10
11
|
// @trpc/server
|
|
11
|
-
import type { AnyRouter } from '
|
|
12
|
+
import type { AnyRouter } from '../..';
|
|
12
13
|
import type {
|
|
13
14
|
HTTPRequest,
|
|
14
15
|
HTTPResponse,
|
|
15
16
|
ResolveHTTPRequestOptionsContextFn,
|
|
16
17
|
ResponseChunk,
|
|
17
|
-
} from '
|
|
18
|
-
import {
|
|
19
|
-
getBatchStreamFormatter,
|
|
20
|
-
resolveHTTPResponse,
|
|
21
|
-
} from '../../@trpc/server/http';
|
|
18
|
+
} from '../../http';
|
|
19
|
+
import { getBatchStreamFormatter, resolveHTTPResponse } from '../../http';
|
|
22
20
|
import type { FetchHandlerOptions } from './types';
|
|
23
21
|
|
|
24
22
|
export type FetchHandlerRequestOptions<TRouter extends AnyRouter> =
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -8,12 +9,12 @@
|
|
|
8
9
|
* ```
|
|
9
10
|
*/
|
|
10
11
|
// @trpc/server
|
|
11
|
-
import type { AnyRouter, inferRouterContext } from '
|
|
12
|
+
import type { AnyRouter, inferRouterContext } from '../..';
|
|
12
13
|
// @trpc/server/http
|
|
13
14
|
import type {
|
|
14
15
|
HTTPBaseHandlerOptions,
|
|
15
16
|
TRPCRequestInfo,
|
|
16
|
-
} from '../../@trpc
|
|
17
|
+
} from '../../@trpc-server/http';
|
|
17
18
|
|
|
18
19
|
export type FetchCreateContextFnOptions = {
|
|
19
20
|
req: Request;
|
package/src/adapters/next.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -9,9 +10,9 @@
|
|
|
9
10
|
*/
|
|
10
11
|
import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
11
12
|
// @trpc/server
|
|
12
|
-
import type { AnyRouter } from '
|
|
13
|
+
import type { AnyRouter } from '..';
|
|
13
14
|
// @trpc/server
|
|
14
|
-
import { getErrorShape, TRPCError } from '
|
|
15
|
+
import { getErrorShape, TRPCError } from '..';
|
|
15
16
|
import type {
|
|
16
17
|
NodeHTTPCreateContextFnOptions,
|
|
17
18
|
NodeHTTPHandlerOptions,
|
|
@@ -22,6 +23,7 @@ export type CreateNextContextOptions = NodeHTTPCreateContextFnOptions<
|
|
|
22
23
|
NextApiRequest,
|
|
23
24
|
NextApiResponse
|
|
24
25
|
>;
|
|
26
|
+
export type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
25
27
|
|
|
26
28
|
export function createNextApiHandler<TRouter extends AnyRouter>(
|
|
27
29
|
opts: NodeHTTPHandlerOptions<TRouter, NextApiRequest, NextApiResponse>,
|
|
@@ -14,7 +14,7 @@ import { Readable } from 'node:stream';
|
|
|
14
14
|
// @ts-ignore the type definitions for this package are borked
|
|
15
15
|
import { streamMultipart } from '@web3-storage/multipart-parser';
|
|
16
16
|
// @trpc/server
|
|
17
|
-
import type { CombinedDataTransformer } from '
|
|
17
|
+
import type { CombinedDataTransformer } from '../../../..';
|
|
18
18
|
import { createNodeHTTPContentTypeHandler } from '../../internals/contentType';
|
|
19
19
|
import type { NodeHTTPRequest } from '../../types';
|
|
20
20
|
import { NodeOnDiskFile } from './fileUploadHandler';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @trpc/server
|
|
2
|
-
import { TRPCError } from '
|
|
3
|
-
import type { BodyResult } from '
|
|
2
|
+
import { TRPCError } from '../../../..';
|
|
3
|
+
import type { BodyResult } from '../../../../http';
|
|
4
4
|
import type { NodeHTTPRequest } from '../../types';
|
|
5
5
|
|
|
6
6
|
export async function getPostBody(opts: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @trpc/server
|
|
2
|
-
import type { AnyRouter } from '
|
|
2
|
+
import type { AnyRouter } from '../../..';
|
|
3
3
|
// @trpc/server/http
|
|
4
|
-
import type { BaseContentTypeHandler } from '../../../@trpc
|
|
4
|
+
import type { BaseContentTypeHandler } from '../../../@trpc-server/http';
|
|
5
5
|
import type {
|
|
6
6
|
NodeHTTPRequest,
|
|
7
7
|
NodeHTTPRequestHandlerOptions,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -9,17 +10,14 @@
|
|
|
9
10
|
*/
|
|
10
11
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
11
12
|
// @trpc/server
|
|
12
|
-
import type { AnyRouter } from '
|
|
13
|
+
import type { AnyRouter } from '../..';
|
|
13
14
|
import type {
|
|
14
15
|
HTTPRequest,
|
|
15
16
|
HTTPResponse,
|
|
16
17
|
ResolveHTTPRequestOptionsContextFn,
|
|
17
18
|
ResponseChunk,
|
|
18
|
-
} from '
|
|
19
|
-
import {
|
|
20
|
-
getBatchStreamFormatter,
|
|
21
|
-
resolveHTTPResponse,
|
|
22
|
-
} from '../../@trpc/server/http';
|
|
19
|
+
} from '../../http';
|
|
20
|
+
import { getBatchStreamFormatter, resolveHTTPResponse } from '../../http';
|
|
23
21
|
import { nodeHTTPJSONContentTypeHandler } from './content-type/json';
|
|
24
22
|
import type { NodeHTTPContentTypeHandler } from './internals/contentType';
|
|
25
23
|
import type {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -8,15 +9,15 @@
|
|
|
8
9
|
* ```
|
|
9
10
|
*/
|
|
10
11
|
import type { IncomingMessage, ServerResponse } from 'http';
|
|
12
|
+
// eslint-disable-next-line no-restricted-imports
|
|
13
|
+
import type { MaybePromise } from '@trpc/core';
|
|
11
14
|
// @trpc/server
|
|
12
|
-
import type { AnyRouter, inferRouterContext } from '
|
|
15
|
+
import type { AnyRouter, inferRouterContext } from '../..';
|
|
13
16
|
// @trpc/server/http
|
|
14
17
|
import type {
|
|
15
18
|
HTTPBaseHandlerOptions,
|
|
16
19
|
TRPCRequestInfo,
|
|
17
|
-
} from '../../@trpc
|
|
18
|
-
// eslint-disable-next-line no-restricted-imports
|
|
19
|
-
import type { MaybePromise } from '../../unstable-core-do-not-import';
|
|
20
|
+
} from '../../@trpc-server/http';
|
|
20
21
|
import type { NodeHTTPContentTypeHandler } from './internals/contentType';
|
|
21
22
|
|
|
22
23
|
interface ParsedQs {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
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
3
|
*
|
|
4
|
+
* Do **not** import from `@trpc/core`
|
|
4
5
|
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
11
12
|
import http from 'http';
|
|
12
13
|
// @trpc/server
|
|
13
|
-
import type { AnyRouter } from '
|
|
14
|
+
import type { AnyRouter } from '..';
|
|
14
15
|
import type {
|
|
15
16
|
NodeHTTPCreateContextFnOptions,
|
|
16
17
|
NodeHTTPHandlerOptions,
|
|
@@ -36,7 +37,6 @@ export function createHTTPHandler<TRouter extends AnyRouter>(
|
|
|
36
37
|
await nodeHTTPRequestHandler({
|
|
37
38
|
// FIXME: no typecasting should be needed here
|
|
38
39
|
...(opts as CreateHTTPHandlerOptions<AnyRouter>),
|
|
39
|
-
...(opts as any),
|
|
40
40
|
req,
|
|
41
41
|
res,
|
|
42
42
|
path,
|
package/src/adapters/ws.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import type { IncomingMessage } from 'http';
|
|
2
|
+
// eslint-disable-next-line no-restricted-imports
|
|
3
|
+
import type {
|
|
4
|
+
BaseHandlerOptions,
|
|
5
|
+
JSONRPC2,
|
|
6
|
+
MaybePromise,
|
|
7
|
+
TRPCClientOutgoingMessage,
|
|
8
|
+
TRPCReconnectNotification,
|
|
9
|
+
TRPCResponseMessage,
|
|
10
|
+
Unsubscribable,
|
|
11
|
+
} from '@trpc/core';
|
|
2
12
|
import type ws from 'ws';
|
|
3
|
-
import type { AnyRouter, inferRouterContext } from '
|
|
13
|
+
import type { AnyRouter, inferRouterContext } from '..';
|
|
4
14
|
import {
|
|
5
15
|
callProcedure,
|
|
6
16
|
getErrorShape,
|
|
7
17
|
getTRPCErrorFromUnknown,
|
|
8
18
|
transformTRPCResponse,
|
|
9
19
|
TRPCError,
|
|
10
|
-
} from '
|
|
11
|
-
import type { BaseHandlerOptions } from '../@trpc/server/http';
|
|
12
|
-
import { parseTRPCMessage } from '../@trpc/server/rpc';
|
|
13
|
-
// @trpc/server/rpc
|
|
14
|
-
import type {
|
|
15
|
-
JSONRPC2,
|
|
16
|
-
TRPCClientOutgoingMessage,
|
|
17
|
-
TRPCReconnectNotification,
|
|
18
|
-
TRPCResponseMessage,
|
|
19
|
-
} from '../@trpc/server/rpc';
|
|
20
|
+
} from '..';
|
|
20
21
|
import { isObservable } from '../observable';
|
|
21
|
-
import
|
|
22
|
-
// eslint-disable-next-line no-restricted-imports
|
|
23
|
-
import type { MaybePromise } from '../unstable-core-do-not-import';
|
|
22
|
+
import { parseTRPCMessage } from '../rpc';
|
|
24
23
|
import type { NodeHTTPCreateContextFnOptions } from './node-http';
|
|
25
24
|
|
|
26
25
|
/**
|