@geekmidas/constructs 10.0.0-alpha.11 → 10.0.0-alpha.111

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 (438) hide show
  1. package/README.md +222 -158
  2. package/dist/Construct-BQALFCh2.d.cts +230 -0
  3. package/dist/Construct-BQALFCh2.d.cts.map +1 -0
  4. package/dist/{Construct-BD5neF7w.mjs → Construct-CKUA-CTA.mjs} +35 -35
  5. package/dist/Construct-CKUA-CTA.mjs.map +1 -0
  6. package/dist/{Construct-CyS3RpTL.cjs → Construct-DEOVauyA.cjs} +55 -49
  7. package/dist/Construct-DEOVauyA.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-DmQ8vQ4b.d.cts → Cron-CQJqqkhY.d.mts} +17 -11
  11. package/dist/Cron-CQJqqkhY.d.mts.map +1 -0
  12. package/dist/{Cron-dh4rUgib.d.mts → Cron-DI3nKoic.d.cts} +17 -11
  13. package/dist/Cron-DI3nKoic.d.cts.map +1 -0
  14. package/dist/{CronBuilder-Da0C0edR.cjs → CronBuilder-BXTG10u5.cjs} +47 -31
  15. package/dist/CronBuilder-BXTG10u5.cjs.map +1 -0
  16. package/dist/{CronBuilder-CYKT5RiO.mjs → CronBuilder-D3sF9tS_.mjs} +37 -21
  17. package/dist/CronBuilder-D3sF9tS_.mjs.map +1 -0
  18. package/dist/CronBuilder-Xx_zakuc.d.mts +47 -0
  19. package/dist/CronBuilder-Xx_zakuc.d.mts.map +1 -0
  20. package/dist/CronBuilder-g1lZLWyG.d.cts +47 -0
  21. package/dist/CronBuilder-g1lZLWyG.d.cts.map +1 -0
  22. package/dist/{Endpoint-BjWKinFA.d.mts → Endpoint-BWyKCa2x.d.cts} +130 -100
  23. package/dist/Endpoint-BWyKCa2x.d.cts.map +1 -0
  24. package/dist/{Endpoint-dav89W6-.d.cts → Endpoint-CrE9Ppdk.d.mts} +130 -100
  25. package/dist/Endpoint-CrE9Ppdk.d.mts.map +1 -0
  26. package/dist/{Endpoint-DCQPMdUX.mjs → Endpoint-gPXhHKhJ.mjs} +208 -100
  27. package/dist/Endpoint-gPXhHKhJ.mjs.map +1 -0
  28. package/dist/{Endpoint-DcWXE-SZ.cjs → Endpoint-yhR2T2Wt.cjs} +248 -122
  29. package/dist/Endpoint-yhR2T2Wt.cjs.map +1 -0
  30. package/dist/{index-lAO9egTb.d.mts → EndpointFactory-BV-nfnaP.d.mts} +85 -136
  31. package/dist/EndpointFactory-BV-nfnaP.d.mts.map +1 -0
  32. package/dist/{EndpointFactory-CdWB7wPw.cjs → EndpointFactory-BVv6EIDu.cjs} +98 -112
  33. package/dist/EndpointFactory-BVv6EIDu.cjs.map +1 -0
  34. package/dist/{index-Bd5FqCoe.d.cts → EndpointFactory-C1-IBwm4.d.cts} +84 -135
  35. package/dist/EndpointFactory-C1-IBwm4.d.cts.map +1 -0
  36. package/dist/{EndpointFactory-CjV8F_lJ.mjs → EndpointFactory-Cs8IHvwF.mjs} +62 -76
  37. package/dist/EndpointFactory-Cs8IHvwF.mjs.map +1 -0
  38. package/dist/Function-DuqGcbOI.d.mts +76 -0
  39. package/dist/Function-DuqGcbOI.d.mts.map +1 -0
  40. package/dist/Function-Pu-1kKZz.d.cts +76 -0
  41. package/dist/Function-Pu-1kKZz.d.cts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-DtL9j19R.cjs → HonoEndpointAdaptor-CN1jjUBJ.cjs} +115 -71
  43. package/dist/HonoEndpointAdaptor-CN1jjUBJ.cjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-P1ahhZHu.mjs → HonoEndpointAdaptor-euH1oSdY.mjs} +105 -64
  45. package/dist/HonoEndpointAdaptor-euH1oSdY.mjs.map +1 -0
  46. package/dist/Queue-BhuofM3k.cjs +109 -0
  47. package/dist/Queue-BhuofM3k.cjs.map +1 -0
  48. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-DlsHRzUp.d.mts} +48 -48
  49. package/dist/Queue-DlsHRzUp.d.mts.map +1 -0
  50. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-HPyi0e1i.d.cts} +49 -49
  51. package/dist/Queue-HPyi0e1i.d.cts.map +1 -0
  52. package/dist/Queue-cmhqEBOB.mjs +104 -0
  53. package/dist/Queue-cmhqEBOB.mjs.map +1 -0
  54. package/dist/QueueBuilder-Cx9lKC5d.d.mts +75 -0
  55. package/dist/QueueBuilder-Cx9lKC5d.d.mts.map +1 -0
  56. package/dist/QueueBuilder-DXu1qxT1.mjs +118 -0
  57. package/dist/QueueBuilder-DXu1qxT1.mjs.map +1 -0
  58. package/dist/QueueBuilder-DdU2klPu.cjs +135 -0
  59. package/dist/QueueBuilder-DdU2klPu.cjs.map +1 -0
  60. package/dist/QueueBuilder-OSi6LkV9.d.cts +75 -0
  61. package/dist/QueueBuilder-OSi6LkV9.d.cts.map +1 -0
  62. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-Bpp02cGr.d.cts} +29 -20
  63. package/dist/Subscriber-Bpp02cGr.d.cts.map +1 -0
  64. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-CtN9R48-.d.mts} +29 -20
  65. package/dist/Subscriber-CtN9R48-.d.mts.map +1 -0
  66. package/dist/SubscriberBuilder-4DWe9feX.d.mts +67 -0
  67. package/dist/SubscriberBuilder-4DWe9feX.d.mts.map +1 -0
  68. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DRXfxWn_.mjs} +50 -24
  69. package/dist/SubscriberBuilder-DRXfxWn_.mjs.map +1 -0
  70. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-M2EAgQhC.cjs} +61 -36
  71. package/dist/SubscriberBuilder-M2EAgQhC.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-D2R0r24C.mjs +99 -0
  75. package/dist/Topic-D2R0r24C.mjs.map +1 -0
  76. package/dist/Topic-DwS3QO0m.cjs +104 -0
  77. package/dist/Topic-DwS3QO0m.cjs.map +1 -0
  78. package/dist/adaptors/aws.cjs +200 -246
  79. package/dist/adaptors/aws.cjs.map +1 -1
  80. package/dist/adaptors/aws.d.cts +58 -62
  81. package/dist/adaptors/aws.d.cts.map +1 -1
  82. package/dist/adaptors/aws.d.mts +59 -63
  83. package/dist/adaptors/aws.d.mts.map +1 -1
  84. package/dist/adaptors/aws.mjs +171 -219
  85. package/dist/adaptors/aws.mjs.map +1 -1
  86. package/dist/adaptors/hono.cjs +3 -10
  87. package/dist/adaptors/hono.d.cts +7 -16
  88. package/dist/adaptors/hono.d.cts.map +1 -1
  89. package/dist/adaptors/hono.d.mts +9 -18
  90. package/dist/adaptors/hono.d.mts.map +1 -1
  91. package/dist/adaptors/hono.mjs +2 -10
  92. package/dist/adaptors/testing.cjs +765 -99
  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 +726 -78
  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-D_0788uW.d.mts +268 -0
  103. package/dist/auth-D_0788uW.d.mts.map +1 -0
  104. package/dist/auth.cjs +301 -33
  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 +289 -27
  109. package/dist/auth.mjs.map +1 -1
  110. package/dist/{cache-BrRz3fEB.d.mts → cache-5QZzh5Er.d.mts} +3 -6
  111. package/dist/cache-5QZzh5Er.d.mts.map +1 -0
  112. package/dist/{cache-BtZY_tHe.d.cts → cache-DnGDGly3.d.cts} +3 -6
  113. package/dist/cache-DnGDGly3.d.cts.map +1 -0
  114. package/dist/cache.cjs +68 -2
  115. package/dist/cache.cjs.map +1 -0
  116. package/dist/cache.d.cts +1 -2
  117. package/dist/cache.d.mts +1 -2
  118. package/dist/cache.mjs +67 -2
  119. package/dist/cache.mjs.map +1 -0
  120. package/dist/cipher-C1lEFX63.mjs +225 -0
  121. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  122. package/dist/cipher-CVxfwLjk.cjs +332 -0
  123. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  124. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  125. package/dist/clone-EKNovYHu.mjs.map +1 -0
  126. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  127. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  128. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
  129. package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
  130. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-ZvYQbivO.d.mts} +42 -11
  131. package/dist/construct-interface-ZvYQbivO.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-DYymbp_7.cjs +257 -0
  139. package/dist/credential-DYymbp_7.cjs.map +1 -0
  140. package/dist/credential-DfSAOOdY.mjs +222 -0
  141. package/dist/credential-DfSAOOdY.mjs.map +1 -0
  142. package/dist/credential.cjs +8 -96
  143. package/dist/credential.d.cts +2 -61
  144. package/dist/credential.d.mts +2 -61
  145. package/dist/credential.mjs +2 -94
  146. package/dist/crons/index.cjs +129 -7
  147. package/dist/crons/index.cjs.map +1 -1
  148. package/dist/crons/index.d.cts +45 -11
  149. package/dist/crons/index.d.cts.map +1 -1
  150. package/dist/crons/index.d.mts +45 -11
  151. package/dist/crons/index.d.mts.map +1 -1
  152. package/dist/crons/index.mjs +127 -8
  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 +4 -8
  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 +20 -16
  175. package/dist/endpoints/index.d.cts +105 -7
  176. package/dist/endpoints/index.d.cts.map +1 -0
  177. package/dist/endpoints/index.d.mts +105 -7
  178. package/dist/endpoints/index.d.mts.map +1 -0
  179. package/dist/endpoints/index.mjs +6 -10
  180. package/dist/external-api.cjs +106 -0
  181. package/dist/external-api.cjs.map +1 -0
  182. package/dist/external-api.d.cts +2 -0
  183. package/dist/external-api.d.mts +2 -0
  184. package/dist/external-api.mjs +103 -0
  185. package/dist/external-api.mjs.map +1 -0
  186. package/dist/fake-DqKo8INJ.d.mts +201 -0
  187. package/dist/fake-DqKo8INJ.d.mts.map +1 -0
  188. package/dist/fake-Dvion_Fh.d.cts +201 -0
  189. package/dist/fake-Dvion_Fh.d.cts.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 +3 -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-14lpEFL4.mjs → functions-CTI-hDem.mjs} +376 -238
  203. package/dist/{functions-14lpEFL4.mjs.map → functions-CTI-hDem.mjs.map} +1 -1
  204. package/dist/{functions-i_la-N5r.cjs → functions-D7O5SGVc.cjs} +414 -264
  205. package/dist/functions-D7O5SGVc.cjs.map +1 -0
  206. package/dist/index-B13kQB_U.d.mts +115 -0
  207. package/dist/index-B13kQB_U.d.mts.map +1 -0
  208. package/dist/index-BuzRvKOQ.d.cts +115 -0
  209. package/dist/index-BuzRvKOQ.d.cts.map +1 -0
  210. package/dist/index-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-B3zfg9ti.cjs +383 -0
  225. package/dist/kysely-B3zfg9ti.cjs.map +1 -0
  226. package/dist/kysely-B_0BAr0T.mjs +370 -0
  227. package/dist/kysely-B_0BAr0T.mjs.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-DKwnl0nf.d.mts +175 -0
  231. package/dist/kysely-DKwnl0nf.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/mobile-app.cjs +74 -0
  237. package/dist/mobile-app.cjs.map +1 -0
  238. package/dist/mobile-app.d.cts +73 -0
  239. package/dist/mobile-app.d.cts.map +1 -0
  240. package/dist/mobile-app.d.mts +73 -0
  241. package/dist/mobile-app.d.mts.map +1 -0
  242. package/dist/mobile-app.mjs +73 -0
  243. package/dist/mobile-app.mjs.map +1 -0
  244. package/dist/object-storage.cjs +18 -10
  245. package/dist/object-storage.cjs.map +1 -1
  246. package/dist/object-storage.d.cts +3 -7
  247. package/dist/object-storage.d.cts.map +1 -1
  248. package/dist/object-storage.d.mts +3 -7
  249. package/dist/object-storage.d.mts.map +1 -1
  250. package/dist/object-storage.mjs +11 -3
  251. package/dist/object-storage.mjs.map +1 -1
  252. package/dist/queue/index.cjs +6 -189
  253. package/dist/queue/index.d.cts +3 -60
  254. package/dist/queue/index.d.mts +3 -60
  255. package/dist/queue/index.mjs +3 -186
  256. package/dist/random-password.cjs +86 -0
  257. package/dist/random-password.cjs.map +1 -0
  258. package/dist/random-password.d.cts +30 -0
  259. package/dist/random-password.d.cts.map +1 -0
  260. package/dist/random-password.d.mts +30 -0
  261. package/dist/random-password.d.mts.map +1 -0
  262. package/dist/random-password.mjs +84 -0
  263. package/dist/random-password.mjs.map +1 -0
  264. package/dist/{lazyAccessors-BoJN3SMd.mjs → readRequestBody-BTIl3k-D.mjs} +117 -60
  265. package/dist/readRequestBody-BTIl3k-D.mjs.map +1 -0
  266. package/dist/readRequestBody-Dej_L3c4.cjs +342 -0
  267. package/dist/readRequestBody-Dej_L3c4.cjs.map +1 -0
  268. package/dist/requestLogger-BZcXwdBs.cjs +207 -0
  269. package/dist/requestLogger-BZcXwdBs.cjs.map +1 -0
  270. package/dist/requestLogger-pA4gi3E1.mjs +178 -0
  271. package/dist/requestLogger-pA4gi3E1.mjs.map +1 -0
  272. package/dist/rest-api.cjs +90 -59
  273. package/dist/rest-api.cjs.map +1 -1
  274. package/dist/rest-api.d.cts +70 -42
  275. package/dist/rest-api.d.cts.map +1 -1
  276. package/dist/rest-api.d.mts +70 -42
  277. package/dist/rest-api.d.mts.map +1 -1
  278. package/dist/rest-api.mjs +82 -51
  279. package/dist/rest-api.mjs.map +1 -1
  280. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  281. package/dist/runSubscriber-BHvJ8POr.mjs +109 -0
  282. package/dist/runSubscriber-BHvJ8POr.mjs.map +1 -0
  283. package/dist/runSubscriber-D8nLXIv1.cjs +126 -0
  284. package/dist/runSubscriber-D8nLXIv1.cjs.map +1 -0
  285. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  286. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  287. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  288. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  289. package/dist/site.cjs +33 -7
  290. package/dist/site.cjs.map +1 -1
  291. package/dist/site.d.cts +17 -7
  292. package/dist/site.d.cts.map +1 -1
  293. package/dist/site.d.mts +17 -7
  294. package/dist/site.d.mts.map +1 -1
  295. package/dist/site.mjs +29 -3
  296. package/dist/site.mjs.map +1 -1
  297. package/dist/stages-BSCF19o2.d.cts +56 -0
  298. package/dist/stages-BSCF19o2.d.cts.map +1 -0
  299. package/dist/stages-BSCF19o2.d.mts +56 -0
  300. package/dist/stages-BSCF19o2.d.mts.map +1 -0
  301. package/dist/subscribers/index.cjs +118 -6
  302. package/dist/subscribers/index.cjs.map +1 -0
  303. package/dist/subscribers/index.d.cts +51 -6
  304. package/dist/subscribers/index.d.cts.map +1 -0
  305. package/dist/subscribers/index.d.mts +51 -6
  306. package/dist/subscribers/index.d.mts.map +1 -0
  307. package/dist/subscribers/index.mjs +115 -5
  308. package/dist/subscribers/index.mjs.map +1 -0
  309. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  310. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  311. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  312. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  313. package/dist/telemetry-B48RLjyk.d.cts +40 -0
  314. package/dist/telemetry-B48RLjyk.d.cts.map +1 -0
  315. package/dist/telemetry-BEoBn6GO.d.mts +40 -0
  316. package/dist/telemetry-BEoBn6GO.d.mts.map +1 -0
  317. package/dist/telemetry.cjs +56 -0
  318. package/dist/telemetry.cjs.map +1 -0
  319. package/dist/telemetry.d.cts +2 -0
  320. package/dist/telemetry.d.mts +2 -0
  321. package/dist/telemetry.mjs +55 -0
  322. package/dist/telemetry.mjs.map +1 -0
  323. package/dist/topic/index.cjs +3 -137
  324. package/dist/topic/index.d.cts +2 -4
  325. package/dist/topic/index.d.mts +2 -4
  326. package/dist/topic/index.mjs +2 -134
  327. package/dist/tracing-Bbj1uoFJ.mjs +127 -0
  328. package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
  329. package/dist/tracing-C0ooU0V2.cjs +150 -0
  330. package/dist/tracing-C0ooU0V2.cjs.map +1 -0
  331. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  332. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  333. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  334. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  335. package/dist/types.d.cts +1 -1
  336. package/dist/types.d.mts +1 -1
  337. package/dist/types.mjs +1 -0
  338. package/dist/worker.cjs +59 -34
  339. package/dist/worker.cjs.map +1 -1
  340. package/dist/worker.d.cts +70 -45
  341. package/dist/worker.d.cts.map +1 -1
  342. package/dist/worker.d.mts +71 -46
  343. package/dist/worker.d.mts.map +1 -1
  344. package/dist/worker.mjs +54 -29
  345. package/dist/worker.mjs.map +1 -1
  346. package/package.json +106 -42
  347. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  348. package/dist/Construct-C0ijr2qp.d.cts +0 -117
  349. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  350. package/dist/Construct-Ct8nalEi.d.mts +0 -117
  351. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  352. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  353. package/dist/Cron-DmQ8vQ4b.d.cts.map +0 -1
  354. package/dist/Cron-dh4rUgib.d.mts.map +0 -1
  355. package/dist/CronBuilder-BquXDbDI.d.cts +0 -44
  356. package/dist/CronBuilder-BquXDbDI.d.cts.map +0 -1
  357. package/dist/CronBuilder-CGgY2080.d.mts +0 -44
  358. package/dist/CronBuilder-CGgY2080.d.mts.map +0 -1
  359. package/dist/CronBuilder-CYKT5RiO.mjs.map +0 -1
  360. package/dist/CronBuilder-Da0C0edR.cjs.map +0 -1
  361. package/dist/Endpoint-BjWKinFA.d.mts.map +0 -1
  362. package/dist/Endpoint-DCQPMdUX.mjs.map +0 -1
  363. package/dist/Endpoint-DcWXE-SZ.cjs.map +0 -1
  364. package/dist/Endpoint-dav89W6-.d.cts.map +0 -1
  365. package/dist/EndpointFactory-CdWB7wPw.cjs.map +0 -1
  366. package/dist/EndpointFactory-CjV8F_lJ.mjs.map +0 -1
  367. package/dist/HonoEndpointAdaptor-DtL9j19R.cjs.map +0 -1
  368. package/dist/HonoEndpointAdaptor-P1ahhZHu.mjs.map +0 -1
  369. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  370. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  371. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  372. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  373. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  374. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  375. package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
  376. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  377. package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
  378. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  379. package/dist/Topic-19QeHBIR.d.cts +0 -91
  380. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  381. package/dist/Topic-DuFeqkBh.d.mts +0 -91
  382. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  383. package/dist/auth.d.cts.map +0 -1
  384. package/dist/auth.d.mts.map +0 -1
  385. package/dist/cache-0ANvRQnD.mjs +0 -51
  386. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  387. package/dist/cache-3WSvAulx.cjs +0 -57
  388. package/dist/cache-3WSvAulx.cjs.map +0 -1
  389. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  390. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  391. package/dist/clone-DblgEZZa.mjs.map +0 -1
  392. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  393. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  394. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  395. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  396. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  397. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  398. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  399. package/dist/credential.cjs.map +0 -1
  400. package/dist/credential.d.cts.map +0 -1
  401. package/dist/credential.d.mts.map +0 -1
  402. package/dist/credential.mjs.map +0 -1
  403. package/dist/database/kysely.cjs.map +0 -1
  404. package/dist/database/kysely.d.cts.map +0 -1
  405. package/dist/database/kysely.d.mts.map +0 -1
  406. package/dist/database/kysely.mjs.map +0 -1
  407. package/dist/functions-i_la-N5r.cjs.map +0 -1
  408. package/dist/index-Bd5FqCoe.d.cts.map +0 -1
  409. package/dist/index-BknhM6Ux.d.mts +0 -31
  410. package/dist/index-BknhM6Ux.d.mts.map +0 -1
  411. package/dist/index-CBSfrowv.d.cts +0 -31
  412. package/dist/index-CBSfrowv.d.cts.map +0 -1
  413. package/dist/index-D24Xm79M.d.cts +0 -171
  414. package/dist/index-D24Xm79M.d.cts.map +0 -1
  415. package/dist/index-_ajboYxK.d.mts +0 -171
  416. package/dist/index-_ajboYxK.d.mts.map +0 -1
  417. package/dist/index-lAO9egTb.d.mts.map +0 -1
  418. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  419. package/dist/lazyAccessors-e3j2oE2m.cjs +0 -274
  420. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  421. package/dist/processAudits-CGqttuXm.cjs +0 -92
  422. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  423. package/dist/processAudits-Dmts9H_b.mjs +0 -80
  424. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  425. package/dist/queue/index.cjs.map +0 -1
  426. package/dist/queue/index.d.cts.map +0 -1
  427. package/dist/queue/index.d.mts.map +0 -1
  428. package/dist/queue/index.mjs.map +0 -1
  429. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  430. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  431. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  432. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  433. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  434. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  435. package/dist/topic/index.cjs.map +0 -1
  436. package/dist/topic/index.mjs.map +0 -1
  437. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  438. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -0,0 +1,230 @@
