@trpc/server 11.0.0-alpha-tmp-export-from-main.218 → 11.0.0-alpha-tmp-export-from-main-nuke-core.239

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 (249) hide show
  1. package/dist/@trpc/server/http.d.ts +7 -0
  2. package/dist/@trpc/server/http.d.ts.map +1 -0
  3. package/dist/@trpc/server/index.d.ts +69 -0
  4. package/dist/@trpc/server/index.d.ts.map +1 -0
  5. package/dist/@trpc/server/rpc.d.ts +3 -0
  6. package/dist/@trpc/server/rpc.d.ts.map +1 -0
  7. package/dist/adapters/aws-lambda/index.d.ts +1 -2
  8. package/dist/adapters/aws-lambda/index.d.ts.map +1 -1
  9. package/dist/adapters/aws-lambda/index.js +6 -4
  10. package/dist/adapters/aws-lambda/index.mjs +4 -2
  11. package/dist/adapters/aws-lambda/utils.d.ts +2 -3
  12. package/dist/adapters/aws-lambda/utils.d.ts.map +1 -1
  13. package/dist/adapters/aws-lambda/utils.js +5 -4
  14. package/dist/adapters/aws-lambda/utils.mjs +3 -2
  15. package/dist/adapters/express.d.ts +1 -2
  16. package/dist/adapters/express.d.ts.map +1 -1
  17. package/dist/adapters/fastify/fastifyRequestHandler.d.ts +2 -2
  18. package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +1 -1
  19. package/dist/adapters/fastify/fastifyRequestHandler.js +6 -3
  20. package/dist/adapters/fastify/fastifyRequestHandler.mjs +4 -1
  21. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +1 -2
  22. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +1 -1
  23. package/dist/adapters/fastify/fastifyTRPCPlugin.js +0 -1
  24. package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +0 -1
  25. package/dist/adapters/fetch/fetchRequestHandler.d.ts +1 -2
  26. package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +1 -1
  27. package/dist/adapters/fetch/fetchRequestHandler.js +6 -4
  28. package/dist/adapters/fetch/fetchRequestHandler.mjs +4 -2
  29. package/dist/adapters/fetch/types.d.ts +2 -3
  30. package/dist/adapters/fetch/types.d.ts.map +1 -1
  31. package/dist/adapters/next.d.ts +1 -3
  32. package/dist/adapters/next.d.ts.map +1 -1
  33. package/dist/adapters/next.js +6 -4
  34. package/dist/adapters/next.mjs +4 -2
  35. package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +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/getPostBody.js +4 -2
  38. package/dist/adapters/node-http/content-type/json/getPostBody.mjs +3 -1
  39. package/dist/adapters/node-http/content-type/json/index.js +4 -2
  40. package/dist/adapters/node-http/content-type/json/index.mjs +3 -1
  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 +1 -2
  44. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +1 -1
  45. package/dist/adapters/node-http/nodeHTTPRequestHandler.js +6 -4
  46. package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +4 -2
  47. package/dist/adapters/node-http/types.d.ts +3 -4
  48. package/dist/adapters/node-http/types.d.ts.map +1 -1
  49. package/dist/adapters/standalone.d.ts +1 -2
  50. package/dist/adapters/standalone.d.ts.map +1 -1
  51. package/dist/adapters/standalone.js +1 -0
  52. package/dist/adapters/standalone.mjs +1 -0
  53. package/dist/adapters/ws.d.ts +3 -2
  54. package/dist/adapters/ws.d.ts.map +1 -1
  55. package/dist/adapters/ws.js +33 -26
  56. package/dist/adapters/ws.mjs +8 -1
  57. package/dist/bundle-analysis.json +757 -0
  58. package/dist/http.d.ts +1 -6
  59. package/dist/http.d.ts.map +1 -1
  60. package/dist/http.js +11 -21
  61. package/dist/http.mjs +6 -1
  62. package/dist/index.d.ts +1 -68
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +18 -41
  65. package/dist/index.mjs +8 -1
  66. package/dist/observable/index.d.ts +5 -0
  67. package/dist/observable/index.d.ts.map +1 -0
  68. package/dist/observable/index.js +13 -0
  69. package/dist/observable/index.mjs +2 -0
  70. package/dist/observable/observable.d.ts +13 -0
  71. package/dist/observable/observable.d.ts.map +1 -0
  72. package/dist/observable/observable.js +126 -0
  73. package/dist/observable/observable.mjs +122 -0
  74. package/dist/observable/operators.d.ts +8 -0
  75. package/dist/observable/operators.d.ts.map +1 -0
  76. package/dist/observable/operators.js +103 -0
  77. package/dist/observable/operators.mjs +99 -0
  78. package/dist/observable/types.d.ts +26 -0
  79. package/dist/observable/types.d.ts.map +1 -0
  80. package/dist/rpc.d.ts +1 -2
  81. package/dist/rpc.d.ts.map +1 -1
  82. package/dist/rpc.js +6 -13
  83. package/dist/rpc.mjs +3 -1
  84. package/dist/shared.d.ts +1 -1
  85. package/dist/shared.d.ts.map +1 -1
  86. package/dist/shared.js +6 -9
  87. package/dist/shared.mjs +4 -1
  88. package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +6 -0
  89. package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +1 -0
  90. package/dist/unstable-core-do-not-import/createProxy.d.ts +19 -0
  91. package/dist/unstable-core-do-not-import/createProxy.d.ts.map +1 -0
  92. package/dist/unstable-core-do-not-import/createProxy.js +52 -0
  93. package/dist/unstable-core-do-not-import/createProxy.mjs +49 -0
  94. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +13 -0
  95. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -0
  96. package/dist/unstable-core-do-not-import/error/TRPCError.js +67 -0
  97. package/dist/unstable-core-do-not-import/error/TRPCError.mjs +63 -0
  98. package/dist/unstable-core-do-not-import/error/formatter.d.ts +33 -0
  99. package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +1 -0
  100. package/dist/unstable-core-do-not-import/error/formatter.js +7 -0
  101. package/dist/unstable-core-do-not-import/error/formatter.mjs +5 -0
  102. package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +15 -0
  103. package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +1 -0
  104. package/dist/unstable-core-do-not-import/error/getErrorShape.js +31 -0
  105. package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +29 -0
  106. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +24 -0
  107. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +1 -0
  108. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.js +32 -0
  109. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.mjs +30 -0
  110. package/dist/unstable-core-do-not-import/http/contentType.d.ts +29 -0
  111. package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +1 -0
  112. package/dist/unstable-core-do-not-import/http/contentType.js +54 -0
  113. package/dist/unstable-core-do-not-import/http/contentType.mjs +52 -0
  114. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +5 -0
  115. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +1 -0
  116. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +51 -0
  117. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +48 -0
  118. package/dist/unstable-core-do-not-import/http/index.d.ts +7 -0
  119. package/dist/unstable-core-do-not-import/http/index.d.ts.map +1 -0
  120. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +51 -0
  121. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +1 -0
  122. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.js +295 -0
  123. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs +293 -0
  124. package/dist/unstable-core-do-not-import/http/types.d.ts +96 -0
  125. package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -0
  126. package/dist/unstable-core-do-not-import/index.d.ts +37 -0
  127. package/dist/unstable-core-do-not-import/index.d.ts.map +1 -0
  128. package/dist/unstable-core-do-not-import/index.js +48 -0
  129. package/dist/unstable-core-do-not-import/index.mjs +16 -0
  130. package/dist/unstable-core-do-not-import/initTRPC.d.ts +96 -0
  131. package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +1 -0
  132. package/dist/unstable-core-do-not-import/initTRPC.js +95 -0
  133. package/dist/unstable-core-do-not-import/initTRPC.mjs +93 -0
  134. package/dist/unstable-core-do-not-import/middleware.d.ts +105 -0
  135. package/dist/unstable-core-do-not-import/middleware.d.ts.map +1 -0
  136. package/dist/unstable-core-do-not-import/middleware.js +95 -0
  137. package/dist/unstable-core-do-not-import/middleware.mjs +89 -0
  138. package/dist/unstable-core-do-not-import/parser.d.ts +30 -0
  139. package/dist/unstable-core-do-not-import/parser.d.ts.map +1 -0
  140. package/dist/unstable-core-do-not-import/parser.js +37 -0
  141. package/dist/unstable-core-do-not-import/parser.mjs +35 -0
  142. package/dist/unstable-core-do-not-import/procedure.d.ts +72 -0
  143. package/dist/unstable-core-do-not-import/procedure.d.ts.map +1 -0
  144. package/dist/unstable-core-do-not-import/procedure.js +9 -0
  145. package/dist/unstable-core-do-not-import/procedure.mjs +7 -0
  146. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +101 -0
  147. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -0
  148. package/dist/unstable-core-do-not-import/procedureBuilder.js +176 -0
  149. package/dist/unstable-core-do-not-import/procedureBuilder.mjs +173 -0
  150. package/dist/unstable-core-do-not-import/rootConfig.d.ts +75 -0
  151. package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +1 -0
  152. package/dist/unstable-core-do-not-import/rootConfig.js +8 -0
  153. package/dist/unstable-core-do-not-import/rootConfig.mjs +6 -0
  154. package/dist/unstable-core-do-not-import/router.d.ts +85 -0
  155. package/dist/unstable-core-do-not-import/router.d.ts.map +1 -0
  156. package/dist/unstable-core-do-not-import/router.js +156 -0
  157. package/dist/unstable-core-do-not-import/router.mjs +151 -0
  158. package/dist/unstable-core-do-not-import/rpc/codes.d.ts +51 -0
  159. package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -0
  160. package/dist/unstable-core-do-not-import/rpc/codes.js +38 -0
  161. package/dist/unstable-core-do-not-import/rpc/codes.mjs +35 -0
  162. package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +97 -0
  163. package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +1 -0
  164. package/dist/unstable-core-do-not-import/rpc/index.d.ts +5 -0
  165. package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +1 -0
  166. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +5 -0
  167. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +1 -0
  168. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +59 -0
  169. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +57 -0
  170. package/dist/unstable-core-do-not-import/serialize.d.ts +62 -0
  171. package/dist/unstable-core-do-not-import/serialize.d.ts.map +1 -0
  172. package/dist/unstable-core-do-not-import/transformer.d.ts +107 -0
  173. package/dist/unstable-core-do-not-import/transformer.d.ts.map +1 -0
  174. package/dist/unstable-core-do-not-import/transformer.js +107 -0
  175. package/dist/unstable-core-do-not-import/transformer.mjs +102 -0
  176. package/dist/unstable-core-do-not-import/types.d.ts +98 -0
  177. package/dist/unstable-core-do-not-import/types.d.ts.map +1 -0
  178. package/dist/unstable-core-do-not-import/utils.d.ts +27 -0
  179. package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -0
  180. package/dist/unstable-core-do-not-import/utils.js +44 -0
  181. package/dist/unstable-core-do-not-import/utils.mjs +39 -0
  182. package/package.json +53 -125
  183. package/src/@trpc/server/http.ts +26 -0
  184. package/src/@trpc/server/index.ts +105 -0
  185. package/src/@trpc/server/rpc.ts +26 -0
  186. package/src/adapters/aws-lambda/index.ts +4 -5
  187. package/src/adapters/aws-lambda/utils.ts +3 -4
  188. package/src/adapters/express.ts +1 -3
  189. package/src/adapters/fastify/fastifyRequestHandler.ts +6 -4
  190. package/src/adapters/fastify/fastifyTRPCPlugin.ts +1 -2
  191. package/src/adapters/fetch/fetchRequestHandler.ts +6 -4
  192. package/src/adapters/fetch/types.ts +2 -3
  193. package/src/adapters/next.ts +2 -4
  194. package/src/adapters/node-http/content-type/form-data/index.ts +1 -1
  195. package/src/adapters/node-http/content-type/json/getPostBody.ts +2 -2
  196. package/src/adapters/node-http/content-type/json/index.ts +1 -1
  197. package/src/adapters/node-http/internals/contentType.ts +2 -2
  198. package/src/adapters/node-http/nodeHTTPRequestHandler.ts +6 -4
  199. package/src/adapters/node-http/types.ts +4 -5
  200. package/src/adapters/standalone.ts +2 -2
  201. package/src/adapters/ws.ts +14 -13
  202. package/src/http.ts +1 -26
  203. package/src/index.ts +1 -105
  204. package/src/observable/index.ts +10 -0
  205. package/src/observable/observable.ts +158 -0
  206. package/src/observable/operators.ts +119 -0
  207. package/src/observable/types.ts +76 -0
  208. package/src/rpc.ts +1 -26
  209. package/src/shared.ts +1 -1
  210. package/src/unstable-core-do-not-import/TRPCInferrable.ts +9 -0
  211. package/src/unstable-core-do-not-import/createProxy.ts +59 -0
  212. package/src/unstable-core-do-not-import/error/TRPCError.ts +82 -0
  213. package/src/unstable-core-do-not-import/error/formatter.ts +51 -0
  214. package/src/unstable-core-do-not-import/error/getErrorShape.ts +36 -0
  215. package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +29 -0
  216. package/src/unstable-core-do-not-import/http/contentType.ts +99 -0
  217. package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +57 -0
  218. package/src/unstable-core-do-not-import/http/index.ts +23 -0
  219. package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +458 -0
  220. package/src/unstable-core-do-not-import/http/types.ts +111 -0
  221. package/src/unstable-core-do-not-import/index.ts +110 -0
  222. package/src/unstable-core-do-not-import/initTRPC.ts +206 -0
  223. package/src/unstable-core-do-not-import/middleware.ts +233 -0
  224. package/src/unstable-core-do-not-import/parser.ts +94 -0
  225. package/src/unstable-core-do-not-import/procedure.ts +108 -0
  226. package/src/unstable-core-do-not-import/procedureBuilder.ts +458 -0
  227. package/src/unstable-core-do-not-import/rootConfig.ts +90 -0
  228. package/src/unstable-core-do-not-import/router.ts +370 -0
  229. package/src/unstable-core-do-not-import/rpc/codes.ts +44 -0
  230. package/src/unstable-core-do-not-import/rpc/envelopes.ts +136 -0
  231. package/src/unstable-core-do-not-import/rpc/index.ts +21 -0
  232. package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +85 -0
  233. package/src/unstable-core-do-not-import/serialize.ts +122 -0
  234. package/src/unstable-core-do-not-import/transformer.ts +202 -0
  235. package/src/unstable-core-do-not-import/types.ts +151 -0
  236. package/src/unstable-core-do-not-import/utils.ts +59 -0
  237. package/unstable-core-do-not-import/index.d.ts +1 -0
  238. package/unstable-core-do-not-import/index.js +1 -0
  239. package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts +0 -10
  240. package/dist/@trpc-core-unstable-do-not-import-this-please.d.ts.map +0 -1
  241. package/dist/@trpc-server/http.d.ts +0 -2
  242. package/dist/@trpc-server/http.d.ts.map +0 -1
  243. package/dist/observable.d.ts +0 -3
  244. package/dist/observable.d.ts.map +0 -1
  245. package/dist/observable.js +0 -30
  246. package/dist/observable.mjs +0 -1
  247. package/src/@trpc-core-unstable-do-not-import-this-please.ts +0 -146
  248. package/src/@trpc-server/http.ts +0 -2
  249. package/src/observable.ts +0 -16
