@trpc/server 11.0.0-rc.348 → 11.0.0-rc.354

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 (160) hide show
  1. package/dist/@trpc/server/http.d.ts +1 -0
  2. package/dist/@trpc/server/http.d.ts.map +1 -1
  3. package/dist/@trpc/server/index.d.ts +1 -2
  4. package/dist/@trpc/server/index.d.ts.map +1 -1
  5. package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
  6. package/dist/adapters/aws-lambda/index.js +9 -19
  7. package/dist/adapters/aws-lambda/index.mjs +9 -19
  8. package/dist/adapters/aws-lambda/utils.d.ts +12 -3
  9. package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
  10. package/dist/adapters/aws-lambda/utils.js +1 -12
  11. package/dist/adapters/aws-lambda/utils.mjs +2 -12
  12. package/dist/adapters/express.d.ts.map +1 -1
  13. package/dist/adapters/express.js +1 -0
  14. package/dist/adapters/express.mjs +1 -0
  15. package/dist/adapters/fastify/fastifyRequestHandler.d.ts +9 -1
  16. package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
  17. package/dist/adapters/fastify/fastifyRequestHandler.js +2 -10
  18. package/dist/adapters/fastify/fastifyRequestHandler.mjs +2 -10
  19. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -1
  20. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
  21. package/dist/adapters/fetch/fetchRequestHandler.d.ts +5 -1
  22. package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
  23. package/dist/adapters/fetch/fetchRequestHandler.js +2 -16
  24. package/dist/adapters/fetch/fetchRequestHandler.mjs +2 -16
  25. package/dist/adapters/fetch/types.d.ts +12 -9
  26. package/dist/adapters/fetch/types.d.ts.map +1 -1
  27. package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts +7 -2
  28. package/dist/adapters/next-app-dir/nextAppDirCaller.d.ts.map +1 -1
  29. package/dist/adapters/next.d.ts.map +1 -1
  30. package/dist/adapters/next.js +1 -0
  31. package/dist/adapters/next.mjs +1 -0
  32. package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts +73 -0
  33. package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts.map +1 -0
  34. package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.js +161 -0
  35. package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.mjs +157 -0
  36. package/dist/adapters/node-http/content-type/form-data/index.d.ts +25 -4
  37. package/dist/adapters/node-http/content-type/form-data/index.d.ts.map +1 -1
  38. package/dist/adapters/node-http/content-type/form-data/index.js +128 -25
  39. package/dist/adapters/node-http/content-type/form-data/index.mjs +103 -25
  40. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts +31 -0
  41. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts.map +1 -0
  42. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.js +29 -0
  43. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.mjs +27 -0
  44. package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts +16 -0
  45. package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts.map +1 -0
  46. package/dist/adapters/node-http/content-type/form-data/streamSlice.js +46 -0
  47. package/dist/adapters/node-http/content-type/form-data/streamSlice.mjs +44 -0
  48. package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts +45 -0
  49. package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts.map +1 -0
  50. package/dist/adapters/node-http/content-type/form-data/uploadHandler.js +30 -0
  51. package/dist/adapters/node-http/content-type/form-data/uploadHandler.mjs +26 -0
  52. package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +1 -1
  53. package/dist/adapters/node-http/content-type/json/getPostBody.js +12 -4
  54. package/dist/adapters/node-http/content-type/json/getPostBody.mjs +12 -4
  55. package/dist/adapters/node-http/content-type/json/index.d.ts +1 -4
  56. package/dist/adapters/node-http/content-type/json/index.d.ts.map +1 -1
  57. package/dist/adapters/node-http/content-type/json/index.js +10 -59
  58. package/dist/adapters/node-http/content-type/json/index.mjs +10 -59
  59. package/dist/adapters/node-http/internals/contentType.d.ts +9 -0
  60. package/dist/adapters/node-http/internals/contentType.d.ts.map +1 -0
  61. package/dist/adapters/node-http/internals/contentType.js +8 -0
  62. package/dist/adapters/node-http/internals/contentType.mjs +6 -0
  63. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
  64. package/dist/adapters/node-http/nodeHTTPRequestHandler.js +21 -19
  65. package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +22 -20
  66. package/dist/adapters/node-http/types.d.ts +19 -8
  67. package/dist/adapters/node-http/types.d.ts.map +1 -1
  68. package/dist/adapters/standalone.d.ts.map +1 -1
  69. package/dist/adapters/standalone.js +1 -0
  70. package/dist/adapters/standalone.mjs +1 -0
  71. package/dist/adapters/ws.d.ts +12 -2
  72. package/dist/adapters/ws.d.ts.map +1 -1
  73. package/dist/bundle-analysis.json +225 -219
  74. package/dist/http.js +2 -0
  75. package/dist/http.mjs +1 -0
  76. package/dist/index.js +0 -2
  77. package/dist/index.mjs +0 -1
  78. package/dist/unstable-core-do-not-import/http/contentType.d.ts +15 -7
  79. package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +1 -1
  80. package/dist/unstable-core-do-not-import/http/contentType.js +54 -0
  81. package/dist/unstable-core-do-not-import/http/contentType.mjs +52 -0
  82. package/dist/unstable-core-do-not-import/http/index.d.ts +1 -0
  83. package/dist/unstable-core-do-not-import/http/index.d.ts.map +1 -1
  84. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +5 -5
  85. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +1 -1
  86. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.js +22 -25
  87. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs +22 -25
  88. package/dist/unstable-core-do-not-import/http/types.d.ts +2 -0
  89. package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -1
  90. package/dist/unstable-core-do-not-import/initTRPC.d.ts +1 -1
  91. package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +1 -1
  92. package/dist/unstable-core-do-not-import/rootConfig.d.ts +0 -21
  93. package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +1 -1
  94. package/dist/unstable-core-do-not-import.js +2 -0
  95. package/dist/unstable-core-do-not-import.mjs +1 -0
  96. package/package.json +3 -2
  97. package/src/@trpc/server/http.ts +1 -0
  98. package/src/@trpc/server/index.ts +1 -4
  99. package/src/adapters/aws-lambda/index.ts +9 -24
  100. package/src/adapters/aws-lambda/utils.ts +15 -21
  101. package/src/adapters/express.ts +6 -1
  102. package/src/adapters/fastify/fastifyRequestHandler.ts +21 -15
  103. package/src/adapters/fastify/fastifyTRPCPlugin.ts +1 -1
  104. package/src/adapters/fetch/fetchRequestHandler.ts +10 -22
  105. package/src/adapters/fetch/types.ts +15 -22
  106. package/src/adapters/next-app-dir/nextAppDirCaller.ts +9 -2
  107. package/src/adapters/next.ts +6 -1
  108. package/src/adapters/node-http/content-type/form-data/fileUploadHandler.ts +277 -0
  109. package/src/adapters/node-http/content-type/form-data/index.ts +159 -33
  110. package/src/adapters/node-http/content-type/form-data/memoryUploadHandler.ts +56 -0
  111. package/src/adapters/node-http/content-type/form-data/streamSlice.ts +56 -0
  112. package/src/adapters/node-http/content-type/form-data/uploadHandler.ts +89 -0
  113. package/src/adapters/node-http/content-type/json/getPostBody.ts +18 -9
  114. package/src/adapters/node-http/content-type/json/index.ts +7 -87
  115. package/src/adapters/node-http/{content-type/types.ts → internals/contentType.ts} +14 -2
  116. package/src/adapters/node-http/nodeHTTPRequestHandler.ts +35 -22
  117. package/src/adapters/node-http/types.ts +46 -46
  118. package/src/adapters/standalone.ts +2 -1
  119. package/src/adapters/ws.ts +14 -9
  120. package/src/unstable-core-do-not-import/http/contentType.ts +85 -10
  121. package/src/unstable-core-do-not-import/http/index.ts +1 -0
  122. package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +28 -29
  123. package/src/unstable-core-do-not-import/http/types.ts +2 -0
  124. package/src/unstable-core-do-not-import/initTRPC.ts +1 -0
  125. package/src/unstable-core-do-not-import/rootConfig.ts +0 -31
  126. package/dist/adapters/aws-lambda/content-type/json/index.d.ts +0 -10
  127. package/dist/adapters/aws-lambda/content-type/json/index.d.ts.map +0 -1
  128. package/dist/adapters/aws-lambda/content-type/json/index.js +0 -59
  129. package/dist/adapters/aws-lambda/content-type/json/index.mjs +0 -57
  130. package/dist/adapters/content-handlers/selectContentHandlerOrUnsupportedMediaType.d.ts +0 -10
  131. package/dist/adapters/content-handlers/selectContentHandlerOrUnsupportedMediaType.d.ts.map +0 -1
  132. package/dist/adapters/content-handlers/selectContentHandlerOrUnsupportedMediaType.js +0 -33
  133. package/dist/adapters/content-handlers/selectContentHandlerOrUnsupportedMediaType.mjs +0 -31
  134. package/dist/adapters/fastify/content-type/json/index.d.ts +0 -8
  135. package/dist/adapters/fastify/content-type/json/index.d.ts.map +0 -1
  136. package/dist/adapters/fastify/content-type/json/index.js +0 -59
  137. package/dist/adapters/fastify/content-type/json/index.mjs +0 -57
  138. package/dist/adapters/fastify/types.d.ts +0 -11
  139. package/dist/adapters/fastify/types.d.ts.map +0 -1
  140. package/dist/adapters/fetch/content-type/json/index.d.ts +0 -9
  141. package/dist/adapters/fetch/content-type/json/index.d.ts.map +0 -1
  142. package/dist/adapters/fetch/content-type/json/index.js +0 -58
  143. package/dist/adapters/fetch/content-type/json/index.mjs +0 -56
  144. package/dist/adapters/node-http/content-type/octet/index.d.ts +0 -5
  145. package/dist/adapters/node-http/content-type/octet/index.d.ts.map +0 -1
  146. package/dist/adapters/node-http/content-type/octet/index.js +0 -19
  147. package/dist/adapters/node-http/content-type/octet/index.mjs +0 -17
  148. package/dist/adapters/node-http/content-type/types.d.ts +0 -8
  149. package/dist/adapters/node-http/content-type/types.d.ts.map +0 -1
  150. package/dist/unstable-core-do-not-import/contentTypeParsers.d.ts +0 -16
  151. package/dist/unstable-core-do-not-import/contentTypeParsers.d.ts.map +0 -1
  152. package/dist/unstable-core-do-not-import/contentTypeParsers.js +0 -23
  153. package/dist/unstable-core-do-not-import/contentTypeParsers.mjs +0 -21
  154. package/src/adapters/aws-lambda/content-type/json/index.ts +0 -99
  155. package/src/adapters/content-handlers/selectContentHandlerOrUnsupportedMediaType.ts +0 -45
  156. package/src/adapters/fastify/content-type/json/index.ts +0 -97
  157. package/src/adapters/fastify/types.ts +0 -22
  158. package/src/adapters/fetch/content-type/json/index.ts +0 -94
  159. package/src/adapters/node-http/content-type/octet/index.ts +0 -27
  160. package/src/unstable-core-do-not-import/contentTypeParsers.ts +0 -37
