@webiny/api-scheduler 0.0.0-unstable.61c048f412
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/LICENSE +21 -0
- package/README.md +11 -0
- package/constants.d.ts +8 -0
- package/constants.js +10 -0
- package/constants.js.map +1 -0
- package/context.d.ts +7 -0
- package/context.js +41 -0
- package/context.js.map +1 -0
- package/createEventHandler.d.ts +13 -0
- package/createEventHandler.js +50 -0
- package/createEventHandler.js.map +1 -0
- package/createScheduler.d.ts +6 -0
- package/createScheduler.js +11 -0
- package/createScheduler.js.map +1 -0
- package/domain/SchedulePrivateModel.d.ts +8 -0
- package/domain/SchedulePrivateModel.js +29 -0
- package/domain/SchedulePrivateModel.js.map +1 -0
- package/domain/ScheduledActionId.d.ts +8 -0
- package/domain/ScheduledActionId.js +9 -0
- package/domain/ScheduledActionId.js.map +1 -0
- package/domain/ScheduledActionIdWithVersion.d.ts +3 -0
- package/domain/ScheduledActionIdWithVersion.js +10 -0
- package/domain/ScheduledActionIdWithVersion.js.map +1 -0
- package/domain/errors.d.ts +37 -0
- package/domain/errors.js +63 -0
- package/domain/errors.js.map +1 -0
- package/domain/isValidDate.d.ts +6 -0
- package/domain/isValidDate.js +13 -0
- package/domain/isValidDate.js.map +1 -0
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.d.ts +26 -0
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.js +74 -0
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.js.map +1 -0
- package/features/CancelScheduledAction/abstractions.d.ts +24 -0
- package/features/CancelScheduledAction/abstractions.js +13 -0
- package/features/CancelScheduledAction/abstractions.js.map +1 -0
- package/features/CancelScheduledAction/feature.d.ts +7 -0
- package/features/CancelScheduledAction/feature.js +17 -0
- package/features/CancelScheduledAction/feature.js.map +1 -0
- package/features/CancelScheduledAction/index.d.ts +1 -0
- package/features/CancelScheduledAction/index.js +3 -0
- package/features/CancelScheduledAction/index.js.map +1 -0
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.d.ts +33 -0
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.js +106 -0
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.js.map +1 -0
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.d.ts +19 -0
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.js +32 -0
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.js.map +1 -0
- package/features/ExecuteScheduledAction/abstractions.d.ts +46 -0
- package/features/ExecuteScheduledAction/abstractions.js +41 -0
- package/features/ExecuteScheduledAction/abstractions.js.map +1 -0
- package/features/ExecuteScheduledAction/feature.d.ts +7 -0
- package/features/ExecuteScheduledAction/feature.js +19 -0
- package/features/ExecuteScheduledAction/feature.js.map +1 -0
- package/features/ExecuteScheduledAction/index.d.ts +1 -0
- package/features/ExecuteScheduledAction/index.js +3 -0
- package/features/ExecuteScheduledAction/index.js.map +1 -0
- package/features/GetScheduledAction/GetScheduledActionUseCase.d.ts +24 -0
- package/features/GetScheduledAction/GetScheduledActionUseCase.js +49 -0
- package/features/GetScheduledAction/GetScheduledActionUseCase.js.map +1 -0
- package/features/GetScheduledAction/abstractions.d.ts +26 -0
- package/features/GetScheduledAction/abstractions.js +14 -0
- package/features/GetScheduledAction/abstractions.js.map +1 -0
- package/features/GetScheduledAction/feature.d.ts +7 -0
- package/features/GetScheduledAction/feature.js +17 -0
- package/features/GetScheduledAction/feature.js.map +1 -0
- package/features/GetScheduledAction/index.d.ts +1 -0
- package/features/GetScheduledAction/index.js +3 -0
- package/features/GetScheduledAction/index.js.map +1 -0
- package/features/ListScheduledActions/ListScheduledActionsUseCase.d.ts +27 -0
- package/features/ListScheduledActions/ListScheduledActionsUseCase.js +77 -0
- package/features/ListScheduledActions/ListScheduledActionsUseCase.js.map +1 -0
- package/features/ListScheduledActions/abstractions.d.ts +49 -0
- package/features/ListScheduledActions/abstractions.js +15 -0
- package/features/ListScheduledActions/abstractions.js.map +1 -0
- package/features/ListScheduledActions/feature.d.ts +7 -0
- package/features/ListScheduledActions/feature.js +17 -0
- package/features/ListScheduledActions/feature.js.map +1 -0
- package/features/ListScheduledActions/index.d.ts +1 -0
- package/features/ListScheduledActions/index.js +3 -0
- package/features/ListScheduledActions/index.js.map +1 -0
- package/features/RunAction/RunActionUseCase.d.ts +23 -0
- package/features/RunAction/RunActionUseCase.js +37 -0
- package/features/RunAction/RunActionUseCase.js.map +1 -0
- package/features/RunAction/abstractions.d.ts +35 -0
- package/features/RunAction/abstractions.js +15 -0
- package/features/RunAction/abstractions.js.map +1 -0
- package/features/RunAction/feature.d.ts +7 -0
- package/features/RunAction/feature.js +17 -0
- package/features/RunAction/feature.js.map +1 -0
- package/features/RunAction/index.d.ts +1 -0
- package/features/RunAction/index.js +3 -0
- package/features/RunAction/index.js.map +1 -0
- package/features/ScheduleAction/ScheduleActionUseCase.d.ts +45 -0
- package/features/ScheduleAction/ScheduleActionUseCase.js +164 -0
- package/features/ScheduleAction/ScheduleActionUseCase.js.map +1 -0
- package/features/ScheduleAction/abstractions.d.ts +35 -0
- package/features/ScheduleAction/abstractions.js +13 -0
- package/features/ScheduleAction/abstractions.js.map +1 -0
- package/features/ScheduleAction/feature.d.ts +7 -0
- package/features/ScheduleAction/feature.js +17 -0
- package/features/ScheduleAction/feature.js.map +1 -0
- package/features/ScheduleAction/index.d.ts +1 -0
- package/features/ScheduleAction/index.js +3 -0
- package/features/ScheduleAction/index.js.map +1 -0
- package/features/SchedulerFeature.d.ts +8 -0
- package/features/SchedulerFeature.js +29 -0
- package/features/SchedulerFeature.js.map +1 -0
- package/features/SchedulerService/EventBridgeSchedulerService.d.ts +26 -0
- package/features/SchedulerService/EventBridgeSchedulerService.js +131 -0
- package/features/SchedulerService/EventBridgeSchedulerService.js.map +1 -0
- package/features/SchedulerService/VoidSchedulerService.d.ts +15 -0
- package/features/SchedulerService/VoidSchedulerService.js +31 -0
- package/features/SchedulerService/VoidSchedulerService.js.map +1 -0
- package/index.d.ts +10 -0
- package/index.js +13 -0
- package/index.js.map +1 -0
- package/manifest.d.ts +17 -0
- package/manifest.js +39 -0
- package/manifest.js.map +1 -0
- package/package.json +55 -0
- package/shared/abstractions.d.ts +77 -0
- package/shared/abstractions.js +32 -0
- package/shared/abstractions.js.map +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CancelScheduledAction Feature
|
|
3
|
+
*
|
|
4
|
+
* Provides the ability to cancel a scheduled action.
|
|
5
|
+
* Removes both the EventBridge schedule and the CMS entry.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CancelScheduledActionFeature: import("@webiny/feature/api/createFeature.js").FeatureDefinition<unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { CancelScheduledActionUseCase } from "./CancelScheduledActionUseCase.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CancelScheduledAction Feature
|
|
6
|
+
*
|
|
7
|
+
* Provides the ability to cancel a scheduled action.
|
|
8
|
+
* Removes both the EventBridge schedule and the CMS entry.
|
|
9
|
+
*/
|
|
10
|
+
export const CancelScheduledActionFeature = createFeature({
|
|
11
|
+
name: "CancelScheduledAction",
|
|
12
|
+
register(container) {
|
|
13
|
+
container.register(CancelScheduledActionUseCase);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFeature","CancelScheduledActionUseCase","CancelScheduledActionFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CancelScheduledActionUseCase } from \"./CancelScheduledActionUseCase.js\";\n\n/**\n * CancelScheduledAction Feature\n *\n * Provides the ability to cancel a scheduled action.\n * Removes both the EventBridge schedule and the CMS entry.\n */\nexport const CancelScheduledActionFeature = createFeature({\n name: \"CancelScheduledAction\",\n register(container) {\n container.register(CancelScheduledActionUseCase);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,4BAA4B;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAGF,aAAa,CAAC;EACtDG,IAAI,EAAE,uBAAuB;EAC7BC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,4BAA4B,CAAC;EACpD;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./abstractions.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ExecuteScheduledActionUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
|
+
import { GetScheduledActionUseCase } from "../../features/GetScheduledAction/abstractions.js";
|
|
4
|
+
import { ScheduledActionHandler, ScheduledActionModel } from "../../shared/abstractions.js";
|
|
5
|
+
import { DeleteEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js";
|
|
6
|
+
import { UpdateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js";
|
|
7
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
8
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
9
|
+
/**
|
|
10
|
+
* Executes a scheduled action
|
|
11
|
+
*
|
|
12
|
+
* Flow:
|
|
13
|
+
* 1. Load scheduled action from CMS
|
|
14
|
+
* 2. Find registered handler for namespace + actionType
|
|
15
|
+
* 3. Execute handler
|
|
16
|
+
* 4. Delete schedule entry on success
|
|
17
|
+
* 5. Update entry with error on failure (for debugging/audit)
|
|
18
|
+
*/
|
|
19
|
+
declare class ExecuteScheduledActionUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
20
|
+
private getScheduledActionUseCase;
|
|
21
|
+
private actionHandler;
|
|
22
|
+
private deleteEntryUseCase;
|
|
23
|
+
private updateEntryUseCase;
|
|
24
|
+
private model;
|
|
25
|
+
private identityContext;
|
|
26
|
+
constructor(getScheduledActionUseCase: GetScheduledActionUseCase.Interface, actionHandler: ScheduledActionHandler.Interface, deleteEntryUseCase: DeleteEntryUseCase.Interface, updateEntryUseCase: UpdateEntryUseCase.Interface, model: ScheduledActionModel.Interface, identityContext: IdentityContext.Interface);
|
|
27
|
+
execute<T extends GenericRecord>(id: string): Promise<Result<void, UseCaseAbstraction.Error>>;
|
|
28
|
+
private executeAction;
|
|
29
|
+
}
|
|
30
|
+
export declare const ExecuteScheduledActionUseCase: typeof ExecuteScheduledActionUseCaseImpl & {
|
|
31
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IExecuteScheduledActionUseCase>;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ExecuteScheduledActionUseCase as UseCaseAbstraction, ExecutionFailedError, HandlerNotFoundError } from "./abstractions.js";
|
|
3
|
+
import { GetScheduledActionUseCase } from "../GetScheduledAction/abstractions.js";
|
|
4
|
+
import { ScheduledActionHandler, ScheduledActionModel } from "../../shared/abstractions.js";
|
|
5
|
+
import { ScheduledActionNotFoundError, ScheduledActionPersistenceError } from "../../domain/errors.js";
|
|
6
|
+
import { DeleteEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js";
|
|
7
|
+
import { UpdateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js";
|
|
8
|
+
import { ScheduledActionIdWithVersion } from "../../domain/ScheduledActionIdWithVersion.js";
|
|
9
|
+
import { AuthenticatedIdentity, IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Executes a scheduled action
|
|
13
|
+
*
|
|
14
|
+
* Flow:
|
|
15
|
+
* 1. Load scheduled action from CMS
|
|
16
|
+
* 2. Find registered handler for namespace + actionType
|
|
17
|
+
* 3. Execute handler
|
|
18
|
+
* 4. Delete schedule entry on success
|
|
19
|
+
* 5. Update entry with error on failure (for debugging/audit)
|
|
20
|
+
*/
|
|
21
|
+
class ExecuteScheduledActionUseCaseImpl {
|
|
22
|
+
constructor(getScheduledActionUseCase, actionHandler, deleteEntryUseCase, updateEntryUseCase, model, identityContext) {
|
|
23
|
+
this.getScheduledActionUseCase = getScheduledActionUseCase;
|
|
24
|
+
this.actionHandler = actionHandler;
|
|
25
|
+
this.deleteEntryUseCase = deleteEntryUseCase;
|
|
26
|
+
this.updateEntryUseCase = updateEntryUseCase;
|
|
27
|
+
this.model = model;
|
|
28
|
+
this.identityContext = identityContext;
|
|
29
|
+
}
|
|
30
|
+
async execute(id) {
|
|
31
|
+
// return this.identityContext.withoutAuthorization(async () => {
|
|
32
|
+
return this.executeAction(id);
|
|
33
|
+
// });
|
|
34
|
+
}
|
|
35
|
+
async executeAction(id) {
|
|
36
|
+
// Load scheduled action
|
|
37
|
+
const getResult = await this.getScheduledActionUseCase.execute(id);
|
|
38
|
+
if (getResult.isFail()) {
|
|
39
|
+
const error = getResult.error;
|
|
40
|
+
if (error.code === "Scheduler/ScheduledAction/NotFound") {
|
|
41
|
+
return Result.fail(new ScheduledActionNotFoundError(id));
|
|
42
|
+
}
|
|
43
|
+
return Result.fail(error);
|
|
44
|
+
}
|
|
45
|
+
const scheduledAction = getResult.value;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* When executing the scheduled action, we need a user which has access to perform the action.
|
|
49
|
+
* We will set a user which created the scheduled action as the execution user.
|
|
50
|
+
*/
|
|
51
|
+
const scheduledBy = scheduledAction.scheduledBy;
|
|
52
|
+
this.identityContext.setIdentity(new AuthenticatedIdentity({
|
|
53
|
+
id: scheduledBy.id,
|
|
54
|
+
type: scheduledBy.type,
|
|
55
|
+
displayName: scheduledBy.displayName ?? "",
|
|
56
|
+
context: {
|
|
57
|
+
canAccessTenant: true
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
60
|
+
const scheduleId = ScheduledActionIdWithVersion.from(id);
|
|
61
|
+
|
|
62
|
+
// Check if the handler can handle this action
|
|
63
|
+
if (!this.actionHandler.canHandle(scheduledAction.namespace, scheduledAction.actionType)) {
|
|
64
|
+
const error = new HandlerNotFoundError(scheduledAction.namespace, scheduledAction.actionType);
|
|
65
|
+
|
|
66
|
+
// Update entry with error for debugging
|
|
67
|
+
await this.updateEntryUseCase.execute(this.model, scheduleId, {
|
|
68
|
+
values: {
|
|
69
|
+
error: error.message
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return Result.fail(error);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Execute handler
|
|
76
|
+
try {
|
|
77
|
+
await this.actionHandler.handle(scheduledAction);
|
|
78
|
+
|
|
79
|
+
// Delete schedule entry on success
|
|
80
|
+
const deleteResult = await this.deleteEntryUseCase.execute(this.model, scheduleId, {
|
|
81
|
+
force: true,
|
|
82
|
+
permanently: true
|
|
83
|
+
});
|
|
84
|
+
if (deleteResult.isFail()) {
|
|
85
|
+
return Result.fail(new ScheduledActionPersistenceError(new Error(deleteResult.error.message)));
|
|
86
|
+
}
|
|
87
|
+
return Result.ok();
|
|
88
|
+
} catch (error) {
|
|
89
|
+
const executionError = new ExecutionFailedError(`Failed to execute scheduled action: ${error.message}`, error);
|
|
90
|
+
|
|
91
|
+
// Update entry with error for debugging
|
|
92
|
+
await this.updateEntryUseCase.execute(this.model, scheduleId, {
|
|
93
|
+
values: {
|
|
94
|
+
error: executionError.message
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return Result.fail(executionError);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export const ExecuteScheduledActionUseCase = UseCaseAbstraction.createImplementation({
|
|
102
|
+
implementation: ExecuteScheduledActionUseCaseImpl,
|
|
103
|
+
dependencies: [GetScheduledActionUseCase, ScheduledActionHandler, DeleteEntryUseCase, UpdateEntryUseCase, ScheduledActionModel, IdentityContext]
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=ExecuteScheduledActionUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Result","ExecuteScheduledActionUseCase","UseCaseAbstraction","ExecutionFailedError","HandlerNotFoundError","GetScheduledActionUseCase","ScheduledActionHandler","ScheduledActionModel","ScheduledActionNotFoundError","ScheduledActionPersistenceError","DeleteEntryUseCase","UpdateEntryUseCase","ScheduledActionIdWithVersion","AuthenticatedIdentity","IdentityContext","ExecuteScheduledActionUseCaseImpl","constructor","getScheduledActionUseCase","actionHandler","deleteEntryUseCase","updateEntryUseCase","model","identityContext","execute","id","executeAction","getResult","isFail","error","code","fail","scheduledAction","value","scheduledBy","setIdentity","type","displayName","context","canAccessTenant","scheduleId","from","canHandle","namespace","actionType","values","message","handle","deleteResult","force","permanently","Error","ok","executionError","createImplementation","implementation","dependencies"],"sources":["ExecuteScheduledActionUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {\n ExecuteScheduledActionUseCase as UseCaseAbstraction,\n ExecutionFailedError,\n HandlerNotFoundError\n} from \"./abstractions.js\";\nimport { GetScheduledActionUseCase } from \"~/features/GetScheduledAction/abstractions.js\";\nimport {\n type IScheduledAction,\n ScheduledActionHandler,\n ScheduledActionModel\n} from \"~/shared/abstractions.js\";\nimport { ScheduledActionNotFoundError, ScheduledActionPersistenceError } from \"~/domain/errors.js\";\nimport { DeleteEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js\";\nimport { UpdateEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js\";\nimport { ScheduledActionIdWithVersion } from \"~/domain/ScheduledActionIdWithVersion.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport {\n AuthenticatedIdentity,\n IdentityContext\n} from \"@webiny/api-core/features/security/IdentityContext/index.js\";\n\n/**\n * Executes a scheduled action\n *\n * Flow:\n * 1. Load scheduled action from CMS\n * 2. Find registered handler for namespace + actionType\n * 3. Execute handler\n * 4. Delete schedule entry on success\n * 5. Update entry with error on failure (for debugging/audit)\n */\nclass ExecuteScheduledActionUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private getScheduledActionUseCase: GetScheduledActionUseCase.Interface,\n private actionHandler: ScheduledActionHandler.Interface,\n private deleteEntryUseCase: DeleteEntryUseCase.Interface,\n private updateEntryUseCase: UpdateEntryUseCase.Interface,\n private model: ScheduledActionModel.Interface,\n private identityContext: IdentityContext.Interface\n ) {}\n\n public async execute<T extends GenericRecord>(\n id: string\n ): Promise<Result<void, UseCaseAbstraction.Error>> {\n // return this.identityContext.withoutAuthorization(async () => {\n return this.executeAction<T>(id);\n // });\n }\n\n private async executeAction<T extends GenericRecord>(\n id: string\n ): Promise<Result<void, UseCaseAbstraction.Error>> {\n // Load scheduled action\n const getResult = await this.getScheduledActionUseCase.execute<T>(id);\n\n if (getResult.isFail()) {\n const error = getResult.error;\n\n if (error.code === \"Scheduler/ScheduledAction/NotFound\") {\n return Result.fail(new ScheduledActionNotFoundError(id));\n }\n\n return Result.fail(error);\n }\n const scheduledAction = getResult.value;\n\n /**\n * When executing the scheduled action, we need a user which has access to perform the action.\n * We will set a user which created the scheduled action as the execution user.\n */\n const scheduledBy = scheduledAction.scheduledBy;\n this.identityContext.setIdentity(\n new AuthenticatedIdentity({\n id: scheduledBy.id,\n type: scheduledBy.type,\n displayName: scheduledBy.displayName ?? \"\",\n context: {\n canAccessTenant: true\n }\n })\n );\n\n const scheduleId = ScheduledActionIdWithVersion.from(id);\n\n // Check if the handler can handle this action\n if (!this.actionHandler.canHandle(scheduledAction.namespace, scheduledAction.actionType)) {\n const error = new HandlerNotFoundError(\n scheduledAction.namespace,\n scheduledAction.actionType\n );\n\n // Update entry with error for debugging\n await this.updateEntryUseCase.execute<IScheduledAction<T>>(this.model, scheduleId, {\n values: {\n error: error.message\n }\n });\n\n return Result.fail(error);\n }\n\n // Execute handler\n try {\n await this.actionHandler.handle(scheduledAction);\n\n // Delete schedule entry on success\n const deleteResult = await this.deleteEntryUseCase.execute(this.model, scheduleId, {\n force: true,\n permanently: true\n });\n\n if (deleteResult.isFail()) {\n return Result.fail(\n new ScheduledActionPersistenceError(new Error(deleteResult.error.message))\n );\n }\n\n return Result.ok();\n } catch (error) {\n const executionError = new ExecutionFailedError(\n `Failed to execute scheduled action: ${(error as Error).message}`,\n error as Error\n );\n\n // Update entry with error for debugging\n await this.updateEntryUseCase.execute<IScheduledAction<T>>(this.model, scheduleId, {\n values: {\n error: executionError.message\n }\n });\n\n return Result.fail(executionError);\n }\n }\n}\n\nexport const ExecuteScheduledActionUseCase = UseCaseAbstraction.createImplementation({\n implementation: ExecuteScheduledActionUseCaseImpl,\n dependencies: [\n GetScheduledActionUseCase,\n ScheduledActionHandler,\n DeleteEntryUseCase,\n UpdateEntryUseCase,\n ScheduledActionModel,\n IdentityContext\n ]\n});\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IScheduledAction, ScheduledActionHandler } from "../../shared/abstractions.js";
|
|
2
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Composite handler that iterates through all registered handlers
|
|
5
|
+
* to find one that can handle the given namespace + actionType combination.
|
|
6
|
+
*
|
|
7
|
+
* This is registered as a composite via container.registerComposite(),
|
|
8
|
+
* and the DI container will automatically inject all registered handlers.
|
|
9
|
+
*/
|
|
10
|
+
declare class ScheduledActionHandlerCompositeImpl implements ScheduledActionHandler.Interface {
|
|
11
|
+
private handlers;
|
|
12
|
+
constructor(handlers: ScheduledActionHandler.Interface[]);
|
|
13
|
+
canHandle(namespace: string, actionType: string): boolean;
|
|
14
|
+
handle<T extends GenericRecord>(action: IScheduledAction<T>): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare const ScheduledActionHandlerComposite: typeof ScheduledActionHandlerCompositeImpl & {
|
|
17
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/shared/abstractions.js").IScheduledActionHandler>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ScheduledActionHandler } from "../../shared/abstractions.js";
|
|
2
|
+
/**
|
|
3
|
+
* Composite handler that iterates through all registered handlers
|
|
4
|
+
* to find one that can handle the given namespace + actionType combination.
|
|
5
|
+
*
|
|
6
|
+
* This is registered as a composite via container.registerComposite(),
|
|
7
|
+
* and the DI container will automatically inject all registered handlers.
|
|
8
|
+
*/
|
|
9
|
+
class ScheduledActionHandlerCompositeImpl {
|
|
10
|
+
constructor(handlers) {
|
|
11
|
+
this.handlers = handlers;
|
|
12
|
+
}
|
|
13
|
+
canHandle(namespace, actionType) {
|
|
14
|
+
return this.handlers.some(handler => handler.canHandle(namespace, actionType));
|
|
15
|
+
}
|
|
16
|
+
async handle(action) {
|
|
17
|
+
const handler = this.handlers.find(h => h.canHandle(action.namespace, action.actionType));
|
|
18
|
+
if (!handler) {
|
|
19
|
+
console.log(`No handler found for namespace "${action.namespace}" and actionType "${action.actionType}"`);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
await handler.handle(action);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const ScheduledActionHandlerComposite = ScheduledActionHandler.createComposite({
|
|
26
|
+
implementation: ScheduledActionHandlerCompositeImpl,
|
|
27
|
+
dependencies: [[ScheduledActionHandler, {
|
|
28
|
+
multiple: true
|
|
29
|
+
}]]
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=ScheduledActionHandlerComposite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ScheduledActionHandler","ScheduledActionHandlerCompositeImpl","constructor","handlers","canHandle","namespace","actionType","some","handler","handle","action","find","h","console","log","ScheduledActionHandlerComposite","createComposite","implementation","dependencies","multiple"],"sources":["ScheduledActionHandlerComposite.ts"],"sourcesContent":["import { IScheduledAction, ScheduledActionHandler } from \"~/shared/abstractions.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\n/**\n * Composite handler that iterates through all registered handlers\n * to find one that can handle the given namespace + actionType combination.\n *\n * This is registered as a composite via container.registerComposite(),\n * and the DI container will automatically inject all registered handlers.\n */\nclass ScheduledActionHandlerCompositeImpl implements ScheduledActionHandler.Interface {\n public constructor(private handlers: ScheduledActionHandler.Interface[]) {}\n\n public canHandle(namespace: string, actionType: string): boolean {\n return this.handlers.some(handler => handler.canHandle(namespace, actionType));\n }\n\n public async handle<T extends GenericRecord>(action: IScheduledAction<T>): Promise<void> {\n const handler = this.handlers.find(h => h.canHandle(action.namespace, action.actionType));\n\n if (!handler) {\n console.log(\n `No handler found for namespace \"${action.namespace}\" and actionType \"${action.actionType}\"`\n );\n return;\n }\n\n await handler.handle(action);\n }\n}\n\nexport const ScheduledActionHandlerComposite = ScheduledActionHandler.createComposite({\n implementation: ScheduledActionHandlerCompositeImpl,\n dependencies: [[ScheduledActionHandler, { multiple: true }]]\n});\n"],"mappings":"AAAA,SAA2BA,sBAAsB;AAGjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mCAAmC,CAA6C;EAC3EC,WAAWA,CAASC,QAA4C,EAAE;IAAA,KAA9CA,QAA4C,GAA5CA,QAA4C;EAAG;EAEnEC,SAASA,CAACC,SAAiB,EAAEC,UAAkB,EAAW;IAC7D,OAAO,IAAI,CAACH,QAAQ,CAACI,IAAI,CAACC,OAAO,IAAIA,OAAO,CAACJ,SAAS,CAACC,SAAS,EAAEC,UAAU,CAAC,CAAC;EAClF;EAEA,MAAaG,MAAMA,CAA0BC,MAA2B,EAAiB;IACrF,MAAMF,OAAO,GAAG,IAAI,CAACL,QAAQ,CAACQ,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACR,SAAS,CAACM,MAAM,CAACL,SAAS,EAAEK,MAAM,CAACJ,UAAU,CAAC,CAAC;IAEzF,IAAI,CAACE,OAAO,EAAE;MACVK,OAAO,CAACC,GAAG,CACP,mCAAmCJ,MAAM,CAACL,SAAS,qBAAqBK,MAAM,CAACJ,UAAU,GAC7F,CAAC;MACD;IACJ;IAEA,MAAME,OAAO,CAACC,MAAM,CAACC,MAAM,CAAC;EAChC;AACJ;AAEA,OAAO,MAAMK,+BAA+B,GAAGf,sBAAsB,CAACgB,eAAe,CAAC;EAClFC,cAAc,EAAEhB,mCAAmC;EACnDiB,YAAY,EAAE,CAAC,CAAClB,sBAAsB,EAAE;IAAEmB,QAAQ,EAAE;EAAK,CAAC,CAAC;AAC/D,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ScheduledActionNotFoundError, ScheduledActionPersistenceError } from "../../domain/errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* ExecuteScheduledActionUseCase - Execute a scheduled action
|
|
5
|
+
*
|
|
6
|
+
* This is triggered by EventBridge when a schedule fires.
|
|
7
|
+
* Finds the appropriate handler based on namespace + actionType and executes it.
|
|
8
|
+
*
|
|
9
|
+
* Flow:
|
|
10
|
+
* 1. Load scheduled action from CMS
|
|
11
|
+
* 2. Find registered handler for namespace + actionType
|
|
12
|
+
* 3. Execute handler
|
|
13
|
+
* 4. Delete schedule entry on success
|
|
14
|
+
* 5. Update entry with error on failure
|
|
15
|
+
*/
|
|
16
|
+
export interface IExecuteScheduledActionErrors {
|
|
17
|
+
notFound: ScheduledActionNotFoundError;
|
|
18
|
+
persistence: ScheduledActionPersistenceError;
|
|
19
|
+
handlerNotFound: HandlerNotFoundError;
|
|
20
|
+
executionFailed: ExecutionFailedError;
|
|
21
|
+
}
|
|
22
|
+
type ExecuteScheduledActionError = IExecuteScheduledActionErrors[keyof IExecuteScheduledActionErrors];
|
|
23
|
+
export interface IExecuteScheduledActionUseCase {
|
|
24
|
+
execute(scheduleId: string): Promise<Result<void, ExecuteScheduledActionError>>;
|
|
25
|
+
}
|
|
26
|
+
export declare const ExecuteScheduledActionUseCase: import("@webiny/di").Abstraction<IExecuteScheduledActionUseCase>;
|
|
27
|
+
export declare namespace ExecuteScheduledActionUseCase {
|
|
28
|
+
type Interface = IExecuteScheduledActionUseCase;
|
|
29
|
+
type Error = ExecuteScheduledActionError;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Handler not found error
|
|
33
|
+
*/
|
|
34
|
+
export declare class HandlerNotFoundError extends Error {
|
|
35
|
+
readonly code: "Scheduler/Handler/NotFound";
|
|
36
|
+
constructor(namespace: string, actionType: string);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Execution failed error
|
|
40
|
+
*/
|
|
41
|
+
export declare class ExecutionFailedError extends Error {
|
|
42
|
+
readonly originalError?: Error | undefined;
|
|
43
|
+
readonly code: "Scheduler/Execution/Failed";
|
|
44
|
+
constructor(message: string, originalError?: Error | undefined);
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ExecuteScheduledActionUseCase - Execute a scheduled action
|
|
5
|
+
*
|
|
6
|
+
* This is triggered by EventBridge when a schedule fires.
|
|
7
|
+
* Finds the appropriate handler based on namespace + actionType and executes it.
|
|
8
|
+
*
|
|
9
|
+
* Flow:
|
|
10
|
+
* 1. Load scheduled action from CMS
|
|
11
|
+
* 2. Find registered handler for namespace + actionType
|
|
12
|
+
* 3. Execute handler
|
|
13
|
+
* 4. Delete schedule entry on success
|
|
14
|
+
* 5. Update entry with error on failure
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export const ExecuteScheduledActionUseCase = createAbstraction("ExecuteScheduledActionUseCase");
|
|
18
|
+
/**
|
|
19
|
+
* Handler not found error
|
|
20
|
+
*/
|
|
21
|
+
export class HandlerNotFoundError extends Error {
|
|
22
|
+
code = "Scheduler/Handler/NotFound";
|
|
23
|
+
constructor(namespace, actionType) {
|
|
24
|
+
super(`No handler registered for namespace "${namespace}" and actionType "${actionType}"`);
|
|
25
|
+
this.name = "HandlerNotFoundError";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Execution failed error
|
|
31
|
+
*/
|
|
32
|
+
export class ExecutionFailedError extends Error {
|
|
33
|
+
code = "Scheduler/Execution/Failed";
|
|
34
|
+
constructor(message, originalError) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.originalError = originalError;
|
|
37
|
+
this.name = "ExecutionFailedError";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","ExecuteScheduledActionUseCase","HandlerNotFoundError","Error","code","constructor","namespace","actionType","name","ExecutionFailedError","message","originalError"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport { ScheduledActionNotFoundError, ScheduledActionPersistenceError } from \"~/domain/errors.js\";\n\n/**\n * ExecuteScheduledActionUseCase - Execute a scheduled action\n *\n * This is triggered by EventBridge when a schedule fires.\n * Finds the appropriate handler based on namespace + actionType and executes it.\n *\n * Flow:\n * 1. Load scheduled action from CMS\n * 2. Find registered handler for namespace + actionType\n * 3. Execute handler\n * 4. Delete schedule entry on success\n * 5. Update entry with error on failure\n */\n\nexport interface IExecuteScheduledActionErrors {\n notFound: ScheduledActionNotFoundError;\n persistence: ScheduledActionPersistenceError;\n handlerNotFound: HandlerNotFoundError;\n executionFailed: ExecutionFailedError;\n}\n\ntype ExecuteScheduledActionError =\n IExecuteScheduledActionErrors[keyof IExecuteScheduledActionErrors];\n\nexport interface IExecuteScheduledActionUseCase {\n execute(scheduleId: string): Promise<Result<void, ExecuteScheduledActionError>>;\n}\n\nexport const ExecuteScheduledActionUseCase = createAbstraction<IExecuteScheduledActionUseCase>(\n \"ExecuteScheduledActionUseCase\"\n);\n\nexport namespace ExecuteScheduledActionUseCase {\n export type Interface = IExecuteScheduledActionUseCase;\n export type Error = ExecuteScheduledActionError;\n}\n\n/**\n * Handler not found error\n */\nexport class HandlerNotFoundError extends Error {\n readonly code = \"Scheduler/Handler/NotFound\" as const;\n\n constructor(namespace: string, actionType: string) {\n super(`No handler registered for namespace \"${namespace}\" and actionType \"${actionType}\"`);\n this.name = \"HandlerNotFoundError\";\n }\n}\n\n/**\n * Execution failed error\n */\nexport class ExecutionFailedError extends Error {\n readonly code = \"Scheduler/Execution/Failed\" as const;\n\n constructor(\n message: string,\n public readonly originalError?: Error\n ) {\n super(message);\n this.name = \"ExecutionFailedError\";\n }\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAIvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAO,MAAMC,6BAA6B,GAAGD,iBAAiB,CAC1D,+BACJ,CAAC;AAOD;AACA;AACA;AACA,OAAO,MAAME,oBAAoB,SAASC,KAAK,CAAC;EACnCC,IAAI,GAAG,4BAA4B;EAE5CC,WAAWA,CAACC,SAAiB,EAAEC,UAAkB,EAAE;IAC/C,KAAK,CAAC,wCAAwCD,SAAS,qBAAqBC,UAAU,GAAG,CAAC;IAC1F,IAAI,CAACC,IAAI,GAAG,sBAAsB;EACtC;AACJ;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,SAASN,KAAK,CAAC;EACnCC,IAAI,GAAG,4BAA4B;EAE5CC,WAAWA,CACPK,OAAe,EACCC,aAAqB,EACvC;IACE,KAAK,CAACD,OAAO,CAAC;IAAC,KAFCC,aAAqB,GAArBA,aAAqB;IAGrC,IAAI,CAACH,IAAI,GAAG,sBAAsB;EACtC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExecuteScheduledAction Feature
|
|
3
|
+
*
|
|
4
|
+
* Provides the ability to execute a scheduled action when triggered by EventBridge.
|
|
5
|
+
* Finds the appropriate handler and executes it, then cleans up the schedule entry.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ExecuteScheduledActionFeature: import("@webiny/feature/api/createFeature.js").FeatureDefinition<unknown>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { ExecuteScheduledActionUseCase } from "./ExecuteScheduledActionUseCase.js";
|
|
3
|
+
import { ScheduledActionHandlerComposite } from "./ScheduledActionHandlerComposite.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ExecuteScheduledAction Feature
|
|
7
|
+
*
|
|
8
|
+
* Provides the ability to execute a scheduled action when triggered by EventBridge.
|
|
9
|
+
* Finds the appropriate handler and executes it, then cleans up the schedule entry.
|
|
10
|
+
*/
|
|
11
|
+
export const ExecuteScheduledActionFeature = createFeature({
|
|
12
|
+
name: "ExecuteScheduledAction",
|
|
13
|
+
register(container) {
|
|
14
|
+
container.register(ExecuteScheduledActionUseCase);
|
|
15
|
+
container.registerComposite(ScheduledActionHandlerComposite);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFeature","ExecuteScheduledActionUseCase","ScheduledActionHandlerComposite","ExecuteScheduledActionFeature","name","register","container","registerComposite"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ExecuteScheduledActionUseCase } from \"./ExecuteScheduledActionUseCase.js\";\nimport { ScheduledActionHandlerComposite } from \"~/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.js\";\n\n/**\n * ExecuteScheduledAction Feature\n *\n * Provides the ability to execute a scheduled action when triggered by EventBridge.\n * Finds the appropriate handler and executes it, then cleans up the schedule entry.\n */\nexport const ExecuteScheduledActionFeature = createFeature({\n name: \"ExecuteScheduledAction\",\n register(container) {\n container.register(ExecuteScheduledActionUseCase);\n container.registerComposite(ScheduledActionHandlerComposite);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,6BAA6B;AACtC,SAASC,+BAA+B;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAGH,aAAa,CAAC;EACvDI,IAAI,EAAE,wBAAwB;EAC9BC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACJ,6BAA6B,CAAC;IACjDK,SAAS,CAACC,iBAAiB,CAACL,+BAA+B,CAAC;EAChE;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./abstractions.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetScheduledActionUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
|
+
import type { IScheduledAction } from "../../shared/abstractions.js";
|
|
4
|
+
import { ScheduledActionModel } from "../../shared/abstractions.js";
|
|
5
|
+
import { GetEntryByIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetEntryById/index.js";
|
|
6
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves a scheduled action by its ID
|
|
9
|
+
*
|
|
10
|
+
* Flow:
|
|
11
|
+
* 1. Fetch schedule entry from CMS storage by ID
|
|
12
|
+
* 2. Return null if not found
|
|
13
|
+
* 3. Transform CMS entry to IScheduledAction format
|
|
14
|
+
*/
|
|
15
|
+
declare class GetScheduledActionUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
16
|
+
private getEntryByIdUseCase;
|
|
17
|
+
private model;
|
|
18
|
+
constructor(getEntryByIdUseCase: GetEntryByIdUseCase.Interface, model: ScheduledActionModel.Interface);
|
|
19
|
+
execute<T extends GenericRecord>(id: string): Promise<Result<IScheduledAction<T>, UseCaseAbstraction.Error>>;
|
|
20
|
+
}
|
|
21
|
+
export declare const GetScheduledActionUseCase: typeof GetScheduledActionUseCaseImpl & {
|
|
22
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetScheduledActionUseCase>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetScheduledActionUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
|
+
import { ScheduledActionModel } from "../../shared/abstractions.js";
|
|
4
|
+
import { ScheduledActionNotFoundError, ScheduledActionPersistenceError } from "../../domain/errors.js";
|
|
5
|
+
import { GetEntryByIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetEntryById/index.js";
|
|
6
|
+
import { ScheduledActionIdWithVersion } from "../../domain/ScheduledActionIdWithVersion.js";
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves a scheduled action by its ID
|
|
9
|
+
*
|
|
10
|
+
* Flow:
|
|
11
|
+
* 1. Fetch schedule entry from CMS storage by ID
|
|
12
|
+
* 2. Return null if not found
|
|
13
|
+
* 3. Transform CMS entry to IScheduledAction format
|
|
14
|
+
*/
|
|
15
|
+
class GetScheduledActionUseCaseImpl {
|
|
16
|
+
constructor(getEntryByIdUseCase, model) {
|
|
17
|
+
this.getEntryByIdUseCase = getEntryByIdUseCase;
|
|
18
|
+
this.model = model;
|
|
19
|
+
}
|
|
20
|
+
async execute(id) {
|
|
21
|
+
// Get entry from CMS
|
|
22
|
+
const scheduleId = ScheduledActionIdWithVersion.from(id);
|
|
23
|
+
const entryResult = await this.getEntryByIdUseCase.execute(this.model, scheduleId);
|
|
24
|
+
if (entryResult.isFail()) {
|
|
25
|
+
if (entryResult.error.code === "Cms/Entry/NotFound") {
|
|
26
|
+
return Result.fail(new ScheduledActionNotFoundError(scheduleId));
|
|
27
|
+
}
|
|
28
|
+
return Result.fail(new ScheduledActionPersistenceError(entryResult.error));
|
|
29
|
+
}
|
|
30
|
+
const entry = entryResult.value;
|
|
31
|
+
return Result.ok({
|
|
32
|
+
id: entry.entryId,
|
|
33
|
+
namespace: entry.values.namespace,
|
|
34
|
+
actionType: entry.values.actionType,
|
|
35
|
+
targetId: entry.values.targetId,
|
|
36
|
+
scheduledBy: entry.values.scheduledBy,
|
|
37
|
+
scheduledFor: entry.values.scheduledFor,
|
|
38
|
+
payload: entry.values.payload,
|
|
39
|
+
title: entry.values.title,
|
|
40
|
+
error: entry.values.error
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export const GetScheduledActionUseCase = UseCaseAbstraction.createImplementation({
|
|
45
|
+
implementation: GetScheduledActionUseCaseImpl,
|
|
46
|
+
dependencies: [GetEntryByIdUseCase, ScheduledActionModel]
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=GetScheduledActionUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Result","GetScheduledActionUseCase","UseCaseAbstraction","ScheduledActionModel","ScheduledActionNotFoundError","ScheduledActionPersistenceError","GetEntryByIdUseCase","ScheduledActionIdWithVersion","GetScheduledActionUseCaseImpl","constructor","getEntryByIdUseCase","model","execute","id","scheduleId","from","entryResult","isFail","error","code","fail","entry","value","ok","entryId","namespace","values","actionType","targetId","scheduledBy","scheduledFor","payload","title","createImplementation","implementation","dependencies"],"sources":["GetScheduledActionUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { GetScheduledActionUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { IScheduledAction } from \"~/shared/abstractions.js\";\nimport { ScheduledActionModel } from \"~/shared/abstractions.js\";\nimport { ScheduledActionNotFoundError, ScheduledActionPersistenceError } from \"~/domain/errors.js\";\nimport { GetEntryByIdUseCase } from \"@webiny/api-headless-cms/features/contentEntry/GetEntryById/index.js\";\nimport { ScheduledActionIdWithVersion } from \"~/domain/ScheduledActionIdWithVersion.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\n/**\n * Retrieves a scheduled action by its ID\n *\n * Flow:\n * 1. Fetch schedule entry from CMS storage by ID\n * 2. Return null if not found\n * 3. Transform CMS entry to IScheduledAction format\n */\nclass GetScheduledActionUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private getEntryByIdUseCase: GetEntryByIdUseCase.Interface,\n private model: ScheduledActionModel.Interface\n ) {}\n\n async execute<T extends GenericRecord>(\n id: string\n ): Promise<Result<IScheduledAction<T>, UseCaseAbstraction.Error>> {\n // Get entry from CMS\n const scheduleId = ScheduledActionIdWithVersion.from(id);\n const entryResult = await this.getEntryByIdUseCase.execute<IScheduledAction<T>>(\n this.model,\n scheduleId\n );\n\n if (entryResult.isFail()) {\n if (entryResult.error.code === \"Cms/Entry/NotFound\") {\n return Result.fail(new ScheduledActionNotFoundError(scheduleId));\n }\n\n return Result.fail(new ScheduledActionPersistenceError(entryResult.error));\n }\n\n const entry = entryResult.value;\n\n return Result.ok({\n id: entry.entryId,\n namespace: entry.values.namespace,\n actionType: entry.values.actionType,\n targetId: entry.values.targetId,\n scheduledBy: entry.values.scheduledBy,\n scheduledFor: entry.values.scheduledFor,\n payload: entry.values.payload,\n title: entry.values.title,\n error: entry.values.error\n });\n }\n}\n\nexport const GetScheduledActionUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetScheduledActionUseCaseImpl,\n dependencies: [GetEntryByIdUseCase, ScheduledActionModel]\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,yBAAyB,IAAIC,kBAAkB;AAExD,SAASC,oBAAoB;AAC7B,SAASC,4BAA4B,EAAEC,+BAA+B;AACtE,SAASC,mBAAmB,QAAQ,sEAAsE;AAC1G,SAASC,4BAA4B;AAGrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,6BAA6B,CAAyC;EACxEC,WAAWA,CACCC,mBAAkD,EAClDC,KAAqC,EAC/C;IAAA,KAFUD,mBAAkD,GAAlDA,mBAAkD;IAAA,KAClDC,KAAqC,GAArCA,KAAqC;EAC9C;EAEH,MAAMC,OAAOA,CACTC,EAAU,EACoD;IAC9D;IACA,MAAMC,UAAU,GAAGP,4BAA4B,CAACQ,IAAI,CAACF,EAAE,CAAC;IACxD,MAAMG,WAAW,GAAG,MAAM,IAAI,CAACN,mBAAmB,CAACE,OAAO,CACtD,IAAI,CAACD,KAAK,EACVG,UACJ,CAAC;IAED,IAAIE,WAAW,CAACC,MAAM,CAAC,CAAC,EAAE;MACtB,IAAID,WAAW,CAACE,KAAK,CAACC,IAAI,KAAK,oBAAoB,EAAE;QACjD,OAAOnB,MAAM,CAACoB,IAAI,CAAC,IAAIhB,4BAA4B,CAACU,UAAU,CAAC,CAAC;MACpE;MAEA,OAAOd,MAAM,CAACoB,IAAI,CAAC,IAAIf,+BAA+B,CAACW,WAAW,CAACE,KAAK,CAAC,CAAC;IAC9E;IAEA,MAAMG,KAAK,GAAGL,WAAW,CAACM,KAAK;IAE/B,OAAOtB,MAAM,CAACuB,EAAE,CAAC;MACbV,EAAE,EAAEQ,KAAK,CAACG,OAAO;MACjBC,SAAS,EAAEJ,KAAK,CAACK,MAAM,CAACD,SAAS;MACjCE,UAAU,EAAEN,KAAK,CAACK,MAAM,CAACC,UAAU;MACnCC,QAAQ,EAAEP,KAAK,CAACK,MAAM,CAACE,QAAQ;MAC/BC,WAAW,EAAER,KAAK,CAACK,MAAM,CAACG,WAAW;MACrCC,YAAY,EAAET,KAAK,CAACK,MAAM,CAACI,YAAY;MACvCC,OAAO,EAAEV,KAAK,CAACK,MAAM,CAACK,OAAO;MAC7BC,KAAK,EAAEX,KAAK,CAACK,MAAM,CAACM,KAAK;MACzBd,KAAK,EAAEG,KAAK,CAACK,MAAM,CAACR;IACxB,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMjB,yBAAyB,GAAGC,kBAAkB,CAAC+B,oBAAoB,CAAC;EAC7EC,cAAc,EAAE1B,6BAA6B;EAC7C2B,YAAY,EAAE,CAAC7B,mBAAmB,EAAEH,oBAAoB;AAC5D,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { IScheduledAction } from "../../shared/abstractions.js";
|
|
3
|
+
import { ScheduledActionNotFoundError, ScheduledActionPersistenceError } from "../../domain/errors.js";
|
|
4
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
5
|
+
/**
|
|
6
|
+
* GetScheduledActionUseCase - Retrieve a scheduled action by ID
|
|
7
|
+
*
|
|
8
|
+
* Used to check if a schedule exists (for reschedule logic) and to retrieve
|
|
9
|
+
* schedule details for display/management purposes.
|
|
10
|
+
*
|
|
11
|
+
* Returns null value (Result.ok(null)) if schedule not found.
|
|
12
|
+
*/
|
|
13
|
+
export interface IGetScheduledActionErrors {
|
|
14
|
+
persistence: ScheduledActionPersistenceError;
|
|
15
|
+
notFound: ScheduledActionNotFoundError;
|
|
16
|
+
}
|
|
17
|
+
type GetScheduledActionError = IGetScheduledActionErrors[keyof IGetScheduledActionErrors];
|
|
18
|
+
export interface IGetScheduledActionUseCase {
|
|
19
|
+
execute<T extends GenericRecord>(scheduleId: string): Promise<Result<IScheduledAction<T>, GetScheduledActionError>>;
|
|
20
|
+
}
|
|
21
|
+
export declare const GetScheduledActionUseCase: import("@webiny/di").Abstraction<IGetScheduledActionUseCase>;
|
|
22
|
+
export declare namespace GetScheduledActionUseCase {
|
|
23
|
+
type Interface = IGetScheduledActionUseCase;
|
|
24
|
+
type Error = GetScheduledActionError;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* GetScheduledActionUseCase - Retrieve a scheduled action by ID
|
|
5
|
+
*
|
|
6
|
+
* Used to check if a schedule exists (for reschedule logic) and to retrieve
|
|
7
|
+
* schedule details for display/management purposes.
|
|
8
|
+
*
|
|
9
|
+
* Returns null value (Result.ok(null)) if schedule not found.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const GetScheduledActionUseCase = createAbstraction("GetScheduledActionUseCase");
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","GetScheduledActionUseCase"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport type { IScheduledAction } from \"~/shared/abstractions.js\";\nimport { ScheduledActionNotFoundError, ScheduledActionPersistenceError } from \"~/domain/errors.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\n/**\n * GetScheduledActionUseCase - Retrieve a scheduled action by ID\n *\n * Used to check if a schedule exists (for reschedule logic) and to retrieve\n * schedule details for display/management purposes.\n *\n * Returns null value (Result.ok(null)) if schedule not found.\n */\n\nexport interface IGetScheduledActionErrors {\n persistence: ScheduledActionPersistenceError;\n notFound: ScheduledActionNotFoundError;\n}\n\ntype GetScheduledActionError = IGetScheduledActionErrors[keyof IGetScheduledActionErrors];\n\nexport interface IGetScheduledActionUseCase {\n execute<T extends GenericRecord>(\n scheduleId: string\n ): Promise<Result<IScheduledAction<T>, GetScheduledActionError>>;\n}\n\nexport const GetScheduledActionUseCase = createAbstraction<IGetScheduledActionUseCase>(\n \"GetScheduledActionUseCase\"\n);\n\nexport namespace GetScheduledActionUseCase {\n export type Interface = IGetScheduledActionUseCase;\n export type Error = GetScheduledActionError;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAMvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA,OAAO,MAAMC,yBAAyB,GAAGD,iBAAiB,CACtD,2BACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GetScheduledAction Feature
|
|
3
|
+
*
|
|
4
|
+
* Provides the ability to retrieve a scheduled action by ID.
|
|
5
|
+
* Used for checking if schedules exist and displaying schedule details.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GetScheduledActionFeature: import("@webiny/feature/api/createFeature.js").FeatureDefinition<unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { GetScheduledActionUseCase } from "./GetScheduledActionUseCase.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* GetScheduledAction Feature
|
|
6
|
+
*
|
|
7
|
+
* Provides the ability to retrieve a scheduled action by ID.
|
|
8
|
+
* Used for checking if schedules exist and displaying schedule details.
|
|
9
|
+
*/
|
|
10
|
+
export const GetScheduledActionFeature = createFeature({
|
|
11
|
+
name: "GetScheduledAction",
|
|
12
|
+
register(container) {
|
|
13
|
+
container.register(GetScheduledActionUseCase);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFeature","GetScheduledActionUseCase","GetScheduledActionFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetScheduledActionUseCase } from \"./GetScheduledActionUseCase.js\";\n\n/**\n * GetScheduledAction Feature\n *\n * Provides the ability to retrieve a scheduled action by ID.\n * Used for checking if schedules exist and displaying schedule details.\n */\nexport const GetScheduledActionFeature = createFeature({\n name: \"GetScheduledAction\",\n register(container) {\n container.register(GetScheduledActionUseCase);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,yBAAyB;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,GAAGF,aAAa,CAAC;EACnDG,IAAI,EAAE,oBAAoB;EAC1BC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,yBAAyB,CAAC;EACjD;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./abstractions.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ListLatestEntriesUseCase } from "@webiny/api-headless-cms/features/contentEntry/ListEntries/abstractions.js";
|
|
3
|
+
import { IListScheduledActionsParams, IListScheduledActionsResponse, ListScheduledActionsUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
4
|
+
import { ScheduledActionModel } from "../../shared/abstractions.js";
|
|
5
|
+
import { CmsSortMapper, CmsWhereMapper } from "@webiny/api-headless-cms";
|
|
6
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Lists scheduled actions with optional filtering
|
|
9
|
+
*
|
|
10
|
+
* Flow:
|
|
11
|
+
* 1. Build query filters based on where params (namespace, actionType, targetId, etc.)
|
|
12
|
+
* 2. Fetch entries from CMS storage with pagination and sorting
|
|
13
|
+
* 3. Transform CMS entries to IScheduledAction format
|
|
14
|
+
* 4. Return paginated results with metadata
|
|
15
|
+
*/
|
|
16
|
+
declare class ListScheduledActionsUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
17
|
+
private listEntriesUseCase;
|
|
18
|
+
private model;
|
|
19
|
+
private cmsWhereMapper;
|
|
20
|
+
private cmsSortMapper;
|
|
21
|
+
constructor(listEntriesUseCase: ListLatestEntriesUseCase.Interface, model: ScheduledActionModel.Interface, cmsWhereMapper: CmsWhereMapper.Interface, cmsSortMapper: CmsSortMapper.Interface);
|
|
22
|
+
execute<T extends GenericRecord>(params: IListScheduledActionsParams): Promise<Result<IListScheduledActionsResponse<T>, UseCaseAbstraction.Error>>;
|
|
23
|
+
}
|
|
24
|
+
export declare const ListScheduledActionsUseCase: typeof ListScheduledActionsUseCaseImpl & {
|
|
25
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListScheduledActionsUseCase>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|