@geekmidas/constructs 10.0.0-alpha.3 → 10.0.0-alpha.31

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 (341) hide show
  1. package/README.md +52 -3
  2. package/dist/{Construct-Ct8nalEi.d.mts → Construct-DTqYvkPG.d.cts} +11 -13
  3. package/dist/Construct-DTqYvkPG.d.cts.map +1 -0
  4. package/dist/{Construct-BD5neF7w.mjs → Construct-Detz65RA.mjs} +31 -29
  5. package/dist/Construct-Detz65RA.mjs.map +1 -0
  6. package/dist/{Construct-C0ijr2qp.d.cts → Construct-pVadmURD.d.mts} +10 -12
  7. package/dist/Construct-pVadmURD.d.mts.map +1 -0
  8. package/dist/{Construct-CyS3RpTL.cjs → Construct-yG9Sw-5p.cjs} +51 -43
  9. package/dist/Construct-yG9Sw-5p.cjs.map +1 -0
  10. package/dist/{Cron-ByxdOfpE.d.mts → Cron-B_iuyNxr.d.mts} +17 -6
  11. package/dist/Cron-B_iuyNxr.d.mts.map +1 -0
  12. package/dist/{Cron-Wqh464aO.d.cts → Cron-CA2oa2nC.d.cts} +16 -5
  13. package/dist/Cron-CA2oa2nC.d.cts.map +1 -0
  14. package/dist/{CronBuilder-BL0AP6fs.d.mts → CronBuilder-BIKCLWu7.d.mts} +7 -10
  15. package/dist/CronBuilder-BIKCLWu7.d.mts.map +1 -0
  16. package/dist/{CronBuilder-BmABazzH.mjs → CronBuilder-BRkzUOAs.mjs} +35 -17
  17. package/dist/CronBuilder-BRkzUOAs.mjs.map +1 -0
  18. package/dist/{CronBuilder-BqpEzMPQ.d.cts → CronBuilder-B_KqaodP.d.cts} +6 -9
  19. package/dist/CronBuilder-B_KqaodP.d.cts.map +1 -0
  20. package/dist/{CronBuilder-CkXPJiGO.cjs → CronBuilder-BbnT7tqo.cjs} +45 -27
  21. package/dist/CronBuilder-BbnT7tqo.cjs.map +1 -0
  22. package/dist/{Endpoint-2Wg7T7Cq.d.mts → Endpoint-BojvdQoh.d.mts} +63 -84
  23. package/dist/Endpoint-BojvdQoh.d.mts.map +1 -0
  24. package/dist/{Endpoint-VIOpSo0S.mjs → Endpoint-DO332Dnm.mjs} +117 -109
  25. package/dist/Endpoint-DO332Dnm.mjs.map +1 -0
  26. package/dist/{Endpoint-BiaaMEn_.cjs → Endpoint-QKuFg5gs.cjs} +145 -131
  27. package/dist/Endpoint-QKuFg5gs.cjs.map +1 -0
  28. package/dist/{Endpoint-CH9Fn1AD.d.cts → Endpoint-xNGuv2Fq.d.cts} +61 -82
  29. package/dist/Endpoint-xNGuv2Fq.d.cts.map +1 -0
  30. package/dist/{EndpointFactory-DTTCkGEL.mjs → EndpointFactory-B9HAjDAP.mjs} +26 -32
  31. package/dist/EndpointFactory-B9HAjDAP.mjs.map +1 -0
  32. package/dist/{EndpointFactory-ChxLZllA.cjs → EndpointFactory-BmO0WnXE.cjs} +63 -69
  33. package/dist/EndpointFactory-BmO0WnXE.cjs.map +1 -0
  34. package/dist/{index-BxHDdy6a.d.mts → EndpointFactory-CaYTrUOO.d.mts} +12 -92
  35. package/dist/EndpointFactory-CaYTrUOO.d.mts.map +1 -0
  36. package/dist/{index-V2nksZIJ.d.cts → EndpointFactory-DyT1yOJL.d.cts} +10 -90
  37. package/dist/EndpointFactory-DyT1yOJL.d.cts.map +1 -0
  38. package/dist/{HonoEndpointAdaptor-NKQQQbBY.mjs → HonoEndpointAdaptor-CiqAZ5Mt.mjs} +40 -47
  39. package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs.map → HonoEndpointAdaptor-CiqAZ5Mt.mjs.map} +1 -1
  40. package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs → HonoEndpointAdaptor-DoEQdC3r.cjs} +48 -52
  41. package/dist/HonoEndpointAdaptor-DoEQdC3r.cjs.map +1 -0
  42. package/dist/Queue-B7yRXQmL.cjs +124 -0
  43. package/dist/Queue-B7yRXQmL.cjs.map +1 -0
  44. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-Bhzi2WQC.d.cts} +8 -9
  45. package/dist/Queue-Bhzi2WQC.d.cts.map +1 -0
  46. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-BoUA-e83.d.mts} +9 -10
  47. package/dist/Queue-BoUA-e83.d.mts.map +1 -0
  48. package/dist/Queue-DpKTLl6E.mjs +119 -0
  49. package/dist/Queue-DpKTLl6E.mjs.map +1 -0
  50. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-CIO3pwji.d.mts} +7 -8
  51. package/dist/Subscriber-CIO3pwji.d.mts.map +1 -0
  52. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-DQCaiOXF.d.cts} +7 -8
  53. package/dist/Subscriber-DQCaiOXF.d.cts.map +1 -0
  54. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-B4YRTBng.mjs} +16 -10
  55. package/dist/SubscriberBuilder-B4YRTBng.mjs.map +1 -0
  56. package/dist/{SubscriberBuilder-Dptmo-1A.d.mts → SubscriberBuilder-C2FRfd26.d.mts} +8 -11
  57. package/dist/SubscriberBuilder-C2FRfd26.d.mts.map +1 -0
  58. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2bCOuPT.cjs} +28 -23
  59. package/dist/SubscriberBuilder-C2bCOuPT.cjs.map +1 -0
  60. package/dist/{SubscriberBuilder-waNhzjSM.d.cts → SubscriberBuilder-CjDGSTZc.d.cts} +7 -10
  61. package/dist/SubscriberBuilder-CjDGSTZc.d.cts.map +1 -0
  62. package/dist/Topic-Ct3Le8Wt.mjs +103 -0
  63. package/dist/Topic-Ct3Le8Wt.mjs.map +1 -0
  64. package/dist/Topic-D5rlM9wS.cjs +108 -0
  65. package/dist/Topic-D5rlM9wS.cjs.map +1 -0
  66. package/dist/{Topic-19QeHBIR.d.cts → Topic-D6blllEn.d.cts} +5 -7
  67. package/dist/Topic-D6blllEn.d.cts.map +1 -0
  68. package/dist/{Topic-DuFeqkBh.d.mts → Topic-DVvheJ_-.d.mts} +6 -8
  69. package/dist/Topic-DVvheJ_-.d.mts.map +1 -0
  70. package/dist/adaptors/aws.cjs +87 -106
  71. package/dist/adaptors/aws.cjs.map +1 -1
  72. package/dist/adaptors/aws.d.cts +14 -27
  73. package/dist/adaptors/aws.d.cts.map +1 -1
  74. package/dist/adaptors/aws.d.mts +16 -29
  75. package/dist/adaptors/aws.d.mts.map +1 -1
  76. package/dist/adaptors/aws.mjs +60 -81
  77. package/dist/adaptors/aws.mjs.map +1 -1
  78. package/dist/adaptors/hono.cjs +3 -10
  79. package/dist/adaptors/hono.d.cts +5 -13
  80. package/dist/adaptors/hono.d.cts.map +1 -1
  81. package/dist/adaptors/hono.d.mts +7 -15
  82. package/dist/adaptors/hono.d.mts.map +1 -1
  83. package/dist/adaptors/hono.mjs +2 -10
  84. package/dist/adaptors/testing.cjs +396 -82
  85. package/dist/adaptors/testing.cjs.map +1 -1
  86. package/dist/adaptors/testing.d.cts +150 -33
  87. package/dist/adaptors/testing.d.cts.map +1 -1
  88. package/dist/adaptors/testing.d.mts +151 -34
  89. package/dist/adaptors/testing.d.mts.map +1 -1
  90. package/dist/adaptors/testing.mjs +368 -63
  91. package/dist/adaptors/testing.mjs.map +1 -1
  92. package/dist/auth-Bmo1wSQF.d.cts +177 -0
  93. package/dist/auth-Bmo1wSQF.d.cts.map +1 -0
  94. package/dist/auth-CJ5dp7T7.d.mts +177 -0
  95. package/dist/auth-CJ5dp7T7.d.mts.map +1 -0
  96. package/dist/auth.cjs +113 -28
  97. package/dist/auth.cjs.map +1 -1
  98. package/dist/auth.d.cts +2 -108
  99. package/dist/auth.d.mts +2 -108
  100. package/dist/auth.mjs +103 -20
  101. package/dist/auth.mjs.map +1 -1
  102. package/dist/{cache-BrRz3fEB.d.mts → cache-B2s0b-ss.d.mts} +3 -6
  103. package/dist/cache-B2s0b-ss.d.mts.map +1 -0
  104. package/dist/{cache-BtZY_tHe.d.cts → cache-CYe2Kzjc.d.cts} +3 -6
  105. package/dist/cache-CYe2Kzjc.d.cts.map +1 -0
  106. package/dist/cache.cjs +68 -2
  107. package/dist/cache.cjs.map +1 -0
  108. package/dist/cache.d.cts +1 -2
  109. package/dist/cache.d.mts +1 -2
  110. package/dist/cache.mjs +67 -2
  111. package/dist/cache.mjs.map +1 -0
  112. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  113. package/dist/clone-EKNovYHu.mjs.map +1 -0
  114. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  115. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  116. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-D2gesxos.d.mts} +28 -10
  117. package/dist/construct-interface-D2gesxos.d.mts.map +1 -0
  118. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-DPusCUSQ.d.cts} +28 -10
  119. package/dist/construct-interface-DPusCUSQ.d.cts.map +1 -0
  120. package/dist/construct-interface.cjs +116 -7
  121. package/dist/construct-interface.cjs.map +1 -0
  122. package/dist/construct-interface.d.cts +2 -2
  123. package/dist/construct-interface.d.mts +2 -2
  124. package/dist/construct-interface.mjs +108 -2
  125. package/dist/construct-interface.mjs.map +1 -0
  126. package/dist/credential.cjs +43 -9
  127. package/dist/credential.cjs.map +1 -1
  128. package/dist/credential.d.cts +5 -8
  129. package/dist/credential.d.cts.map +1 -1
  130. package/dist/credential.d.mts +5 -8
  131. package/dist/credential.d.mts.map +1 -1
  132. package/dist/credential.mjs +36 -2
  133. package/dist/credential.mjs.map +1 -1
  134. package/dist/crons/index.cjs +68 -10
  135. package/dist/crons/index.cjs.map +1 -1
  136. package/dist/crons/index.d.cts +32 -14
  137. package/dist/crons/index.d.cts.map +1 -1
  138. package/dist/crons/index.d.mts +32 -14
  139. package/dist/crons/index.d.mts.map +1 -1
  140. package/dist/crons/index.mjs +66 -10
  141. package/dist/crons/index.mjs.map +1 -1
  142. package/dist/database/kysely.cjs +40 -15
  143. package/dist/database/kysely.cjs.map +1 -1
  144. package/dist/database/kysely.d.cts +2 -152
  145. package/dist/database/kysely.d.mts +2 -152
  146. package/dist/database/kysely.mjs +28 -5
  147. package/dist/database/kysely.mjs.map +1 -1
  148. package/dist/email.cjs +25 -12
  149. package/dist/email.cjs.map +1 -1
  150. package/dist/email.d.cts +3 -7
  151. package/dist/email.d.cts.map +1 -1
  152. package/dist/email.d.mts +3 -7
  153. package/dist/email.d.mts.map +1 -1
  154. package/dist/email.mjs +16 -3
  155. package/dist/email.mjs.map +1 -1
  156. package/dist/endpoints/index.cjs +7 -10
  157. package/dist/endpoints/index.d.cts +60 -7
  158. package/dist/endpoints/index.d.cts.map +1 -0
  159. package/dist/endpoints/index.d.mts +60 -7
  160. package/dist/endpoints/index.d.mts.map +1 -0
  161. package/dist/endpoints/index.mjs +5 -10
  162. package/dist/file-server.cjs +42 -10
  163. package/dist/file-server.cjs.map +1 -1
  164. package/dist/file-server.d.cts +6 -10
  165. package/dist/file-server.d.cts.map +1 -1
  166. package/dist/file-server.d.mts +6 -10
  167. package/dist/file-server.d.mts.map +1 -1
  168. package/dist/file-server.mjs +34 -2
  169. package/dist/file-server.mjs.map +1 -1
  170. package/dist/functions/index.cjs +2 -6
  171. package/dist/functions/index.d.cts +2 -4
  172. package/dist/functions/index.d.mts +2 -4
  173. package/dist/functions/index.mjs +2 -6
  174. package/dist/{functions-Bd3TPxid.cjs → functions-DKN6aQWJ.cjs} +325 -268
  175. package/dist/functions-DKN6aQWJ.cjs.map +1 -0
  176. package/dist/{functions-Cxbo-pEd.mjs → functions-DlFm8HmH.mjs} +298 -238
  177. package/dist/functions-DlFm8HmH.mjs.map +1 -0
  178. package/dist/{index-JSf9xNIJ.d.cts → index-BI23K3wy.d.cts} +17 -22
  179. package/dist/index-BI23K3wy.d.cts.map +1 -0
  180. package/dist/index-CeEtxDmK.d.cts +79 -0
  181. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  182. package/dist/index-CeEtxDmK.d.mts +79 -0
  183. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  184. package/dist/index-fnpjXiA-.d.mts +26 -0
  185. package/dist/index-fnpjXiA-.d.mts.map +1 -0
  186. package/dist/index-tE_119SX.d.cts +26 -0
  187. package/dist/index-tE_119SX.d.cts.map +1 -0
  188. package/dist/{index-CubPzHd9.d.mts → index-yb3fXNyH.d.mts} +18 -23
  189. package/dist/index-yb3fXNyH.d.mts.map +1 -0
  190. package/dist/index.cjs +3 -3
  191. package/dist/index.d.cts +4 -4
  192. package/dist/index.d.mts +4 -4
  193. package/dist/index.mjs +2 -3
  194. package/dist/kysely-CEVXacPN.d.cts +159 -0
  195. package/dist/kysely-CEVXacPN.d.cts.map +1 -0
  196. package/dist/kysely-mcTdPNhl.d.mts +159 -0
  197. package/dist/kysely-mcTdPNhl.d.mts.map +1 -0
  198. package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-BHtcqgz2.mjs} +22 -25
  199. package/dist/lazyAccessors-BHtcqgz2.mjs.map +1 -0
  200. package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-Dx9NLwJZ.cjs} +72 -76
  201. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +1 -0
  202. package/dist/object-storage.cjs +18 -10
  203. package/dist/object-storage.cjs.map +1 -1
  204. package/dist/object-storage.d.cts +3 -7
  205. package/dist/object-storage.d.cts.map +1 -1
  206. package/dist/object-storage.d.mts +3 -7
  207. package/dist/object-storage.d.mts.map +1 -1
  208. package/dist/object-storage.mjs +11 -3
  209. package/dist/object-storage.mjs.map +1 -1
  210. package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
  211. package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
  212. package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
  213. package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
  214. package/dist/queue/index.cjs +9 -118
  215. package/dist/queue/index.cjs.map +1 -1
  216. package/dist/queue/index.d.cts +8 -15
  217. package/dist/queue/index.d.cts.map +1 -1
  218. package/dist/queue/index.d.mts +8 -15
  219. package/dist/queue/index.d.mts.map +1 -1
  220. package/dist/queue/index.mjs +5 -114
  221. package/dist/queue/index.mjs.map +1 -1
  222. package/dist/rest-api.cjs +88 -62
  223. package/dist/rest-api.cjs.map +1 -1
  224. package/dist/rest-api.d.cts +62 -60
  225. package/dist/rest-api.d.cts.map +1 -1
  226. package/dist/rest-api.d.mts +62 -60
  227. package/dist/rest-api.d.mts.map +1 -1
  228. package/dist/rest-api.mjs +80 -54
  229. package/dist/rest-api.mjs.map +1 -1
  230. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  231. package/dist/site.cjs +33 -9
  232. package/dist/site.cjs.map +1 -1
  233. package/dist/site.d.cts +11 -22
  234. package/dist/site.d.cts.map +1 -1
  235. package/dist/site.d.mts +11 -22
  236. package/dist/site.d.mts.map +1 -1
  237. package/dist/site.mjs +29 -5
  238. package/dist/site.mjs.map +1 -1
  239. package/dist/subscribers/index.cjs +2 -11
  240. package/dist/subscribers/index.d.cts +3 -14
  241. package/dist/subscribers/index.d.mts +3 -14
  242. package/dist/subscribers/index.mjs +2 -11
  243. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  244. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  245. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  246. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  247. package/dist/{telemetry-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
  248. package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
  249. package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
  250. package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
  251. package/dist/topic/index.cjs +8 -107
  252. package/dist/topic/index.cjs.map +1 -1
  253. package/dist/topic/index.d.cts +3 -32
  254. package/dist/topic/index.d.mts +3 -32
  255. package/dist/topic/index.mjs +4 -103
  256. package/dist/topic/index.mjs.map +1 -1
  257. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  258. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  259. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  260. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  261. package/dist/types.d.cts +1 -1
  262. package/dist/types.d.mts +1 -1
  263. package/dist/types.mjs +1 -0
  264. package/dist/worker.cjs +109 -35
  265. package/dist/worker.cjs.map +1 -1
  266. package/dist/worker.d.cts +87 -42
  267. package/dist/worker.d.cts.map +1 -1
  268. package/dist/worker.d.mts +87 -42
  269. package/dist/worker.d.mts.map +1 -1
  270. package/dist/worker.mjs +104 -30
  271. package/dist/worker.mjs.map +1 -1
  272. package/package.json +59 -55
  273. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  274. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  275. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  276. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  277. package/dist/Cron-ByxdOfpE.d.mts.map +0 -1
  278. package/dist/Cron-Wqh464aO.d.cts.map +0 -1
  279. package/dist/CronBuilder-BL0AP6fs.d.mts.map +0 -1
  280. package/dist/CronBuilder-BmABazzH.mjs.map +0 -1
  281. package/dist/CronBuilder-BqpEzMPQ.d.cts.map +0 -1
  282. package/dist/CronBuilder-CkXPJiGO.cjs.map +0 -1
  283. package/dist/Endpoint-2Wg7T7Cq.d.mts.map +0 -1
  284. package/dist/Endpoint-BiaaMEn_.cjs.map +0 -1
  285. package/dist/Endpoint-CH9Fn1AD.d.cts.map +0 -1
  286. package/dist/Endpoint-VIOpSo0S.mjs.map +0 -1
  287. package/dist/EndpointFactory-ChxLZllA.cjs.map +0 -1
  288. package/dist/EndpointFactory-DTTCkGEL.mjs.map +0 -1
  289. package/dist/HonoEndpointAdaptor-NKQQQbBY.mjs.map +0 -1
  290. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  291. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  292. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  293. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  294. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  295. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  296. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  297. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  298. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  299. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  300. package/dist/auth.d.cts.map +0 -1
  301. package/dist/auth.d.mts.map +0 -1
  302. package/dist/cache-0ANvRQnD.mjs +0 -51
  303. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  304. package/dist/cache-3WSvAulx.cjs +0 -57
  305. package/dist/cache-3WSvAulx.cjs.map +0 -1
  306. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  307. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  308. package/dist/clone-DblgEZZa.mjs.map +0 -1
  309. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  310. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  311. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  312. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  313. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  314. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  315. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  316. package/dist/database/kysely.d.cts.map +0 -1
  317. package/dist/database/kysely.d.mts.map +0 -1
  318. package/dist/functions-Bd3TPxid.cjs.map +0 -1
  319. package/dist/functions-Cxbo-pEd.mjs.map +0 -1
  320. package/dist/index-BxHDdy6a.d.mts.map +0 -1
  321. package/dist/index-CubPzHd9.d.mts.map +0 -1
  322. package/dist/index-JSf9xNIJ.d.cts.map +0 -1
  323. package/dist/index-V2nksZIJ.d.cts.map +0 -1
  324. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  325. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  326. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  327. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  328. package/dist/subscribers/index.cjs.map +0 -1
  329. package/dist/subscribers/index.d.cts.map +0 -1
  330. package/dist/subscribers/index.d.mts.map +0 -1
  331. package/dist/subscribers/index.mjs.map +0 -1
  332. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  333. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  334. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  335. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  336. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  337. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  338. package/dist/topic/index.d.cts.map +0 -1
  339. package/dist/topic/index.d.mts.map +0 -1
  340. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  341. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -1,37 +1,26 @@
1
- import "./Construct-C0ijr2qp.cjs";
2
- import "./index-JSf9xNIJ.cjs";
3
- import { Declarable } from "./construct-interface-D9d4Gm4p.cjs";
4
- import "./types-BlAkSuGI.cjs";
5
- import { BuiltInSecuritySchemeId } from "./Endpoint-CH9Fn1AD.cjs";
6
- import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-V2nksZIJ.cjs";
1
+ import { i as Declarable, t as Authenticator } from "./construct-interface-DPusCUSQ.cjs";
2
+ import { T as BuiltInSecuritySchemeId } from "./Endpoint-xNGuv2Fq.cjs";
3
+ import { t as EndpointFactory } from "./EndpointFactory-DyT1yOJL.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;
35
24
  /**
36
25
  * CORS tunables. The *origins* are never here — they are read off the
37
26
  * constructs that declared an edge to this surface, which is the whole point
@@ -102,15 +91,17 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
102
91
  * into a handler. Putting one on the surface hands it to every route the
103
92
  * surface serves — a health check gets the database because a report needed it
104
93
  * — 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.
94
+ * spelled `dependsOn`. They belong to the endpoint, or to a branch —
95
+ * `api.database(db)` — for a group of endpoints that genuinely share them. A
96
+ * branch is a new factory; the surface config stays free of grants.
107
97
  *
108
98
  * `auth` is not here either: `.auth(construct)` already declares it, and a
109
99
  * second way to say the same thing is the duplication this whole model removes.
110
100
  *
111
101
  * What is left is what the *process* is rather than what a route may reach.
112
102
  */
113
- declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
103
+ export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
104
+ #private;
114
105
  private readonly config;
115
106
  /** Internal: how `.calls()` carries edges into the copy it returns. */
116
107
  private readonly dependencies;
@@ -146,34 +137,45 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
146
137
  readonly envParser: EnvironmentParser<{}>;
147
138
  /** The Telescope instance, when this surface was given one. */
148
139
  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);