1
+ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
2
+ import { Logger } from "@geekmidas/logger";
3
+ import { InferStandardSchema } from "@geekmidas/schema";
4
+ import { Service, ServiceContext, ServiceDiscovery } from "@geekmidas/services";
5
+ import { AuditStorage } from "@geekmidas/audit";
6
+ import { SniffResult } from "@geekmidas/envkit/sniffer";
7
+ import { EventPublisher, PublishableMessage } from "@geekmidas/events";
8
+ import { ConstructName, Declaration } from "@geekmidas/manifest";
9
+ //#region src/topic/Topic.d.ts
10
+ /** A topic's event contract — a map of event type → payload schema. */
11
+ type TopicEvents = Record<string, StandardSchemaV1>;
12
+ /**
13
+ * The union of wire messages a topic carries, derived from its event map:
14
+ * `{ type: 'user.created'; payload: … } | { type: 'user.updated'; payload: … }`.
15
+ */
16
+ type TopicMessage<TEvents extends TopicEvents> = { [K in keyof TEvents & string]: PublishableMessage<K, InferStandardSchema<TEvents[K]>>; }[keyof TEvents & string];
17
+ /**
18
+ * A topic — pub/sub fan-out. Unlike a `Queue` (point-to-point, one consumer), a
19
+ * topic is a *resource* owned by no single handler: it declares the event
20
+ * contract, and any number of subscribers (`worker.topic(topic)`) bind to it.
21
+ * `gkm build` discovers it into the manifest's `topics` field; infra provisions
22
+ * an SNS topic.
23
+ *
24
+ * A construct publishes with `.event(topic, { type, payload })`, repeatable
25
+ * across topics, each event going through its own topic's publisher. That also
26
+ * puts `services.<topic>` in the handler, as `.dependsOn([topic])` does, for an
27
+ * event the handler decides on itself.
28
+ *
29
+ * ```ts
30
+ * export const users = new Topic('Users', {
31
+ * events: { 'user.created': z.object({ userId: z.string() }) },
32
+ * });
33
+ * ```
34
+ */
35
+ declare class Topic<TName extends string = string, TEvents extends TopicEvents = TopicEvents> extends Construct {
36
+ __IS_TOPIC__: boolean;
37
+ static isTopic(obj: unknown): obj is Topic<string, TopicEvents>;
38
+ /**
39
+ * The canonical id this topic is declared under.
40
+ *
41
+ * Derived from the name, so `users` and `Users` are one topic. The name is
42
+ * left alone: subscribers bind to it and it is what the broker routes on.
43
+ */
44
+ readonly id: string;
45
+ /** The name it was declared with — what the broker routes on. */
46
+ readonly name: TName;
47
+ /**
48
+ * The event contract — a map of event type → payload schema. Named
49
+ * `eventSchemas` (not `events`) to avoid clashing with `Construct.events`,
50
+ * which is the array of `MappedEvent`s a construct *publishes*.
51
+ */
52
+ readonly eventSchemas: TEvents;
53
+ /**
54
+ * The topic as a dependency — what `.dependsOn([users])` and
55
+ * `.event(users, …)` dissolve into, reachable as `services.users`.
56
+ *
57
+ * The producer, because publishing is the only thing depending on a topic
58
+ * can mean: a subscriber binds to the topic instead, and is never handed
59
+ * this. It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and picks the
60
+ * transport from its protocol — `pgboss://` locally, `sns://` deployed.
61
+ *
62
+ * A field assigned once, not a getter: services are cached by object
63
+ * identity, and a fresh literal on every access never hit that cache.
64
+ */
65
+ readonly service: Service<Uncapitalize<TName>, EventPublisher<TopicMessage<TEvents>>>;
66
+ /** The producer's env key, read by both {@link declare} and the service. */
67
+ private readonly connectionKey;
68
+ constructor(name: ConstructName<TName>, options: TopicOptions<TEvents>);
69
+ /**
70
+ * What this topic is in the manifest.
71
+ *
72
+ * Only the producer's key: a subscriber is *bound* to a topic rather than
73
+ * depending on it, so the binding is an edge the deploy target reads and not
74
+ * an env key anyone can hold. Locally both sides meet on the same broker.
75
+ */
76
+ declare(): Declaration[];
77
+ /** The event type names this topic carries. */
78
+ get eventTypes(): (keyof TEvents & string)[];
79
+ }
80
+ interface TopicOptions<TEvents extends TopicEvents> {
81
+ /** Each event this topic carries — its type, and its payload's schema. */
82
+ events: TEvents;
83
+ }
84
+ //#endregion
85
+ //#region src/publisher.d.ts
86
+ /**
87
+ * An event a construct publishes to a topic once its handler has succeeded.
88
+ *
89
+ * It carries its topic, so a construct can publish to as many topics as it
90
+ * names — each event goes through the publisher of the topic it was declared
91
+ * against, never a single shared one.
92
+ */
93
+ interface TopicEvent<TOutput = any> {
94
+ /** The topic's service: the publisher this event is sent through. */
95
+ topic: Service<string, EventPublisher<any>>;
96
+ type: string;
97
+ /** The event's payload, from what the handler returned. */
98
+ payload: (output: TOutput) => unknown;
99
+ /** Publish only when this holds for what the handler returned. */
100
+ when?: (output: TOutput) => boolean;
101
+ }
102
+ /**
103
+ * What `.event(topic, …)` takes: one of the topic's event types, and a payload
104
+ * of that event's shape built from the handler's output.
105
+ */
106
+ type EventFor<TTopic extends Topic<any, any>, TOutput> = TTopic extends Topic<string, infer TEvents> ? { [K in keyof TEvents & string]: {
107
+ type: K;
108
+ payload: (output: TOutput) => InferStandardSchema<TEvents[K]>;
109
+ when?: (output: TOutput) => boolean;
110
+ }; }[keyof TEvents & string] : never;
111
+ /** Publish a construct's declared events for what its handler returned. */
112
+ declare function publishConstructEvents<OutSchema extends StandardSchemaV1 | undefined = undefined>(construct: Pick<Construct, 'events' | 'logger'>, response: InferStandardSchema<OutSchema>, serviceDiscovery: ServiceDiscovery<any>, logger?: Logger, provided?: Readonly<Record<string, unknown>>): Promise<void>;
113
+ //#endregion
114
+ //#region src/Construct.d.ts
115
+ /**
116
+ * Noop context for environment sniffing.
117
+ * Used when calling service.register() to detect env vars without a real request.
118
+ * Returns dummy values since services should only use context in instance methods,
119
+ * not during registration.
120
+ */
121
+ declare const snifferContext: ServiceContext;
122
+ declare abstract class Construct<TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TAuditStorageServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TDatabaseServiceName extends string = string, TDatabase = unknown> {
123
+ readonly type: ConstructType;
124
+ readonly logger: TLogger;
125
+ readonly services: TServices;
126
+ /**
127
+ * What this construct publishes once its handler succeeds — each event
128
+ * bound to its own topic, so a construct publishes to as many as it names.
129
+ */
130
+ readonly events: TopicEvent[];
131
+ outputSchema?: OutSchema | undefined;
132
+ readonly timeout?: number | undefined;
133
+ readonly memorySize?: number | undefined;
134
+ readonly auditorStorageService?: Service<TAuditStorageServiceName, TAuditStorage>;
135
+ /**
136
+ * The constructs this one declared an edge to, by id.
137
+ *
138
+ * What the manifest records. `services` is the same information in the
139
+ * form a handler runs with — clients, keyed by name — and an id cannot be
140
+ * recovered from one of those reliably, so both are kept.
141
+ *
142
+ * Last in the list because every other parameter is positional and already
143
+ * spoken for; a new one anywhere else silently rebinds existing callers.
144
+ */
145
+ readonly constructs: string[];
146
+ /** Database service for this construct (used by Endpoint for RLS/audit context) */
147
+ databaseService?: Service<TDatabaseServiceName, TDatabase>;
148
+ /**
149
+ * The deploy unit that runs this, by construct id.
150
+ *
151
+ * What an endpoint's `surface` is to it, and for the same reason: something
152
+ * has to say which process a runnable belongs to, and until this existed the
153
+ * only thing that said so was the directory its file sat in. Set by the
154
+ * factory it was built from — `worker.crons`, `api.get(…)` — so it is
155
+ * carried rather than configured.
156
+ *
157
+ * Undefined for a construct built from a free-standing builder, which is
158
+ * still how `c`, `s` and `f` work.
159
+ */
160
+ owner?: string;
161
+ constructor(type: ConstructType, logger: TLogger, services: TServices,
162
+ /**
163
+ * What this construct publishes once its handler succeeds — each event
164
+ * bound to its own topic, so a construct publishes to as many as it names.
165
+ */
166
+ events?: TopicEvent[], outputSchema?: OutSchema | undefined, timeout?: number | undefined, memorySize?: number | undefined, auditorStorageService?: Service<TAuditStorageServiceName, TAuditStorage>,
167
+ /**
168
+ * The constructs this one declared an edge to, by id.
169
+ *
170
+ * What the manifest records. `services` is the same information in the
171
+ * form a handler runs with — clients, keyed by name — and an id cannot be
172
+ * recovered from one of those reliably, so both are kept.
173
+ *
174
+ * Last in the list because every other parameter is positional and already
175
+ * spoken for; a new one anywhere else silently rebinds existing callers.
176
+ */
177
+ constructs?: string[]);
178
+ /**
179
+ * Returns an array of environment variable names required by this construct's services.
180
+ * This is determined by running a "sniffer" EnvironmentParser through each service's
181
+ * register method to track which environment variables are accessed.
182
+ *
183
+ * Results are cached per service class to handle singleton patterns where
184
+ * subsequent register() calls may short-circuit and not access env vars.
185
+ *
186
+ * @param markOptional - When true, optional vars (those accessed via `.optional()` or
187
+ * `.default()`) are suffixed with `?` in the returned array (e.g. `'PORT?'`).
188
+ * @returns Promise that resolves to array of environment variable names, sorted alphabetically
189
+ *
190
+ * @example
191
+ * ```typescript
192
+ * const endpoint = e
193
+ * .services([databaseService, authService])
194
+ * .get('/users')
195
+ * .handle(async () => []);
196
+ *
197
+ * await endpoint.getEnvironment(); // ['AUTH_SECRET', 'DATABASE_URL']
198
+ * await endpoint.getEnvironment({ markOptional: true }); // ['AUTH_SECRET', 'DATABASE_URL', 'PORT?']
199
+ * ```
200
+ */
201
+ getEnvironment(opts?: {
202
+ markOptional?: boolean;
203
+ }): Promise<string[]>;
204
+ }
205
+ declare enum ConstructType {
206
+ Cron = "dev.geekmidas.function.cron",
207
+ Endpoint = "dev.geekmidas.function.endpoint",
208
+ Function = "dev.geekmidas.function.function",
209
+ Subscriber = "dev.geekmidas.function.subscriber",
210
+ Queue = "dev.geekmidas.function.queue",
211
+ Topic = "dev.geekmidas.resource.topic"
212
+ }
213
+ /**
214
+ * Utility to test sniffing a service for environment variables.
215
+ * Useful for debugging services that throw errors during sniffing.
216
+ *
217
+ * @example
218
+ * ```typescript
219
+ * import { sniffService } from '@geekmidas/constructs';
220
+ * import { authService } from './services/AuthService';
221
+ *
222
+ * const result = await sniffService(authService);
223
+ * console.log('Env vars:', result.envVars);
224
+ * console.log('Error:', result.error);
225
+ * ```
226
+ */
227
+ declare function sniffService(service: Service): Promise<SniffResult>;
228
+ //#endregion
229
+ export { EventFor as a, Topic as c, TopicOptions as d, snifferContext as i, TopicEvents as l, ConstructType as n, TopicEvent as o, sniffService as r, publishConstructEvents as s, Construct as t, TopicMessage as u };
230
+ //# sourceMappingURL=Construct-BQALFCh2.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Construct-BQALFCh2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,eAAe,uBACN,8BACA,iCACA,wBAAwB,QACvC,0BACA,gBAYe;;;;;;;;;;;EAAA;;;;;;;;;;;;;;;;;;;;;;;;EA0BX,eACL;IAAQ;MACN;;aAiEQ;EACX;EACA;EACA;EACA;EACA;EACA;;;;;;;;;;;;;;;;iBAiBqB,aAAa,SAAS,UAAU,QAAQ"}
@@ -1,15 +1,12 @@
1
1
  import { SnifferEnvironmentParser, sniffWithFireAndForget } from "@geekmidas/envkit/sniffer";
