@geekmidas/constructs 9.0.2 → 10.0.0-alpha.0

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 (385) hide show
  1. package/README.md +71 -44
  2. package/dist/{AWSScheduledFunction-Bn99MceY.d.cts → AWSScheduledFunction-BvFvBsBN.d.cts} +8 -3
  3. package/dist/{AWSScheduledFunction-ysaCsdWx.d.mts.map → AWSScheduledFunction-BvFvBsBN.d.cts.map} +1 -1
  4. package/dist/{AWSScheduledFunction-ysaCsdWx.d.mts → AWSScheduledFunction-CVccZO-L.d.mts} +9 -4
  5. package/dist/{AWSScheduledFunction-Bn99MceY.d.cts.map → AWSScheduledFunction-CVccZO-L.d.mts.map} +1 -1
  6. package/dist/{AWSScheduledFunction-CufMMhGB.mjs → AWSScheduledFunction-Db1lttJH.mjs} +3 -3
  7. package/dist/{AWSScheduledFunction-CufMMhGB.mjs.map → AWSScheduledFunction-Db1lttJH.mjs.map} +1 -1
  8. package/dist/{AWSScheduledFunction-DbkDr8CA.cjs → AWSScheduledFunction-qu4ieRZR.cjs} +9 -9
  9. package/dist/{AWSScheduledFunction-DbkDr8CA.cjs.map → AWSScheduledFunction-qu4ieRZR.cjs.map} +1 -1
  10. package/dist/{Construct-_1wX7p_Y.d.cts → Construct-B-xc0SE9.d.mts} +27 -5
  11. package/dist/Construct-B-xc0SE9.d.mts.map +1 -0
  12. package/dist/{Construct-r0U2zBwW.mjs → Construct-HmWM6YYu.mjs} +4 -3
  13. package/dist/Construct-HmWM6YYu.mjs.map +1 -0
  14. package/dist/{Construct-DCMuYOox.d.mts → Construct-WhCXIOPV.d.cts} +29 -7
  15. package/dist/Construct-WhCXIOPV.d.cts.map +1 -0
  16. package/dist/{Construct-vXMZJgRp.cjs → Construct-roId57cU.cjs} +7 -43
  17. package/dist/Construct-roId57cU.cjs.map +1 -0
  18. package/dist/{lazyAccessors-DmTG8sQH.cjs → Endpoint-BBkV6l0k.cjs} +869 -1079
  19. package/dist/Endpoint-BBkV6l0k.cjs.map +1 -0
  20. package/dist/{lazyAccessors-DfqZR6C4.mjs → Endpoint-BGwpNEX4.mjs} +840 -1003
  21. package/dist/Endpoint-BGwpNEX4.mjs.map +1 -0
  22. package/dist/{Endpoint-DgfRslct.d.cts → Endpoint-BnxZqIX-.d.cts} +53 -4
  23. package/dist/Endpoint-BnxZqIX-.d.cts.map +1 -0
  24. package/dist/{Endpoint-CLPSIl6S.d.mts → Endpoint-ROcXU-eH.d.mts} +55 -6
  25. package/dist/Endpoint-ROcXU-eH.d.mts.map +1 -0
  26. package/dist/EndpointFactory-DYoGLaIT.cjs +850 -0
  27. package/dist/EndpointFactory-DYoGLaIT.cjs.map +1 -0
  28. package/dist/EndpointFactory-Di0X9AWp.mjs +808 -0
  29. package/dist/EndpointFactory-Di0X9AWp.mjs.map +1 -0
  30. package/dist/{HonoEndpointAdaptor-DJDT3PMx.mjs → HonoEndpointAdaptor-DFKIIG2o.mjs} +5 -4
  31. package/dist/HonoEndpointAdaptor-DFKIIG2o.mjs.map +1 -0
  32. package/dist/{HonoEndpointAdaptor-CkJENANP.cjs → HonoEndpointAdaptor-wMsCyMgt.cjs} +24 -23
  33. package/dist/HonoEndpointAdaptor-wMsCyMgt.cjs.map +1 -0
  34. package/dist/{Queue-DaxjwmOQ.d.cts → Queue-D6WeziRD.d.cts} +43 -4
  35. package/dist/Queue-D6WeziRD.d.cts.map +1 -0
  36. package/dist/{Queue-HBDf0fqz.d.mts → Queue-DpUeqdC8.d.mts} +43 -4
  37. package/dist/Queue-DpUeqdC8.d.mts.map +1 -0
  38. package/dist/{Subscriber-B69ngPwl.d.cts → Subscriber-4rBJgDKI.d.mts} +9 -4
  39. package/dist/{Subscriber-B69ngPwl.d.cts.map → Subscriber-4rBJgDKI.d.mts.map} +1 -1
  40. package/dist/{Subscriber-D8Xm-86W.d.mts → Subscriber-DVQowdyj.d.cts} +11 -6
  41. package/dist/Subscriber-DVQowdyj.d.cts.map +1 -0
  42. package/dist/{Topic-C5ZMfveW.d.cts → Topic-Ohx9dvWr.d.cts} +33 -2
  43. package/dist/Topic-Ohx9dvWr.d.cts.map +1 -0
  44. package/dist/{Topic-DT10AqHk.d.mts → Topic-cmy2jOUy.d.mts} +33 -2
  45. package/dist/Topic-cmy2jOUy.d.mts.map +1 -0
  46. package/dist/adaptors/aws.cjs +39 -26
  47. package/dist/adaptors/aws.cjs.map +1 -1
  48. package/dist/adaptors/aws.d.cts +24 -16
  49. package/dist/adaptors/aws.d.cts.map +1 -1
  50. package/dist/adaptors/aws.d.mts +25 -17
  51. package/dist/adaptors/aws.d.mts.map +1 -1
  52. package/dist/adaptors/aws.mjs +26 -14
  53. package/dist/adaptors/aws.mjs.map +1 -1
  54. package/dist/adaptors/hono.cjs +9 -6
  55. package/dist/adaptors/hono.d.cts +7 -6
  56. package/dist/adaptors/hono.d.cts.map +1 -1
  57. package/dist/adaptors/hono.d.mts +8 -7
  58. package/dist/adaptors/hono.d.mts.map +1 -1
  59. package/dist/adaptors/hono.mjs +9 -6
  60. package/dist/adaptors/testing.cjs +18 -14
  61. package/dist/adaptors/testing.cjs.map +1 -1
  62. package/dist/adaptors/testing.d.cts +7 -6
  63. package/dist/adaptors/testing.d.cts.map +1 -1
  64. package/dist/adaptors/testing.d.mts +11 -10
  65. package/dist/adaptors/testing.d.mts.map +1 -1
  66. package/dist/adaptors/testing.mjs +10 -7
  67. package/dist/adaptors/testing.mjs.map +1 -1
  68. package/dist/auth.cjs +165 -0
  69. package/dist/auth.cjs.map +1 -0
  70. package/dist/auth.d.cts +108 -0
  71. package/dist/auth.d.cts.map +1 -0
  72. package/dist/auth.d.mts +108 -0
  73. package/dist/auth.d.mts.map +1 -0
  74. package/dist/auth.mjs +164 -0
  75. package/dist/auth.mjs.map +1 -0
  76. package/dist/cache-0ANvRQnD.mjs +51 -0
  77. package/dist/cache-0ANvRQnD.mjs.map +1 -0
  78. package/dist/cache-3WSvAulx.cjs +57 -0
  79. package/dist/cache-3WSvAulx.cjs.map +1 -0
  80. package/dist/cache-CdQ7OLpR.d.cts +47 -0
  81. package/dist/cache-CdQ7OLpR.d.cts.map +1 -0
  82. package/dist/cache-DYoJFcfd.d.mts +47 -0
  83. package/dist/cache-DYoJFcfd.d.mts.map +1 -0
  84. package/dist/cache.cjs +3 -0
  85. package/dist/cache.d.cts +3 -0
  86. package/dist/cache.d.mts +3 -0
  87. package/dist/cache.mjs +3 -0
  88. package/dist/chunk-DWy1uDak.cjs +39 -0
  89. package/dist/clone-DblgEZZa.mjs +39 -0
  90. package/dist/clone-DblgEZZa.mjs.map +1 -0
  91. package/dist/clone-Dy0cR2SZ.cjs +45 -0
  92. package/dist/clone-Dy0cR2SZ.cjs.map +1 -0
  93. package/dist/construct-interface-BfjcOD_E.cjs +117 -0
  94. package/dist/construct-interface-BfjcOD_E.cjs.map +1 -0
  95. package/dist/construct-interface-BqwRNYA2.d.mts +131 -0
  96. package/dist/construct-interface-BqwRNYA2.d.mts.map +1 -0
  97. package/dist/construct-interface-D2nNkHUN.d.cts +131 -0
  98. package/dist/construct-interface-D2nNkHUN.d.cts.map +1 -0
  99. package/dist/construct-interface-Z4CpS8tK.mjs +81 -0
  100. package/dist/construct-interface-Z4CpS8tK.mjs.map +1 -0
  101. package/dist/construct-interface.cjs +8 -0
  102. package/dist/construct-interface.d.cts +2 -0
  103. package/dist/construct-interface.d.mts +2 -0
  104. package/dist/construct-interface.mjs +3 -0
  105. package/dist/credential.cjs +96 -0
  106. package/dist/credential.cjs.map +1 -0
  107. package/dist/credential.d.cts +61 -0
  108. package/dist/credential.d.cts.map +1 -0
  109. package/dist/credential.d.mts +61 -0
  110. package/dist/credential.d.mts.map +1 -0
  111. package/dist/credential.mjs +94 -0
  112. package/dist/credential.mjs.map +1 -0
  113. package/dist/crons/index.cjs +39 -37
  114. package/dist/crons/index.cjs.map +1 -1
  115. package/dist/crons/index.d.cts +21 -8
  116. package/dist/crons/index.d.cts.map +1 -1
  117. package/dist/crons/index.d.mts +29 -13
  118. package/dist/crons/index.d.mts.map +1 -1
  119. package/dist/crons/index.mjs +37 -36
  120. package/dist/crons/index.mjs.map +1 -1
  121. package/dist/database/kysely.cjs +181 -0
  122. package/dist/database/kysely.cjs.map +1 -0
  123. package/dist/database/kysely.d.cts +152 -0
  124. package/dist/database/kysely.d.cts.map +1 -0
  125. package/dist/database/kysely.d.mts +152 -0
  126. package/dist/database/kysely.d.mts.map +1 -0
  127. package/dist/database/kysely.mjs +180 -0
  128. package/dist/database/kysely.mjs.map +1 -0
  129. package/dist/email.cjs +59 -0
  130. package/dist/email.cjs.map +1 -0
  131. package/dist/email.d.cts +50 -0
  132. package/dist/email.d.cts.map +1 -0
  133. package/dist/email.d.mts +50 -0
  134. package/dist/email.d.mts.map +1 -0
  135. package/dist/email.mjs +58 -0
  136. package/dist/email.mjs.map +1 -0
  137. package/dist/endpoints/index.cjs +21 -747
  138. package/dist/endpoints/index.d.cts +7 -343
  139. package/dist/endpoints/index.d.mts +7 -342
  140. package/dist/endpoints/index.mjs +11 -738
  141. package/dist/file-server.cjs +154 -0
  142. package/dist/file-server.cjs.map +1 -0
  143. package/dist/file-server.d.cts +156 -0
  144. package/dist/file-server.d.cts.map +1 -0
  145. package/dist/file-server.d.mts +156 -0
  146. package/dist/file-server.d.mts.map +1 -0
  147. package/dist/file-server.mjs +152 -0
  148. package/dist/file-server.mjs.map +1 -0
  149. package/dist/functions/index.cjs +4 -2
  150. package/dist/functions/index.d.cts +3 -2
  151. package/dist/functions/index.d.mts +3 -2
  152. package/dist/functions/index.mjs +4 -2
  153. package/dist/{functions-B-qt91O7.mjs → functions-CvT_q7Y4.mjs} +55 -51
  154. package/dist/functions-CvT_q7Y4.mjs.map +1 -0
  155. package/dist/{functions-C8i1kCMM.cjs → functions-DukjG8ov.cjs} +62 -57
  156. package/dist/functions-DukjG8ov.cjs.map +1 -0
  157. package/dist/index-7OcOWe75.d.cts +419 -0
  158. package/dist/index-7OcOWe75.d.cts.map +1 -0
  159. package/dist/index-Bt-F7u8L.d.mts +419 -0
  160. package/dist/index-Bt-F7u8L.d.mts.map +1 -0
  161. package/dist/{index-DP6fqv0I.d.mts → index-CPeqtKgq.d.mts} +48 -19
  162. package/dist/index-CPeqtKgq.d.mts.map +1 -0
  163. package/dist/{index-BVs9DvIj.d.cts → index-Dadljnh_.d.cts} +36 -9
  164. package/dist/index-Dadljnh_.d.cts.map +1 -0
  165. package/dist/index.cjs +1 -1
  166. package/dist/index.d.cts +3 -3
  167. package/dist/index.d.mts +3 -3
  168. package/dist/index.mjs +1 -1
  169. package/dist/lazyAccessors-DM6HcXQk.mjs +175 -0
  170. package/dist/lazyAccessors-DM6HcXQk.mjs.map +1 -0
  171. package/dist/lazyAccessors-DrJj8NpA.cjs +223 -0
  172. package/dist/lazyAccessors-DrJj8NpA.cjs.map +1 -0
  173. package/dist/object-storage.cjs +48 -0
  174. package/dist/object-storage.cjs.map +1 -0
  175. package/dist/object-storage.d.cts +36 -0
  176. package/dist/object-storage.d.cts.map +1 -0
  177. package/dist/object-storage.d.mts +36 -0
  178. package/dist/object-storage.d.mts.map +1 -0
  179. package/dist/object-storage.mjs +47 -0
  180. package/dist/object-storage.mjs.map +1 -0
  181. package/dist/{processAudits-CKjjivyz.cjs → processAudits-Bc8rz6Ev.cjs} +3 -3
  182. package/dist/{processAudits-CKjjivyz.cjs.map → processAudits-Bc8rz6Ev.cjs.map} +1 -1
  183. package/dist/{processAudits-ySnizdMG.mjs → processAudits-D89tICM4.mjs} +1 -1
  184. package/dist/{processAudits-ySnizdMG.mjs.map → processAudits-D89tICM4.mjs.map} +1 -1
  185. package/dist/{publisher-BrFOF847.mjs → publisher-CGEo8UKD.mjs} +1 -1
  186. package/dist/{publisher-BrFOF847.mjs.map → publisher-CGEo8UKD.mjs.map} +1 -1
  187. package/dist/{publisher-lFQleddL.cjs → publisher-CqGsXB2X.cjs} +1 -1
  188. package/dist/{publisher-lFQleddL.cjs.map → publisher-CqGsXB2X.cjs.map} +1 -1
  189. package/dist/queue/index.cjs +92 -30
  190. package/dist/queue/index.cjs.map +1 -1
  191. package/dist/queue/index.d.cts +19 -4
  192. package/dist/queue/index.d.cts.map +1 -1
  193. package/dist/queue/index.d.mts +22 -6
  194. package/dist/queue/index.d.mts.map +1 -1
  195. package/dist/queue/index.mjs +90 -29
  196. package/dist/queue/index.mjs.map +1 -1
  197. package/dist/rest-api.cjs +187 -0
  198. package/dist/rest-api.cjs.map +1 -0
  199. package/dist/rest-api.d.cts +221 -0
  200. package/dist/rest-api.d.cts.map +1 -0
  201. package/dist/rest-api.d.mts +221 -0
  202. package/dist/rest-api.d.mts.map +1 -0
  203. package/dist/rest-api.mjs +186 -0
  204. package/dist/rest-api.mjs.map +1 -0
  205. package/dist/site.cjs +48 -0
  206. package/dist/site.cjs.map +1 -0
  207. package/dist/site.d.cts +101 -0
  208. package/dist/site.d.cts.map +1 -0
  209. package/dist/site.d.mts +101 -0
  210. package/dist/site.d.mts.map +1 -0
  211. package/dist/site.mjs +47 -0
  212. package/dist/site.mjs.map +1 -0
  213. package/dist/subscribers/index.cjs +35 -27
  214. package/dist/subscribers/index.cjs.map +1 -1
  215. package/dist/subscribers/index.d.cts +20 -5
  216. package/dist/subscribers/index.d.cts.map +1 -1
  217. package/dist/subscribers/index.d.mts +23 -7
  218. package/dist/subscribers/index.d.mts.map +1 -1
  219. package/dist/subscribers/index.mjs +34 -27
  220. package/dist/subscribers/index.mjs.map +1 -1
  221. package/dist/surfaceEnv-BFXEms2f.cjs +39 -0
  222. package/dist/surfaceEnv-BFXEms2f.cjs.map +1 -0
  223. package/dist/surfaceEnv-C3Ktahea.mjs +27 -0
  224. package/dist/surfaceEnv-C3Ktahea.mjs.map +1 -0
  225. package/dist/{telemetry-3vdxGn4q.d.mts → telemetry-C3L0iS28.d.cts} +2 -2
  226. package/dist/{telemetry-3vdxGn4q.d.mts.map → telemetry-C3L0iS28.d.cts.map} +1 -1
  227. package/dist/{telemetry-Dqx-D3F7.d.cts → telemetry-D7bVFLGi.d.mts} +2 -2
  228. package/dist/{telemetry-Dqx-D3F7.d.cts.map → telemetry-D7bVFLGi.d.mts.map} +1 -1
  229. package/dist/topic/index.cjs +56 -13
  230. package/dist/topic/index.cjs.map +1 -1
  231. package/dist/topic/index.d.cts +2 -2
  232. package/dist/topic/index.d.cts.map +1 -1
  233. package/dist/topic/index.d.mts +2 -2
  234. package/dist/topic/index.d.mts.map +1 -1
  235. package/dist/topic/index.mjs +54 -12
  236. package/dist/topic/index.mjs.map +1 -1
  237. package/dist/{types-BDNGr7pv.d.mts → types-BlAkSuGI.d.cts} +1 -1
  238. package/dist/{types-BDNGr7pv.d.mts.map → types-BlAkSuGI.d.cts.map} +1 -1
  239. package/dist/{types-BdAaYDvd.d.cts → types-aKksMEWL.d.mts} +1 -1
  240. package/dist/{types-BdAaYDvd.d.cts.map → types-aKksMEWL.d.mts.map} +1 -1
  241. package/dist/types.d.cts +1 -1
  242. package/dist/types.d.mts +1 -1
  243. package/package.json +155 -23
  244. package/CHANGELOG.md +0 -396
  245. package/dist/Construct-DCMuYOox.d.mts.map +0 -1
  246. package/dist/Construct-_1wX7p_Y.d.cts.map +0 -1
  247. package/dist/Construct-r0U2zBwW.mjs.map +0 -1
  248. package/dist/Construct-vXMZJgRp.cjs.map +0 -1
  249. package/dist/Endpoint-CLPSIl6S.d.mts.map +0 -1
  250. package/dist/Endpoint-DgfRslct.d.cts.map +0 -1
  251. package/dist/HonoEndpointAdaptor-CkJENANP.cjs.map +0 -1
  252. package/dist/HonoEndpointAdaptor-DJDT3PMx.mjs.map +0 -1
  253. package/dist/Queue-DaxjwmOQ.d.cts.map +0 -1
  254. package/dist/Queue-HBDf0fqz.d.mts.map +0 -1
  255. package/dist/Subscriber-D8Xm-86W.d.mts.map +0 -1
  256. package/dist/Topic-C5ZMfveW.d.cts.map +0 -1
  257. package/dist/Topic-DT10AqHk.d.mts.map +0 -1
  258. package/dist/endpoints/index.cjs.map +0 -1
  259. package/dist/endpoints/index.d.cts.map +0 -1
  260. package/dist/endpoints/index.d.mts.map +0 -1
  261. package/dist/endpoints/index.mjs.map +0 -1
  262. package/dist/functions-B-qt91O7.mjs.map +0 -1
  263. package/dist/functions-C8i1kCMM.cjs.map +0 -1
  264. package/dist/index-BVs9DvIj.d.cts.map +0 -1
  265. package/dist/index-DP6fqv0I.d.mts.map +0 -1
  266. package/dist/lazyAccessors-DfqZR6C4.mjs.map +0 -1
  267. package/dist/lazyAccessors-DmTG8sQH.cjs.map +0 -1
  268. package/src/Construct.ts +0 -204
  269. package/src/__benchmarks__/build-time-optimization.bench.ts +0 -274
  270. package/src/__benchmarks__/endpoint.bench.ts +0 -494
  271. package/src/__benchmarks__/fixtures.ts +0 -241
  272. package/src/__benchmarks__/hono-adaptor.bench.ts +0 -533
  273. package/src/__benchmarks__/hono-server.bench.ts +0 -249
  274. package/src/__benchmarks__/response-builder.bench.ts +0 -428
  275. package/src/__benchmarks__/strategies/strategy-a-lazy-services.ts +0 -319
  276. package/src/__benchmarks__/strategies/strategy-c-middleware.ts +0 -530
  277. package/src/__benchmarks__/strategies/strategy-d-opt-in-events.ts +0 -567
  278. package/src/__tests__/Construct.environment.spec.ts +0 -704
  279. package/src/__tests__/publisher.setting.spec.ts +0 -508
  280. package/src/__tests__/publisher.spec.ts +0 -452
  281. package/src/adaptors/aws.ts +0 -6
  282. package/src/adaptors/hono.ts +0 -1
  283. package/src/adaptors/testing.ts +0 -11
  284. package/src/crons/AWSScheduledFunction.ts +0 -73
  285. package/src/crons/Cron.ts +0 -149
  286. package/src/crons/CronBuilder.ts +0 -271
  287. package/src/crons/__tests__/AWSScheduledFunction.spec.ts +0 -152
  288. package/src/crons/__tests__/Cron.spec.ts +0 -464
  289. package/src/crons/__tests__/CronBuilder.state-isolation.spec.ts +0 -227
  290. package/src/crons/index.ts +0 -12
  291. package/src/endpoints/AmazonApiGatewayEndpointAdaptor.ts +0 -677
  292. package/src/endpoints/AmazonApiGatewayV1EndpointAdaptor.ts +0 -105
  293. package/src/endpoints/AmazonApiGatewayV2EndpointAdaptor.ts +0 -97
  294. package/src/endpoints/Authorizer.ts +0 -152
  295. package/src/endpoints/Endpoint.ts +0 -1287
  296. package/src/endpoints/EndpointBuilder.ts +0 -758
  297. package/src/endpoints/EndpointFactory.ts +0 -1148
  298. package/src/endpoints/HonoEndpointAdaptor.ts +0 -677
  299. package/src/endpoints/MswEndpointAdaptor.ts +0 -226
  300. package/src/endpoints/TestEndpointAdaptor.ts +0 -422
  301. package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.audits.spec.ts +0 -499
  302. package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.events.spec.ts +0 -560
  303. package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.spec.ts +0 -1304
  304. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.audits.spec.ts +0 -626
  305. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.events.spec.ts +0 -732
  306. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.factory-publisher.spec.ts +0 -296
  307. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.kysely-audit.integration.spec.ts +0 -951
  308. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.responseType.spec.ts +0 -111
  309. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.rls.spec.ts +0 -307
  310. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.spec.ts +0 -629
  311. package/src/endpoints/__tests__/Authorizer.spec.ts +0 -286
  312. package/src/endpoints/__tests__/Endpoint.cookies.spec.ts +0 -207
  313. package/src/endpoints/__tests__/Endpoint.headers.spec.ts +0 -187
  314. package/src/endpoints/__tests__/Endpoint.manifest.spec.ts +0 -175
  315. package/src/endpoints/__tests__/Endpoint.spec.ts +0 -857
  316. package/src/endpoints/__tests__/EndpointBuilder.audit.spec.ts +0 -448
  317. package/src/endpoints/__tests__/EndpointBuilder.responseType.spec.ts +0 -47
  318. package/src/endpoints/__tests__/EndpointBuilder.spec.ts +0 -523
  319. package/src/endpoints/__tests__/EndpointFactory.authorizers.spec.ts +0 -492
  320. package/src/endpoints/__tests__/EndpointFactory.database-auditor.spec.ts +0 -509
  321. package/src/endpoints/__tests__/EndpointFactory.reference-audit.spec.ts +0 -190
  322. package/src/endpoints/__tests__/EndpointFactory.spec.ts +0 -479
  323. package/src/endpoints/__tests__/EndpointFactory.state-isolation.spec.ts +0 -155
  324. package/src/endpoints/__tests__/HonoEndpointAdaptor.audit-transactions.spec.ts +0 -703
  325. package/src/endpoints/__tests__/HonoEndpointAdaptor.audits.spec.ts +0 -632
  326. package/src/endpoints/__tests__/HonoEndpointAdaptor.events.spec.ts +0 -577
  327. package/src/endpoints/__tests__/HonoEndpointAdaptor.kysely-audit.integration.spec.ts +0 -1067
  328. package/src/endpoints/__tests__/HonoEndpointAdaptor.openapi.spec.ts +0 -317
  329. package/src/endpoints/__tests__/HonoEndpointAdaptor.pgboss-publisher.spec.ts +0 -289
  330. package/src/endpoints/__tests__/HonoEndpointAdaptor.responseType.spec.ts +0 -128
  331. package/src/endpoints/__tests__/HonoEndpointAdaptor.spec.ts +0 -1207
  332. package/src/endpoints/__tests__/MswEndpointAdaptor.spec.ts +0 -211
  333. package/src/endpoints/__tests__/ResponseBuilder.spec.ts +0 -235
  334. package/src/endpoints/__tests__/TestEndpointAdaptor.audits.spec.ts +0 -602
  335. package/src/endpoints/__tests__/TestEndpointAdaptor.spec.ts +0 -1044
  336. package/src/endpoints/__tests__/__snapshots__/HonoEndpointAdaptor.spec.ts.snap +0 -54
  337. package/src/endpoints/__tests__/endpoint-types.test.ts +0 -88
  338. package/src/endpoints/__tests__/helpers.spec.ts +0 -37
  339. package/src/endpoints/__tests__/lazyAccessors.spec.ts +0 -330
  340. package/src/endpoints/__tests__/processAudits.spec.ts +0 -631
  341. package/src/endpoints/audit.ts +0 -87
  342. package/src/endpoints/helpers.ts +0 -98
  343. package/src/endpoints/index.ts +0 -42
  344. package/src/endpoints/lazyAccessors.ts +0 -241
  345. package/src/endpoints/parseHonoQuery.ts +0 -16
  346. package/src/endpoints/parseQueryParams.ts +0 -32
  347. package/src/endpoints/processAudits.ts +0 -371
  348. package/src/endpoints/rls.ts +0 -67
  349. package/src/functions/AWSLambdaFunction.ts +0 -348
  350. package/src/functions/BaseFunctionBuilder.ts +0 -201
  351. package/src/functions/Function.ts +0 -238
  352. package/src/functions/FunctionBuilder.ts +0 -391
  353. package/src/functions/FunctionExecutionWrapper.ts +0 -216
  354. package/src/functions/TestFunctionAdaptor.ts +0 -217
  355. package/src/functions/__tests__/AWSLambdaFunctionAdaptor.spec.ts +0 -513
  356. package/src/functions/__tests__/Function.audits.spec.ts +0 -393
  357. package/src/functions/__tests__/Function.spec.ts +0 -477
  358. package/src/functions/__tests__/FunctionBuilder.state-isolation.spec.ts +0 -207
  359. package/src/functions/__tests__/TestFunctionAdaptor.spec.ts +0 -480
  360. package/src/functions/index.ts +0 -12
  361. package/src/index.ts +0 -23
  362. package/src/publisher.ts +0 -93
  363. package/src/queue/AWSLambdaQueueAdaptor.ts +0 -162
  364. package/src/queue/Queue.ts +0 -128
  365. package/src/queue/QueueBuilder.ts +0 -115
  366. package/src/queue/TestQueueAdaptor.ts +0 -63
  367. package/src/queue/__tests__/QueueBuilder.spec.ts +0 -137
  368. package/src/queue/index.ts +0 -12
  369. package/src/subscribers/AWSLambdaSubscriberAdaptor.ts +0 -342
  370. package/src/subscribers/Subscriber.ts +0 -117
  371. package/src/subscribers/SubscriberBuilder.ts +0 -186
  372. package/src/subscribers/TestSubscriberAdaptor.ts +0 -133
  373. package/src/subscribers/__tests__/AWSLambdaSubscriberAdaptor.spec.ts +0 -1018
  374. package/src/subscribers/__tests__/Subscriber.spec.ts +0 -430
  375. package/src/subscribers/__tests__/TestSubscriberAdaptor.spec.ts +0 -652
  376. package/src/subscribers/index.ts +0 -6
  377. package/src/telemetry.ts +0 -103
  378. package/src/topic/Topic.ts +0 -103
  379. package/src/topic/TopicBuilder.ts +0 -51
  380. package/src/topic/__tests__/TopicBuilder.spec.ts +0 -82
  381. package/src/topic/index.ts +0 -11
  382. package/src/types.ts +0 -13
  383. package/test.ts +0 -91
  384. package/tsconfig.json +0 -9
  385. package/tsdown.config.ts +0 -34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/constructs",
