@trpc/server 11.0.0-next-alpha.170 → 11.0.0-next-alpha.175

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.
Files changed (88) hide show
  1. package/dist/{unstableDoNotImportThis.d.ts → @trpc-core-unstable-do-not-import-this-please.d.ts} +1 -1
  2. package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts.map +1 -0
  3. package/dist/@trpc-server/http.d.ts +2 -0
  4. package/dist/@trpc-server/http.d.ts.map +1 -0
  5. package/dist/@trpc-server.d.ts +37 -0
  6. package/dist/@trpc-server.d.ts.map +1 -0
  7. package/dist/adapters/aws-lambda/index.d.ts +11 -1
  8. package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
  9. package/dist/adapters/aws-lambda/index.js +20 -0
  10. package/dist/adapters/aws-lambda/index.mjs +20 -0
  11. package/dist/adapters/aws-lambda/utils.d.ts +11 -1
  12. package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
  13. package/dist/adapters/express.d.ts +11 -1
  14. package/dist/adapters/express.d.ts.map +1 -1
  15. package/dist/adapters/express.js +2 -2
  16. package/dist/adapters/express.mjs +2 -2
  17. package/dist/adapters/fastify/fastifyRequestHandler.d.ts +1 -1
  18. package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
  19. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +11 -1
  20. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
  21. package/dist/adapters/fastify/index.js +11 -2
  22. package/dist/adapters/fastify/index.mjs +11 -2
  23. package/dist/adapters/fetch/fetchRequestHandler.d.ts +11 -1
  24. package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
  25. package/dist/adapters/fetch/index.js +10 -0
  26. package/dist/adapters/fetch/index.mjs +10 -0
  27. package/dist/adapters/fetch/types.d.ts +12 -2
  28. package/dist/adapters/fetch/types.d.ts.map +1 -1
  29. package/dist/adapters/next.d.ts +11 -1
  30. package/dist/adapters/next.d.ts.map +1 -1
  31. package/dist/adapters/next.js +12 -2
  32. package/dist/adapters/next.mjs +12 -2
  33. package/dist/adapters/node-http/content-type/form-data/index.d.ts.map +1 -1
  34. package/dist/adapters/node-http/content-type/form-data/index.js +1 -1
  35. package/dist/adapters/node-http/content-type/form-data/index.mjs +1 -1
  36. package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
  37. package/dist/adapters/node-http/content-type/json/index.js +2 -1
  38. package/dist/adapters/node-http/content-type/json/index.mjs +2 -1
  39. package/dist/adapters/node-http/index.js +2 -2
  40. package/dist/adapters/node-http/index.mjs +2 -2
  41. package/dist/adapters/node-http/internals/contentType.d.ts +2 -2
  42. package/dist/adapters/node-http/internals/contentType.d.ts.map +1 -1
  43. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +11 -1
  44. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
  45. package/dist/adapters/node-http/types.d.ts +13 -2
  46. package/dist/adapters/node-http/types.d.ts.map +1 -1
  47. package/dist/adapters/standalone.d.ts +11 -1
  48. package/dist/adapters/standalone.d.ts.map +1 -1
  49. package/dist/adapters/standalone.js +2 -2
  50. package/dist/adapters/standalone.mjs +2 -2
  51. package/dist/adapters/ws.d.ts +2 -1
  52. package/dist/adapters/ws.d.ts.map +1 -1
  53. package/dist/adapters/ws.js +1 -1
  54. package/dist/adapters/ws.mjs +1 -1
  55. package/dist/bundle-analysis.json +72 -72
  56. package/dist/{contentType-3194ed5f.mjs → contentType-72ed9df5.mjs} +1 -0
  57. package/dist/{contentType-8c16408e.js → contentType-d9d22104.js} +1 -0
  58. package/dist/http.d.ts +1 -1
  59. package/dist/http.d.ts.map +1 -1
  60. package/dist/index.d.ts +1 -19
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +28 -8
  63. package/dist/index.mjs +1 -1
  64. package/dist/{nodeHTTPRequestHandler-36974696.mjs → nodeHTTPRequestHandler-0223fac5.mjs} +10 -0
  65. package/dist/{nodeHTTPRequestHandler-30028c9a.js → nodeHTTPRequestHandler-83441c73.js} +10 -0
  66. package/package.json +4 -20
  67. package/src/@trpc-server/http.ts +2 -0
  68. package/src/@trpc-server.ts +60 -0
  69. package/src/adapters/aws-lambda/index.ts +14 -2
  70. package/src/adapters/aws-lambda/utils.ts +14 -2
  71. package/src/adapters/express.ts +12 -1
  72. package/src/adapters/fastify/fastifyRequestHandler.ts +12 -1
  73. package/src/adapters/fastify/fastifyTRPCPlugin.ts +12 -1
  74. package/src/adapters/fetch/fetchRequestHandler.ts +12 -1
  75. package/src/adapters/fetch/types.ts +17 -2
  76. package/src/adapters/next.ts +14 -2
  77. package/src/adapters/node-http/content-type/form-data/index.ts +2 -1
  78. package/src/adapters/node-http/content-type/json/getPostBody.ts +2 -1
  79. package/src/adapters/node-http/internals/contentType.ts +4 -2
  80. package/src/adapters/node-http/nodeHTTPRequestHandler.ts +12 -1
  81. package/src/adapters/node-http/types.ts +19 -2
  82. package/src/adapters/standalone.ts +12 -1
  83. package/src/adapters/ws.ts +10 -8
  84. package/src/http.ts +1 -2
  85. package/src/index.ts +1 -35
  86. package/dist/unstableDoNotImportThis.d.ts.map +0 -1
  87. /package/dist/{nodeHTTPRequestHandler-640c1f60.js → nodeHTTPRequestHandler-aa0dce4e.js} +0 -0
  88. /package/src/{unstableDoNotImportThis.ts → @trpc-core-unstable-do-not-import-this-please.ts} +0 -0
