@geekmidas/constructs 10.0.0-alpha.5 → 10.0.0-alpha.51

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 (392) hide show
  1. package/README.md +223 -158
  2. package/dist/{Construct-BD5neF7w.mjs → Construct-BO1X-kt9.mjs} +32 -33
  3. package/dist/Construct-BO1X-kt9.mjs.map +1 -0
  4. package/dist/Construct-BQALFCh2.d.cts +230 -0
  5. package/dist/Construct-BQALFCh2.d.cts.map +1 -0
  6. package/dist/{Construct-CyS3RpTL.cjs → Construct-DmvXceVY.cjs} +52 -47
  7. package/dist/Construct-DmvXceVY.cjs.map +1 -0
  8. package/dist/Construct-QXnl3VqT.d.mts +230 -0
  9. package/dist/Construct-QXnl3VqT.d.mts.map +1 -0
  10. package/dist/{Cron-B2OFsfDM.d.cts → Cron-DI3nKoic.d.cts} +22 -8
  11. package/dist/Cron-DI3nKoic.d.cts.map +1 -0
  12. package/dist/{Cron-CqEbBbwH.d.mts → Cron-uYAHPnp7.d.mts} +22 -8
  13. package/dist/Cron-uYAHPnp7.d.mts.map +1 -0
  14. package/dist/CronBuilder-BoHzlWU_.cjs +121 -0
  15. package/dist/CronBuilder-BoHzlWU_.cjs.map +1 -0
  16. package/dist/CronBuilder-CCgt0wCE.mjs +109 -0
  17. package/dist/CronBuilder-CCgt0wCE.mjs.map +1 -0
  18. package/dist/CronBuilder-DaSUm2Na.d.mts +47 -0
  19. package/dist/CronBuilder-DaSUm2Na.d.mts.map +1 -0
  20. package/dist/CronBuilder-g1lZLWyG.d.cts +47 -0
  21. package/dist/CronBuilder-g1lZLWyG.d.cts.map +1 -0
  22. package/dist/{Endpoint-Dem2XyCu.d.mts → Endpoint-Bm9HjTPc.d.cts} +70 -93
  23. package/dist/Endpoint-Bm9HjTPc.d.cts.map +1 -0
  24. package/dist/{Endpoint-Dij_wOcc.mjs → Endpoint-CQ9RJ7p2.mjs} +130 -109
  25. package/dist/Endpoint-CQ9RJ7p2.mjs.map +1 -0
  26. package/dist/{Endpoint-DrD8a1yH.d.cts → Endpoint-CwM8Rzfs.d.mts} +71 -94
  27. package/dist/Endpoint-CwM8Rzfs.d.mts.map +1 -0
  28. package/dist/{Endpoint-DODn1RhN.cjs → Endpoint-DOi8c_Gy.cjs} +158 -131
  29. package/dist/Endpoint-DOi8c_Gy.cjs.map +1 -0
  30. package/dist/{index-B8g8POkr.d.cts → EndpointFactory-0plFjvb7.d.mts} +64 -134
  31. package/dist/EndpointFactory-0plFjvb7.d.mts.map +1 -0
  32. package/dist/{index-DbKmfl-q.d.mts → EndpointFactory-B6eZ3RDd.d.cts} +64 -134
  33. package/dist/EndpointFactory-B6eZ3RDd.d.cts.map +1 -0
  34. package/dist/{EndpointFactory-BHFMmFkV.cjs → EndpointFactory-Bo9lkMqB.cjs} +75 -110
  35. package/dist/EndpointFactory-Bo9lkMqB.cjs.map +1 -0
  36. package/dist/{EndpointFactory-b4ituq-s.mjs → EndpointFactory-DR1rebok.mjs} +39 -74
  37. package/dist/EndpointFactory-DR1rebok.mjs.map +1 -0
  38. package/dist/Function-DuqGcbOI.d.mts +76 -0
  39. package/dist/Function-DuqGcbOI.d.mts.map +1 -0
  40. package/dist/Function-Pu-1kKZz.d.cts +76 -0
  41. package/dist/Function-Pu-1kKZz.d.cts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-BM2jbWht.mjs → HonoEndpointAdaptor-BIS0O3M9.mjs} +41 -47
  43. package/dist/HonoEndpointAdaptor-BIS0O3M9.mjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-De6IlBZe.cjs → HonoEndpointAdaptor-CMi0MJsF.cjs} +50 -53
  45. package/dist/HonoEndpointAdaptor-CMi0MJsF.cjs.map +1 -0
  46. package/dist/Queue-D5jcw0mu.cjs +109 -0
  47. package/dist/Queue-D5jcw0mu.cjs.map +1 -0
  48. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-DlsHRzUp.d.mts} +48 -48
  49. package/dist/Queue-DlsHRzUp.d.mts.map +1 -0
  50. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-HPyi0e1i.d.cts} +49 -49
  51. package/dist/Queue-HPyi0e1i.d.cts.map +1 -0
  52. package/dist/Queue-hwPN-t31.mjs +104 -0
  53. package/dist/Queue-hwPN-t31.mjs.map +1 -0
  54. package/dist/QueueBuilder-BFQn3OzZ.cjs +135 -0
  55. package/dist/QueueBuilder-BFQn3OzZ.cjs.map +1 -0
  56. package/dist/QueueBuilder-DCuYdjMw.mjs +118 -0
  57. package/dist/QueueBuilder-DCuYdjMw.mjs.map +1 -0
  58. package/dist/QueueBuilder-OSi6LkV9.d.cts +75 -0
  59. package/dist/QueueBuilder-OSi6LkV9.d.cts.map +1 -0
  60. package/dist/QueueBuilder-QHsnVt1P.d.mts +75 -0
  61. package/dist/QueueBuilder-QHsnVt1P.d.mts.map +1 -0
  62. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-Bpp02cGr.d.cts} +29 -20
  63. package/dist/Subscriber-Bpp02cGr.d.cts.map +1 -0
  64. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-CtN9R48-.d.mts} +29 -20
  65. package/dist/Subscriber-CtN9R48-.d.mts.map +1 -0
  66. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2PwqwIl.cjs} +61 -36
  67. package/dist/SubscriberBuilder-C2PwqwIl.cjs.map +1 -0
  68. package/dist/SubscriberBuilder-CuCMFpYW.d.mts +67 -0
  69. package/dist/SubscriberBuilder-CuCMFpYW.d.mts.map +1 -0
  70. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DMFk_Ap1.mjs} +50 -24
  71. package/dist/SubscriberBuilder-DMFk_Ap1.mjs.map +1 -0
  72. package/dist/SubscriberBuilder-g3fAVWgs.d.cts +67 -0
  73. package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +1 -0
  74. package/dist/Topic-CkxOTrMv.cjs +104 -0
  75. package/dist/Topic-CkxOTrMv.cjs.map +1 -0
  76. package/dist/Topic-hPffOsot.mjs +99 -0
  77. package/dist/Topic-hPffOsot.mjs.map +1 -0
  78. package/dist/adaptors/aws.cjs +189 -110
  79. package/dist/adaptors/aws.cjs.map +1 -1
  80. package/dist/adaptors/aws.d.cts +81 -45
  81. package/dist/adaptors/aws.d.cts.map +1 -1
  82. package/dist/adaptors/aws.d.mts +82 -46
  83. package/dist/adaptors/aws.d.mts.map +1 -1
  84. package/dist/adaptors/aws.mjs +161 -85
  85. package/dist/adaptors/aws.mjs.map +1 -1
  86. package/dist/adaptors/hono.cjs +3 -10
  87. package/dist/adaptors/hono.d.cts +7 -16
  88. package/dist/adaptors/hono.d.cts.map +1 -1
  89. package/dist/adaptors/hono.d.mts +8 -17
  90. package/dist/adaptors/hono.d.mts.map +1 -1
  91. package/dist/adaptors/hono.mjs +2 -10
  92. package/dist/adaptors/testing.cjs +704 -90
  93. package/dist/adaptors/testing.cjs.map +1 -1
  94. package/dist/adaptors/testing.d.cts +325 -54
  95. package/dist/adaptors/testing.d.cts.map +1 -1
  96. package/dist/adaptors/testing.d.mts +325 -54
  97. package/dist/adaptors/testing.d.mts.map +1 -1
  98. package/dist/adaptors/testing.mjs +669 -71
  99. package/dist/adaptors/testing.mjs.map +1 -1
  100. package/dist/auth-CIFXNuDk.d.cts +194 -0
  101. package/dist/auth-CIFXNuDk.d.cts.map +1 -0
  102. package/dist/auth-CJ9Ff6Lu.d.mts +194 -0
  103. package/dist/auth-CJ9Ff6Lu.d.mts.map +1 -0
  104. package/dist/auth.cjs +172 -31
  105. package/dist/auth.cjs.map +1 -1
  106. package/dist/auth.d.cts +2 -108
  107. package/dist/auth.d.mts +2 -108
  108. package/dist/auth.mjs +161 -24
  109. package/dist/auth.mjs.map +1 -1
  110. package/dist/{cache-BrRz3fEB.d.mts → cache-CXh6GIgb.d.mts} +3 -6
  111. package/dist/cache-CXh6GIgb.d.mts.map +1 -0
  112. package/dist/{cache-BtZY_tHe.d.cts → cache-DnGDGly3.d.cts} +3 -6
  113. package/dist/cache-DnGDGly3.d.cts.map +1 -0
  114. package/dist/cache.cjs +68 -2
  115. package/dist/cache.cjs.map +1 -0
  116. package/dist/cache.d.cts +1 -2
  117. package/dist/cache.d.mts +1 -2
  118. package/dist/cache.mjs +67 -2
  119. package/dist/cache.mjs.map +1 -0
  120. package/dist/cipher-C1lEFX63.mjs +225 -0
  121. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  122. package/dist/cipher-CVxfwLjk.cjs +332 -0
  123. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  124. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  125. package/dist/clone-EKNovYHu.mjs.map +1 -0
  126. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  127. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  128. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
  129. package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
  130. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-DluK3_da.d.mts} +42 -11
  131. package/dist/construct-interface-DluK3_da.d.mts.map +1 -0
  132. package/dist/construct-interface.cjs +113 -7
  133. package/dist/construct-interface.cjs.map +1 -0
  134. package/dist/construct-interface.d.cts +2 -2
  135. package/dist/construct-interface.d.mts +2 -2
  136. package/dist/construct-interface.mjs +106 -2
  137. package/dist/construct-interface.mjs.map +1 -0
  138. package/dist/credential.cjs +63 -16
  139. package/dist/credential.cjs.map +1 -1
  140. package/dist/credential.d.cts +16 -9
  141. package/dist/credential.d.cts.map +1 -1
  142. package/dist/credential.d.mts +16 -9
  143. package/dist/credential.d.mts.map +1 -1
  144. package/dist/credential.mjs +58 -12
  145. package/dist/credential.mjs.map +1 -1
  146. package/dist/crons/index.cjs +68 -10
  147. package/dist/crons/index.cjs.map +1 -1
  148. package/dist/crons/index.d.cts +32 -14
  149. package/dist/crons/index.d.cts.map +1 -1
  150. package/dist/crons/index.d.mts +32 -14
  151. package/dist/crons/index.d.mts.map +1 -1
  152. package/dist/crons/index.mjs +66 -10
  153. package/dist/crons/index.mjs.map +1 -1
  154. package/dist/database/kysely.cjs +40 -15
  155. package/dist/database/kysely.cjs.map +1 -1
  156. package/dist/database/kysely.d.cts +2 -152
  157. package/dist/database/kysely.d.mts +2 -152
  158. package/dist/database/kysely.mjs +28 -5
  159. package/dist/database/kysely.mjs.map +1 -1
  160. package/dist/email.cjs +25 -12
  161. package/dist/email.cjs.map +1 -1
  162. package/dist/email.d.cts +3 -7
  163. package/dist/email.d.cts.map +1 -1
  164. package/dist/email.d.mts +3 -7
  165. package/dist/email.d.mts.map +1 -1
  166. package/dist/email.mjs +16 -3
  167. package/dist/email.mjs.map +1 -1
  168. package/dist/encryption.cjs +96 -0
  169. package/dist/encryption.cjs.map +1 -0
  170. package/dist/encryption.d.cts +117 -0
  171. package/dist/encryption.d.cts.map +1 -0
  172. package/dist/encryption.d.mts +117 -0
  173. package/dist/encryption.d.mts.map +1 -0
  174. package/dist/encryption.mjs +83 -0
  175. package/dist/encryption.mjs.map +1 -0
  176. package/dist/endpoints/index.cjs +8 -10
  177. package/dist/endpoints/index.d.cts +51 -7
  178. package/dist/endpoints/index.d.cts.map +1 -0
  179. package/dist/endpoints/index.d.mts +51 -7
  180. package/dist/endpoints/index.d.mts.map +1 -0
  181. package/dist/endpoints/index.mjs +6 -10
  182. package/dist/external-api-CWY9orcO.d.mts +86 -0
  183. package/dist/external-api-CWY9orcO.d.mts.map +1 -0
  184. package/dist/external-api-D-5WB-sr.d.cts +86 -0
  185. package/dist/external-api-D-5WB-sr.d.cts.map +1 -0
  186. package/dist/external-api.cjs +124 -0
  187. package/dist/external-api.cjs.map +1 -0
  188. package/dist/external-api.d.cts +2 -0
  189. package/dist/external-api.d.mts +2 -0
  190. package/dist/external-api.mjs +121 -0
  191. package/dist/external-api.mjs.map +1 -0
  192. package/dist/file-server.cjs +42 -10
  193. package/dist/file-server.cjs.map +1 -1
  194. package/dist/file-server.d.cts +6 -10
  195. package/dist/file-server.d.cts.map +1 -1
  196. package/dist/file-server.d.mts +6 -10
  197. package/dist/file-server.d.mts.map +1 -1
  198. package/dist/file-server.mjs +34 -2
  199. package/dist/file-server.mjs.map +1 -1
  200. package/dist/functions/index.cjs +2 -6
  201. package/dist/functions/index.d.cts +3 -4
  202. package/dist/functions/index.d.mts +3 -4
  203. package/dist/functions/index.mjs +2 -6
  204. package/dist/{functions-DJJA7VGc.cjs → functions-CbP5ZKma.cjs} +421 -273
  205. package/dist/functions-CbP5ZKma.cjs.map +1 -0
  206. package/dist/{functions-Ck21Uyq0.mjs → functions-Di6n5ltG.mjs} +383 -241
  207. package/dist/functions-Di6n5ltG.mjs.map +1 -0
  208. package/dist/index-BuzRvKOQ.d.cts +115 -0
  209. package/dist/index-BuzRvKOQ.d.cts.map +1 -0
  210. package/dist/index-CTkKOer4.d.mts +115 -0
  211. package/dist/index-CTkKOer4.d.mts.map +1 -0
  212. package/dist/index-CeEtxDmK.d.cts +79 -0
  213. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  214. package/dist/index-CeEtxDmK.d.mts +79 -0
  215. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  216. package/dist/index.cjs +3 -3
  217. package/dist/index.d.cts +4 -4
  218. package/dist/index.d.mts +4 -4
  219. package/dist/index.mjs +2 -3
  220. package/dist/kms-B-Hm3d5r.cjs +85 -0
  221. package/dist/kms-B-Hm3d5r.cjs.map +1 -0
  222. package/dist/kms-BdUlMJEZ.mjs +85 -0
  223. package/dist/kms-BdUlMJEZ.mjs.map +1 -0
  224. package/dist/kysely-Bqov3fwv.d.mts +159 -0
  225. package/dist/kysely-Bqov3fwv.d.mts.map +1 -0
  226. package/dist/kysely-DTnkZsub.d.cts +159 -0
  227. package/dist/kysely-DTnkZsub.d.cts.map +1 -0
  228. package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-CFanua0O.mjs} +20 -60
  229. package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
  230. package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-hJKGv8Ay.cjs} +60 -113
  231. package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
  232. package/dist/mobile-app.cjs +73 -0
  233. package/dist/mobile-app.cjs.map +1 -0
  234. package/dist/mobile-app.d.cts +61 -0
  235. package/dist/mobile-app.d.cts.map +1 -0
  236. package/dist/mobile-app.d.mts +61 -0
  237. package/dist/mobile-app.d.mts.map +1 -0
  238. package/dist/mobile-app.mjs +72 -0
  239. package/dist/mobile-app.mjs.map +1 -0
  240. package/dist/object-storage.cjs +18 -10
  241. package/dist/object-storage.cjs.map +1 -1
  242. package/dist/object-storage.d.cts +3 -7
  243. package/dist/object-storage.d.cts.map +1 -1
  244. package/dist/object-storage.d.mts +3 -7
  245. package/dist/object-storage.d.mts.map +1 -1
  246. package/dist/object-storage.mjs +11 -3
  247. package/dist/object-storage.mjs.map +1 -1
  248. package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
  249. package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
  250. package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
  251. package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
  252. package/dist/queue/index.cjs +6 -189
  253. package/dist/queue/index.d.cts +3 -60
  254. package/dist/queue/index.d.mts +3 -60
  255. package/dist/queue/index.mjs +3 -186
  256. package/dist/rest-api.cjs +88 -63
  257. package/dist/rest-api.cjs.map +1 -1
  258. package/dist/rest-api.d.cts +68 -61
  259. package/dist/rest-api.d.cts.map +1 -1
  260. package/dist/rest-api.d.mts +68 -61
  261. package/dist/rest-api.d.mts.map +1 -1
  262. package/dist/rest-api.mjs +80 -55
  263. package/dist/rest-api.mjs.map +1 -1
  264. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  265. package/dist/site.cjs +34 -9
  266. package/dist/site.cjs.map +1 -1
  267. package/dist/site.d.cts +17 -22
  268. package/dist/site.d.cts.map +1 -1
  269. package/dist/site.d.mts +17 -22
  270. package/dist/site.d.mts.map +1 -1
  271. package/dist/site.mjs +30 -5
  272. package/dist/site.mjs.map +1 -1
  273. package/dist/subscribers/index.cjs +2 -11
  274. package/dist/subscribers/index.d.cts +3 -14
  275. package/dist/subscribers/index.d.mts +3 -14
  276. package/dist/subscribers/index.mjs +2 -11
  277. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  278. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  279. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  280. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  281. package/dist/{telemetry-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
  282. package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
  283. package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
  284. package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
  285. package/dist/topic/index.cjs +3 -137
  286. package/dist/topic/index.d.cts +2 -32
  287. package/dist/topic/index.d.mts +2 -32
  288. package/dist/topic/index.mjs +2 -134
  289. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  290. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  291. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  292. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  293. package/dist/types.d.cts +1 -1
  294. package/dist/types.d.mts +1 -1
  295. package/dist/types.mjs +1 -0
  296. package/dist/worker.cjs +137 -38
  297. package/dist/worker.cjs.map +1 -1
  298. package/dist/worker.d.cts +113 -44
  299. package/dist/worker.d.cts.map +1 -1
  300. package/dist/worker.d.mts +113 -43
  301. package/dist/worker.d.mts.map +1 -1
  302. package/dist/worker.mjs +132 -33
  303. package/dist/worker.mjs.map +1 -1
  304. package/package.json +81 -41
  305. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  306. package/dist/Construct-C0ijr2qp.d.cts +0 -117
  307. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  308. package/dist/Construct-Ct8nalEi.d.mts +0 -117
  309. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  310. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  311. package/dist/Cron-B2OFsfDM.d.cts.map +0 -1
  312. package/dist/Cron-CqEbBbwH.d.mts.map +0 -1
  313. package/dist/CronBuilder-Bg-9h2cc.d.mts +0 -44
  314. package/dist/CronBuilder-Bg-9h2cc.d.mts.map +0 -1
  315. package/dist/CronBuilder-CdibiHNB.mjs +0 -84
  316. package/dist/CronBuilder-CdibiHNB.mjs.map +0 -1
  317. package/dist/CronBuilder-DyUr6nYz.cjs +0 -96
  318. package/dist/CronBuilder-DyUr6nYz.cjs.map +0 -1
  319. package/dist/CronBuilder-LSJMfqnq.d.cts +0 -44
  320. package/dist/CronBuilder-LSJMfqnq.d.cts.map +0 -1
  321. package/dist/Endpoint-DODn1RhN.cjs.map +0 -1
  322. package/dist/Endpoint-Dem2XyCu.d.mts.map +0 -1
  323. package/dist/Endpoint-Dij_wOcc.mjs.map +0 -1
  324. package/dist/Endpoint-DrD8a1yH.d.cts.map +0 -1
  325. package/dist/EndpointFactory-BHFMmFkV.cjs.map +0 -1
  326. package/dist/EndpointFactory-b4ituq-s.mjs.map +0 -1
  327. package/dist/HonoEndpointAdaptor-BM2jbWht.mjs.map +0 -1
  328. package/dist/HonoEndpointAdaptor-De6IlBZe.cjs.map +0 -1
  329. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  330. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  331. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  332. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  333. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  334. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  335. package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
  336. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  337. package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
  338. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  339. package/dist/Topic-19QeHBIR.d.cts +0 -91
  340. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  341. package/dist/Topic-DuFeqkBh.d.mts +0 -91
  342. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  343. package/dist/auth.d.cts.map +0 -1
  344. package/dist/auth.d.mts.map +0 -1
  345. package/dist/cache-0ANvRQnD.mjs +0 -51
  346. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  347. package/dist/cache-3WSvAulx.cjs +0 -57
  348. package/dist/cache-3WSvAulx.cjs.map +0 -1
  349. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  350. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  351. package/dist/clone-DblgEZZa.mjs.map +0 -1
  352. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  353. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  354. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  355. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  356. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  357. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  358. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  359. package/dist/database/kysely.d.cts.map +0 -1
  360. package/dist/database/kysely.d.mts.map +0 -1
  361. package/dist/functions-Ck21Uyq0.mjs.map +0 -1
  362. package/dist/functions-DJJA7VGc.cjs.map +0 -1
  363. package/dist/index-AIfVzkhi.d.cts +0 -170
  364. package/dist/index-AIfVzkhi.d.cts.map +0 -1
  365. package/dist/index-B8g8POkr.d.cts.map +0 -1
  366. package/dist/index-D3zjrwjr.d.mts +0 -169
  367. package/dist/index-D3zjrwjr.d.mts.map +0 -1
  368. package/dist/index-DbKmfl-q.d.mts.map +0 -1
  369. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  370. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  371. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  372. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  373. package/dist/queue/index.cjs.map +0 -1
  374. package/dist/queue/index.d.cts.map +0 -1
  375. package/dist/queue/index.d.mts.map +0 -1
  376. package/dist/queue/index.mjs.map +0 -1
  377. package/dist/subscribers/index.cjs.map +0 -1
  378. package/dist/subscribers/index.d.cts.map +0 -1
  379. package/dist/subscribers/index.d.mts.map +0 -1
  380. package/dist/subscribers/index.mjs.map +0 -1
  381. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  382. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  383. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  384. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  385. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  386. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  387. package/dist/topic/index.cjs.map +0 -1
  388. package/dist/topic/index.d.cts.map +0 -1
  389. package/dist/topic/index.d.mts.map +0 -1
  390. package/dist/topic/index.mjs.map +0 -1
  391. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  392. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -1,37 +1,32 @@
1
- import "./Construct-C0ijr2qp.cjs";
2
- import "./index-AIfVzkhi.cjs";
3
- import { Declarable } from "./construct-interface-D9d4Gm4p.cjs";
4
- import "./types-BlAkSuGI.cjs";
5
- import { BuiltInSecuritySchemeId } from "./Endpoint-DrD8a1yH.cjs";
6
- import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-B8g8POkr.cjs";
1
+ import { i as Declarable, t as Authenticator } from "./construct-interface-B1AfqRl4.cjs";
2
+ import { T as BuiltInSecuritySchemeId } from "./Endpoint-Bm9HjTPc.cjs";
3
+ import { t as EndpointFactory } from "./EndpointFactory-B6eZ3RDd.cjs";
7
4
  import { EnvironmentParser } from "@geekmidas/envkit";
8
5
  import { Logger } from "@geekmidas/logger";
9
- import { AppSpec, ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
6
+ import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
10
7
  import { Telescope } from "@geekmidas/telescope";
11
-
12
8
  //#region src/rest-api.d.ts
13
-
14
- interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
9
+ /** The factory a surface builds its endpoints from. */
10
+ type Endpoints = EndpointFactory<[], '', Logger>;
11
+ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
15
12
  /**
16
- * The app that serves this surface: where its source lives, which globs
17
- * find its code, how it is run.
18
- *
19
- * What makes a surface a deploy unit rather than something a deploy has to
20
- * be told about separately: one `RestApi` is one server. A `StaticSite` says
21
- * the same thing, and the two are the same kind of statement.
22
- *
23
- * Normally omitted. One RestApi is one server, always — there is no mode in
24
- * which a surface shares somebody else's container, because a surface that
25
- * gets its process by inference gets it from whatever happened to reference
26
- * it, and that was the thing worth removing.
27
- *
28
- * So this is an override and nothing else. Everything in it follows from
29
- * this construct's id — `apps/<kebab-id>` where that directory exists, the
30
- * conventional code directories under it, a port assigned in a stable
31
- * order. Write one when the layout genuinely differs:
32
- * `app: { path: 'services/api' }`.
13
+ * The app that serves this surface, relative to the workspace root —
14
+ * `'apps/api'`, or `'.'` in a single-app project.
15
+ *
16
+ * Required. It was inferred from the id (`apps/<kebab-id>`, or the root
17
+ * when no such directory existed), which meant a surface's home was
18
+ * whatever happened to be on disk. It is where the app's `package.json`
19
+ * and base `tsconfig.json` are, and which build serves this surface. It
20
+ * does not change discovery: constructs still load from the workspace's
21
+ * `constructs` glob.
33
22
  */
34
- app?: AppSpec;
23
+ path: string;
24
+ /**
25
+ * The label it answers on under a stage's domain — `api` for
26
+ * `api.myapp.com`, from `deploy.domains` — and under the project locally,
27
+ * `api.myapp.localhost`. Absent, its id kebab-cased.
28
+ */
29
+ subdomain?: string;
35
30
  /**
36
31
  * CORS tunables. The *origins* are never here — they are read off the
37
32
  * constructs that declared an edge to this surface, which is the whole point
@@ -98,19 +93,21 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
98
93
  /**
99
94
  * What is *not* here, and why.
100
95
  *
101
- * `dependsOn`, `database`, `auditor` and `publisher` all inject a capability
96
+ * `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
102
97
  * into a handler. Putting one on the surface hands it to every route the
103
98
  * surface serves — a health check gets the database because a report needed it
104
99
  * — which is the thing least privilege forbids and the reason `.calls()` is not
105
- * spelled `dependsOn`. They belong to the endpoint, or to a factory branched
106
- * from `api.endpoints` for a group of endpoints that genuinely share them.
100
+ * spelled `dependsOn`. They belong to the endpoint, or to a branch —
101
+ * `api.database(db)` — for a group of endpoints that genuinely share them. A
102
+ * branch is a new factory; the surface config stays free of grants.
107
103
  *
108
104
  * `auth` is not here either: `.auth(construct)` already declares it, and a
109
105
  * second way to say the same thing is the duplication this whole model removes.
110
106
  *
111
107
  * What is left is what the *process* is rather than what a route may reach.
112
108
  */
113
- declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
109
+ export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
110
+ #private;
114
111
  private readonly config;
115
112
  /** Internal: how `.calls()` carries edges into the copy it returns. */
116
113
  private readonly dependencies;
@@ -146,34 +143,44 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
146
143
  readonly envParser: EnvironmentParser<{}>;
147
144
  /** The Telescope instance, when this surface was given one. */
148
145
  readonly telescope?: Telescope;
149
- constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>, /** Internal: how `.calls()` carries edges into the copy it returns. */
150
- dependencies?: readonly Dependency[], /** Internal: how `.auth()` carries the authenticator into its copy. */
151
- authenticator?: string | undefined);
146
+ constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
147
+ /** Internal: how `.calls()` carries edges into the copy it returns. */
148
+ dependencies?: readonly Dependency[],
149
+ /** Internal: how `.auth()` carries the authenticator into its copy. */
150
+ authenticator?: Authenticator | undefined);
151
+ /** `api.get('/users')` — one route on this surface. */
152
+ readonly get: Endpoints['get'];
153
+ readonly post: Endpoints['post'];
154
+ readonly put: Endpoints['put'];
155
+ readonly patch: Endpoints['patch'];
156
+ readonly delete: Endpoints['delete'];
157
+ readonly options: Endpoints['options'];
152
158
  /**
153
- * This surface's endpoint factory.
154
- *
155
- * `api.get('/users')` is the short form and covers most routes. Reach for
156
- * this one when a *group* of endpoints shares something a single route would
157
- * otherwise repeat — a database, an auditor, a publisher:
159
+ * A branch for a *group* of endpoints that shares what a single route would
160
+ * otherwise repeat — a database, an auditor, a publisher, a session:
158
161
  *
159
162
  * ```ts
160
- * const audited = api.endpoints.database(db).auditor(AuditStore);
161
- * export const createUser = audited.post('/users').handle(...);
163
+ * export const router = api.database(database);
164
+ * export const createUser = router.post('/users').handle(({ db }) => …);
162
165
  * ```
163
166
  *
164
- * A factory branched from here keeps the surface, so its endpoints still
165
- * know which API serves them. That is deliberately narrower than putting the
166
- * same thing in the surface's own config: a group opts in, where a surface
167
- * would grant it to every route it serves.
167
+ * Each returns a new factory and leaves the surface as it was. That is the
168
+ * whole difference from putting the same thing in the surface's config: a
169
+ * group opts in, where the surface would grant it to every route it serves —
170
+ * a health check handed the database because a profile endpoint needed it.
171
+ *
172
+ * `dependsOn` is deliberately not here. It is per endpoint, and on the
173
+ * surface it would read as the API depending on something, which is what
174
+ * `.calls()` and `.auth()` say instead.
168
175
  */
