@highstate/designer 0.20.0 → 0.26.0

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 (240) hide show
  1. package/.output/nitro.json +4 -4
  2. package/.output/public/_nuxt/{BkNNRtnm.js → -aI73seg.js} +1 -1
  3. package/.output/public/_nuxt/32ctXXKs.js +1 -0
  4. package/.output/public/_nuxt/39D0VL7r.js +1 -0
  5. package/.output/public/_nuxt/{ByBNG4eo.js → 3T5CmBSF.js} +1 -1
  6. package/.output/public/_nuxt/4R6BJ3GI.js +1 -0
  7. package/.output/public/_nuxt/77UvFSdd.js +18 -0
  8. package/.output/public/_nuxt/{G13IRnB2.js → B0E2rEnI.js} +1 -1
  9. package/.output/public/_nuxt/B1x03f8R.js +1 -0
  10. package/.output/public/_nuxt/B2CVdECd.js +1 -0
  11. package/.output/public/_nuxt/{DWQRqdcR.js → B2_u9ZKl.js} +1 -1
  12. package/.output/public/_nuxt/{DCR009rv.js → B8uKU-iG.js} +1 -1
  13. package/.output/public/_nuxt/{CxEW7TG8.js → B9BJCsIg.js} +1 -1
  14. package/.output/public/_nuxt/BA47KaF1.js +1 -0
  15. package/.output/public/_nuxt/{DRfxs3PN.js → BBmoak6l.js} +1 -1
  16. package/.output/public/_nuxt/BEOSfHJT.js +1 -0
  17. package/.output/public/_nuxt/{D2aToa54.js → BJV0IIsR.js} +1 -1
  18. package/.output/public/_nuxt/{DCBCRx0O.js → BKaSp7fy.js} +1 -1
  19. package/.output/public/_nuxt/BN7gUcg9.js +1 -0
  20. package/.output/public/_nuxt/{DiTMzCP2.js → BOujskTX.js} +1 -1
  21. package/.output/public/_nuxt/{DJN0y8jO.js → BPboW4rx.js} +1 -1
  22. package/.output/public/_nuxt/{DzWdbJvx.js → BR4jrf3-.js} +1 -1
  23. package/.output/public/_nuxt/{9I37tBe7.js → BSRetNRl.js} +1 -1
  24. package/.output/public/_nuxt/{C1FLL1Qz.js → Ba9NwIJp.js} +1 -1
  25. package/.output/public/_nuxt/{DCinzvm1.js → BbWhHw7B.js} +1 -1
  26. package/.output/public/_nuxt/Bcyj9glE.js +6 -0
  27. package/.output/public/_nuxt/{xA6NntuA.js → Be4ezMZK.js} +1 -1
  28. package/.output/public/_nuxt/BeH2EWoN.js +1 -0
  29. package/.output/public/_nuxt/{CudFwYib.js → BgvYz3Nr.js} +1 -1
  30. package/.output/public/_nuxt/BlGDdimO.js +1 -0
  31. package/.output/public/_nuxt/{ZbicA1ry.js → Bn5R9WlL.js} +1 -1
  32. package/.output/public/_nuxt/{ChaZkl1J.js → BqJDg8iS.js} +1 -1
  33. package/.output/public/_nuxt/BxD6MFcJ.js +1 -0
  34. package/.output/public/_nuxt/{D27ZAKIj.js → BxvmPvww.js} +1 -1
  35. package/.output/public/_nuxt/{BEEt8Am7.js → By1Fxx6d.js} +1 -1
  36. package/.output/public/_nuxt/{xdsXwj_J.js → ByBXn3Vz.js} +1 -1
  37. package/.output/public/_nuxt/C1bzPMRu.js +14 -0
  38. package/.output/public/_nuxt/{CV5MeYf9.js → C29gnYT3.js} +1 -1
  39. package/.output/public/_nuxt/C5BYcBs_.js +1 -0
  40. package/.output/public/_nuxt/{ziXKbM2N.js → C5DRPdxC.js} +1 -1
  41. package/.output/public/_nuxt/{BJK6uMxG.js → C794qwo0.js} +1 -1
  42. package/.output/public/_nuxt/{RCBWmVHz.js → C9OJ0gQB.js} +1 -1
  43. package/.output/public/_nuxt/{B13uiJCv.js → C9n5vGW7.js} +1 -1
  44. package/.output/public/_nuxt/{rcFevLEP.js → CCBTuGSI.js} +2 -2
  45. package/.output/public/_nuxt/CENFIVCM.js +1 -0
  46. package/.output/public/_nuxt/{CzSiA7V6.js → CGLWlIpJ.js} +1 -1
  47. package/.output/public/_nuxt/CI40hKzv.js +2 -0
  48. package/.output/public/_nuxt/{CcOKGYBt.js → CLsyMJ1X.js} +1 -1
  49. package/.output/public/_nuxt/{CaJ-zn_Z.js → CNWyx-82.js} +1 -1
  50. package/.output/public/_nuxt/CRZrAKrA.js +2 -0
  51. package/.output/public/_nuxt/{BxaP9l2T.js → CRb2z3Pg.js} +1 -1
  52. package/.output/public/_nuxt/{BDAHnC4j.js → CWA5Cfde.js} +1 -1
  53. package/.output/public/_nuxt/CYpkKp66.js +1 -0
  54. package/.output/public/_nuxt/{n0RAZLbO.js → C_yayEmb.js} +1 -1
  55. package/.output/public/_nuxt/{rgN_MdZl.js → CaZj7sno.js} +1 -1
  56. package/.output/public/_nuxt/{CGscLIrv.js → CgK0fS9t.js} +1 -1
  57. package/.output/public/_nuxt/CiaugisX.js +1 -0
  58. package/.output/public/_nuxt/Cjs5trkS.js +1 -0
  59. package/.output/public/_nuxt/Cn-bp-IR.js +1 -0
  60. package/.output/public/_nuxt/CoqwalnO.js +2 -0
  61. package/.output/public/_nuxt/{d-NZQb9b.js → CscXh7Vy.js} +1 -1
  62. package/.output/public/_nuxt/{DQHHT9y-.js → CwWsKBf5.js} +1 -1
  63. package/.output/public/_nuxt/Cwefpg1x.js +1 -0
  64. package/.output/public/_nuxt/CxoCegAs.js +13 -0
  65. package/.output/public/_nuxt/{8MSfy8uY.js → CyFj-Mv9.js} +1 -1
  66. package/.output/public/_nuxt/Cz2AlsmD.js +1 -0
  67. package/.output/public/_nuxt/{tsyQDnRt.js → D1BdWMiq.js} +1 -1
  68. package/.output/public/_nuxt/D1yXAE_w.js +1 -0
  69. package/.output/public/_nuxt/{xp27HhqZ.js → D2lHwbtX.js} +1 -1
  70. package/.output/public/_nuxt/{DKhcu7kD.js → D46u9gXN.js} +1 -1
  71. package/.output/public/_nuxt/{CJWmG4YP.js → D4H6aUyZ.js} +7 -7
  72. package/.output/public/_nuxt/{Dg5xB15N.js → D82vCrfD.js} +1 -1
  73. package/.output/public/_nuxt/D8l8udqQ.js +1 -0
  74. package/.output/public/_nuxt/D9ITfHnZ.js +269 -0
  75. package/.output/public/_nuxt/{RNghxpo_.js → DDvzSYfr.js} +1 -1
  76. package/.output/public/_nuxt/{Aopv2gwH.js → DFwfZeyL.js} +1 -1
  77. package/.output/public/_nuxt/{GgtqCdye.js → DMM9kDc1.js} +1 -1
  78. package/.output/public/_nuxt/{DOPqH6_T.js → DNVXBFXP.js} +1 -1
  79. package/.output/public/_nuxt/DPOp833l.js +1 -0
  80. package/.output/public/_nuxt/{D2obegTF.js → DPQHj1GW.js} +1 -1
  81. package/.output/public/_nuxt/DRJZaHtK.js +1 -0
  82. package/.output/public/_nuxt/{BlfjmxyP.js → DRTFVhVr.js} +1 -1
  83. package/.output/public/_nuxt/{TsXTqZ29.js → DSeZwD4N.js} +1 -1
  84. package/.output/public/_nuxt/{C8lm7lgC.js → DTYY2tCY.js} +1 -1
  85. package/.output/public/_nuxt/{DWa2aw6r.js → DVKmRHSk.js} +1 -1
  86. package/.output/public/_nuxt/DYE7WIF3.js +1 -0
  87. package/.output/public/_nuxt/{D-wGZMZP.js → DYYyOkJe.js} +1 -1
  88. package/.output/public/_nuxt/{BCVaR2pQ.js → DcV32yum.js} +1 -1
  89. package/.output/public/_nuxt/DdhYQ3Tv.js +1 -0
  90. package/.output/public/_nuxt/DgsIRcX7.js +1 -0
  91. package/.output/public/_nuxt/{BtvRca6l.js → DjAJT7YJ.js} +1 -1
  92. package/.output/public/_nuxt/DmMgvbsF.js +1 -0
  93. package/.output/public/_nuxt/{pxXmJ8QX.js → DrQCNsTo.js} +1 -1
  94. package/.output/public/_nuxt/{DNqd6Nek.js → DvCXikgN.js} +1 -1
  95. package/.output/public/_nuxt/DzQULtcW.js +1 -0
  96. package/.output/public/_nuxt/{Cm-2nZ05.js → DzowYWbi.js} +1 -1
  97. package/.output/public/_nuxt/{DQwYQDb2.js → FtFNcQmh.js} +1 -1
  98. package/.output/public/_nuxt/{BPcwi1q2.js → I4u-TRO-.js} +1 -1
  99. package/.output/public/_nuxt/{D5z-4QVk.js → O3nsZ-Uz.js} +1 -1
  100. package/.output/public/_nuxt/Qj4UhtaN.js +1 -0
  101. package/.output/public/_nuxt/{BA0jw7CM.js → VF7GAmoY.js} +1 -1
  102. package/.output/public/_nuxt/Ve4PFQV2.js +1 -0
  103. package/.output/public/_nuxt/{xrNU8mHG.js → YpnHruhZ.js} +1 -1
  104. package/.output/public/_nuxt/_H4v1dQx.js +1 -0
  105. package/.output/public/_nuxt/_pageId_.C5KTkEfy.css +1 -0
  106. package/.output/public/_nuxt/_panelId_.CKSHyLNC.css +1 -0
  107. package/.output/public/_nuxt/builds/latest.json +1 -1
  108. package/.output/public/_nuxt/builds/meta/53add2c3-4d7c-4a4f-a116-e73c3787cf98.json +1 -0
  109. package/.output/public/_nuxt/components.a-P9dVi2.css +1 -0
  110. package/.output/public/_nuxt/{entry.Bc0aTA0K.css → entry.DsBbjDm-.css} +1 -1
  111. package/.output/public/_nuxt/eo99z4R2.js +1 -0
  112. package/.output/public/_nuxt/error-404.DnBTUElh.css +1 -0
  113. package/.output/public/_nuxt/error-500.BNyYF0qG.css +1 -0
  114. package/.output/public/_nuxt/{BUNf2Yb8.js → fbfpKHgl.js} +1 -1
  115. package/.output/public/_nuxt/{BDs6uo3D.js → fxmP1KZw.js} +1 -1
  116. package/.output/public/_nuxt/graph-resolver-DhjyrFRu.js +180 -0
  117. package/.output/public/_nuxt/{mUFnM-_q.js → hunqYsQf.js} +1 -1
  118. package/.output/public/_nuxt/iJghVVcV.js +1 -0
  119. package/.output/public/_nuxt/{DyMmfYiE.js → m4Sxwg8n.js} +1 -1
  120. package/.output/public/_nuxt/monaco-editor.DOXZIHvr.css +1 -0
  121. package/.output/public/_nuxt/oH_c3LbQ.js +1 -0
  122. package/.output/public/_nuxt/rZm6bMo-.js +1 -0
  123. package/.output/public/_nuxt/{DOMRsNpU.js → rpHuDh4d.js} +1 -1
  124. package/.output/public/_nuxt/{vuetify.BzdWZaIq.css → vuetify.DtnS3-VQ.css} +1 -1
  125. package/.output/public/_nuxt/{yaml.worker-C1Cl1y5J.js → yaml.worker-CYOhFCVP.js} +248 -252
  126. package/.output/server/index.mjs +3272 -7573
  127. package/.output/server/index.mjs.map +1 -1
  128. package/.output/server/node_modules/@babel/parser/lib/index.js +1 -1
  129. package/.output/server/node_modules/@babel/parser/package.json +1 -1
  130. package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.cjs +57 -0
  131. package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.mjs +2 -2
  132. package/.output/server/node_modules/@trpc/server/dist/codes-BfZsPdy-.cjs +222 -0
  133. package/.output/server/node_modules/@trpc/server/dist/{contentTypeParsers-SN4WL9ze.mjs → contentTypeParsers-iAFF_pJG.cjs} +7 -2
  134. package/.output/server/node_modules/@trpc/server/dist/getErrorShape-MR4DZeb7.cjs +341 -0
  135. package/.output/server/node_modules/@trpc/server/dist/http.cjs +14 -0
  136. package/.output/server/node_modules/@trpc/server/dist/index.cjs +22 -0
  137. package/.output/server/node_modules/@trpc/server/dist/index.mjs +2 -2
  138. package/.output/server/node_modules/@trpc/server/dist/{initTRPC-RoZMIBeA.mjs → initTRPC-B1ggxyJl.mjs} +2 -2
  139. package/.output/server/node_modules/@trpc/server/dist/initTRPC-BXPPV9Tx.cjs +416 -0
  140. package/.output/server/node_modules/@trpc/server/dist/observable/index.cjs +13 -0
  141. package/.output/server/node_modules/@trpc/server/dist/observable-B1Nk6r1H.cjs +181 -0
  142. package/.output/server/node_modules/@trpc/server/dist/{observable-CUiPknO-.mjs → observable-BVzLuBs6.cjs} +42 -8
  143. package/.output/server/node_modules/@trpc/server/dist/{parseTRPCMessage-CTow-umk.mjs → parseTRPCMessage-7Ltmq-Fb.cjs} +14 -4
  144. package/.output/server/node_modules/@trpc/server/dist/resolveResponse-B0CCg8nq.cjs +2365 -0
  145. package/.output/server/node_modules/@trpc/server/dist/{resolveResponse-BVDlNZwN.mjs → resolveResponse-C5I6V_wc.mjs} +67 -18
  146. package/.output/server/node_modules/@trpc/server/dist/rpc.cjs +6 -0
  147. package/.output/server/node_modules/@trpc/server/dist/{tracked-Bjtgv3wJ.mjs → tracked-DiE3uR1B.mjs} +12 -3
  148. package/.output/server/node_modules/@trpc/server/dist/tracked-Dj_dpOJE.cjs +486 -0
  149. package/.output/server/node_modules/@trpc/server/package.json +15 -5
  150. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +2 -2
  151. package/.output/server/node_modules/@vue/compiler-core/package.json +3 -3
  152. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +1 -1
  153. package/.output/server/node_modules/@vue/compiler-dom/package.json +3 -3
  154. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1 -1
  155. package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
  156. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +31 -13
  157. package/.output/server/node_modules/@vue/reactivity/package.json +2 -2
  158. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +144 -81
  159. package/.output/server/node_modules/@vue/runtime-core/package.json +3 -3
  160. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +70 -9
  161. package/.output/server/node_modules/@vue/runtime-dom/package.json +4 -4
  162. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +6 -2
  163. package/.output/server/node_modules/@vue/server-renderer/package.json +4 -4
  164. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +1 -1
  165. package/.output/server/node_modules/@vue/shared/package.json +1 -1
  166. package/.output/server/node_modules/devalue/package.json +5 -2
  167. package/.output/server/node_modules/devalue/src/base64.js +46 -96
  168. package/.output/server/node_modules/devalue/src/parse.js +32 -10
  169. package/.output/server/node_modules/devalue/src/stringify.js +13 -28
  170. package/.output/server/node_modules/devalue/src/uneval.js +117 -55
  171. package/.output/server/node_modules/devalue/src/utils.js +3 -7
  172. package/.output/server/node_modules/hookable/dist/index.mjs +5 -14
  173. package/.output/server/node_modules/hookable/package.json +24 -23
  174. package/.output/server/node_modules/trpc-bun-adapter/dist/index.js +406 -0
  175. package/.output/server/node_modules/trpc-bun-adapter/package.json +44 -0
  176. package/.output/server/node_modules/unhead/dist/plugins.mjs +3 -3
  177. package/.output/server/node_modules/unhead/dist/server.mjs +2 -2
  178. package/.output/server/node_modules/unhead/dist/shared/{unhead.eK9_7LaY.mjs → unhead.B5FWS6X0.mjs} +22 -13
  179. package/.output/server/node_modules/unhead/dist/shared/{unhead.BFfcxOoW.mjs → unhead.Ct24BOby.mjs} +4 -2
  180. package/.output/server/node_modules/unhead/dist/shared/unhead.D4vSFytZ.mjs +236 -0
  181. package/.output/server/node_modules/unhead/dist/shared/{unhead.ckV6dpEQ.mjs → unhead.TxTMM7cM.mjs} +1 -1
  182. package/.output/server/node_modules/unhead/dist/utils.mjs +1 -1
  183. package/.output/server/node_modules/unhead/package.json +1 -1
  184. package/.output/server/node_modules/vue/dist/vue.cjs.js +1 -1
  185. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +1 -1
  186. package/.output/server/node_modules/vue/package.json +7 -7
  187. package/.output/server/node_modules/ws/lib/permessage-deflate.js +6 -6
  188. package/.output/server/node_modules/ws/lib/websocket-server.js +5 -5
  189. package/.output/server/node_modules/ws/lib/websocket.js +6 -6
  190. package/.output/server/node_modules/ws/package.json +4 -3
  191. package/.output/server/node_modules/ws/wrapper.mjs +14 -1
  192. package/.output/server/package.json +17 -16
  193. package/package.json +20 -14
  194. package/.output/public/_nuxt/57B6Rca8.js +0 -1
  195. package/.output/public/_nuxt/83L43bj1.js +0 -1
  196. package/.output/public/_nuxt/B8nw2aST.js +0 -2
  197. package/.output/public/_nuxt/B93PlW-d.js +0 -1
  198. package/.output/public/_nuxt/BDa1f6PF.js +0 -2
  199. package/.output/public/_nuxt/BE_Meo09.js +0 -269
  200. package/.output/public/_nuxt/BLF3u89x.js +0 -1
  201. package/.output/public/_nuxt/Ba13S78F.js +0 -1
  202. package/.output/public/_nuxt/BhRPY-oY.js +0 -1
  203. package/.output/public/_nuxt/Bhrxn6JZ.js +0 -1
  204. package/.output/public/_nuxt/Bo8jzlL1.js +0 -18
  205. package/.output/public/_nuxt/BpkvlDNi.js +0 -1
  206. package/.output/public/_nuxt/BrzmwbiE.js +0 -1
  207. package/.output/public/_nuxt/BuJgCY_C.js +0 -1
  208. package/.output/public/_nuxt/C-sUppwS.js +0 -1
  209. package/.output/public/_nuxt/C47S-Tmv.js +0 -1
  210. package/.output/public/_nuxt/CMjwMIkn.js +0 -1
  211. package/.output/public/_nuxt/CPZSvMBB.js +0 -1
  212. package/.output/public/_nuxt/CPpO8vcZ.js +0 -1
  213. package/.output/public/_nuxt/CQ8jqdy-.js +0 -1
  214. package/.output/public/_nuxt/CjoLj4QM.js +0 -1
  215. package/.output/public/_nuxt/D6fh7rEe.js +0 -2
  216. package/.output/public/_nuxt/D91rOou-.js +0 -13
  217. package/.output/public/_nuxt/DMwsHuHA.js +0 -1
  218. package/.output/public/_nuxt/DYoxhk2S.js +0 -1
  219. package/.output/public/_nuxt/Dbwml2gB.js +0 -1
  220. package/.output/public/_nuxt/DsS90Fp6.js +0 -1
  221. package/.output/public/_nuxt/Dv7Oe6Be.js +0 -1
  222. package/.output/public/_nuxt/DxERyYWQ.js +0 -1
  223. package/.output/public/_nuxt/GDxZ_Nvm.js +0 -14
  224. package/.output/public/_nuxt/VCDPK7BO.js +0 -1
  225. package/.output/public/_nuxt/builds/meta/a1fec520-0c95-4ae0-af5e-964780fad341.json +0 -1
  226. package/.output/public/_nuxt/components.CIe9upZ4.css +0 -1
  227. package/.output/public/_nuxt/error-404.X7H_YhdC.css +0 -1
  228. package/.output/public/_nuxt/error-500.BOQe1fsk.css +0 -1
  229. package/.output/public/_nuxt/f3TOpYbw.js +0 -1
  230. package/.output/public/_nuxt/graph-resolver-DKNtntr2.js +0 -180
  231. package/.output/public/_nuxt/monaco-editor.D_J4ItrK.css +0 -1
  232. package/.output/public/_nuxt/o_m1mZtJ.js +0 -6
  233. package/.output/server/node_modules/@trpc/server/dist/adapters/ws.mjs +0 -15
  234. package/.output/server/node_modules/@trpc/server/dist/node-http-DtA2iLK9.mjs +0 -224
  235. package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import-9NNw8uQM.mjs +0 -31
  236. package/.output/server/node_modules/@trpc/server/dist/ws-CJgZE7Hg.mjs +0 -460
  237. package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +0 -148
  238. package/LICENSE +0 -21
  239. /package/.output/public/_nuxt/{XEA9GSJd.js → B69Z0Xk1.js} +0 -0
  240. /package/.output/server/node_modules/@trpc/server/dist/{http-CWyjOa1l.mjs → http-DXy3XyhL.cjs} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { __commonJS, __toESM, getErrorShape, getHTTPStatusCode, require_defineProperty, require_objectSpread2 } from "./getErrorShape-vC8mUXJD.mjs";
