@geekmidas/constructs 10.0.0-alpha.17 → 10.0.0-alpha.170

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-Ca_qHQu2.d.cts} +16 -9
  11. package/dist/Cron-Ca_qHQu2.d.cts.map +1 -0
  12. package/dist/{Cron-zsoSAwZo.d.cts → Cron-DPJiR7Lt.d.mts} +15 -8
  13. package/dist/Cron-DPJiR7Lt.d.mts.map +1 -0
  14. package/dist/CronBuilder-BC4za5Bx.d.mts +47 -0
  15. package/dist/CronBuilder-BC4za5Bx.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-C3RrAF1-.d.cts +47 -0
  21. package/dist/CronBuilder-C3RrAF1-.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-DBflWAe4.d.cts → Endpoint-BlIZLsBQ.d.cts} +101 -20
  25. package/dist/Endpoint-BlIZLsBQ.d.cts.map +1 -0
  26. package/dist/{Endpoint-oS-Fe3d_.d.mts → Endpoint-DC7mreOr.d.mts} +104 -23
  27. package/dist/Endpoint-DC7mreOr.d.mts.map +1 -0
  28. package/dist/Endpoint-sUOU7uLx.mjs +552 -0
  29. package/dist/Endpoint-sUOU7uLx.mjs.map +1 -0
  30. package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-Bzi9Sl7r.mjs} +269 -53
  31. package/dist/EndpointFactory-Bzi9Sl7r.mjs.map +1 -0
  32. package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-Cf_Cs1ym.cjs} +309 -51
  33. package/dist/EndpointFactory-Cf_Cs1ym.cjs.map +1 -0
  34. package/dist/{index-Cc4kKPag.d.mts → EndpointFactory-DCmnCmkX.d.mts} +189 -106
  35. package/dist/EndpointFactory-DCmnCmkX.d.mts.map +1 -0
  36. package/dist/{index-C1ZwNOOk.d.cts → EndpointFactory-cVTb8kCc.d.cts} +187 -104
  37. package/dist/EndpointFactory-cVTb8kCc.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-AwGKoUKy.d.mts +129 -0
  47. package/dist/ObjectSubscriberBuilder-AwGKoUKy.d.mts.map +1 -0
  48. package/dist/ObjectSubscriberBuilder-CB6imsX4.d.cts +129 -0
  49. package/dist/ObjectSubscriberBuilder-CB6imsX4.d.cts.map +1 -0
  50. package/dist/ProcessorBuilder-CeEZ2vCx.d.cts +216 -0
  51. package/dist/ProcessorBuilder-CeEZ2vCx.d.cts.map +1 -0
  52. package/dist/ProcessorBuilder-CwIlm75W.d.mts +216 -0
  53. package/dist/ProcessorBuilder-CwIlm75W.d.mts.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-CUERv8jt.d.mts +75 -0
  65. package/dist/QueueBuilder-CUERv8jt.d.mts.map +1 -0
  66. package/dist/QueueBuilder-CmB1vOgn.d.cts +75 -0
  67. package/dist/QueueBuilder-CmB1vOgn.d.cts.map +1 -0
  68. package/dist/QueueBuilder-CrZL8HHs.mjs +118 -0
  69. package/dist/QueueBuilder-CrZL8HHs.mjs.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-1yI2wR-4.d.cts +274 -0
  113. package/dist/auth-1yI2wR-4.d.cts.map +1 -0
  114. package/dist/auth-D4NMXgLt.d.mts +274 -0
  115. package/dist/auth-D4NMXgLt.d.mts.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-0VoeOTF9.d.mts +44 -0
  123. package/dist/cache-0VoeOTF9.d.mts.map +1 -0
  124. package/dist/cache-CW-sArzS.d.cts +44 -0
  125. package/dist/cache-CW-sArzS.d.cts.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-DhbaONW2.d.cts} +63 -8
  141. package/dist/construct-interface-DhbaONW2.d.cts.map +1 -0
  142. package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-DxfkFxkl.d.mts} +63 -8
  143. package/dist/construct-interface-DxfkFxkl.d.mts.map +1 -0
  144. package/dist/construct-interface.cjs +47 -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 +45 -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/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-BvOXkZmj.d.mts +201 -0
  215. package/dist/fake-BvOXkZmj.d.mts.map +1 -0
  216. package/dist/fake-Djx8E0o1.d.cts +201 -0
  217. package/dist/fake-Djx8E0o1.d.cts.map +1 -0
  218. package/dist/file-server.cjs +200 -48
  219. package/dist/file-server.cjs.map +1 -1
  220. package/dist/file-server.d.cts +147 -15
  221. package/dist/file-server.d.cts.map +1 -1
  222. package/dist/file-server.d.mts +147 -15
  223. package/dist/file-server.d.mts.map +1 -1
  224. package/dist/file-server.mjs +198 -50
  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-BjvMs7EJ.d.cts +195 -0
  235. package/dist/inbox-BjvMs7EJ.d.cts.map +1 -0
  236. package/dist/inbox-C8bOR9UL.d.mts +195 -0
  237. package/dist/inbox-C8bOR9UL.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-DaK-C7N3.d.cts +115 -0
  245. package/dist/index-DaK-C7N3.d.cts.map +1 -0
  246. package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
  247. package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
  248. package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
  249. package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
  250. package/dist/index-vCS4HBEG.d.mts +115 -0
  251. package/dist/index-vCS4HBEG.d.mts.map +1 -0
  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-2HqIQ2fC.d.cts +216 -0
  259. package/dist/kysely-2HqIQ2fC.d.cts.map +1 -0
  260. package/dist/kysely-BGvpd_ZH.d.mts +216 -0
  261. package/dist/kysely-BGvpd_ZH.d.mts.map +1 -0
  262. package/dist/kysely-Bc9xzaik.mjs +371 -0
  263. package/dist/kysely-Bc9xzaik.mjs.map +1 -0
  264. package/dist/kysely-D7f6J2lh.cjs +384 -0
  265. package/dist/kysely-D7f6J2lh.cjs.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 +78 -0
  271. package/dist/mobile-app.cjs.map +1 -0
  272. package/dist/mobile-app.d.cts +77 -0
  273. package/dist/mobile-app.d.cts.map +1 -0
  274. package/dist/mobile-app.d.mts +77 -0
  275. package/dist/mobile-app.d.mts.map +1 -0
  276. package/dist/mobile-app.mjs +77 -0
  277. package/dist/mobile-app.mjs.map +1 -0
  278. package/dist/object-storage.cjs +14 -7
  279. package/dist/object-storage.cjs.map +1 -1
  280. package/dist/object-storage.d.cts +12 -3
  281. package/dist/object-storage.d.cts.map +1 -1
  282. package/dist/object-storage.d.mts +12 -3
  283. package/dist/object-storage.d.mts.map +1 -1
  284. package/dist/object-storage.mjs +14 -9
  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 +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 +137 -10
  347. package/dist/site.cjs.map +1 -1
  348. package/dist/site.d.cts +153 -3
  349. package/dist/site.d.cts.map +1 -1
  350. package/dist/site.d.mts +153 -3
  351. package/dist/site.d.mts.map +1 -1
  352. package/dist/site.mjs +117 -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-BirKau0X.d.mts +40 -0
  367. package/dist/telemetry-BirKau0X.d.mts.map +1 -0
  368. package/dist/telemetry-DjJgtQ_N.d.cts +40 -0
  369. package/dist/telemetry-DjJgtQ_N.d.cts.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-C6LGg9-D.mjs +1716 -0
  385. package/dist/websocket-api-C6LGg9-D.mjs.map +1 -0
  386. package/dist/websocket-api-CD-E5Ogr.d.cts +1207 -0
  387. package/dist/websocket-api-CD-E5Ogr.d.cts.map +1 -0
  388. package/dist/websocket-api-CoKPJJRl.cjs +1895 -0
  389. package/dist/websocket-api-CoKPJJRl.cjs.map +1 -0
  390. package/dist/websocket-api-pJJfeTcm.d.mts +1207 -0
  391. package/dist/websocket-api-pJJfeTcm.d.mts.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