@@ -0,0 +1,105 @@
1
+ export {
2
+ TRPCError,
3
+ /**
4
+ * @deprecated use `experimental_trpcMiddleware` instead
5
+ */
6
+ experimental_standaloneMiddleware,
7
+ experimental_standaloneMiddleware as experimental_trpcMiddleware,
8
+ initTRPC,
9
+ // --- FIXME a bunch of these exports are only useful for plugins - move them somewhere else? ----
10
+ callProcedure as callTRPCProcedure,
11
+ getTRPCErrorFromUnknown,
12
+ transformTRPCResponse,
13
+ createFlatProxy as createTRPCFlatProxy,
14
+ type inferProcedureInput,
15
+ type inferProcedureOutput,
16
+ type inferRouterError,
17
+ type inferRouterInputs,
18
+ type inferRouterOutputs,
19
+ type inferRouterContext,
20
+ type inferTransformedProcedureOutput,
21
+ type inferTransformedSubscriptionOutput,
22
+ type AnyProcedure as AnyTRPCProcedure,
23
+ type AnyRouter as AnyTRPCRouter,
24
+ type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction,
25
+ type CombinedDataTransformer as TRPCCombinedDataTransformer,
26
+ type ProcedureType as TRPCProcedureType,
27
+ type AnyMutationProcedure as AnyTRPCMutationProcedure,
28
+ type AnyQueryProcedure as AnyTRPCQueryProcedure,
29
+ type ProcedureRouterRecord as TRPCProcedureRouterRecord,
30
+ type ProcedureArgs as TRPCProcedureArgs,
31
+ type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure,
32
+ } from '../../unstable-core-do-not-import';
33
+
34
+ export type {
35
+ /**
36
+ * @deprecated use `AnyTRPCProcedure` instead
37
+ */
38
+ AnyProcedure,
39
+ /**
40
+ * @deprecated use `AnyTRPCRouter` instead
41
+ */
42
+ AnyRouter,
43
+ /**
44
+ * @deprecated use `AnyTRPCMiddlewareFunction` instead
45
+ */
46
+ AnyMiddlewareFunction,
47
+ /**
48
+ * @deprecated use `TRPCCombinedDataTransformer` instead
49
+ */
50
+ CombinedDataTransformer,
51
+
52
+ /**
53
+ * @deprecated This is a utility type will be removed in v12
54
+ */
55
+ Dict,
56
+
57
+ /**
58
+ * @deprecated This is a utility type will be removed in v12
59
+ */
60
+ DeepPartial,
61
+ /**
62
+ * @deprecated use `TRPCProcedureType` instead
63
+ */
64
+ ProcedureType,
65
+ /**
66
+ * @deprecated use `AnyTRPCMutationProcedure` instead
67
+ */
68
+ AnyMutationProcedure,
69
+
70
+ /**
71
+ * @deprecated use `AnyTRPCQueryProcedure` instead
72
+ */
73
+ AnyQueryProcedure,
74
+ /**
75
+ * @deprecated use `TRPCProcedureRouterRecord` instead
76
+ */
77
+ ProcedureRouterRecord,
78
+ /**
79
+ * @deprecated use `TRPCProcedureArgs` instead
80
+ */
81
+ ProcedureArgs,
82
+ /**
83
+ * @deprecated use `AnyTRPCSubscriptionProcedure` instead
84
+ */
85
+ AnySubscriptionProcedure,
86
+ } from '../../unstable-core-do-not-import';
87
+
88
+ export {
89
+ /**
90
+ * @deprecated use `getTRPCErrorShape` instead
91
+ */
92
+ getErrorShape,
93
+
94
+ /**
95
+ * @deprecated use `callTRPCProcedure` instead
96
+ */
97
+ callProcedure,
98
+ } from '../../unstable-core-do-not-import';
99
+
100
+ /**
101
+ * @deprecated
102
+ * Use `Awaited<ReturnType<typeof myFunction>>` instead
103
+ */
104
+ export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> =
105
+ Awaited<ReturnType<TFunction>>;
@@ -0,0 +1,26 @@
1
+ // Note: this should likely be moved to a sort of `@trpc/plugin` package
2
+ export type {
3
+ JSONRPC2,
4
+ TRPCClientIncomingMessage,
5
+ TRPCClientIncomingRequest,
6
+ TRPCClientOutgoingMessage,
7
+ TRPCClientOutgoingRequest,
8
+ TRPCErrorResponse,
9
+ TRPCErrorShape,
10
+ TRPCReconnectNotification,
11
+ TRPCRequest,
12
+ TRPCRequestMessage,
13
+ TRPCResponse,
14
+ TRPCResponseMessage,
15
+ TRPCResult,
16
+ TRPCResultMessage,
17
+ TRPCSubscriptionStopNotification,
18
+ TRPCSuccessResponse,
19
+ TRPC_ERROR_CODE_KEY,
20
+ TRPC_ERROR_CODE_NUMBER,
21
+ } from '../../unstable-core-do-not-import';
22
+ export {
23
+ TRPC_ERROR_CODES_BY_KEY,
24
+ TRPC_ERROR_CODES_BY_NUMBER,
25
+ parseTRPCMessage,
26
+ } from '../../unstable-core-do-not-import';
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -16,15 +15,15 @@ import type {
16
15
  Context as APIGWContext,
17
16
  } from 'aws-lambda';