2
2
  import { abortSignalsAnyPonyfill, emptyObject, identity, isAsyncIterable, isFunction, isObject, run } from "./codes-DagpWZLc.mjs";
3
- import { TRPCError, getProcedureAtPath, getTRPCErrorFromUnknown, isTrackedEnvelope, transformTRPCResponse } from "./tracked-Bjtgv3wJ.mjs";
3
+ import { TRPCError, getProcedureAtPath, getTRPCErrorFromUnknown, isTrackedEnvelope, transformTRPCResponse } from "./tracked-DiE3uR1B.mjs";
4
4
  import { isObservable, observableToAsyncIterable } from "./observable-UMO3vUa_.mjs";
5
5
 
6
6
  //#region src/unstable-core-do-not-import/http/parseConnectionParams.ts
@@ -36,6 +36,10 @@ function parseConnectionParamsFromString(str) {
36
36
  //#endregion
37
37
  //#region src/unstable-core-do-not-import/http/contentType.ts
38
38
  var import_objectSpread2$1 = __toESM(require_objectSpread2(), 1);
39
+ function getAcceptHeader(headers) {
40
+ var _ref, _headers$get;
41
+ return (_ref = headers.get("trpc-accept")) !== null && _ref !== void 0 ? _ref : ((_headers$get = headers.get("accept")) === null || _headers$get === void 0 ? void 0 : _headers$get.split(",").some((t) => t.trim() === "application/jsonl")) ? "application/jsonl" : null;
42
+ }
39
43
  /**
40
44
  * Memoize a function that takes no arguments
41
45
  * @internal
@@ -74,7 +78,12 @@ const jsonContentTypeHandler = {
74
78
  var _types$values$next$va;
75
79
  const { req } = opts;
76
80
  const isBatchCall = opts.searchParams.get("batch") === "1";
81
+ const maxBatchSize = opts.maxBatchSize;
77
82
  const paths = isBatchCall ? opts.path.split(",") : [opts.path];
83
+ if (isBatchCall && typeof maxBatchSize === "number" && paths.length > maxBatchSize) throw new TRPCError({
84
+ code: "BAD_REQUEST",
85
+ message: `Batch call exceeds maximum size`
86
+ });
78
87
  const getInputs = memo(async () => {
79
88
  let inputs = void 0;
80
89
  if (req.method === "GET") {
@@ -108,8 +117,8 @@ const jsonContentTypeHandler = {
108
117
  const inputs = await getInputs.read();
109
118
  let input = inputs[index];
110
119
  if ((procedure === null || procedure === void 0 ? void 0 : procedure._def.type) === "subscription") {
111
- var _ref, _opts$headers$get;
112
- const lastEventId = (_ref = (_opts$headers$get = opts.headers.get("last-event-id")) !== null && _opts$headers$get !== void 0 ? _opts$headers$get : opts.searchParams.get("lastEventId")) !== null && _ref !== void 0 ? _ref : opts.searchParams.get("Last-Event-Id");
120
+ var _ref2, _opts$headers$get;
121
+ const lastEventId = (_ref2 = (_opts$headers$get = opts.headers.get("last-event-id")) !== null && _opts$headers$get !== void 0 ? _opts$headers$get : opts.searchParams.get("lastEventId")) !== null && _ref2 !== void 0 ? _ref2 : opts.searchParams.get("Last-Event-Id");
113
122
  if (lastEventId) if (isObject(input)) input = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, input), {}, { lastEventId });
114
123
  else {
115
124
  var _input;
@@ -137,7 +146,7 @@ const jsonContentTypeHandler = {
137
146
  const connectionParamsStr = opts.searchParams.get("connectionParams");
138
147
  const info = {
139
148
  isBatchCall,
140
- accept: req.headers.get("trpc-accept"),
149
+ accept: getAcceptHeader(req.headers),
141
150
  calls,
142
151
  type,
143
152
  connectionParams: connectionParamsStr === null ? null : parseConnectionParamsFromString(connectionParamsStr),
@@ -1358,9 +1367,16 @@ function createStreamsManager(abortController) {
1358
1367
  function cancelAll(reason) {
1359
1368
  for (const controller of controllerMap.values()) controller.error(reason);
1360
1369
  }
1370
+ /**
1371
+ * Closes all pending controllers to preserve buffered data
1372
+ */
1373
+ function closeAll() {
1374
+ for (const controller of controllerMap.values()) controller.close();
1375
+ }
1361
1376
  return {
1362
1377
  getOrCreate,
1363
- cancelAll
1378
+ cancelAll,
1379
+ closeAll
1364
1380
  };
1365
1381
  }