169
- readonly endpoints: EndpointFactory<[], '', Logger>;
170
- /** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */
171
- get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "GET", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string>;
172
- post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "POST", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string>;
173
- put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PUT", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string>;
174
- patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PATCH", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string>;
175
- delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "DELETE", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string>;
176
- options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "OPTIONS", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string>;
176
+ readonly database: Endpoints['database'];
177
+ readonly session: Endpoints['session'];
178
+ readonly auditor: Endpoints['auditor'];
179
+ readonly actor: Endpoints['actor'];
180
+ readonly authorizer: Endpoints['authorizer'];
181
+ readonly authorize: Endpoints['authorize'];
182
+ readonly rls: Endpoints['rls'];
183
+ readonly route: Endpoints['route'];
177
184
  /**
178
185
  * What authenticates this surface.
179
186
  *
@@ -183,12 +190,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
183
190
  * what a request is allowed to be. A surface with two of the first is a
184
191
  * mistake; two of the second is Tuesday.
185
192
  *
186
- * It records the id, not a client. Every endpoint consumes the same thing —
187
- * `verify(request) → Session | null` — and that is what every provider
188
- * shares, whether the server is mounted in this process, deployed beside it,
189
- * or an OIDC issuer somebody else runs.
193
+ * It declares the id, and keeps the construct: a session callback reads from
194
+ * it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
195
+ * calls the construct's `verify(headers)`. That is the one thing every
196
+ * provider shares, whether the server is mounted in this process, deployed
197
+ * beside it, or an OIDC issuer somebody else runs.
190
198
  */