18
17
  // @trpc/server
19
- import type { AnyRouter } from '../..';
18
+ import type { AnyRouter } from '../../@trpc/server';
20
19
  // @trpc/server
21
- import { TRPCError } from '../..';
20
+ import { TRPCError } from '../../@trpc/server';
22
21
  import type {
23
22
  HTTPRequest,
24
23
  HTTPResponse,
25
24
  ResolveHTTPRequestOptionsContextFn,
26
- } from '../../http';
27
- import { resolveHTTPResponse } from '../../http';
25
+ } from '../../@trpc/server/http';
26
+ import { resolveHTTPResponse } from '../../@trpc/server/http';
28
27
  import type {
29
28
  APIGatewayEvent,
30
29
  APIGatewayResult,
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -15,16 +14,16 @@ import type {
15
14
  APIGatewayProxyStructuredResultV2,
16
15
  Context as APIGWContext,
17
16
  } from 'aws-lambda';
18
- import type { AnyRouter, inferRouterContext } from '../..'; // import @trpc/server
17
+ import type { AnyRouter, inferRouterContext } from '../../@trpc/server'; // import @trpc/server
19
18
 
20
19
  // @trpc/server
21
- import { TRPCError } from '../..';
20
+ import { TRPCError } from '../../@trpc/server';
22
21
  import type {
23
22
  HTTPHeaders,
24
23
  OnErrorFunction,
25
24
  ResponseMetaFn,
26
25
  TRPCRequestInfo,
27
- } from '../../http';
26
+ } from '../../@trpc/server/http';
28
27
 
