@webiny/api-scheduler 0.0.0-unstable.6844005670 → 0.0.0-unstable.7be00a75a9
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/constants.d.ts +5 -0
- package/constants.js +11 -8
- package/constants.js.map +1 -1
- package/context.d.ts +1 -1
- package/context.js +32 -26
- package/context.js.map +1 -1
- package/createEventHandler.d.ts +1 -0
- package/createEventHandler.js +26 -39
- package/createEventHandler.js.map +1 -1
- package/createScheduler.d.ts +1 -1
- package/createScheduler.js +5 -7
- package/createScheduler.js.map +1 -1
- package/domain/SchedulePrivateModel.js +25 -22
- package/domain/SchedulePrivateModel.js.map +1 -1
- package/domain/ScheduledActionId.js +12 -4
- package/domain/ScheduledActionId.js.map +1 -1
- package/domain/ScheduledActionIdWithVersion.js +5 -6
- package/domain/ScheduledActionIdWithVersion.js.map +1 -1
- package/domain/ScheduledActionMapper.d.ts +16 -0
- package/domain/ScheduledActionMapper.js +36 -0
- package/domain/ScheduledActionMapper.js.map +1 -0
- package/domain/errors.d.ts +19 -1
- package/domain/errors.js +54 -56
- package/domain/errors.js.map +1 -1
- package/domain/isValidDate.d.ts +1 -1
- package/domain/isValidDate.js +4 -9
- package/domain/isValidDate.js.map +1 -1
- package/domain/permissionsSchema.d.ts +9 -0
- package/domain/permissionsSchema.js +18 -0
- package/domain/permissionsSchema.js.map +1 -0
- package/exports/api/scheduler.d.ts +10 -0
- package/exports/api/scheduler.js +8 -0
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.d.ts +4 -2
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.js +45 -61
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.js.map +1 -1
- package/features/CancelScheduledAction/abstractions.d.ts +9 -2
- package/features/CancelScheduledAction/abstractions.js +2 -10
- package/features/CancelScheduledAction/abstractions.js.map +1 -1
- package/features/CancelScheduledAction/feature.d.ts +4 -1
- package/features/CancelScheduledAction/feature.js +6 -12
- package/features/CancelScheduledAction/feature.js.map +1 -1
- package/features/CancelScheduledAction/index.js +0 -2
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.d.ts +1 -1
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.js +65 -89
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.js.map +1 -1
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.d.ts +2 -2
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.js +21 -25
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.js.map +1 -1
- package/features/ExecuteScheduledAction/abstractions.d.ts +9 -2
- package/features/ExecuteScheduledAction/abstractions.js +12 -36
- package/features/ExecuteScheduledAction/abstractions.js.map +1 -1
- package/features/ExecuteScheduledAction/feature.d.ts +4 -1
- package/features/ExecuteScheduledAction/feature.js +7 -13
- package/features/ExecuteScheduledAction/feature.js.map +1 -1
- package/features/ExecuteScheduledAction/index.js +0 -2
- package/features/GetScheduledAction/GetScheduledActionUseCase.d.ts +6 -2
- package/features/GetScheduledAction/GetScheduledActionUseCase.js +38 -39
- package/features/GetScheduledAction/GetScheduledActionUseCase.js.map +1 -1
- package/features/GetScheduledAction/abstractions.d.ts +9 -2
- package/features/GetScheduledAction/abstractions.js +2 -11
- package/features/GetScheduledAction/abstractions.js.map +1 -1
- package/features/GetScheduledAction/feature.d.ts +4 -1
- package/features/GetScheduledAction/feature.js +6 -12
- package/features/GetScheduledAction/feature.js.map +1 -1
- package/features/GetScheduledAction/index.js +0 -2
- package/features/GetTargetScheduledAction/GetTargetScheduledActionUseCase.d.ts +32 -0
- package/features/GetTargetScheduledAction/GetTargetScheduledActionUseCase.js +64 -0
- package/features/GetTargetScheduledAction/GetTargetScheduledActionUseCase.js.map +1 -0
- package/features/GetTargetScheduledAction/abstractions.d.ts +24 -0
- package/features/GetTargetScheduledAction/abstractions.js +5 -0
- package/features/GetTargetScheduledAction/abstractions.js.map +1 -0
- package/features/GetTargetScheduledAction/feature.d.ts +10 -0
- package/features/GetTargetScheduledAction/feature.js +11 -0
- package/features/GetTargetScheduledAction/feature.js.map +1 -0
- package/features/{RunAction → GetTargetScheduledAction}/index.js +0 -2
- package/features/ListScheduledActions/ListScheduledActionsUseCase.d.ts +5 -1
- package/features/ListScheduledActions/ListScheduledActionsUseCase.js +53 -67
- package/features/ListScheduledActions/ListScheduledActionsUseCase.js.map +1 -1
- package/features/ListScheduledActions/abstractions.d.ts +11 -3
- package/features/ListScheduledActions/abstractions.js +2 -12
- package/features/ListScheduledActions/abstractions.js.map +1 -1
- package/features/ListScheduledActions/feature.d.ts +4 -1
- package/features/ListScheduledActions/feature.js +6 -12
- package/features/ListScheduledActions/feature.js.map +1 -1
- package/features/ListScheduledActions/index.js +0 -2
- package/features/NamespaceHandler/NamespaceHandlerExecutioner.d.ts +11 -0
- package/features/NamespaceHandler/NamespaceHandlerExecutioner.js +26 -0
- package/features/NamespaceHandler/NamespaceHandlerExecutioner.js.map +1 -0
- package/features/NamespaceHandler/abstractions.d.ts +50 -0
- package/features/NamespaceHandler/abstractions.js +6 -0
- package/features/NamespaceHandler/abstractions.js.map +1 -0
- package/features/NamespaceHandler/index.d.ts +1 -0
- package/features/NamespaceHandler/index.js +1 -0
- package/features/ScheduleAction/ScheduleActionUseCase.d.ts +4 -4
- package/features/ScheduleAction/ScheduleActionUseCase.js +146 -143
- package/features/ScheduleAction/ScheduleActionUseCase.js.map +1 -1
- package/features/ScheduleAction/abstractions.d.ts +11 -11
- package/features/ScheduleAction/abstractions.js +2 -10
- package/features/ScheduleAction/abstractions.js.map +1 -1
- package/features/ScheduleAction/feature.d.ts +4 -1
- package/features/ScheduleAction/feature.js +6 -12
- package/features/ScheduleAction/feature.js.map +1 -1
- package/features/ScheduleAction/index.js +0 -2
- package/features/SchedulerFeature.d.ts +4 -1
- package/features/SchedulerFeature.js +12 -20
- package/features/SchedulerFeature.js.map +1 -1
- package/features/SchedulerService/EventBridgeSchedulerService.d.ts +1 -1
- package/features/SchedulerService/EventBridgeSchedulerService.js +86 -120
- package/features/SchedulerService/EventBridgeSchedulerService.js.map +1 -1
- package/features/SchedulerService/VoidSchedulerService.js +17 -24
- package/features/SchedulerService/VoidSchedulerService.js.map +1 -1
- package/features/permissions/abstractions.d.ts +14 -0
- package/features/permissions/abstractions.js +6 -0
- package/features/permissions/abstractions.js.map +1 -0
- package/features/permissions/feature.d.ts +4 -0
- package/features/permissions/feature.js +7 -0
- package/features/permissions/feature.js.map +1 -0
- package/graphql/SchedulerGraphQLFactory.d.ts +8 -0
- package/graphql/SchedulerGraphQLFactory.js +219 -0
- package/graphql/SchedulerGraphQLFactory.js.map +1 -0
- package/graphql/index.d.ts +1 -0
- package/graphql/index.js +1 -0
- package/index.d.ts +0 -6
- package/index.js +1 -11
- package/manifest.js +26 -30
- package/manifest.js.map +1 -1
- package/package.json +29 -31
- package/shared/abstractions.d.ts +19 -6
- package/shared/abstractions.js +4 -29
- package/shared/abstractions.js.map +1 -1
- package/features/CancelScheduledAction/index.js.map +0 -1
- package/features/ExecuteScheduledAction/index.js.map +0 -1
- package/features/GetScheduledAction/index.js.map +0 -1
- package/features/ListScheduledActions/index.js.map +0 -1
- package/features/RunAction/RunActionUseCase.d.ts +0 -23
- package/features/RunAction/RunActionUseCase.js +0 -37
- package/features/RunAction/RunActionUseCase.js.map +0 -1
- package/features/RunAction/abstractions.d.ts +0 -35
- package/features/RunAction/abstractions.js +0 -15
- package/features/RunAction/abstractions.js.map +0 -1
- package/features/RunAction/feature.d.ts +0 -7
- package/features/RunAction/feature.js +0 -17
- package/features/RunAction/feature.js.map +0 -1
- package/features/RunAction/index.js.map +0 -1
- package/features/ScheduleAction/index.js.map +0 -1
- package/index.js.map +0 -1
- /package/features/{RunAction → GetTargetScheduledAction}/index.d.ts +0 -0
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* ScheduleActionUseCase - Schedule an action for future execution
|
|
5
|
-
*
|
|
6
|
-
* Handles both new schedules and rescheduling (update) automatically:
|
|
7
|
-
* - If no schedule exists for the namespace+actionType+targetId combination: creates new schedule
|
|
8
|
-
* - If schedule already exists: updates the existing schedule (reschedule)
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export const ScheduleActionUseCase = createAbstraction("ScheduleActionUseCase");
|
|
2
|
+
const ScheduleActionUseCase = createAbstraction("Scheduler/ScheduleActionUseCase");
|
|
3
|
+
export { ScheduleActionUseCase };
|
|
12
4
|
|
|
13
5
|
//# sourceMappingURL=abstractions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/ScheduleAction/abstractions.js","sources":["../../../src/features/ScheduleAction/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { IScheduledAction, ScheduledActionType } from \"~/shared/abstractions.js\";\nimport {\n InvalidScheduleDateError,\n ScheduledActionPersistenceError,\n SchedulerServiceError,\n NamespaceHandlerNotFoundError\n} from \"~/domain/errors.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\n/**\n * ScheduleActionUseCase - Schedule an action for future execution\n *\n * Handles both new schedules and rescheduling (update) automatically:\n * - If no schedule exists for the namespace+actionType+targetId combination: creates new schedule\n * - If schedule already exists: updates the existing schedule (reschedule)\n */\n\nexport interface IScheduleActionErrors {\n namespaceHandlerNotFound: NamespaceHandlerNotFoundError;\n persistence: ScheduledActionPersistenceError;\n invalidDate: InvalidScheduleDateError;\n schedulerService: SchedulerServiceError;\n}\n\nexport type ScheduleActionError = IScheduleActionErrors[keyof IScheduleActionErrors];\n\nexport interface IScheduleActionParams {\n namespace: string;\n targetId: string;\n actionType: ScheduledActionType;\n scheduleFor: Date;\n immediately?: boolean;\n}\n\nexport interface IScheduleActionUseCase {\n execute<T extends GenericRecord>(\n params: IScheduleActionParams\n ): Promise<Result<IScheduledAction<T>, ScheduleActionError>>;\n}\n\n/** Schedule an action for future execution. */\nexport const ScheduleActionUseCase = createAbstraction<IScheduleActionUseCase>(\n \"Scheduler/ScheduleActionUseCase\"\n);\n\nexport namespace ScheduleActionUseCase {\n export type Interface = IScheduleActionUseCase;\n export type Params = IScheduleActionParams;\n export type Error = ScheduleActionError;\n}\n"],"names":["ScheduleActionUseCase","createAbstraction"],"mappings":";AA0CO,MAAMA,wBAAwBC,kBACjC"}
|
|
@@ -4,4 +4,7 @@
|
|
|
4
4
|
* Provides the ability to schedule actions for future execution.
|
|
5
5
|
* Handles both creating new schedules and updating existing ones (reschedule).
|
|
6
6
|
*/
|
|
7
|
-
export declare const ScheduleActionFeature:
|
|
7
|
+
export declare const ScheduleActionFeature: {
|
|
8
|
+
name: string;
|
|
9
|
+
register(container: import("@webiny/di").Container): void;
|
|
10
|
+
};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { ScheduleActionUseCase } from "./ScheduleActionUseCase.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Handles both creating new schedules and updating existing ones (reschedule).
|
|
9
|
-
*/
|
|
10
|
-
export const ScheduleActionFeature = createFeature({
|
|
11
|
-
name: "ScheduleAction",
|
|
12
|
-
register(container) {
|
|
13
|
-
container.register(ScheduleActionUseCase);
|
|
14
|
-
}
|
|
3
|
+
const ScheduleActionFeature = createFeature({
|
|
4
|
+
name: "ScheduleAction",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(ScheduleActionUseCase);
|
|
7
|
+
}
|
|
15
8
|
});
|
|
9
|
+
export { ScheduleActionFeature };
|
|
16
10
|
|
|
17
11
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/ScheduleAction/feature.js","sources":["../../../src/features/ScheduleAction/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ScheduleActionUseCase } from \"./ScheduleActionUseCase.js\";\n\n/**\n * ScheduleAction Feature\n *\n * Provides the ability to schedule actions for future execution.\n * Handles both creating new schedules and updating existing ones (reschedule).\n */\nexport const ScheduleActionFeature = createFeature({\n name: \"ScheduleAction\",\n register(container) {\n container.register(ScheduleActionUseCase);\n }\n});\n"],"names":["ScheduleActionFeature","createFeature","container","ScheduleActionUseCase"],"mappings":";;AASO,MAAMA,wBAAwBC,cAAc;IAC/C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -5,4 +5,7 @@
|
|
|
5
5
|
* Individual handler implementations are registered by consumer packages
|
|
6
6
|
* (e.g., api-headless-cms-scheduler registers CMS-specific handlers).
|
|
7
7
|
*/
|
|
8
|
-
export declare const SchedulerFeature:
|
|
8
|
+
export declare const SchedulerFeature: {
|
|
9
|
+
name: string;
|
|
10
|
+
register(container: import("@webiny/di").Container): void;
|
|
11
|
+
};
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { ScheduleActionFeature } from "./ScheduleAction/feature.js";
|
|
3
3
|
import { GetScheduledActionFeature } from "./GetScheduledAction/feature.js";
|
|
4
|
+
import { GetTargetScheduledActionFeature } from "./GetTargetScheduledAction/feature.js";
|
|
4
5
|
import { ListScheduledActionsFeature } from "./ListScheduledActions/feature.js";
|
|
5
6
|
import { CancelScheduledActionFeature } from "./CancelScheduledAction/feature.js";
|
|
6
7
|
import { ExecuteScheduledActionFeature } from "./ExecuteScheduledAction/feature.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
name: "Scheduler",
|
|
18
|
-
register(container) {
|
|
19
|
-
// Register all features
|
|
20
|
-
ScheduleActionFeature.register(container);
|
|
21
|
-
GetScheduledActionFeature.register(container);
|
|
22
|
-
ListScheduledActionsFeature.register(container);
|
|
23
|
-
CancelScheduledActionFeature.register(container);
|
|
24
|
-
ExecuteScheduledActionFeature.register(container);
|
|
25
|
-
RunActionFeature.register(container);
|
|
26
|
-
}
|
|
8
|
+
const SchedulerFeature = createFeature({
|
|
9
|
+
name: "Scheduler",
|
|
10
|
+
register (container) {
|
|
11
|
+
ScheduleActionFeature.register(container);
|
|
12
|
+
GetScheduledActionFeature.register(container);
|
|
13
|
+
GetTargetScheduledActionFeature.register(container);
|
|
14
|
+
ListScheduledActionsFeature.register(container);
|
|
15
|
+
CancelScheduledActionFeature.register(container);
|
|
16
|
+
ExecuteScheduledActionFeature.register(container);
|
|
17
|
+
}
|
|
27
18
|
});
|
|
19
|
+
export { SchedulerFeature };
|
|
28
20
|
|
|
29
21
|
//# sourceMappingURL=SchedulerFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/SchedulerFeature.js","sources":["../../src/features/SchedulerFeature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ScheduleActionFeature } from \"./ScheduleAction/feature.js\";\nimport { GetScheduledActionFeature } from \"./GetScheduledAction/feature.js\";\nimport { GetTargetScheduledActionFeature } from \"./GetTargetScheduledAction/feature.js\";\nimport { ListScheduledActionsFeature } from \"./ListScheduledActions/feature.js\";\nimport { CancelScheduledActionFeature } from \"./CancelScheduledAction/feature.js\";\nimport { ExecuteScheduledActionFeature } from \"./ExecuteScheduledAction/feature.js\";\n\n/**\n * Main Scheduler Feature\n *\n * Registers all scheduler use cases and the composite handler.\n * Individual handler implementations are registered by consumer packages\n * (e.g., api-headless-cms-scheduler registers CMS-specific handlers).\n */\nexport const SchedulerFeature = createFeature({\n name: \"Scheduler\",\n register(container) {\n // Register all features\n ScheduleActionFeature.register(container);\n GetScheduledActionFeature.register(container);\n GetTargetScheduledActionFeature.register(container);\n ListScheduledActionsFeature.register(container);\n CancelScheduledActionFeature.register(container);\n ExecuteScheduledActionFeature.register(container);\n }\n});\n"],"names":["SchedulerFeature","createFeature","container","ScheduleActionFeature","GetScheduledActionFeature","GetTargetScheduledActionFeature","ListScheduledActionsFeature","CancelScheduledActionFeature","ExecuteScheduledActionFeature"],"mappings":";;;;;;;AAeO,MAAMA,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAS;QAEdC,sBAAsB,QAAQ,CAACD;QAC/BE,0BAA0B,QAAQ,CAACF;QACnCG,gCAAgC,QAAQ,CAACH;QACzCI,4BAA4B,QAAQ,CAACJ;QACrCK,6BAA6B,QAAQ,CAACL;QACtCM,8BAA8B,QAAQ,CAACN;IAC3C;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ISchedulerServiceCreateParams, type ISchedulerServiceUpdateParams, SchedulerService } from "../../shared/abstractions.js";
|
|
2
|
-
import { type SchedulerClient } from "@webiny/aws-sdk/client-scheduler";
|
|
2
|
+
import { type SchedulerClient } from "@webiny/aws-sdk/client-scheduler/index.js";
|
|
3
3
|
export interface ISchedulerConfig {
|
|
4
4
|
lambdaArn: string;
|
|
5
5
|
roleArn: string;
|
|
@@ -1,131 +1,97 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, UpdateScheduleCommand } from "@webiny/aws-sdk/client-scheduler";
|
|
2
|
+
import { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, UpdateScheduleCommand } from "@webiny/aws-sdk/client-scheduler/index.js";
|
|
3
3
|
import { SCHEDULED_ACTION_EVENT_IDENTIFIER } from "../../constants.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* Manages schedules in AWS EventBridge Scheduler for triggering Lambda functions
|
|
10
|
-
* at specified future times.
|
|
11
|
-
*/
|
|
12
|
-
export class EventBridgeSchedulerService {
|
|
13
|
-
constructor(getClient, config) {
|
|
14
|
-
this.getClient = getClient;
|
|
15
|
-
this.config = config;
|
|
16
|
-
}
|
|
17
|
-
async create(params) {
|
|
18
|
-
const {
|
|
19
|
-
id,
|
|
20
|
-
scheduleFor
|
|
21
|
-
} = params;
|
|
22
|
-
|
|
23
|
-
// Validate date is in future
|
|
24
|
-
if (scheduleFor <= new Date()) {
|
|
25
|
-
throw new WebinyError(`Cannot create a schedule for "${id}" with date in the past`, "INVALID_SCHEDULE_DATE", {
|
|
26
|
-
scheduleFor,
|
|
27
|
-
id
|
|
28
|
-
});
|
|
4
|
+
class EventBridgeSchedulerService {
|
|
5
|
+
constructor(getClient, config){
|
|
6
|
+
this.getClient = getClient;
|
|
7
|
+
this.config = config;
|
|
29
8
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
9
|
+
async create(params) {
|
|
10
|
+
const { id, scheduleFor } = params;
|
|
11
|
+
if (scheduleFor <= new Date()) throw new WebinyError(`Cannot create a schedule for "${id}" with date in the past`, "INVALID_SCHEDULE_DATE", {
|
|
12
|
+
scheduleFor,
|
|
13
|
+
id
|
|
14
|
+
});
|
|
15
|
+
const client = this.getClient();
|
|
16
|
+
const exists = await this.exists(id);
|
|
17
|
+
if (exists) return this.update(params);
|
|
18
|
+
await client.send(new CreateScheduleCommand({
|
|
19
|
+
Name: id,
|
|
20
|
+
ScheduleExpression: this.createScheduleExpression(scheduleFor),
|
|
21
|
+
FlexibleTimeWindow: {
|
|
22
|
+
Mode: "OFF"
|
|
23
|
+
},
|
|
24
|
+
Target: {
|
|
25
|
+
Arn: this.config.lambdaArn,
|
|
26
|
+
RoleArn: this.config.roleArn,
|
|
27
|
+
Input: this.createScheduledActionEventInput(params)
|
|
28
|
+
},
|
|
29
|
+
ActionAfterCompletion: "DELETE"
|
|
30
|
+
}));
|
|
36
31
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
id
|
|
62
|
-
|
|
32
|
+
async update(params) {
|
|
33
|
+
const { id, scheduleFor } = params;
|
|
34
|
+
if (scheduleFor <= new Date()) throw new WebinyError(`Cannot update an existing schedule for "${id}" with date in the past`, "INVALID_SCHEDULE_DATE", {
|
|
35
|
+
scheduleFor,
|
|
36
|
+
id
|
|
37
|
+
});
|
|
38
|
+
const client = this.getClient();
|
|
39
|
+
await client.send(new UpdateScheduleCommand({
|
|
40
|
+
Name: id,
|
|
41
|
+
ScheduleExpression: this.createScheduleExpression(scheduleFor),
|
|
42
|
+
FlexibleTimeWindow: {
|
|
43
|
+
Mode: "OFF"
|
|
44
|
+
},
|
|
45
|
+
Target: {
|
|
46
|
+
Arn: this.config.lambdaArn,
|
|
47
|
+
RoleArn: this.config.roleArn,
|
|
48
|
+
Input: this.createScheduledActionEventInput(params)
|
|
49
|
+
},
|
|
50
|
+
ActionAfterCompletion: "DELETE"
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
async delete(id) {
|
|
54
|
+
const client = this.getClient();
|
|
55
|
+
const exists = await this.exists(id);
|
|
56
|
+
if (!exists) throw new WebinyError(`Cannot delete schedule "${id}" because it does not exist.`);
|
|
57
|
+
try {
|
|
58
|
+
await client.send(new DeleteScheduleCommand({
|
|
59
|
+
Name: id
|
|
60
|
+
}));
|
|
61
|
+
} catch (ex) {
|
|
62
|
+
if ("ResourceNotFoundException" === ex.name) return;
|
|
63
|
+
throw WebinyError.from(ex);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async exists(id) {
|
|
67
|
+
const client = this.getClient();
|
|
68
|
+
try {
|
|
69
|
+
await client.send(new GetScheduleCommand({
|
|
70
|
+
Name: id
|
|
71
|
+
}));
|
|
72
|
+
return true;
|
|
73
|
+
} catch (ex) {
|
|
74
|
+
if ("ResourceNotFoundException" === ex.name) return false;
|
|
75
|
+
throw ex;
|
|
76
|
+
}
|
|
63
77
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Name: id,
|
|
67
|
-
ScheduleExpression: this.createScheduleExpression(scheduleFor),
|
|
68
|
-
FlexibleTimeWindow: {
|
|
69
|
-
Mode: "OFF"
|
|
70
|
-
},
|
|
71
|
-
Target: {
|
|
72
|
-
Arn: this.config.lambdaArn,
|
|
73
|
-
RoleArn: this.config.roleArn,
|
|
74
|
-
Input: this.createScheduledActionEventInput(params)
|
|
75
|
-
},
|
|
76
|
-
ActionAfterCompletion: "DELETE"
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
|
-
async delete(id) {
|
|
80
|
-
const client = this.getClient();
|
|
81
|
-
const exists = await this.exists(id);
|
|
82
|
-
if (!exists) {
|
|
83
|
-
throw new WebinyError(`Cannot delete schedule "${id}" because it does not exist.`);
|
|
78
|
+
createScheduleExpression(scheduleFor) {
|
|
79
|
+
return `at(${scheduleFor.toISOString().replace(/\.\d{3}Z$/, "")})`;
|
|
84
80
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} catch (ex) {
|
|
90
|
-
if (ex.name === "ResourceNotFoundException") {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
throw WebinyError.from(ex);
|
|
81
|
+
createScheduledActionEventInput(params) {
|
|
82
|
+
return JSON.stringify({
|
|
83
|
+
[SCHEDULED_ACTION_EVENT_IDENTIFIER]: this.createScheduledActionEventPayload(params)
|
|
84
|
+
});
|
|
94
85
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return true;
|
|
103
|
-
} catch (ex) {
|
|
104
|
-
if (ex.name === "ResourceNotFoundException") {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
throw ex;
|
|
86
|
+
createScheduledActionEventPayload(params) {
|
|
87
|
+
const { id, scheduleFor, namespace } = params;
|
|
88
|
+
return {
|
|
89
|
+
id,
|
|
90
|
+
namespace,
|
|
91
|
+
scheduleFor: scheduleFor.toISOString()
|
|
92
|
+
};
|
|
108
93
|
}
|
|
109
|
-
}
|
|
110
|
-
createScheduleExpression(scheduleFor) {
|
|
111
|
-
// Format: at(YYYY-MM-DDTHH:mm:ss) - EventBridge expects this format
|
|
112
|
-
return `at(${scheduleFor.toISOString().replace(/\.\d{3}Z$/, "")})`;
|
|
113
|
-
}
|
|
114
|
-
createScheduledActionEventInput(params) {
|
|
115
|
-
return JSON.stringify({
|
|
116
|
-
[SCHEDULED_ACTION_EVENT_IDENTIFIER]: this.createScheduledActionEventPayload(params)
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
createScheduledActionEventPayload(params) {
|
|
120
|
-
const {
|
|
121
|
-
id,
|
|
122
|
-
scheduleFor
|
|
123
|
-
} = params;
|
|
124
|
-
return {
|
|
125
|
-
id,
|
|
126
|
-
scheduleFor: scheduleFor.toISOString()
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
94
|
}
|
|
95
|
+
export { EventBridgeSchedulerService };
|
|
130
96
|
|
|
131
97
|
//# sourceMappingURL=EventBridgeSchedulerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/SchedulerService/EventBridgeSchedulerService.js","sources":["../../../src/features/SchedulerService/EventBridgeSchedulerService.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport {\n type ISchedulerServiceCreateParams,\n type ISchedulerServiceUpdateParams,\n SchedulerService\n} from \"~/shared/abstractions.js\";\nimport {\n CreateScheduleCommand,\n DeleteScheduleCommand,\n GetScheduleCommand,\n type SchedulerClient,\n UpdateScheduleCommand\n} from \"@webiny/aws-sdk/client-scheduler/index.js\";\nimport { SCHEDULED_ACTION_EVENT_IDENTIFIER } from \"~/constants.js\";\nimport type { IScheduledActionEventPayload } from \"~/createEventHandler.js\";\n\nexport interface ISchedulerConfig {\n lambdaArn: string;\n roleArn: string;\n}\n\n/**\n * AWS EventBridge Scheduler implementation\n *\n * This is the AWS-specific implementation of the cloud-agnostic SchedulerService abstraction.\n *\n * Manages schedules in AWS EventBridge Scheduler for triggering Lambda functions\n * at specified future times.\n */\nexport class EventBridgeSchedulerService implements SchedulerService.Interface {\n public constructor(\n private getClient: (config?: any) => Pick<SchedulerClient, \"send\">,\n private config: ISchedulerConfig\n ) {}\n\n public async create(params: ISchedulerServiceCreateParams): Promise<void> {\n const { id, scheduleFor } = params;\n\n // Validate date is in future\n if (scheduleFor <= new Date()) {\n throw new WebinyError(\n `Cannot create a schedule for \"${id}\" with date in the past`,\n \"INVALID_SCHEDULE_DATE\",\n {\n scheduleFor,\n id\n }\n );\n }\n\n const client = this.getClient();\n\n // Check if schedule already exists (for auto-update logic)\n const exists = await this.exists(id);\n if (exists) {\n return this.update(params);\n }\n\n await client.send(\n new CreateScheduleCommand({\n Name: id,\n ScheduleExpression: this.createScheduleExpression(scheduleFor),\n FlexibleTimeWindow: {\n Mode: \"OFF\"\n },\n Target: {\n Arn: this.config.lambdaArn,\n RoleArn: this.config.roleArn,\n Input: this.createScheduledActionEventInput(params)\n },\n ActionAfterCompletion: \"DELETE\" // Auto-cleanup after execution\n })\n );\n }\n\n public async update(params: ISchedulerServiceUpdateParams): Promise<void> {\n const { id, scheduleFor } = params;\n\n // Validate date is in future\n if (scheduleFor <= new Date()) {\n throw new WebinyError(\n `Cannot update an existing schedule for \"${id}\" with date in the past`,\n \"INVALID_SCHEDULE_DATE\",\n {\n scheduleFor,\n id\n }\n );\n }\n\n const client = this.getClient();\n\n await client.send(\n new UpdateScheduleCommand({\n Name: id,\n ScheduleExpression: this.createScheduleExpression(scheduleFor),\n FlexibleTimeWindow: {\n Mode: \"OFF\"\n },\n Target: {\n Arn: this.config.lambdaArn,\n RoleArn: this.config.roleArn,\n Input: this.createScheduledActionEventInput(params)\n },\n ActionAfterCompletion: \"DELETE\"\n })\n );\n }\n\n public async delete(id: string): Promise<void> {\n const client = this.getClient();\n\n const exists = await this.exists(id);\n if (!exists) {\n throw new WebinyError(`Cannot delete schedule \"${id}\" because it does not exist.`);\n }\n\n try {\n await client.send(new DeleteScheduleCommand({ Name: id }));\n } catch (ex) {\n if (ex.name === \"ResourceNotFoundException\") {\n return;\n }\n throw WebinyError.from(ex);\n }\n }\n\n public async exists(id: string): Promise<boolean> {\n const client = this.getClient();\n\n try {\n await client.send(new GetScheduleCommand({ Name: id }));\n return true;\n } catch (ex) {\n if (ex.name === \"ResourceNotFoundException\") {\n return false;\n }\n throw ex;\n }\n }\n\n private createScheduleExpression(scheduleFor: Date): string {\n // Format: at(YYYY-MM-DDTHH:mm:ss) - EventBridge expects this format\n return `at(${scheduleFor.toISOString().replace(/\\.\\d{3}Z$/, \"\")})`;\n }\n\n private createScheduledActionEventInput(\n params: ISchedulerServiceCreateParams | ISchedulerServiceUpdateParams\n ): string {\n return JSON.stringify({\n [SCHEDULED_ACTION_EVENT_IDENTIFIER]: this.createScheduledActionEventPayload(params)\n });\n }\n\n private createScheduledActionEventPayload(\n params: ISchedulerServiceCreateParams | ISchedulerServiceUpdateParams\n ): IScheduledActionEventPayload {\n const { id, scheduleFor, namespace } = params;\n\n return {\n id,\n namespace,\n scheduleFor: scheduleFor.toISOString()\n };\n }\n}\n"],"names":["EventBridgeSchedulerService","getClient","config","params","id","scheduleFor","Date","WebinyError","client","exists","CreateScheduleCommand","UpdateScheduleCommand","DeleteScheduleCommand","ex","GetScheduleCommand","JSON","SCHEDULED_ACTION_EVENT_IDENTIFIER","namespace"],"mappings":"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"}
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
async create(params) {
|
|
6
|
-
if (!this.callbacks?.create) {
|
|
7
|
-
return;
|
|
1
|
+
class VoidSchedulerService {
|
|
2
|
+
constructor(callbacks){
|
|
3
|
+
this.callbacks = callbacks;
|
|
8
4
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (!this.callbacks?.update) {
|
|
13
|
-
return;
|
|
5
|
+
async create(params) {
|
|
6
|
+
if (!this.callbacks?.create) return;
|
|
7
|
+
return this.callbacks?.create(params);
|
|
14
8
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (!this.callbacks?.delete) {
|
|
19
|
-
return;
|
|
9
|
+
async update(params) {
|
|
10
|
+
if (!this.callbacks?.update) return;
|
|
11
|
+
return this.callbacks?.update(params);
|
|
20
12
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
async delete(id) {
|
|
14
|
+
if (!this.callbacks?.delete) return;
|
|
15
|
+
return this.callbacks?.delete(id);
|
|
16
|
+
}
|
|
17
|
+
async exists(id) {
|
|
18
|
+
if (!this.callbacks?.exists) return false;
|
|
19
|
+
return this.callbacks?.exists(id);
|
|
26
20
|
}
|
|
27
|
-
return this.callbacks?.exists(id);
|
|
28
|
-
}
|
|
29
21
|
}
|
|
22
|
+
export { VoidSchedulerService };
|
|
30
23
|
|
|
31
24
|
//# sourceMappingURL=VoidSchedulerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/SchedulerService/VoidSchedulerService.js","sources":["../../../src/features/SchedulerService/VoidSchedulerService.ts"],"sourcesContent":["import {\n type ISchedulerServiceCreateParams,\n type ISchedulerServiceUpdateParams,\n SchedulerService\n} from \"~/shared/abstractions.js\";\n\nexport interface IVoidSchedulerServiceParams {\n create?: (params: ISchedulerServiceCreateParams) => Promise<void>;\n update?: (params: ISchedulerServiceUpdateParams) => Promise<void>;\n delete?: (id: string) => Promise<void>;\n exists?: (id: string) => Promise<boolean>;\n}\n\nexport class VoidSchedulerService implements SchedulerService.Interface {\n private readonly callbacks: IVoidSchedulerServiceParams | undefined;\n\n public constructor(callbacks?: IVoidSchedulerServiceParams) {\n this.callbacks = callbacks;\n }\n\n public async create(params: ISchedulerServiceCreateParams): Promise<void> {\n if (!this.callbacks?.create) {\n return;\n }\n return this.callbacks?.create(params);\n }\n\n public async update(params: ISchedulerServiceUpdateParams): Promise<void> {\n if (!this.callbacks?.update) {\n return;\n }\n return this.callbacks?.update(params);\n }\n\n public async delete(id: string): Promise<void> {\n if (!this.callbacks?.delete) {\n return;\n }\n return this.callbacks?.delete(id);\n }\n\n public async exists(id: string): Promise<boolean> {\n if (!this.callbacks?.exists) {\n return false;\n }\n return this.callbacks?.exists(id);\n }\n}\n"],"names":["VoidSchedulerService","callbacks","params","id"],"mappings":"AAaO,MAAMA;IAGT,YAAmBC,SAAuC,CAAE;QACxD,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEA,MAAa,OAAOC,MAAqC,EAAiB;QACtE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QACjB;QAEJ,OAAO,IAAI,CAAC,SAAS,EAAE,OAAOA;IAClC;IAEA,MAAa,OAAOA,MAAqC,EAAiB;QACtE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QACjB;QAEJ,OAAO,IAAI,CAAC,SAAS,EAAE,OAAOA;IAClC;IAEA,MAAa,OAAOC,EAAU,EAAiB;QAC3C,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QACjB;QAEJ,OAAO,IAAI,CAAC,SAAS,EAAE,OAAOA;IAClC;IAEA,MAAa,OAAOA,EAAU,EAAoB;QAC9C,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QACjB,OAAO;QAEX,OAAO,IAAI,CAAC,SAAS,EAAE,OAAOA;IAClC;AACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Permissions } from "@webiny/api-core/exports/api/security.js";
|
|
2
|
+
import { SCHEDULER_PERMISSIONS_SCHEMA } from "../../domain/permissionsSchema.js";
|
|
3
|
+
export declare const SchedulerPermissions: import("@webiny/di").Abstraction<import("@webiny/api-core/features/security/permissions/types").PermissionsTyped<{
|
|
4
|
+
readonly prefix: "scheduler";
|
|
5
|
+
readonly fullAccess: true;
|
|
6
|
+
readonly entities: readonly [{
|
|
7
|
+
readonly id: "action";
|
|
8
|
+
readonly permission: "scheduler.action";
|
|
9
|
+
readonly scopes: readonly ["full", "own"];
|
|
10
|
+
}];
|
|
11
|
+
}>>;
|
|
12
|
+
export declare namespace SchedulerPermissions {
|
|
13
|
+
type Interface = Permissions<typeof SCHEDULER_PERMISSIONS_SCHEMA>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createPermissionsAbstraction } from "@webiny/api-core/exports/api/security.js";
|
|
2
|
+
import { SCHEDULER_PERMISSIONS_SCHEMA } from "../../domain/permissionsSchema.js";
|
|
3
|
+
const SchedulerPermissions = createPermissionsAbstraction(SCHEDULER_PERMISSIONS_SCHEMA);
|
|
4
|
+
export { SchedulerPermissions };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/permissions/abstractions.js","sources":["../../../src/features/permissions/abstractions.ts"],"sourcesContent":["import { createPermissionsAbstraction } from \"@webiny/api-core/exports/api/security.js\";\nimport type { Permissions } from \"@webiny/api-core/exports/api/security.js\";\nimport { SCHEDULER_PERMISSIONS_SCHEMA } from \"~/domain/permissionsSchema.js\";\n\nexport const SchedulerPermissions = createPermissionsAbstraction(SCHEDULER_PERMISSIONS_SCHEMA);\n\nexport namespace SchedulerPermissions {\n export type Interface = Permissions<typeof SCHEDULER_PERMISSIONS_SCHEMA>;\n}\n"],"names":["SchedulerPermissions","createPermissionsAbstraction","SCHEDULER_PERMISSIONS_SCHEMA"],"mappings":";;AAIO,MAAMA,uBAAuBC,6BAA6BC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createPermissionsFeature } from "@webiny/api-core/exports/api/security.js";
|
|
2
|
+
import { SCHEDULER_PERMISSIONS_SCHEMA } from "../../domain/permissionsSchema.js";
|
|
3
|
+
import { SchedulerPermissions } from "./abstractions.js";
|
|
4
|
+
const SchedulerPermissionsFeature = createPermissionsFeature(SCHEDULER_PERMISSIONS_SCHEMA, SchedulerPermissions);
|
|
5
|
+
export { SchedulerPermissionsFeature };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/permissions/feature.js","sources":["../../../src/features/permissions/feature.ts"],"sourcesContent":["import { createPermissionsFeature } from \"@webiny/api-core/exports/api/security.js\";\nimport { SCHEDULER_PERMISSIONS_SCHEMA } from \"~/domain/permissionsSchema.js\";\nimport { SchedulerPermissions } from \"./abstractions.js\";\n\nexport const SchedulerPermissionsFeature = createPermissionsFeature(\n SCHEDULER_PERMISSIONS_SCHEMA,\n SchedulerPermissions\n);\n"],"names":["SchedulerPermissionsFeature","createPermissionsFeature","SCHEDULER_PERMISSIONS_SCHEMA","SchedulerPermissions"],"mappings":";;;AAIO,MAAMA,8BAA8BC,yBACvCC,8BACAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GraphQLSchemaBuilder } from "@webiny/handler-graphql/features/GraphQLSchemaBuilder/abstractions";
|
|
2
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
3
|
+
export declare class SchedulerGraphQL implements CoreGraphQLSchemaFactory.Interface {
|
|
4
|
+
execute(builder: GraphQLSchemaBuilder.Interface): Promise<GraphQLSchemaBuilder.Interface>;
|
|
5
|
+
}
|
|
6
|
+
export declare const SchedulerGraphQLFactory: typeof SchedulerGraphQL & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
|
|
8
|
+
};
|