@geekmidas/constructs 0.0.10 → 0.0.12

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 (324) hide show
  1. package/dist/{AWSLambdaFunction-DhUb-Vs6.cjs → AWSLambdaFunction-DMxScuaw.cjs} +3 -3
  2. package/dist/{AWSLambdaFunction-DhUb-Vs6.cjs.map → AWSLambdaFunction-DMxScuaw.cjs.map} +1 -1
  3. package/dist/{AWSLambdaFunction-D5V3YVqv.d.cts → AWSLambdaFunction-DSB2oaFG.d.mts} +5 -5
  4. package/dist/{AWSLambdaFunction-D_V-ZQmS.mjs → AWSLambdaFunction-cL8A169J.mjs} +3 -3
  5. package/dist/{AWSLambdaFunction-D_V-ZQmS.mjs.map → AWSLambdaFunction-cL8A169J.mjs.map} +1 -1
  6. package/dist/{AWSLambdaFunction-DvZcnL8a.d.mts → AWSLambdaFunction-t6q2o8EL.d.cts} +5 -5
  7. package/dist/{AWSLambdaSubscriberAdaptor-J_pSz6pu.d.cts → AWSLambdaSubscriberAdaptor-Cknp_nn1.d.cts} +2 -2
  8. package/dist/{AWSLambdaSubscriberAdaptor-G8y3YkWj.mjs → AWSLambdaSubscriberAdaptor-CyFh7MN8.mjs} +1 -1
  9. package/dist/{AWSLambdaSubscriberAdaptor-G8y3YkWj.mjs.map → AWSLambdaSubscriberAdaptor-CyFh7MN8.mjs.map} +1 -1
  10. package/dist/{AWSLambdaSubscriberAdaptor-D6kjKjSf.d.mts → AWSLambdaSubscriberAdaptor-DpHzp-AM.d.mts} +2 -2
  11. package/dist/{AWSLambdaSubscriberAdaptor-CmPZ10JF.cjs → AWSLambdaSubscriberAdaptor-Dum5bkw3.cjs} +1 -1
  12. package/dist/{AWSLambdaSubscriberAdaptor-CmPZ10JF.cjs.map → AWSLambdaSubscriberAdaptor-Dum5bkw3.cjs.map} +1 -1
  13. package/dist/{AmazonApiGatewayEndpointAdaptor-DHcUetbw.mjs → AmazonApiGatewayEndpointAdaptor-CIEhW1TQ.mjs} +47 -16
  14. package/dist/AmazonApiGatewayEndpointAdaptor-CIEhW1TQ.mjs.map +1 -0
  15. package/dist/{AmazonApiGatewayEndpointAdaptor-BnNd8tCz.d.cts → AmazonApiGatewayEndpointAdaptor-CwItKPz2.d.cts} +6 -5
  16. package/dist/{AmazonApiGatewayEndpointAdaptor-DHBF_5jn.cjs → AmazonApiGatewayEndpointAdaptor-H8YvtfQm.cjs} +47 -16
  17. package/dist/AmazonApiGatewayEndpointAdaptor-H8YvtfQm.cjs.map +1 -0
  18. package/dist/{AmazonApiGatewayEndpointAdaptor-B7MKo8h3.d.mts → AmazonApiGatewayEndpointAdaptor-eDQgPNLH.d.mts} +7 -6
  19. package/dist/{AmazonApiGatewayV1EndpointAdaptor-CmUxFoPx.cjs → AmazonApiGatewayV1EndpointAdaptor-0n71d3gq.cjs} +3 -3
  20. package/dist/{AmazonApiGatewayV1EndpointAdaptor-CmUxFoPx.cjs.map → AmazonApiGatewayV1EndpointAdaptor-0n71d3gq.cjs.map} +1 -1
  21. package/dist/{AmazonApiGatewayV1EndpointAdaptor-CsV6zyvn.mjs → AmazonApiGatewayV1EndpointAdaptor-B36zXLJ7.mjs} +3 -3
  22. package/dist/{AmazonApiGatewayV1EndpointAdaptor-CsV6zyvn.mjs.map → AmazonApiGatewayV1EndpointAdaptor-B36zXLJ7.mjs.map} +1 -1
  23. package/dist/{AmazonApiGatewayV1EndpointAdaptor-gO9OxdZl.d.mts → AmazonApiGatewayV1EndpointAdaptor-CnGVpA38.d.mts} +4 -4
  24. package/dist/{AmazonApiGatewayV1EndpointAdaptor-BC-a2tt3.d.cts → AmazonApiGatewayV1EndpointAdaptor-DaCvUL6y.d.cts} +3 -3
  25. package/dist/{AmazonApiGatewayV2EndpointAdaptor-D1uz4wNg.d.mts → AmazonApiGatewayV2EndpointAdaptor-BELz2ijs.d.mts} +4 -4
  26. package/dist/{AmazonApiGatewayV2EndpointAdaptor-_bFcbEa-.mjs → AmazonApiGatewayV2EndpointAdaptor-CE3wZEb8.mjs} +3 -3
  27. package/dist/{AmazonApiGatewayV2EndpointAdaptor-_bFcbEa-.mjs.map → AmazonApiGatewayV2EndpointAdaptor-CE3wZEb8.mjs.map} +1 -1
  28. package/dist/{AmazonApiGatewayV2EndpointAdaptor-zNFUPxSY.d.cts → AmazonApiGatewayV2EndpointAdaptor-DA1PH0nc.d.cts} +3 -3
  29. package/dist/{AmazonApiGatewayV2EndpointAdaptor-cZbaqiUi.cjs → AmazonApiGatewayV2EndpointAdaptor-DtU3Cb8F.cjs} +3 -3
  30. package/dist/{AmazonApiGatewayV2EndpointAdaptor-cZbaqiUi.cjs.map → AmazonApiGatewayV2EndpointAdaptor-DtU3Cb8F.cjs.map} +1 -1
  31. package/dist/{Authorizer-Bbk9ziuG.d.mts → Authorizer-BRCVPz_O.d.mts} +1 -1
  32. package/dist/{Authorizer-iXsSB600.d.cts → Authorizer-DG54w1m2.d.cts} +1 -1
  33. package/dist/{BaseFunctionBuilder-BmsbV0BU.cjs → BaseFunctionBuilder-B8rT07QR.cjs} +7 -2
  34. package/dist/BaseFunctionBuilder-B8rT07QR.cjs.map +1 -0
  35. package/dist/{BaseFunctionBuilder-DCUtCdVL.mjs → BaseFunctionBuilder-CT7p10K1.mjs} +7 -2
  36. package/dist/BaseFunctionBuilder-CT7p10K1.mjs.map +1 -0
  37. package/dist/{BaseFunctionBuilder-C4ZJPkIZ.d.cts → BaseFunctionBuilder-Cf0op65o.d.cts} +7 -4
  38. package/dist/{BaseFunctionBuilder-CxBX0arJ.d.mts → BaseFunctionBuilder-DilipY1y.d.mts} +7 -4
  39. package/dist/{Construct-VEI7M3fs.cjs → Construct-BYSPikVm.cjs} +28 -10
  40. package/dist/Construct-BYSPikVm.cjs.map +1 -0
  41. package/dist/{Construct-C3hsQBy4.mjs → Construct-LWeB1rSQ.mjs} +28 -10
  42. package/dist/Construct-LWeB1rSQ.mjs.map +1 -0
  43. package/dist/{Construct-ci5u8Xnu.d.cts → Construct-ZPqE0vhn.d.mts} +9 -4
  44. package/dist/{Construct-zhmcmIdY.d.mts → Construct-dI_rgdSp.d.cts} +9 -4
  45. package/dist/Construct.cjs +1 -1
  46. package/dist/Construct.d.cts +1 -1
  47. package/dist/Construct.d.mts +1 -1
  48. package/dist/Construct.mjs +1 -1
  49. package/dist/{Cron-ByNYsQDH.d.mts → Cron-6lOgKqSA.d.cts} +3 -3
  50. package/dist/{Cron-DkPL-Fms.d.cts → Cron-BH_07atD.d.mts} +3 -3
  51. package/dist/{Cron-Dfgr8F9d.cjs → Cron-Bnd-2pgE.cjs} +3 -3
  52. package/dist/{Cron-Dfgr8F9d.cjs.map → Cron-Bnd-2pgE.cjs.map} +1 -1
  53. package/dist/{Cron-wP6Ob48_.mjs → Cron-DNRjf2cp.mjs} +3 -3
  54. package/dist/{Cron-wP6Ob48_.mjs.map → Cron-DNRjf2cp.mjs.map} +1 -1
  55. package/dist/{CronBuilder-BknVTWLE.d.mts → CronBuilder-5oK2AL2n.d.cts} +5 -5
  56. package/dist/{CronBuilder-BqTTozUi.d.cts → CronBuilder-D2b4zY4l.d.mts} +5 -5
  57. package/dist/{CronBuilder-C27c5oqh.mjs → CronBuilder-DdR2TuQa.mjs} +5 -5
  58. package/dist/{CronBuilder-C27c5oqh.mjs.map → CronBuilder-DdR2TuQa.mjs.map} +1 -1
  59. package/dist/{CronBuilder-W1ZqCJ7m.cjs → CronBuilder-dtw4ZyH6.cjs} +5 -5
  60. package/dist/{CronBuilder-W1ZqCJ7m.cjs.map → CronBuilder-dtw4ZyH6.cjs.map} +1 -1
  61. package/dist/{Endpoint-C98BwZjA.mjs → Endpoint-B69TqESg.mjs} +15 -8
  62. package/dist/Endpoint-B69TqESg.mjs.map +1 -0
  63. package/dist/{Endpoint-BjpQmTek.cjs → Endpoint-B9PryZES.cjs} +15 -8
  64. package/dist/Endpoint-B9PryZES.cjs.map +1 -0
  65. package/dist/{Endpoint-zHPjZ35J.d.cts → Endpoint-Cs-MsYlY.d.cts} +80 -12
  66. package/dist/{Endpoint-C16whGI-.d.mts → Endpoint-DuZlyjd4.d.mts} +80 -12
  67. package/dist/EndpointBuilder-BrB-K1jO.d.mts +86 -0
  68. package/dist/EndpointBuilder-C-PHInEW.d.cts +86 -0
  69. package/dist/{EndpointBuilder-CCUx4vep.mjs → EndpointBuilder-DnVL-EU_.mjs} +47 -5
  70. package/dist/EndpointBuilder-DnVL-EU_.mjs.map +1 -0
  71. package/dist/{EndpointBuilder-D2Zu8i9b.cjs → EndpointBuilder-DofwCnWJ.cjs} +47 -5
  72. package/dist/EndpointBuilder-DofwCnWJ.cjs.map +1 -0
  73. package/dist/{EndpointFactory-KkyIOE62.d.cts → EndpointFactory-6zNpVSYp.d.mts} +12 -11
  74. package/dist/{EndpointFactory-C4YhgXOc.cjs → EndpointFactory-Ba9mx9MU.cjs} +3 -3
  75. package/dist/{EndpointFactory-C4YhgXOc.cjs.map → EndpointFactory-Ba9mx9MU.cjs.map} +1 -1
  76. package/dist/{EndpointFactory-VnSAdwdv.d.mts → EndpointFactory-e5WYVR6t.d.cts} +12 -11
  77. package/dist/{EndpointFactory-RAb2zcw0.mjs → EndpointFactory-pPaIGFHV.mjs} +3 -3
  78. package/dist/{EndpointFactory-RAb2zcw0.mjs.map → EndpointFactory-pPaIGFHV.mjs.map} +1 -1
  79. package/dist/{Function-BbLYIKLL.d.cts → Function-6EWabl_X.d.cts} +5 -4
  80. package/dist/{Function-1Fh6Tdkg.cjs → Function-CO-s2pB8.cjs} +6 -6
  81. package/dist/Function-CO-s2pB8.cjs.map +1 -0
  82. package/dist/{Function-D-QEfH7k.mjs → Function-COnc-tWM.mjs} +6 -6
  83. package/dist/Function-COnc-tWM.mjs.map +1 -0
  84. package/dist/{Function-DFRZZCC-.d.mts → Function-G3JPHMaY.d.mts} +5 -4
  85. package/dist/{FunctionBuilder-DdGjpiFT.d.cts → FunctionBuilder-B3fpp3hA.d.cts} +13 -11
  86. package/dist/{FunctionBuilder-DuktGyZc.d.mts → FunctionBuilder-ByaB_LQ4.d.mts} +13 -11
  87. package/dist/{FunctionBuilder-Bxyr1Pf9.mjs → FunctionBuilder-CMhLQ4dt.mjs} +11 -6
  88. package/dist/FunctionBuilder-CMhLQ4dt.mjs.map +1 -0
  89. package/dist/{FunctionBuilder-DcEFYgbn.cjs → FunctionBuilder-_hMwZUof.cjs} +11 -6
  90. package/dist/FunctionBuilder-_hMwZUof.cjs.map +1 -0
  91. package/dist/{FunctionExecutionWrapper-CRYi047B.d.cts → FunctionExecutionWrapper-Ci-ookJG.d.cts} +2 -2
  92. package/dist/{FunctionExecutionWrapper-DaR-dSLw.d.mts → FunctionExecutionWrapper-DHFMLrOl.d.mts} +2 -2
  93. package/dist/{FunctionExecutionWrapper-BL6PE6Dv.mjs → FunctionExecutionWrapper-i9v5L3Av.mjs} +2 -2
  94. package/dist/{FunctionExecutionWrapper-BL6PE6Dv.mjs.map → FunctionExecutionWrapper-i9v5L3Av.mjs.map} +1 -1
  95. package/dist/{FunctionExecutionWrapper-Ee-CE8Fz.cjs → FunctionExecutionWrapper-sxJNTpuc.cjs} +2 -2
  96. package/dist/{FunctionExecutionWrapper-Ee-CE8Fz.cjs.map → FunctionExecutionWrapper-sxJNTpuc.cjs.map} +1 -1
  97. package/dist/{HonoEndpointAdaptor-CY1mXTe6.d.mts → HonoEndpointAdaptor-BElil8O5.d.mts} +9 -8
  98. package/dist/{HonoEndpointAdaptor-DcvZdYzx.cjs → HonoEndpointAdaptor-Cw2if5cG.cjs} +51 -20
  99. package/dist/HonoEndpointAdaptor-Cw2if5cG.cjs.map +1 -0
  100. package/dist/{HonoEndpointAdaptor-CyVPl4w2.mjs → HonoEndpointAdaptor-DAfnTFVS.mjs} +51 -20
  101. package/dist/HonoEndpointAdaptor-DAfnTFVS.mjs.map +1 -0
  102. package/dist/{HonoEndpointAdaptor-CYvrXBe-.d.cts → HonoEndpointAdaptor-DSHl8ZCY.d.cts} +8 -7
  103. package/dist/{Subscriber-Cy28j8MS.d.cts → Subscriber-BhzqUzs-.d.cts} +2 -2
  104. package/dist/{Subscriber-CTczVFsF.mjs → Subscriber-CGb8LjZa.mjs} +2 -2
  105. package/dist/{Subscriber-CTczVFsF.mjs.map → Subscriber-CGb8LjZa.mjs.map} +1 -1
  106. package/dist/{Subscriber-BL30GpWp.cjs → Subscriber-D-FPWts6.cjs} +2 -2
  107. package/dist/{Subscriber-BL30GpWp.cjs.map → Subscriber-D-FPWts6.cjs.map} +1 -1
  108. package/dist/{Subscriber-g3IWM1_d.d.mts → Subscriber-s6yfjeOc.d.mts} +2 -2
  109. package/dist/{SubscriberBuilder-BzK8kc2a.d.cts → SubscriberBuilder-BCVkp-ga.d.cts} +2 -2
  110. package/dist/{SubscriberBuilder-CekL3BoP.mjs → SubscriberBuilder-BcAspHv9.mjs} +2 -2
  111. package/dist/{SubscriberBuilder-CekL3BoP.mjs.map → SubscriberBuilder-BcAspHv9.mjs.map} +1 -1
  112. package/dist/{SubscriberBuilder-D1hojYLa.cjs → SubscriberBuilder-BfE2cL1q.cjs} +2 -2
  113. package/dist/{SubscriberBuilder-D1hojYLa.cjs.map → SubscriberBuilder-BfE2cL1q.cjs.map} +1 -1
  114. package/dist/{SubscriberBuilder-YjQ7qIpQ.d.mts → SubscriberBuilder-aCua5_wA.d.mts} +2 -2
  115. package/dist/{TestEndpointAdaptor-C-ahwGW6.cjs → TestEndpointAdaptor-Bn1WRFph.cjs} +47 -18
  116. package/dist/TestEndpointAdaptor-Bn1WRFph.cjs.map +1 -0
  117. package/dist/{TestEndpointAdaptor-DGWuai69.d.mts → TestEndpointAdaptor-DnlAA_rm.d.mts} +7 -6
  118. package/dist/{TestEndpointAdaptor-B4z9G5Ap.mjs → TestEndpointAdaptor-DubQOJk_.mjs} +47 -18
  119. package/dist/TestEndpointAdaptor-DubQOJk_.mjs.map +1 -0
  120. package/dist/{TestEndpointAdaptor-uXliWYjS.d.cts → TestEndpointAdaptor-o-xtSyQ3.d.cts} +6 -5
  121. package/dist/adaptors/aws.cjs +14 -13
  122. package/dist/adaptors/aws.d.cts +14 -14
  123. package/dist/adaptors/aws.d.mts +15 -15
  124. package/dist/adaptors/aws.mjs +14 -13
  125. package/dist/adaptors/hono.cjs +10 -9
  126. package/dist/adaptors/hono.d.cts +8 -8
  127. package/dist/adaptors/hono.d.mts +9 -9
  128. package/dist/adaptors/hono.mjs +10 -9
  129. package/dist/adaptors/testing.cjs +8 -7
  130. package/dist/adaptors/testing.d.cts +8 -8
  131. package/dist/adaptors/testing.d.mts +9 -9
  132. package/dist/adaptors/testing.mjs +8 -7
  133. package/dist/crons/Cron.cjs +6 -6
  134. package/dist/crons/Cron.d.cts +6 -6
  135. package/dist/crons/Cron.d.mts +6 -6
  136. package/dist/crons/Cron.mjs +6 -6
  137. package/dist/crons/CronBuilder.cjs +7 -7
  138. package/dist/crons/CronBuilder.d.cts +7 -7
  139. package/dist/crons/CronBuilder.d.mts +7 -7
  140. package/dist/crons/CronBuilder.mjs +7 -7
  141. package/dist/crons/index.cjs +7 -7
  142. package/dist/crons/index.d.cts +11 -11
  143. package/dist/crons/index.d.mts +11 -11
  144. package/dist/crons/index.mjs +7 -7
  145. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.cjs +8 -7
  146. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +8 -8
  147. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.mts +9 -9
  148. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.mjs +8 -7
  149. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.cjs +10 -9
  150. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +9 -9
  151. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.mts +10 -10
  152. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.mjs +10 -9
  153. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.cjs +10 -9
  154. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +9 -9
  155. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.mts +10 -10
  156. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.mjs +10 -9
  157. package/dist/endpoints/Authorizer.d.cts +1 -1
  158. package/dist/endpoints/Authorizer.d.mts +1 -1
  159. package/dist/endpoints/Endpoint.cjs +6 -6
  160. package/dist/endpoints/Endpoint.d.cts +7 -7
  161. package/dist/endpoints/Endpoint.d.mts +8 -8
  162. package/dist/endpoints/Endpoint.mjs +6 -6
  163. package/dist/endpoints/EndpointBuilder.cjs +7 -7
  164. package/dist/endpoints/EndpointBuilder.d.cts +8 -8
  165. package/dist/endpoints/EndpointBuilder.d.mts +9 -9
  166. package/dist/endpoints/EndpointBuilder.mjs +7 -7
  167. package/dist/endpoints/EndpointFactory.cjs +8 -8
  168. package/dist/endpoints/EndpointFactory.d.cts +9 -9
  169. package/dist/endpoints/EndpointFactory.d.mts +10 -10
  170. package/dist/endpoints/EndpointFactory.mjs +8 -8
  171. package/dist/endpoints/HonoEndpointAdaptor.cjs +10 -9
  172. package/dist/endpoints/HonoEndpointAdaptor.d.cts +8 -8
  173. package/dist/endpoints/HonoEndpointAdaptor.d.mts +9 -9
  174. package/dist/endpoints/HonoEndpointAdaptor.mjs +10 -9
  175. package/dist/endpoints/TestEndpointAdaptor.cjs +8 -7
  176. package/dist/endpoints/TestEndpointAdaptor.d.cts +8 -8
  177. package/dist/endpoints/TestEndpointAdaptor.d.mts +9 -9
  178. package/dist/endpoints/TestEndpointAdaptor.mjs +8 -7
  179. package/dist/endpoints/audit.cjs +0 -0
  180. package/dist/endpoints/audit.d.cts +9 -0
  181. package/dist/endpoints/audit.d.mts +9 -0
  182. package/dist/endpoints/audit.mjs +0 -0
  183. package/dist/endpoints/helpers.cjs +7 -7
  184. package/dist/endpoints/helpers.d.cts +7 -7
  185. package/dist/endpoints/helpers.d.mts +8 -8
  186. package/dist/endpoints/helpers.mjs +7 -7
  187. package/dist/endpoints/index.cjs +8 -8
  188. package/dist/endpoints/index.cjs.map +1 -1
  189. package/dist/endpoints/index.d.cts +12 -12
  190. package/dist/endpoints/index.d.mts +13 -13
  191. package/dist/endpoints/index.mjs +8 -8
  192. package/dist/endpoints/index.mjs.map +1 -1
  193. package/dist/endpoints/parseHonoQuery.cjs +1 -1
  194. package/dist/endpoints/parseHonoQuery.mjs +1 -1
  195. package/dist/endpoints/parseQueryParams.cjs +1 -1
  196. package/dist/endpoints/parseQueryParams.mjs +1 -1
  197. package/dist/endpoints/processAudits.cjs +5 -0
  198. package/dist/endpoints/processAudits.d.cts +74 -0
  199. package/dist/endpoints/processAudits.d.mts +74 -0
  200. package/dist/endpoints/processAudits.mjs +3 -0
  201. package/dist/functions/AWSLambdaFunction.cjs +6 -6
  202. package/dist/functions/AWSLambdaFunction.d.cts +4 -4
  203. package/dist/functions/AWSLambdaFunction.d.mts +4 -4
  204. package/dist/functions/AWSLambdaFunction.mjs +6 -6
  205. package/dist/functions/BaseFunctionBuilder.cjs +2 -2
  206. package/dist/functions/BaseFunctionBuilder.d.cts +2 -2
  207. package/dist/functions/BaseFunctionBuilder.d.mts +2 -2
  208. package/dist/functions/BaseFunctionBuilder.mjs +2 -2
  209. package/dist/functions/Function.cjs +2 -2
  210. package/dist/functions/Function.d.cts +2 -2
  211. package/dist/functions/Function.d.mts +2 -2
  212. package/dist/functions/Function.mjs +2 -2
  213. package/dist/functions/FunctionBuilder.cjs +4 -4
  214. package/dist/functions/FunctionBuilder.d.cts +4 -4
  215. package/dist/functions/FunctionBuilder.d.mts +4 -4
  216. package/dist/functions/FunctionBuilder.mjs +4 -4
  217. package/dist/functions/FunctionExecutionWrapper.cjs +5 -5
  218. package/dist/functions/FunctionExecutionWrapper.d.cts +3 -3
  219. package/dist/functions/FunctionExecutionWrapper.d.mts +3 -3
  220. package/dist/functions/FunctionExecutionWrapper.mjs +5 -5
  221. package/dist/functions/TestFunctionAdaptor.cjs +4 -4
  222. package/dist/functions/TestFunctionAdaptor.d.cts +2 -2
  223. package/dist/functions/TestFunctionAdaptor.d.mts +2 -2
  224. package/dist/functions/TestFunctionAdaptor.mjs +4 -4
  225. package/dist/functions/index.cjs +5 -5
  226. package/dist/functions/index.d.cts +5 -5
  227. package/dist/functions/index.d.mts +5 -5
  228. package/dist/functions/index.mjs +5 -5
  229. package/dist/functions-BYqZAob8.mjs +8 -0
  230. package/dist/{functions-DD-00sWF.mjs.map → functions-BYqZAob8.mjs.map} +1 -1
  231. package/dist/{functions-BtgBiuC_.cjs → functions-D03lqK-r.cjs} +2 -2
  232. package/dist/{functions-BtgBiuC_.cjs.map → functions-D03lqK-r.cjs.map} +1 -1
  233. package/dist/{helpers-QM_FSjPY.cjs → helpers-BApRyhly.cjs} +2 -2
  234. package/dist/{helpers-QM_FSjPY.cjs.map → helpers-BApRyhly.cjs.map} +1 -1
  235. package/dist/{helpers-DtPeOhUV.mjs → helpers-BPDogwac.mjs} +2 -2
  236. package/dist/{helpers-DtPeOhUV.mjs.map → helpers-BPDogwac.mjs.map} +1 -1
  237. package/dist/index-CUg_hSq-.d.cts +9 -0
  238. package/dist/index-D-a7e2gv.d.mts +9 -0
  239. package/dist/index.cjs +1 -1
  240. package/dist/index.d.cts +1 -1
  241. package/dist/index.d.mts +2 -2
  242. package/dist/index.mjs +1 -1
  243. package/dist/{parseHonoQuery-DopC24vB.cjs → parseHonoQuery-CT8Cvin-.cjs} +1 -1
  244. package/dist/{parseHonoQuery-DopC24vB.cjs.map → parseHonoQuery-CT8Cvin-.cjs.map} +1 -1
  245. package/dist/{parseHonoQuery-znDKBhdE.mjs → parseHonoQuery-CwFKw2ua.mjs} +1 -1
  246. package/dist/{parseHonoQuery-znDKBhdE.mjs.map → parseHonoQuery-CwFKw2ua.mjs.map} +1 -1
  247. package/dist/{parseQueryParams-BJaRh3OB.mjs → parseQueryParams-CHINupbZ.mjs} +1 -1
  248. package/dist/{parseQueryParams-BJaRh3OB.mjs.map → parseQueryParams-CHINupbZ.mjs.map} +1 -1
  249. package/dist/{parseQueryParams-BzPop4I1.cjs → parseQueryParams-CwvXXwkW.cjs} +1 -1
  250. package/dist/{parseQueryParams-BzPop4I1.cjs.map → parseQueryParams-CwvXXwkW.cjs.map} +1 -1
  251. package/dist/processAudits-BFokHhCO.cjs +174 -0
  252. package/dist/processAudits-BFokHhCO.cjs.map +1 -0
  253. package/dist/processAudits-DfcB-X-4.mjs +156 -0
  254. package/dist/processAudits-DfcB-X-4.mjs.map +1 -0
  255. package/dist/publisher.d.cts +1 -1
  256. package/dist/publisher.d.mts +1 -1
  257. package/dist/subscribers/AWSLambdaSubscriberAdaptor.cjs +1 -1
  258. package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.cts +3 -3
  259. package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.mts +3 -3
  260. package/dist/subscribers/AWSLambdaSubscriberAdaptor.mjs +1 -1
  261. package/dist/subscribers/Subscriber.cjs +2 -2
  262. package/dist/subscribers/Subscriber.d.cts +2 -2
  263. package/dist/subscribers/Subscriber.d.mts +2 -2
  264. package/dist/subscribers/Subscriber.mjs +2 -2
  265. package/dist/subscribers/SubscriberBuilder.cjs +3 -3
  266. package/dist/subscribers/SubscriberBuilder.d.cts +3 -3
  267. package/dist/subscribers/SubscriberBuilder.d.mts +3 -3
  268. package/dist/subscribers/SubscriberBuilder.mjs +3 -3
  269. package/dist/subscribers/index.cjs +3 -3
  270. package/dist/subscribers/index.d.cts +5 -5
  271. package/dist/subscribers/index.d.mts +5 -5
  272. package/dist/subscribers/index.mjs +3 -3
  273. package/dist/{types-CVq20-fE.d.mts → types-DKf0juBf.d.mts} +1 -1
  274. package/dist/types.d.mts +1 -1
  275. package/package.json +14 -10
  276. package/src/Construct.ts +31 -5
  277. package/src/endpoints/AmazonApiGatewayEndpointAdaptor.ts +88 -19
  278. package/src/endpoints/Endpoint.ts +66 -13
  279. package/src/endpoints/EndpointBuilder.ts +183 -19
  280. package/src/endpoints/HonoEndpointAdaptor.ts +114 -33
  281. package/src/endpoints/TestEndpointAdaptor.ts +96 -21
  282. package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.events.spec.ts +8 -0
  283. package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.spec.ts +29 -0
  284. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.audits.spec.ts +626 -0
  285. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.events.spec.ts +9 -0
  286. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.kysely-audit.integration.spec.ts +718 -0
  287. package/src/endpoints/__tests__/Endpoint.spec.ts +19 -0
  288. package/src/endpoints/__tests__/EndpointBuilder.audit.spec.ts +424 -0
  289. package/src/endpoints/__tests__/HonoEndpointAdaptor.audit-transactions.spec.ts +685 -0
  290. package/src/endpoints/__tests__/HonoEndpointAdaptor.audits.spec.ts +632 -0
  291. package/src/endpoints/__tests__/HonoEndpointAdaptor.events.spec.ts +8 -0
  292. package/src/endpoints/__tests__/HonoEndpointAdaptor.kysely-audit.integration.spec.ts +678 -0
  293. package/src/endpoints/__tests__/HonoEndpointAdaptor.openapi.spec.ts +4 -0
  294. package/src/endpoints/__tests__/HonoEndpointAdaptor.spec.ts +25 -0
  295. package/src/endpoints/audit.ts +87 -0
  296. package/src/endpoints/index.ts +1 -0
  297. package/src/endpoints/processAudits.ts +339 -0
  298. package/src/functions/BaseFunctionBuilder.ts +50 -7
  299. package/src/functions/Function.ts +13 -9
  300. package/src/functions/FunctionBuilder.ts +78 -14
  301. package/src/functions/__tests__/FunctionBuilder.state-isolation.spec.ts +43 -2
  302. package/dist/AmazonApiGatewayEndpointAdaptor-DHBF_5jn.cjs.map +0 -1
  303. package/dist/AmazonApiGatewayEndpointAdaptor-DHcUetbw.mjs.map +0 -1
  304. package/dist/BaseFunctionBuilder-BmsbV0BU.cjs.map +0 -1
  305. package/dist/BaseFunctionBuilder-DCUtCdVL.mjs.map +0 -1
  306. package/dist/Construct-C3hsQBy4.mjs.map +0 -1
  307. package/dist/Construct-VEI7M3fs.cjs.map +0 -1
  308. package/dist/Endpoint-BjpQmTek.cjs.map +0 -1
  309. package/dist/Endpoint-C98BwZjA.mjs.map +0 -1
  310. package/dist/EndpointBuilder-B5l7zQU1.d.cts +0 -55
  311. package/dist/EndpointBuilder-BzqR0xvt.d.mts +0 -55
  312. package/dist/EndpointBuilder-CCUx4vep.mjs.map +0 -1
  313. package/dist/EndpointBuilder-D2Zu8i9b.cjs.map +0 -1
  314. package/dist/Function-1Fh6Tdkg.cjs.map +0 -1
  315. package/dist/Function-D-QEfH7k.mjs.map +0 -1
  316. package/dist/FunctionBuilder-Bxyr1Pf9.mjs.map +0 -1
  317. package/dist/FunctionBuilder-DcEFYgbn.cjs.map +0 -1
  318. package/dist/HonoEndpointAdaptor-CyVPl4w2.mjs.map +0 -1
  319. package/dist/HonoEndpointAdaptor-DcvZdYzx.cjs.map +0 -1
  320. package/dist/TestEndpointAdaptor-B4z9G5Ap.mjs.map +0 -1
  321. package/dist/TestEndpointAdaptor-C-ahwGW6.cjs.map +0 -1
  322. package/dist/functions-DD-00sWF.mjs +0 -8
  323. package/dist/index-CcmV3PKF.d.cts +0 -9
  324. package/dist/index-DQt3pQtF.d.mts +0 -9
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { HttpMethod, LowerHttpMethod, RemoveUndefined } from "./types-CVq20-fE.mjs";
1
+ import { HttpMethod, LowerHttpMethod, RemoveUndefined } from "./types-DKf0juBf.mjs";
2
2
  export { HttpMethod, LowerHttpMethod, RemoveUndefined };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/constructs",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -59,27 +59,31 @@
