@trpc/server 11.0.0-alpha-tmp-subscription-connection-state.488 → 11.0.0-alpha-tmp-12-06-react.665
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/@trpc/server/http.d.ts +1 -1
- package/dist/@trpc/server/http.d.ts.map +1 -1
- package/dist/@trpc/server/index.d.ts +5 -1
- package/dist/@trpc/server/index.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/getPlanner.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/getPlanner.js +2 -2
- package/dist/adapters/aws-lambda/getPlanner.mjs +2 -2
- package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/index.js +2 -0
- package/dist/adapters/aws-lambda/index.mjs +2 -0
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/express.js +27 -7
- package/dist/adapters/express.mjs +27 -7
- package/dist/adapters/fastify/fastifyRequestHandler.js +3 -1
- package/dist/adapters/fastify/fastifyRequestHandler.mjs +3 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.js +9 -2
- package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +10 -3
- package/dist/adapters/fetch/fetchRequestHandler.js +9 -8
- package/dist/adapters/fetch/fetchRequestHandler.mjs +9 -8
- package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts.map +1 -1
- package/dist/adapters/next-app-dir/nextAppDirCaller.js +10 -5
- package/dist/adapters/next-app-dir/nextAppDirCaller.mjs +10 -5
- package/dist/adapters/next-app-dir/notFound.js +2 -0
- package/dist/adapters/next-app-dir/notFound.mjs +2 -0
- package/dist/adapters/next-app-dir/redirect.js +16 -1
- package/dist/adapters/next-app-dir/redirect.mjs +16 -1
- package/dist/adapters/next-app-dir/rethrowNextErrors.d.ts.map +1 -1
- package/dist/adapters/next-app-dir/rethrowNextErrors.js +4 -3
- package/dist/adapters/next-app-dir/rethrowNextErrors.mjs +4 -3
- package/dist/adapters/next.d.ts.map +1 -1
- package/dist/adapters/next.js +23 -30
- package/dist/adapters/next.mjs +24 -31
- package/dist/adapters/node-http/incomingMessageToRequest.d.ts +2 -1
- package/dist/adapters/node-http/incomingMessageToRequest.d.ts.map +1 -1
- package/dist/adapters/node-http/incomingMessageToRequest.js +83 -40
- package/dist/adapters/node-http/incomingMessageToRequest.mjs +83 -41
- package/dist/adapters/node-http/index.js +2 -0
- package/dist/adapters/node-http/index.mjs +2 -2
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +7 -0
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.js +70 -58
- package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +70 -59
- package/dist/adapters/node-http/writeResponse.d.ts +18 -0
- package/dist/adapters/node-http/writeResponse.d.ts.map +1 -0
- package/dist/adapters/node-http/writeResponse.js +82 -0
- package/dist/adapters/node-http/writeResponse.mjs +79 -0
- package/dist/adapters/standalone.d.ts +5 -2
- package/dist/adapters/standalone.d.ts.map +1 -1
- package/dist/adapters/standalone.js +25 -13
- package/dist/adapters/standalone.mjs +26 -14
- package/dist/adapters/ws.d.ts +14 -4
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +236 -90
- package/dist/adapters/ws.mjs +237 -92
- package/dist/bundle-analysis.json +411 -294
- package/dist/http.js +2 -4
- package/dist/http.mjs +2 -2
- package/dist/index.js +6 -2
- package/dist/index.mjs +3 -1
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@12.1.1_rollup@4.27.4_tslib@2.8.1_typescript@5.7.2/node_modules/tslib/tslib.es6.js +73 -0
- package/dist/observable/behaviorSubject.d.ts +15 -0
- package/dist/observable/behaviorSubject.d.ts.map +1 -0
- package/dist/observable/behaviorSubject.js +40 -0
- package/dist/observable/behaviorSubject.mjs +38 -0
- package/dist/observable/index.d.ts +3 -3
- package/dist/observable/index.d.ts.map +1 -1
- package/dist/observable/index.js +5 -0
- package/dist/observable/index.mjs +3 -2
- package/dist/observable/observable.d.ts +2 -1
- package/dist/observable/observable.d.ts.map +1 -1
- package/dist/observable/observable.js +31 -8
- package/dist/observable/observable.mjs +31 -8
- package/dist/observable/operators.d.ts +2 -0
- package/dist/observable/operators.d.ts.map +1 -1
- package/dist/observable/operators.js +35 -0
- package/dist/observable/operators.mjs +34 -1
- package/dist/rpc.js +2 -0
- package/dist/rpc.mjs +2 -0
- package/dist/shared.js +2 -0
- package/dist/shared.mjs +2 -0
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/clientish/inferrable.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts +2 -2
- package/dist/unstable-core-do-not-import/clientish/serialize.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/createProxy.js +1 -1
- package/dist/unstable-core-do-not-import/createProxy.mjs +1 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +1 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.js +16 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.mjs +16 -1
- package/dist/unstable-core-do-not-import/error/formatter.js +1 -1
- package/dist/unstable-core-do-not-import/error/formatter.mjs +1 -1
- package/dist/unstable-core-do-not-import/error/getErrorShape.js +2 -2
- package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +2 -2
- package/dist/unstable-core-do-not-import/http/contentType.js +3 -3
- package/dist/unstable-core-do-not-import/http/contentType.mjs +3 -3
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +6 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +28 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +25 -1
- package/dist/unstable-core-do-not-import/http/isAbortError.d.ts +4 -0
- package/dist/unstable-core-do-not-import/http/isAbortError.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/isAbortError.js +9 -0
- package/dist/unstable-core-do-not-import/http/isAbortError.mjs +7 -0
- package/dist/unstable-core-do-not-import/http/resolveResponse.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/resolveResponse.js +187 -92
- package/dist/unstable-core-do-not-import/http/resolveResponse.mjs +189 -94
- package/dist/unstable-core-do-not-import/http/types.d.ts +1 -1
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +11 -11
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/initTRPC.js +11 -11
- package/dist/unstable-core-do-not-import/initTRPC.mjs +11 -11
- package/dist/unstable-core-do-not-import/middleware.d.ts +2 -1
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/middleware.js +2 -2
- package/dist/unstable-core-do-not-import/middleware.mjs +2 -2
- package/dist/unstable-core-do-not-import/parser.d.ts +5 -1
- package/dist/unstable-core-do-not-import/parser.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/parser.js +4 -0
- package/dist/unstable-core-do-not-import/parser.mjs +4 -0
- package/dist/unstable-core-do-not-import/procedure.d.ts +8 -2
- package/dist/unstable-core-do-not-import/procedure.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +32 -13
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/procedureBuilder.js +33 -39
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +33 -39
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +17 -17
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/router.d.ts +4 -3
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/router.js +6 -5
- package/dist/unstable-core-do-not-import/router.mjs +6 -5
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +2 -9
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +11 -6
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +7 -3
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +7 -3
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts +31 -16
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/stream/jsonl.js +440 -318
- package/dist/unstable-core-do-not-import/stream/jsonl.mjs +440 -318
- package/dist/unstable-core-do-not-import/stream/sse.d.ts +63 -41
- package/dist/unstable-core-do-not-import/stream/sse.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/stream/sse.js +300 -119
- package/dist/unstable-core-do-not-import/stream/sse.mjs +302 -119
- package/dist/unstable-core-do-not-import/stream/sse.types.d.ts +31 -0
- package/dist/unstable-core-do-not-import/stream/sse.types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/stream/tracked.d.ts +31 -0
- package/dist/unstable-core-do-not-import/stream/tracked.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/stream/tracked.js +29 -0
- package/dist/unstable-core-do-not-import/stream/tracked.mjs +25 -0
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts +17 -0
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.js +171 -0
- package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.mjs +167 -0
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.d.ts +0 -11
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.js +0 -29
- package/dist/unstable-core-do-not-import/stream/utils/createDeferred.mjs +1 -29
- package/dist/unstable-core-do-not-import/stream/utils/disposable.d.ts +17 -0
- package/dist/unstable-core-do-not-import/stream/utils/disposable.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/stream/utils/disposable.js +44 -0
- package/dist/unstable-core-do-not-import/stream/utils/disposable.mjs +41 -0
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.d.ts +8 -0
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.js +25 -0
- package/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.mjs +23 -0
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.d.ts +5 -0
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.js +26 -0
- package/dist/unstable-core-do-not-import/stream/utils/timerResource.mjs +23 -0
- package/dist/unstable-core-do-not-import/stream/utils/withPing.d.ts +7 -0
- package/dist/unstable-core-do-not-import/stream/utils/withPing.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/stream/utils/withPing.js +130 -0
- package/dist/unstable-core-do-not-import/stream/utils/withPing.mjs +127 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts +2 -4
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/transformer.js +1 -1
- package/dist/unstable-core-do-not-import/transformer.mjs +1 -1
- package/dist/unstable-core-do-not-import/types.d.ts +26 -3
- package/dist/unstable-core-do-not-import/types.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/utils.d.ts +15 -0
- package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/utils.js +49 -1
- package/dist/unstable-core-do-not-import/utils.mjs +45 -2
- package/dist/unstable-core-do-not-import.d.ts +4 -2
- package/dist/unstable-core-do-not-import.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import.js +18 -9
- package/dist/unstable-core-do-not-import.mjs +7 -7
- package/dist/vendor/unpromise/index.d.ts +3 -0
- package/dist/vendor/unpromise/index.d.ts.map +1 -0
- package/dist/vendor/unpromise/types.d.ts +28 -0
- package/dist/vendor/unpromise/types.d.ts.map +1 -0
- package/dist/vendor/unpromise/unpromise.d.ts +121 -0
- package/dist/vendor/unpromise/unpromise.d.ts.map +1 -0
- package/dist/vendor/unpromise/unpromise.js +292 -0
- package/dist/vendor/unpromise/unpromise.mjs +289 -0
- package/package.json +20 -17
- package/src/@trpc/server/http.ts +0 -2
- package/src/@trpc/server/index.ts +6 -0
- package/src/adapters/aws-lambda/getPlanner.ts +2 -2
- package/src/adapters/aws-lambda/index.ts +5 -6
- package/src/adapters/express.ts +21 -9
- package/src/adapters/fastify/fastifyRequestHandler.ts +1 -1
- package/src/adapters/fastify/fastifyTRPCPlugin.ts +16 -5
- package/src/adapters/fetch/fetchRequestHandler.ts +2 -2
- package/src/adapters/next-app-dir/nextAppDirCaller.ts +3 -0
- package/src/adapters/next-app-dir/rethrowNextErrors.ts +3 -2
- package/src/adapters/next.ts +29 -34
- package/src/adapters/node-http/incomingMessageToRequest.ts +110 -40
- package/src/adapters/node-http/nodeHTTPRequestHandler.ts +85 -63
- package/src/adapters/node-http/writeResponse.ts +94 -0
- package/src/adapters/standalone.ts +35 -18
- package/src/adapters/ws.ts +152 -62
- package/src/observable/behaviorSubject.ts +55 -0
- package/src/observable/index.ts +22 -3
- package/src/observable/observable.ts +32 -14
- package/src/observable/operators.ts +47 -0
- package/src/unstable-core-do-not-import/clientish/inference.ts +4 -4
- package/src/unstable-core-do-not-import/clientish/inferrable.ts +6 -6
- package/src/unstable-core-do-not-import/clientish/serialize.ts +5 -5
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +37 -4
- package/src/unstable-core-do-not-import/http/isAbortError.ts +7 -0
- package/src/unstable-core-do-not-import/http/resolveResponse.ts +192 -85
- package/src/unstable-core-do-not-import/http/types.ts +1 -1
- package/src/unstable-core-do-not-import/initTRPC.ts +14 -20
- package/src/unstable-core-do-not-import/middleware.ts +5 -4
- package/src/unstable-core-do-not-import/parser.ts +17 -6
- package/src/unstable-core-do-not-import/procedure.ts +17 -2
- package/src/unstable-core-do-not-import/procedureBuilder.ts +138 -123
- package/src/unstable-core-do-not-import/rootConfig.ts +20 -17
- package/src/unstable-core-do-not-import/router.ts +15 -16
- package/src/unstable-core-do-not-import/rpc/codes.ts +2 -10
- package/src/unstable-core-do-not-import/rpc/envelopes.ts +18 -7
- package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +5 -1
- package/src/unstable-core-do-not-import/stream/jsonl.ts +293 -294
- package/src/unstable-core-do-not-import/stream/sse.ts +349 -191
- package/src/unstable-core-do-not-import/stream/sse.types.ts +44 -0
- package/src/unstable-core-do-not-import/stream/tracked.ts +49 -0
- package/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts +89 -0
- package/src/unstable-core-do-not-import/stream/utils/createDeferred.ts +0 -36
- package/src/unstable-core-do-not-import/stream/utils/disposable.ts +52 -0
- package/src/unstable-core-do-not-import/stream/utils/readableStreamFrom.ts +28 -0
- package/src/unstable-core-do-not-import/stream/utils/timerResource.ts +29 -0
- package/src/unstable-core-do-not-import/stream/utils/withPing.ts +47 -0
- package/src/unstable-core-do-not-import/transformer.ts +1 -1
- package/src/unstable-core-do-not-import/types.ts +35 -10
- package/src/unstable-core-do-not-import/utils.ts +56 -1
- package/src/unstable-core-do-not-import.ts +4 -2
- package/src/vendor/unpromise/ATTRIBUTION.txt +1 -0
- package/src/vendor/unpromise/LICENSE +20 -0
- package/src/vendor/unpromise/index.ts +7 -0
- package/src/vendor/unpromise/types.ts +55 -0
- package/src/vendor/unpromise/unpromise.ts +380 -0
- 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/toURL.d.ts +0 -2
- package/dist/unstable-core-do-not-import/http/toURL.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/http/toURL.js +0 -8
- package/dist/unstable-core-do-not-import/http/toURL.mjs +0 -6
- package/dist/unstable-core-do-not-import/stream/utils/createReadableStream.d.ts +0 -10
- package/dist/unstable-core-do-not-import/stream/utils/createReadableStream.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/stream/utils/createReadableStream.js +0 -31
- package/dist/unstable-core-do-not-import/stream/utils/createReadableStream.mjs +0 -29
- package/dist/unstable-core-do-not-import/stream/utils/createServer.d.ts +0 -7
- package/dist/unstable-core-do-not-import/stream/utils/createServer.d.ts.map +0 -1
- package/dist/unstable-core-do-not-import/types.js +0 -11
- package/dist/unstable-core-do-not-import/types.mjs +0 -9
- package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +0 -29
- package/src/unstable-core-do-not-import/http/toURL.ts +0 -7
- package/src/unstable-core-do-not-import/stream/utils/createReadableStream.ts +0 -31
- package/src/unstable-core-do-not-import/stream/utils/createServer.ts +0 -44
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD,OAAO,KAAK,EACV,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,CACnE,cAAc,EACd,eAAe,CAChB,CAAC;AAEF;;GAEG;AACH,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5E,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,SAAS,EAC5D,IAAI,EAAE,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,eAAe,CAAC,GACrE,cAAc,CAkChB"}
|
package/dist/adapters/next.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var utils = require('../unstable-core-do-not-import/utils.js');
|
|
4
4
|
var TRPCError = require('../unstable-core-do-not-import/error/TRPCError.js');
|
|
5
|
+
require('../vendor/unpromise/unpromise.js');
|
|
6
|
+
require('../unstable-core-do-not-import/stream/utils/disposable.js');
|
|
5
7
|
require('../unstable-core-do-not-import/rootConfig.js');
|
|
6
8
|
var nodeHTTPRequestHandler = require('./node-http/nodeHTTPRequestHandler.js');
|
|
7
9
|
|
|
@@ -16,41 +18,32 @@ var nodeHTTPRequestHandler = require('./node-http/nodeHTTPRequestHandler.js');
|
|
|
16
18
|
*/ // @trpc/server
|
|
17
19
|
function createNextApiHandler(opts) {
|
|
18
20
|
return async (req, res)=>{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (path === null) {
|
|
30
|
-
const error = getErrorShape.getErrorShape({
|
|
31
|
-
config: opts.router._def._config,
|
|
32
|
-
error: new TRPCError.TRPCError({
|
|
21
|
+
let path = '';
|
|
22
|
+
await utils.run(async ()=>{
|
|
23
|
+
path = utils.run(()=>{
|
|
24
|
+
if (typeof req.query['trpc'] === 'string') {
|
|
25
|
+
return req.query['trpc'];
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(req.query['trpc'])) {
|
|
28
|
+
return req.query['trpc'].join('/');
|
|
29
|
+
}
|
|
30
|
+
throw new TRPCError.TRPCError({
|
|
33
31
|
message: 'Query "trpc" not found - is the file named `[trpc]`.ts or `[...trpc].ts`?',
|
|
34
32
|
code: 'INTERNAL_SERVER_ERROR'
|
|
35
|
-
})
|
|
36
|
-
type: 'unknown',
|
|
37
|
-
ctx: undefined,
|
|
38
|
-
path: undefined,
|
|
39
|
-
input: undefined
|
|
33
|
+
});
|
|
40
34
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
await nodeHTTPRequestHandler.nodeHTTPRequestHandler({
|
|
36
|
+
...opts,
|
|
37
|
+
req,
|
|
38
|
+
res,
|
|
39
|
+
path
|
|
45
40
|
});
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
await nodeHTTPRequestHandler.nodeHTTPRequestHandler({
|
|
49
|
-
...opts,
|
|
41
|
+
}).catch(nodeHTTPRequestHandler.internal_exceptionHandler({
|
|
50
42
|
req,
|
|
51
43
|
res,
|
|
52
|
-
path
|
|
53
|
-
|
|
44
|
+
path,
|
|
45
|
+
...opts
|
|
46
|
+
}));
|
|
54
47
|
};
|
|
55
48
|
}
|
|
56
49
|
|
package/dist/adapters/next.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { run } from '../unstable-core-do-not-import/utils.mjs';
|
|
2
2
|
import { TRPCError } from '../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
3
|
+
import '../vendor/unpromise/unpromise.mjs';
|
|
4
|
+
import '../unstable-core-do-not-import/stream/utils/disposable.mjs';
|
|
3
5
|
import '../unstable-core-do-not-import/rootConfig.mjs';
|
|
4
|
-
import { nodeHTTPRequestHandler } from './node-http/nodeHTTPRequestHandler.mjs';
|
|
6
|
+
import { nodeHTTPRequestHandler, internal_exceptionHandler } from './node-http/nodeHTTPRequestHandler.mjs';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* 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`
|
|
@@ -14,41 +16,32 @@ import { nodeHTTPRequestHandler } from './node-http/nodeHTTPRequestHandler.mjs';
|
|
|
14
16
|
*/ // @trpc/server
|
|
15
17
|
function createNextApiHandler(opts) {
|
|
16
18
|
return async (req, res)=>{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (path === null) {
|
|
28
|
-
const error = getErrorShape({
|
|
29
|
-
config: opts.router._def._config,
|
|
30
|
-
error: new TRPCError({
|
|
19
|
+
let path = '';
|
|
20
|
+
await run(async ()=>{
|
|
21
|
+
path = run(()=>{
|
|
22
|
+
if (typeof req.query['trpc'] === 'string') {
|
|
23
|
+
return req.query['trpc'];
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(req.query['trpc'])) {
|
|
26
|
+
return req.query['trpc'].join('/');
|
|
27
|
+
}
|
|
28
|
+
throw new TRPCError({
|
|
31
29
|
message: 'Query "trpc" not found - is the file named `[trpc]`.ts or `[...trpc].ts`?',
|
|
32
30
|
code: 'INTERNAL_SERVER_ERROR'
|
|
33
|
-
})
|
|
34
|
-
type: 'unknown',
|
|
35
|
-
ctx: undefined,
|
|
36
|
-
path: undefined,
|
|
37
|
-
input: undefined
|
|
31
|
+
});
|
|
38
32
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
await nodeHTTPRequestHandler({
|
|
34
|
+
...opts,
|
|
35
|
+
req,
|
|
36
|
+
res,
|
|
37
|
+
path
|
|
43
38
|
});
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
await nodeHTTPRequestHandler({
|
|
47
|
-
...opts,
|
|
39
|
+
}).catch(internal_exceptionHandler({
|
|
48
40
|
req,
|
|
49
41
|
res,
|
|
50
|
-
path
|
|
51
|
-
|
|
42
|
+
path,
|
|
43
|
+
...opts
|
|
44
|
+
}));
|
|
52
45
|
};
|
|
53
46
|
}
|
|
54
47
|
|
|
@@ -5,10 +5,11 @@ export interface IncomingMessageWithBody extends http.IncomingMessage {
|
|
|
5
5
|
*/
|
|
6
6
|
body?: unknown;
|
|
7
7
|
}
|
|
8
|
+
export declare function createURL(req: http.IncomingMessage): URL;
|
|
8
9
|
/**
|
|
9
10
|
* Convert an [`IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
|
|
10
11
|
*/
|
|
11
|
-
export declare function incomingMessageToRequest(req: http.IncomingMessage, opts: {
|
|
12
|
+
export declare function incomingMessageToRequest(req: http.IncomingMessage, res: http.ServerResponse, opts: {
|
|
12
13
|
/**
|
|
13
14
|
* Max body size in bytes. If the body is larger than this, the request will be aborted
|
|
14
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incomingMessageToRequest.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/incomingMessageToRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAGlC,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,eAAe;IACnE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"incomingMessageToRequest.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/incomingMessageToRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAGlC,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,eAAe;IACnE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAiED,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,GAAG,CAkBxD;AAwBD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,IAAI,EAAE;IACJ;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GACA,OAAO,CAqCT"}
|
|
@@ -1,75 +1,118 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var TRPCError = require('../../unstable-core-do-not-import/error/TRPCError.js');
|
|
4
|
+
require('../../vendor/unpromise/unpromise.js');
|
|
5
|
+
require('../../unstable-core-do-not-import/stream/utils/disposable.js');
|
|
4
6
|
require('../../unstable-core-do-not-import/rootConfig.js');
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
function createBody(req, opts) {
|
|
9
|
+
// Some adapters will pre-parse the body and add it to the request object
|
|
10
|
+
if ('body' in req) {
|
|
11
|
+
// If the body is already a string, return it directly
|
|
12
|
+
if (typeof req.body === 'string') {
|
|
13
|
+
return req.body;
|
|
14
|
+
} else if (req.body !== undefined) {
|
|
15
|
+
return JSON.stringify(req.body);
|
|
16
|
+
}
|
|
17
|
+
// If body property exists but is undefined, return undefined
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
9
20
|
let size = 0;
|
|
10
|
-
const maxBodySize = opts.maxBodySize;
|
|
11
21
|
let hasClosed = false;
|
|
12
|
-
|
|
22
|
+
return new ReadableStream({
|
|
13
23
|
start (controller) {
|
|
14
|
-
|
|
24
|
+
const onData = (chunk)=>{
|
|
15
25
|
size += chunk.length;
|
|
16
|
-
if (maxBodySize
|
|
17
|
-
controller.
|
|
18
|
-
code: 'PAYLOAD_TOO_LARGE'
|
|
19
|
-
}));
|
|
20
|
-
// an error is thrown if we try to close the controller after
|
|
21
|
-
// erroring, so track the closure
|
|
22
|
-
hasClosed = true;
|
|
26
|
+
if (!opts.maxBodySize || size <= opts.maxBodySize) {
|
|
27
|
+
controller.enqueue(new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength));
|
|
23
28
|
return;
|
|
24
29
|
}
|
|
25
|
-
controller.
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
controller.error(new TRPCError.TRPCError({
|
|
31
|
+
code: 'PAYLOAD_TOO_LARGE'
|
|
32
|
+
}));
|
|
33
|
+
hasClosed = true;
|
|
34
|
+
req.off('data', onData);
|
|
35
|
+
req.off('end', onEnd);
|
|
36
|
+
};
|
|
37
|
+
const onEnd = ()=>{
|
|
28
38
|
if (hasClosed) {
|
|
29
39
|
return;
|
|
30
40
|
}
|
|
31
41
|
hasClosed = true;
|
|
42
|
+
req.off('data', onData);
|
|
43
|
+
req.off('end', onEnd);
|
|
32
44
|
controller.close();
|
|
33
|
-
}
|
|
45
|
+
};
|
|
46
|
+
req.on('data', onData);
|
|
47
|
+
req.on('end', onEnd);
|
|
34
48
|
},
|
|
35
49
|
cancel () {
|
|
36
50
|
req.destroy();
|
|
37
51
|
}
|
|
38
52
|
});
|
|
39
|
-
return stream;
|
|
40
53
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
function createURL(req) {
|
|
55
|
+
try {
|
|
56
|
+
const protocol = req.socket && 'encrypted' in req.socket && req.socket.encrypted ? 'https:' : 'http:';
|
|
57
|
+
const host = req.headers.host ?? 'localhost';
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
59
|
+
return new URL(req.url, `${protocol}//${host}`);
|
|
60
|
+
} catch (cause) {
|
|
61
|
+
throw new TRPCError.TRPCError({
|
|
62
|
+
code: 'BAD_REQUEST',
|
|
63
|
+
message: 'Invalid URL',
|
|
64
|
+
cause
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function createHeaders(incoming) {
|
|
69
|
+
const headers = new Headers();
|
|
70
|
+
for(const key in incoming){
|
|
71
|
+
const value = incoming[key];
|
|
72
|
+
if (typeof key === 'string' && key.startsWith(':')) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (Array.isArray(value)) {
|
|
76
|
+
for (const item of value){
|
|
77
|
+
headers.append(key, item);
|
|
78
|
+
}
|
|
79
|
+
} else if (value != null) {
|
|
80
|
+
headers.append(key, value);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return headers;
|
|
84
|
+
}
|
|
46
85
|
/**
|
|
47
86
|
* Convert an [`IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
|
|
48
|
-
*/ function incomingMessageToRequest(req, opts) {
|
|
87
|
+
*/ function incomingMessageToRequest(req, res, opts) {
|
|
49
88
|
const ac = new AbortController();
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
89
|
+
const onAbort = ()=>{
|
|
90
|
+
res.off('close', onAbort);
|
|
91
|
+
req.socket.off('end', onAbort);
|
|
92
|
+
// abort the request
|
|
53
93
|
ac.abort();
|
|
54
|
-
}
|
|
94
|
+
};
|
|
95
|
+
res.once('close', onAbort);
|
|
96
|
+
req.socket.once('end', onAbort);
|
|
97
|
+
// Get host from either regular header or HTTP/2 pseudo-header
|
|
98
|
+
const url = createURL(req);
|
|
55
99
|
const init = {
|
|
56
|
-
headers,
|
|
100
|
+
headers: createHeaders(req.headers),
|
|
57
101
|
method: req.method,
|
|
58
|
-
signal: ac.signal
|
|
59
|
-
// @ts-expect-error this is fine
|
|
60
|
-
duplex: 'half'
|
|
102
|
+
signal: ac.signal
|
|
61
103
|
};
|
|
62
|
-
if (req.method &&
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
104
|
+
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
105
|
+
init.body = createBody(req, opts);
|
|
106
|
+
// init.duplex = 'half' must be set when body is a ReadableStream, and Node follows the spec.
|
|
107
|
+
// However, this property is not defined in the TypeScript types for RequestInit, so we have
|
|
108
|
+
// to cast it here in order to set it without a type error.
|
|
109
|
+
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex
|
|
110
|
+
// @ts-expect-error this is fine
|
|
111
|
+
init.duplex = 'half';
|
|
70
112
|
}
|
|
71
113
|
const request = new Request(url, init);
|
|
72
114
|
return request;
|
|
73
115
|
}
|
|
74
116
|
|
|
117
|
+
exports.createURL = createURL;
|
|
75
118
|
exports.incomingMessageToRequest = incomingMessageToRequest;
|
|
@@ -1,73 +1,115 @@
|
|
|
1
1
|
import { TRPCError } from '../../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
2
|
+
import '../../vendor/unpromise/unpromise.mjs';
|
|
3
|
+
import '../../unstable-core-do-not-import/stream/utils/disposable.mjs';
|
|
2
4
|
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
function createBody(req, opts) {
|
|
7
|
+
// Some adapters will pre-parse the body and add it to the request object
|
|
8
|
+
if ('body' in req) {
|
|
9
|
+
// If the body is already a string, return it directly
|
|
10
|
+
if (typeof req.body === 'string') {
|
|
11
|
+
return req.body;
|
|
12
|
+
} else if (req.body !== undefined) {
|
|
13
|
+
return JSON.stringify(req.body);
|
|
14
|
+
}
|
|
15
|
+
// If body property exists but is undefined, return undefined
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
7
18
|
let size = 0;
|
|
8
|
-
const maxBodySize = opts.maxBodySize;
|
|
9
19
|
let hasClosed = false;
|
|
10
|
-
|
|
20
|
+
return new ReadableStream({
|
|
11
21
|
start (controller) {
|
|
12
|
-
|
|
22
|
+
const onData = (chunk)=>{
|
|
13
23
|
size += chunk.length;
|
|
14
|
-
if (maxBodySize
|
|
15
|
-
controller.
|
|
16
|
-
code: 'PAYLOAD_TOO_LARGE'
|
|
17
|
-
}));
|
|
18
|
-
// an error is thrown if we try to close the controller after
|
|
19
|
-
// erroring, so track the closure
|
|
20
|
-
hasClosed = true;
|
|
24
|
+
if (!opts.maxBodySize || size <= opts.maxBodySize) {
|
|
25
|
+
controller.enqueue(new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength));
|
|
21
26
|
return;
|
|
22
27
|
}
|
|
23
|
-
controller.
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
controller.error(new TRPCError({
|
|
29
|
+
code: 'PAYLOAD_TOO_LARGE'
|
|
30
|
+
}));
|
|
31
|
+
hasClosed = true;
|
|
32
|
+
req.off('data', onData);
|
|
33
|
+
req.off('end', onEnd);
|
|
34
|
+
};
|
|
35
|
+
const onEnd = ()=>{
|
|
26
36
|
if (hasClosed) {
|
|
27
37
|
return;
|
|
28
38
|
}
|
|
29
39
|
hasClosed = true;
|
|
40
|
+
req.off('data', onData);
|
|
41
|
+
req.off('end', onEnd);
|
|
30
42
|
controller.close();
|
|
31
|
-
}
|
|
43
|
+
};
|
|
44
|
+
req.on('data', onData);
|
|
45
|
+
req.on('end', onEnd);
|
|
32
46
|
},
|
|
33
47
|
cancel () {
|
|
34
48
|
req.destroy();
|
|
35
49
|
}
|
|
36
50
|
});
|
|
37
|
-
return stream;
|
|
38
51
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
function createURL(req) {
|
|
53
|
+
try {
|
|
54
|
+
const protocol = req.socket && 'encrypted' in req.socket && req.socket.encrypted ? 'https:' : 'http:';
|
|
55
|
+
const host = req.headers.host ?? 'localhost';
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
57
|
+
return new URL(req.url, `${protocol}//${host}`);
|
|
58
|
+
} catch (cause) {
|
|
59
|
+
throw new TRPCError({
|
|
60
|
+
code: 'BAD_REQUEST',
|
|
61
|
+
message: 'Invalid URL',
|
|
62
|
+
cause
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function createHeaders(incoming) {
|
|
67
|
+
const headers = new Headers();
|
|
68
|
+
for(const key in incoming){
|
|
69
|
+
const value = incoming[key];
|
|
70
|
+
if (typeof key === 'string' && key.startsWith(':')) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (Array.isArray(value)) {
|
|
74
|
+
for (const item of value){
|
|
75
|
+
headers.append(key, item);
|
|
76
|
+
}
|
|
77
|
+
} else if (value != null) {
|
|
78
|
+
headers.append(key, value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return headers;
|
|
82
|
+
}
|
|
44
83
|
/**
|
|
45
84
|
* Convert an [`IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
|
|
46
|
-
*/ function incomingMessageToRequest(req, opts) {
|
|
85
|
+
*/ function incomingMessageToRequest(req, res, opts) {
|
|
47
86
|
const ac = new AbortController();
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
87
|
+
const onAbort = ()=>{
|
|
88
|
+
res.off('close', onAbort);
|
|
89
|
+
req.socket.off('end', onAbort);
|
|
90
|
+
// abort the request
|
|
51
91
|
ac.abort();
|
|
52
|
-
}
|
|
92
|
+
};
|
|
93
|
+
res.once('close', onAbort);
|
|
94
|
+
req.socket.once('end', onAbort);
|
|
95
|
+
// Get host from either regular header or HTTP/2 pseudo-header
|
|
96
|
+
const url = createURL(req);
|
|
53
97
|
const init = {
|
|
54
|
-
headers,
|
|
98
|
+
headers: createHeaders(req.headers),
|
|
55
99
|
method: req.method,
|
|
56
|
-
signal: ac.signal
|
|
57
|
-
// @ts-expect-error this is fine
|
|
58
|
-
duplex: 'half'
|
|
100
|
+
signal: ac.signal
|
|
59
101
|
};
|
|
60
|
-
if (req.method &&
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
102
|
+
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
103
|
+
init.body = createBody(req, opts);
|
|
104
|
+
// init.duplex = 'half' must be set when body is a ReadableStream, and Node follows the spec.
|
|
105
|
+
// However, this property is not defined in the TypeScript types for RequestInit, so we have
|
|
106
|
+
// to cast it here in order to set it without a type error.
|
|
107
|
+
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex
|
|
108
|
+
// @ts-expect-error this is fine
|
|
109
|
+
init.duplex = 'half';
|
|
68
110
|
}
|
|
69
111
|
const request = new Request(url, init);
|
|
70
112
|
return request;
|
|
71
113
|
}
|
|
72
114
|
|
|
73
|
-
export { incomingMessageToRequest };
|
|
115
|
+
export { createURL, incomingMessageToRequest };
|
|
@@ -5,5 +5,7 @@ var incomingMessageToRequest = require('./incomingMessageToRequest.js');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
exports.internal_exceptionHandler = nodeHTTPRequestHandler.internal_exceptionHandler;
|
|
8
9
|
exports.nodeHTTPRequestHandler = nodeHTTPRequestHandler.nodeHTTPRequestHandler;
|
|
10
|
+
exports.createURL = incomingMessageToRequest.createURL;
|
|
9
11
|
exports.incomingMessageToRequest = incomingMessageToRequest.incomingMessageToRequest;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { nodeHTTPRequestHandler } from './nodeHTTPRequestHandler.mjs';
|
|
2
|
-
export { incomingMessageToRequest } from './incomingMessageToRequest.mjs';
|
|
1
|
+
export { internal_exceptionHandler, nodeHTTPRequestHandler } from './nodeHTTPRequestHandler.mjs';
|
|
2
|
+
export { createURL, incomingMessageToRequest } from './incomingMessageToRequest.mjs';
|
|
@@ -9,5 +9,12 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { type AnyRouter } from '../../@trpc/server';
|
|
11
11
|
import type { NodeHTTPRequest, NodeHTTPRequestHandlerOptions, NodeHTTPResponse } from './types';
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function internal_exceptionHandler<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>(opts: NodeHTTPRequestHandlerOptions<TRouter, TRequest, TResponse>): (cause: unknown) => void;
|
|
16
|
+
/**
|
|
17
|
+
* @remark the promise never rejects
|
|
18
|
+
*/
|
|
12
19
|
export declare function nodeHTTPRequestHandler<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>(opts: NodeHTTPRequestHandlerOptions<TRouter, TRequest, TResponse>): Promise<void>;
|
|
13
20
|
//# sourceMappingURL=nodeHTTPRequestHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeHTTPRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/nodeHTTPRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"nodeHTTPRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/nodeHTTPRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAM5B,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,eAAe,EAChC,SAAS,SAAS,gBAAgB,EAClC,IAAI,EAAE,6BAA6B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,WAClD,OAAO,UA6BvB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,eAAe,EAChC,SAAS,SAAS,gBAAgB,EAClC,IAAI,EAAE,6BAA6B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,iBA6ClE"}
|