191
- auth(construct: Declarable): RestApi<TName, TAuthorizers>;
199
+ auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
192
200
  /**
193
201
  * Other surfaces this one calls.
194
202
  *
@@ -215,7 +223,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
215
223
  */
216
224
  declare(): Declaration[];
217
225
  }
218
- //# sourceMappingURL=rest-api.d.ts.map
219
226
  //#endregion
220
- export { RestApi, RestApiConfig };
227
+ export type { Authenticator };
221
228
  //# sourceMappingURL=rest-api.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rest-api.d.cts","names":[],"sources":["../src/rest-api.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA2LoB,UAnJH,aAmJG,CAAA,qBAAA,SAAA,MAAA,EAAA,GAAA,SAAA,EAAA,CAAA,CAAA;EAAK;;;;;;;;;;;;;;;;;;;EAqEa,GAAA,CAAA,EA/L/B,OA+L+B;EAAA;;;;;EAIE,IAAA,CAAA,EAAA;IAIJ,MAAA,CAAA,EAAA,MAAA;IAAK,WAAA,CAAA,EAAA,OAAA;IAAA,YAAA,CAAA,EAAA,SAAA,MAAA,EAAA;IAAA,aAAA,CAAA,EAAA,SAAA,MAAA,EAAA;EAAA,CAAA;EAAA;;;;;EAIC,WAkBzB,CAAA,EA5MF,YA4ME;EAAU;;;;;;;;;AAzIJ;;;;;;;;;qBAhDH,uBAAuB;;;;;;;;;;WAUjC;;;;;;;;cAQG;;;;;;;;cAQA;;;;;;;;;;;;;;;;;cAmBA,8GAGA,WAAW;;;;;;eAEV;;;;;;;;;;;;;;;;;;mBAoBI;;;;;;;;;sBAUG;;uBAGC;kBAGhB,cAAc,gBACO,cAAc;0BAEC;;;;;;;;;;;;;;;;;;;sBAuDrB,wBAAwB;;kCAGZ,QAAK,gBAAA,oBAAA,uBAAA;mCAIJ,QAAK,gBAAA,oBAAA,wBAAA;kCAIN,QAAK,gBAAA,oBAAA,uBAAA;oCAIH,QAAK,gBAAA,oBAAA,yBAAA;qCAIJ,QAAK,gBAAA,oBAAA,0BAAA;sCAIJ,QAAK,gBAAA,oBAAA,2BAAA;;;;;;;;;;;;;;;kBAkBzB,aAAa,QAAQ,OAAO;;;;;;;;;;;;;;;6BAuBjB,eAAe,QAAQ,OAAO;;;;;;;;;;aAkB9C"}
