n8n 1.45.0 → 1.46.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.
- package/dist/Interfaces.d.ts +6 -2
- package/dist/Interfaces.js.map +1 -1
- package/dist/Server.js +2 -2
- package/dist/Server.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/license/clear.js +4 -0
- package/dist/commands/license/clear.js.map +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/worker.js +1 -1
- package/dist/commands/worker.js.map +1 -1
- package/dist/constants.d.ts +8 -0
- package/dist/constants.js +11 -1
- package/dist/constants.js.map +1 -1
- package/dist/controllers/userSettings.controller.d.ts +7 -0
- package/dist/controllers/userSettings.controller.js +66 -0
- package/dist/controllers/userSettings.controller.js.map +1 -0
- package/dist/credentials/credentials.service.js +1 -1
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/databases/entities/AuthUser.d.ts +2 -4
- package/dist/databases/entities/AuthUser.js +2 -13
- package/dist/databases/entities/AuthUser.js.map +1 -1
- package/dist/databases/entities/ProjectRelation.d.ts +1 -1
- package/dist/databases/entities/ProjectRelation.js.map +1 -1
- package/dist/databases/migrations/mysqldb/1717498465931-AddActivatedAtUserSetting.d.ts +5 -0
- package/dist/databases/migrations/mysqldb/1717498465931-AddActivatedAtUserSetting.js +18 -0
- package/dist/databases/migrations/mysqldb/1717498465931-AddActivatedAtUserSetting.js.map +1 -0
- package/dist/databases/migrations/mysqldb/index.js +2 -0
- package/dist/databases/migrations/mysqldb/index.js.map +1 -1
- package/dist/databases/migrations/postgresdb/1717498465931-AddActivatedAtUserSetting.d.ts +5 -0
- package/dist/databases/migrations/postgresdb/1717498465931-AddActivatedAtUserSetting.js +16 -0
- package/dist/databases/migrations/postgresdb/1717498465931-AddActivatedAtUserSetting.js.map +1 -0
- package/dist/databases/migrations/postgresdb/index.js +2 -0
- package/dist/databases/migrations/postgresdb/index.js.map +1 -1
- package/dist/databases/migrations/sqlite/1717498465931-AddActivatedAtUserSetting.d.ts +6 -0
- package/dist/databases/migrations/sqlite/1717498465931-AddActivatedAtUserSetting.js +19 -0
- package/dist/databases/migrations/sqlite/1717498465931-AddActivatedAtUserSetting.js.map +1 -0
- package/dist/databases/migrations/sqlite/index.js +2 -0
- package/dist/databases/migrations/sqlite/index.js.map +1 -1
- package/dist/errors/node-crashed.error.d.ts +5 -0
- package/dist/errors/node-crashed.error.js +14 -0
- package/dist/errors/node-crashed.error.js.map +1 -0
- package/dist/errors/workflow-crashed.error.d.ts +4 -0
- package/dist/errors/workflow-crashed.error.js +11 -0
- package/dist/errors/workflow-crashed.error.js.map +1 -0
- package/dist/eventbus/MessageEventBus/MessageEventBus.d.ts +4 -4
- package/dist/eventbus/MessageEventBus/MessageEventBus.js +9 -20
- package/dist/eventbus/MessageEventBus/MessageEventBus.js.map +1 -1
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestination.ee.d.ts +2 -0
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestination.ee.js +2 -0
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestination.ee.js.map +1 -1
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestinationSentry.ee.js +1 -2
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestinationSentry.ee.js.map +1 -1
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestinationSyslog.ee.js +1 -2
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestinationSyslog.ee.js.map +1 -1
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestinationWebhook.ee.js +1 -2
- package/dist/eventbus/MessageEventBusDestination/MessageEventBusDestinationWebhook.ee.js.map +1 -1
- package/dist/eventbus/MessageEventBusWriter/MessageEventBusLogWriter.d.ts +2 -1
- package/dist/eventbus/MessageEventBusWriter/MessageEventBusLogWriter.js +21 -9
- package/dist/eventbus/MessageEventBusWriter/MessageEventBusLogWriter.js.map +1 -1
- package/dist/eventbus/MessageEventBusWriter/MessageEventBusLogWriterWorker.js +0 -4
- package/dist/eventbus/MessageEventBusWriter/MessageEventBusLogWriterWorker.js.map +1 -1
- package/dist/eventbus/eventBus.controller.d.ts +6 -4
- package/dist/eventbus/eventBus.controller.js +85 -62
- package/dist/eventbus/eventBus.controller.js.map +1 -1
- package/dist/eventbus/index.d.ts +0 -1
- package/dist/eventbus/index.js +0 -4
- package/dist/eventbus/index.js.map +1 -1
- package/dist/executions/execution-recovery.service.d.ts +14 -0
- package/dist/executions/execution-recovery.service.js +169 -0
- package/dist/executions/execution-recovery.service.js.map +1 -0
- package/dist/permissions/global-roles.js +0 -7
- package/dist/permissions/global-roles.js.map +1 -1
- package/dist/permissions/project-roles.d.ts +1 -0
- package/dist/permissions/project-roles.js +9 -1
- package/dist/permissions/project-roles.js.map +1 -1
- package/dist/requests.d.ts +3 -0
- package/dist/services/events.service.js +1 -0
- package/dist/services/events.service.js.map +1 -1
- package/dist/services/hooks.service.d.ts +45 -0
- package/dist/services/hooks.service.js +78 -0
- package/dist/services/hooks.service.js.map +1 -0
- package/dist/services/metrics.service.d.ts +4 -0
- package/dist/services/metrics.service.js +36 -3
- package/dist/services/metrics.service.js.map +1 -1
- package/dist/services/orchestration/main/orchestration.handler.main.service.js +1 -29
- package/dist/services/orchestration/main/orchestration.handler.main.service.js.map +1 -1
- package/dist/services/orchestration/worker/orchestration.worker.service.d.ts +0 -2
- package/dist/services/orchestration/worker/orchestration.worker.service.js +0 -5
- package/dist/services/orchestration/worker/orchestration.worker.service.js.map +1 -1
- package/dist/services/redis/RedisServiceHelper.d.ts +0 -1
- package/dist/services/redis/RedisServiceHelper.js +1 -2
- package/dist/services/redis/RedisServiceHelper.js.map +1 -1
- package/dist/services/redis/RedisServicePubSubPublisher.d.ts +0 -2
- package/dist/services/redis/RedisServicePubSubPublisher.js +0 -3
- package/dist/services/redis/RedisServicePubSubPublisher.js.map +1 -1
- package/dist/services/redis/RedisServicePubSubSubscriber.d.ts +0 -2
- package/dist/services/redis/RedisServicePubSubSubscriber.js +0 -6
- package/dist/services/redis/RedisServicePubSubSubscriber.js.map +1 -1
- package/dist/services/role.service.js +4 -0
- package/dist/services/role.service.js.map +1 -1
- package/dist/services/user.service.d.ts +3 -6
- package/dist/services/user.service.js +4 -4
- package/dist/services/user.service.js.map +1 -1
- package/package.json +7 -7
- package/templates/form-trigger.handlebars +1 -1
- package/dist/eventbus/EventMessageClasses/Helpers.d.ts +0 -11
- package/dist/eventbus/EventMessageClasses/Helpers.js +0 -85
- package/dist/eventbus/EventMessageClasses/Helpers.js.map +0 -1
- package/dist/eventbus/MessageEventBus/MessageEventBusHelper.d.ts +0 -1
- package/dist/eventbus/MessageEventBus/MessageEventBusHelper.js +0 -11
- package/dist/eventbus/MessageEventBus/MessageEventBusHelper.js.map +0 -1
- package/dist/eventbus/MessageEventBusDestination/Helpers.ee.d.ts +0 -6
- package/dist/eventbus/MessageEventBusDestination/Helpers.ee.js +0 -51
- package/dist/eventbus/MessageEventBusDestination/Helpers.ee.js.map +0 -1
- package/dist/eventbus/eventBus.controller.ee.d.ts +0 -12
- package/dist/eventbus/eventBus.controller.ee.js +0 -135
- package/dist/eventbus/eventBus.controller.ee.js.map +0 -1
- package/dist/eventbus/executionDataRecovery.service.d.ts +0 -10
- package/dist/eventbus/executionDataRecovery.service.js +0 -180
- package/dist/eventbus/executionDataRecovery.service.js.map +0 -1
- package/dist/eventbus/middleware/logStreamingEnabled.middleware.ee.d.ts +0 -3
- package/dist/eventbus/middleware/logStreamingEnabled.middleware.ee.js +0 -22
- package/dist/eventbus/middleware/logStreamingEnabled.middleware.ee.js.map +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eventListToObjectTree = exports.eventListToObject = exports.eventGroupFromEventName = exports.getEventMessageObjectByType = void 0;
|
|
4
|
-
const EventMessageGeneric_1 = require("./EventMessageGeneric");
|
|
5
|
-
const EventMessageWorkflow_1 = require("./EventMessageWorkflow");
|
|
6
|
-
const EventMessageAudit_1 = require("./EventMessageAudit");
|
|
7
|
-
const EventMessageNode_1 = require("./EventMessageNode");
|
|
8
|
-
const getEventMessageObjectByType = (message) => {
|
|
9
|
-
switch (message.__type) {
|
|
10
|
-
case "$$EventMessage":
|
|
11
|
-
return new EventMessageGeneric_1.EventMessageGeneric(message);
|
|
12
|
-
case "$$EventMessageWorkflow":
|
|
13
|
-
return new EventMessageWorkflow_1.EventMessageWorkflow(message);
|
|
14
|
-
case "$$EventMessageAudit":
|
|
15
|
-
return new EventMessageAudit_1.EventMessageAudit(message);
|
|
16
|
-
case "$$EventMessageNode":
|
|
17
|
-
return new EventMessageNode_1.EventMessageNode(message);
|
|
18
|
-
default:
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.getEventMessageObjectByType = getEventMessageObjectByType;
|
|
23
|
-
function eventGroupFromEventName(eventName) {
|
|
24
|
-
const matches = eventName.match(/^[\w\s]+\.[\w\s]+/);
|
|
25
|
-
if (matches && (matches === null || matches === void 0 ? void 0 : matches.length) > 0) {
|
|
26
|
-
return matches[0];
|
|
27
|
-
}
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
exports.eventGroupFromEventName = eventGroupFromEventName;
|
|
31
|
-
function dotsToObject2(dottedString, o) {
|
|
32
|
-
const rootObject = o !== null && o !== void 0 ? o : {};
|
|
33
|
-
if (!dottedString)
|
|
34
|
-
return rootObject;
|
|
35
|
-
const parts = dottedString.split('.');
|
|
36
|
-
let part;
|
|
37
|
-
let obj = rootObject;
|
|
38
|
-
while ((part = parts.shift())) {
|
|
39
|
-
if (typeof obj[part] !== 'object') {
|
|
40
|
-
obj[part] = {
|
|
41
|
-
__name: part,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
obj = obj[part];
|
|
45
|
-
}
|
|
46
|
-
return rootObject;
|
|
47
|
-
}
|
|
48
|
-
function eventListToObject(dottedList) {
|
|
49
|
-
const result = {};
|
|
50
|
-
dottedList.forEach((e) => {
|
|
51
|
-
dotsToObject2(e, result);
|
|
52
|
-
});
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
exports.eventListToObject = eventListToObject;
|
|
56
|
-
function eventListToObjectTree(dottedList) {
|
|
57
|
-
const x = {
|
|
58
|
-
name: 'eventTree',
|
|
59
|
-
children: [],
|
|
60
|
-
};
|
|
61
|
-
dottedList.forEach((dottedString) => {
|
|
62
|
-
const parts = dottedString.split('.');
|
|
63
|
-
let part;
|
|
64
|
-
let children = x.children;
|
|
65
|
-
while ((part = parts.shift())) {
|
|
66
|
-
if (part) {
|
|
67
|
-
const foundChild = children.find((e) => e.name === part);
|
|
68
|
-
if (foundChild) {
|
|
69
|
-
children = foundChild.children;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
const newChild = {
|
|
73
|
-
name: part,
|
|
74
|
-
children: [],
|
|
75
|
-
};
|
|
76
|
-
children.push(newChild);
|
|
77
|
-
children = newChild.children;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
return x;
|
|
83
|
-
}
|
|
84
|
-
exports.eventListToObjectTree = eventListToObjectTree;
|
|
85
|
-
//# sourceMappingURL=Helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Helpers.js","sourceRoot":"","sources":["../../../src/eventbus/EventMessageClasses/Helpers.ts"],"names":[],"mappings":";;;AAEA,+DAA4D;AAG5D,iEAA8D;AAG9D,2DAAwD;AAExD,yDAAsD;AAE/C,MAAM,2BAA2B,GAAG,CAC1C,OAAoC,EACT,EAAE;IAC7B,QAAQ,OAAO,CAAC,MAA+B,EAAE,CAAC;QACjD;YACC,OAAO,IAAI,yCAAmB,CAAC,OAAqC,CAAC,CAAC;QACvE;YACC,OAAO,IAAI,2CAAoB,CAAC,OAAsC,CAAC,CAAC;QACz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StreamingEnabled = void 0;
|
|
4
|
-
const License_1 = require("../../License");
|
|
5
|
-
const typedi_1 = require("typedi");
|
|
6
|
-
function isLogStreamingEnabled() {
|
|
7
|
-
const license = typedi_1.Container.get(License_1.License);
|
|
8
|
-
return license.isLogStreamingEnabled();
|
|
9
|
-
}
|
|
10
|
-
exports.isLogStreamingEnabled = isLogStreamingEnabled;
|
|
11
|
-
//# sourceMappingURL=MessageEventBusHelper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MessageEventBusHelper.js","sourceRoot":"","sources":["../../../src/eventbus/MessageEventBus/MessageEventBusHelper.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AACpC,mCAAmC;AAEnC,SAAgB,qBAAqB;IACpC,MAAM,OAAO,GAAG,kBAAS,CAAC,GAAG,CAAC,iBAAO,CAAC,CAAC;IACvC,OAAO,OAAO,CAAC,qBAAqB,EAAE,CAAC;AACxC,CAAC;AAHD,sDAGC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { EventMessageTypes } from '../EventMessageClasses';
|
|
2
|
-
export declare const METRICS_EVENT_NAME = "metrics.messageEventBus.Event";
|
|
3
|
-
export declare function getMetricNameForEvent(event: EventMessageTypes): string;
|
|
4
|
-
export declare function getLabelValueForNode(nodeType: string): string;
|
|
5
|
-
export declare function getLabelValueForCredential(credentialType: string): string;
|
|
6
|
-
export declare function getLabelsForEvent(event: EventMessageTypes): Record<string, string>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getLabelsForEvent = exports.getLabelValueForCredential = exports.getLabelValueForNode = exports.getMetricNameForEvent = exports.METRICS_EVENT_NAME = void 0;
|
|
7
|
-
const config_1 = __importDefault(require("../../config"));
|
|
8
|
-
exports.METRICS_EVENT_NAME = 'metrics.messageEventBus.Event';
|
|
9
|
-
function getMetricNameForEvent(event) {
|
|
10
|
-
const prefix = config_1.default.getEnv('endpoints.metrics.prefix');
|
|
11
|
-
return prefix + event.eventName.replace('n8n.', '').replace(/\./g, '_') + '_total';
|
|
12
|
-
}
|
|
13
|
-
exports.getMetricNameForEvent = getMetricNameForEvent;
|
|
14
|
-
function getLabelValueForNode(nodeType) {
|
|
15
|
-
return nodeType.replace('n8n-nodes-', '').replace(/\./g, '_');
|
|
16
|
-
}
|
|
17
|
-
exports.getLabelValueForNode = getLabelValueForNode;
|
|
18
|
-
function getLabelValueForCredential(credentialType) {
|
|
19
|
-
return credentialType.replace(/\./g, '_');
|
|
20
|
-
}
|
|
21
|
-
exports.getLabelValueForCredential = getLabelValueForCredential;
|
|
22
|
-
function getLabelsForEvent(event) {
|
|
23
|
-
var _a, _b, _c, _d, _e, _f;
|
|
24
|
-
switch (event.__type) {
|
|
25
|
-
case "$$EventMessageAudit":
|
|
26
|
-
if (event.eventName.startsWith('n8n.audit.user.credentials')) {
|
|
27
|
-
return config_1.default.getEnv('endpoints.metrics.includeCredentialTypeLabel')
|
|
28
|
-
? {
|
|
29
|
-
credential_type: getLabelValueForCredential((_a = event.payload.credentialType) !== null && _a !== void 0 ? _a : 'unknown'),
|
|
30
|
-
}
|
|
31
|
-
: {};
|
|
32
|
-
}
|
|
33
|
-
if (event.eventName.startsWith('n8n.audit.workflow')) {
|
|
34
|
-
return config_1.default.getEnv('endpoints.metrics.includeWorkflowIdLabel')
|
|
35
|
-
? { workflow_id: (_c = (_b = event.payload.workflowId) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'unknown' }
|
|
36
|
-
: {};
|
|
37
|
-
}
|
|
38
|
-
break;
|
|
39
|
-
case "$$EventMessageNode":
|
|
40
|
-
return config_1.default.getEnv('endpoints.metrics.includeNodeTypeLabel')
|
|
41
|
-
? { node_type: getLabelValueForNode((_d = event.payload.nodeType) !== null && _d !== void 0 ? _d : 'unknown') }
|
|
42
|
-
: {};
|
|
43
|
-
case "$$EventMessageWorkflow":
|
|
44
|
-
return config_1.default.getEnv('endpoints.metrics.includeWorkflowIdLabel')
|
|
45
|
-
? { workflow_id: (_f = (_e = event.payload.workflowId) === null || _e === void 0 ? void 0 : _e.toString()) !== null && _f !== void 0 ? _f : 'unknown' }
|
|
46
|
-
: {};
|
|
47
|
-
}
|
|
48
|
-
return {};
|
|
49
|
-
}
|
|
50
|
-
exports.getLabelsForEvent = getLabelsForEvent;
|
|
51
|
-
//# sourceMappingURL=Helpers.ee.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Helpers.ee.js","sourceRoot":"","sources":["../../../src/eventbus/MessageEventBusDestination/Helpers.ee.ts"],"names":[],"mappings":";;;;;;AACA,sDAA8B;AAGjB,QAAA,kBAAkB,GAAG,+BAA+B,CAAC;AAElE,SAAgB,qBAAqB,CAAC,KAAwB;IAC7D,MAAM,MAAM,GAAG,gBAAM,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;IACzD,OAAO,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC;AACpF,CAAC;AAHD,sDAGC;AAED,SAAgB,oBAAoB,CAAC,QAAgB;IACpD,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/D,CAAC;AAFD,oDAEC;AAED,SAAgB,0BAA0B,CAAC,cAAsB;IAChE,OAAO,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAFD,gEAEC;AAED,SAAgB,iBAAiB,CAAC,KAAwB;;IACzD,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QACtB;YACC,IAAI,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC;gBAC9D,OAAO,gBAAM,CAAC,MAAM,CAAC,8CAA8C,CAAC;oBACnE,CAAC,CAAC;wBACA,eAAe,EAAE,0BAA0B,CAC1C,MAAA,KAAK,CAAC,OAAO,CAAC,cAAc,mCAAI,SAAS,CACzC;qBACD;oBACF,CAAC,CAAC,EAAE,CAAC;YACP,CAAC;YAED,IAAI,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,CAAC;gBACtD,OAAO,gBAAM,CAAC,MAAM,CAAC,0CAA0C,CAAC;oBAC/D,CAAC,CAAC,EAAE,WAAW,EAAE,MAAA,MAAA,KAAK,CAAC,OAAO,CAAC,UAAU,0CAAE,QAAQ,EAAE,mCAAI,SAAS,EAAE;oBACpE,CAAC,CAAC,EAAE,CAAC;YACP,CAAC;YACD,MAAM;QAEP;YACC,OAAO,gBAAM,CAAC,MAAM,CAAC,wCAAwC,CAAC;gBAC7D,CAAC,CAAC,EAAE,SAAS,EAAE,oBAAoB,CAAC,MAAA,KAAK,CAAC,OAAO,CAAC,QAAQ,mCAAI,SAAS,CAAC,EAAE;gBAC1E,CAAC,CAAC,EAAE,CAAC;QAEP;YACC,OAAO,gBAAM,CAAC,MAAM,CAAC,0CAA0C,CAAC;gBAC/D,CAAC,CAAC,EAAE,WAAW,EAAE,MAAA,MAAA,KAAK,CAAC,OAAO,CAAC,UAAU,0CAAE,QAAQ,EAAE,mCAAI,SAAS,EAAE;gBACpE,CAAC,CAAC,EAAE,CAAC;IACR,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC;AAhCD,8CAgCC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import express from 'express';
|
|
2
|
-
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
|
|
3
|
-
import { AuthenticatedRequest } from '../requests';
|
|
4
|
-
import { MessageEventBus } from './MessageEventBus/MessageEventBus';
|
|
5
|
-
export declare class EventBusControllerEE {
|
|
6
|
-
private readonly eventBus;
|
|
7
|
-
constructor(eventBus: MessageEventBus);
|
|
8
|
-
getDestination(req: express.Request): Promise<MessageEventBusDestinationOptions[]>;
|
|
9
|
-
postDestination(req: AuthenticatedRequest): Promise<any>;
|
|
10
|
-
sendTestMessage(req: express.Request): Promise<boolean>;
|
|
11
|
-
deleteDestination(req: AuthenticatedRequest): Promise<import("@n8n/typeorm").DeleteResult | undefined>;
|
|
12
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
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
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.EventBusControllerEE = void 0;
|
|
16
|
-
const express_1 = __importDefault(require("express"));
|
|
17
|
-
const decorators_1 = require("../decorators");
|
|
18
|
-
const bad_request_error_1 = require("../errors/response-errors/bad-request.error");
|
|
19
|
-
const MessageEventBus_1 = require("./MessageEventBus/MessageEventBus");
|
|
20
|
-
const MessageEventBusDestinationSentry_ee_1 = require("./MessageEventBusDestination/MessageEventBusDestinationSentry.ee");
|
|
21
|
-
const MessageEventBusDestinationSyslog_ee_1 = require("./MessageEventBusDestination/MessageEventBusDestinationSyslog.ee");
|
|
22
|
-
const MessageEventBusDestinationWebhook_ee_1 = require("./MessageEventBusDestination/MessageEventBusDestinationWebhook.ee");
|
|
23
|
-
const logStreamingEnabled_middleware_ee_1 = require("./middleware/logStreamingEnabled.middleware.ee");
|
|
24
|
-
const isWithIdString = (candidate) => {
|
|
25
|
-
const o = candidate;
|
|
26
|
-
if (!o)
|
|
27
|
-
return false;
|
|
28
|
-
return o.id !== undefined;
|
|
29
|
-
};
|
|
30
|
-
const isMessageEventBusDestinationWebhookOptions = (candidate) => {
|
|
31
|
-
const o = candidate;
|
|
32
|
-
if (!o)
|
|
33
|
-
return false;
|
|
34
|
-
return o.url !== undefined;
|
|
35
|
-
};
|
|
36
|
-
const isMessageEventBusDestinationOptions = (candidate) => {
|
|
37
|
-
const o = candidate;
|
|
38
|
-
if (!o)
|
|
39
|
-
return false;
|
|
40
|
-
return o.__type !== undefined;
|
|
41
|
-
};
|
|
42
|
-
let EventBusControllerEE = class EventBusControllerEE {
|
|
43
|
-
constructor(eventBus) {
|
|
44
|
-
this.eventBus = eventBus;
|
|
45
|
-
}
|
|
46
|
-
async getDestination(req) {
|
|
47
|
-
if (isWithIdString(req.query)) {
|
|
48
|
-
return await this.eventBus.findDestination(req.query.id);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
return await this.eventBus.findDestination();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async postDestination(req) {
|
|
55
|
-
let result;
|
|
56
|
-
if (isMessageEventBusDestinationOptions(req.body)) {
|
|
57
|
-
switch (req.body.__type) {
|
|
58
|
-
case "$$MessageEventBusDestinationSentry":
|
|
59
|
-
if ((0, MessageEventBusDestinationSentry_ee_1.isMessageEventBusDestinationSentryOptions)(req.body)) {
|
|
60
|
-
result = await this.eventBus.addDestination(new MessageEventBusDestinationSentry_ee_1.MessageEventBusDestinationSentry(this.eventBus, req.body));
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
63
|
-
case "$$MessageEventBusDestinationWebhook":
|
|
64
|
-
if (isMessageEventBusDestinationWebhookOptions(req.body)) {
|
|
65
|
-
result = await this.eventBus.addDestination(new MessageEventBusDestinationWebhook_ee_1.MessageEventBusDestinationWebhook(this.eventBus, req.body));
|
|
66
|
-
}
|
|
67
|
-
break;
|
|
68
|
-
case "$$MessageEventBusDestinationSyslog":
|
|
69
|
-
if ((0, MessageEventBusDestinationSyslog_ee_1.isMessageEventBusDestinationSyslogOptions)(req.body)) {
|
|
70
|
-
result = await this.eventBus.addDestination(new MessageEventBusDestinationSyslog_ee_1.MessageEventBusDestinationSyslog(this.eventBus, req.body));
|
|
71
|
-
}
|
|
72
|
-
break;
|
|
73
|
-
default:
|
|
74
|
-
throw new bad_request_error_1.BadRequestError(`Body is missing ${req.body.__type} options or type ${req.body.__type} is unknown`);
|
|
75
|
-
}
|
|
76
|
-
if (result) {
|
|
77
|
-
await result.saveToDb();
|
|
78
|
-
return {
|
|
79
|
-
...result.serialize(),
|
|
80
|
-
eventBusInstance: undefined,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
throw new bad_request_error_1.BadRequestError('There was an error adding the destination');
|
|
84
|
-
}
|
|
85
|
-
throw new bad_request_error_1.BadRequestError('Body is not configuring MessageEventBusDestinationOptions');
|
|
86
|
-
}
|
|
87
|
-
async sendTestMessage(req) {
|
|
88
|
-
if (isWithIdString(req.query)) {
|
|
89
|
-
return await this.eventBus.testDestination(req.query.id);
|
|
90
|
-
}
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
async deleteDestination(req) {
|
|
94
|
-
if (isWithIdString(req.query)) {
|
|
95
|
-
return await this.eventBus.removeDestination(req.query.id);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
throw new bad_request_error_1.BadRequestError('Query is missing id');
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
exports.EventBusControllerEE = EventBusControllerEE;
|
|
103
|
-
__decorate([
|
|
104
|
-
(0, decorators_1.Get)('/destination', { middlewares: [logStreamingEnabled_middleware_ee_1.logStreamingLicensedMiddleware] }),
|
|
105
|
-
(0, decorators_1.GlobalScope)('eventBusDestination:list'),
|
|
106
|
-
__metadata("design:type", Function),
|
|
107
|
-
__metadata("design:paramtypes", [Object]),
|
|
108
|
-
__metadata("design:returntype", Promise)
|
|
109
|
-
], EventBusControllerEE.prototype, "getDestination", null);
|
|
110
|
-
__decorate([
|
|
111
|
-
(0, decorators_1.Post)('/destination', { middlewares: [logStreamingEnabled_middleware_ee_1.logStreamingLicensedMiddleware] }),
|
|
112
|
-
(0, decorators_1.GlobalScope)('eventBusDestination:create'),
|
|
113
|
-
__metadata("design:type", Function),
|
|
114
|
-
__metadata("design:paramtypes", [Object]),
|
|
115
|
-
__metadata("design:returntype", Promise)
|
|
116
|
-
], EventBusControllerEE.prototype, "postDestination", null);
|
|
117
|
-
__decorate([
|
|
118
|
-
(0, decorators_1.Get)('/testmessage', { middlewares: [logStreamingEnabled_middleware_ee_1.logStreamingLicensedMiddleware] }),
|
|
119
|
-
(0, decorators_1.GlobalScope)('eventBusDestination:test'),
|
|
120
|
-
__metadata("design:type", Function),
|
|
121
|
-
__metadata("design:paramtypes", [Object]),
|
|
122
|
-
__metadata("design:returntype", Promise)
|
|
123
|
-
], EventBusControllerEE.prototype, "sendTestMessage", null);
|
|
124
|
-
__decorate([
|
|
125
|
-
(0, decorators_1.Delete)('/destination', { middlewares: [logStreamingEnabled_middleware_ee_1.logStreamingLicensedMiddleware] }),
|
|
126
|
-
(0, decorators_1.GlobalScope)('eventBusDestination:delete'),
|
|
127
|
-
__metadata("design:type", Function),
|
|
128
|
-
__metadata("design:paramtypes", [Object]),
|
|
129
|
-
__metadata("design:returntype", Promise)
|
|
130
|
-
], EventBusControllerEE.prototype, "deleteDestination", null);
|
|
131
|
-
exports.EventBusControllerEE = EventBusControllerEE = __decorate([
|
|
132
|
-
(0, decorators_1.RestController)('/eventbus'),
|
|
133
|
-
__metadata("design:paramtypes", [MessageEventBus_1.MessageEventBus])
|
|
134
|
-
], EventBusControllerEE);
|
|
135
|
-
//# sourceMappingURL=eventBus.controller.ee.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventBus.controller.ee.js","sourceRoot":"","sources":["../../src/eventbus/eventBus.controller.ee.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA8B;AAO9B,6CAA8E;AAE9E,kFAA6E;AAE7E,uEAAoE;AACpE,0HAG0E;AAC1E,0HAG0E;AAC1E,4HAAsH;AAEtH,sGAAgG;AAMhG,MAAM,cAAc,GAAG,CAAC,SAAkB,EAA+B,EAAE;IAC1E,MAAM,CAAC,GAAG,SAA2B,CAAC;IACtC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,CAAC,EAAE,KAAK,SAAS,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,0CAA0C,GAAG,CAClD,SAAkB,EACsC,EAAE;IAC1D,MAAM,CAAC,GAAG,SAAqD,CAAC;IAChE,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,mCAAmC,GAAG,CAC3C,SAAkB,EAC+B,EAAE;IACnD,MAAM,CAAC,GAAG,SAA8C,CAAC;IACzD,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC;AAC/B,CAAC,CAAC;AAOK,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAChC,YAA6B,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;IAAG,CAAC;IAQpD,AAAN,KAAK,CAAC,cAAc,CAA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;IACvE,IAAA,wBAAW,EAAC,4BAA4B,CAAC;;;;2DAyCzC;AAIK;IAFL,IAAA,gBAAG,EAAC,cAAc,EAAE,EAAE,WAAW,EAAE,CAAC,kEAA8B,CAAC,EAAE,CAAC;IACtE,IAAA,wBAAW,EAAC,0BAA0B,CAAC;;;;2DAMvC;AAIK;IAFL,IAAA,mBAAM,EAAC,cAAc,EAAE,EAAE,WAAW,EAAE,CAAC,kEAA8B,CAAC,EAAE,CAAC;IACzE,IAAA,wBAAW,EAAC,4BAA4B,CAAC;;;;6DAOzC;+BA9EW,oBAAoB;IADhC,IAAA,2BAAc,EAAC,WAAW,CAAC;qCAEY,iCAAe;GAD1C,oBAAoB,CA+EhC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Push } from '../push';
|
|
2
|
-
import type { IRunExecutionData } from 'n8n-workflow';
|
|
3
|
-
import { ExecutionRepository } from '../databases/repositories/execution.repository';
|
|
4
|
-
import type { EventMessageTypes } from './EventMessageClasses';
|
|
5
|
-
export declare class ExecutionDataRecoveryService {
|
|
6
|
-
private readonly push;
|
|
7
|
-
private readonly executionRepository;
|
|
8
|
-
constructor(push: Push, executionRepository: ExecutionRepository);
|
|
9
|
-
recoverExecutionData(executionId: string, messages: EventMessageTypes[], applyToDb: boolean): Promise<IRunExecutionData | undefined>;
|
|
10
|
-
}
|
|
@@ -1,180 +0,0 @@
|
|
|
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
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ExecutionDataRecoveryService = void 0;
|
|
13
|
-
const typedi_1 = require("typedi");
|
|
14
|
-
const push_1 = require("../push");
|
|
15
|
-
const InternalHooks_1 = require("../InternalHooks");
|
|
16
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
17
|
-
const execution_repository_1 = require("../databases/repositories/execution.repository");
|
|
18
|
-
const WorkflowExecuteAdditionalData_1 = require("../WorkflowExecuteAdditionalData");
|
|
19
|
-
let ExecutionDataRecoveryService = class ExecutionDataRecoveryService {
|
|
20
|
-
constructor(push, executionRepository) {
|
|
21
|
-
this.push = push;
|
|
22
|
-
this.executionRepository = executionRepository;
|
|
23
|
-
}
|
|
24
|
-
async recoverExecutionData(executionId, messages, applyToDb) {
|
|
25
|
-
var _a, _b, _c, _d;
|
|
26
|
-
const executionEntry = await this.executionRepository.findSingleExecution(executionId, {
|
|
27
|
-
includeData: true,
|
|
28
|
-
unflattenData: true,
|
|
29
|
-
});
|
|
30
|
-
if (executionEntry && messages) {
|
|
31
|
-
let executionData = executionEntry.data;
|
|
32
|
-
let workflowError;
|
|
33
|
-
if (!executionData) {
|
|
34
|
-
executionData = { resultData: { runData: {} } };
|
|
35
|
-
}
|
|
36
|
-
let nodeNames = [];
|
|
37
|
-
if (((_a = executionData === null || executionData === void 0 ? void 0 : executionData.resultData) === null || _a === void 0 ? void 0 : _a.runData) &&
|
|
38
|
-
Object.keys(executionData.resultData.runData).length > 0) {
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
if (!executionData.resultData) {
|
|
42
|
-
executionData.resultData = {
|
|
43
|
-
runData: {},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
if (!executionData.resultData.runData) {
|
|
48
|
-
executionData.resultData.runData = {};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
nodeNames = executionEntry.workflowData.nodes.map((n) => n.name);
|
|
53
|
-
let lastNodeRunTimestamp = undefined;
|
|
54
|
-
for (const nodeName of nodeNames) {
|
|
55
|
-
const nodeByName = executionEntry === null || executionEntry === void 0 ? void 0 : executionEntry.workflowData.nodes.find((n) => n.name === nodeName);
|
|
56
|
-
if (!nodeByName)
|
|
57
|
-
continue;
|
|
58
|
-
const nodeStartedMessage = messages.find((message) => message.eventName === 'n8n.node.started' && message.payload.nodeName === nodeName);
|
|
59
|
-
const nodeFinishedMessage = messages.find((message) => message.eventName === 'n8n.node.finished' && message.payload.nodeName === nodeName);
|
|
60
|
-
const executionTime = nodeStartedMessage && nodeFinishedMessage
|
|
61
|
-
? nodeFinishedMessage.ts.diff(nodeStartedMessage.ts).toMillis()
|
|
62
|
-
: 0;
|
|
63
|
-
let taskData;
|
|
64
|
-
if (((_b = executionData.resultData.runData[nodeName]) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
65
|
-
taskData = executionData.resultData.runData[nodeName][0];
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
taskData = {
|
|
69
|
-
startTime: nodeStartedMessage ? nodeStartedMessage.ts.toUnixInteger() : 0,
|
|
70
|
-
executionTime,
|
|
71
|
-
source: [null],
|
|
72
|
-
executionStatus: 'unknown',
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
if (nodeStartedMessage && !nodeFinishedMessage) {
|
|
76
|
-
const nodeError = new n8n_workflow_1.NodeOperationError(nodeByName, 'Node crashed, possible out-of-memory issue', {
|
|
77
|
-
message: 'Execution stopped at this node',
|
|
78
|
-
description: "n8n may have run out of memory while executing it. More context and tips on how to avoid this <a href='https://docs.n8n.io/flow-logic/error-handling/memory-errors' target='_blank'>in the docs</a>",
|
|
79
|
-
});
|
|
80
|
-
workflowError = new n8n_workflow_1.WorkflowOperationError('Workflow did not finish, possible out-of-memory issue');
|
|
81
|
-
taskData.error = nodeError;
|
|
82
|
-
taskData.executionStatus = 'crashed';
|
|
83
|
-
executionData.resultData.lastNodeExecuted = nodeName;
|
|
84
|
-
if (nodeStartedMessage)
|
|
85
|
-
lastNodeRunTimestamp = nodeStartedMessage.ts;
|
|
86
|
-
}
|
|
87
|
-
else if (nodeStartedMessage && nodeFinishedMessage) {
|
|
88
|
-
taskData.executionStatus = 'success';
|
|
89
|
-
if (taskData.data === undefined) {
|
|
90
|
-
taskData.data = {
|
|
91
|
-
main: [
|
|
92
|
-
[
|
|
93
|
-
{
|
|
94
|
-
json: {
|
|
95
|
-
isArtificialRecoveredEventItem: true,
|
|
96
|
-
},
|
|
97
|
-
pairedItem: undefined,
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
],
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (!executionData.resultData.runData[nodeName]) {
|
|
105
|
-
executionData.resultData.runData[nodeName] = [taskData];
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (!lastNodeRunTimestamp) {
|
|
109
|
-
const workflowEndedMessage = messages.find((message) => [
|
|
110
|
-
'n8n.workflow.success',
|
|
111
|
-
'n8n.workflow.crashed',
|
|
112
|
-
'n8n.workflow.failed',
|
|
113
|
-
].includes(message.eventName));
|
|
114
|
-
if (workflowEndedMessage) {
|
|
115
|
-
lastNodeRunTimestamp = workflowEndedMessage.ts;
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
if (!workflowError) {
|
|
119
|
-
workflowError = new n8n_workflow_1.WorkflowOperationError('Workflow did not finish, possible out-of-memory issue');
|
|
120
|
-
}
|
|
121
|
-
const workflowStartedMessage = messages.find((message) => message.eventName === 'n8n.workflow.started');
|
|
122
|
-
if (workflowStartedMessage) {
|
|
123
|
-
lastNodeRunTimestamp = workflowStartedMessage.ts;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
if (!executionData.resultData.error && workflowError) {
|
|
128
|
-
executionData.resultData.error = workflowError;
|
|
129
|
-
}
|
|
130
|
-
if (applyToDb) {
|
|
131
|
-
const newStatus = executionEntry.status === 'error' ? 'error' : 'crashed';
|
|
132
|
-
await this.executionRepository.updateExistingExecution(executionId, {
|
|
133
|
-
data: executionData,
|
|
134
|
-
status: newStatus,
|
|
135
|
-
stoppedAt: lastNodeRunTimestamp === null || lastNodeRunTimestamp === void 0 ? void 0 : lastNodeRunTimestamp.toJSDate(),
|
|
136
|
-
});
|
|
137
|
-
await typedi_1.Container.get(InternalHooks_1.InternalHooks).onWorkflowPostExecute(executionId, executionEntry.workflowData, {
|
|
138
|
-
data: executionData,
|
|
139
|
-
finished: false,
|
|
140
|
-
mode: executionEntry.mode,
|
|
141
|
-
waitTill: (_c = executionEntry.waitTill) !== null && _c !== void 0 ? _c : undefined,
|
|
142
|
-
startedAt: executionEntry.startedAt,
|
|
143
|
-
stoppedAt: lastNodeRunTimestamp === null || lastNodeRunTimestamp === void 0 ? void 0 : lastNodeRunTimestamp.toJSDate(),
|
|
144
|
-
status: newStatus,
|
|
145
|
-
});
|
|
146
|
-
const iRunData = {
|
|
147
|
-
data: executionData,
|
|
148
|
-
finished: false,
|
|
149
|
-
mode: executionEntry.mode,
|
|
150
|
-
waitTill: (_d = executionEntry.waitTill) !== null && _d !== void 0 ? _d : undefined,
|
|
151
|
-
startedAt: executionEntry.startedAt,
|
|
152
|
-
stoppedAt: lastNodeRunTimestamp === null || lastNodeRunTimestamp === void 0 ? void 0 : lastNodeRunTimestamp.toJSDate(),
|
|
153
|
-
status: newStatus,
|
|
154
|
-
};
|
|
155
|
-
const workflowHooks = (0, WorkflowExecuteAdditionalData_1.getWorkflowHooksMain)({
|
|
156
|
-
userId: '',
|
|
157
|
-
workflowData: executionEntry.workflowData,
|
|
158
|
-
executionMode: executionEntry.mode,
|
|
159
|
-
executionData,
|
|
160
|
-
runData: executionData.resultData.runData,
|
|
161
|
-
retryOf: executionEntry.retryOf,
|
|
162
|
-
}, executionId);
|
|
163
|
-
await workflowHooks.executeHookFunctions('workflowExecuteAfter', [iRunData]);
|
|
164
|
-
this.push.once('editorUiConnected', async () => {
|
|
165
|
-
await (0, n8n_workflow_1.sleep)(1000);
|
|
166
|
-
this.push.broadcast('executionRecovered', { executionId });
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
return executionData;
|
|
170
|
-
}
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
exports.ExecutionDataRecoveryService = ExecutionDataRecoveryService;
|
|
175
|
-
exports.ExecutionDataRecoveryService = ExecutionDataRecoveryService = __decorate([
|
|
176
|
-
(0, typedi_1.Service)(),
|
|
177
|
-
__metadata("design:paramtypes", [push_1.Push,
|
|
178
|
-
execution_repository_1.ExecutionRepository])
|
|
179
|
-
], ExecutionDataRecoveryService);
|
|
180
|
-
//# sourceMappingURL=executionDataRecovery.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executionDataRecovery.service.js","sourceRoot":"","sources":["../../src/eventbus/executionDataRecovery.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAA4C;AAE5C,iCAA8B;AAC9B,mDAAgD;AAEhD,+CAAiF;AAEjF,gFAA4E;AAC5E,mFAAuE;AAIhE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACxC,YACkB,IAAU,EACV,mBAAwC;QADxC,SAAI,GAAJ,IAAI,CAAM;QACV,wBAAmB,GAAnB,mBAAmB,CAAqB;IACvD,CAAC;IAGJ,KAAK,CAAC,oBAAoB,CACzB,WAAmB,EACnB,QAA6B,EAC7B,SAAkB;;QAElB,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,EAAE;YACtF,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,IAAI;SACnB,CAAC,CAAC;Q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K;oBACf,IAAI,EAAE,cAAc,CAAC,IAAI;oBACzB,QAAQ,EAAE,MAAA,cAAc,CAAC,QAAQ,mCAAI,SAAS;oBAC9C,SAAS,EAAE,cAAc,CAAC,SAAS;oBACnC,SAAS,EAAE,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,QAAQ,EAAE;oBAC3C,MAAM,EAAE,SAAS;iBACjB,CAAC;gBACF,MAAM,aAAa,GAAG,IAAA,oDAAoB,EACzC;oBACC,MAAM,EAAE,EAAE;oBACV,YAAY,EAAE,cAAc,CAAC,YAAY;oBACzC,aAAa,EAAE,cAAc,CAAC,IAAI;oBAClC,aAAa;oBACb,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,OAAO;oBACzC,OAAO,EAAE,cAAc,CAAC,OAAO;iBAC/B,EACD,WAAW,CACX,CAAC;gBAGF,MAAM,aAAa,CAAC,oBAAoB,CAAC,sBAAsB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAG7E,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;oBAE9C,MAAM,IAAA,oBAAK,EAAC,IAAI,CAAC,CAAC;oBAClB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;gBAC5D,CAAC,CAAC,CAAC;YACJ,CAAC;YACD,OAAO,aAAa,CAAC;QACtB,CAAC;QACD,OAAO;IACR,CAAC;CACD,CAAA;AAxMY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,gBAAO,GAAE;qCAGe,WAAI;QACW,0CAAmB;GAH9C,4BAA4B,CAwMxC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.logStreamingLicensedMiddleware = exports.islogStreamingLicensed = void 0;
|
|
7
|
-
const typedi_1 = __importDefault(require("typedi"));
|
|
8
|
-
const License_1 = require("../../License");
|
|
9
|
-
function islogStreamingLicensed() {
|
|
10
|
-
return typedi_1.default.get(License_1.License).isLogStreamingEnabled();
|
|
11
|
-
}
|
|
12
|
-
exports.islogStreamingLicensed = islogStreamingLicensed;
|
|
13
|
-
const logStreamingLicensedMiddleware = (_req, res, next) => {
|
|
14
|
-
if (islogStreamingLicensed()) {
|
|
15
|
-
next();
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
res.status(403).json({ status: 'error', message: 'Unauthorized' });
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.logStreamingLicensedMiddleware = logStreamingLicensedMiddleware;
|
|
22
|
-
//# sourceMappingURL=logStreamingEnabled.middleware.ee.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logStreamingEnabled.middleware.ee.js","sourceRoot":"","sources":["../../../src/eventbus/middleware/logStreamingEnabled.middleware.ee.ts"],"names":[],"mappings":";;;;;;AACA,oDAA+B;AAC/B,2CAAwC;AAExC,SAAgB,sBAAsB;IACrC,OAAO,gBAAS,CAAC,GAAG,CAAC,iBAAO,CAAC,CAAC,qBAAqB,EAAE,CAAC;AACvD,CAAC;AAFD,wDAEC;AAEM,MAAM,8BAA8B,GAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IACjF,IAAI,sBAAsB,EAAE,EAAE,CAAC;QAC9B,IAAI,EAAE,CAAC;IACR,CAAC;SAAM,CAAC;QACP,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IACpE,CAAC;AACF,CAAC,CAAC;AANW,QAAA,8BAA8B,kCAMzC"}
|