@geekmidas/constructs 1.0.4 → 1.1.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 (242) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{AWSLambdaFunction-CDJX0Tr1.d.mts → AWSLambdaFunction-BF1gJJjG.d.mts} +3 -3
  3. package/dist/{AWSLambdaFunction-CDJX0Tr1.d.mts.map → AWSLambdaFunction-BF1gJJjG.d.mts.map} +1 -1
  4. package/dist/{AWSLambdaSubscriberAdaptor-Soie57uM.cjs → AWSLambdaSubscriberAdaptor-BtBKExsh.cjs} +38 -35
  5. package/dist/AWSLambdaSubscriberAdaptor-BtBKExsh.cjs.map +1 -0
  6. package/dist/{AWSLambdaSubscriberAdaptor-BfEGolJA.d.cts → AWSLambdaSubscriberAdaptor-Cj1wjkUP.d.cts} +3 -2
  7. package/dist/{AWSLambdaSubscriberAdaptor-BfEGolJA.d.cts.map → AWSLambdaSubscriberAdaptor-Cj1wjkUP.d.cts.map} +1 -1
  8. package/dist/{AWSLambdaSubscriberAdaptor-BUvb-v_n.mjs → AWSLambdaSubscriberAdaptor-DsRmmGm1.mjs} +38 -35
  9. package/dist/AWSLambdaSubscriberAdaptor-DsRmmGm1.mjs.map +1 -0
  10. package/dist/{AWSLambdaSubscriberAdaptor-Pb7Jof-i.d.mts → AWSLambdaSubscriberAdaptor-OQvj2lKI.d.mts} +4 -3
  11. package/dist/{AWSLambdaSubscriberAdaptor-Pb7Jof-i.d.mts.map → AWSLambdaSubscriberAdaptor-OQvj2lKI.d.mts.map} +1 -1
  12. package/dist/{AmazonApiGatewayEndpointAdaptor-DRG4hu-k.d.mts → AmazonApiGatewayEndpointAdaptor-CQSZArI6.d.mts} +4 -4
  13. package/dist/{AmazonApiGatewayEndpointAdaptor-DRG4hu-k.d.mts.map → AmazonApiGatewayEndpointAdaptor-CQSZArI6.d.mts.map} +1 -1
  14. package/dist/{AmazonApiGatewayV1EndpointAdaptor-Bj9BDhNM.d.mts → AmazonApiGatewayV1EndpointAdaptor-xTrFYt48.d.mts} +4 -4
  15. package/dist/{AmazonApiGatewayV1EndpointAdaptor-Bj9BDhNM.d.mts.map → AmazonApiGatewayV1EndpointAdaptor-xTrFYt48.d.mts.map} +1 -1
  16. package/dist/{AmazonApiGatewayV2EndpointAdaptor-C0199fdk.d.mts → AmazonApiGatewayV2EndpointAdaptor-BBayh2_k.d.mts} +4 -4
  17. package/dist/{AmazonApiGatewayV2EndpointAdaptor-C0199fdk.d.mts.map → AmazonApiGatewayV2EndpointAdaptor-BBayh2_k.d.mts.map} +1 -1
  18. package/dist/{Authorizer-BgjU8-z6.mjs → Authorizer-4unKN3Xn.mjs} +1 -1
  19. package/dist/{Authorizer-BgjU8-z6.mjs.map → Authorizer-4unKN3Xn.mjs.map} +1 -1
  20. package/dist/{Authorizer-DCcYOx3h.d.mts → Authorizer-DBsrDTuf.d.mts} +1 -1
  21. package/dist/{Authorizer-DCcYOx3h.d.mts.map → Authorizer-DBsrDTuf.d.mts.map} +1 -1
  22. package/dist/{Authorizer-BXxBee2P.cjs → Authorizer-Dx57psuM.cjs} +1 -1
  23. package/dist/{Authorizer-BXxBee2P.cjs.map → Authorizer-Dx57psuM.cjs.map} +1 -1
  24. package/dist/{BaseFunctionBuilder-JpN2FtB4.d.mts → BaseFunctionBuilder-CsvFjzA8.d.mts} +2 -2
  25. package/dist/{BaseFunctionBuilder-JpN2FtB4.d.mts.map → BaseFunctionBuilder-CsvFjzA8.d.mts.map} +1 -1
  26. package/dist/{Construct-DvXCkLOP.d.mts → Construct-C2SyofdS.d.mts} +1 -1
  27. package/dist/{Construct-DvXCkLOP.d.mts.map → Construct-C2SyofdS.d.mts.map} +1 -1
  28. package/dist/Construct.d.mts +1 -1
  29. package/dist/{Cron-D5NpDp6y.mjs → Cron-B3vrGuaD.mjs} +1 -1
  30. package/dist/{Cron-D5NpDp6y.mjs.map → Cron-B3vrGuaD.mjs.map} +1 -1
  31. package/dist/{Cron-BJWjEj3U.d.cts → Cron-BDxW6fYg.d.cts} +1 -1
  32. package/dist/{Cron-BJWjEj3U.d.cts.map → Cron-BDxW6fYg.d.cts.map} +1 -1
  33. package/dist/{Cron-BjNvt_Wj.d.mts → Cron-CWxjO2Fg.d.mts} +2 -2
  34. package/dist/{Cron-BjNvt_Wj.d.mts.map → Cron-CWxjO2Fg.d.mts.map} +1 -1
  35. package/dist/{Cron-BV6weqem.cjs → Cron-DEKZg5j4.cjs} +1 -1
  36. package/dist/{Cron-BV6weqem.cjs.map → Cron-DEKZg5j4.cjs.map} +1 -1
  37. package/dist/{CronBuilder-DzPkDCiP.cjs → CronBuilder-BHpY6w3b.cjs} +2 -2
  38. package/dist/{CronBuilder-DzPkDCiP.cjs.map → CronBuilder-BHpY6w3b.cjs.map} +1 -1
  39. package/dist/{CronBuilder-CmPYae1S.d.cts → CronBuilder-CginrW3H.d.cts} +2 -2
  40. package/dist/{CronBuilder-CmPYae1S.d.cts.map → CronBuilder-CginrW3H.d.cts.map} +1 -1
  41. package/dist/{CronBuilder-X4au0zTu.d.mts → CronBuilder-DJnXbDGK.d.mts} +4 -4
  42. package/dist/{CronBuilder-X4au0zTu.d.mts.map → CronBuilder-DJnXbDGK.d.mts.map} +1 -1
  43. package/dist/{CronBuilder-p1Ro6a0n.mjs → CronBuilder-VXpyNfp2.mjs} +2 -2
  44. package/dist/{CronBuilder-p1Ro6a0n.mjs.map → CronBuilder-VXpyNfp2.mjs.map} +1 -1
  45. package/dist/{Endpoint-DU20A9E8.d.mts → Endpoint-BiPM0glm.d.mts} +4 -4
  46. package/dist/{Endpoint-DU20A9E8.d.mts.map → Endpoint-BiPM0glm.d.mts.map} +1 -1
  47. package/dist/{EndpointBuilder-CuVlda7g.d.mts → EndpointBuilder-B0Aj5jbB.d.mts} +5 -5
  48. package/dist/{EndpointBuilder-CuVlda7g.d.mts.map → EndpointBuilder-B0Aj5jbB.d.mts.map} +1 -1
  49. package/dist/{EndpointBuilder-BfzI6Rpc.d.cts → EndpointBuilder-Bel6RS7W.d.cts} +1 -1
  50. package/dist/{EndpointBuilder-BfzI6Rpc.d.cts.map → EndpointBuilder-Bel6RS7W.d.cts.map} +1 -1
  51. package/dist/{EndpointBuilder-CF-ZWtdu.mjs → EndpointBuilder-D1RtrBu1.mjs} +3 -3
  52. package/dist/{EndpointBuilder-CF-ZWtdu.mjs.map → EndpointBuilder-D1RtrBu1.mjs.map} +1 -1
  53. package/dist/{EndpointBuilder-CyszO0bs.cjs → EndpointBuilder-fXmTxRyW.cjs} +3 -3
  54. package/dist/{EndpointBuilder-CyszO0bs.cjs.map → EndpointBuilder-fXmTxRyW.cjs.map} +1 -1
  55. package/dist/{EndpointFactory-Bj7vHtT6.d.mts → EndpointFactory-CWIeWCRG.d.mts} +7 -7
  56. package/dist/EndpointFactory-CWIeWCRG.d.mts.map +1 -0
  57. package/dist/{EndpointFactory-C1miOYUW.d.cts → EndpointFactory-CXvakOkn.d.cts} +5 -5
  58. package/dist/EndpointFactory-CXvakOkn.d.cts.map +1 -0
  59. package/dist/{EndpointFactory-B6fUZPhx.cjs → EndpointFactory-DBfTbSTX.cjs} +6 -6
  60. package/dist/EndpointFactory-DBfTbSTX.cjs.map +1 -0
  61. package/dist/{EndpointFactory-CyM-gSew.mjs → EndpointFactory-DkB8yxdQ.mjs} +6 -6
  62. package/dist/EndpointFactory-DkB8yxdQ.mjs.map +1 -0
  63. package/dist/{Function-DEX2O-SB.d.mts → Function-CZw1DRQ6.d.mts} +2 -2
  64. package/dist/{Function-DEX2O-SB.d.mts.map → Function-CZw1DRQ6.d.mts.map} +1 -1
  65. package/dist/{FunctionBuilder-DRw1s5uT.d.mts → FunctionBuilder-m5BNA2Ap.d.mts} +4 -4
  66. package/dist/{FunctionBuilder-DRw1s5uT.d.mts.map → FunctionBuilder-m5BNA2Ap.d.mts.map} +1 -1
  67. package/dist/{FunctionExecutionWrapper-D2kbmPJG.d.mts → FunctionExecutionWrapper-C7yYXIq-.d.mts} +2 -2
  68. package/dist/{FunctionExecutionWrapper-D2kbmPJG.d.mts.map → FunctionExecutionWrapper-C7yYXIq-.d.mts.map} +1 -1
  69. package/dist/{HonoEndpointAdaptor-C7BBBYuU.d.mts → HonoEndpointAdaptor-C3AdQ0xS.d.mts} +5 -5
  70. package/dist/{HonoEndpointAdaptor-C7BBBYuU.d.mts.map → HonoEndpointAdaptor-C3AdQ0xS.d.mts.map} +1 -1
  71. package/dist/{Subscriber-DKQK5gLD.mjs → Subscriber-BEhOdNQi.mjs} +1 -1
  72. package/dist/{Subscriber-DKQK5gLD.mjs.map → Subscriber-BEhOdNQi.mjs.map} +1 -1
  73. package/dist/{Subscriber-DCgMSkQA.d.mts → Subscriber-BgB3RRxb.d.mts} +2 -2
  74. package/dist/{Subscriber-DCgMSkQA.d.mts.map → Subscriber-BgB3RRxb.d.mts.map} +1 -1
  75. package/dist/{Subscriber-ClqSPbIZ.cjs → Subscriber-Scz7hrV6.cjs} +1 -1
  76. package/dist/{Subscriber-ClqSPbIZ.cjs.map → Subscriber-Scz7hrV6.cjs.map} +1 -1
  77. package/dist/{SubscriberBuilder-BS5B_688.cjs → SubscriberBuilder-B82h4v-S.cjs} +2 -2
  78. package/dist/{SubscriberBuilder-BS5B_688.cjs.map → SubscriberBuilder-B82h4v-S.cjs.map} +1 -1
  79. package/dist/{SubscriberBuilder-UIwW_wIY.d.cts → SubscriberBuilder-B9uva8fZ.d.cts} +1 -1
  80. package/dist/{SubscriberBuilder-BcyK44e_.d.mts.map → SubscriberBuilder-B9uva8fZ.d.cts.map} +1 -1
  81. package/dist/{SubscriberBuilder-BcyK44e_.d.mts → SubscriberBuilder-DaQkh2Nt.d.mts} +2 -2
  82. package/dist/{SubscriberBuilder-UIwW_wIY.d.cts.map → SubscriberBuilder-DaQkh2Nt.d.mts.map} +1 -1
  83. package/dist/{SubscriberBuilder-BswTuvUc.mjs → SubscriberBuilder-DlUaG0Ej.mjs} +2 -2
  84. package/dist/{SubscriberBuilder-BswTuvUc.mjs.map → SubscriberBuilder-DlUaG0Ej.mjs.map} +1 -1
  85. package/dist/{TestEndpointAdaptor-oWNADEl4.d.mts → TestEndpointAdaptor-qSWV8dpS.d.mts} +3 -3
  86. package/dist/{TestEndpointAdaptor-oWNADEl4.d.mts.map → TestEndpointAdaptor-qSWV8dpS.d.mts.map} +1 -1
  87. package/dist/TestFunctionAdaptor-BHk2bDOV.d.cts +30 -0
  88. package/dist/TestFunctionAdaptor-BHk2bDOV.d.cts.map +1 -0
  89. package/dist/TestFunctionAdaptor-CK-dbKpO.mjs +67 -0
  90. package/dist/TestFunctionAdaptor-CK-dbKpO.mjs.map +1 -0
  91. package/dist/TestFunctionAdaptor-CSMX7myB.cjs +73 -0
  92. package/dist/TestFunctionAdaptor-CSMX7myB.cjs.map +1 -0
  93. package/dist/TestFunctionAdaptor-DzT8GRdR.d.mts +30 -0
  94. package/dist/TestFunctionAdaptor-DzT8GRdR.d.mts.map +1 -0
  95. package/dist/TestSubscriberAdaptor-1m-2bM_j.cjs +49 -0
  96. package/dist/TestSubscriberAdaptor-1m-2bM_j.cjs.map +1 -0
  97. package/dist/TestSubscriberAdaptor-CPEiqSfE.d.mts +26 -0
  98. package/dist/TestSubscriberAdaptor-CPEiqSfE.d.mts.map +1 -0
  99. package/dist/TestSubscriberAdaptor-CrqLkyUE.mjs +43 -0
  100. package/dist/TestSubscriberAdaptor-CrqLkyUE.mjs.map +1 -0
  101. package/dist/TestSubscriberAdaptor-DQk5xzb0.d.cts +26 -0
  102. package/dist/TestSubscriberAdaptor-DQk5xzb0.d.cts.map +1 -0
  103. package/dist/adaptors/aws.cjs +1 -1
  104. package/dist/adaptors/aws.d.cts +2 -2
  105. package/dist/adaptors/aws.d.mts +16 -16
  106. package/dist/adaptors/aws.mjs +1 -1
  107. package/dist/adaptors/hono.d.cts +1 -1
  108. package/dist/adaptors/hono.d.mts +9 -9
  109. package/dist/adaptors/testing.cjs +5 -1
  110. package/dist/adaptors/testing.d.cts +5 -2
  111. package/dist/adaptors/testing.d.mts +13 -10
  112. package/dist/adaptors/testing.mjs +3 -1
  113. package/dist/crons/Cron.cjs +1 -1
  114. package/dist/crons/Cron.d.cts +2 -2
  115. package/dist/crons/Cron.d.mts +6 -6
  116. package/dist/crons/Cron.mjs +1 -1
  117. package/dist/crons/CronBuilder.cjs +2 -2
  118. package/dist/crons/CronBuilder.d.cts +3 -3
  119. package/dist/crons/CronBuilder.d.mts +7 -7
  120. package/dist/crons/CronBuilder.mjs +2 -2
  121. package/dist/crons/index.cjs +2 -2
  122. package/dist/crons/index.d.cts +3 -3
  123. package/dist/crons/index.d.mts +7 -7
  124. package/dist/crons/index.mjs +2 -2
  125. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +1 -1
  126. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.mts +10 -10
  127. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +1 -1
  128. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.mts +11 -11
  129. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +1 -1
  130. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.mts +11 -11
  131. package/dist/endpoints/Authorizer.cjs +1 -1
  132. package/dist/endpoints/Authorizer.d.mts +1 -1
  133. package/dist/endpoints/Authorizer.mjs +1 -1
  134. package/dist/endpoints/Endpoint.d.cts +1 -1
  135. package/dist/endpoints/Endpoint.d.mts +8 -8
  136. package/dist/endpoints/EndpointBuilder.cjs +3 -3
  137. package/dist/endpoints/EndpointBuilder.d.cts +2 -2
  138. package/dist/endpoints/EndpointBuilder.d.mts +9 -9
  139. package/dist/endpoints/EndpointBuilder.mjs +3 -3
  140. package/dist/endpoints/EndpointFactory.cjs +4 -4
  141. package/dist/endpoints/EndpointFactory.d.cts +3 -3
  142. package/dist/endpoints/EndpointFactory.d.mts +10 -10
  143. package/dist/endpoints/EndpointFactory.mjs +4 -4
  144. package/dist/endpoints/HonoEndpointAdaptor.d.cts +1 -1
  145. package/dist/endpoints/HonoEndpointAdaptor.d.mts +9 -9
  146. package/dist/endpoints/TestEndpointAdaptor.d.cts +1 -1
  147. package/dist/endpoints/TestEndpointAdaptor.d.mts +9 -9
  148. package/dist/endpoints/audit.d.cts +1 -1
  149. package/dist/endpoints/audit.d.mts +8 -8
  150. package/dist/endpoints/helpers.d.cts +1 -1
  151. package/dist/endpoints/helpers.d.mts +8 -8
  152. package/dist/endpoints/index.cjs +4 -4
  153. package/dist/endpoints/index.d.cts +7 -7
  154. package/dist/endpoints/index.d.mts +14 -14
  155. package/dist/endpoints/index.mjs +4 -4
  156. package/dist/endpoints/lazyAccessors.d.cts +2 -2
  157. package/dist/endpoints/lazyAccessors.d.mts +9 -9
  158. package/dist/endpoints/processAudits.d.cts +1 -1
  159. package/dist/endpoints/processAudits.d.mts +8 -8
  160. package/dist/endpoints/rls.cjs +1 -1
  161. package/dist/endpoints/rls.d.cts +1 -1
  162. package/dist/endpoints/rls.d.mts +8 -8
  163. package/dist/endpoints/rls.mjs +1 -1
  164. package/dist/functions/AWSLambdaFunction.d.mts +4 -4
  165. package/dist/functions/BaseFunctionBuilder.d.mts +2 -2
  166. package/dist/functions/Function.d.mts +2 -2
  167. package/dist/functions/FunctionBuilder.d.mts +4 -4
  168. package/dist/functions/FunctionExecutionWrapper.d.mts +3 -3
  169. package/dist/functions/TestFunctionAdaptor.cjs +4 -67
  170. package/dist/functions/TestFunctionAdaptor.d.cts +3 -30
  171. package/dist/functions/TestFunctionAdaptor.d.mts +4 -31
  172. package/dist/functions/TestFunctionAdaptor.mjs +4 -66
  173. package/dist/functions/index.d.cts +1 -1
  174. package/dist/functions/index.d.mts +5 -5
  175. package/dist/index-BfeupgMl.d.cts +12 -0
  176. package/dist/{index-BRZODuxf.d.mts.map → index-BfeupgMl.d.cts.map} +1 -1
  177. package/dist/index-DQo_Csy7.d.mts +12 -0
  178. package/dist/{index-BnoOaBQV.d.cts.map → index-DQo_Csy7.d.mts.map} +1 -1
  179. package/dist/index.d.mts +3 -3
  180. package/dist/{lazyAccessors-D1tbdxUk.d.mts → lazyAccessors-DXkJpnyX.d.mts} +2 -2
  181. package/dist/{lazyAccessors-D1tbdxUk.d.mts.map → lazyAccessors-DXkJpnyX.d.mts.map} +1 -1
  182. package/dist/{lazyAccessors-ZRbwOONj.d.cts → lazyAccessors-DdZaA716.d.cts} +1 -1
  183. package/dist/{lazyAccessors-ZRbwOONj.d.cts.map → lazyAccessors-DdZaA716.d.cts.map} +1 -1
  184. package/dist/{publisher-DdPDps5m.d.cts → publisher-BrzPGnm4.d.cts} +1 -1
  185. package/dist/{publisher-BeouS9lG.d.mts.map → publisher-BrzPGnm4.d.cts.map} +1 -1
  186. package/dist/{publisher-BeouS9lG.d.mts → publisher-CP4gpv-4.d.mts} +2 -2
  187. package/dist/{publisher-DdPDps5m.d.cts.map → publisher-CP4gpv-4.d.mts.map} +1 -1
  188. package/dist/publisher.d.cts +1 -1
  189. package/dist/publisher.d.mts +2 -2
  190. package/dist/{rls-C0cWOnk4.mjs → rls-7XXX7DvY.mjs} +1 -1
  191. package/dist/{rls-C0cWOnk4.mjs.map → rls-7XXX7DvY.mjs.map} +1 -1
  192. package/dist/{rls-BrywnrQb.cjs → rls-DxFqdIA0.cjs} +1 -1
  193. package/dist/{rls-BrywnrQb.cjs.map → rls-DxFqdIA0.cjs.map} +1 -1
  194. package/dist/subscribers/AWSLambdaSubscriberAdaptor.cjs +1 -1
  195. package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.cts +1 -1
  196. package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.mts +3 -3
  197. package/dist/subscribers/AWSLambdaSubscriberAdaptor.mjs +1 -1
  198. package/dist/subscribers/Subscriber.cjs +1 -1
  199. package/dist/subscribers/Subscriber.d.mts +2 -2
  200. package/dist/subscribers/Subscriber.mjs +1 -1
  201. package/dist/subscribers/SubscriberBuilder.cjs +2 -2
  202. package/dist/subscribers/SubscriberBuilder.d.cts +1 -1
  203. package/dist/subscribers/SubscriberBuilder.d.mts +3 -3
  204. package/dist/subscribers/SubscriberBuilder.mjs +2 -2
  205. package/dist/subscribers/TestSubscriberAdaptor.cjs +4 -0
  206. package/dist/subscribers/TestSubscriberAdaptor.d.cts +4 -0
  207. package/dist/subscribers/TestSubscriberAdaptor.d.mts +4 -0
  208. package/dist/subscribers/TestSubscriberAdaptor.mjs +4 -0
  209. package/dist/subscribers/index.cjs +5 -2
  210. package/dist/subscribers/index.cjs.map +1 -1
  211. package/dist/subscribers/index.d.cts +3 -2
  212. package/dist/subscribers/index.d.cts.map +1 -1
  213. package/dist/subscribers/index.d.mts +5 -4
  214. package/dist/subscribers/index.d.mts.map +1 -1
  215. package/dist/subscribers/index.mjs +5 -3
  216. package/dist/subscribers/index.mjs.map +1 -1
  217. package/dist/{telemetry-yAHf5yDs.d.mts → telemetry-C-kNOW3C.d.mts} +1 -1
  218. package/dist/{telemetry-yAHf5yDs.d.mts.map → telemetry-C-kNOW3C.d.mts.map} +1 -1
  219. package/dist/telemetry.d.mts +1 -1
  220. package/dist/{types-Dw-iLd3Y.d.mts → types-aFmq5cKh.d.mts} +1 -1
  221. package/dist/{types-Dw-iLd3Y.d.mts.map → types-aFmq5cKh.d.mts.map} +1 -1
  222. package/dist/types.d.mts +1 -1
  223. package/package.json +10 -10
  224. package/src/adaptors/testing.ts +2 -0
  225. package/src/endpoints/EndpointFactory.ts +15 -12
  226. package/src/subscribers/AWSLambdaSubscriberAdaptor.ts +61 -37
  227. package/src/subscribers/TestSubscriberAdaptor.ts +127 -0
  228. package/src/subscribers/__tests__/AWSLambdaSubscriberAdaptor.spec.ts +239 -27
  229. package/src/subscribers/__tests__/TestSubscriberAdaptor.spec.ts +558 -0
  230. package/src/subscribers/index.ts +1 -0
  231. package/dist/AWSLambdaSubscriberAdaptor-BUvb-v_n.mjs.map +0 -1
  232. package/dist/AWSLambdaSubscriberAdaptor-Soie57uM.cjs.map +0 -1
  233. package/dist/EndpointFactory-B6fUZPhx.cjs.map +0 -1
  234. package/dist/EndpointFactory-Bj7vHtT6.d.mts.map +0 -1
  235. package/dist/EndpointFactory-C1miOYUW.d.cts.map +0 -1
  236. package/dist/EndpointFactory-CyM-gSew.mjs.map +0 -1
  237. package/dist/functions/TestFunctionAdaptor.cjs.map +0 -1
  238. package/dist/functions/TestFunctionAdaptor.d.cts.map +0 -1
  239. package/dist/functions/TestFunctionAdaptor.d.mts.map +0 -1
  240. package/dist/functions/TestFunctionAdaptor.mjs.map +0 -1
  241. package/dist/index-BRZODuxf.d.mts +0 -12
  242. package/dist/index-BnoOaBQV.d.cts +0 -12
