@geekmidas/constructs 1.0.0 → 1.0.2

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 (77) hide show
  1. package/dist/{AWSLambdaSubscriberAdaptor-BD3FwGUb.mjs → AWSLambdaSubscriberAdaptor-BUvb-v_n.mjs} +29 -5
  2. package/dist/AWSLambdaSubscriberAdaptor-BUvb-v_n.mjs.map +1 -0
  3. package/dist/{AWSLambdaSubscriberAdaptor-Bat1CB6a.d.cts → AWSLambdaSubscriberAdaptor-BfEGolJA.d.cts} +2 -1
  4. package/dist/{AWSLambdaSubscriberAdaptor-DgSXzIUT.d.mts.map → AWSLambdaSubscriberAdaptor-BfEGolJA.d.cts.map} +1 -1
  5. package/dist/{AWSLambdaSubscriberAdaptor-DgSXzIUT.d.mts → AWSLambdaSubscriberAdaptor-Pb7Jof-i.d.mts} +2 -1
  6. package/dist/{AWSLambdaSubscriberAdaptor-Bat1CB6a.d.cts.map → AWSLambdaSubscriberAdaptor-Pb7Jof-i.d.mts.map} +1 -1
  7. package/dist/{AWSLambdaSubscriberAdaptor-DQDnt1Xk.cjs → AWSLambdaSubscriberAdaptor-Soie57uM.cjs} +29 -5
  8. package/dist/AWSLambdaSubscriberAdaptor-Soie57uM.cjs.map +1 -0
  9. package/dist/{HonoEndpointAdaptor-BbnZe3hb.d.mts → HonoEndpointAdaptor-Ay5UGPu0.d.mts} +3 -3
  10. package/dist/{HonoEndpointAdaptor-BNHGwpvZ.d.cts.map → HonoEndpointAdaptor-Ay5UGPu0.d.mts.map} +1 -1
  11. package/dist/{HonoEndpointAdaptor-BNHGwpvZ.d.cts → HonoEndpointAdaptor-o6QyDkdy.d.cts} +3 -3
  12. package/dist/{HonoEndpointAdaptor-BbnZe3hb.d.mts.map → HonoEndpointAdaptor-o6QyDkdy.d.cts.map} +1 -1
  13. package/dist/adaptors/aws.cjs +1 -1
  14. package/dist/adaptors/aws.d.cts +2 -2
  15. package/dist/adaptors/aws.d.mts +2 -2
  16. package/dist/adaptors/aws.mjs +1 -1
  17. package/dist/adaptors/hono.d.cts +2 -2
  18. package/dist/adaptors/hono.d.mts +2 -2
  19. package/dist/adaptors/testing.d.cts +1 -1
  20. package/dist/adaptors/testing.d.mts +1 -1
  21. package/dist/crons/Cron.d.cts +1 -1
  22. package/dist/crons/Cron.d.mts +1 -1
  23. package/dist/crons/CronBuilder.d.cts +1 -1
  24. package/dist/crons/CronBuilder.d.mts +1 -1
  25. package/dist/crons/index.d.cts +5 -5
  26. package/dist/crons/index.d.mts +5 -5
  27. package/dist/crons/index.d.mts.map +1 -1
  28. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +1 -1
  29. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.mts +1 -1
  30. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +1 -1
  31. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.mts +1 -1
  32. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +1 -1
  33. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.mts +1 -1
  34. package/dist/endpoints/Endpoint.d.cts +1 -1
  35. package/dist/endpoints/Endpoint.d.mts +1 -1
  36. package/dist/endpoints/EndpointBuilder.d.cts +1 -1
  37. package/dist/endpoints/EndpointBuilder.d.mts +1 -1
  38. package/dist/endpoints/EndpointFactory.d.cts +1 -1
  39. package/dist/endpoints/EndpointFactory.d.mts +1 -1
  40. package/dist/endpoints/HonoEndpointAdaptor.d.cts +2 -2
  41. package/dist/endpoints/HonoEndpointAdaptor.d.mts +2 -2
  42. package/dist/endpoints/TestEndpointAdaptor.d.cts +1 -1
  43. package/dist/endpoints/TestEndpointAdaptor.d.mts +1 -1
  44. package/dist/endpoints/audit.d.cts +1 -1
  45. package/dist/endpoints/audit.d.mts +1 -1
  46. package/dist/endpoints/helpers.d.cts +1 -1
  47. package/dist/endpoints/helpers.d.mts +1 -1
  48. package/dist/endpoints/index.d.cts +3 -3
  49. package/dist/endpoints/index.d.mts +3 -3
  50. package/dist/endpoints/lazyAccessors.d.cts +1 -1
  51. package/dist/endpoints/lazyAccessors.d.mts +1 -1
  52. package/dist/endpoints/processAudits.d.cts +1 -1
  53. package/dist/endpoints/processAudits.d.mts +1 -1
  54. package/dist/endpoints/rls.d.cts +1 -1
  55. package/dist/endpoints/rls.d.mts +1 -1
  56. package/dist/functions/index.d.cts +1 -1
  57. package/dist/functions/index.d.mts +1 -1
  58. package/dist/index-dRNH0dT6.d.cts +12 -0
  59. package/dist/{index-BRbGNZpa.d.cts.map → index-dRNH0dT6.d.cts.map} +1 -1
  60. package/dist/index-puUpr9Dh.d.mts +12 -0
  61. package/dist/{index-DHGtpWKA.d.mts.map → index-puUpr9Dh.d.mts.map} +1 -1
  62. package/dist/subscribers/AWSLambdaSubscriberAdaptor.cjs +1 -1
  63. package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.cts +1 -1
  64. package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.mts +1 -1
  65. package/dist/subscribers/AWSLambdaSubscriberAdaptor.mjs +1 -1
  66. package/dist/subscribers/index.d.cts +2 -2
  67. package/dist/subscribers/index.d.cts.map +1 -1
  68. package/dist/subscribers/index.d.mts +2 -2
  69. package/dist/subscribers/index.d.mts.map +1 -1
  70. package/package.json +4 -4
  71. package/src/subscribers/AWSLambdaSubscriberAdaptor.ts +40 -6
  72. package/src/subscribers/__tests__/AWSLambdaSubscriberAdaptor.spec.ts +120 -1
  73. package/tsconfig.tsbuildinfo +1 -0
  74. package/dist/AWSLambdaSubscriberAdaptor-BD3FwGUb.mjs.map +0 -1
  75. package/dist/AWSLambdaSubscriberAdaptor-DQDnt1Xk.cjs.map +0 -1
  76. package/dist/index-BRbGNZpa.d.cts +0 -12
  77. package/dist/index-DHGtpWKA.d.mts +0 -12
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import { EndpointBuilder } from "../EndpointBuilder-BfzI6Rpc.cjs";
@@ -3,7 +3,7 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import "../Authorizer-DCcYOx3h.mjs";
8
8
  import "../Endpoint-DU20A9E8.mjs";