1366
1382
  /**
@@ -1432,8 +1448,16 @@ async function jsonlStreamConsumer(opts) {
1432
1448
  }
1433
1449
  return data;
1434
1450
  }
1435
- const closeOrAbort = (reason) => {
1451
+ const handleClose = () => {
1452
+ if (headDeferred) {
1453
+ headDeferred.reject(new Error("Stream closed before head was received"));
1454
+ headDeferred = null;
1455
+ }
1456
+ streamManager.closeAll();
1457
+ };
1458
+ const handleAbort = (reason) => {
1436
1459
  headDeferred === null || headDeferred === void 0 || headDeferred.reject(reason);
1460
+ headDeferred = null;
1437
1461
  streamManager.cancelAll(reason);
1438
1462
  };
1439
1463
  source.pipeTo(new WritableStream({
@@ -1453,12 +1477,12 @@ async function jsonlStreamConsumer(opts) {
1453
1477
  const controller = streamManager.getOrCreate(idx);
1454
1478
  controller.enqueue(chunk);
1455
1479
  },
1456
- close: closeOrAbort,
1457
- abort: closeOrAbort
1480
+ close: handleClose,
1481
+ abort: handleAbort
1458
1482
  })).catch((error) => {
1459
1483
  var _opts$onError4;
1460
1484
  (_opts$onError4 = opts.onError) === null || _opts$onError4 === void 0 || _opts$onError4.call(opts, { error });
1461
- closeOrAbort(error);
1485
+ handleAbort(error);
1462
1486
  });
1463
1487
  return [await headDeferred.promise];
1464
1488
  }
@@ -1849,7 +1873,7 @@ function isDataStream(v) {
1849
1873
  async function resolveResponse(opts) {
1850
1874
  var _ref, _opts$allowBatching, _opts$batching, _opts$allowMethodOver, _config$sse$enabled, _config$sse;
1851
1875
  const { router, req } = opts;
1852
- const headers = new Headers([["vary", "trpc-accept"]]);
1876
+ const headers = new Headers([["vary", "trpc-accept, accept"]]);
1853
1877
  const config = router._def._config;
1854
1878
  const url = new URL(req.url);
1855
1879
  if (req.method === "HEAD") return new Response(null, { status: 204 });
@@ -1863,7 +1887,8 @@ async function resolveResponse(opts) {
1863
1887
  router,
1864
1888
  searchParams: url.searchParams,
1865
1889
  headers: opts.req.headers,
1866
- url
1890
+ url,
1891
+ maxBatchSize: opts.maxBatchSize
1867
1892
  })];
1868
1893
  } catch (cause) {
1869
1894
  return [getTRPCErrorFromUnknown(cause), void 0];
@@ -1896,7 +1921,7 @@ async function resolveResponse(opts) {
1896
1921
  /**
1897
1922
  * @deprecated
1898
1923
  */
