@trpc/server 11.0.0-alpha-tmp-export-from-main-nuke-core.240 → 11.0.0-alpha-tmp-export-from-main.222

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 (308) hide show
  1. package/dist/adapters/aws-lambda/index.d.mts +68 -0
  2. package/dist/adapters/aws-lambda/index.d.ts +55 -6
  3. package/dist/adapters/aws-lambda/index.js +111 -23
  4. package/dist/adapters/aws-lambda/index.mjs +95 -7
  5. package/dist/adapters/express.d.mts +19 -0
  6. package/dist/adapters/express.d.ts +10 -6
  7. package/dist/adapters/express.js +3 -3
  8. package/dist/adapters/express.mjs +1 -1
  9. package/dist/adapters/fastify/index.d.mts +33 -0
  10. package/dist/adapters/fastify/index.d.ts +33 -3
  11. package/dist/adapters/fastify/index.js +124 -5
  12. package/dist/adapters/fastify/index.mjs +125 -2
  13. package/dist/adapters/fetch/index.d.mts +51 -0
  14. package/dist/adapters/fetch/index.d.ts +51 -3
  15. package/dist/adapters/fetch/index.js +115 -4
  16. package/dist/adapters/fetch/index.mjs +116 -1
  17. package/dist/adapters/next.d.mts +21 -0
  18. package/dist/adapters/next.d.ts +12 -6
  19. package/dist/adapters/next.js +7 -9
  20. package/dist/adapters/next.mjs +3 -5
  21. package/dist/adapters/node-http/content-type/form-data/index.d.mts +219 -0
  22. package/dist/adapters/node-http/content-type/form-data/index.d.ts +201 -10
  23. package/dist/adapters/node-http/content-type/form-data/index.js +662 -23
  24. package/dist/adapters/node-http/content-type/form-data/index.mjs +646 -10
  25. package/dist/adapters/node-http/{types.d.ts → content-type/json/index.d.mts} +22 -15
  26. package/dist/adapters/node-http/content-type/json/index.d.ts +89 -2
  27. package/dist/adapters/node-http/content-type/json/index.js +48 -9
  28. package/dist/adapters/node-http/content-type/json/index.mjs +44 -5
  29. package/dist/adapters/node-http/index.d.mts +100 -0
  30. package/dist/adapters/node-http/index.d.ts +100 -3
  31. package/dist/adapters/node-http/index.js +106 -4
  32. package/dist/adapters/node-http/index.mjs +107 -1
  33. package/dist/adapters/standalone.d.mts +21 -0
  34. package/dist/adapters/standalone.d.ts +12 -9
  35. package/dist/adapters/standalone.js +9 -6
  36. package/dist/adapters/standalone.mjs +2 -3
  37. package/dist/adapters/ws.d.mts +36 -0
  38. package/dist/adapters/ws.d.ts +12 -14
  39. package/dist/adapters/ws.js +33 -38
  40. package/dist/adapters/ws.mjs +12 -17
  41. package/dist/http.d.mts +1 -0
  42. package/dist/http.d.ts +1 -2
  43. package/dist/http.js +22 -12
  44. package/dist/http.mjs +1 -6
  45. package/dist/index.d.mts +9 -0
  46. package/dist/index.d.ts +9 -2
  47. package/dist/index.js +809 -23
  48. package/dist/index.mjs +798 -8
  49. package/dist/observable.d.mts +1 -0
  50. package/dist/observable.d.ts +1 -0
  51. package/dist/observable.js +30 -0
  52. package/dist/observable.mjs +1 -0
  53. package/dist/rpc.d.mts +1 -0
  54. package/dist/rpc.d.ts +1 -2
  55. package/dist/rpc.js +14 -7
  56. package/dist/rpc.mjs +1 -3
  57. package/dist/shared.d.mts +1 -0
  58. package/dist/shared.d.ts +1 -26
  59. package/dist/shared.js +10 -7
  60. package/dist/shared.mjs +1 -4
  61. package/dist/unstableDontImportMe.d.mts +1 -0
  62. package/dist/unstableDontImportMe.d.ts +1 -0
  63. package/dist/unstableDontImportMe.js +1549 -0
  64. package/dist/unstableDontImportMe.mjs +1514 -0
  65. package/package.json +138 -53
  66. package/src/@trpc-server/http.ts +2 -0
  67. package/src/adapters/aws-lambda/index.ts +5 -4
  68. package/src/adapters/aws-lambda/utils.ts +4 -3
  69. package/src/adapters/express.ts +3 -1
  70. package/src/adapters/fastify/fastifyRequestHandler.ts +4 -6
  71. package/src/adapters/fastify/fastifyTRPCPlugin.ts +2 -1
  72. package/src/adapters/fetch/fetchRequestHandler.ts +4 -6
  73. package/src/adapters/fetch/types.ts +3 -2
  74. package/src/adapters/next.ts +4 -2
  75. package/src/adapters/node-http/content-type/form-data/index.ts +1 -1
  76. package/src/adapters/node-http/content-type/json/getPostBody.ts +2 -2
  77. package/src/adapters/node-http/content-type/json/index.ts +1 -1
  78. package/src/adapters/node-http/internals/contentType.ts +2 -2
  79. package/src/adapters/node-http/nodeHTTPRequestHandler.ts +4 -6
  80. package/src/adapters/node-http/types.ts +5 -4
  81. package/src/adapters/standalone.ts +2 -2
  82. package/src/adapters/ws.ts +13 -14
  83. package/src/http.ts +26 -1
  84. package/src/index.ts +106 -1
  85. package/src/observable.ts +16 -0
  86. package/src/rpc.ts +26 -1
  87. package/src/shared.ts +1 -1
  88. package/src/unstableDontImportMe.ts +146 -0
  89. package/unstableDontImportMe/index.d.ts +1 -0
  90. package/unstableDontImportMe/index.js +1 -0
  91. package/dist/@trpc/server/http.d.ts +0 -7
  92. package/dist/@trpc/server/http.d.ts.map +0 -1
  93. package/dist/@trpc/server/index.d.ts +0 -69
  94. package/dist/@trpc/server/index.d.ts.map +0 -1
  95. package/dist/@trpc/server/rpc.d.ts +0 -3
  96. package/dist/@trpc/server/rpc.d.ts.map +0 -1
  97. package/dist/adapters/aws-lambda/index.d.ts.map +0 -1
  98. package/dist/adapters/aws-lambda/utils.d.ts +0 -47
  99. package/dist/adapters/aws-lambda/utils.d.ts.map +0 -1
  100. package/dist/adapters/aws-lambda/utils.js +0 -101
  101. package/dist/adapters/aws-lambda/utils.mjs +0 -94
  102. package/dist/adapters/express.d.ts.map +0 -1
  103. package/dist/adapters/fastify/fastifyRequestHandler.d.ts +0 -13
  104. package/dist/adapters/fastify/fastifyRequestHandler.d.ts.map +0 -1
  105. package/dist/adapters/fastify/fastifyRequestHandler.js +0 -84
  106. package/dist/adapters/fastify/fastifyRequestHandler.mjs +0 -82
  107. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts +0 -21
  108. package/dist/adapters/fastify/fastifyTRPCPlugin.d.ts.map +0 -1
  109. package/dist/adapters/fastify/fastifyTRPCPlugin.js +0 -50
  110. package/dist/adapters/fastify/fastifyTRPCPlugin.mjs +0 -48
  111. package/dist/adapters/fastify/index.d.ts.map +0 -1
  112. package/dist/adapters/fetch/fetchRequestHandler.d.ts +0 -17
  113. package/dist/adapters/fetch/fetchRequestHandler.d.ts.map +0 -1
  114. package/dist/adapters/fetch/fetchRequestHandler.js +0 -120
  115. package/dist/adapters/fetch/fetchRequestHandler.mjs +0 -118
  116. package/dist/adapters/fetch/index.d.ts.map +0 -1
  117. package/dist/adapters/fetch/types.d.ts +0 -30
  118. package/dist/adapters/fetch/types.d.ts.map +0 -1
  119. package/dist/adapters/next.d.ts.map +0 -1
  120. package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts +0 -70
  121. package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.d.ts.map +0 -1
  122. package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.js +0 -161
  123. package/dist/adapters/node-http/content-type/form-data/fileUploadHandler.mjs +0 -157
  124. package/dist/adapters/node-http/content-type/form-data/index.d.ts.map +0 -1
  125. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts +0 -31
  126. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.d.ts.map +0 -1
  127. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.js +0 -29
  128. package/dist/adapters/node-http/content-type/form-data/memoryUploadHandler.mjs +0 -27
  129. package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts +0 -16
  130. package/dist/adapters/node-http/content-type/form-data/streamSlice.d.ts.map +0 -1
  131. package/dist/adapters/node-http/content-type/form-data/streamSlice.js +0 -46
  132. package/dist/adapters/node-http/content-type/form-data/streamSlice.mjs +0 -44
  133. package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts +0 -45
  134. package/dist/adapters/node-http/content-type/form-data/uploadHandler.d.ts.map +0 -1
  135. package/dist/adapters/node-http/content-type/form-data/uploadHandler.js +0 -30
  136. package/dist/adapters/node-http/content-type/form-data/uploadHandler.mjs +0 -26
  137. package/dist/adapters/node-http/content-type/json/getPostBody.d.ts +0 -7
  138. package/dist/adapters/node-http/content-type/json/getPostBody.d.ts.map +0 -1
  139. package/dist/adapters/node-http/content-type/json/getPostBody.js +0 -44
  140. package/dist/adapters/node-http/content-type/json/getPostBody.mjs +0 -42
  141. package/dist/adapters/node-http/content-type/json/index.d.ts.map +0 -1
  142. package/dist/adapters/node-http/index.d.ts.map +0 -1
  143. package/dist/adapters/node-http/internals/contentType.d.ts +0 -9
  144. package/dist/adapters/node-http/internals/contentType.d.ts.map +0 -1
  145. package/dist/adapters/node-http/internals/contentType.js +0 -8
  146. package/dist/adapters/node-http/internals/contentType.mjs +0 -6
  147. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts +0 -13
  148. package/dist/adapters/node-http/nodeHTTPRequestHandler.d.ts.map +0 -1
  149. package/dist/adapters/node-http/nodeHTTPRequestHandler.js +0 -111
  150. package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +0 -109
  151. package/dist/adapters/node-http/types.d.ts.map +0 -1
  152. package/dist/adapters/standalone.d.ts.map +0 -1
  153. package/dist/adapters/ws.d.ts.map +0 -1
  154. package/dist/bundle-analysis.json +0 -757
  155. package/dist/http.d.ts.map +0 -1
  156. package/dist/index.d.ts.map +0 -1
  157. package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/index.js +0 -203
  158. package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/index.mjs +0 -201
  159. package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/search.js +0 -167
  160. package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/search.mjs +0 -163
  161. package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/utils.js +0 -35
  162. package/dist/node_modules/.pnpm/@web3-storage_multipart-parser@1.0.0/node_modules/@web3-storage/multipart-parser/esm/src/utils.mjs +0 -30
  163. package/dist/observable/index.d.ts +0 -5
  164. package/dist/observable/index.d.ts.map +0 -1
  165. package/dist/observable/index.js +0 -13
  166. package/dist/observable/index.mjs +0 -2
  167. package/dist/observable/observable.d.ts +0 -13
  168. package/dist/observable/observable.d.ts.map +0 -1
  169. package/dist/observable/observable.js +0 -126
  170. package/dist/observable/observable.mjs +0 -122
  171. package/dist/observable/operators.d.ts +0 -8
  172. package/dist/observable/operators.d.ts.map +0 -1
  173. package/dist/observable/operators.js +0 -103
  174. package/dist/observable/operators.mjs +0 -99
  175. package/dist/observable/types.d.ts +0 -26
  176. package/dist/observable/types.d.ts.map +0 -1
  177. package/dist/rpc.d.ts.map +0 -1
  178. package/dist/shared.d.ts.map +0 -1
  179. package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts +0 -6
  180. package/dist/unstable-core-do-not-import/TRPCInferrable.d.ts.map +0 -1
  181. package/dist/unstable-core-do-not-import/createProxy.d.ts +0 -19
  182. package/dist/unstable-core-do-not-import/createProxy.d.ts.map +0 -1
  183. package/dist/unstable-core-do-not-import/createProxy.js +0 -52
  184. package/dist/unstable-core-do-not-import/createProxy.mjs +0 -49
  185. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +0 -13
  186. package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +0 -1
  187. package/dist/unstable-core-do-not-import/error/TRPCError.js +0 -67
  188. package/dist/unstable-core-do-not-import/error/TRPCError.mjs +0 -63
  189. package/dist/unstable-core-do-not-import/error/formatter.d.ts +0 -33
  190. package/dist/unstable-core-do-not-import/error/formatter.d.ts.map +0 -1
  191. package/dist/unstable-core-do-not-import/error/formatter.js +0 -7
  192. package/dist/unstable-core-do-not-import/error/formatter.mjs +0 -5
  193. package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts +0 -15
  194. package/dist/unstable-core-do-not-import/error/getErrorShape.d.ts.map +0 -1
  195. package/dist/unstable-core-do-not-import/error/getErrorShape.js +0 -31
  196. package/dist/unstable-core-do-not-import/error/getErrorShape.mjs +0 -29
  197. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts +0 -24
  198. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.d.ts.map +0 -1
  199. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.js +0 -32
  200. package/dist/unstable-core-do-not-import/http/batchStreamFormatter.mjs +0 -30
  201. package/dist/unstable-core-do-not-import/http/contentType.d.ts +0 -29
  202. package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +0 -1
  203. package/dist/unstable-core-do-not-import/http/contentType.js +0 -54
  204. package/dist/unstable-core-do-not-import/http/contentType.mjs +0 -52
  205. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts +0 -5
  206. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +0 -1
  207. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +0 -51
  208. package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +0 -48
  209. package/dist/unstable-core-do-not-import/http/index.d.ts +0 -7
  210. package/dist/unstable-core-do-not-import/http/index.d.ts.map +0 -1
  211. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts +0 -51
  212. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.d.ts.map +0 -1
  213. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.js +0 -295
  214. package/dist/unstable-core-do-not-import/http/resolveHTTPResponse.mjs +0 -293
  215. package/dist/unstable-core-do-not-import/http/types.d.ts +0 -96
  216. package/dist/unstable-core-do-not-import/http/types.d.ts.map +0 -1
  217. package/dist/unstable-core-do-not-import/index.d.ts +0 -37
  218. package/dist/unstable-core-do-not-import/index.d.ts.map +0 -1
  219. package/dist/unstable-core-do-not-import/index.js +0 -48
  220. package/dist/unstable-core-do-not-import/index.mjs +0 -16
  221. package/dist/unstable-core-do-not-import/initTRPC.d.ts +0 -96
  222. package/dist/unstable-core-do-not-import/initTRPC.d.ts.map +0 -1
  223. package/dist/unstable-core-do-not-import/initTRPC.js +0 -95
  224. package/dist/unstable-core-do-not-import/initTRPC.mjs +0 -93
  225. package/dist/unstable-core-do-not-import/middleware.d.ts +0 -105
  226. package/dist/unstable-core-do-not-import/middleware.d.ts.map +0 -1
  227. package/dist/unstable-core-do-not-import/middleware.js +0 -95
  228. package/dist/unstable-core-do-not-import/middleware.mjs +0 -89
  229. package/dist/unstable-core-do-not-import/parser.d.ts +0 -30
  230. package/dist/unstable-core-do-not-import/parser.d.ts.map +0 -1
  231. package/dist/unstable-core-do-not-import/parser.js +0 -37
  232. package/dist/unstable-core-do-not-import/parser.mjs +0 -35
  233. package/dist/unstable-core-do-not-import/procedure.d.ts +0 -72
  234. package/dist/unstable-core-do-not-import/procedure.d.ts.map +0 -1
  235. package/dist/unstable-core-do-not-import/procedure.js +0 -9
  236. package/dist/unstable-core-do-not-import/procedure.mjs +0 -7
  237. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +0 -101
  238. package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +0 -1
  239. package/dist/unstable-core-do-not-import/procedureBuilder.js +0 -176
  240. package/dist/unstable-core-do-not-import/procedureBuilder.mjs +0 -173
  241. package/dist/unstable-core-do-not-import/rootConfig.d.ts +0 -75
  242. package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +0 -1
  243. package/dist/unstable-core-do-not-import/rootConfig.js +0 -8
  244. package/dist/unstable-core-do-not-import/rootConfig.mjs +0 -6
  245. package/dist/unstable-core-do-not-import/router.d.ts +0 -85
  246. package/dist/unstable-core-do-not-import/router.d.ts.map +0 -1
  247. package/dist/unstable-core-do-not-import/router.js +0 -156
  248. package/dist/unstable-core-do-not-import/router.mjs +0 -151
  249. package/dist/unstable-core-do-not-import/rpc/codes.d.ts +0 -51
  250. package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +0 -1
  251. package/dist/unstable-core-do-not-import/rpc/codes.js +0 -38
  252. package/dist/unstable-core-do-not-import/rpc/codes.mjs +0 -35
  253. package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +0 -97
  254. package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +0 -1
  255. package/dist/unstable-core-do-not-import/rpc/index.d.ts +0 -5
  256. package/dist/unstable-core-do-not-import/rpc/index.d.ts.map +0 -1
  257. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts +0 -5
  258. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +0 -1
  259. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +0 -59
  260. package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +0 -57
  261. package/dist/unstable-core-do-not-import/serialize.d.ts +0 -62
  262. package/dist/unstable-core-do-not-import/serialize.d.ts.map +0 -1
  263. package/dist/unstable-core-do-not-import/transformer.d.ts +0 -107
  264. package/dist/unstable-core-do-not-import/transformer.d.ts.map +0 -1
  265. package/dist/unstable-core-do-not-import/transformer.js +0 -107
  266. package/dist/unstable-core-do-not-import/transformer.mjs +0 -102
  267. package/dist/unstable-core-do-not-import/types.d.ts +0 -98
  268. package/dist/unstable-core-do-not-import/types.d.ts.map +0 -1
  269. package/dist/unstable-core-do-not-import/utils.d.ts +0 -27
  270. package/dist/unstable-core-do-not-import/utils.d.ts.map +0 -1
  271. package/dist/unstable-core-do-not-import/utils.js +0 -44
  272. package/dist/unstable-core-do-not-import/utils.mjs +0 -39
  273. package/src/@trpc/server/http.ts +0 -26
  274. package/src/@trpc/server/index.ts +0 -105
  275. package/src/@trpc/server/rpc.ts +0 -26
  276. package/src/observable/index.ts +0 -10
  277. package/src/observable/observable.ts +0 -158
  278. package/src/observable/operators.ts +0 -119
  279. package/src/observable/types.ts +0 -76
  280. package/src/unstable-core-do-not-import/TRPCInferrable.ts +0 -9
  281. package/src/unstable-core-do-not-import/createProxy.ts +0 -59
  282. package/src/unstable-core-do-not-import/error/TRPCError.ts +0 -82
  283. package/src/unstable-core-do-not-import/error/formatter.ts +0 -51
  284. package/src/unstable-core-do-not-import/error/getErrorShape.ts +0 -36
  285. package/src/unstable-core-do-not-import/http/batchStreamFormatter.ts +0 -29
  286. package/src/unstable-core-do-not-import/http/contentType.ts +0 -99
  287. package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +0 -57
  288. package/src/unstable-core-do-not-import/http/index.ts +0 -23
  289. package/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts +0 -458
  290. package/src/unstable-core-do-not-import/http/types.ts +0 -111
  291. package/src/unstable-core-do-not-import/index.ts +0 -110
  292. package/src/unstable-core-do-not-import/initTRPC.ts +0 -206
  293. package/src/unstable-core-do-not-import/middleware.ts +0 -233
  294. package/src/unstable-core-do-not-import/parser.ts +0 -94
  295. package/src/unstable-core-do-not-import/procedure.ts +0 -108
  296. package/src/unstable-core-do-not-import/procedureBuilder.ts +0 -458
  297. package/src/unstable-core-do-not-import/rootConfig.ts +0 -90
  298. package/src/unstable-core-do-not-import/router.ts +0 -370
  299. package/src/unstable-core-do-not-import/rpc/codes.ts +0 -44
  300. package/src/unstable-core-do-not-import/rpc/envelopes.ts +0 -136
  301. package/src/unstable-core-do-not-import/rpc/index.ts +0 -21
  302. package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +0 -85
  303. package/src/unstable-core-do-not-import/serialize.ts +0 -122
  304. package/src/unstable-core-do-not-import/transformer.ts +0 -202
  305. package/src/unstable-core-do-not-import/types.ts +0 -151
  306. package/src/unstable-core-do-not-import/utils.ts +0 -59
  307. package/unstable-core-do-not-import/index.d.ts +0 -1
  308. package/unstable-core-do-not-import/index.js +0 -1