1
+ {"version":3,"file":"rest-api.d.cts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;KAkDK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;;;;;;;;;qBAoBA,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,gBAAgB;;WAwEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,YAAY;WACZ,WAAW;WACX,KAAK;WACL,OAAO;;;;;;;;;;;;;;;;EAiBhB,KAAK,WAAW,gBAAgB,QAAQ,OAAO;;;;;;;;;;;;;;;EAuB/C,MAAM,qBAAqB,eAAe,QAAQ,OAAO;;;;;;;;;;EAkBzD,WAAW"}
@@ -1,37 +1,32 @@
1
- import "./Construct-Ct8nalEi.mjs";
2
- import "./index-D3zjrwjr.mjs";
3
- import { Declarable } from "./construct-interface-g5GM5pwR.mjs";
4
- import "./types-aKksMEWL.mjs";
5
- import { BuiltInSecuritySchemeId } from "./Endpoint-Dem2XyCu.mjs";
6
- import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-DbKmfl-q.mjs";
7
- import { AppSpec, ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
1
+ import { i as Declarable, t as Authenticator } from "./construct-interface-DluK3_da.mjs";
2
+ import { T as BuiltInSecuritySchemeId } from "./Endpoint-CwM8Rzfs.mjs";
3
+ import { t as EndpointFactory } from "./EndpointFactory-0plFjvb7.mjs";
4
+ import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
8
5
  import { EnvironmentParser } from "@geekmidas/envkit";
9
6
  import { Logger } from "@geekmidas/logger";
10
7
  import { Telescope } from "@geekmidas/telescope";
11
-
12
8
  //#region src/rest-api.d.ts
13
-
14
- interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
9
+ /** The factory a surface builds its endpoints from. */
10
+ type Endpoints = EndpointFactory<[], '', Logger>;
11
+ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
15
12
  /**
16
- * The app that serves this surface: where its source lives, which globs
17
- * find its code, how it is run.
18
- *
19
- * What makes a surface a deploy unit rather than something a deploy has to
20
- * be told about separately: one `RestApi` is one server. A `StaticSite` says
21
- * the same thing, and the two are the same kind of statement.
22
- *
23
- * Normally omitted. One RestApi is one server, always — there is no mode in
24
- * which a surface shares somebody else's container, because a surface that
25
- * gets its process by inference gets it from whatever happened to reference
26
- * it, and that was the thing worth removing.
27
- *
28
- * So this is an override and nothing else. Everything in it follows from
29
- * this construct's id — `apps/<kebab-id>` where that directory exists, the
30
- * conventional code directories under it, a port assigned in a stable
31
- * order. Write one when the layout genuinely differs:
32
- * `app: { path: 'services/api' }`.
13
+ * The app that serves this surface, relative to the workspace root —
14
+ * `'apps/api'`, or `'.'` in a single-app project.
15
+ *
16
+ * Required. It was inferred from the id (`apps/<kebab-id>`, or the root
17
+ * when no such directory existed), which meant a surface's home was
18
+ * whatever happened to be on disk. It is where the app's `package.json`
19
+ * and base `tsconfig.json` are, and which build serves this surface. It
20
+ * does not change discovery: constructs still load from the workspace's
21
+ * `constructs` glob.
33
22
  */
34
- app?: AppSpec;
23
+ path: string;
24
+ /**
25
+ * The label it answers on under a stage's domain — `api` for
26
+ * `api.myapp.com`, from `deploy.domains` — and under the project locally,
27
+ * `api.myapp.localhost`. Absent, its id kebab-cased.
28
+ */
29
+ subdomain?: string;
35
30
  /**
36
31
  * CORS tunables. The *origins* are never here — they are read off the
37
32
  * constructs that declared an edge to this surface, which is the whole point
@@ -98,19 +93,21 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
98
93
  /**
99
94
  * What is *not* here, and why.
100
95
  *
101
- * `dependsOn`, `database`, `auditor` and `publisher` all inject a capability
96
+ * `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
102
97
  * into a handler. Putting one on the surface hands it to every route the
103
98
  * surface serves — a health check gets the database because a report needed it
104
99
  * — which is the thing least privilege forbids and the reason `.calls()` is not
105
- * spelled `dependsOn`. They belong to the endpoint, or to a factory branched
106
- * from `api.endpoints` for a group of endpoints that genuinely share them.
100
+ * spelled `dependsOn`. They belong to the endpoint, or to a branch —
101
+ * `api.database(db)` — for a group of endpoints that genuinely share them. A
102
+ * branch is a new factory; the surface config stays free of grants.
107
103
  *
108
104
  * `auth` is not here either: `.auth(construct)` already declares it, and a
109
105
  * second way to say the same thing is the duplication this whole model removes.
110
106
  *
111
107
  * What is left is what the *process* is rather than what a route may reach.
112
108
  */
113
- declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
109
+ export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
110
+ #private;
114
111
  private readonly config;
115
112
  /** Internal: how `.calls()` carries edges into the copy it returns. */
116
113
  private readonly dependencies;
@@ -146,34 +143,44 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
146
143
  readonly envParser: EnvironmentParser<{}>;
147
144
  /** The Telescope instance, when this surface was given one. */
148
145
  readonly telescope?: Telescope;
149
- constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>, /** Internal: how `.calls()` carries edges into the copy it returns. */
150
- dependencies?: readonly Dependency[], /** Internal: how `.auth()` carries the authenticator into its copy. */
151
- authenticator?: string | undefined);
146
+ constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
147
+ /** Internal: how `.calls()` carries edges into the copy it returns. */
148
+ dependencies?: readonly Dependency[],
149
+ /** Internal: how `.auth()` carries the authenticator into its copy. */
150
+ authenticator?: Authenticator | undefined);
151
+ /** `api.get('/users')` — one route on this surface. */
152
+ readonly get: Endpoints['get'];
153
+ readonly post: Endpoints['post'];
154
+ readonly put: Endpoints['put'];
155
+ readonly patch: Endpoints['patch'];
156
+ readonly delete: Endpoints['delete'];
157
+ readonly options: Endpoints['options'];
152
158
  /**
153
- * This surface's endpoint factory.
154
- *
155
- * `api.get('/users')` is the short form and covers most routes. Reach for
156
- * this one when a *group* of endpoints shares something a single route would
157
- * otherwise repeat — a database, an auditor, a publisher:
159
+ * A branch for a *group* of endpoints that shares what a single route would
160
+ * otherwise repeat — a database, an auditor, a publisher, a session:
158
161
  *
159
162
  * ```ts
160
- * const audited = api.endpoints.database(db).auditor(AuditStore);
161
- * export const createUser = audited.post('/users').handle(...);
163
+ * export const router = api.database(database);
164
+ * export const createUser = router.post('/users').handle(({ db }) => …);
162
165
  * ```
163
166
  *
164
- * A factory branched from here keeps the surface, so its endpoints still
165
- * know which API serves them. That is deliberately narrower than putting the
166
- * same thing in the surface's own config: a group opts in, where a surface
167
- * would grant it to every route it serves.
167
+ * Each returns a new factory and leaves the surface as it was. That is the
168
+ * whole difference from putting the same thing in the surface's config: a
169
+ * group opts in, where the surface would grant it to every route it serves —
170
+ * a health check handed the database because a profile endpoint needed it.
171
+ *
172
+ * `dependsOn` is deliberately not here. It is per endpoint, and on the
173
+ * surface it would read as the API depending on something, which is what
174
+ * `.calls()` and `.auth()` say instead.
168
175
  */
