@trpc/server 11.0.0-alpha-tmp-export-from-main.211 → 11.0.0-alpha-tmp-export-from-main-nuke-core.229
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/TRPCError-54f51dec.mjs +63 -0
- package/dist/TRPCError-6f02e18d.js +67 -0
- package/dist/TRPCError-792b0901.js +61 -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 +10 -7
- package/dist/adapters/aws-lambda/index.mjs +6 -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/express.d.ts +1 -2
- package/dist/adapters/express.d.ts.map +1 -1
- package/dist/adapters/express.js +8 -2
- package/dist/adapters/express.mjs +8 -2
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts +2 -2
- package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -2
- package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
- package/dist/adapters/fastify/index.js +11 -4
- package/dist/adapters/fastify/index.mjs +9 -2
- package/dist/adapters/fetch/fetchRequestHandler.d.ts +1 -2
- package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
- package/dist/adapters/fetch/index.js +9 -4
- package/dist/adapters/fetch/index.mjs +7 -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 +1 -2
- package/dist/adapters/next.d.ts.map +1 -1
- package/dist/adapters/next.js +10 -5
- package/dist/adapters/next.mjs +8 -3
- 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/index.js +5 -3
- package/dist/adapters/node-http/content-type/json/index.mjs +3 -1
- package/dist/adapters/node-http/index.js +8 -2
- package/dist/adapters/node-http/index.mjs +8 -2
- 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/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 +9 -2
- package/dist/adapters/standalone.mjs +9 -2
- package/dist/adapters/ws.d.ts +3 -2
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +31 -26
- package/dist/adapters/ws.mjs +6 -1
- package/dist/batchStreamFormatter-1971db27.js +32 -0
- package/dist/batchStreamFormatter-378277dc.mjs +30 -0
- package/dist/batchStreamFormatter-4375dc8b.js +31 -0
- package/dist/bundle-analysis.json +757 -0
- package/dist/contentType-19471015.js +59 -0
- package/dist/contentType-2e62862d.mjs +52 -0
- package/dist/contentType-4cd0be82.js +54 -0
- package/dist/createProxy-562377d3.js +127 -0
- package/dist/createProxy-72161f42.js +116 -0
- package/dist/createProxy-f7ba8b4d.mjs +121 -0
- package/dist/http.d.ts +1 -6
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +12 -21
- package/dist/http.mjs +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -41
- package/dist/index.mjs +5 -1
- package/dist/initTRPC-12d9099b.js +371 -0
- package/dist/initTRPC-69a60dfb.js +384 -0
- package/dist/initTRPC-dcdfb896.mjs +376 -0
- package/dist/{nodeHTTPRequestHandler-55f05150.js → nodeHTTPRequestHandler-71a3f758.js} +5 -4
- package/dist/{nodeHTTPRequestHandler-2d5c8791.mjs → nodeHTTPRequestHandler-c5d1d163.mjs} +3 -2
- package/dist/{nodeHTTPRequestHandler-7691fc79.js → nodeHTTPRequestHandler-f60f0b99.js} +3 -1
- package/dist/observable/index.d.ts +5 -0
- package/dist/observable/index.d.ts.map +1 -0
- package/dist/observable/index.js +110 -0
- package/dist/observable/index.mjs +101 -0
- package/dist/observable/observable.d.ts +13 -0
- package/dist/observable/observable.d.ts.map +1 -0
- package/dist/observable/operators.d.ts +8 -0
- package/dist/observable/operators.d.ts.map +1 -0
- package/dist/observable/types.d.ts +26 -0
- package/dist/observable/types.d.ts.map +1 -0
- package/dist/observable-25f4098f.js +126 -0
- package/dist/observable-bf75028f.mjs +122 -0
- package/dist/observable-e837fe43.js +126 -0
- package/dist/parseTRPCMessage-aeb00dbd.js +67 -0
- package/dist/parseTRPCMessage-ddbcc719.mjs +62 -0
- package/dist/parseTRPCMessage-ee50b281.js +65 -0
- package/dist/resolveHTTPResponse-104460bf.js +293 -0
- package/dist/resolveHTTPResponse-6a85f0a7.js +265 -0
- package/dist/resolveHTTPResponse-eb29e5cf.mjs +291 -0
- package/dist/rootConfig-52aed7d7.js +88 -0
- package/dist/rootConfig-7d3e1fc8.mjs +76 -0
- package/dist/rootConfig-ccd626d6.js +83 -0
- package/dist/router-5a3e1181.mjs +252 -0
- package/dist/router-5e93cd14.js +259 -0
- package/dist/router-d9e22315.js +262 -0
- package/dist/rpc.d.ts +1 -2
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +5 -13
- package/dist/rpc.mjs +2 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +4 -9
- package/dist/shared.mjs +2 -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/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/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/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/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/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/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/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/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 +43 -0
- package/dist/unstable-core-do-not-import/index.mjs +9 -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/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/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/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/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/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/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/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/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/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/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/package.json +53 -125
- 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 +2 -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 +14 -13
- package/src/http.ts +1 -26
- 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 -26
- 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 -3
- package/dist/observable.d.ts.map +0 -1
- package/dist/observable.js +0 -32
- 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 -16
|
@@ -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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { i as isObject } from './rootConfig-7d3e1fc8.mjs';
|
|
2
|
+
|
|
3
|
+
class UnknownCauseError extends Error {
|
|
4
|
+
}
|
|
5
|
+
function getCauseFromUnknown(cause) {
|
|
6
|
+
if (cause instanceof Error) {
|
|
7
|
+
return cause;
|
|
8
|
+
}
|
|
9
|
+
const type = typeof cause;
|
|
10
|
+
if (type === 'undefined' || type === 'function' || cause === null) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
// Primitive types just get wrapped in an error
|
|
14
|
+
if (type !== 'object') {
|
|
15
|
+
return new Error(String(cause));
|
|
16
|
+
}
|
|
17
|
+
// If it's an object, we'll create a synthetic error
|
|
18
|
+
if (isObject(cause)) {
|
|
19
|
+
const err = new UnknownCauseError();
|
|
20
|
+
for(const key in cause){
|
|
21
|
+
err[key] = cause[key];
|
|
22
|
+
}
|
|
23
|
+
return err;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
function getTRPCErrorFromUnknown(cause) {
|
|
28
|
+
if (cause instanceof TRPCError) {
|
|
29
|
+
return cause;
|
|
30
|
+
}
|
|
31
|
+
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
32
|
+
// https://github.com/trpc/trpc/pull/4848
|
|
33
|
+
return cause;
|
|
34
|
+
}
|
|
35
|
+
const trpcError = new TRPCError({
|
|
36
|
+
code: 'INTERNAL_SERVER_ERROR',
|
|
37
|
+
cause
|
|
38
|
+
});
|
|
39
|
+
// Inherit stack from error
|
|
40
|
+
if (cause instanceof Error && cause.stack) {
|
|
41
|
+
trpcError.stack = cause.stack;
|
|
42
|
+
}
|
|
43
|
+
return trpcError;
|
|
44
|
+
}
|
|
45
|
+
class TRPCError extends Error {
|
|
46
|
+
constructor(opts){
|
|
47
|
+
const cause = getCauseFromUnknown(opts.cause);
|
|
48
|
+
const message = opts.message ?? cause?.message ?? opts.code;
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
50
|
+
// @ts-ignore https://github.com/tc39/proposal-error-cause
|
|
51
|
+
super(message, {
|
|
52
|
+
cause
|
|
53
|
+
});
|
|
54
|
+
this.code = opts.code;
|
|
55
|
+
this.name = 'TRPCError';
|
|
56
|
+
if (!this.cause) {
|
|
57
|
+
// < ES2022 / < Node 16.9.0 compatability
|
|
58
|
+
this.cause = cause;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { TRPCError as T, getCauseFromUnknown as a, getTRPCErrorFromUnknown as g };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var rootConfig = require('./rootConfig-ccd626d6.js');
|
|
4
|
+
|
|
5
|
+
class UnknownCauseError extends Error {
|
|
6
|
+
}
|
|
7
|
+
function getCauseFromUnknown(cause) {
|
|
8
|
+
if (cause instanceof Error) {
|
|
9
|
+
return cause;
|
|
10
|
+
}
|
|
11
|
+
const type = typeof cause;
|
|
12
|
+
if (type === 'undefined' || type === 'function' || cause === null) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
// Primitive types just get wrapped in an error
|
|
16
|
+
if (type !== 'object') {
|
|
17
|
+
return new Error(String(cause));
|
|
18
|
+
}
|
|
19
|
+
// If it's an object, we'll create a synthetic error
|
|
20
|
+
if (rootConfig.isObject(cause)) {
|
|
21
|
+
const err = new UnknownCauseError();
|
|
22
|
+
for(const key in cause){
|
|
23
|
+
err[key] = cause[key];
|
|
24
|
+
}
|
|
25
|
+
return err;
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
function getTRPCErrorFromUnknown(cause) {
|
|
30
|
+
if (cause instanceof TRPCError) {
|
|
31
|
+
return cause;
|
|
32
|
+
}
|
|
33
|
+
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
34
|
+
// https://github.com/trpc/trpc/pull/4848
|
|
35
|
+
return cause;
|
|
36
|
+
}
|
|
37
|
+
const trpcError = new TRPCError({
|
|
38
|
+
code: 'INTERNAL_SERVER_ERROR',
|
|
39
|
+
cause
|
|
40
|
+
});
|
|
41
|
+
// Inherit stack from error
|
|
42
|
+
if (cause instanceof Error && cause.stack) {
|
|
43
|
+
trpcError.stack = cause.stack;
|
|
44
|
+
}
|
|
45
|
+
return trpcError;
|
|
46
|
+
}
|
|
47
|
+
class TRPCError extends Error {
|
|
48
|
+
constructor(opts){
|
|
49
|
+
const cause = getCauseFromUnknown(opts.cause);
|
|
50
|
+
const message = opts.message ?? cause?.message ?? opts.code;
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
52
|
+
// @ts-ignore https://github.com/tc39/proposal-error-cause
|
|
53
|
+
super(message, {
|
|
54
|
+
cause
|
|
55
|
+
});
|
|
56
|
+
this.code = opts.code;
|
|
57
|
+
this.name = 'TRPCError';
|
|
58
|
+
if (!this.cause) {
|
|
59
|
+
// < ES2022 / < Node 16.9.0 compatability
|
|
60
|
+
this.cause = cause;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
exports.TRPCError = TRPCError;
|
|
66
|
+
exports.getCauseFromUnknown = getCauseFromUnknown;
|
|
67
|
+
exports.getTRPCErrorFromUnknown = getTRPCErrorFromUnknown;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { i as isObject } from './rootConfig-52aed7d7.js';
|
|
2
|
+
|
|
3
|
+
class UnknownCauseError extends Error {
|
|
4
|
+
}
|
|
5
|
+
function getCauseFromUnknown(cause) {
|
|
6
|
+
if (cause instanceof Error) {
|
|
7
|
+
return cause;
|
|
8
|
+
}
|
|
9
|
+
const type = typeof cause;
|
|
10
|
+
if (type === 'undefined' || type === 'function' || cause === null) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
// Primitive types just get wrapped in an error
|
|
14
|
+
if (type !== 'object') {
|
|
15
|
+
return new Error(String(cause));
|
|
16
|
+
}
|
|
17
|
+
// If it's an object, we'll create a synthetic error
|
|
18
|
+
if (isObject(cause)) {
|
|
19
|
+
const err = new UnknownCauseError();
|
|
20
|
+
for (const key in cause) {
|
|
21
|
+
err[key] = cause[key];
|
|
22
|
+
}
|
|
23
|
+
return err;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
function getTRPCErrorFromUnknown(cause) {
|
|
28
|
+
if (cause instanceof TRPCError) {
|
|
29
|
+
return cause;
|
|
30
|
+
}
|
|
31
|
+
if (cause instanceof Error && cause.name === 'TRPCError') {
|
|
32
|
+
// https://github.com/trpc/trpc/pull/4848
|
|
33
|
+
return cause;
|
|
34
|
+
}
|
|
35
|
+
const trpcError = new TRPCError({
|
|
36
|
+
code: 'INTERNAL_SERVER_ERROR',
|
|
37
|
+
cause,
|
|
38
|
+
});
|
|
39
|
+
// Inherit stack from error
|
|
40
|
+
if (cause instanceof Error && cause.stack) {
|
|
41
|
+
trpcError.stack = cause.stack;
|
|
42
|
+
}
|
|
43
|
+
return trpcError;
|
|
44
|
+
}
|
|
45
|
+
class TRPCError extends Error {
|
|
46
|
+
constructor(opts) {
|
|
47
|
+
const cause = getCauseFromUnknown(opts.cause);
|
|
48
|
+
const message = opts.message ?? cause?.message ?? opts.code;
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
50
|
+
// @ts-ignore https://github.com/tc39/proposal-error-cause
|
|
51
|
+
super(message, { cause });
|
|
52
|
+
this.code = opts.code;
|
|
53
|
+
this.name = 'TRPCError';
|
|
54
|
+
if (!this.cause) {
|
|
55
|
+
// < ES2022 / < Node 16.9.0 compatability
|
|
56
|
+
this.cause = cause;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { TRPCError as T, getCauseFromUnknown as a, getTRPCErrorFromUnknown as g };
|
|
@@ -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"}
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('../../rootConfig-ccd626d6.js');
|
|
6
|
+
var TRPCError = require('../../TRPCError-6f02e18d.js');
|
|
7
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-104460bf.js');
|
|
8
|
+
require('../../createProxy-562377d3.js');
|
|
9
|
+
require('../../router-d9e22315.js');
|
|
10
|
+
require('../../contentType-4cd0be82.js');
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
13
|
* 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
14
|
*
|
|
10
|
-
* Do **not** import from `@trpc/core`
|
|
11
15
|
* @example
|
|
12
16
|
* ```ts
|
|
13
17
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -45,7 +49,7 @@ function getHTTPMethod(event) {
|
|
|
45
49
|
if (isPayloadV2(event)) {
|
|
46
50
|
return event.requestContext.http.method;
|
|
47
51
|
}
|
|
48
|
-
throw new
|
|
52
|
+
throw new TRPCError.TRPCError({
|
|
49
53
|
code: 'INTERNAL_SERVER_ERROR',
|
|
50
54
|
message: UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE
|
|
51
55
|
});
|
|
@@ -77,7 +81,7 @@ function getPath(event) {
|
|
|
77
81
|
}
|
|
78
82
|
return event.rawPath.slice(1);
|
|
79
83
|
}
|
|
80
|
-
throw new
|
|
84
|
+
throw new TRPCError.TRPCError({
|
|
81
85
|
code: 'INTERNAL_SERVER_ERROR',
|
|
82
86
|
message: UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE
|
|
83
87
|
});
|
|
@@ -97,7 +101,6 @@ const UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE = 'Custom payload format vers
|
|
|
97
101
|
/**
|
|
98
102
|
* 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`
|
|
99
103
|
*
|
|
100
|
-
* Do **not** import from `@trpc/core`
|
|
101
104
|
* @example
|
|
102
105
|
* ```ts
|
|
103
106
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -140,7 +143,7 @@ function tRPCOutputToAPIGatewayOutput(event, response) {
|
|
|
140
143
|
};
|
|
141
144
|
return resp1;
|
|
142
145
|
} else {
|
|
143
|
-
throw new
|
|
146
|
+
throw new TRPCError.TRPCError({
|
|
144
147
|
code: 'INTERNAL_SERVER_ERROR',
|
|
145
148
|
message: UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE
|
|
146
149
|
});
|
|
@@ -157,7 +160,7 @@ function awsLambdaRequestHandler(opts) {
|
|
|
157
160
|
...innerOpts
|
|
158
161
|
});
|
|
159
162
|
};
|
|
160
|
-
const response = await
|
|
163
|
+
const response = await resolveHTTPResponse.resolveHTTPResponse({
|
|
161
164
|
router: opts.router,
|
|
162
165
|
batching: opts.batching,
|
|
163
166
|
responseMeta: opts?.responseMeta,
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../rootConfig-7d3e1fc8.mjs';
|
|
2
|
+
import { T as TRPCError } from '../../TRPCError-54f51dec.mjs';
|
|
3
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-eb29e5cf.mjs';
|
|
4
|
+
import '../../createProxy-f7ba8b4d.mjs';
|
|
5
|
+
import '../../router-5a3e1181.mjs';
|
|
6
|
+
import '../../contentType-2e62862d.mjs';
|
|
2
7
|
|
|
3
8
|
/**
|
|
4
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`
|
|
5
10
|
*
|
|
6
|
-
* Do **not** import from `@trpc/core`
|
|
7
11
|
* @example
|
|
8
12
|
* ```ts
|
|
9
13
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -93,7 +97,6 @@ const UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE = 'Custom payload format vers
|
|
|
93
97
|
/**
|
|
94
98
|
* 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`
|
|
95
99
|
*
|
|
96
|
-
* Do **not** import from `@trpc/core`
|
|
97
100
|
* @example
|
|
98
101
|
* ```ts
|
|
99
102
|
* 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,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"}
|
package/dist/adapters/express.js
CHANGED
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-
|
|
6
|
-
require('
|
|
5
|
+
var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-71a3f758.js');
|
|
6
|
+
require('../rootConfig-ccd626d6.js');
|
|
7
|
+
require('../resolveHTTPResponse-104460bf.js');
|
|
8
|
+
require('../createProxy-562377d3.js');
|
|
9
|
+
require('../TRPCError-6f02e18d.js');
|
|
10
|
+
require('../router-d9e22315.js');
|
|
11
|
+
require('../contentType-4cd0be82.js');
|
|
12
|
+
require('../batchStreamFormatter-1971db27.js');
|
|
7
13
|
require('./node-http/content-type/json/index.js');
|
|
8
14
|
require('../contentType-d9d22104.js');
|
|
9
15
|
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-
|
|
2
|
-
import '
|
|
1
|
+
import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-c5d1d163.mjs';
|
|
2
|
+
import '../rootConfig-7d3e1fc8.mjs';
|
|
3
|
+
import '../resolveHTTPResponse-eb29e5cf.mjs';
|
|
4
|
+
import '../createProxy-f7ba8b4d.mjs';
|
|
5
|
+
import '../TRPCError-54f51dec.mjs';
|
|
6
|
+
import '../router-5a3e1181.mjs';
|
|
7
|
+
import '../contentType-2e62862d.mjs';
|
|
8
|
+
import '../batchStreamFormatter-378277dc.mjs';
|
|
3
9
|
import './node-http/content-type/json/index.mjs';
|
|
4
10
|
import '../contentType-72ed9df5.mjs';
|
|
5
11
|
|
|
@@ -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,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"}
|
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var node_stream = require('node:stream');
|
|
6
|
-
|
|
6
|
+
require('../../rootConfig-ccd626d6.js');
|
|
7
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-104460bf.js');
|
|
8
|
+
var batchStreamFormatter = require('../../batchStreamFormatter-1971db27.js');
|
|
7
9
|
var adapters_ws = require('../ws.js');
|
|
10
|
+
require('../../createProxy-562377d3.js');
|
|
11
|
+
require('../../TRPCError-6f02e18d.js');
|
|
12
|
+
require('../../router-d9e22315.js');
|
|
13
|
+
require('../../contentType-4cd0be82.js');
|
|
14
|
+
require('../../parseTRPCMessage-ee50b281.js');
|
|
15
|
+
require('../../observable-25f4098f.js');
|
|
8
16
|
|
|
9
17
|
async function fastifyRequestHandler(opts) {
|
|
10
18
|
const createContext = async (innerOpts)=>{
|
|
@@ -42,7 +50,7 @@ async function fastifyRequestHandler(opts) {
|
|
|
42
50
|
stream._read = ()=>{}; // eslint-disable-line @typescript-eslint/no-empty-function -- https://github.com/fastify/fastify/issues/805#issuecomment-369172154
|
|
43
51
|
resolve(opts.res.send(stream));
|
|
44
52
|
isStream = true;
|
|
45
|
-
formatter =
|
|
53
|
+
formatter = batchStreamFormatter.getBatchStreamFormatter();
|
|
46
54
|
}
|
|
47
55
|
};
|
|
48
56
|
const unstable_onChunk = ([index, string])=>{
|
|
@@ -53,7 +61,7 @@ async function fastifyRequestHandler(opts) {
|
|
|
53
61
|
stream.push(formatter(index, string));
|
|
54
62
|
}
|
|
55
63
|
};
|
|
56
|
-
|
|
64
|
+
resolveHTTPResponse.resolveHTTPResponse({
|
|
57
65
|
req,
|
|
58
66
|
createContext,
|
|
59
67
|
path: opts.path,
|
|
@@ -84,7 +92,6 @@ async function fastifyRequestHandler(opts) {
|
|
|
84
92
|
/**
|
|
85
93
|
* 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`
|
|
86
94
|
*
|
|
87
|
-
* Do **not** import from `@trpc/core`
|
|
88
95
|
* @example
|
|
89
96
|
* ```ts
|
|
90
97
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
-
import
|
|
2
|
+
import '../../rootConfig-7d3e1fc8.mjs';
|
|
3
|
+
import { r as resolveHTTPResponse } from '../../resolveHTTPResponse-eb29e5cf.mjs';
|
|
4
|
+
import { g as getBatchStreamFormatter } from '../../batchStreamFormatter-378277dc.mjs';
|
|
3
5
|
import { applyWSSHandler } from '../ws.mjs';
|
|
6
|
+
import '../../createProxy-f7ba8b4d.mjs';
|
|
7
|
+
import '../../TRPCError-54f51dec.mjs';
|
|
8
|
+
import '../../router-5a3e1181.mjs';
|
|
9
|
+
import '../../contentType-2e62862d.mjs';
|
|
10
|
+
import '../../parseTRPCMessage-ddbcc719.mjs';
|
|
11
|
+
import '../../observable-bf75028f.mjs';
|
|
4
12
|
|
|
5
13
|
async function fastifyRequestHandler(opts) {
|
|
6
14
|
const createContext = async (innerOpts)=>{
|
|
@@ -80,7 +88,6 @@ async function fastifyRequestHandler(opts) {
|
|
|
80
88
|
/**
|
|
81
89
|
* 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`
|
|
82
90
|
*
|
|
83
|
-
* Do **not** import from `@trpc/core`
|
|
84
91
|
* @example
|
|
85
92
|
* ```ts
|
|
86
93
|
* 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"}
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('../../rootConfig-ccd626d6.js');
|
|
6
|
+
var resolveHTTPResponse = require('../../resolveHTTPResponse-104460bf.js');
|
|
7
|
+
var batchStreamFormatter = require('../../batchStreamFormatter-1971db27.js');
|
|
8
|
+
require('../../createProxy-562377d3.js');
|
|
9
|
+
require('../../TRPCError-6f02e18d.js');
|
|
10
|
+
require('../../router-d9e22315.js');
|
|
11
|
+
require('../../contentType-4cd0be82.js');
|
|
6
12
|
|
|
7
13
|
/**
|
|
8
14
|
* 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
15
|
*
|
|
10
|
-
* Do **not** import from `@trpc/core`
|
|
11
16
|
* @example
|
|
12
17
|
* ```ts
|
|
13
18
|
* import type { AnyTRPCRouter } from '@trpc/server'
|
|
@@ -73,7 +78,7 @@ async function fetchRequestHandler(opts) {
|
|
|
73
78
|
});
|
|
74
79
|
resolve(response);
|
|
75
80
|
encoder = new TextEncoder();
|
|
76
|
-
formatter =
|
|
81
|
+
formatter = batchStreamFormatter.getBatchStreamFormatter();
|
|
77
82
|
isStream = true;
|
|
78
83
|
}
|
|
79
84
|
};
|
|
@@ -89,7 +94,7 @@ async function fetchRequestHandler(opts) {
|
|
|
89
94
|
controller.enqueue(encoder.encode(formatter(index, string)));
|
|
90
95
|
}
|
|
91
96
|
};
|
|
92
|
-
|
|
97
|
+
resolveHTTPResponse.resolveHTTPResponse({
|
|
93
98
|
req,
|
|
94
99
|
createContext,
|
|
95
100
|
path,
|