package/dist/http.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var getHTTPStatusCode = require('./unstable-core-do-not-import/http/getHTTPStatusCode.js');
4
4
  var resolveHTTPResponse = require('./unstable-core-do-not-import/http/resolveHTTPResponse.js');
5
5
  var batchStreamFormatter = require('./unstable-core-do-not-import/http/batchStreamFormatter.js');
6
+ var contentType = require('./unstable-core-do-not-import/http/contentType.js');
6
7
  var toURL = require('./unstable-core-do-not-import/http/toURL.js');
7
8
  require('./unstable-core-do-not-import/rootConfig.js');
8
9
 
@@ -12,4 +13,5 @@ exports.getHTTPStatusCode = getHTTPStatusCode.getHTTPStatusCode;
12
13
  exports.getHTTPStatusCodeFromError = getHTTPStatusCode.getHTTPStatusCodeFromError;
13
14
  exports.resolveHTTPResponse = resolveHTTPResponse.resolveHTTPResponse;
14
15
  exports.getBatchStreamFormatter = batchStreamFormatter.getBatchStreamFormatter;
16
+ exports.getJsonContentTypeInputs = contentType.getJsonContentTypeInputs;
15
17
  exports.toURL = toURL.toURL;
package/dist/http.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  export { getHTTPStatusCode, getHTTPStatusCodeFromError } from './unstable-core-do-not-import/http/getHTTPStatusCode.mjs';
2
2
  export { resolveHTTPResponse } from './unstable-core-do-not-import/http/resolveHTTPResponse.mjs';
