@geekmidas/constructs 10.0.0-alpha.38 → 10.0.0-alpha.39

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 (257) hide show
  1. package/README.md +156 -155
  2. package/dist/{Construct-Detz65RA.mjs → Construct-BO1X-kt9.mjs} +3 -6
  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-yG9Sw-5p.cjs → Construct-DmvXceVY.cjs} +3 -6
  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-Brs_n_vQ.d.cts → Cron-CMEGfRs8.d.cts} +7 -5
  11. package/dist/Cron-CMEGfRs8.d.cts.map +1 -0
  12. package/dist/{Cron-C18-2Lgb.d.mts → Cron-D6X4-xjB.d.mts} +7 -5
  13. package/dist/Cron-D6X4-xjB.d.mts.map +1 -0
  14. package/dist/{CronBuilder-4WnWKR40.d.cts → CronBuilder-CEK7aOqD.d.cts} +21 -16
  15. package/dist/CronBuilder-CEK7aOqD.d.cts.map +1 -0
  16. package/dist/{CronBuilder-BbnT7tqo.cjs → CronBuilder-DB35T5dL.cjs} +13 -11
  17. package/dist/CronBuilder-DB35T5dL.cjs.map +1 -0
  18. package/dist/{CronBuilder-BRkzUOAs.mjs → CronBuilder-Dv0IlZs0.mjs} +14 -12
  19. package/dist/CronBuilder-Dv0IlZs0.mjs.map +1 -0
  20. package/dist/{CronBuilder-CGv51EoE.d.mts → CronBuilder-O_gvButp.d.mts} +21 -16
  21. package/dist/CronBuilder-O_gvButp.d.mts.map +1 -0
  22. package/dist/{Endpoint-DO332Dnm.mjs → Endpoint-CQAeh1Rh.mjs} +5 -5
  23. package/dist/Endpoint-CQAeh1Rh.mjs.map +1 -0
  24. package/dist/{Endpoint-QKuFg5gs.cjs → Endpoint-D1L9qu5C.cjs} +5 -5
  25. package/dist/Endpoint-D1L9qu5C.cjs.map +1 -0
  26. package/dist/{Endpoint-BkhPHCuX.d.cts → Endpoint-Dp5AKIXl.d.cts} +10 -13
  27. package/dist/Endpoint-Dp5AKIXl.d.cts.map +1 -0
  28. package/dist/{Endpoint-DkiD0GJs.d.mts → Endpoint-DtI7heFm.d.mts} +10 -13
  29. package/dist/Endpoint-DtI7heFm.d.mts.map +1 -0
  30. package/dist/{EndpointFactory-B9HAjDAP.mjs → EndpointFactory-BBdNeaGJ.mjs} +23 -52
  31. package/dist/EndpointFactory-BBdNeaGJ.mjs.map +1 -0
  32. package/dist/{EndpointFactory-BmO0WnXE.cjs → EndpointFactory-BZOCOaK6.cjs} +22 -51
  33. package/dist/EndpointFactory-BZOCOaK6.cjs.map +1 -0
  34. package/dist/{EndpointFactory-WJzZfkTW.d.mts → EndpointFactory-CgMDvERK.d.mts} +58 -48
  35. package/dist/EndpointFactory-CgMDvERK.d.mts.map +1 -0
  36. package/dist/{EndpointFactory-n96CT_Ys.d.cts → EndpointFactory-FeFRmlDZ.d.cts} +58 -48
  37. package/dist/EndpointFactory-FeFRmlDZ.d.cts.map +1 -0
  38. package/dist/{HonoEndpointAdaptor-CiqAZ5Mt.mjs → HonoEndpointAdaptor-Aui-x9Lg.mjs} +4 -3
  39. package/dist/HonoEndpointAdaptor-Aui-x9Lg.mjs.map +1 -0
  40. package/dist/{HonoEndpointAdaptor-DoEQdC3r.cjs → HonoEndpointAdaptor-Cq99r9H7.cjs} +5 -4
  41. package/dist/HonoEndpointAdaptor-Cq99r9H7.cjs.map +1 -0
  42. package/dist/{Queue-DpKTLl6E.mjs → Queue-C1uDgjxt.mjs} +29 -48
  43. package/dist/Queue-C1uDgjxt.mjs.map +1 -0
  44. package/dist/{Queue-B7yRXQmL.cjs → Queue-Ckmudcm8.cjs} +29 -48
  45. package/dist/Queue-Ckmudcm8.cjs.map +1 -0
  46. package/dist/{Queue-Bhzi2WQC.d.cts → Queue-CpQIGB_2.d.cts} +22 -33
  47. package/dist/Queue-CpQIGB_2.d.cts.map +1 -0
  48. package/dist/{Queue-BoUA-e83.d.mts → Queue-YmvN2vEP.d.mts} +21 -32
  49. package/dist/Queue-YmvN2vEP.d.mts.map +1 -0
  50. package/dist/QueueBuilder-CJNcv4dy.cjs +112 -0
  51. package/dist/QueueBuilder-CJNcv4dy.cjs.map +1 -0
  52. package/dist/QueueBuilder-CM0WUxfw.d.mts +62 -0
  53. package/dist/QueueBuilder-CM0WUxfw.d.mts.map +1 -0
  54. package/dist/QueueBuilder-XEnnOWGe.d.cts +62 -0
  55. package/dist/QueueBuilder-XEnnOWGe.d.cts.map +1 -0
  56. package/dist/QueueBuilder-XuPKZwKH.mjs +95 -0
  57. package/dist/QueueBuilder-XuPKZwKH.mjs.map +1 -0
  58. package/dist/{Subscriber-DQCaiOXF.d.cts → Subscriber-B91YSkZt.d.cts} +12 -13
  59. package/dist/Subscriber-B91YSkZt.d.cts.map +1 -0
  60. package/dist/{Subscriber-CIO3pwji.d.mts → Subscriber-BjHYe5hK.d.mts} +11 -12
  61. package/dist/Subscriber-BjHYe5hK.d.mts.map +1 -0
  62. package/dist/{SubscriberBuilder-CIXTozBi.d.cts → SubscriberBuilder-BSpQX1JT.d.cts} +19 -23
  63. package/dist/SubscriberBuilder-BSpQX1JT.d.cts.map +1 -0
  64. package/dist/{SubscriberBuilder-CMBzPdRX.d.mts → SubscriberBuilder-BhMphk4z.d.mts} +18 -22
  65. package/dist/SubscriberBuilder-BhMphk4z.d.mts.map +1 -0
  66. package/dist/{SubscriberBuilder-C2bCOuPT.cjs → SubscriberBuilder-Duk028pD.cjs} +11 -19
  67. package/dist/SubscriberBuilder-Duk028pD.cjs.map +1 -0
  68. package/dist/{SubscriberBuilder-B4YRTBng.mjs → SubscriberBuilder-DzQUWE08.mjs} +11 -19
  69. package/dist/SubscriberBuilder-DzQUWE08.mjs.map +1 -0
  70. package/dist/{Topic-D5rlM9wS.cjs → Topic-BBVXC3H4.cjs} +46 -51
  71. package/dist/Topic-BBVXC3H4.cjs.map +1 -0
  72. package/dist/Topic-DOw051ch.mjs +98 -0
  73. package/dist/Topic-DOw051ch.mjs.map +1 -0
  74. package/dist/adaptors/aws.cjs +5 -5
  75. package/dist/adaptors/aws.cjs.map +1 -1
  76. package/dist/adaptors/aws.d.cts +26 -26
  77. package/dist/adaptors/aws.d.cts.map +1 -1
  78. package/dist/adaptors/aws.d.mts +25 -25
  79. package/dist/adaptors/aws.d.mts.map +1 -1
  80. package/dist/adaptors/aws.mjs +5 -5
  81. package/dist/adaptors/aws.mjs.map +1 -1
  82. package/dist/adaptors/hono.cjs +1 -1
  83. package/dist/adaptors/hono.d.cts +4 -5
  84. package/dist/adaptors/hono.d.cts.map +1 -1
  85. package/dist/adaptors/hono.d.mts +4 -5
  86. package/dist/adaptors/hono.d.mts.map +1 -1
  87. package/dist/adaptors/hono.mjs +1 -1
  88. package/dist/adaptors/testing.cjs +15 -17
  89. package/dist/adaptors/testing.cjs.map +1 -1
  90. package/dist/adaptors/testing.d.cts +26 -28
  91. package/dist/adaptors/testing.d.cts.map +1 -1
  92. package/dist/adaptors/testing.d.mts +26 -28
  93. package/dist/adaptors/testing.d.mts.map +1 -1
  94. package/dist/adaptors/testing.mjs +15 -17
  95. package/dist/adaptors/testing.mjs.map +1 -1
  96. package/dist/{auth-6Cdx5amw.d.cts → auth-CMwml9QN.d.mts} +4 -4
  97. package/dist/{auth-6Cdx5amw.d.cts.map → auth-CMwml9QN.d.mts.map} +1 -1
  98. package/dist/{auth-B_c9b54v.d.mts → auth-rVRDjIw_.d.cts} +4 -4
  99. package/dist/{auth-B_c9b54v.d.mts.map → auth-rVRDjIw_.d.cts.map} +1 -1
  100. package/dist/auth.d.cts +1 -1
  101. package/dist/auth.d.mts +1 -1
  102. package/dist/{cache-CSJHbgwS.d.cts → cache-C9a_hVCc.d.cts} +2 -2
  103. package/dist/{cache-CSJHbgwS.d.cts.map → cache-C9a_hVCc.d.cts.map} +1 -1
  104. package/dist/{cache-HHg5No4L.d.mts → cache-CeTMI8LR.d.mts} +2 -2
  105. package/dist/{cache-HHg5No4L.d.mts.map → cache-CeTMI8LR.d.mts.map} +1 -1
  106. package/dist/cache.d.cts +1 -1
  107. package/dist/cache.d.mts +1 -1
  108. package/dist/{construct-interface-BLG_BEH5.d.mts → construct-interface-_3zgxzXl.d.mts} +9 -18
  109. package/dist/{construct-interface-BLG_BEH5.d.mts.map → construct-interface-_3zgxzXl.d.mts.map} +1 -1
  110. package/dist/{construct-interface-DcNaRKoC.d.cts → construct-interface-_xi4BPN8.d.cts} +9 -18
  111. package/dist/{construct-interface-DcNaRKoC.d.cts.map → construct-interface-_xi4BPN8.d.cts.map} +1 -1
  112. package/dist/construct-interface.cjs +1 -30
  113. package/dist/construct-interface.cjs.map +1 -1
  114. package/dist/construct-interface.d.cts +2 -2
  115. package/dist/construct-interface.d.mts +2 -2
  116. package/dist/construct-interface.mjs +2 -29
  117. package/dist/construct-interface.mjs.map +1 -1
  118. package/dist/credential.d.cts +1 -1
  119. package/dist/credential.d.mts +1 -1
  120. package/dist/crons/index.cjs +1 -1
  121. package/dist/crons/index.d.cts +2 -2
  122. package/dist/crons/index.d.mts +2 -2
  123. package/dist/crons/index.mjs +1 -1
  124. package/dist/database/kysely.d.cts +1 -1
  125. package/dist/database/kysely.d.mts +1 -1
  126. package/dist/email.d.cts +1 -1
  127. package/dist/email.d.mts +1 -1
  128. package/dist/endpoints/index.cjs +5 -4
  129. package/dist/endpoints/index.d.cts +4 -13
  130. package/dist/endpoints/index.d.cts.map +1 -1
  131. package/dist/endpoints/index.d.mts +4 -13
  132. package/dist/endpoints/index.d.mts.map +1 -1
  133. package/dist/endpoints/index.mjs +4 -3
  134. package/dist/{external-api-CZHev1Oh.d.mts → external-api-DS3mujT5.d.mts} +2 -2
  135. package/dist/{external-api-BKOb2jSC.d.cts.map → external-api-DS3mujT5.d.mts.map} +1 -1
  136. package/dist/{external-api-BKOb2jSC.d.cts → external-api-LBfE-q3g.d.cts} +2 -2
  137. package/dist/{external-api-CZHev1Oh.d.mts.map → external-api-LBfE-q3g.d.cts.map} +1 -1
  138. package/dist/external-api.d.cts +1 -1
  139. package/dist/external-api.d.mts +1 -1
  140. package/dist/file-server.d.cts +1 -1
  141. package/dist/file-server.d.mts +1 -1
  142. package/dist/functions/index.cjs +1 -1
  143. package/dist/functions/index.d.cts +1 -1
  144. package/dist/functions/index.d.mts +1 -1
  145. package/dist/functions/index.mjs +1 -1
  146. package/dist/{functions-DlFm8HmH.mjs → functions-DCIfCRR-.mjs} +94 -23
  147. package/dist/functions-DCIfCRR-.mjs.map +1 -0
  148. package/dist/{functions-DKN6aQWJ.cjs → functions-ZH60FE7H.cjs} +99 -19
  149. package/dist/functions-ZH60FE7H.cjs.map +1 -0
  150. package/dist/{index-Dzkdm-IE.d.cts → index-B0kxstwf.d.cts} +36 -24
  151. package/dist/index-B0kxstwf.d.cts.map +1 -0
  152. package/dist/{index-DwveWr3c.d.mts → index-CjVEjOw0.d.mts} +36 -24
  153. package/dist/index-CjVEjOw0.d.mts.map +1 -0
  154. package/dist/index.cjs +1 -1
  155. package/dist/index.d.cts +1 -1
  156. package/dist/index.d.mts +1 -1
  157. package/dist/index.mjs +1 -1
  158. package/dist/{kysely-Dy8nNgvk.d.cts → kysely-BJ8IQ_1P.d.mts} +4 -4
  159. package/dist/{kysely-Dy8nNgvk.d.cts.map → kysely-BJ8IQ_1P.d.mts.map} +1 -1
  160. package/dist/{kysely-QLoPapbM.d.mts → kysely-DVF8wOT4.d.cts} +4 -4
  161. package/dist/{kysely-QLoPapbM.d.mts.map → kysely-DVF8wOT4.d.cts.map} +1 -1
  162. package/dist/{lazyAccessors-BHtcqgz2.mjs → lazyAccessors-CFanua0O.mjs} +2 -39
  163. package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
  164. package/dist/{lazyAccessors-Dx9NLwJZ.cjs → lazyAccessors-hJKGv8Ay.cjs} +1 -50
  165. package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
  166. package/dist/mobile-app.d.cts +1 -1
  167. package/dist/mobile-app.d.mts +1 -1
  168. package/dist/object-storage.d.cts +1 -1
  169. package/dist/object-storage.d.mts +1 -1
  170. package/dist/processAudits-BpRlPQMW.mjs.map +1 -1
  171. package/dist/processAudits-D_2W5x8k.cjs.map +1 -1
  172. package/dist/queue/index.cjs +4 -78
  173. package/dist/queue/index.d.cts +3 -53
  174. package/dist/queue/index.d.mts +3 -53
  175. package/dist/queue/index.mjs +3 -77
  176. package/dist/rest-api.cjs +2 -4
  177. package/dist/rest-api.cjs.map +1 -1
  178. package/dist/rest-api.d.cts +4 -5
  179. package/dist/rest-api.d.cts.map +1 -1
  180. package/dist/rest-api.d.mts +4 -5
  181. package/dist/rest-api.d.mts.map +1 -1
  182. package/dist/rest-api.mjs +2 -4
  183. package/dist/rest-api.mjs.map +1 -1
  184. package/dist/site.d.cts +1 -1
  185. package/dist/site.d.mts +1 -1
  186. package/dist/subscribers/index.cjs +1 -1
  187. package/dist/subscribers/index.d.cts +2 -2
  188. package/dist/subscribers/index.d.mts +2 -2
  189. package/dist/subscribers/index.mjs +1 -1
  190. package/dist/topic/index.cjs +1 -36
  191. package/dist/topic/index.d.cts +2 -3
  192. package/dist/topic/index.d.mts +2 -3
  193. package/dist/topic/index.mjs +2 -35
  194. package/dist/worker.cjs +26 -17
  195. package/dist/worker.cjs.map +1 -1
  196. package/dist/worker.d.cts +37 -29
  197. package/dist/worker.d.cts.map +1 -1
  198. package/dist/worker.d.mts +37 -29
  199. package/dist/worker.d.mts.map +1 -1
  200. package/dist/worker.mjs +26 -17
  201. package/dist/worker.mjs.map +1 -1
  202. package/package.json +31 -31
  203. package/dist/Construct-DTqYvkPG.d.cts +0 -115
  204. package/dist/Construct-DTqYvkPG.d.cts.map +0 -1
  205. package/dist/Construct-Detz65RA.mjs.map +0 -1
  206. package/dist/Construct-pVadmURD.d.mts +0 -115
  207. package/dist/Construct-pVadmURD.d.mts.map +0 -1
  208. package/dist/Construct-yG9Sw-5p.cjs.map +0 -1
  209. package/dist/Cron-Brs_n_vQ.d.cts.map +0 -1
  210. package/dist/Cron-C18-2Lgb.d.mts.map +0 -1
  211. package/dist/CronBuilder-4WnWKR40.d.cts.map +0 -1
  212. package/dist/CronBuilder-BRkzUOAs.mjs.map +0 -1
  213. package/dist/CronBuilder-BbnT7tqo.cjs.map +0 -1
  214. package/dist/CronBuilder-CGv51EoE.d.mts.map +0 -1
  215. package/dist/Endpoint-BkhPHCuX.d.cts.map +0 -1
  216. package/dist/Endpoint-DO332Dnm.mjs.map +0 -1
  217. package/dist/Endpoint-DkiD0GJs.d.mts.map +0 -1
  218. package/dist/Endpoint-QKuFg5gs.cjs.map +0 -1
  219. package/dist/EndpointFactory-B9HAjDAP.mjs.map +0 -1
  220. package/dist/EndpointFactory-BmO0WnXE.cjs.map +0 -1
  221. package/dist/EndpointFactory-WJzZfkTW.d.mts.map +0 -1
  222. package/dist/EndpointFactory-n96CT_Ys.d.cts.map +0 -1
  223. package/dist/HonoEndpointAdaptor-CiqAZ5Mt.mjs.map +0 -1
  224. package/dist/HonoEndpointAdaptor-DoEQdC3r.cjs.map +0 -1
  225. package/dist/Queue-B7yRXQmL.cjs.map +0 -1
  226. package/dist/Queue-Bhzi2WQC.d.cts.map +0 -1
  227. package/dist/Queue-BoUA-e83.d.mts.map +0 -1
  228. package/dist/Queue-DpKTLl6E.mjs.map +0 -1
  229. package/dist/Subscriber-CIO3pwji.d.mts.map +0 -1
  230. package/dist/Subscriber-DQCaiOXF.d.cts.map +0 -1
  231. package/dist/SubscriberBuilder-B4YRTBng.mjs.map +0 -1
  232. package/dist/SubscriberBuilder-C2bCOuPT.cjs.map +0 -1
  233. package/dist/SubscriberBuilder-CIXTozBi.d.cts.map +0 -1
  234. package/dist/SubscriberBuilder-CMBzPdRX.d.mts.map +0 -1
  235. package/dist/Topic-Ct3Le8Wt.mjs +0 -103
  236. package/dist/Topic-Ct3Le8Wt.mjs.map +0 -1
  237. package/dist/Topic-D5rlM9wS.cjs.map +0 -1
  238. package/dist/Topic-D6blllEn.d.cts +0 -89
  239. package/dist/Topic-D6blllEn.d.cts.map +0 -1
  240. package/dist/Topic-DVvheJ_-.d.mts +0 -89
  241. package/dist/Topic-DVvheJ_-.d.mts.map +0 -1
  242. package/dist/functions-DKN6aQWJ.cjs.map +0 -1
  243. package/dist/functions-DlFm8HmH.mjs.map +0 -1
  244. package/dist/index-DwveWr3c.d.mts.map +0 -1
  245. package/dist/index-Dzkdm-IE.d.cts.map +0 -1
  246. package/dist/index-fnpjXiA-.d.mts +0 -26
  247. package/dist/index-fnpjXiA-.d.mts.map +0 -1
  248. package/dist/index-tE_119SX.d.cts +0 -26
  249. package/dist/index-tE_119SX.d.cts.map +0 -1
  250. package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
  251. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
  252. package/dist/queue/index.cjs.map +0 -1
  253. package/dist/queue/index.d.cts.map +0 -1
  254. package/dist/queue/index.d.mts.map +0 -1
  255. package/dist/queue/index.mjs.map +0 -1
  256. package/dist/topic/index.cjs.map +0 -1
  257. package/dist/topic/index.mjs.map +0 -1
