n8n-core 2.27.2 → 2.28.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/binary-data/azure-blob/azure-blob.config.d.ts +8 -0
- package/dist/binary-data/azure-blob/azure-blob.config.js +52 -0
- package/dist/binary-data/azure-blob/azure-blob.config.js.map +1 -0
- package/dist/binary-data/azure-blob/azure-blob.service.ee.d.ts +16 -0
- package/dist/binary-data/azure-blob/azure-blob.service.ee.js +101 -0
- package/dist/binary-data/azure-blob/azure-blob.service.ee.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/credentials.d.ts +2 -2
- package/dist/credentials.js +1 -1
- package/dist/errors/disallowed-filepath.error.d.ts +2 -2
- package/dist/errors/disallowed-filepath.error.js +3 -3
- package/dist/errors/disallowed-filepath.error.js.map +1 -1
- package/dist/errors/error-reporter.d.ts +2 -1
- package/dist/errors/error-reporter.js +7 -2
- package/dist/errors/error-reporter.js.map +1 -1
- package/dist/errors/file-not-found.error.d.ts +2 -2
- package/dist/errors/file-not-found.error.js +3 -3
- package/dist/errors/file-not-found.error.js.map +1 -1
- package/dist/errors/invalid-execution-metadata.error.d.ts +2 -2
- package/dist/errors/invalid-execution-metadata.error.js +2 -2
- package/dist/errors/invalid-execution-metadata.error.js.map +1 -1
- package/dist/errors/invalid-manager.error.d.ts +2 -2
- package/dist/errors/invalid-manager.error.js +2 -2
- package/dist/errors/invalid-manager.error.js.map +1 -1
- package/dist/execution-engine/active-workflow-triggers.d.ts +3 -0
- package/dist/execution-engine/active-workflow-triggers.js +31 -5
- package/dist/execution-engine/active-workflow-triggers.js.map +1 -1
- package/dist/execution-engine/node-execution-context/base-execute-context.js +3 -1
- package/dist/execution-engine/node-execution-context/base-execute-context.js.map +1 -1
- package/dist/execution-engine/node-execution-context/credentials-test-context.d.ts +2 -2
- package/dist/execution-engine/node-execution-context/credentials-test-context.js +2 -2
- package/dist/execution-engine/node-execution-context/credentials-test-context.js.map +1 -1
- package/dist/execution-engine/node-execution-context/index.d.ts +0 -1
- package/dist/execution-engine/node-execution-context/index.js +1 -3
- package/dist/execution-engine/node-execution-context/index.js.map +1 -1
- package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.d.ts +3 -1
- package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.js +5 -2
- package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.js.map +1 -1
- package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js +2 -0
- package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js.map +1 -1
- package/dist/execution-engine/node-execution-context/utils/request-helpers/factory.js +1 -0
- package/dist/execution-engine/node-execution-context/utils/request-helpers/factory.js.map +1 -1
- package/dist/execution-engine/node-execution-context/utils/request-helpers/legacy-request-adapter.d.ts +0 -3
- package/dist/execution-engine/node-execution-context/utils/request-helpers/legacy-request-adapter.js +9 -289
- package/dist/execution-engine/node-execution-context/utils/request-helpers/legacy-request-adapter.js.map +1 -1
- package/dist/execution-engine/node-execution-context/webhook-context.d.ts +3 -1
- package/dist/execution-engine/node-execution-context/webhook-context.js +26 -1
- package/dist/execution-engine/node-execution-context/webhook-context.js.map +1 -1
- package/dist/observability/index.d.ts +1 -0
- package/dist/observability/index.js +5 -1
- package/dist/observability/index.js.map +1 -1
- package/dist/observability/tracing/span-sampling.d.ts +4 -0
- package/dist/observability/tracing/span-sampling.js +61 -0
- package/dist/observability/tracing/span-sampling.js.map +1 -0
- package/dist/storage.config.d.ts +3 -3
- package/dist/storage.config.js +2 -2
- package/dist/storage.config.js.map +1 -1
- package/package.json +20 -14
- package/dist/errors/abstract/binary-data.error.d.ts +0 -3
- package/dist/errors/abstract/binary-data.error.js +0 -8
- package/dist/errors/abstract/binary-data.error.js.map +0 -1
- package/dist/errors/abstract/filesystem.error.d.ts +0 -4
- package/dist/errors/abstract/filesystem.error.js +0 -11
- package/dist/errors/abstract/filesystem.error.js.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
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.AzureBlobConfig = void 0;
|
|
13
|
+
const config_1 = require("@n8n/config");
|
|
14
|
+
let AzureBlobConfig = class AzureBlobConfig {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.connectionString = '';
|
|
17
|
+
this.accountName = '';
|
|
18
|
+
this.accountKey = '';
|
|
19
|
+
this.containerName = '';
|
|
20
|
+
this.endpoint = '';
|
|
21
|
+
this.authAutoDetect = false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.AzureBlobConfig = AzureBlobConfig;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_AZURE_CONNECTION_STRING'),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AzureBlobConfig.prototype, "connectionString", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_AZURE_ACCOUNT_NAME'),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AzureBlobConfig.prototype, "accountName", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_AZURE_ACCOUNT_KEY'),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], AzureBlobConfig.prototype, "accountKey", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_AZURE_CONTAINER_NAME'),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AzureBlobConfig.prototype, "containerName", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_AZURE_ENDPOINT'),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AzureBlobConfig.prototype, "endpoint", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_AZURE_AUTH_AUTO_DETECT'),
|
|
47
|
+
__metadata("design:type", Boolean)
|
|
48
|
+
], AzureBlobConfig.prototype, "authAutoDetect", void 0);
|
|
49
|
+
exports.AzureBlobConfig = AzureBlobConfig = __decorate([
|
|
50
|
+
config_1.Config
|
|
51
|
+
], AzureBlobConfig);
|
|
52
|
+
//# sourceMappingURL=azure-blob.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-blob.config.js","sourceRoot":"","sources":["../../../src/binary-data/azure-blob/azure-blob.config.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAA0C;AAGnC,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QAMN,qBAAgB,GAAW,EAAE,CAAC;QAI9B,gBAAW,GAAW,EAAE,CAAC;QAIzB,eAAU,GAAW,EAAE,CAAC;QAIxB,kBAAa,GAAW,EAAE,CAAC;QAI3B,aAAQ,GAAW,EAAE,CAAC;QAOtB,mBAAc,GAAY,KAAK,CAAC;IACjC,CAAC;CAAA,CAAA;AA9BY,0CAAe;AAM3B;IADC,IAAA,YAAG,EAAC,8CAA8C,CAAC;;yDACtB;AAI9B;IADC,IAAA,YAAG,EAAC,yCAAyC,CAAC;;oDACtB;AAIzB;IADC,IAAA,YAAG,EAAC,wCAAwC,CAAC;;mDACtB;AAIxB;IADC,IAAA,YAAG,EAAC,2CAA2C,CAAC;;sDACtB;AAI3B;IADC,IAAA,YAAG,EAAC,qCAAqC,CAAC;;iDACrB;AAOtB;IADC,IAAA,YAAG,EAAC,6CAA6C,CAAC;;uDACnB;0BA7BpB,eAAe;IAD3B,eAAM;GACM,eAAe,CA8B3B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Logger } from '@n8n/backend-common';
|
|
2
|
+
import { AzureBlobConfig } from './azure-blob.config';
|
|
3
|
+
export declare class AzureBlobService {
|
|
4
|
+
private readonly logger;
|
|
5
|
+
private readonly config;
|
|
6
|
+
private readonly containerClient;
|
|
7
|
+
private isReady;
|
|
8
|
+
constructor(logger: Logger, config: AzureBlobConfig);
|
|
9
|
+
private buildContainerClient;
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
checkConnection(): Promise<void>;
|
|
12
|
+
put(blobName: string, body: Buffer): Promise<void>;
|
|
13
|
+
get(blobName: string): Promise<Buffer>;
|
|
14
|
+
delete(blobName: string): Promise<void>;
|
|
15
|
+
private handleError;
|
|
16
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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.AzureBlobService = void 0;
|
|
13
|
+
const identity_1 = require("@azure/identity");
|
|
14
|
+
const storage_blob_1 = require("@azure/storage-blob");
|
|
15
|
+
const backend_common_1 = require("@n8n/backend-common");
|
|
16
|
+
const di_1 = require("@n8n/di");
|
|
17
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
18
|
+
const azure_blob_config_1 = require("./azure-blob.config");
|
|
19
|
+
let AzureBlobService = class AzureBlobService {
|
|
20
|
+
constructor(logger, config) {
|
|
21
|
+
this.logger = logger;
|
|
22
|
+
this.config = config;
|
|
23
|
+
this.isReady = false;
|
|
24
|
+
if (config.containerName === '') {
|
|
25
|
+
throw new n8n_workflow_1.UserError('Azure Blob container name not configured. Please set `N8N_EXTERNAL_STORAGE_AZURE_CONTAINER_NAME`.');
|
|
26
|
+
}
|
|
27
|
+
this.containerClient = this.buildContainerClient();
|
|
28
|
+
}
|
|
29
|
+
buildContainerClient() {
|
|
30
|
+
const { connectionString, accountName, accountKey, containerName, endpoint, authAutoDetect } = this.config;
|
|
31
|
+
if (connectionString) {
|
|
32
|
+
return storage_blob_1.BlobServiceClient.fromConnectionString(connectionString).getContainerClient(containerName);
|
|
33
|
+
}
|
|
34
|
+
const url = endpoint || `https://${accountName}.blob.core.windows.net`;
|
|
35
|
+
const serviceClient = authAutoDetect
|
|
36
|
+
? new storage_blob_1.BlobServiceClient(url, new identity_1.DefaultAzureCredential())
|
|
37
|
+
: new storage_blob_1.BlobServiceClient(url, new storage_blob_1.StorageSharedKeyCredential(accountName, accountKey));
|
|
38
|
+
return serviceClient.getContainerClient(containerName);
|
|
39
|
+
}
|
|
40
|
+
async init() {
|
|
41
|
+
await this.checkConnection();
|
|
42
|
+
this.isReady = true;
|
|
43
|
+
}
|
|
44
|
+
async checkConnection() {
|
|
45
|
+
if (this.isReady)
|
|
46
|
+
return;
|
|
47
|
+
try {
|
|
48
|
+
this.logger.debug('Checking connection to Azure Blob container', {
|
|
49
|
+
container: this.config.containerName,
|
|
50
|
+
});
|
|
51
|
+
const exists = await this.containerClient.exists();
|
|
52
|
+
if (!exists) {
|
|
53
|
+
throw new n8n_workflow_1.UserError(`Azure Blob container "${this.config.containerName}" does not exist or is not accessible.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
if (e instanceof n8n_workflow_1.UserError)
|
|
58
|
+
throw e;
|
|
59
|
+
this.handleError(e);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async put(blobName, body) {
|
|
63
|
+
try {
|
|
64
|
+
await this.containerClient.getBlockBlobClient(blobName).uploadData(body, {
|
|
65
|
+
blobHTTPHeaders: { blobContentType: 'application/json' },
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
this.handleError(e);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async get(blobName) {
|
|
73
|
+
try {
|
|
74
|
+
return await this.containerClient.getBlockBlobClient(blobName).downloadToBuffer();
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
this.handleError(e);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async delete(blobName) {
|
|
81
|
+
try {
|
|
82
|
+
await this.containerClient.getBlockBlobClient(blobName).deleteIfExists();
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
this.handleError(e);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
handleError(e) {
|
|
89
|
+
const error = (0, n8n_workflow_1.ensureError)(e);
|
|
90
|
+
throw new n8n_workflow_1.UnexpectedError(`Request to Azure Blob storage failed: ${error.message}`, {
|
|
91
|
+
cause: error,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.AzureBlobService = AzureBlobService;
|
|
96
|
+
exports.AzureBlobService = AzureBlobService = __decorate([
|
|
97
|
+
(0, di_1.Service)(),
|
|
98
|
+
__metadata("design:paramtypes", [backend_common_1.Logger,
|
|
99
|
+
azure_blob_config_1.AzureBlobConfig])
|
|
100
|
+
], AzureBlobService);
|
|
101
|
+
//# sourceMappingURL=azure-blob.service.ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-blob.service.ee.js","sourceRoot":"","sources":["../../../src/binary-data/azure-blob/azure-blob.service.ee.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAyD;AAEzD,sDAAoF;AACpF,wDAA6C;AAC7C,gCAAkC;AAClC,+CAAuE;AAEvE,2DAAsD;AAG/C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAK5B,YACkB,MAAc,EACd,MAAuB;QADvB,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAiB;QAJjC,YAAO,GAAG,KAAK,CAAC;QAMvB,IAAI,MAAM,CAAC,aAAa,KAAK,EAAE,EAAE,CAAC;YACjC,MAAM,IAAI,wBAAS,CAClB,mGAAmG,CACnG,CAAC;QACH,CAAC;QACD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACpD,CAAC;IAEO,oBAAoB;QAC3B,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,GAC3F,IAAI,CAAC,MAAM,CAAC;QAEb,IAAI,gBAAgB,EAAE,CAAC;YACtB,OAAO,gCAAiB,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC,kBAAkB,CACjF,aAAa,CACb,CAAC;QACH,CAAC;QAED,MAAM,GAAG,GAAG,QAAQ,IAAI,WAAW,WAAW,wBAAwB,CAAC;QACvE,MAAM,aAAa,GAAG,cAAc;YACnC,CAAC,CAAC,IAAI,gCAAiB,CAAC,GAAG,EAA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