n8n-core 1.49.0 → 1.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ScheduledTaskManager = void 0;
10
+ const typedi_1 = require("typedi");
11
+ const cron_1 = require("cron");
12
+ let ScheduledTaskManager = class ScheduledTaskManager {
13
+ constructor() {
14
+ this.cronJobs = new Map();
15
+ }
16
+ registerCron(workflow, cronExpression, onTick) {
17
+ const cronJob = new cron_1.CronJob(cronExpression, onTick, undefined, true, workflow.timezone);
18
+ const cronJobsForWorkflow = this.cronJobs.get(workflow.id);
19
+ if (cronJobsForWorkflow) {
20
+ cronJobsForWorkflow.push(cronJob);
21
+ }
22
+ else {
23
+ this.cronJobs.set(workflow.id, [cronJob]);
24
+ }
25
+ }
26
+ deregisterCrons(workflowId) {
27
+ var _a;
28
+ const cronJobs = (_a = this.cronJobs.get(workflowId)) !== null && _a !== void 0 ? _a : [];
29
+ for (const cronJob of cronJobs) {
30
+ cronJob.stop();
31
+ }
32
+ }
33
+ deregisterAllCrons() {
34
+ for (const workflowId of Object.keys(this.cronJobs)) {
35
+ this.deregisterCrons(workflowId);
36
+ }
37
+ }
38
+ };
39
+ exports.ScheduledTaskManager = ScheduledTaskManager;
40
+ exports.ScheduledTaskManager = ScheduledTaskManager = __decorate([
41
+ (0, typedi_1.Service)()
42
+ ], ScheduledTaskManager);
43
+ //# sourceMappingURL=ScheduledTaskManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScheduledTaskManager.js","sourceRoot":"","sources":["../src/ScheduledTaskManager.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAAiC;AACjC,+BAA+B;AAIxB,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAA1B;QACG,aAAQ,GAAG,IAAI,GAAG,EAAqB,CAAC;IAwBlD,CAAC;IAtBA,YAAY,CAAC,QAAkB,EAAE,cAA8B,EAAE,MAAkB;QAClF,MAAM,OAAO,GAAG,IAAI,cAAO,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxF,MAAM,mBAAmB,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC3D,IAAI,mBAAmB,EAAE,CAAC;YACzB,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;IAED,eAAe,CAAC,UAAkB;;QACjC,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,mCAAI,EAAE,CAAC;QACrD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAChC,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,CAAC;IACF,CAAC;IAED,kBAAkB;QACjB,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrD,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;CACD,CAAA;AAzBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,gBAAO,GAAE;GACG,oBAAoB,CAyBhC"}