9
9
  import { EndpointBuilder } from "../EndpointBuilder-CuVlda7g.mjs";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import { SecurityScheme } from "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import "../EndpointBuilder-BfzI6Rpc.cjs";
@@ -3,7 +3,7 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import { SecurityScheme } from "../Authorizer-DCcYOx3h.mjs";
8
8
  import "../Endpoint-DU20A9E8.mjs";
9
9
  import "../EndpointBuilder-CuVlda7g.mjs";
@@ -3,8 +3,8 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
- import { HonoEndpoint, HonoEndpointOptions } from "../HonoEndpointAdaptor-BNHGwpvZ.cjs";
9
+ import { HonoEndpoint, HonoEndpointOptions } from "../HonoEndpointAdaptor-o6QyDkdy.cjs";
10
10
  export { HonoEndpoint, HonoEndpointOptions };
@@ -3,8 +3,8 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import "../Authorizer-DCcYOx3h.mjs";
8
8
  import "../Endpoint-DU20A9E8.mjs";
9
- import { HonoEndpoint, HonoEndpointOptions } from "../HonoEndpointAdaptor-BbnZe3hb.mjs";
9
+ import { HonoEndpoint, HonoEndpointOptions } from "../HonoEndpointAdaptor-Ay5UGPu0.mjs";
10
10
  export { HonoEndpoint, HonoEndpointOptions };
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import { TestEndpointAdaptor, TestHttpResponse, TestRequestAdaptor } from "../TestEndpointAdaptor-CCf3Dg0u.cjs";
@@ -3,7 +3,7 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import "../Authorizer-DCcYOx3h.mjs";
8
8
  import "../Endpoint-DU20A9E8.mjs";