140
+ constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
141
+ /** Internal: how `.calls()` carries edges into the copy it returns. */
142
+ dependencies?: readonly Dependency[],
143
+ /** Internal: how `.auth()` carries the authenticator into its copy. */
144
+ authenticator?: Authenticator | undefined);
145
+ /** `api.get('/users')` — one route on this surface. */
146
+ readonly get: Endpoints['get'];
147
+ readonly post: Endpoints['post'];
148
+ readonly put: Endpoints['put'];
149
+ readonly patch: Endpoints['patch'];
150
+ readonly delete: Endpoints['delete'];
151
+ readonly options: Endpoints['options'];
152
152
  /**
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:
153
+ * A branch for a *group* of endpoints that shares what a single route would
154
+ * otherwise repeat — a database, an auditor, a publisher, a session:
158
155
  *
159
156
  * ```ts
160
- * const audited = api.endpoints.database(db).auditor(AuditStore);
161
- * export const createUser = audited.post('/users').handle(...);
157
+ * export const router = api.database(database);
158
+ * export const createUser = router.post('/users').handle(({ db }) => …);
162
159
  * ```
163
160
  *
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.
161
+ * Each returns a new factory and leaves the surface as it was. That is the
162
+ * whole difference from putting the same thing in the surface's config: a
163
+ * group opts in, where the surface would grant it to every route it serves —
164
+ * a health check handed the database because a profile endpoint needed it.
165
+ *
166
+ * `dependsOn` is deliberately not here. It is per endpoint, and on the
167
+ * surface it would read as the API depending on something, which is what
168
+ * `.calls()` and `.auth()` say instead.
168
169
  */
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>;
170
+ readonly database: Endpoints['database'];
171
+ readonly session: Endpoints['session'];
172
+ readonly auditor: Endpoints['auditor'];
173
+ readonly actor: Endpoints['actor'];
174
+ readonly publisher: Endpoints['publisher'];
175
+ readonly authorizer: Endpoints['authorizer'];
176
+ readonly authorize: Endpoints['authorize'];
177
+ readonly rls: Endpoints['rls'];
178
+ readonly route: Endpoints['route'];
177
179
  /**
178
180
  * What authenticates this surface.
179
181
  *
@@ -183,12 +185,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
183
185
  * what a request is allowed to be. A surface with two of the first is a
184
186
  * mistake; two of the second is Tuesday.
185
187
  *
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.
188
+ * It declares the id, and keeps the construct: a session callback reads from
189
+ * it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
190
+ * calls the construct's `verify(headers)`. That is the one thing every
191
+ * provider shares, whether the server is mounted in this process, deployed
192
+ * beside it, or an OIDC issuer somebody else runs.
190
193
  */