@@ -1,14 +1,12 @@
1
- 'use strict';
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
2
 
3
- var getErrorShape = require('../unstable-core-do-not-import/error/getErrorShape.js');
4
- var TRPCError = require('../unstable-core-do-not-import/error/TRPCError.js');
5
- require('../unstable-core-do-not-import/rootConfig.js');
6
- require('../unstable-core-do-not-import/rpc/codes.js');
7
- var nodeHTTPRequestHandler = require('./node-http/nodeHTTPRequestHandler.js');
3
+ var server = require('@trpc/server');
4
+ var nodeHttp = require('@trpc/server/adapters/node-http');
8
5
 
9
6
  /**
10
7
  * 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`
11
8
  *
9
+ * Do **not** import from `@trpc/core`
12
10
  * @example
13
11
  * ```ts
14
12
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -28,9 +26,9 @@ function createNextApiHandler(opts) {
28
26
  }
29
27
  const path = getPath();
30
28
  if (path === null) {
31
- const error = getErrorShape.getErrorShape({
29
+ const error = server.getErrorShape({
32
30
  config: opts.router._def._config,
33
- error: new TRPCError.TRPCError({
31
+ error: new server.TRPCError({
34
32
  message: 'Query "trpc" not found - is the file named `[trpc]`.ts or `[...trpc].ts`?',
35
33
  code: 'INTERNAL_SERVER_ERROR'
36
34
  }),
@@ -46,7 +44,7 @@ function createNextApiHandler(opts) {
46
44
  });
47
45
  return;
48
46
  }
49
- await nodeHTTPRequestHandler.nodeHTTPRequestHandler({
47
+ await nodeHttp.nodeHTTPRequestHandler({
50
48
  // FIXME: no typecasting should be needed here
51
49
  ...opts,
52
50
  req,
@@ -1,12 +1,10 @@
1
- import { getErrorShape } from '../unstable-core-do-not-import/error/getErrorShape.mjs';
2
- import { TRPCError } from '../unstable-core-do-not-import/error/TRPCError.mjs';
3
- import '../unstable-core-do-not-import/rootConfig.mjs';
4
- import '../unstable-core-do-not-import/rpc/codes.mjs';
5
- import { nodeHTTPRequestHandler } from './node-http/nodeHTTPRequestHandler.mjs';
1
+ import { getErrorShape, TRPCError } from '@trpc/server';
2
+ import { nodeHTTPRequestHandler } from '@trpc/server/adapters/node-http';
6
3
 
7
4
  /**
8
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`
9
6
  *
7
+ * Do **not** import from `@trpc/core`
10
8
  * @example
11
9
  * ```ts
12
10
  * import type { AnyTRPCRouter } from '@trpc/server'
@@ -0,0 +1,219 @@
1
+ import { AnyRouter, inferRouterContext } from '@trpc/server';
2
+ import { HTTPBaseHandlerOptions, MaybePromise, TRPCRequestInfo, BaseContentTypeHandler } from '@trpc/core';
3
+ import { IncomingMessage, ServerResponse } from 'http';
4
+
5
+ /**
6
+ * 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`
7
+ *
8
+ * Do **not** import from `@trpc/core`
9
+ * @example
10
+ * ```ts
11
+ * import type { AnyTRPCRouter } from '@trpc/server'
12
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
13
+ * ```
14
+ */
15
+
16
+ interface ParsedQs {
17
+ [key: string]: ParsedQs | ParsedQs[] | string[] | string | undefined;
18
+ }
19
+ type NodeHTTPRequest = IncomingMessage & {
20
+ query?: ParsedQs;
21
+ body?: unknown;
22
+ };
23
+ type NodeHTTPResponse = ServerResponse & {
24
+ /**
25
+ * Force the partially-compressed response to be flushed to the client.
26
+ *
27
+ * Added by compression middleware
28
+ * (depending on the environment,
29
+ * e.g. Next <= 12,
30
+ * e.g. Express w/ `compression()`)
31
+ */
32
+ flush?: () => void;
33
+ };
34
+ type NodeHTTPCreateContextOption<TRouter extends AnyRouter, TRequest, TResponse> = object extends inferRouterContext<TRouter> ? {
35
+ /**
36
+ * @link https://trpc.io/docs/v11/context
37
+ **/
38
+ createContext?: NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>;
39
+ } : {
40
+ /**
41
+ * @link https://trpc.io/docs/v11/context
42
+ **/
43
+ createContext: NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>;
44
+ };
45
+ /**
46
+ * @internal
47
+ */
48
+ type ConnectMiddleware<TRequest extends NodeHTTPRequest = NodeHTTPRequest, TResponse extends NodeHTTPResponse = NodeHTTPResponse> = (req: TRequest, res: TResponse, next: (err?: any) => any) => void;
49
+ type NodeHTTPHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = HTTPBaseHandlerOptions<TRouter, TRequest> & NodeHTTPCreateContextOption<TRouter, TRequest, TResponse> & {
50
+ /**
51
+ * By default, http `OPTIONS` requests are not handled, and CORS headers are not returned.
52
+ *
53
+ * This can be used to handle them manually or via the `cors` npm package: https://www.npmjs.com/package/cors
54
+ *
55
+ * ```ts
56
+ * import cors from 'cors'
57
+ *
58
+ * nodeHTTPRequestHandler({
59
+ * cors: cors()
60
+ * })
61
+ * ```
62
+ *
63
+ * You can also use it for other needs which a connect/node.js compatible middleware can solve,
64
+ * though you might wish to consider an alternative solution like the Express adapter if your needs are complex.
65
+ */
66
+ middleware?: ConnectMiddleware;
67
+ maxBodySize?: number;
68
+ experimental_contentTypeHandlers?: NodeHTTPContentTypeHandler<TRequest, TResponse>[];
69
+ };
70
+ type NodeHTTPRequestHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = {
71
+ req: TRequest;
72
+ res: TResponse;
73
+ path: string;
74
+ } & NodeHTTPHandlerOptions<TRouter, TRequest, TResponse>;
75
+ type NodeHTTPCreateContextFnOptions<TRequest, TResponse> = {
76
+ req: TRequest;
77
+ res: TResponse;
78
+ info: TRPCRequestInfo;
79
+ };
80
+ type NodeHTTPCreateContextFn<TRouter extends AnyRouter, TRequest, TResponse> = (opts: NodeHTTPCreateContextFnOptions<TRequest, TResponse>) => MaybePromise<inferRouterContext<TRouter>>;
81
+
82
+ interface NodeHTTPContentTypeHandler<TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> extends BaseContentTypeHandler<NodeHTTPRequestHandlerOptions<AnyRouter, TRequest, TResponse> & {
83
+ query: URLSearchParams;
84
+ }> {
85
+ }
86
+
87
+ type FileUploadHandlerFilterArgs = {
88
+ filename: string;
89
+ contentType: string;
90
+ name: string;
91
+ };
92
+ type FileUploadHandlerPathResolverArgs = {
93
+ filename: string;
94
+ contentType: string;
95
+ name: string;
96
+ };
97
+ /**
98
+ * Chooses the path of the file to be uploaded. If a string is not
99
+ * returned the file will not be written.
100
+ */
101
+ type FileUploadHandlerPathResolver = (args: FileUploadHandlerPathResolverArgs) => string | undefined;
102
+ type FileUploadHandlerOptions = {
103
+ /**
104
+ * Avoid file conflicts by appending a count on the end of the filename
105
+ * if it already exists on disk. Defaults to `true`.
106
+ */
107
+ avoidFileConflicts?: boolean;
108
+ /**
109
+ * The directory to write the upload.
110
+ */
111
+ directory?: FileUploadHandlerPathResolver | string;
112
+ /**
113
+ * The name of the file in the directory. Can be a relative path, the directory
114
+ * structure will be created if it does not exist.
115
+ */
116
+ file?: FileUploadHandlerPathResolver;
117
+ /**
118
+ * The maximum upload size allowed. If the size is exceeded an error will be thrown.
119
+ * Defaults to 3000000B (3MB).
120
+ */
121
+ maxPartSize?: number;
122
+ /**
123
+ *
124
+ * @param filename
125
+ * @param contentType
126
+ * @param name
127
+ */
128
+ filter?(args: FileUploadHandlerFilterArgs): Promise<boolean> | boolean;
129
+ };
130
+ declare function createFileUploadHandler({ directory, avoidFileConflicts, file, filter, maxPartSize, }?: FileUploadHandlerOptions): UploadHandler;
131
+ declare class NodeOnDiskFile {
132
+ private filepath;
133
+ type: string;
134
+ private slicer?;
135
+ name: string;
136
+ lastModified: number;
137
+ webkitRelativePath: string;
138
+ constructor(filepath: string, type: string, slicer?: {
139
+ start: number;
140
+ end: number;
141
+ } | undefined);
142
+ get size(): number;
143
+ slice(start?: number, end?: number, type?: string): NodeOnDiskFile;
144
+ arrayBuffer(): Promise<ArrayBuffer>;
145
+ stream(): ReadableStream<any>;
146
+ stream(): NodeJS.ReadableStream;
147
+ text(): Promise<string>;
148
+ readonly [Symbol.toStringTag] = "File";
149
+ remove(): Promise<void>;
150
+ getFilePath(): string;
151
+ }
152
+
153
+ /**
154
+ * @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/formData.ts
155
+ */
156
+ type UploadHandlerPart = {
157
+ name: string;
158
+ filename?: string;
159
+ contentType: string;
160
+ data: AsyncIterable<Uint8Array>;
161
+ };
162
+ type UploadHandler = (part: Required<UploadHandlerPart>) => Promise<File | NodeOnDiskFile | null | undefined>;
163
+ declare function composeUploadHandlers(...handlers: UploadHandler[]): UploadHandler;
164
+ declare class MaxPartSizeExceededError extends Error {
165
+ field: string;
166
+ maxBytes: number;
167
+ constructor(field: string, maxBytes: number);
168
+ }
169
+ declare class MaxBodySizeExceededError extends Error {
170
+ maxBytes: number;
171
+ constructor(maxBytes: number);
172
+ }
173
+
174
+ /**
175
+ * Copyright 2021 Remix Software Inc.
176
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
177
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
178
+ * 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.
179
+ */
180
+ /**
181
+ * @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/upload/memoryUploadHandler.ts
182
+ */
183
+
184
+ type MemoryUploadHandlerFilterArgs = {
185
+ filename?: string;
186
+ contentType: string;
187
+ name: string;
188
+ };
189
+ type MemoryUploadHandlerOptions = {
190
+ /**
191
+ * The maximum upload size allowed. If the size is exceeded an error will be thrown.
192
+ * Defaults to 3000000B (3MB).
193
+ */
194
+ maxPartSize?: number;
195
+ /**
196
+ *
197
+ * @param filename
198
+ * @param mimetype
199
+ * @param encoding
200
+ */
201
+ filter?(args: MemoryUploadHandlerFilterArgs): Promise<boolean> | boolean;
202
+ };
203
+ declare function createMemoryUploadHandler({ filter, maxPartSize, }?: MemoryUploadHandlerOptions): UploadHandler;
204
+
205
+ /**
206
+ * Allows you to handle multipart forms (file uploads) for your app.
207
+ * Request body parts with a 'filename' property will be treated as files.
208
+ * The rest will be treated as text.
209
+ * @param request The incoming Node HTTP request
210
+ * @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.
211
+ * @param maxBodySize The maximum size of the request body in bytes. Defaults to Infinity.
212
+ *
213
+ * @link https://remix.run/utils/parse-multipart-form-data
214
+ */
215
+ declare function parseMultipartFormData(request: NodeHTTPRequest, uploadHandler: UploadHandler, maxBodySize?: number): Promise<FormData>;
216
+ declare function isMultipartFormDataRequest(req: NodeHTTPRequest): boolean;
217
+ declare const nodeHTTPFormDataContentTypeHandler: <TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>() => NodeHTTPContentTypeHandler<TRequest, TResponse>;
218
+
219
+ export { MaxBodySizeExceededError, MaxPartSizeExceededError, type UploadHandler, NodeOnDiskFile as experimental_NodeOnDiskFile, composeUploadHandlers as experimental_composeUploadHandlers, createFileUploadHandler as experimental_createFileUploadHandler, createMemoryUploadHandler as experimental_createMemoryUploadHandler, isMultipartFormDataRequest as experimental_isMultipartFormDataRequest, parseMultipartFormData as experimental_parseMultipartFormData, nodeHTTPFormDataContentTypeHandler };
@@ -1,11 +1,207 @@
1
+ import { AnyRouter, inferRouterContext } from '@trpc/server';
2
+ import { HTTPBaseHandlerOptions, MaybePromise, TRPCRequestInfo, BaseContentTypeHandler } from '@trpc/core';
3
+ import { IncomingMessage, ServerResponse } from 'http';
4
+
5
+ /**
6
+ * 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`
7
+ *
8
+ * Do **not** import from `@trpc/core`
9
+ * @example
10
+ * ```ts
11
+ * import type { AnyTRPCRouter } from '@trpc/server'
12
+ * import type { HTTPBaseHandlerOptions } from '@trpc/server/http'
13
+ * ```
14
+ */
15
+
16
+ interface ParsedQs {
17
+ [key: string]: ParsedQs | ParsedQs[] | string[] | string | undefined;
18
+ }
19
+ type NodeHTTPRequest = IncomingMessage & {
20
+ query?: ParsedQs;
21
+ body?: unknown;
22
+ };
23
+ type NodeHTTPResponse = ServerResponse & {
24
+ /**
25
+ * Force the partially-compressed response to be flushed to the client.
26
+ *
27
+ * Added by compression middleware
28
+ * (depending on the environment,
29
+ * e.g. Next <= 12,
30
+ * e.g. Express w/ `compression()`)
31
+ */
32
+ flush?: () => void;
33
+ };
34
+ type NodeHTTPCreateContextOption<TRouter extends AnyRouter, TRequest, TResponse> = object extends inferRouterContext<TRouter> ? {
35
+ /**
36
+ * @link https://trpc.io/docs/v11/context
37
+ **/
38
+ createContext?: NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>;
39
+ } : {
40
+ /**
41
+ * @link https://trpc.io/docs/v11/context
42
+ **/
43
+ createContext: NodeHTTPCreateContextFn<TRouter, TRequest, TResponse>;
44
+ };
45
+ /**
46
+ * @internal
47
+ */
48
+ type ConnectMiddleware<TRequest extends NodeHTTPRequest = NodeHTTPRequest, TResponse extends NodeHTTPResponse = NodeHTTPResponse> = (req: TRequest, res: TResponse, next: (err?: any) => any) => void;
49
+ type NodeHTTPHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = HTTPBaseHandlerOptions<TRouter, TRequest> & NodeHTTPCreateContextOption<TRouter, TRequest, TResponse> & {
50
+ /**
51
+ * By default, http `OPTIONS` requests are not handled, and CORS headers are not returned.
52
+ *
53
+ * This can be used to handle them manually or via the `cors` npm package: https://www.npmjs.com/package/cors
54
+ *
55
+ * ```ts
56
+ * import cors from 'cors'
57
+ *
58
+ * nodeHTTPRequestHandler({
59
+ * cors: cors()
60
+ * })
61
+ * ```
62
+ *
63
+ * You can also use it for other needs which a connect/node.js compatible middleware can solve,
64
+ * though you might wish to consider an alternative solution like the Express adapter if your needs are complex.
65
+ */
66
+ middleware?: ConnectMiddleware;
67
+ maxBodySize?: number;
68
+ experimental_contentTypeHandlers?: NodeHTTPContentTypeHandler<TRequest, TResponse>[];
69
+ };
70
+ type NodeHTTPRequestHandlerOptions<TRouter extends AnyRouter, TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> = {
71
+ req: TRequest;
72
+ res: TResponse;
73
+ path: string;
74
+ } & NodeHTTPHandlerOptions<TRouter, TRequest, TResponse>;
75
+ type NodeHTTPCreateContextFnOptions<TRequest, TResponse> = {
76
+ req: TRequest;
77
+ res: TResponse;
78
+ info: TRPCRequestInfo;
79
+ };
80
+ type NodeHTTPCreateContextFn<TRouter extends AnyRouter, TRequest, TResponse> = (opts: NodeHTTPCreateContextFnOptions<TRequest, TResponse>) => MaybePromise<inferRouterContext<TRouter>>;
81
+
82
+ interface NodeHTTPContentTypeHandler<TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse> extends BaseContentTypeHandler<NodeHTTPRequestHandlerOptions<AnyRouter, TRequest, TResponse> & {
83
+ query: URLSearchParams;
84
+ }> {
85
+ }
86
+
87
+ type FileUploadHandlerFilterArgs = {
88
+ filename: string;
89
+ contentType: string;
90
+ name: string;
91
+ };
92
+ type FileUploadHandlerPathResolverArgs = {
93
+ filename: string;
94
+ contentType: string;
95
+ name: string;
96
+ };
97
+ /**
98
+ * Chooses the path of the file to be uploaded. If a string is not
99
+ * returned the file will not be written.
100
+ */
101
+ type FileUploadHandlerPathResolver = (args: FileUploadHandlerPathResolverArgs) => string | undefined;
102
+ type FileUploadHandlerOptions = {
103
+ /**
104
+ * Avoid file conflicts by appending a count on the end of the filename
105
+ * if it already exists on disk. Defaults to `true`.
106
+ */
107
+ avoidFileConflicts?: boolean;
108
+ /**
109
+ * The directory to write the upload.
110
+ */
111
+ directory?: FileUploadHandlerPathResolver | string;
112
+ /**
113
+ * The name of the file in the directory. Can be a relative path, the directory
114
+ * structure will be created if it does not exist.
115
+ */
116
+ file?: FileUploadHandlerPathResolver;
117
+ /**
118
+ * The maximum upload size allowed. If the size is exceeded an error will be thrown.
119
+ * Defaults to 3000000B (3MB).
120
+ */
121
+ maxPartSize?: number;
122
+ /**
123
+ *
124
+ * @param filename
125
+ * @param contentType
126
+ * @param name
127
+ */
128
+ filter?(args: FileUploadHandlerFilterArgs): Promise<boolean> | boolean;
129
+ };
130
+ declare function createFileUploadHandler({ directory, avoidFileConflicts, file, filter, maxPartSize, }?: FileUploadHandlerOptions): UploadHandler;
131
+ declare class NodeOnDiskFile {
132
+ private filepath;
133
+ type: string;
134
+ private slicer?;
135
+ name: string;
136
+ lastModified: number;
137
+ webkitRelativePath: string;
138
+ constructor(filepath: string, type: string, slicer?: {
139
+ start: number;
140
+ end: number;
141
+ } | undefined);
142
+ get size(): number;
143
+ slice(start?: number, end?: number, type?: string): NodeOnDiskFile;
144
+ arrayBuffer(): Promise<ArrayBuffer>;
145
+ stream(): ReadableStream<any>;
146
+ stream(): NodeJS.ReadableStream;
147
+ text(): Promise<string>;
148
+ readonly [Symbol.toStringTag] = "File";
149
+ remove(): Promise<void>;
150
+ getFilePath(): string;
151
+ }
152
+
153
+ /**
154
+ * @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/formData.ts
155
+ */
156
+ type UploadHandlerPart = {
157
+ name: string;
158
+ filename?: string;
159
+ contentType: string;
160
+ data: AsyncIterable<Uint8Array>;
161
+ };
162
+ type UploadHandler = (part: Required<UploadHandlerPart>) => Promise<File | NodeOnDiskFile | null | undefined>;
163
+ declare function composeUploadHandlers(...handlers: UploadHandler[]): UploadHandler;
164
+ declare class MaxPartSizeExceededError extends Error {
165
+ field: string;
166
+ maxBytes: number;
167
+ constructor(field: string, maxBytes: number);
168
+ }
169
+ declare class MaxBodySizeExceededError extends Error {
170
+ maxBytes: number;
171
+ constructor(maxBytes: number);
172
+ }
173
+
1
174
  /**
2
175
  * Copyright 2021 Remix Software Inc.
3
176
  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
177
  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
178
  * 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
179
  */
