@webiny/handler-aws 0.0.0-unstable.a4637c5ce6 → 0.0.0-unstable.a4f3e4ea8b

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 (98) hide show
  1. package/README.md +10 -14
  2. package/createHandler.d.ts +1 -1
  3. package/createHandler.js +20 -26
  4. package/createHandler.js.map +1 -1
  5. package/dynamodb/index.d.ts +3 -3
  6. package/dynamodb/index.js +39 -76
  7. package/dynamodb/index.js.map +1 -1
  8. package/dynamodb/plugins/DynamoDBEventHandler.d.ts +4 -4
  9. package/dynamodb/plugins/DynamoDBEventHandler.js +11 -18
  10. package/dynamodb/plugins/DynamoDBEventHandler.js.map +1 -1
  11. package/dynamodb/register.js +13 -25
  12. package/dynamodb/register.js.map +1 -1
  13. package/eventBridge/index.d.ts +3 -3
  14. package/eventBridge/index.js +39 -76
  15. package/eventBridge/index.js.map +1 -1
  16. package/eventBridge/plugins/EventBridgeEventHandler.d.ts +4 -4
  17. package/eventBridge/plugins/EventBridgeEventHandler.js +11 -18
  18. package/eventBridge/plugins/EventBridgeEventHandler.js.map +1 -1
  19. package/eventBridge/register.d.ts +1 -1
  20. package/eventBridge/register.js +8 -18
  21. package/eventBridge/register.js.map +1 -1
  22. package/execute.d.ts +1 -1
  23. package/execute.js +53 -68
  24. package/execute.js.map +1 -1
  25. package/gateway/index.d.ts +2 -2
  26. package/gateway/index.js +41 -83
  27. package/gateway/index.js.map +1 -1
  28. package/gateway/register.js +8 -18
  29. package/gateway/register.js.map +1 -1
  30. package/index.d.ts +17 -17
  31. package/index.js +17 -374
  32. package/package.json +22 -19
  33. package/plugins/index.d.ts +1 -1
  34. package/plugins/index.js +3 -10
  35. package/plugins/index.js.map +1 -1
  36. package/raw/index.d.ts +3 -3
  37. package/raw/index.js +42 -86
  38. package/raw/index.js.map +1 -1
  39. package/raw/plugins/RawEventHandler.d.ts +3 -3
  40. package/raw/plugins/RawEventHandler.js +12 -30
  41. package/raw/plugins/RawEventHandler.js.map +1 -1
  42. package/registry.d.ts +2 -2
  43. package/registry.js +17 -38
  44. package/registry.js.map +1 -1
  45. package/s3/index.d.ts +3 -3
  46. package/s3/index.js +39 -76
  47. package/s3/index.js.map +1 -1
  48. package/s3/plugins/S3EventHandler.d.ts +4 -4
  49. package/s3/plugins/S3EventHandler.js +11 -18
  50. package/s3/plugins/S3EventHandler.js.map +1 -1
  51. package/s3/register.d.ts +1 -1
  52. package/s3/register.js +12 -22
  53. package/s3/register.js.map +1 -1
  54. package/sns/index.d.ts +3 -3
  55. package/sns/index.js +39 -76
  56. package/sns/index.js.map +1 -1
  57. package/sns/plugins/SNSEventHandler.d.ts +4 -4
  58. package/sns/plugins/SNSEventHandler.js +11 -18
  59. package/sns/plugins/SNSEventHandler.js.map +1 -1
  60. package/sns/register.js +12 -22
  61. package/sns/register.js.map +1 -1
  62. package/sourceHandler.d.ts +2 -2
  63. package/sourceHandler.js +2 -10
  64. package/sourceHandler.js.map +1 -1
  65. package/sqs/index.d.ts +3 -3
  66. package/sqs/index.js +40 -79
  67. package/sqs/index.js.map +1 -1
  68. package/sqs/plugins/SQSEventHandler.d.ts +4 -4
  69. package/sqs/plugins/SQSEventHandler.js +11 -18
  70. package/sqs/plugins/SQSEventHandler.js.map +1 -1
  71. package/sqs/register.js +13 -25
  72. package/sqs/register.js.map +1 -1
  73. package/types.d.ts +3 -3
  74. package/types.js +7 -34
  75. package/types.js.map +1 -1
  76. package/utils/composedHandler.d.ts +1 -1
  77. package/utils/composedHandler.js +6 -22
  78. package/utils/composedHandler.js.map +1 -1
  79. package/utils/index.d.ts +2 -2
  80. package/utils/index.js +2 -29
  81. package/utils/timer/CustomTimer.js +8 -14
  82. package/utils/timer/CustomTimer.js.map +1 -1
  83. package/utils/timer/Timer.d.ts +1 -1
  84. package/utils/timer/Timer.js +11 -19
  85. package/utils/timer/Timer.js.map +1 -1
  86. package/utils/timer/abstractions/ITimer.js +0 -7
  87. package/utils/timer/factory.d.ts +2 -2
  88. package/utils/timer/factory.js +9 -17
  89. package/utils/timer/factory.js.map +1 -1
  90. package/utils/timer/index.d.ts +4 -4
  91. package/utils/timer/index.js +3 -51
  92. package/index.js.map +0 -1
  93. package/plugins/handlerClient.d.ts +0 -2
  94. package/plugins/handlerClient.js +0 -53
  95. package/plugins/handlerClient.js.map +0 -1
  96. package/utils/index.js.map +0 -1
  97. package/utils/timer/abstractions/ITimer.js.map +0 -1
  98. package/utils/timer/index.js.map +0 -1