59
59
  "access": "public"
60
60
  },
61
61
  "dependencies": {
62
+ "fast-glob": "~3.3.3",
63
+ "lodash.compact": "~3.0.1",
64
+ "lodash.get": "~4.4.2",
62
65
  "lodash.pick": "~4.4.0",
63
66
  "lodash.set": "~4.3.2",
64
- "lodash.get": "~4.4.2",
65
67
  "lodash.uniqby": "~4.7.0",
66
- "lodash.compact": "~3.0.1",
67
68
  "openapi-types": "~12.1.3",
68
- "fast-glob": "~3.3.3",
69
+ "@geekmidas/cache": "0.0.7",
70
+ "@geekmidas/audit": "0.0.1",
71
+ "@geekmidas/logger": "0.0.1",
72
+ "@geekmidas/rate-limit": "0.1.0",
69
73
  "@geekmidas/schema": "0.0.2",
70
74
  "@geekmidas/services": "0.0.1",
71
- "@geekmidas/logger": "0.0.1",
72
- "@geekmidas/errors": "0.0.1",
73
- "@geekmidas/cache": "0.0.7",
74
75
  "@geekmidas/events": "0.0.2",
75
- "@geekmidas/rate-limit": "0.1.0"
76
+ "@geekmidas/errors": "0.0.1"
76
77
  },
