@trpc/server 11.0.0-next-beta.208 → 11.0.0-next-beta.218
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 +7 -0
- package/dist/@trpc/server/http.d.ts.map +1 -0
- package/dist/{@trpc-server.d.ts → @trpc/server/index.d.ts} +4 -4
- 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 +1 -2
- package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/index.js +6 -5
- package/dist/adapters/aws-lambda/index.mjs +4 -3
- package/dist/adapters/aws-lambda/utils.d.ts +2 -3
- package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
- package/dist/adapters/aws-lambda/utils.js +5 -4
- package/dist/adapters/aws-lambda/utils.mjs +3 -2
- package/dist/adapters/express.d.ts +1 -2
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +2 -2
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyRequestHandler.js +6 -3
- package/dist/adapters/fastify/fastifyRequestHandler.mjs +4 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -2
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.js +0 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +0 -1
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +1 -2
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fetch/fetchRequestHandler.js +6 -4
- package/dist/adapters/fetch/fetchRequestHandler.mjs +4 -2
- package/dist/adapters/fetch/types.d.ts +2 -3
- package/dist/adapters/fetch/types.d.ts.map +1 -1
- package/dist/adapters/next.d.ts +4 -2
- package/dist/adapters/next.d.ts.map +1 -1
- package/dist/adapters/next.js +6 -4
- package/dist/adapters/next.mjs +4 -2
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
- package/dist/adapters/node-http/content-type/json/getPostBody.js +4 -2
- package/dist/adapters/node-http/content-type/json/getPostBody.mjs +3 -1
- package/dist/adapters/node-http/content-type/json/index.js +4 -2
- package/dist/adapters/node-http/content-type/json/index.mjs +3 -1
- package/dist/adapters/node-http/internals/contentType.d.ts +2 -2
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +1 -2
- package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.js +6 -4
- package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +4 -2
- package/dist/adapters/node-http/types.d.ts +3 -4
- package/dist/adapters/node-http/types.d.ts.map +1 -1
- package/dist/adapters/standalone.d.ts +1 -2
- package/dist/adapters/standalone.d.ts.map +1 -1
- package/dist/adapters/standalone.js +1 -0
- package/dist/adapters/standalone.mjs +1 -0
- package/dist/adapters/ws.d.ts +3 -3
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +30 -25
- package/dist/adapters/ws.mjs +8 -3
- package/dist/bundle-analysis.json +416 -75
- package/dist/http.d.ts +1 -1
- package/dist/http.js +11 -7
- package/dist/http.mjs +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -41
- package/dist/index.mjs +8 -1
- package/dist/observable/index.d.ts +5 -0
- package/dist/observable/index.d.ts.map +1 -0
- package/dist/observable/index.js +13 -0
- package/dist/observable/index.mjs +2 -0
- package/dist/observable/observable.d.ts +13 -0
- package/dist/observable/observable.d.ts.map +1 -0
- package/dist/observable/observable.js +126 -0
- package/dist/observable/observable.mjs +122 -0
- package/dist/observable/operators.d.ts +8 -0
- package/dist/observable/operators.d.ts.map +1 -0
- package/dist/observable/operators.js +103 -0
- package/dist/observable/operators.mjs +99 -0
- package/dist/observable/types.d.ts +26 -0
- package/dist/observable/types.d.ts.map +1 -0
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +6 -7
- package/dist/rpc.mjs +3 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +6 -9
- package/dist/shared.mjs +4 -1
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +6 -0
- package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/createProxy.d.ts +19 -0
- package/dist/unstable-core-do-not-import/createProxy.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/createProxy.js +52 -0
- package/dist/unstable-core-do-not-import/createProxy.mjs +49 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +13 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.js +67 -0
- package/dist/unstable-core-do-not-import/error/TRPCError.mjs +63 -0
- package/dist/unstable-core-do-not-import/error/formatter.d.ts +33 -0
- 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 +31 -0
- package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +29 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +24 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.js +32 -0
- package/dist/unstable-core-do-not-import/http/batchStreamFormatter.mjs +30 -0
- package/dist/unstable-core-do-not-import/http/contentType.d.ts +29 -0
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/contentType.js +54 -0
- package/dist/unstable-core-do-not-import/http/contentType.mjs +52 -0
- 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 +51 -0
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +48 -0
- package/dist/unstable-core-do-not-import/http/index.d.ts +7 -0
- package/dist/unstable-core-do-not-import/http/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +51 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.js +295 -0
- package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs +293 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts +96 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/index.d.ts +37 -0
- package/dist/unstable-core-do-not-import/index.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/index.js +48 -0
- package/dist/unstable-core-do-not-import/index.mjs +16 -0
- package/dist/unstable-core-do-not-import/initTRPC.d.ts +96 -0
- package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/initTRPC.js +95 -0
- package/dist/unstable-core-do-not-import/initTRPC.mjs +93 -0
- package/dist/unstable-core-do-not-import/middleware.d.ts +105 -0
- package/dist/unstable-core-do-not-import/middleware.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/middleware.js +95 -0
- package/dist/unstable-core-do-not-import/middleware.mjs +89 -0
- package/dist/unstable-core-do-not-import/parser.d.ts +30 -0
- 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/unstable-core-do-not-import/procedure.d.ts +72 -0
- 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 +101 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.js +176 -0
- package/dist/unstable-core-do-not-import/procedureBuilder.mjs +173 -0
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +75 -0
- 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 +85 -0
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/router.js +156 -0
- package/dist/unstable-core-do-not-import/router.mjs +151 -0
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +51 -0
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/codes.js +38 -0
- package/dist/unstable-core-do-not-import/rpc/codes.mjs +35 -0
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +97 -0
- 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 +5 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +59 -0
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +57 -0
- package/dist/unstable-core-do-not-import/serialize.d.ts +62 -0
- package/dist/unstable-core-do-not-import/serialize.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts +107 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/transformer.js +107 -0
- package/dist/unstable-core-do-not-import/transformer.mjs +102 -0
- package/dist/unstable-core-do-not-import/types.d.ts +98 -0
- package/dist/unstable-core-do-not-import/types.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/utils.d.ts +27 -0
- package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/utils.js +44 -0
- package/dist/unstable-core-do-not-import/utils.mjs +39 -0
- package/package.json +11 -8
- package/src/@trpc/server/http.ts +26 -0
- package/src/{@trpc-server.ts → @trpc/server/index.ts} +3 -3
- package/src/@trpc/server/rpc.ts +26 -0
- package/src/adapters/aws-lambda/index.ts +4 -5
- package/src/adapters/aws-lambda/utils.ts +3 -4
- package/src/adapters/express.ts +1 -3
- package/src/adapters/fastify/fastifyRequestHandler.ts +6 -4
- package/src/adapters/fastify/fastifyTRPCPlugin.ts +1 -2
- package/src/adapters/fetch/fetchRequestHandler.ts +6 -4
- package/src/adapters/fetch/types.ts +2 -3
- package/src/adapters/next.ts +6 -3
- 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 +6 -4
- package/src/adapters/node-http/types.ts +4 -5
- package/src/adapters/standalone.ts +2 -2
- package/src/adapters/ws.ts +15 -14
- package/src/http.ts +1 -1
- package/src/index.ts +1 -1
- package/src/observable/index.ts +10 -0
- package/src/observable/observable.ts +158 -0
- package/src/observable/operators.ts +119 -0
- package/src/observable/types.ts +76 -0
- package/src/rpc.ts +1 -2
- package/src/shared.ts +1 -1
- package/src/unstable-core-do-not-import/TRPCInferrable.ts +9 -0
- package/src/unstable-core-do-not-import/createProxy.ts +59 -0
- package/src/unstable-core-do-not-import/error/TRPCError.ts +82 -0
- package/src/unstable-core-do-not-import/error/formatter.ts +51 -0
- package/src/unstable-core-do-not-import/error/getErrorShape.ts +36 -0
- package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +29 -0
- package/src/unstable-core-do-not-import/http/contentType.ts +99 -0
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +57 -0
- package/src/unstable-core-do-not-import/http/index.ts +23 -0
- package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +458 -0
- package/src/unstable-core-do-not-import/http/types.ts +111 -0
- package/src/unstable-core-do-not-import/index.ts +110 -0
- package/src/unstable-core-do-not-import/initTRPC.ts +206 -0
- package/src/unstable-core-do-not-import/middleware.ts +233 -0
- package/src/unstable-core-do-not-import/parser.ts +94 -0
- package/src/unstable-core-do-not-import/procedure.ts +108 -0
- package/src/unstable-core-do-not-import/procedureBuilder.ts +458 -0
- package/src/unstable-core-do-not-import/rootConfig.ts +90 -0
- package/src/unstable-core-do-not-import/router.ts +370 -0
- package/src/unstable-core-do-not-import/rpc/codes.ts +44 -0
- package/src/unstable-core-do-not-import/rpc/envelopes.ts +136 -0
- package/src/unstable-core-do-not-import/rpc/index.ts +21 -0
- package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +85 -0
- package/src/unstable-core-do-not-import/serialize.ts +122 -0
- package/src/unstable-core-do-not-import/transformer.ts +202 -0
- package/src/unstable-core-do-not-import/types.ts +151 -0
- package/src/unstable-core-do-not-import/utils.ts +59 -0
- package/unstable-core-do-not-import/index.d.ts +1 -0
- package/unstable-core-do-not-import/index.js +1 -0
- package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts +0 -9
- package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts.map +0 -1
- package/dist/@trpc-server/http.d.ts +0 -2
- package/dist/@trpc-server/http.d.ts.map +0 -1
- package/dist/@trpc-server.d.ts.map +0 -1
- package/dist/observable.d.ts +0 -2
- package/dist/observable.d.ts.map +0 -1
- package/dist/observable.js +0 -12
- package/dist/observable.mjs +0 -1
- package/src/@trpc-core-unstable-do-not-import-this-please.ts +0 -9
- package/src/@trpc-server/http.ts +0 -2
- package/src/observable.ts +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { getHTTPStatusCode, getHTTPStatusCodeFromError, } from '../../unstable-core-do-not-import';
|
|
2
|
+
export { resolveHTTPResponse } from '../../unstable-core-do-not-import';
|
|
3
|
+
export type { BaseHandlerOptions, HTTPBaseHandlerOptions, HTTPHeaders, HTTPRequest, HTTPResponse, OnErrorFunction, ProcedureCall, ResolveHTTPRequestOptionsContextFn, ResponseChunk, ResponseMeta, ResponseMetaFn, TRPCRequestInfo, } from '../../unstable-core-do-not-import';
|
|
4
|
+
export { getBatchStreamFormatter } from '../../unstable-core-do-not-import';
|
|
5
|
+
export type { BaseContentTypeHandler, BodyResult, } from '../../unstable-core-do-not-import';
|
|
6
|
+
export { getJsonContentTypeInputs } from '../../unstable-core-do-not-import';
|
|
7
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/@trpc/server/http.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,kCAAkC,EAClC,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,YAAY,EACV,sBAAsB,EACtB,UAAU,GACX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -2,7 +2,7 @@ export { TRPCError,
|
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated use `experimental_trpcMiddleware` instead
|
|
4
4
|
*/
|
|
5
|
-
experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, callProcedure as callTRPCProcedure, getTRPCErrorFromUnknown, transformTRPCResponse, createFlatProxy as createTRPCFlatProxy, type inferProcedureInput, type inferProcedureOutput, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type CombinedDataTransformer as TRPCCombinedDataTransformer, type ProcedureType as TRPCProcedureType, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type ProcedureRouterRecord as TRPCProcedureRouterRecord, type ProcedureArgs as TRPCProcedureArgs, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, } from '
|
|
5
|
+
experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, callProcedure as callTRPCProcedure, getTRPCErrorFromUnknown, transformTRPCResponse, createFlatProxy as createTRPCFlatProxy, type inferProcedureInput, type inferProcedureOutput, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, type inferTransformedProcedureOutput, type inferTransformedSubscriptionOutput, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type CombinedDataTransformer as TRPCCombinedDataTransformer, type ProcedureType as TRPCProcedureType, type AnyMutationProcedure as AnyTRPCMutationProcedure, type AnyQueryProcedure as AnyTRPCQueryProcedure, type ProcedureRouterRecord as TRPCProcedureRouterRecord, type ProcedureArgs as TRPCProcedureArgs, type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure, } from '../../unstable-core-do-not-import';
|
|
6
6
|
export type {
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated use `AnyTRPCProcedure` instead
|
|
@@ -51,7 +51,7 @@ ProcedureArgs,
|
|
|
51
51
|
/**
|
|
52
52
|
* @deprecated use `AnyTRPCSubscriptionProcedure` instead
|
|
53
53
|
*/
|
|
54
|
-
AnySubscriptionProcedure, } from '
|
|
54
|
+
AnySubscriptionProcedure, } from '../../unstable-core-do-not-import';
|
|
55
55
|
export {
|
|
56
56
|
/**
|
|
57
57
|
* @deprecated use `getTRPCErrorShape` instead
|
|
@@ -60,10 +60,10 @@ getErrorShape,
|
|
|
60
60
|
/**
|
|
61
61
|
* @deprecated use `callTRPCProcedure` instead
|
|
62
62
|
*/
|
|
63
|
-
callProcedure, } from '
|
|
63
|
+
callProcedure, } from '../../unstable-core-do-not-import';
|
|
64
64
|
/**
|
|
65
65
|
* @deprecated
|
|
66
66
|
* Use `Awaited<ReturnType<typeof myFunction>>` instead
|
|
67
67
|
*/
|
|
68
68
|
export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> = Awaited<ReturnType<TFunction>>;
|
|
69
|
-
//# sourceMappingURL
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/@trpc/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS;AACT;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,QAAQ,EAER,aAAa,IAAI,iBAAiB,EAClC,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,IAAI,mBAAmB,EACtC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACpC,KAAK,kCAAkC,EACvC,KAAK,YAAY,IAAI,gBAAgB,EACrC,KAAK,SAAS,IAAI,aAAa,EAC/B,KAAK,qBAAqB,IAAI,yBAAyB,EACvD,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,oBAAoB,IAAI,wBAAwB,EACrD,KAAK,iBAAiB,IAAI,qBAAqB,EAC/C,KAAK,qBAAqB,IAAI,yBAAyB,EACvD,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,wBAAwB,IAAI,4BAA4B,GAC9D,MAAM,mCAAmC,CAAC;AAE3C,YAAY;AACV;;GAEG;AACH,YAAY;AACZ;;GAEG;AACH,SAAS;AACT;;GAEG;AACH,qBAAqB;AACrB;;GAEG;AACH,uBAAuB;AAEvB;;GAEG;AACH,IAAI;AAEJ;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,aAAa;AACb;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,iBAAiB;AACjB;;GAEG;AACH,qBAAqB;AACrB;;GAEG;AACH,aAAa;AACb;;GAEG;AACH,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAE3C,OAAO;AACL;;GAEG;AACH,aAAa;AAEb;;GAEG;AACH,aAAa,GACd,MAAM,mCAAmC,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IACxE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { JSONRPC2, TRPCClientIncomingMessage, TRPCClientIncomingRequest, TRPCClientOutgoingMessage, TRPCClientOutgoingRequest, TRPCErrorResponse, TRPCErrorShape, TRPCReconnectNotification, TRPCRequest, TRPCRequestMessage, TRPCResponse, TRPCResponseMessage, TRPCResult, TRPCResultMessage, TRPCSubscriptionStopNotification, TRPCSuccessResponse, TRPC_ERROR_CODE_KEY, TRPC_ERROR_CODE_NUMBER, } from '../../unstable-core-do-not-import';
|
|
2
|
+
export { TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER, parseTRPCMessage, } from '../../unstable-core-do-not-import';
|
|
3
|
+
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../../src/@trpc/server/rpc.ts"],"names":[],"mappings":"AACA,YAAY,EACV,QAAQ,EACR,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,yBAAyB,EACzB,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,gCAAgC,EAChC,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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`
|
|
5
4
|
* @example
|
|
6
5
|
* ```ts
|
|
7
6
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -9,7 +8,7 @@
|
|
|
9
8
|
* ```
|
|
10
9
|
*/
|
|
11
10
|
import type { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2, Context as APIGWContext } from 'aws-lambda';
|
|
12
|
-
import type { AnyRouter } from '../../@trpc
|
|
11
|
+
import type { AnyRouter } from '../../@trpc/server';
|
|
13
12
|
import type { APIGatewayEvent, AWSLambdaOptions } from './utils';
|
|
14
13
|
export * from './utils';
|
|
15
14
|
/** 1:1 mapping of v1 or v2 input events, deduces which is which.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EACjC,OAAO,IAAI,YAAY,EACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AASpD,OAAO,KAAK,EACV,eAAe,EAEf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAUjB,cAAc,SAAS,CAAC;AAqDxB;;IAEI;AACJ,KAAK,gBAAgB,CAAC,KAAK,IAAI,KAAK,SAAS,oBAAoB,GAC7D,qBAAqB,GACrB,KAAK,SAAS,sBAAsB,GACpC,iCAAiC,GACjC,KAAK,CAAC;AACV,wBAAgB,uBAAuB,CACrC,OAAO,SAAS,SAAS,EACzB,MAAM,SAAS,eAAe,EAC9B,OAAO,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAExC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,GACtC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CA4B5D"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var
|
|
3
|
+
require('../../unstable-core-do-not-import/rpc/codes.js');
|
|
4
|
+
var TRPCError = require('../../unstable-core-do-not-import/error/TRPCError.js');
|
|
5
|
+
require('../../unstable-core-do-not-import/rootConfig.js');
|
|
6
|
+
var resolveHTTPResponse = require('../../unstable-core-do-not-import/http/resolveHTTPResponse.js');
|
|
5
7
|
var utils = require('./utils.js');
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* 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`
|
|
9
11
|
*
|
|
10
|
-
* Do **not** import from `@trpc/core`
|
|
11
12
|
* @example
|
|
12
13
|
* ```ts
|
|
13
14
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -50,7 +51,7 @@ function tRPCOutputToAPIGatewayOutput(event, response) {
|
|
|
50
51
|
};
|
|
51
52
|
return resp1;
|
|
52
53
|
} else {
|
|
53
|
-
throw new
|
|
54
|
+
throw new TRPCError.TRPCError({
|
|
54
55
|
code: 'INTERNAL_SERVER_ERROR',
|
|
55
56
|
message: utils.UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE
|
|
56
57
|
});
|
|
@@ -67,7 +68,7 @@ function awsLambdaRequestHandler(opts) {
|
|
|
67
68
|
...innerOpts
|
|
68
69
|
});
|
|
69
70
|
};
|
|
70
|
-
const response = await
|
|
71
|
+
const response = await resolveHTTPResponse.resolveHTTPResponse({
|
|
71
72
|
router: opts.router,
|
|
72
73
|
batching: opts.batching,
|
|
73
74
|
responseMeta: opts?.responseMeta,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import '../../unstable-core-do-not-import/rpc/codes.mjs';
|
|
2
|
+
import { TRPCError } from '../../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
3
|
+
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
4
|
+
import { resolveHTTPResponse } from '../../unstable-core-do-not-import/http/resolveHTTPResponse.mjs';
|
|
3
5
|
import { getPath, getHTTPMethod, isPayloadV1, transformHeaders, isPayloadV2, UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE } from './utils.mjs';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* 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`
|
|
7
9
|
*
|
|
8
|
-
* Do **not** import from `@trpc/core`
|
|
9
10
|
* @example
|
|
10
11
|
* ```ts
|
|
11
12
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,7 +1,6 @@
|
|
|
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`
|
|
5
4
|
* @example
|
|
6
5
|
* ```ts
|
|
7
6
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -9,8 +8,8 @@
|
|
|
9
8
|
* ```
|
|
10
9
|
*/
|
|
11
10
|
import type { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2, Context as APIGWContext } from 'aws-lambda';
|
|
12
|
-
import type { AnyRouter, inferRouterContext } from '../../@trpc
|
|
13
|
-
import type { HTTPHeaders, OnErrorFunction, ResponseMetaFn, TRPCRequestInfo } from '
|
|
11
|
+
import type { AnyRouter, inferRouterContext } from '../../@trpc/server';
|
|
12
|
+
import type { HTTPHeaders, OnErrorFunction, ResponseMetaFn, TRPCRequestInfo } from '../../@trpc/server/http';
|
|
14
13
|
export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
|
|
15
14
|
export type APIGatewayResult = APIGatewayProxyResult | APIGatewayProxyStructuredResultV2;
|
|
16
15
|
export type CreateAWSLambdaContextOptions<TEvent extends APIGatewayEvent> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EACjC,OAAO,IAAI,YAAY,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAIxE,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,cAAc,EACd,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAC5E,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,GACrB,iCAAiC,CAAC;AAEtC,MAAM,MAAM,6BAA6B,CAAC,MAAM,SAAS,eAAe,IAAI;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,wBAAwB,CAClC,OAAO,SAAS,SAAS,EACzB,MAAM,SAAS,eAAe,IAC5B,CAAC,EACH,KAAK,EACL,OAAO,EACP,IAAI,GACL,EAAE,6BAA6B,CAAC,MAAM,CAAC,KACpC,kBAAkB,CAAC,OAAO,CAAC,GAC3B,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AAEzC,MAAM,MAAM,gBAAgB,CAC1B,OAAO,SAAS,SAAS,EACzB,MAAM,SAAS,eAAe,IAE5B;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACxC,GAAG,CACA;IACE;;QAEI;IACJ,aAAa,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAC1D,GACD;IACE;;QAEI;IACJ,aAAa,CAAC,EAAE,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAC3D,CACJ,CAAC;AAEN,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,GACrB,KAAK,IAAI,oBAAoB,CAE/B;AACD,wBAAgB,WAAW,CACzB,KAAK,EAAE,eAAe,GACrB,KAAK,IAAI,sBAAsB,CAEjC;AAoBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,UAWnD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,eAAe,UA+B7C;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,GACnB,gBAAgB,CAAC,SAAS,CAAC,CAU7B;AAED,MAAM,MAAM,+BAA+B,GAAG,KAAK,GAAG,KAAK,CAAC;AAC5D,MAAM,MAAM,8BAA8B,GACtC,+BAA+B,GAC/B,QAAQ,CAAC;AAEb,eAAO,MAAM,4CAA4C,QAEiD,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('../../unstable-core-do-not-import/rpc/codes.js');
|
|
4
|
+
var TRPCError = require('../../unstable-core-do-not-import/error/TRPCError.js');
|
|
5
|
+
require('../../unstable-core-do-not-import/rootConfig.js');
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* 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`
|
|
7
9
|
*
|
|
8
|
-
* Do **not** import from `@trpc/core`
|
|
9
10
|
* @example
|
|
10
11
|
* ```ts
|
|
11
12
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -43,7 +44,7 @@ function getHTTPMethod(event) {
|
|
|
43
44
|
if (isPayloadV2(event)) {
|
|
44
45
|
return event.requestContext.http.method;
|
|
45
46
|
}
|
|
46
|
-
throw new
|
|
47
|
+
throw new TRPCError.TRPCError({
|
|
47
48
|
code: 'INTERNAL_SERVER_ERROR',
|
|
48
49
|
message: UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE
|
|
49
50
|
});
|
|
@@ -75,7 +76,7 @@ function getPath(event) {
|
|
|
75
76
|
}
|
|
76
77
|
return event.rawPath.slice(1);
|
|
77
78
|
}
|
|
78
|
-
throw new
|
|
79
|
+
throw new TRPCError.TRPCError({
|
|
79
80
|
code: 'INTERNAL_SERVER_ERROR',
|
|
80
81
|
message: UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE
|
|
81
82
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../unstable-core-do-not-import/rpc/codes.mjs';
|
|
2
|
+
import { TRPCError } from '../../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
3
|
+
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* 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`
|
|
5
7
|
*
|
|
6
|
-
* Do **not** import from `@trpc/core`
|
|
7
8
|
* @example
|
|
8
9
|
* ```ts
|
|
9
10
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,7 +1,6 @@
|
|
|
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`
|
|
5
4
|
* @example
|
|
6
5
|
* ```ts
|
|
7
6
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -9,7 +8,7 @@
|
|
|
9
8
|
* ```
|
|
10
9
|
*/
|
|
11
10
|
import type * as express from 'express';
|
|
12
|
-
import type { AnyRouter } from '../@trpc
|
|
11
|
+
import type { AnyRouter } from '../@trpc/server';
|
|
13
12
|
import type { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
|
|
14
13
|
export type CreateExpressContextOptions = NodeHTTPCreateContextFnOptions<express.Request, express.Response>;
|
|
15
14
|
export declare function createExpressMiddleware<TRouter extends AnyRouter>(opts: NodeHTTPHandlerOptions<TRouter, express.Request, express.Response>): express.Handler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/adapters/express.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/adapters/express.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EACV,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,2BAA2B,GAAG,8BAA8B,CACtE,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,QAAQ,CACjB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,OAAO,SAAS,SAAS,EAC/D,IAAI,EAAE,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GACvE,OAAO,CAAC,OAAO,CAgBjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
2
|
-
import type { AnyRouter } from '../../@trpc
|
|
3
|
-
import type { HTTPBaseHandlerOptions } from '
|
|
2
|
+
import type { AnyRouter } from '../../@trpc/server';
|
|
3
|
+
import type { HTTPBaseHandlerOptions } from '../../@trpc/server/http';
|
|
4
4
|
import type { NodeHTTPCreateContextOption } from '../node-http';
|
|
5
5
|
export type FastifyHandlerOptions<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply> = HTTPBaseHandlerOptions<TRouter, TRequest> & NodeHTTPCreateContextOption<TRouter, TRequest, TResponse>;
|
|
6
6
|
type FastifyRequestHandlerOptions<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply> = FastifyHandlerOptions<TRouter, TRequest, TResponse> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastifyRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyRequestHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fastifyRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyRequestHandler.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EACV,sBAAsB,EAKvB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,MAAM,qBAAqB,CAC/B,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,cAAc,EAC/B,SAAS,SAAS,YAAY,IAC5B,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAC3C,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAE5D,KAAK,4BAA4B,CAC/B,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,cAAc,EAC/B,SAAS,SAAS,YAAY,IAC5B,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,GAAG;IACxD,GAAG,EAAE,QAAQ,CAAC;IACd,GAAG,EAAE,SAAS,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,qBAAqB,CACzC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,cAAc,EAC/B,SAAS,SAAS,YAAY,EAC9B,IAAI,EAAE,4BAA4B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,kBAyFjE"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var node_stream = require('node:stream');
|
|
4
|
-
|
|
4
|
+
require('../../unstable-core-do-not-import/rpc/codes.js');
|
|
5
|
+
require('../../unstable-core-do-not-import/rootConfig.js');
|
|
6
|
+
var resolveHTTPResponse = require('../../unstable-core-do-not-import/http/resolveHTTPResponse.js');
|
|
7
|
+
var batchStreamFormatter = require('../../unstable-core-do-not-import/http/batchStreamFormatter.js');
|
|
5
8
|
|
|
6
9
|
async function fastifyRequestHandler(opts) {
|
|
7
10
|
const createContext = async (innerOpts)=>{
|
|
@@ -39,7 +42,7 @@ async function fastifyRequestHandler(opts) {
|
|
|
39
42
|
stream._read = ()=>{}; // eslint-disable-line @typescript-eslint/no-empty-function -- https://github.com/fastify/fastify/issues/805#issuecomment-369172154
|
|
40
43
|
resolve(opts.res.send(stream));
|
|
41
44
|
isStream = true;
|
|
42
|
-
formatter =
|
|
45
|
+
formatter = batchStreamFormatter.getBatchStreamFormatter();
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
const unstable_onChunk = ([index, string])=>{
|
|
@@ -50,7 +53,7 @@ async function fastifyRequestHandler(opts) {
|
|
|
50
53
|
stream.push(formatter(index, string));
|
|
51
54
|
}
|
|
52
55
|
};
|
|
53
|
-
|
|
56
|
+
resolveHTTPResponse.resolveHTTPResponse({
|
|
54
57
|
req,
|
|
55
58
|
createContext,
|
|
56
59
|
path: opts.path,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
-
import
|
|
2
|
+
import '../../unstable-core-do-not-import/rpc/codes.mjs';
|
|
3
|
+
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
4
|
+
import { resolveHTTPResponse } from '../../unstable-core-do-not-import/http/resolveHTTPResponse.mjs';
|
|
5
|
+
import { getBatchStreamFormatter } from '../../unstable-core-do-not-import/http/batchStreamFormatter.mjs';
|
|
3
6
|
|
|
4
7
|
async function fastifyRequestHandler(opts) {
|
|
5
8
|
const createContext = async (innerOpts)=>{
|
|
@@ -1,7 +1,6 @@
|
|
|
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`
|
|
5
4
|
* @example
|
|
6
5
|
* ```ts
|
|
7
6
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -10,7 +9,7 @@
|
|
|
10
9
|
*/
|
|
11
10
|
import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
12
11
|
import type { FastifyHandlerOptions } from '.';
|
|
13
|
-
import type { AnyRouter } from '../../@trpc
|
|
12
|
+
import type { AnyRouter } from '../../@trpc/server';
|
|
14
13
|
import type { NodeHTTPCreateContextFnOptions } from '../node-http';
|
|
15
14
|
export interface FastifyTRPCPluginOptions<TRouter extends AnyRouter> {
|
|
16
15
|
prefix?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastifyTRPCPlugin.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyTRPCPlugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fastifyTRPCPlugin.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyTRPCPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAKnE,MAAM,WAAW,wBAAwB,CAAC,OAAO,SAAS,SAAS;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,qBAAqB,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;CAC3E;AAED,MAAM,MAAM,2BAA2B,GAAG,8BAA8B,CACtE,cAAc,EACd,YAAY,CACb,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,SAAS,EACzD,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,EACvC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,IAAI,QAkC5B"}
|
|
@@ -6,7 +6,6 @@ var fastifyRequestHandler = require('./fastifyRequestHandler.js');
|
|
|
6
6
|
/**
|
|
7
7
|
* 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`
|
|
8
8
|
*
|
|
9
|
-
* Do **not** import from `@trpc/core`
|
|
10
9
|
* @example
|
|
11
10
|
* ```ts
|
|
12
11
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -4,7 +4,6 @@ import { fastifyRequestHandler } from './fastifyRequestHandler.mjs';
|
|
|
4
4
|
/**
|
|
5
5
|
* 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`
|
|
6
6
|
*
|
|
7
|
-
* Do **not** import from `@trpc/core`
|
|
8
7
|
* @example
|
|
9
8
|
* ```ts
|
|
10
9
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,14 +1,13 @@
|
|
|
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`
|
|
5
4
|
* @example
|
|
6
5
|
* ```ts
|
|
7
6
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
8
7
|
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
9
8
|
* ```
|
|
10
9
|
*/
|
|
11
|
-
import type { AnyRouter } from '../../@trpc
|
|
10
|
+
import type { AnyRouter } from '../../@trpc/server';
|
|
12
11
|
import type { FetchHandlerOptions } from './types';
|
|
13
12
|
export type FetchHandlerRequestOptions<TRouter extends AnyRouter> = FetchHandlerOptions<TRouter> & {
|
|
14
13
|
req: Request;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAWpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,0BAA0B,CAAC,OAAO,SAAS,SAAS,IAC9D,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAC7B,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AASJ,wBAAsB,mBAAmB,CAAC,OAAO,SAAS,SAAS,EACjE,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACxC,OAAO,CAAC,QAAQ,CAAC,CAyGnB"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('../../unstable-core-do-not-import/rpc/codes.js');
|
|
4
|
+
require('../../unstable-core-do-not-import/rootConfig.js');
|
|
5
|
+
var resolveHTTPResponse = require('../../unstable-core-do-not-import/http/resolveHTTPResponse.js');
|
|
6
|
+
var batchStreamFormatter = require('../../unstable-core-do-not-import/http/batchStreamFormatter.js');
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
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`
|
|
7
10
|
*
|
|
8
|
-
* Do **not** import from `@trpc/core`
|
|
9
11
|
* @example
|
|
10
12
|
* ```ts
|
|
11
13
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -71,7 +73,7 @@ async function fetchRequestHandler(opts) {
|
|
|
71
73
|
});
|
|
72
74
|
resolve(response);
|
|
73
75
|
encoder = new TextEncoder();
|
|
74
|
-
formatter =
|
|
76
|
+
formatter = batchStreamFormatter.getBatchStreamFormatter();
|
|
75
77
|
isStream = true;
|
|
76
78
|
}
|
|
77
79
|
};
|
|
@@ -87,7 +89,7 @@ async function fetchRequestHandler(opts) {
|
|
|
87
89
|
controller.enqueue(encoder.encode(formatter(index, string)));
|
|
88
90
|
}
|
|
89
91
|
};
|
|
90
|
-
|
|
92
|
+
resolveHTTPResponse.resolveHTTPResponse({
|
|
91
93
|
req,
|
|
92
94
|
createContext,
|
|
93
95
|
path,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../unstable-core-do-not-import/rpc/codes.mjs';
|
|
2
|
+
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
3
|
+
import { resolveHTTPResponse } from '../../unstable-core-do-not-import/http/resolveHTTPResponse.mjs';
|
|
4
|
+
import { getBatchStreamFormatter } from '../../unstable-core-do-not-import/http/batchStreamFormatter.mjs';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* 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`
|
|
5
8
|
*
|
|
6
|
-
* Do **not** import from `@trpc/core`
|
|
7
9
|
* @example
|
|
8
10
|
* ```ts
|
|
9
11
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,15 +1,14 @@
|
|
|
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`
|
|
5
4
|
* @example
|
|
6
5
|
* ```ts
|
|
7
6
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
8
7
|
* import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
|
|
9
8
|
* ```
|
|
10
9
|
*/
|
|
11
|
-
import type { AnyRouter, inferRouterContext } from '../../@trpc
|
|
12
|
-
import type { HTTPBaseHandlerOptions, TRPCRequestInfo } from '../../@trpc
|
|
10
|
+
import type { AnyRouter, inferRouterContext } from '../../@trpc/server';
|
|
11
|
+
import type { HTTPBaseHandlerOptions, TRPCRequestInfo } from '../../@trpc/server/http';
|
|
13
12
|
export type FetchCreateContextFnOptions = {
|
|
14
13
|
req: Request;
|
|
15
14
|
resHeaders: Headers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,2BAA2B,GAAG;IACxC,GAAG,EAAE,OAAO,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,SAAS,IAAI,CAC5D,IAAI,EAAE,2BAA2B,KAC9B,kBAAkB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AAExE,MAAM,MAAM,wBAAwB,CAAC,OAAO,SAAS,SAAS,IAC5D,OAAO,SAAS,kBAAkB,CAAC,OAAO,CAAC,GACvC;IACE;;QAEI;IACJ,aAAa,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;CAC/C,GACD;IACE;;QAEI;IACJ,aAAa,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;CAC9C,CAAC;AAER,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,SAAS,IACvD,wBAAwB,CAAC,OAAO,CAAC,GAAG,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC"}
|
package/dist/adapters/next.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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`
|
|
5
4
|
* @example
|
|
6
5
|
* ```ts
|
|
7
6
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -9,9 +8,12 @@
|
|
|
9
8
|
* ```
|
|
10
9
|
*/
|
|
11
10
|
import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
12
|
-
import type { AnyRouter } from '../@trpc
|
|
11
|
+
import type { AnyRouter } from '../@trpc/server';
|
|
13
12
|
import type { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
|
|
14
13
|
export type CreateNextContextOptions = NodeHTTPCreateContextFnOptions<NextApiRequest, NextApiResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Preventing "TypeScript where it's tough not to get "The inferred type of 'xxxx' cannot be named without a reference to [...]"
|
|
16
|
+
*/
|
|
15
17
|
export type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
16
18
|
export declare function createNextApiHandler<TRouter extends AnyRouter>(opts: NodeHTTPHandlerOptions<TRouter, NextApiRequest, NextApiResponse>): NextApiHandler;
|
|
17
19
|
//# sourceMappingURL=next.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA
|
|
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;AAGjD,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,CA8ChB"}
|
package/dist/adapters/next.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var getErrorShape = require('../unstable-core-do-not-import/error/getErrorShape.js');
|
|
4
|
+
var TRPCError = require('../unstable-core-do-not-import/error/TRPCError.js');
|
|
5
|
+
require('../unstable-core-do-not-import/rootConfig.js');
|
|
6
|
+
require('../unstable-core-do-not-import/rpc/codes.js');
|
|
4
7
|
var nodeHTTPRequestHandler = require('./node-http/nodeHTTPRequestHandler.js');
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* 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`
|
|
8
11
|
*
|
|
9
|
-
* Do **not** import from `@trpc/core`
|
|
10
12
|
* @example
|
|
11
13
|
* ```ts
|
|
12
14
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -26,9 +28,9 @@ function createNextApiHandler(opts) {
|
|
|
26
28
|
}
|
|
27
29
|
const path = getPath();
|
|
28
30
|
if (path === null) {
|
|
29
|
-
const error =
|
|
31
|
+
const error = getErrorShape.getErrorShape({
|
|
30
32
|
config: opts.router._def._config,
|
|
31
|
-
error: new
|
|
33
|
+
error: new TRPCError.TRPCError({
|
|
32
34
|
message: 'Query "trpc" not found - is the file named `[trpc]`.ts or `[...trpc].ts`?',
|
|
33
35
|
code: 'INTERNAL_SERVER_ERROR'
|
|
34
36
|
}),
|
package/dist/adapters/next.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { getErrorShape
|
|
1
|
+
import { getErrorShape } from '../unstable-core-do-not-import/error/getErrorShape.mjs';
|
|
2
|
+
import { TRPCError } from '../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
3
|
+
import '../unstable-core-do-not-import/rootConfig.mjs';
|
|
4
|
+
import '../unstable-core-do-not-import/rpc/codes.mjs';
|
|
2
5
|
import { nodeHTTPRequestHandler } from './node-http/nodeHTTPRequestHandler.mjs';
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* 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`
|
|
6
9
|
*
|
|
7
|
-
* Do **not** import from `@trpc/core`
|
|
8
10
|
* @example
|
|
9
11
|
* ```ts
|
|
10
12
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPostBody.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/json/getPostBody.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getPostBody.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/json/getPostBody.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACtC,GAAG,EAAE,eAAe,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiCtB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('../../../../unstable-core-do-not-import/rpc/codes.js');
|
|
4
|
+
var TRPCError = require('../../../../unstable-core-do-not-import/error/TRPCError.js');
|
|
5
|
+
require('../../../../unstable-core-do-not-import/rootConfig.js');
|
|
4
6
|
|
|
5
7
|
// @trpc/server
|
|
6
8
|
async function getPostBody(opts) {
|
|
@@ -23,7 +25,7 @@ async function getPostBody(opts) {
|
|
|
23
25
|
if (body.length > maxBodySize) {
|
|
24
26
|
resolve({
|
|
25
27
|
ok: false,
|
|
26
|
-
error: new
|
|
28
|
+
error: new TRPCError.TRPCError({
|
|
27
29
|
code: 'PAYLOAD_TOO_LARGE'
|
|
28
30
|
})
|
|
29
31
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../unstable-core-do-not-import/rpc/codes.mjs';
|
|
2
|
+
import { TRPCError } from '../../../../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
3
|
+
import '../../../../unstable-core-do-not-import/rootConfig.mjs';
|
|
2
4
|
|
|
3
5
|
// @trpc/server
|
|
4
6
|
async function getPostBody(opts) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('../../../../unstable-core-do-not-import/rpc/codes.js');
|
|
4
|
+
require('../../../../unstable-core-do-not-import/rootConfig.js');
|
|
5
|
+
var contentType$1 = require('../../../../unstable-core-do-not-import/http/contentType.js');
|
|
4
6
|
var contentType = require('../../internals/contentType.js');
|
|
5
7
|
var getPostBody = require('./getPostBody.js');
|
|
6
8
|
|
|
@@ -9,7 +11,7 @@ const nodeHTTPJSONContentTypeHandler = contentType.createNodeHTTPContentTypeHand
|
|
|
9
11
|
return !!opts.req.headers['content-type']?.startsWith('application/json');
|
|
10
12
|
},
|
|
11
13
|
getBody: getPostBody.getPostBody,
|
|
12
|
-
getInputs:
|
|
14
|
+
getInputs: contentType$1.getJsonContentTypeInputs
|
|
13
15
|
});
|
|
14
16
|
|
|
15
17
|
exports.nodeHTTPJSONContentTypeHandler = nodeHTTPJSONContentTypeHandler;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../../unstable-core-do-not-import/rpc/codes.mjs';
|
|
2
|
+
import '../../../../unstable-core-do-not-import/rootConfig.mjs';
|
|
3
|
+
import { getJsonContentTypeInputs } from '../../../../unstable-core-do-not-import/http/contentType.mjs';
|
|
2
4
|
import { createNodeHTTPContentTypeHandler } from '../../internals/contentType.mjs';
|
|
3
5
|
import { getPostBody } from './getPostBody.mjs';
|
|
4
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyRouter } from '../../../@trpc
|
|
2
|
-
import type { BaseContentTypeHandler } from '../../../@trpc
|
|
1
|
+
import type { AnyRouter } from '../../../@trpc/server';
|
|
2
|
+
import type { BaseContentTypeHandler } from '../../../@trpc/server/http';
|
|
3
3
|
import type { NodeHTTPRequest, NodeHTTPRequestHandlerOptions, NodeHTTPResponse } from '../types';
|
|
4
4
|
export interface NodeHTTPContentTypeHandler<TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> extends BaseContentTypeHandler<NodeHTTPRequestHandlerOptions<AnyRouter, TRequest, TResponse> & {
|
|
5
5
|
query: URLSearchParams;
|