191
- auth(construct: Declarable): RestApi<TName, TAuthorizers>;
194
+ auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
192
195
  /**
193
196
  * Other surfaces this one calls.
194
197
  *
@@ -215,7 +218,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
215
218
  */
216
219
  declare(): Declaration[];
217
220
  }
218
- //# sourceMappingURL=rest-api.d.ts.map
219
221
  //#endregion
220
- export { RestApi, RestApiConfig };
222
+ export type { Authenticator };
221
223
  //# 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;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;;WAyEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,WAAW;WACX,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,26 @@
1
- import "./Construct-Ct8nalEi.mjs";
2
- import "./index-CubPzHd9.mjs";
3
- import { Declarable } from "./construct-interface-g5GM5pwR.mjs";
4
- import "./types-aKksMEWL.mjs";
5
- import { BuiltInSecuritySchemeId } from "./Endpoint-2Wg7T7Cq.mjs";
6
- import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-BxHDdy6a.mjs";
7
- import { AppSpec, ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
1
+ import { i as Declarable, t as Authenticator } from "./construct-interface-D2gesxos.mjs";
2
+ import { T as BuiltInSecuritySchemeId } from "./Endpoint-BojvdQoh.mjs";
3
+ import { t as EndpointFactory } from "./EndpointFactory-CaYTrUOO.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;
35
24
  /**
36
25
  * CORS tunables. The *origins* are never here — they are read off the
37
26
  * constructs that declared an edge to this surface, which is the whole point
@@ -102,15 +91,17 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
102
91
  * into a handler. Putting one on the surface hands it to every route the
103
92
  * surface serves — a health check gets the database because a report needed it
104
93
  * — 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.
94
+ * spelled `dependsOn`. They belong to the endpoint, or to a branch —
95
+ * `api.database(db)` — for a group of endpoints that genuinely share them. A
96
+ * branch is a new factory; the surface config stays free of grants.
107
97
  *
108
98
  * `auth` is not here either: `.auth(construct)` already declares it, and a
109
99
  * second way to say the same thing is the duplication this whole model removes.
110
100
  *
111
101
  * What is left is what the *process* is rather than what a route may reach.
112
102
  */
113
- declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
103
+ export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
104
+ #private;
114
105
  private readonly config;
115
106
  /** Internal: how `.calls()` carries edges into the copy it returns. */
116
107
  private readonly dependencies;
@@ -146,34 +137,45 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
146
137
  readonly envParser: EnvironmentParser<{}>;
147
138
  /** The Telescope instance, when this surface was given one. */
148
139
  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);