169
- readonly endpoints: EndpointFactory<[], '', Logger>;
170
- /** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */
171
- get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "GET", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
172
- post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "POST", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
173
- put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PUT", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
174
- patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PATCH", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
175
- delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "DELETE", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
176
- options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "OPTIONS", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
176
+ readonly database: Endpoints['database'];
177
+ readonly session: Endpoints['session'];
178
+ readonly auditor: Endpoints['auditor'];
179
+ readonly actor: Endpoints['actor'];
180
+ readonly authorizer: Endpoints['authorizer'];
181
+ readonly authorize: Endpoints['authorize'];
182
+ readonly rls: Endpoints['rls'];
183
+ readonly route: Endpoints['route'];
177
184
  /**
178
185
  * What authenticates this surface.
179
186
  *
@@ -183,12 +190,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
183
190
  * what a request is allowed to be. A surface with two of the first is a
184
191
  * mistake; two of the second is Tuesday.
185
192
  *
186
- * It records the id, not a client. Every endpoint consumes the same thing —
187
- * `verify(request) → Session | null` — and that is what every provider
188
- * shares, whether the server is mounted in this process, deployed beside it,
189
- * or an OIDC issuer somebody else runs.
193
+ * It declares the id, and keeps the construct: a session callback reads from
194
+ * it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
195
+ * calls the construct's `verify(headers)`. That is the one thing every
196
+ * provider shares, whether the server is mounted in this process, deployed
197
+ * beside it, or an OIDC issuer somebody else runs.
190
198
  */