@@ -1,11 +1,15 @@
1
- import { r as Declarable } from "./construct-interface-DgXTJcOD.cjs";
2
- import { S as BuiltInSecuritySchemeId } from "./Endpoint-DBflWAe4.cjs";
3
- import { d as EndpointBuilder, l as EndpointFactory, u as RemoveTrailingSlash } from "./index-C1ZwNOOk.cjs";
1
+ import { i as Declarable, n as Construct, t as Authenticator } from "./construct-interface-DhbaONW2.cjs";
2
+ import { n as Telemetry } from "./telemetry-DjJgtQ_N.cjs";
3
+ import { D as BuiltInSecuritySchemeId } from "./Endpoint-BlIZLsBQ.cjs";
4
+ import { t as EndpointFactory } from "./EndpointFactory-cVTb8kCc.cjs";
4
5
  import { EnvironmentParser } from "@geekmidas/envkit";
5
6
  import { Logger } from "@geekmidas/logger";
6
- import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
7
+ import { Service } from "@geekmidas/services";
8
+ import { ConstructName, Declaration, InvalidHostLabel } from "@geekmidas/manifest";
7
9
  import { Telescope } from "@geekmidas/telescope";
8
10
  //#region src/rest-api.d.ts
11
+ /** The factory a surface builds its endpoints from. */
12
+ type Endpoints = EndpointFactory<[], '', Logger>;
9
13
  export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