1899
- const isStreamCall = req.headers.get("trpc-accept") === "application/jsonl";
1924
+ const isStreamCall = getAcceptHeader(req.headers) === "application/jsonl";
1900
1925
  const experimentalSSE = (_config$sse$enabled = (_config$sse = config.sse) === null || _config$sse === void 0 ? void 0 : _config$sse.enabled) !== null && _config$sse$enabled !== void 0 ? _config$sse$enabled : true;
1901
1926
  try {
1902
1927
  const [infoError, info] = infoTuple;
@@ -1949,7 +1974,10 @@ async function resolveResponse(opts) {
1949
1974
  signal: combinedAbort.signal,
1950
1975
  batchIndex: call.batchIndex
1951
1976
  });
1952
- return [void 0, { data }];
1977
+ return [void 0, {
1978
+ data,
1979
+ signal: proc._def.type === "subscription" ? combinedAbort.signal : void 0
1980
+ }];
1953
1981
  } catch (cause) {
1954
1982
  var _opts$onError, _call$procedure$_def$, _call$procedure2;
1955
1983
  const error = getTRPCErrorFromUnknown(cause);
@@ -2049,7 +2077,28 @@ async function resolveResponse(opts) {
2049
2077
  headers,
2050
2078
  untransformedJSON: null
2051
2079
  });