2
-
3
- //#region rolldown:runtime
2
+ //#region \0rolldown/runtime.js
4
3
  var __create = Object.create;
5
4
  var __defProp = Object.defineProperty;
6
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
7
  var __getProtoOf = Object.getPrototypeOf;
9
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __commonJS = (cb, mod) => function() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
13
10
  var __copyProps = (to, from, except, desc) => {
14
11
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
12
  key = keys[i];
@@ -20,14 +17,13 @@ var __copyProps = (to, from, except, desc) => {
20
17
  }
21
18
  return to;
22
19
  };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
24
21
  value: mod,
25
22
  enumerable: true
26
23
  }) : target, mod));
27
-
28
24
  //#endregion
29
- //#region ../../node_modules/.pnpm/lodash.compact@3.0.1/node_modules/lodash.compact/index.js
30
- var require_lodash = __commonJS({ "../../node_modules/.pnpm/lodash.compact@3.0.1/node_modules/lodash.compact/index.js"(exports, module) {
25
+ //#region src/Construct.ts
26
+ var import_lodash_compact = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
31
27
  /**
32
28
  * lodash 3.0.1 (Custom Build) <https://lodash.com/>
33
29
  * Build: `lodash modularize exports="npm" -o ./`
@@ -50,7 +46,7 @@ var require_lodash = __commonJS({ "../../node_modules/.pnpm/lodash.compact@3.0.1
50
46
  * _.compact([0, 1, false, 2, '', 3]);
51
47
  * // => [1, 2, 3]
52
48
  */
53
- function compact$1(array) {
49
+ function compact(array) {
54
50
  var index = -1, length = array ? array.length : 0, resIndex = 0, result = [];
55
51
  while (++index < length) {
56
52
  var value = array[index];
@@ -58,12 +54,8 @@ var require_lodash = __commonJS({ "../../node_modules/.pnpm/lodash.compact@3.0.1
58
54
  }
59
55
  return result;
60
56
  }
61
- module.exports = compact$1;
62
- } });
63
-
64
- //#endregion
65
- //#region src/Construct.ts
66
- var import_lodash = __toESM(require_lodash(), 1);
57
+ module.exports = compact;
58
+ })))(), 1);
67
59
  const serviceEnvCache = /* @__PURE__ */ new Map();