77
78
  "devDependencies": {
79
+ "@types/lodash.compact": "~3.0.9",
80
+ "@types/lodash.get": "~4.4.9",
78
81
  "@types/lodash.pick": "~4.4.9",
79
82
  "@types/lodash.set": "~4.3.9",
80
- "@types/lodash.get": "~4.4.9",
81
83
  "@types/lodash.uniqby": "~4.7.9",
82
- "@types/lodash.compact": "~3.0.9",
84
+ "@types/pg": "~8.15.6",
85
+ "kysely": "~0.28.8",
86
+ "pg": "~8.16.3",
83
87
  "zod": "~4.1.12",
84
88
  "@geekmidas/testkit": "0.0.17"
85
89
  },
package/src/Construct.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { AuditStorage } from '@geekmidas/audit';
1
2
  import { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';
2
3
  import type { EventPublisher, MappedEvent } from '@geekmidas/events';
3
4
  import type { Logger } from '@geekmidas/logger';
@@ -5,12 +6,18 @@ import type { Service } from '@geekmidas/services';
5
6
  import type { StandardSchemaV1 } from '@standard-schema/spec';
6
7
  import compact from 'lodash.compact';
7
8
 
9
+ // Cache for service environment variables to handle singleton services
10
+ // Key: service class/constructor, Value: array of env var names
11
+ const serviceEnvCache = new Map<Service, string[]>();
12
+
8
13
  export abstract class Construct<
9
14
  TLogger extends Logger = Logger,
10
15
  TServiceName extends string = string,
11
16
  T extends EventPublisher<any> | undefined = undefined,
12
17
  OutSchema extends StandardSchemaV1 | undefined = undefined,
13
18
  TServices extends Service[] = [],
19
+ TAuditStorageServiceName extends string = string,
20
+ TAuditStorage extends AuditStorage | undefined = undefined,
14
21
  > {
15
22
  constructor(
16
23
  public readonly type: ConstructType,
@@ -22,6 +29,10 @@ export abstract class Construct<
22
29
  public outputSchema?: OutSchema,
23
30
  public readonly timeout?: number,
24
31
  public readonly memorySize?: number,
32
+ public readonly auditorStorageService?: Service<
33
+ TAuditStorageServiceName,
34
+ TAuditStorage
35
+ >,
25
36
  ) {}
26
37
 
27
38
  /**
@@ -29,6 +40,9 @@ export abstract class Construct<
29
40
  * This is determined by running a "sniffer" EnvironmentParser through each service's
30
41
  * register method to track which environment variables are accessed.
31
42
  *
43
+ * Results are cached per service class to handle singleton patterns where
44
+ * subsequent register() calls may short-circuit and not access env vars.
45
+ *
32
46
  * @returns Promise that resolves to array of environment variable names, sorted alphabetically
33
47
  *
34
48
  * @example
@@ -42,15 +56,24 @@ export abstract class Construct<
42
56
  * ```
43
57
  */
44
58
  async getEnvironment(): Promise<string[]> {
45
- const sniffer = new SnifferEnvironmentParser();
59
+ const envVars = new Set<string>();
46
60
  const services: Service[] = compact([
47
61
  ...this.services,
48
62
  this.publisherService,
63
+ this.auditorStorageService,
49
64
  ]);
50
65
 
51
66
  try {
52
- // Run each service's register method with the sniffer to track env var access
53
67
  for (const service of services) {
68
+ // Check cache first - handles singleton services that short-circuit
69
+ if (serviceEnvCache.has(service)) {
70
+ const cached = serviceEnvCache.get(service)!;
71
+ cached.forEach((v) => envVars.add(v));
72
+ continue;
73
+ }
74
+
75
+ // Sniff the service for env vars
76
+ const sniffer = new SnifferEnvironmentParser();
54
77
  try {
55
78
  const result = service.register(sniffer as any);
56
79
 
@@ -60,12 +83,15 @@ export abstract class Construct<
60
83
  }
61
84
  } catch {
62
85
  // Service registration may fail but env vars are still tracked
63
- continue;
64
86
  }
87
+
88
+ // Cache and collect the env vars
89
+ const serviceEnvVars = sniffer.getEnvironmentVariables();
90
+ serviceEnvCache.set(service, serviceEnvVars);
91
+ serviceEnvVars.forEach((v) => envVars.add(v));
65
92
  }
66
93
 
67
- // Get tracked env vars directly from the sniffer
68
- return sniffer.getEnvironmentVariables();
94
+ return Array.from(envVars).sort();
69
95
  } catch (error) {
70
96
  console.error(
71
97
  'Error determining environment variables for construct:',
@@ -1,3 +1,4 @@
1
+ import type { AuditableAction, Auditor, AuditStorage } from '@geekmidas/audit';
1
2
  import type { Logger } from '@geekmidas/logger';
2
3
  import type { StandardSchemaV1 } from '@standard-schema/spec';
3
4
  import type { HttpMethod } from '../types';
@@ -29,6 +30,12 @@ import type {
29
30
  InferStandardSchema,
30
31
  } from '@geekmidas/schema';
31
32
  import { publishConstructEvents } from '../publisher';
33
+ import {
34
+ type AuditExecutionContext,
35
+ createAuditContext,
36
+ executeWithAuditTransaction,
37
+ } from './processAudits';
38
+ import type { MappedAudit } from './audit';
32
39
 
33
40
  // Helper function to publish events
34
41
 
@@ -46,6 +53,12 @@ export abstract class AmazonApiGatewayEndpoint<
46
53
  TSession = unknown,
47
54
  TEventPublisher extends EventPublisher<any> | undefined = undefined,
48
55
  TEventPublisherServiceName extends string = string,
56
+ TAuditStorage extends AuditStorage | undefined = undefined,
57
+ TAuditStorageServiceName extends string = string,
58
+ TAuditAction extends AuditableAction<string, unknown> = AuditableAction<
59
+ string,
60
+ unknown
61
+ >,
49
62
  > {
50
63
  constructor(
51
64
  protected envParser: EnvironmentParser<{}>,
@@ -58,7 +71,10 @@ export abstract class AmazonApiGatewayEndpoint<
58
71
  TLogger,
59
72
  TSession,
60
73
  TEventPublisher,
61
- TEventPublisherServiceName
74
+ TEventPublisherServiceName,
75
+ TAuditStorage,
76
+ TAuditStorageServiceName,
77
+ TAuditAction
62
78
  >,
63
79
  ) {}
64
80
 
@@ -199,12 +215,15 @@ export abstract class AmazonApiGatewayEndpoint<
199
215
  const statusCode = req.response?.statusCode ?? this.endpoint.status;
200
216
 
201
217
  // Only publish events on successful responses (2xx status codes)
218
+ // Note: Audits are processed inside the handler's transaction
202
219
  if (Endpoint.isSuccessStatus(statusCode)) {
203
220
  const logger = event.logger as TLogger;
204
221
  const serviceDiscovery = ServiceDiscovery.getInstance<
205
222
  ServiceRecord<TServices>,
206
223
  TLogger
207
224
  >(logger, this.envParser);
225
+
226
+ // Publish events
208
227
  await publishConstructEvents(
209
228
  this.endpoint,
210
229
  response,
@@ -220,33 +239,83 @@ export abstract class AmazonApiGatewayEndpoint<
220
239
  event: Event<TEvent, TInput, TServices, TLogger, TSession>,
221
240
  ) {
222
241
  const input = this.endpoint.refineInput(event);
223
-
224
- const responseBuilder = new ResponseBuilder();
225
- const response = await this.endpoint.handler(
242
+ const logger = event.logger as TLogger;
243
+ const serviceDiscovery = ServiceDiscovery.getInstance<
244
+ ServiceRecord<TServices>,
245
+ TLogger
246
+ >(logger, this.envParser);
247
+
248
+ // Create audit context if audit storage is configured
249
+ const auditContext = await createAuditContext(
250
+ this.endpoint,
251
+ serviceDiscovery,
252
+ logger,
226
253
  {
254
+ session: event.session,
227
255
  header: event.header,
228
256
  cookie: event.cookie,
229
- logger: event.logger,
230
- services: event.services,
231
- session: event.session,
232
- ...input,
257
+ services: event.services as Record<string, unknown>,
233
258
  },
234
- responseBuilder,
235
259
  );
236
260
 
237
- // Check if response has metadata
238
- let data = response;
239
- let metadata = responseBuilder.getMetadata();
240
-
241
- if (Endpoint.hasMetadata(response)) {
242
- data = response.data;
243
- metadata = response.metadata;
261
+ // Warn if declarative audits are configured but no audit storage
262
+ const audits = this.endpoint.audits as MappedAudit<TAuditAction, TOutSchema>[];
263
+ if (!auditContext && audits?.length) {
264
+ logger.warn('No auditor storage service available');
244
265
  }
245
266
 
246
- const output = this.endpoint.outputSchema
247
- ? await this.endpoint.parseOutput(data)
248
- : undefined;
267
+ // Execute handler with automatic audit transaction support
268
+ const result = await executeWithAuditTransaction(
269
+ auditContext,
270
+ async (auditor) => {
271
+ const responseBuilder = new ResponseBuilder();
272
+ const response = await this.endpoint.handler(
273
+ {
274
+ header: event.header,
275
+ cookie: event.cookie,
276
+ logger: event.logger,
277
+ services: event.services,
278
+ session: event.session,
279
+ auditor,
280
+ ...input,
281
+ } as any,
282
+ responseBuilder,
283
+ );
284
+
285
+ // Check if response has metadata
286
+ let data = response;
287
+ let metadata = responseBuilder.getMetadata();
288
+
289
+ if (Endpoint.hasMetadata(response)) {
290
+ data = response.data;
291
+ metadata = response.metadata;
292
+ }
293
+
294
+ const output = this.endpoint.outputSchema
295
+ ? await this.endpoint.parseOutput(data)
296
+ : undefined;
297
+
298
+ return { output, metadata, responseBuilder };
299
+ },
300
+ // Process declarative audits after handler (inside transaction)
301
+ async (result, auditor) => {
302
+ if (!audits?.length) return;
303
+
304
+ for (const audit of audits) {
305
+ if (audit.when && !audit.when(result.output as any)) {
306
+ continue;
307
+ }
308
+ const payload = audit.payload(result.output as any);
309
+ const entityId = audit.entityId?.(result.output as any);
310
+ auditor.audit(audit.type as any, payload as any, {
311
+ table: audit.table,
312
+ entityId,
313
+ });
314
+ }
315
+ },
316
+ );
249
317
 
318
+ const { output, metadata } = result;
250
319
  const body = output !== undefined ? JSON.stringify(output) : undefined;
251
320
 
252
321
  // Store response for middleware access
@@ -1,19 +1,10 @@
1
- import type { Logger } from '@geekmidas/logger';
2
- import type { StandardSchemaV1 } from '@standard-schema/spec';
3
- import pick from 'lodash.pick';
4
- import set from 'lodash.set';
5
- import type { OpenAPIV3_1 } from 'openapi-types';
6
-
7
- import type { Service, ServiceRecord } from '@geekmidas/services';
8
- import type { Authorizer } from './Authorizer';
9
- import { ConstructType } from '../Construct';
10
- import { Function, type FunctionHandler } from '../functions';
11
-
1
+ import type { AuditableAction, Auditor, AuditStorage } from '@geekmidas/audit';
12
2
  import type {
13
3
  EventPublisher,
14
4
  ExtractPublisherMessage,
15
5
  MappedEvent,
16
6
  } from '@geekmidas/events';
7
+ import type { Logger } from '@geekmidas/logger';
17
8
  import type { RateLimitConfig } from '@geekmidas/rate-limit';
18
9
  import type {
19
10
  InferComposableStandardSchema,
@@ -28,7 +19,16 @@ import {
28
19
  type OpenApiSchemaOptions,
29
20
  buildOpenApiSchema,
30
21
  } from '@geekmidas/schema/openapi';
22
+ import type { Service, ServiceRecord } from '@geekmidas/services';
23
+ import type { StandardSchemaV1 } from '@standard-schema/spec';
24
+ import pick from 'lodash.pick';
25
+ import set from 'lodash.set';
26
+ import type { OpenAPIV3_1 } from 'openapi-types';
27
+ import { ConstructType } from '../Construct';
28
+ import { Function, type FunctionHandler } from '../functions';
31
29
  import type { HttpMethod, LowerHttpMethod, RemoveUndefined } from '../types';
30
+ import type { ActorExtractor, MappedAudit } from './audit';
31
+ import type { Authorizer } from './Authorizer';
32
32
 
33
33
  /**
34
34
  * Represents an HTTP endpoint that can handle requests with type-safe input/output validation,
@@ -65,6 +65,12 @@ export class Endpoint<
65
65
  TSession = unknown,
66
66
  TEventPublisher extends EventPublisher<any> | undefined = undefined,
67
67
  TEventPublisherServiceName extends string = string,
68
+ TAuditStorage extends AuditStorage | undefined = undefined,
69
+ TAuditStorageServiceName extends string = string,
70
+ TAuditAction extends AuditableAction<string, unknown> = AuditableAction<
71
+ string,
72
+ unknown
73
+ >,
68
74
  > extends Function<
69
75
  TInput,
70
76
  TServices,
@@ -72,7 +78,9 @@ export class Endpoint<
72
78
  OutSchema,
73
79
  FunctionHandler<TInput, TServices, TLogger, OutSchema>,
74
80
  TEventPublisher,
75
- TEventPublisherServiceName
81
+ TEventPublisherServiceName,
82
+ TAuditStorage,
83
+ TAuditStorageServiceName
76
84
  > {
77
85
  operationId?: string;
78
86
  /** The route path pattern with parameter placeholders */
@@ -96,6 +104,10 @@ export class Endpoint<
96
104
  public rateLimit?: RateLimitConfig;
97
105
  /** Optional authorizer for this endpoint */
98
106
  public authorizer?: Authorizer;
107
+ /** Optional actor extractor for audit records */
108
+ public actorExtractor?: ActorExtractor<TServices, TSession, TLogger>;
109
+ /** Declarative audit definitions */
110
+ public audits: MappedAudit<TAuditAction, OutSchema>[] = [];
99
111
  /** The endpoint handler function */
100
112
  private endpointFn!: EndpointHandler<
101
113
  TInput,
@@ -335,6 +347,7 @@ export class Endpoint<
335
347
  header: ctx.header,
336
348
  cookie: ctx.cookie,
337
349
  session: ctx.session,
350
+ auditor: ctx.auditor,
338
351
  } as EndpointContext<TInput, TServices, TLogger, TSession>,
339
352
  response,
340
353
  );
@@ -540,6 +553,9 @@ export class Endpoint<
540
553
  publisherService,
541
554
  events,
542
555
  authorizer,
556
+ auditorStorageService,
557
+ actorExtractor,
558
+ audits,
543
559
  }: EndpointOptions<
544
560
  TRoute,
545
561
  TMethod,
@@ -550,7 +566,10 @@ export class Endpoint<
550
566
  TSession,
551
567
  OutSchema,
552
568
  TEventPublisher,
553
- TEventPublisherServiceName
569
+ TEventPublisherServiceName,
570
+ TAuditStorage,
571
+ TAuditStorageServiceName,
572
+ TAuditAction
554
573
  >) {
555
574
  super(
556
575
  fn as unknown as FunctionHandler<TInput, TServices, TLogger, OutSchema>,
@@ -563,6 +582,7 @@ export class Endpoint<
563
582
  publisherService,
564
583
  events,
565
584
  memorySize,
585
+ auditorStorageService,
566
586
  );
567
587
 
568
588
  this.route = route;
@@ -587,6 +607,14 @@ export class Endpoint<
587
607
  if (authorizer) {
588
608
  this.authorizer = authorizer;
589
609
  }
610
+
611
+ if (actorExtractor) {
612
+ this.actorExtractor = actorExtractor;
613
+ }
614
+
615
+ if (audits) {
616
+ this.audits = audits;
617
+ }
590
618
  }
591
619
  }
592
620
 
@@ -638,6 +666,12 @@ export interface EndpointOptions<
638
666
  OutSchema extends StandardSchemaV1 | undefined = undefined,
639
667
  TEventPublisher extends EventPublisher<any> | undefined = undefined,
640
668
  TEventPublisherServiceName extends string = string,
669
+ TAuditStorage extends AuditStorage | undefined = undefined,
670
+ TAuditStorageServiceName extends string = string,
671
+ TAuditAction extends AuditableAction<string, unknown> = AuditableAction<
672
+ string,
673
+ unknown
674
+ >,
641
675
  > {
642
676
  /** The route path with parameter placeholders */
643
677
  route: TRoute;
@@ -677,6 +711,14 @@ export interface EndpointOptions<
677
711
  events?: MappedEvent<TEventPublisher, OutSchema>[];
678
712
  /** Optional authorizer configuration */
679
713
  authorizer?: Authorizer;
714
+ /**
715
+ * Auditor storage service for persisting audit records from this endpoint
716
+ */
717
+ auditorStorageService?: Service<TAuditStorageServiceName, TAuditStorage>;
718
+ /** Optional actor extractor function for audit records */
719
+ actorExtractor?: ActorExtractor<TServices, TSession, TLogger>;
720
+ /** Declarative audit definitions */
721
+ audits?: MappedAudit<TAuditAction, OutSchema>[];
680
722
  }
681
723
 
682
724
  /**
@@ -940,6 +982,10 @@ export type EndpointContext<
940
982
  TServices extends Service[] = [],
941
983
  TLogger extends Logger = Logger,
942
984
  TSession = unknown,
985
+ TAuditAction extends AuditableAction<string, unknown> = AuditableAction<
986
+ string,
987
+ unknown
988
+ >,
943
989
  > = {
944
990
  /** Injected service instances */
945
991
  services: ServiceRecord<TServices>;
@@ -951,6 +997,13 @@ export type EndpointContext<
951
997
  cookie: CookieFn;
952
998
  /** Session data extracted by getSession */
953
999
  session: TSession;
1000
+ /**
1001
+ * Auditor instance for recording audit events.
1002
+ * Only present when audit storage is configured on the endpoint.
1003
+ * When a transactional database is used for audit storage,
1004
+ * the auditor is pre-configured with the transaction context.
1005
+ */
1006
+ auditor?: Auditor<TAuditAction>;
954
1007
  } & InferComposableStandardSchema<Input>;
955
1008
 
956
1009
  /**