@trpc/server 11.0.0-next-alpha.172 → 11.0.0-next-beta.178

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 (94) 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 +13 -3
  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 +14 -4
  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 +1 -1
  34. package/dist/adapters/node-http/content-type/form-data/index.d.ts.map +1 -1
  35. package/dist/adapters/node-http/content-type/form-data/index.js +2 -2
  36. package/dist/adapters/node-http/content-type/form-data/index.mjs +2 -2
  37. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts +1 -1
  38. package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts +1 -1
  39. package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
  40. package/dist/adapters/node-http/content-type/json/index.js +2 -1
  41. package/dist/adapters/node-http/content-type/json/index.mjs +2 -1
  42. package/dist/adapters/node-http/index.js +2 -2
  43. package/dist/adapters/node-http/index.mjs +2 -2
  44. package/dist/adapters/node-http/internals/contentType.d.ts +2 -2
  45. package/dist/adapters/node-http/internals/contentType.d.ts.map +1 -1
  46. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +11 -1
  47. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
  48. package/dist/adapters/node-http/types.d.ts +15 -4
  49. package/dist/adapters/node-http/types.d.ts.map +1 -1
  50. package/dist/adapters/standalone.d.ts +11 -1
  51. package/dist/adapters/standalone.d.ts.map +1 -1
  52. package/dist/adapters/standalone.js +2 -2
  53. package/dist/adapters/standalone.mjs +2 -2
  54. package/dist/adapters/ws.d.ts +4 -3
  55. package/dist/adapters/ws.d.ts.map +1 -1
  56. package/dist/adapters/ws.js +2 -2
  57. package/dist/adapters/ws.mjs +2 -2
  58. package/dist/bundle-analysis.json +80 -80
  59. package/dist/{contentType-3194ed5f.mjs → contentType-72ed9df5.mjs} +1 -0
  60. package/dist/{contentType-8c16408e.js → contentType-d9d22104.js} +1 -0
  61. package/dist/http.d.ts +1 -1
  62. package/dist/http.d.ts.map +1 -1
  63. package/dist/index.d.ts +1 -23
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +28 -8
  66. package/dist/index.mjs +1 -1
  67. package/dist/{nodeHTTPRequestHandler-36974696.mjs → nodeHTTPRequestHandler-0223fac5.mjs} +10 -0
  68. package/dist/{nodeHTTPRequestHandler-30028c9a.js → nodeHTTPRequestHandler-83441c73.js} +10 -0
  69. package/package.json +4 -20
  70. package/src/@trpc-server/http.ts +2 -0
  71. package/src/@trpc-server.ts +60 -0
  72. package/src/adapters/aws-lambda/index.ts +14 -2
  73. package/src/adapters/aws-lambda/utils.ts +16 -4
  74. package/src/adapters/express.ts +12 -1
  75. package/src/adapters/fastify/fastifyRequestHandler.ts +12 -1
  76. package/src/adapters/fastify/fastifyTRPCPlugin.ts +12 -1
  77. package/src/adapters/fetch/fetchRequestHandler.ts +12 -1
  78. package/src/adapters/fetch/types.ts +19 -4
  79. package/src/adapters/next.ts +14 -2
  80. package/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts +1 -1
  81. package/src/adapters/node-http/content-type/form-data/index.ts +4 -3
  82. package/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts +1 -1
  83. package/src/adapters/node-http/content-type/form-data/uploadHandler.ts +1 -1
  84. package/src/adapters/node-http/content-type/json/getPostBody.ts +2 -1
  85. package/src/adapters/node-http/internals/contentType.ts +4 -2
  86. package/src/adapters/node-http/nodeHTTPRequestHandler.ts +12 -1
  87. package/src/adapters/node-http/types.ts +21 -4
  88. package/src/adapters/standalone.ts +12 -1
  89. package/src/adapters/ws.ts +13 -11
  90. package/src/http.ts +1 -2
  91. package/src/index.ts +1 -39
  92. package/dist/unstableDoNotImportThis.d.ts.map +0 -1
  93. /package/dist/{nodeHTTPRequestHandler-640c1f60.js → nodeHTTPRequestHandler-aa0dce4e.js} +0 -0
  94. /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;
@@ -18,12 +28,12 @@ export type AWSLambdaOptions<TRouter extends AnyRouter, TEvent extends APIGatewa
18
28
  responseMeta?: ResponseMetaFn<TRouter>;