package/utils/index.js CHANGED
@@ -1,29 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _composedHandler = require("./composedHandler");
7
- Object.keys(_composedHandler).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _composedHandler[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _composedHandler[key];
14
- }
15
- });
16
- });
17
- var _timer = require("./timer");
18
- Object.keys(_timer).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _timer[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _timer[key];
25
- }
26
- });
27
- });
28
-
29
- //# sourceMappingURL=index.js.map
1
+ export * from "./composedHandler.js";
2
+ export * from "./timer/index.js";
@@ -1,19 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CustomTimer = void 0;
7
1
  const MAX_RUNNING_MINUTES = 14;
8
- const MAX_RUNNING_MILLISECONDS = MAX_RUNNING_MINUTES * 60 * 1000;
2
+ const MAX_RUNNING_MILLISECONDS = 60 * MAX_RUNNING_MINUTES * 1000;
9
3
  class CustomTimer {
10
- constructor() {
11
- this.startTime = Date.now();
12
- }
13
- getRemainingMilliseconds() {
14
- return this.startTime + MAX_RUNNING_MILLISECONDS - Date.now(); // 14 minutes
15
- }
4
+ constructor(){
5
+ this.startTime = Date.now();
6
+ }
7
+ getRemainingMilliseconds() {
8
+ return this.startTime + MAX_RUNNING_MILLISECONDS - Date.now();
9
+ }
16
10
  }
17
- exports.CustomTimer = CustomTimer;
11
+ export { CustomTimer };
18
12
 