140
+ constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
141
+ /** Internal: how `.calls()` carries edges into the copy it returns. */
142
+ dependencies?: readonly Dependency[],
143
+ /** Internal: how `.auth()` carries the authenticator into its copy. */
144
+ authenticator?: Authenticator | undefined);
145
+ /** `api.get('/users')` — one route on this surface. */
146
+ readonly get: Endpoints['get'];
147
+ readonly post: Endpoints['post'];
148
+ readonly put: Endpoints['put'];
149
+ readonly patch: Endpoints['patch'];
150
+ readonly delete: Endpoints['delete'];
151
+ readonly options: Endpoints['options'];
152
152
  /**
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:
153
+ * A branch for a *group* of endpoints that shares what a single route would
154
+ * otherwise repeat — a database, an auditor, a publisher, a session:
158
155
  *
159
156
  * ```ts
160
- * const audited = api.endpoints.database(db).auditor(AuditStore);
161
- * export const createUser = audited.post('/users').handle(...);
157
+ * export const router = api.database(database);
158
+ * export const createUser = router.post('/users').handle(({ db }) => …);
162
159
  * ```
163
160
  *
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.
161
+ * Each returns a new factory and leaves the surface as it was. That is the
162
+ * whole difference from putting the same thing in the surface's config: a
163
+ * group opts in, where the surface would grant it to every route it serves —
164
+ * a health check handed the database because a profile endpoint needed it.
165
+ *
166
+ * `dependsOn` is deliberately not here. It is per endpoint, and on the
167
+ * surface it would read as the API depending on something, which is what
168
+ * `.calls()` and `.auth()` say instead.
168
169
  */
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>;
170
+ readonly database: Endpoints['database'];
171
+ readonly session: Endpoints['session'];
172
+ readonly auditor: Endpoints['auditor'];
173
+ readonly actor: Endpoints['actor'];
174
+ readonly publisher: Endpoints['publisher'];
175
+ readonly authorizer: Endpoints['authorizer'];
176
+ readonly authorize: Endpoints['authorize'];
177
+ readonly rls: Endpoints['rls'];
178
+ readonly route: Endpoints['route'];
177
179
  /**
178
180
  * What authenticates this surface.
179
181
  *
@@ -183,12 +185,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
183
185
  * what a request is allowed to be. A surface with two of the first is a
184
186
  * mistake; two of the second is Tuesday.
185
187
  *
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.
188
+ * It declares the id, and keeps the construct: a session callback reads from
189
+ * it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
190
+ * calls the construct's `verify(headers)`. That is the one thing every
191
+ * provider shares, whether the server is mounted in this process, deployed
192
+ * beside it, or an OIDC issuer somebody else runs.
190
193
  */
