n8n 0.155.2 → 0.158.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/commands/execute.js +6 -3
- package/dist/commands/execute.js.map +1 -1
- package/dist/commands/executeBatch.js +6 -3
- package/dist/commands/executeBatch.js.map +1 -1
- package/dist/commands/start.js +3 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/webhook.js +3 -1
- package/dist/commands/webhook.js.map +1 -1
- package/dist/commands/worker.js +3 -1
- package/dist/commands/worker.js.map +1 -1
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.js +38 -0
- package/dist/config/index.js.map +1 -1
- package/dist/src/ActiveWorkflowRunner.js +2 -0
- package/dist/src/ActiveWorkflowRunner.js.map +1 -1
- package/dist/src/Interfaces.d.ts +2 -1
- package/dist/src/InternalHooks.d.ts +6 -5
- package/dist/src/InternalHooks.js +43 -10
- package/dist/src/InternalHooks.js.map +1 -1
- package/dist/src/InternalHooksManager.d.ts +2 -1
- package/dist/src/InternalHooksManager.js +2 -2
- package/dist/src/InternalHooksManager.js.map +1 -1
- package/dist/src/Server.js +50 -19
- package/dist/src/Server.js.map +1 -1
- package/dist/src/TranslationHelpers.d.ts +9 -1
- package/dist/src/TranslationHelpers.js +11 -4
- package/dist/src/TranslationHelpers.js.map +1 -1
- package/dist/src/WebhookHelpers.js +3 -2
- package/dist/src/WebhookHelpers.js.map +1 -1
- package/dist/src/WorkflowExecuteAdditionalData.js +5 -2
- package/dist/src/WorkflowExecuteAdditionalData.js.map +1 -1
- package/dist/src/WorkflowRunner.js +7 -2
- package/dist/src/WorkflowRunner.js.map +1 -1
- package/dist/src/WorkflowRunnerProcess.js +5 -3
- package/dist/src/WorkflowRunnerProcess.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InternalHooksClass = void 0;
|
|
4
|
+
const n8n_core_1 = require("n8n-core");
|
|
4
5
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
6
|
class InternalHooksClass {
|
|
6
|
-
constructor(telemetry, versionCli) {
|
|
7
|
+
constructor(telemetry, versionCli, nodeTypes) {
|
|
7
8
|
this.telemetry = telemetry;
|
|
8
9
|
this.versionCli = versionCli;
|
|
10
|
+
this.nodeTypes = nodeTypes;
|
|
9
11
|
}
|
|
10
12
|
async onServerStarted(diagnosticInfo, earliestWorkflowCreatedAt) {
|
|
11
13
|
const info = {
|
|
@@ -17,6 +19,7 @@ class InternalHooksClass {
|
|
|
17
19
|
system_info: diagnosticInfo.systemInfo,
|
|
18
20
|
execution_variables: diagnosticInfo.executionVariables,
|
|
19
21
|
n8n_deployment_type: diagnosticInfo.deploymentType,
|
|
22
|
+
n8n_binary_data_mode: diagnosticInfo.binaryDataMode,
|
|
20
23
|
};
|
|
21
24
|
return Promise.all([
|
|
22
25
|
this.telemetry.identify(info),
|
|
@@ -34,7 +37,7 @@ class InternalHooksClass {
|
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
39
|
async onWorkflowCreated(workflow) {
|
|
37
|
-
const { nodeGraph } = n8n_workflow_1.TelemetryHelpers.generateNodesGraph(workflow);
|
|
40
|
+
const { nodeGraph } = n8n_workflow_1.TelemetryHelpers.generateNodesGraph(workflow, this.nodeTypes);
|
|
38
41
|
return this.telemetry.track('User created workflow', {
|
|
39
42
|
workflow_id: workflow.id,
|
|
40
43
|
node_graph: nodeGraph,
|
|
@@ -47,16 +50,18 @@ class InternalHooksClass {
|
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
async onWorkflowSaved(workflow) {
|
|
50
|
-
const { nodeGraph } = n8n_workflow_1.TelemetryHelpers.generateNodesGraph(workflow);
|
|
53
|
+
const { nodeGraph } = n8n_workflow_1.TelemetryHelpers.generateNodesGraph(workflow, this.nodeTypes);
|
|
51
54
|
return this.telemetry.track('User saved workflow', {
|
|
52
55
|
workflow_id: workflow.id,
|
|
53
56
|
node_graph: nodeGraph,
|
|
54
57
|
node_graph_string: JSON.stringify(nodeGraph),
|
|
55
58
|
version_cli: this.versionCli,
|
|
59
|
+
num_tags: workflow.tags.length,
|
|
56
60
|
});
|
|
57
61
|
}
|
|
58
|
-
async onWorkflowPostExecute(workflow, runData) {
|
|
59
|
-
var _a, _b;
|
|
62
|
+
async onWorkflowPostExecute(executionId, workflow, runData) {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64
|
+
const promises = [Promise.resolve()];
|
|
60
65
|
const properties = {
|
|
61
66
|
workflow_id: workflow.id,
|
|
62
67
|
is_manual: false,
|
|
@@ -64,10 +69,9 @@ class InternalHooksClass {
|
|
|
64
69
|
};
|
|
65
70
|
if (runData !== undefined) {
|
|
66
71
|
properties.execution_mode = runData.mode;
|
|
67
|
-
if (runData.mode === 'manual') {
|
|
68
|
-
properties.is_manual = true;
|
|
69
|
-
}
|
|
70
72
|
properties.success = !!runData.finished;
|
|
73
|
+
properties.is_manual = runData.mode === 'manual';
|
|
74
|
+
let nodeGraphResult;
|
|
71
75
|
if (!properties.success && (runData === null || runData === void 0 ? void 0 : runData.data.resultData.error)) {
|
|
72
76
|
properties.error_message = runData === null || runData === void 0 ? void 0 : runData.data.resultData.error.message;
|
|
73
77
|
let errorNodeName = (_a = runData === null || runData === void 0 ? void 0 : runData.data.resultData.error.node) === null || _a === void 0 ? void 0 : _a.name;
|
|
@@ -80,7 +84,7 @@ class InternalHooksClass {
|
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
if (properties.is_manual) {
|
|
83
|
-
|
|
87
|
+
nodeGraphResult = n8n_workflow_1.TelemetryHelpers.generateNodesGraph(workflow, this.nodeTypes);
|
|
84
88
|
properties.node_graph = nodeGraphResult.nodeGraph;
|
|
85
89
|
properties.node_graph_string = JSON.stringify(nodeGraphResult.nodeGraph);
|
|
86
90
|
if (errorNodeName) {
|
|
@@ -88,8 +92,37 @@ class InternalHooksClass {
|
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
}
|
|
95
|
+
if (properties.is_manual) {
|
|
96
|
+
if (!nodeGraphResult) {
|
|
97
|
+
nodeGraphResult = n8n_workflow_1.TelemetryHelpers.generateNodesGraph(workflow, this.nodeTypes);
|
|
98
|
+
}
|
|
99
|
+
const manualExecEventProperties = {
|
|
100
|
+
workflow_id: workflow.id,
|
|
101
|
+
status: properties.success ? 'success' : 'failed',
|
|
102
|
+
error_message: properties.error_message,
|
|
103
|
+
error_node_type: properties.error_node_type,
|
|
104
|
+
node_graph: properties.node_graph,
|
|
105
|
+
node_graph_string: properties.node_graph_string,
|
|
106
|
+
error_node_id: properties.error_node_id,
|
|
107
|
+
};
|
|
108
|
+
if (!manualExecEventProperties.node_graph) {
|
|
109
|
+
nodeGraphResult = n8n_workflow_1.TelemetryHelpers.generateNodesGraph(workflow, this.nodeTypes);
|
|
110
|
+
manualExecEventProperties.node_graph = nodeGraphResult.nodeGraph;
|
|
111
|
+
manualExecEventProperties.node_graph_string = JSON.stringify(manualExecEventProperties.node_graph);
|
|
112
|
+
}
|
|
113
|
+
if ((_c = runData.data.startData) === null || _c === void 0 ? void 0 : _c.destinationNode) {
|
|
114
|
+
promises.push(this.telemetry.track('Manual node exec finished', Object.assign(Object.assign({}, manualExecEventProperties), { node_type: (_e = n8n_workflow_1.TelemetryHelpers.getNodeTypeForName(workflow, (_d = runData.data.startData) === null || _d === void 0 ? void 0 : _d.destinationNode)) === null || _e === void 0 ? void 0 : _e.type, node_id: nodeGraphResult.nameIndices[(_f = runData.data.startData) === null || _f === void 0 ? void 0 : _f.destinationNode] })));
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
promises.push(this.telemetry.track('Manual workflow exec finished', manualExecEventProperties));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
91
120
|
}
|
|
92
|
-
return
|
|
121
|
+
return Promise.all([
|
|
122
|
+
...promises,
|
|
123
|
+
n8n_core_1.BinaryDataManager.getInstance().persistBinaryDataForExecutionId(executionId),
|
|
124
|
+
this.telemetry.trackWorkflowExecution(properties),
|
|
125
|
+
]).then(() => { });
|
|
93
126
|
}
|
|
94
127
|
async onN8nStop() {
|
|
95
128
|
const timeoutPromise = new Promise((resolve) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalHooks.js","sourceRoot":"","sources":["../../src/InternalHooks.ts"],"names":[],"mappings":";;;AACA,+
|
|
1
|
+
{"version":3,"file":"InternalHooks.js","sourceRoot":"","sources":["../../src/InternalHooks.ts"],"names":[],"mappings":";;;AACA,uCAA6C;AAC7C,+CAA+E;AAU/E,MAAa,kBAAkB;IAK9B,YAAoB,SAAoB,EAAE,UAAkB,EAAE,SAAqB;QAA/D,cAAS,GAAT,SAAS,CAAW;QACvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,eAAe,CACpB,cAA+B,EAC/B,yBAAgC;QAEhC,MAAM,IAAI,GAAG;YACZ,WAAW,EAAE,cAAc,CAAC,UAAU;YACtC,OAAO,EAAE,cAAc,CAAC,YAAY;YACpC,iCAAiC,EAAE,cAAc,CAAC,oBAAoB;YACtE,mCAAmC,EAAE,cAAc,CAAC,sCAAsC;YAC1F,qBAAqB,EAAE,cAAc,CAAC,eAAe;YACrD,WAAW,EAAE,cAAc,CAAC,UAAU;YACtC,mBAAmB,EAAE,cAAc,CAAC,kBAAkB;YACtD,mBAAmB,EAAE,cAAc,CAAC,cAAc;YAClD,oBAAoB,EAAE,cAAc,CAAC,cAAc;SACnD,CAAC;QAEF,OAAO,OAAO,CAAC,GAAG,CAAC;YAClB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC7B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,kCACnC,IAAI,KACP,yBAAyB,EAAE,yBA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ACV,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IACtE,CAAC;CACD;AAlLD,gDAkLC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { INodeTypes } from 'n8n-workflow';
|
|
1
2
|
import { InternalHooksClass } from './InternalHooks';
|
|
2
3
|
export declare class InternalHooksManager {
|
|
3
4
|
private static internalHooksInstance;
|
|
4
5
|
static getInstance(): InternalHooksClass;
|
|
5
|
-
static init(instanceId: string, versionCli: string): InternalHooksClass;
|
|
6
|
+
static init(instanceId: string, versionCli: string, nodeTypes: INodeTypes): InternalHooksClass;
|
|
6
7
|
}
|
|
@@ -10,9 +10,9 @@ class InternalHooksManager {
|
|
|
10
10
|
}
|
|
11
11
|
throw new Error('InternalHooks not initialized');
|
|
12
12
|
}
|
|
13
|
-
static init(instanceId, versionCli) {
|
|
13
|
+
static init(instanceId, versionCli, nodeTypes) {
|
|
14
14
|
if (!this.internalHooksInstance) {
|
|
15
|
-
this.internalHooksInstance = new InternalHooks_1.InternalHooksClass(new telemetry_1.Telemetry(instanceId, versionCli), versionCli);
|
|
15
|
+
this.internalHooksInstance = new InternalHooks_1.InternalHooksClass(new telemetry_1.Telemetry(instanceId, versionCli), versionCli, nodeTypes);
|
|
16
16
|
}
|
|
17
17
|
return this.internalHooksInstance;
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalHooksManager.js","sourceRoot":"","sources":["../../src/InternalHooksManager.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"InternalHooksManager.js","sourceRoot":"","sources":["../../src/InternalHooksManager.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,2CAAwC;AAExC,MAAa,oBAAoB;IAGhC,MAAM,CAAC,WAAW;QACjB,IAAI,IAAI,CAAC,qBAAqB,EAAE;YAC/B,OAAO,IAAI,CAAC,qBAAqB,CAAC;SAClC;QAED,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,UAAkB,EAAE,UAAkB,EAAE,SAAqB;QACxE,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE;YAChC,IAAI,CAAC,qBAAqB,GAAG,IAAI,kCAAkB,CAClD,IAAI,qBAAS,CAAC,UAAU,EAAE,UAAU,CAAC,EACrC,UAAU,EACV,SAAS,CACT,CAAC;SACF;QAED,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACnC,CAAC;CACD;AAtBD,oDAsBC"}
|
package/dist/src/Server.js
CHANGED
|
@@ -629,6 +629,18 @@ class App {
|
|
|
629
629
|
}
|
|
630
630
|
return returnData;
|
|
631
631
|
}));
|
|
632
|
+
this.app.get(`/${this.restEndpoint}/credential-translation`, _1.ResponseHelper.send(async (req, res) => {
|
|
633
|
+
const translationPath = TranslationHelpers_1.getCredentialTranslationPath({
|
|
634
|
+
locale: this.frontendSettings.defaultLocale,
|
|
635
|
+
credentialType: req.query.credentialType,
|
|
636
|
+
});
|
|
637
|
+
try {
|
|
638
|
+
return require(translationPath);
|
|
639
|
+
}
|
|
640
|
+
catch (error) {
|
|
641
|
+
return null;
|
|
642
|
+
}
|
|
643
|
+
}));
|
|
632
644
|
this.app.post(`/${this.restEndpoint}/node-types`, _1.ResponseHelper.send(async (req, res) => {
|
|
633
645
|
const nodeInfos = _.get(req, 'body.nodeInfos', []);
|
|
634
646
|
const { defaultLocale } = this.frontendSettings;
|
|
@@ -641,7 +653,11 @@ class App {
|
|
|
641
653
|
}
|
|
642
654
|
async function populateTranslation(name, version, nodeTypes) {
|
|
643
655
|
const { description, sourcePath } = _1.NodeTypes().getWithSourcePath(name, version);
|
|
644
|
-
const translationPath = await TranslationHelpers_1.getNodeTranslationPath(
|
|
656
|
+
const translationPath = await TranslationHelpers_1.getNodeTranslationPath({
|
|
657
|
+
nodeSourcePath: sourcePath,
|
|
658
|
+
longNodeType: description.name,
|
|
659
|
+
locale: defaultLocale,
|
|
660
|
+
});
|
|
645
661
|
try {
|
|
646
662
|
const translation = await promises_1.readFile(translationPath, 'utf8');
|
|
647
663
|
description.translation = JSON.parse(translation);
|
|
@@ -755,7 +771,7 @@ class App {
|
|
|
755
771
|
const credentialTestable = (_a = nodeType.description.credentials) === null || _a === void 0 ? void 0 : _a.find((credential) => {
|
|
756
772
|
const testFunctionSearch = credential.name === credentialType && !!credential.testedBy;
|
|
757
773
|
if (testFunctionSearch) {
|
|
758
|
-
foundTestFunction =
|
|
774
|
+
foundTestFunction = nodeType.methods.credentialTest[credential.testedBy];
|
|
759
775
|
}
|
|
760
776
|
return testFunctionSearch;
|
|
761
777
|
});
|
|
@@ -1319,9 +1335,12 @@ class App {
|
|
|
1319
1335
|
if (deleteData.filters !== undefined) {
|
|
1320
1336
|
Object.assign(filters, deleteData.filters);
|
|
1321
1337
|
}
|
|
1338
|
+
const execs = await _1.Db.collections.Execution.find(Object.assign(Object.assign({}, filters), { select: ['id'] }));
|
|
1339
|
+
await Promise.all(execs.map(async (item) => n8n_core_1.BinaryDataManager.getInstance().deleteBinaryDataByExecutionId(item.id.toString())));
|
|
1322
1340
|
await _1.Db.collections.Execution.delete(filters);
|
|
1323
1341
|
}
|
|
1324
1342
|
else if (deleteData.ids !== undefined) {
|
|
1343
|
+
await Promise.all(deleteData.ids.map(async (id) => n8n_core_1.BinaryDataManager.getInstance().deleteBinaryDataByExecutionId(id)));
|
|
1325
1344
|
await _1.Db.collections.Execution.delete(deleteData.ids);
|
|
1326
1345
|
}
|
|
1327
1346
|
else {
|
|
@@ -1451,6 +1470,14 @@ class App {
|
|
|
1451
1470
|
this.app.get(`/${this.restEndpoint}/options/timezones`, _1.ResponseHelper.send(async (req, res) => {
|
|
1452
1471
|
return timezones;
|
|
1453
1472
|
}));
|
|
1473
|
+
this.app.get(`/${this.restEndpoint}/data/:path`, _1.ResponseHelper.send(async (req, res) => {
|
|
1474
|
+
const dataPath = req.params.path;
|
|
1475
|
+
return n8n_core_1.BinaryDataManager.getInstance()
|
|
1476
|
+
.retrieveBinaryDataByIdentifier(dataPath)
|
|
1477
|
+
.then((buffer) => {
|
|
1478
|
+
return buffer.toString('base64');
|
|
1479
|
+
});
|
|
1480
|
+
}));
|
|
1454
1481
|
this.app.get(`/${this.restEndpoint}/settings`, _1.ResponseHelper.send(async (req, res) => {
|
|
1455
1482
|
return this.frontendSettings;
|
|
1456
1483
|
}));
|
|
@@ -1545,24 +1572,26 @@ class App {
|
|
|
1545
1572
|
}
|
|
1546
1573
|
});
|
|
1547
1574
|
}
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1575
|
+
if (config.get('endpoints.disableUi') !== true) {
|
|
1576
|
+
const editorUiPath = require.resolve('n8n-editor-ui');
|
|
1577
|
+
const filePath = path_1.join(path_1.dirname(editorUiPath), 'dist', 'index.html');
|
|
1578
|
+
const n8nPath = config.get('path');
|
|
1579
|
+
let readIndexFile = fs_1.readFileSync(filePath, 'utf8');
|
|
1580
|
+
readIndexFile = readIndexFile.replace(/\/%BASE_PATH%\//g, n8nPath);
|
|
1581
|
+
readIndexFile = readIndexFile.replace(/\/favicon.ico/g, `${n8nPath}favicon.ico`);
|
|
1582
|
+
this.app.get(`/index.html`, async (req, res) => {
|
|
1583
|
+
res.send(readIndexFile);
|
|
1584
|
+
});
|
|
1585
|
+
this.app.use('/', express.static(path_1.join(path_1.dirname(editorUiPath), 'dist'), {
|
|
1586
|
+
index: 'index.html',
|
|
1587
|
+
setHeaders: (res, path) => {
|
|
1588
|
+
if (res.req && res.req.url === '/index.html') {
|
|
1589
|
+
res.setHeader('Last-Modified', startTime);
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
}));
|
|
1593
|
+
}
|
|
1557
1594
|
const startTime = new Date().toUTCString();
|
|
1558
|
-
this.app.use('/', express.static(path_1.join(path_1.dirname(editorUiPath), 'dist'), {
|
|
1559
|
-
index: 'index.html',
|
|
1560
|
-
setHeaders: (res, path) => {
|
|
1561
|
-
if (res.req && res.req.url === '/index.html') {
|
|
1562
|
-
res.setHeader('Last-Modified', startTime);
|
|
1563
|
-
}
|
|
1564
|
-
},
|
|
1565
|
-
}));
|
|
1566
1595
|
}
|
|
1567
1596
|
}
|
|
1568
1597
|
async function start() {
|
|
@@ -1592,6 +1621,7 @@ async function start() {
|
|
|
1592
1621
|
}
|
|
1593
1622
|
await app.externalHooks.run('n8n.ready', [app]);
|
|
1594
1623
|
const cpus = os.cpus();
|
|
1624
|
+
const binarDataConfig = config.get('binaryDataManager');
|
|
1595
1625
|
const diagnosticInfo = {
|
|
1596
1626
|
basicAuthActive: config.get('security.basicAuth.active'),
|
|
1597
1627
|
databaseType: (await _1.GenericHelpers.getConfigValue('database.type')),
|
|
@@ -1624,6 +1654,7 @@ async function start() {
|
|
|
1624
1654
|
executions_data_prune_timeout: config.get('executions.pruneDataTimeout'),
|
|
1625
1655
|
},
|
|
1626
1656
|
deploymentType: config.get('deployment.type'),
|
|
1657
|
+
binaryDataMode: binarDataConfig.mode,
|
|
1627
1658
|
};
|
|
1628
1659
|
void _1.Db.collections
|
|
1629
1660
|
.Workflow.findOne({
|