@geekmidas/constructs 10.0.0-alpha.1 → 10.0.0-alpha.100

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 (422) hide show
  1. package/README.md +223 -158
  2. package/dist/{Construct-CdhThxDI.mjs → Construct-B1vGBPme.mjs} +45 -33
  3. package/dist/Construct-B1vGBPme.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-roId57cU.cjs → Construct-DUSXuTHP.cjs} +65 -47
  7. package/dist/Construct-DUSXuTHP.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-DI3nKoic.d.cts +45 -0
  11. package/dist/Cron-DI3nKoic.d.cts.map +1 -0
  12. package/dist/Cron-uYAHPnp7.d.mts +45 -0
  13. package/dist/Cron-uYAHPnp7.d.mts.map +1 -0
  14. package/dist/CronBuilder-C0Ek1-RA.cjs +121 -0
  15. package/dist/CronBuilder-C0Ek1-RA.cjs.map +1 -0
  16. package/dist/CronBuilder-DaSUm2Na.d.mts +47 -0
  17. package/dist/CronBuilder-DaSUm2Na.d.mts.map +1 -0
  18. package/dist/CronBuilder-Dmix_Pen.mjs +109 -0
  19. package/dist/CronBuilder-Dmix_Pen.mjs.map +1 -0
  20. package/dist/CronBuilder-g1lZLWyG.d.cts +47 -0
  21. package/dist/CronBuilder-g1lZLWyG.d.cts.map +1 -0
  22. package/dist/{Endpoint-BTj58Gob.mjs → Endpoint-BG4UJ9oA.mjs} +146 -109
  23. package/dist/Endpoint-BG4UJ9oA.mjs.map +1 -0
  24. package/dist/{Endpoint-BBkV6l0k.cjs → Endpoint-BoUg8ocM.cjs} +174 -131
  25. package/dist/Endpoint-BoUg8ocM.cjs.map +1 -0
  26. package/dist/{Endpoint-BKR5QH6O.d.mts → Endpoint-Du-NwPX2.d.mts} +83 -91
  27. package/dist/Endpoint-Du-NwPX2.d.mts.map +1 -0
  28. package/dist/{Endpoint-BQ9O0P1w.d.cts → Endpoint-aCvBMPoH.d.cts} +82 -90
  29. package/dist/Endpoint-aCvBMPoH.d.cts.map +1 -0
  30. package/dist/{EndpointFactory-BejSTzbB.mjs → EndpointFactory-BDtsrEvJ.mjs} +60 -77
  31. package/dist/EndpointFactory-BDtsrEvJ.mjs.map +1 -0
  32. package/dist/{EndpointFactory-DYoGLaIT.cjs → EndpointFactory-DJ7gXLpR.cjs} +96 -113
  33. package/dist/EndpointFactory-DJ7gXLpR.cjs.map +1 -0
  34. package/dist/{index-D5zqAJ2e.d.cts → EndpointFactory-DMYdJCOj.d.mts} +78 -134
  35. package/dist/EndpointFactory-DMYdJCOj.d.mts.map +1 -0
  36. package/dist/{index-Cvz551AO.d.mts → EndpointFactory-I7s1co3Y.d.cts} +79 -135
  37. package/dist/EndpointFactory-I7s1co3Y.d.cts.map +1 -0
  38. package/dist/Function-DuqGcbOI.d.mts +76 -0
  39. package/dist/Function-DuqGcbOI.d.mts.map +1 -0
  40. package/dist/Function-Pu-1kKZz.d.cts +76 -0
  41. package/dist/Function-Pu-1kKZz.d.cts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-7aYNdqJq.mjs → HonoEndpointAdaptor-PtPlbeKY.mjs} +75 -57
  43. package/dist/HonoEndpointAdaptor-PtPlbeKY.mjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-wMsCyMgt.cjs → HonoEndpointAdaptor-zVzVLJEO.cjs} +83 -62
  45. package/dist/HonoEndpointAdaptor-zVzVLJEO.cjs.map +1 -0
  46. package/dist/Queue-A3wfD0it.cjs +109 -0
  47. package/dist/Queue-A3wfD0it.cjs.map +1 -0
  48. package/dist/Queue-D6USGS4q.mjs +104 -0
  49. package/dist/Queue-D6USGS4q.mjs.map +1 -0
  50. package/dist/{Queue-D6WeziRD.d.cts → Queue-DlsHRzUp.d.mts} +48 -48
  51. package/dist/Queue-DlsHRzUp.d.mts.map +1 -0
  52. package/dist/{Queue-DpUeqdC8.d.mts → Queue-HPyi0e1i.d.cts} +49 -49
  53. package/dist/Queue-HPyi0e1i.d.cts.map +1 -0
  54. package/dist/QueueBuilder-BjuF0UBl.cjs +135 -0
  55. package/dist/QueueBuilder-BjuF0UBl.cjs.map +1 -0
  56. package/dist/QueueBuilder-Cue73M4t.mjs +118 -0
  57. package/dist/QueueBuilder-Cue73M4t.mjs.map +1 -0
  58. package/dist/QueueBuilder-OSi6LkV9.d.cts +75 -0
  59. package/dist/QueueBuilder-OSi6LkV9.d.cts.map +1 -0
  60. package/dist/QueueBuilder-QHsnVt1P.d.mts +75 -0
  61. package/dist/QueueBuilder-QHsnVt1P.d.mts.map +1 -0
  62. package/dist/{Subscriber-4rBJgDKI.d.mts → Subscriber-Bpp02cGr.d.cts} +30 -21
  63. package/dist/Subscriber-Bpp02cGr.d.cts.map +1 -0
  64. package/dist/{Subscriber-DVQowdyj.d.cts → Subscriber-CtN9R48-.d.mts} +29 -20
  65. package/dist/Subscriber-CtN9R48-.d.mts.map +1 -0
  66. package/dist/SubscriberBuilder-CDy4nHCz.mjs +134 -0
  67. package/dist/SubscriberBuilder-CDy4nHCz.mjs.map +1 -0
  68. package/dist/SubscriberBuilder-CuCMFpYW.d.mts +67 -0
  69. package/dist/SubscriberBuilder-CuCMFpYW.d.mts.map +1 -0
  70. package/dist/SubscriberBuilder-D_owVoHo.cjs +145 -0
  71. package/dist/SubscriberBuilder-D_owVoHo.cjs.map +1 -0
  72. package/dist/SubscriberBuilder-g3fAVWgs.d.cts +67 -0
  73. package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +1 -0
  74. package/dist/Topic-D74b5cgs.mjs +99 -0
  75. package/dist/Topic-D74b5cgs.mjs.map +1 -0
  76. package/dist/Topic-GHxcU8AG.cjs +104 -0
  77. package/dist/Topic-GHxcU8AG.cjs.map +1 -0
  78. package/dist/adaptors/aws.cjs +332 -188
  79. package/dist/adaptors/aws.cjs.map +1 -1
  80. package/dist/adaptors/aws.d.cts +114 -44
  81. package/dist/adaptors/aws.d.cts.map +1 -1
  82. package/dist/adaptors/aws.d.mts +114 -44
  83. package/dist/adaptors/aws.d.mts.map +1 -1
  84. package/dist/adaptors/aws.mjs +308 -166
  85. package/dist/adaptors/aws.mjs.map +1 -1
  86. package/dist/adaptors/hono.cjs +3 -11
  87. package/dist/adaptors/hono.d.cts +7 -16
  88. package/dist/adaptors/hono.d.cts.map +1 -1
  89. package/dist/adaptors/hono.d.mts +8 -17
  90. package/dist/adaptors/hono.d.mts.map +1 -1
  91. package/dist/adaptors/hono.mjs +2 -11
  92. package/dist/adaptors/testing.cjs +743 -90
  93. package/dist/adaptors/testing.cjs.map +1 -1
  94. package/dist/adaptors/testing.d.cts +351 -54
  95. package/dist/adaptors/testing.d.cts.map +1 -1
  96. package/dist/adaptors/testing.d.mts +351 -54
  97. package/dist/adaptors/testing.d.mts.map +1 -1
  98. package/dist/adaptors/testing.mjs +706 -71
  99. package/dist/adaptors/testing.mjs.map +1 -1
  100. package/dist/auth-BMCJN30Y.d.cts +268 -0
  101. package/dist/auth-BMCJN30Y.d.cts.map +1 -0
  102. package/dist/auth-CcuceLYo.d.mts +268 -0
  103. package/dist/auth-CcuceLYo.d.mts.map +1 -0
  104. package/dist/auth.cjs +302 -34
  105. package/dist/auth.cjs.map +1 -1
  106. package/dist/auth.d.cts +2 -108
  107. package/dist/auth.d.mts +2 -108
  108. package/dist/auth.mjs +290 -28
  109. package/dist/auth.mjs.map +1 -1
  110. package/dist/{cache-CdQ7OLpR.d.cts → cache-CXh6GIgb.d.mts} +4 -7
  111. package/dist/cache-CXh6GIgb.d.mts.map +1 -0
  112. package/dist/{cache-DYoJFcfd.d.mts → cache-DnGDGly3.d.cts} +4 -7
  113. package/dist/cache-DnGDGly3.d.cts.map +1 -0
  114. package/dist/cache.cjs +68 -2
  115. package/dist/cache.cjs.map +1 -0
  116. package/dist/cache.d.cts +1 -2
  117. package/dist/cache.d.mts +1 -2
  118. package/dist/cache.mjs +67 -2
  119. package/dist/cache.mjs.map +1 -0
  120. package/dist/cipher-C1lEFX63.mjs +225 -0
  121. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  122. package/dist/cipher-CVxfwLjk.cjs +332 -0
  123. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  124. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  125. package/dist/clone-EKNovYHu.mjs.map +1 -0
  126. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  127. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  128. package/dist/{construct-interface-BqwRNYA2.d.mts → construct-interface-B1AfqRl4.d.cts} +43 -12
  129. package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
  130. package/dist/{construct-interface-D2nNkHUN.d.cts → construct-interface-DluK3_da.d.mts} +43 -12
  131. package/dist/construct-interface-DluK3_da.d.mts.map +1 -0
  132. package/dist/construct-interface.cjs +113 -7
  133. package/dist/construct-interface.cjs.map +1 -0
  134. package/dist/construct-interface.d.cts +2 -2
  135. package/dist/construct-interface.d.mts +2 -2
  136. package/dist/construct-interface.mjs +106 -2
  137. package/dist/construct-interface.mjs.map +1 -0
  138. package/dist/credential.cjs +77 -17
  139. package/dist/credential.cjs.map +1 -1
  140. package/dist/credential.d.cts +34 -9
  141. package/dist/credential.d.cts.map +1 -1
  142. package/dist/credential.d.mts +34 -9
  143. package/dist/credential.d.mts.map +1 -1
  144. package/dist/credential.mjs +71 -13
  145. package/dist/credential.mjs.map +1 -1
  146. package/dist/crons/index.cjs +189 -85
  147. package/dist/crons/index.cjs.map +1 -1
  148. package/dist/crons/index.d.cts +70 -48
  149. package/dist/crons/index.d.cts.map +1 -1
  150. package/dist/crons/index.d.mts +70 -48
  151. package/dist/crons/index.d.mts.map +1 -1
  152. package/dist/crons/index.mjs +183 -81
  153. package/dist/crons/index.mjs.map +1 -1
  154. package/dist/database/kysely.cjs +4 -181
  155. package/dist/database/kysely.d.cts +2 -152
  156. package/dist/database/kysely.d.mts +2 -152
  157. package/dist/database/kysely.mjs +2 -180
  158. package/dist/email.cjs +25 -12
  159. package/dist/email.cjs.map +1 -1
  160. package/dist/email.d.cts +3 -7
  161. package/dist/email.d.cts.map +1 -1
  162. package/dist/email.d.mts +3 -7
  163. package/dist/email.d.mts.map +1 -1
  164. package/dist/email.mjs +16 -3
  165. package/dist/email.mjs.map +1 -1
  166. package/dist/encryption.cjs +96 -0
  167. package/dist/encryption.cjs.map +1 -0
  168. package/dist/encryption.d.cts +117 -0
  169. package/dist/encryption.d.cts.map +1 -0
  170. package/dist/encryption.d.mts +117 -0
  171. package/dist/encryption.d.mts.map +1 -0
  172. package/dist/encryption.mjs +83 -0
  173. package/dist/encryption.mjs.map +1 -0
  174. package/dist/endpoints/index.cjs +8 -11
  175. package/dist/endpoints/index.d.cts +51 -7
  176. package/dist/endpoints/index.d.cts.map +1 -0
  177. package/dist/endpoints/index.d.mts +51 -7
  178. package/dist/endpoints/index.d.mts.map +1 -0
  179. package/dist/endpoints/index.mjs +6 -11
  180. package/dist/external-api-MJ8id87V.d.mts +105 -0
  181. package/dist/external-api-MJ8id87V.d.mts.map +1 -0
  182. package/dist/external-api-O107yzZJ.d.cts +105 -0
  183. package/dist/external-api-O107yzZJ.d.cts.map +1 -0
  184. package/dist/external-api.cjs +142 -0
  185. package/dist/external-api.cjs.map +1 -0
  186. package/dist/external-api.d.cts +2 -0
  187. package/dist/external-api.d.mts +2 -0
  188. package/dist/external-api.mjs +139 -0
  189. package/dist/external-api.mjs.map +1 -0
  190. package/dist/file-server.cjs +42 -10
  191. package/dist/file-server.cjs.map +1 -1
  192. package/dist/file-server.d.cts +6 -10
  193. package/dist/file-server.d.cts.map +1 -1
  194. package/dist/file-server.d.mts +6 -10
  195. package/dist/file-server.d.mts.map +1 -1
  196. package/dist/file-server.mjs +34 -2
  197. package/dist/file-server.mjs.map +1 -1
  198. package/dist/functions/index.cjs +2 -6
  199. package/dist/functions/index.d.cts +3 -4
  200. package/dist/functions/index.d.mts +3 -4
  201. package/dist/functions/index.mjs +2 -6
  202. package/dist/{functions-Cpff1uZH.mjs → functions-BFizikJU.mjs} +394 -243
  203. package/dist/functions-BFizikJU.mjs.map +1 -0
  204. package/dist/{functions-DukjG8ov.cjs → functions-CfzJG9hK.cjs} +432 -275
  205. package/dist/functions-CfzJG9hK.cjs.map +1 -0
  206. package/dist/index-BuzRvKOQ.d.cts +115 -0
  207. package/dist/index-BuzRvKOQ.d.cts.map +1 -0
  208. package/dist/index-CTkKOer4.d.mts +115 -0
  209. package/dist/index-CTkKOer4.d.mts.map +1 -0
  210. package/dist/index-CeEtxDmK.d.cts +79 -0
  211. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  212. package/dist/index-CeEtxDmK.d.mts +79 -0
  213. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  214. package/dist/index.cjs +6 -3
  215. package/dist/index.d.cts +27 -4
  216. package/dist/index.d.cts.map +1 -0
  217. package/dist/index.d.mts +27 -4
  218. package/dist/index.d.mts.map +1 -0
  219. package/dist/index.mjs +3 -3
  220. package/dist/kms-B-Hm3d5r.cjs +85 -0
  221. package/dist/kms-B-Hm3d5r.cjs.map +1 -0
  222. package/dist/kms-BdUlMJEZ.mjs +85 -0
  223. package/dist/kms-BdUlMJEZ.mjs.map +1 -0
  224. package/dist/kysely-Bii4l6eP.mjs +370 -0
  225. package/dist/kysely-Bii4l6eP.mjs.map +1 -0
  226. package/dist/kysely-CO_Dk43W.cjs +383 -0
  227. package/dist/kysely-CO_Dk43W.cjs.map +1 -0
  228. package/dist/kysely-D0bpzgPs.d.cts +175 -0
  229. package/dist/kysely-D0bpzgPs.d.cts.map +1 -0
  230. package/dist/kysely-DUqC3Ie0.d.mts +175 -0
  231. package/dist/kysely-DUqC3Ie0.d.mts.map +1 -0
  232. package/dist/{telemetry-C3L0iS28.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +3 -6
  233. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  234. package/dist/{telemetry-D7bVFLGi.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +3 -6
  235. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  236. package/dist/{lazyAccessors-DM6HcXQk.mjs → lazyAccessors-CFanua0O.mjs} +20 -21
  237. package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
  238. package/dist/{lazyAccessors-DrJj8NpA.cjs → lazyAccessors-hJKGv8Ay.cjs} +60 -62
  239. package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
  240. package/dist/mobile-app.cjs +73 -0
  241. package/dist/mobile-app.cjs.map +1 -0
  242. package/dist/mobile-app.d.cts +61 -0
  243. package/dist/mobile-app.d.cts.map +1 -0
  244. package/dist/mobile-app.d.mts +61 -0
  245. package/dist/mobile-app.d.mts.map +1 -0
  246. package/dist/mobile-app.mjs +72 -0
  247. package/dist/mobile-app.mjs.map +1 -0
  248. package/dist/object-storage.cjs +18 -10
  249. package/dist/object-storage.cjs.map +1 -1
  250. package/dist/object-storage.d.cts +3 -7
  251. package/dist/object-storage.d.cts.map +1 -1
  252. package/dist/object-storage.d.mts +3 -7
  253. package/dist/object-storage.d.mts.map +1 -1
  254. package/dist/object-storage.mjs +11 -3
  255. package/dist/object-storage.mjs.map +1 -1
  256. package/dist/processAudits-BRRVVHUB.mjs +131 -0
  257. package/dist/processAudits-BRRVVHUB.mjs.map +1 -0
  258. package/dist/processAudits-DasOZjPl.cjs +154 -0
  259. package/dist/processAudits-DasOZjPl.cjs.map +1 -0
  260. package/dist/queue/index.cjs +6 -189
  261. package/dist/queue/index.d.cts +3 -60
  262. package/dist/queue/index.d.mts +3 -60
  263. package/dist/queue/index.mjs +3 -186
  264. package/dist/rest-api.cjs +92 -63
  265. package/dist/rest-api.cjs.map +1 -1
  266. package/dist/rest-api.d.cts +81 -61
  267. package/dist/rest-api.d.cts.map +1 -1
  268. package/dist/rest-api.d.mts +81 -61
  269. package/dist/rest-api.d.mts.map +1 -1
  270. package/dist/rest-api.mjs +84 -55
  271. package/dist/rest-api.mjs.map +1 -1
  272. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  273. package/dist/runSubscriber-BHvJ8POr.mjs +109 -0
  274. package/dist/runSubscriber-BHvJ8POr.mjs.map +1 -0
  275. package/dist/runSubscriber-D8nLXIv1.cjs +126 -0
  276. package/dist/runSubscriber-D8nLXIv1.cjs.map +1 -0
  277. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  278. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  279. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  280. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  281. package/dist/site.cjs +35 -9
  282. package/dist/site.cjs.map +1 -1
  283. package/dist/site.d.cts +25 -22
  284. package/dist/site.d.cts.map +1 -1
  285. package/dist/site.d.mts +25 -22
  286. package/dist/site.d.mts.map +1 -1
  287. package/dist/site.mjs +31 -5
  288. package/dist/site.mjs.map +1 -1
  289. package/dist/stages-BSCF19o2.d.cts +56 -0
  290. package/dist/stages-BSCF19o2.d.cts.map +1 -0
  291. package/dist/stages-BSCF19o2.d.mts +56 -0
  292. package/dist/stages-BSCF19o2.d.mts.map +1 -0
  293. package/dist/subscribers/index.cjs +111 -101
  294. package/dist/subscribers/index.cjs.map +1 -1
  295. package/dist/subscribers/index.d.cts +44 -56
  296. package/dist/subscribers/index.d.cts.map +1 -1
  297. package/dist/subscribers/index.d.mts +44 -56
  298. package/dist/subscribers/index.d.mts.map +1 -1
  299. package/dist/subscribers/index.mjs +108 -98
  300. package/dist/subscribers/index.mjs.map +1 -1
  301. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  302. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  303. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  304. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  305. package/dist/telemetry-B48RLjyk.d.cts +40 -0
  306. package/dist/telemetry-B48RLjyk.d.cts.map +1 -0
  307. package/dist/telemetry-DRtT1_0A.d.mts +40 -0
  308. package/dist/telemetry-DRtT1_0A.d.mts.map +1 -0
  309. package/dist/telemetry.cjs +56 -0
  310. package/dist/telemetry.cjs.map +1 -0
  311. package/dist/telemetry.d.cts +2 -0
  312. package/dist/telemetry.d.mts +2 -0
  313. package/dist/telemetry.mjs +55 -0
  314. package/dist/telemetry.mjs.map +1 -0
  315. package/dist/topic/index.cjs +3 -137
  316. package/dist/topic/index.d.cts +2 -32
  317. package/dist/topic/index.d.mts +2 -32
  318. package/dist/topic/index.mjs +2 -134
  319. package/dist/tracing-CxaZ98IB.mjs +110 -0
  320. package/dist/tracing-CxaZ98IB.mjs.map +1 -0
  321. package/dist/tracing-DPMidF_r.cjs +127 -0
  322. package/dist/tracing-DPMidF_r.cjs.map +1 -0
  323. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  324. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  325. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  326. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  327. package/dist/types.d.cts +1 -1
  328. package/dist/types.d.mts +1 -1
  329. package/dist/types.mjs +1 -0
  330. package/dist/worker.cjs +191 -0
  331. package/dist/worker.cjs.map +1 -0
  332. package/dist/worker.d.cts +171 -0
  333. package/dist/worker.d.cts.map +1 -0
  334. package/dist/worker.d.mts +171 -0
  335. package/dist/worker.d.mts.map +1 -0
  336. package/dist/worker.mjs +190 -0
  337. package/dist/worker.mjs.map +1 -0
  338. package/package.json +116 -70
  339. package/dist/AWSScheduledFunction-9bJS4WdJ.d.cts +0 -122
  340. package/dist/AWSScheduledFunction-9bJS4WdJ.d.cts.map +0 -1
  341. package/dist/AWSScheduledFunction-BJjj8B5V.mjs +0 -243
  342. package/dist/AWSScheduledFunction-BJjj8B5V.mjs.map +0 -1
  343. package/dist/AWSScheduledFunction-BO5iEMSh.d.mts +0 -122
  344. package/dist/AWSScheduledFunction-BO5iEMSh.d.mts.map +0 -1
  345. package/dist/AWSScheduledFunction-qu4ieRZR.cjs +0 -255
  346. package/dist/AWSScheduledFunction-qu4ieRZR.cjs.map +0 -1
  347. package/dist/Construct-B-xc0SE9.d.mts +0 -104
  348. package/dist/Construct-B-xc0SE9.d.mts.map +0 -1
  349. package/dist/Construct-CdhThxDI.mjs.map +0 -1
  350. package/dist/Construct-WhCXIOPV.d.cts +0 -104
  351. package/dist/Construct-WhCXIOPV.d.cts.map +0 -1
  352. package/dist/Construct-roId57cU.cjs.map +0 -1
  353. package/dist/Endpoint-BBkV6l0k.cjs.map +0 -1
  354. package/dist/Endpoint-BKR5QH6O.d.mts.map +0 -1
  355. package/dist/Endpoint-BQ9O0P1w.d.cts.map +0 -1
  356. package/dist/Endpoint-BTj58Gob.mjs.map +0 -1
  357. package/dist/EndpointFactory-BejSTzbB.mjs.map +0 -1
  358. package/dist/EndpointFactory-DYoGLaIT.cjs.map +0 -1
  359. package/dist/HonoEndpointAdaptor-7aYNdqJq.mjs.map +0 -1
  360. package/dist/HonoEndpointAdaptor-wMsCyMgt.cjs.map +0 -1
  361. package/dist/Queue-D6WeziRD.d.cts.map +0 -1
  362. package/dist/Queue-DpUeqdC8.d.mts.map +0 -1
  363. package/dist/Subscriber-4rBJgDKI.d.mts.map +0 -1
  364. package/dist/Subscriber-DVQowdyj.d.cts.map +0 -1
  365. package/dist/Topic-Ohx9dvWr.d.cts +0 -91
  366. package/dist/Topic-Ohx9dvWr.d.cts.map +0 -1
  367. package/dist/Topic-cmy2jOUy.d.mts +0 -91
  368. package/dist/Topic-cmy2jOUy.d.mts.map +0 -1
  369. package/dist/auth.d.cts.map +0 -1
  370. package/dist/auth.d.mts.map +0 -1
  371. package/dist/cache-0ANvRQnD.mjs +0 -51
  372. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  373. package/dist/cache-3WSvAulx.cjs +0 -57
  374. package/dist/cache-3WSvAulx.cjs.map +0 -1
  375. package/dist/cache-CdQ7OLpR.d.cts.map +0 -1
  376. package/dist/cache-DYoJFcfd.d.mts.map +0 -1
  377. package/dist/clone-DblgEZZa.mjs.map +0 -1
  378. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  379. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  380. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  381. package/dist/construct-interface-BqwRNYA2.d.mts.map +0 -1
  382. package/dist/construct-interface-D2nNkHUN.d.cts.map +0 -1
  383. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  384. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  385. package/dist/database/kysely.cjs.map +0 -1
  386. package/dist/database/kysely.d.cts.map +0 -1
  387. package/dist/database/kysely.d.mts.map +0 -1
  388. package/dist/database/kysely.mjs.map +0 -1
  389. package/dist/functions-Cpff1uZH.mjs.map +0 -1
  390. package/dist/functions-DukjG8ov.cjs.map +0 -1
  391. package/dist/index-BTvozlUD.d.cts +0 -163
  392. package/dist/index-BTvozlUD.d.cts.map +0 -1
  393. package/dist/index-Cvz551AO.d.mts.map +0 -1
  394. package/dist/index-D5zqAJ2e.d.cts.map +0 -1
  395. package/dist/index-L7pz0R0T.d.mts +0 -162
  396. package/dist/index-L7pz0R0T.d.mts.map +0 -1
  397. package/dist/lazyAccessors-DM6HcXQk.mjs.map +0 -1
  398. package/dist/lazyAccessors-DrJj8NpA.cjs.map +0 -1
  399. package/dist/processAudits-Bc8rz6Ev.cjs +0 -92
  400. package/dist/processAudits-Bc8rz6Ev.cjs.map +0 -1
  401. package/dist/processAudits-D89tICM4.mjs +0 -80
  402. package/dist/processAudits-D89tICM4.mjs.map +0 -1
  403. package/dist/publisher-CGEo8UKD.mjs +0 -41
  404. package/dist/publisher-CGEo8UKD.mjs.map +0 -1
  405. package/dist/publisher-CqGsXB2X.cjs +0 -53
  406. package/dist/publisher-CqGsXB2X.cjs.map +0 -1
  407. package/dist/queue/index.cjs.map +0 -1
  408. package/dist/queue/index.d.cts.map +0 -1
  409. package/dist/queue/index.d.mts.map +0 -1
  410. package/dist/queue/index.mjs.map +0 -1
  411. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  412. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  413. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  414. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  415. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  416. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  417. package/dist/topic/index.cjs.map +0 -1
  418. package/dist/topic/index.d.cts.map +0 -1
  419. package/dist/topic/index.d.mts.map +0 -1
  420. package/dist/topic/index.mjs.map +0 -1
  421. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  422. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -0,0 +1,38 @@
1
+ //#region src/shutdown.ts
2
+ const key = Symbol.for("@geekmidas/constructs/shutdown");
3
+ const registry = globalThis;
4
+ registry[key] ??= /* @__PURE__ */ new Set();
5
+ const hooks = registry[key];
6
+ /** Run `hook` when the server shuts down. Returns a function that removes it. */
7
+ function onShutdown(hook) {
8
+ hooks.add(hook);
9
+ return () => hooks.delete(hook);
10
+ }
11
+ /**
12
+ * Run every registered hook, together, and wait for them. A hook that fails is
13
+ * reported to `onError` and does not stop the others.
14
+ */
15
+ async function runShutdownHooks(onError = () => {}) {
16
+ await Promise.all([...hooks].map(async (hook) => {
17
+ try {
18
+ await hook();
19
+ } catch (error) {
20
+ onError(error);
21
+ }
22
+ }));
23
+ }
24
+ //#endregion
25
+ Object.defineProperty(exports, "onShutdown", {
26
+ enumerable: true,
27
+ get: function() {
28
+ return onShutdown;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "runShutdownHooks", {
32
+ enumerable: true,
33
+ get: function() {
34
+ return runShutdownHooks;
35
+ }
36
+ });
37
+
38
+ //# sourceMappingURL=shutdown-BMJmAhSt.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shutdown-BMJmAhSt.cjs","names":[],"sources":["../src/shutdown.ts"],"sourcesContent":["/**\n * What a server releases when it stops: the connections constructs opened.\n *\n * A construct that holds something open — a database's pool — registers how to\n * close it here, and the generated server runs every hook once it has stopped\n * taking requests. Without that, a rolling deploy has the old task and the new\n * one both holding connections until the old process dies.\n *\n * Kept free of any driver import so the server entry can always import it,\n * whether or not the app has a database.\n */\n\ntype ShutdownHook = () => Promise<void> | void;\n\n// On globalThis, as Credentials are: a package loaded twice (ESM and CJS)\n// would otherwise keep two registries, and the server would run the empty one.\nconst key = Symbol.for('@geekmidas/constructs/shutdown');\nconst registry = globalThis as Record<symbol, Set<ShutdownHook> | undefined>;\nregistry[key] ??= new Set<ShutdownHook>();\nconst hooks = registry[key];\n\n/** Run `hook` when the server shuts down. Returns a function that removes it. */\nexport function onShutdown(hook: ShutdownHook): () => void {\n\thooks.add(hook);\n\treturn () => hooks.delete(hook);\n}\n\n/**\n * Run every registered hook, together, and wait for them. A hook that fails is\n * reported to `onError` and does not stop the others.\n */\nexport async function runShutdownHooks(\n\tonError: (error: unknown) => void = () => {},\n): Promise<void> {\n\tawait Promise.all(\n\t\t[...hooks].map(async (hook) => {\n\t\t\ttry {\n\t\t\t\tawait hook();\n\t\t\t} catch (error) {\n\t\t\t\tonError(error);\n\t\t\t}\n\t\t}),\n\t);\n}\n"],"mappings":";AAgBA,MAAM,MAAM,OAAO,IAAI,gCAAgC;AACvD,MAAM,WAAW;AACjB,SAAS,yBAAS,IAAI,IAAkB;AACxC,MAAM,QAAQ,SAAS;;AAGvB,SAAgB,WAAW,MAAgC;CAC1D,MAAM,IAAI,IAAI;CACd,aAAa,MAAM,OAAO,IAAI;AAC/B;;;;;AAMA,eAAsB,iBACrB,gBAA0C,CAAC,GAC3B;CAChB,MAAM,QAAQ,IACb,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,OAAO,SAAS;EAC9B,IAAI;GACH,MAAM,KAAK;EACZ,SAAS,OAAO;GACf,QAAQ,KAAK;EACd;CACD,CAAC,CACF;AACD"}
@@ -0,0 +1,27 @@
1
+ //#region src/shutdown.ts
2
+ const key = Symbol.for("@geekmidas/constructs/shutdown");
3
+ const registry = globalThis;
4
+ registry[key] ??= /* @__PURE__ */ new Set();
5
+ const hooks = registry[key];
6
+ /** Run `hook` when the server shuts down. Returns a function that removes it. */
7
+ function onShutdown(hook) {
8
+ hooks.add(hook);
9
+ return () => hooks.delete(hook);
10
+ }
11
+ /**
12
+ * Run every registered hook, together, and wait for them. A hook that fails is
13
+ * reported to `onError` and does not stop the others.
14
+ */
15
+ async function runShutdownHooks(onError = () => {}) {
16
+ await Promise.all([...hooks].map(async (hook) => {
17
+ try {
18
+ await hook();
19
+ } catch (error) {
20
+ onError(error);
21
+ }
22
+ }));
23
+ }
24
+ //#endregion
25
+ export { runShutdownHooks as n, onShutdown as t };
26
+
27
+ //# sourceMappingURL=shutdown-C7xa8x9S.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shutdown-C7xa8x9S.mjs","names":[],"sources":["../src/shutdown.ts"],"sourcesContent":["/**\n * What a server releases when it stops: the connections constructs opened.\n *\n * A construct that holds something open — a database's pool — registers how to\n * close it here, and the generated server runs every hook once it has stopped\n * taking requests. Without that, a rolling deploy has the old task and the new\n * one both holding connections until the old process dies.\n *\n * Kept free of any driver import so the server entry can always import it,\n * whether or not the app has a database.\n */\n\ntype ShutdownHook = () => Promise<void> | void;\n\n// On globalThis, as Credentials are: a package loaded twice (ESM and CJS)\n// would otherwise keep two registries, and the server would run the empty one.\nconst key = Symbol.for('@geekmidas/constructs/shutdown');\nconst registry = globalThis as Record<symbol, Set<ShutdownHook> | undefined>;\nregistry[key] ??= new Set<ShutdownHook>();\nconst hooks = registry[key];\n\n/** Run `hook` when the server shuts down. Returns a function that removes it. */\nexport function onShutdown(hook: ShutdownHook): () => void {\n\thooks.add(hook);\n\treturn () => hooks.delete(hook);\n}\n\n/**\n * Run every registered hook, together, and wait for them. A hook that fails is\n * reported to `onError` and does not stop the others.\n */\nexport async function runShutdownHooks(\n\tonError: (error: unknown) => void = () => {},\n): Promise<void> {\n\tawait Promise.all(\n\t\t[...hooks].map(async (hook) => {\n\t\t\ttry {\n\t\t\t\tawait hook();\n\t\t\t} catch (error) {\n\t\t\t\tonError(error);\n\t\t\t}\n\t\t}),\n\t);\n}\n"],"mappings":";AAgBA,MAAM,MAAM,OAAO,IAAI,gCAAgC;AACvD,MAAM,WAAW;AACjB,SAAS,yBAAS,IAAI,IAAkB;AACxC,MAAM,QAAQ,SAAS;;AAGvB,SAAgB,WAAW,MAAgC;CAC1D,MAAM,IAAI,IAAI;CACd,aAAa,MAAM,OAAO,IAAI;AAC/B;;;;;AAMA,eAAsB,iBACrB,gBAA0C,CAAC,GAC3B;CAChB,MAAM,QAAQ,IACb,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,OAAO,SAAS;EAC9B,IAAI;GACH,MAAM,KAAK;EACZ,SAAS,OAAO;GACf,QAAQ,KAAK;EACd;CACD,CAAC,CACF;AACD"}
package/dist/site.cjs CHANGED
@@ -1,16 +1,40 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const require_construct_interface = require('./construct-interface-BfjcOD_E.cjs');
3
- const __geekmidas_manifest = require_chunk.__toESM(require("@geekmidas/manifest"));
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_construct_interface = require("./construct-interface.cjs");
3
+ let _geekmidas_manifest = require("@geekmidas/manifest");
5
4
  //#region src/site.ts
5
+ /**
6
+ * `StaticSite` — a frontend, declared like anything else.
7
+ *
8
+ * The point is not that a site needs provisioning; it is that a site is the
9
+ * *consumer* whose edges make four hand-maintained lists derivable. Declaring it
10
+ * is what turns "which origins does the API allow" from something a person keeps
11
+ * in step into something the graph already knows.
12
+ *
13
+ * ```ts
14
+ * export const console = new StaticSite('Console', { path: 'apps/console' })
15
+ * .dependsOn([api, auth]);
16
+ * ```
17
+ *
18
+ * It has no `.service`. A site is not a process that registers clients — it is
19
+ * built, and the values it needs are inlined or fetched by its own framework —
20
+ * so the edge is {@link Declarable} rather than {@link Consumable}, and the
21
+ * asymmetry is the honest one: a site consumes addresses, not connections.
22
+ *
23
+ * Only the static variant ships. SSR deploy shapes are unstable and each one is
24
+ * its own maintenance, so they follow rather than arrive together. A mobile app
25
+ * is not a site — it is reached by a scheme, not a URL — and is its own
26
+ * construct: see `MobileApp`.
27
+ */
6
28
  var StaticSite = class StaticSite {
29
+ config;
30
+ dependencies;
7
31
  id;
8
32
  keys;
9
- constructor(id, config = {}, dependencies = []) {
33
+ constructor(id, config, dependencies = []) {
10
34
  this.config = config;
11
35
  this.dependencies = dependencies;
12
- this.id = (0, __geekmidas_manifest.canonicalId)(id);
13
- this.keys = { url: (0, __geekmidas_manifest.provideKey)(this.id, "url") };
36
+ this.id = (0, _geekmidas_manifest.canonicalId)(id);
37
+ this.keys = { url: (0, _geekmidas_manifest.provideKey)(this.id, "url") };
14
38
  }
15
39
  /**
16
40
  * What this site calls.
@@ -31,18 +55,20 @@ var StaticSite = class StaticSite {
31
55
  kind: "site",
32
56
  id: this.id,
33
57
  variant: this.config.variant ?? "static",
58
+ ...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
34
59
  app: {
35
- ...this.config.path ? { path: this.config.path } : {},
60
+ path: this.config.path,
36
61
  ...this.config.port ? { port: this.config.port } : {},
37
62
  ...this.config.config ? { config: this.config.config } : {}
38
63
  },
39
64
  ...this.config.root ? { root: true } : {},
40
65
  dependencies: this.dependencies,
66
+ ...this.config.telemetry ? { telemetry: this.config.telemetry.id } : {},
41
67
  provides: [this.keys.url]
42
68
  }];
43
69
  }
44
70
  };
45
-
46
71
  //#endregion
47
72
  exports.StaticSite = StaticSite;
73
+
48
74
  //# sourceMappingURL=site.cjs.map
package/dist/site.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"site.cjs","names":["id: ConstructName<TName>","config: StaticSiteConfig","dependencies: readonly Dependency[]","constructs: readonly Declarable[]","edgeTo"],"sources":["../src/site.ts"],"sourcesContent":["/**\n * `StaticSite` — a frontend, declared like anything else.\n *\n * The point is not that a site needs provisioning; it is that a site is the\n * *consumer* whose edges make four hand-maintained lists derivable. Declaring it\n * is what turns \"which origins does the API allow\" from something a person keeps\n * in step into something the graph already knows.\n *\n * ```ts\n * export const console = new StaticSite('Console', { path: 'apps/console' })\n * .dependsOn([api, auth]);\n * ```\n *\n * It has no `.service`. A site is not a process that registers clients — it is\n * built, and the values it needs are inlined or fetched by its own framework —\n * so the edge is {@link Declarable} rather than {@link Consumable}, and the\n * asymmetry is the honest one: a site consumes addresses, not connections.\n *\n * Only the static variant ships. SSR deploy shapes are unstable and each one is\n * its own maintenance, so they follow rather than arrive together; Expo and\n * mobile are out of scope entirely, because an app store is not infrastructure\n * and there is no URL to hand anyone.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovideKey,\n\ttype SiteDeclaration,\n} from '@geekmidas/manifest';\nimport { type Declarable, edgeTo } from './construct-interface';\n\n/**\n * A site's config is flat, where a surface's nests its `app`.\n *\n * Not an inconsistency: a `RestApi` may or may not have a process of its own,\n * so \"what the surface is\" and \"how its process is built\" are separable there\n * and worth separating. A site *is* its app — there is nothing to separate it\n * from, and `{ app: { path } }` would be a wrapper around the only thing in it.\n *\n * Every field is optional, so `new StaticSite('Web')` is a complete site.\n */\nexport interface StaticSiteConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root.\n\t *\n\t * Optional, and normally omitted: `apps/<kebab-id>` where that directory\n\t * exists, and the workspace root otherwise. `StaticSite('Web')` means\n\t * `apps/web`, which is the thing the id already said.\n\t *\n\t * Worth writing only when the layout differs — `path: 'sites/marketing'`.\n\t */\n\tpath?: string;\n\t/**\n\t * The port it answers on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, so adding a site\n\t * does not renumber the ones already running.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars this site reads.\n\t *\n\t * A frontend's values are inlined at build time, so the build has to know\n\t * which ones it reads before it reads them.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Whether the base domain points at this site.\n\t *\n\t * A project with one site needs this no more than a project with one\n\t * database needs to say which database. It matters when there are several\n\t * and none is called `web`: the base domain then belongs to whichever site\n\t * says so, rather than to whichever file the glob happened to reach first.\n\t */\n\troot?: boolean;\n\t/**\n\t * Which framework builds it.\n\t *\n\t * It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched\n\t * `config.json` — and never which values there are. One neutral name from the\n\t * construct, one serialisation per framework, the same rule as everywhere\n\t * else.\n\t */\n\tvariant?: SiteDeclaration['variant'];\n}\n\nexport class StaticSite<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\treadonly keys: { url: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: StaticSiteConfig = {},\n\t\t/**\n\t\t * Internal: how `.dependsOn()` carries edges into the copy it returns.\n\t\t * Written as a parameter rather than a mutable field so the builder can\n\t\t * stay immutable without a clone method, the same shape\n\t\t * `KyselyDatabase` uses for its derived forms.\n\t\t */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { url: provideKey(this.id, 'url') };\n\t}\n\n\t/**\n\t * What this site calls.\n\t *\n\t * Immutable, like every other builder here: it returns a new site rather than\n\t * mutating this one, so a module that exports both a base and a variant of it\n\t * cannot have the second silently change the first.\n\t *\n\t * Takes {@link Declarable} rather than {@link Consumable} because a site's\n\t * edge is a build-time link and not a service injection — requiring a client\n\t * would exclude exactly the surfaces a frontend actually depends on.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): StaticSite<TName> {\n\t\treturn new StaticSite<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(edgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'site',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'static',\n\t\t\t\tapp: {\n\t\t\t\t\t...(this.config.path ? { path: this.config.path } : {}),\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.root ? { root: true } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;AAyFA,IAAa,aAAb,MAAa,WAEb;CACC,AAAS;CACT,AAAS;CAET,YACCA,IACiBC,SAA2B,CAAE,GAO7BC,eAAsC,CAAE,GACxD;EARgB;EAOA;AAEjB,OAAK,KAAK,sCAAY,GAAa;AACnC,OAAK,OAAO,EAAE,KAAK,qCAAW,KAAK,IAAI,MAAM,CAAE;CAC/C;;;;;;;;;;;;CAaD,UAAUC,YAAsD;AAC/D,SAAO,IAAI,WAAkB,KAAK,IAA4B,KAAK,QAAQ,CAC1E,GAAG,KAAK,cACR,GAAG,WAAW,IAAIC,mCAAO,AACzB;CACD;CAED,UAAyB;AACxB,SAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,KAAK;IACJ,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAM,IAAG,CAAE;IACtD,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAM,IAAG,CAAE;IACtD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAQ,IAAG,CAAE;GAC5D;GACD,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAM,IAAG,CAAE;GAC1C,cAAc,KAAK;GACnB,UAAU,CAAC,KAAK,KAAK,GAAI;EACzB,CACD;CACD;AACD"}
1
+ {"version":3,"file":"site.cjs","names":["canonicalId","provideKey","edgeTo"],"sources":["../src/site.ts"],"sourcesContent":["/**\n * `StaticSite` — a frontend, declared like anything else.\n *\n * The point is not that a site needs provisioning; it is that a site is the\n * *consumer* whose edges make four hand-maintained lists derivable. Declaring it\n * is what turns \"which origins does the API allow\" from something a person keeps\n * in step into something the graph already knows.\n *\n * ```ts\n * export const console = new StaticSite('Console', { path: 'apps/console' })\n * .dependsOn([api, auth]);\n * ```\n *\n * It has no `.service`. A site is not a process that registers clients — it is\n * built, and the values it needs are inlined or fetched by its own framework —\n * so the edge is {@link Declarable} rather than {@link Consumable}, and the\n * asymmetry is the honest one: a site consumes addresses, not connections.\n *\n * Only the static variant ships. SSR deploy shapes are unstable and each one is\n * its own maintenance, so they follow rather than arrive together. A mobile app\n * is not a site — it is reached by a scheme, not a URL — and is its own\n * construct: see `MobileApp`.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovideKey,\n\ttype SiteDeclaration,\n} from '@geekmidas/manifest';\nimport { type Declarable, edgeTo } from './construct-interface';\nimport type { Telemetry } from './telemetry';\n\n/**\n * Where a site's source lives, and the little else a layout can differ by.\n *\n * Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a\n * complete site.\n */\nexport interface StaticSiteConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/web'`.\n\t *\n\t * Required, the same field `RestApi` and `BetterAuth` take. It was\n\t * inferred from the id, which made a site's home whatever was on disk.\n\t */\n\tpath: string;\n\t/**\n\t * The label it answers on under a stage's domain — `api` for\n\t * `api.myapp.com`, from `domains` — and under the project locally,\n\t * `api.myapp.localhost`. Absent, its id kebab-cased.\n\t */\n\tsubdomain?: string;\n\t/**\n\t * The port it answers on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, so adding a site\n\t * does not renumber the ones already running.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars this site reads.\n\t *\n\t * A frontend's values are inlined at build time, so the build has to know\n\t * which ones it reads before it reads them.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Whether the base domain points at this site.\n\t *\n\t * A project with one site needs this no more than a project with one\n\t * database needs to say which database. It matters when there are several\n\t * and none is called `web`: the base domain then belongs to whichever site\n\t * says so, rather than to whichever file the glob happened to reach first.\n\t */\n\troot?: boolean;\n\t/**\n\t * Which framework builds it.\n\t *\n\t * It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched\n\t * `config.json` — and never which values there are. One neutral name from the\n\t * construct, one serialisation per framework, the same rule as everywhere\n\t * else.\n\t */\n\tvariant?: SiteDeclaration['variant'];\n\t/**\n\t * What the site emits — the `Telemetry` construct. An edge to the node and\n\t * nothing more for now: a site is handed none of its server keys, and the\n\t * browser half (propagation from the generated client, then a browser SDK\n\t * exporting through the API) builds on this edge.\n\t */\n\ttelemetry?: Telemetry;\n}\n\nexport class StaticSite<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\treadonly keys: { url: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: StaticSiteConfig,\n\t\t/**\n\t\t * Internal: how `.dependsOn()` carries edges into the copy it returns.\n\t\t * Written as a parameter rather than a mutable field so the builder can\n\t\t * stay immutable without a clone method, the same shape\n\t\t * `KyselyDatabase` uses for its derived forms.\n\t\t */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { url: provideKey(this.id, 'url') };\n\t}\n\n\t/**\n\t * What this site calls.\n\t *\n\t * Immutable, like every other builder here: it returns a new site rather than\n\t * mutating this one, so a module that exports both a base and a variant of it\n\t * cannot have the second silently change the first.\n\t *\n\t * Takes {@link Declarable} rather than {@link Consumable} because a site's\n\t * edge is a build-time link and not a service injection — requiring a client\n\t * would exclude exactly the surfaces a frontend actually depends on.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): StaticSite<TName> {\n\t\treturn new StaticSite<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(edgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'site',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'static',\n\t\t\t\t...(this.config.subdomain ? { subdomain: this.config.subdomain } : {}),\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.root ? { root: true } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\t...(this.config.telemetry\n\t\t\t\t\t? { telemetry: this.config.telemetry.id }\n\t\t\t\t\t: {}),\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,IAAa,aAAb,MAAa,WAEb;CAMmB;CAOA;CAZlB;CACA;CAEA,YACC,IACA,QAOA,eAAuD,CAAC,GACvD;EARgB,KAAA,SAAA;EAOA,KAAA,eAAA;EAEjB,KAAK,MAAA,GAAKA,oBAAAA,YAAAA,CAAY,EAAY;EAClC,KAAK,OAAO,EAAE,MAAA,GAAKC,oBAAAA,WAAAA,CAAW,KAAK,IAAI,KAAK,EAAE;CAC/C;;;;;;;;;;;;CAaA,UAAU,YAAsD;EAC/D,OAAO,IAAI,WAAkB,KAAK,IAA4B,KAAK,QAAQ,CAC1E,GAAG,KAAK,cACR,GAAG,WAAW,IAAIC,4BAAAA,MAAM,CACzB,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,GAAI,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK,OAAO,UAAU,IAAI,CAAC;GACpE,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;GACzC,cAAc,KAAK;GACnB,GAAI,KAAK,OAAO,YACb,EAAE,WAAW,KAAK,OAAO,UAAU,GAAG,IACtC,CAAC;GACJ,UAAU,CAAC,KAAK,KAAK,GAAG;EACzB,CACD;CACD;AACD"}
package/dist/site.d.cts CHANGED
@@ -1,29 +1,27 @@
1
- import { Declarable } from "./construct-interface-D2nNkHUN.cjs";
1
+ import { i as Declarable } from "./construct-interface-B1AfqRl4.cjs";
2
+ import { n as Telemetry } from "./telemetry-B48RLjyk.cjs";
2
3
  import { ConstructName, Declaration, Dependency, SiteDeclaration } from "@geekmidas/manifest";
3
-
4
4
  //#region src/site.d.ts
5
-
6
5
  /**
7
- * A site's config is flat, where a surface's nests its `app`.
6
+ * Where a site's source lives, and the little else a layout can differ by.
8
7
  *
9
- * Not an inconsistency: a `RestApi` may or may not have a process of its own,
10
- * so "what the surface is" and "how its process is built" are separable there
11
- * and worth separating. A site *is* its app — there is nothing to separate it
12
- * from, and `{ app: { path } }` would be a wrapper around the only thing in it.
13
- *
14
- * Every field is optional, so `new StaticSite('Web')` is a complete site.
8
+ * Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a
9
+ * complete site.
15
10
  */
16
- interface StaticSiteConfig {
11
+ export interface StaticSiteConfig {
17
12
  /**
18
- * Where its source lives, relative to the workspace root.
19
- *
20
- * Optional, and normally omitted: `apps/<kebab-id>` where that directory
21
- * exists, and the workspace root otherwise. `StaticSite('Web')` means
22
- * `apps/web`, which is the thing the id already said.
13
+ * Where its source lives, relative to the workspace root — `'apps/web'`.
23
14
  *
24
- * Worth writing only when the layout differs — `path: 'sites/marketing'`.
15
+ * Required, the same field `RestApi` and `BetterAuth` take. It was
16
+ * inferred from the id, which made a site's home whatever was on disk.
17
+ */
18
+ path: string;
19
+ /**
20
+ * The label it answers on under a stage's domain — `api` for
21
+ * `api.myapp.com`, from `domains` — and under the project locally,
22
+ * `api.myapp.localhost`. Absent, its id kebab-cased.
25
23
  */
26
- path?: string;
24
+ subdomain?: string;
27
25
  /**
28
26
  * The port it answers on locally.
29
27
  *
@@ -59,8 +57,15 @@ interface StaticSiteConfig {
59
57
  * else.
60
58
  */
61
59
  variant?: SiteDeclaration['variant'];
60
+ /**
61
+ * What the site emits — the `Telemetry` construct. An edge to the node and
62
+ * nothing more for now: a site is handed none of its server keys, and the
63
+ * browser half (propagation from the generated client, then a browser SDK
64
+ * exporting through the API) builds on this edge.
65
+ */
66
+ telemetry?: Telemetry;
62
67
  }
63
- declare class StaticSite<TName extends string = string> implements Declarable<TName> {
68
+ export declare class StaticSite<TName extends string = string> implements Declarable<TName> {
64
69
  private readonly config;
65
70
  /**
66
71
  * Internal: how `.dependsOn()` carries edges into the copy it returns.
@@ -73,7 +78,7 @@ declare class StaticSite<TName extends string = string> implements Declarable<TN
73
78
  readonly keys: {
74
79
  url: string;
75
80
  };
76
- constructor(id: ConstructName<TName>, config?: StaticSiteConfig,
81
+ constructor(id: ConstructName<TName>, config: StaticSiteConfig,
77
82
  /**
78
83
  * Internal: how `.dependsOn()` carries edges into the copy it returns.
79
84
  * Written as a parameter rather than a mutable field so the builder can
@@ -95,7 +100,5 @@ declare class StaticSite<TName extends string = string> implements Declarable<TN
95
100
  dependsOn(constructs: readonly Declarable[]): StaticSite<TName>;
96
101
  declare(): Declaration[];
97
102
  }
98
- //# sourceMappingURL=site.d.ts.map
99
103
  //#endregion
100
- export { StaticSite, StaticSiteConfig };
101
104
  //# sourceMappingURL=site.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"site.d.cts","names":[],"sources":["../src/site.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;UA4CiB,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA0CN;;cAGE,qDACD,WAAW;;;;;;;;;eAET;;;;kBAIR,cAAc,iBACO;;;;;;;0BAOe;;;;;;;;;;;;iCAiBV,eAAe,WAAW;aAO9C"}
1
+ {"version":3,"file":"site.d.cts","names":[],"sources":["../src/site.ts"],"mappings":";;;;;;;;;;iBAyCiB;;;;;;;EAOhB;;;;;;EAMA;;;;;;;EAOA;;;;;;;EAOA;IAAW;IAAiB;;;;;;;;;;EAS5B;;;;;;;;;EASA,UAAU;;;;;;;EAOV,YAAY;;qBAGA,WAAW,0CACZ,WAAW;mBAOJ;;;;;;;mBAOA;WAZT,IAAI;WACJ;IAAQ;;EAEjB,YACC,IAAI,cAAc,QACD,QAAQ,kBAOR;;;;;;;EAAA,wBAAuB;;;;;;;;;;;;EAiBzC,UAAU,qBAAqB,eAAe,WAAW;EAOzD,WAAW"}
package/dist/site.d.mts CHANGED
@@ -1,29 +1,27 @@
1
- import { Declarable } from "./construct-interface-BqwRNYA2.mjs";
1
+ import { i as Declarable } from "./construct-interface-DluK3_da.mjs";
2
+ import { n as Telemetry } from "./telemetry-DRtT1_0A.mjs";
2
3
  import { ConstructName, Declaration, Dependency, SiteDeclaration } from "@geekmidas/manifest";
3
-
4
4
  //#region src/site.d.ts
5
-
6
5
  /**
7
- * A site's config is flat, where a surface's nests its `app`.
6
+ * Where a site's source lives, and the little else a layout can differ by.
8
7
  *
9
- * Not an inconsistency: a `RestApi` may or may not have a process of its own,
10
- * so "what the surface is" and "how its process is built" are separable there
11
- * and worth separating. A site *is* its app — there is nothing to separate it
12
- * from, and `{ app: { path } }` would be a wrapper around the only thing in it.
13
- *
14
- * Every field is optional, so `new StaticSite('Web')` is a complete site.
8
+ * Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a
9
+ * complete site.
15
10
  */
16
- interface StaticSiteConfig {
11
+ export interface StaticSiteConfig {
17
12
  /**
18
- * Where its source lives, relative to the workspace root.
19
- *
20
- * Optional, and normally omitted: `apps/<kebab-id>` where that directory
21
- * exists, and the workspace root otherwise. `StaticSite('Web')` means
22
- * `apps/web`, which is the thing the id already said.
13
+ * Where its source lives, relative to the workspace root — `'apps/web'`.
23
14
  *
24
- * Worth writing only when the layout differs — `path: 'sites/marketing'`.
15
+ * Required, the same field `RestApi` and `BetterAuth` take. It was
16
+ * inferred from the id, which made a site's home whatever was on disk.
17
+ */
18
+ path: string;
19
+ /**
20
+ * The label it answers on under a stage's domain — `api` for
21
+ * `api.myapp.com`, from `domains` — and under the project locally,
22
+ * `api.myapp.localhost`. Absent, its id kebab-cased.
25
23
  */
26
- path?: string;
24
+ subdomain?: string;
27
25
  /**
28
26
  * The port it answers on locally.
29
27
  *
@@ -59,8 +57,15 @@ interface StaticSiteConfig {
59
57
  * else.
60
58
  */
61
59
  variant?: SiteDeclaration['variant'];
60
+ /**
61
+ * What the site emits — the `Telemetry` construct. An edge to the node and
62
+ * nothing more for now: a site is handed none of its server keys, and the
63
+ * browser half (propagation from the generated client, then a browser SDK
64
+ * exporting through the API) builds on this edge.
65
+ */
66
+ telemetry?: Telemetry;
62
67
  }
63
- declare class StaticSite<TName extends string = string> implements Declarable<TName> {
68
+ export declare class StaticSite<TName extends string = string> implements Declarable<TName> {
64
69
  private readonly config;
65
70
  /**
66
71
  * Internal: how `.dependsOn()` carries edges into the copy it returns.
@@ -73,7 +78,7 @@ declare class StaticSite<TName extends string = string> implements Declarable<TN
73
78
  readonly keys: {
74
79
  url: string;
75
80
  };
76
- constructor(id: ConstructName<TName>, config?: StaticSiteConfig,
81
+ constructor(id: ConstructName<TName>, config: StaticSiteConfig,
77
82
  /**
78
83
  * Internal: how `.dependsOn()` carries edges into the copy it returns.
79
84
  * Written as a parameter rather than a mutable field so the builder can
@@ -95,7 +100,5 @@ declare class StaticSite<TName extends string = string> implements Declarable<TN
95
100
  dependsOn(constructs: readonly Declarable[]): StaticSite<TName>;
96
101
  declare(): Declaration[];
97
102
  }
98
- //# sourceMappingURL=site.d.ts.map
99
103
  //#endregion
100
- export { StaticSite, StaticSiteConfig };
101
104
  //# sourceMappingURL=site.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"site.d.mts","names":[],"sources":["../src/site.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;UA4CiB,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA0CN;;cAGE,qDACD,WAAW;;;;;;;;;eAET;;;;kBAIR,cAAc,iBACO;;;;;;;0BAOe;;;;;;;;;;;;iCAiBV,eAAe,WAAW;aAO9C"}
1
+ {"version":3,"file":"site.d.mts","names":[],"sources":["../src/site.ts"],"mappings":";;;;;;;;;;iBAyCiB;;;;;;;EAOhB;;;;;;EAMA;;;;;;;EAOA;;;;;;;EAOA;IAAW;IAAiB;;;;;;;;;;EAS5B;;;;;;;;;EASA,UAAU;;;;;;;EAOV,YAAY;;qBAGA,WAAW,0CACZ,WAAW;mBAOJ;;;;;;;mBAOA;WAZT,IAAI;WACJ;IAAQ;;EAEjB,YACC,IAAI,cAAc,QACD,QAAQ,kBAOR;;;;;;;EAAA,wBAAuB;;;;;;;;;;;;EAiBzC,UAAU,qBAAqB,eAAe,WAAW;EAOzD,WAAW"}
package/dist/site.mjs CHANGED
@@ -1,11 +1,35 @@
1
- import { edgeTo } from "./construct-interface-Z4CpS8tK.mjs";
1
+ import { edgeTo } from "./construct-interface.mjs";
2
2
  import { canonicalId, provideKey } from "@geekmidas/manifest";
3
-
4
3
  //#region src/site.ts
4
+ /**
5
+ * `StaticSite` — a frontend, declared like anything else.
6
+ *
7
+ * The point is not that a site needs provisioning; it is that a site is the
8
+ * *consumer* whose edges make four hand-maintained lists derivable. Declaring it
9
+ * is what turns "which origins does the API allow" from something a person keeps
10
+ * in step into something the graph already knows.
11
+ *
12
+ * ```ts
13
+ * export const console = new StaticSite('Console', { path: 'apps/console' })
14
+ * .dependsOn([api, auth]);
15
+ * ```
16
+ *
17
+ * It has no `.service`. A site is not a process that registers clients — it is
18
+ * built, and the values it needs are inlined or fetched by its own framework —
19
+ * so the edge is {@link Declarable} rather than {@link Consumable}, and the
20
+ * asymmetry is the honest one: a site consumes addresses, not connections.
21
+ *
22
+ * Only the static variant ships. SSR deploy shapes are unstable and each one is
23
+ * its own maintenance, so they follow rather than arrive together. A mobile app
24
+ * is not a site — it is reached by a scheme, not a URL — and is its own
25
+ * construct: see `MobileApp`.
26
+ */
5
27
  var StaticSite = class StaticSite {
28
+ config;
29
+ dependencies;
6
30
  id;
7
31
  keys;
8
- constructor(id, config = {}, dependencies = []) {
32
+ constructor(id, config, dependencies = []) {
9
33
  this.config = config;
10
34
  this.dependencies = dependencies;
11
35
  this.id = canonicalId(id);
@@ -30,18 +54,20 @@ var StaticSite = class StaticSite {
30
54
  kind: "site",
31
55
  id: this.id,
32
56
  variant: this.config.variant ?? "static",
57
+ ...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
33
58
  app: {
34
- ...this.config.path ? { path: this.config.path } : {},
59
+ path: this.config.path,
35
60
  ...this.config.port ? { port: this.config.port } : {},
36
61
  ...this.config.config ? { config: this.config.config } : {}
37
62
  },
38
63
  ...this.config.root ? { root: true } : {},
39
64
  dependencies: this.dependencies,
65
+ ...this.config.telemetry ? { telemetry: this.config.telemetry.id } : {},
40
66
  provides: [this.keys.url]
41
67
  }];
42
68
  }
43
69
  };
44
-
45
70
  //#endregion
46
71
  export { StaticSite };
72
+
47
73
  //# sourceMappingURL=site.mjs.map
package/dist/site.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"site.mjs","names":["id: ConstructName<TName>","config: StaticSiteConfig","dependencies: readonly Dependency[]","constructs: readonly Declarable[]"],"sources":["../src/site.ts"],"sourcesContent":["/**\n * `StaticSite` — a frontend, declared like anything else.\n *\n * The point is not that a site needs provisioning; it is that a site is the\n * *consumer* whose edges make four hand-maintained lists derivable. Declaring it\n * is what turns \"which origins does the API allow\" from something a person keeps\n * in step into something the graph already knows.\n *\n * ```ts\n * export const console = new StaticSite('Console', { path: 'apps/console' })\n * .dependsOn([api, auth]);\n * ```\n *\n * It has no `.service`. A site is not a process that registers clients — it is\n * built, and the values it needs are inlined or fetched by its own framework —\n * so the edge is {@link Declarable} rather than {@link Consumable}, and the\n * asymmetry is the honest one: a site consumes addresses, not connections.\n *\n * Only the static variant ships. SSR deploy shapes are unstable and each one is\n * its own maintenance, so they follow rather than arrive together; Expo and\n * mobile are out of scope entirely, because an app store is not infrastructure\n * and there is no URL to hand anyone.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovideKey,\n\ttype SiteDeclaration,\n} from '@geekmidas/manifest';\nimport { type Declarable, edgeTo } from './construct-interface';\n\n/**\n * A site's config is flat, where a surface's nests its `app`.\n *\n * Not an inconsistency: a `RestApi` may or may not have a process of its own,\n * so \"what the surface is\" and \"how its process is built\" are separable there\n * and worth separating. A site *is* its app — there is nothing to separate it\n * from, and `{ app: { path } }` would be a wrapper around the only thing in it.\n *\n * Every field is optional, so `new StaticSite('Web')` is a complete site.\n */\nexport interface StaticSiteConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root.\n\t *\n\t * Optional, and normally omitted: `apps/<kebab-id>` where that directory\n\t * exists, and the workspace root otherwise. `StaticSite('Web')` means\n\t * `apps/web`, which is the thing the id already said.\n\t *\n\t * Worth writing only when the layout differs — `path: 'sites/marketing'`.\n\t */\n\tpath?: string;\n\t/**\n\t * The port it answers on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, so adding a site\n\t * does not renumber the ones already running.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars this site reads.\n\t *\n\t * A frontend's values are inlined at build time, so the build has to know\n\t * which ones it reads before it reads them.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Whether the base domain points at this site.\n\t *\n\t * A project with one site needs this no more than a project with one\n\t * database needs to say which database. It matters when there are several\n\t * and none is called `web`: the base domain then belongs to whichever site\n\t * says so, rather than to whichever file the glob happened to reach first.\n\t */\n\troot?: boolean;\n\t/**\n\t * Which framework builds it.\n\t *\n\t * It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched\n\t * `config.json` — and never which values there are. One neutral name from the\n\t * construct, one serialisation per framework, the same rule as everywhere\n\t * else.\n\t */\n\tvariant?: SiteDeclaration['variant'];\n}\n\nexport class StaticSite<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\treadonly keys: { url: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: StaticSiteConfig = {},\n\t\t/**\n\t\t * Internal: how `.dependsOn()` carries edges into the copy it returns.\n\t\t * Written as a parameter rather than a mutable field so the builder can\n\t\t * stay immutable without a clone method, the same shape\n\t\t * `KyselyDatabase` uses for its derived forms.\n\t\t */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { url: provideKey(this.id, 'url') };\n\t}\n\n\t/**\n\t * What this site calls.\n\t *\n\t * Immutable, like every other builder here: it returns a new site rather than\n\t * mutating this one, so a module that exports both a base and a variant of it\n\t * cannot have the second silently change the first.\n\t *\n\t * Takes {@link Declarable} rather than {@link Consumable} because a site's\n\t * edge is a build-time link and not a service injection — requiring a client\n\t * would exclude exactly the surfaces a frontend actually depends on.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): StaticSite<TName> {\n\t\treturn new StaticSite<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(edgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'site',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'static',\n\t\t\t\tapp: {\n\t\t\t\t\t...(this.config.path ? { path: this.config.path } : {}),\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.root ? { root: true } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;AAyFA,IAAa,aAAb,MAAa,WAEb;CACC,AAAS;CACT,AAAS;CAET,YACCA,IACiBC,SAA2B,CAAE,GAO7BC,eAAsC,CAAE,GACxD;EARgB;EAOA;AAEjB,OAAK,KAAK,YAAY,GAAa;AACnC,OAAK,OAAO,EAAE,KAAK,WAAW,KAAK,IAAI,MAAM,CAAE;CAC/C;;;;;;;;;;;;CAaD,UAAUC,YAAsD;AAC/D,SAAO,IAAI,WAAkB,KAAK,IAA4B,KAAK,QAAQ,CAC1E,GAAG,KAAK,cACR,GAAG,WAAW,IAAI,OAAO,AACzB;CACD;CAED,UAAyB;AACxB,SAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,KAAK;IACJ,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAM,IAAG,CAAE;IACtD,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAM,IAAG,CAAE;IACtD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAQ,IAAG,CAAE;GAC5D;GACD,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAM,IAAG,CAAE;GAC1C,cAAc,KAAK;GACnB,UAAU,CAAC,KAAK,KAAK,GAAI;EACzB,CACD;CACD;AACD"}
1
+ {"version":3,"file":"site.mjs","names":[],"sources":["../src/site.ts"],"sourcesContent":["/**\n * `StaticSite` — a frontend, declared like anything else.\n *\n * The point is not that a site needs provisioning; it is that a site is the\n * *consumer* whose edges make four hand-maintained lists derivable. Declaring it\n * is what turns \"which origins does the API allow\" from something a person keeps\n * in step into something the graph already knows.\n *\n * ```ts\n * export const console = new StaticSite('Console', { path: 'apps/console' })\n * .dependsOn([api, auth]);\n * ```\n *\n * It has no `.service`. A site is not a process that registers clients — it is\n * built, and the values it needs are inlined or fetched by its own framework —\n * so the edge is {@link Declarable} rather than {@link Consumable}, and the\n * asymmetry is the honest one: a site consumes addresses, not connections.\n *\n * Only the static variant ships. SSR deploy shapes are unstable and each one is\n * its own maintenance, so they follow rather than arrive together. A mobile app\n * is not a site — it is reached by a scheme, not a URL — and is its own\n * construct: see `MobileApp`.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovideKey,\n\ttype SiteDeclaration,\n} from '@geekmidas/manifest';\nimport { type Declarable, edgeTo } from './construct-interface';\nimport type { Telemetry } from './telemetry';\n\n/**\n * Where a site's source lives, and the little else a layout can differ by.\n *\n * Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a\n * complete site.\n */\nexport interface StaticSiteConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/web'`.\n\t *\n\t * Required, the same field `RestApi` and `BetterAuth` take. It was\n\t * inferred from the id, which made a site's home whatever was on disk.\n\t */\n\tpath: string;\n\t/**\n\t * The label it answers on under a stage's domain — `api` for\n\t * `api.myapp.com`, from `domains` — and under the project locally,\n\t * `api.myapp.localhost`. Absent, its id kebab-cased.\n\t */\n\tsubdomain?: string;\n\t/**\n\t * The port it answers on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, so adding a site\n\t * does not renumber the ones already running.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars this site reads.\n\t *\n\t * A frontend's values are inlined at build time, so the build has to know\n\t * which ones it reads before it reads them.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Whether the base domain points at this site.\n\t *\n\t * A project with one site needs this no more than a project with one\n\t * database needs to say which database. It matters when there are several\n\t * and none is called `web`: the base domain then belongs to whichever site\n\t * says so, rather than to whichever file the glob happened to reach first.\n\t */\n\troot?: boolean;\n\t/**\n\t * Which framework builds it.\n\t *\n\t * It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched\n\t * `config.json` — and never which values there are. One neutral name from the\n\t * construct, one serialisation per framework, the same rule as everywhere\n\t * else.\n\t */\n\tvariant?: SiteDeclaration['variant'];\n\t/**\n\t * What the site emits — the `Telemetry` construct. An edge to the node and\n\t * nothing more for now: a site is handed none of its server keys, and the\n\t * browser half (propagation from the generated client, then a browser SDK\n\t * exporting through the API) builds on this edge.\n\t */\n\ttelemetry?: Telemetry;\n}\n\nexport class StaticSite<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\treadonly keys: { url: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: StaticSiteConfig,\n\t\t/**\n\t\t * Internal: how `.dependsOn()` carries edges into the copy it returns.\n\t\t * Written as a parameter rather than a mutable field so the builder can\n\t\t * stay immutable without a clone method, the same shape\n\t\t * `KyselyDatabase` uses for its derived forms.\n\t\t */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { url: provideKey(this.id, 'url') };\n\t}\n\n\t/**\n\t * What this site calls.\n\t *\n\t * Immutable, like every other builder here: it returns a new site rather than\n\t * mutating this one, so a module that exports both a base and a variant of it\n\t * cannot have the second silently change the first.\n\t *\n\t * Takes {@link Declarable} rather than {@link Consumable} because a site's\n\t * edge is a build-time link and not a service injection — requiring a client\n\t * would exclude exactly the surfaces a frontend actually depends on.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): StaticSite<TName> {\n\t\treturn new StaticSite<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(edgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'site',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'static',\n\t\t\t\t...(this.config.subdomain ? { subdomain: this.config.subdomain } : {}),\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.root ? { root: true } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\t...(this.config.telemetry\n\t\t\t\t\t? { telemetry: this.config.telemetry.id }\n\t\t\t\t\t: {}),\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,IAAa,aAAb,MAAa,WAEb;CAMmB;CAOA;CAZlB;CACA;CAEA,YACC,IACA,QAOA,eAAuD,CAAC,GACvD;EARgB,KAAA,SAAA;EAOA,KAAA,eAAA;EAEjB,KAAK,KAAK,YAAY,EAAY;EAClC,KAAK,OAAO,EAAE,KAAK,WAAW,KAAK,IAAI,KAAK,EAAE;CAC/C;;;;;;;;;;;;CAaA,UAAU,YAAsD;EAC/D,OAAO,IAAI,WAAkB,KAAK,IAA4B,KAAK,QAAQ,CAC1E,GAAG,KAAK,cACR,GAAG,WAAW,IAAI,MAAM,CACzB,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,GAAI,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK,OAAO,UAAU,IAAI,CAAC;GACpE,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;GACzC,cAAc,KAAK;GACnB,GAAI,KAAK,OAAO,YACb,EAAE,WAAW,KAAK,OAAO,UAAU,GAAG,IACtC,CAAC;GACJ,UAAU,CAAC,KAAK,KAAK,GAAG;EACzB,CACD;CACD;AACD"}
@@ -0,0 +1,56 @@
1
+ //#region src/stages.d.ts
2
+ /**
3
+ * The project's stage names, as types.
4
+ *
5
+ * `gkm.config.ts` declares the stages — `stages: { local: 'dev', deployed:
6
+ * ['staging', 'prod'] }` — but constructs and application code cannot import
7
+ * the config, so a stage name written anywhere else was a bare `string`: a
8
+ * typo'd key in an `ExternalApi`'s `url` map was silently never read, and a
9
+ * seed's `stage === 'prodution'` branch silently never ran.
10
+ *
11
+ * `gkm dev`, `gkm build` and `gkm test --prepare` write `.gkm/stages.d.ts`,
12
+ * which fills this interface in from the loaded workspace:
13
+ *
14
+ * ```ts
15
+ * declare module '@geekmidas/constructs' {
16
+ * interface Stages { local: 'dev'; deployed: 'staging' | 'prod' }
17
+ * }
18
+ * ```
19
+ *
20
+ * Until that file exists — a fresh clone, before the first run — the interface
21
+ * is empty and every stage type below is `string`, so nothing fails to compile
22
+ * for want of a generated file.
23
+ */
24
+ interface Stages {}
25
+ /** What `Stages` says under `key`, or `string` while it says nothing. */
26
+ type Declared<TKey extends string> = Stages extends { [K in TKey]: infer TStage extends string; } ? TStage : string;
27
+ /** The stage `gkm dev`, `exec`, `setup` and `test` run as: `stages.local`. */
28
+ type LocalStage = Declared<'local'>;
29
+ /** A stage `gkm deploy --stage` accepts: one of `stages.deployed`. */
30
+ type DeployedStage = Declared<'deployed'>;
31
+ /** What `gkm test` runs as. The CLI's own; no project stage may take it. */
32
+ type TestStage = 'test';
33
+ /** Any stage the project's code can find itself running as. */
34
+ type AnyStage = LocalStage | TestStage | DeployedStage;
35
+ /**
36
+ * What a seed is handed beside its database.
37
+ *
38
+ * Seeds run on every stage, production included, so a seed that should write
39
+ * something only somewhere — a demo tenant on the local stage, never on a
40
+ * deployed one — decides by the stage it is given:
41
+ *
42
+ * ```ts
43
+ * import type { SeedContext } from '@geekmidas/constructs';
44
+ *
45
+ * export async function seed(db: Kysely<Database>, { stage }: SeedContext) {
46
+ * if (stage === 'dev') await insertDemoTenant(db);
47
+ * }
48
+ * ```
49
+ */
50
+ interface SeedContext {
51
+ /** The stage being seeded: the local one, `test`, or a deployed one. */
52
+ stage: AnyStage;
53
+ }
54
+ //#endregion
55
+ export { Stages as a, SeedContext as i, DeployedStage as n, TestStage as o, LocalStage as r, AnyStage as t };
56
+ //# sourceMappingURL=stages-BSCF19o2.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stages-BSCF19o2.d.cts","names":[],"sources":["../src/stages.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAuBiB;;KAGZ,SAAS,uBAAuB,kBACnC,KAAK,aAAa,2BAEjB;;KAIS,aAAa;;KAGb,gBAAgB;;KAGhB;;KAGA,WAAW,aAAa,YAAY;;;;;;;;;;;;;;;;UAiB/B;;EAEhB,OAAO"}
@@ -0,0 +1,56 @@
1
+ //#region src/stages.d.ts
2
+ /**
3
+ * The project's stage names, as types.
4
+ *
5
+ * `gkm.config.ts` declares the stages — `stages: { local: 'dev', deployed:
6
+ * ['staging', 'prod'] }` — but constructs and application code cannot import
7
+ * the config, so a stage name written anywhere else was a bare `string`: a
8
+ * typo'd key in an `ExternalApi`'s `url` map was silently never read, and a
9
+ * seed's `stage === 'prodution'` branch silently never ran.
10
+ *
11
+ * `gkm dev`, `gkm build` and `gkm test --prepare` write `.gkm/stages.d.ts`,
12
+ * which fills this interface in from the loaded workspace:
13
+ *
14
+ * ```ts
15
+ * declare module '@geekmidas/constructs' {
16
+ * interface Stages { local: 'dev'; deployed: 'staging' | 'prod' }
17
+ * }
18
+ * ```
19
+ *
20
+ * Until that file exists — a fresh clone, before the first run — the interface
21
+ * is empty and every stage type below is `string`, so nothing fails to compile
22
+ * for want of a generated file.
23
+ */
24
+ interface Stages {}
25
+ /** What `Stages` says under `key`, or `string` while it says nothing. */
26
+ type Declared<TKey extends string> = Stages extends { [K in TKey]: infer TStage extends string; } ? TStage : string;
27
+ /** The stage `gkm dev`, `exec`, `setup` and `test` run as: `stages.local`. */
28
+ type LocalStage = Declared<'local'>;
29
+ /** A stage `gkm deploy --stage` accepts: one of `stages.deployed`. */
30
+ type DeployedStage = Declared<'deployed'>;
31
+ /** What `gkm test` runs as. The CLI's own; no project stage may take it. */
32
+ type TestStage = 'test';
33
+ /** Any stage the project's code can find itself running as. */
34
+ type AnyStage = LocalStage | TestStage | DeployedStage;
35
+ /**
36
+ * What a seed is handed beside its database.
37
+ *
38
+ * Seeds run on every stage, production included, so a seed that should write
39
+ * something only somewhere — a demo tenant on the local stage, never on a
40
+ * deployed one — decides by the stage it is given:
41
+ *
42
+ * ```ts
43
+ * import type { SeedContext } from '@geekmidas/constructs';
44
+ *
45
+ * export async function seed(db: Kysely<Database>, { stage }: SeedContext) {
46
+ * if (stage === 'dev') await insertDemoTenant(db);
47
+ * }
48
+ * ```
49
+ */
50
+ interface SeedContext {
51
+ /** The stage being seeded: the local one, `test`, or a deployed one. */
52
+ stage: AnyStage;
53
+ }
54
+ //#endregion
55
+ export { Stages as a, SeedContext as i, DeployedStage as n, TestStage as o, LocalStage as r, AnyStage as t };
56
+ //# sourceMappingURL=stages-BSCF19o2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stages-BSCF19o2.d.mts","names":[],"sources":["../src/stages.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAuBiB;;KAGZ,SAAS,uBAAuB,kBACnC,KAAK,aAAa,2BAEjB;;KAIS,aAAa;;KAGb,gBAAgB;;KAGhB;;KAGA,WAAW,aAAa,YAAY;;;;;;;;;;;;;;;;UAiB/B;;EAEhB,OAAO"}