191
- auth(construct: Declarable): RestApi<TName, TAuthorizers>;
194
+ auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
192
195
  /**
193
196
  * Other surfaces this one calls.
194
197
  *
@@ -215,7 +218,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
215
218
  */
216
219
  declare(): Declaration[];
217
220
  }
218
- //# sourceMappingURL=rest-api.d.ts.map
219
221
  //#endregion
220
- export { RestApi, RestApiConfig };
222
+ export type { Authenticator };
221
223
  //# 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;;;;;;;;;;;;;;;;;;;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.mts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;KAkDK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;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;;WAyEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,WAAW;WACX,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,13 +1,8 @@
1
- import "./Construct-BD5neF7w.mjs";
2
- import { edgeTo } from "./construct-interface-Z4CpS8tK.mjs";
3
- import "./functions-Cxbo-pEd.mjs";
4
- import { EndpointFactory } from "./EndpointFactory-DTTCkGEL.mjs";
5
- import "./clone-DblgEZZa.mjs";
6
- import "./Endpoint-VIOpSo0S.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-B9HAjDAP.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.
@@ -16,8 +11,9 @@ import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
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,81 @@ 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.publisher = endpoints.publisher.bind(endpoints);
98
+ this.authorizer = endpoints.authorizer.bind(endpoints);
99
+ this.authorize = endpoints.authorize.bind(endpoints);
100
+ this.rls = endpoints.rls.bind(endpoints);
101
+ this.route = endpoints.route.bind(endpoints);
80
102
  }
