@graphrefly/ts 0.0.0 → 0.0.2

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 (405) hide show
  1. package/README.md +135 -0
  2. package/dist/actions-types-CSC3NMDl.d.ts +657 -0
  3. package/dist/actions-types-wl9Mgkmr.d.cts +657 -0
  4. package/dist/adapters/index.cjs +5219 -2974
  5. package/dist/adapters/index.cjs.map +1 -1
  6. package/dist/adapters/index.d.cts +204 -192
  7. package/dist/adapters/index.d.ts +204 -192
  8. package/dist/adapters/index.js +3685 -1833
  9. package/dist/adapters/index.js.map +1 -1
  10. package/dist/adapters/nestjs/microservices.cjs +841 -0
  11. package/dist/adapters/nestjs/microservices.cjs.map +1 -0
  12. package/dist/adapters/nestjs/microservices.d.cts +45 -0
  13. package/dist/adapters/nestjs/microservices.d.ts +45 -0
  14. package/dist/adapters/nestjs/microservices.js +206 -0
  15. package/dist/adapters/nestjs/microservices.js.map +1 -0
  16. package/dist/adapters/nestjs/native.cjs +1391 -0
  17. package/dist/adapters/nestjs/native.cjs.map +1 -0
  18. package/dist/adapters/nestjs/native.d.cts +111 -0
  19. package/dist/adapters/nestjs/native.d.ts +111 -0
  20. package/dist/adapters/nestjs/native.js +577 -0
  21. package/dist/adapters/nestjs/native.js.map +1 -0
  22. package/dist/adapters/nestjs/websockets.cjs +924 -0
  23. package/dist/adapters/nestjs/websockets.cjs.map +1 -0
  24. package/dist/adapters/nestjs/websockets.d.cts +47 -0
  25. package/dist/adapters/nestjs/websockets.d.ts +47 -0
  26. package/dist/adapters/nestjs/websockets.js +286 -0
  27. package/dist/adapters/nestjs/websockets.js.map +1 -0
  28. package/dist/adapters/nestjs.cjs +1085 -0
  29. package/dist/adapters/nestjs.cjs.map +1 -0
  30. package/dist/adapters/nestjs.d.cts +385 -0
  31. package/dist/adapters/nestjs.d.ts +385 -0
  32. package/dist/adapters/nestjs.js +112 -0
  33. package/dist/adapters/nestjs.js.map +1 -0
  34. package/dist/adapters/observe-storage.d.cts +4 -4
  35. package/dist/adapters/observe-storage.d.ts +4 -4
  36. package/dist/adapters/observe-storage.js +5 -4
  37. package/dist/adapters/observe-storage.js.map +1 -1
  38. package/dist/adapters/react.cjs +166 -0
  39. package/dist/adapters/react.cjs.map +1 -0
  40. package/dist/adapters/react.d.cts +31 -0
  41. package/dist/adapters/react.d.ts +31 -0
  42. package/dist/adapters/react.js +51 -0
  43. package/dist/adapters/react.js.map +1 -0
  44. package/dist/adapters/solid.cjs +157 -0
  45. package/dist/adapters/solid.cjs.map +1 -0
  46. package/dist/adapters/solid.d.cts +26 -0
  47. package/dist/adapters/solid.d.ts +26 -0
  48. package/dist/adapters/solid.js +48 -0
  49. package/dist/adapters/solid.js.map +1 -0
  50. package/dist/adapters/svelte.cjs +148 -0
  51. package/dist/adapters/svelte.cjs.map +1 -0
  52. package/dist/adapters/svelte.d.cts +31 -0
  53. package/dist/adapters/svelte.d.ts +31 -0
  54. package/dist/adapters/svelte.js +46 -0
  55. package/dist/adapters/svelte.js.map +1 -0
  56. package/dist/adapters/vue.cjs +155 -0
  57. package/dist/adapters/vue.cjs.map +1 -0
  58. package/dist/adapters/vue.d.cts +26 -0
  59. package/dist/adapters/vue.d.ts +26 -0
  60. package/dist/adapters/vue.js +46 -0
  61. package/dist/adapters/vue.js.map +1 -0
  62. package/dist/agent-runtime-types-core-CaXfKNtY.d.cts +406 -0
  63. package/dist/agent-runtime-types-core-hU299uIC.d.ts +406 -0
  64. package/dist/agent-runtime-types-tool-BEpSINol.d.ts +695 -0
  65. package/dist/agent-runtime-types-tool-DninPEzk.d.cts +695 -0
  66. package/dist/agentic-memory-retention-BmGX368S.d.ts +14 -0
  67. package/dist/agentic-memory-retention-Ih1qhX9Z.d.cts +14 -0
  68. package/dist/agentic-memory-types-CVSUS6XR.d.ts +473 -0
  69. package/dist/agentic-memory-types-FnnYlVUs.d.cts +473 -0
  70. package/dist/capability-admission-BW2CziT6.d.ts +102 -0
  71. package/dist/capability-admission-lwSecxXs.d.cts +102 -0
  72. package/dist/chunk-2KUAG2GZ.js +9693 -0
  73. package/dist/chunk-2KUAG2GZ.js.map +1 -0
  74. package/dist/chunk-2NJP6GO4.js +1320 -0
  75. package/dist/chunk-2NJP6GO4.js.map +1 -0
  76. package/dist/{chunk-GDL26N2T.js → chunk-3KN7NJDR.js} +2 -2
  77. package/dist/{chunk-COHO25CZ.js → chunk-4NWSNI4K.js} +2232 -1672
  78. package/dist/chunk-4NWSNI4K.js.map +1 -0
  79. package/dist/{chunk-Z2ANQ6JW.js → chunk-4Q77MMJY.js} +2 -2
  80. package/dist/chunk-6E76H4OU.js +132 -0
  81. package/dist/chunk-6E76H4OU.js.map +1 -0
  82. package/dist/chunk-7GOTIIQ7.js +819 -0
  83. package/dist/chunk-7GOTIIQ7.js.map +1 -0
  84. package/dist/{chunk-D6BG7U6A.js → chunk-7HZRJMN6.js} +3 -3
  85. package/dist/{chunk-SCRFRCGR.js → chunk-BSQGE5PS.js} +1 -1
  86. package/dist/{chunk-PKVBHGBM.js → chunk-CJIFGJQG.js} +7 -7
  87. package/dist/{chunk-G4M3NHRJ.js → chunk-CX6B6PO2.js} +93 -10
  88. package/dist/chunk-CX6B6PO2.js.map +1 -0
  89. package/dist/chunk-DGUM43GV.js +11 -0
  90. package/dist/chunk-DGUM43GV.js.map +1 -0
  91. package/dist/{chunk-JIMUDQN3.js → chunk-E4QCH32M.js} +449 -447
  92. package/dist/chunk-E4QCH32M.js.map +1 -0
  93. package/dist/{chunk-RIIOUTGM.js → chunk-ECURQ3HD.js} +19 -129
  94. package/dist/chunk-ECURQ3HD.js.map +1 -0
  95. package/dist/{chunk-2ILL7HQI.js → chunk-EOKT4QFF.js} +134 -128
  96. package/dist/chunk-EOKT4QFF.js.map +1 -0
  97. package/dist/{chunk-K3FXTC3I.js → chunk-HJACH5PU.js} +3 -3
  98. package/dist/{chunk-GTPCOEOZ.js → chunk-IDMLXLLG.js} +3 -3
  99. package/dist/{chunk-DKP56CSW.js → chunk-JKAYLDQV.js} +2 -2
  100. package/dist/{chunk-4VLAQHZI.js → chunk-K7FB3JTD.js} +17 -1
  101. package/dist/chunk-K7FB3JTD.js.map +1 -0
  102. package/dist/chunk-L6LDXRWE.js +219 -0
  103. package/dist/chunk-L6LDXRWE.js.map +1 -0
  104. package/dist/chunk-M7J6Z4IJ.js +1930 -0
  105. package/dist/chunk-M7J6Z4IJ.js.map +1 -0
  106. package/dist/chunk-MQEQMS7B.js +1009 -0
  107. package/dist/chunk-MQEQMS7B.js.map +1 -0
  108. package/dist/chunk-MTELVIYR.js +1421 -0
  109. package/dist/chunk-MTELVIYR.js.map +1 -0
  110. package/dist/chunk-PVC7WDKI.js +885 -0
  111. package/dist/chunk-PVC7WDKI.js.map +1 -0
  112. package/dist/chunk-RAHNUYA5.js +368 -0
  113. package/dist/chunk-RAHNUYA5.js.map +1 -0
  114. package/dist/{chunk-DK554R7P.js → chunk-S6HXABGL.js} +2 -1
  115. package/dist/chunk-S6HXABGL.js.map +1 -0
  116. package/dist/{chunk-I3IHOHCJ.js → chunk-SHZDP2MQ.js} +1181 -1001
  117. package/dist/chunk-SHZDP2MQ.js.map +1 -0
  118. package/dist/{chunk-Y3ZLRGHC.js → chunk-SIDJO2T4.js} +16 -16
  119. package/dist/chunk-STXRMPW4.js +4131 -0
  120. package/dist/chunk-STXRMPW4.js.map +1 -0
  121. package/dist/{chunk-JR4IKCR2.js → chunk-TPND5MJS.js} +5 -5
  122. package/dist/chunk-TQPCAIQI.js +612 -0
  123. package/dist/chunk-TQPCAIQI.js.map +1 -0
  124. package/dist/chunk-UT3MHJCW.js +49 -0
  125. package/dist/chunk-UT3MHJCW.js.map +1 -0
  126. package/dist/{chunk-TEW47IVR.js → chunk-VPEFSDME.js} +2 -2
  127. package/dist/{chunk-SWTLEQL6.js → chunk-WQIA3GFB.js} +2 -2
  128. package/dist/chunk-WQIA3GFB.js.map +1 -0
  129. package/dist/{chunk-DJC4CHLQ.js → chunk-YDWBXXQZ.js} +5 -5
  130. package/dist/{chunk-6PHB5CJS.js → chunk-ZLFRB6FI.js} +2 -2
  131. package/dist/composition/index.cjs +1256 -1059
  132. package/dist/composition/index.cjs.map +1 -1
  133. package/dist/composition/index.d.cts +4 -4
  134. package/dist/composition/index.d.ts +4 -4
  135. package/dist/composition/index.js +7 -6
  136. package/dist/core/index.cjs +1218 -1021
  137. package/dist/core/index.cjs.map +1 -1
  138. package/dist/core/index.d.cts +2 -2
  139. package/dist/core/index.d.ts +2 -2
  140. package/dist/core/index.js +5 -4
  141. package/dist/cqrs/index.cjs.map +1 -1
  142. package/dist/cqrs/index.d.cts +4 -4
  143. package/dist/cqrs/index.d.ts +4 -4
  144. package/dist/cqrs/index.js +3 -2
  145. package/dist/cqrs/index.js.map +1 -1
  146. package/dist/cqrs/messaging.cjs +312 -0
  147. package/dist/cqrs/messaging.cjs.map +1 -0
  148. package/dist/cqrs/messaging.d.cts +57 -0
  149. package/dist/cqrs/messaging.d.ts +57 -0
  150. package/dist/cqrs/messaging.js +274 -0
  151. package/dist/cqrs/messaging.js.map +1 -0
  152. package/dist/cqrs/work-queue.cjs +329 -0
  153. package/dist/cqrs/work-queue.cjs.map +1 -0
  154. package/dist/cqrs/work-queue.d.cts +90 -0
  155. package/dist/cqrs/work-queue.d.ts +90 -0
  156. package/dist/cqrs/work-queue.js +292 -0
  157. package/dist/cqrs/work-queue.js.map +1 -0
  158. package/dist/data/index.cjs +19 -0
  159. package/dist/data/index.cjs.map +1 -0
  160. package/dist/data/index.d.cts +36 -0
  161. package/dist/data/index.d.ts +36 -0
  162. package/dist/data/index.js +1 -0
  163. package/dist/data/index.js.map +1 -0
  164. package/dist/data-structures/index.cjs +1252 -1052
  165. package/dist/data-structures/index.cjs.map +1 -1
  166. package/dist/data-structures/index.d.cts +9 -8
  167. package/dist/data-structures/index.d.ts +9 -8
  168. package/dist/data-structures/index.js +9 -7
  169. package/dist/{describe-BZb7AS2y.d.ts → describe-B_A5fbXH.d.ts} +1 -1
  170. package/dist/{describe-Ciu8SUnN.d.cts → describe-CQRrkv-Q.d.cts} +1 -1
  171. package/dist/executors/tool-provider-adapters.cjs +3091 -0
  172. package/dist/executors/tool-provider-adapters.cjs.map +1 -0
  173. package/dist/executors/tool-provider-adapters.d.cts +174 -0
  174. package/dist/executors/tool-provider-adapters.d.ts +174 -0
  175. package/dist/executors/tool-provider-adapters.js +1336 -0
  176. package/dist/executors/tool-provider-adapters.js.map +1 -0
  177. package/dist/executors/tool-provider-runtime.cjs +5178 -0
  178. package/dist/executors/tool-provider-runtime.cjs.map +1 -0
  179. package/dist/executors/tool-provider-runtime.d.cts +17 -0
  180. package/dist/executors/tool-provider-runtime.d.ts +17 -0
  181. package/dist/executors/tool-provider-runtime.js +15 -0
  182. package/dist/executors/tool-provider-runtime.js.map +1 -0
  183. package/dist/executors/tool-provider.cjs +6392 -0
  184. package/dist/executors/tool-provider.cjs.map +1 -0
  185. package/dist/executors/tool-provider.d.cts +60 -0
  186. package/dist/executors/tool-provider.d.ts +60 -0
  187. package/dist/executors/tool-provider.js +89 -0
  188. package/dist/executors/tool-provider.js.map +1 -0
  189. package/dist/executors/work-queue.cjs +342 -0
  190. package/dist/executors/work-queue.cjs.map +1 -0
  191. package/dist/executors/work-queue.d.cts +90 -0
  192. package/dist/executors/work-queue.d.ts +90 -0
  193. package/dist/executors/work-queue.js +306 -0
  194. package/dist/executors/work-queue.js.map +1 -0
  195. package/dist/graph/index.cjs +1536 -1324
  196. package/dist/graph/index.cjs.map +1 -1
  197. package/dist/graph/index.d.cts +10 -9
  198. package/dist/graph/index.d.ts +10 -9
  199. package/dist/graph/index.js +22 -20
  200. package/dist/{graph-s23RbbFO.d.cts → graph-CWK3HLPB.d.cts} +134 -132
  201. package/dist/{graph-DfdF9zy4.d.ts → graph-ho5sotHP.d.ts} +134 -132
  202. package/dist/{index-SnzZu3x7.d.ts → index-CQWcE0Dw.d.ts} +18 -4
  203. package/dist/{index-CAEmLCYF.d.cts → index-DHA1i67c.d.cts} +18 -4
  204. package/dist/index.cjs +3331 -3020
  205. package/dist/index.cjs.map +1 -1
  206. package/dist/index.d.cts +14 -10
  207. package/dist/index.d.ts +14 -10
  208. package/dist/index.js +114 -108
  209. package/dist/inspection/boundary.cjs +98 -0
  210. package/dist/inspection/boundary.cjs.map +1 -0
  211. package/dist/inspection/boundary.d.cts +61 -0
  212. package/dist/inspection/boundary.d.ts +61 -0
  213. package/dist/inspection/boundary.js +75 -0
  214. package/dist/inspection/boundary.js.map +1 -0
  215. package/dist/measurements-C0mAvWU1.d.cts +164 -0
  216. package/dist/measurements-OMpCeBwh.d.ts +164 -0
  217. package/dist/{messages-BZqrGGm1.d.ts → messages-CAzUPPJM.d.cts} +10 -5
  218. package/dist/{messages-BZqrGGm1.d.cts → messages-CAzUPPJM.d.ts} +10 -5
  219. package/dist/messaging/index.cjs +756 -619
  220. package/dist/messaging/index.cjs.map +1 -1
  221. package/dist/messaging/index.d.cts +17 -226
  222. package/dist/messaging/index.d.ts +17 -226
  223. package/dist/messaging/index.js +19 -749
  224. package/dist/messaging/index.js.map +1 -1
  225. package/dist/operators/index.cjs +1256 -1059
  226. package/dist/operators/index.cjs.map +1 -1
  227. package/dist/operators/index.d.cts +6 -6
  228. package/dist/operators/index.d.ts +6 -6
  229. package/dist/operators/index.js +9 -8
  230. package/dist/orchestration/index.cjs +8664 -2617
  231. package/dist/orchestration/index.cjs.map +1 -1
  232. package/dist/orchestration/index.d.cts +171 -221
  233. package/dist/orchestration/index.d.ts +171 -221
  234. package/dist/orchestration/index.js +74 -982
  235. package/dist/orchestration/index.js.map +1 -1
  236. package/dist/orchestration/messaging.cjs +314 -0
  237. package/dist/orchestration/messaging.cjs.map +1 -0
  238. package/dist/orchestration/messaging.d.cts +56 -0
  239. package/dist/orchestration/messaging.d.ts +56 -0
  240. package/dist/orchestration/messaging.js +276 -0
  241. package/dist/orchestration/messaging.js.map +1 -0
  242. package/dist/orchestration/work-queue.cjs +1500 -0
  243. package/dist/orchestration/work-queue.cjs.map +1 -0
  244. package/dist/orchestration/work-queue.d.cts +196 -0
  245. package/dist/orchestration/work-queue.d.ts +196 -0
  246. package/dist/orchestration/work-queue.js +1289 -0
  247. package/dist/orchestration/work-queue.js.map +1 -0
  248. package/dist/patterns/event-flow.cjs +433 -0
  249. package/dist/patterns/event-flow.cjs.map +1 -0
  250. package/dist/patterns/event-flow.d.cts +115 -0
  251. package/dist/patterns/event-flow.d.ts +115 -0
  252. package/dist/patterns/event-flow.js +14 -0
  253. package/dist/patterns/event-flow.js.map +1 -0
  254. package/dist/patterns/index.cjs +748 -355
  255. package/dist/patterns/index.cjs.map +1 -1
  256. package/dist/patterns/index.d.cts +9 -5
  257. package/dist/patterns/index.d.ts +9 -5
  258. package/dist/patterns/index.js +13 -4
  259. package/dist/process-types-C9uMYz3i.d.ts +200 -0
  260. package/dist/process-types-h3uRlzDc.d.cts +200 -0
  261. package/dist/{reactive-collection-BxBqtIOE.d.cts → reactive-collection-B9R0Bl1P.d.cts} +11 -41
  262. package/dist/{reactive-collection-Cb1II1Fi.d.ts → reactive-collection-BXFrH0U2.d.ts} +11 -41
  263. package/dist/{reactive-collection-storage-D-KmjE0J.d.cts → reactive-collection-storage-BLGv8Xp8.d.cts} +5 -5
  264. package/dist/{reactive-collection-storage-BNiEc-Gd.d.ts → reactive-collection-storage-a4zD3665.d.ts} +5 -5
  265. package/dist/{reactive-map-BcB4KsQR.d.ts → reactive-map-C_8sOfdS.d.cts} +7 -6
  266. package/dist/{reactive-map-D-g3dv8I.d.cts → reactive-map-jle5dnok.d.ts} +7 -6
  267. package/dist/render/index.d.cts +3 -3
  268. package/dist/render/index.d.ts +3 -3
  269. package/dist/render/index.js +1 -0
  270. package/dist/scheduled-readiness-5rwQlyjV.d.ts +91 -0
  271. package/dist/scheduled-readiness-DpRY8jI0.d.cts +91 -0
  272. package/dist/semantic-memory-graph-C2ZUwIlq.d.ts +30 -0
  273. package/dist/semantic-memory-graph-DlZBD_Eu.d.cts +30 -0
  274. package/dist/{semantic-memory-graph-BYoIlP35.d.cts → semantic-memory-graph-types-BvzdqmkY.d.cts} +2 -28
  275. package/dist/{semantic-memory-graph-CxyXLms3.d.ts → semantic-memory-graph-types-Ci-OtahO.d.ts} +2 -28
  276. package/dist/solutions/index.cjs +6788 -2128
  277. package/dist/solutions/index.cjs.map +1 -1
  278. package/dist/solutions/index.d.cts +15 -519
  279. package/dist/solutions/index.d.ts +15 -519
  280. package/dist/solutions/index.js +91 -7
  281. package/dist/solutions/reactive-layout/browser/index.cjs +457 -0
  282. package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -0
  283. package/dist/solutions/reactive-layout/browser/index.d.cts +44 -0
  284. package/dist/solutions/reactive-layout/browser/index.d.ts +44 -0
  285. package/dist/solutions/reactive-layout/browser/index.js +69 -0
  286. package/dist/solutions/reactive-layout/browser/index.js.map +1 -0
  287. package/dist/solutions/reactive-layout/index.cjs +4494 -0
  288. package/dist/solutions/reactive-layout/index.cjs.map +1 -0
  289. package/dist/solutions/reactive-layout/index.d.cts +37 -0
  290. package/dist/solutions/reactive-layout/index.d.ts +37 -0
  291. package/dist/solutions/reactive-layout/index.js +146 -0
  292. package/dist/solutions/reactive-layout/index.js.map +1 -0
  293. package/dist/solutions/reactive-layout/node-canvas/index.cjs +555 -0
  294. package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -0
  295. package/dist/solutions/reactive-layout/node-canvas/index.d.cts +54 -0
  296. package/dist/solutions/reactive-layout/node-canvas/index.d.ts +54 -0
  297. package/dist/solutions/reactive-layout/node-canvas/index.js +131 -0
  298. package/dist/solutions/reactive-layout/node-canvas/index.js.map +1 -0
  299. package/dist/solutions/reactive-layout/react-native/index.cjs +504 -0
  300. package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -0
  301. package/dist/solutions/reactive-layout/react-native/index.d.cts +51 -0
  302. package/dist/solutions/reactive-layout/react-native/index.d.ts +51 -0
  303. package/dist/solutions/reactive-layout/react-native/index.js +77 -0
  304. package/dist/solutions/reactive-layout/react-native/index.js.map +1 -0
  305. package/dist/solutions/reactive-layout/skia/index.cjs +557 -0
  306. package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -0
  307. package/dist/solutions/reactive-layout/skia/index.d.cts +64 -0
  308. package/dist/solutions/reactive-layout/skia/index.d.ts +64 -0
  309. package/dist/solutions/reactive-layout/skia/index.js +70 -0
  310. package/dist/solutions/reactive-layout/skia/index.js.map +1 -0
  311. package/dist/solutions/work-item/actions.cjs +2345 -0
  312. package/dist/solutions/work-item/actions.cjs.map +1 -0
  313. package/dist/solutions/work-item/actions.d.cts +40 -0
  314. package/dist/solutions/work-item/actions.d.ts +40 -0
  315. package/dist/solutions/work-item/actions.js +2078 -0
  316. package/dist/solutions/work-item/actions.js.map +1 -0
  317. package/dist/solutions/work-item/scheduling.cjs +9797 -0
  318. package/dist/solutions/work-item/scheduling.cjs.map +1 -0
  319. package/dist/solutions/work-item/scheduling.d.cts +1868 -0
  320. package/dist/solutions/work-item/scheduling.d.ts +1868 -0
  321. package/dist/solutions/work-item/scheduling.js +146 -0
  322. package/dist/solutions/work-item/scheduling.js.map +1 -0
  323. package/dist/solutions/work-item/work-queue.cjs +306 -0
  324. package/dist/solutions/work-item/work-queue.cjs.map +1 -0
  325. package/dist/solutions/work-item/work-queue.d.cts +71 -0
  326. package/dist/solutions/work-item/work-queue.d.ts +71 -0
  327. package/dist/solutions/work-item/work-queue.js +270 -0
  328. package/dist/solutions/work-item/work-queue.js.map +1 -0
  329. package/dist/sources/browser.cjs +1399 -1052
  330. package/dist/sources/browser.cjs.map +1 -1
  331. package/dist/sources/browser.d.cts +33 -6
  332. package/dist/sources/browser.d.ts +33 -6
  333. package/dist/sources/browser.js +73 -6
  334. package/dist/sources/browser.js.map +1 -1
  335. package/dist/sources/index.cjs +1345 -1065
  336. package/dist/sources/index.cjs.map +1 -1
  337. package/dist/sources/index.d.cts +5 -5
  338. package/dist/sources/index.d.ts +5 -5
  339. package/dist/sources/index.js +7 -6
  340. package/dist/sources/node.cjs.map +1 -1
  341. package/dist/sources/node.d.cts +4 -4
  342. package/dist/sources/node.d.ts +4 -4
  343. package/dist/sources/node.js +2 -1
  344. package/dist/sources/node.js.map +1 -1
  345. package/dist/storage/browser.cjs +16 -0
  346. package/dist/storage/browser.cjs.map +1 -1
  347. package/dist/storage/browser.js +4 -3
  348. package/dist/storage/browser.js.map +1 -1
  349. package/dist/storage/index.cjs +16 -0
  350. package/dist/storage/index.cjs.map +1 -1
  351. package/dist/storage/index.d.cts +6 -5
  352. package/dist/storage/index.d.ts +6 -5
  353. package/dist/storage/index.js +10 -9
  354. package/dist/storage/node.cjs +16 -0
  355. package/dist/storage/node.cjs.map +1 -1
  356. package/dist/storage/node.js +4 -3
  357. package/dist/storage/node.js.map +1 -1
  358. package/dist/store-BmtEs9mG.d.ts +123 -0
  359. package/dist/store-PAAsYvML.d.cts +123 -0
  360. package/dist/testing/index.cjs +1 -0
  361. package/dist/testing/index.cjs.map +1 -1
  362. package/dist/testing/index.d.cts +1 -1
  363. package/dist/testing/index.d.ts +1 -1
  364. package/dist/testing/index.js +3 -2
  365. package/dist/types-BRNKoFHj.d.ts +357 -0
  366. package/dist/{types-h12mNYbq.d.ts → types-BS6CyR-x.d.cts} +49 -130
  367. package/dist/types-BWK2ay3e.d.cts +457 -0
  368. package/dist/types-BXKSAoE1.d.cts +357 -0
  369. package/dist/types-BaPpZItj.d.ts +457 -0
  370. package/dist/types-BhveCMg5.d.cts +274 -0
  371. package/dist/{types-bNMSWKqF.d.cts → types-C9NOgNJw.d.ts} +49 -130
  372. package/dist/types-CTsQ8Ww4.d.ts +274 -0
  373. package/dist/types-DL_05n2M.d.ts +34 -0
  374. package/dist/types-XDoqxYO9.d.cts +34 -0
  375. package/dist/work-item-runtime-types-BqtWnSCS.d.ts +138 -0
  376. package/dist/work-item-runtime-types-CHO03AKh.d.cts +138 -0
  377. package/dist/work-queue/index.cjs +1136 -0
  378. package/dist/work-queue/index.cjs.map +1 -0
  379. package/dist/work-queue/index.d.cts +21 -0
  380. package/dist/work-queue/index.d.ts +21 -0
  381. package/dist/work-queue/index.js +1082 -0
  382. package/dist/work-queue/index.js.map +1 -0
  383. package/package.json +603 -249
  384. package/dist/chunk-2ILL7HQI.js.map +0 -1
  385. package/dist/chunk-4VLAQHZI.js.map +0 -1
  386. package/dist/chunk-COHO25CZ.js.map +0 -1
  387. package/dist/chunk-DK554R7P.js.map +0 -1
  388. package/dist/chunk-G4M3NHRJ.js.map +0 -1
  389. package/dist/chunk-I3IHOHCJ.js.map +0 -1
  390. package/dist/chunk-JIMUDQN3.js.map +0 -1
  391. package/dist/chunk-RIIOUTGM.js.map +0 -1
  392. package/dist/chunk-SWTLEQL6.js.map +0 -1
  393. /package/dist/{chunk-GDL26N2T.js.map → chunk-3KN7NJDR.js.map} +0 -0
  394. /package/dist/{chunk-Z2ANQ6JW.js.map → chunk-4Q77MMJY.js.map} +0 -0
  395. /package/dist/{chunk-D6BG7U6A.js.map → chunk-7HZRJMN6.js.map} +0 -0
  396. /package/dist/{chunk-SCRFRCGR.js.map → chunk-BSQGE5PS.js.map} +0 -0
  397. /package/dist/{chunk-PKVBHGBM.js.map → chunk-CJIFGJQG.js.map} +0 -0
  398. /package/dist/{chunk-K3FXTC3I.js.map → chunk-HJACH5PU.js.map} +0 -0
  399. /package/dist/{chunk-GTPCOEOZ.js.map → chunk-IDMLXLLG.js.map} +0 -0
  400. /package/dist/{chunk-DKP56CSW.js.map → chunk-JKAYLDQV.js.map} +0 -0
  401. /package/dist/{chunk-Y3ZLRGHC.js.map → chunk-SIDJO2T4.js.map} +0 -0
  402. /package/dist/{chunk-JR4IKCR2.js.map → chunk-TPND5MJS.js.map} +0 -0
  403. /package/dist/{chunk-TEW47IVR.js.map → chunk-VPEFSDME.js.map} +0 -0
  404. /package/dist/{chunk-DJC4CHLQ.js.map → chunk-YDWBXXQZ.js.map} +0 -0
  405. /package/dist/{chunk-6PHB5CJS.js.map → chunk-ZLFRB6FI.js.map} +0 -0