10
14
  /**
11
15
  * The app that serves this surface, relative to the workspace root —
@@ -19,6 +23,18 @@ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly
19
23
  * `constructs` glob.
20
24
  */
21
25
  path: string;
26
+ /**
27
+ * The label it answers on under a stage's domain — `api` for
28
+ * `api.myapp.com`, from `domains` — and under the project locally,
29
+ * `api.myapp.localhost`. Absent, its id kebab-cased.
30
+ */
31
+ subdomain?: string;
32
+ /**
33
+ * More labels it answers on under the stage's domain, exactly as on its
34
+ * own — `['rest']` serves `rest.myapp.com` beside `api.myapp.com`. Its own
35
+ * label stays canonical: `<ID>_URL`, clients and OpenAPI are built on it.
36
+ */
37
+ aliases?: readonly string[];
22
38
  /**
23
39
  * CORS tunables. The *origins* are never here — they are read off the
24
40
  * constructs that declared an edge to this surface, which is the whole point
@@ -81,29 +97,44 @@ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly
81
97
  * printed an import for. The entry already imports the surface.
82
98
  */
83
99
  telescope?: Telescope;
100
+ /**
101
+ * What this surface's process emits — the `Telemetry` construct, passed
102
+ * like the logger: a fact about the process, not a grant to a route.
103
+ *
104
+ * An edge to the node, so the deploy hands this process the `OTEL_*` keys
105
+ * its stage resolves, and the build fails without the OpenTelemetry
106
+ * packages. Where the telemetry goes is never here: it is the deploy's,
107
+ * per stage.
108
+ */
109
+ telemetry?: Telemetry;
84
110
  }
85
111
  /**
86
112
  * What is *not* here, and why.
87
113
  *
88
- * `dependsOn`, `database`, `auditor` and `publisher` all inject a capability
114
+ * `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
89
115
  * into a handler. Putting one on the surface hands it to every route the
90
116
  * surface serves — a health check gets the database because a report needed it
91
- * — which is the thing least privilege forbids and the reason `.calls()` is not
92
- * spelled `dependsOn`. They belong to the endpoint, or to a factory branched
93
- * from `api.endpoints` for a group of endpoints that genuinely share them.
117
+ * — which is the thing least privilege forbids. They belong to the endpoint, or to a branch —
118
+ * `api.database(db)` — for a group of endpoints that genuinely share them. A
119
+ * branch is a new factory; the surface config stays free of grants.
94
120
  *
95
121
  * `auth` is not here either: `.auth(construct)` already declares it, and a
96
122
  * second way to say the same thing is the duplication this whole model removes.
97
123
  *
98
124
  * What is left is what the *process* is rather than what a route may reach.
99
125
  */