19
13
  //# sourceMappingURL=CustomTimer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MAX_RUNNING_MINUTES","MAX_RUNNING_MILLISECONDS","CustomTimer","constructor","startTime","Date","now","getRemainingMilliseconds","exports"],"sources":["CustomTimer.ts"],"sourcesContent":["const MAX_RUNNING_MINUTES = 14;\nconst MAX_RUNNING_MILLISECONDS = MAX_RUNNING_MINUTES * 60 * 1000;\n\nexport class CustomTimer {\n private readonly startTime: number;\n\n public constructor() {\n this.startTime = Date.now();\n }\n\n public getRemainingMilliseconds(): number {\n return this.startTime + MAX_RUNNING_MILLISECONDS - Date.now(); // 14 minutes\n }\n}\n"],"mappings":";;;;;;AAAA,MAAMA,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,wBAAwB,GAAGD,mBAAmB,GAAG,EAAE,GAAG,IAAI;AAEzD,MAAME,WAAW,CAAC;EAGdC,WAAWA,CAAA,EAAG;IACjB,IAAI,CAACC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EAC/B;EAEOC,wBAAwBA,CAAA,EAAW;IACtC,OAAO,IAAI,CAACH,SAAS,GAAGH,wBAAwB,GAAGI,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC,CAAC;EACnE;AACJ;AAACE,OAAA,CAAAN,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"file":"utils/timer/CustomTimer.js","sources":["../../../src/utils/timer/CustomTimer.ts"],"sourcesContent":["const MAX_RUNNING_MINUTES = 14;\nconst MAX_RUNNING_MILLISECONDS = MAX_RUNNING_MINUTES * 60 * 1000;\n\nexport class CustomTimer {\n private readonly startTime: number;\n\n public constructor() {\n this.startTime = Date.now();\n }\n\n public getRemainingMilliseconds(): number {\n return this.startTime + MAX_RUNNING_MILLISECONDS - Date.now(); // 14 minutes\n }\n}\n"],"names":["MAX_RUNNING_MINUTES","MAX_RUNNING_MILLISECONDS","CustomTimer","Date"],"mappings":"AAAA,MAAMA,sBAAsB;AAC5B,MAAMC,2BAA2BD,AAAsB,KAAtBA,sBAA2B;AAErD,MAAME;IAGT,aAAqB;QACjB,IAAI,CAAC,SAAS,GAAGC,KAAK,GAAG;IAC7B;IAEO,2BAAmC;QACtC,OAAO,IAAI,CAAC,SAAS,GAAGF,2BAA2BE,KAAK,GAAG;IAC/D;AACJ"}
@@ -1,4 +1,4 @@
1
- import type { ITimer } from "./abstractions/ITimer";
1
+ import type { ITimer } from "./abstractions/ITimer.js";
2
2
  export interface ITimerCb {
3
3
  (): number;
4
4
  }