191
- auth(construct: Declarable): RestApi<TName, TAuthorizers>;
199
+ auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
192
200
  /**
193
201
  * Other surfaces this one calls.
194
202
  *
@@ -215,7 +223,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
215
223
  */
216
224
  declare(): Declaration[];
217
225
  }
218
- //# sourceMappingURL=rest-api.d.ts.map
219
226
  //#endregion
220
- export { RestApi, RestApiConfig };
227
+ export type { Authenticator };
221
228
  //# sourceMappingURL=rest-api.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rest-api.d.mts","names":[],"sources":["../src/rest-api.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA2LoB,UAnJH,aAmJG,CAAA,qBAAA,SAAA,MAAA,EAAA,GAAA,SAAA,EAAA,CAAA,CAAA;EAAK;;;;;;;;;;;;;;;;;;;EAiEc,GAAA,CAAA,EA3LhC,OA2LgC;EAAA;;;;;EAID,IAAA,CAAA,EAAA;IAAA,MAAA,CAAA,EAAA,MAAA;IAAA,WAAA,CAAA,EAAA,OAAA;IAAA,YAAA,CAAA,EAAA,SAAA,MAAA,EAAA;IAAA,aAAA,CAAA,EAAA,SAAA,MAAA,EAAA;EAAA,CAAA;EAIE;;;;;EAAA,WAAA,CAAA,EAlLzB,YAkLyB;EAAA;;;;;;;;;;;;;;;;;;EA0Bb,iBAAW,EAzLlB,YAyLkB,CAAA,MAAA,CAAA,GAzLK,uBAyLL,GAAA,MAAA;EAAK;;;;;;;;AAzIpB;WAtCb;;;;;;;;cAQG;;;;;;;;cAQA;;;;;;;;;;;;;;;;;cAmBA,8GAGA,WAAW;;;;;;eAEV;;;;;;;;;;;;;;;;;;mBAoBI;;;;;;;;;sBAUG;;uBAGC;kBAGhB,cAAc,gBACO,cAAc;0BAEC;;;;;;;;;;;;;;;;;;;sBAuDrB,wBAAwB;;kCAGZ,QAAK,gBAAA,oBAAA,uBAAA,qFAAA,0BAAA,YAAA;mCAIJ,QAAK,gBAAA,oBAAA,wBAAA,qFAAA,0BAAA,YAAA;kCAIN,QAAK,gBAAA,oBAAA,uBAAA,qFAAA,0BAAA,YAAA;oCAIH,QAAK,gBAAA,oBAAA,yBAAA,qFAAA,0BAAA,YAAA;qCAIJ,QAAK,gBAAA,oBAAA,0BAAA,qFAAA,0BAAA,YAAA;sCAIJ,QAAK,gBAAA,oBAAA,2BAAA,qFAAA,0BAAA,YAAA;;;;;;;;;;;;;;;kBAkBzB,aAAa,QAAQ,OAAO;;;;;;;;;;;;;;;6BAuBjB,eAAe,QAAQ,OAAO;;;;;;;;;;aAkB9C"}