2052
- return new Response(stream, {
2080
+ const abortSignal = result === null || result === void 0 ? void 0 : result.signal;
2081
+ let responseBody = stream;
2082
+ if (abortSignal) {
2083
+ const reader = stream.getReader();
2084
+ const onAbort = () => void reader.cancel();
2085
+ if (abortSignal.aborted) onAbort();
2086
+ else abortSignal.addEventListener("abort", onAbort, { once: true });
2087
+ responseBody = new ReadableStream({
2088
+ async pull(controller) {
2089
+ const chunk = await reader.read();
2090
+ if (chunk.done) {
2091
+ abortSignal.removeEventListener("abort", onAbort);
2092
+ controller.close();
2093
+ } else controller.enqueue(chunk.value);
2094
+ },
2095
+ cancel() {
2096
+ abortSignal.removeEventListener("abort", onAbort);
2097
+ return reader.cancel();
2098
+ }
2099
+ });
2100
+ }
2101
+ return new Response(responseBody, {
2053
2102
  headers,
2054
2103
  status: headResponse$1.status
2055
2104
  });
@@ -2069,9 +2118,9 @@ async function resolveResponse(opts) {
2069
2118
  });
2070
2119
  const stream = jsonlStreamProducer((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, config.jsonl), {}, {
2071
2120
  maxDepth: Infinity,
2072
- data: rpcCalls.map(async (res) => {
2121
+ data: rpcCalls.map(async (res, index) => {
2073
2122
  const [error, result] = await res;
2074
- const call = info.calls[0];
2123
+ const call = info.calls[index];
2075
2124
  if (error) {
2076
2125
  var _procedure$_def$type, _procedure;
2077
2126
  return { error: getErrorShape({
@@ -2194,5 +2243,5 @@ async function resolveResponse(opts) {
2194
2243
  }
2195
2244
 
2196
2245
  //#endregion
2197
- export { Unpromise, createDeferred, getRequestInfo, isAbortError, isPromise, iteratorResource, jsonlStreamConsumer, jsonlStreamProducer, makeAsyncResource, makeResource, parseConnectionParamsFromString, parseConnectionParamsFromUnknown, require_usingCtx, resolveResponse, sseHeaders, sseStreamConsumer, sseStreamProducer, takeWithGrace, throwAbortError };
2198
- //# sourceMappingURL=resolveResponse-BVDlNZwN.mjs.map
2246
+ export { Unpromise, createDeferred, getAcceptHeader, getRequestInfo, isAbortError, isPromise, iteratorResource, jsonlStreamConsumer, jsonlStreamProducer, makeAsyncResource, makeResource, parseConnectionParamsFromString, parseConnectionParamsFromUnknown, require_usingCtx, resolveResponse, sseHeaders, sseStreamConsumer, sseStreamProducer, takeWithGrace, throwAbortError };
2247
+ //# sourceMappingURL=resolveResponse-C5I6V_wc.mjs.map
@@ -0,0 +1,6 @@
1
+ const require_codes = require('./codes-BfZsPdy-.cjs');
2
+ const require_parseTRPCMessage = require('./parseTRPCMessage-7Ltmq-Fb.cjs');
3
+
4
+ exports.TRPC_ERROR_CODES_BY_KEY = require_codes.TRPC_ERROR_CODES_BY_KEY;
5
+ exports.TRPC_ERROR_CODES_BY_NUMBER = require_codes.TRPC_ERROR_CODES_BY_NUMBER;
6
+ exports.parseTRPCMessage = require_parseTRPCMessage.parseTRPCMessage;
@@ -9,13 +9,22 @@ const defaultFormatter = ({ shape }) => {
9
9
  //#endregion
10
10
  //#region src/unstable-core-do-not-import/error/TRPCError.ts
11
11
  var import_defineProperty = __toESM(require_defineProperty(), 1);
12
- var UnknownCauseError = class extends Error {};
12
+ var UnknownCauseError = class extends Error {
13
+ constructor(cause) {
14
+ super(getMessage(cause));
15
+ Object.assign(this, cause);
16
+ }
17
+ };
18
+ function getMessage(cause) {
19
+ if ("message" in cause) return String(cause.message);
20
+ return void 0;
21
+ }
13
22
  function getCauseFromUnknown(cause) {
14
23
  if (cause instanceof Error) return cause;
15
24
  const type = typeof cause;
16
25
  if (type === "undefined" || type === "function" || cause === null) return void 0;
17
26
  if (type !== "object") return new Error(String(cause));
18
- if (isObject(cause)) return Object.assign(new UnknownCauseError(), cause);
27
+ if (isObject(cause)) return new UnknownCauseError(cause);
19
28
  return void 0;
20
29
  }
21
30
  function getTRPCErrorFromUnknown(cause) {
@@ -374,4 +383,4 @@ function tracked(id, data) {
374
383
 
375
384
  //#endregion
376
385
  export { TRPCError, callProcedure, createCallerFactory, createRouterFactory, defaultFormatter, defaultTransformer, getCauseFromUnknown, getDataTransformer, getProcedureAtPath, getTRPCErrorFromUnknown, isTrackedEnvelope, lazy, mergeRouters, sse, tracked, transformResult, transformTRPCResponse };
377
- //# sourceMappingURL=tracked-Bjtgv3wJ.mjs.map
386
+ //# sourceMappingURL=tracked-DiE3uR1B.mjs.map