@@ -1,24 +1,16 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Timer = void 0;
7
1
  class Timer {
8
- constructor(cb) {
9
- this.cb = cb;
10
- }
11
- getRemainingMilliseconds() {
12
- return this.cb();
13
- }
14
- getRemainingSeconds() {
15
- const result = this.cb();
16
- if (result > 0) {
17
- return Math.floor(result / 1000);
2
+ constructor(cb){
3
+ this.cb = cb;
4
+ }
5
+ getRemainingMilliseconds() {
6
+ return this.cb();
7
+ }
8
+ getRemainingSeconds() {
9
+ const result = this.cb();
10
+ if (result > 0) return Math.floor(result / 1000);
11
+ return 0;
18
12
  }
19
- return 0;
20
- }
21
13
  }
22
- exports.Timer = Timer;
14
+ export { Timer };
23
15
 
24
16
  //# sourceMappingURL=Timer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Timer","constructor","cb","getRemainingMilliseconds","getRemainingSeconds","result","Math","floor","exports"],"sources":["Timer.ts"],"sourcesContent":["import type { ITimer } from \"./abstractions/ITimer\";\n\nexport interface ITimerCb {\n (): number;\n}\n\nexport class Timer implements ITimer {\n private readonly cb: ITimerCb;\n\n public constructor(cb: ITimerCb) {\n this.cb = cb;\n }\n public getRemainingMilliseconds(): number {\n return this.cb();\n }\n\n public getRemainingSeconds(): number {\n const result = this.cb();\n if (result > 0) {\n return Math.floor(result / 1000);\n }\n return 0;\n }\n}\n"],"mappings":";;;;;;AAMO,MAAMA,KAAK,CAAmB;EAG1BC,WAAWA,CAACC,EAAY,EAAE;IAC7B,IAAI,CAACA,EAAE,GAAGA,EAAE;EAChB;EACOC,wBAAwBA,CAAA,EAAW;IACtC,OAAO,IAAI,CAACD,EAAE,CAAC,CAAC;EACpB;EAEOE,mBAAmBA,CAAA,EAAW;IACjC,MAAMC,MAAM,GAAG,IAAI,CAACH,EAAE,CAAC,CAAC;IACxB,IAAIG,MAAM,GAAG,CAAC,EAAE;MACZ,OAAOC,IAAI,CAACC,KAAK,CAACF,MAAM,GAAG,IAAI,CAAC;IACpC;IACA,OAAO,CAAC;EACZ;AACJ;AAACG,OAAA,CAAAR,KAAA,GAAAA,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"utils/timer/Timer.js","sources":["../../../src/utils/timer/Timer.ts"],"sourcesContent":["import type { ITimer } from \"./abstractions/ITimer.js\";\n\nexport interface ITimerCb {\n (): number;\n}\n\nexport class Timer implements ITimer {\n private readonly cb: ITimerCb;\n\n public constructor(cb: ITimerCb) {\n this.cb = cb;\n }\n public getRemainingMilliseconds(): number {\n return this.cb();\n }\n\n public getRemainingSeconds(): number {\n const result = this.cb();\n if (result > 0) {\n return Math.floor(result / 1000);\n }\n return 0;\n }\n}\n"],"names":["Timer","cb","result","Math"],"mappings":"AAMO,MAAMA;IAGT,YAAmBC,EAAY,CAAE;QAC7B,IAAI,CAAC,EAAE,GAAGA;IACd;IACO,2BAAmC;QACtC,OAAO,IAAI,CAAC,EAAE;IAClB;IAEO,sBAA8B;QACjC,MAAMC,SAAS,IAAI,CAAC,EAAE;QACtB,IAAIA,SAAS,GACT,OAAOC,KAAK,KAAK,CAACD,SAAS;QAE/B,OAAO;IACX;AACJ"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=ITimer.js.map
@@ -1,4 +1,4 @@
1
- import type { ITimer } from "./abstractions/ITimer";
2
- import type { Context as LambdaContext } from "@webiny/aws-sdk/types";
1
+ import type { ITimer } from "./abstractions/ITimer.js";
2
+ import type { Context as LambdaContext } from "@webiny/aws-sdk/types/index.js";
3
3
  export type ITimerFactoryParams = Pick<LambdaContext, "getRemainingTimeInMillis">;
4
4
  export declare const timerFactory: (params?: Partial<ITimerFactoryParams>) => ITimer;
@@ -1,20 +1,12 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.timerFactory = void 0;
7
- var _CustomTimer = require("./CustomTimer");
8
- var _Timer = require("./Timer");
9
- const timerFactory = params => {
10
- const customTimer = new _CustomTimer.CustomTimer();
11
- return new _Timer.Timer(() => {
12
- if (params?.getRemainingTimeInMillis) {
13
- return params.getRemainingTimeInMillis();
14
- }
15
- return customTimer.getRemainingMilliseconds();
16
- });
1
+ import { CustomTimer } from "./CustomTimer.js";
2
+ import { Timer } from "./Timer.js";
3
+ const timerFactory = (params)=>{
4
+ const customTimer = new CustomTimer();
5
+ return new Timer(()=>{
6
+ if (params?.getRemainingTimeInMillis) return params.getRemainingTimeInMillis();
7
+ return customTimer.getRemainingMilliseconds();
8
+ });
17
9
  };
18
- exports.timerFactory = timerFactory;
10
+ export { timerFactory };
19
11
 
20
12
  //# sourceMappingURL=factory.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_CustomTimer","require","_Timer","timerFactory","params","customTimer","CustomTimer","Timer","getRemainingTimeInMillis","getRemainingMilliseconds","exports"],"sources":["factory.ts"],"sourcesContent":["import type { ITimer } from \"./abstractions/ITimer\";\nimport { CustomTimer } from \"./CustomTimer\";\nimport type { Context as LambdaContext } from \"@webiny/aws-sdk/types\";\nimport { Timer } from \"./Timer\";\n\nexport type ITimerFactoryParams = Pick<LambdaContext, \"getRemainingTimeInMillis\">;\n\nexport const timerFactory = (params?: Partial<ITimerFactoryParams>): ITimer => {\n const customTimer = new CustomTimer();\n\n return new Timer(() => {\n if (params?.getRemainingTimeInMillis) {\n return params.getRemainingTimeInMillis();\n }\n return customTimer.getRemainingMilliseconds();\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAIO,MAAME,YAAY,GAAIC,MAAqC,IAAa;EAC3E,MAAMC,WAAW,GAAG,IAAIC,wBAAW,CAAC,CAAC;EAErC,OAAO,IAAIC,YAAK,CAAC,MAAM;IACnB,IAAIH,MAAM,EAAEI,wBAAwB,EAAE;MAClC,OAAOJ,MAAM,CAACI,wBAAwB,CAAC,CAAC;IAC5C;IACA,OAAOH,WAAW,CAACI,wBAAwB,CAAC,CAAC;EACjD,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAP,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"file":"utils/timer/factory.js","sources":["../../../src/utils/timer/factory.ts"],"sourcesContent":["import type { ITimer } from \"./abstractions/ITimer.js\";\nimport { CustomTimer } from \"./CustomTimer.js\";\nimport type { Context as LambdaContext } from \"@webiny/aws-sdk/types/index.js\";\nimport { Timer } from \"./Timer.js\";\n\nexport type ITimerFactoryParams = Pick<LambdaContext, \"getRemainingTimeInMillis\">;\n\nexport const timerFactory = (params?: Partial<ITimerFactoryParams>): ITimer => {\n const customTimer = new CustomTimer();\n\n return new Timer(() => {\n if (params?.getRemainingTimeInMillis) {\n return params.getRemainingTimeInMillis();\n }\n return customTimer.getRemainingMilliseconds();\n });\n};\n"],"names":["timerFactory","params","customTimer","CustomTimer","Timer"],"mappings":";;AAOO,MAAMA,eAAe,CAACC;IACzB,MAAMC,cAAc,IAAIC;IAExB,OAAO,IAAIC,MAAM;QACb,IAAIH,QAAQ,0BACR,OAAOA,OAAO,wBAAwB;QAE1C,OAAOC,YAAY,wBAAwB;IAC/C;AACJ"}
@@ -1,4 +1,4 @@
1
- export * from "./abstractions/ITimer";
2
- export * from "./CustomTimer";
3
- export * from "./factory";
4
- export * from "./Timer";
1
+ export type * from "./abstractions/ITimer.js";
2
+ export * from "./CustomTimer.js";
3
+ export * from "./factory.js";
4
+ export * from "./Timer.js";
@@ -1,51 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _ITimer = require("./abstractions/ITimer");
7
- Object.keys(_ITimer).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _ITimer[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _ITimer[key];
14
- }
15
- });
16
- });
17
- var _CustomTimer = require("./CustomTimer");
18
- Object.keys(_CustomTimer).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _CustomTimer[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _CustomTimer[key];
25
- }
26
- });
27
- });
28
- var _factory = require("./factory");
29
- Object.keys(_factory).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _factory[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _factory[key];
36
- }
37
- });
38
- });
39
- var _Timer = require("./Timer");
40
- Object.keys(_Timer).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _Timer[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _Timer[key];
47
- }
48
- });
49
- });
50
-
51
- //# sourceMappingURL=index.js.map
1
+ export * from "./CustomTimer.js";
2
+ export * from "./factory.js";
3
+ export * from "./Timer.js";
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":["require","_utils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_gateway","_s","_dynamodb","_sqs","_sns","_eventBridge","_raw","_handler","_createHandler","_sourceHandler"],"sources":["index.ts"],"sourcesContent":["import \"./gateway/register\";\nimport \"./s3/register\";\nimport \"./dynamodb/register\";\nimport \"./sqs/register\";\nimport \"./eventBridge/register\";\nimport \"./sns/register\";\n\nexport * from \"./utils\";\n\n/**\n * API Gateway\n */\nexport {\n createHandler as createApiGatewayHandler,\n HandlerParams as CreateApiGatewayHandlerParams,\n HandlerCallable as ApiGatewayHandlerCallable,\n RoutePlugin,\n createRoute as createApiGatewayRoute\n} from \"~/gateway\";\n\n/**\n * S3\n */\n//\nexport {\n createHandler as createS3Handler,\n HandlerParams as CreateS3HandlerParams,\n S3EventHandler,\n S3EventHandlerCallable,\n S3EventHandlerCallableParams,\n createEventHandler as createS3EventHandler\n} from \"~/s3\";\n\n/**\n * DynamoDB Stream\n */\n//\nexport {\n createHandler as createDynamoDBHandler,\n HandlerParams as CreateDynamoDBHandlerParams,\n DynamoDBEventHandler,\n DynamoDBEventHandlerCallable,\n DynamoDBEventHandlerCallableParams,\n createEventHandler as createDynamoDBEventHandler\n} from \"~/dynamodb\";\n\n/**\n * SQS\n */\n//\nexport {\n createHandler as createSQSHandler,\n HandlerParams as CreateSQSHandlerParams,\n SQSEventHandler,\n SQSEventHandlerCallable,\n SQSEventHandlerCallableParams,\n createEventHandler as createSQSEventHandler\n} from \"~/sqs\";\n\n/**\n * SNS\n */\n//\nexport {\n createHandler as createSNSHandler,\n HandlerParams as CreateSNSHandlerParams,\n SNSEventHandler,\n SNSEventHandlerCallable,\n SNSEventHandlerCallableParams,\n createEventHandler as createSNSEventHandler\n} from \"~/sns\";\n\n/**\n * EventBridge\n */\n//\nexport {\n createHandler as createEventBridgeHandler,\n HandlerParams as CreateEventBridgeHandlerParams,\n EventBridgeEventHandler,\n EventBridgeEventHandlerCallable,\n EventBridgeEventHandlerCallableParams,\n createEventHandler as createEventBridgeEventHandler\n} from \"~/eventBridge\";\n\nexport {\n createHandler as createRawHandler,\n CreateHandlerParams as CreateRawHandlerParams,\n HandlerCallable as RawHandlerCallable,\n createEventHandler as createRawEventHandler,\n RawEventHandlerCallableParams,\n RawEventHandlerCallable,\n RawEventHandler\n} from \"~/raw\";\n\nexport { ContextPlugin, createContextPlugin, ContextPluginCallable } from \"@webiny/handler\";\n\nexport * from \"./createHandler\";\nexport * from \"./sourceHandler\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAKA,IAAAS,QAAA,GAAAd,OAAA;AAYA,IAAAe,EAAA,GA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
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createHandlerClientPlugin = void 0;
7
- var _clientLambda = require("@webiny/aws-sdk/client-lambda");
8
- var _handlerClient = require("@webiny/handler-client");
9
- const createHandlerClientPlugin = () => {
10
- const plugin = new _handlerClient.HandlerClientPlugin({
11
- invoke: async params => {
12
- const {
13
- await: useAwait,
14
- name,
15
- payload
16
- } = params;
17
- const lambdaClient = new _clientLambda.LambdaClient({
18
- region: process.env.AWS_REGION
19
- });
20
- const response = await lambdaClient.send(new _clientLambda.InvokeCommand({
21
- FunctionName: name,
22
- InvocationType: useAwait === false ? "Event" : "RequestResponse",
23
- Payload: JSON.stringify(payload)
24
- }));
25
- if (useAwait === false) {
26
- return null;
27
- }
28
- const decoder = new TextDecoder("utf-8");
29
- return JSON.parse(decoder.decode(response.Payload));
30
- },
31
- canUse: params => {
32
- if (!params?.name) {
33
- return true;
34
- }
35
- const {
36
- name
37
- } = params;
38
- /**
39
- * In case we are invoking currently active lambda, let's use this plugin as well.
40
- * When invoking some other lambda, name starts with arn.
41
- */
42
- if (name === process.env.AWS_LAMBDA_FUNCTION_NAME) {
43
- return true;
44
- }
45
- return name.match("arn:") !== null;
46
- }
47
- });
48
- plugin.name = "handler-client";
49
- return plugin;
50
- };
51
- exports.createHandlerClientPlugin = createHandlerClientPlugin;
52
-
53
- //# sourceMappingURL=handlerClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_clientLambda","require","_handlerClient","createHandlerClientPlugin","plugin","HandlerClientPlugin","invoke","params","await","useAwait","name","payload","lambdaClient","LambdaClient","region","process","env","AWS_REGION","response","send","InvokeCommand","FunctionName","InvocationType","Payload","JSON","stringify","decoder","TextDecoder","parse","decode","canUse","AWS_LAMBDA_FUNCTION_NAME","match","exports"],"sources":["handlerClient.ts"],"sourcesContent":["import { LambdaClient, InvokeCommand } from \"@webiny/aws-sdk/client-lambda\";\nimport { HandlerClientPlugin } from \"@webiny/handler-client\";\n\nexport const createHandlerClientPlugin = () => {\n const plugin = new HandlerClientPlugin({\n invoke: async params => {\n const { await: useAwait, name, payload } = params;\n const lambdaClient = new LambdaClient({\n region: process.env.AWS_REGION\n });\n const response = await lambdaClient.send(\n new InvokeCommand({\n FunctionName: name,\n InvocationType: useAwait === false ? \"Event\" : \"RequestResponse\",\n Payload: JSON.stringify(payload)\n })\n );\n\n if (useAwait === false) {\n return null;\n }\n\n const decoder = new TextDecoder(\"utf-8\");\n return JSON.parse(decoder.decode(response.Payload));\n },\n canUse: params => {\n if (!params?.name) {\n return true;\n }\n const { name } = params;\n /**\n * In case we are invoking currently active lambda, let's use this plugin as well.\n * When invoking some other lambda, name starts with arn.\n */\n if (name === process.env.AWS_LAMBDA_FUNCTION_NAME) {\n return true;\n }\n return name.match(\"arn:\") !== null;\n }\n });\n\n plugin.name = \"handler-client\";\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAEO,MAAME,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,MAAM,GAAG,IAAIC,kCAAmB,CAAC;IACnCC,MAAM,EAAE,MAAMC,MAAM,IAAI;MACpB,MAAM;QAAEC,KAAK,EAAEC,QAAQ;QAAEC,IAAI;QAAEC;MAAQ,CAAC,GAAGJ,MAAM;MACjD,MAAMK,YAAY,GAAG,IAAIC,0BAAY,CAAC;QAClCC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;MACxB,CAAC,CAAC;MACF,MAAMC,QAAQ,GAAG,MAAMN,YAAY,CAACO,IAAI,CACpC,IAAIC,2BAAa,CAAC;QACdC,YAAY,EAAEX,IAAI;QAClBY,cAAc,EAAEb,QAAQ,KAAK,KAAK,GAAG,OAAO,GAAG,iBAAiB;QAChEc,OAAO,EAAEC,IAAI,CAACC,SAAS,CAACd,OAAO;MACnC,CAAC,CACL,CAAC;MAED,IAAIF,QAAQ,KAAK,KAAK,EAAE;QACpB,OAAO,IAAI;MACf;MAEA,MAAMiB,OAAO,GAAG,IAAIC,WAAW,CAAC,OAAO,CAAC;MACxC,OAAOH,IAAI,CAACI,KAAK,CAACF,OAAO,CAACG,MAAM,CAACX,QAAQ,CAACK,OAAO,CAAC,CAAC;IACvD,CAAC;IACDO,MAAM,EAAEvB,MAAM,IAAI;MACd,IAAI,CAACA,MAAM,EAAEG,IAAI,EAAE;QACf,OAAO,IAAI;MACf;MACA,MAAM;QAAEA;MAAK,CAAC,GAAGH,MAAM;MACvB;AACZ;AACA;AACA;MACY,IAAIG,IAAI,KAAKK,OAAO,CAACC,GAAG,CAACe,wBAAwB,EAAE;QAC/C,OAAO,IAAI;MACf;MACA,OAAOrB,IAAI,CAACsB,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI;IACtC;EACJ,CAAC,CAAC;EAEF5B,MAAM,CAACM,IAAI,GAAG,gBAAgB;EAE9B,OAAON,MAAM;AACjB,CAAC;AAAC6B,OAAA,CAAA9B,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_composedHandler","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_timer"],"sources":["index.ts"],"sourcesContent":["export * from \"./composedHandler\";\nexport * from \"./timer\";\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["ITimer.ts"],"sourcesContent":["export interface ITimer {\n /**\n * Return value must be in milliseconds.\n */\n getRemainingMilliseconds(): number;\n /**\n * Return value must be in seconds.\n */\n getRemainingSeconds(): number;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_ITimer","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CustomTimer","_factory","_Timer"],"sources":["index.ts"],"sourcesContent":["export * from \"./abstractions/ITimer\";\nexport * from \"./CustomTimer\";\nexport * from \"./factory\";\nexport * from \"./Timer\";\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA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