100
- export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
126
+ export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName>, Construct<TName, string> {
127
+ #private;
101
128
  private readonly config;
102
- /** Internal: how `.calls()` carries edges into the copy it returns. */
103
- private readonly dependencies;
104
129
  /** Internal: how `.auth()` carries the authenticator into its copy. */
105
130
  private readonly authenticator?;
106
131
  readonly id: TName;
132
+ /**
133
+ * Its public address, `https://api.example.com` — what a worker or another
134
+ * surface's endpoint that `.dependsOn([api])` reads to build a link or a
135
+ * callback URL. The same `<ID>_URL` on every command and stage.
136
+ */
137
+ readonly service: Service<Uncapitalize<TName>, string>;
107
138
  /**
108
139
  * Declared once and read by both `declare()` and anything that consumes this
109
140
  * surface, so what the target publishes and what a consumer reads cannot
@@ -133,68 +164,60 @@ export declare class RestApi<TName extends string = string, const TAuthorizers e
133
164
  readonly envParser: EnvironmentParser<{}>;
134
165
  /** The Telescope instance, when this surface was given one. */
135
166
  readonly telescope?: Telescope;
167
+ /** What this surface's process emits, when it was given a `Telemetry`. */
168
+ readonly telemetry?: Telemetry;
136
169
  constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
137
- /** Internal: how `.calls()` carries edges into the copy it returns. */
138
- dependencies?: readonly Dependency[],
139
170
  /** Internal: how `.auth()` carries the authenticator into its copy. */
140
- authenticator?: string | undefined);
171
+ authenticator?: Authenticator | undefined);
172
+ /** `api.get('/users')` — one route on this surface. */
173
+ readonly get: Endpoints['get'];
174
+ readonly post: Endpoints['post'];
175
+ readonly put: Endpoints['put'];
176
+ readonly patch: Endpoints['patch'];
177
+ readonly delete: Endpoints['delete'];
178
+ readonly options: Endpoints['options'];
141
179
  /**
142
- * This surface's endpoint factory.
143
- *
144
- * `api.get('/users')` is the short form and covers most routes. Reach for
145
- * this one when a *group* of endpoints shares something a single route would
146
- * otherwise repeat — a database, an auditor, a publisher:
180
+ * A branch for a *group* of endpoints that shares what a single route would
181
+ * otherwise repeat — a database, an auditor, a publisher, a session:
147
182
  *
148
183
  * ```ts
149
- * const audited = api.endpoints.database(db).auditor(AuditStore);
150
- * export const createUser = audited.post('/users').handle(...);
184
+ * export const router = api.database(database);
185
+ * export const createUser = router.post('/users').handle(({ db }) => …);
151
186
  * ```
152
187
  *
153
- * A factory branched from here keeps the surface, so its endpoints still
154
- * know which API serves them. That is deliberately narrower than putting the
155
- * same thing in the surface's own config: a group opts in, where a surface
156
- * would grant it to every route it serves.
157
- */
158
- readonly endpoints: EndpointFactory<[], '', Logger>;
159
- /** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */
160
- get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "GET", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
161
- post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "POST", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
162
- put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PUT", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
163
- patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PATCH", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
164
- delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "DELETE", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
165
- options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "OPTIONS", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
166
- /**
167
- * What authenticates this surface.
168
- *
169
- * An edge like `.calls()` — the auth server learns this origin, and the two
170
- * share a cookie domain — but a named one, because *who authenticates me* is
171
- * a different fact from *who I happen to call*, and only one of them decides
172
- * what a request is allowed to be. A surface with two of the first is a
173
- * mistake; two of the second is Tuesday.
188
+ * Each returns a new factory and leaves the surface as it was. That is the
189
+ * whole difference from putting the same thing in the surface's config: a
190
+ * group opts in, where the surface would grant it to every route it serves —
191
+ * a health check handed the database because a profile endpoint needed it.
174
192
  *
175
- * It records the id, not a client. Every endpoint consumes the same thing —
176
- * `verify(request) → Session | null` — and that is what every provider
177
- * shares, whether the server is mounted in this process, deployed beside it,
178
- * or an OIDC issuer somebody else runs.
193
+ * `dependsOn` is deliberately not here. It is per endpoint: what the API's
194
+ * process reaches is the edges of the endpoints it serves.
179
195
  */