@@ -6,4 +6,4 @@
6
6
  * If you need to import anything from here, please open an issue at https://github.com/trpc/trpc/issues
7
7
  */
8
8
  export * from '@trpc/core';
9
- //# sourceMappingURL=unstableDoNotImportThis.d.ts.map
9
+ //# sourceMappingURL=@trpc-core-unstable-do-not-import-this-please.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"@trpc-core-unstable-do-not-import-this-please.d.ts","sourceRoot":"","sources":["../src/@trpc-core-unstable-do-not-import-this-please.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from '@trpc/core/http';
2
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/@trpc-server/http.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,37 @@
1
+ export { TRPCError,
2
+ /**
3
+ * @deprecated use `experimental_trpcMiddleware` instead
4
+ */
5
+ experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware, initTRPC, callProcedure as callTRPCProcedure, getTRPCErrorFromUnknown, transformTRPCResponse, type inferProcedureInput, type inferProcedureOutput, type inferRouterError, type inferRouterInputs, type inferRouterOutputs, type inferRouterContext, type AnyProcedure as AnyTRPCProcedure, type AnyRouter as AnyTRPCRouter, type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction, type CombinedDataTransformer as TRPCCombinedDataTransformer, } from './@trpc-core-unstable-do-not-import-this-please';
6
+ export type {
7
+ /**
8
+ * @deprecated use `AnyTRPCProcedure` instead
9
+ */
10
+ AnyProcedure,
11
+ /**
12
+ * @deprecated use `AnyTRPCRouter` instead
13
+ */
14
+ AnyRouter,
15
+ /**
16
+ * @deprecated use `AnyTRPCMiddlewareFunction` instead
17
+ */
18
+ AnyMiddlewareFunction,
19
+ /**
20
+ * @deprecated use `TRPCCombinedDataTransformer` instead
21
+ */
22
+ CombinedDataTransformer, } from '@trpc/core';
23
+ export {
24
+ /**
25
+ * @deprecated use `getTRPCErrorShape` instead
26
+ */
27
+ getErrorShape,
28
+ /**
29
+ * @deprecated use `callTRPCProcedure` instead
30
+ */
31
+ callProcedure, } from '@trpc/core';
32
+ /**
33
+ * @deprecated
34
+ * Use `Awaited<ReturnType<typeof myFunction>>` instead
35
+ */
36
+ export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> = Awaited<ReturnType<TFunction>>;
37
+ //# sourceMappingURL=@trpc-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"@trpc-server.d.ts","sourceRoot":"","sources":["../src/@trpc-server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS;AACT;;GAEG;AACH,iCAAiC,EACjC,iCAAiC,IAAI,2BAA2B,EAChE,QAAQ,EACR,aAAa,IAAI,iBAAiB,EAClC,uBAAuB,EACvB,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,IAAI,gBAAgB,EACrC,KAAK,SAAS,IAAI,aAAa,EAC/B,KAAK,qBAAqB,IAAI,yBAAyB,EACvD,KAAK,uBAAuB,IAAI,2BAA2B,GAC5D,MAAM,iDAAiD,CAAC;AAEzD,YAAY;AACV;;GAEG;AACH,YAAY;AACZ;;GAEG;AACH,SAAS;AACT;;GAEG;AACH,qBAAqB;AACrB;;GAEG;AACH,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAEpB,OAAO;AACL;;GAEG;AACH,aAAa;AAEb;;GAEG;AACH,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB;;;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"}
@@ -1,5 +1,15 @@
1
- import type { AnyRouter } from '@trpc/core';
1
+ /**
2
+ * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
+ *
4
+ * Do **not** import from `@trpc/core`
5
+ * @example
6
+ * ```ts
7
+ * import type { AnyTRPCRouter } from '@trpc/server'
8
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
9
+ * ```
10
+ */
2
11
  import type { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2, Context as APIGWContext } from 'aws-lambda';