3
3
  export { getBatchStreamFormatter } from './unstable-core-do-not-import/http/batchStreamFormatter.mjs';
4
+ export { getJsonContentTypeInputs } from './unstable-core-do-not-import/http/contentType.mjs';
4
5
  export { toURL } from './unstable-core-do-not-import/http/toURL.mjs';
5
6
  import './unstable-core-do-not-import/rootConfig.mjs';
package/dist/index.js CHANGED
@@ -8,7 +8,6 @@ var transformer = require('./unstable-core-do-not-import/transformer.js');
8
8
  var initTRPC = require('./unstable-core-do-not-import/initTRPC.js');
9
9
  var middleware = require('./unstable-core-do-not-import/middleware.js');
10
10
  require('./unstable-core-do-not-import/rootConfig.js');
11
- var contentTypeParsers = require('./unstable-core-do-not-import/contentTypeParsers.js');
12
11
 
13
12
 
14
13
 
@@ -22,4 +21,3 @@ exports.transformTRPCResponse = transformer.transformTRPCResponse;
22
21
  exports.initTRPC = initTRPC.initTRPC;
23
22
  exports.experimental_standaloneMiddleware = middleware.experimental_standaloneMiddleware;
24
23
  exports.experimental_trpcMiddleware = middleware.experimental_standaloneMiddleware;
25
- exports.parseOctetInput = contentTypeParsers.parseOctetInput;
package/dist/index.mjs CHANGED
@@ -6,4 +6,3 @@ export { transformTRPCResponse } from './unstable-core-do-not-import/transformer
6
6
  export { initTRPC } from './unstable-core-do-not-import/initTRPC.mjs';
7
7
  export { experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware } from './unstable-core-do-not-import/middleware.mjs';
8
8
  import './unstable-core-do-not-import/rootConfig.mjs';