29
28
  export type APIGatewayEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2;
30
29
  export type APIGatewayResult =
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -9,8 +8,7 @@
9
8
  * ```
10
9
  */
11
10
  import type * as express from 'express';
12
- // @trpc/server
13
- import type { AnyRouter } from '..';
11
+ import type { AnyRouter } from '../@trpc/server';
14
12
  import type {
15
13
  NodeHTTPCreateContextFnOptions,
16
14
  NodeHTTPHandlerOptions,
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -11,15 +10,18 @@
11
10
  import { Readable } from 'node:stream';
12
11
  import type { FastifyReply, FastifyRequest } from 'fastify';
13
12
  // @trpc/server
14
- import type { AnyRouter } from '../..';
13
+ import type { AnyRouter } from '../../@trpc/server';
15
14
  import type {
16
15
  HTTPBaseHandlerOptions,
17
16
  HTTPRequest,
18
17
  HTTPResponse,
19
18
  ResolveHTTPRequestOptionsContextFn,
20
19
  ResponseChunk,
21
- } from '../../http';
22
- import { getBatchStreamFormatter, resolveHTTPResponse } from '../../http';
20
+ } from '../../@trpc/server/http';
21
+ import {
22
+ getBatchStreamFormatter,
23
+ resolveHTTPResponse,
24
+ } from '../../@trpc/server/http';
23
25
  import type { NodeHTTPCreateContextOption } from '../node-http';
24
26
 
25
27
  export type FastifyHandlerOptions<
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -12,7 +11,7 @@
12
11
  import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
13
12
  import type { FastifyHandlerOptions } from '.';
14
13
  // @trpc/server
15
- import type { AnyRouter } from '../..';
14
+ import type { AnyRouter } from '../../@trpc/server';
16
15
  import type { NodeHTTPCreateContextFnOptions } from '../node-http';
17
16
  import type { WSSHandlerOptions } from '../ws';
18
17
  import { applyWSSHandler } from '../ws';
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -9,14 +8,17 @@
9
8
  * ```