@@ -0,0 +1,1085 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/adapters/nestjs.ts
21
+ var nestjs_exports = {};
22
+ __export(nestjs_exports, {
23
+ CRON_HANDLERS: () => CRON_HANDLERS,
24
+ EVENT_HANDLERS: () => EVENT_HANDLERS,
25
+ GRAPHREFLY_MODULE_OPTIONS: () => GRAPHREFLY_MODULE_OPTIONS,
26
+ GRAPHREFLY_REQUEST_GRAPH: () => GRAPHREFLY_REQUEST_GRAPH,
27
+ GRAPHREFLY_ROOT_GRAPH: () => GRAPHREFLY_ROOT_GRAPH,
28
+ GraphCron: () => GraphCron,
29
+ GraphError: () => GraphError,
30
+ GraphFilter: () => GraphFilter,
31
+ GraphGuard: () => GraphGuard,
32
+ GraphGuardDecision: () => GraphGuardDecision,
33
+ GraphHttpReply: () => GraphHttpReply,
34
+ GraphIntercept: () => GraphIntercept,
35
+ GraphInterval: () => GraphInterval,
36
+ GraphLifecycle: () => GraphLifecycle,
37
+ GraphMessage: () => GraphMessage,
38
+ GraphMessageReply: () => GraphMessageReply,
39
+ GraphReq: () => GraphReq,
40
+ GraphWs: () => GraphWs,
41
+ GraphWsAck: () => GraphWsAck,
42
+ GraphWsReply: () => GraphWsReply,
43
+ INTERVAL_HANDLERS: () => INTERVAL_HANDLERS,
44
+ NEST_BOUNDARY_BINDINGS: () => NEST_BOUNDARY_BINDINGS,
45
+ NEST_BOUNDARY_ENVELOPE_VERSION: () => NEST_BOUNDARY_ENVELOPE_VERSION,
46
+ NEST_BOUNDARY_PAYLOAD_MAX_BYTES: () => NEST_BOUNDARY_PAYLOAD_MAX_BYTES,
47
+ NEST_HTTP_DIAGNOSTICS_MAX_RETAINED: () => NEST_HTTP_DIAGNOSTICS_MAX_RETAINED,
48
+ OnGraphEvent: () => OnGraphEvent,
49
+ bindingEmitOptions: () => bindingEmitOptions,
50
+ bindingRequestId: () => bindingRequestId,
51
+ createNestGraphBoundaryInterceptor: () => createNestGraphBoundaryInterceptor,
52
+ createNestGraphBoundaryRunner: () => createNestGraphBoundaryRunner,
53
+ fromNestCron: () => fromNestCron,
54
+ fromNestDiagnostics: () => fromNestDiagnostics,
55
+ fromNestError: () => fromNestError,
56
+ fromNestGuard: () => fromNestGuard,
57
+ fromNestIntercept: () => fromNestIntercept,
58
+ fromNestLifecycle: () => fromNestLifecycle,
59
+ fromNestMessage: () => fromNestMessage,
60
+ fromNestReq: () => fromNestReq,
61
+ fromNestWs: () => fromNestWs,
62
+ getGraphToken: () => getGraphToken,
63
+ getNestBoundaryBindings: () => getNestBoundaryBindings,
64
+ getNestBoundaryToken: () => getNestBoundaryToken,
65
+ getNodeToken: () => getNodeToken,
66
+ isDataIssue: () => isDataIssue,
67
+ isHttpDataIssue: () => isHttpDataIssue,
68
+ issueResponse: () => issueResponse,
69
+ lowerHttpReplyPayload: () => lowerHttpReplyPayload,
70
+ lowerProtocolError: () => lowerProtocolError,
71
+ nestProvider: () => nestProvider,
72
+ protocolError: () => protocolError,
73
+ resolveNestMethodKey: () => resolveNestMethodKey,
74
+ sanitizeNestDiagnostic: () => sanitizeNestDiagnostic,
75
+ toNestHttp: () => toNestHttp
76
+ });
77
+ module.exports = __toCommonJS(nestjs_exports);
78
+ var NEST_BOUNDARY_ENVELOPE_VERSION = 1;
79
+ var NEST_BOUNDARY_PAYLOAD_MAX_BYTES = 64 * 1024;
80
+ var NEST_HTTP_DIAGNOSTICS_MAX_RETAINED = 100;
81
+ var GRAPHREFLY_ROOT_GRAPH = /* @__PURE__ */ Symbol.for("graphrefly:root-graph");
82
+ var GRAPHREFLY_MODULE_OPTIONS = /* @__PURE__ */ Symbol.for("graphrefly:module-options");
83
+ var GRAPHREFLY_REQUEST_GRAPH = /* @__PURE__ */ Symbol.for("graphrefly:request-graph");
84
+ var EVENT_HANDLERS = /* @__PURE__ */ new WeakMap();
85
+ var INTERVAL_HANDLERS = /* @__PURE__ */ new WeakMap();
86
+ var CRON_HANDLERS = /* @__PURE__ */ new WeakMap();
87
+ var NEST_BOUNDARY_BINDINGS = /* @__PURE__ */ new WeakMap();
88
+ function getGraphToken(name) {
89
+ assertNonEmptyString(name, "getGraphToken(name)");
90
+ return /* @__PURE__ */ Symbol.for(`graphrefly:graph:${name}`);
91
+ }
92
+ function getNodeToken(path) {
93
+ assertNonEmptyString(path, "getNodeToken(path)");
94
+ return /* @__PURE__ */ Symbol.for(`graphrefly:node:${path}`);
95
+ }
96
+ function getNestBoundaryToken(bindingId) {
97
+ assertNonEmptyString(bindingId, "getNestBoundaryToken(bindingId)");
98
+ return /* @__PURE__ */ Symbol.for(`graphrefly:nest-boundary:${bindingId}`);
99
+ }
100
+ function nestProvider(provide, useValue) {
101
+ return { provide, useValue };
102
+ }
103
+ function fromNestReq(graph, opts = {}) {
104
+ return nestIngress(graph, "request", opts);
105
+ }
106
+ function fromNestGuard(graph, opts = {}) {
107
+ return nestIngress(graph, "guard", opts);
108
+ }
109
+ function fromNestIntercept(graph, opts = {}) {
110
+ return nestIngress(graph, "interceptor", opts);
111
+ }
112
+ function fromNestError(graph, opts = {}) {
113
+ return nestIngress(graph, "error", opts);
114
+ }
115
+ function fromNestLifecycle(graph, opts = {}) {
116
+ return nestIngress(graph, "lifecycle", opts);
117
+ }
118
+ function fromNestCron(graph, opts = {}) {
119
+ return nestIngress(graph, "cron", opts);
120
+ }
121
+ function fromNestDiagnostics(graph, opts = {}) {
122
+ return nestIngress(graph, "diagnostics", {
123
+ ...opts,
124
+ payload: (diagnostic) => sanitizeNestDiagnostic(diagnostic, opts.phase)
125
+ });
126
+ }
127
+ function fromNestWs(graph, opts = {}) {
128
+ return nestIngress(graph, "ws", opts);
129
+ }
130
+ function fromNestMessage(graph, opts = {}) {
131
+ return nestIngress(graph, "message", opts);
132
+ }
133
+ function toNestHttp(egress, opts = {}) {
134
+ const bindingId = stableBindingId("http", opts);
135
+ const scopedBindingId = opts.bindingId;
136
+ const maxDiagnostics = diagnosticsRetainedLimit(opts.maxDiagnostics);
137
+ const maxPayloadBytes = payloadByteLimit(opts.maxPayloadBytes);
138
+ const pending = /* @__PURE__ */ new Map();
139
+ const diagnostics = [];
140
+ let active = true;
141
+ let terminal;
142
+ const report = (diagnostic) => {
143
+ pushDiagnostic(diagnostics, diagnostic, maxDiagnostics);
144
+ try {
145
+ const phase = diagnostic.phase ?? opts.diagnosticPhase ?? "http";
146
+ const payload = sanitizeNestDiagnostic({ ...diagnostic, phase }, phase);
147
+ opts.diagnosticBoundary?.emit(payload, { payload });
148
+ } catch {
149
+ }
150
+ };
151
+ const keyOf = (requestId, requestBindingId) => requestBindingId === void 0 ? requestId : `${requestBindingId}\0${requestId}`;
152
+ const rejectEntry = (entry, error, envelope, message) => {
153
+ try {
154
+ entry.handle.reject(error, envelope);
155
+ } catch (rejectError) {
156
+ report({
157
+ kind: "reject-threw",
158
+ requestId: entry.requestId,
159
+ bindingId: entry.bindingId,
160
+ message,
161
+ error: rejectError
162
+ });
163
+ }
164
+ };
165
+ const rejectPending = (kind, error, message) => {
166
+ const entries = [...pending.values()];
167
+ pending.clear();
168
+ if (entries.length === 0) return 0;
169
+ report({ kind, bindingId: scopedBindingId, message, error });
170
+ for (const entry of entries) {
171
+ rejectEntry(entry, error, void 0, `toNestHttp(${bindingId}) pending reject threw`);
172
+ }
173
+ return entries.length;
174
+ };
175
+ const unsubscribe = egress.subscribe((msg) => {
176
+ if (!active) return;
177
+ if (msg[0] === "ERROR" || msg[0] === "COMPLETE" || msg[0] === "TEARDOWN") {
178
+ const error = msg[0] === "ERROR" ? msg[1] : new Error(`toNestHttp(${bindingId}) egress received ${msg[0]}`);
179
+ const message = `toNestHttp(${bindingId}) rejected pending requests after ${msg[0]}`;
180
+ terminal = { error, message };
181
+ const rejectedCount = rejectPending("terminal-egress", error, message);
182
+ if (rejectedCount === 0)
183
+ report({ kind: "terminal-egress", bindingId: scopedBindingId, message, error });
184
+ return;
185
+ }
186
+ if (msg[0] !== "DATA") return;
187
+ const envelope = msg[1];
188
+ const malformed = validateEnvelope(envelope, maxPayloadBytes);
189
+ if (malformed !== void 0) {
190
+ const correlated = malformedCorrelation(msg[1], scopedBindingId);
191
+ if (correlated !== void 0) {
192
+ const pendingKey2 = keyOf(correlated.requestId, scopedBindingId);
193
+ const entry2 = pending.get(pendingKey2);
194
+ if (entry2 !== void 0) {
195
+ pending.delete(pendingKey2);
196
+ rejectEntry(
197
+ entry2,
198
+ new Error(malformed),
199
+ void 0,
200
+ `toNestHttp(${bindingId}) rejected malformed correlated egress`
201
+ );
202
+ }
203
+ }
204
+ report({
205
+ kind: "malformed-egress",
206
+ requestId: correlated?.requestId,
207
+ bindingId: correlated?.bindingId,
208
+ message: malformed
209
+ });
210
+ return;
211
+ }
212
+ if (scopedBindingId !== void 0 && envelope.bindingId !== scopedBindingId) {
213
+ report({
214
+ kind: "binding-mismatch",
215
+ requestId: envelope.requestId,
216
+ bindingId: envelope.bindingId,
217
+ expectedBindingId: scopedBindingId,
218
+ message: `toNestHttp(${bindingId}) ignored egress for binding ${envelope.bindingId}`
219
+ });
220
+ return;
221
+ }
222
+ const pendingKey = keyOf(envelope.requestId, scopedBindingId);
223
+ const entry = pending.get(pendingKey);
224
+ if (entry === void 0) {
225
+ report({
226
+ kind: "stale-egress",
227
+ requestId: envelope.requestId,
228
+ bindingId: envelope.bindingId,
229
+ message: `toNestHttp(${bindingId}) ignored stale requestId ${envelope.requestId}`
230
+ });
231
+ return;
232
+ }
233
+ pending.delete(pendingKey);
234
+ try {
235
+ entry.handle.resolve(
236
+ opts.transform?.(envelope.payload, envelope) ?? envelope.payload,
237
+ envelope
238
+ );
239
+ } catch (error) {
240
+ report({
241
+ kind: "resolve-threw",
242
+ requestId: envelope.requestId,
243
+ bindingId: envelope.bindingId,
244
+ message: `toNestHttp(${bindingId}) response handle threw while resolving`,
245
+ error
246
+ });
247
+ rejectEntry(
248
+ entry,
249
+ error,
250
+ envelope,
251
+ `toNestHttp(${bindingId}) response handle threw while rejecting`
252
+ );
253
+ }
254
+ });
255
+ return {
256
+ kind: "http",
257
+ bindingId,
258
+ attach(registration) {
259
+ if (!active) throw new Error(`toNestHttp(${bindingId}) is disposed`);
260
+ assertNonEmptyString(registration.requestId, "toNestHttp.attach(requestId)");
261
+ const registrationBindingId = registration.bindingId ?? scopedBindingId;
262
+ if (scopedBindingId !== void 0 && registrationBindingId !== scopedBindingId) {
263
+ throw new Error(
264
+ `toNestHttp.attach expected bindingId ${scopedBindingId}, got ${registrationBindingId}`
265
+ );
266
+ }
267
+ if (terminal !== void 0) {
268
+ const entry2 = {
269
+ requestId: registration.requestId,
270
+ bindingId: registrationBindingId,
271
+ handle: registration.handle
272
+ };
273
+ report({
274
+ kind: "terminal-egress",
275
+ requestId: registration.requestId,
276
+ bindingId: registrationBindingId,
277
+ message: terminal.message,
278
+ error: terminal.error
279
+ });
280
+ rejectEntry(
281
+ entry2,
282
+ terminal.error,
283
+ void 0,
284
+ `toNestHttp(${bindingId}) terminal response handle reject threw`
285
+ );
286
+ return () => false;
287
+ }
288
+ const key = keyOf(registration.requestId, scopedBindingId);
289
+ if (pending.has(key)) {
290
+ throw new Error(`toNestHttp.attach duplicate pending requestId ${registration.requestId}`);
291
+ }
292
+ const entry = {
293
+ requestId: registration.requestId,
294
+ bindingId: registrationBindingId,
295
+ handle: registration.handle
296
+ };
297
+ pending.set(key, entry);
298
+ return () => {
299
+ if (pending.get(key) !== entry) return false;
300
+ return pending.delete(key);
301
+ };
302
+ },
303
+ pendingCount: () => pending.size,
304
+ diagnostics: () => diagnostics.slice(),
305
+ dispose() {
306
+ if (!active) return;
307
+ active = false;
308
+ rejectPending(
309
+ "dispose-pending",
310
+ new Error(`toNestHttp(${bindingId}) disposed before response resolution`),
311
+ `toNestHttp(${bindingId}) rejected pending requests during dispose`
312
+ );
313
+ unsubscribe();
314
+ }
315
+ };
316
+ }
317
+ function GraphReq(boundary, opts = {}) {
318
+ return graphIngressBinding("request", boundary, opts);
319
+ }
320
+ function GraphGuard(boundary, opts = {}) {
321
+ return graphIngressBinding("guard", boundary, opts);
322
+ }
323
+ function GraphIntercept(boundary, opts = {}) {
324
+ return graphIngressBinding("interceptor", boundary, opts);
325
+ }
326
+ function GraphFilter(boundary, opts = {}) {
327
+ return graphIngressBinding("error", boundary, opts);
328
+ }
329
+ function GraphError(boundary, opts = {}) {
330
+ return GraphFilter(boundary, opts);
331
+ }
332
+ function GraphLifecycle(boundary, opts = {}) {
333
+ return graphIngressBinding("lifecycle", boundary, opts);
334
+ }
335
+ function GraphCron(boundary, opts = {}) {
336
+ return graphIngressBinding("cron", boundary, opts);
337
+ }
338
+ function GraphWs(boundary, opts = {}) {
339
+ return graphIngressBinding("ws", boundary, opts);
340
+ }
341
+ function GraphMessage(boundary, opts = {}) {
342
+ return graphIngressBinding("message", boundary, opts);
343
+ }
344
+ function GraphHttpReply(replyNode, opts) {
345
+ const bindingId = opts?.bindingId;
346
+ if (typeof bindingId !== "string" || bindingId.length === 0) {
347
+ throw new Error("GraphHttpReply requires a non-empty bindingId");
348
+ }
349
+ return registerMeta(NEST_BOUNDARY_BINDINGS, (methodKey) => ({
350
+ direction: "egress",
351
+ kind: "http",
352
+ bindingId,
353
+ methodKey,
354
+ replyNode,
355
+ order: opts.order,
356
+ issueResponse: opts.issueResponse,
357
+ protocolError: opts.protocolError
358
+ }));
359
+ }
360
+ function GraphGuardDecision(decisionNode, opts) {
361
+ const bindingId = opts?.bindingId;
362
+ if (typeof bindingId !== "string" || bindingId.length === 0) {
363
+ throw new Error("GraphGuardDecision requires a non-empty bindingId");
364
+ }
365
+ return registerMeta(NEST_BOUNDARY_BINDINGS, (methodKey) => ({
366
+ direction: "egress",
367
+ kind: "guard-decision",
368
+ bindingId,
369
+ methodKey,
370
+ decisionNode,
371
+ order: opts.order,
372
+ issueResponse: opts.issueResponse,
373
+ protocolError: opts.protocolError
374
+ }));
375
+ }
376
+ function GraphWsAck(ackNode, opts) {
377
+ return graphReplyBinding("ws-ack", ackNode, opts, "GraphWsAck");
378
+ }
379
+ function GraphWsReply(replyNode, opts) {
380
+ return graphReplyBinding("ws-reply", replyNode, opts, "GraphWsReply");
381
+ }
382
+ function GraphMessageReply(replyNode, opts) {
383
+ return graphReplyBinding("message-reply", replyNode, opts, "GraphMessageReply");
384
+ }
385
+ function createNestGraphBoundaryRunner(opts = {}) {
386
+ const httpBoundaries = /* @__PURE__ */ new Map();
387
+ const httpBoundaryFor = (node, bindingId) => {
388
+ let byBinding = httpBoundaries.get(node);
389
+ if (byBinding === void 0) {
390
+ byBinding = /* @__PURE__ */ new Map();
391
+ httpBoundaries.set(node, byBinding);
392
+ }
393
+ let boundary = byBinding.get(bindingId);
394
+ if (boundary === void 0) {
395
+ boundary = toNestHttp(node, {
396
+ bindingId,
397
+ diagnosticBoundary: opts.diagnosticBoundary,
398
+ diagnosticPhase: opts.diagnosticPhase ?? "http"
399
+ });
400
+ byBinding.set(bindingId, boundary);
401
+ }
402
+ return boundary;
403
+ };
404
+ return {
405
+ run(target, methodKey, host, opts2 = {}) {
406
+ const ctor = typeof target === "function" ? target : target.constructor;
407
+ const bindings = getNestBoundaryBindings(ctor, methodKey);
408
+ if (bindings.length === 0) return void 0;
409
+ const requestId = requestIdFromRunOptions(host, opts2);
410
+ const replies = bindings.filter(isHttpReplyBinding);
411
+ const ingress = bindings.filter(
412
+ (binding) => binding.direction === "ingress" && (binding.kind === "request" || binding.kind === "interceptor")
413
+ );
414
+ if (replies.length > 0 && ingress.length === 0) {
415
+ throw new Error("Nest GraphHttpReply requires at least one ingress boundary");
416
+ }
417
+ const ingressEmits = ingress.map((binding) => ({
418
+ binding,
419
+ requestId: requestIdFromBinding(host, binding) ?? requestId
420
+ }));
421
+ const replyRequestIds = uniqueDefinedStrings(ingressEmits.map((entry) => entry.requestId));
422
+ if (replies.length > 0 && replyRequestIds.length === 0) {
423
+ throw new Error("Nest GraphHttpReply requires a stable requestId");
424
+ }
425
+ const cleanups = [];
426
+ let resolveReply;
427
+ let rejectReply;
428
+ const replyPromise = replies.length === 0 ? void 0 : new Promise((resolve, reject) => {
429
+ resolveReply = resolve;
430
+ rejectReply = reject;
431
+ });
432
+ try {
433
+ for (const reply of replies) {
434
+ const http = httpBoundaryFor(reply.replyNode, reply.bindingId);
435
+ for (const replyRequestId of replyRequestIds) {
436
+ cleanups.push(
437
+ http.attach({
438
+ requestId: replyRequestId,
439
+ bindingId: reply.bindingId,
440
+ handle: {
441
+ resolve: resolveReply ?? (() => void 0),
442
+ reject: rejectReply ?? (() => void 0)
443
+ }
444
+ })
445
+ );
446
+ }
447
+ }
448
+ for (const entry of ingressEmits) {
449
+ entry.binding.boundary.emit(host, {
450
+ bindingId: entry.binding.bindingId,
451
+ requestId: entry.requestId,
452
+ ...bindingPayloadEmitOption(host, entry.binding),
453
+ requireRequestId: requiresRequestId(entry.binding.kind)
454
+ });
455
+ }
456
+ } catch (error) {
457
+ for (const cleanup of cleanups) cleanup();
458
+ throw error;
459
+ }
460
+ return replyPromise?.finally(() => {
461
+ for (const cleanup of cleanups) cleanup();
462
+ });
463
+ },
464
+ dispose() {
465
+ for (const byBinding of httpBoundaries.values()) {
466
+ for (const boundary of byBinding.values()) boundary.dispose();
467
+ }
468
+ httpBoundaries.clear();
469
+ }
470
+ };
471
+ }
472
+ function createNestGraphBoundaryInterceptor(opts = {}) {
473
+ const runner = opts.runner ?? createNestGraphBoundaryRunner(opts);
474
+ let nextRequestSeq = 1;
475
+ return {
476
+ intercept(context, next) {
477
+ const ctor = context.getClass();
478
+ const handler = context.getHandler();
479
+ const methodKey = methodKeyForHandler(ctor, handler);
480
+ if (methodKey === void 0) return next?.handle();
481
+ const bindings = getNestBoundaryBindings(ctor, methodKey);
482
+ const needsSyntheticRequestId = bindings.some(
483
+ (binding) => binding.direction === "egress" || binding.direction === "ingress" && requiresRequestId(binding.kind)
484
+ );
485
+ const host = opts.host?.(context) ?? defaultNestHttpHost(context, () => nextRequestSeq++, needsSyntheticRequestId) ?? {};
486
+ const result = runner.run(ctor, methodKey, host, opts);
487
+ return result ?? next?.handle();
488
+ },
489
+ dispose() {
490
+ runner.dispose();
491
+ }
492
+ };
493
+ }
494
+ function getNestBoundaryBindings(target, methodKey) {
495
+ const ctor = typeof target === "function" ? target : target.constructor;
496
+ const bindings = boundaryBindingsFor(ctor);
497
+ return sortBoundaryBindings(
498
+ methodKey === void 0 ? bindings : bindings.filter((binding) => binding.methodKey === methodKey)
499
+ );
500
+ }
501
+ function resolveNestMethodKey(ctor, handler) {
502
+ return methodKeyForHandler(ctor, handler);
503
+ }
504
+ function bindingRequestId(host, binding, fallback) {
505
+ if (binding.direction === "ingress") {
506
+ const requestId = requestIdFromBinding(host, binding);
507
+ if (requestId !== void 0) return requestId;
508
+ }
509
+ if (typeof fallback === "string") {
510
+ assertNonEmptyString(fallback, "requestId");
511
+ return fallback;
512
+ }
513
+ if (typeof fallback === "function") {
514
+ const requestId = fallback(host);
515
+ if (requestId !== void 0) assertNonEmptyString(requestId, "requestId");
516
+ return requestId;
517
+ }
518
+ return requestIdOf(host, {}, {});
519
+ }
520
+ function bindingEmitOptions(host, binding, requestId) {
521
+ return {
522
+ bindingId: binding.bindingId,
523
+ requestId,
524
+ ...bindingPayloadEmitOption(host, binding),
525
+ requireRequestId: requiresRequestId(binding.kind)
526
+ };
527
+ }
528
+ function isDataIssue(value) {
529
+ return value !== null && typeof value === "object" && value.kind === "issue" && typeof value.code === "string" && typeof value.message === "string";
530
+ }
531
+ function isHttpDataIssue(value) {
532
+ return isDataIssue(value) && Number.isInteger(value.status);
533
+ }
534
+ function issueResponse(issue, _host) {
535
+ if (isHttpDataIssue(issue)) {
536
+ return {
537
+ status: issue.status,
538
+ body: issue.body ?? { code: issue.code, message: issue.message },
539
+ headers: issue.headers
540
+ };
541
+ }
542
+ return {
543
+ status: 400,
544
+ body: { code: issue.code, message: issue.message }
545
+ };
546
+ }
547
+ function protocolError(_errorPayload, _host) {
548
+ return {
549
+ status: 500,
550
+ body: { code: "graphrefly.protocol_error", message: "GraphReFly reply pipeline failed" }
551
+ };
552
+ }
553
+ function lowerHttpReplyPayload(payload, host, opts = {}) {
554
+ if (isHttpResponsePayload(payload)) return payload;
555
+ if (isDataIssue(payload)) return (opts.issueResponse ?? issueResponse)(payload, host);
556
+ return { status: 200, body: payload };
557
+ }
558
+ function lowerProtocolError(errorPayload, host, opts = {}) {
559
+ return (opts.protocolError ?? protocolError)(errorPayload, host);
560
+ }
561
+ function sanitizeNestDiagnostic(diagnostic, defaultPhase = "adapter") {
562
+ const payload = {
563
+ kind: diagnostic.kind,
564
+ phase: diagnostic.phase ?? defaultPhase,
565
+ message: diagnostic.message,
566
+ ...optionalStringField("requestId", diagnostic.requestId),
567
+ ...optionalStringField("bindingId", diagnostic.bindingId),
568
+ ...optionalStringField("expectedBindingId", diagnostic.expectedBindingId),
569
+ ...optionalDiagnosticError(diagnostic.error)
570
+ };
571
+ assertGraphVisibleData(payload, "NestDiagnosticPayload", NEST_BOUNDARY_PAYLOAD_MAX_BYTES);
572
+ return payload;
573
+ }
574
+ function nestIngress(graph, kind, opts) {
575
+ const bindingId = stableBindingId(kind, opts);
576
+ const version = parseEnvelopeVersion(opts.version ?? NEST_BOUNDARY_ENVELOPE_VERSION, "version");
577
+ const maxPayloadBytes = payloadByteLimit(opts.maxPayloadBytes);
578
+ const node = graph.node([], null, {
579
+ name: opts.name,
580
+ meta: { adapter: "nestjs", boundary: "ingress", kind, bindingId, version }
581
+ });
582
+ return {
583
+ kind,
584
+ bindingId,
585
+ version,
586
+ node,
587
+ envelope(host, emitOpts = {}) {
588
+ const requestId = requestIdOf(host, opts, {
589
+ ...emitOpts,
590
+ requireRequestId: emitOpts.requireRequestId ?? opts.requireRequestId ?? requiresRequestId(kind)
591
+ });
592
+ const envelopeBindingId = emitOpts.bindingId ?? bindingId;
593
+ assertNonEmptyString(envelopeBindingId, "NestBoundaryEnvelope.bindingId");
594
+ const envelopeVersion = parseEnvelopeVersion(
595
+ emitOpts.version ?? version,
596
+ "NestBoundaryEnvelope.version"
597
+ );
598
+ const payload = "payload" in emitOpts ? emitOpts.payload : opts.payload !== void 0 ? opts.payload(host) : host;
599
+ assertGraphVisibleData(payload, "NestBoundaryEnvelope.payload", maxPayloadBytes);
600
+ const envelope = {
601
+ bindingId: envelopeBindingId,
602
+ version: envelopeVersion,
603
+ payload
604
+ };
605
+ return requestId === void 0 ? envelope : { ...envelope, requestId };
606
+ },
607
+ emit(host, emitOpts = {}) {
608
+ const envelope = this.envelope(host, emitOpts);
609
+ node.down([["DATA", envelope]]);
610
+ return envelope;
611
+ }
612
+ };
613
+ }
614
+ function stableBindingId(kind, opts) {
615
+ const bindingId = opts.bindingId ?? opts.name ?? `nestjs.${kind}`;
616
+ assertNonEmptyString(bindingId, "bindingId");
617
+ return bindingId;
618
+ }
619
+ function requiresRequestId(kind) {
620
+ return kind === "request" || kind === "guard" || kind === "interceptor" || kind === "error";
621
+ }
622
+ function requestIdFromRunOptions(host, opts) {
623
+ if (typeof opts.requestId === "string") {
624
+ assertNonEmptyString(opts.requestId, "requestId");
625
+ return opts.requestId;
626
+ }
627
+ if (typeof opts.requestId === "function") {
628
+ const requestId = opts.requestId(host);
629
+ if (requestId !== void 0) assertNonEmptyString(requestId, "requestId");
630
+ return requestId;
631
+ }
632
+ return requestIdOf(host, {}, {});
633
+ }
634
+ function requestIdFromBinding(host, binding) {
635
+ if (typeof binding.requestId === "string") {
636
+ assertNonEmptyString(binding.requestId, "requestId");
637
+ return binding.requestId;
638
+ }
639
+ if (typeof binding.requestId === "function") {
640
+ const requestId = binding.requestId(host);
641
+ if (requestId !== void 0) assertNonEmptyString(requestId, "requestId");
642
+ return requestId;
643
+ }
644
+ return void 0;
645
+ }
646
+ function bindingPayloadEmitOption(host, binding) {
647
+ return binding.payload === void 0 ? {} : { payload: binding.payload(host) };
648
+ }
649
+ function isHttpResponsePayload(value) {
650
+ if (value === null || typeof value !== "object") return false;
651
+ const status = value.status;
652
+ if (!Number.isInteger(status)) return false;
653
+ const headers = value.headers;
654
+ return headers === void 0 || isStringRecord(headers);
655
+ }
656
+ function isStringRecord(value) {
657
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
658
+ for (const entry of Object.values(value)) if (typeof entry !== "string") return false;
659
+ return true;
660
+ }
661
+ function isHttpReplyBinding(binding) {
662
+ return binding.direction === "egress" && binding.kind === "http";
663
+ }
664
+ function uniqueDefinedStrings(values) {
665
+ const seen = /* @__PURE__ */ new Set();
666
+ for (const value of values) {
667
+ if (value !== void 0) seen.add(value);
668
+ }
669
+ return [...seen];
670
+ }
671
+ function defaultNestHttpHost(context, nextSeq, needsSyntheticRequestId) {
672
+ const request = context.switchToHttp?.().getRequest();
673
+ if (request === void 0 || request === null || typeof request !== "object") return request;
674
+ if (requestIdFromRecord(request) !== void 0) return request;
675
+ const headerId = requestIdFromHeaders(request.headers);
676
+ if (headerId !== void 0 || needsSyntheticRequestId) {
677
+ return { ...request, requestId: headerId ?? `nestjs-request:${nextSeq()}` };
678
+ }
679
+ return request;
680
+ }
681
+ function requestIdFromRecord(record) {
682
+ for (const key of ["requestId", "id"]) {
683
+ const value = record[key];
684
+ if (typeof value === "string" && value.length > 0) return value;
685
+ }
686
+ return void 0;
687
+ }
688
+ function requestIdFromHeaders(headers) {
689
+ if (headers === null || typeof headers !== "object") return void 0;
690
+ for (const key of ["x-request-id", "x-correlation-id"]) {
691
+ const value = headers[key];
692
+ const first = Array.isArray(value) ? value[0] : value;
693
+ if (typeof first === "string" && first.trim().length > 0) return first.trim();
694
+ }
695
+ return void 0;
696
+ }
697
+ function graphIngressBinding(kind, boundary, opts) {
698
+ if (boundary.kind !== kind) {
699
+ throw new Error(`Graph${kind} expected a ${kind} boundary, got ${boundary.kind}`);
700
+ }
701
+ const bindingId = opts.bindingId ?? boundary.bindingId;
702
+ assertNonEmptyString(bindingId, "bindingId");
703
+ return registerMeta(NEST_BOUNDARY_BINDINGS, (methodKey) => ({
704
+ direction: "ingress",
705
+ kind,
706
+ bindingId,
707
+ methodKey,
708
+ boundary,
709
+ payload: opts.payload,
710
+ requestId: opts.requestId,
711
+ order: opts.order,
712
+ mode: opts.mode,
713
+ issueResponse: opts.issueResponse,
714
+ protocolError: opts.protocolError
715
+ }));
716
+ }
717
+ function graphReplyBinding(kind, node, opts, decoratorName) {
718
+ const bindingId = opts?.bindingId;
719
+ if (typeof bindingId !== "string" || bindingId.length === 0) {
720
+ throw new Error(`${decoratorName} requires a non-empty bindingId`);
721
+ }
722
+ const replyNode = node;
723
+ return registerMeta(NEST_BOUNDARY_BINDINGS, (methodKey) => {
724
+ if (kind === "ws-ack") {
725
+ return {
726
+ direction: "egress",
727
+ kind,
728
+ bindingId,
729
+ methodKey,
730
+ ackNode: replyNode,
731
+ order: opts.order
732
+ };
733
+ }
734
+ return {
735
+ direction: "egress",
736
+ kind,
737
+ bindingId,
738
+ methodKey,
739
+ replyNode,
740
+ order: opts.order
741
+ };
742
+ });
743
+ }
744
+ function methodKeyForHandler(ctor, handler) {
745
+ for (const binding of boundaryBindingsFor(ctor)) {
746
+ const candidate = methodOnPrototypeChain(ctor, binding.methodKey);
747
+ if (candidate === handler || String(binding.methodKey) === handler.name)
748
+ return binding.methodKey;
749
+ }
750
+ return void 0;
751
+ }
752
+ function boundaryBindingsFor(ctor) {
753
+ const bindings = [];
754
+ const seen = /* @__PURE__ */ new Set();
755
+ let current = ctor;
756
+ while (typeof current === "function" && current !== Function.prototype) {
757
+ for (const binding of NEST_BOUNDARY_BINDINGS.get(current) ?? []) {
758
+ if (seen.has(binding)) continue;
759
+ seen.add(binding);
760
+ bindings.push(binding);
761
+ }
762
+ current = Object.getPrototypeOf(current);
763
+ }
764
+ return bindings;
765
+ }
766
+ function sortBoundaryBindings(bindings) {
767
+ return bindings.map((binding, index) => ({ binding, index })).sort((a, b) => (a.binding.order ?? 0) - (b.binding.order ?? 0) || a.index - b.index).map(({ binding }) => binding);
768
+ }
769
+ function methodOnPrototypeChain(ctor, methodKey) {
770
+ let proto = ctor.prototype;
771
+ while (proto !== null && typeof proto === "object") {
772
+ if (Object.hasOwn(proto, methodKey)) {
773
+ return proto[methodKey];
774
+ }
775
+ proto = Object.getPrototypeOf(proto);
776
+ }
777
+ return void 0;
778
+ }
779
+ function requestIdOf(host, opts, emitOpts) {
780
+ const fromEmit = emitOpts.requestId;
781
+ if (fromEmit !== void 0) {
782
+ assertNonEmptyString(fromEmit, "requestId");
783
+ return fromEmit;
784
+ }
785
+ if (typeof opts.requestId === "string") {
786
+ assertNonEmptyString(opts.requestId, "requestId");
787
+ return opts.requestId;
788
+ }
789
+ if (typeof opts.requestId === "function") {
790
+ const requestId = opts.requestId(host);
791
+ if (requestId !== void 0) assertNonEmptyString(requestId, "requestId");
792
+ return requestId;
793
+ }
794
+ const record = host;
795
+ if (typeof record?.requestId === "string" && record.requestId.length > 0) return record.requestId;
796
+ if (typeof record?.id === "string" && record.id.length > 0) return record.id;
797
+ if (emitOpts.requireRequestId ?? opts.requireRequestId ?? false) {
798
+ throw new Error("Nest boundary ingress requires a stable requestId");
799
+ }
800
+ return void 0;
801
+ }
802
+ function validateEnvelope(value, maxPayloadBytes) {
803
+ try {
804
+ assertGraphVisibleData(value, "NestBoundaryEnvelope", maxPayloadBytes);
805
+ } catch (error) {
806
+ return error instanceof Error ? error.message : "egress envelope must be data-only material";
807
+ }
808
+ if (value === null || typeof value !== "object") return "egress DATA is not an envelope object";
809
+ const envelope = value;
810
+ if (typeof envelope.requestId !== "string" || envelope.requestId.length === 0) {
811
+ return "egress envelope requestId must be a non-empty string";
812
+ }
813
+ if (typeof envelope.bindingId !== "string" || envelope.bindingId.length === 0) {
814
+ return "egress envelope bindingId must be a non-empty string";
815
+ }
816
+ try {
817
+ parseEnvelopeVersion(envelope.version, "egress envelope version");
818
+ } catch {
819
+ return `egress envelope version must be ${NEST_BOUNDARY_ENVELOPE_VERSION}`;
820
+ }
821
+ return void 0;
822
+ }
823
+ function malformedCorrelation(value, scopedBindingId) {
824
+ if (value === null || typeof value !== "object") return void 0;
825
+ const requestId = value.requestId;
826
+ const bindingId = value.bindingId;
827
+ if (typeof requestId !== "string" || requestId.length === 0) return void 0;
828
+ if (typeof bindingId !== "string" || bindingId.length === 0) return void 0;
829
+ if (scopedBindingId !== void 0 && bindingId !== scopedBindingId) return void 0;
830
+ return { requestId, bindingId };
831
+ }
832
+ function parseEnvelopeVersion(value, label) {
833
+ if (value !== NEST_BOUNDARY_ENVELOPE_VERSION) {
834
+ throw new Error(`${label} must be ${NEST_BOUNDARY_ENVELOPE_VERSION}`);
835
+ }
836
+ return value;
837
+ }
838
+ function assertNonEmptyString(value, label) {
839
+ if (value.length === 0) throw new Error(`${label} must be a non-empty string`);
840
+ }
841
+ function optionalStringField(key, value) {
842
+ return value === void 0 ? {} : { [key]: value };
843
+ }
844
+ function optionalDiagnosticError(error) {
845
+ const summarized = summarizeDiagnosticError(error);
846
+ return summarized === void 0 ? {} : { error: summarized };
847
+ }
848
+ function summarizeDiagnosticError(error) {
849
+ if (error === void 0) return void 0;
850
+ if (error instanceof Error) {
851
+ return {
852
+ ...optionalDiagnosticName(safeDiagnosticString(() => error.name)),
853
+ message: safeDiagnosticString(() => error.message) ?? "diagnostic error"
854
+ };
855
+ }
856
+ if (typeof error === "string") return { message: error };
857
+ if (typeof error === "number" || typeof error === "boolean" || typeof error === "bigint") {
858
+ return { message: String(error) };
859
+ }
860
+ if (typeof error === "symbol") return { message: error.description ?? "symbol" };
861
+ if (typeof error === "function") return { message: "opaque diagnostic function" };
862
+ if (error !== null && typeof error === "object") {
863
+ const record = error;
864
+ const message = safeDiagnosticString(() => record.message);
865
+ if (message !== void 0) {
866
+ return {
867
+ ...optionalDiagnosticName(safeDiagnosticString(() => record.name)),
868
+ message
869
+ };
870
+ }
871
+ return { message: "opaque diagnostic error" };
872
+ }
873
+ return { message: String(error) };
874
+ }
875
+ function safeDiagnosticString(read) {
876
+ try {
877
+ const value = read();
878
+ return typeof value === "string" ? value : void 0;
879
+ } catch {
880
+ return void 0;
881
+ }
882
+ }
883
+ function optionalDiagnosticName(name) {
884
+ return name === void 0 || name.length === 0 ? {} : { name };
885
+ }
886
+ function payloadByteLimit(value) {
887
+ if (value === void 0) return NEST_BOUNDARY_PAYLOAD_MAX_BYTES;
888
+ if (!Number.isSafeInteger(value) || value < 1) {
889
+ throw new Error("Nest boundary maxPayloadBytes must be a positive safe integer");
890
+ }
891
+ return value;
892
+ }
893
+ function diagnosticsRetainedLimit(value) {
894
+ if (value === void 0) return NEST_HTTP_DIAGNOSTICS_MAX_RETAINED;
895
+ if (!Number.isSafeInteger(value) || value < 0) {
896
+ throw new Error("toNestHttp maxDiagnostics must be a non-negative safe integer");
897
+ }
898
+ return value;
899
+ }
900
+ function pushDiagnostic(diagnostics, diagnostic, maxDiagnostics) {
901
+ if (maxDiagnostics === 0) return;
902
+ diagnostics.push(diagnostic);
903
+ if (diagnostics.length > maxDiagnostics)
904
+ diagnostics.splice(0, diagnostics.length - maxDiagnostics);
905
+ }
906
+ function assertGraphVisibleData(value, path, maxPayloadBytes, seen = /* @__PURE__ */ new WeakSet()) {
907
+ if (value === void 0) {
908
+ throw new TypeError(`${path} cannot be undefined; undefined is SENTINEL/no DATA`);
909
+ }
910
+ if (value === null) return;
911
+ const type = typeof value;
912
+ if (type === "string" || type === "boolean") return;
913
+ if (type === "number") {
914
+ if (!Number.isFinite(value)) throw new TypeError(`${path} number must be finite`);
915
+ return;
916
+ }
917
+ if (type === "function" || type === "symbol" || type === "bigint") {
918
+ throw new TypeError(`${path} must be data-only; found ${type}`);
919
+ }
920
+ if (type !== "object") return;
921
+ if (seen.has(value)) throw new TypeError(`${path} must be acyclic data`);
922
+ seen.add(value);
923
+ if (Array.isArray(value)) {
924
+ try {
925
+ for (let i = 0; i < value.length; i += 1) {
926
+ const descriptor = Object.getOwnPropertyDescriptor(value, i);
927
+ if (descriptor === void 0) {
928
+ throw new TypeError(`${path}[${i}] cannot be a sparse array hole`);
929
+ }
930
+ if (!descriptor.enumerable || !("value" in descriptor)) {
931
+ throw new TypeError(`${path}[${i}] must be enumerable plain data`);
932
+ }
933
+ assertGraphVisibleData(descriptor.value, `${path}[${i}]`, maxPayloadBytes, seen);
934
+ }
935
+ for (const key of Reflect.ownKeys(value)) {
936
+ if (key === "length") continue;
937
+ if (typeof key === "symbol" || !/^(0|[1-9]\d*)$/.test(key)) {
938
+ throw new TypeError(`${path} arrays must not carry hidden or extra properties`);
939
+ }
940
+ }
941
+ assertPayloadSize(value, path, maxPayloadBytes);
942
+ } finally {
943
+ seen.delete(value);
944
+ }
945
+ return;
946
+ }
947
+ const proto = Object.getPrototypeOf(value);
948
+ if (proto !== Object.prototype && proto !== null) {
949
+ throw new TypeError(`${path} must be a plain data object or array`);
950
+ }
951
+ try {
952
+ for (const key of Reflect.ownKeys(value)) {
953
+ if (typeof key === "symbol") throw new TypeError(`${path} must not carry symbol keys`);
954
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
955
+ if (descriptor === void 0) continue;
956
+ if (!descriptor.enumerable || !("value" in descriptor)) {
957
+ throw new TypeError(`${path}.${key} must be enumerable plain data`);
958
+ }
959
+ assertGraphVisibleData(descriptor.value, `${path}.${key}`, maxPayloadBytes, seen);
960
+ }
961
+ assertPayloadSize(value, path, maxPayloadBytes);
962
+ } finally {
963
+ seen.delete(value);
964
+ }
965
+ }
966
+ function assertPayloadSize(value, path, maxPayloadBytes) {
967
+ const serialized = JSON.stringify(value);
968
+ if (serialized !== void 0 && utf8ByteLength(serialized) > maxPayloadBytes) {
969
+ throw new TypeError(`${path} exceeds ${maxPayloadBytes} bytes`);
970
+ }
971
+ }
972
+ function utf8ByteLength(value) {
973
+ let bytes = 0;
974
+ for (let i = 0; i < value.length; i += 1) {
975
+ const code = value.charCodeAt(i);
976
+ if (code < 128) {
977
+ bytes += 1;
978
+ } else if (code < 2048) {
979
+ bytes += 2;
980
+ } else if (code >= 55296 && code <= 56319 && i + 1 < value.length) {
981
+ const next = value.charCodeAt(i + 1);
982
+ if (next >= 56320 && next <= 57343) {
983
+ bytes += 4;
984
+ i += 1;
985
+ } else {
986
+ bytes += 3;
987
+ }
988
+ } else {
989
+ bytes += 3;
990
+ }
991
+ }
992
+ return bytes;
993
+ }
994
+ function sameMeta(a, b) {
995
+ const left = a;
996
+ const right = b;
997
+ const keys = Reflect.ownKeys(left);
998
+ if (keys.length !== Reflect.ownKeys(right).length) return false;
999
+ for (const key of keys) {
1000
+ if (!Object.is(left[key], right[key])) return false;
1001
+ }
1002
+ return true;
1003
+ }
1004
+ function pushUniqueMeta(registry, ctor, item) {
1005
+ const existing = registry.get(ctor) ?? [];
1006
+ if (existing.some((current) => sameMeta(current, item))) return;
1007
+ registry.set(ctor, [...existing, item]);
1008
+ }
1009
+ function registerMeta(registry, meta) {
1010
+ return ((targetOrValue, contextOrKey) => {
1011
+ if (typeof contextOrKey === "object" && contextOrKey !== null) {
1012
+ const methodKey = contextOrKey.name;
1013
+ contextOrKey.addInitializer(function() {
1014
+ const ctor2 = this.constructor;
1015
+ pushUniqueMeta(registry, ctor2, meta(methodKey));
1016
+ });
1017
+ return;
1018
+ }
1019
+ const ctor = targetOrValue.constructor;
1020
+ pushUniqueMeta(registry, ctor, meta(contextOrKey));
1021
+ });
1022
+ }
1023
+ function OnGraphEvent(nodeName) {
1024
+ return registerMeta(EVENT_HANDLERS, (methodKey) => ({ nodeName, methodKey }));
1025
+ }
1026
+ function GraphInterval(ms) {
1027
+ return registerMeta(INTERVAL_HANDLERS, (methodKey) => ({ ms, methodKey }));
1028
+ }
1029
+ // Annotate the CommonJS export names for ESM import in node:
1030
+ 0 && (module.exports = {
1031
+ CRON_HANDLERS,
1032
+ EVENT_HANDLERS,
1033
+ GRAPHREFLY_MODULE_OPTIONS,
1034
+ GRAPHREFLY_REQUEST_GRAPH,
1035
+ GRAPHREFLY_ROOT_GRAPH,
1036
+ GraphCron,
1037
+ GraphError,
1038
+ GraphFilter,
1039
+ GraphGuard,
1040
+ GraphGuardDecision,
1041
+ GraphHttpReply,
1042
+ GraphIntercept,
1043
+ GraphInterval,
1044
+ GraphLifecycle,
1045
+ GraphMessage,
1046
+ GraphMessageReply,
1047
+ GraphReq,
1048
+ GraphWs,
1049
+ GraphWsAck,
1050
+ GraphWsReply,
1051
+ INTERVAL_HANDLERS,
1052
+ NEST_BOUNDARY_BINDINGS,
1053
+ NEST_BOUNDARY_ENVELOPE_VERSION,
1054
+ NEST_BOUNDARY_PAYLOAD_MAX_BYTES,
1055
+ NEST_HTTP_DIAGNOSTICS_MAX_RETAINED,
1056
+ OnGraphEvent,
1057
+ bindingEmitOptions,
1058
+ bindingRequestId,
1059
+ createNestGraphBoundaryInterceptor,
1060
+ createNestGraphBoundaryRunner,
1061
+ fromNestCron,
1062
+ fromNestDiagnostics,
1063
+ fromNestError,
1064
+ fromNestGuard,
1065
+ fromNestIntercept,
1066
+ fromNestLifecycle,
1067
+ fromNestMessage,
1068
+ fromNestReq,
1069
+ fromNestWs,
1070
+ getGraphToken,
1071
+ getNestBoundaryBindings,
1072
+ getNestBoundaryToken,
1073
+ getNodeToken,
1074
+ isDataIssue,
1075
+ isHttpDataIssue,
1076
+ issueResponse,
1077
+ lowerHttpReplyPayload,
1078
+ lowerProtocolError,
1079
+ nestProvider,
1080
+ protocolError,
1081
+ resolveNestMethodKey,
1082
+ sanitizeNestDiagnostic,
1083
+ toNestHttp
1084
+ });
1085
+ //# sourceMappingURL=nestjs.cjs.map