3
- "version": "9.0.2",
3
+ "version": "10.0.0-alpha.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -113,8 +113,111 @@
113
113
  "types": "./dist/adaptors/testing.d.cts",
114
114
  "default": "./dist/adaptors/testing.cjs"
115
115
  }
116
+ },
117
+ "./construct": {
118
+ "import": {
119
+ "types": "./dist/construct-interface.d.mts",
120
+ "default": "./dist/construct-interface.mjs"
121
+ },
122
+ "require": {
123
+ "types": "./dist/construct-interface.d.cts",
124
+ "default": "./dist/construct-interface.cjs"
125
+ }
126
+ },
127
+ "./object-storage": {
128
+ "import": {
129
+ "types": "./dist/object-storage.d.mts",
130
+ "default": "./dist/object-storage.mjs"
131
+ },
132
+ "require": {
133
+ "types": "./dist/object-storage.d.cts",
134
+ "default": "./dist/object-storage.cjs"
135
+ }
136
+ },
137
+ "./file-server": {
138
+ "import": {
139
+ "types": "./dist/file-server.d.mts",
140
+ "default": "./dist/file-server.mjs"
141
+ },
142
+ "require": {
143
+ "types": "./dist/file-server.d.cts",
144
+ "default": "./dist/file-server.cjs"
145
+ }
146
+ },
147
+ "./email": {
148
+ "import": {
149
+ "types": "./dist/email.d.mts",
150
+ "default": "./dist/email.mjs"
151
+ },
152
+ "require": {
153
+ "types": "./dist/email.d.cts",
154
+ "default": "./dist/email.cjs"
155
+ }
156
+ },
157
+ "./cache": {
158
+ "import": {
159
+ "types": "./dist/cache.d.mts",
160
+ "default": "./dist/cache.mjs"
161
+ },
162
+ "require": {
163
+ "types": "./dist/cache.d.cts",
164
+ "default": "./dist/cache.cjs"
165
+ }
166
+ },
167
+ "./credential": {
168
+ "import": {
169
+ "types": "./dist/credential.d.mts",
170
+ "default": "./dist/credential.mjs"
171
+ },
172
+ "require": {
173
+ "types": "./dist/credential.d.cts",
174
+ "default": "./dist/credential.cjs"
175
+ }
176
+ },
177
+ "./auth": {
178
+ "import": {
179
+ "types": "./dist/auth.d.mts",
180
+ "default": "./dist/auth.mjs"
181
+ },
182
+ "require": {
183
+ "types": "./dist/auth.d.cts",
184
+ "default": "./dist/auth.cjs"
185
+ }
186
+ },
187
+ "./rest-api": {
188
+ "import": {
189
+ "types": "./dist/rest-api.d.mts",
190
+ "default": "./dist/rest-api.mjs"
191
+ },
192
+ "require": {
193
+ "types": "./dist/rest-api.d.cts",
194
+ "default": "./dist/rest-api.cjs"
195
+ }
196
+ },
197
+ "./site": {
198
+ "import": {
199
+ "types": "./dist/site.d.mts",
200
+ "default": "./dist/site.mjs"
201
+ },
202
+ "require": {
203
+ "types": "./dist/site.d.cts",
204
+ "default": "./dist/site.cjs"
205
+ }
206
+ },
207
+ "./database/kysely": {
208
+ "import": {
209
+ "types": "./dist/database/kysely.d.mts",
210
+ "default": "./dist/database/kysely.mjs"
211
+ },
212
+ "require": {
213
+ "types": "./dist/database/kysely.d.cts",
214
+ "default": "./dist/database/kysely.cjs"
215
+ }
116
216
  }