19
29
  } & ({
20
30
  /**
21
- * @link https://trpc.io/docs/context
31
+ * @link https://trpc.io/docs/v11/context
22
32
  **/
23
33
  createContext: AWSLambdaCreateContextFn<TRouter, TEvent>;
24
34
  } | {
25
35
  /**
26
- * @link https://trpc.io/docs/context
36
+ * @link https://trpc.io/docs/v11/context
27
37
  **/
28
38
  createContext?: AWSLambdaCreateContextFn<TRouter, TEvent>;
29
39
  });
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/adapters/aws-lambda/utils.ts"],"names":[],"mappings":"AAAA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,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,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
+ {"version":3,"file":"fastifyRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/fastify/fastifyRequestHandler.ts"],"names":[],"mappings":"AAWA,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,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,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,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;
@@ -8,12 +18,12 @@ export type FetchCreateContextFnOptions = {
8
18
  export type FetchCreateContextFn<TRouter extends AnyRouter> = (opts: FetchCreateContextFnOptions) => inferRouterContext<TRouter> | Promise<inferRouterContext<TRouter>>;
9
19
  export type FetchCreateContextOption<TRouter extends AnyRouter> = unknown extends inferRouterContext<TRouter> ? {
10
20
  /**
11
- * @link https://trpc.io/docs/context
21
+ * @link https://trpc.io/docs/v11/context
12
22
  **/
13
23
  createContext?: FetchCreateContextFn<TRouter>;
14
24
  } : {
15
25
  /**
16
- * @link https://trpc.io/docs/context
26
+ * @link https://trpc.io/docs/v11/context
17
27
  **/
18
28
  createContext: FetchCreateContextFn<TRouter>;
19
29
  };
@@ -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() {
@@ -14,7 +14,7 @@ import type { UploadHandler } from './uploadHandler';
14
14
  * @param uploadHandler A function that handles file uploads and returns a value to be used in the request body. If uploaded to disk, the returned value is a NodeOnDiskFile. If uploaded to memory, the returned value is a File.
15
15
  * @param maxBodySize The maximum size of the request body in bytes. Defaults to Infinity.
16
16
  *
17
- * @see https://remix.run/utils/parse-multipart-form-data
17
+ * @link https://remix.run/utils/parse-multipart-form-data
18
18
  */
19
19
  declare function parseMultipartFormData(request: NodeHTTPRequest, uploadHandler: UploadHandler, maxBodySize?: number): Promise<FormData>;
20
20
  declare function isMultipartFormDataRequest(req: NodeHTTPRequest): boolean;
@@ -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');
@@ -662,7 +662,7 @@ const utfTextDecoder = new TextDecoder('utf-8');
662
662
  * @param uploadHandler A function that handles file uploads and returns a value to be used in the request body. If uploaded to disk, the returned value is a NodeOnDiskFile. If uploaded to memory, the returned value is a File.
663
663
  * @param maxBodySize The maximum size of the request body in bytes. Defaults to Infinity.
664
664
  *
665
- * @see https://remix.run/utils/parse-multipart-form-data
665
+ * @link https://remix.run/utils/parse-multipart-form-data
666
666
  */ async function parseMultipartFormData(request, uploadHandler, maxBodySize = Infinity) {
667
667
  const contentType = request.headers['content-type'] ?? '';
668
668
  const [type, boundary] = contentType.split(/\s*;\s*boundary=/);
@@ -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';
@@ -639,7 +639,7 @@ const utfTextDecoder = new TextDecoder('utf-8');
639
639
  * @param uploadHandler A function that handles file uploads and returns a value to be used in the request body. If uploaded to disk, the returned value is a NodeOnDiskFile. If uploaded to memory, the returned value is a File.
640
640
  * @param maxBodySize The maximum size of the request body in bytes. Defaults to Infinity.
641
641
  *
642
- * @see https://remix.run/utils/parse-multipart-form-data
642
+ * @link https://remix.run/utils/parse-multipart-form-data
643
643
  */ async function parseMultipartFormData(request, uploadHandler, maxBodySize = Infinity) {
644
644
  const contentType = request.headers['content-type'] ?? '';
645
645
  const [type, boundary] = contentType.split(/\s*;\s*boundary=/);
@@ -5,7 +5,7 @@
5
5
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6
6
  */
7
7
  /**
8
- * @see https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/upload/memoryUploadHandler.ts
8
+ * @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/upload/memoryUploadHandler.ts
9
9
  */
10
10
  import type { UploadHandler } from './uploadHandler';
11
11
  export type MemoryUploadHandlerFilterArgs = {
@@ -1,6 +1,6 @@
1
1
  import type { NodeOnDiskFile } from './fileUploadHandler';
2
2
  /**
3
- * @see https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/formData.ts
3
+ * @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/formData.ts
4
4
  */
5
5
  export type UploadHandlerPart = {
6
6
  name: string;
@@ -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)=>{