@@ -26,8 +26,8 @@ interface Construct<TName extends string = string, TClient = never> {
26
26
  * The consumable face — the address this construct owns, as a client.
27
27
  *
28
28
  * A field assigned once rather than a getter. `Construct.getEnvironment`
29
- * caches by service *object*, and `Topic.publisher` returns a fresh literal
30
- * on every access, so that cache never hits for topics or queues today.
29
+ * and `ServiceDiscovery` cache by service *object*, so a getter returning a
30
+ * fresh literal on every access would never hit either cache.
31
31
  */
32
32
  readonly service: [TClient] extends [never] ? never : Service<Uncapitalize<TName>, TClient>;
33
33
  }
@@ -120,30 +120,21 @@ declare class NotAConstruct extends Error {
120
120
  constructor(value: unknown);
121
121
  }
122
122
  /**
123
- * Mark a service as standing for the construct it was derived from.
123
+ * Whether a value is a construct rather than a bare `Service`.
124
124
  *
125
- * \`.publisher(users.publisher)\` takes a service, not the topic, and an id
126
- * cannot be recovered from a service name. Without the mark the edge was lost:
127
- * the manifest never heard that the API publishes to \`users\`, so the app's
128
- * container was composed without \`USERS_PUBLISHER_CONNECTION_STRING\`.
125
+ * Structural rather than `instanceof`: a construct from a second copy of
126
+ * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is
127
+ * still a construct, and `instanceof` is exactly the check that says otherwise.
129
128
  */
