@webiny/api-scheduler-server 0.0.0-unstable.9f53ea597d

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.
@@ -0,0 +1,26 @@
1
+ import { type ISchedulerServiceCreateParams, type ISchedulerServiceUpdateParams, SchedulerService } from "@webiny/api-scheduler/shared/abstractions.js";
2
+ import type { Logger } from "@webiny/api-core/features/logger/abstractions.js";
3
+ export interface IPendingAction {
4
+ id: string;
5
+ namespace: string;
6
+ scheduledFor: Date;
7
+ }
8
+ export interface IBreeSchedulerServiceParams {
9
+ logger: Logger.Interface;
10
+ onTrigger: (id: string, namespace: string) => Promise<void>;
11
+ }
12
+ export declare class BreeSchedulerService implements SchedulerService.Interface {
13
+ private readonly bree;
14
+ private readonly namespaces;
15
+ private readonly logger;
16
+ private readonly onTrigger;
17
+ constructor(params: IBreeSchedulerServiceParams);
18
+ start(pendingActions?: IPendingAction[]): Promise<void>;
19
+ stop(): Promise<void>;
20
+ create(params: ISchedulerServiceCreateParams): Promise<void>;
21
+ update(params: ISchedulerServiceUpdateParams): Promise<void>;
22
+ delete(params: SchedulerService.DeleteParams): Promise<void>;
23
+ exists(params: SchedulerService.ExistsParams): Promise<boolean>;
24
+ private recover;
25
+ private safeRemove;
26
+ }
@@ -0,0 +1,102 @@
1
+ import bree from "bree";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { WebinyError } from "@webiny/error";
5
+ const jobsDir = join(dirname(fileURLToPath(import.meta.url)), "jobs");
6
+ const workerPath = join(jobsDir, "pollWorker.js");
7
+ class BreeSchedulerService {
8
+ constructor(params){
9
+ this.namespaces = new Map();
10
+ this.logger = params.logger;
11
+ this.onTrigger = params.onTrigger;
12
+ this.bree = new bree({
13
+ root: false,
14
+ jobs: [],
15
+ logger: false,
16
+ workerMessageHandler: async ({ name })=>{
17
+ const namespace = this.namespaces.get(name);
18
+ if (!namespace) return;
19
+ this.namespaces.delete(name);
20
+ await this.onTrigger(name, namespace);
21
+ }
22
+ });
23
+ }
24
+ async start(pendingActions) {
25
+ await this.bree.start();
26
+ if (pendingActions) await this.recover(pendingActions);
27
+ }
28
+ async stop() {
29
+ await this.bree.stop();
30
+ }
31
+ async create(params) {
32
+ const { id, namespace, scheduleFor, tenant } = params;
33
+ if (scheduleFor <= new Date()) throw new WebinyError(`Cannot create a schedule for "${id}" with date in the past`, "INVALID_SCHEDULE_DATE", {
34
+ scheduleFor,
35
+ id
36
+ });
37
+ const exists = await this.exists({
38
+ id,
39
+ namespace,
40
+ tenant
41
+ });
42
+ if (exists) return this.update(params);
43
+ this.namespaces.set(id, namespace);
44
+ await this.bree.add({
45
+ name: id,
46
+ date: scheduleFor,
47
+ path: workerPath
48
+ });
49
+ await this.bree.start(id);
50
+ }
51
+ async update(params) {
52
+ const { id, scheduleFor } = params;
53
+ if (scheduleFor <= new Date()) throw new WebinyError(`Cannot update an existing schedule for "${id}" with date in the past`, "INVALID_SCHEDULE_DATE", {
54
+ scheduleFor,
55
+ id
56
+ });
57
+ await this.safeRemove(id);
58
+ await this.create(params);
59
+ }
60
+ async delete(params) {
61
+ const { id } = params;
62
+ const exists = await this.exists(params);
63
+ if (!exists) throw new WebinyError(`Cannot delete schedule "${id}" because it does not exist.`);
64
+ await this.safeRemove(id);
65
+ }
66
+ async exists(params) {
67
+ const { id } = params;
68
+ return this.namespaces.has(id);
69
+ }
70
+ async recover(pendingActions) {
71
+ const now = new Date();
72
+ for (const action of pendingActions){
73
+ if (action.scheduledFor <= now) {
74
+ await this.onTrigger(action.id, action.namespace);
75
+ continue;
76
+ }
77
+ this.namespaces.set(action.id, action.namespace);
78
+ await this.bree.add({
79
+ name: action.id,
80
+ date: action.scheduledFor,
81
+ path: workerPath
82
+ });
83
+ await this.bree.start(action.id);
84
+ }
85
+ }
86
+ async safeRemove(id) {
87
+ this.namespaces.delete(id);
88
+ try {
89
+ await this.bree.stop(id);
90
+ } catch {
91
+ this.logger.debug(`Could not stop bree job "${id}" — it may have already fired.`);
92
+ }
93
+ try {
94
+ await this.bree.remove(id);
95
+ } catch {
96
+ this.logger.debug(`Could not remove bree job "${id}" — it may have already been removed.`);
97
+ }
98
+ }
99
+ }
100
+ export { BreeSchedulerService };
101
+
102
+ //# sourceMappingURL=BreeSchedulerService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BreeSchedulerService.js","sources":["../src/BreeSchedulerService.ts"],"sourcesContent":["import Bree from \"bree\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { WebinyError } from \"@webiny/error\";\nimport {\n type ISchedulerServiceCreateParams,\n type ISchedulerServiceUpdateParams,\n SchedulerService\n} from \"@webiny/api-scheduler/shared/abstractions.js\";\nimport type { Logger } from \"@webiny/api-core/features/logger/abstractions.js\";\n\nconst jobsDir = join(dirname(fileURLToPath(import.meta.url)), \"jobs\");\nconst workerPath = join(jobsDir, \"pollWorker.js\");\n\nexport interface IPendingAction {\n id: string;\n namespace: string;\n scheduledFor: Date;\n}\n\nexport interface IBreeSchedulerServiceParams {\n logger: Logger.Interface;\n onTrigger: (id: string, namespace: string) => Promise<void>;\n}\n\n/* One-shot bree job per scheduled action — mirrors EventBridge behavior. */\nexport class BreeSchedulerService implements SchedulerService.Interface {\n private readonly bree;\n private readonly namespaces = new Map<string, string>();\n private readonly logger;\n private readonly onTrigger;\n\n public constructor(params: IBreeSchedulerServiceParams) {\n this.logger = params.logger;\n this.onTrigger = params.onTrigger;\n\n this.bree = new Bree({\n root: false,\n jobs: [],\n logger: false,\n workerMessageHandler: async ({ name }) => {\n const namespace = this.namespaces.get(name);\n if (!namespace) {\n return;\n }\n\n this.namespaces.delete(name);\n await this.onTrigger(name, namespace);\n }\n });\n }\n\n public async start(pendingActions?: IPendingAction[]): Promise<void> {\n await this.bree.start();\n\n if (pendingActions) {\n await this.recover(pendingActions);\n }\n }\n\n public async stop(): Promise<void> {\n await this.bree.stop();\n }\n\n public async create(params: ISchedulerServiceCreateParams): Promise<void> {\n const { id, namespace, scheduleFor, tenant } = params;\n\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 { scheduleFor, id }\n );\n }\n\n const exists = await this.exists({\n id,\n namespace,\n tenant\n });\n if (exists) {\n return this.update(params);\n }\n\n this.namespaces.set(id, namespace);\n\n await this.bree.add({\n name: id,\n date: scheduleFor,\n path: workerPath\n });\n\n await this.bree.start(id);\n }\n\n public async update(params: ISchedulerServiceUpdateParams): Promise<void> {\n const { id, scheduleFor } = params;\n\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 { scheduleFor, id }\n );\n }\n\n await this.safeRemove(id);\n await this.create(params);\n }\n\n public async delete(params: SchedulerService.DeleteParams): Promise<void> {\n const { id } = params;\n const exists = await this.exists(params);\n if (!exists) {\n throw new WebinyError(`Cannot delete schedule \"${id}\" because it does not exist.`);\n }\n\n await this.safeRemove(id);\n }\n\n public async exists(params: SchedulerService.ExistsParams): Promise<boolean> {\n const { id } = params;\n return this.namespaces.has(id);\n }\n\n private async recover(pendingActions: IPendingAction[]): Promise<void> {\n const now = new Date();\n\n for (const action of pendingActions) {\n if (action.scheduledFor <= now) {\n /* Overdue — execute immediately. */\n await this.onTrigger(action.id, action.namespace);\n continue;\n }\n\n this.namespaces.set(action.id, action.namespace);\n\n await this.bree.add({\n name: action.id,\n date: action.scheduledFor,\n path: workerPath\n });\n\n await this.bree.start(action.id);\n }\n }\n\n private async safeRemove(id: string): Promise<void> {\n this.namespaces.delete(id);\n\n try {\n await this.bree.stop(id);\n } catch {\n this.logger.debug(`Could not stop bree job \"${id}\" — it may have already fired.`);\n }\n\n try {\n await this.bree.remove(id);\n } catch {\n this.logger.debug(\n `Could not remove bree job \"${id}\" — it may have already been removed.`\n );\n }\n }\n}\n"],"names":["jobsDir","join","dirname","fileURLToPath","workerPath","BreeSchedulerService","params","Map","Bree","name","namespace","pendingActions","id","scheduleFor","tenant","Date","WebinyError","exists","now","action"],"mappings":"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"}
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-scheduler-server
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/context.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { CmsContext } from "@webiny/api-headless-cms/types/index.js";
2
+ import { ContextPlugin } from "@webiny/api";
3
+ export declare const registerSchedulerServerExtension: () => ContextPlugin<CmsContext>;
package/context.js ADDED
@@ -0,0 +1,44 @@
1
+ import { SchedulerService } from "@webiny/api-scheduler/shared/abstractions.js";
2
+ import { ExecuteScheduledActionUseCase } from "@webiny/api-scheduler/features/ExecuteScheduledAction/index.js";
3
+ import { ListScheduledActionsUseCase } from "@webiny/api-scheduler/features/ListScheduledActions/index.js";
4
+ import { Logger } from "@webiny/api-core/features/logger/abstractions.js";
5
+ import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
6
+ import { BreeSchedulerService } from "./BreeSchedulerService.js";
7
+ import { ContextPlugin } from "@webiny/api";
8
+ const registerSchedulerServerExtension = ()=>{
9
+ const plugin = new ContextPlugin(async (context)=>{
10
+ const tenantContext = context.container.resolve(TenantContext);
11
+ const tenant = tenantContext.getTenant();
12
+ if (!tenant) return;
13
+ const logger = context.container.resolve(Logger);
14
+ const executeScheduledAction = context.container.resolve(ExecuteScheduledActionUseCase);
15
+ const service = new BreeSchedulerService({
16
+ logger,
17
+ onTrigger: async (id, namespace)=>{
18
+ const result = await executeScheduledAction.execute({
19
+ id,
20
+ namespace,
21
+ tenant: tenant.id
22
+ });
23
+ if (result.isFail()) logger.error(`Scheduled action "${id}" execution failed: ${result.error.message}`);
24
+ }
25
+ });
26
+ context.container.registerInstance(SchedulerService, service);
27
+ const listScheduledActions = context.container.resolve(ListScheduledActionsUseCase);
28
+ const listResult = await listScheduledActions.execute({
29
+ where: {},
30
+ limit: 1000
31
+ });
32
+ const pendingActions = listResult.isOk() ? listResult.value.items.map((action)=>({
33
+ id: action.id,
34
+ namespace: action.namespace,
35
+ scheduledFor: action.scheduledFor
36
+ })) : void 0;
37
+ await service.start(pendingActions);
38
+ });
39
+ plugin.name = "scheduler.server.extension";
40
+ return plugin;
41
+ };
42
+ export { registerSchedulerServerExtension };
43
+
44
+ //# sourceMappingURL=context.js.map
package/context.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import type { CmsContext } from \"@webiny/api-headless-cms/types/index.js\";\nimport { SchedulerService } from \"@webiny/api-scheduler/shared/abstractions.js\";\nimport { ExecuteScheduledActionUseCase } from \"@webiny/api-scheduler/features/ExecuteScheduledAction/index.js\";\nimport { ListScheduledActionsUseCase } from \"@webiny/api-scheduler/features/ListScheduledActions/index.js\";\nimport { Logger } from \"@webiny/api-core/features/logger/abstractions.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { BreeSchedulerService } from \"~/BreeSchedulerService.js\";\nimport { ContextPlugin } from \"@webiny/api\";\n\nexport const registerSchedulerServerExtension = () => {\n const plugin = new ContextPlugin<CmsContext>(async context => {\n const tenantContext = context.container.resolve(TenantContext);\n\n const tenant = tenantContext.getTenant();\n if (!tenant) {\n return;\n }\n\n const logger = context.container.resolve(Logger);\n const executeScheduledAction = context.container.resolve(ExecuteScheduledActionUseCase);\n\n const service = new BreeSchedulerService({\n logger,\n onTrigger: async (id, namespace) => {\n const result = await executeScheduledAction.execute({\n id,\n namespace,\n tenant: tenant.id\n });\n\n if (result.isFail()) {\n logger.error(\n `Scheduled action \"${id}\" execution failed: ${result.error.message}`\n );\n }\n }\n });\n\n context.container.registerInstance(SchedulerService, service);\n\n const listScheduledActions = context.container.resolve(ListScheduledActionsUseCase);\n const listResult = await listScheduledActions.execute({\n where: {},\n limit: 1000\n });\n\n const pendingActions = listResult.isOk()\n ? listResult.value.items.map(action => ({\n id: action.id,\n namespace: action.namespace,\n scheduledFor: action.scheduledFor\n }))\n : undefined;\n\n await service.start(pendingActions);\n });\n\n plugin.name = \"scheduler.server.extension\";\n\n return plugin;\n};\n"],"names":["registerSchedulerServerExtension","plugin","ContextPlugin","context","tenantContext","TenantContext","tenant","logger","Logger","executeScheduledAction","ExecuteScheduledActionUseCase","service","BreeSchedulerService","id","namespace","result","SchedulerService","listScheduledActions","ListScheduledActionsUseCase","listResult","pendingActions","action","undefined"],"mappings":";;;;;;;AASO,MAAMA,mCAAmC;IAC5C,MAAMC,SAAS,IAAIC,cAA0B,OAAMC;QAC/C,MAAMC,gBAAgBD,QAAQ,SAAS,CAAC,OAAO,CAACE;QAEhD,MAAMC,SAASF,cAAc,SAAS;QACtC,IAAI,CAACE,QACD;QAGJ,MAAMC,SAASJ,QAAQ,SAAS,CAAC,OAAO,CAACK;QACzC,MAAMC,yBAAyBN,QAAQ,SAAS,CAAC,OAAO,CAACO;QAEzD,MAAMC,UAAU,IAAIC,qBAAqB;YACrCL;YACA,WAAW,OAAOM,IAAIC;gBAClB,MAAMC,SAAS,MAAMN,uBAAuB,OAAO,CAAC;oBAChDI;oBACAC;oBACA,QAAQR,OAAO,EAAE;gBACrB;gBAEA,IAAIS,OAAO,MAAM,IACbR,OAAO,KAAK,CACR,CAAC,kBAAkB,EAAEM,GAAG,oBAAoB,EAAEE,OAAO,KAAK,CAAC,OAAO,EAAE;YAGhF;QACJ;QAEAZ,QAAQ,SAAS,CAAC,gBAAgB,CAACa,kBAAkBL;QAErD,MAAMM,uBAAuBd,QAAQ,SAAS,CAAC,OAAO,CAACe;QACvD,MAAMC,aAAa,MAAMF,qBAAqB,OAAO,CAAC;YAClD,OAAO,CAAC;YACR,OAAO;QACX;QAEA,MAAMG,iBAAiBD,WAAW,IAAI,KAChCA,WAAW,KAAK,CAAC,KAAK,CAAC,GAAG,CAACE,CAAAA,SAAW;gBAClC,IAAIA,OAAO,EAAE;gBACb,WAAWA,OAAO,SAAS;gBAC3B,cAAcA,OAAO,YAAY;YACrC,MACAC;QAEN,MAAMX,QAAQ,KAAK,CAACS;IACxB;IAEAnB,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { registerSchedulerServerExtension } from "./context.js";
package/index.js ADDED
@@ -0,0 +1 @@
1
+ export { registerSchedulerServerExtension } from "./context.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { parentPort } from "node:worker_threads";
2
+ if (parentPort) parentPort.postMessage("poll");
3
+
4
+ //# sourceMappingURL=pollWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs/pollWorker.js","sources":["../../src/jobs/pollWorker.js"],"sourcesContent":["import { parentPort } from \"node:worker_threads\";\n\nif (parentPort) {\n parentPort.postMessage(\"poll\");\n}\n"],"names":["parentPort"],"mappings":";AAEA,IAAIA,YACAA,WAAW,WAAW,CAAC"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@webiny/api-scheduler-server",
3
+ "version": "0.0.0-unstable.9f53ea597d",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": "./index.js",
7
+ "./*": "./*"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/webiny/webiny-js.git",
12
+ "directory": "packages/api-scheduler-server"
13
+ },
14
+ "keywords": [
15
+ "scheduler:server"
16
+ ],
17
+ "author": "Webiny Ltd",
18
+ "description": "Server-side cron-based implementation for the Webiny action scheduler.",
19
+ "license": "MIT",
20
+ "dependencies": {
21
+ "@webiny/api": "0.0.0-unstable.9f53ea597d",
22
+ "@webiny/api-core": "0.0.0-unstable.9f53ea597d",
23
+ "@webiny/api-headless-cms": "0.0.0-unstable.9f53ea597d",
24
+ "@webiny/api-scheduler": "0.0.0-unstable.9f53ea597d",
25
+ "@webiny/error": "0.0.0-unstable.9f53ea597d",
26
+ "bree": "9.2.9"
27
+ },
28
+ "devDependencies": {
29
+ "@webiny/build-tools": "0.0.0-unstable.9f53ea597d",
30
+ "@webiny/project-utils": "0.0.0-unstable.9f53ea597d",
31
+ "typescript": "7.0.2",
32
+ "vitest": "4.1.10"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "webiny": {
38
+ "publishFrom": "dist"
39
+ }
40
+ }