68
60
  /**
69
61
  * Noop context for environment sniffing.
@@ -89,9 +81,19 @@ const snifferContext = {
89
81
  },
90
82
  hasContext() {
91
83
  return false;
92
- }
84
+ },
85
+ getUser() {}
93
86
  };
94
87
  var Construct = class {
88
+ type;
89
+ logger;
90
+ services;
91
+ events;
92
+ outputSchema;
93
+ timeout;
94
+ memorySize;
95
+ auditorStorageService;
96
+ constructs;
95
97
  /** Database service for this construct (used by Endpoint for RLS/audit context) */
96
98
  databaseService;
97
99
  /**
@@ -100,19 +102,18 @@ var Construct = class {
100
102
  * What an endpoint's `surface` is to it, and for the same reason: something
101
103
  * has to say which process a runnable belongs to, and until this existed the
102
104
  * only thing that said so was the directory its file sat in. Set by the
103
- * factory it was built from — `worker.crons`, `api.endpoints` — so it is
105
+ * factory it was built from — `worker.crons`, `api.get(…)` — so it is
104
106
  * carried rather than configured.
105
107
  *
106
108
  * Undefined for a construct built from a free-standing builder, which is
107
109
  * still how `c`, `s` and `f` work.
108
110
  */
109
111
  owner;