1
+ {"version":3,"file":"rest-api.d.mts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;KAkDK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;;;;;;;;;qBAoBA,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,gBAAgB;;WAwEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,YAAY;WACZ,WAAW;WACX,KAAK;WACL,OAAO;;;;;;;;;;;;;;;;EAiBhB,KAAK,WAAW,gBAAgB,QAAQ,OAAO;;;;;;;;;;;;;;;EAuB/C,MAAM,qBAAqB,eAAe,QAAQ,OAAO;;;;;;;;;;EAkBzD,WAAW"}
package/dist/rest-api.mjs CHANGED
@@ -1,23 +1,19 @@
1
- import "./Construct-BD5neF7w.mjs";
2
- import { edgeTo } from "./construct-interface-Z4CpS8tK.mjs";
3
- import "./functions-Ck21Uyq0.mjs";
4
- import { EndpointFactory } from "./EndpointFactory-b4ituq-s.mjs";
5
- import "./clone-DblgEZZa.mjs";
6
- import "./Endpoint-Dij_wOcc.mjs";
7
- import { envParserFor } from "./surfaceEnv-C3Ktahea.mjs";
1
+ import { edgeTo } from "./construct-interface.mjs";
2
+ import { o as getSecurityScheme, t as EndpointFactory } from "./EndpointFactory-DR1rebok.mjs";
3
+ import { n as envParserFor } from "./surfaceEnv-wMT5QzgZ.mjs";
8
4
  import { canonicalId, provideKey } from "@geekmidas/manifest";
9
5
  import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
10
-
11
6
  //#region src/rest-api.ts
12
7
  /**
13
8
  * What is *not* here, and why.
14
9
  *
15
- * `dependsOn`, `database`, `auditor` and `publisher` all inject a capability
10
+ * `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
16
11
  * into a handler. Putting one on the surface hands it to every route the
17
12
  * surface serves — a health check gets the database because a report needed it
18
13
  * — which is the thing least privilege forbids and the reason `.calls()` is not
19
- * spelled `dependsOn`. They belong to the endpoint, or to a factory branched
20
- * from `api.endpoints` for a group of endpoints that genuinely share them.
14
+ * spelled `dependsOn`. They belong to the endpoint, or to a branch —
15
+ * `api.database(db)` — for a group of endpoints that genuinely share them. A
16
+ * branch is a new factory; the surface config stays free of grants.
21
17
  *
22
18
  * `auth` is not here either: `.auth(construct)` already declares it, and a
23
19
  * second way to say the same thing is the duplication this whole model removes.
@@ -25,6 +21,9 @@ import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
25
21
  * What is left is what the *process* is rather than what a route may reach.
26
22
  */