117
217
  },
218
+ "files": [
219
+ "dist"
220
+ ],
118
221
  "repository": {
119
222
  "type": "git",
120
223
  "url": "https://github.com/geekmidas/toolbox"
@@ -143,36 +246,47 @@
143
246
  "@types/qs": "~6.15.0",
144
247
  "better-auth": "~1.4.18",
145
248
  "kysely": "~0.29.4",
146
- "pg": "~8.16.3",
147
249
  "msw": "~2.10.3",
250
+ "pg": "~8.16.3",
148
251
  "zod": "~4.1.13",
149
- "@geekmidas/audit": "^9.0.2",
150
- "@geekmidas/cache": "^9.0.2",
151
- "@geekmidas/db": "^9.0.2",
152
- "@geekmidas/envkit": "^9.0.2",
153
- "@geekmidas/errors": "^9.0.2",
154
- "@geekmidas/events": "^9.0.2",
155
- "@geekmidas/logger": "^9.0.2",
156
- "@geekmidas/rate-limit": "^9.0.2",
157
- "@geekmidas/schema": "^9.0.2",
158
- "@geekmidas/services": "^9.0.2",
159
- "@geekmidas/testkit": "^9.0.2"
252
+ "@geekmidas/audit": "^10.0.0-alpha.0",
253
+ "@geekmidas/auth": "10.0.0-alpha.0",
254
+ "@geekmidas/cache": "^10.0.0-alpha.0",
255
+ "@geekmidas/db": "^10.0.0-alpha.0",
256
+ "@geekmidas/emailkit": "^10.0.0-alpha.0",
257
+ "@geekmidas/envkit": "^10.0.0-alpha.0",
258
+ "@geekmidas/errors": "^10.0.0-alpha.0",
259
+ "@geekmidas/events": "^10.0.0-alpha.0",
260
+ "@geekmidas/logger": "^10.0.0-alpha.0",
261
+ "@geekmidas/rate-limit": "^10.0.0-alpha.0",
262
+ "@geekmidas/schema": "^10.0.0-alpha.0",
263
+ "@geekmidas/services": "^10.0.0-alpha.0",
264
+ "@geekmidas/telescope": "10.0.0-alpha.0",
265
+ "@geekmidas/testkit": "^10.0.0-alpha.0"
160
266
  },
