@webiny/api-headless-cms-bulk-actions-aws 0.0.0-unstable.0d717d18dd
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/BulkActionsEventBridgeLambdaHandler.d.ts +15 -0
- package/BulkActionsEventBridgeLambdaHandler.js +32 -0
- package/BulkActionsEventBridgeLambdaHandler.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/index.d.ts +4 -0
- package/index.js +11 -0
- package/index.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EventBridgeEvent } from "@webiny/aws-sdk/types/index.js";
|
|
2
|
+
import { EventBridgeEventHandler, type EventBridgeResult } from "@webiny/event-handler-aws/abstractions/handlers/EventBridgeEventHandler.js";
|
|
3
|
+
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
4
|
+
import { TaskService } from "@webiny/api-core/features/task/TaskService/abstractions.js";
|
|
5
|
+
import type { EventContext } from "@webiny/event-handler-core";
|
|
6
|
+
declare class BulkActionsEventBridgeLambdaHandlerImpl implements EventBridgeEventHandler.Interface {
|
|
7
|
+
private readonly tenantContext;
|
|
8
|
+
private readonly taskService;
|
|
9
|
+
constructor(tenantContext: TenantContext.Interface, taskService: TaskService.Interface);
|
|
10
|
+
execute(eventCtx: EventContext<EventBridgeEvent<string, any>>): Promise<EventBridgeResult>;
|
|
11
|
+
}
|
|
12
|
+
export declare const BulkActionsEventBridgeLambdaHandler: typeof BulkActionsEventBridgeLambdaHandlerImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/event-handler-aws/abstractions/handlers/EventBridgeEventHandler.js").IEventBridgeEventHandler>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EventBridgeEventHandler } from "@webiny/event-handler-aws/abstractions/handlers/EventBridgeEventHandler.js";
|
|
2
|
+
import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
|
|
3
|
+
import { TaskService } from "@webiny/api-core/features/task/TaskService/abstractions.js";
|
|
4
|
+
const DETAIL_TYPE = "WebinyEmptyTrashBin";
|
|
5
|
+
class BulkActionsEventBridgeLambdaHandlerImpl {
|
|
6
|
+
constructor(tenantContext, taskService){
|
|
7
|
+
this.tenantContext = tenantContext;
|
|
8
|
+
this.taskService = taskService;
|
|
9
|
+
}
|
|
10
|
+
async execute(eventCtx) {
|
|
11
|
+
if (eventCtx.event["detail-type"] !== DETAIL_TYPE) return {
|
|
12
|
+
success: true,
|
|
13
|
+
message: "Not a bulk action event."
|
|
14
|
+
};
|
|
15
|
+
await this.tenantContext.withRootTenant(async ()=>await this.taskService.trigger({
|
|
16
|
+
definition: "hcmsEntriesEmptyTrashBins"
|
|
17
|
+
}));
|
|
18
|
+
return {
|
|
19
|
+
success: true
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const BulkActionsEventBridgeLambdaHandler = EventBridgeEventHandler.createImplementation({
|
|
24
|
+
implementation: BulkActionsEventBridgeLambdaHandlerImpl,
|
|
25
|
+
dependencies: [
|
|
26
|
+
TenantContext,
|
|
27
|
+
TaskService
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
export { BulkActionsEventBridgeLambdaHandler };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=BulkActionsEventBridgeLambdaHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BulkActionsEventBridgeLambdaHandler.js","sources":["../src/BulkActionsEventBridgeLambdaHandler.ts"],"sourcesContent":["import type { EventBridgeEvent } from \"@webiny/aws-sdk/types/index.js\";\nimport {\n EventBridgeEventHandler,\n type EventBridgeResult\n} from \"@webiny/event-handler-aws/abstractions/handlers/EventBridgeEventHandler.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/abstractions.js\";\nimport type { EventContext } from \"@webiny/event-handler-core\";\n\nconst DETAIL_TYPE = \"WebinyEmptyTrashBin\";\n\nclass BulkActionsEventBridgeLambdaHandlerImpl implements EventBridgeEventHandler.Interface {\n public constructor(\n private readonly tenantContext: TenantContext.Interface,\n private readonly taskService: TaskService.Interface\n ) {}\n\n public async execute(\n eventCtx: EventContext<EventBridgeEvent<string, any>>\n ): Promise<EventBridgeResult> {\n if (eventCtx.event[\"detail-type\"] !== DETAIL_TYPE) {\n return {\n success: true,\n message: \"Not a bulk action event.\"\n };\n }\n\n await this.tenantContext.withRootTenant(async () => {\n return await this.taskService.trigger({\n definition: \"hcmsEntriesEmptyTrashBins\"\n });\n });\n\n return { success: true };\n }\n}\n\nexport const BulkActionsEventBridgeLambdaHandler = EventBridgeEventHandler.createImplementation({\n implementation: BulkActionsEventBridgeLambdaHandlerImpl,\n dependencies: [TenantContext, TaskService]\n});\n"],"names":["DETAIL_TYPE","BulkActionsEventBridgeLambdaHandlerImpl","tenantContext","taskService","eventCtx","BulkActionsEventBridgeLambdaHandler","EventBridgeEventHandler","TenantContext","TaskService"],"mappings":";;;AASA,MAAMA,cAAc;AAEpB,MAAMC;IACF,YACqBC,aAAsC,EACtCC,WAAkC,CACrD;aAFmBD,aAAa,GAAbA;aACAC,WAAW,GAAXA;IAClB;IAEH,MAAa,QACTC,QAAqD,EAC3B;QAC1B,IAAIA,SAAS,KAAK,CAAC,cAAc,KAAKJ,aAClC,OAAO;YACH,SAAS;YACT,SAAS;QACb;QAGJ,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,UAC7B,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;gBAClC,YAAY;YAChB;QAGJ,OAAO;YAAE,SAAS;QAAK;IAC3B;AACJ;AAEO,MAAMK,sCAAsCC,wBAAwB,oBAAoB,CAAC;IAC5F,gBAAgBL;IAChB,cAAc;QAACM;QAAeC;KAAY;AAC9C"}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Webiny
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @webiny/api-headless-cms-bulk-actions-aws
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
6
|
+
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { BulkActionsEventBridgeLambdaHandler } from "./BulkActionsEventBridgeLambdaHandler.js";
|
|
3
|
+
const BulkActionsEventBridgeLambdaHandlerFeature = createFeature({
|
|
4
|
+
name: "BulkActionsEventBridgeLambdaHandler",
|
|
5
|
+
register: (container)=>{
|
|
6
|
+
container.register(BulkActionsEventBridgeLambdaHandler);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { BulkActionsEventBridgeLambdaHandlerFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { BulkActionsEventBridgeLambdaHandler } from \"./BulkActionsEventBridgeLambdaHandler.js\";\n\nexport const BulkActionsEventBridgeLambdaHandlerFeature = createFeature({\n name: \"BulkActionsEventBridgeLambdaHandler\",\n register: container => {\n container.register(BulkActionsEventBridgeLambdaHandler);\n }\n});\n"],"names":["BulkActionsEventBridgeLambdaHandlerFeature","createFeature","container","BulkActionsEventBridgeLambdaHandler"],"mappings":";;AAGO,MAAMA,6CAA6CC,cAAc;IACpE,MAAM;IACN,UAAUC,CAAAA;QACNA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webiny/api-headless-cms-bulk-actions-aws",
|
|
3
|
+
"version": "0.0.0-unstable.0d717d18dd",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
9
|
+
"description": "AWS EventBridge handler for Webiny Headless CMS bulk actions",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"api-headless-cms-bulk-actions-aws:base"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/webiny/webiny-js.git",
|
|
16
|
+
"directory": "packages/api-headless-cms-bulk-actions-aws"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@webiny/aws-sdk": "0.0.0-unstable.0d717d18dd",
|
|
21
|
+
"@webiny/event-handler-aws": "0.0.0-unstable.0d717d18dd",
|
|
22
|
+
"@webiny/event-handler-core": "0.0.0-unstable.0d717d18dd",
|
|
23
|
+
"@webiny/feature": "0.0.0-unstable.0d717d18dd"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@webiny/di": ">=0.2.3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@webiny/api-core": "0.0.0-unstable.0d717d18dd",
|
|
30
|
+
"@webiny/build-tools": "0.0.0-unstable.0d717d18dd",
|
|
31
|
+
"@webiny/di": "1.0.2",
|
|
32
|
+
"typescript": "7.0.2",
|
|
33
|
+
"vitest": "4.1.10"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"webiny": {
|
|
39
|
+
"publishFrom": "dist"
|
|
40
|
+
}
|
|
41
|
+
}
|