81
103
  /**
82
- * This surface's endpoint factory.
104
+ * This surface's endpoint factory, which every method below starts from.
83
105
  *
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:
106
+ * Private: a surface *is* where endpoints are built, so there is no second
107
+ * object to reach through first. `api.database(db)` said the same
108
+ * thing as `api.database(db)` with one more word to learn.
109
+ */
110
+ #endpoints;
111
+ /** `api.get('/users')` — one route on this surface. */
112
+ get;
113
+ post;
114
+ put;
115
+ patch;
116
+ delete;
117
+ options;
118
+ /**
119
+ * A branch for a *group* of endpoints that shares what a single route would
120
+ * otherwise repeat — a database, an auditor, a publisher, a session:
87
121
  *
88
122
  * ```ts
89
- * const audited = api.endpoints.database(db).auditor(AuditStore);
90
- * export const createUser = audited.post('/users').handle(...);
123
+ * export const router = api.database(database);
124
+ * export const createUser = router.post('/users').handle(({ db }) => …);
91
125
  * ```
92
126
  *
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.
127
+ * Each returns a new factory and leaves the surface as it was. That is the
128
+ * whole difference from putting the same thing in the surface's config: a
129
+ * group opts in, where the surface would grant it to every route it serves —
130
+ * a health check handed the database because a profile endpoint needed it.
131
+ *
132
+ * `dependsOn` is deliberately not here. It is per endpoint, and on the
133
+ * surface it would read as the API depending on something, which is what
134
+ * `.calls()` and `.auth()` say instead.
97
135
  */
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
- }
136
+ database;
137
+ session;
138
+ auditor;
139
+ actor;
140
+ publisher;
141
+ authorizer;
142
+ authorize;
143
+ rls;
144
+ route;
118
145
  /**
119
146
  * What authenticates this surface.
120
147
  *
@@ -124,13 +151,14 @@ var RestApi = class RestApi {
124
151
  * what a request is allowed to be. A surface with two of the first is a
125
152
  * mistake; two of the second is Tuesday.
126
153
  *
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.
154
+ * It declares the id, and keeps the construct: a session callback reads from
155
+ * it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
156
+ * calls the construct's `verify(headers)`. That is the one thing every
157
+ * provider shares, whether the server is mounted in this process, deployed
158
+ * beside it, or an OIDC issuer somebody else runs.
131
159
  */
132
160
  auth(construct) {
133
- return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct.id);
161
+ return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct);
134
162
  }
135
163
  /**
136
164
  * Other surfaces this one calls.
@@ -162,12 +190,10 @@ var RestApi = class RestApi {
162
190
  return [{
163
191
  kind: "rest-api",
164
192
  id: this.id,
165
- app: {
166
- ...this.config.app,
167
- ...this.config.telescope ? { telescope: true } : {}
168
- },
193
+ path: this.config.path,
194
+ ...this.config.telescope ? { telescope: true } : {},
169
195
  ...this.config.cors ? { cors: this.config.cors } : {},
170
- ...this.authenticator ? { auth: this.authenticator } : {},
196
+ ...this.authenticator ? { auth: this.authenticator.id } : {},
171
197
  endpoints: [],
172
198
  ...this.dependencies.length ? { calls: this.dependencies } : {},
173
199
  ...this.config.authorizers?.length ? { authorizers: this.config.authorizers } : {},
@@ -180,7 +206,7 @@ var RestApi = class RestApi {
180
206
  }];
181
207
  }
182
208
  };
183
-
184
209
  //#endregion
185
210
  export { RestApi };
211
+
186
212
  //# sourceMappingURL=rest-api.mjs.map