7
- import type { NodeHTTPRequest } from '../../types';
8
- import type { UploadHandler } from './uploadHandler';
180
+ /**
181
+ * @link https://github.com/remix-run/remix/blob/0bcb4a304dd2f08f6032c3bf0c3aa7eb5b976901/packages/remix-server-runtime/upload/memoryUploadHandler.ts
182
+ */
183
+
184
+ type MemoryUploadHandlerFilterArgs = {
185
+ filename?: string;
186
+ contentType: string;
187
+ name: string;
188
+ };
189
+ type MemoryUploadHandlerOptions = {
190
+ /**
191
+ * The maximum upload size allowed. If the size is exceeded an error will be thrown.
192
+ * Defaults to 3000000B (3MB).
193
+ */
194
+ maxPartSize?: number;
195
+ /**
196
+ *
197
+ * @param filename
198
+ * @param mimetype
199
+ * @param encoding
200
+ */
201
+ filter?(args: MemoryUploadHandlerFilterArgs): Promise<boolean> | boolean;
202
+ };
203
+ declare function createMemoryUploadHandler({ filter, maxPartSize, }?: MemoryUploadHandlerOptions): UploadHandler;
204
+
9
205
  /**
10
206
  * Allows you to handle multipart forms (file uploads) for your app.
11
207
  * Request body parts with a 'filename' property will be treated as files.
@@ -18,11 +214,6 @@ import type { UploadHandler } from './uploadHandler';
18
214
  */