180
- auth(construct: Declarable): RestApi<TName, TAuthorizers>;
196
+ readonly database: Endpoints['database'];
197
+ readonly session: Endpoints['session'];
198
+ readonly auditor: Endpoints['auditor'];
199
+ readonly actor: Endpoints['actor'];
200
+ readonly authorizer: Endpoints['authorizer'];
201
+ readonly authorize: Endpoints['authorize'];
202
+ readonly rls: Endpoints['rls'];
203
+ readonly route: Endpoints['route'];
181
204
  /**
182
- * Other surfaces this one calls.
183
- *
184
- * **Not `.dependsOn()`, and the difference matters.** An endpoint's
185
- * `.dependsOn()` injects a client into that handler and grants it exactly
186
- * what it named. This grants nothing and injects nothing: it records that
187
- * this API calls another surface, which is what puts this API's origin on
188
- * that surface's trusted-origin list.
205
+ * What authenticates this surface.
189
206
  *
190
- * Spelling it `dependsOn` would invite the thing least privilege forbids —
191
- * every route on the surface receiving whatever the surface named.
207
+ * An edge — the auth server learns this origin, and the two share a cookie
208
+ * domain — but a named one, because *who authenticates me* is a different
209
+ * fact from *who an endpoint happens to call*, and only one of them decides
210
+ * what a request is allowed to be.
192
211
  *
193
- * Immutable, like every other builder here.
212
+ * It declares the id, and keeps the construct: a session callback reads from
213
+ * it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
214
+ * calls the construct's `verify(headers)`. That is the one thing every
215
+ * provider shares, whether the server is mounted in this process, deployed
216
+ * beside it, or an OIDC issuer somebody else runs.
194
217
  */
195
- calls(constructs: readonly Declarable[]): RestApi<TName, TAuthorizers>;
218
+ auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
196
219
  /**
197
- * One surface node, with its endpoints left to the build.
220
+ * One surface node, with its endpoints left to discovery.
198
221
  *
199
222
  * The three provided keys are one fact about this surface and two about its
200
223
  * callers. Declaring the caller-derived pair here rather than having the
@@ -205,4 +228,5 @@ export declare class RestApi<TName extends string = string, const TAuthorizers e
205
228
  declare(): Declaration[];
206
229
  }
207
230
  //#endregion
231
+ export { type Authenticator, InvalidHostLabel };
208
232
  //# sourceMappingURL=rest-api.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rest-api.d.cts","names":["_$__endpoints_EndpointFactory0.RemoveTrailingSlash","_$__endpoints0.EndpointBuilder"],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;iBA0CiB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;;;;;;;;qBAmBA,QACZ,qCACM,iEACM,WAAW;mBAuCL;;mBAEA;;mBAEA;WAzCT,IAAI;;;;;;WAOJ;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,wBAAuB,cAEvB;;EAAA;;;;;;;;;;;;;;;;;;WA2DT,WAAW,wBAAwB;;EAG5C,IAAI,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,uBAAA,qFAAA,0BAAA,YAAA;EAIrC,KAAK,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,wBAAA,qFAAA,0BAAA,YAAA;EAItC,IAAI,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,uBAAA,qFAAA,0BAAA,YAAA;EAIrC,MAAM,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,yBAAA,qFAAA,0BAAA,YAAA;EAIvC,OAAO,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,0BAAA,qFAAA,0BAAA,YAAA;EAIxC,QAAQ,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,2BAAA,qFAAA,0BAAA,YAAA;;;;;;;;;;;;;;;EAkBzC,KAAK,WAAW,aAAa,QAAQ,OAAO;;;;;;;;;;;;;;;EAuB5C,MAAM,qBAAqB,eAAe,QAAQ,OAAO;;;;;;;;;;EAkBzD,WAAW"}
1
+ {"version":3,"file":"rest-api.d.cts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;;;KA2DK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;EAUZ,YAAY;;;;;;;;;;;;;;;;;qBAmBA,QACZ,qCACM,iEACM,WAAW,QAAQ,UAAU;;mBAiDvB;;mBAEA;WAjDT,IAAI;;;;;;WAOJ,SAAS,QAAQ,aAAa;;;;;;WAO9B;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;;WAGZ,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,gBAAgB;;WAoFzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;WAmBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,YAAY;WACZ,WAAW;WACX,KAAK;WACL,OAAO;;;;;;;;;;;;;;;EAgBhB,KAAK,WAAW,gBAAgB,QAAQ,OAAO;;;;;;;;;;EAiB/C,WAAW"}
@@ -1,11 +1,15 @@
1
- import { r as Declarable } from "./construct-interface-DPlxfpoS.mjs";
2
- import { S as BuiltInSecuritySchemeId } from "./Endpoint-oS-Fe3d_.mjs";
3
- import { d as EndpointBuilder, l as EndpointFactory, u as RemoveTrailingSlash } from "./index-Cc4kKPag.mjs";
4
- import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
1
+ import { i as Declarable, n as Construct, t as Authenticator } from "./construct-interface-DxfkFxkl.mjs";
2
+ import { n as Telemetry } from "./telemetry-BirKau0X.mjs";
3
+ import { D as BuiltInSecuritySchemeId } from "./Endpoint-DC7mreOr.mjs";
4
+ import { t as EndpointFactory } from "./EndpointFactory-DCmnCmkX.mjs";
5
+ import { ConstructName, Declaration, InvalidHostLabel } from "@geekmidas/manifest";
6
+ import { Service } from "@geekmidas/services";
5
7
  import { EnvironmentParser } from "@geekmidas/envkit";
6
8
  import { Logger } from "@geekmidas/logger";
7
9
  import { Telescope } from "@geekmidas/telescope";
8
10
  //#region src/rest-api.d.ts
11
+ /** The factory a surface builds its endpoints from. */
12
+ type Endpoints = EndpointFactory<[], '', Logger>;
9
13
  export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