27
23
  var RestApi = class RestApi {
24
+ config;
25
+ dependencies;
26
+ authenticator;
28
27
  id;
29
28
  /**
30
29
  * Declared once and read by both `declare()` and anything that consumes this
@@ -68,53 +67,79 @@ var RestApi = class RestApi {
68
67
  id: canonical,
69
68
  envParser: config.envParser
70
69
  } : void 0);
71
- this.endpoints = new EndpointFactory({
70
+ this.#endpoints = new EndpointFactory({
72
71
  defaultLogger: this.logger,
73
- ...config.authorizers ? { availableAuthorizers: config.authorizers.map((name) => ({ name })) } : {},
72
+ ...config.authorizers ? { availableAuthorizers: config.authorizers.map((name) => {
73
+ const securityScheme = getSecurityScheme(name);
74
+ return securityScheme ? {
75
+ name,
76
+ securityScheme
77
+ } : { name };
78
+ }) } : {},
74
79
  ...config.defaultAuthorizer && config.defaultAuthorizer !== "none" ? { defaultAuthorizerName: config.defaultAuthorizer } : {},
75
80
  surface: {
76
81
  id: this.id,
77
- envParser: this.envParser
82
+ envParser: this.envParser,
83
+ ...authenticator ? { auth: authenticator } : {}
78
84
  }
79
85
  });
86
+ const endpoints = this.#endpoints;
87
+ this.get = endpoints.get.bind(endpoints);
88
+ this.post = endpoints.post.bind(endpoints);
89
+ this.put = endpoints.put.bind(endpoints);
90
+ this.patch = endpoints.patch.bind(endpoints);
91
+ this.delete = endpoints.delete.bind(endpoints);
92
+ this.options = endpoints.options.bind(endpoints);
93
+ this.database = endpoints.database.bind(endpoints);
94
+ this.session = endpoints.session.bind(endpoints);
95
+ this.auditor = endpoints.auditor.bind(endpoints);
96
+ this.actor = endpoints.actor.bind(endpoints);
97
+ this.authorizer = endpoints.authorizer.bind(endpoints);
98
+ this.authorize = endpoints.authorize.bind(endpoints);
99
+ this.rls = endpoints.rls.bind(endpoints);
100
+ this.route = endpoints.route.bind(endpoints);
80
101
  }
81
102
  /**
82
- * This surface's endpoint factory.
103
+ * This surface's endpoint factory, which every method below starts from.
83
104
  *
84
- * `api.get('/users')` is the short form and covers most routes. Reach for
85
- * this one when a *group* of endpoints shares something a single route would
86
- * otherwise repeat — a database, an auditor, a publisher:
105
+ * Private: a surface *is* where endpoints are built, so there is no second
106
+ * object to reach through first. `api.database(db)` said the same
107
+ * thing as `api.database(db)` with one more word to learn.
108
+ */
109
+ #endpoints;
110
+ /** `api.get('/users')` — one route on this surface. */
111
+ get;
112
+ post;
113
+ put;
114
+ patch;
115
+ delete;
116
+ options;
117
+ /**
118
+ * A branch for a *group* of endpoints that shares what a single route would
119
+ * otherwise repeat — a database, an auditor, a publisher, a session:
87
120
  *
88
121
  * ```ts
89
- * const audited = api.endpoints.database(db).auditor(AuditStore);
90
- * export const createUser = audited.post('/users').handle(...);
122
+ * export const router = api.database(database);
123
+ * export const createUser = router.post('/users').handle(({ db }) => …);
91
124
  * ```
92
125
  *
93
- * A factory branched from here keeps the surface, so its endpoints still
94
- * know which API serves them. That is deliberately narrower than putting the
95
- * same thing in the surface's own config: a group opts in, where a surface
96
- * would grant it to every route it serves.
126
+ * Each returns a new factory and leaves the surface as it was. That is the
127
+ * whole difference from putting the same thing in the surface's config: a
128
+ * group opts in, where the surface would grant it to every route it serves —
129
+ * a health check handed the database because a profile endpoint needed it.
130
+ *
131
+ * `dependsOn` is deliberately not here. It is per endpoint, and on the
132
+ * surface it would read as the API depending on something, which is what
133
+ * `.calls()` and `.auth()` say instead.
97
134
  */
98
- endpoints;
99
- /** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */
100
- get(path) {
101
- return this.endpoints.get(path);
102
- }
103
- post(path) {
104
- return this.endpoints.post(path);
105
- }
106
- put(path) {
107
- return this.endpoints.put(path);
108
- }
109
- patch(path) {
110
- return this.endpoints.patch(path);
111
- }
112
- delete(path) {
113
- return this.endpoints.delete(path);
114
- }
115
- options(path) {
116
- return this.endpoints.options(path);
117
- }
135
+ database;
136
+ session;
137
+ auditor;
138
+ actor;
139
+ authorizer;
140
+ authorize;
141
+ rls;
142
+ route;
118
143
  /**
119
144
  * What authenticates this surface.
120
145
  *
@@ -124,13 +149,14 @@ var RestApi = class RestApi {
124
149
  * what a request is allowed to be. A surface with two of the first is a
125
150
  * mistake; two of the second is Tuesday.
126
151
  *
127
- * It records the id, not a client. Every endpoint consumes the same thing —
128
- * `verify(request) → Session | null` — and that is what every provider
129
- * shares, whether the server is mounted in this process, deployed beside it,
130
- * or an OIDC issuer somebody else runs.
152
+ * It declares the id, and keeps the construct: a session callback reads from
153
+ * it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
154
+ * calls the construct's `verify(headers)`. That is the one thing every
155
+ * provider shares, whether the server is mounted in this process, deployed
156
+ * beside it, or an OIDC issuer somebody else runs.
131
157
  */
132
158
  auth(construct) {
133
- return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct.id);
159
+ return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct);
134
160
  }
135
161
  /**
136
162
  * Other surfaces this one calls.
@@ -162,12 +188,11 @@ var RestApi = class RestApi {
162
188
  return [{
163
189
  kind: "rest-api",
164
190
  id: this.id,
165
- app: {
166
- ...this.config.app,
167
- ...this.config.telescope ? { telescope: true } : {}
168
- },
191
+ path: this.config.path,
192
+ ...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
193
+ ...this.config.telescope ? { telescope: true } : {},
169
194
  ...this.config.cors ? { cors: this.config.cors } : {},
170
- ...this.authenticator ? { auth: this.authenticator } : {},
195
+ ...this.authenticator ? { auth: this.authenticator.id } : {},
171
196
  endpoints: [],
172
197
  ...this.dependencies.length ? { calls: this.dependencies } : {},
173
198
  ...this.config.authorizers?.length ? { authorizers: this.config.authorizers } : {},
@@ -180,7 +205,7 @@ var RestApi = class RestApi {
180
205
  }];
181
206
  }
182
207
  };
183
-
184
208
  //#endregion
185
209
  export { RestApi };
210
+
186
211
  //# sourceMappingURL=rest-api.mjs.map