12
+ import type { AnyRouter } from '../../@trpc-server';
3
13
  import type { APIGatewayEvent, AWSLambdaOptions } from './utils';
4
14
  export * from './utils';
5
15
  /** 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,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EACjC,OAAO,IAAI,YAAY,EACxB,MAAM,YAAY,CAAC;AAOpB,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
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;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"}
@@ -5,6 +5,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var core = require('@trpc/core');
6
6
  var http = require('@trpc/core/http');
7
7
 
8
+ /**
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`
10
+ *
11
+ * Do **not** import from `@trpc/core`
12
+ * @example
13
+ * ```ts
14
+ * import type { AnyTRPCRouter } from '@trpc/server'
15
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
16
+ * ```
17
+ */ // @trpc/server
8
18
  function isPayloadV1(event) {
9
19
  return determinePayloadFormat(event) == '1.0';
10
20
  }
@@ -85,6 +95,16 @@ function transformHeaders(headers) {
85
95
  }
86
96
  const UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE = 'Custom payload format version not handled by this adapter. Please use either 1.0 or 2.0. More information here' + 'https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html';
87
97
 
98
+ /**
99
+ * 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`
100
+ *
101
+ * Do **not** import from `@trpc/core`
102
+ * @example
103
+ * ```ts
104
+ * import type { AnyTRPCRouter } from '@trpc/server'
105
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
106
+ * ```
107
+ */ // @trpc/server
88
108
  function lambdaEventToHTTPRequest(event) {
89
109
  const query = new URLSearchParams();
90
110
  for (const [key, value] of Object.entries(event.queryStringParameters ?? {})){
@@ -1,6 +1,16 @@
1
1
  import { TRPCError } from '@trpc/core';
2
2
  import { resolveHTTPResponse } from '@trpc/core/http';
3
3
 
4
+ /**
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
+ *
7
+ * Do **not** import from `@trpc/core`
8
+ * @example
9
+ * ```ts
10
+ * import type { AnyTRPCRouter } from '@trpc/server'
11
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
12
+ * ```
13
+ */ // @trpc/server
4
14
  function isPayloadV1(event) {
5
15
  return determinePayloadFormat(event) == '1.0';
6
16
  }
@@ -81,6 +91,16 @@ function transformHeaders(headers) {
81
91
  }
82
92
  const UNKNOWN_PAYLOAD_FORMAT_VERSION_ERROR_MESSAGE = 'Custom payload format version not handled by this adapter. Please use either 1.0 or 2.0. More information here' + 'https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html';
83
93
 
94
+ /**
95
+ * 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`
96
+ *
97
+ * Do **not** import from `@trpc/core`
98
+ * @example
99
+ * ```ts
100
+ * import type { AnyTRPCRouter } from '@trpc/server'
101
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
102
+ * ```
103
+ */ // @trpc/server
84
104
  function lambdaEventToHTTPRequest(event) {
85
105
  const query = new URLSearchParams();
86
106
  for (const [key, value] of Object.entries(event.queryStringParameters ?? {})){
@@ -1,5 +1,15 @@
1
- import type { AnyRouter, inferRouterContext } from '@trpc/core';
1
+ /**
2
+ * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
+ *
4
+ * Do **not** import from `@trpc/core`
5
+ * @example
6
+ * ```ts
7
+ * import type { AnyTRPCRouter } from '@trpc/server'
8
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
9
+ * ```
10
+ */
2
11
  import type { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2, Context as APIGWContext } from 'aws-lambda';
12
+ import type { AnyRouter, inferRouterContext } from '../../@trpc-server';
3
13
  import type { HTTPHeaders, OnErrorFunction, ResponseMetaFn, TRPCRequestInfo } from '../../http';
4
14
  export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
5
15
  export type APIGatewayResult = APIGatewayProxyResult | APIGatewayProxyStructuredResultV2;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iCAAiC,EACjC,OAAO,IAAI,YAAY,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,cAAc,EACd,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,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,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AC;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,5 +1,15 @@
1
- import type { AnyRouter } from '@trpc/core';
1
+ /**
2
+ * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
+ *
4
+ * Do **not** import from `@trpc/core`
5
+ * @example
6
+ * ```ts
7
+ * import type { AnyTRPCRouter } from '@trpc/server'
8
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
9
+ * ```
10
+ */
2
11
  import type * as express from 'express';
12
+ import type { AnyRouter } from '../@trpc-server';
3
13
  import type { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
4
14
  export type CreateExpressContextOptions = NodeHTTPCreateContextFnOptions<express.Request, express.Response>;
5
15
  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,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,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
+ {"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/adapters/express.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AAExC,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"}
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-30028c9a.js');
5
+ var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-83441c73.js');
6
6
  require('@trpc/core/http');
7
7
  require('./node-http/content-type/json/index.js');
8
- require('../contentType-8c16408e.js');
8
+ require('../contentType-d9d22104.js');
9
9
  require('@trpc/core');
10
10
 
11
11
  function createExpressMiddleware(opts) {
@@ -1,7 +1,7 @@
1
- import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-36974696.mjs';
1
+ import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-0223fac5.mjs';
2
2
  import '@trpc/core/http';
3
3
  import './node-http/content-type/json/index.mjs';
4
- import '../contentType-3194ed5f.mjs';
4
+ import '../contentType-72ed9df5.mjs';
5
5
  import '@trpc/core';
6
6
 
7
7
  function createExpressMiddleware(opts) {
@@ -1,5 +1,5 @@
1
- import type { AnyRouter } from '@trpc/core';
2
1
  import type { FastifyReply, FastifyRequest } from 'fastify';
2
+ import type { AnyRouter } from '../../@trpc-server';
3
3
  import type { HTTPBaseHandlerOptions } from '../../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>;
@@ -1 +1 @@
1
- {"version":3,"file":"fastifyRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyRequestHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EACV,sBAAsB,EAKvB,MAAM,YAAY,CAAC;AAEpB,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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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,6 +1,16 @@
1
- import type { AnyRouter } from '@trpc/core';
1
+ /**
2
+ * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
+ *
4
+ * Do **not** import from `@trpc/core`
5
+ * @example
6
+ * ```ts
7
+ * import type { AnyTRPCRouter } from '@trpc/server'
8
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
9
+ * ```
10
+ */
2
11
  import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
3
12
  import type { FastifyHandlerOptions } from '.';
13
+ import type { AnyRouter } from '../../@trpc-server';
4
14
  import type { NodeHTTPCreateContextFnOptions } from '../node-http';
5
15
  export interface FastifyTRPCPluginOptions<TRouter extends AnyRouter> {
6
16
  prefix?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fastifyTRPCPlugin.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyTRPCPlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAC;AAC/C,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"}
1
+ {"version":3,"file":"fastifyTRPCPlugin.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyTRPCPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;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"}
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var node_stream = require('node:stream');
6
6
  var http = require('@trpc/core/http');
7
7
  var adapters_ws = require('../ws.js');
8
- require('@trpc/core');
9
8
  require('@trpc/core/observable');
10
9
  require('@trpc/core/rpc');
10
+ require('@trpc/core');
11
11
 
12
12
  async function fastifyRequestHandler(opts) {
13
13
  const createContext = async (innerOpts)=>{
@@ -84,7 +84,16 @@ async function fastifyRequestHandler(opts) {
84
84
  return promise;
85
85
  }
86
86
 
87
- /// <reference types="@fastify/websocket" />
87
+ /**
88
+ * 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`
89
+ *
90
+ * Do **not** import from `@trpc/core`
91
+ * @example
92
+ * ```ts
93
+ * import type { AnyTRPCRouter } from '@trpc/server'
94
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
95
+ * ```
96
+ */ /// <reference types="@fastify/websocket" />
88
97
  function fastifyTRPCPlugin(fastify, opts, done) {
89
98
  fastify.removeContentTypeParser('application/json');
90
99
  fastify.addContentTypeParser('application/json', {
@@ -1,9 +1,9 @@
1
1
  import { Readable } from 'node:stream';
2
2
  import { resolveHTTPResponse, getBatchStreamFormatter } from '@trpc/core/http';
3
3
  import { applyWSSHandler } from '../ws.mjs';
4
- import '@trpc/core';
5
4
  import '@trpc/core/observable';
6
5
  import '@trpc/core/rpc';
6
+ import '@trpc/core';
7
7
 
8
8
  async function fastifyRequestHandler(opts) {
9
9
  const createContext = async (innerOpts)=>{
@@ -80,7 +80,16 @@ async function fastifyRequestHandler(opts) {
80
80
  return promise;
81
81
  }
82
82
 
83
- /// <reference types="@fastify/websocket" />
83
+ /**
84
+ * 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`
85
+ *
86
+ * Do **not** import from `@trpc/core`
87
+ * @example
88
+ * ```ts
89
+ * import type { AnyTRPCRouter } from '@trpc/server'
90
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
91
+ * ```
92
+ */ /// <reference types="@fastify/websocket" />
84
93
  function fastifyTRPCPlugin(fastify, opts, done) {
85
94
  fastify.removeContentTypeParser('application/json');
86
95
  fastify.addContentTypeParser('application/json', {
@@ -1,4 +1,14 @@
1
- import type { AnyRouter } from '@trpc/core';
1
+ /**
2
+ * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
+ *
4
+ * Do **not** import from `@trpc/core`
5
+ * @example
6
+ * ```ts
7
+ * import type { AnyTRPCRouter } from '@trpc/server'
8
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
9
+ * ```
10
+ */
11
+ import type { AnyRouter } from '../../@trpc-server';
2
12
  import type { FetchHandlerOptions } from './types';
3
13
  export type FetchHandlerRequestOptions<TRouter extends AnyRouter> = FetchHandlerOptions<TRouter> & {
4
14
  req: Request;
@@ -1 +1 @@
1
- {"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,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
+ {"version":3,"file":"fetchRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/fetchRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAQpD,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"}
@@ -4,6 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var http = require('@trpc/core/http');
6
6
 
7
+ /**
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`
9
+ *
10
+ * Do **not** import from `@trpc/core`
11
+ * @example
12
+ * ```ts
13
+ * import type { AnyTRPCRouter } from '@trpc/server'
14
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
15
+ * ```
16
+ */ // @trpc/server
7
17
  const trimSlashes = (path)=>{
8
18
  path = path.startsWith('/') ? path.slice(1) : path;
9
19
  path = path.endsWith('/') ? path.slice(0, -1) : path;
@@ -1,5 +1,15 @@
1
1
  import { resolveHTTPResponse, getBatchStreamFormatter } from '@trpc/core/http';
2
2
 
3
+ /**
4
+ * 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
+ *
6
+ * Do **not** import from `@trpc/core`
7
+ * @example
8
+ * ```ts
9
+ * import type { AnyTRPCRouter } from '@trpc/server'
10
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
11
+ * ```
12
+ */ // @trpc/server
3
13
  const trimSlashes = (path)=>{
4
14
  path = path.startsWith('/') ? path.slice(1) : path;
5
15
  path = path.endsWith('/') ? path.slice(0, -1) : path;
@@ -1,5 +1,15 @@
1
- import type { AnyRouter, inferRouterContext } from '@trpc/core';
2
- import type { HTTPBaseHandlerOptions, TRPCRequestInfo } from '../../http';
1
+ /**
2
+ * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
+ *
4
+ * Do **not** import from `@trpc/core`
5
+ * @example
6
+ * ```ts
7
+ * import type { AnyTRPCRouter } from '@trpc/server'
8
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
9
+ * ```
10
+ */
11
+ import type { AnyRouter, inferRouterContext } from '../../@trpc-server';
12
+ import type { HTTPBaseHandlerOptions, TRPCRequestInfo } from '../../@trpc-server/http';
3
13
  export type FetchCreateContextFnOptions = {
4
14
  req: Request;
5
15
  resHeaders: Headers;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE1E,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"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/fetch/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;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"}
@@ -1,5 +1,15 @@
1
- import type { AnyRouter } from '@trpc/core';
1
+ /**
2
+ * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
+ *
4
+ * Do **not** import from `@trpc/core`
5
+ * @example
6
+ * ```ts
7
+ * import type { AnyTRPCRouter } from '@trpc/server'
8
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
9
+ * ```
10
+ */
2
11
  import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
12
+ import type { AnyRouter } from '../@trpc-server';
3
13
  import type { NodeHTTPCreateContextFnOptions, NodeHTTPHandlerOptions } from './node-http';
4
14
  export type CreateNextContextOptions = NodeHTTPCreateContextFnOptions<NextApiRequest, NextApiResponse>;
5
15
  export type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
@@ -1 +1 @@
1
- {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,KAAK,EACV,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,wBAAwB,GAAG,8BAA8B,CACnE,cAAc,EACd,eAAe,CAChB,CAAC;AACF,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"}
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;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;AACF,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"}
@@ -3,11 +3,21 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@trpc/core');
6
- var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-30028c9a.js');
6
+ var nodeHTTPRequestHandler = require('../nodeHTTPRequestHandler-83441c73.js');
7
7
  require('@trpc/core/http');
8
8
  require('./node-http/content-type/json/index.js');
9
- require('../contentType-8c16408e.js');
9
+ require('../contentType-d9d22104.js');
10
10
 
11
+ /**
12
+ * 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`
13
+ *
14
+ * Do **not** import from `@trpc/core`
15
+ * @example
16
+ * ```ts
17
+ * import type { AnyTRPCRouter } from '@trpc/server'
18
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
19
+ * ```
20
+ */ // @trpc/server
11
21
  function createNextApiHandler(opts) {
12
22
  return async (req, res)=>{
13
23
  function getPath() {
@@ -1,9 +1,19 @@
1
1
  import { getErrorShape, TRPCError } from '@trpc/core';
2
- import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-36974696.mjs';
2
+ import { n as nodeHTTPRequestHandler } from '../nodeHTTPRequestHandler-0223fac5.mjs';
3
3
  import '@trpc/core/http';
4
4
  import './node-http/content-type/json/index.mjs';
5
- import '../contentType-3194ed5f.mjs';
5
+ import '../contentType-72ed9df5.mjs';
6
6
 
7
+ /**
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`
9
+ *
10
+ * Do **not** import from `@trpc/core`
11
+ * @example
12
+ * ```ts
13
+ * import type { AnyTRPCRouter } from '@trpc/server'
14
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
15
+ * ```
16
+ */ // @trpc/server
7
17
  function createNextApiHandler(opts) {
8
18
  return async (req, res)=>{
9
19
  function getPath() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/form-data/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AAKxE;;;;;;;;;GASG;AACH,iBAAe,sBAAsB,CACnC,OAAO,EAAE,eAAe,EACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,SAAW,qBAoEvB;AAED,iBAAS,0BAA0B,CAAC,GAAG,EAAE,eAAe,WAMvD;AAED,eAAO,MAAM,kCAAkC,yLAgC3C,CAAC;AAEL,OAAO,EAAE,sBAAsB,IAAI,mCAAmC,EAAE,CAAC;AACzE,OAAO,EAAE,yBAAyB,IAAI,sCAAsC,EAAE,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EACL,uBAAuB,IAAI,oCAAoC,EAC/D,cAAc,IAAI,2BAA2B,GAC9C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,IAAI,kCAAkC,EAC3D,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,0BAA0B,IAAI,uCAAuC,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/form-data/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AAKxE;;;;;;;;;GASG;AACH,iBAAe,sBAAsB,CACnC,OAAO,EAAE,eAAe,EACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,SAAW,qBAoEvB;AAED,iBAAS,0BAA0B,CAAC,GAAG,EAAE,eAAe,WAMvD;AAED,eAAO,MAAM,kCAAkC,yLAgC3C,CAAC;AAEL,OAAO,EAAE,sBAAsB,IAAI,mCAAmC,EAAE,CAAC;AACzE,OAAO,EAAE,yBAAyB,IAAI,sCAAsC,EAAE,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EACL,uBAAuB,IAAI,oCAAoC,EAC/D,cAAc,IAAI,2BAA2B,GAC9C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,IAAI,kCAAkC,EAC3D,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,0BAA0B,IAAI,uCAAuC,EAAE,CAAC"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var fs = require('node:fs/promises');
6
6
  var node_stream = require('node:stream');
7
- var contentType = require('../../../../contentType-8c16408e.js');
7
+ var contentType = require('../../../../contentType-d9d22104.js');
8
8
  var node_crypto = require('node:crypto');
9
9
  var node_fs = require('node:fs');
10
10
  var node_os = require('node:os');
@@ -1,7 +1,7 @@
1
1
  import * as fs from 'node:fs/promises';
2
2
  import { mkdir, rm, unlink, stat } from 'node:fs/promises';
3
3
  import { Transform, finished, Readable } from 'node:stream';
4
- import { c as createNodeHTTPContentTypeHandler } from '../../../../contentType-3194ed5f.mjs';
4
+ import { c as createNodeHTTPContentTypeHandler } from '../../../../contentType-72ed9df5.mjs';
5
5
  import { randomBytes } from 'node:crypto';
6
6
  import { createWriteStream, statSync, createReadStream } from 'node:fs';
7
7
  import { tmpdir } from 'node:os';
@@ -1 +1 @@
1
- {"version":3,"file":"getPostBody.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/node-http/content-type/json/getPostBody.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,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
+ {"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,kBAAkB,CAAC;AACnD,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"}
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var http = require('@trpc/core/http');
6
- var contentType = require('../../../../contentType-8c16408e.js');
6
+ var contentType = require('../../../../contentType-d9d22104.js');
7
7
  var core = require('@trpc/core');
8
8
 
9
+ // @trpc/server
9
10
  async function getPostBody(opts) {
10
11
  const { req , maxBodySize =Infinity } = opts;
11
12
  return new Promise((resolve)=>{
@@ -1,7 +1,8 @@
1
1
  import { getJsonContentTypeInputs } from '@trpc/core/http';
2
- import { c as createNodeHTTPContentTypeHandler } from '../../../../contentType-3194ed5f.mjs';
2
+ import { c as createNodeHTTPContentTypeHandler } from '../../../../contentType-72ed9df5.mjs';
3
3
  import { TRPCError } from '@trpc/core';
4
4
 
5
+ // @trpc/server
5
6
  async function getPostBody(opts) {
6
7
  const { req , maxBodySize =Infinity } = opts;
7
8
  return new Promise((resolve)=>{
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-30028c9a.js');
5
+ var nodeHTTPRequestHandler = require('../../nodeHTTPRequestHandler-83441c73.js');
6
6
  require('@trpc/core/http');
7
7
  require('./content-type/json/index.js');
8
- require('../../contentType-8c16408e.js');
8
+ require('../../contentType-d9d22104.js');
9
9
  require('@trpc/core');
10
10
 
11
11
 
@@ -1,5 +1,5 @@
1
- export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-36974696.mjs';
1
+ export { n as nodeHTTPRequestHandler } from '../../nodeHTTPRequestHandler-0223fac5.mjs';
2
2
  import '@trpc/core/http';
3
3
  import './content-type/json/index.mjs';
4
- import '../../contentType-3194ed5f.mjs';
4
+ import '../../contentType-72ed9df5.mjs';
5
5
  import '@trpc/core';
@@ -1,5 +1,5 @@
1
- import type { AnyRouter } from '@trpc/core';
2
- import type { BaseContentTypeHandler } from '../../../http';
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;
@@ -1 +1 @@
1
- {"version":3,"file":"contentType.d.ts","sourceRoot":"","sources":["../../../../src/adapters/node-http/internals/contentType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,0BAA0B,CACzC,QAAQ,SAAS,eAAe,EAChC,SAAS,SAAS,gBAAgB,CAClC,SAAQ,sBAAsB,CAC5B,6BAA6B,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,GAAG;IAC9D,KAAK,EAAE,eAAe,CAAC;CACxB,CACF;CAAG;AAEN,wBAAgB,gCAAgC,CAC9C,kBAAkB,EAAE,0BAA0B,CAC5C,eAAe,EACf,gBAAgB,CACjB,+HAOF"}
1
+ {"version":3,"file":"contentType.d.ts","sourceRoot":"","sources":["../../../../src/adapters/node-http/internals/contentType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,0BAA0B,CACzC,QAAQ,SAAS,eAAe,EAChC,SAAS,SAAS,gBAAgB,CAClC,SAAQ,sBAAsB,CAC5B,6BAA6B,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,GAAG;IAC9D,KAAK,EAAE,eAAe,CAAC;CACxB,CACF;CAAG;AAEN,wBAAgB,gCAAgC,CAC9C,kBAAkB,EAAE,0BAA0B,CAC5C,eAAe,EACf,gBAAgB,CACjB,+HAOF"}
@@ -1,4 +1,14 @@
1
- import type { AnyRouter } from '@trpc/core';
1
+ /**
2
+ * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
+ *
4
+ * Do **not** import from `@trpc/core`
5
+ * @example
6
+ * ```ts
7
+ * import type { AnyTRPCRouter } from '@trpc/server'
8
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
9
+ * ```
10
+ */
11
+ import type { AnyRouter } from '../../@trpc-server';
2
12
  import type { NodeHTTPRequest, NodeHTTPRequestHandlerOptions, NodeHTTPResponse } from './types';
3
13
  export declare function nodeHTTPRequestHandler<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>(opts: NodeHTTPRequestHandlerOptions<TRouter, TRequest, TResponse>): Promise<void>;
4
14
  //# sourceMappingURL=nodeHTTPRequestHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeHTTPRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/nodeHTTPRequestHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAU5C,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB,wBAAsB,sBAAsB,CAC1C,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,eAAe,EAChC,SAAS,SAAS,gBAAgB,EAClC,IAAI,EAAE,6BAA6B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,iBA4HlE"}
1
+ {"version":3,"file":"nodeHTTPRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/nodeHTTPRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAUpD,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB,wBAAsB,sBAAsB,CAC1C,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,eAAe,EAChC,SAAS,SAAS,gBAAgB,EAClC,IAAI,EAAE,6BAA6B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,iBA4HlE"}