110
- constructor(type, logger, services, events = [], publisherService, outputSchema, timeout, memorySize, auditorStorageService, constructs = []) {
112
+ constructor(type, logger, services, events = [], outputSchema, timeout, memorySize, auditorStorageService, constructs = []) {
111
113
  this.type = type;
112
114
  this.logger = logger;
113
115
  this.services = services;
114
116
  this.events = events;
115
- this.publisherService = publisherService;
116
117
  this.outputSchema = outputSchema;
117
118
  this.timeout = timeout;
118
119
  this.memorySize = memorySize;
@@ -146,10 +147,9 @@ var Construct = class {
146
147
  const { markOptional = false } = opts;
147
148
  const envVars = /* @__PURE__ */ new Set();
148
149
  const optionalVars = /* @__PURE__ */ new Set();
149
- const services = (0, import_lodash.default)([
150
+ const services = (0, import_lodash_compact.default)([
150
151
  ...this.services,
151
- this.publisherService,
152
- this.publisherService,
152
+ ...this.events.map(({ topic }) => topic),
153
153
  this.auditorStorageService,
154
154
  this.databaseService
155
155
  ]);
@@ -181,19 +181,19 @@ var Construct = class {
181
181
  if (!markOptional || optionalVars.size === 0) return sorted;
182
182
  return sorted.map((v) => optionalVars.has(v) ? `${v}?` : v);
183
183
  } catch (error) {
184
- this.logger.error({ error }, "Error determining environment variables for construct");
184
+ this.logger.error({ err: error }, "Error determining environment variables for construct");
185
185
  return [];
186
186
  }
187
187
  }
188
188
  };
189
- let ConstructType = /* @__PURE__ */ function(ConstructType$1) {
190
- ConstructType$1["Cron"] = "dev.geekmidas.function.cron";
191
- ConstructType$1["Endpoint"] = "dev.geekmidas.function.endpoint";
192
- ConstructType$1["Function"] = "dev.geekmidas.function.function";
193
- ConstructType$1["Subscriber"] = "dev.geekmidas.function.subscriber";
194
- ConstructType$1["Queue"] = "dev.geekmidas.function.queue";
195
- ConstructType$1["Topic"] = "dev.geekmidas.resource.topic";
196
- return ConstructType$1;
189
+ let ConstructType = /* @__PURE__ */ function(ConstructType) {
190
+ ConstructType["Cron"] = "dev.geekmidas.function.cron";
191
+ ConstructType["Endpoint"] = "dev.geekmidas.function.endpoint";
192
+ ConstructType["Function"] = "dev.geekmidas.function.function";
193
+ ConstructType["Subscriber"] = "dev.geekmidas.function.subscriber";
194
+ ConstructType["Queue"] = "dev.geekmidas.function.queue";
195
+ ConstructType["Topic"] = "dev.geekmidas.resource.topic";
196
+ return ConstructType;
197
197
  }({});
198
198
  /**
199
199
  * Utility to test sniffing a service for environment variables.
@@ -216,7 +216,7 @@ async function sniffService(service) {
216
216
  context: snifferContext
217
217
  }));
218
218
  }
219
-
220
219
  //#endregion
221
- export { Construct, ConstructType, __commonJS, __toESM, sniffService, snifferContext };
222
- //# sourceMappingURL=Construct-BD5neF7w.mjs.map
220
+ export { __commonJSMin as a, snifferContext as i, ConstructType as n, __toESM as o, sniffService as r, Construct as t };
221
+
222
+ //# sourceMappingURL=Construct-CKUA-CTA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Construct-CKUA-CTA.mjs","names":["compact"],"sources":["../../../node_modules/.pnpm/lodash.compact@3.0.1/node_modules/lodash.compact/index.js","../src/Construct.ts"],"sourcesContent":["/**\n * lodash 3.0.1 (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license <https://lodash.com/license>\n */\n\n/**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\nfunction compact(array) {\n var index = -1,\n length = array ? array.length : 0,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = compact;\n","import type { AuditStorage } from '@geekmidas/audit';\nimport {\n\tSnifferEnvironmentParser,\n\ttype SniffResult,\n\tsniffWithFireAndForget,\n} from '@geekmidas/envkit/sniffer';\nimport type { Logger } from '@geekmidas/logger';\nimport type { Service, ServiceContext } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport compact from 'lodash.compact';\nimport type { TopicEvent } from './publisher';\n\n// Cache for service environment variables to handle singleton services\n// Stores both the full list and the optional subset so the same sniff result\n// can satisfy both getEnvironment() and getEnvironment({ markOptional: true }).\nconst serviceEnvCache = new Map<\n\tService,\n\t{ envVars: string[]; optionalEnvVars: string[] }\n>();\n\n/**\n * Noop context for environment sniffing.\n * Used when calling service.register() to detect env vars without a real request.\n * Returns dummy values since services should only use context in instance methods,\n * not during registration.\n */\nconst snifferContext: ServiceContext = {\n\tgetLogger() {\n\t\t// Return a noop logger for sniffing - services shouldn't log during registration\n\t\treturn {\n\t\t\tdebug: () => {},\n\t\t\tinfo: () => {},\n\t\t\twarn: () => {},\n\t\t\terror: () => {},\n\t\t\tchild: () => snifferContext.getLogger(),\n\t\t} as unknown as Logger;\n\t},\n\tgetRequestId() {\n\t\treturn 'sniffer-context';\n\t},\n\tgetRequestStartTime() {\n\t\treturn Date.now();\n\t},\n\thasContext() {\n\t\treturn false;\n\t},\n\tgetUser() {\n\t\treturn undefined;\n\t},\n};\n\nexport abstract class Construct<\n\tTLogger extends Logger = Logger,\n\tOutSchema extends StandardSchemaV1 | undefined = undefined,\n\tTServices extends Service[] = [],\n\tTAuditStorageServiceName extends string = string,\n\tTAuditStorage extends AuditStorage | undefined = undefined,\n\tTDatabaseServiceName extends string = string,\n\tTDatabase = unknown,\n> {\n\t/** Database service for this construct (used by Endpoint for RLS/audit context) */\n\tpublic databaseService?: Service<TDatabaseServiceName, TDatabase>;\n\n\t/**\n\t * The deploy unit that runs this, by construct id.\n\t *\n\t * What an endpoint's `surface` is to it, and for the same reason: something\n\t * has to say which process a runnable belongs to, and until this existed the\n\t * only thing that said so was the directory its file sat in. Set by the\n\t * factory it was built from — `worker.crons`, `api.get(…)` — so it is\n\t * carried rather than configured.\n\t *\n\t * Undefined for a construct built from a free-standing builder, which is\n\t * still how `c`, `s` and `f` work.\n\t */\n\tpublic owner?: string;\n\n\tconstructor(\n\t\tpublic readonly type: ConstructType,\n\t\tpublic readonly logger: TLogger,\n\t\tpublic readonly services: TServices,\n\t\t/**\n\t\t * What this construct publishes once its handler succeeds — each event\n\t\t * bound to its own topic, so a construct publishes to as many as it names.\n\t\t */\n\t\tpublic readonly events: TopicEvent[] = [],\n\t\tpublic outputSchema?: OutSchema,\n\t\tpublic readonly timeout?: number,\n\t\tpublic readonly memorySize?: number,\n\t\tpublic readonly auditorStorageService?: Service<\n\t\t\tTAuditStorageServiceName,\n\t\t\tTAuditStorage\n\t\t>,\n\t\t/**\n\t\t * The constructs this one declared an edge to, by id.\n\t\t *\n\t\t * What the manifest records. `services` is the same information in the\n\t\t * form a handler runs with — clients, keyed by name — and an id cannot be\n\t\t * recovered from one of those reliably, so both are kept.\n\t\t *\n\t\t * Last in the list because every other parameter is positional and already\n\t\t * spoken for; a new one anywhere else silently rebinds existing callers.\n\t\t */\n\t\tpublic readonly constructs: string[] = [],\n\t) {}\n\n\t/**\n\t * Returns an array of environment variable names required by this construct's services.\n\t * This is determined by running a \"sniffer\" EnvironmentParser through each service's\n\t * register method to track which environment variables are accessed.\n\t *\n\t * Results are cached per service class to handle singleton patterns where\n\t * subsequent register() calls may short-circuit and not access env vars.\n\t *\n\t * @param markOptional - When true, optional vars (those accessed via `.optional()` or\n\t * `.default()`) are suffixed with `?` in the returned array (e.g. `'PORT?'`).\n\t * @returns Promise that resolves to array of environment variable names, sorted alphabetically\n\t *\n\t * @example\n\t * ```typescript\n\t * const endpoint = e\n\t * .services([databaseService, authService])\n\t * .get('/users')\n\t * .handle(async () => []);\n\t *\n\t * await endpoint.getEnvironment(); // ['AUTH_SECRET', 'DATABASE_URL']\n\t * await endpoint.getEnvironment({ markOptional: true }); // ['AUTH_SECRET', 'DATABASE_URL', 'PORT?']\n\t * ```\n\t */\n\tasync getEnvironment(\n\t\topts: { markOptional?: boolean } = {},\n\t): Promise<string[]> {\n\t\tconst { markOptional = false } = opts;\n\t\tconst envVars = new Set<string>();\n\t\tconst optionalVars = new Set<string>();\n\t\tconst services: Service[] = compact([\n\t\t\t...this.services,\n\t\t\t// Each topic an event names is a dependency like any other.\n\t\t\t...this.events.map(({ topic }) => topic),\n\t\t\tthis.auditorStorageService,\n\t\t\tthis.databaseService,\n\t\t]);\n\n\t\ttry {\n\t\t\tfor (const service of services) {\n\t\t\t\t// Check cache first - handles singleton services that short-circuit\n\t\t\t\tif (serviceEnvCache.has(service)) {\n\t\t\t\t\tconst cached = serviceEnvCache.get(service)!;\n\t\t\t\t\tcached.envVars.forEach((v) => envVars.add(v));\n\t\t\t\t\tcached.optionalEnvVars.forEach((v) => optionalVars.add(v));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Use sniffService to properly handle all error scenarios\n\t\t\t\tconst result = await sniffService(service);\n\n\t\t\t\t// Log any issues for debugging\n\t\t\t\tif (result.error) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t{ error: result.error.message, service: service.serviceName },\n\t\t\t\t\t\t'Service threw error during env sniffing (env vars still captured)',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (result.unhandledRejections.length > 0) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrors: result.unhandledRejections.map((e) => e.message),\n\t\t\t\t\t\t\tservice: service.serviceName,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'Fire-and-forget rejections during env sniffing (suppressed)',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Cache and collect env vars (both required and optional)\n\t\t\t\tserviceEnvCache.set(service, {\n\t\t\t\t\tenvVars: result.envVars,\n\t\t\t\t\toptionalEnvVars: result.optionalEnvVars,\n\t\t\t\t});\n\t\t\t\tresult.envVars.forEach((v) => envVars.add(v));\n\t\t\t\tresult.optionalEnvVars.forEach((v) => optionalVars.add(v));\n\t\t\t}\n\n\t\t\tconst sorted = Array.from(envVars).sort();\n\t\t\tif (!markOptional || optionalVars.size === 0) return sorted;\n\t\t\treturn sorted.map((v) => (optionalVars.has(v) ? `${v}?` : v));\n\t\t} catch (error) {\n\t\t\tthis.logger.error(\n\t\t\t\t{ err: error },\n\t\t\t\t'Error determining environment variables for construct',\n\t\t\t);\n\n\t\t\treturn [];\n\t\t}\n\t}\n}\n\nexport enum ConstructType {\n\tCron = 'dev.geekmidas.function.cron',\n\tEndpoint = 'dev.geekmidas.function.endpoint',\n\tFunction = 'dev.geekmidas.function.function',\n\tSubscriber = 'dev.geekmidas.function.subscriber',\n\tQueue = 'dev.geekmidas.function.queue',\n\tTopic = 'dev.geekmidas.resource.topic',\n}\n\n/**\n * Utility to test sniffing a service for environment variables.\n * Useful for debugging services that throw errors during sniffing.\n *\n * @example\n * ```typescript\n * import { sniffService } from '@geekmidas/constructs';\n * import { authService } from './services/AuthService';\n *\n * const result = await sniffService(authService);\n * console.log('Env vars:', result.envVars);\n * console.log('Error:', result.error);\n * ```\n */\nexport async function sniffService(service: Service): Promise<SniffResult> {\n\tconst sniffer = new SnifferEnvironmentParser();\n\n\treturn sniffWithFireAndForget(sniffer, () =>\n\t\tservice.register({\n\t\t\tenvParser: sniffer as any,\n\t\t\tcontext: snifferContext,\n\t\t}),\n\t);\n}\n\n// Export for testing\nexport { snifferContext };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBA,SAAS,QAAQ,OAAO;EACtB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AAW;EACX,SAAS;CACV,CAAC,CACF;AACD"}
@@ -1,8 +1,7 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const __geekmidas_envkit_sniffer = require_chunk.__toESM(require("@geekmidas/envkit/sniffer"));
3
-
1
+ const require_rolldown_runtime = require("./rolldown-runtime-y5ARvAq5.cjs");
2
+ let _geekmidas_envkit_sniffer = require("@geekmidas/envkit/sniffer");
4
3
  //#region ../../node_modules/.pnpm/lodash.compact@3.0.1/node_modules/lodash.compact/index.js
5
- var require_lodash = require_chunk.__commonJS({ "../../node_modules/.pnpm/lodash.compact@3.0.1/node_modules/lodash.compact/index.js"(exports, module) {
4
+ var require_lodash_compact = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
6
5
  /**
7
6
  * lodash 3.0.1 (Custom Build) <https://lodash.com/>
8
7
  * Build: `lodash modularize exports="npm" -o ./`
@@ -25,7 +24,7 @@ var require_lodash = require_chunk.__commonJS({ "../../node_modules/.pnpm/lodash
25
24
  * _.compact([0, 1, false, 2, '', 3]);
26
25
  * // => [1, 2, 3]
27
26
  */
28
- function compact$1(array) {
27
+ function compact(array) {
29
28
  var index = -1, length = array ? array.length : 0, resIndex = 0, result = [];
30
29
  while (++index < length) {
31
30
  var value = array[index];
@@ -33,12 +32,11 @@ var require_lodash = require_chunk.__commonJS({ "../../node_modules/.pnpm/lodash
33
32
  }
34
33
  return result;
35
34
  }
36
- module.exports = compact$1;
37
- } });
38
-
35
+ module.exports = compact;
36
+ }));
39
37
  //#endregion
40
38
  //#region src/Construct.ts
41
- var import_lodash = require_chunk.__toESM(require_lodash(), 1);
39
+ var import_lodash_compact = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_lodash_compact(), 1);
42
40
  const serviceEnvCache = /* @__PURE__ */ new Map();
43
41
  /**
44
42
  * Noop context for environment sniffing.
@@ -64,9 +62,19 @@ const snifferContext = {
64
62
  },
65
63
  hasContext() {
66
64
  return false;
67
- }
65
+ },
66
+ getUser() {}
68
67
  };
69
68
  var Construct = class {
69
+ type;
70
+ logger;
71
+ services;
72
+ events;
73
+ outputSchema;
74
+ timeout;
75
+ memorySize;
76
+ auditorStorageService;
77
+ constructs;
70
78
  /** Database service for this construct (used by Endpoint for RLS/audit context) */
71
79
  databaseService;
72
80
  /**
@@ -75,19 +83,18 @@ var Construct = class {
75
83
  * What an endpoint's `surface` is to it, and for the same reason: something
76
84
  * has to say which process a runnable belongs to, and until this existed the
77
85
  * only thing that said so was the directory its file sat in. Set by the
78
- * factory it was built from — `worker.crons`, `api.endpoints` — so it is
86
+ * factory it was built from — `worker.crons`, `api.get(…)` — so it is
79
87
  * carried rather than configured.
80
88
  *
81
89
  * Undefined for a construct built from a free-standing builder, which is
82
90
  * still how `c`, `s` and `f` work.
83
91
  */
84
92
  owner;
85
- constructor(type, logger, services, events = [], publisherService, outputSchema, timeout, memorySize, auditorStorageService, constructs = []) {
93
+ constructor(type, logger, services, events = [], outputSchema, timeout, memorySize, auditorStorageService, constructs = []) {
86
94
  this.type = type;
87
95
  this.logger = logger;
88
96
  this.services = services;
89
97
  this.events = events;
90
- this.publisherService = publisherService;
91
98
  this.outputSchema = outputSchema;
92
99
  this.timeout = timeout;
93
100
  this.memorySize = memorySize;
@@ -121,10 +128,9 @@ var Construct = class {
121
128
  const { markOptional = false } = opts;
122
129
  const envVars = /* @__PURE__ */ new Set();
123
130
  const optionalVars = /* @__PURE__ */ new Set();
124
- const services = (0, import_lodash.default)([
131
+ const services = (0, import_lodash_compact.default)([
125
132
  ...this.services,
126
- this.publisherService,
127
- this.publisherService,
133
+ ...this.events.map(({ topic }) => topic),
128
134
  this.auditorStorageService,
129
135
  this.databaseService
130
136
  ]);
@@ -156,19 +162,19 @@ var Construct = class {
156
162
  if (!markOptional || optionalVars.size === 0) return sorted;
157
163
  return sorted.map((v) => optionalVars.has(v) ? `${v}?` : v);
158
164
  } catch (error) {
159
- this.logger.error({ error }, "Error determining environment variables for construct");
165
+ this.logger.error({ err: error }, "Error determining environment variables for construct");
160
166
  return [];
161
167
  }
162
168
  }
163
169
  };
164
- let ConstructType = /* @__PURE__ */ function(ConstructType$1) {
165
- ConstructType$1["Cron"] = "dev.geekmidas.function.cron";
166
- ConstructType$1["Endpoint"] = "dev.geekmidas.function.endpoint";
167
- ConstructType$1["Function"] = "dev.geekmidas.function.function";
168
- ConstructType$1["Subscriber"] = "dev.geekmidas.function.subscriber";
169
- ConstructType$1["Queue"] = "dev.geekmidas.function.queue";
170
- ConstructType$1["Topic"] = "dev.geekmidas.resource.topic";
171
- return ConstructType$1;
170
+ let ConstructType = /* @__PURE__ */ function(ConstructType) {
171
+ ConstructType["Cron"] = "dev.geekmidas.function.cron";
172
+ ConstructType["Endpoint"] = "dev.geekmidas.function.endpoint";
173
+ ConstructType["Function"] = "dev.geekmidas.function.function";
174
+ ConstructType["Subscriber"] = "dev.geekmidas.function.subscriber";
175
+ ConstructType["Queue"] = "dev.geekmidas.function.queue";
176
+ ConstructType["Topic"] = "dev.geekmidas.resource.topic";
177
+ return ConstructType;
172
178
  }({});
173
179
  /**
174
180
  * Utility to test sniffing a service for environment variables.
@@ -185,36 +191,36 @@ let ConstructType = /* @__PURE__ */ function(ConstructType$1) {
185
191
  * ```
186
192
  */
187
193
  async function sniffService(service) {
188
- const sniffer = new __geekmidas_envkit_sniffer.SnifferEnvironmentParser();
189
- return (0, __geekmidas_envkit_sniffer.sniffWithFireAndForget)(sniffer, () => service.register({
194
+ const sniffer = new _geekmidas_envkit_sniffer.SnifferEnvironmentParser();
195
+ return (0, _geekmidas_envkit_sniffer.sniffWithFireAndForget)(sniffer, () => service.register({
190
196
  envParser: sniffer,
191
197
  context: snifferContext
192
198
  }));
193
199
  }
194
-
195
200
  //#endregion
196
- Object.defineProperty(exports, 'Construct', {
197
- enumerable: true,
198
- get: function () {
199
- return Construct;
200
- }
201
+ Object.defineProperty(exports, "Construct", {
202
+ enumerable: true,
203
+ get: function() {
204
+ return Construct;
205
+ }
201
206
  });
202
- Object.defineProperty(exports, 'ConstructType', {
203
- enumerable: true,
204
- get: function () {
205
- return ConstructType;
206
- }
207
+ Object.defineProperty(exports, "ConstructType", {
208
+ enumerable: true,
209
+ get: function() {
210
+ return ConstructType;
211
+ }
207
212
  });
208
- Object.defineProperty(exports, 'sniffService', {
209
- enumerable: true,
210
- get: function () {
211
- return sniffService;
212
- }
213
+ Object.defineProperty(exports, "sniffService", {
214
+ enumerable: true,
215
+ get: function() {
216
+ return sniffService;
217
+ }
213
218
  });
214
- Object.defineProperty(exports, 'snifferContext', {
215
- enumerable: true,
216
- get: function () {
217
- return snifferContext;
218
- }
219
+ Object.defineProperty(exports, "snifferContext", {
220
+ enumerable: true,
221
+ get: function() {
222
+ return snifferContext;
223
+ }
219
224
  });
220
- //# sourceMappingURL=Construct-CyS3RpTL.cjs.map
225
+
226
+ //# sourceMappingURL=Construct-DEOVauyA.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Construct-DEOVauyA.cjs","names":["compact","SnifferEnvironmentParser","sniffWithFireAndForget"],"sources":["../../../node_modules/.pnpm/lodash.compact@3.0.1/node_modules/lodash.compact/index.js","../src/Construct.ts"],"sourcesContent":["/**\n * lodash 3.0.1 (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license <https://lodash.com/license>\n */\n\n/**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\nfunction compact(array) {\n var index = -1,\n length = array ? array.length : 0,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = compact;\n","import type { AuditStorage } from '@geekmidas/audit';\nimport {\n\tSnifferEnvironmentParser,\n\ttype SniffResult,\n\tsniffWithFireAndForget,\n} from '@geekmidas/envkit/sniffer';\nimport type { Logger } from '@geekmidas/logger';\nimport type { Service, ServiceContext } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport compact from 'lodash.compact';\nimport type { TopicEvent } from './publisher';\n\n// Cache for service environment variables to handle singleton services\n// Stores both the full list and the optional subset so the same sniff result\n// can satisfy both getEnvironment() and getEnvironment({ markOptional: true }).\nconst serviceEnvCache = new Map<\n\tService,\n\t{ envVars: string[]; optionalEnvVars: string[] }\n>();\n\n/**\n * Noop context for environment sniffing.\n * Used when calling service.register() to detect env vars without a real request.\n * Returns dummy values since services should only use context in instance methods,\n * not during registration.\n */\nconst snifferContext: ServiceContext = {\n\tgetLogger() {\n\t\t// Return a noop logger for sniffing - services shouldn't log during registration\n\t\treturn {\n\t\t\tdebug: () => {},\n\t\t\tinfo: () => {},\n\t\t\twarn: () => {},\n\t\t\terror: () => {},\n\t\t\tchild: () => snifferContext.getLogger(),\n\t\t} as unknown as Logger;\n\t},\n\tgetRequestId() {\n\t\treturn 'sniffer-context';\n\t},\n\tgetRequestStartTime() {\n\t\treturn Date.now();\n\t},\n\thasContext() {\n\t\treturn false;\n\t},\n\tgetUser() {\n\t\treturn undefined;\n\t},\n};\n\nexport abstract class Construct<\n\tTLogger extends Logger = Logger,\n\tOutSchema extends StandardSchemaV1 | undefined = undefined,\n\tTServices extends Service[] = [],\n\tTAuditStorageServiceName extends string = string,\n\tTAuditStorage extends AuditStorage | undefined = undefined,\n\tTDatabaseServiceName extends string = string,\n\tTDatabase = unknown,\n> {\n\t/** Database service for this construct (used by Endpoint for RLS/audit context) */\n\tpublic databaseService?: Service<TDatabaseServiceName, TDatabase>;\n\n\t/**\n\t * The deploy unit that runs this, by construct id.\n\t *\n\t * What an endpoint's `surface` is to it, and for the same reason: something\n\t * has to say which process a runnable belongs to, and until this existed the\n\t * only thing that said so was the directory its file sat in. Set by the\n\t * factory it was built from — `worker.crons`, `api.get(…)` — so it is\n\t * carried rather than configured.\n\t *\n\t * Undefined for a construct built from a free-standing builder, which is\n\t * still how `c`, `s` and `f` work.\n\t */\n\tpublic owner?: string;\n\n\tconstructor(\n\t\tpublic readonly type: ConstructType,\n\t\tpublic readonly logger: TLogger,\n\t\tpublic readonly services: TServices,\n\t\t/**\n\t\t * What this construct publishes once its handler succeeds — each event\n\t\t * bound to its own topic, so a construct publishes to as many as it names.\n\t\t */\n\t\tpublic readonly events: TopicEvent[] = [],\n\t\tpublic outputSchema?: OutSchema,\n\t\tpublic readonly timeout?: number,\n\t\tpublic readonly memorySize?: number,\n\t\tpublic readonly auditorStorageService?: Service<\n\t\t\tTAuditStorageServiceName,\n\t\t\tTAuditStorage\n\t\t>,\n\t\t/**\n\t\t * The constructs this one declared an edge to, by id.\n\t\t *\n\t\t * What the manifest records. `services` is the same information in the\n\t\t * form a handler runs with — clients, keyed by name — and an id cannot be\n\t\t * recovered from one of those reliably, so both are kept.\n\t\t *\n\t\t * Last in the list because every other parameter is positional and already\n\t\t * spoken for; a new one anywhere else silently rebinds existing callers.\n\t\t */\n\t\tpublic readonly constructs: string[] = [],\n\t) {}\n\n\t/**\n\t * Returns an array of environment variable names required by this construct's services.\n\t * This is determined by running a \"sniffer\" EnvironmentParser through each service's\n\t * register method to track which environment variables are accessed.\n\t *\n\t * Results are cached per service class to handle singleton patterns where\n\t * subsequent register() calls may short-circuit and not access env vars.\n\t *\n\t * @param markOptional - When true, optional vars (those accessed via `.optional()` or\n\t * `.default()`) are suffixed with `?` in the returned array (e.g. `'PORT?'`).\n\t * @returns Promise that resolves to array of environment variable names, sorted alphabetically\n\t *\n\t * @example\n\t * ```typescript\n\t * const endpoint = e\n\t * .services([databaseService, authService])\n\t * .get('/users')\n\t * .handle(async () => []);\n\t *\n\t * await endpoint.getEnvironment(); // ['AUTH_SECRET', 'DATABASE_URL']\n\t * await endpoint.getEnvironment({ markOptional: true }); // ['AUTH_SECRET', 'DATABASE_URL', 'PORT?']\n\t * ```\n\t */\n\tasync getEnvironment(\n\t\topts: { markOptional?: boolean } = {},\n\t): Promise<string[]> {\n\t\tconst { markOptional = false } = opts;\n\t\tconst envVars = new Set<string>();\n\t\tconst optionalVars = new Set<string>();\n\t\tconst services: Service[] = compact([\n\t\t\t...this.services,\n\t\t\t// Each topic an event names is a dependency like any other.\n\t\t\t...this.events.map(({ topic }) => topic),\n\t\t\tthis.auditorStorageService,\n\t\t\tthis.databaseService,\n\t\t]);\n\n\t\ttry {\n\t\t\tfor (const service of services) {\n\t\t\t\t// Check cache first - handles singleton services that short-circuit\n\t\t\t\tif (serviceEnvCache.has(service)) {\n\t\t\t\t\tconst cached = serviceEnvCache.get(service)!;\n\t\t\t\t\tcached.envVars.forEach((v) => envVars.add(v));\n\t\t\t\t\tcached.optionalEnvVars.forEach((v) => optionalVars.add(v));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Use sniffService to properly handle all error scenarios\n\t\t\t\tconst result = await sniffService(service);\n\n\t\t\t\t// Log any issues for debugging\n\t\t\t\tif (result.error) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t{ error: result.error.message, service: service.serviceName },\n\t\t\t\t\t\t'Service threw error during env sniffing (env vars still captured)',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (result.unhandledRejections.length > 0) {\n\t\t\t\t\tthis.logger.warn(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrors: result.unhandledRejections.map((e) => e.message),\n\t\t\t\t\t\t\tservice: service.serviceName,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'Fire-and-forget rejections during env sniffing (suppressed)',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Cache and collect env vars (both required and optional)\n\t\t\t\tserviceEnvCache.set(service, {\n\t\t\t\t\tenvVars: result.envVars,\n\t\t\t\t\toptionalEnvVars: result.optionalEnvVars,\n\t\t\t\t});\n\t\t\t\tresult.envVars.forEach((v) => envVars.add(v));\n\t\t\t\tresult.optionalEnvVars.forEach((v) => optionalVars.add(v));\n\t\t\t}\n\n\t\t\tconst sorted = Array.from(envVars).sort();\n\t\t\tif (!markOptional || optionalVars.size === 0) return sorted;\n\t\t\treturn sorted.map((v) => (optionalVars.has(v) ? `${v}?` : v));\n\t\t} catch (error) {\n\t\t\tthis.logger.error(\n\t\t\t\t{ err: error },\n\t\t\t\t'Error determining environment variables for construct',\n\t\t\t);\n\n\t\t\treturn [];\n\t\t}\n\t}\n}\n\nexport enum ConstructType {\n\tCron = 'dev.geekmidas.function.cron',\n\tEndpoint = 'dev.geekmidas.function.endpoint',\n\tFunction = 'dev.geekmidas.function.function',\n\tSubscriber = 'dev.geekmidas.function.subscriber',\n\tQueue = 'dev.geekmidas.function.queue',\n\tTopic = 'dev.geekmidas.resource.topic',\n}\n\n/**\n * Utility to test sniffing a service for environment variables.\n * Useful for debugging services that throw errors during sniffing.\n *\n * @example\n * ```typescript\n * import { sniffService } from '@geekmidas/constructs';\n * import { authService } from './services/AuthService';\n *\n * const result = await sniffService(authService);\n * console.log('Env vars:', result.envVars);\n * console.log('Error:', result.error);\n * ```\n */\nexport async function sniffService(service: Service): Promise<SniffResult> {\n\tconst sniffer = new SnifferEnvironmentParser();\n\n\treturn sniffWithFireAndForget(sniffer, () =>\n\t\tservice.register({\n\t\t\tenvParser: sniffer as any,\n\t\t\tcontext: snifferContext,\n\t\t}),\n\t);\n}\n\n// Export for testing\nexport { snifferContext };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;CAuBA,SAAS,QAAQ,OAAO;EACtB,IAAI,QAAQ,IACR,SAAS,QAAQ,MAAM,SAAS,GAChC,WAAW,GACX,SAAS,CAAC;EAEd,OAAO,EAA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