@geekmidas/constructs 10.0.0-alpha.15 → 10.0.0-alpha.150

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 (454) hide show
  1. package/README.md +222 -158
  2. package/dist/Construct-127M7yrl.d.cts +231 -0
  3. package/dist/Construct-127M7yrl.d.cts.map +1 -0
  4. package/dist/{Construct-BeYVu_QF.mjs → Construct-CGuc_Ijk.mjs} +8 -9
  5. package/dist/Construct-CGuc_Ijk.mjs.map +1 -0
  6. package/dist/{Construct-DqdlARxq.cjs → Construct-DorKS0Ua.cjs} +8 -9
  7. package/dist/Construct-DorKS0Ua.cjs.map +1 -0
  8. package/dist/Construct-DySlwh8o.d.mts +231 -0
  9. package/dist/Construct-DySlwh8o.d.mts.map +1 -0
  10. package/dist/{Cron-DKqnnTdH.d.cts → Cron-D8mB_cPX.d.mts} +16 -9
  11. package/dist/Cron-D8mB_cPX.d.mts.map +1 -0
  12. package/dist/{Cron-SyqS5oWJ.d.mts → Cron-D_sfaMGz.d.cts} +16 -9
  13. package/dist/Cron-D_sfaMGz.d.cts.map +1 -0
  14. package/dist/{CronBuilder-D_0HNBTr.mjs → CronBuilder-BJ5LoadF.mjs} +28 -11
  15. package/dist/CronBuilder-BJ5LoadF.mjs.map +1 -0
  16. package/dist/{CronBuilder-BdnI6lxF.cjs → CronBuilder-B_NSP-Y5.cjs} +27 -10
  17. package/dist/CronBuilder-B_NSP-Y5.cjs.map +1 -0
  18. package/dist/CronBuilder-C91MVLSr.d.cts +47 -0
  19. package/dist/CronBuilder-C91MVLSr.d.cts.map +1 -0
  20. package/dist/CronBuilder-Cmajva3g.d.mts +47 -0
  21. package/dist/CronBuilder-Cmajva3g.d.mts.map +1 -0
  22. package/dist/Endpoint-52z1P0Ue.cjs +581 -0
  23. package/dist/Endpoint-52z1P0Ue.cjs.map +1 -0
  24. package/dist/{Endpoint-DuT4TEEq.d.mts → Endpoint-BbHh3Qoc.d.mts} +124 -43
  25. package/dist/Endpoint-BbHh3Qoc.d.mts.map +1 -0
  26. package/dist/{Endpoint-C6yyHpRS.d.cts → Endpoint-YYwjqtS1.d.cts} +122 -41
  27. package/dist/Endpoint-YYwjqtS1.d.cts.map +1 -0
  28. package/dist/Endpoint-sUOU7uLx.mjs +552 -0
  29. package/dist/Endpoint-sUOU7uLx.mjs.map +1 -0
  30. package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-Bzi9Sl7r.mjs} +269 -53
  31. package/dist/EndpointFactory-Bzi9Sl7r.mjs.map +1 -0
  32. package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-Cf_Cs1ym.cjs} +309 -51
  33. package/dist/EndpointFactory-Cf_Cs1ym.cjs.map +1 -0
  34. package/dist/{index-BPSZ_Lp_.d.cts → EndpointFactory-Hh1r6J_C.d.cts} +187 -104
  35. package/dist/EndpointFactory-Hh1r6J_C.d.cts.map +1 -0
  36. package/dist/{index-BoZ-iisU.d.mts → EndpointFactory-qcLzi4f-.d.mts} +188 -105
  37. package/dist/EndpointFactory-qcLzi4f-.d.mts.map +1 -0
  38. package/dist/Function-BIEsY0Hm.d.cts +76 -0
  39. package/dist/Function-BIEsY0Hm.d.cts.map +1 -0
  40. package/dist/Function-DfMzTGS4.d.mts +76 -0
  41. package/dist/Function-DfMzTGS4.d.mts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-BXBdb2Bt.cjs} +79 -31
  43. package/dist/HonoEndpointAdaptor-BXBdb2Bt.cjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-DR3j7S35.mjs} +76 -28
  45. package/dist/HonoEndpointAdaptor-DR3j7S35.mjs.map +1 -0
  46. package/dist/ObjectSubscriberBuilder-Cv8C7yS1.d.mts +129 -0
  47. package/dist/ObjectSubscriberBuilder-Cv8C7yS1.d.mts.map +1 -0
  48. package/dist/ObjectSubscriberBuilder-LWkey_oq.d.cts +129 -0
  49. package/dist/ObjectSubscriberBuilder-LWkey_oq.d.cts.map +1 -0
  50. package/dist/ProcessorBuilder-CwfP-M33.d.mts +216 -0
  51. package/dist/ProcessorBuilder-CwfP-M33.d.mts.map +1 -0
  52. package/dist/ProcessorBuilder-_jdZlbfW.d.cts +216 -0
  53. package/dist/ProcessorBuilder-_jdZlbfW.d.cts.map +1 -0
  54. package/dist/{Queue-D9X6OoON.d.mts → Queue-BnK3UH8r.d.mts} +42 -41
  55. package/dist/Queue-BnK3UH8r.d.mts.map +1 -0
  56. package/dist/{Queue-DYPB2KWL.d.cts → Queue-C4rijiM7.d.cts} +43 -42
  57. package/dist/Queue-C4rijiM7.d.cts.map +1 -0
  58. package/dist/Queue-D4Iaidrs.cjs +109 -0
  59. package/dist/Queue-D4Iaidrs.cjs.map +1 -0
  60. package/dist/Queue-u8w8_HpE.mjs +104 -0
  61. package/dist/Queue-u8w8_HpE.mjs.map +1 -0
  62. package/dist/QueueBuilder-2wP5lEC8.mjs +118 -0
  63. package/dist/QueueBuilder-2wP5lEC8.mjs.map +1 -0
  64. package/dist/QueueBuilder-BxsZ9o5z.cjs +135 -0
  65. package/dist/QueueBuilder-BxsZ9o5z.cjs.map +1 -0
  66. package/dist/QueueBuilder-DmwFtLzQ.d.mts +75 -0
  67. package/dist/QueueBuilder-DmwFtLzQ.d.mts.map +1 -0
  68. package/dist/QueueBuilder-SQli59An.d.cts +75 -0
  69. package/dist/QueueBuilder-SQli59An.d.cts.map +1 -0
  70. package/dist/Subscriber-5rCX1Nph.d.cts +83 -0
  71. package/dist/Subscriber-5rCX1Nph.d.cts.map +1 -0
  72. package/dist/Subscriber-CW_Dl-YR.d.mts +83 -0
  73. package/dist/Subscriber-CW_Dl-YR.d.mts.map +1 -0
  74. package/dist/SubscriberBuilder-BL_GTcwh.mjs +237 -0
  75. package/dist/SubscriberBuilder-BL_GTcwh.mjs.map +1 -0
  76. package/dist/SubscriberBuilder-CWzKwX1p.cjs +260 -0
  77. package/dist/SubscriberBuilder-CWzKwX1p.cjs.map +1 -0
  78. package/dist/Topic-DN2gYJ-p.mjs +99 -0
  79. package/dist/Topic-DN2gYJ-p.mjs.map +1 -0
  80. package/dist/Topic-Dp9Q7Lj2.cjs +104 -0
  81. package/dist/Topic-Dp9Q7Lj2.cjs.map +1 -0
  82. package/dist/adaptors/aws.cjs +134 -160
  83. package/dist/adaptors/aws.cjs.map +1 -1
  84. package/dist/adaptors/aws.d.cts +57 -48
  85. package/dist/adaptors/aws.d.cts.map +1 -1
  86. package/dist/adaptors/aws.d.mts +58 -49
  87. package/dist/adaptors/aws.d.mts.map +1 -1
  88. package/dist/adaptors/aws.mjs +130 -157
  89. package/dist/adaptors/aws.mjs.map +1 -1
  90. package/dist/adaptors/hono.cjs +1 -1
  91. package/dist/adaptors/hono.d.cts +5 -6
  92. package/dist/adaptors/hono.d.cts.map +1 -1
  93. package/dist/adaptors/hono.d.mts +6 -7
  94. package/dist/adaptors/hono.d.mts.map +1 -1
  95. package/dist/adaptors/hono.mjs +1 -1
  96. package/dist/adaptors/testing.cjs +955 -38
  97. package/dist/adaptors/testing.cjs.map +1 -1
  98. package/dist/adaptors/testing.d.cts +437 -39
  99. package/dist/adaptors/testing.d.cts.map +1 -1
  100. package/dist/adaptors/testing.d.mts +436 -38
  101. package/dist/adaptors/testing.d.mts.map +1 -1
  102. package/dist/adaptors/testing.mjs +929 -34
  103. package/dist/adaptors/testing.mjs.map +1 -1
  104. package/dist/auth-BqWz2JxC.d.cts +274 -0
  105. package/dist/auth-BqWz2JxC.d.cts.map +1 -0
  106. package/dist/auth-DnB9H9KL.d.mts +274 -0
  107. package/dist/auth-DnB9H9KL.d.mts.map +1 -0
  108. package/dist/auth.cjs +320 -21
  109. package/dist/auth.cjs.map +1 -1
  110. package/dist/auth.d.cts +2 -104
  111. package/dist/auth.d.mts +2 -104
  112. package/dist/auth.mjs +316 -23
  113. package/dist/auth.mjs.map +1 -1
  114. package/dist/cache-CQjMNPrC.d.cts +44 -0
  115. package/dist/cache-CQjMNPrC.d.cts.map +1 -0
  116. package/dist/cache-e3tfMQ9g.d.mts +44 -0
  117. package/dist/cache-e3tfMQ9g.d.mts.map +1 -0
  118. package/dist/cache.d.cts +2 -43
  119. package/dist/cache.d.mts +2 -43
  120. package/dist/cipher-C1lEFX63.mjs +225 -0
  121. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  122. package/dist/cipher-CVxfwLjk.cjs +332 -0
  123. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  124. package/dist/cipher-DSDxPRIp.d.cts +106 -0
  125. package/dist/cipher-DSDxPRIp.d.cts.map +1 -0
  126. package/dist/cipher-DSDxPRIp.d.mts +106 -0
  127. package/dist/cipher-DSDxPRIp.d.mts.map +1 -0
  128. package/dist/{construct-interface-DPlxfpoS.d.mts → construct-interface-CSA9VeWM.d.mts} +47 -8
  129. package/dist/construct-interface-CSA9VeWM.d.mts.map +1 -0
  130. package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-DugP0E5q.d.cts} +47 -8
  131. package/dist/construct-interface-DugP0E5q.d.cts.map +1 -0
  132. package/dist/construct-interface.cjs +38 -4
  133. package/dist/construct-interface.cjs.map +1 -1
  134. package/dist/construct-interface.d.cts +2 -2
  135. package/dist/construct-interface.d.mts +2 -2
  136. package/dist/construct-interface.mjs +37 -5
  137. package/dist/construct-interface.mjs.map +1 -1
  138. package/dist/credential-DYymbp_7.cjs +257 -0
  139. package/dist/credential-DYymbp_7.cjs.map +1 -0
  140. package/dist/credential-DfSAOOdY.mjs +222 -0
  141. package/dist/credential-DfSAOOdY.mjs.map +1 -0
  142. package/dist/credential.cjs +7 -129
  143. package/dist/credential.d.cts +2 -58
  144. package/dist/credential.d.mts +2 -58
  145. package/dist/credential.mjs +2 -128
  146. package/dist/crons/index.cjs +126 -1
  147. package/dist/crons/index.cjs.map +1 -1
  148. package/dist/crons/index.d.cts +43 -3
  149. package/dist/crons/index.d.cts.map +1 -1
  150. package/dist/crons/index.d.mts +43 -3
  151. package/dist/crons/index.d.mts.map +1 -1
  152. package/dist/crons/index.mjs +125 -2
  153. package/dist/crons/index.mjs.map +1 -1
  154. package/dist/database/kysely.cjs +3 -194
  155. package/dist/database/kysely.d.cts +2 -149
  156. package/dist/database/kysely.d.mts +2 -149
  157. package/dist/database/kysely.mjs +2 -192
  158. package/dist/email.d.cts +1 -1
  159. package/dist/email.d.cts.map +1 -1
  160. package/dist/email.d.mts +2 -2
  161. package/dist/email.d.mts.map +1 -1
  162. package/dist/encryption/kms.cjs +95 -0
  163. package/dist/encryption/kms.cjs.map +1 -0
  164. package/dist/encryption/kms.d.cts +7 -0
  165. package/dist/encryption/kms.d.cts.map +1 -0
  166. package/dist/encryption/kms.d.mts +7 -0
  167. package/dist/encryption/kms.d.mts.map +1 -0
  168. package/dist/encryption/kms.mjs +93 -0
  169. package/dist/encryption/kms.mjs.map +1 -0
  170. package/dist/encryption.cjs +116 -0
  171. package/dist/encryption.cjs.map +1 -0
  172. package/dist/encryption.d.cts +37 -0
  173. package/dist/encryption.d.cts.map +1 -0
  174. package/dist/encryption.d.mts +37 -0
  175. package/dist/encryption.d.mts.map +1 -0
  176. package/dist/encryption.mjs +101 -0
  177. package/dist/encryption.mjs.map +1 -0
  178. package/dist/endpoints/index.cjs +32 -10
  179. package/dist/endpoints/index.d.cts +106 -3
  180. package/dist/endpoints/index.d.cts.map +1 -0
  181. package/dist/endpoints/index.d.mts +106 -3
  182. package/dist/endpoints/index.d.mts.map +1 -0
  183. package/dist/endpoints/index.mjs +6 -4
  184. package/dist/expire-C586zznE.d.cts +38 -0
  185. package/dist/expire-C586zznE.d.cts.map +1 -0
  186. package/dist/expire-C586zznE.d.mts +38 -0
  187. package/dist/expire-C586zznE.d.mts.map +1 -0
  188. package/dist/expire-CieftS01.cjs +67 -0
  189. package/dist/expire-CieftS01.cjs.map +1 -0
  190. package/dist/expire-CpzUAfr9.mjs +50 -0
  191. package/dist/expire-CpzUAfr9.mjs.map +1 -0
  192. package/dist/external-api.cjs +106 -0
  193. package/dist/external-api.cjs.map +1 -0
  194. package/dist/external-api.d.cts +2 -0
  195. package/dist/external-api.d.mts +2 -0
  196. package/dist/external-api.mjs +103 -0
  197. package/dist/external-api.mjs.map +1 -0
  198. package/dist/fake-BqhP8RRQ.d.mts +201 -0
  199. package/dist/fake-BqhP8RRQ.d.mts.map +1 -0
  200. package/dist/fake-DqieDYYA.d.cts +201 -0
  201. package/dist/fake-DqieDYYA.d.cts.map +1 -0
  202. package/dist/file-server.cjs +123 -30
  203. package/dist/file-server.cjs.map +1 -1
  204. package/dist/file-server.d.cts +115 -1
  205. package/dist/file-server.d.cts.map +1 -1
  206. package/dist/file-server.d.mts +115 -1
  207. package/dist/file-server.d.mts.map +1 -1
  208. package/dist/file-server.mjs +122 -32
  209. package/dist/file-server.mjs.map +1 -1
  210. package/dist/functions/index.cjs +1 -1
  211. package/dist/functions/index.d.cts +2 -1
  212. package/dist/functions/index.d.mts +2 -1
  213. package/dist/functions/index.mjs +1 -1
  214. package/dist/{functions-C53GW2eQ.mjs → functions-BvIDQKAA.mjs} +117 -22
  215. package/dist/functions-BvIDQKAA.mjs.map +1 -0
  216. package/dist/{functions-B6qCvfmy.cjs → functions-DLF6-IK8.cjs} +122 -18
  217. package/dist/functions-DLF6-IK8.cjs.map +1 -0
  218. package/dist/inbox-CR3L1fOI.d.cts +195 -0
  219. package/dist/inbox-CR3L1fOI.d.cts.map +1 -0
  220. package/dist/inbox-CjxpLVkH.d.mts +195 -0
  221. package/dist/inbox-CjxpLVkH.d.mts.map +1 -0
  222. package/dist/inbox.cjs +291 -0
  223. package/dist/inbox.cjs.map +1 -0
  224. package/dist/inbox.d.cts +2 -0
  225. package/dist/inbox.d.mts +2 -0
  226. package/dist/inbox.mjs +283 -0
  227. package/dist/inbox.mjs.map +1 -0
  228. package/dist/index-DCkDQkwj.d.mts +115 -0
  229. package/dist/index-DCkDQkwj.d.mts.map +1 -0
  230. package/dist/index-DPTHa6Ud.d.cts +115 -0
  231. package/dist/index-DPTHa6Ud.d.cts.map +1 -0
  232. package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
  233. package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
  234. package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
  235. package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
  236. package/dist/index.cjs +4 -1
  237. package/dist/index.d.cts +26 -3
  238. package/dist/index.d.cts.map +1 -0
  239. package/dist/index.d.mts +26 -3
  240. package/dist/index.d.mts.map +1 -0
  241. package/dist/index.mjs +3 -2
  242. package/dist/kysely-CebjCWTl.d.cts +216 -0
  243. package/dist/kysely-CebjCWTl.d.cts.map +1 -0
  244. package/dist/kysely-Cs4uPO8k.mjs +371 -0
  245. package/dist/kysely-Cs4uPO8k.mjs.map +1 -0
  246. package/dist/kysely-CukArHJ0.cjs +384 -0
  247. package/dist/kysely-CukArHJ0.cjs.map +1 -0
  248. package/dist/kysely-DE4kADWD.d.mts +216 -0
  249. package/dist/kysely-DE4kADWD.d.mts.map +1 -0
  250. package/dist/{telemetry-DGcFlVpB.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +2 -2
  251. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  252. package/dist/{telemetry-DGcFlVpB.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +2 -2
  253. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  254. package/dist/mobile-app.cjs +74 -0
  255. package/dist/mobile-app.cjs.map +1 -0
  256. package/dist/mobile-app.d.cts +73 -0
  257. package/dist/mobile-app.d.cts.map +1 -0
  258. package/dist/mobile-app.d.mts +73 -0
  259. package/dist/mobile-app.d.mts.map +1 -0
  260. package/dist/mobile-app.mjs +73 -0
  261. package/dist/mobile-app.mjs.map +1 -0
  262. package/dist/object-storage.cjs +8 -1
  263. package/dist/object-storage.cjs.map +1 -1
  264. package/dist/object-storage.d.cts +10 -1
  265. package/dist/object-storage.d.cts.map +1 -1
  266. package/dist/object-storage.d.mts +10 -1
  267. package/dist/object-storage.d.mts.map +1 -1
  268. package/dist/object-storage.mjs +7 -2
  269. package/dist/object-storage.mjs.map +1 -1
  270. package/dist/pattern-C1CEcglD.mjs +241 -0
  271. package/dist/pattern-C1CEcglD.mjs.map +1 -0
  272. package/dist/pattern-QFaUIr77.cjs +288 -0
  273. package/dist/pattern-QFaUIr77.cjs.map +1 -0
  274. package/dist/processors/index.cjs +214 -0
  275. package/dist/processors/index.cjs.map +1 -0
  276. package/dist/processors/index.d.cts +78 -0
  277. package/dist/processors/index.d.cts.map +1 -0
  278. package/dist/processors/index.d.mts +78 -0
  279. package/dist/processors/index.d.mts.map +1 -0
  280. package/dist/processors/index.mjs +193 -0
  281. package/dist/processors/index.mjs.map +1 -0
  282. package/dist/queue/index.cjs +5 -192
  283. package/dist/queue/index.d.cts +3 -53
  284. package/dist/queue/index.d.mts +3 -53
  285. package/dist/queue/index.mjs +3 -190
  286. package/dist/random-password.cjs +86 -0
  287. package/dist/random-password.cjs.map +1 -0
  288. package/dist/random-password.d.cts +30 -0
  289. package/dist/random-password.d.cts.map +1 -0
  290. package/dist/random-password.d.mts +30 -0
  291. package/dist/random-password.d.mts.map +1 -0
  292. package/dist/random-password.mjs +84 -0
  293. package/dist/random-password.mjs.map +1 -0
  294. package/dist/{lazyAccessors-BHtcqgz2.mjs → readRequestBody-BTIl3k-D.mjs} +99 -39
  295. package/dist/readRequestBody-BTIl3k-D.mjs.map +1 -0
  296. package/dist/{lazyAccessors-Dx9NLwJZ.cjs → readRequestBody-Dej_L3c4.cjs} +118 -46
  297. package/dist/readRequestBody-Dej_L3c4.cjs.map +1 -0
  298. package/dist/requestLogger-BZcXwdBs.cjs +207 -0
  299. package/dist/requestLogger-BZcXwdBs.cjs.map +1 -0
  300. package/dist/requestLogger-pA4gi3E1.mjs +178 -0
  301. package/dist/requestLogger-pA4gi3E1.mjs.map +1 -0
  302. package/dist/rest-api.cjs +85 -70
  303. package/dist/rest-api.cjs.map +1 -1
  304. package/dist/rest-api.d.cts +77 -59
  305. package/dist/rest-api.d.cts.map +1 -1
  306. package/dist/rest-api.d.mts +77 -59
  307. package/dist/rest-api.d.mts.map +1 -1
  308. package/dist/rest-api.mjs +87 -72
  309. package/dist/rest-api.mjs.map +1 -1
  310. package/dist/runSubscriber-CC_2C9F2.cjs +133 -0
  311. package/dist/runSubscriber-CC_2C9F2.cjs.map +1 -0
  312. package/dist/runSubscriber-DyHWp_Lf.mjs +116 -0
  313. package/dist/runSubscriber-DyHWp_Lf.mjs.map +1 -0
  314. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  315. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  316. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  317. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  318. package/dist/site.cjs +85 -8
  319. package/dist/site.cjs.map +1 -1
  320. package/dist/site.d.cts +98 -2
  321. package/dist/site.d.cts.map +1 -1
  322. package/dist/site.d.mts +98 -2
  323. package/dist/site.d.mts.map +1 -1
  324. package/dist/site.mjs +84 -11
  325. package/dist/site.mjs.map +1 -1
  326. package/dist/stages-DaTaoQei.d.cts +73 -0
  327. package/dist/stages-DaTaoQei.d.cts.map +1 -0
  328. package/dist/stages-DaTaoQei.d.mts +73 -0
  329. package/dist/stages-DaTaoQei.d.mts.map +1 -0
  330. package/dist/subscribers/index.cjs +134 -1
  331. package/dist/subscribers/index.cjs.map +1 -0
  332. package/dist/subscribers/index.d.cts +74 -3
  333. package/dist/subscribers/index.d.cts.map +1 -0
  334. package/dist/subscribers/index.d.mts +74 -3
  335. package/dist/subscribers/index.d.mts.map +1 -0
  336. package/dist/subscribers/index.mjs +132 -2
  337. package/dist/subscribers/index.mjs.map +1 -0
  338. package/dist/telemetry-C1oqncFY.d.cts +40 -0
  339. package/dist/telemetry-C1oqncFY.d.cts.map +1 -0
  340. package/dist/telemetry-CObow3Dn.d.mts +40 -0
  341. package/dist/telemetry-CObow3Dn.d.mts.map +1 -0
  342. package/dist/telemetry.cjs +56 -0
  343. package/dist/telemetry.cjs.map +1 -0
  344. package/dist/telemetry.d.cts +2 -0
  345. package/dist/telemetry.d.mts +2 -0
  346. package/dist/telemetry.mjs +55 -0
  347. package/dist/telemetry.mjs.map +1 -0
  348. package/dist/topic/index.cjs +2 -134
  349. package/dist/topic/index.d.cts +2 -3
  350. package/dist/topic/index.d.mts +2 -3
  351. package/dist/topic/index.mjs +2 -132
  352. package/dist/tracing-Bbj1uoFJ.mjs +127 -0
  353. package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
  354. package/dist/tracing-C0ooU0V2.cjs +150 -0
  355. package/dist/tracing-C0ooU0V2.cjs.map +1 -0
  356. package/dist/websocket-api.cjs +951 -0
  357. package/dist/websocket-api.cjs.map +1 -0
  358. package/dist/websocket-api.d.cts +556 -0
  359. package/dist/websocket-api.d.cts.map +1 -0
  360. package/dist/websocket-api.d.mts +556 -0
  361. package/dist/websocket-api.d.mts.map +1 -0
  362. package/dist/websocket-api.mjs +933 -0
  363. package/dist/websocket-api.mjs.map +1 -0
  364. package/dist/worker.cjs +174 -32
  365. package/dist/worker.cjs.map +1 -1
  366. package/dist/worker.d.cts +147 -47
  367. package/dist/worker.d.cts.map +1 -1
  368. package/dist/worker.d.mts +147 -47
  369. package/dist/worker.d.mts.map +1 -1
  370. package/dist/worker.mjs +175 -33
  371. package/dist/worker.mjs.map +1 -1
  372. package/package.json +155 -44
  373. package/dist/Construct-BeYVu_QF.mjs.map +0 -1
  374. package/dist/Construct-DfbwIntp.d.cts +0 -115
  375. package/dist/Construct-DfbwIntp.d.cts.map +0 -1
  376. package/dist/Construct-DqdlARxq.cjs.map +0 -1
  377. package/dist/Construct-l5aOn_jv.d.mts +0 -115
  378. package/dist/Construct-l5aOn_jv.d.mts.map +0 -1
  379. package/dist/Cron-DKqnnTdH.d.cts.map +0 -1
  380. package/dist/Cron-SyqS5oWJ.d.mts.map +0 -1
  381. package/dist/CronBuilder-BdnI6lxF.cjs.map +0 -1
  382. package/dist/CronBuilder-CRGnDfTq.d.mts +0 -41
  383. package/dist/CronBuilder-CRGnDfTq.d.mts.map +0 -1
  384. package/dist/CronBuilder-D_0HNBTr.mjs.map +0 -1
  385. package/dist/CronBuilder-Df1q9PNy.d.cts +0 -41
  386. package/dist/CronBuilder-Df1q9PNy.d.cts.map +0 -1
  387. package/dist/Endpoint-BpZHtJ2W.cjs +0 -1689
  388. package/dist/Endpoint-BpZHtJ2W.cjs.map +0 -1
  389. package/dist/Endpoint-C6yyHpRS.d.cts.map +0 -1
  390. package/dist/Endpoint-DuT4TEEq.d.mts.map +0 -1
  391. package/dist/Endpoint-ONsly_dq.mjs +0 -1671
  392. package/dist/Endpoint-ONsly_dq.mjs.map +0 -1
  393. package/dist/EndpointFactory-Bm3aKRdV.mjs.map +0 -1
  394. package/dist/EndpointFactory-CLvWuHyt.cjs.map +0 -1
  395. package/dist/HonoEndpointAdaptor-92zavCsV.cjs.map +0 -1
  396. package/dist/HonoEndpointAdaptor-yYaU7jVJ.mjs.map +0 -1
  397. package/dist/Queue-D9X6OoON.d.mts.map +0 -1
  398. package/dist/Queue-DYPB2KWL.d.cts.map +0 -1
  399. package/dist/Subscriber-C4heaAyO.d.mts +0 -51
  400. package/dist/Subscriber-C4heaAyO.d.mts.map +0 -1
  401. package/dist/Subscriber-CotDUELC.d.cts +0 -51
  402. package/dist/Subscriber-CotDUELC.d.cts.map +0 -1
  403. package/dist/SubscriberBuilder-BEv0eoHy.d.cts +0 -59
  404. package/dist/SubscriberBuilder-BEv0eoHy.d.cts.map +0 -1
  405. package/dist/SubscriberBuilder-C0ZEtGDI.cjs +0 -125
  406. package/dist/SubscriberBuilder-C0ZEtGDI.cjs.map +0 -1
  407. package/dist/SubscriberBuilder-h7B_cHMr.mjs +0 -114
  408. package/dist/SubscriberBuilder-h7B_cHMr.mjs.map +0 -1
  409. package/dist/SubscriberBuilder-tyH5yTk5.d.mts +0 -59
  410. package/dist/SubscriberBuilder-tyH5yTk5.d.mts.map +0 -1
  411. package/dist/Topic-DEVGo0Dm.d.cts +0 -89
  412. package/dist/Topic-DEVGo0Dm.d.cts.map +0 -1
  413. package/dist/Topic-zk_6Gthr.d.mts +0 -89
  414. package/dist/Topic-zk_6Gthr.d.mts.map +0 -1
  415. package/dist/auth.d.cts.map +0 -1
  416. package/dist/auth.d.mts.map +0 -1
  417. package/dist/cache.d.cts.map +0 -1
  418. package/dist/cache.d.mts.map +0 -1
  419. package/dist/construct-interface-DPlxfpoS.d.mts.map +0 -1
  420. package/dist/construct-interface-DgXTJcOD.d.cts.map +0 -1
  421. package/dist/credential.cjs.map +0 -1
  422. package/dist/credential.d.cts.map +0 -1
  423. package/dist/credential.d.mts.map +0 -1
  424. package/dist/credential.mjs.map +0 -1
  425. package/dist/database/kysely.cjs.map +0 -1
  426. package/dist/database/kysely.d.cts.map +0 -1
  427. package/dist/database/kysely.d.mts.map +0 -1
  428. package/dist/database/kysely.mjs.map +0 -1
  429. package/dist/functions-B6qCvfmy.cjs.map +0 -1
  430. package/dist/functions-C53GW2eQ.mjs.map +0 -1
  431. package/dist/index-B2urf3YI.d.cts +0 -26
  432. package/dist/index-B2urf3YI.d.cts.map +0 -1
  433. package/dist/index-BPSZ_Lp_.d.cts.map +0 -1
  434. package/dist/index-BoZ-iisU.d.mts.map +0 -1
  435. package/dist/index-CdaU--_B.d.cts +0 -165
  436. package/dist/index-CdaU--_B.d.cts.map +0 -1
  437. package/dist/index-DMCDvnsM.d.mts +0 -26
  438. package/dist/index-DMCDvnsM.d.mts.map +0 -1
  439. package/dist/index-PQRWOQj4.d.mts +0 -165
  440. package/dist/index-PQRWOQj4.d.mts.map +0 -1
  441. package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
  442. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
  443. package/dist/processAudits-BpRlPQMW.mjs +0 -77
  444. package/dist/processAudits-BpRlPQMW.mjs.map +0 -1
  445. package/dist/processAudits-D_2W5x8k.cjs +0 -88
  446. package/dist/processAudits-D_2W5x8k.cjs.map +0 -1
  447. package/dist/queue/index.cjs.map +0 -1
  448. package/dist/queue/index.d.cts.map +0 -1
  449. package/dist/queue/index.d.mts.map +0 -1
  450. package/dist/queue/index.mjs.map +0 -1
  451. package/dist/telemetry-DGcFlVpB.d.cts.map +0 -1
  452. package/dist/telemetry-DGcFlVpB.d.mts.map +0 -1
  453. package/dist/topic/index.cjs.map +0 -1
  454. package/dist/topic/index.mjs.map +0 -1
@@ -0,0 +1,951 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_shutdown = require("./shutdown-BMJmAhSt.cjs");
3
+ const require_construct_interface = require("./construct-interface.cjs");
4
+ const require_surfaceEnv = require("./surfaceEnv-CNimK76p.cjs");
5
+ let _geekmidas_manifest = require("@geekmidas/manifest");
6
+ let _geekmidas_logger_console = require("@geekmidas/logger/console");
7
+ let node_crypto = require("node:crypto");
8
+ let _geekmidas_services = require("@geekmidas/services");
9
+ let _geekmidas_errors = require("@geekmidas/errors");
10
+ let _geekmidas_schema_conversion = require("@geekmidas/schema/conversion");
11
+ //#region src/websocket/frame.ts
12
+ /**
13
+ * The shape a surface's frames take on the wire.
14
+ *
15
+ * By default a frame is `{ "action": …, "id"?: …, "data": … }` — API
16
+ * Gateway's shape. A surface that names a discriminator — `frame: {
17
+ * discriminator: 'type' }` — sends and reads flat frames instead: the action
18
+ * under that key, and the data's own fields beside it.
19
+ *
20
+ * ```json
21
+ * {"type":"chat.message.created","chatId":"c1","message":{…}}
22
+ * ```
23
+ *
24
+ * A flat frame has no `id` of its own: every field but the discriminator is
25
+ * the data, so a reply is paired by its action, not an echoed id.
26
+ */
27
+ /** A declared message whose schema does not describe an object. */
28
+ var WebSocketMessageNotAnObject = class extends Error {
29
+ surface;
30
+ action;
31
+ discriminator;
32
+ constructor(surface, action, discriminator) {
33
+ super(`${surface} sends flat frames, keyed by '${discriminator}', so each message's fields sit beside it — but '${action}' is not an object schema. Declare it as an object (z.object({ … })), or drop \`frame\` to send { action, data }.`);
34
+ this.surface = surface;
35
+ this.action = action;
36
+ this.discriminator = discriminator;
37
+ this.name = "WebSocketMessageNotAnObject";
38
+ }
39
+ };
40
+ /** A declared message whose schema has a field named the discriminator. */
41
+ var WebSocketMessageDeclaresDiscriminator = class extends Error {
42
+ surface;
43
+ action;
44
+ discriminator;
45
+ constructor(surface, action, discriminator) {
46
+ super(`${surface}'s '${action}' message declares a '${discriminator}' field, which is where its flat frames keep the action. Rename the field, or give \`frame.discriminator\` a key no message uses.`);
47
+ this.surface = surface;
48
+ this.action = action;
49
+ this.discriminator = discriminator;
50
+ this.name = "WebSocketMessageDeclaresDiscriminator";
51
+ }
52
+ };
53
+ /** Data sent in a flat frame that is not an object. */
54
+ var WebSocketDataNotAnObject = class extends Error {
55
+ surface;
56
+ action;
57
+ discriminator;
58
+ constructor(surface, action, discriminator) {
59
+ super(`${surface} sends flat frames, keyed by '${discriminator}', and '${action}''s data is not an object, so it has no fields to put beside it. Send an object. Nothing was sent.`);
60
+ this.surface = surface;
61
+ this.action = action;
62
+ this.discriminator = discriminator;
63
+ this.name = "WebSocketDataNotAnObject";
64
+ }
65
+ };
66
+ /** Data sent in a flat frame that carries the discriminator itself. */
67
+ var WebSocketDataHasDiscriminator = class extends Error {
68
+ surface;
69
+ action;
70
+ discriminator;
71
+ constructor(surface, action, discriminator) {
72
+ super(`'${action}''s data on ${surface} has a '${discriminator}' field, which is where its flat frames keep the action. Rename the field. Nothing was sent.`);
73
+ this.surface = surface;
74
+ this.action = action;
75
+ this.discriminator = discriminator;
76
+ this.name = "WebSocketDataHasDiscriminator";
77
+ }
78
+ };
79
+ /** How one surface writes and reads its frames. */
80
+ var FrameShape = class {
81
+ surface;
82
+ discriminator;
83
+ constructor(surface, discriminator) {
84
+ this.surface = surface;
85
+ this.discriminator = discriminator;
86
+ }
87
+ /** The key an inbound frame names its action under. */
88
+ get key() {
89
+ return this.discriminator ?? "action";
90
+ }
91
+ /**
92
+ * The frame for `action`'s `data`, serialised.
93
+ *
94
+ * @throws {WebSocketDataNotAnObject}, {WebSocketDataHasDiscriminator} for
95
+ * a flat frame whose data cannot sit beside the discriminator.
96
+ */
97
+ encode(action, data, id) {
98
+ const { discriminator } = this;
99
+ if (discriminator === void 0) return JSON.stringify({
100
+ action,
101
+ ...id !== void 0 ? { id } : {},
102
+ data
103
+ });
104
+ if (!isRecord(data)) throw new WebSocketDataNotAnObject(this.surface, action, discriminator);
105
+ if (Object.hasOwn(data, discriminator)) throw new WebSocketDataHasDiscriminator(this.surface, action, discriminator);
106
+ return JSON.stringify({
107
+ [discriminator]: action,
108
+ ...data
109
+ });
110
+ }
111
+ /** A parsed frame's action, id and data — `undefined` when it names none. */
112
+ decode(frame) {
113
+ if (!isRecord(frame)) return void 0;
114
+ const { discriminator } = this;
115
+ if (discriminator === void 0) {
116
+ if (typeof frame.action !== "string") return void 0;
117
+ return {
118
+ action: frame.action,
119
+ ...isId(frame.id) ? { id: frame.id } : {},
120
+ data: frame.data
121
+ };
122
+ }
123
+ const { [discriminator]: action, ...data } = frame;
124
+ if (typeof action !== "string") return void 0;
125
+ return {
126
+ action,
127
+ data
128
+ };
129
+ }
130
+ /** The id a frame that names no action carried, to echo on its error. */
131
+ idOf(frame) {
132
+ if (this.discriminator !== void 0 || !isRecord(frame)) return void 0;
133
+ return isId(frame.id) ? frame.id : void 0;
134
+ }
135
+ /**
136
+ * Refuse a declared message a flat frame cannot carry: one that is not an
137
+ * object, or that has a field named the discriminator.
138
+ *
139
+ * @throws {WebSocketMessageNotAnObject}, {WebSocketMessageDeclaresDiscriminator}
140
+ */
141
+ check(messages) {
142
+ const { discriminator } = this;
143
+ if (discriminator === void 0) return;
144
+ for (const [action, schema] of Object.entries(messages)) {
145
+ const shape = objectShape((0, _geekmidas_schema_conversion.toJsonSchema)(schema));
146
+ if (!shape) throw new WebSocketMessageNotAnObject(this.surface, action, discriminator);
147
+ if (shape.has(discriminator)) throw new WebSocketMessageDeclaresDiscriminator(this.surface, action, discriminator);
148
+ }
149
+ }
150
+ };
151
+ /**
152
+ * The fields a JSON Schema's object declares, or `undefined` when it is not
153
+ * an object. A union or intersection is one when each of its members is.
154
+ */
155
+ function objectShape(schema) {
156
+ if (!isRecord(schema)) return void 0;
157
+ const members = schema.anyOf ?? schema.oneOf ?? schema.allOf;
158
+ if (Array.isArray(members) && members.length > 0) {
159
+ const fields = /* @__PURE__ */ new Set();
160
+ for (const member of members) {
161
+ const shape = objectShape(member);
162
+ if (!shape) return void 0;
163
+ for (const field of shape) fields.add(field);
164
+ }
165
+ return fields;
166
+ }
167
+ if (schema.type !== "object") return void 0;
168
+ return new Set(isRecord(schema.properties) ? Object.keys(schema.properties) : []);
169
+ }
170
+ function isRecord(value) {
171
+ return typeof value === "object" && value !== null && !Array.isArray(value);
172
+ }
173
+ function isId(value) {
174
+ return typeof value === "string" || typeof value === "number";
175
+ }
176
+ /** A connection string names no transport this package knows. */
177
+ var UnsupportedWebSocketTransport = class extends Error {
178
+ connectionString;
179
+ constructor(connectionString) {
180
+ super(`'${redact(connectionString)}' is not a WebSocket publisher connection string. Use redis://, rediss:// or memory:// — gkm composes it as <ID>_PUBLISHER_CONNECTION_STRING.`);
181
+ this.connectionString = connectionString;
182
+ this.name = "UnsupportedWebSocketTransport";
183
+ }
184
+ };
185
+ /** The scheme alone, so an error never prints a password. */
186
+ function redact(connectionString) {
187
+ const scheme = connectionString.split("://")[0];
188
+ return scheme && scheme !== connectionString ? `${scheme}://…` : connectionString.slice(0, 12);
189
+ }
190
+ const key = Symbol.for("@geekmidas/constructs/websocket/memory");
191
+ const registry = globalThis;
192
+ registry[key] ??= /* @__PURE__ */ new Map();
193
+ const channels = registry[key];
194
+ /**
195
+ * In one process: the server and whoever sends meet in a map, keyed by the
196
+ * channel the connection string names.
197
+ */
198
+ var MemoryTransport = class {
199
+ channel;
200
+ subscribed = /* @__PURE__ */ new Set();
201
+ constructor(channel) {
202
+ this.channel = channel;
203
+ }
204
+ async publish(instance, delivery) {
205
+ const instances = channels.get(this.channel);
206
+ if (!instances) return;
207
+ if (instance === "*") {
208
+ for (const receive of instances.values()) receive(delivery);
209
+ return;
210
+ }
211
+ instances.get(instance)?.(delivery);
212
+ }
213
+ async subscribe(instance, receive) {
214
+ let instances = channels.get(this.channel);
215
+ if (!instances) {
216
+ instances = /* @__PURE__ */ new Map();
217
+ channels.set(this.channel, instances);
218
+ }
219
+ instances.set(instance, receive);
220
+ this.subscribed.add(instance);
221
+ }
222
+ async close() {
223
+ const instances = channels.get(this.channel);
224
+ for (const instance of this.subscribed) instances?.delete(instance);
225
+ this.subscribed.clear();
226
+ }
227
+ };
228
+ /**
229
+ * Over Redis pub/sub: one channel per instance and one for broadcasts, under
230
+ * a prefix that keeps two surfaces — or two projects on one Redis — apart.
231
+ * Channels are not scoped by database index, so the prefix is what does it.
232
+ *
233
+ * Publishing and subscribing take separate connections, because a connection
234
+ * that has subscribed can do nothing else.
235
+ */
236
+ var RedisTransport = class {
237
+ client;
238
+ prefix;
239
+ subscriber;
240
+ closed;
241
+ constructor(client, prefix) {
242
+ this.client = client;
243
+ this.prefix = prefix;
244
+ }
245
+ channel(instance) {
246
+ return `${this.prefix}:${instance}`;
247
+ }
248
+ async publish(instance, delivery) {
249
+ await this.client.publish(this.channel(instance), JSON.stringify(delivery));
250
+ }
251
+ async subscribe(instance, receive) {
252
+ const subscriber = this.client.duplicate();
253
+ this.subscriber = subscriber;
254
+ const own = this.channel(instance);
255
+ const every = this.channel("*");
256
+ subscriber.on("message", (channel, message) => {
257
+ if (channel !== own && channel !== every) return;
258
+ receive(JSON.parse(message));
259
+ });
260
+ await subscriber.subscribe(own, every);
261
+ }
262
+ /** Idempotent: the server and a shutdown hook may both close it. */
263
+ close() {
264
+ this.closed ??= Promise.all([this.subscriber?.quit(), this.client.quit()]).then(() => void 0);
265
+ return this.closed;
266
+ }
267
+ };
268
+ /**
269
+ * The transport a connection string names.
270
+ *
271
+ * `redis://` and `rediss://` take an optional `channel` query parameter, the
272
+ * prefix every channel is named under; `memory://<channel>` is in-process.
273
+ * Absent, the channel is `fallback` — the surface's own.
274
+ */
275
+ async function transportFromConnectionString(connectionString, fallback) {
276
+ if (connectionString.startsWith("memory://")) return new MemoryTransport(connectionString.slice(9) || fallback);
277
+ const url = URL.canParse(connectionString) ? new URL(connectionString) : void 0;
278
+ if (!url) throw new UnsupportedWebSocketTransport(connectionString);
279
+ if (url.protocol === "redis:" || url.protocol === "rediss:") {
280
+ const channel = url.searchParams.get("channel") || fallback;
281
+ url.searchParams.delete("channel");
282
+ const { Redis } = await import("ioredis");
283
+ return new RedisTransport(new Redis(url.toString(), {
284
+ maxRetriesPerRequest: null,
285
+ lazyConnect: false
286
+ }), channel);
287
+ }
288
+ throw new UnsupportedWebSocketTransport(connectionString);
289
+ }
290
+ //#endregion
291
+ //#region src/websocket/publisher.ts
292
+ /** The instance a connection id was issued by: everything before its dot. */
293
+ function instanceOf(connectionId) {
294
+ const dot = connectionId.indexOf(".");
295
+ return dot > 0 ? connectionId.slice(0, dot) : void 0;
296
+ }
297
+ /** A message sent on an action the surface does not declare. */
298
+ var UnknownWebSocketMessage = class extends Error {
299
+ surface;
300
+ action;
301
+ declared;
302
+ constructor(surface, action, declared) {
303
+ super(`${surface} sends no '${action}' message. It declares ${declared.map((a) => `'${a}'`).join(", ")} — send one of them, or add '${action}' to its messages.`);
304
+ this.surface = surface;
305
+ this.action = action;
306
+ this.declared = declared;
307
+ this.name = "UnknownWebSocketMessage";
308
+ }
309
+ };
310
+ /** A message whose data its action's schema refused. */
311
+ var InvalidWebSocketMessage = class extends Error {
312
+ surface;
313
+ action;
314
+ issues;
315
+ constructor(surface, action, issues) {
316
+ super(`${surface}'s '${action}' message was refused by its schema: ${issues.map((issue) => issue.message).join("; ")}. Nothing was sent.`);
317
+ this.surface = surface;
318
+ this.action = action;
319
+ this.issues = issues;
320
+ this.name = "InvalidWebSocketMessage";
321
+ }
322
+ };
323
+ /**
324
+ * How anything reaches a socket — `services.realtime` in an endpoint, and
325
+ * `sockets` in a route of the surface itself.
326
+ *
327
+ * A message is `{ action, data }`, the shape a client's frames arrive in —
328
+ * or, where the surface names a `frame.discriminator`, flat: `{ [key]: action,
329
+ * ...data }`.
330
+ * Where the surface declares its messages, `action` is one of them and
331
+ * `data` is typed and checked by its schema before anything is sent; where it
332
+ * declares none, any action and any JSON value go. A message is serialised
333
+ * once, whatever the number of sockets it goes to. An id whose process has
334
+ * gone is dropped silently, as API Gateway's `postToConnection` to a closed
335
+ * connection is a no-op the sender rarely wants to handle.
336
+ */
337
+ var WebSocketPublisher = class {
338
+ transport;
339
+ local;
340
+ declared;
341
+ frame;
342
+ constructor(transport, local, declared, frame = new FrameShape(declared?.surface ?? "")) {
343
+ this.transport = transport;
344
+ this.local = local;
345
+ this.declared = declared;
346
+ this.frame = frame;
347
+ }
348
+ /** Send `action`'s message to each connection. */
349
+ async send(ids, action, data) {
350
+ const payload = await this.payload(action, data);
351
+ await this.each(ids, (group) => ({
352
+ kind: "send",
353
+ ids: group,
354
+ payload
355
+ }));
356
+ }
357
+ /** Send `action`'s message to every open connection, on every process. */
358
+ async broadcast(action, data, options = {}) {
359
+ const payload = await this.payload(action, data);
360
+ await this.transport.publish("*", {
361
+ kind: "broadcast",
362
+ payload,
363
+ ...options.except?.length ? { except: options.except } : {}
364
+ });
365
+ }
366
+ /** Close each connection, with a close code and reason its client sees. */
367
+ async close(ids, code = 1e3, reason = "") {
368
+ await this.each(ids, (group) => ({
369
+ kind: "close",
370
+ ids: group,
371
+ code,
372
+ reason
373
+ }));
374
+ }
375
+ /**
376
+ * The frame, checked by the action's schema where the surface declares
377
+ * its messages.
378
+ *
379
+ * @throws {UnknownWebSocketMessage}, {InvalidWebSocketMessage}, and for a
380
+ * flat frame {WebSocketDataNotAnObject}, {WebSocketDataHasDiscriminator}
381
+ */
382
+ async payload(action, data) {
383
+ if (!this.declared) return this.frame.encode(action, data);
384
+ const { surface, messages } = this.declared;
385
+ const schema = messages[action];
386
+ if (!schema) throw new UnknownWebSocketMessage(surface, action, Object.keys(messages));
387
+ const result = await schema["~standard"].validate(data);
388
+ if (result.issues) throw new InvalidWebSocketMessage(surface, action, result.issues);
389
+ return this.frame.encode(action, result.value);
390
+ }
391
+ /** One delivery per process that holds any of `ids`. */
392
+ async each(ids, delivery) {
393
+ const byInstance = /* @__PURE__ */ new Map();
394
+ for (const id of typeof ids === "string" ? [ids] : ids) {
395
+ const instance = instanceOf(id);
396
+ if (!instance) continue;
397
+ const group = byInstance.get(instance) ?? [];
398
+ group.push(id);
399
+ byInstance.set(instance, group);
400
+ }
401
+ await Promise.all([...byInstance].map(([instance, group]) => this.local?.instance === instance ? this.local.deliver(delivery(group)) : this.transport.publish(instance, delivery(group))));
402
+ }
403
+ };
404
+ //#endregion
405
+ //#region src/websocket/route.ts
406
+ /**
407
+ * A handler bound to a WebSocket surface — what `realtime.route('chat.send')
408
+ * …handle()` returns, and what a file exports.
409
+ *
410
+ * Carries `surface` and `constructs` the way an endpoint does, so discovery
411
+ * records what its process reaches without knowing what a route is.
412
+ */
413
+ var WebSocketRoute = class {
414
+ kind;
415
+ action;
416
+ surface;
417
+ services;
418
+ constructs;
419
+ handler;
420
+ schema;
421
+ __IS_WEBSOCKET_ROUTE__ = true;
422
+ static isRoute(value) {
423
+ return Boolean(value && value.__IS_WEBSOCKET_ROUTE__ === true);
424
+ }
425
+ constructor(kind, action, surface, services, constructs, handler, schema) {
426
+ this.kind = kind;
427
+ this.action = action;
428
+ this.surface = surface;
429
+ this.services = services;
430
+ this.constructs = constructs;
431
+ this.handler = handler;
432
+ this.schema = schema;
433
+ }
434
+ };
435
+ /** The builder `connect()`, `disconnect()` and `route()` start. */
436
+ var WebSocketRouteBuilder = class WebSocketRouteBuilder {
437
+ kind;
438
+ action;
439
+ surface;
440
+ _services;
441
+ _constructs;
442
+ schema;
443
+ constructor(kind, action, surface, _services = [], _constructs = [], schema) {
444
+ this.kind = kind;
445
+ this.action = action;
446
+ this.surface = surface;
447
+ this._services = _services;
448
+ this._constructs = _constructs;
449
+ this.schema = schema;
450
+ }
451
+ /** The schema a frame's `data` must satisfy before the handler runs. */
452
+ body(schema) {
453
+ return new WebSocketRouteBuilder(this.kind, this.action, this.surface, this._services, this._constructs, schema);
454
+ }
455
+ /** What the handler reaches, as `services.<id>` — per route, as an endpoint's. */
456
+ dependsOn(constructs) {
457
+ return new WebSocketRouteBuilder(this.kind, this.action, this.surface, [...this._services, ...require_construct_interface.servicesOf(constructs)], require_construct_interface.idsOf(constructs, this._constructs), this.schema);
458
+ }
459
+ /**
460
+ * The handler. A message handler's return value, when there is one, is
461
+ * sent back to the connection as the reply to that frame; a connect
462
+ * handler's is kept as the connection's `data`.
463
+ */
464
+ handle(handler) {
465
+ return new WebSocketRoute(this.kind, this.action, this.surface, this._services, this._constructs, handler, this.schema);
466
+ }
467
+ };
468
+ //#endregion
469
+ //#region src/websocket/server.ts
470
+ /**
471
+ * The process that holds a WebSocket surface's sockets.
472
+ *
473
+ * Node's own `http` server and `ws`, nothing between them: a frame is parsed,
474
+ * validated and handed to its route, and that is the whole hot path. The HTTP
475
+ * server is whatever the entry started — the generated one serves `/health`
476
+ * on the same port — and this attaches to its `upgrade` event.
477
+ */
478
+ /** Close codes a client sees. */
479
+ const CLOSE = {
480
+ normal: 1e3,
481
+ /** The process is stopping; reconnect and land on another. */
482
+ serviceRestart: 1012,
483
+ /** It stopped reading, and what was queued for it passed the limit. */
484
+ tooSlow: 1013
485
+ };
486
+ /** Two routes answer one action. */
487
+ var DuplicateWebSocketRoute = class extends Error {
488
+ surface;
489
+ action;
490
+ constructor(surface, action) {
491
+ super(`Two routes on ${surface} answer '${action}'. Each action has one handler — rename one of them.`);
492
+ this.surface = surface;
493
+ this.action = action;
494
+ this.name = "DuplicateWebSocketRoute";
495
+ }
496
+ };
497
+ var WebSocketSurfaceServer = class WebSocketSurfaceServer {
498
+ wss;
499
+ options;
500
+ /** This process, as connection ids name it. */
501
+ instance = (0, node_crypto.randomBytes)(6).toString("hex");
502
+ /** `sockets` in a route: local sends skip the transport. */
503
+ publisher;
504
+ held = /* @__PURE__ */ new Map();
505
+ routes = /* @__PURE__ */ new Map();
506
+ lifecycle = {};
507
+ heartbeat;
508
+ frame;
509
+ trusted;
510
+ next = 0;
511
+ closing = false;
512
+ constructor(wss, options) {
513
+ this.wss = wss;
514
+ this.options = options;
515
+ for (const route of options.routes) {
516
+ if (route.surface.id !== options.surface) continue;
517
+ if (route.kind === "message") {
518
+ if (this.routes.has(route.action)) throw new DuplicateWebSocketRoute(options.surface, route.action);
519
+ this.routes.set(route.action, route);
520
+ } else {
521
+ if (this.lifecycle[route.kind]) throw new DuplicateWebSocketRoute(options.surface, route.action);
522
+ this.lifecycle[route.kind] = route;
523
+ }
524
+ }
525
+ this.frame = new FrameShape(options.surface, options.frame?.discriminator);
526
+ if (options.messages) this.frame.check(options.messages);
527
+ this.trusted = [...options.trustedOrigins, ...ownOrigins(options.url)];
528
+ this.publisher = new WebSocketPublisher(options.transport, {
529
+ instance: this.instance,
530
+ deliver: (delivery) => this.deliver(delivery)
531
+ }, options.messages ? {
532
+ surface: options.surface,
533
+ messages: options.messages
534
+ } : void 0, this.frame);
535
+ this.heartbeat = setInterval(() => this.beat(), options.heartbeatMs ?? 3e4);
536
+ this.heartbeat.unref();
537
+ }
538
+ static async start(options) {
539
+ const { WebSocketServer } = await import("ws");
540
+ const wss = new WebSocketServer({
541
+ noServer: true,
542
+ maxPayload: options.maxPayload ?? 1048576,
543
+ perMessageDeflate: false,
544
+ clientTracking: false
545
+ });
546
+ const server = new WebSocketSurfaceServer(wss, options);
547
+ await options.transport.subscribe(server.instance, (delivery) => server.deliver(delivery));
548
+ return server;
549
+ }
550
+ /** How many sockets this process holds. */
551
+ get size() {
552
+ return this.held.size;
553
+ }
554
+ /** Take over `server`'s upgrades. */
555
+ attach(server) {
556
+ server.on("upgrade", (request, socket, head) => {
557
+ this.upgrade(request, socket, head);
558
+ });
559
+ }
560
+ /** Upgrade one request, or refuse it with a status line. */
561
+ async upgrade(request, socket, head) {
562
+ if (this.closing) return refuse(socket, 503, "Service Unavailable");
563
+ const origin = request.headers.origin;
564
+ if (origin && !(0, _geekmidas_manifest.trustsOrigin)(origin, this.trusted)) return refuse(socket, 403, "Forbidden");
565
+ const connectionId = `${this.instance}.${(this.next++).toString(36)}`;
566
+ const headers = headersOf(request);
567
+ let data = {};
568
+ const connect = this.lifecycle.connect;
569
+ if (connect) try {
570
+ const session = this.options.authenticator ? await this.options.authenticator.verify(headers, this.options.envParser) : null;
571
+ const returned = await this.run(connect, connectionId, (base) => ({
572
+ ...base,
573
+ connectionId,
574
+ headers,
575
+ query: new URL(request.url ?? "/", "http://localhost").searchParams,
576
+ session
577
+ }));
578
+ if (returned && typeof returned === "object") data = returned;
579
+ } catch (error) {
580
+ if (error instanceof _geekmidas_errors.HttpError) return refuse(socket, error.statusCode, error.statusMessage);
581
+ this.options.logger.error({
582
+ err: error,
583
+ connectionId
584
+ }, "WebSocket connect handler failed");
585
+ return refuse(socket, 500, "Internal Server Error");
586
+ }
587
+ if (socket.destroyed) return;
588
+ this.wss.handleUpgrade(request, socket, head, (ws) => this.open(ws, {
589
+ id: connectionId,
590
+ data
591
+ }));
592
+ }
593
+ open(socket, connection) {
594
+ const held = {
595
+ socket,
596
+ connection,
597
+ alive: true
598
+ };
599
+ this.held.set(connection.id, held);
600
+ socket.on("pong", () => {
601
+ held.alive = true;
602
+ });
603
+ socket.on("message", (raw, isBinary) => {
604
+ held.alive = true;
605
+ if (isBinary) return this.error(held, void 0, "Frames are JSON text.");
606
+ this.dispatch(held, raw.toString());
607
+ });
608
+ socket.on("error", () => socket.terminate());
609
+ socket.on("close", (code, reason) => {
610
+ this.held.delete(connection.id);
611
+ const disconnect = this.lifecycle.disconnect;
612
+ if (!disconnect) return;
613
+ this.run(disconnect, connection.id, (base) => ({
614
+ ...base,
615
+ connection,
616
+ code,
617
+ reason: reason.toString()
618
+ })).catch((error) => this.options.logger.error({
619
+ err: error,
620
+ connectionId: connection.id
621
+ }, "WebSocket disconnect handler failed"));
622
+ });
623
+ }
624
+ /** Parse, validate and run one frame. Errors go back as frames, not closes. */
625
+ async dispatch(held, text) {
626
+ let parsed;
627
+ try {
628
+ parsed = JSON.parse(text);
629
+ } catch {
630
+ return this.error(held, void 0, "Frames are JSON.");
631
+ }
632
+ const frame = this.frame.decode(parsed);
633
+ if (!frame) return this.error(held, this.frame.idOf(parsed), `A frame names its \`${this.frame.key}\`.`);
634
+ const route = this.routes.get(frame.action) ?? this.routes.get("$default");
635
+ if (!route) return this.error(held, frame.id, `No route answers '${frame.action}'.`);
636
+ let body = frame.data;
637
+ if (route.schema) {
638
+ const result = await route.schema["~standard"].validate(frame.data);
639
+ if (result.issues) return this.error(held, frame.id, "The frame was invalid.", result.issues);
640
+ body = result.value;
641
+ }
642
+ try {
643
+ const returned = await this.run(route, held.connection.id, (base) => ({
644
+ ...base,
645
+ connection: held.connection,
646
+ body,
647
+ reply: (message) => this.write(held, JSON.stringify(message))
648
+ }));
649
+ if (returned !== void 0) this.write(held, this.frame.encode(frame.action, returned, frame.id));
650
+ } catch (error) {
651
+ if (error instanceof _geekmidas_errors.HttpError) return this.error(held, frame.id, error.message);
652
+ this.options.logger.error({
653
+ err: error,
654
+ connectionId: held.connection.id,
655
+ action: frame.action
656
+ }, "WebSocket route failed");
657
+ this.error(held, frame.id, "The route failed.");
658
+ }
659
+ }
660
+ /** Run a handler with its services, inside a request context of its own. */
661
+ async run(route, connectionId, context) {
662
+ const logger = this.options.logger.child({
663
+ connectionId,
664
+ action: route.action
665
+ });
666
+ return (0, _geekmidas_services.runWithRequestContext)({
667
+ logger,
668
+ requestId: connectionId,
669
+ startTime: Date.now(),
670
+ operation: `ws ${route.action}`
671
+ }, async () => {
672
+ const services = route.services.length ? await _geekmidas_services.ServiceDiscovery.getInstance(this.options.envParser).register([...route.services]) : {};
673
+ return route.handler(context({
674
+ services,
675
+ logger,
676
+ sockets: this.publisher
677
+ }));
678
+ });
679
+ }
680
+ error(held, id, message, issues) {
681
+ this.write(held, this.frame.encode("$error", {
682
+ message,
683
+ ...issues ? { issues } : {}
684
+ }, id));
685
+ }
686
+ /** Write, unless the socket has stopped reading and its queue is full. */
687
+ write(held, payload) {
688
+ const { socket } = held;
689
+ if (socket.readyState !== socket.OPEN) return;
690
+ if (socket.bufferedAmount > (this.options.maxBufferedBytes ?? 4194304)) {
691
+ socket.close(CLOSE.tooSlow, "Too slow");
692
+ return;
693
+ }
694
+ socket.send(payload);
695
+ }
696
+ /** What the transport, or a local publisher, asked of this process. */
697
+ deliver(delivery) {
698
+ switch (delivery.kind) {
699
+ case "send":
700
+ for (const id of delivery.ids) {
701
+ const held = this.held.get(id);
702
+ if (held) this.write(held, delivery.payload);
703
+ }
704
+ return;
705
+ case "broadcast": {
706
+ const except = delivery.except ? new Set(delivery.except) : void 0;
707
+ for (const [id, held] of this.held) if (!except?.has(id)) this.write(held, delivery.payload);
708
+ return;
709
+ }
710
+ case "close":
711
+ for (const id of delivery.ids) this.held.get(id)?.socket.close(delivery.code, delivery.reason);
712
+ return;
713
+ }
714
+ }
715
+ /** Drop every socket that missed the last ping, and ping the rest. */
716
+ beat() {
717
+ for (const [id, held] of this.held) {
718
+ if (!held.alive) {
719
+ held.socket.terminate();
720
+ this.held.delete(id);
721
+ continue;
722
+ }
723
+ held.alive = false;
724
+ held.socket.ping();
725
+ }
726
+ }
727
+ /**
728
+ * Stop: refuse new upgrades, close every socket with `code` — 1012 tells
729
+ * a client to reconnect, and it lands on a process that is still up — and
730
+ * leave the transport.
731
+ */
732
+ async close(code = CLOSE.serviceRestart, reason = "Restarting") {
733
+ if (this.closing) return;
734
+ this.closing = true;
735
+ clearInterval(this.heartbeat);
736
+ const closed = [...this.held.values()].map(({ socket }) => new Promise((resolve) => {
737
+ if (socket.readyState === socket.CLOSED) return resolve();
738
+ socket.once("close", () => resolve());
739
+ socket.close(code, reason);
740
+ setTimeout(() => {
741
+ socket.terminate();
742
+ resolve();
743
+ }, 2e3).unref();
744
+ }));
745
+ await Promise.all(closed);
746
+ await this.options.transport.close();
747
+ this.wss.close();
748
+ }
749
+ };
750
+ /**
751
+ * The origins a client of the surface's own address sends: the `https://`
752
+ * one a native socket derives from `wss://`, and the address's own.
753
+ */
754
+ function ownOrigins(url) {
755
+ if (!url || !URL.canParse(url)) return [];
756
+ const own = new URL(url);
757
+ const web = new URL(url.replace(/^ws(s?):/i, "http$1:"));
758
+ return [.../* @__PURE__ */ new Set([`${own.protocol}//${own.host}`, web.origin])];
759
+ }
760
+ function headersOf(request) {
761
+ const headers = new Headers();
762
+ for (const [name, value] of Object.entries(request.headers)) {
763
+ if (value === void 0) continue;
764
+ for (const one of Array.isArray(value) ? value : [value]) headers.append(name, one);
765
+ }
766
+ return headers;
767
+ }
768
+ function refuse(socket, status, message) {
769
+ if (!socket.destroyed) socket.end(`HTTP/1.1 ${status} ${message}\r\nConnection: close\r\nContent-Length: 0\r\n\r\n`);
770
+ }
771
+ //#endregion
772
+ //#region src/websocket-api.ts
773
+ /** A replica count that is not a whole number of at least one. */
774
+ var InvalidReplicaCount = class extends Error {
775
+ id;
776
+ replicas;
777
+ constructor(id, replicas) {
778
+ super(`${id} asks for ${replicas} replicas. A surface runs on at least one process — give a whole number of 1 or more.`);
779
+ this.id = id;
780
+ this.replicas = replicas;
781
+ this.name = "InvalidReplicaCount";
782
+ }
783
+ };
784
+ var WebSocketApi = class WebSocketApi {
785
+ config;
786
+ authenticator;
787
+ id;
788
+ keys;
789
+ logger;
790
+ envParser;
791
+ telemetry;
792
+ /**
793
+ * The shape its frames take — `{ action, data }`, or flat under
794
+ * `discriminator`. What a client of the surface decodes by.
795
+ */
796
+ frame;
797
+ /**
798
+ * The surface as a dependency: `services.<id>` is its publisher, so an
799
+ * endpoint sends to a socket the way a route beside it does.
800
+ */
801
+ service;
802
+ constructor(id, config, authenticator) {
803
+ this.config = config;
804
+ this.authenticator = authenticator;
805
+ const canonical = (0, _geekmidas_manifest.canonicalId)(id);
806
+ this.id = canonical;
807
+ const replicas = config.replicas ?? 1;
808
+ if (!Number.isInteger(replicas) || replicas < 1) throw new InvalidReplicaCount(canonical, replicas);
809
+ const frame = new FrameShape(canonical, config.frame?.discriminator);
810
+ if (config.messages) frame.check(config.messages);
811
+ this.frame = config.frame ? { discriminator: config.frame.discriminator } : {};
812
+ this.keys = {
813
+ url: (0, _geekmidas_manifest.provideKey)(canonical, "url"),
814
+ trustedOrigins: (0, _geekmidas_manifest.provideKey)(canonical, "trustedOrigins"),
815
+ publisherConnectionString: (0, _geekmidas_manifest.provideKey)(canonical, "publisherConnectionString")
816
+ };
817
+ this.logger = config.logger ?? _geekmidas_logger_console.DEFAULT_LOGGER;
818
+ this.telemetry = config.telemetry;
819
+ this.envParser = require_surfaceEnv.envParserFor(config.envParser ? {
820
+ id: canonical,
821
+ envParser: config.envParser
822
+ } : void 0);
823
+ const envVar = this.keys.publisherConnectionString;
824
+ const channel = channelOf(canonical);
825
+ const declared = this.declared;
826
+ this.service = {
827
+ serviceName: (0, _geekmidas_manifest.serviceKey)(canonical),
828
+ async register({ envParser }) {
829
+ const { connectionString } = envParser.create((get) => ({ connectionString: get(envVar).string() })).parse();
830
+ const transport = await transportFromConnectionString(connectionString, channel);
831
+ require_shutdown.onShutdown(() => transport.close());
832
+ return new WebSocketPublisher(transport, void 0, declared, frame);
833
+ }
834
+ };
835
+ }
836
+ /** The handler a connection's upgrade runs: refuse it, or say who it is. */
837
+ connect() {
838
+ return new WebSocketRouteBuilder("connect", "$connect", { id: this.id });
839
+ }
840
+ /** The handler a closed connection runs. */
841
+ disconnect() {
842
+ return new WebSocketRouteBuilder("disconnect", "$disconnect", { id: this.id });
843
+ }
844
+ /**
845
+ * The handler for frames whose `action` — or, for flat frames, whose
846
+ * discriminator — is `action`. `$default` answers
847
+ * any action nothing else does.
848
+ */
849
+ route(action) {
850
+ return new WebSocketRouteBuilder("message", action, { id: this.id });
851
+ }
852
+ /** What authenticates a connection — its session reaches `connect()`. */
853
+ auth(construct) {
854
+ return new WebSocketApi(this.id, this.config, construct);
855
+ }
856
+ /**
857
+ * Serve it: the routes exported by `modules` that were built from this
858
+ * surface, on whatever HTTP server `attach` is handed.
859
+ *
860
+ * `app` answers plain HTTP — the generated entry puts `/health` in front
861
+ * of it — and `attach` takes over the server's upgrades. The sockets are
862
+ * closed with 1012 when the server shuts down.
863
+ */
864
+ async server(options) {
865
+ const { Hono } = await import("hono");
866
+ const routes = (options.modules ?? []).flatMap((module) => Object.values(module).filter(WebSocketRoute.isRoute));
867
+ const { connectionString, origins, url } = options.envParser.create((get) => ({
868
+ connectionString: get(this.keys.publisherConnectionString).string().default(`memory://${channelOf(this.id)}`),
869
+ origins: get(this.keys.trustedOrigins).string().default("").transform((value) => value.split(",").map((origin) => origin.trim()).filter(Boolean)),
870
+ url: get(this.keys.url).string().optional()
871
+ })).parse();
872
+ const server = await WebSocketSurfaceServer.start({
873
+ surface: this.id,
874
+ routes,
875
+ transport: await transportFromConnectionString(connectionString, channelOf(this.id)),
876
+ envParser: options.envParser,
877
+ logger: this.logger,
878
+ trustedOrigins: origins,
879
+ ...url ? { url } : {},
880
+ ...this.config.frame ? { frame: this.config.frame } : {},
881
+ ...this.declared ? { messages: this.declared.messages } : {},
882
+ ...this.authenticator ? { authenticator: this.authenticator } : {},
883
+ ...this.config.heartbeat ? { heartbeatMs: this.config.heartbeat * 1e3 } : {},
884
+ ...this.config.maxPayload ? { maxPayload: this.config.maxPayload } : {}
885
+ });
886
+ require_shutdown.onShutdown(() => server.close());
887
+ const app = new Hono();
888
+ app.get("/health", (c) => c.json({
889
+ status: "ok",
890
+ connections: server.size
891
+ }));
892
+ app.get("/", (c) => c.json({
893
+ surface: this.id,
894
+ connections: server.size
895
+ }, 426, { Upgrade: "websocket" }));
896
+ return {
897
+ app,
898
+ attach: (http) => server.attach(http),
899
+ release: () => server.close(),
900
+ server
901
+ };
902
+ }
903
+ /** The declared messages, with the surface they are checked for. */
904
+ get declared() {
905
+ return this.config.messages ? {
906
+ surface: this.id,
907
+ messages: this.config.messages
908
+ } : void 0;
909
+ }
910
+ declare() {
911
+ return [{
912
+ kind: "websocket-api",
913
+ id: this.id,
914
+ path: this.config.path,
915
+ ...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
916
+ ...this.authenticator ? { auth: require_construct_interface.edgeTo(this.authenticator) } : {},
917
+ ...this.config.telemetry ? { telemetry: this.config.telemetry.id } : {},
918
+ ...this.config.replicas && this.config.replicas > 1 ? { replicas: this.config.replicas } : {},
919
+ provides: [
920
+ this.keys.url,
921
+ this.keys.trustedOrigins,
922
+ this.keys.publisherConnectionString
923
+ ]
924
+ }];
925
+ }
926
+ };
927
+ /** The prefix a surface's channels are named under. */
928
+ function channelOf(id) {
929
+ return `gkm:ws:${id}`;
930
+ }
931
+ //#endregion
932
+ exports.CLOSE = CLOSE;
933
+ exports.DuplicateWebSocketRoute = DuplicateWebSocketRoute;
934
+ exports.InvalidReplicaCount = InvalidReplicaCount;
935
+ exports.InvalidWebSocketMessage = InvalidWebSocketMessage;
936
+ exports.MemoryTransport = MemoryTransport;
937
+ exports.RedisTransport = RedisTransport;
938
+ exports.UnknownWebSocketMessage = UnknownWebSocketMessage;
939
+ exports.UnsupportedWebSocketTransport = UnsupportedWebSocketTransport;
940
+ exports.WebSocketApi = WebSocketApi;
941
+ exports.WebSocketDataHasDiscriminator = WebSocketDataHasDiscriminator;
942
+ exports.WebSocketDataNotAnObject = WebSocketDataNotAnObject;
943
+ exports.WebSocketMessageDeclaresDiscriminator = WebSocketMessageDeclaresDiscriminator;
944
+ exports.WebSocketMessageNotAnObject = WebSocketMessageNotAnObject;
945
+ exports.WebSocketPublisher = WebSocketPublisher;
946
+ exports.WebSocketRoute = WebSocketRoute;
947
+ exports.WebSocketRouteBuilder = WebSocketRouteBuilder;
948
+ exports.WebSocketSurfaceServer = WebSocketSurfaceServer;
949
+ exports.transportFromConnectionString = transportFromConnectionString;
950
+
951
+ //# sourceMappingURL=websocket-api.cjs.map