130
- declare function derivedFrom<S extends Service>(service: S, construct: {
131
- id: string;
132
- }): S;
133
- /**
134
- * \`existing\`, with the edge a service stands for — a construct's own id, or
135
- * the id a derived service was marked with. Unchanged for a plain service.
136
- */
137
- declare function edgesWith(service: unknown, existing?: readonly string[]): string[];
138
129
  declare function isConsumable(value: unknown): value is Consumable;
139
130
  /**
140
131
  * The service behind either face.
141
132
  *
142
- * `.database()` and the publisher slots take a construct now; they took a
133
+ * `.database()` and the auditor slot take a construct now; they took a
143
134
  * `Service` before and still do, because not every hand-written service has a
144
135
  * construct to stand for it.
145
136
  */
146
137
  declare function serviceOf<TName extends string, TClient>(source: Consumable<TName, TClient> | Service<TName, TClient>): Service<TName, TClient>;
147
138
  //#endregion
148
- export { Infer as a, ServicesOf as c, edgesWith as d, idsOf as f, servicesOf as h, Declarable as i, derivedFrom as l, serviceOf as m, Construct as n, NameOf as o, isConsumable as p, Consumable as r, NotAConstruct as s, Authenticator as t, edgeTo as u };
149
- //# sourceMappingURL=construct-interface-DcNaRKoC.d.cts.map
139
+ export { Infer as a, ServicesOf as c, isConsumable as d, serviceOf as f, Declarable as i, edgeTo as l, Construct as n, NameOf as o, servicesOf as p, Consumable as r, NotAConstruct as s, Authenticator as t, idsOf as u };
140
+ //# sourceMappingURL=construct-interface-_xi4BPN8.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"construct-interface-DcNaRKoC.d.cts","names":[],"sources":["../src/construct-interface.ts"],"mappings":";;;;;;;;;;;;;UA8BiB,UAAU,+BAA+B;;WAEhD,IAAI;;;;;;;;EASb,WAAW;;;;;;;;WASF,UAAU,mCAEhB,QAAQ,aAAa,QAAQ;;;;;;;;;;;UAYhB,WAAW;WAClB,IAAI;EACb,WAAW;;;;;;;;;;UAWK,cAAc,4BAA4B;EAC1D,OACC,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;;;;;;;iBAeI,OAAO,WAAW,aAAa;;KAWnC,MAAM,KACjB,UAAU,wBAAwB,WAAW;;KAGlC,OAAO,KAClB,UAAU,gBAAgB,kBAAkB;;;;;;;;;;;UAY5B,WAAW,+BAA+B;WACjD,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;EAC/C,WAAW;;;;;;;;;;KAWA,WAAW,mBAAmB,mBACxC,WAAW,IAAI,EAAE;;;;;;;;iBAUH,iBAAiB,mBAAmB,cACnD,YAAY,IACV,WAAW;;;;;;;;;;iBAiBE,MACf,qBAAqB,cACrB;;cAMY,sBAAsB;WACb;EAArB,YAAqB;;;;;;;;;;iBAoCN,YAAY,UAAU,SACrC,SAAS,GACT;EAAa;IACX;;;;;iBASa,UACf,kBACA;iBAce,aAAa,iBAAiB,SAAS;;;;;;;;iBAmBvC,UAAU,sBAAsB,SAC/C,QAAQ,WAAW,OAAO,WAAW,QAAQ,OAAO,WAClD,QAAQ,OAAO"}
1
+ {"version":3,"file":"construct-interface-_xi4BPN8.d.cts","names":[],"sources":["../src/construct-interface.ts"],"mappings":";;;;;;;;;;;;;UA8BiB,UAAU,+BAA+B;;WAEhD,IAAI;;;;;;;;EASb,WAAW;;;;;;;;WASF,UAAU,mCAEhB,QAAQ,aAAa,QAAQ;;;;;;;;;;;UAYhB,WAAW;WAClB,IAAI;EACb,WAAW;;;;;;;;;;UAWK,cAAc,4BAA4B;EAC1D,OACC,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;;;;;;;iBAeI,OAAO,WAAW,aAAa;;KAWnC,MAAM,KACjB,UAAU,wBAAwB,WAAW;;KAGlC,OAAO,KAClB,UAAU,gBAAgB,kBAAkB;;;;;;;;;;;UAY5B,WAAW,+BAA+B;WACjD,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;EAC/C,WAAW;;;;;;;;;;KAWA,WAAW,mBAAmB,mBACxC,WAAW,IAAI,EAAE;;;;;;;;iBAUH,iBAAiB,mBAAmB,cACnD,YAAY,IACV,WAAW;;;;;;;;;;iBAiBE,MACf,qBAAqB,cACrB;;cAMY,sBAAsB;WACb;EAArB,YAAqB;;;;;;;;;iBAqBN,aAAa,iBAAiB,SAAS;;;;;;;;iBAmBvC,UAAU,sBAAsB,SAC/C,QAAQ,WAAW,OAAO,WAAW,QAAQ,OAAO,WAClD,QAAQ,OAAO"}
@@ -62,33 +62,6 @@ var NotAConstruct = class extends Error {
62
62
  * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is
63
63
  * still a construct, and `instanceof` is exactly the check that says otherwise.
64
64
  */
65
- /**
66
- * The construct a service was derived from — the \`users\` topic, for
67
- * \`users.publisher\`. A symbol, so it rides on the service object without
68
- * becoming part of its shape.
69
- */
70
- const DERIVED_FROM = Symbol.for("@geekmidas/constructs/derivedFrom");
71
- /**
72
- * Mark a service as standing for the construct it was derived from.
73
- *
74
- * \`.publisher(users.publisher)\` takes a service, not the topic, and an id
75
- * cannot be recovered from a service name. Without the mark the edge was lost:
76
- * the manifest never heard that the API publishes to \`users\`, so the app's
77
- * container was composed without \`USERS_PUBLISHER_CONNECTION_STRING\`.
78
- */
79
- function derivedFrom(service, construct) {
80
- Object.defineProperty(service, DERIVED_FROM, { value: construct.id });
81
- return service;
82
- }
83
- /**
84
- * \`existing\`, with the edge a service stands for — a construct's own id, or
85
- * the id a derived service was marked with. Unchanged for a plain service.
86
- */
87
- function edgesWith(service, existing = []) {
88
- if (isConsumable(service)) return idsOf([service], existing);
89
- const id = typeof service === "object" && service !== null ? service[DERIVED_FROM] : void 0;
90
- return typeof id === "string" ? [.../* @__PURE__ */ new Set([...existing, id])] : [...existing];
91
- }
92
65
  function isConsumable(value) {
93
66
  if (typeof value !== "object" || value === null) return false;
94
67
  const candidate = value;
@@ -97,7 +70,7 @@ function isConsumable(value) {
97
70
  /**
98
71
  * The service behind either face.
99
72
  *
100
- * `.database()` and the publisher slots take a construct now; they took a
73
+ * `.database()` and the auditor slot take a construct now; they took a
101
74
  * `Service` before and still do, because not every hand-written service has a
102
75
  * construct to stand for it.
103
76
  */
@@ -106,9 +79,7 @@ function serviceOf(source) {
106
79
  }
107
80
  //#endregion
108
81
  exports.NotAConstruct = NotAConstruct;
109
- exports.derivedFrom = derivedFrom;
110
82
  exports.edgeTo = edgeTo;
111
- exports.edgesWith = edgesWith;
112
83
  exports.idsOf = idsOf;
113
84
  exports.isConsumable = isConsumable;
114
85
  exports.serviceOf = serviceOf;
@@ -1 +1 @@
1
- {"version":3,"file":"construct-interface.cjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * caches by service *object*, and `Topic.publisher` returns a fresh literal\n\t * on every access, so that cache never hits for topics or queues today.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\n/**\n * The construct a service was derived from — the \\`users\\` topic, for\n * \\`users.publisher\\`. A symbol, so it rides on the service object without\n * becoming part of its shape.\n */\nconst DERIVED_FROM = Symbol.for('@geekmidas/constructs/derivedFrom');\n\n/**\n * Mark a service as standing for the construct it was derived from.\n *\n * \\`.publisher(users.publisher)\\` takes a service, not the topic, and an id\n * cannot be recovered from a service name. Without the mark the edge was lost:\n * the manifest never heard that the API publishes to \\`users\\`, so the app's\n * container was composed without \\`USERS_PUBLISHER_CONNECTION_STRING\\`.\n */\nexport function derivedFrom<S extends Service>(\n\tservice: S,\n\tconstruct: { id: string },\n): S {\n\tObject.defineProperty(service, DERIVED_FROM, { value: construct.id });\n\treturn service;\n}\n\n/**\n * \\`existing\\`, with the edge a service stands for — a construct's own id, or\n * the id a derived service was marked with. Unchanged for a plain service.\n */\nexport function edgesWith(\n\tservice: unknown,\n\texisting: readonly string[] = [],\n): string[] {\n\tif (isConsumable(service)) return idsOf([service], existing);\n\n\tconst id =\n\t\ttypeof service === 'object' && service !== null\n\t\t\t? (service as { [DERIVED_FROM]?: unknown })[DERIVED_FROM]\n\t\t\t: undefined;\n\n\treturn typeof id === 'string'\n\t\t? [...new Set([...existing, id])]\n\t\t: [...existing];\n}\n\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the publisher slots take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n"],"mappings":";;;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;;;;;;AAcA,MAAM,eAAe,OAAO,IAAI,mCAAmC;;;;;;;;;AAUnE,SAAgB,YACf,SACA,WACI;CACJ,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,UAAU,GAAG,CAAC;CACpE,OAAO;AACR;;;;;AAMA,SAAgB,UACf,SACA,WAA8B,CAAC,GACpB;CACX,IAAI,aAAa,OAAO,GAAG,OAAO,MAAM,CAAC,OAAO,GAAG,QAAQ;CAE3D,MAAM,KACL,OAAO,YAAY,YAAY,YAAY,OACvC,QAAyC,gBAC1C,KAAA;CAEJ,OAAO,OAAO,OAAO,WAClB,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC,IAC9B,CAAC,GAAG,QAAQ;AAChB;AAEA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL"}
1
+ {"version":3,"file":"construct-interface.cjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * and `ServiceDiscovery` cache by service *object*, so a getter returning a\n\t * fresh literal on every access would never hit either cache.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the auditor slot take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n"],"mappings":";;;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL"}
@@ -1,2 +1,2 @@
1
- import { a as Infer, c as ServicesOf, d as edgesWith, f as idsOf, h as servicesOf, i as Declarable, l as derivedFrom, m as serviceOf, n as Construct, o as NameOf, p as isConsumable, r as Consumable, s as NotAConstruct, t as Authenticator, u as edgeTo } from "./construct-interface-DcNaRKoC.cjs";
2
- export { Authenticator, Construct, Consumable, Declarable, Infer, NameOf, NotAConstruct, ServicesOf, derivedFrom, edgeTo, edgesWith, idsOf, isConsumable, serviceOf, servicesOf };
1
+ import { a as Infer, c as ServicesOf, d as isConsumable, f as serviceOf, i as Declarable, l as edgeTo, n as Construct, o as NameOf, p as servicesOf, r as Consumable, s as NotAConstruct, t as Authenticator, u as idsOf } from "./construct-interface-_xi4BPN8.cjs";
2
+ export { Authenticator, Construct, Consumable, Declarable, Infer, NameOf, NotAConstruct, ServicesOf, edgeTo, idsOf, isConsumable, serviceOf, servicesOf };
@@ -1,2 +1,2 @@
1
- import { a as Infer, c as ServicesOf, d as edgesWith, f as idsOf, h as servicesOf, i as Declarable, l as derivedFrom, m as serviceOf, n as Construct, o as NameOf, p as isConsumable, r as Consumable, s as NotAConstruct, t as Authenticator, u as edgeTo } from "./construct-interface-BLG_BEH5.mjs";
2
- export { Authenticator, Construct, Consumable, Declarable, Infer, NameOf, NotAConstruct, ServicesOf, derivedFrom, edgeTo, edgesWith, idsOf, isConsumable, serviceOf, servicesOf };
1
+ import { a as Infer, c as ServicesOf, d as isConsumable, f as serviceOf, i as Declarable, l as edgeTo, n as Construct, o as NameOf, p as servicesOf, r as Consumable, s as NotAConstruct, t as Authenticator, u as idsOf } from "./construct-interface-_3zgxzXl.mjs";
2
+ export { Authenticator, Construct, Consumable, Declarable, Infer, NameOf, NotAConstruct, ServicesOf, edgeTo, idsOf, isConsumable, serviceOf, servicesOf };
@@ -61,33 +61,6 @@ var NotAConstruct = class extends Error {
61
61
  * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is
62
62
  * still a construct, and `instanceof` is exactly the check that says otherwise.
63
63
  */
64
- /**
65
- * The construct a service was derived from — the \`users\` topic, for
66
- * \`users.publisher\`. A symbol, so it rides on the service object without
67
- * becoming part of its shape.
68
- */
69
- const DERIVED_FROM = Symbol.for("@geekmidas/constructs/derivedFrom");
70
- /**
71
- * Mark a service as standing for the construct it was derived from.
72
- *
73
- * \`.publisher(users.publisher)\` takes a service, not the topic, and an id
74
- * cannot be recovered from a service name. Without the mark the edge was lost:
75
- * the manifest never heard that the API publishes to \`users\`, so the app's
76
- * container was composed without \`USERS_PUBLISHER_CONNECTION_STRING\`.
77
- */
78
- function derivedFrom(service, construct) {
79
- Object.defineProperty(service, DERIVED_FROM, { value: construct.id });
80
- return service;
81
- }
82
- /**
83
- * \`existing\`, with the edge a service stands for — a construct's own id, or
84
- * the id a derived service was marked with. Unchanged for a plain service.
85
- */
86
- function edgesWith(service, existing = []) {
87
- if (isConsumable(service)) return idsOf([service], existing);
88
- const id = typeof service === "object" && service !== null ? service[DERIVED_FROM] : void 0;
89
- return typeof id === "string" ? [.../* @__PURE__ */ new Set([...existing, id])] : [...existing];
90
- }
91
64
  function isConsumable(value) {
92
65
  if (typeof value !== "object" || value === null) return false;
93
66
  const candidate = value;
@@ -96,7 +69,7 @@ function isConsumable(value) {
96
69
  /**
97
70
  * The service behind either face.
98
71
  *
99
- * `.database()` and the publisher slots take a construct now; they took a
72
+ * `.database()` and the auditor slot take a construct now; they took a
100
73
  * `Service` before and still do, because not every hand-written service has a
101
74
  * construct to stand for it.
102
75
  */
@@ -104,6 +77,6 @@ function serviceOf(source) {
104
77
  return isConsumable(source) ? source.service : source;
105
78
  }
106
79
  //#endregion
107
- export { NotAConstruct, derivedFrom, edgeTo, edgesWith, idsOf, isConsumable, serviceOf, servicesOf };
80
+ export { NotAConstruct, edgeTo, idsOf, isConsumable, serviceOf, servicesOf };
108
81
 
109
82
  //# sourceMappingURL=construct-interface.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"construct-interface.mjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * caches by service *object*, and `Topic.publisher` returns a fresh literal\n\t * on every access, so that cache never hits for topics or queues today.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\n/**\n * The construct a service was derived from — the \\`users\\` topic, for\n * \\`users.publisher\\`. A symbol, so it rides on the service object without\n * becoming part of its shape.\n */\nconst DERIVED_FROM = Symbol.for('@geekmidas/constructs/derivedFrom');\n\n/**\n * Mark a service as standing for the construct it was derived from.\n *\n * \\`.publisher(users.publisher)\\` takes a service, not the topic, and an id\n * cannot be recovered from a service name. Without the mark the edge was lost:\n * the manifest never heard that the API publishes to \\`users\\`, so the app's\n * container was composed without \\`USERS_PUBLISHER_CONNECTION_STRING\\`.\n */\nexport function derivedFrom<S extends Service>(\n\tservice: S,\n\tconstruct: { id: string },\n): S {\n\tObject.defineProperty(service, DERIVED_FROM, { value: construct.id });\n\treturn service;\n}\n\n/**\n * \\`existing\\`, with the edge a service stands for — a construct's own id, or\n * the id a derived service was marked with. Unchanged for a plain service.\n */\nexport function edgesWith(\n\tservice: unknown,\n\texisting: readonly string[] = [],\n): string[] {\n\tif (isConsumable(service)) return idsOf([service], existing);\n\n\tconst id =\n\t\ttypeof service === 'object' && service !== null\n\t\t\t? (service as { [DERIVED_FROM]?: unknown })[DERIVED_FROM]\n\t\t\t: undefined;\n\n\treturn typeof id === 'string'\n\t\t? [...new Set([...existing, id])]\n\t\t: [...existing];\n}\n\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the publisher slots take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n"],"mappings":";;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;;;;;;AAcA,MAAM,eAAe,OAAO,IAAI,mCAAmC;;;;;;;;;AAUnE,SAAgB,YACf,SACA,WACI;CACJ,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,UAAU,GAAG,CAAC;CACpE,OAAO;AACR;;;;;AAMA,SAAgB,UACf,SACA,WAA8B,CAAC,GACpB;CACX,IAAI,aAAa,OAAO,GAAG,OAAO,MAAM,CAAC,OAAO,GAAG,QAAQ;CAE3D,MAAM,KACL,OAAO,YAAY,YAAY,YAAY,OACvC,QAAyC,gBAC1C,KAAA;CAEJ,OAAO,OAAO,OAAO,WAClB,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC,IAC9B,CAAC,GAAG,QAAQ;AAChB;AAEA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL"}
1
+ {"version":3,"file":"construct-interface.mjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * and `ServiceDiscovery` cache by service *object*, so a getter returning a\n\t * fresh literal on every access would never hit either cache.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the auditor slot take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n"],"mappings":";;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL"}
@@ -1,5 +1,5 @@
1
1
  import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
2
- import { r as Consumable } from "./construct-interface-DcNaRKoC.cjs";
2
+ import { r as Consumable } from "./construct-interface-_xi4BPN8.cjs";
3
3
  import { Service, ServiceRegisterOptions } from "@geekmidas/services";
4
4
  import { ConstructName, Declaration } from "@geekmidas/manifest";
5
5
  //#region src/credential.d.ts
@@ -1,5 +1,5 @@
1
1
  import { t as StandardSchemaV1 } from "./index-CeEtxDmK.mjs";
2
- import { r as Consumable } from "./construct-interface-BLG_BEH5.mjs";
2
+ import { r as Consumable } from "./construct-interface-_3zgxzXl.mjs";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { Service, ServiceRegisterOptions } from "@geekmidas/services";
5
5
  //#region src/credential.d.ts
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_CronBuilder = require("../CronBuilder-BbnT7tqo.cjs");
2
+ const require_CronBuilder = require("../CronBuilder-DB35T5dL.cjs");
3
3
  //#region src/crons/schedule.ts
4
4
  /**
5
5
  * A schedule a cron runner can take, as standard five-field cron.
@@ -1,5 +1,5 @@
1
- import { i as ScheduleExpression, n as CronExpression, r as RateExpression, t as Cron } from "../Cron-Brs_n_vQ.cjs";
2
- import { t as CronBuilder } from "../CronBuilder-4WnWKR40.cjs";
1
+ import { i as ScheduleExpression, n as CronExpression, r as RateExpression, t as Cron } from "../Cron-CMEGfRs8.cjs";
2
+ import { t as CronBuilder } from "../CronBuilder-CEK7aOqD.cjs";
3
3
  //#region src/crons/schedule.d.ts
4
4
  /**
5
5
  * A schedule a cron runner can take, as standard five-field cron.
@@ -1,5 +1,5 @@
1
- import { i as ScheduleExpression, n as CronExpression, r as RateExpression, t as Cron } from "../Cron-C18-2Lgb.mjs";
2
- import { t as CronBuilder } from "../CronBuilder-CGv51EoE.mjs";
1
+ import { i as ScheduleExpression, n as CronExpression, r as RateExpression, t as Cron } from "../Cron-D6X4-xjB.mjs";
2
+ import { t as CronBuilder } from "../CronBuilder-O_gvButp.mjs";
3
3
  //#region src/crons/schedule.d.ts
4
4
  /**
5
5
  * A schedule a cron runner can take, as standard five-field cron.
@@ -1,4 +1,4 @@
1
- import { n as Cron, t as CronBuilder } from "../CronBuilder-BRkzUOAs.mjs";
1
+ import { n as Cron, t as CronBuilder } from "../CronBuilder-Dv0IlZs0.mjs";
2
2
  //#region src/crons/schedule.ts
3
3
  /**
4
4
  * A schedule a cron runner can take, as standard five-field cron.
@@ -1,2 +1,2 @@
1
- import { n as KyselyDatabaseOptions, r as ReadOnlyDatabase, t as KyselyDatabase } from "../kysely-Dy8nNgvk.cjs";
1
+ import { n as KyselyDatabaseOptions, r as ReadOnlyDatabase, t as KyselyDatabase } from "../kysely-DVF8wOT4.cjs";
2
2
  export { KyselyDatabase, KyselyDatabaseOptions, ReadOnlyDatabase };
@@ -1,2 +1,2 @@
1
- import { n as KyselyDatabaseOptions, r as ReadOnlyDatabase, t as KyselyDatabase } from "../kysely-QLoPapbM.mjs";
1
+ import { n as KyselyDatabaseOptions, r as ReadOnlyDatabase, t as KyselyDatabase } from "../kysely-BJ8IQ_1P.mjs";
2
2
  export { KyselyDatabase, KyselyDatabaseOptions, ReadOnlyDatabase };
package/dist/email.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as Construct } from "./construct-interface-DcNaRKoC.cjs";
1
+ import { n as Construct } from "./construct-interface-_xi4BPN8.cjs";
2
2
  import { Service } from "@geekmidas/services";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { EmailClient, TemplateRecord } from "@geekmidas/emailkit";
package/dist/email.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as Construct } from "./construct-interface-BLG_BEH5.mjs";
1
+ import { n as Construct } from "./construct-interface-_3zgxzXl.mjs";
2
2
  import { ConstructName, Declaration } from "@geekmidas/manifest";
3
3
  import { EmailClient, TemplateRecord } from "@geekmidas/emailkit";
4
4
  import { Service } from "@geekmidas/services";
@@ -1,8 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_EndpointFactory = require("../EndpointFactory-BmO0WnXE.cjs");
3
- const require_Endpoint = require("../Endpoint-QKuFg5gs.cjs");
2
+ const require_EndpointFactory = require("../EndpointFactory-BZOCOaK6.cjs");
3
+ const require_functions = require("../functions-ZH60FE7H.cjs");
4
+ const require_Endpoint = require("../Endpoint-D1L9qu5C.cjs");
4
5
  const require_surfaceEnv = require("../surfaceEnv-CNimK76p.cjs");
5
- const require_lazyAccessors = require("../lazyAccessors-Dx9NLwJZ.cjs");
6
+ const require_lazyAccessors = require("../lazyAccessors-hJKGv8Ay.cjs");
6
7
  exports.BUILT_IN_SECURITY_SCHEMES = require_EndpointFactory.BUILT_IN_SECURITY_SCHEMES;
7
8
  exports.Endpoint = require_Endpoint.Endpoint;
8
9
  exports.EndpointBuilder = require_EndpointFactory.EndpointBuilder;
@@ -21,4 +22,4 @@ exports.defaultEnvParser = require_surfaceEnv.defaultEnvParser;
21
22
  exports.envParserFor = require_surfaceEnv.envParserFor;
22
23
  exports.getSecurityScheme = require_EndpointFactory.getSecurityScheme;
23
24
  exports.isBuiltInSecurityScheme = require_EndpointFactory.isBuiltInSecurityScheme;
24
- exports.publishConstructEvents = require_lazyAccessors.publishConstructEvents;
25
+ exports.publishConstructEvents = require_functions.publishConstructEvents;
@@ -1,17 +1,8 @@
1
- import { t as StandardSchemaV1 } from "../index-CeEtxDmK.cjs";
2
- import { t as Construct } from "../Construct-DTqYvkPG.cjs";
3
- import { A as getSecurityScheme, C as Authorizer, D as OAuthFlows, E as OAuthFlow, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, a as EndpointContext, b as RlsContextExtractor, c as EndpointSchemas, d as ResponseBuilder, g as RLS_BYPASS, h as SessionAuth, i as Endpoint, j as isBuiltInSecurityScheme, k as createAuthorizer, l as EndpointSurface, m as NoAuthenticator, n as ConvertRouteParams, o as EndpointHandler, r as CookieFn, s as EndpointOutput, u as HeaderFn, v as RlsConfig, w as BUILT_IN_SECURITY_SCHEMES, x as ActorExtractor, y as RlsContext } from "../Endpoint-BkhPHCuX.cjs";
4
- import { n as EndpointBuilder, t as EndpointFactory } from "../EndpointFactory-n96CT_Ys.cjs";
1
+ import { s as publishConstructEvents } from "../Construct-BQALFCh2.cjs";
2
+ import { A as getSecurityScheme, C as Authorizer, D as OAuthFlows, E as OAuthFlow, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, a as EndpointContext, b as RlsContextExtractor, c as EndpointSchemas, d as ResponseBuilder, g as RLS_BYPASS, h as SessionAuth, i as Endpoint, j as isBuiltInSecurityScheme, k as createAuthorizer, l as EndpointSurface, m as NoAuthenticator, n as ConvertRouteParams, o as EndpointHandler, r as CookieFn, s as EndpointOutput, u as HeaderFn, v as RlsConfig, w as BUILT_IN_SECURITY_SCHEMES, x as ActorExtractor, y as RlsContext } from "../Endpoint-Dp5AKIXl.cjs";
3
+ import { n as EndpointBuilder, t as EndpointFactory } from "../EndpointFactory-FeFRmlDZ.cjs";
5
4
  import { EnvironmentParser } from "@geekmidas/envkit";
6
- import { EventPublisher, MappedEvent } from "@geekmidas/events";
7
- import { Logger } from "@geekmidas/logger";
8
- import { InferStandardSchema } from "@geekmidas/schema";
9
- import { Service, ServiceDiscovery } from "@geekmidas/services";
10
- import { AuditStorage } from "@geekmidas/audit";
11
5
  import { Context } from "hono";
12
- //#region src/publisher.d.ts
13
- export declare function publishConstructEvents<T extends EventPublisher<any> | undefined, OutSchema extends StandardSchemaV1 | undefined = undefined, TServiceName extends string = string, TServices extends Service[] = [], TAuditStorageServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined>(construct: Construct<Logger, TServiceName, T, OutSchema, TServices, TAuditStorageServiceName, TAuditStorage>, response: InferStandardSchema<OutSchema>, serviceDiscovery: ServiceDiscovery<any>, logger?: Logger): Promise<void>;
14
- //#endregion
15
6
  //#region src/endpoints/lazyAccessors.d.ts
16
7
  /**
17
8
  * Create a lazy header accessor for Hono.
@@ -56,5 +47,5 @@ export declare function defaultEnvParser(): EnvironmentParser<{}>;
56
47
  /** The parser for an endpoint, from its surface or the default. */
57
48
  export declare function envParserFor(surface: EndpointSurface | undefined): EnvironmentParser<{}>;
58
49
  //#endregion
59
- export { type ActorExtractor, type Authorizer, BUILT_IN_SECURITY_SCHEMES, type BuiltInSecuritySchemeId, type ConvertRouteParams, Endpoint, EndpointBuilder, type EndpointContext, EndpointFactory, type EndpointHandler, type EndpointOutput, type EndpointSchemas, type MappedAudit, NoAuthenticator, type OAuthFlow, type OAuthFlows, RLS_BYPASS, ResponseBuilder, type RlsBypass, type RlsConfig, type RlsContext, type RlsContextExtractor, type SecurityScheme, type SessionAuth, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme };
50
+ export { type ActorExtractor, type Authorizer, BUILT_IN_SECURITY_SCHEMES, type BuiltInSecuritySchemeId, type ConvertRouteParams, Endpoint, EndpointBuilder, type EndpointContext, EndpointFactory, type EndpointHandler, type EndpointOutput, type EndpointSchemas, type MappedAudit, NoAuthenticator, type OAuthFlow, type OAuthFlows, RLS_BYPASS, ResponseBuilder, type RlsBypass, type RlsConfig, type RlsContext, type RlsContextExtractor, type SecurityScheme, type SessionAuth, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
60
51
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/publisher.ts","../../src/endpoints/lazyAccessors.ts","../../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;;wBAgEsB,uBACrB,UAAU,iCACV,kBAAkB,0CAClB,sCACA,kBAAkB,gBAClB,kDACA,sBAAsB,sCAEtB,WAAW,UACV,QACA,cACA,GACA,WACA,WACA,0BACA,gBAED,UAAU,oBAAoB,YAC9B,kBAAkB,uBAClB,SAAQ,SAAyB;;;;;;;;wBCnElB,kBAAkB,GAAG,UAAU;;;;;;wBAqB/B,kBAAkB,GAAG,UAAU;;;;;wBAgC/B,wBACf,SAAS,wDACP;;;;;wBAoCa,wBACf,+BACA,mCACE;;;;wBAmHa,qBAAqB;;;;wBAUrB,qBAAqB;;;;;;;;;;wBC1MrB,oBAAoB;;wBASpB,aACf,SAAS,8BACP"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/endpoints/lazyAccessors.ts","../../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;wBAgBgB,kBAAkB,GAAG,UAAU;;;;;;wBAqB/B,kBAAkB,GAAG,UAAU;;;;;wBAgC/B,wBACf,SAAS,wDACP;;;;;wBAoCa,wBACf,+BACA,mCACE;;;;wBAmHa,qBAAqB;;;;wBAUrB,qBAAqB;;;;;;;;;;wBC1MrB,oBAAoB;;wBASpB,aACf,SAAS,8BACP"}
@@ -1,17 +1,8 @@
1
- import { t as StandardSchemaV1 } from "../index-CeEtxDmK.mjs";
2
- import { t as Construct } from "../Construct-pVadmURD.mjs";
3
- import { A as getSecurityScheme, C as Authorizer, D as OAuthFlows, E as OAuthFlow, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, a as EndpointContext, b as RlsContextExtractor, c as EndpointSchemas, d as ResponseBuilder, g as RLS_BYPASS, h as SessionAuth, i as Endpoint, j as isBuiltInSecurityScheme, k as createAuthorizer, l as EndpointSurface, m as NoAuthenticator, n as ConvertRouteParams, o as EndpointHandler, r as CookieFn, s as EndpointOutput, u as HeaderFn, v as RlsConfig, w as BUILT_IN_SECURITY_SCHEMES, x as ActorExtractor, y as RlsContext } from "../Endpoint-DkiD0GJs.mjs";
4
- import { n as EndpointBuilder, t as EndpointFactory } from "../EndpointFactory-WJzZfkTW.mjs";
1
+ import { s as publishConstructEvents } from "../Construct-QXnl3VqT.mjs";
2
+ import { A as getSecurityScheme, C as Authorizer, D as OAuthFlows, E as OAuthFlow, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, a as EndpointContext, b as RlsContextExtractor, c as EndpointSchemas, d as ResponseBuilder, g as RLS_BYPASS, h as SessionAuth, i as Endpoint, j as isBuiltInSecurityScheme, k as createAuthorizer, l as EndpointSurface, m as NoAuthenticator, n as ConvertRouteParams, o as EndpointHandler, r as CookieFn, s as EndpointOutput, u as HeaderFn, v as RlsConfig, w as BUILT_IN_SECURITY_SCHEMES, x as ActorExtractor, y as RlsContext } from "../Endpoint-DtI7heFm.mjs";
3
+ import { n as EndpointBuilder, t as EndpointFactory } from "../EndpointFactory-CgMDvERK.mjs";
5
4
  import { EnvironmentParser } from "@geekmidas/envkit";
6
- import { EventPublisher, MappedEvent } from "@geekmidas/events";
7
- import { Service, ServiceDiscovery } from "@geekmidas/services";
8
5
  import { Context } from "hono";
9
- import { AuditStorage } from "@geekmidas/audit";
10
- import { Logger } from "@geekmidas/logger";
11
- import { InferStandardSchema } from "@geekmidas/schema";
12
- //#region src/publisher.d.ts
13
- export declare function publishConstructEvents<T extends EventPublisher<any> | undefined, OutSchema extends StandardSchemaV1 | undefined = undefined, TServiceName extends string = string, TServices extends Service[] = [], TAuditStorageServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined>(construct: Construct<Logger, TServiceName, T, OutSchema, TServices, TAuditStorageServiceName, TAuditStorage>, response: InferStandardSchema<OutSchema>, serviceDiscovery: ServiceDiscovery<any>, logger?: Logger): Promise<void>;
14
- //#endregion
15
6
  //#region src/endpoints/lazyAccessors.d.ts
16
7
  /**
17
8
  * Create a lazy header accessor for Hono.
@@ -56,5 +47,5 @@ export declare function defaultEnvParser(): EnvironmentParser<{}>;
56
47
  /** The parser for an endpoint, from its surface or the default. */
57
48
  export declare function envParserFor(surface: EndpointSurface | undefined): EnvironmentParser<{}>;
58
49
  //#endregion
59
- export { type ActorExtractor, type Authorizer, BUILT_IN_SECURITY_SCHEMES, type BuiltInSecuritySchemeId, type ConvertRouteParams, Endpoint, EndpointBuilder, type EndpointContext, EndpointFactory, type EndpointHandler, type EndpointOutput, type EndpointSchemas, type MappedAudit, NoAuthenticator, type OAuthFlow, type OAuthFlows, RLS_BYPASS, ResponseBuilder, type RlsBypass, type RlsConfig, type RlsContext, type RlsContextExtractor, type SecurityScheme, type SessionAuth, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme };
50
+ export { type ActorExtractor, type Authorizer, BUILT_IN_SECURITY_SCHEMES, type BuiltInSecuritySchemeId, type ConvertRouteParams, Endpoint, EndpointBuilder, type EndpointContext, EndpointFactory, type EndpointHandler, type EndpointOutput, type EndpointSchemas, type MappedAudit, NoAuthenticator, type OAuthFlow, type OAuthFlows, RLS_BYPASS, ResponseBuilder, type RlsBypass, type RlsConfig, type RlsContext, type RlsContextExtractor, type SecurityScheme, type SessionAuth, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
60
51
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/publisher.ts","../../src/endpoints/lazyAccessors.ts","../../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;;wBAgEsB,uBACrB,UAAU,iCACV,kBAAkB,0CAClB,sCACA,kBAAkB,gBAClB,kDACA,sBAAsB,sCAEtB,WAAW,UACV,QACA,cACA,GACA,WACA,WACA,0BACA,gBAED,UAAU,oBAAoB,YAC9B,kBAAkB,uBAClB,SAAQ,SAAyB;;;;;;;;wBCnElB,kBAAkB,GAAG,UAAU;;;;;;wBAqB/B,kBAAkB,GAAG,UAAU;;;;;wBAgC/B,wBACf,SAAS,wDACP;;;;;wBAoCa,wBACf,+BACA,mCACE;;;;wBAmHa,qBAAqB;;;;wBAUrB,qBAAqB;;;;;;;;;;wBC1MrB,oBAAoB;;wBASpB,aACf,SAAS,8BACP"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/endpoints/lazyAccessors.ts","../../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;wBAgBgB,kBAAkB,GAAG,UAAU;;;;;;wBAqB/B,kBAAkB,GAAG,UAAU;;;;;wBAgC/B,wBACf,SAAS,wDACP;;;;;wBAoCa,wBACf,+BACA,mCACE;;;;wBAmHa,qBAAqB;;;;wBAUrB,qBAAqB;;;;;;;;;;wBC1MrB,oBAAoB;;wBASpB,aACf,SAAS,8BACP"}
@@ -1,5 +1,6 @@
1
- import { a as createAuthorizer, i as BUILT_IN_SECURITY_SCHEMES, n as EndpointBuilder, o as getSecurityScheme, r as RLS_BYPASS, s as isBuiltInSecurityScheme, t as EndpointFactory } from "../EndpointFactory-B9HAjDAP.mjs";
2
- import { n as ResponseBuilder, r as NoAuthenticator, t as Endpoint } from "../Endpoint-DO332Dnm.mjs";
1
+ import { a as createAuthorizer, i as BUILT_IN_SECURITY_SCHEMES, n as EndpointBuilder, o as getSecurityScheme, r as RLS_BYPASS, s as isBuiltInSecurityScheme, t as EndpointFactory } from "../EndpointFactory-BBdNeaGJ.mjs";
2
+ import { i as publishConstructEvents } from "../functions-DCIfCRR-.mjs";
3
+ import { n as ResponseBuilder, r as NoAuthenticator, t as Endpoint } from "../Endpoint-CQAeh1Rh.mjs";
3
4
  import { n as envParserFor, t as defaultEnvParser } from "../surfaceEnv-wMT5QzgZ.mjs";
4
- import { a as createHonoHeaders, i as createHonoCookies, l as publishConstructEvents, n as createApiGatewayHeaders, o as createNoopCookies, s as createNoopHeaders, t as createApiGatewayCookies } from "../lazyAccessors-BHtcqgz2.mjs";
5
+ import { a as createHonoHeaders, i as createHonoCookies, n as createApiGatewayHeaders, o as createNoopCookies, s as createNoopHeaders, t as createApiGatewayCookies } from "../lazyAccessors-CFanua0O.mjs";
5
6
  export { BUILT_IN_SECURITY_SCHEMES, Endpoint, EndpointBuilder, EndpointFactory, NoAuthenticator, RLS_BYPASS, ResponseBuilder, createApiGatewayCookies, createApiGatewayHeaders, createAuthorizer, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
@@ -1,5 +1,5 @@
1
1
  import { t as StandardSchemaV1 } from "./index-CeEtxDmK.mjs";
2
- import { r as Consumable } from "./construct-interface-BLG_BEH5.mjs";
2
+ import { r as Consumable } from "./construct-interface-_3zgxzXl.mjs";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { Service } from "@geekmidas/services";
5
5
  //#region src/external-api.d.ts
@@ -83,4 +83,4 @@ declare const fake: {
83
83
  declare function isFake(value: unknown): value is Fake;
84
84
  //#endregion
85
85
  export { fake as a, FetchHandler as i, ExternalApiOptions as n, isFake as o, Fake as r, ExternalApi as t };
86
- //# sourceMappingURL=external-api-CZHev1Oh.d.mts.map
86
+ //# sourceMappingURL=external-api-DS3mujT5.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-api-BKOb2jSC.d.cts","names":[],"sources":["../src/external-api.ts"],"mappings":";;;;;;KAmDK,MAAM,gBAAgB,oBAC1B,iBAAiB,YAAY;UAEb,mBAAmB,gBAAgB,kBAAkB;;;;;EAKrE,cAAc,SAAS;;EAEvB,aAAa;;EAEb,SAAS;IACR;IACA,aAAa,MAAM;QACd,UAAU,QAAQ;;cAGZ,YACZ,+BACA,gBAAgB,mBAAmB,kBACnC,8BACY,WAAW,OAAO;mBAeZ;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;mBAG9B;;UAGT;EAER,YACC,IAAI,cAAc,QACD,SAAS,mBAAmB,SAAS;EAoBvD,WAAW;UAWG;;;UAgBE;EAChB,MAAM,SAAS,UAAU,WAAW,QAAQ;;;;;;cAOvC;;KAGD,cAAc,QAClB,aAAa,0BAA0B,oBACpC,iBAAiB,WAAW;;;;;;;KASpB;YACD;WACD;;WAGE;;WAEA,SAAS;;WAGT;;WAEA;;WAEA;;;;;;;;cAUC;;EAEZ,IAAI,gBAAc,SACR,cAAY;IACV,aAAa,cAAc;MACpC;;EAUH,MAAM,gBAAc,eACN;IACF;IAAc,aAAa,cAAc;MAClD;;;iBAYY,OAAO,iBAAiB,SAAS"}
1
+ {"version":3,"file":"external-api-DS3mujT5.d.mts","names":[],"sources":["../src/external-api.ts"],"mappings":";;;;;;KAmDK,MAAM,gBAAgB,oBAC1B,iBAAiB,YAAY;UAEb,mBAAmB,gBAAgB,kBAAkB;;;;;EAKrE,cAAc,SAAS;;EAEvB,aAAa;;EAEb,SAAS;IACR;IACA,aAAa,MAAM;QACd,UAAU,QAAQ;;cAGZ,YACZ,+BACA,gBAAgB,mBAAmB,kBACnC,8BACY,WAAW,OAAO;mBAeZ;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;mBAG9B;;UAGT;EAER,YACC,IAAI,cAAc,QACD,SAAS,mBAAmB,SAAS;EAoBvD,WAAW;UAWG;;;UAgBE;EAChB,MAAM,SAAS,UAAU,WAAW,QAAQ;;;;;;cAOvC;;KAGD,cAAc,QAClB,aAAa,0BAA0B,oBACpC,iBAAiB,WAAW;;;;;;;KASpB;YACD;WACD;;WAGE;;WAEA,SAAS;;WAGT;;WAEA;;WAEA;;;;;;;;cAUC;;EAEZ,IAAI,gBAAc,SACR,cAAY;IACV,aAAa,cAAc;MACpC;;EAUH,MAAM,gBAAc,eACN;IACF;IAAc,aAAa,cAAc;MAClD;;;iBAYY,OAAO,iBAAiB,SAAS"}
@@ -1,5 +1,5 @@
1
1
  import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
2
- import { r as Consumable } from "./construct-interface-DcNaRKoC.cjs";
2
+ import { r as Consumable } from "./construct-interface-_xi4BPN8.cjs";
3
3
  import { Service } from "@geekmidas/services";
4
4
  import { ConstructName, Declaration } from "@geekmidas/manifest";
5
5
  //#region src/external-api.d.ts
@@ -83,4 +83,4 @@ declare const fake: {
83
83
  declare function isFake(value: unknown): value is Fake;
84
84
  //#endregion
85
85
  export { fake as a, FetchHandler as i, ExternalApiOptions as n, isFake as o, Fake as r, ExternalApi as t };
86
- //# sourceMappingURL=external-api-BKOb2jSC.d.cts.map
86
+ //# sourceMappingURL=external-api-LBfE-q3g.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-api-CZHev1Oh.d.mts","names":[],"sources":["../src/external-api.ts"],"mappings":";;;;;;KAmDK,MAAM,gBAAgB,oBAC1B,iBAAiB,YAAY;UAEb,mBAAmB,gBAAgB,kBAAkB;;;;;EAKrE,cAAc,SAAS;;EAEvB,aAAa;;EAEb,SAAS;IACR;IACA,aAAa,MAAM;QACd,UAAU,QAAQ;;cAGZ,YACZ,+BACA,gBAAgB,mBAAmB,kBACnC,8BACY,WAAW,OAAO;mBAeZ;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;mBAG9B;;UAGT;EAER,YACC,IAAI,cAAc,QACD,SAAS,mBAAmB,SAAS;EAoBvD,WAAW;UAWG;;;UAgBE;EAChB,MAAM,SAAS,UAAU,WAAW,QAAQ;;;;;;cAOvC;;KAGD,cAAc,QAClB,aAAa,0BAA0B,oBACpC,iBAAiB,WAAW;;;;;;;KASpB;YACD;WACD;;WAGE;;WAEA,SAAS;;WAGT;;WAEA;;WAEA;;;;;;;;cAUC;;EAEZ,IAAI,gBAAc,SACR,cAAY;IACV,aAAa,cAAc;MACpC;;EAUH,MAAM,gBAAc,eACN;IACF;IAAc,aAAa,cAAc;MAClD;;;iBAYY,OAAO,iBAAiB,SAAS"}
1
+ {"version":3,"file":"external-api-LBfE-q3g.d.cts","names":[],"sources":["../src/external-api.ts"],"mappings":";;;;;;KAmDK,MAAM,gBAAgB,oBAC1B,iBAAiB,YAAY;UAEb,mBAAmB,gBAAgB,kBAAkB;;;;;EAKrE,cAAc,SAAS;;EAEvB,aAAa;;EAEb,SAAS;IACR;IACA,aAAa,MAAM;QACd,UAAU,QAAQ;;cAGZ,YACZ,+BACA,gBAAgB,mBAAmB,kBACnC,8BACY,WAAW,OAAO;mBAeZ;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;mBAG9B;;UAGT;EAER,YACC,IAAI,cAAc,QACD,SAAS,mBAAmB,SAAS;EAoBvD,WAAW;UAWG;;;UAgBE;EAChB,MAAM,SAAS,UAAU,WAAW,QAAQ;;;;;;cAOvC;;KAGD,cAAc,QAClB,aAAa,0BAA0B,oBACpC,iBAAiB,WAAW;;;;;;;KASpB;YACD;WACD;;WAGE;;WAEA,SAAS;;WAGT;;WAEA;;WAEA;;;;;;;;cAUC;;EAEZ,IAAI,gBAAc,SACR,cAAY;IACV,aAAa,cAAc;MACpC;;EAUH,MAAM,gBAAc,eACN;IACF;IAAc,aAAa,cAAc;MAClD;;;iBAYY,OAAO,iBAAiB,SAAS"}
@@ -1,2 +1,2 @@
1
- import { a as fake, i as FetchHandler, n as ExternalApiOptions, o as isFake, r as Fake, t as ExternalApi } from "./external-api-BKOb2jSC.cjs";
1
+ import { a as fake, i as FetchHandler, n as ExternalApiOptions, o as isFake, r as Fake, t as ExternalApi } from "./external-api-LBfE-q3g.cjs";
2
2
  export { ExternalApi, ExternalApiOptions, Fake, FetchHandler, fake, isFake };
@@ -1,2 +1,2 @@
1
- import { a as fake, i as FetchHandler, n as ExternalApiOptions, o as isFake, r as Fake, t as ExternalApi } from "./external-api-CZHev1Oh.mjs";
1
+ import { a as fake, i as FetchHandler, n as ExternalApiOptions, o as isFake, r as Fake, t as ExternalApi } from "./external-api-DS3mujT5.mjs";
2
2
  export { ExternalApi, ExternalApiOptions, Fake, FetchHandler, fake, isFake };
@@ -1,4 +1,4 @@
1
- import { i as Declarable, n as Construct } from "./construct-interface-DcNaRKoC.cjs";
1
+ import { i as Declarable, n as Construct } from "./construct-interface-_xi4BPN8.cjs";
2
2
  import { Service } from "@geekmidas/services";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { StorageClient } from "@geekmidas/storage";
@@ -1,4 +1,4 @@
1
- import { i as Declarable, n as Construct } from "./construct-interface-BLG_BEH5.mjs";
1
+ import { i as Declarable, n as Construct } from "./construct-interface-_3zgxzXl.mjs";
2
2
  import { ConstructName, Declaration } from "@geekmidas/manifest";
3
3
  import { StorageClient } from "@geekmidas/storage";
4
4
  import { Service } from "@geekmidas/services";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_functions = require("../functions-DKN6aQWJ.cjs");
2
+ const require_functions = require("../functions-ZH60FE7H.cjs");
3
3
  exports.BaseFunctionBuilder = require_functions.BaseFunctionBuilder;
4
4
  exports.Function = require_functions.Function;
5
5
  exports.FunctionBuilder = require_functions.FunctionBuilder;
@@ -1,2 +1,2 @@
1
- import { a as FunctionHandler, i as FunctionContext, n as BaseFunctionBuilder, r as Function, t as FunctionBuilder } from "../index-Dzkdm-IE.cjs";
1
+ import { a as FunctionHandler, i as FunctionContext, n as BaseFunctionBuilder, r as Function, t as FunctionBuilder } from "../index-B0kxstwf.cjs";
2
2
  export { BaseFunctionBuilder, Function, FunctionBuilder, type FunctionContext, type FunctionHandler };
@@ -1,2 +1,2 @@
1
- import { a as FunctionHandler, i as FunctionContext, n as BaseFunctionBuilder, r as Function, t as FunctionBuilder } from "../index-DwveWr3c.mjs";
1
+ import { a as FunctionHandler, i as FunctionContext, n as BaseFunctionBuilder, r as Function, t as FunctionBuilder } from "../index-CjVEjOw0.mjs";
2
2
  export { BaseFunctionBuilder, Function, FunctionBuilder, type FunctionContext, type FunctionHandler };
@@ -1,2 +1,2 @@
1
- import { n as Function, r as BaseFunctionBuilder, t as FunctionBuilder } from "../functions-DlFm8HmH.mjs";
1
+ import { n as Function, r as BaseFunctionBuilder, t as FunctionBuilder } from "../functions-DCIfCRR-.mjs";
2
2
  export { BaseFunctionBuilder, Function, FunctionBuilder };