@webiny/handler-aws 6.0.0-beta.0 → 6.0.0-rc.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.
- package/README.md +10 -14
- package/createHandler.d.ts +1 -1
- package/createHandler.js +12 -12
- package/createHandler.js.map +1 -1
- package/dynamodb/index.d.ts +4 -4
- package/dynamodb/index.js +14 -36
- package/dynamodb/index.js.map +1 -1
- package/dynamodb/plugins/DynamoDBEventHandler.d.ts +4 -4
- package/dynamodb/plugins/DynamoDBEventHandler.js +3 -11
- package/dynamodb/plugins/DynamoDBEventHandler.js.map +1 -1
- package/dynamodb/register.js +6 -8
- package/dynamodb/register.js.map +1 -1
- package/eventBridge/index.d.ts +4 -4
- package/eventBridge/index.js +14 -36
- package/eventBridge/index.js.map +1 -1
- package/eventBridge/plugins/EventBridgeEventHandler.d.ts +4 -4
- package/eventBridge/plugins/EventBridgeEventHandler.js +3 -11
- package/eventBridge/plugins/EventBridgeEventHandler.js.map +1 -1
- package/eventBridge/register.d.ts +1 -1
- package/eventBridge/register.js +6 -8
- package/eventBridge/register.js.map +1 -1
- package/execute.d.ts +1 -1
- package/execute.js +12 -10
- package/execute.js.map +1 -1
- package/gateway/index.d.ts +4 -4
- package/gateway/index.js +16 -30
- package/gateway/index.js.map +1 -1
- package/gateway/register.js +6 -8
- package/gateway/register.js.map +1 -1
- package/index.d.ts +17 -17
- package/index.js +45 -371
- package/index.js.map +1 -1
- package/package.json +15 -34
- package/plugins/handlerClient.js +6 -13
- package/plugins/handlerClient.js.map +1 -1
- package/plugins/index.d.ts +1 -1
- package/plugins/index.js +3 -10
- package/plugins/index.js.map +1 -1
- package/raw/index.d.ts +5 -6
- package/raw/index.js +23 -33
- package/raw/index.js.map +1 -1
- package/raw/plugins/RawEventHandler.d.ts +16 -5
- package/raw/plugins/RawEventHandler.js +16 -13
- package/raw/plugins/RawEventHandler.js.map +1 -1
- package/registry.d.ts +2 -2
- package/registry.js +1 -7
- package/registry.js.map +1 -1
- package/s3/index.d.ts +4 -5
- package/s3/index.js +14 -36
- package/s3/index.js.map +1 -1
- package/s3/plugins/S3EventHandler.d.ts +4 -4
- package/s3/plugins/S3EventHandler.js +3 -11
- package/s3/plugins/S3EventHandler.js.map +1 -1
- package/s3/register.d.ts +1 -1
- package/s3/register.js +6 -8
- package/s3/register.js.map +1 -1
- package/sns/index.d.ts +4 -5
- package/sns/index.js +14 -36
- package/sns/index.js.map +1 -1
- package/sns/plugins/SNSEventHandler.d.ts +4 -4
- package/sns/plugins/SNSEventHandler.js +3 -11
- package/sns/plugins/SNSEventHandler.js.map +1 -1
- package/sns/register.js +6 -8
- package/sns/register.js.map +1 -1
- package/sourceHandler.d.ts +2 -2
- package/sourceHandler.js +1 -8
- package/sourceHandler.js.map +1 -1
- package/sqs/index.d.ts +4 -5
- package/sqs/index.js +18 -37
- package/sqs/index.js.map +1 -1
- package/sqs/plugins/SQSEventHandler.d.ts +4 -4
- package/sqs/plugins/SQSEventHandler.js +3 -11
- package/sqs/plugins/SQSEventHandler.js.map +1 -1
- package/sqs/register.js +6 -8
- package/sqs/register.js.map +1 -1
- package/types.d.ts +9 -10
- package/types.js +3 -31
- package/types.js.map +1 -1
- package/utils/composedHandler.d.ts +3 -3
- package/utils/composedHandler.js +3 -10
- package/utils/composedHandler.js.map +1 -1
- package/utils/index.d.ts +2 -2
- package/utils/index.js +2 -27
- package/utils/index.js.map +1 -1
- package/utils/timer/CustomTimer.js +1 -8
- package/utils/timer/CustomTimer.js.map +1 -1
- package/utils/timer/Timer.d.ts +1 -1
- package/utils/timer/Timer.js +1 -8
- package/utils/timer/Timer.js.map +1 -1
- package/utils/timer/abstractions/ITimer.js +1 -5
- package/utils/timer/factory.d.ts +3 -3
- package/utils/timer/factory.js +5 -12
- package/utils/timer/factory.js.map +1 -1
- package/utils/timer/index.d.ts +4 -4
- package/utils/timer/index.js +3 -49
- package/utils/timer/index.js.map +1 -1
package/utils/timer/Timer.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Timer = void 0;
|
|
7
|
-
class Timer {
|
|
1
|
+
export class Timer {
|
|
8
2
|
constructor(cb) {
|
|
9
3
|
this.cb = cb;
|
|
10
4
|
}
|
|
@@ -19,6 +13,5 @@ class Timer {
|
|
|
19
13
|
return 0;
|
|
20
14
|
}
|
|
21
15
|
}
|
|
22
|
-
exports.Timer = Timer;
|
|
23
16
|
|
|
24
17
|
//# sourceMappingURL=Timer.js.map
|
package/utils/timer/Timer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Timer","constructor","cb","getRemainingMilliseconds","getRemainingSeconds","result","Math","floor"
|
|
1
|
+
{"version":3,"names":["Timer","constructor","cb","getRemainingMilliseconds","getRemainingSeconds","result","Math","floor"],"sources":["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"],"mappings":"AAMA,OAAO,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","ignoreList":[]}
|
package/utils/timer/factory.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITimer } from "./abstractions/ITimer";
|
|
2
|
-
import { Context as LambdaContext } from "aws-
|
|
3
|
-
export
|
|
1
|
+
import type { ITimer } from "./abstractions/ITimer.js";
|
|
2
|
+
import type { Context as LambdaContext } from "@webiny/aws-sdk/types/index.js";
|
|
3
|
+
export type ITimerFactoryParams = Pick<LambdaContext, "getRemainingTimeInMillis">;
|
|
4
4
|
export declare const timerFactory: (params?: Partial<ITimerFactoryParams>) => ITimer;
|
package/utils/timer/factory.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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(() => {
|
|
1
|
+
import { CustomTimer } from "./CustomTimer.js";
|
|
2
|
+
import { Timer } from "./Timer.js";
|
|
3
|
+
export const timerFactory = params => {
|
|
4
|
+
const customTimer = new CustomTimer();
|
|
5
|
+
return new Timer(() => {
|
|
12
6
|
if (params?.getRemainingTimeInMillis) {
|
|
13
7
|
return params.getRemainingTimeInMillis();
|
|
14
8
|
}
|
|
15
9
|
return customTimer.getRemainingMilliseconds();
|
|
16
10
|
});
|
|
17
11
|
};
|
|
18
|
-
exports.timerFactory = timerFactory;
|
|
19
12
|
|
|
20
13
|
//# sourceMappingURL=factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["CustomTimer","Timer","timerFactory","params","customTimer","getRemainingTimeInMillis","getRemainingMilliseconds"],"sources":["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"],"mappings":"AACA,SAASA,WAAW;AAEpB,SAASC,KAAK;AAId,OAAO,MAAMC,YAAY,GAAIC,MAAqC,IAAa;EAC3E,MAAMC,WAAW,GAAG,IAAIJ,WAAW,CAAC,CAAC;EAErC,OAAO,IAAIC,KAAK,CAAC,MAAM;IACnB,IAAIE,MAAM,EAAEE,wBAAwB,EAAE;MAClC,OAAOF,MAAM,CAACE,wBAAwB,CAAC,CAAC;IAC5C;IACA,OAAOD,WAAW,CAACE,wBAAwB,CAAC,CAAC;EACjD,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/utils/timer/index.d.ts
CHANGED
|
@@ -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";
|
package/utils/timer/index.js
CHANGED
|
@@ -1,51 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
});
|
|
1
|
+
export * from "./CustomTimer.js";
|
|
2
|
+
export * from "./factory.js";
|
|
3
|
+
export * from "./Timer.js";
|
|
50
4
|
|
|
51
5
|
//# sourceMappingURL=index.js.map
|
package/utils/timer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export type * from \"./abstractions/ITimer.js\";\nexport * from \"./CustomTimer.js\";\nexport * from \"./factory.js\";\nexport * from \"./Timer.js\";\n"],"mappings":"AACA;AACA;AACA","ignoreList":[]}
|