9
- export { parseOctetInput } from './unstable-core-do-not-import/contentTypeParsers.mjs';
@@ -1,4 +1,13 @@
1
- import type { TRPCError } from '../error/TRPCError';
1
+ import { TRPCError } from '../error/TRPCError';
2
+ import type { AnyRouter } from '../router';
3
+ import type { MaybePromise } from '../types';
4
+ import type { HTTPRequest } from './types';
5
+ type GetInputs = (opts: {
6
+ req: HTTPRequest;
7
+ isBatchCall: boolean;
8
+ router: AnyRouter;
9
+ preprocessedBody: boolean;
10
+ }) => MaybePromise<Record<number, unknown>>;
2
11
  export type BodyResult = {
3
12
  ok: true;
4
13
  data: unknown;
@@ -11,11 +20,10 @@ export type BodyResult = {
11
20
  error: TRPCError;
12
21
  };
13
22
  export type BaseContentTypeHandler<TOptions> = {
14
- name: string;
15
- isMatch(headers: Headers): boolean;
16
- getInputs: (opts: TOptions, info: {
17
- isBatchCall: boolean;
18
- batch: number;
19
- }) => Promise<unknown>;
23
+ isMatch(opts: TOptions): boolean;
24
+ getBody: (opts: TOptions) => MaybePromise<BodyResult>;
25
+ getInputs: GetInputs;
20
26
  };
27
+ export declare const getJsonContentTypeInputs: GetInputs;
28
+ export {};
21
29
  //# sourceMappingURL=contentType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contentType.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/contentType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,UAAU,GAClB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAEpC,MAAM,MAAM,sBAAsB,CAAC,QAAQ,IAAI;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IACnC,SAAS,EAAE,CACT,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE;QACJ,WAAW,EAAE,OAAO,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,KACE,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB,CAAC"}
1
+ {"version":3,"file":"contentType.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/contentType.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,KAAK,SAAS,GAAG,CAAC,IAAI,EAAE;IACtB,GAAG,EAAE,WAAW,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,KAAK,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE5C,MAAM,MAAM,UAAU,GAClB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAEpC,MAAM,MAAM,sBAAsB,CAAC,QAAQ,IAAI;IAC7C,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACjC,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,YAAY,CAAC,UAAU,CAAC,CAAC;IACtD,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAqCF,eAAO,MAAM,wBAAwB,EAAE,SAgCtC,CAAC"}
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ var TRPCError = require('../error/TRPCError.js');
4
+
5
+ function getRawProcedureInputOrThrow(opts) {
6
+ const { req } = opts;
7
+ try {
8
+ if (req.method === 'GET') {
9
+ if (!req.query.has('input')) {
10
+ return undefined;
11
+ }
12
+ const raw = req.query.get('input');
13
+ return JSON.parse(raw);
14
+ }
15
+ if (!opts.preprocessedBody && typeof req.body === 'string') {
16
+ // A mutation with no inputs will have req.body === ''
17
+ return req.body.length === 0 ? undefined : JSON.parse(req.body);
18
+ }
19
+ return req.body;
20
+ } catch (cause) {
21
+ throw new TRPCError.TRPCError({
22
+ code: 'PARSE_ERROR',
23
+ cause
24
+ });
25
+ }
26
+ }
27
+ const deserializeInputValue = (rawValue, transformer)=>{
28
+ return typeof rawValue !== 'undefined' ? transformer.input.deserialize(rawValue) : rawValue;
29
+ };
30
+ const getJsonContentTypeInputs = (opts)=>{
31
+ const rawInput = getRawProcedureInputOrThrow(opts);
32
+ const transformer = opts.router._def._config.transformer;
33
+ if (!opts.isBatchCall) {
34
+ return {
35
+ 0: deserializeInputValue(rawInput, transformer)
36
+ };
37
+ }
38
+ /* istanbul ignore if */ if (rawInput == null || typeof rawInput !== 'object' || Array.isArray(rawInput)) {
39
+ throw new TRPCError.TRPCError({
40
+ code: 'BAD_REQUEST',
41
+ message: '"input" needs to be an object when doing a batch call'
42
+ });
43
+ }
44
+ const input = {};
45
+ for(const key in rawInput){
46
+ const k = key;
47
+ const rawValue = rawInput[k];
48
+ const value = deserializeInputValue(rawValue, transformer);
49
+ input[k] = value;
50
+ }
51
+ return input;
52
+ };
53
+
54
+ exports.getJsonContentTypeInputs = getJsonContentTypeInputs;
@@ -0,0 +1,52 @@
1
+ import { TRPCError } from '../error/TRPCError.mjs';
2
+
3
+ function getRawProcedureInputOrThrow(opts) {
4
+ const { req } = opts;
5
+ try {
6
+ if (req.method === 'GET') {
7
+ if (!req.query.has('input')) {
8
+ return undefined;
9
+ }
10
+ const raw = req.query.get('input');
11
+ return JSON.parse(raw);
12
+ }
13
+ if (!opts.preprocessedBody && typeof req.body === 'string') {
14
+ // A mutation with no inputs will have req.body === ''
15
+ return req.body.length === 0 ? undefined : JSON.parse(req.body);
16
+ }
17
+ return req.body;
18
+ } catch (cause) {
19
+ throw new TRPCError({
20
+ code: 'PARSE_ERROR',
21
+ cause
22
+ });
23
+ }
24
+ }
25
+ const deserializeInputValue = (rawValue, transformer)=>{
26
+ return typeof rawValue !== 'undefined' ? transformer.input.deserialize(rawValue) : rawValue;
27
+ };
28
+ const getJsonContentTypeInputs = (opts)=>{
29
+ const rawInput = getRawProcedureInputOrThrow(opts);
30
+ const transformer = opts.router._def._config.transformer;
31
+ if (!opts.isBatchCall) {
32
+ return {
33
+ 0: deserializeInputValue(rawInput, transformer)
34
+ };
35
+ }
36
+ /* istanbul ignore if */ if (rawInput == null || typeof rawInput !== 'object' || Array.isArray(rawInput)) {
37
+ throw new TRPCError({
38
+ code: 'BAD_REQUEST',
39
+ message: '"input" needs to be an object when doing a batch call'
40
+ });
41
+ }
42
+ const input = {};
43
+ for(const key in rawInput){
44
+ const k = key;
45
+ const rawValue = rawInput[k];
46
+ const value = deserializeInputValue(rawValue, transformer);
47
+ input[k] = value;
48
+ }
49
+ return input;
50
+ };
51
+
52
+ export { getJsonContentTypeInputs };
@@ -7,5 +7,6 @@ export type { BaseHandlerOptions, HTTPBaseHandlerOptions, HTTPHeaders, HTTPReque
7
7
  HTTPErrorHandler as OnErrorFunction, HTTPErrorHandler, ProcedureCall, ResolveHTTPRequestOptionsContextFn, ResponseChunk, ResponseMeta, ResponseMetaFn, TRPCRequestInfo, } from './types';
8
8
  export { getBatchStreamFormatter } from './batchStreamFormatter';
9
9
  export type { BaseContentTypeHandler, BodyResult } from './contentType';
10
+ export { getJsonContentTypeInputs } from './contentType';
10
11
  export { toURL } from './toURL';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,YAAY;AACZ;;GAEG;AACH,gBAAgB,IAAI,eAAe,EACnC,gBAAgB,EAChB,aAAa,EACb,kCAAkC,EAClC,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAExE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,YAAY;AACZ;;GAEG;AACH,gBAAgB,IAAI,eAAe,EACnC,gBAAgB,EAChB,aAAa,EACb,kCAAkC,EAClC,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
@@ -1,15 +1,15 @@
1
1
  import { TRPCError } from '../error/TRPCError';
2
2
  import type { AnyRouter } from '../router';
3
+ import type { Maybe } from '../types';
4
+ import type { BaseContentTypeHandler } from './contentType';
3
5
  import type { HTTPBaseHandlerOptions, HTTPRequest, HTTPResponse, ResolveHTTPRequestOptionsContextFn, ResponseChunk } from './types';
4
6
  interface ResolveHTTPRequestOptions<TRouter extends AnyRouter, TRequest extends HTTPRequest> extends HTTPBaseHandlerOptions<TRouter, TRequest> {
5
7
  createContext: ResolveHTTPRequestOptionsContextFn<TRouter>;
6
8
  req: TRequest;
7
9
  path: string;
8
- getInput: (opts: {
9
- isBatchCall: boolean;
10
- batch: number;
11
- }) => Promise<unknown>;
12
- error?: TRPCError;
10
+ error?: Maybe<TRPCError>;
11
+ contentTypeHandler?: BaseContentTypeHandler<any>;
12
+ preprocessedBody?: boolean;
13
13
  /**
14
14
  * Called as soon as the response head is known.
15
15
  * When streaming, headers will have been generated
@@ -1 +1 @@
1
- {"version":3,"file":"resolveHTTPResponse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,WAAW,CAAC;AAKnB,OAAO,KAAK,EACV,sBAAsB,EAEtB,WAAW,EACX,YAAY,EACZ,kCAAkC,EAClC,aAAa,EAEd,MAAM,SAAS,CAAC;AAgBjB,UAAU,yBAAyB,CACjC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,CAC5B,SAAQ,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACjD,aAAa,EAAE,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9E,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;OAMG;IACH,eAAe,EAAE,CACf,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,EACxC,WAAW,EAAE,OAAO,KACjB,IAAI,CAAC;IACV;;;;;;;;OAQG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAClD;AA4GD;;;GAGG;AAEH;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,EAE5B,IAAI,EAAE,IAAI,CACR,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAC5C,kBAAkB,GAAG,iBAAiB,CACvC,GACA,OAAO,CAAC,YAAY,CAAC,CAAC;AACzB;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,EAC5B,IAAI,EAAE,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"resolveHTTPResponse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/resolveHTTPResponse.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,KAAK,EACV,sBAAsB,EAEtB,WAAW,EACX,YAAY,EACZ,kCAAkC,EAClC,aAAa,EAEd,MAAM,SAAS,CAAC;AAoBjB,UAAU,yBAAyB,CACjC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,CAC5B,SAAQ,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACjD,aAAa,EAAE,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACzB,kBAAkB,CAAC,EAAE,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACjD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,eAAe,EAAE,CACf,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,EACxC,WAAW,EAAE,OAAO,KACjB,IAAI,CAAC;IACV;;;;;;;;OAQG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAClD;AA4GD;;;GAGG;AAEH;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,EAE5B,IAAI,EAAE,IAAI,CACR,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAC5C,kBAAkB,GAAG,iBAAiB,CACvC,GACA,OAAO,CAAC,YAAY,CAAC,CAAC;AACzB;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,WAAW,EAC5B,IAAI,EAAE,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -4,12 +4,16 @@ var getErrorShape = require('../error/getErrorShape.js');
4
4
  var TRPCError = require('../error/TRPCError.js');
5
5
  var router = require('../router.js');
6
6
  var transformer = require('../transformer.js');
7
+ var contentType = require('./contentType.js');
7
8
  var getHTTPStatusCode = require('./getHTTPStatusCode.js');
8
9
 
9
10
  const HTTP_METHOD_PROCEDURE_TYPE_MAP = {
10
11
  GET: 'query',
11
12
  POST: 'mutation'
12
13
  };
14
+ const fallbackContentTypeHandler = {
15
+ getInputs: contentType.getJsonContentTypeInputs
16
+ };
13
17
  function initResponse(initOpts) {
14
18
  const { ctx , paths , type , responseMeta , untransformedJSON , errors =[] , } = initOpts;
15
19
  let status = untransformedJSON ? getHTTPStatusCode.getHTTPStatusCode(untransformedJSON) : 200;
@@ -83,6 +87,7 @@ async function resolveHTTPResponse(opts) {
83
87
  ]);
84
88
  return headResponse;
85
89
  }
90
+ const contentTypeHandler = opts.contentTypeHandler ?? fallbackContentTypeHandler;
86
91
  const allowBatching = opts.allowBatching ?? opts.batching?.enabled ?? true;
87
92
  const allowMethodOverride = opts.allowMethodOverride ?? false;
88
93
  const type = HTTP_METHOD_PROCEDURE_TYPE_MAP[req.method] ?? 'unknown';
@@ -91,6 +96,9 @@ async function resolveHTTPResponse(opts) {
91
96
  const isBatchCall = !!req.query.get('batch');
92
97
  const isStreamCall = isBatchCall && unstable_onHead && unstable_onChunk && req.headers['trpc-batch-mode'] === 'stream';
93
98
  try {
99
+ if (opts.error) {
100
+ throw opts.error;
101
+ }
94
102
  if (isBatchCall && !allowBatching) {
95
103
  throw new TRPCError.TRPCError({
96
104
  code: 'BAD_REQUEST',
@@ -109,24 +117,21 @@ async function resolveHTTPResponse(opts) {
109
117
  code: 'METHOD_NOT_SUPPORTED'
110
118
  });
111
119
  }
112
- const batchesCache = {};
113
- async function getRawInputForBatch(batch) {
114
- if (!batchesCache.hasOwnProperty(batch)) {
115
- batchesCache[batch] = await opts.getInput({
116
- isBatchCall,
117
- batch
118
- });
119
- }
120
- return batchesCache[batch];
121
- }
120
+ const inputs = await contentTypeHandler.getInputs({
121
+ isBatchCall,
122
+ req,
123
+ router: router$1,
124
+ preprocessedBody: opts.preprocessedBody ?? false
125
+ });
122
126
  paths = isBatchCall ? decodeURIComponent(opts.path).split(',') : [
123
127
  opts.path
124
128
  ];
125
129
  const info = {
126
130
  isBatchCall,
127
- calls: paths.map((path)=>({
131
+ calls: paths.map((path, idx)=>({
128
132
  path,
129
- type
133
+ type,
134
+ input: inputs[idx] ?? undefined
130
135
  }))
131
136
  };
132
137
  ctx = await opts.createContext({
@@ -134,20 +139,12 @@ async function resolveHTTPResponse(opts) {
134
139
  });
135
140
  const errors = [];
136
141
  const promises = paths.map(async (path, index)=>{
137
- async function getRawInput() {
138
- return await getRawInputForBatch(index);
139
- }
142
+ const input = inputs[index];
140
143
  try {
141
- if (opts.error) {
142
- // sometimes an error may be generated above this function in the stack
143
- // for instance a 405 error if the method is not supported
144
- // But we need to handle it here to ensure the error is formatted correctly
145
- throw opts.error;
146
- }
147
144
  const data = await router.callProcedure({
148
145
  procedures: opts.router._def.procedures,
149
146
  path,
150
- getRawInput: getRawInput,
147
+ getRawInput: async ()=>input,
151
148
  ctx,
152
149
  type,
153
150
  allowMethodOverride
@@ -163,7 +160,7 @@ async function resolveHTTPResponse(opts) {
163
160
  opts.onError?.({
164
161
  error,
165
162
  path,
166
- input: getRawInput(),
163
+ input,
167
164
  ctx,
168
165
  type: type,
169
166
  req: opts.req
@@ -174,7 +171,7 @@ async function resolveHTTPResponse(opts) {
174
171
  error,
175
172
  type,
176
173
  path,
177
- input: getRawInput(),
174
+ input,
178
175
  ctx
179
176
  })
180
177
  };
@@ -241,7 +238,7 @@ async function resolveHTTPResponse(opts) {
241
238
  ]);
242
239
  } catch (cause) {
243
240
  const path = paths[index];
244
- const input = await getRawInputForBatch(index);
241
+ const input = inputs[index];
245
242
  const { body: body2 } = caughtErrorToData(cause, {
246
243
  opts,
247
244
  ctx,
@@ -2,12 +2,16 @@ import { getErrorShape } from '../error/getErrorShape.mjs';
2
2
  import { TRPCError, getTRPCErrorFromUnknown } from '../error/TRPCError.mjs';
3
3
  import { callProcedure } from '../router.mjs';
4
4
  import { transformTRPCResponse } from '../transformer.mjs';
5
+ import { getJsonContentTypeInputs } from './contentType.mjs';
5
6
  import { getHTTPStatusCode } from './getHTTPStatusCode.mjs';
6
7
 
7
8
  const HTTP_METHOD_PROCEDURE_TYPE_MAP = {
8
9
  GET: 'query',
9
10
  POST: 'mutation'
10
11
  };
12
+ const fallbackContentTypeHandler = {
13
+ getInputs: getJsonContentTypeInputs
14
+ };
11
15
  function initResponse(initOpts) {
12
16
  const { ctx , paths , type , responseMeta , untransformedJSON , errors =[] , } = initOpts;
13
17
  let status = untransformedJSON ? getHTTPStatusCode(untransformedJSON) : 200;
@@ -81,6 +85,7 @@ async function resolveHTTPResponse(opts) {
81
85
  ]);
82
86
  return headResponse;
83
87
  }
88
+ const contentTypeHandler = opts.contentTypeHandler ?? fallbackContentTypeHandler;
84
89
  const allowBatching = opts.allowBatching ?? opts.batching?.enabled ?? true;
85
90
  const allowMethodOverride = opts.allowMethodOverride ?? false;
86
91
  const type = HTTP_METHOD_PROCEDURE_TYPE_MAP[req.method] ?? 'unknown';
@@ -89,6 +94,9 @@ async function resolveHTTPResponse(opts) {
89
94
  const isBatchCall = !!req.query.get('batch');
90
95
  const isStreamCall = isBatchCall && unstable_onHead && unstable_onChunk && req.headers['trpc-batch-mode'] === 'stream';
91
96
  try {
97
+ if (opts.error) {
98
+ throw opts.error;
99
+ }
92
100
  if (isBatchCall && !allowBatching) {
93
101
  throw new TRPCError({
94
102
  code: 'BAD_REQUEST',
@@ -107,24 +115,21 @@ async function resolveHTTPResponse(opts) {
107
115
  code: 'METHOD_NOT_SUPPORTED'
108
116
  });
109
117
  }
110
- const batchesCache = {};
111
- async function getRawInputForBatch(batch) {
112
- if (!batchesCache.hasOwnProperty(batch)) {
113
- batchesCache[batch] = await opts.getInput({
114
- isBatchCall,
115
- batch
116
- });
117
- }
118
- return batchesCache[batch];
119
- }
118
+ const inputs = await contentTypeHandler.getInputs({
119
+ isBatchCall,
120
+ req,
121
+ router,
122
+ preprocessedBody: opts.preprocessedBody ?? false
123
+ });
120
124
  paths = isBatchCall ? decodeURIComponent(opts.path).split(',') : [
121
125
  opts.path
122
126
  ];
123
127
  const info = {
124
128
  isBatchCall,
125
- calls: paths.map((path)=>({
129
+ calls: paths.map((path, idx)=>({
126
130
  path,
127
- type
131
+ type,
132
+ input: inputs[idx] ?? undefined
128
133
  }))
129
134
  };
130
135
  ctx = await opts.createContext({
@@ -132,20 +137,12 @@ async function resolveHTTPResponse(opts) {
132
137
  });
133
138
  const errors = [];
134
139
  const promises = paths.map(async (path, index)=>{
135
- async function getRawInput() {
136
- return await getRawInputForBatch(index);
137
- }
140
+ const input = inputs[index];
138
141
  try {
139
- if (opts.error) {
140
- // sometimes an error may be generated above this function in the stack
141
- // for instance a 405 error if the method is not supported
142
- // But we need to handle it here to ensure the error is formatted correctly
143
- throw opts.error;
144
- }
145
142
  const data = await callProcedure({
146
143
  procedures: opts.router._def.procedures,
147
144
  path,
148
- getRawInput: getRawInput,
145
+ getRawInput: async ()=>input,
149
146
  ctx,
150
147
  type,
151
148
  allowMethodOverride
@@ -161,7 +158,7 @@ async function resolveHTTPResponse(opts) {
161
158
  opts.onError?.({
162
159
  error,
163
160
  path,
164
- input: getRawInput(),
161
+ input,
165
162
  ctx,
166
163
  type: type,
167
164
  req: opts.req
@@ -172,7 +169,7 @@ async function resolveHTTPResponse(opts) {
172
169
  error,
173
170
  type,
174
171
  path,
175
- input: getRawInput(),
172
+ input,
176
173
  ctx
177
174
  })
178
175
  };
@@ -239,7 +236,7 @@ async function resolveHTTPResponse(opts) {
239
236
  ]);
240
237
  } catch (cause) {
241
238
  const path = paths[index];
242
- const input = await getRawInputForBatch(index);
239
+ const input = inputs[index];
243
240
  const { body: body2 } = caughtErrorToData(cause, {
244
241
  opts,
245
242
  ctx,
@@ -37,6 +37,7 @@ export interface HTTPRequest {
37
37
  method: string;
38
38
  query: URLSearchParams;
39
39
  headers: HTTPHeaders;
40
+ body: unknown;
40
41
  }
41
42
  /**
42
43
  * Base interface for anything using HTTP
@@ -52,6 +53,7 @@ export interface HTTPBaseHandlerOptions<TRouter extends AnyRouter, TRequest> ext
52
53
  /** @internal */
53
54
  export type ProcedureCall = {
54
55
  type: ProcedureType;
56
+ input?: unknown;
55
57
  path: string;
56
58
  };
57
59
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,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AC;IAC9C;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
@@ -98,5 +98,5 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
98
98
  * @link https://trpc.io/docs/v11/quickstart
99
99
  */
100
100
  export declare const initTRPC: TRPCBuilder<object, object>;
101
- export {};
101
+ export type { TRPCBuilder };
102
102
  //# sourceMappingURL=initTRPC.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"initTRPC.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/initTRPC.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAGL,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAErD,KAAK,wBAAwB,CAAC,KAAK,IAAI,KAAK,SAAS,cAAc,CACjE,GAAG,EACH,MAAM,MAAM,CACb,GACG,MAAM,GACN,iBAAiB,CAAC;AACtB,UAAU,oBAAoB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,CAC1E,SAAQ,OAAO,CACb,IAAI,CACF,UAAU,CAAC;IACT,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;IACZ,UAAU,EAAE,GAAG,CAAC;IAChB,WAAW,EAAE,GAAG,CAAC;CAClB,CAAC,EACF,QAAQ,GAAG,aAAa,C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AC,CAAC;6BAC3C,SAAS,SAAS,QAAQ,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG,IAAI;;;QAoDrE;;;WAGG;;QAEH;;;WAGG;;iBAjEE,QAAQ;kBACP,KAAK;wBACC,SAAS,SAAS,QAAQ,CAAC,gBAAgB,CAAC,GACpD,iBAAiB,GACjB,yBAAyB,QAAQ,CAAC,gBAAgB,CAAC,CAAC;yBAC3C,SAAS,SAAS,QAAQ,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG,IAAI;;iBALhE,QAAQ;kBACP,KAAK;wBACC,SAAS,SAAS,QAAQ,CAAC,gBAAgB,CAAC,GACpD,iBAAiB,GACjB,yBAAyB,QAAQ,CAAC,gBAAgB,CAAC,CAAC;yBAC3C,SAAS,SAAS,QAAQ,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG,IAAI;;;CAgE1E;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,6BAAoB,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -64,25 +64,4 @@ export type AnyRootTypes = CreateRootTypes<{
64
64
  errorShape: any;
65
65
  transformer: any;
66
66
  }>;
67
- type PartialIf<TCondition extends boolean, TType> = TCondition extends true ? Partial<TType> : TType;
68
- /**
69
- * Adds a `createContext` option with a given callback function
70
- * If context is the default value, then the `createContext` option is optional
71
- */
72
- export type CreateContextCallback<TContext, TFunction extends (...args: any[]) => any> = PartialIf<object extends TContext ? true : false, {
73
- /**
74
- * @link https://trpc.io/docs/v11/context
75
- **/
76
- createContext: TFunction;
77
- }>;
78
- /**
79
- * @internal
80
- */
81
- export type WrapCreateContext<TFunction extends (...args: any[]) => any> = {
82
- /**
83
- * @link https://trpc.io/docs/v11/context
84
- **/
85
- createContext?: TFunction;
86
- };
87
- export {};
88
67
  //# sourceMappingURL=rootConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rootConfig.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/rootConfig.ts"],"names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,CAAC;IAClB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;CACtE;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,SAAS,SAAS,SAAS,IAAI,SAAS,CAAC;AAErE,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC;IACzC,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,GAAG,CAAC;IACV,UAAU,EAAE,GAAG,CAAC;IAChB,WAAW,EAAE,GAAG,CAAC;CAClB,CAAC,CAAC"}
@@ -7,6 +7,7 @@ var TRPCError = require('./unstable-core-do-not-import/error/TRPCError.js');
7
7
  var getHTTPStatusCode = require('./unstable-core-do-not-import/http/getHTTPStatusCode.js');
8
8
  var resolveHTTPResponse = require('./unstable-core-do-not-import/http/resolveHTTPResponse.js');
9
9
  var batchStreamFormatter = require('./unstable-core-do-not-import/http/batchStreamFormatter.js');
10
+ var contentType = require('./unstable-core-do-not-import/http/contentType.js');
10
11
  var toURL = require('./unstable-core-do-not-import/http/toURL.js');
11
12
  var initTRPC = require('./unstable-core-do-not-import/initTRPC.js');
12
13
  var middleware = require('./unstable-core-do-not-import/middleware.js');
@@ -34,6 +35,7 @@ exports.getHTTPStatusCode = getHTTPStatusCode.getHTTPStatusCode;
34
35
  exports.getHTTPStatusCodeFromError = getHTTPStatusCode.getHTTPStatusCodeFromError;
35
36
  exports.resolveHTTPResponse = resolveHTTPResponse.resolveHTTPResponse;
36
37
  exports.getBatchStreamFormatter = batchStreamFormatter.getBatchStreamFormatter;
38
+ exports.getJsonContentTypeInputs = contentType.getJsonContentTypeInputs;
37
39
  exports.toURL = toURL.toURL;
38
40
  exports.initTRPC = initTRPC.initTRPC;
39
41
  exports.createInputMiddleware = middleware.createInputMiddleware;
@@ -5,6 +5,7 @@ export { TRPCError, getCauseFromUnknown, getTRPCErrorFromUnknown } from './unsta
5
5
  export { getHTTPStatusCode, getHTTPStatusCodeFromError } from './unstable-core-do-not-import/http/getHTTPStatusCode.mjs';
6
6
  export { resolveHTTPResponse } from './unstable-core-do-not-import/http/resolveHTTPResponse.mjs';
7
7
  export { getBatchStreamFormatter } from './unstable-core-do-not-import/http/batchStreamFormatter.mjs';
8
+ export { getJsonContentTypeInputs } from './unstable-core-do-not-import/http/contentType.mjs';
8
9
  export { toURL } from './unstable-core-do-not-import/http/toURL.mjs';
9
10
  export { initTRPC } from './unstable-core-do-not-import/initTRPC.mjs';
10
11
  export { createInputMiddleware, createMiddlewareFactory, createOutputMiddleware, experimental_standaloneMiddleware, middlewareMarker } from './unstable-core-do-not-import/middleware.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.348+9d8b631a7",
3
+ "version": "11.0.0-rc.354+ab11f2310",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -135,6 +135,7 @@
135
135
  "@types/react": "^18.2.33",
136
136
  "@types/react-dom": "^18.2.14",
137
137
  "@types/ws": "^8.2.0",
138
+ "@web3-storage/multipart-parser": "^1.0.0",
138
139
  "devalue": "^5.0.0",
139
140
  "eslint": "^8.56.0",
140
141
  "express": "^4.17.1",
@@ -159,5 +160,5 @@
159
160
  "funding": [
160
161
  "https://trpc.io/sponsor"
161
162
  ],
162
- "gitHead": "9d8b631a7e78c94e19d9822abda61278664bceee"
163
+ "gitHead": "ab11f23106d3bc29a3207f52a8bff8806d074267"
163
164
  }
@@ -23,4 +23,5 @@ export type {
23
23
  BaseContentTypeHandler,
24
24
  BodyResult,
25
25
  } from '../../unstable-core-do-not-import';
26
+ export { getJsonContentTypeInputs } from '../../unstable-core-do-not-import';
26
27
  export { toURL } from '../../unstable-core-do-not-import';
@@ -32,11 +32,10 @@ export {
32
32
  type RouterRecord as TRPCRouterRecord,
33
33
  type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure,
34
34
  type ProcedureOptions as TRPCProcedureOptions,
35
- type CreateContextCallback,
36
- type WrapCreateContext,
37
35
  type MutationProcedure as TRPCMutationProcedure,
38
36
  type QueryProcedure as TRPCQueryProcedure,
39
37
  type SubscriptionProcedure as TRPCSubscriptionProcedure,
38
+ type TRPCBuilder,
40
39
  } from '../../unstable-core-do-not-import';
41
40
 
42
41
  export type {
@@ -103,5 +102,3 @@ export {
103
102
  */
104
103
  export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> =
105
104
  Awaited<ReturnType<TFunction>>;
106
-
107
- export { parseOctetInput } from '../../unstable-core-do-not-import/contentTypeParsers';