161
267
  "peerDependencies": {
162
268
  "@middy/core": ">=6.3.1",
163
269
  "@types/aws-lambda": ">=8.10.92",
270
+ "better-auth": ">=1.4.18",
164
271
  "hono": ">=4.8.2",
272
+ "kysely": ">=0.28.2 <0.30.0",
165
273
  "msw": ">=2.0.0",
166
- "@geekmidas/audit": "^9.0.2",
167
- "@geekmidas/cache": "^9.0.2",
168
- "@geekmidas/db": "^9.0.2",
169
- "@geekmidas/envkit": "^9.0.2",
170
- "@geekmidas/errors": "^9.0.2",
171
- "@geekmidas/events": "^9.0.2",
172
- "@geekmidas/logger": "^9.0.2",
173
- "@geekmidas/rate-limit": "^9.0.2",
174
- "@geekmidas/schema": "^9.0.2",
175
- "@geekmidas/services": "^9.0.2"
274
+ "pg": "~8.16.3",
275
+ "@geekmidas/audit": "^10.0.0-alpha.0",
276
+ "@geekmidas/auth": "10.0.0-alpha.0",
277
+ "@geekmidas/cache": "^10.0.0-alpha.0",
278
+ "@geekmidas/db": "^10.0.0-alpha.0",
279
+ "@geekmidas/emailkit": "^10.0.0-alpha.0",
280
+ "@geekmidas/envkit": "^10.0.0-alpha.0",
281
+ "@geekmidas/errors": "^10.0.0-alpha.0",
282
+ "@geekmidas/events": "^10.0.0-alpha.0",
283
+ "@geekmidas/logger": "^10.0.0-alpha.0",
284
+ "@geekmidas/manifest": "^10.0.0-alpha.0",
285
+ "@geekmidas/rate-limit": "^10.0.0-alpha.0",
286
+ "@geekmidas/schema": "^10.0.0-alpha.0",
287
+ "@geekmidas/services": "^10.0.0-alpha.0",
288
+ "@geekmidas/storage": "^10.0.0-alpha.0",
289
+ "@geekmidas/telescope": "10.0.0-alpha.0"
176
290
  },
