@geekmidas/constructs 10.0.0-alpha.18 → 10.0.0-alpha.181

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-BcA8F0S-.d.cts} +16 -9
  11. package/dist/Cron-BcA8F0S-.d.cts.map +1 -0
  12. package/dist/{Cron-zsoSAwZo.d.cts → Cron-z2CiuQT_.d.mts} +15 -8
  13. package/dist/Cron-z2CiuQT_.d.mts.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-BZvo34X2.d.cts +47 -0
  17. package/dist/CronBuilder-BZvo34X2.d.cts.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-BbgKo8OI.d.mts +47 -0
  21. package/dist/CronBuilder-BbgKo8OI.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-oS-Fe3d_.d.mts → Endpoint-CIDUreMW.d.mts} +104 -23
  25. package/dist/Endpoint-CIDUreMW.d.mts.map +1 -0
  26. package/dist/{Endpoint-DBflWAe4.d.cts → Endpoint-COisi9jw.d.cts} +101 -20
  27. package/dist/Endpoint-COisi9jw.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/{index-Cc4kKPag.d.mts → EndpointFactory-CIM80WIK.d.mts} +189 -106
  33. package/dist/EndpointFactory-CIM80WIK.d.mts.map +1 -0
  34. package/dist/{index-C1ZwNOOk.d.cts → EndpointFactory-CfBg6jJE.d.cts} +187 -104
  35. package/dist/EndpointFactory-CfBg6jJE.d.cts.map +1 -0
  36. package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-Cf_Cs1ym.cjs} +309 -51
  37. package/dist/EndpointFactory-Cf_Cs1ym.cjs.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-Ci_Cc-WZ.d.mts +129 -0
  47. package/dist/ObjectSubscriberBuilder-Ci_Cc-WZ.d.mts.map +1 -0
  48. package/dist/ObjectSubscriberBuilder-DWtLxfAJ.d.cts +129 -0
  49. package/dist/ObjectSubscriberBuilder-DWtLxfAJ.d.cts.map +1 -0
  50. package/dist/ProcessorBuilder-CdLwJK4k.d.mts +216 -0
  51. package/dist/ProcessorBuilder-CdLwJK4k.d.mts.map +1 -0
  52. package/dist/ProcessorBuilder-ClD7tmEe.d.cts +216 -0
  53. package/dist/ProcessorBuilder-ClD7tmEe.d.cts.map +1 -0
  54. package/dist/Queue-9Hh20ZCk.mjs +104 -0
  55. package/dist/Queue-9Hh20ZCk.mjs.map +1 -0
  56. package/dist/{Queue-D9X6OoON.d.mts → Queue-B8HGg439.d.mts} +42 -41
  57. package/dist/Queue-B8HGg439.d.mts.map +1 -0
  58. package/dist/{Queue-DYPB2KWL.d.cts → Queue-C4rijiM7.d.cts} +43 -42
  59. package/dist/Queue-C4rijiM7.d.cts.map +1 -0
  60. package/dist/Queue-W1wueijP.cjs +109 -0
  61. package/dist/Queue-W1wueijP.cjs.map +1 -0
  62. package/dist/QueueBuilder-BDcv9B71.cjs +135 -0
  63. package/dist/QueueBuilder-BDcv9B71.cjs.map +1 -0
  64. package/dist/QueueBuilder-CjULiiDN.d.mts +75 -0
  65. package/dist/QueueBuilder-CjULiiDN.d.mts.map +1 -0
  66. package/dist/QueueBuilder-CrZL8HHs.mjs +118 -0
  67. package/dist/QueueBuilder-CrZL8HHs.mjs.map +1 -0
  68. package/dist/QueueBuilder-Dacm9qAv.d.cts +75 -0
  69. package/dist/QueueBuilder-Dacm9qAv.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-BGoOeCT6.mjs +99 -0
  79. package/dist/Topic-BGoOeCT6.mjs.map +1 -0
  80. package/dist/Topic-DLCZBNwK.cjs +104 -0
  81. package/dist/Topic-DLCZBNwK.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-CutSfNlr.d.mts +274 -0
  113. package/dist/auth-CutSfNlr.d.mts.map +1 -0
  114. package/dist/auth-b9ADezz9.d.cts +274 -0
  115. package/dist/auth-b9ADezz9.d.cts.map +1 -0
  116. package/dist/auth.cjs +311 -26
  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 +307 -28
  121. package/dist/auth.mjs.map +1 -1
  122. package/dist/cache-9wLNSy3O.d.cts +44 -0
  123. package/dist/cache-9wLNSy3O.d.cts.map +1 -0
  124. package/dist/cache-BFPs_CGs.d.mts +44 -0
  125. package/dist/cache-BFPs_CGs.d.mts.map +1 -0
  126. package/dist/cache.cjs +4 -20
  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 +4 -20
  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-CVoejIpo.d.cts} +79 -8
  141. package/dist/construct-interface-CVoejIpo.d.cts.map +1 -0
  142. package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-Nw5Dt9AC.d.mts} +79 -8
  143. package/dist/construct-interface-Nw5Dt9AC.d.mts.map +1 -0
  144. package/dist/construct-interface.cjs +62 -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 +59 -5
  149. package/dist/construct-interface.mjs.map +1 -1
  150. package/dist/credential-B80mOxwT.mjs +222 -0
  151. package/dist/credential-B80mOxwT.mjs.map +1 -0
  152. package/dist/credential-RlgbzZAc.cjs +257 -0
  153. package/dist/credential-RlgbzZAc.cjs.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 +24 -17
  171. package/dist/email.cjs.map +1 -1
  172. package/dist/email.d.cts +15 -5
  173. package/dist/email.d.cts.map +1 -1
  174. package/dist/email.d.mts +16 -6
  175. package/dist/email.d.mts.map +1 -1
  176. package/dist/email.mjs +23 -17
  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/external-api.cjs +106 -0
  205. package/dist/external-api.cjs.map +1 -0
  206. package/dist/external-api.d.cts +2 -0
  207. package/dist/external-api.d.mts +2 -0
  208. package/dist/external-api.mjs +103 -0
  209. package/dist/external-api.mjs.map +1 -0
  210. package/dist/fake-JI5uN1SF.d.cts +201 -0
  211. package/dist/fake-JI5uN1SF.d.cts.map +1 -0
  212. package/dist/fake-zpuXpBmY.d.mts +201 -0
  213. package/dist/fake-zpuXpBmY.d.mts.map +1 -0
  214. package/dist/file-server.cjs +170 -49
  215. package/dist/file-server.cjs.map +1 -1
  216. package/dist/file-server.d.cts +148 -16
  217. package/dist/file-server.d.cts.map +1 -1
  218. package/dist/file-server.d.mts +148 -16
  219. package/dist/file-server.d.mts.map +1 -1
  220. package/dist/file-server.mjs +168 -51
  221. package/dist/file-server.mjs.map +1 -1
  222. package/dist/functions/index.cjs +1 -1
  223. package/dist/functions/index.d.cts +2 -1
  224. package/dist/functions/index.d.mts +2 -1
  225. package/dist/functions/index.mjs +1 -1
  226. package/dist/{functions-C53GW2eQ.mjs → functions-BvIDQKAA.mjs} +117 -22
  227. package/dist/functions-BvIDQKAA.mjs.map +1 -0
  228. package/dist/{functions-B6qCvfmy.cjs → functions-DLF6-IK8.cjs} +122 -18
  229. package/dist/functions-DLF6-IK8.cjs.map +1 -0
  230. package/dist/inbox-CXLU7h_8.d.cts +195 -0
  231. package/dist/inbox-CXLU7h_8.d.cts.map +1 -0
  232. package/dist/inbox-DYFsLd9A.d.mts +195 -0
  233. package/dist/inbox-DYFsLd9A.d.mts.map +1 -0
  234. package/dist/inbox.cjs +291 -0
  235. package/dist/inbox.cjs.map +1 -0
  236. package/dist/inbox.d.cts +2 -0
  237. package/dist/inbox.d.mts +2 -0
  238. package/dist/inbox.mjs +283 -0
  239. package/dist/inbox.mjs.map +1 -0
  240. package/dist/index-BpE9_6l5.d.mts +115 -0
  241. package/dist/index-BpE9_6l5.d.mts.map +1 -0
  242. package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
  243. package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
  244. package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
  245. package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
  246. package/dist/index-zRChehJ9.d.cts +115 -0
  247. package/dist/index-zRChehJ9.d.cts.map +1 -0
  248. package/dist/index.cjs +4 -1
  249. package/dist/index.d.cts +26 -3
  250. package/dist/index.d.cts.map +1 -0
  251. package/dist/index.d.mts +26 -3
  252. package/dist/index.d.mts.map +1 -0
  253. package/dist/index.mjs +3 -2
  254. package/dist/kysely-5PAqFBzo.d.mts +216 -0
  255. package/dist/kysely-5PAqFBzo.d.mts.map +1 -0
  256. package/dist/kysely-Bc9xzaik.mjs +371 -0
  257. package/dist/kysely-Bc9xzaik.mjs.map +1 -0
  258. package/dist/kysely-D7f6J2lh.cjs +384 -0
  259. package/dist/kysely-D7f6J2lh.cjs.map +1 -0
  260. package/dist/kysely-lxNUBSTP.d.cts +216 -0
  261. package/dist/kysely-lxNUBSTP.d.cts.map +1 -0
  262. package/dist/{telemetry-DGcFlVpB.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +2 -2
  263. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  264. package/dist/{telemetry-DGcFlVpB.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +2 -2
  265. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  266. package/dist/mobile-app.cjs +79 -0
  267. package/dist/mobile-app.cjs.map +1 -0
  268. package/dist/mobile-app.d.cts +78 -0
  269. package/dist/mobile-app.d.cts.map +1 -0
  270. package/dist/mobile-app.d.mts +78 -0
  271. package/dist/mobile-app.d.mts.map +1 -0
  272. package/dist/mobile-app.mjs +78 -0
  273. package/dist/mobile-app.mjs.map +1 -0
  274. package/dist/object-storage.cjs +50 -7
  275. package/dist/object-storage.cjs.map +1 -1
  276. package/dist/object-storage.d.cts +37 -3
  277. package/dist/object-storage.d.cts.map +1 -1
  278. package/dist/object-storage.d.mts +37 -3
  279. package/dist/object-storage.d.mts.map +1 -1
  280. package/dist/object-storage.mjs +49 -9
  281. package/dist/object-storage.mjs.map +1 -1
  282. package/dist/optionalPeers-D7Wt6dnF.mjs +140 -0
  283. package/dist/optionalPeers-D7Wt6dnF.mjs.map +1 -0
  284. package/dist/optionalPeers-DuNQXXe1.cjs +223 -0
  285. package/dist/optionalPeers-DuNQXXe1.cjs.map +1 -0
  286. package/dist/origins-BjxYht13.cjs +96 -0
  287. package/dist/origins-BjxYht13.cjs.map +1 -0
  288. package/dist/origins-Boc9qbo-.mjs +73 -0
  289. package/dist/origins-Boc9qbo-.mjs.map +1 -0
  290. package/dist/pattern-C1CEcglD.mjs +241 -0
  291. package/dist/pattern-C1CEcglD.mjs.map +1 -0
  292. package/dist/pattern-QFaUIr77.cjs +288 -0
  293. package/dist/pattern-QFaUIr77.cjs.map +1 -0
  294. package/dist/privateAddress-Bg5fUsbp.mjs +21 -0
  295. package/dist/privateAddress-Bg5fUsbp.mjs.map +1 -0
  296. package/dist/privateAddress-CqGyuFHn.cjs +26 -0
  297. package/dist/privateAddress-CqGyuFHn.cjs.map +1 -0
  298. package/dist/processors/index.cjs +214 -0
  299. package/dist/processors/index.cjs.map +1 -0
  300. package/dist/processors/index.d.cts +78 -0
  301. package/dist/processors/index.d.cts.map +1 -0
  302. package/dist/processors/index.d.mts +78 -0
  303. package/dist/processors/index.d.mts.map +1 -0
  304. package/dist/processors/index.mjs +193 -0
  305. package/dist/processors/index.mjs.map +1 -0
  306. package/dist/queue/index.cjs +5 -192
  307. package/dist/queue/index.d.cts +3 -53
  308. package/dist/queue/index.d.mts +3 -53
  309. package/dist/queue/index.mjs +3 -190
  310. package/dist/random-password.cjs +86 -0
  311. package/dist/random-password.cjs.map +1 -0
  312. package/dist/random-password.d.cts +30 -0
  313. package/dist/random-password.d.cts.map +1 -0
  314. package/dist/random-password.d.mts +30 -0
  315. package/dist/random-password.d.mts.map +1 -0
  316. package/dist/random-password.mjs +84 -0
  317. package/dist/random-password.mjs.map +1 -0
  318. package/dist/readOnlyStorage-C7bCe-z5.cjs +101 -0
  319. package/dist/readOnlyStorage-C7bCe-z5.cjs.map +1 -0
  320. package/dist/readOnlyStorage-DMCeLuS2.mjs +78 -0
  321. package/dist/readOnlyStorage-DMCeLuS2.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 +100 -73
  331. package/dist/rest-api.cjs.map +1 -1
  332. package/dist/rest-api.d.cts +83 -59
  333. package/dist/rest-api.d.cts.map +1 -1
  334. package/dist/rest-api.d.mts +83 -59
  335. package/dist/rest-api.d.mts.map +1 -1
  336. package/dist/rest-api.mjs +97 -76
  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 +140 -10
  347. package/dist/site.cjs.map +1 -1
  348. package/dist/site.d.cts +156 -3
  349. package/dist/site.d.cts.map +1 -1
  350. package/dist/site.d.mts +156 -3
  351. package/dist/site.d.mts.map +1 -1
  352. package/dist/site.mjs +120 -13
  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-BbLyS7ln.d.cts +57 -0
  367. package/dist/telemetry-BbLyS7ln.d.cts.map +1 -0
  368. package/dist/telemetry-DWX-qKUh.d.mts +57 -0
  369. package/dist/telemetry-DWX-qKUh.d.mts.map +1 -0
  370. package/dist/telemetry.cjs +64 -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 +63 -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-9ndLBolx.d.cts +1207 -0
  385. package/dist/websocket-api-9ndLBolx.d.cts.map +1 -0
  386. package/dist/websocket-api-BPPXF79i.d.mts +1207 -0
  387. package/dist/websocket-api-BPPXF79i.d.mts.map +1 -0
  388. package/dist/websocket-api-C6LGg9-D.mjs +1716 -0
  389. package/dist/websocket-api-C6LGg9-D.mjs.map +1 -0
  390. package/dist/websocket-api-CoKPJJRl.cjs +1895 -0
  391. package/dist/websocket-api-CoKPJJRl.cjs.map +1 -0
  392. package/dist/websocket-api.cjs +42 -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
@@ -0,0 +1,581 @@
1
+ require("./Construct-DorKS0Ua.cjs");
2
+ const require_tracing = require("./tracing-C0ooU0V2.cjs");
3
+ const require_functions = require("./functions-DLF6-IK8.cjs");
4
+ let _geekmidas_schema_conversion = require("@geekmidas/schema/conversion");
5
+ let _geekmidas_schema_openapi = require("@geekmidas/schema/openapi");
6
+ //#region src/endpoints/sessionAuth.ts
7
+ /**
8
+ * What is forwarded to the auth server: the headers a session travels in,
9
+ * whose request it is, and the origin it came from — nothing else.
10
+ *
11
+ * The client's address goes with the session because the auth server
12
+ * rate-limits by it, `/get-session` included. Without it every user's session
13
+ * check arrived from the surface itself — one shared bucket, so enough
14
+ * traffic from anyone turned every session check into a 429 — and in tests,
15
+ * concurrent tests queued on the same rate-limit row.
16
+ *
17
+ * The origin, because the surface calls the auth server at its public
18
+ * address, through the edge: it is what lets the auth server continue this
19
+ * request's trace for a site both trust.
20
+ */
21
+ const SESSION_HEADERS = [
22
+ "cookie",
23
+ "authorization",
24
+ "x-forwarded-for",
25
+ "origin"
26
+ ];
27
+ /** `auth` for one request on one surface. */
28
+ function sessionAuth(surface, header) {
29
+ return { async getSession() {
30
+ const authenticator = surface?.auth;
31
+ if (!surface || !authenticator) throw new NoAuthenticator(surface?.id);
32
+ const headers = new Headers();
33
+ for (const name of SESSION_HEADERS) {
34
+ const value = header(name);
35
+ if (value) headers.set(name, value);
36
+ }
37
+ const session = await authenticator.verify(headers, surface.envParser);
38
+ const identity = session;
39
+ if (typeof identity?.user?.id === "string") require_tracing.identifyUser({
40
+ id: identity.user.id,
41
+ ...typeof identity.session?.id === "string" ? { sessionId: identity.session.id } : {}
42
+ });
43
+ return session;
44
+ } };
45
+ }
46
+ /** `auth.getSession()` was called on a surface that names no authenticator. */
47
+ var NoAuthenticator = class extends Error {
48
+ surface;
49
+ constructor(surface) {
50
+ super(`auth.getSession() needs an authenticator, and ${surface ? `the surface '${surface}'` : "this endpoint"} declares none: declare one on the surface with .auth(construct).`);
51
+ this.surface = surface;
52
+ this.name = "NoAuthenticator";
53
+ }
54
+ };
55
+ //#endregion
56
+ //#region src/endpoints/Endpoint.ts
57
+ /**
58
+ * Represents an HTTP endpoint that can handle requests with type-safe input/output validation,
59
+ * dependency injection, session management, and authorization.
60
+ *
61
+ * @template TRoute - The route path string with parameter placeholders (e.g., '/users/:id')
62
+ * @template TMethod - The HTTP method (GET, POST, PUT, DELETE, PATCH)
63
+ * @template TInput - The input schema definition for body, query, and path parameters
64
+ * @template OutSchema - The output schema for response validation
65
+ * @template TServices - Array of service dependencies to inject
66
+ * @template TLogger - The logger instance type
67
+ * @template TSession - The session data type
68
+ *
69
+ * @extends Function - Base function construct for handler execution
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * const endpoint = new Endpoint({
74
+ * route: '/users/:id',
75
+ * method: 'GET',
76
+ * input: { params: userIdSchema },
77
+ * output: userSchema,
78
+ * fn: async ({ params }) => getUserById(params.id)
79
+ * });
80
+ * ```
81
+ */
82
+ var Endpoint = class Endpoint extends require_functions.Function {
83
+ operationId;
84
+ /** The route path pattern with parameter placeholders */
85
+ route;
86
+ /** The HTTP method for this endpoint */
87
+ method;
88
+ /**
89
+ * The surface that serves it, when it was built from one.
90
+ *
91
+ * Carries the env parser the adaptors need, so a generated handler needs no
92
+ * import written for it — and the surface's id, so the build attributes the
93
+ * route to the API that serves it rather than inferring it by exclusion.
94
+ */
95
+ surface;
96
+ /** Optional description for OpenAPI documentation */
97
+ description;
98
+ /** Optional tags for OpenAPI documentation */
99
+ tags;
100
+ /** The HTTP status code to return (default: 200) */
101
+ status;
102
+ /**
103
+ * Response content type for this endpoint. Defaults to `'application/json'`.
104
+ * Non-JSON types cause adaptors to emit the body as-is with the declared
105
+ * Content-Type header instead of JSON-serializing.
106
+ */
107
+ responseType;
108
+ /**
109
+ * This route's telemetry — `.telemetry({ ignore, attributes })` — read by
110
+ * the build, which hands it to the request middleware.
111
+ */
112
+ telemetry;
113
+ /** Default headers to apply to all responses */
114
+ defaultHeaders = {};
115
+ /** Function to extract session data from the request context */
116
+ getSession = () => ({});
117
+ /**
118
+ * Whether a session callback was given — `.session()` on the factory it was
119
+ * built from. A generated handler reads the session only when it is, so
120
+ * an endpoint with a session and no authorizer must say so: it used to be
121
+ * handed `undefined` in a production build and its session in `gkm dev`.
122
+ */
123
+ hasSession = false;
124
+ /** Function to determine if the request is authorized */
125
+ authorize = () => true;
126
+ /** Optional rate limiting configuration */
127
+ rateLimit;
128
+ /** Optional authorizer for this endpoint */
129
+ authorizer;
130
+ /** Optional actor extractor for audit records */
131
+ actorExtractor;
132
+ /** Declarative audit definitions */
133
+ audits = [];
134
+ /** RLS configuration for this endpoint */
135
+ rlsConfig;
136
+ /** Whether to bypass RLS for this endpoint */
137
+ rlsBypass;
138
+ /** The endpoint handler function */
139
+ endpointFn;
140
+ /**
141
+ * Builds a complete OpenAPI 3.1 schema from an array of endpoints.
142
+ *
143
+ * @param endpoints - Array of endpoint instances to document
144
+ * @param options - Optional configuration for OpenAPI generation
145
+ * @returns OpenAPI 3.1 specification object
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * const schema = await Endpoint.buildOpenApiSchema([
150
+ * getUserEndpoint,
151
+ * createUserEndpoint
152
+ * ], {
153
+ * title: 'User API',
154
+ * version: '1.0.0'
155
+ * });
156
+ * ```
157
+ */
158
+ static async buildOpenApiSchema(endpoints, options) {
159
+ return (0, _geekmidas_schema_openapi.buildOpenApiSchema)(endpoints, options);
160
+ }
161
+ /**
162
+ * Gets the full path including HTTP method and route.
163
+ * @returns Formatted string like 'GET /users/{id}'
164
+ */
165
+ get fullPath() {
166
+ return `${this.method} ${this._path}`;
167
+ }
168
+ /**
169
+ * Parses and validates input data for a specific input type (body, query, params).
170
+ *
171
+ * @param input - The raw input data to validate
172
+ * @param key - The input type key ('body', 'query', or 'params')
173
+ * @returns The validated input data for the specified key
174
+ * @throws {UnprocessableEntityError} When validation fails
175
+ */
176
+ async parseInput(input, key) {
177
+ const schema = this.input?.[key];
178
+ return Endpoint.parseSchema(schema, input);
179
+ }
180
+ /**
181
+ * Parses and validates the request body against the body schema.
182
+ *
183
+ * @param body - The raw request body to validate
184
+ * @returns The validated body data
185
+ * @throws {UnprocessableEntityError} When body validation fails
186
+ */
187
+ async parseBody(body) {
188
+ return this.parseInput(body, "body");
189
+ }
190
+ static isSuccessStatus(status) {
191
+ return status >= 200 && status < 300;
192
+ }
193
+ /**
194
+ * Whether `status` sends the client elsewhere. A redirect has no body, so
195
+ * its response is not checked against the output schema, and what is
196
+ * derived from the output — declared events and audits — is not sent.
197
+ */
198
+ static isRedirectStatus(status) {
199
+ return status !== void 0 && status >= 300 && status < 400;
200
+ }
201
+ /**
202
+ * Creates a case-insensitive header lookup function from a headers object.
203
+ *
204
+ * @param headers - Object containing header key-value pairs
205
+ * @returns Function to retrieve header values by case-insensitive key, or all headers
206
+ *
207
+ * @example
208
+ * ```typescript
209
+ * const headerFn = Endpoint.createHeaders({ 'Content-Type': 'application/json' });
210
+ * headerFn('content-type'); // Returns 'application/json'
211
+ * headerFn(); // Returns { 'content-type': 'application/json' }
212
+ * ```
213
+ */
214
+ static createHeaders(headers) {
215
+ const headerMap = /* @__PURE__ */ new Map();
216
+ for (const [k, v] of Object.entries(headers)) {
217
+ const key = k.toLowerCase();
218
+ headerMap.set(key, v);
219
+ }
220
+ function get(key) {
221
+ if (key === void 0) return Object.fromEntries(headerMap.entries());
222
+ return headerMap.get(key.toLowerCase());
223
+ }
224
+ return get;
225
+ }
226
+ /**
227
+ * Parses cookie string and creates a cookie lookup function.
228
+ *
229
+ * @param cookieHeader - The Cookie header value
230
+ * @returns Function to retrieve cookie values by name, or all cookies
231
+ *
232
+ * @example
233
+ * ```typescript
234
+ * const cookieFn = Endpoint.createCookies('session=abc123; theme=dark');
235
+ * cookieFn('session'); // Returns 'abc123'
236
+ * cookieFn(); // Returns { session: 'abc123', theme: 'dark' }
237
+ * ```
238
+ */
239
+ static createCookies(cookieHeader) {
240
+ const cookieMap = /* @__PURE__ */ new Map();
241
+ if (cookieHeader) {
242
+ const cookies = cookieHeader.split(";");
243
+ for (const cookie of cookies) {
244
+ const [name, ...valueParts] = cookie.trim().split("=");
245
+ if (name) {
246
+ const value = valueParts.join("=");
247
+ cookieMap.set(name, decodeURIComponent(value));
248
+ }
249
+ }
250
+ }
251
+ function get(name) {
252
+ if (name === void 0) return Object.fromEntries(cookieMap.entries());
253
+ return cookieMap.get(name);
254
+ }
255
+ return get;
256
+ }
257
+ /**
258
+ * Formats a cookie as a Set-Cookie header string.
259
+ *
260
+ * @param name - Cookie name
261
+ * @param value - Cookie value
262
+ * @param options - Cookie options (httpOnly, secure, sameSite, etc.)
263
+ * @returns Formatted Set-Cookie header string
264
+ *
265
+ * @example
266
+ * ```typescript
267
+ * const header = Endpoint.formatCookieHeader('session', 'abc123', {
268
+ * httpOnly: true,
269
+ * secure: true,
270
+ * sameSite: 'strict',
271
+ * maxAge: 3600
272
+ * });
273
+ * // Returns: "session=abc123; Max-Age=3600; HttpOnly; Secure; SameSite=Strict"
274
+ * ```
275
+ */
276
+ static formatCookieHeader(name, value, options) {
277
+ let cookie = `${name}=${value}`;
278
+ if (options) {
279
+ if (options.domain) cookie += `; Domain=${options.domain}`;
280
+ if (options.path) cookie += `; Path=${options.path}`;
281
+ if (options.expires) cookie += `; Expires=${options.expires.toUTCString()}`;
282
+ if (options.maxAge !== void 0) cookie += `; Max-Age=${options.maxAge}`;
283
+ if (options.httpOnly) cookie += "; HttpOnly";
284
+ if (options.secure) cookie += "; Secure";
285
+ if (options.sameSite) cookie += `; SameSite=${options.sameSite.charAt(0).toUpperCase() + options.sameSite.slice(1)}`;
286
+ }
287
+ return cookie;
288
+ }
289
+ /**
290
+ * Extracts and refines input data from the endpoint context.
291
+ *
292
+ * @param ctx - The endpoint execution context
293
+ * @returns Object containing only the input data (body, query, params)
294
+ * @internal
295
+ */
296
+ refineInput(ctx) {
297
+ const input = {};
298
+ for (const key of [
299
+ "body",
300
+ "query",
301
+ "params"
302
+ ]) if (key in ctx) input[key] = ctx[key];
303
+ return input;
304
+ }
305
+ handler = (ctx, response) => {
306
+ for (const [key, value] of Object.entries(this.defaultHeaders)) response.header(key, value);
307
+ const handlerCtx = {
308
+ ...this.refineInput(ctx),
309
+ services: ctx.services,
310
+ logger: ctx.logger,
311
+ header: ctx.header,
312
+ cookie: ctx.cookie,
313
+ session: ctx.session,
314
+ ..."auditor" in ctx && { auditor: ctx.auditor },
315
+ ..."db" in ctx && { db: ctx.db }
316
+ };
317
+ return this.endpointFn(handlerCtx, response);
318
+ };
319
+ /**
320
+ * Type guard to check if an object is an Endpoint instance.
321
+ *
322
+ * @param obj - The object to check
323
+ * @returns True if the object is an Endpoint
324
+ */
325
+ static isEndpoint(obj) {
326
+ return Boolean(obj && obj.__IS_FUNCTION__ === true && obj.type === "dev.geekmidas.function.endpoint");
327
+ }
328
+ /**
329
+ * Helper to check if response has metadata
330
+ */
331
+ static hasMetadata(response) {
332
+ return response !== null && typeof response === "object" && "data" in response && "metadata" in response;
333
+ }
334
+ /**
335
+ * Converts Express-style route params to OpenAPI format.
336
+ * @returns Route with ':param' converted to '{param}'
337
+ * @internal
338
+ */
339
+ get _path() {
340
+ return this.route.replace(/:(\w+)/g, "{$1}");
341
+ }
342
+ /**
343
+ * Generates OpenAPI 3.1 schema for this endpoint.
344
+ *
345
+ * @returns OpenAPI route definition with operation details
346
+ */
347
+ async toOpenApi3Route(componentCollector) {
348
+ const status = String(this.status);
349
+ const operation = {
350
+ operationId: this.operationId,
351
+ ...this.description && { description: this.description },
352
+ ...this.tags && this.tags.length > 0 && { tags: this.tags },
353
+ responses: { [status]: { description: "Successful response" } }
354
+ };
355
+ const scheme = this.authorizer?.securityScheme;
356
+ if (this.authorizer && scheme && componentCollector) {
357
+ componentCollector.addSecurityScheme(this.authorizer.name, scheme);
358
+ operation.security = [{ [this.authorizer.name]: [] }];
359
+ }
360
+ if (this.outputSchema) {
361
+ const responseSchema = await (0, _geekmidas_schema_conversion.convertSchemaWithComponents)(this.outputSchema, componentCollector);
362
+ if (responseSchema) operation.responses[status].content = { [this.responseType]: { schema: responseSchema } };
363
+ }
364
+ const pathParameters = [];
365
+ const queryParameters = [];
366
+ if (this.input && typeof this.input === "object") {
367
+ if ([
368
+ "POST",
369
+ "PUT",
370
+ "PATCH"
371
+ ].includes(this.method) && "body" in this.input && this.input.body) {
372
+ const bodySchema = await (0, _geekmidas_schema_conversion.convertSchemaWithComponents)(this.input.body, componentCollector);
373
+ if (bodySchema) operation.requestBody = {
374
+ required: true,
375
+ content: { "application/json": { schema: bodySchema } }
376
+ };
377
+ }
378
+ if ("params" in this.input && this.input.params) {
379
+ const paramsSchema = await (0, _geekmidas_schema_conversion.convertStandardSchemaToJsonSchema)(this.input.params);
380
+ if (paramsSchema && paramsSchema.type === "object" && paramsSchema.properties) for (const [name, schema] of Object.entries(paramsSchema.properties)) pathParameters.push({
381
+ name,
382
+ in: "path",
383
+ required: paramsSchema.required?.includes(name) ?? true,
384
+ schema
385
+ });
386
+ }
387
+ if ("query" in this.input && this.input.query) {
388
+ const querySchema = await (0, _geekmidas_schema_conversion.convertStandardSchemaToJsonSchema)(this.input.query);
389
+ if (querySchema && querySchema.type === "object" && querySchema.properties) for (const [name, schema] of Object.entries(querySchema.properties)) queryParameters.push({
390
+ name,
391
+ in: "query",
392
+ required: querySchema.required?.includes(name) ?? false,
393
+ schema
394
+ });
395
+ }
396
+ }
397
+ if (queryParameters.length > 0) operation.parameters = queryParameters;
398
+ const routeObject = {};
399
+ if (pathParameters.length > 0) routeObject.parameters = pathParameters;
400
+ routeObject[this.method.toLowerCase()] = operation;
401
+ return { [this._path]: routeObject };
402
+ }
403
+ /**
404
+ * Creates a new Endpoint instance.
405
+ *
406
+ * @param options - Configuration options for the endpoint
407
+ * @param options.fn - The handler function to execute
408
+ * @param options.method - HTTP method
409
+ * @param options.route - Route path with parameter placeholders
410
+ * @param options.description - Optional description for documentation
411
+ * @param options.input - Input schemas for validation
412
+ * @param options.logger - Logger instance
413
+ * @param options.output - Output schema for response validation
414
+ * @param options.services - Service dependencies
415
+ * @param options.timeout - Execution timeout in milliseconds
416
+ * @param options.getSession - Session extraction function
417
+ * @param options.authorize - Authorization check function
418
+ * @param options.status - Success HTTP status code (default: 200)
419
+ * @param options.authorizer - Optional authorizer configuration
420
+ */
421
+ constructor({ fn, method, route, description, tags, input, logger, output: outputSchema, services, constructs, timeout, memorySize, getSession, authorize, rateLimit, status = 200, events, authorizer, surface, auditorStorageService, actorExtractor, audits, databaseService, rlsConfig, rlsBypass, responseType, telemetry }) {
422
+ super(fn, timeout, "dev.geekmidas.function.endpoint", input, outputSchema, services, logger, events, memorySize, auditorStorageService, void 0, constructs);
423
+ this.route = route;
424
+ this.method = method;
425
+ this.description = description;
426
+ this.tags = tags;
427
+ this.status = status;
428
+ this.responseType = responseType ?? "application/json";
429
+ this.endpointFn = fn;
430
+ if (telemetry) this.telemetry = telemetry;
431
+ if (getSession) {
432
+ this.hasSession = true;
433
+ this.getSession = (ctx) => getSession({
434
+ ...ctx,
435
+ auth: sessionAuth(surface, ctx.header)
436
+ });
437
+ }
438
+ if (authorize) this.authorize = authorize;
439
+ if (rateLimit) this.rateLimit = rateLimit;
440
+ if (authorizer) this.authorizer = authorizer;
441
+ this.surface = surface;
442
+ if (actorExtractor) this.actorExtractor = actorExtractor;
443
+ if (audits) this.audits = audits;
444
+ if (databaseService) this.databaseService = databaseService;
445
+ if (rlsConfig) this.rlsConfig = rlsConfig;
446
+ if (rlsBypass) this.rlsBypass = rlsBypass;
447
+ }
448
+ };
449
+ /**
450
+ * Response builder for fluent API in handlers
451
+ */
452
+ var ResponseBuilder = class {
453
+ metadata = {
454
+ headers: {},
455
+ cookies: /* @__PURE__ */ new Map()
456
+ };
457
+ header(key, value) {
458
+ this.metadata.headers[key] = value;
459
+ return this;
460
+ }
461
+ cookie(name, value, options) {
462
+ this.metadata.cookies?.set(name, {
463
+ value,
464
+ options
465
+ });
466
+ return this;
467
+ }
468
+ deleteCookie(name, options) {
469
+ this.metadata.cookies?.set(name, {
470
+ value: "",
471
+ options: {
472
+ ...options,
473
+ maxAge: 0,
474
+ expires: /* @__PURE__ */ new Date(0)
475
+ }
476
+ });
477
+ return this;
478
+ }
479
+ status(code) {
480
+ this.metadata.status = code;
481
+ return this;
482
+ }
483
+ /**
484
+ * Send the client to `url` — `Location` and a 3xx, with no body. 303 by
485
+ * default: after a form post, the browser follows it with a GET, so a
486
+ * reload does not post the form again.
487
+ *
488
+ * A redirect is not checked against the endpoint's `.output()` schema, so
489
+ * an endpoint that renders a page can redirect instead.
490
+ *
491
+ * @example
492
+ * ```typescript
493
+ * return response.cookie('session', token).redirect('/dashboard');
494
+ * ```
495
+ */
496
+ redirect(url, status = 303) {
497
+ this.metadata.headers.location = url;
498
+ this.metadata.status = status;
499
+ return {
500
+ data: void 0,
501
+ metadata: this.metadata
502
+ };
503
+ }
504
+ send(data) {
505
+ return {
506
+ data,
507
+ metadata: this.metadata
508
+ };
509
+ }
510
+ getMetadata() {
511
+ return this.metadata;
512
+ }
513
+ };
514
+ /**
515
+ * HTTP success status codes that can be returned by endpoints.
516
+ */
517
+ let SuccessStatus = /* @__PURE__ */ function(SuccessStatus) {
518
+ /** Standard response for successful HTTP requests */
519
+ SuccessStatus[SuccessStatus["OK"] = 200] = "OK";
520
+ /** Request has been fulfilled and resulted in a new resource being created */
521
+ SuccessStatus[SuccessStatus["Created"] = 201] = "Created";
522
+ /** Request has been accepted for processing, but processing is not complete */
523
+ SuccessStatus[SuccessStatus["Accepted"] = 202] = "Accepted";
524
+ /** Server successfully processed the request but is not returning any content */
525
+ SuccessStatus[SuccessStatus["NoContent"] = 204] = "NoContent";
526
+ /** Server successfully processed the request and is not returning any content, client should reset the document view */
527
+ SuccessStatus[SuccessStatus["ResetContent"] = 205] = "ResetContent";
528
+ /** Server is delivering only part of the resource due to a range header */
529
+ SuccessStatus[SuccessStatus["PartialContent"] = 206] = "PartialContent";
530
+ return SuccessStatus;
531
+ }({});
532
+ /**
533
+ * HTTP redirect status codes an endpoint can answer with —
534
+ * `response.redirect(url, status)`, or `.status()` with a `Location` header.
535
+ */
536
+ let RedirectStatus = /* @__PURE__ */ function(RedirectStatus) {
537
+ /** The resource has moved for good; a POST may become a GET */
538
+ RedirectStatus[RedirectStatus["MovedPermanently"] = 301] = "MovedPermanently";
539
+ /** The resource is elsewhere for now; a POST may become a GET */
540
+ RedirectStatus[RedirectStatus["Found"] = 302] = "Found";
541
+ /** See the resource elsewhere, with a GET — the answer to a form post */
542
+ RedirectStatus[RedirectStatus["SeeOther"] = 303] = "SeeOther";
543
+ /** The resource is elsewhere for now; the method and body are kept */
544
+ RedirectStatus[RedirectStatus["TemporaryRedirect"] = 307] = "TemporaryRedirect";
545
+ /** The resource has moved for good; the method and body are kept */
546
+ RedirectStatus[RedirectStatus["PermanentRedirect"] = 308] = "PermanentRedirect";
547
+ return RedirectStatus;
548
+ }({});
549
+ //#endregion
550
+ Object.defineProperty(exports, "Endpoint", {
551
+ enumerable: true,
552
+ get: function() {
553
+ return Endpoint;
554
+ }
555
+ });
556
+ Object.defineProperty(exports, "NoAuthenticator", {
557
+ enumerable: true,
558
+ get: function() {
559
+ return NoAuthenticator;
560
+ }
561
+ });
562
+ Object.defineProperty(exports, "RedirectStatus", {
563
+ enumerable: true,
564
+ get: function() {
565
+ return RedirectStatus;
566
+ }
567
+ });
568
+ Object.defineProperty(exports, "ResponseBuilder", {
569
+ enumerable: true,
570
+ get: function() {
571
+ return ResponseBuilder;
572
+ }
573
+ });
574
+ Object.defineProperty(exports, "SuccessStatus", {
575
+ enumerable: true,
576
+ get: function() {
577
+ return SuccessStatus;
578
+ }
579
+ });
580
+
581
+ //# sourceMappingURL=Endpoint-52z1P0Ue.cjs.map