@@ -662,41 +662,260 @@ describe('AWSLambdaSubscriber', () => {
662
662
  );
663
663
  });
664
664
 
665
- it('should log errors for invalid SQS records', async () => {
666
- const childLogger = {
667
- info: vi.fn(),
668
- error: vi.fn(),
669
- warn: vi.fn(),
670
- debug: vi.fn(),
671
- child: vi.fn(),
665
+ it('should wrap non-JSON SNS message with type from MessageAttributes in SQS', async () => {
666
+ const handler = vi.fn(async ({ events }) => {
667
+ expect(events).toHaveLength(1);
668
+ expect(events[0]).toEqual({
669
+ type: 'notification.sent',
670
+ payload: 'this is not json',
671
+ });
672
+ });
673
+
674
+ const subscriber = new Subscriber(
675
+ handler,
676
+ 30000,
677
+ undefined,
678
+ undefined,
679
+ [],
680
+ logger,
681
+ );
682
+
683
+ const adapter = new AWSLambdaSubscriber(envParser, subscriber);
684
+ const lambdaHandler = adapter.handler;
685
+
686
+ const sqsEvent: SQSEvent = {
687
+ Records: [
688
+ {
689
+ messageId: 'message-1',
690
+ receiptHandle: 'receipt-1',
691
+ body: JSON.stringify({
692
+ Type: 'Notification',
693
+ MessageId: 'sns-msg-1',
694
+ TopicArn: 'arn:aws:sns:region:account:topic',
695
+ Message: 'this is not json',
696
+ Timestamp: '2023-01-01T00:00:00.000Z',
697
+ MessageAttributes: {
698
+ type: { Type: 'String', Value: 'notification.sent' },
699
+ },
700
+ }),
701
+ attributes: {} as any,
702
+ messageAttributes: {},
703
+ md5OfBody: 'md5',
704
+ eventSource: 'aws:sqs',
705
+ eventSourceARN: 'arn:aws:sqs:region:account:queue-name',
706
+ awsRegion: 'us-east-1',
707
+ } as SQSRecord,
708
+ ],
672
709
  };
673
710
 
674
- const mockLogger = {
675
- child: vi.fn().mockReturnValue(childLogger),
676
- info: vi.fn(),
677
- error: vi.fn(),
678
- warn: vi.fn(),
679
- debug: vi.fn(),
711
+ await lambdaHandler(sqsEvent, createMockContext(), vi.fn());
712
+
713
+ expect(handler).toHaveBeenCalled();
714
+ });
715
+
716
+ it('should pass through non-JSON SNS message without type as raw string', async () => {
717
+ const handler = vi.fn(async ({ events }) => {
718
+ expect(events).toHaveLength(1);
719
+ expect(events[0]).toBe('plain text without type');
720
+ });
721
+
722
+ const subscriber = new Subscriber(
723
+ handler,
724
+ 30000,
725
+ undefined,
726
+ undefined,
727
+ [],
728
+ logger,
729
+ );
730
+
731
+ const adapter = new AWSLambdaSubscriber(envParser, subscriber);
732
+ const lambdaHandler = adapter.handler;
733
+
734
+ const sqsEvent: SQSEvent = {
735
+ Records: [
736
+ {
737
+ messageId: 'message-1',
738
+ receiptHandle: 'receipt-1',
739
+ body: JSON.stringify({
740
+ Type: 'Notification',
741
+ MessageId: 'sns-msg-1',
742
+ TopicArn: 'arn:aws:sns:region:account:topic',
743
+ Message: 'plain text without type',
744
+ Timestamp: '2023-01-01T00:00:00.000Z',
745
+ }),
746
+ attributes: {} as any,
747
+ messageAttributes: {},
748
+ md5OfBody: 'md5',
749
+ eventSource: 'aws:sqs',
750
+ eventSourceARN: 'arn:aws:sqs:region:account:queue-name',
751
+ awsRegion: 'us-east-1',
752
+ } as SQSRecord,
753
+ ],
680
754
  };
681
755
 
756
+ await lambdaHandler(sqsEvent, createMockContext(), vi.fn());
757
+
758
+ expect(handler).toHaveBeenCalled();
759
+ });
760
+
761
+ it('should wrap non-JSON SNS record with type from MessageAttributes', async () => {
682
762
  const handler = vi.fn(async ({ events }) => {
683
- // Should still process valid events
684
763
  expect(events).toHaveLength(1);
764
+ expect(events[0]).toEqual({
765
+ type: 'alert.fired',
766
+ payload: 'plain text, not json',
767
+ });
685
768
  });
686
769
 
687
770
  const subscriber = new Subscriber(
688
771
  handler,
689
- 30000, // timeout
690
- undefined, // subscribedEvents
691
- undefined, // outputSchema
692
- [], // services
693
- mockLogger as any, // logger
772
+ 30000,
773
+ undefined,
774
+ undefined,
775
+ [],
776
+ logger,
777
+ );
778
+
779
+ const adapter = new AWSLambdaSubscriber(envParser, subscriber);
780
+ const lambdaHandler = adapter.handler;
781
+
782
+ const snsEvent: SNSEvent = {
783
+ Records: [
784
+ {
785
+ EventSource: 'aws:sns',
786
+ EventVersion: '1.0',
787
+ EventSubscriptionArn: 'arn:aws:sns:region:account:topic',
788
+ Sns: {
789
+ Type: 'Notification',
790
+ MessageId: 'msg-1',
791
+ TopicArn: 'arn:aws:sns:region:account:topic',
792
+ Subject: 'Test',
793
+ Message: 'plain text, not json',
794
+ Timestamp: '2023-01-01T00:00:00.000Z',
795
+ SignatureVersion: '1',
796
+ Signature: 'sig',
797
+ SigningCertUrl: 'https://example.com/cert',
798
+ UnsubscribeUrl: 'https://example.com/unsub',
799
+ MessageAttributes: {
800
+ type: { Type: 'String', Value: 'alert.fired' },
801
+ },
802
+ },
803
+ } as SNSEventRecord,
804
+ ],
805
+ };
806
+
807
+ await lambdaHandler(snsEvent, createMockContext(), vi.fn());
808
+
809
+ expect(handler).toHaveBeenCalled();
810
+ });
811
+
812
+ it('should pass through non-JSON SNS record without type as raw string', async () => {
813
+ const handler = vi.fn(async ({ events }) => {
814
+ expect(events).toHaveLength(1);
815
+ expect(events[0]).toBe('plain text, no type attr');
816
+ });
817
+
818
+ const subscriber = new Subscriber(
819
+ handler,
820
+ 30000,
821
+ undefined,
822
+ undefined,
823
+ [],
824
+ logger,
825
+ );
826
+
827
+ const adapter = new AWSLambdaSubscriber(envParser, subscriber);
828
+ const lambdaHandler = adapter.handler;
829
+
830
+ const snsEvent: SNSEvent = {
831
+ Records: [
832
+ {
833
+ EventSource: 'aws:sns',
834
+ EventVersion: '1.0',
835
+ EventSubscriptionArn: 'arn:aws:sns:region:account:topic',
836
+ Sns: {
837
+ Type: 'Notification',
838
+ MessageId: 'msg-1',
839
+ TopicArn: 'arn:aws:sns:region:account:topic',
840
+ Subject: 'Test',
841
+ Message: 'plain text, no type attr',
842
+ Timestamp: '2023-01-01T00:00:00.000Z',
843
+ SignatureVersion: '1',
844
+ Signature: 'sig',
845
+ SigningCertUrl: 'https://example.com/cert',
846
+ UnsubscribeUrl: 'https://example.com/unsub',
847
+ },
848
+ } as SNSEventRecord,
849
+ ],
850
+ };
851
+
852
+ await lambdaHandler(snsEvent, createMockContext(), vi.fn());
853
+
854
+ expect(handler).toHaveBeenCalled();
855
+ });
856
+
857
+ it('should pass through non-JSON SQS body', async () => {
858
+ const handler = vi.fn(async ({ events }) => {
859
+ expect(events).toHaveLength(1);
860
+ expect(events[0]).toBe('raw text body');
861
+ });
862
+
863
+ const subscriber = new Subscriber(
864
+ handler,
865
+ 30000,
866
+ undefined,
867
+ undefined,
868
+ [],
869
+ logger,
870
+ );
871
+
872
+ const adapter = new AWSLambdaSubscriber(envParser, subscriber);
873
+ const lambdaHandler = adapter.handler;
874
+
875
+ const sqsEvent: SQSEvent = {
876
+ Records: [
877
+ {
878
+ messageId: 'message-1',
879
+ receiptHandle: 'receipt-1',
880
+ body: 'raw text body',
881
+ attributes: {} as any,
882
+ messageAttributes: {},
883
+ md5OfBody: 'md5',
884
+ eventSource: 'aws:sqs',
885
+ eventSourceARN: 'arn:aws:sqs:region:account:queue-name',
886
+ awsRegion: 'us-east-1',
887
+ } as SQSRecord,
888
+ ],
889
+ };
890
+
891
+ await lambdaHandler(sqsEvent, createMockContext(), vi.fn());
892
+
893
+ expect(handler).toHaveBeenCalled();
894
+ });
895
+
896
+ it('should pass through invalid JSON SQS records alongside valid ones', async () => {
897
+ const handler = vi.fn(async ({ events }) => {
898
+ // Both records should be passed through
899
+ expect(events).toHaveLength(2);
900
+ expect(events[0]).toBe('invalid json{');
901
+ expect(events[1]).toEqual({
902
+ type: 'user.created',
903
+ payload: { userId: '1', email: 'user1@example.com' },
904
+ });
905
+ });
906
+
907
+ const subscriber = new Subscriber(
908
+ handler,
909
+ 30000,
910
+ undefined,
911
+ undefined,
912
+ [],
913
+ logger,
694
914
  );
695
915
 
696
916
  const adapter = new AWSLambdaSubscriber(envParser, subscriber);
697
917
  const lambdaHandler = adapter.handler;
698
918
 
699
- // Create event with one invalid record
700
919
  const sqsEvent: SQSEvent = {
701
920
  Records: [
702
921
  {
@@ -729,13 +948,6 @@ describe('AWSLambdaSubscriber', () => {
729
948
 
730
949
  await lambdaHandler(sqsEvent, createMockContext(), vi.fn());
731
950
 
732
- expect(childLogger.error).toHaveBeenCalledWith(
733
- expect.objectContaining({
734
- error: expect.any(Error),
735
- record: expect.any(Object),
736
- }),
737
- 'Failed to parse SQS record body',
738
- );
739
951
  expect(handler).toHaveBeenCalled();
740
952
  });
741
953
  });