10
9
  */
11
10
  // @trpc/server
12
- import type { AnyRouter } from '../..';
11
+ import type { AnyRouter } from '../../@trpc/server';
13
12
  import type {
14
13
  HTTPRequest,
15
14
  HTTPResponse,
16
15
  ResolveHTTPRequestOptionsContextFn,
17
16
  ResponseChunk,
18
- } from '../../http';
19
- import { getBatchStreamFormatter, resolveHTTPResponse } from '../../http';
17
+ } from '../../@trpc/server/http';
18
+ import {
19
+ getBatchStreamFormatter,
20
+ resolveHTTPResponse,
21
+ } from '../../@trpc/server/http';
20
22
  import type { FetchHandlerOptions } from './types';
21
23
 
22
24
  export type FetchHandlerRequestOptions<TRouter extends AnyRouter> =
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -9,12 +8,12 @@
9
8
  * ```
10
9
  */
11
10
  // @trpc/server
12
- import type { AnyRouter, inferRouterContext } from '../..';
11
+ import type { AnyRouter, inferRouterContext } from '../../@trpc/server';
13
12
  // @trpc/server/http
14
13
  import type {
15
14
  HTTPBaseHandlerOptions,
16
15
  TRPCRequestInfo,
17
- } from '../../@trpc-server/http';
16
+ } from '../../@trpc/server/http';
18
17
 
19
18
  export type FetchCreateContextFnOptions = {
20
19
  req: Request;
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -10,9 +9,9 @@
10
9
  */
11
10
  import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
12
11
  // @trpc/server
13
- import type { AnyRouter } from '..';
12
+ import type { AnyRouter } from '../@trpc/server';
14
13
  // @trpc/server
15
- import { getErrorShape, TRPCError } from '..';
14
+ import { getErrorShape, TRPCError } from '../@trpc/server';
16
15
  import type {
17
16
  NodeHTTPCreateContextFnOptions,
18
17
  NodeHTTPHandlerOptions,
@@ -23,7 +22,6 @@ export type CreateNextContextOptions = NodeHTTPCreateContextFnOptions<
23
22
  NextApiRequest,
24
23
  NextApiResponse
25
24
  >;
26
- export type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
27
25
 
28
26
  export function createNextApiHandler<TRouter extends AnyRouter>(
29
27
  opts: NodeHTTPHandlerOptions<TRouter, NextApiRequest, NextApiResponse>,
@@ -14,7 +14,7 @@ import { Readable } from 'node:stream';
14
14
  // @ts-ignore the type definitions for this package are borked
15
15
  import { streamMultipart } from '@web3-storage/multipart-parser';
16
16
  // @trpc/server
17
- import type { CombinedDataTransformer } from '../../../..';
17
+ import type { CombinedDataTransformer } from '../../../../@trpc/server';
18
18
  import { createNodeHTTPContentTypeHandler } from '../../internals/contentType';
19
19
  import type { NodeHTTPRequest } from '../../types';
20
20
  import { NodeOnDiskFile } from './fileUploadHandler';
@@ -1,6 +1,6 @@
1
1
  // @trpc/server
2
- import { TRPCError } from '../../../..';
3
- import type { BodyResult } from '../../../../http';
2
+ import { TRPCError } from '../../../../@trpc/server';
3
+ import type { BodyResult } from '../../../../@trpc/server/http';
4
4
  import type { NodeHTTPRequest } from '../../types';
5
5
 
6
6
  export async function getPostBody(opts: {
@@ -1,4 +1,4 @@
1
- import { getJsonContentTypeInputs } from '../../../../http';
1
+ import { getJsonContentTypeInputs } from '../../../../@trpc/server/http';
2
2
  import { createNodeHTTPContentTypeHandler } from '../../internals/contentType';
3
3
  import { getPostBody } from './getPostBody';
4
4
 
@@ -1,7 +1,7 @@
1
1
  // @trpc/server
2
- import type { AnyRouter } from '../../..';
2
+ import type { AnyRouter } from '../../../@trpc/server';
3
3
  // @trpc/server/http
4
- import type { BaseContentTypeHandler } from '../../../@trpc-server/http';
4
+ import type { BaseContentTypeHandler } from '../../../@trpc/server/http';
5
5
  import type {
6
6
  NodeHTTPRequest,
7
7
  NodeHTTPRequestHandlerOptions,
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -10,14 +9,17 @@
10
9
  */
11
10
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
12
11
  // @trpc/server
13
- import type { AnyRouter } from '../..';
12
+ import type { AnyRouter } from '../../@trpc/server';
14
13
  import type {
15
14
  HTTPRequest,
16
15
  HTTPResponse,
17
16
  ResolveHTTPRequestOptionsContextFn,
18
17
  ResponseChunk,
19
- } from '../../http';
20
- import { getBatchStreamFormatter, resolveHTTPResponse } from '../../http';
18
+ } from '../../@trpc/server/http';
19
+ import {
20
+ getBatchStreamFormatter,
21
+ resolveHTTPResponse,
22
+ } from '../../@trpc/server/http';
21
23
  import { nodeHTTPJSONContentTypeHandler } from './content-type/json';
22
24
  import type { NodeHTTPContentTypeHandler } from './internals/contentType';
23
25
  import type {
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -9,15 +8,15 @@
9
8
  * ```