10
14
  /**
11
15
  * The app that serves this surface, relative to the workspace root —
@@ -19,6 +23,18 @@ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly
19
23
  * `constructs` glob.
20
24
  */
21
25
  path: string;
26
+ /**
27
+ * The label it answers on under a stage's domain — `api` for
28
+ * `api.myapp.com`, from `domains` — and under the project locally,
29
+ * `api.myapp.localhost`. Absent, its id kebab-cased.
30
+ */
31
+ subdomain?: string;
32
+ /**
33
+ * More labels it answers on under the stage's domain, exactly as on its
34
+ * own — `['rest']` serves `rest.myapp.com` beside `api.myapp.com`. Its own
35
+ * label stays canonical: `<ID>_URL`, clients and OpenAPI are built on it.
36
+ */
37
+ aliases?: readonly string[];
22
38
  /**
23
39
  * CORS tunables. The *origins* are never here — they are read off the
24
40
  * constructs that declared an edge to this surface, which is the whole point
@@ -81,29 +97,44 @@ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly
81
97
  * printed an import for. The entry already imports the surface.
82
98
  */
83
99
  telescope?: Telescope;
100
+ /**
101
+ * What this surface's process emits — the `Telemetry` construct, passed
102
+ * like the logger: a fact about the process, not a grant to a route.
103
+ *
104
+ * An edge to the node, so the deploy hands this process the `OTEL_*` keys
105
+ * its stage resolves, and the build fails without the OpenTelemetry
106
+ * packages. Where the telemetry goes is never here: it is the deploy's,
107
+ * per stage.
108
+ */
109
+ telemetry?: Telemetry;
84
110
  }
85
111
  /**
86
112
  * What is *not* here, and why.
87
113
  *
88
- * `dependsOn`, `database`, `auditor` and `publisher` all inject a capability
114
+ * `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
89
115
  * into a handler. Putting one on the surface hands it to every route the
90
116
  * surface serves — a health check gets the database because a report needed it
91
- * — which is the thing least privilege forbids and the reason `.calls()` is not
92
- * spelled `dependsOn`. They belong to the endpoint, or to a factory branched
93
- * from `api.endpoints` for a group of endpoints that genuinely share them.
117
+ * — which is the thing least privilege forbids. They belong to the endpoint, or to a branch —
118
+ * `api.database(db)` — for a group of endpoints that genuinely share them. A
119
+ * branch is a new factory; the surface config stays free of grants.
94
120
  *
95
121
  * `auth` is not here either: `.auth(construct)` already declares it, and a
96
122
  * second way to say the same thing is the duplication this whole model removes.
97
123
  *
98
124
  * What is left is what the *process* is rather than what a route may reach.
99
125
  */