9
9
  import { TestEndpointAdaptor, TestHttpResponse, TestRequestAdaptor } from "../TestEndpointAdaptor-oWNADEl4.mjs";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { ActorExtractor, EndpointAuditorConfig, MappedAudit } from "../Endpoint-C9N6CmvB.cjs";
9
9
  export { ActorExtractor, EndpointAuditorConfig, MappedAudit };
@@ -3,7 +3,7 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import "../Authorizer-DCcYOx3h.mjs";
8
8
  import { ActorExtractor, EndpointAuditorConfig, MappedAudit } from "../Endpoint-DU20A9E8.mjs";
9
9
  export { ActorExtractor, EndpointAuditorConfig, MappedAudit };
@@ -3,7 +3,7 @@ import { HttpMethod } from "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { Endpoint } from "../Endpoint-C9N6CmvB.cjs";
9
9
  import { Service } from "@geekmidas/services";
@@ -3,7 +3,7 @@ import { HttpMethod } from "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import "../Authorizer-DCcYOx3h.mjs";
8
8
  import { Endpoint } from "../Endpoint-DU20A9E8.mjs";
9
9
  import { Service } from "@geekmidas/services";
@@ -3,17 +3,17 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import { Authorizer, BUILT_IN_SECURITY_SCHEMES, BuiltInSecuritySchemeId, OAuthFlow, OAuthFlows, SecurityScheme, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme } from "../Authorizer-DWtwC8we.cjs";
8
8
  import { ActorExtractor, Endpoint, EndpointContext, EndpointHandler, EndpointOutput, EndpointSchemas, MappedAudit, RLS_BYPASS, ResponseBuilder, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor } from "../Endpoint-C9N6CmvB.cjs";
9
9
  import { EndpointBuilder } from "../EndpointBuilder-BfzI6Rpc.cjs";
10
10
  import { EndpointFactory } from "../EndpointFactory-C1miOYUW.cjs";
11
11
  import { publishConstructEvents } from "../publisher-DdPDps5m.cjs";
12
12
  import { createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders } from "../lazyAccessors-ZRbwOONj.cjs";
13
- import * as _geekmidas_logger2 from "@geekmidas/logger";
13
+ import * as _geekmidas_logger9 from "@geekmidas/logger";
14
14
 
15
15
  //#region src/endpoints/index.d.ts
16
- declare const e: EndpointFactory<[], "", _geekmidas_logger2.Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string, Record<string, SecurityScheme>, undefined>;
16
+ declare const e: EndpointFactory<[], "", _geekmidas_logger9.Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string, Record<string, SecurityScheme>, undefined>;
17
17
  //# sourceMappingURL=index.d.ts.map
18
18
 
19
19
  //#endregion
@@ -3,17 +3,17 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import { Authorizer, BUILT_IN_SECURITY_SCHEMES, BuiltInSecuritySchemeId, OAuthFlow, OAuthFlows, SecurityScheme, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme } from "../Authorizer-DCcYOx3h.mjs";
8
8
  import { ActorExtractor, Endpoint, EndpointContext, EndpointHandler, EndpointOutput, EndpointSchemas, MappedAudit, RLS_BYPASS, ResponseBuilder, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor } from "../Endpoint-DU20A9E8.mjs";
9
9
  import { EndpointBuilder } from "../EndpointBuilder-CuVlda7g.mjs";
10
10
  import { EndpointFactory } from "../EndpointFactory-Bj7vHtT6.mjs";
11
11
  import { publishConstructEvents } from "../publisher-BeouS9lG.mjs";
12
12
  import { createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders } from "../lazyAccessors-D1tbdxUk.mjs";
13
- import * as _geekmidas_logger8 from "@geekmidas/logger";
13
+ import * as _geekmidas_logger3 from "@geekmidas/logger";
14
14
 
15
15
  //#region src/endpoints/index.d.ts