10
9
  */
11
10
  import type { IncomingMessage, ServerResponse } from 'http';
12
- // eslint-disable-next-line no-restricted-imports
13
- import type { MaybePromise } from '@trpc/core';
14
11
  // @trpc/server
15
- import type { AnyRouter, inferRouterContext } from '../..';
12
+ import type { AnyRouter, inferRouterContext } from '../../@trpc/server';
16
13
  // @trpc/server/http
17
14
  import type {
18
15
  HTTPBaseHandlerOptions,
19
16
  TRPCRequestInfo,
20
- } from '../../@trpc-server/http';
17
+ } from '../../@trpc/server/http';
18
+ // eslint-disable-next-line no-restricted-imports
19
+ import type { MaybePromise } from '../../unstable-core-do-not-import';
21
20
  import type { NodeHTTPContentTypeHandler } from './internals/contentType';
22
21
 
23
22
  interface ParsedQs {
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http`
3
3
  *
4
- * Do **not** import from `@trpc/core`
5
4
  * @example
6
5
  * ```ts
7
6
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -11,7 +10,7 @@
11
10
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
12
11
  import http from 'http';
13
12
  // @trpc/server
14
- import type { AnyRouter } from '..';
13
+ import type { AnyRouter } from '../@trpc/server';
15
14
  import type {
16
15
  NodeHTTPCreateContextFnOptions,
17
16
  NodeHTTPHandlerOptions,
@@ -37,6 +36,7 @@ export function createHTTPHandler<TRouter extends AnyRouter>(
37
36
  await nodeHTTPRequestHandler({
38
37
  // FIXME: no typecasting should be needed here
39
38
  ...(opts as CreateHTTPHandlerOptions<AnyRouter>),
39
+ ...(opts as any),
40
40
  req,
41
41
  res,
42
42
  path,
@@ -1,25 +1,26 @@
1
1
  import type { IncomingMessage } from 'http';
2
- // eslint-disable-next-line no-restricted-imports
3
- import type {
4
- BaseHandlerOptions,
5
- JSONRPC2,
6
- MaybePromise,
7
- TRPCClientOutgoingMessage,
8
- TRPCReconnectNotification,
9
- TRPCResponseMessage,
10
- Unsubscribable,
11
- } from '@trpc/core';
12
2
  import type ws from 'ws';
13
- import type { AnyRouter, inferRouterContext } from '..';
3
+ import type { AnyRouter, inferRouterContext } from '../@trpc/server';
14
4
  import {
15
5
  callProcedure,
16
6
  getErrorShape,
17
7
  getTRPCErrorFromUnknown,
18
8
  transformTRPCResponse,
19
9
  TRPCError,
20
- } from '..';
10
+ } from '../@trpc/server';
11
+ import type { BaseHandlerOptions } from '../@trpc/server/http';
12
+ import { parseTRPCMessage } from '../@trpc/server/rpc';
13
+ // @trpc/server/rpc
14
+ import type {
15
+ JSONRPC2,
16
+ TRPCClientOutgoingMessage,
17
+ TRPCReconnectNotification,
18
+ TRPCResponseMessage,
19
+ } from '../@trpc/server/rpc';
21
20
  import { isObservable } from '../observable';
22
- import { parseTRPCMessage } from '../rpc';
21
+ import type { Unsubscribable } from '../observable';
22
+ // eslint-disable-next-line no-restricted-imports
23
+ import type { MaybePromise } from '../unstable-core-do-not-import';
23
24
  import type { NodeHTTPCreateContextFnOptions } from './node-http';
24
25
 
25
26
  /**
package/src/http.ts CHANGED
@@ -1,26 +1 @@
1
- export {
2
- getHTTPStatusCode,
3
- getHTTPStatusCodeFromError,
4
- } from './@trpc-core-unstable-do-not-import-this-please';
5
- export { resolveHTTPResponse } from './@trpc-core-unstable-do-not-import-this-please';
6
- export type {
7
- BaseHandlerOptions,
8
- HTTPBaseHandlerOptions,
9
- HTTPHeaders,
10
- HTTPRequest,
11
- HTTPResponse,
12
- OnErrorFunction,
13
- ProcedureCall,
14
- ResolveHTTPRequestOptionsContextFn,
15
- ResponseChunk,
16
- ResponseMeta,
17
- ResponseMetaFn,
18
- TRPCRequestInfo,
19
- } from './@trpc-core-unstable-do-not-import-this-please';
20
-
21
- export { getBatchStreamFormatter } from './@trpc-core-unstable-do-not-import-this-please';
22
- export type {
23
- BaseContentTypeHandler,
24
- BodyResult,
25
- } from './@trpc-core-unstable-do-not-import-this-please';
26
- export { getJsonContentTypeInputs } from './@trpc-core-unstable-do-not-import-this-please';
1
+ export * from './@trpc/server/http';
package/src/index.ts CHANGED
@@ -1,105 +1 @@
1
- export {
2
- TRPCError,
3
- /**
4
- * @deprecated use `experimental_trpcMiddleware` instead
5
- */
6
- experimental_standaloneMiddleware,
7
- experimental_standaloneMiddleware as experimental_trpcMiddleware,
8
- initTRPC,
9
- // --- FIXME a bunch of these exports are only useful for plugins - move them somewhere else? ----
10
- callProcedure as callTRPCProcedure,
11
- getTRPCErrorFromUnknown,
12
- transformTRPCResponse,
13
- createFlatProxy as createTRPCFlatProxy,
14
- type inferProcedureInput,
15
- type inferProcedureOutput,
16
- type inferRouterError,
17
- type inferRouterInputs,
18
- type inferRouterOutputs,
19
- type inferRouterContext,
20
- type inferTransformedProcedureOutput,
21
- type inferTransformedSubscriptionOutput,
22
- type AnyProcedure as AnyTRPCProcedure,
23
- type AnyRouter as AnyTRPCRouter,
24
- type AnyMiddlewareFunction as AnyTRPCMiddlewareFunction,
25
- type CombinedDataTransformer as TRPCCombinedDataTransformer,
26
- type ProcedureType as TRPCProcedureType,
27
- type AnyMutationProcedure as AnyTRPCMutationProcedure,
28
- type AnyQueryProcedure as AnyTRPCQueryProcedure,
29
- type ProcedureRouterRecord as TRPCProcedureRouterRecord,
30
- type ProcedureArgs as TRPCProcedureArgs,
31
- type AnySubscriptionProcedure as AnyTRPCSubscriptionProcedure,
32
- } from './@trpc-core-unstable-do-not-import-this-please';
33
-
34
- export type {
35
- /**
36
- * @deprecated use `AnyTRPCProcedure` instead
37
- */
38
- AnyProcedure,
39
- /**
40
- * @deprecated use `AnyTRPCRouter` instead
41
- */
42
- AnyRouter,
43
- /**
44
- * @deprecated use `AnyTRPCMiddlewareFunction` instead
45
- */
46
- AnyMiddlewareFunction,
47
- /**
48
- * @deprecated use `TRPCCombinedDataTransformer` instead
49
- */
50
- CombinedDataTransformer,
51
-
52
- /**
53
- * @deprecated This is a utility type will be removed in v12
54
- */
55
- Dict,
56
-
57
- /**
58
- * @deprecated This is a utility type will be removed in v12
59
- */
60
- DeepPartial,
61
- /**
62
- * @deprecated use `TRPCProcedureType` instead
63
- */
64
- ProcedureType,
65
- /**
66
- * @deprecated use `AnyTRPCMutationProcedure` instead
67
- */
68
- AnyMutationProcedure,
69
-
70
- /**
71
- * @deprecated use `AnyTRPCQueryProcedure` instead
72
- */
73
- AnyQueryProcedure,
74
- /**
75
- * @deprecated use `TRPCProcedureRouterRecord` instead
76
- */
77
- ProcedureRouterRecord,
78
- /**
79
- * @deprecated use `TRPCProcedureArgs` instead
80
- */
81
- ProcedureArgs,
82
- /**
83
- * @deprecated use `AnyTRPCSubscriptionProcedure` instead
84
- */
85
- AnySubscriptionProcedure,
86
- } from '@trpc/core';
87
-
88
- export {
89
- /**
90
- * @deprecated use `getTRPCErrorShape` instead
91
- */
92
- getErrorShape,
93
-
94
- /**
95
- * @deprecated use `callTRPCProcedure` instead
96
- */
97
- callProcedure,
98
- } from '@trpc/core';
99
-
100
- /**
101
- * @deprecated
102
- * Use `Awaited<ReturnType<typeof myFunction>>` instead
103
- */
104
- export type inferAsyncReturnType<TFunction extends (...args: any[]) => any> =
105
- Awaited<ReturnType<TFunction>>;
1
+ export * from './@trpc/server';
@@ -0,0 +1,10 @@
1
+ export type { inferObservableValue } from './observable';
2
+ export { isObservable, observable, observableToPromise } from './observable';
3
+ export { map, share, tap } from './operators';
4
+ export type {
5
+ Observable,
6
+ Observer,
7
+ TeardownLogic,
8
+ Unsubscribable,
9
+ UnsubscribeFn,
10
+ } from './types';