100
- export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
126
+ export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName>, Construct<TName, string> {
127
+ #private;
101
128
  private readonly config;
102
- /** Internal: how `.calls()` carries edges into the copy it returns. */
103
- private readonly dependencies;
104
129
  /** Internal: how `.auth()` carries the authenticator into its copy. */
105
130
  private readonly authenticator?;
106
131
  readonly id: TName;
132
+ /**
133
+ * Its public address, `https://api.example.com` — what a worker or another
134
+ * surface's endpoint that `.dependsOn([api])` reads to build a link or a
135
+ * callback URL. The same `<ID>_URL` on every command and stage.
136
+ */
137
+ readonly service: Service<Uncapitalize<TName>, string>;
107
138
  /**
108
139
  * Declared once and read by both `declare()` and anything that consumes this
109
140
  * surface, so what the target publishes and what a consumer reads cannot
@@ -133,68 +164,60 @@ export declare class RestApi<TName extends string = string, const TAuthorizers e
133
164
  readonly envParser: EnvironmentParser<{}>;
134
165
  /** The Telescope instance, when this surface was given one. */
135
166
  readonly telescope?: Telescope;
167
+ /** What this surface's process emits, when it was given a `Telemetry`. */
168
+ readonly telemetry?: Telemetry;
136
169
  constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
137
- /** Internal: how `.calls()` carries edges into the copy it returns. */
138
- dependencies?: readonly Dependency[],
139
170
  /** Internal: how `.auth()` carries the authenticator into its copy. */
140
- authenticator?: string | undefined);
171
+ authenticator?: Authenticator | undefined);
172
+ /** `api.get('/users')` — one route on this surface. */
173
+ readonly get: Endpoints['get'];
174
+ readonly post: Endpoints['post'];
175
+ readonly put: Endpoints['put'];
176
+ readonly patch: Endpoints['patch'];
177
+ readonly delete: Endpoints['delete'];
178
+ readonly options: Endpoints['options'];
141
179
  /**
142
- * This surface's endpoint factory.
143
- *
144
- * `api.get('/users')` is the short form and covers most routes. Reach for
145
- * this one when a *group* of endpoints shares something a single route would
146
- * otherwise repeat — a database, an auditor, a publisher:
180
+ * A branch for a *group* of endpoints that shares what a single route would
181
+ * otherwise repeat — a database, an auditor, a publisher, a session:
147
182
  *
148
183
  * ```ts
149
- * const audited = api.endpoints.database(db).auditor(AuditStore);
150
- * export const createUser = audited.post('/users').handle(...);
184
+ * export const router = api.database(database);
185
+ * export const createUser = router.post('/users').handle(({ db }) => …);
151
186
  * ```
152
187
  *
153
- * A factory branched from here keeps the surface, so its endpoints still
154
- * know which API serves them. That is deliberately narrower than putting the
155
- * same thing in the surface's own config: a group opts in, where a surface
156
- * would grant it to every route it serves.
157
- */
158
- readonly endpoints: EndpointFactory<[], '', Logger>;
159
- /** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */
160
- get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "GET", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
161
- post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "POST", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
162
- put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PUT", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
163
- patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PATCH", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
164
- delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "DELETE", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
165
- options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "OPTIONS", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
166
- /**
167
- * What authenticates this surface.
168
- *
169
- * An edge like `.calls()` — the auth server learns this origin, and the two
170
- * share a cookie domain — but a named one, because *who authenticates me* is
171
- * a different fact from *who I happen to call*, and only one of them decides
172
- * what a request is allowed to be. A surface with two of the first is a
173
- * mistake; two of the second is Tuesday.
188
+ * Each returns a new factory and leaves the surface as it was. That is the
189
+ * whole difference from putting the same thing in the surface's config: a
190
+ * group opts in, where the surface would grant it to every route it serves —
191
+ * a health check handed the database because a profile endpoint needed it.
174
192
  *
175
- * It records the id, not a client. Every endpoint consumes the same thing —
176
- * `verify(request) → Session | null` — and that is what every provider
177
- * shares, whether the server is mounted in this process, deployed beside it,
178
- * or an OIDC issuer somebody else runs.
193
+ * `dependsOn` is deliberately not here. It is per endpoint: what the API's
194
+ * process reaches is the edges of the endpoints it serves.
179
195
  */