16
- declare const e: EndpointFactory<[], "", _geekmidas_logger8.Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string, Record<string, SecurityScheme>, undefined>;
16
+ declare const e: EndpointFactory<[], "", _geekmidas_logger3.Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string, Record<string, SecurityScheme>, undefined>;
17
17
  //# sourceMappingURL=index.d.ts.map
18
18
 
19
19
  //#endregion
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import { createApiGatewayCookies, createApiGatewayHeaders, createCookieHeaderAccessor, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, createObjectHeaders } from "../lazyAccessors-ZRbwOONj.cjs";
@@ -3,7 +3,7 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import "../Authorizer-DCcYOx3h.mjs";
8
8
  import "../Endpoint-DU20A9E8.mjs";
9
9
  import { createApiGatewayCookies, createApiGatewayHeaders, createCookieHeaderAccessor, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, createObjectHeaders } from "../lazyAccessors-D1tbdxUk.mjs";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { CookieFn, Endpoint, HeaderFn } from "../Endpoint-C9N6CmvB.cjs";
9
9
  import { AuditStorage, AuditableAction, Auditor } from "@geekmidas/audit";
@@ -3,7 +3,7 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import "../Authorizer-DCcYOx3h.mjs";
8
8
  import { CookieFn, Endpoint, HeaderFn } from "../Endpoint-DU20A9E8.mjs";
9
9
  import { Service, ServiceDiscovery } from "@geekmidas/services";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-BRbGNZpa.cjs";
6
+ import "../index-dRNH0dT6.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { RLS_BYPASS, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor } from "../Endpoint-C9N6CmvB.cjs";
9
9
  export { RLS_BYPASS, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor };
@@ -3,7 +3,7 @@ import "../types-Dw-iLd3Y.mjs";
3
3
  import "../BaseFunctionBuilder-JpN2FtB4.mjs";
4
4
  import "../Function-DEX2O-SB.mjs";
5
5
  import "../FunctionBuilder-DRw1s5uT.mjs";
6
- import "../index-DHGtpWKA.mjs";
6
+ import "../index-puUpr9Dh.mjs";
7
7
  import "../Authorizer-DCcYOx3h.mjs";
8
8
  import { RLS_BYPASS, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor } from "../Endpoint-DU20A9E8.mjs";
9
9
  export { RLS_BYPASS, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor };
@@ -2,5 +2,5 @@ import "../Construct-CX7HyFfT.cjs";
2
2
  import { BaseFunctionBuilder } from "../BaseFunctionBuilder-C-4hYTfj.cjs";
3
3
  import { Function, FunctionContext, FunctionHandler } from "../Function-CwlB89lS.cjs";
4
4
  import { FunctionBuilder } from "../FunctionBuilder-D_7f5MfS.cjs";
5
- import { f } from "../index-BRbGNZpa.cjs";
5
+ import { f } from "../index-dRNH0dT6.cjs";
6
6
  export { BaseFunctionBuilder, Function, FunctionBuilder, FunctionContext, FunctionHandler, f };
@@ -2,5 +2,5 @@ import "../Construct-DvXCkLOP.mjs";
2
2
  import { BaseFunctionBuilder } from "../BaseFunctionBuilder-JpN2FtB4.mjs";
3
3
  import { Function, FunctionContext, FunctionHandler } from "../Function-DEX2O-SB.mjs";
4
4
  import { FunctionBuilder } from "../FunctionBuilder-DRw1s5uT.mjs";
5
- import { f } from "../index-DHGtpWKA.mjs";
5
+ import { f } from "../index-puUpr9Dh.mjs";
6
6
  export { BaseFunctionBuilder, Function, FunctionBuilder, FunctionContext, FunctionHandler, f };