19
215
  declare function parseMultipartFormData(request: NodeHTTPRequest, uploadHandler: UploadHandler, maxBodySize?: number): Promise<FormData>;
20
216
  declare function isMultipartFormDataRequest(req: NodeHTTPRequest): boolean;
21
- export declare const nodeHTTPFormDataContentTypeHandler: <TRequest extends NodeHTTPRequest, TResponse extends import("../../types").NodeHTTPResponse>() => import("../../internals/contentType").NodeHTTPContentTypeHandler<TRequest, TResponse>;
22
- export { parseMultipartFormData as experimental_parseMultipartFormData };
23
- export { createMemoryUploadHandler as experimental_createMemoryUploadHandler } from './memoryUploadHandler';
24
- export { createFileUploadHandler as experimental_createFileUploadHandler, NodeOnDiskFile as experimental_NodeOnDiskFile, } from './fileUploadHandler';
25
- export { composeUploadHandlers as experimental_composeUploadHandlers, MaxPartSizeExceededError, MaxBodySizeExceededError, } from './uploadHandler';
26
- export { type UploadHandler } from './uploadHandler';
27
- export { isMultipartFormDataRequest as experimental_isMultipartFormDataRequest };
28
- //# sourceMappingURL=index.d.ts.map
217
+ declare const nodeHTTPFormDataContentTypeHandler: <TRequest extends NodeHTTPRequest, TResponse extends NodeHTTPResponse>() => NodeHTTPContentTypeHandler<TRequest, TResponse>;
218
+
219
+ export { MaxBodySizeExceededError, MaxPartSizeExceededError, type UploadHandler, NodeOnDiskFile as experimental_NodeOnDiskFile, composeUploadHandlers as experimental_composeUploadHandlers, createFileUploadHandler as experimental_createFileUploadHandler, createMemoryUploadHandler as experimental_createMemoryUploadHandler, isMultipartFormDataRequest as experimental_isMultipartFormDataRequest, parseMultipartFormData as experimental_parseMultipartFormData, nodeHTTPFormDataContentTypeHandler };