@geekmidas/constructs 10.0.0-alpha.16 → 10.0.0-alpha.160

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 (485) hide show
  1. package/README.md +246 -158
  2. package/dist/Construct-127M7yrl.d.cts +231 -0
  3. package/dist/Construct-127M7yrl.d.cts.map +1 -0
  4. package/dist/Construct-BMk_CRSD.d.mts +231 -0
  5. package/dist/Construct-BMk_CRSD.d.mts.map +1 -0
  6. package/dist/{Construct-BeYVu_QF.mjs → Construct-CGuc_Ijk.mjs} +8 -9
  7. package/dist/Construct-CGuc_Ijk.mjs.map +1 -0
  8. package/dist/{Construct-DqdlARxq.cjs → Construct-DorKS0Ua.cjs} +8 -9
  9. package/dist/Construct-DorKS0Ua.cjs.map +1 -0
  10. package/dist/{Cron-l4Wlz6G9.d.mts → Cron-D6Y7BBt3.d.mts} +15 -8
  11. package/dist/Cron-D6Y7BBt3.d.mts.map +1 -0
  12. package/dist/{Cron-zsoSAwZo.d.cts → Cron-D_sfaMGz.d.cts} +14 -7
  13. package/dist/Cron-D_sfaMGz.d.cts.map +1 -0
  14. package/dist/CronBuilder-4BZhkChG.d.mts +47 -0
  15. package/dist/CronBuilder-4BZhkChG.d.mts.map +1 -0
  16. package/dist/{CronBuilder-D_0HNBTr.mjs → CronBuilder-BJ5LoadF.mjs} +28 -11
  17. package/dist/CronBuilder-BJ5LoadF.mjs.map +1 -0
  18. package/dist/{CronBuilder-BdnI6lxF.cjs → CronBuilder-B_NSP-Y5.cjs} +27 -10
  19. package/dist/CronBuilder-B_NSP-Y5.cjs.map +1 -0
  20. package/dist/CronBuilder-C91MVLSr.d.cts +47 -0
  21. package/dist/CronBuilder-C91MVLSr.d.cts.map +1 -0
  22. package/dist/Endpoint-52z1P0Ue.cjs +581 -0
  23. package/dist/Endpoint-52z1P0Ue.cjs.map +1 -0
  24. package/dist/{Endpoint-oS-Fe3d_.d.mts → Endpoint-BUoDD96P.d.mts} +104 -23
  25. package/dist/Endpoint-BUoDD96P.d.mts.map +1 -0
  26. package/dist/{Endpoint-DBflWAe4.d.cts → Endpoint-YYwjqtS1.d.cts} +101 -20
  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/{index-Cc4kKPag.d.mts → EndpointFactory-BbVOeryo.d.mts} +189 -106
  31. package/dist/EndpointFactory-BbVOeryo.d.mts.map +1 -0
  32. package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-Bzi9Sl7r.mjs} +269 -53
  33. package/dist/EndpointFactory-Bzi9Sl7r.mjs.map +1 -0
  34. package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-Cf_Cs1ym.cjs} +309 -51
  35. package/dist/EndpointFactory-Cf_Cs1ym.cjs.map +1 -0
  36. package/dist/{index-C1ZwNOOk.d.cts → EndpointFactory-Hh1r6J_C.d.cts} +187 -104
  37. package/dist/EndpointFactory-Hh1r6J_C.d.cts.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-BKReud5p.d.mts +76 -0
  41. package/dist/Function-BKReud5p.d.mts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-BTbqfSaa.cjs} +115 -41
  43. package/dist/HonoEndpointAdaptor-BTbqfSaa.cjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-CBVey2cY.mjs} +112 -38
  45. package/dist/HonoEndpointAdaptor-CBVey2cY.mjs.map +1 -0
  46. package/dist/ObjectSubscriberBuilder-DfzXQEKW.d.mts +129 -0
  47. package/dist/ObjectSubscriberBuilder-DfzXQEKW.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-D4oYvZeG.d.mts +216 -0
  51. package/dist/ProcessorBuilder-D4oYvZeG.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-B8HGg439.d.mts} +42 -41
  55. package/dist/Queue-B8HGg439.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-CVS_qPuo.d.mts +75 -0
  67. package/dist/QueueBuilder-CVS_qPuo.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-CtQXhcL7.d.mts +83 -0
  73. package/dist/Subscriber-CtQXhcL7.d.mts.map +1 -0
  74. package/dist/SubscriberBuilder-CpFhShTJ.mjs +238 -0
  75. package/dist/SubscriberBuilder-CpFhShTJ.mjs.map +1 -0
  76. package/dist/SubscriberBuilder-DJEvNRdD.cjs +261 -0
  77. package/dist/SubscriberBuilder-DJEvNRdD.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 +147 -168
  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 +142 -164
  89. package/dist/adaptors/aws.mjs.map +1 -1
  90. package/dist/adaptors/awsWebsocket.cjs +354 -0
  91. package/dist/adaptors/awsWebsocket.cjs.map +1 -0
  92. package/dist/adaptors/awsWebsocket.d.cts +156 -0
  93. package/dist/adaptors/awsWebsocket.d.cts.map +1 -0
  94. package/dist/adaptors/awsWebsocket.d.mts +156 -0
  95. package/dist/adaptors/awsWebsocket.d.mts.map +1 -0
  96. package/dist/adaptors/awsWebsocket.mjs +347 -0
  97. package/dist/adaptors/awsWebsocket.mjs.map +1 -0
  98. package/dist/adaptors/hono.cjs +1 -1
  99. package/dist/adaptors/hono.d.cts +8 -7
  100. package/dist/adaptors/hono.d.cts.map +1 -1
  101. package/dist/adaptors/hono.d.mts +10 -9
  102. package/dist/adaptors/hono.d.mts.map +1 -1
  103. package/dist/adaptors/hono.mjs +1 -1
  104. package/dist/adaptors/testing.cjs +1174 -41
  105. package/dist/adaptors/testing.cjs.map +1 -1
  106. package/dist/adaptors/testing.d.cts +517 -40
  107. package/dist/adaptors/testing.d.cts.map +1 -1
  108. package/dist/adaptors/testing.d.mts +517 -40
  109. package/dist/adaptors/testing.d.mts.map +1 -1
  110. package/dist/adaptors/testing.mjs +1140 -36
  111. package/dist/adaptors/testing.mjs.map +1 -1
  112. package/dist/auth-BqWz2JxC.d.cts +274 -0
  113. package/dist/auth-BqWz2JxC.d.cts.map +1 -0
  114. package/dist/auth-DnB9H9KL.d.mts +274 -0
  115. package/dist/auth-DnB9H9KL.d.mts.map +1 -0
  116. package/dist/auth.cjs +308 -23
  117. package/dist/auth.cjs.map +1 -1
  118. package/dist/auth.d.cts +2 -104
  119. package/dist/auth.d.mts +2 -104
  120. package/dist/auth.mjs +304 -25
  121. package/dist/auth.mjs.map +1 -1
  122. package/dist/cache-CCHcO9Oo.d.mts +44 -0
  123. package/dist/cache-CCHcO9Oo.d.mts.map +1 -0
  124. package/dist/cache-CQjMNPrC.d.cts +44 -0
  125. package/dist/cache-CQjMNPrC.d.cts.map +1 -0
  126. package/dist/cache.cjs +3 -19
  127. package/dist/cache.cjs.map +1 -1
  128. package/dist/cache.d.cts +2 -43
  129. package/dist/cache.d.mts +2 -43
  130. package/dist/cache.mjs +2 -18
  131. package/dist/cache.mjs.map +1 -1
  132. package/dist/cipher-C1lEFX63.mjs +225 -0
  133. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  134. package/dist/cipher-CVxfwLjk.cjs +332 -0
  135. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  136. package/dist/cipher-DSDxPRIp.d.cts +106 -0
  137. package/dist/cipher-DSDxPRIp.d.cts.map +1 -0
  138. package/dist/cipher-DSDxPRIp.d.mts +106 -0
  139. package/dist/cipher-DSDxPRIp.d.mts.map +1 -0
  140. package/dist/{construct-interface-DPlxfpoS.d.mts → construct-interface-CSA9VeWM.d.mts} +47 -8
  141. package/dist/construct-interface-CSA9VeWM.d.mts.map +1 -0
  142. package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-DugP0E5q.d.cts} +47 -8
  143. package/dist/construct-interface-DugP0E5q.d.cts.map +1 -0
  144. package/dist/construct-interface.cjs +38 -4
  145. package/dist/construct-interface.cjs.map +1 -1
  146. package/dist/construct-interface.d.cts +2 -2
  147. package/dist/construct-interface.d.mts +2 -2
  148. package/dist/construct-interface.mjs +37 -5
  149. package/dist/construct-interface.mjs.map +1 -1
  150. package/dist/credential-DYymbp_7.cjs +257 -0
  151. package/dist/credential-DYymbp_7.cjs.map +1 -0
  152. package/dist/credential-DfSAOOdY.mjs +222 -0
  153. package/dist/credential-DfSAOOdY.mjs.map +1 -0
  154. package/dist/credential.cjs +7 -129
  155. package/dist/credential.d.cts +2 -58
  156. package/dist/credential.d.mts +2 -58
  157. package/dist/credential.mjs +2 -128
  158. package/dist/crons/index.cjs +127 -1
  159. package/dist/crons/index.cjs.map +1 -1
  160. package/dist/crons/index.d.cts +43 -3
  161. package/dist/crons/index.d.cts.map +1 -1
  162. package/dist/crons/index.d.mts +43 -3
  163. package/dist/crons/index.d.mts.map +1 -1
  164. package/dist/crons/index.mjs +126 -2
  165. package/dist/crons/index.mjs.map +1 -1
  166. package/dist/database/kysely.cjs +3 -194
  167. package/dist/database/kysely.d.cts +2 -149
  168. package/dist/database/kysely.d.mts +2 -149
  169. package/dist/database/kysely.mjs +2 -192
  170. package/dist/email.cjs +4 -16
  171. package/dist/email.cjs.map +1 -1
  172. package/dist/email.d.cts +1 -1
  173. package/dist/email.d.cts.map +1 -1
  174. package/dist/email.d.mts +2 -2
  175. package/dist/email.d.mts.map +1 -1
  176. package/dist/email.mjs +2 -14
  177. package/dist/email.mjs.map +1 -1
  178. package/dist/encryption/kms.cjs +95 -0
  179. package/dist/encryption/kms.cjs.map +1 -0
  180. package/dist/encryption/kms.d.cts +7 -0
  181. package/dist/encryption/kms.d.cts.map +1 -0
  182. package/dist/encryption/kms.d.mts +7 -0
  183. package/dist/encryption/kms.d.mts.map +1 -0
  184. package/dist/encryption/kms.mjs +93 -0
  185. package/dist/encryption/kms.mjs.map +1 -0
  186. package/dist/encryption.cjs +116 -0
  187. package/dist/encryption.cjs.map +1 -0
  188. package/dist/encryption.d.cts +37 -0
  189. package/dist/encryption.d.cts.map +1 -0
  190. package/dist/encryption.d.mts +37 -0
  191. package/dist/encryption.d.mts.map +1 -0
  192. package/dist/encryption.mjs +101 -0
  193. package/dist/encryption.mjs.map +1 -0
  194. package/dist/endpoints/index.cjs +32 -10
  195. package/dist/endpoints/index.d.cts +106 -3
  196. package/dist/endpoints/index.d.cts.map +1 -0
  197. package/dist/endpoints/index.d.mts +106 -3
  198. package/dist/endpoints/index.d.mts.map +1 -0
  199. package/dist/endpoints/index.mjs +6 -4
  200. package/dist/expire-C586zznE.d.cts +38 -0
  201. package/dist/expire-C586zznE.d.cts.map +1 -0
  202. package/dist/expire-C586zznE.d.mts +38 -0
  203. package/dist/expire-C586zznE.d.mts.map +1 -0
  204. package/dist/expire-CieftS01.cjs +67 -0
  205. package/dist/expire-CieftS01.cjs.map +1 -0
  206. package/dist/expire-CpzUAfr9.mjs +50 -0
  207. package/dist/expire-CpzUAfr9.mjs.map +1 -0
  208. package/dist/external-api.cjs +106 -0
  209. package/dist/external-api.cjs.map +1 -0
  210. package/dist/external-api.d.cts +2 -0
  211. package/dist/external-api.d.mts +2 -0
  212. package/dist/external-api.mjs +103 -0
  213. package/dist/external-api.mjs.map +1 -0
  214. package/dist/fake-BqhP8RRQ.d.mts +201 -0
  215. package/dist/fake-BqhP8RRQ.d.mts.map +1 -0
  216. package/dist/fake-DqieDYYA.d.cts +201 -0
  217. package/dist/fake-DqieDYYA.d.cts.map +1 -0
  218. package/dist/file-server.cjs +123 -30
  219. package/dist/file-server.cjs.map +1 -1
  220. package/dist/file-server.d.cts +115 -1
  221. package/dist/file-server.d.cts.map +1 -1
  222. package/dist/file-server.d.mts +115 -1
  223. package/dist/file-server.d.mts.map +1 -1
  224. package/dist/file-server.mjs +122 -32
  225. package/dist/file-server.mjs.map +1 -1
  226. package/dist/functions/index.cjs +1 -1
  227. package/dist/functions/index.d.cts +2 -1
  228. package/dist/functions/index.d.mts +2 -1
  229. package/dist/functions/index.mjs +1 -1
  230. package/dist/{functions-C53GW2eQ.mjs → functions-BvIDQKAA.mjs} +117 -22
  231. package/dist/functions-BvIDQKAA.mjs.map +1 -0
  232. package/dist/{functions-B6qCvfmy.cjs → functions-DLF6-IK8.cjs} +122 -18
  233. package/dist/functions-DLF6-IK8.cjs.map +1 -0
  234. package/dist/inbox-CR3L1fOI.d.cts +195 -0
  235. package/dist/inbox-CR3L1fOI.d.cts.map +1 -0
  236. package/dist/inbox-YOdxlyfj.d.mts +195 -0
  237. package/dist/inbox-YOdxlyfj.d.mts.map +1 -0
  238. package/dist/inbox.cjs +291 -0
  239. package/dist/inbox.cjs.map +1 -0
  240. package/dist/inbox.d.cts +2 -0
  241. package/dist/inbox.d.mts +2 -0
  242. package/dist/inbox.mjs +283 -0
  243. package/dist/inbox.mjs.map +1 -0
  244. package/dist/index-BoQ3-M-K.d.mts +115 -0
  245. package/dist/index-BoQ3-M-K.d.mts.map +1 -0
  246. package/dist/index-DPTHa6Ud.d.cts +115 -0
  247. package/dist/index-DPTHa6Ud.d.cts.map +1 -0
  248. package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
  249. package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
  250. package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
  251. package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
  252. package/dist/index.cjs +4 -1
  253. package/dist/index.d.cts +26 -3
  254. package/dist/index.d.cts.map +1 -0
  255. package/dist/index.d.mts +26 -3
  256. package/dist/index.d.mts.map +1 -0
  257. package/dist/index.mjs +3 -2
  258. package/dist/kysely-CebjCWTl.d.cts +216 -0
  259. package/dist/kysely-CebjCWTl.d.cts.map +1 -0
  260. package/dist/kysely-Cs4uPO8k.mjs +371 -0
  261. package/dist/kysely-Cs4uPO8k.mjs.map +1 -0
  262. package/dist/kysely-CukArHJ0.cjs +384 -0
  263. package/dist/kysely-CukArHJ0.cjs.map +1 -0
  264. package/dist/kysely-De5rAC-E.d.mts +216 -0
  265. package/dist/kysely-De5rAC-E.d.mts.map +1 -0
  266. package/dist/{telemetry-DGcFlVpB.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +2 -2
  267. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  268. package/dist/{telemetry-DGcFlVpB.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +2 -2
  269. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  270. package/dist/mobile-app.cjs +74 -0
  271. package/dist/mobile-app.cjs.map +1 -0
  272. package/dist/mobile-app.d.cts +73 -0
  273. package/dist/mobile-app.d.cts.map +1 -0
  274. package/dist/mobile-app.d.mts +73 -0
  275. package/dist/mobile-app.d.mts.map +1 -0
  276. package/dist/mobile-app.mjs +73 -0
  277. package/dist/mobile-app.mjs.map +1 -0
  278. package/dist/object-storage.cjs +8 -1
  279. package/dist/object-storage.cjs.map +1 -1
  280. package/dist/object-storage.d.cts +10 -1
  281. package/dist/object-storage.d.cts.map +1 -1
  282. package/dist/object-storage.d.mts +10 -1
  283. package/dist/object-storage.d.mts.map +1 -1
  284. package/dist/object-storage.mjs +7 -2
  285. package/dist/object-storage.mjs.map +1 -1
  286. package/dist/optionalPeers-D7Wt6dnF.mjs +140 -0
  287. package/dist/optionalPeers-D7Wt6dnF.mjs.map +1 -0
  288. package/dist/optionalPeers-DuNQXXe1.cjs +223 -0
  289. package/dist/optionalPeers-DuNQXXe1.cjs.map +1 -0
  290. package/dist/origins-BjxYht13.cjs +96 -0
  291. package/dist/origins-BjxYht13.cjs.map +1 -0
  292. package/dist/origins-Boc9qbo-.mjs +73 -0
  293. package/dist/origins-Boc9qbo-.mjs.map +1 -0
  294. package/dist/pattern-C1CEcglD.mjs +241 -0
  295. package/dist/pattern-C1CEcglD.mjs.map +1 -0
  296. package/dist/pattern-QFaUIr77.cjs +288 -0
  297. package/dist/pattern-QFaUIr77.cjs.map +1 -0
  298. package/dist/privateAddress-Bg5fUsbp.mjs +21 -0
  299. package/dist/privateAddress-Bg5fUsbp.mjs.map +1 -0
  300. package/dist/privateAddress-CqGyuFHn.cjs +26 -0
  301. package/dist/privateAddress-CqGyuFHn.cjs.map +1 -0
  302. package/dist/processors/index.cjs +214 -0
  303. package/dist/processors/index.cjs.map +1 -0
  304. package/dist/processors/index.d.cts +78 -0
  305. package/dist/processors/index.d.cts.map +1 -0
  306. package/dist/processors/index.d.mts +78 -0
  307. package/dist/processors/index.d.mts.map +1 -0
  308. package/dist/processors/index.mjs +193 -0
  309. package/dist/processors/index.mjs.map +1 -0
  310. package/dist/queue/index.cjs +5 -192
  311. package/dist/queue/index.d.cts +3 -53
  312. package/dist/queue/index.d.mts +3 -53
  313. package/dist/queue/index.mjs +3 -190
  314. package/dist/random-password.cjs +86 -0
  315. package/dist/random-password.cjs.map +1 -0
  316. package/dist/random-password.d.cts +30 -0
  317. package/dist/random-password.d.cts.map +1 -0
  318. package/dist/random-password.d.mts +30 -0
  319. package/dist/random-password.d.mts.map +1 -0
  320. package/dist/random-password.mjs +84 -0
  321. package/dist/random-password.mjs.map +1 -0
  322. package/dist/readRequestBody-BmKnPl0a.mjs +293 -0
  323. package/dist/readRequestBody-BmKnPl0a.mjs.map +1 -0
  324. package/dist/{lazyAccessors-Dx9NLwJZ.cjs → readRequestBody-CN9GVdeE.cjs} +141 -47
  325. package/dist/readRequestBody-CN9GVdeE.cjs.map +1 -0
  326. package/dist/{processAudits-D_2W5x8k.cjs → requestLogger-CnoYd-Ah.cjs} +63 -3
  327. package/dist/requestLogger-CnoYd-Ah.cjs.map +1 -0
  328. package/dist/{processAudits-BpRlPQMW.mjs → requestLogger-D2JS7pPM.mjs} +51 -3
  329. package/dist/requestLogger-D2JS7pPM.mjs.map +1 -0
  330. package/dist/rest-api.cjs +85 -70
  331. package/dist/rest-api.cjs.map +1 -1
  332. package/dist/rest-api.d.cts +77 -59
  333. package/dist/rest-api.d.cts.map +1 -1
  334. package/dist/rest-api.d.mts +77 -59
  335. package/dist/rest-api.d.mts.map +1 -1
  336. package/dist/rest-api.mjs +87 -72
  337. package/dist/rest-api.mjs.map +1 -1
  338. package/dist/runSubscriber-HEqXkin1.mjs +117 -0
  339. package/dist/runSubscriber-HEqXkin1.mjs.map +1 -0
  340. package/dist/runSubscriber-sVJfLA0-.cjs +134 -0
  341. package/dist/runSubscriber-sVJfLA0-.cjs.map +1 -0
  342. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  343. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  344. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  345. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  346. package/dist/site.cjs +104 -8
  347. package/dist/site.cjs.map +1 -1
  348. package/dist/site.d.cts +132 -2
  349. package/dist/site.d.cts.map +1 -1
  350. package/dist/site.d.mts +132 -2
  351. package/dist/site.d.mts.map +1 -1
  352. package/dist/site.mjs +102 -11
  353. package/dist/site.mjs.map +1 -1
  354. package/dist/stages-DaTaoQei.d.cts +73 -0
  355. package/dist/stages-DaTaoQei.d.cts.map +1 -0
  356. package/dist/stages-DaTaoQei.d.mts +73 -0
  357. package/dist/stages-DaTaoQei.d.mts.map +1 -0
  358. package/dist/subscribers/index.cjs +134 -1
  359. package/dist/subscribers/index.cjs.map +1 -0
  360. package/dist/subscribers/index.d.cts +74 -3
  361. package/dist/subscribers/index.d.cts.map +1 -0
  362. package/dist/subscribers/index.d.mts +74 -3
  363. package/dist/subscribers/index.d.mts.map +1 -0
  364. package/dist/subscribers/index.mjs +132 -2
  365. package/dist/subscribers/index.mjs.map +1 -0
  366. package/dist/telemetry-C1oqncFY.d.cts +40 -0
  367. package/dist/telemetry-C1oqncFY.d.cts.map +1 -0
  368. package/dist/telemetry-CObow3Dn.d.mts +40 -0
  369. package/dist/telemetry-CObow3Dn.d.mts.map +1 -0
  370. package/dist/telemetry.cjs +56 -0
  371. package/dist/telemetry.cjs.map +1 -0
  372. package/dist/telemetry.d.cts +2 -0
  373. package/dist/telemetry.d.mts +2 -0
  374. package/dist/telemetry.mjs +55 -0
  375. package/dist/telemetry.mjs.map +1 -0
  376. package/dist/topic/index.cjs +2 -134
  377. package/dist/topic/index.d.cts +2 -3
  378. package/dist/topic/index.d.mts +2 -3
  379. package/dist/topic/index.mjs +2 -132
  380. package/dist/tracing-Bbj1uoFJ.mjs +127 -0
  381. package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
  382. package/dist/tracing-C0ooU0V2.cjs +150 -0
  383. package/dist/tracing-C0ooU0V2.cjs.map +1 -0
  384. package/dist/websocket-api-Bg9SowJ5.mjs +1710 -0
  385. package/dist/websocket-api-Bg9SowJ5.mjs.map +1 -0
  386. package/dist/websocket-api-CPEzJyDt.d.mts +1201 -0
  387. package/dist/websocket-api-CPEzJyDt.d.mts.map +1 -0
  388. package/dist/websocket-api-DkF8Hva-.d.cts +1201 -0
  389. package/dist/websocket-api-DkF8Hva-.d.cts.map +1 -0
  390. package/dist/websocket-api-czxhekGG.cjs +1889 -0
  391. package/dist/websocket-api-czxhekGG.cjs.map +1 -0
  392. package/dist/websocket-api.cjs +35 -0
  393. package/dist/websocket-api.d.cts +2 -0
  394. package/dist/websocket-api.d.mts +2 -0
  395. package/dist/websocket-api.mjs +3 -0
  396. package/dist/worker.cjs +174 -32
  397. package/dist/worker.cjs.map +1 -1
  398. package/dist/worker.d.cts +147 -47
  399. package/dist/worker.d.cts.map +1 -1
  400. package/dist/worker.d.mts +147 -47
  401. package/dist/worker.d.mts.map +1 -1
  402. package/dist/worker.mjs +175 -33
  403. package/dist/worker.mjs.map +1 -1
  404. package/package.json +180 -43
  405. package/dist/Construct-BeYVu_QF.mjs.map +0 -1
  406. package/dist/Construct-DfbwIntp.d.cts +0 -115
  407. package/dist/Construct-DfbwIntp.d.cts.map +0 -1
  408. package/dist/Construct-DqdlARxq.cjs.map +0 -1
  409. package/dist/Construct-l5aOn_jv.d.mts +0 -115
  410. package/dist/Construct-l5aOn_jv.d.mts.map +0 -1
  411. package/dist/Cron-l4Wlz6G9.d.mts.map +0 -1
  412. package/dist/Cron-zsoSAwZo.d.cts.map +0 -1
  413. package/dist/CronBuilder-BdnI6lxF.cjs.map +0 -1
  414. package/dist/CronBuilder-CyT71Nzg.d.cts +0 -41
  415. package/dist/CronBuilder-CyT71Nzg.d.cts.map +0 -1
  416. package/dist/CronBuilder-D_0HNBTr.mjs.map +0 -1
  417. package/dist/CronBuilder-UoNgFe8S.d.mts +0 -41
  418. package/dist/CronBuilder-UoNgFe8S.d.mts.map +0 -1
  419. package/dist/Endpoint-BpZHtJ2W.cjs +0 -1689
  420. package/dist/Endpoint-BpZHtJ2W.cjs.map +0 -1
  421. package/dist/Endpoint-DBflWAe4.d.cts.map +0 -1
  422. package/dist/Endpoint-ONsly_dq.mjs +0 -1671
  423. package/dist/Endpoint-ONsly_dq.mjs.map +0 -1
  424. package/dist/Endpoint-oS-Fe3d_.d.mts.map +0 -1
  425. package/dist/EndpointFactory-Bm3aKRdV.mjs.map +0 -1
  426. package/dist/EndpointFactory-CLvWuHyt.cjs.map +0 -1
  427. package/dist/HonoEndpointAdaptor-92zavCsV.cjs.map +0 -1
  428. package/dist/HonoEndpointAdaptor-yYaU7jVJ.mjs.map +0 -1
  429. package/dist/Queue-D9X6OoON.d.mts.map +0 -1
  430. package/dist/Queue-DYPB2KWL.d.cts.map +0 -1
  431. package/dist/Subscriber-C4heaAyO.d.mts +0 -51
  432. package/dist/Subscriber-C4heaAyO.d.mts.map +0 -1
  433. package/dist/Subscriber-CotDUELC.d.cts +0 -51
  434. package/dist/Subscriber-CotDUELC.d.cts.map +0 -1
  435. package/dist/SubscriberBuilder-BEv0eoHy.d.cts +0 -59
  436. package/dist/SubscriberBuilder-BEv0eoHy.d.cts.map +0 -1
  437. package/dist/SubscriberBuilder-C0ZEtGDI.cjs +0 -125
  438. package/dist/SubscriberBuilder-C0ZEtGDI.cjs.map +0 -1
  439. package/dist/SubscriberBuilder-h7B_cHMr.mjs +0 -114
  440. package/dist/SubscriberBuilder-h7B_cHMr.mjs.map +0 -1
  441. package/dist/SubscriberBuilder-tyH5yTk5.d.mts +0 -59
  442. package/dist/SubscriberBuilder-tyH5yTk5.d.mts.map +0 -1
  443. package/dist/Topic-DEVGo0Dm.d.cts +0 -89
  444. package/dist/Topic-DEVGo0Dm.d.cts.map +0 -1
  445. package/dist/Topic-zk_6Gthr.d.mts +0 -89
  446. package/dist/Topic-zk_6Gthr.d.mts.map +0 -1
  447. package/dist/auth.d.cts.map +0 -1
  448. package/dist/auth.d.mts.map +0 -1
  449. package/dist/cache.d.cts.map +0 -1
  450. package/dist/cache.d.mts.map +0 -1
  451. package/dist/construct-interface-DPlxfpoS.d.mts.map +0 -1
  452. package/dist/construct-interface-DgXTJcOD.d.cts.map +0 -1
  453. package/dist/credential.cjs.map +0 -1
  454. package/dist/credential.d.cts.map +0 -1
  455. package/dist/credential.d.mts.map +0 -1
  456. package/dist/credential.mjs.map +0 -1
  457. package/dist/database/kysely.cjs.map +0 -1
  458. package/dist/database/kysely.d.cts.map +0 -1
  459. package/dist/database/kysely.d.mts.map +0 -1
  460. package/dist/database/kysely.mjs.map +0 -1
  461. package/dist/functions-B6qCvfmy.cjs.map +0 -1
  462. package/dist/functions-C53GW2eQ.mjs.map +0 -1
  463. package/dist/index-B2urf3YI.d.cts +0 -26
  464. package/dist/index-B2urf3YI.d.cts.map +0 -1
  465. package/dist/index-C1ZwNOOk.d.cts.map +0 -1
  466. package/dist/index-Cc4kKPag.d.mts.map +0 -1
  467. package/dist/index-DMCDvnsM.d.mts +0 -26
  468. package/dist/index-DMCDvnsM.d.mts.map +0 -1
  469. package/dist/index-D_frT6MP.d.cts +0 -165
  470. package/dist/index-D_frT6MP.d.cts.map +0 -1
  471. package/dist/index-DcyIYbDS.d.mts +0 -165
  472. package/dist/index-DcyIYbDS.d.mts.map +0 -1
  473. package/dist/lazyAccessors-BHtcqgz2.mjs +0 -211
  474. package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
  475. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
  476. package/dist/processAudits-BpRlPQMW.mjs.map +0 -1
  477. package/dist/processAudits-D_2W5x8k.cjs.map +0 -1
  478. package/dist/queue/index.cjs.map +0 -1
  479. package/dist/queue/index.d.cts.map +0 -1
  480. package/dist/queue/index.d.mts.map +0 -1
  481. package/dist/queue/index.mjs.map +0 -1
  482. package/dist/telemetry-DGcFlVpB.d.cts.map +0 -1
  483. package/dist/telemetry-DGcFlVpB.d.mts.map +0 -1
  484. package/dist/topic/index.cjs.map +0 -1
  485. package/dist/topic/index.mjs.map +0 -1
@@ -1,22 +1,30 @@
1
- import { t as StandardSchemaV1 } from "../index-CeEtxDmK.mjs";
2
- import { r as Function } from "../index-DcyIYbDS.mjs";
1
+ import { n as StandardSchemaV1 } from "../index-DdRjYhiJ.mjs";
2
+ import "../Construct-BMk_CRSD.mjs";
3
+ import { n as Function } from "../Function-BKReud5p.mjs";
3
4
  import { t as HttpMethod } from "../types-DMuSQeLL.mjs";
4
- import { r as Endpoint, s as EndpointSchemas } from "../Endpoint-oS-Fe3d_.mjs";
5
- import { t as Queue } from "../Queue-D9X6OoON.mjs";
6
- import { t as Subscriber } from "../Subscriber-C4heaAyO.mjs";
5
+ import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-BUoDD96P.mjs";
6
+ import { t as Queue } from "../Queue-B8HGg439.mjs";
7
+ import { t as Subscriber } from "../Subscriber-CtQXhcL7.mjs";
8
+ import { J as RecordedClose, K as InvalidWebSocketRequest, L as Connection, X as RecordedSend, gt as WebSocketPublisher, ht as WebSocketMessages, n as WebSocketApi, pt as NoMessages, q as RecordedBroadcast, rt as TestWebSocketPublisher } from "../websocket-api-CPEzJyDt.mjs";
9
+ import { t as KyselyDatabase } from "../kysely-De5rAC-E.mjs";
10
+ import { t as Fake } from "../fake-BqhP8RRQ.mjs";
11
+ import { o as TestStage } from "../stages-DaTaoQei.mjs";
12
+ import { p as Verdicts } from "../inbox-YOdxlyfj.mjs";
13
+ import { InboxAddressing } from "@geekmidas/manifest";
7
14
  import { EventPublisher, ExtractPublisherMessage } from "@geekmidas/events";
8
15
  import { Service, ServiceDiscovery, ServiceRecord } from "@geekmidas/services";
9
- import { AuditStorage, AuditableAction, Auditor } from "@geekmidas/audit";
10
- import { HttpHandler } from "msw";
16
+ import { EnvironmentParser } from "@geekmidas/envkit";
17
+ import { ComposedAttachment } from "@geekmidas/emailkit/inbound";
18
+ import { Kysely } from "kysely";
19
+ import { TEST_CONTEXT_HEADER } from "@geekmidas/testkit/context";
20
+ import { HttpHandler, WebSocketHandler } from "msw";
21
+ import { Browser, BrowserOptions } from "@geekmidas/testkit/browser";
22
+ import { FakerFactory } from "@geekmidas/testkit/faker";
23
+ import { Mailbox } from "@geekmidas/testkit/mailbox";
11
24
  import { Logger } from "@geekmidas/logger";
12
25
  import { ComposableStandardSchema, InferComposableStandardSchema, InferStandardSchema } from "@geekmidas/schema";
26
+ import { AuditStorage, AuditableAction, Auditor } from "@geekmidas/audit";
13
27
  //#region src/endpoints/MswEndpointAdaptor.d.ts
14
- /**
15
- * Header used to identify which test context a request belongs to.
16
- * Each concurrent test registers its own context (services, db transaction, etc.)
17
- * and the MSW handler looks it up by this header value.
18
- */
19
- export declare const TEST_CONTEXT_HEADER = "x-test-context-id";
20
28
  /**
21
29
  * Options for creating MSW handlers from endpoint constructs.
22
30
  *
@@ -57,16 +65,16 @@ interface CreateMswHandlersOptions {
57
65
  }
58
66
  /**
59
67
  * Options for registering a per-test context.
60
- * Follows the same pattern as TestRequestAdaptor — services, database,
61
- * publisher, and auditorStorage are provided explicitly.
68
+ * Follows the same pattern as TestRequestAdaptor — services, database and
69
+ * auditorStorage are provided explicitly. A topic is a service under its own
70
+ * name, so a recorder in `services` (`{ users: recorder }`) captures what an
71
+ * endpoint publishes to it.
62
72
  */
63
73
  interface RegisterContextOptions {
64
74
  /** Service instances keyed by serviceName */
65
75
  services?: Record<string, unknown>;
66
76
  /** Database instance — required when endpoints use .database() */
67
77
  database?: unknown;
68
- /** Event publisher service definition */
69
- publisher?: Service;
70
78
  /** Audit storage instance — required when endpoints use .auditor() */
71
79
  auditorStorage?: unknown;
72
80
  }
@@ -102,13 +110,13 @@ type TestHttpResponse<TBody = any> = {
102
110
  status: number;
103
111
  headers: Record<string, string | string[]>;
104
112
  };
105
- export declare class TestEndpointAdaptor<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string> {
113
+ export declare class TestEndpointAdaptor<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string> {
106
114
  private readonly endpoint;
107
115
  private serviceDiscovery;
108
- static getDefaultServiceDiscover<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string>(_endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>): any;
109
- constructor(endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>, serviceDiscovery?: ServiceDiscovery<any>);
110
- fullRequest(ctx: TestRequestAdaptor<TInput, TServices, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>): Promise<TestHttpResponse<InferStandardSchema<TOutSchema>>>;
111
- request(ctx: TestRequestAdaptor<TInput, TServices, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>): Promise<InferStandardSchema<TOutSchema>>;
116
+ static getDefaultServiceDiscover<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string>(_endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>): any;
117
+ constructor(endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>, serviceDiscovery?: ServiceDiscovery<any>);
118
+ fullRequest(ctx: TestRequestAdaptor<TInput, TServices, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>): Promise<TestHttpResponse<InferStandardSchema<TOutSchema>>>;
119
+ request(ctx: TestRequestAdaptor<TInput, TServices, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName>): Promise<InferStandardSchema<TOutSchema>>;
112
120
  }
113
121
  /**
114
122
  * Conditional audit storage requirement - required when TAuditStorage is configured
@@ -124,24 +132,22 @@ type DatabaseRequirement<TDatabase = undefined> = TDatabase extends undefined ?
124
132
  /** Database instance - required when endpoint uses .database() */
125
133
  database: TDatabase;
126
134
  };
127
- type TestRequestAdaptor<TInput extends EndpointSchemas = {}, TServices extends Service[] = [], TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, _TAuditStorageServiceName extends string = string, TDatabase = undefined, _TDatabaseServiceName extends string = string> = {
135
+ type TestRequestAdaptor<TInput extends EndpointSchemas = {}, TServices extends Service[] = [], TAuditStorage extends AuditStorage | undefined = undefined, _TAuditStorageServiceName extends string = string, TDatabase = undefined, _TDatabaseServiceName extends string = string> = {
128
136
  services: ServiceRecord<TServices>;
129
137
  headers: Record<string, string>;
130
- publisher?: Service<TEventPublisherServiceName, TEventPublisher>;
131
138
  } & InferComposableStandardSchema<TInput> & AuditStorageRequirement<TAuditStorage> & DatabaseRequirement<TDatabase>;
132
139
  //#endregion
133
140
  //#region src/functions/TestFunctionAdaptor.d.ts
134
- export declare class TestFunctionAdaptor<TInput extends ComposableStandardSchema | undefined = undefined, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>> {
141
+ export declare class TestFunctionAdaptor<TInput extends ComposableStandardSchema | undefined = undefined, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>> {
135
142
  private readonly fn;
136
143
  private serviceDiscovery;
137
- static getDefaultServiceDiscovery<TInput extends ComposableStandardSchema | undefined = undefined, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>>(_fn: Function<TInput, TServices, TLogger, TOutSchema, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName, TAuditAction, any>): any;
138
- constructor(fn: Function<TInput, TServices, TLogger, TOutSchema, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName, TAuditAction, any>, serviceDiscovery?: ServiceDiscovery<any>);
139
- invoke(ctx: TestFunctionRequest<TInput, TServices, TEventPublisher, TEventPublisherServiceName, TDatabase, TAuditAction>): Promise<InferStandardSchema<TOutSchema>>;
144
+ static getDefaultServiceDiscovery<TInput extends ComposableStandardSchema | undefined = undefined, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>>(_fn: Function<TInput, TServices, TLogger, TOutSchema, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName, TAuditAction, any>): any;
145
+ constructor(fn: Function<TInput, TServices, TLogger, TOutSchema, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName, TAuditAction, any>, serviceDiscovery?: ServiceDiscovery<any>);
146
+ invoke(ctx: TestFunctionRequest<TInput, TServices, TDatabase, TAuditAction>): Promise<InferStandardSchema<TOutSchema>>;
140
147
  }
141
- type TestFunctionRequest<TInput extends ComposableStandardSchema | undefined = undefined, TServices extends Service[] = [], TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TDatabase = undefined, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>> = {
148
+ type TestFunctionRequest<TInput extends ComposableStandardSchema | undefined = undefined, TServices extends Service[] = [], TDatabase = undefined, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>> = {
142
149
  input: InferComposableStandardSchema<TInput>;
143
150
  services: ServiceRecord<TServices>;
144
- publisher?: Service<TEventPublisherServiceName, TEventPublisher>;
145
151
  db?: TDatabase;
146
152
  auditor?: Auditor<TAuditAction>;
147
153
  } & InferComposableStandardSchema<{
@@ -152,40 +158,511 @@ type TestFunctionRequest<TInput extends ComposableStandardSchema | undefined = u
152
158
  /**
153
159
  * In-memory test driver for a {@link Queue} worker. Hand it a batch of messages
154
160
  * and it registers the queue's services, runs the handler in a request context,
155
- * and returns the handler result — no SQS/pg-boss required.
161
+ * and returns the handler result — no SQS/pg-boss required. A queue with a
162
+ * database gets `db` registered from it, or the one the request passes.
156
163
  *
157
164
  * @example
158
165
  * const adapter = new TestQueueAdaptor(ordersQueue);
159
166
  * await adapter.invoke({ messages: [{ orderId: '123' }] });
160
167
  */
161
- export declare class TestQueueAdaptor<TName extends string = string, TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> {
168
+ export declare class TestQueueAdaptor<TName extends string = string, TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger, TDatabase = undefined, TDatabaseServiceName extends string = string> {
162
169
  private readonly queue;
163
170
  private serviceDiscovery;
164
171
  static getDefaultServiceDiscovery(): any;
165
- constructor(queue: Queue<TName, TMessage, TServices, TLogger>, serviceDiscovery?: ServiceDiscovery<any>);
166
- invoke(request: TestQueueRequest<TMessage, TServices>): Promise<unknown>;
172
+ constructor(queue: Queue<TName, TMessage, TServices, TLogger, TDatabase, TDatabaseServiceName>, serviceDiscovery?: ServiceDiscovery<any>);
173
+ invoke(request: TestQueueRequest<TMessage, TServices, TDatabase>): Promise<unknown>;
174
+ private getDatabase;
167
175
  }
168
- type TestQueueRequest<TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = []> = {
176
+ type TestQueueRequest<TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TDatabase = undefined> = {
169
177
  messages: InferStandardSchema<TMessage>[];
170
178
  services?: ServiceRecord<TServices>;
179
+ /** Stands in for the queue's database — a transaction, say. */
180
+ db?: TDatabase;
171
181
  };
172
182
  //#endregion
173
183
  //#region src/subscribers/TestSubscriberAdaptor.d.ts
174
184
  type ExtractEventPayloads<TPublisher extends EventPublisher<any> | undefined, TEventTypes extends any[]> = TPublisher extends EventPublisher<any> ? Extract<ExtractPublisherMessage<TPublisher>, {
175
185
  type: TEventTypes[number];
176
186
  }> : never;
177
- export declare class TestSubscriberAdaptor<TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][] = ExtractPublisherMessage<TEventPublisher>['type'][]> {
187
+ export declare class TestSubscriberAdaptor<TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TEventPublisher extends EventPublisher<any> | undefined = undefined, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][] = ExtractPublisherMessage<TEventPublisher>['type'][], TDatabase = undefined, TDatabaseServiceName extends string = string> {
178
188
  private readonly subscriber;
179
189
  private serviceDiscovery;
180
190
  static getDefaultServiceDiscovery(): any;
181
- constructor(subscriber: Subscriber<TServices, TLogger, OutSchema, TEventPublisher, TEventPublisherServiceName, TSubscribedEvents>, serviceDiscovery?: ServiceDiscovery<any>);
182
- invoke(request: TestSubscriberRequest<TEventPublisher, TSubscribedEvents, TServices>): Promise<InferStandardSchema<OutSchema>>;
191
+ constructor(subscriber: Subscriber<TServices, TLogger, OutSchema, TEventPublisher, TSubscribedEvents, TDatabase, TDatabaseServiceName>, serviceDiscovery?: ServiceDiscovery<any>);
192
+ invoke(request: TestSubscriberRequest<TEventPublisher, TSubscribedEvents, TServices, TDatabase>): Promise<InferStandardSchema<OutSchema>>;
193
+ private getDatabase;
183
194
  private filterEvents;
184
195
  }
185
- type TestSubscriberRequest<TEventPublisher extends EventPublisher<any> | undefined = undefined, TSubscribedEvents extends any[] = [], TServices extends Service[] = []> = {
196
+ type TestSubscriberRequest<TEventPublisher extends EventPublisher<any> | undefined = undefined, TSubscribedEvents extends any[] = [], TServices extends Service[] = [], TDatabase = undefined> = {
186
197
  events: ExtractEventPayloads<TEventPublisher, TSubscribedEvents>[];
187
198
  services?: ServiceRecord<TServices>;
199
+ /** Stands in for the subscriber's database — a transaction, say. */
200
+ db?: TDatabase;
188
201
  };
189
202
  //#endregion
190
- export type { CreateMswHandlersOptions, CreateMswHandlersResult, RegisterContextOptions };
203
+ //#region src/testing/manifest.d.ts
204
+ /** Where an export lives: what an import statement has to say. */
205
+ interface TestManifestSource {
206
+ /** Absolute path to the module. */
207
+ file: string;
208
+ /** The name it is exported as. */
209
+ export: string;
210
+ }
211
+ interface TestManifest {
212
+ /** The stage the environment was resolved for — `test`. */
213
+ stage: TestStage;
214
+ /** Every construct the app declares, by id. */
215
+ constructs: Record<string, {
216
+ kind: string;
217
+ source: TestManifestSource;
218
+ }>;
219
+ /** Every endpoint, and the surface that serves it. */
220
+ endpoints: {
221
+ surface: string;
222
+ source: TestManifestSource;
223
+ }[];
224
+ /**
225
+ * Every topic subscriber — what a topic's events are delivered to. Not a
226
+ * construct, so not in `constructs`: the build finds them, as it finds
227
+ * endpoints.
228
+ */
229
+ subscribers?: {
230
+ source: TestManifestSource;
231
+ }[];
232
+ /**
233
+ * The test stage's environment — reconcile's output, keyed as the
234
+ * constructs derive their keys.
235
+ */
236
+ env: Record<string, string>;
237
+ }
238
+ /** The environment variable `gkm test` names the manifest in. */
239
+ export declare const TEST_MANIFEST_ENV = "GKM_TEST_MANIFEST";
240
+ /**
241
+ * Read a test manifest: from a path, a `file:` URL, or — given nothing — the
242
+ * one `gkm test` named in `GKM_TEST_MANIFEST`.
243
+ */
244
+ export declare function loadTestManifest(from?: string | URL): TestManifest;
245
+ /** A feature test ran without a manifest to build itself from. */
246
+ export declare class NoTestManifest extends Error {
247
+ constructor();
248
+ }
249
+ //#endregion
250
+ //#region src/testing/receive.d.ts
251
+ /** What a test hands `mailbox.receive`. */
252
+ type MailToReceive = ({
253
+ /** The envelope recipient — what routes it. Required. */
254
+ to: string;
255
+ /** The envelope sender, and `From:`. Required without `raw`. */
256
+ from: string;
257
+ raw?: undefined;
258
+ /** `To:` as written, when it should differ from the envelope. */
259
+ headerTo?: string | readonly string[];
260
+ cc?: string | readonly string[];
261
+ replyTo?: string;
262
+ subject?: string;
263
+ text?: string;
264
+ html?: string;
265
+ attachments?: readonly ComposedAttachment[];
266
+ headers?: Readonly<Record<string, string>>;
267
+ } & Judged) | ({
268
+ /** The envelope recipient — what routes it. Required. */
269
+ to: string;
270
+ /** A whole message, as an `.eml` holds it. */
271
+ raw: string | Uint8Array;
272
+ /** The envelope sender; `From:` in the message otherwise. */
273
+ from?: string;
274
+ } & Judged);
275
+ interface Judged {
276
+ /** What the provider judged — `'unavailable'` for any left out. */
277
+ verdicts?: Partial<Verdicts>;
278
+ }
279
+ /** `mailbox.receive` named no recipient. */
280
+ export declare class ReceiveNeedsRecipient extends Error {
281
+ constructor();
282
+ }
283
+ /** `mailbox.receive` was given fields and a raw message, or neither a sender nor raw. */
284
+ export declare class ReceiveFieldsOrRaw extends Error {
285
+ readonly reason: 'both' | 'no-sender';
286
+ constructor(reason: 'both' | 'no-sender');
287
+ }
288
+ /** No declared inbox receives at the address `mailbox.receive` was given. */
289
+ export declare class NoInboxForAddress extends Error {
290
+ readonly address: string;
291
+ readonly inboxes: readonly string[];
292
+ constructor(address: string, inboxes: readonly string[]);
293
+ }
294
+ /** An inbox the test can receive for: no Mailpit to deliver to. */
295
+ export declare class InboxNotLocal extends Error {
296
+ readonly inbox: string;
297
+ constructor(inbox: string);
298
+ }
299
+ //#endregion
300
+ //#region src/testing/featureTest.d.ts
301
+ /** How each database's test factory is built, keyed by its service name. */
302
+ type FactoryBuilders = Record<string, (db: Kysely<any>) => unknown>;
303
+ interface FeatureTestOptions<TBrowser extends Browser, TFactories extends FactoryBuilders = {}> {
304
+ /**
305
+ * What the app declares and the environment its test stage resolved.
306
+ * Defaults to the manifest `gkm test` names in `GKM_TEST_MANIFEST`.
307
+ */
308
+ manifest?: TestManifest;
309
+ /**
310
+ * The app's modules, already imported, by the absolute path the manifest
311
+ * records for them. The generated harness imports them statically, from
312
+ * inside the app, so they resolve the way the app's own code does — its
313
+ * tsconfig paths included. A module not here is imported by path.
314
+ */
315
+ modules?: Readonly<Record<string, Record<string, unknown>>>;
316
+ /** The browser each test gets — the generated one, with the app's clients. */
317
+ browser?: new (options?: BrowserOptions) => TBrowser;
318
+ /**
319
+ * Each database's test factory — `createFactory` from
320
+ * `test/factories/<construct>.ts`, which the generated harness imports —
321
+ * keyed by the database's service name. Each is called once per test with
322
+ * that database's transaction, so what a test inserts through it is rolled
323
+ * back with everything else, and seen by the endpoints it calls.
324
+ */
325
+ factories?: TFactories;
326
+ /**
327
+ * Each external API's fake — the default export of `test/fakes/<id>.ts`,
328
+ * which the generated harness imports — keyed by the API's construct id.
329
+ * An app fake is served at the URL the test stage resolved for it.
330
+ */
331
+ fakes?: Readonly<Record<string, Fake>>;
332
+ }
333
+ /** Each database's schema, keyed by its service name. */
334
+ type DatabaseSchemas = Record<string, unknown>;
335
+ /** Each construct's client, keyed by its service name — what `services` types. */
336
+ type ServiceClients = Record<string, unknown>;
337
+ /** The client a construct's service registers — what a handler is handed. */
338
+ type ClientOf<C> = C extends {
339
+ service: {
340
+ register: (...args: any[]) => infer TClient;
341
+ };
342
+ } ? Awaited<TClient> : never;
343
+ /**
344
+ * The app's services for this test, by service name — `services.get('shipping')`.
345
+ *
346
+ * What a handler that depends on the construct is handed, resolved the way the
347
+ * test's endpoints resolve it: an external API's client aimed at whatever the
348
+ * test stage resolved (its fake, which the test never sees), a topic or queue's
349
+ * recorder, a database's transaction for this test.
350
+ */
351
+ interface TestServices<TServices extends ServiceClients> {
352
+ get<K extends keyof TServices & string>(name: K): Promise<TServices[K]>;
353
+ }
354
+ /**
355
+ * The app's databases for this test, by service name — `db.get('database')`.
356
+ *
357
+ * Each is this test's transaction on that database: opened by whatever reaches
358
+ * it first — the test, a factory, an endpoint — and the same one for all of
359
+ * them, rolled back after the test.
360
+ */
361
+ interface TestDatabases<TDatabases extends DatabaseSchemas> {
362
+ get<K extends keyof TDatabases & string>(name: K): Promise<Kysely<TDatabases[K]>>;
363
+ }
364
+ /**
365
+ * Each of the app's databases' test factory, by service name —
366
+ * `await factories.get('database')`. Built on first use, on that database's
367
+ * transaction for this test — the one `db.get` returns — and the same factory
368
+ * for the rest of the test.
369
+ */
370
+ interface TestFactories<TFactories extends FactoryBuilders> {
371
+ get<K extends keyof TFactories & string>(name: K): Promise<ReturnType<TFactories[K]>>;
372
+ }
373
+ interface FeatureContext<TBrowser extends Browser, TDatabases extends DatabaseSchemas = {}, TFactories extends FactoryBuilders = {}, TServices extends ServiceClients = {}> {
374
+ /** This test's browser, already the global `fetch`. */
375
+ browser: TBrowser;
376
+ /**
377
+ * The app's own databases — not a tenant an auth server owns, not a
378
+ * reader — by service name: `await db.get('database')`. The same
379
+ * transaction the test's endpoints and factories use.
380
+ */
381
+ db: TestDatabases<TDatabases>;
382
+ /**
383
+ * Each of the app's databases' test factory, by service name —
384
+ * `await factories.get('database')` — on the same transaction `db.get`
385
+ * returns.
386
+ */
387
+ factories: TestFactories<TFactories>;
388
+ /**
389
+ * Testkit's faker — the one factories are handed — seeded from this test's
390
+ * name, so a failing test fails again with the same data, and so a test
391
+ * imports nothing to make some.
392
+ */
393
+ faker: FakerFactory;
394
+ /**
395
+ * The mail sent to an address during this test, read from Mailpit — and,
396
+ * with `receive`, mail arriving at one of the app's inboxes.
397
+ */
398
+ mailbox: FeatureMailbox;
399
+ /**
400
+ * What this test published to a topic or enqueued on a queue, in order.
401
+ *
402
+ * Also delivered: once each request the test makes has answered, a queue's
403
+ * messages reach its consumer and a topic's events every subscriber that
404
+ * named them, in this test's transaction — see {@link deliver}.
405
+ */
406
+ published: (channel: {
407
+ id: string;
408
+ }) => PublishedMessage[];
409
+ /**
410
+ * What this test sent to a `WebSocketApi`'s sockets — through
411
+ * `services.<surface>` in an endpoint, a subscriber, a consumer — recorded
412
+ * rather than delivered: `sockets(realtime).sent`, `.broadcasts`,
413
+ * `.closed`. Each send is checked by the surface's declared messages, as
414
+ * deployed.
415
+ *
416
+ * @throws {UnknownWebSocketApi} when the manifest declares no such surface.
417
+ */
418
+ sockets: <S extends WebSocketApi<string, any>>(surface: S) => TestWebSocketPublisher<MessagesOf<S>>;
419
+ /**
420
+ * A subscriber, run on its own — handed events rather than delivered them —
421
+ * with this test's services: its databases resolve to this test's
422
+ * transactions, as an endpoint's do.
423
+ */
424
+ subscriber: <S extends Subscriber<any, any, any, any, any, any, any>>(subscriber: S) => SubscriberAdaptorOf<S>;
425
+ /**
426
+ * The app's services, by service name — `await services.get('shipping')` —
427
+ * as a handler is handed them. Assert on an external API through its own
428
+ * client: the fake behind it stays hidden, and the same assertion holds
429
+ * against the real API.
430
+ */
431
+ services: TestServices<TServices>;
432
+ /** A queue's worker, run on its own with this test's services. */
433
+ queue: <Q extends Queue<any, any, any, any, any, any>>(queue: Q) => QueueAdaptorOf<Q>;
434
+ /**
435
+ * A bucket's objects, as its subscribers see them change.
436
+ *
437
+ * An upload or delete through the bucket's client — `services.uploads`,
438
+ * in a handler or in the test — is reported to the bucket's subscribers
439
+ * already; `emit` reports what the storage would see and the app's code
440
+ * never does, such as a browser uploading to a presigned URL.
441
+ */
442
+ objects: (bucket: {
443
+ id: string;
444
+ }) => {
445
+ emit: (...events: EmittedObjectEvent[]) => Promise<void>;
446
+ };
447
+ }
448
+ /** `mailbox(address)` reads what was sent; `mailbox.receive(…)` sends to an inbox. */
449
+ interface FeatureMailbox {
450
+ (address: string): Mailbox;
451
+ /**
452
+ * Mail arriving at an inbox: delivered to Mailpit with `to` as its envelope
453
+ * recipient, received as `gkm dev` receives it, and handed to each inbox
454
+ * subscriber in this test's transaction. Resolves once they have run.
455
+ *
456
+ * @throws {NoInboxForAddress} when no declared inbox receives at `to`.
457
+ */
458
+ receive(mail: MailToReceive): Promise<void>;
459
+ }
460
+ /** An object changing, as a test reports it: the bucket is the one emitted on. */
461
+ interface EmittedObjectEvent {
462
+ type: 'object.created' | 'object.deleted';
463
+ key: string;
464
+ size?: number;
465
+ etag?: string;
466
+ versionId?: string;
467
+ }
468
+ type SubscriberAdaptorOf<S> = S extends Subscriber<infer TServices, infer TLogger, infer OutSchema, infer TEventPublisher, infer TSubscribedEvents, infer TDatabase, infer TDatabaseServiceName> ? TestSubscriberAdaptor<TServices, TLogger, OutSchema, TEventPublisher, TSubscribedEvents, TDatabase, TDatabaseServiceName> : never;
469
+ type QueueAdaptorOf<Q> = Q extends Queue<infer TName, infer TMessage, infer TServices, infer TLogger, infer TDatabase, infer TDatabaseServiceName> ? TestQueueAdaptor<TName, TMessage, TServices, TLogger, TDatabase, TDatabaseServiceName> : never;
470
+ /** The messages a WebSocket surface declares — what its recorder is typed by. */
471
+ type MessagesOf<S> = S extends WebSocketApi<string, infer TMessages extends WebSocketMessages> ? TMessages : never;
472
+ /** The schema a database construct was declared with — what `db` is typed by. */
473
+ type DatabaseOf<C> = C extends KyselyDatabase<infer DB, any> ? DB : unknown;
474
+ /** One message as it was published: its type and its payload. */
475
+ interface PublishedMessage {
476
+ type: string;
477
+ payload: unknown;
478
+ }
479
+ type FeatureFn<TBrowser extends Browser, TDatabases extends DatabaseSchemas, TFactories extends FactoryBuilders, TServices extends ServiceClients> = (context: FeatureContext<TBrowser, TDatabases, TFactories, TServices>) => unknown;
480
+ interface FeatureIt<TBrowser extends Browser, TDatabases extends DatabaseSchemas = {}, TFactories extends FactoryBuilders = {}, TServices extends ServiceClients = {}> {
481
+ (name: string, fn: FeatureFn<TBrowser, TDatabases, TFactories, TServices>, timeout?: number): void;
482
+ only(name: string, fn: FeatureFn<TBrowser, TDatabases, TFactories, TServices>, timeout?: number): void;
483
+ skip(name: string, fn: FeatureFn<TBrowser, TDatabases, TFactories, TServices>, timeout?: number): void;
484
+ }
485
+ export declare function featureTest<TBrowser extends Browser = Browser, TDatabases extends DatabaseSchemas = {}, TFactories extends FactoryBuilders = {}, TServices extends ServiceClients = {}>(options?: FeatureTestOptions<TBrowser, TFactories>): FeatureIt<TBrowser, TDatabases, TFactories, TServices>;
486
+ /** `objects(bucket)` named a bucket no subscriber in the app is bound to. */
487
+ /** `sockets(surface)` for a surface the test manifest does not declare. */
488
+ export declare class UnknownWebSocketApi extends Error {
489
+ readonly surface: string;
490
+ readonly declared: readonly string[];
491
+ constructor(surface: string, declared: readonly string[]);
492
+ }
493
+ /** What `signInWithMagicLink` uses of a better-auth client. */
494
+ interface MagicLinkAuthClient<TSession> {
495
+ signIn: {
496
+ magicLink(input: {
497
+ email: string;
498
+ }): Promise<{
499
+ error?: {
500
+ message?: string;
501
+ } | null;
502
+ }>;
503
+ };
504
+ getSession(): Promise<{
505
+ data: TSession | null;
506
+ }>;
507
+ }
508
+ /**
509
+ * Sign a test's browser in the way a person does: ask the auth server for a
510
+ * magic link, open the email it sent, follow the link.
511
+ *
512
+ * What the generated `browser.signIn(email)` calls. The address's mail is
513
+ * cleared first — so the link is this request's, not one an earlier test left
514
+ * — and cleared again after the test, like any address a test reads. Returns
515
+ * the session the auth server then reports, as better-auth hands it back.
516
+ */
517
+ export declare function signInWithMagicLink<TSession>(browser: Browser, auth: MagicLinkAuthClient<TSession>, email?: string): Promise<TSession>;
518
+ /** `browser.signIn` finished without a session. */
519
+ export declare class SignInFailed extends Error {
520
+ readonly email: string;
521
+ readonly reason: string;
522
+ constructor(email: string, reason: string);
523
+ }
524
+ /** A request reached an in-process server without a test to belong to. */
525
+ export declare class UnknownTestContext extends Error {
526
+ readonly url: string;
527
+ readonly id: string | undefined;
528
+ constructor(url: string, id: string | undefined);
529
+ }
530
+ /** `mailbox` was used in an app that declares no Email construct. */
531
+ export declare class NoInbox extends Error {
532
+ constructor();
533
+ }
534
+ /** `db.get(name)` named no database the test is handed. */
535
+ export declare class UnknownDatabase extends Error {
536
+ readonly database: string;
537
+ readonly known: readonly string[];
538
+ constructor(database: string, known: readonly string[]);
539
+ }
540
+ /** A factory keyed by a service name no database the app declares has. */
541
+ export declare class UnknownFactory extends Error {
542
+ readonly factory: string;
543
+ readonly known: readonly string[];
544
+ constructor(factory: string, known: readonly string[]);
545
+ }
546
+ /** A published message the consumer's own schema refuses. */
547
+ export declare class MessageRejected extends Error {
548
+ readonly consumer: string;
549
+ readonly published: PublishedMessage;
550
+ readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
551
+ constructor(consumer: string, published: PublishedMessage, issues: ReadonlyArray<StandardSchemaV1.Issue>);
552
+ }
553
+ /** A consumer that threw while handling what the test published. */
554
+ export declare class DeliveryFailed extends Error {
555
+ readonly consumer: string;
556
+ readonly messages: readonly PublishedMessage[];
557
+ readonly cause: unknown;
558
+ constructor(consumer: string, messages: readonly PublishedMessage[], cause: unknown);
559
+ }
560
+ /** Consumers that kept publishing to each other without settling. */
561
+ export declare class DeliveryDidNotSettle extends Error {
562
+ readonly rounds: number;
563
+ readonly channels: readonly string[];
564
+ constructor(rounds: number, channels: readonly string[]);
565
+ }
566
+ /** `services.get(name)` for a name no construct of the app is served by. */
567
+ export declare class UnknownService extends Error {
568
+ readonly serviceName: string;
569
+ readonly available: readonly string[];
570
+ constructor(serviceName: string, available: readonly string[]);
571
+ }
572
+ //#endregion
573
+ //#region src/testing/peer.d.ts
574
+ /**
575
+ * The TCP peer a test's in-process requests arrive from.
576
+ *
577
+ * A feature test hands a request straight to a surface's Hono app — no
578
+ * socket, no server — so the app's bindings have no peer to read. Deployed,
579
+ * every request has one, and what a surface trusts follows from it: the auth
580
+ * server honours `x-gkm-client-ip` only from an internal caller, a loopback
581
+ * or private peer with no `Origin` and no forwarding header. With no peer at
582
+ * all the header was dropped, and every test's session check became the same
583
+ * client to Better Auth's rate limiter.
584
+ *
585
+ * So an in-process dispatch says where it came from, the way
586
+ * `@hono/node-server` does: its bindings carry `incoming.socket.remoteAddress`.
587
+ * The address is loopback because that is the truth — the request came from
588
+ * this process. A browser's own address still travels in its
589
+ * `x-forwarded-for`, which makes it outside traffic exactly as it would be
590
+ * behind the stack's proxy.
591
+ *
592
+ * Only a test's dispatch passes these. A runtime with no socket of its own
593
+ * (Lambda, Bun) still has no peer, and a request with no peer is still not an
594
+ * internal caller's.
595
+ */
596
+ /** The address an in-process request presents as its peer. */
597
+ export declare const IN_PROCESS_PEER_ADDRESS = "127.0.0.1";
598
+ /** The part of `@hono/node-server`'s bindings a surface reads its peer from. */
599
+ interface InProcessBindings {
600
+ incoming: {
601
+ socket: {
602
+ remoteAddress: string;
603
+ };
604
+ };
605
+ }
606
+ /** Bindings for `app.fetch(request, bindings)` from inside this process. */
607
+ export declare function inProcessBindings(): InProcessBindings;
608
+ //#endregion
609
+ //#region src/websocket/msw.d.ts
610
+ /**
611
+ * The query parameter that names a connection's test context. Read and
612
+ * removed before `connect()` sees `query`, so the handler never does.
613
+ */
614
+ export declare const TEST_CONTEXT_PARAM = "__gkm_test_context";
615
+ /**
616
+ * The close code a refused connection gets: `4000 + status`, so a 401 is
617
+ * 4401. MSW cannot answer an upgrade with a status line, as a server does.
618
+ */
619
+ export declare const REFUSED_CLOSE_BASE = 4000;
620
+ /** What one test's connections run with. */
621
+ interface MswWebSocketContext {
622
+ /** Instances for the routes' dependencies — the test's transaction. */
623
+ services?: Record<string, unknown>;
624
+ /** Whose connection it is, as `.auth()` would have resolved it. */
625
+ session?: unknown;
626
+ }
627
+ interface CreateMswWebSocketHandlersOptions {
628
+ /** The URL the client opens — what `ws.link()` matches. */
629
+ url: string | RegExp;
630
+ /** What unregistered services are registered with. Default the surface's. */
631
+ envParser?: EnvironmentParser<{}>;
632
+ /**
633
+ * The `memory://` channel sends reach the connections on. Default one of
634
+ * its own, so two adaptors in one process never share sockets.
635
+ */
636
+ channel?: string;
637
+ }
638
+ interface MswWebSocketHandlers<TMessages extends WebSocketMessages = NoMessages> {
639
+ /** For `setupServer(...)` or `server.use(...)`. */
640
+ handlers: WebSocketHandler[];
641
+ /** Give a test's connections their services and session. */
642
+ registerContext(id: string, context: MswWebSocketContext): void;
643
+ removeContext(id: string): void;
644
+ /**
645
+ * A publisher whose sends reach these connections — hand it to an
646
+ * endpoint as `services.<surface>`.
647
+ */
648
+ publisher: WebSocketPublisher<TMessages>;
649
+ /**
650
+ * The same channel as a connection string — what
651
+ * `<ID>_PUBLISHER_CONNECTION_STRING` would be for `services.<surface>` to
652
+ * register onto it.
653
+ */
654
+ connectionString: string;
655
+ /** Every connection open now, in the order they opened. */
656
+ readonly connections: readonly Connection[];
657
+ /** Stop receiving sends on the channel. */
658
+ close(): Promise<void>;
659
+ }
660
+ /** A connection whose query names a context no test registered. */
661
+ export declare class UnknownWebSocketTestContext extends Error {
662
+ readonly id: string;
663
+ constructor(id: string);
664
+ }
665
+ export declare function createMswWebSocketHandlers<TMessages extends WebSocketMessages = NoMessages>(surface: WebSocketApi<string, TMessages>, modules: readonly object[], options: CreateMswWebSocketHandlersOptions): MswWebSocketHandlers<TMessages>;
666
+ //#endregion
667
+ export { type ClientOf, type CreateMswHandlersOptions, type CreateMswHandlersResult, type CreateMswWebSocketHandlersOptions, type DatabaseOf, type DatabaseSchemas, type FactoryBuilders, type FeatureContext, type FeatureIt, type FeatureMailbox, type FeatureTestOptions, type InProcessBindings, InvalidWebSocketRequest, type MagicLinkAuthClient, type MailToReceive, type MswWebSocketContext, type MswWebSocketHandlers, type RecordedBroadcast, type RecordedClose, type RecordedSend, type RegisterContextOptions, type ServiceClients, TEST_CONTEXT_HEADER, type TestDatabases, type TestFactories, type TestManifest, type TestManifestSource, type TestServices, TestWebSocketPublisher };
191
668
  //# sourceMappingURL=testing.d.mts.map