177
291
  "peerDependenciesMeta": {
178
292
  "@geekmidas/audit": {
@@ -216,6 +330,24 @@
216
330
  },
217
331
  "msw": {
218
332
  "optional": true
333
+ },
334
+ "@geekmidas/manifest": {
335
+ "optional": true
336
+ },
337
+ "@geekmidas/storage": {
338
+ "optional": true
339
+ },
340
+ "kysely": {
341
+ "optional": true
342
+ },
343
+ "pg": {
344
+ "optional": true
345
+ },
346
+ "@geekmidas/emailkit": {
347
+ "optional": true
348
+ },
349
+ "better-auth": {
350
+ "optional": true
219
351
  }
220
352
  },
221
353
  "scripts": {
package/CHANGELOG.md DELETED
@@ -1,396 +0,0 @@
1
- # @geekmidas/constructs
2
-
3
- ## 9.0.2
4
-
5
- ### Patch Changes
6
-
7
- - [#12](https://github.com/geekmidas/toolbox/pull/12) [`d53863a`](https://github.com/geekmidas/toolbox/commit/d53863a84db2e4ab5420e08f79128b637043fc42) Thanks [@geekmidas](https://github.com/geekmidas)! - Align every published package on a single version and keep them in step.
8
-
9
- All packages now share one version, enforced by a changesets `fixed` group. The
10
- baseline is 9.0.1 — @geekmidas/client's published version — so nothing moves
11
- backwards; this release takes the whole set to 9.0.2 together.
12
-
13
- Independent versions made "which version of the docs applies to me"
14
- unanswerable: a reader on constructs@7 and cli@2 was on no version at all. One
15
- number per release makes versioned documentation possible, and lets 9 freeze as
16
- the current paradigm while the constructs rework is developed against it.
17
-
18
- Every release now publishes every package, and a major anywhere is a major
19
- everywhere. Peer ranges get simpler in return.
20
-
21
- - Updated dependencies [[`d53863a`](https://github.com/geekmidas/toolbox/commit/d53863a84db2e4ab5420e08f79128b637043fc42)]:
22
- - @geekmidas/audit@9.0.2
23
- - @geekmidas/cache@9.0.2
24
- - @geekmidas/db@9.0.2
25
- - @geekmidas/envkit@9.0.2
26
- - @geekmidas/errors@9.0.2
27
- - @geekmidas/events@9.0.2
28
- - @geekmidas/logger@9.0.2
29
- - @geekmidas/rate-limit@9.0.2
30
- - @geekmidas/schema@9.0.2
31
- - @geekmidas/services@9.0.2
32
-
33
- ## 7.0.1
34
-
35
- ### Patch Changes
36
-
37
- - 🐛 [#11](https://github.com/geekmidas/toolbox/pull/11) [`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309) Thanks [@geekmidas](https://github.com/geekmidas)! - Patch release across all packages to realign published versions with the
38
- registry. The previous release only published the four packages that had
39
- version bumps; the remaining packages failed with "cannot publish over the
40
- previously published versions" because their versions were unchanged.
41
- - Updated dependencies [[`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309)]:
42
- - @geekmidas/audit@2.2.1
43
- - @geekmidas/cache@1.1.2
44
- - @geekmidas/db@1.1.1
45
- - @geekmidas/envkit@1.1.1
46
- - @geekmidas/errors@1.0.2
47
- - @geekmidas/events@1.1.6
48
- - @geekmidas/logger@1.0.3
49
- - @geekmidas/rate-limit@4.0.1
50
- - @geekmidas/schema@1.0.4
51
- - @geekmidas/services@2.0.1
52
-
53
- ## 7.0.0
54
-
55
- ### Patch Changes
56
-
57
- - Updated dependencies [[`ae678fe`](https://github.com/geekmidas/toolbox/commit/ae678fe6fbc89307d052335468f1b955b306a604)]:
58
- - @geekmidas/audit@2.2.0
59
-
60
- ## 6.0.0
61
-
62
- ### Patch Changes
63
-
64
- - Updated dependencies [[`e31a60a`](https://github.com/geekmidas/toolbox/commit/e31a60a971366180a0e7bec6e7da56d8f36aa21f)]:
65
- - @geekmidas/db@1.1.0
66
- - @geekmidas/audit@2.1.0
67
-
68
- ## 5.0.0
69
-
70
- ### Minor Changes
71
-
72
- - [#8](https://github.com/geekmidas/toolbox/pull/8) [`b004fd8`](https://github.com/geekmidas/toolbox/commit/b004fd8ee74b5f20a047260b16669d16d8fc03b4) Thanks [@geekmidas](https://github.com/geekmidas)! - feat: queue workers (`q`) — producer, runtime adaptors, and `gkm` discovery
73
-
74
- Adds end-to-end support for point-to-point queues, alongside subscribers (`s`):
75
-
76
- **`@geekmidas/constructs/queue`** — the `q` builder:
77
-
78
- ```ts
79
- import { q } from '@geekmidas/constructs/queue';
80
-
81
- export const orders = q
82
- .queue('orders')
83
- .services([db]) // array; sniffed for required env vars
84
- .message(z.object({ orderId: z.string() }))
85
- .handle(async ({ messages, services }) => { … }); // the single consumer
86
- ```
87
-
88
- Unlike `s` (topic fan-out, filtered by `subscribedEvents`), a queue drains
89
- _every_ message of its one typed `message`.
90
- - **Producer side** — `orders.publisher`, a ready-to-inject `Service` typed to
91
- the queue's message. Drop it into any `.services([...])` and call
92
- `services.ordersPublisher.publish([{ type: 'orders', payload }])`. It reads
93
- `<NAME>_PUBLISHER_CONNECTION_STRING` and picks its transport from the URL
94
- protocol — `pgboss://` locally, `sqs://` deployed — so the same code targets
95
- Postgres in dev and SQS in prod. The env requirement is sniffed into the
96
- manifest, so infra links exactly that queue with least privilege.
97
- - **Runtime adaptors** — `AWSLambdaQueue` (`@geekmidas/constructs/aws`, SQS
98
- event-source with partial-batch failures) and `TestQueueAdaptor`
99
- (`@geekmidas/constructs/testing`).
100
-
101
- **`@geekmidas/cli`** — `gkm build`/`gkm dev` discover `q` definitions:
102
- - ✨ New `queues: './src/queues/**/*.ts'` config glob.
103
- - Server / `gkm dev`: an in-process pg-boss poller (`setupQueues()`) runs
104
- alongside the Hono server — each queue subscribes by its name on the shared
105
- `EVENT_SUBSCRIBER_CONNECTION_STRING`. Queues are background workers, not HTTP
106
- routes.
107
- - AWS: one `AWSLambdaQueue` handler per queue.
108
- - Queues are recorded in the manifest's `queues` field (`QueueInfo`).
109
-
110
- - ✨ [#8](https://github.com/geekmidas/toolbox/pull/8) [`0dad77e`](https://github.com/geekmidas/toolbox/commit/0dad77e574000e4018033b956ed4bb95935911a5) Thanks [@geekmidas](https://github.com/geekmidas)! - feat(topic): add the `t` topic construct + derived publisher (closes the topic/queue asymmetry)
111
-
112
- Topics now have the same app-driven story queues already had — declare the topic
113
- in the app, get a typed publisher for free, and let `gkm build` capture it. This
114
- removes the need to hand-write a publisher `Service` (e.g. `EventsService`) to
115
- fan events out.
116
-
117
- **`@geekmidas/constructs/topic`** — the `t` builder:
118
-
119
- ```ts
120
- import { t } from "@geekmidas/constructs/topic";
121
-
122
- export const userTopic = t.topic("users").events({
123
- "user.created": z.object({ userId: z.string(), email: z.string() }),
124
- "user.updated": z.object({
125
- userId: z.string(),
126
- changes: z.array(z.string()),
127
- }),
128
- });
129
- ```
130
-
131
- - A `Topic` is a _resource_ construct (`ConstructType.Topic`) — fan-out, owned by
132
- no single handler. It declares the event contract and derives a publisher.
133
- - **`userTopic.publisher`** — a derived `Service` typed to the union of the topic's
134
- events, reading `<NAME>_PUBLISHER_CONNECTION_STRING` (transport by protocol:
135
- `sns://` deployed, `pgboss://` local). Replaces hand-written publisher services.
136
- Inject via `.publisher(userTopic.publisher)` (declarative `.event(...)`) or
137
- `.services([userTopic.publisher])`.
138
- - **`s.topic(userTopic)`** — binds a subscriber to a topic: supplies the
139
- subscribable event types/payloads _and_ records the binding for the manifest.
140
- A consumer doesn't publish, so this requires **no** publisher connection string
141
- (least privilege) — unlike typing via `.publisher(...)`.
142
-
143
- **`@geekmidas/manifest`** — new `TopicInfo` + `manifest.topics`; `SubscriberInfo`
144
- gains `topic` (the bound topic name).
145
-
146
- **`@geekmidas/cli`** — `TopicGenerator` discovers `t` topics into `manifest.topics`
147
- (a topic has no handler to generate); new `topics` config glob; wired through
148
- `gkm build`/`gkm dev` and both manifest writers.
149
-
150
- Hand-written publisher services still work; `t` is the encouraged path.
151
-
152
- ### Patch Changes
153
-
154
- - Updated dependencies [[`7323f34`](https://github.com/geekmidas/toolbox/commit/7323f34176d63170dd53450889ac0b5959420c3c), [`79e2929`](https://github.com/geekmidas/toolbox/commit/79e292978d3dbc8927e25814bdb051d1c380600a), [`03b08fe`](https://github.com/geekmidas/toolbox/commit/03b08feba2e735539c43f95b77792c18a627b07d)]:
155
- - @geekmidas/envkit@1.1.0
156
- - @geekmidas/events@1.1.5
157
- - @geekmidas/services@2.0.0
158
- - @geekmidas/rate-limit@4.0.0
159
-
160
- ## 4.0.1
161
-
162
- ### Patch Changes
163
-
164
- - [#7](https://github.com/geekmidas/toolbox/pull/7) [`e0d06b3`](https://github.com/geekmidas/toolbox/commit/e0d06b38dfd275758f7955f5754900ab78779302) Thanks [@geekmidas](https://github.com/geekmidas)! - feat(constructs): allow endpoint handlers to return the output schema's input type
165
-
166
- Endpoint handlers previously had to return the output schema's _parsed_ type
167
- (`InferStandardSchema`). When an output schema coerces its value (e.g. a `Date`
168
- serialized to an ISO `string`, or an applied default), that forced handlers to
169
- pre-coerce values themselves even though the schema would do it on the way out.
170
-
171
- A new `InferStandardSchemaInput` type is added to `@geekmidas/schema`, exposing a
172
- Standard Schema's _input_ type (`StandardSchemaV1.InferInput`). `Endpoint`'s
173
- handler return type now uses it, so handlers may return the looser pre-coercion
174
- input while consumers (`EndpointOutput` and the generated client) still see the
175
- narrower parsed output type.
176
-
177
- - Updated dependencies [[`e0d06b3`](https://github.com/geekmidas/toolbox/commit/e0d06b38dfd275758f7955f5754900ab78779302)]:
178
- - @geekmidas/schema@1.0.3
179
-
180
- ## 4.0.0
181
-
182
- ### Minor Changes
183
-
184
- - [#5](https://github.com/geekmidas/toolbox/pull/5) [`811d740`](https://github.com/geekmidas/toolbox/commit/811d740ae3875d59ad1b0dc50261266963c8cb76) Thanks [@geekmidas](https://github.com/geekmidas)! - Move the tRPC and Middy service integrations from `@geekmidas/constructs` to `@geekmidas/services`, where they belong — they depend only on `@geekmidas/services`, not on any construct.
185
- - ✨ **`@geekmidas/constructs`:** the `@geekmidas/constructs/trpc` and `@geekmidas/constructs/middy` entry points are removed (they were only just added). Import from `@geekmidas/services/trpc` and `@geekmidas/services/middy` instead. (`@trpc/server` is no longer a peer dependency of `@geekmidas/constructs`.)
186
- - ✨ **`@geekmidas/services`:** adds `/trpc` (`createServicesMiddleware`, `createRequestContextMiddleware`) and `/middy` (`requestContext`, `addServices`, `withServices`, `EventServices`) exports.
187
-
188
- The Middy middlewares were also tightened:
189
- - `requestContext` / `withServices` now require an explicit `logger` (no `ConsoleLogger` default) and are generic over `TLogger extends Logger`, so a custom logger type is preserved.
190
- - `addServices` / `withServices` now require an `envParser` (no implicit `process.env` default).
191
- - 🐛 Resolved services are attached to `event.services` (matching the `Function`/`Cron` constructs).
192
-
193
- ### Patch Changes
194
-
195
- - Updated dependencies [[`811d740`](https://github.com/geekmidas/toolbox/commit/811d740ae3875d59ad1b0dc50261266963c8cb76)]:
196
- - @geekmidas/services@1.1.0
197
- - @geekmidas/rate-limit@3.0.0
198
-
199
- ## 3.1.0
200
-
201
- ### Minor Changes
202
-
203
- - ✨ [#4](https://github.com/geekmidas/toolbox/pull/4) [`07093f5`](https://github.com/geekmidas/toolbox/commit/07093f5f911bf1ee48e53275da3cce398cc78ff6) Thanks [@geekmidas](https://github.com/geekmidas)! - Add `@geekmidas/constructs/middy` — Middy middlewares that bring request context and service discovery to standalone Lambda handlers:
204
- - `requestContext(options?)` establishes a request context so `serviceContext.getLogger()` / `getRequestId()` / `getRequestStartTime()` work inside the handler and any service it calls.
205
- - 🐛 `addServices([...], options?)` resolves services via `ServiceDiscovery` and attaches the typed record to `event.services` (pair with `requestContext`, or use `withServices`, if your services read `serviceContext`).
206
- - `withServices([...], options?)` bundles both in a single `.use(...)`.
207
-
208
- Also exports an `EventServices<T>` helper type for typing the handler's event.
209
-
210
- ### Patch Changes
211
-
212
- - ✨ [#4](https://github.com/geekmidas/toolbox/pull/4) [`a20be2f`](https://github.com/geekmidas/toolbox/commit/a20be2faa4795600358904b751fa947d3cbb4c45) Thanks [@geekmidas](https://github.com/geekmidas)! - Add and export `AWSScheduledFunction` from `@geekmidas/constructs/crons` (and `/aws`). The CLI's cron handler generator already imported this adaptor, but it was never implemented, so generated cron handlers failed to load. `AWSScheduledFunction` wraps a `Cron` (which extends `Function`) and reuses the Lambda function execution pipeline, including the `runWithRequestContext` wrapper that powers request-scoped logging.
213
-
214
- ## 3.0.14
215
-
216
- ### Patch Changes
217
-
218
- - 🐛 [#3](https://github.com/geekmidas/toolbox/pull/3) [`42fda53`](https://github.com/geekmidas/toolbox/commit/42fda532bdf4489a3352f6a684f5f30beafccedd) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix stale logger from service initialization
219
-
220
- - Updated dependencies [[`42fda53`](https://github.com/geekmidas/toolbox/commit/42fda532bdf4489a3352f6a684f5f30beafccedd)]:
221
- - @geekmidas/services@1.0.4
222
-
223
- ## 3.0.13
224
-
225
- ### Patch Changes
226
-
227
- - ✨ [`351f73b`](https://github.com/geekmidas/toolbox/commit/351f73b032bc0742b7f611a9fbcdfc85bbfd69a8) Thanks [@geekmidas](https://github.com/geekmidas)! - Update request context and add support for trpc
228
-
229
- - Updated dependencies [[`351f73b`](https://github.com/geekmidas/toolbox/commit/351f73b032bc0742b7f611a9fbcdfc85bbfd69a8)]:
230
- - @geekmidas/services@1.0.3
231
-
232
- ## 3.0.12
233
-
234
- ### Patch Changes
235
-
236
- - 🐛 [`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix `package.json` exports so TypeScript declarations resolve correctly under NodeNext/Bundler module resolution. Each subpath export now nests `types` inside its `import`/`require` condition, pointing at the `.d.mts` and `.d.cts` files that `tsdown` actually emits (previously the exports referenced non-existent `.d.ts` files, causing type-resolution failures for consumers). Both ESM (`.mjs`) and CJS (`.cjs`) runtime entry points are preserved. Additionally, `@geekmidas/ui` had `import` paths pointing at `.js` files that were never emitted — those are corrected to `.mjs`.
237
-
238
- - Updated dependencies [[`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651)]:
239
- - @geekmidas/audit@2.0.1
240
- - @geekmidas/cache@1.1.1
241
- - @geekmidas/db@1.0.2
242
- - @geekmidas/envkit@1.0.7
243
- - @geekmidas/errors@1.0.1
244
- - @geekmidas/events@1.1.3
245
- - @geekmidas/logger@1.0.2
246
- - @geekmidas/rate-limit@2.0.1
247
- - @geekmidas/schema@1.0.2
248
- - @geekmidas/services@1.0.2
249
-
250
- ## 3.0.11
251
-
252
- ### Patch Changes
253
-
254
- - [`fb1e721`](https://github.com/geekmidas/toolbox/commit/fb1e721ec38c1b328d41466564c6fa1c9305e80b) Thanks [@geekmidas](https://github.com/geekmidas)! - Return 403 Forbidden instead of 401 Unauthorized when an endpoint's `.authorize()` returns false. Authorization runs after `getSession()`, so by the time it rejects, the caller is already identified — 403 is the correct semantic. Callers that want 401 for missing authentication should throw `UnauthorizedError` from `getSession()` (or `.authorize()`) directly.
255
-
256
- ## 3.0.10
257
-
258
- ### Patch Changes
259
-
260
- - 🐛 [`aeba918`](https://github.com/geekmidas/toolbox/commit/aeba918fc258f6ccdb96b8273b2bc01bd2190553) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix schema, openapi generation and events testkit
261
-
262
- - Updated dependencies [[`aeba918`](https://github.com/geekmidas/toolbox/commit/aeba918fc258f6ccdb96b8273b2bc01bd2190553)]:
263
- - @geekmidas/events@1.1.2
264
- - @geekmidas/schema@1.0.1
265
-
266
- ## 3.0.9
267
-
268
- ### Patch Changes
269
-
270
- - ✨ [`363c67f`](https://github.com/geekmidas/toolbox/commit/363c67fb3c3406bac6823326ab80ba55bff29e31) Thanks [@geekmidas](https://github.com/geekmidas)! - Add dynamic return types
271
-
272
- ## 3.0.8
273
-
274
- ### Patch Changes
275
-
276
- - ✨ [`0830c6e`](https://github.com/geekmidas/toolbox/commit/0830c6e0d60842526788e0e1f0e78827514ea7b3) Thanks [@geekmidas](https://github.com/geekmidas)! - Add optional sniff support
277
-
278
- - Updated dependencies [[`0830c6e`](https://github.com/geekmidas/toolbox/commit/0830c6e0d60842526788e0e1f0e78827514ea7b3)]:
279
- - @geekmidas/logger@1.0.1
280
-
281
- ## 3.0.7
282
-
283
- ### Patch Changes
284
-
285
- - ✨ [`79e17a8`](https://github.com/geekmidas/toolbox/commit/79e17a84e630f102023005994d9d45b37f7d9d8f) Thanks [@geekmidas](https://github.com/geekmidas)! - Add msw support for construct testing for ui
286
-
287
- ## 3.0.6
288
-
289
- ### Patch Changes
290
-
291
- - ✨ [`3941ae6`](https://github.com/geekmidas/toolbox/commit/3941ae6c9027fddb32999b9f98af813a12867877) Thanks [@geekmidas](https://github.com/geekmidas)! - Add db to authorizer
292
-
293
- ## 3.0.5
294
-
295
- ### Patch Changes
296
-
297
- - [`fba83f3`](https://github.com/geekmidas/toolbox/commit/fba83f3ceee1d058874e62b31e38a9da205a6742) Thanks [@geekmidas](https://github.com/geekmidas)! - Release constructs
298
-
299
- ## 3.0.4
300
-
301
- ### Patch Changes
302
-
303
- - ✨ [`f005956`](https://github.com/geekmidas/toolbox/commit/f005956573aac6bcdfcc95d2a31c17cf5b9688d4) Thanks [@geekmidas](https://github.com/geekmidas)! - Add params to authorize and decode content type on routes
304
-
305
- ## 3.0.3
306
-
307
- ### Patch Changes
308
-
309
- - [`a39b41f`](https://github.com/geekmidas/toolbox/commit/a39b41fae9c6cfbde8e6d78bf5a11fbb9e59f67d) Thanks [@geekmidas](https://github.com/geekmidas)! - Use qs to process query params instead of custom solution
310
-
311
- ## 3.0.2
312
-
313
- ### Patch Changes
314
-
315
- - 🐛 [`317e53e`](https://github.com/geekmidas/toolbox/commit/317e53e91c07bbc23dad3ae81faf573be91cb992) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix v2 cookie loading
316
-
317
- ## 3.0.1
318
-
319
- ### Patch Changes
320
-
321
- - ✨ [`bfc5a4f`](https://github.com/geekmidas/toolbox/commit/bfc5a4f656445bb389b0532e9d3385d2e66a28fe) Thanks [@geekmidas](https://github.com/geekmidas)! - Add function context and suport for partitions
322
-
323
- ## 3.0.0
324
-
325
- ### Patch Changes
326
-
327
- - Updated dependencies [[`be4f7a9`](https://github.com/geekmidas/toolbox/commit/be4f7a9bd5de7f08adbca582916d6902e0c24de2)]:
328
- - @geekmidas/cache@1.1.0
329
- - @geekmidas/audit@2.0.0
330
- - @geekmidas/rate-limit@2.0.0
331
-
332
- ## 2.0.0
333
-
334
- ### Patch Changes
335
-
336
- - ✨ [`83a24de`](https://github.com/geekmidas/toolbox/commit/83a24de902b3fadd98444cab552ecd84f32b6661) Thanks [@geekmidas](https://github.com/geekmidas)! - Add pg-boss event publisher/subscriber, CLI setup and upgrade commands, and secrets sync via AWS SSM
337
- - ✨ **@geekmidas/events**: Add pg-boss backend for event publishing and subscribing with connection string support
338
- - ✨ **@geekmidas/cli**: Add `gkm setup` command for dev environment initialization, `gkm upgrade` command with workspace detection, and secrets push/pull via AWS SSM Parameter Store
339
- - 🐛 **@geekmidas/testkit**: Fix database creation race condition in PostgresMigrator
340
- - ✨ **@geekmidas/constructs**: Add integration tests for pg-boss with HonoEndpoint
341
-
342
- - Updated dependencies [[`83a24de`](https://github.com/geekmidas/toolbox/commit/83a24de902b3fadd98444cab552ecd84f32b6661)]:
343
- - @geekmidas/events@1.1.0
344
-
345
- ## 1.1.1
346
-
347
- ### Patch Changes
348
-
349
- - 🔥 [`9ac81f2`](https://github.com/geekmidas/toolbox/commit/9ac81f25fbf3676e39580c916dc0085358af99cb) Thanks [@geekmidas](https://github.com/geekmidas)! - Remove subscriber adaptor from root exports
350
-
351
- ## 1.1.0
352
-
353
- ### Minor Changes
354
-
355
- - ⚡️ [`73511d9`](https://github.com/geekmidas/toolbox/commit/73511d912062eb0776935168c9f72d42c7c854a6) Thanks [@geekmidas](https://github.com/geekmidas)! - Improve dev script experience and export function tester
356
-
357
- ## 1.0.5
358
-
359
- ### Patch Changes
360
-
361
- - ⬆️ [`53c39a0`](https://github.com/geekmidas/toolbox/commit/53c39a0ed9244be6ca2ff6ec8e39138a0fc88692) Thanks [@geekmidas](https://github.com/geekmidas)! - Update RLS types
362
-
363
- ## 1.0.4
364
-
365
- ### Patch Changes
366
-
367
- - 🐛 [`05a6302`](https://github.com/geekmidas/toolbox/commit/05a6302a37ef2285aaf07ee46eeb9135ed658a68) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix lambda function generator to use correct adaptor import
368
-
369
- ## 1.0.3
370
-
371
- ### Patch Changes
372
-
373
- - 🐛 [`8bdda11`](https://github.com/geekmidas/toolbox/commit/8bdda11f5c0f7c2eaea605befb0eca38ecc56e44) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix iam resolution for authorizers and fixed exported types for envkit
374
-
375
- - Updated dependencies [[`8bdda11`](https://github.com/geekmidas/toolbox/commit/8bdda11f5c0f7c2eaea605befb0eca38ecc56e44)]:
376
- - @geekmidas/envkit@1.0.1
377
-
378
- ## 1.0.0
379
-
380
- ### Major Changes
381
-
382
- - [`ff7b115`](https://github.com/geekmidas/toolbox/commit/ff7b11599f60f84ac6cdc73714c853ecf786b2e8) Thanks [@geekmidas](https://github.com/geekmidas)! - Version 1 Stable release
383
-
384
- ### Patch Changes
385
-
386
- - Updated dependencies [[`ff7b115`](https://github.com/geekmidas/toolbox/commit/ff7b11599f60f84ac6cdc73714c853ecf786b2e8)]:
387
- - @geekmidas/audit@1.0.0
388
- - @geekmidas/cache@1.0.0
389
- - @geekmidas/db@1.0.0
390
- - @geekmidas/envkit@1.0.0
391
- - @geekmidas/errors@1.0.0
392
- - @geekmidas/events@1.0.0
393
- - @geekmidas/logger@1.0.0
394
- - @geekmidas/rate-limit@1.0.0
395
- - @geekmidas/schema@1.0.0
396
- - @geekmidas/services@1.0.0
@@ -1 +0,0 @@
1
- {"version":3,"file":"Construct-DCMuYOox.d.mts","names":[],"sources":["../src/Construct.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAS8D;AAuC9D;;;cAtBM,cAuBoB,EAvBJ,cAuBI;AAEf,uBAHW,SAGX,CAAA,gBAFM,MAEN,GAFe,MAEf,EAAA,qBAAA,MAAA,GAAA,MAAA,EAAA,UAAA,cAAA,CAAA,GAAA,CAAA,GAAA,SAAA,GAAA,SAAA,EAAA,kBACQ,gBADR,GAAA,SAAA,GAAA,SAAA,EAAA,kBAEQ,OAFR,EAAA,GAAA,EAAA,EAAA,iCAAA,MAAA,GAAA,MAAA,EAAA,sBAIY,YAJZ,GAAA,SAAA,GAAA,SAAA,EAAA,6BAAA,MAAA,GAAA,MAAA,EAAA,YAAA,OAAA,CAAA,CAAA;EAAc,SACN,IAAA,EAWK,aAXL;EAAgB,SAChB,MAAA,EAWO,OAXP;EAAO,SAEH,QAAA,EAUK,SAVL;EAAY,SAQX,MAAA,EAGE,WAHF,CAGc,CAHd,EAAA,GAAA,CAAA,EAAA;EAAa,SACX,gBAAA,CAAA,EAIW,OAJX,CAImB,YAJnB,EAIiC,CAJjC,CAAA;EAAO,YACL,CAAA,EAIJ,SAJI,GAAA,SAAA;EAAS,SACC,OAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAC,SAAb,UAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAW,SAEQ,qBAAA,CAAA,EAIH,OAJG,CAK1C,wBAL0C,EAM1C,aAN0C,CAAA;EAAY;EAAG,eAAvB,CAAA,EARX,OAQW,CARH,oBAQG,EARmB,SAQnB,CAAA;EAAO,WACpB,CAAA,IAAA,EANA,aAMA,EAAA,MAAA,EALE,OAKF,EAAA,QAAA,EAJI,SAIJ,EAAA,MAAA,CAAA,EAHE,WAGF,CAHc,CAGd,EAAA,GAAA,CAAA,EAAA,EAAA,gBAAA,CAAA,EADa,OACb,CADqB,YACrB,EADmC,CACnC,CAAA,EAAA,YAAA,CAAA,EAAA,SAAA,GAAA,SAAA,EAAA,OAAA,CAAA,EAAA,MAAA,GAAA,SAAA,EAAA,UAAA,CAAA,EAAA,MAAA,GAAA,SAAA,EAAA,qBAAA,CAAA,EAGkB,OAHlB,CAIrB,wBAJqB,EAKrB,aALqB,CAAA;EAAS;;;;;;;;;;;;;;;;;;;AAkCtB;AAiEX;AAuBA;;EAAkC,cAAU,CAAA,IAA6B,CAA7B,EAAA;IAAkB,YAAA,CAAA,EAAA,OAAA;EAAW,CAAA,CAAA,EAxFrE,OAwFkD,CAAA,MAAA,EAAA,CAAA;AAAO;aAvBjD,aAAA;;;;;;;;;;;;;;;;;;;;;;iBAuBU,YAAA,UAAsB,UAAU,QAAQ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Construct-_1wX7p_Y.d.cts","names":[],"sources":["../src/Construct.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAS8D;AAuC9D;;;cAtBM,cAuBoB,EAvBJ,cAuBI;AAEf,uBAHW,SAGX,CAAA,gBAFM,MAEN,GAFe,MAEf,EAAA,qBAAA,MAAA,GAAA,MAAA,EAAA,UAAA,cAAA,CAAA,GAAA,CAAA,GAAA,SAAA,GAAA,SAAA,EAAA,kBACQ,gBADR,GAAA,SAAA,GAAA,SAAA,EAAA,kBAEQ,OAFR,EAAA,GAAA,EAAA,EAAA,iCAAA,MAAA,GAAA,MAAA,EAAA,sBAIY,YAJZ,GAAA,SAAA,GAAA,SAAA,EAAA,6BAAA,MAAA,GAAA,MAAA,EAAA,YAAA,OAAA,CAAA,CAAA;EAAc,SACN,IAAA,EAWK,aAXL;EAAgB,SAChB,MAAA,EAWO,OAXP;EAAO,SAEH,QAAA,EAUK,SAVL;EAAY,SAQX,MAAA,EAGE,WAHF,CAGc,CAHd,EAAA,GAAA,CAAA,EAAA;EAAa,SACX,gBAAA,CAAA,EAIW,OAJX,CAImB,YAJnB,EAIiC,CAJjC,CAAA,GAAA,SAAA;EAAO,YACL,CAAA,EAIJ,SAJI,GAAA,SAAA;EAAS,SACC,OAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAC,SAAb,UAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAW,SAEQ,qBAAA,CAAA,EAIH,OAJG,CAK1C,wBAL0C,EAM1C,aAN0C,CAAA,GAAA,SAAA;EAAY;EAAG,eAAvB,CAAA,EARX,OAQW,CARH,oBAQG,EARmB,SAQnB,CAAA;EAAO,WACpB,CAAA,IAAA,EANA,aAMA,EAAA,MAAA,EALE,OAKF,EAAA,QAAA,EAJI,SAIJ,EAAA,MAAA,CAAA,EAHE,WAGF,CAHc,CAGd,EAAA,GAAA,CAAA,EAAA,EAAA,gBAAA,CAAA,EADa,OACb,CADqB,YACrB,EADmC,CACnC,CAAA,GAAA,SAAA,EAAA,YAAA,CAAA,EAAA,SAAA,GAAA,SAAA,EAAA,OAAA,CAAA,EAAA,MAAA,GAAA,SAAA,EAAA,UAAA,CAAA,EAAA,MAAA,GAAA,SAAA,EAAA,qBAAA,CAAA,EAGkB,OAHlB,CAIrB,wBAJqB,EAKrB,aALqB,CAAA,GAAA,SAAA;EAAS;;;;;;;;;;;;;;;;;;;AAkCtB;AAiEX;AAuBA;;EAAkC,cAAU,CAAA,IAA6B,CAA7B,EAAA;IAAkB,YAAA,CAAA,EAAA,OAAA;EAAW,CAAA,CAAA,EAxFrE,OAwFkD,CAAA,MAAA,EAAA,CAAA;AAAO;aAvBjD,aAAA;;;;;;;;;;;;;;;;;;;;;;iBAuBU,YAAA,UAAsB,UAAU,QAAQ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Construct-r0U2zBwW.mjs","names":["compact","snifferContext: ServiceContext","type: ConstructType","logger: TLogger","services: TServices","events: MappedEvent<T, any>[]","publisherService?: Service<TServiceName, T>","outputSchema?: OutSchema","timeout?: number","memorySize?: number","auditorStorageService?: Service<\n\t\t\tTAuditStorageServiceName,\n\t\t\tTAuditStorage\n\t\t>","opts: { markOptional?: boolean }","services: Service[]","service: Service"],"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 { EventPublisher, MappedEvent } from '@geekmidas/events';\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';\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};\n\nexport abstract class Construct<\n\tTLogger extends Logger = Logger,\n\tTServiceName extends string = string,\n\tT extends EventPublisher<any> | undefined = undefined,\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\tconstructor(\n\t\tpublic readonly type: ConstructType,\n\t\tpublic readonly logger: TLogger,\n\t\tpublic readonly services: TServices,\n\t\tpublic readonly events: MappedEvent<T, any>[] = [],\n\n\t\tpublic readonly publisherService?: Service<TServiceName, T>,\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) {}\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\tthis.publisherService,\n\t\t\tthis.publisherService,\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{ 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,SAASA,UAAQ,OAAO;EACtB,IAAI,QAAQ,IACR,SAAS,QAAQ,MAAM,SAAS,GAChC,WAAW,GACX,SAAS,CAAE;AAEf,SAAO,EAAE,QAAQ,QAAQ;GACvB,IAAI,QAAQ,MAAM;AAClB,OAAI,MACF,QAAO,cAAc;EAExB;AACD,SAAO;CACR;AAED,QAAO,UAAUA;;;;;;ACvBjB,MAAM,kCAAkB,IAAI;;;;;;;AAW5B,MAAMC,iBAAiC;CACtC,YAAY;AAEX,SAAO;GACN,OAAO,MAAM,CAAE;GACf,MAAM,MAAM,CAAE;GACd,MAAM,MAAM,CAAE;GACd,OAAO,MAAM,CAAE;GACf,OAAO,MAAM,eAAe,WAAW;EACvC;CACD;CACD,eAAe;AACd,SAAO;CACP;CACD,sBAAsB;AACrB,SAAO,KAAK,KAAK;CACjB;CACD,aAAa;AACZ,SAAO;CACP;AACD;AAED,IAAsB,YAAtB,MAUE;;CAED,AAAO;CAEP,YACiBC,MACAC,QACAC,UACAC,SAAgC,CAAE,GAElCC,kBACTC,cACSC,SACAC,YACAC,uBAIf;EAbe;EACA;EACA;EACA;EAEA;EACT;EACS;EACA;EACA;CAIb;;;;;;;;;;;;;;;;;;;;;;;;CAyBJ,MAAM,eACLC,OAAmC,CAAE,GACjB;EACpB,MAAM,EAAE,eAAe,OAAO,GAAG;EACjC,MAAM,0BAAU,IAAI;EACpB,MAAM,+BAAe,IAAI;EACzB,MAAMC,WAAsB,2BAAQ;GACnC,GAAG,KAAK;GACR,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;EACL,EAAC;AAEF,MAAI;AACH,QAAK,MAAM,WAAW,UAAU;AAE/B,QAAI,gBAAgB,IAAI,QAAQ,EAAE;KACjC,MAAM,SAAS,gBAAgB,IAAI,QAAQ;AAC3C,YAAO,QAAQ,QAAQ,CAAC,MAAM,QAAQ,IAAI,EAAE,CAAC;AAC7C,YAAO,gBAAgB,QAAQ,CAAC,MAAM,aAAa,IAAI,EAAE,CAAC;AAC1D;IACA;IAGD,MAAM,SAAS,MAAM,aAAa,QAAQ;AAG1C,QAAI,OAAO,MACV,MAAK,OAAO,KACX;KAAE,OAAO,OAAO,MAAM;KAAS,SAAS,QAAQ;IAAa,GAC7D,oEACA;AAEF,QAAI,OAAO,oBAAoB,SAAS,EACvC,MAAK,OAAO,KACX;KACC,QAAQ,OAAO,oBAAoB,IAAI,CAAC,MAAM,EAAE,QAAQ;KACxD,SAAS,QAAQ;IACjB,GACD,8DACA;AAIF,oBAAgB,IAAI,SAAS;KAC5B,SAAS,OAAO;KAChB,iBAAiB,OAAO;IACxB,EAAC;AACF,WAAO,QAAQ,QAAQ,CAAC,MAAM,QAAQ,IAAI,EAAE,CAAC;AAC7C,WAAO,gBAAgB,QAAQ,CAAC,MAAM,aAAa,IAAI,EAAE,CAAC;GAC1D;GAED,MAAM,SAAS,MAAM,KAAK,QAAQ,CAAC,MAAM;AACzC,QAAK,gBAAgB,aAAa,SAAS,EAAG,QAAO;AACrD,UAAO,OAAO,IAAI,CAAC,MAAO,aAAa,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAG;EAC7D,SAAQ,OAAO;AACf,QAAK,OAAO,MACX,EAAE,MAAO,GACT,wDACA;AAED,UAAO,CAAE;EACT;CACD;AACD;AAED,IAAY,0DAAL;AACN;AACA;AACA;AACA;AACA;AACA;;AACA;;;;;;;;;;;;;;;AAgBD,eAAsB,aAAaC,SAAwC;CAC1E,MAAM,UAAU,IAAI;AAEpB,QAAO,uBAAuB,SAAS,MACtC,QAAQ,SAAS;EAChB,WAAW;EACX,SAAS;CACT,EAAC,CACF;AACD"}