@@ -0,0 +1,12 @@
1
+ import { FunctionBuilder } from "./FunctionBuilder-D_7f5MfS.cjs";
2
+ import * as _geekmidas_audit6 from "@geekmidas/audit";
3
+ import * as _geekmidas_logger5 from "@geekmidas/logger";
4
+ import * as _geekmidas_schema4 from "@geekmidas/schema";
5
+
6
+ //#region src/functions/index.d.ts
7
+ declare const f: FunctionBuilder<_geekmidas_schema4.ComposableStandardSchema, undefined, [], _geekmidas_logger5.Logger, undefined, string, undefined, string, undefined, string, _geekmidas_audit6.AuditableAction<string, unknown>>;
8
+ //# sourceMappingURL=index.d.ts.map
9
+
10
+ //#endregion
11
+ export { f };
12
+ //# sourceMappingURL=index-dRNH0dT6.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-BRbGNZpa.d.cts","names":[],"sources":["../src/functions/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAWa,GAAC,gBAAwB,kBAAA,CAAxB,wBAAA,iBAAA,kBAAA,CAAA,MAAA,2DAAA,iBAAA,CAAA"}
1
+ {"version":3,"file":"index-dRNH0dT6.d.cts","names":[],"sources":["../src/functions/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAWa,GAAC,gBAAwB,kBAAA,CAAxB,wBAAA,iBAAA,kBAAA,CAAA,MAAA,2DAAA,iBAAA,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { FunctionBuilder } from "./FunctionBuilder-DRw1s5uT.mjs";
2
+ import * as _geekmidas_audit2 from "@geekmidas/audit";
3
+ import * as _geekmidas_logger1 from "@geekmidas/logger";
4
+ import * as _geekmidas_schema0 from "@geekmidas/schema";
5
+
6
+ //#region src/functions/index.d.ts
7
+ declare const f: FunctionBuilder<_geekmidas_schema0.ComposableStandardSchema, undefined, [], _geekmidas_logger1.Logger, undefined, string, undefined, string, undefined, string, _geekmidas_audit2.AuditableAction<string, unknown>>;
8
+ //# sourceMappingURL=index.d.ts.map
9
+
10
+ //#endregion
11
+ export { f };
12
+ //# sourceMappingURL=index-puUpr9Dh.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-DHGtpWKA.d.mts","names":[],"sources":["../src/functions/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAWa,GAAC,gBAAwB,kBAAA,CAAxB,wBAAA,iBAAA,kBAAA,CAAA,MAAA,2DAAA,iBAAA,CAAA"}
1
+ {"version":3,"file":"index-puUpr9Dh.d.mts","names":[],"sources":["../src/functions/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAWa,GAAC,gBAAwB,kBAAA,CAAxB,wBAAA,iBAAA,kBAAA,CAAA,MAAA,2DAAA,iBAAA,CAAA"}
@@ -1,3 +1,3 @@
1
- const require_AWSLambdaSubscriberAdaptor = require('../AWSLambdaSubscriberAdaptor-DQDnt1Xk.cjs');
1
+ const require_AWSLambdaSubscriberAdaptor = require('../AWSLambdaSubscriberAdaptor-Soie57uM.cjs');
2
2
 
3
3
  exports.AWSLambdaSubscriber = require_AWSLambdaSubscriberAdaptor.AWSLambdaSubscriber;
@@ -1,4 +1,4 @@
1
1
  import "../Construct-CX7HyFfT.cjs";
2
2
  import "../Subscriber-1rDE7HuM.cjs";
3
- import { AWSLambdaHandler, AWSLambdaSubscriber } from "../AWSLambdaSubscriberAdaptor-Bat1CB6a.cjs";
3
+ import { AWSLambdaHandler, AWSLambdaSubscriber } from "../AWSLambdaSubscriberAdaptor-BfEGolJA.cjs";
4
4
  export { AWSLambdaHandler, AWSLambdaSubscriber };
@@ -1,4 +1,4 @@
1
1
  import "../Construct-DvXCkLOP.mjs";
2
2
  import "../Subscriber-DCgMSkQA.mjs";
3
- import { AWSLambdaHandler, AWSLambdaSubscriber } from "../AWSLambdaSubscriberAdaptor-DgSXzIUT.mjs";
3
+ import { AWSLambdaHandler, AWSLambdaSubscriber } from "../AWSLambdaSubscriberAdaptor-Pb7Jof-i.mjs";
4
4
  export { AWSLambdaHandler, AWSLambdaSubscriber };
@@ -1,3 +1,3 @@
1
- import { AWSLambdaSubscriber } from "../AWSLambdaSubscriberAdaptor-BD3FwGUb.mjs";
1
+ import { AWSLambdaSubscriber } from "../AWSLambdaSubscriberAdaptor-BUvb-v_n.mjs";
2
2
 
3
3
  export { AWSLambdaSubscriber };
@@ -1,10 +1,10 @@
1
1
  import "../Construct-CX7HyFfT.cjs";
2
2
  import { Subscriber } from "../Subscriber-1rDE7HuM.cjs";
3
3
  import { SubscriberBuilder } from "../SubscriberBuilder-UIwW_wIY.cjs";
4
- import * as _geekmidas_logger10 from "@geekmidas/logger";
4
+ import * as _geekmidas_logger0 from "@geekmidas/logger";
5
5
 
6
6
  //#region src/subscribers/index.d.ts
7
- declare const s: SubscriberBuilder<[], _geekmidas_logger10.Logger, undefined, undefined, string, []>;
7
+ declare const s: SubscriberBuilder<[], _geekmidas_logger0.Logger, undefined, undefined, string, []>;
8
8
  //# sourceMappingURL=index.d.ts.map
9
9
 
10
10
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,mBAAA,CAA1B,MAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,kBAAA,CAA1B,MAAA"}
@@ -1,10 +1,10 @@
1
1
  import "../Construct-DvXCkLOP.mjs";
2
2
  import { Subscriber } from "../Subscriber-DCgMSkQA.mjs";
3
3
  import { SubscriberBuilder } from "../SubscriberBuilder-BcyK44e_.mjs";
4
- import * as _geekmidas_logger10 from "@geekmidas/logger";
4
+ import * as _geekmidas_logger7 from "@geekmidas/logger";
5
5
 
6
6
  //#region src/subscribers/index.d.ts
7
- declare const s: SubscriberBuilder<[], _geekmidas_logger10.Logger, undefined, undefined, string, []>;
7
+ declare const s: SubscriberBuilder<[], _geekmidas_logger7.Logger, undefined, undefined, string, []>;
8
8
  //# sourceMappingURL=index.d.ts.map
9
9
 
10
10
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,mBAAA,CAA1B,MAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,kBAAA,CAA1B,MAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/constructs",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -78,17 +78,17 @@
78
78
  "kysely": "~0.28.8",
79
79
  "pg": "~8.16.3",
80
80
  "zod": "~4.1.13",
81
- "@geekmidas/audit": "^1.0.0",
82
81
  "@geekmidas/cache": "^1.0.0",
82
+ "@geekmidas/audit": "^1.0.0",
83
83
  "@geekmidas/db": "^1.0.0",
84
84
  "@geekmidas/envkit": "^1.0.0",
85
- "@geekmidas/errors": "^1.0.0",
86
85
  "@geekmidas/events": "^1.0.0",
86
+ "@geekmidas/errors": "^1.0.0",
87
87
  "@geekmidas/logger": "^1.0.0",
88
88
  "@geekmidas/rate-limit": "^1.0.0",
89
89
  "@geekmidas/schema": "^1.0.0",
90
90
  "@geekmidas/services": "^1.0.0",
91
- "@geekmidas/testkit": "^1.0.0"
91
+ "@geekmidas/testkit": "^1.0.1"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "@middy/core": ">=6.3.1",
@@ -11,6 +11,7 @@ import type {
11
11
  Context,
12
12
  Handler,
13
13
  SNSEvent,
14
+ SNSEventRecord,
14
15
  SQSEvent,
15
16
  SQSRecord,
16
17
  } from 'aws-lambda';
@@ -128,7 +129,12 @@ export class AWSLambdaSubscriber<
128
129
  private parseEvents(): Middleware<TServices, TLogger, OutSchema> {
129
130
  return {
130
131
  before: async (req) => {
131
- const rawEvent = (req as any).event as SQSEvent | SNSEvent;
132
+ const { logger, ...e } = req.event;
133
+ const rawEvent = e as any as SQSEvent | SNSEvent;
134
+
135
+ logger.info({
136
+ rawEvent,
137
+ });
132
138
 
133
139
  // Parse events based on the event type
134
140
  const events: any[] = [];
@@ -153,7 +159,7 @@ export class AWSLambdaSubscriber<
153
159
  // SNS Event
154
160
  for (const record of rawEvent.Records) {
155
161
  try {
156
- const event = JSON.parse(record.Sns.Message);
162
+ const event = this.parseSNSRecord(record);
157
163
  if (event && this.isSubscribedEvent(event.type)) {
158
164
  events.push(event);
159
165
  }
@@ -194,15 +200,43 @@ export class AWSLambdaSubscriber<
194
200
  );
195
201
  }
196
202
 
203
+ private parseSNSRecord(record: SNSEventRecord): any | null {
204
+ try {
205
+ const message = JSON.parse(record.Sns.Message);
206
+ // Resolve type from MessageAttributes (preferred) or message body
207
+ const messageType =
208
+ record.Sns.MessageAttributes?.type?.Value ?? message.type;
209
+
210
+ if (message.type) {
211
+ return message; // Full event format: { type, payload }
212
+ }
213
+
214
+ // Payload-only format: type is in MessageAttributes
215
+ return messageType ? { type: messageType, payload: message } : message;
216
+ } catch (error) {
217
+ this.logger.error({ error, record }, 'Failed to parse SNS record body');
218
+ return null;
219
+ }
220
+ }
221
+
197
222
  private parseSQSRecord(record: SQSRecord): any | null {
198
223
  try {
199
224
  const body = JSON.parse(record.body);
200
225
 
201
226
  // Check if this is an SNS message wrapped in SQS
202
227
  if (body.Type === 'Notification' && body.Message) {
203
- // Parse the SNS message
204
228
  const snsMessage = JSON.parse(body.Message);
205
- return snsMessage;
229
+
230
+ if (snsMessage.type) {
231
+ return snsMessage; // Full event format: { type, payload }
232
+ }
233
+
234
+ // Payload-only format: type is in MessageAttributes
235
+ const messageType =
236
+ body.MessageAttributes?.type?.Value ?? snsMessage.type;
237
+ return messageType
238
+ ? { type: messageType, payload: snsMessage }
239
+ : snsMessage;
206
240
  }
207
241
 
208
242
  // Direct SQS message
@@ -262,8 +296,8 @@ export class AWSLambdaSubscriber<
262
296
  // Apply middleware in order
263
297
  return middy(handler)
264
298
  .use(this.loggerMiddleware())
299
+ .use(this.parseEvents())
265
300
  .use(this.error())
266
- .use(this.services())
267
- .use(this.parseEvents()) as unknown as AWSLambdaHandler;
301
+ .use(this.services());
268
302
  }
269
303
  }
@@ -66,7 +66,7 @@ const createSQSEvent = (messages: any[]): SQSEvent => ({
66
66
  ),
67
67
  });
68
68
 
69
- // Helper to create SNS event
69
+ // Helper to create SNS event with full event format (type in message body)
70
70
  const createSNSEvent = (messages: any[]): SNSEvent => ({
71
71
  Records: messages.map(
72
72
  (message, index) =>
@@ -90,6 +90,38 @@ const createSNSEvent = (messages: any[]): SNSEvent => ({
90
90
  ),
91
91
  });
92
92
 
93
+ // Helper to create SNS event with payload-only format (type in MessageAttributes)
94
+ const createSNSEventWithMessageAttributes = (
95
+ messages: { type: string; payload: any }[],
96
+ ): SNSEvent => ({
97
+ Records: messages.map(
98
+ (message, index) =>
99
+ ({
100
+ EventSource: 'aws:sns',
101
+ EventVersion: '1.0',
102
+ EventSubscriptionArn: 'arn:aws:sns:region:account:topic-name',
103
+ Sns: {
104
+ Type: 'Notification',
105
+ MessageId: `message-${index}`,
106
+ TopicArn: 'arn:aws:sns:region:account:topic-name',
107
+ Subject: null,
108
+ Message: JSON.stringify(message.payload),
109
+ Timestamp: '2023-01-01T00:00:00.000Z',
110
+ SignatureVersion: '1',
111
+ Signature: 'signature',
112
+ SigningCertUrl: 'https://example.com/cert',
113
+ UnsubscribeUrl: 'https://example.com/unsubscribe',
114
+ MessageAttributes: {
115
+ type: {
116
+ Type: 'String',
117
+ Value: message.type,
118
+ },
119
+ },
120
+ },
121
+ }) as SNSEventRecord,
122
+ ),
123
+ });
124
+
93
125
  // Helper to create SNS wrapped in SQS
94
126
  const createSNSWrappedInSQS = (messages: any[]): SQSEvent => {
95
127
  return createSQSEvent(
@@ -103,6 +135,27 @@ const createSNSWrappedInSQS = (messages: any[]): SQSEvent => {
103
135
  );
104
136
  };
105
137
 
138
+ // Helper to create SNS wrapped in SQS with payload-only format (type in MessageAttributes)
139
+ const createSNSWrappedInSQSWithMessageAttributes = (
140
+ messages: { type: string; payload: any }[],
141
+ ): SQSEvent => {
142
+ return createSQSEvent(
143
+ messages.map((message) => ({
144
+ Type: 'Notification',
145
+ MessageId: 'message-id',
146
+ TopicArn: 'arn:aws:sns:region:account:topic-name',
147
+ Message: JSON.stringify(message.payload),
148
+ Timestamp: '2023-01-01T00:00:00.000Z',
149
+ MessageAttributes: {
150
+ type: {
151
+ Type: 'String',
152
+ Value: message.type,
153
+ },
154
+ },
155
+ })),
156
+ );
157
+ };
158
+
106
159
  describe('AWSLambdaSubscriber', () => {
107
160
  let envParser: EnvironmentParser<{}>;
108
161
  let logger: ConsoleLogger;
@@ -224,6 +277,72 @@ describe('AWSLambdaSubscriber', () => {
224
277
 
225
278
  expect(handler).toHaveBeenCalled();
226
279
  });
280
+
281
+ it('should process SNS events with type in MessageAttributes (payload-only format)', async () => {
282
+ const handler = vi.fn(async ({ events }) => {
283
+ expect(events).toHaveLength(1);
284
+ expect(events[0]).toEqual({
285
+ type: 'tenant.created',
286
+ payload: { tenantId: '019c0b2b-d881-7c21-93b6-480571144b28' },
287
+ });
288
+ });
289
+
290
+ const subscriber = new Subscriber(
291
+ handler,
292
+ 30000,
293
+ ['tenant.created'] as any,
294
+ undefined,
295
+ [],
296
+ logger,
297
+ );
298
+
299
+ const adapter = new AWSLambdaSubscriber(envParser, subscriber);
300
+ const lambdaHandler = adapter.handler;
301
+
302
+ const snsEvent = createSNSEventWithMessageAttributes([
303
+ {
304
+ type: 'tenant.created',
305
+ payload: { tenantId: '019c0b2b-d881-7c21-93b6-480571144b28' },
306
+ },
307
+ ]);
308
+
309
+ await lambdaHandler(snsEvent, createMockContext(), vi.fn());
310
+
311
+ expect(handler).toHaveBeenCalled();
312
+ });
313
+
314
+ it('should process SNS-wrapped-in-SQS with type in MessageAttributes (payload-only format)', async () => {
315
+ const handler = vi.fn(async ({ events }) => {
316
+ expect(events).toHaveLength(1);
317
+ expect(events[0]).toEqual({
318
+ type: 'tenant.created',
319
+ payload: { tenantId: '019c0b2b-d881-7c21-93b6-480571144b28' },
320
+ });
321
+ });
322
+
323
+ const subscriber = new Subscriber(
324
+ handler,
325
+ 30000,
326
+ ['tenant.created'] as any,
327
+ undefined,
328
+ [],
329
+ logger,
330
+ );
331
+
332
+ const adapter = new AWSLambdaSubscriber(envParser, subscriber);
333
+ const lambdaHandler = adapter.handler;
334
+
335
+ const sqsEvent = createSNSWrappedInSQSWithMessageAttributes([
336
+ {
337
+ type: 'tenant.created',
338
+ payload: { tenantId: '019c0b2b-d881-7c21-93b6-480571144b28' },
339
+ },
340
+ ]);
341
+
342
+ await lambdaHandler(sqsEvent, createMockContext(), vi.fn());
343
+
344
+ expect(handler).toHaveBeenCalled();
345
+ });
227
346
  });
228
347
 
229
348
  describe('event type filtering', () => {