180
- auth(construct: Declarable): RestApi<TName, TAuthorizers>;
196
+ readonly database: Endpoints['database'];
197
+ readonly session: Endpoints['session'];
198
+ readonly auditor: Endpoints['auditor'];
199
+ readonly actor: Endpoints['actor'];
200
+ readonly authorizer: Endpoints['authorizer'];
201
+ readonly authorize: Endpoints['authorize'];
202
+ readonly rls: Endpoints['rls'];
203
+ readonly route: Endpoints['route'];
181
204
  /**
182
- * Other surfaces this one calls.
183
- *
184
- * **Not `.dependsOn()`, and the difference matters.** An endpoint's
185
- * `.dependsOn()` injects a client into that handler and grants it exactly
186
- * what it named. This grants nothing and injects nothing: it records that
187
- * this API calls another surface, which is what puts this API's origin on
188
- * that surface's trusted-origin list.
205
+ * What authenticates this surface.
189
206
  *
190
- * Spelling it `dependsOn` would invite the thing least privilege forbids —
191
- * every route on the surface receiving whatever the surface named.
207
+ * An edge — the auth server learns this origin, and the two share a cookie
208
+ * domain — but a named one, because *who authenticates me* is a different
209
+ * fact from *who an endpoint happens to call*, and only one of them decides
210
+ * what a request is allowed to be.
192
211
  *
193
- * Immutable, like every other builder here.
212
+ * It declares the id, and keeps the construct: a session callback reads from
213
+ * it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
214
+ * calls the construct's `verify(headers)`. That is the one thing every
215
+ * provider shares, whether the server is mounted in this process, deployed
216
+ * beside it, or an OIDC issuer somebody else runs.
194
217
  */
195
- calls(constructs: readonly Declarable[]): RestApi<TName, TAuthorizers>;
218
+ auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
196
219
  /**
197
- * One surface node, with its endpoints left to the build.
220
+ * One surface node, with its endpoints left to discovery.
198
221
  *
199
222
  * The three provided keys are one fact about this surface and two about its
200
223
  * callers. Declaring the caller-derived pair here rather than having the
@@ -205,4 +228,5 @@ export declare class RestApi<TName extends string = string, const TAuthorizers e
205
228
  declare(): Declaration[];
206
229
  }
207
230
  //#endregion
231
+ export { type Authenticator, InvalidHostLabel };
208
232
  //# sourceMappingURL=rest-api.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rest-api.d.mts","names":["_$__endpoints_EndpointFactory0.RemoveTrailingSlash","_$__endpoints0.EndpointBuilder"],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;iBA0CiB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;;;;;;;;qBAmBA,QACZ,qCACM,iEACM,WAAW;mBAuCL;;mBAEA;;mBAEA;WAzCT,IAAI;;;;;;WAOJ;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,wBAAuB,cAEvB;;EAAA;;;;;;;;;;;;;;;;;;WA2DT,WAAW,wBAAwB;;EAG5C,IAAI,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,uBAAA,qFAAA,0BAAA,YAAA;EAIrC,KAAK,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,wBAAA,qFAAA,0BAAA,YAAA;EAItC,IAAI,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,uBAAA,qFAAA,0BAAA,YAAA;EAIrC,MAAM,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,yBAAA,qFAAA,0BAAA,YAAA;EAIvC,OAAO,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,0BAAA,qFAAA,0BAAA,YAAA;EAIxC,QAAQ,sBAAsB,MAAM,QAAKC,gBAAAD,oBAAA,2BAAA,qFAAA,0BAAA,YAAA;;;;;;;;;;;;;;;EAkBzC,KAAK,WAAW,aAAa,QAAQ,OAAO;;;;;;;;;;;;;;;EAuB5C,MAAM,qBAAqB,eAAe,QAAQ,OAAO;;;;;;;;;;EAkBzD,WAAW"}
1
+ {"version":3,"file":"rest-api.d.mts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;;;KA2DK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;EAUZ,YAAY;;;;;;;;;;;;;;;;;qBAmBA,QACZ,qCACM,iEACM,WAAW,QAAQ,UAAU;;mBAiDvB;;mBAEA;WAjDT,IAAI;;;;;;WAOJ,SAAS,QAAQ,aAAa;;;;;;WAO9B;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;;WAGZ,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,gBAAgB;;WAoFzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;WAmBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,YAAY;WACZ,WAAW;WACX,KAAK;WACL,OAAO;;;;;;;;;;;;;;;EAgBhB,KAAK,WAAW,gBAAgB,QAAQ,OAAO;;;;;;;;;;EAiB/C,WAAW"}