n8n-core 2.32.2 → 2.33.1
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/binary-data.service.d.ts +1 -1
- package/dist/binary-data/binary-data.service.js +7 -2
- package/dist/binary-data/binary-data.service.js.map +1 -1
- package/dist/binary-data/{azure-blob.manager.d.ts → blob.manager.d.ts} +14 -4
- package/dist/binary-data/blob.manager.js +145 -0
- package/dist/binary-data/blob.manager.js.map +1 -0
- package/dist/binary-data/index.d.ts +1 -2
- package/dist/binary-data/index.js +3 -1
- package/dist/binary-data/index.js.map +1 -1
- package/dist/binary-data/types.d.ts +3 -6
- package/dist/binary-data/utils.d.ts +0 -2
- package/dist/binary-data/utils.js +0 -51
- package/dist/binary-data/utils.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/execution-engine/active-workflow-triggers.d.ts +1 -0
- package/dist/execution-engine/active-workflow-triggers.js +34 -5
- package/dist/execution-engine/active-workflow-triggers.js.map +1 -1
- package/dist/execution-engine/eval-mock-helpers.js +1 -1
- package/dist/execution-engine/execution-context-hook-registry.service.d.ts +2 -0
- package/dist/execution-engine/execution-context-hook-registry.service.js +9 -0
- package/dist/execution-engine/execution-context-hook-registry.service.js.map +1 -1
- package/dist/execution-engine/execution-context.d.ts +1 -1
- package/dist/execution-engine/execution-context.js +4 -0
- package/dist/execution-engine/execution-context.js.map +1 -1
- package/dist/execution-engine/execution-context.service.d.ts +1 -0
- package/dist/execution-engine/execution-context.service.js +19 -0
- package/dist/execution-engine/execution-context.service.js.map +1 -1
- package/dist/execution-engine/index.d.ts +3 -0
- package/dist/execution-engine/index.js +7 -1
- package/dist/execution-engine/index.js.map +1 -1
- package/dist/execution-engine/node-execution-context/base-execute-context.d.ts +1 -0
- package/dist/execution-engine/node-execution-context/base-execute-context.js +15 -0
- package/dist/execution-engine/node-execution-context/base-execute-context.js.map +1 -1
- package/dist/execution-engine/node-execution-context/node-execution-context.js +1 -1
- package/dist/execution-engine/node-execution-context/node-execution-context.js.map +1 -1
- package/dist/execution-engine/node-execution-context/utils/extract-value.js +12 -7
- package/dist/execution-engine/node-execution-context/utils/extract-value.js.map +1 -1
- package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js.map +1 -1
- package/dist/execution-engine/node-execution-context/utils/request-helpers/oauth.js +16 -5
- package/dist/execution-engine/node-execution-context/utils/request-helpers/oauth.js.map +1 -1
- package/dist/execution-engine/noop-poll-job-manager.d.ts +8 -0
- package/dist/execution-engine/noop-poll-job-manager.js +14 -0
- package/dist/execution-engine/noop-poll-job-manager.js.map +1 -0
- package/dist/execution-engine/poll-job-manager.d.ts +7 -0
- package/dist/execution-engine/poll-job-manager.js +7 -0
- package/dist/execution-engine/poll-job-manager.js.map +1 -0
- package/dist/instance-settings/instance-settings.d.ts +3 -0
- package/dist/instance-settings/instance-settings.js +8 -5
- package/dist/instance-settings/instance-settings.js.map +1 -1
- package/package.json +15 -17
- package/dist/binary-data/azure-blob/azure-blob.config.d.ts +0 -8
- package/dist/binary-data/azure-blob/azure-blob.config.js +0 -52
- package/dist/binary-data/azure-blob/azure-blob.config.js.map +0 -1
- package/dist/binary-data/azure-blob/azure-blob.service.ee.d.ts +0 -25
- package/dist/binary-data/azure-blob/azure-blob.service.ee.js +0 -157
- package/dist/binary-data/azure-blob/azure-blob.service.ee.js.map +0 -1
- package/dist/binary-data/azure-blob.manager.js +0 -81
- package/dist/binary-data/azure-blob.manager.js.map +0 -1
- package/dist/binary-data/file-system.manager.d.ts +0 -31
- package/dist/binary-data/file-system.manager.js +0 -151
- package/dist/binary-data/file-system.manager.js.map +0 -1
- package/dist/binary-data/object-store/object-store.config.d.ts +0 -21
- package/dist/binary-data/object-store/object-store.config.js +0 -93
- package/dist/binary-data/object-store/object-store.config.js.map +0 -1
- package/dist/binary-data/object-store/object-store.service.ee.d.ts +0 -49
- package/dist/binary-data/object-store/object-store.service.ee.js +0 -290
- package/dist/binary-data/object-store/object-store.service.ee.js.map +0 -1
- package/dist/binary-data/object-store/types.d.ts +0 -8
- package/dist/binary-data/object-store/types.js +0 -3
- package/dist/binary-data/object-store/types.js.map +0 -1
- package/dist/binary-data/object-store.manager.d.ts +0 -23
- package/dist/binary-data/object-store.manager.js +0 -87
- package/dist/binary-data/object-store.manager.js.map +0 -1
|
@@ -1,157 +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.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 ensure_error_1 = require("@n8n/utils/errors/ensure-error");
|
|
18
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
19
|
-
const node_stream_1 = require("node:stream");
|
|
20
|
-
const azure_blob_config_1 = require("./azure-blob.config");
|
|
21
|
-
const utils_1 = require("../utils");
|
|
22
|
-
let AzureBlobService = class AzureBlobService {
|
|
23
|
-
constructor(logger, config) {
|
|
24
|
-
this.logger = logger;
|
|
25
|
-
this.config = config;
|
|
26
|
-
this.isReady = false;
|
|
27
|
-
if (config.containerName === '') {
|
|
28
|
-
throw new n8n_workflow_1.UserError('Azure Blob container name not configured. Please set `N8N_EXTERNAL_STORAGE_AZURE_CONTAINER_NAME`.');
|
|
29
|
-
}
|
|
30
|
-
this.containerClient = this.buildContainerClient();
|
|
31
|
-
}
|
|
32
|
-
buildContainerClient() {
|
|
33
|
-
const { connectionString, accountName, accountKey, containerName, endpoint, authAutoDetect } = this.config;
|
|
34
|
-
if (connectionString) {
|
|
35
|
-
return storage_blob_1.BlobServiceClient.fromConnectionString(connectionString).getContainerClient(containerName);
|
|
36
|
-
}
|
|
37
|
-
const url = endpoint || `https://${accountName}.blob.core.windows.net`;
|
|
38
|
-
const serviceClient = authAutoDetect
|
|
39
|
-
? new storage_blob_1.BlobServiceClient(url, new identity_1.DefaultAzureCredential())
|
|
40
|
-
: new storage_blob_1.BlobServiceClient(url, new storage_blob_1.StorageSharedKeyCredential(accountName, accountKey));
|
|
41
|
-
return serviceClient.getContainerClient(containerName);
|
|
42
|
-
}
|
|
43
|
-
async init() {
|
|
44
|
-
await this.checkConnection();
|
|
45
|
-
this.isReady = true;
|
|
46
|
-
}
|
|
47
|
-
async checkConnection() {
|
|
48
|
-
if (this.isReady)
|
|
49
|
-
return;
|
|
50
|
-
try {
|
|
51
|
-
this.logger.debug('Checking connection to Azure Blob container', {
|
|
52
|
-
container: this.config.containerName,
|
|
53
|
-
});
|
|
54
|
-
const exists = await this.containerClient.exists();
|
|
55
|
-
if (!exists) {
|
|
56
|
-
throw new n8n_workflow_1.UserError(`Azure Blob container "${this.config.containerName}" does not exist or is not accessible.`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
if (e instanceof n8n_workflow_1.UserError)
|
|
61
|
-
throw e;
|
|
62
|
-
this.handleError(e);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
async put(blobName, body, metadata = {}) {
|
|
66
|
-
try {
|
|
67
|
-
await this.containerClient.getBlockBlobClient(blobName).uploadData(body, {
|
|
68
|
-
blobHTTPHeaders: { blobContentType: metadata.mimeType ?? 'application/octet-stream' },
|
|
69
|
-
metadata: metadata.fileName
|
|
70
|
-
? { filename: encodeURIComponent(metadata.fileName) }
|
|
71
|
-
: undefined,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
this.handleError(e);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
async get(blobName, { mode, chunkSize = 0 }) {
|
|
79
|
-
const blockBlobClient = this.containerClient.getBlockBlobClient(blobName);
|
|
80
|
-
try {
|
|
81
|
-
if (mode === 'stream') {
|
|
82
|
-
const abortController = new AbortController();
|
|
83
|
-
const response = await blockBlobClient.download(0, undefined, {
|
|
84
|
-
abortSignal: abortController.signal,
|
|
85
|
-
});
|
|
86
|
-
const body = response.readableStreamBody;
|
|
87
|
-
if (!body)
|
|
88
|
-
throw new n8n_workflow_1.UnexpectedError('Received empty response body');
|
|
89
|
-
if (!(body instanceof node_stream_1.Readable)) {
|
|
90
|
-
throw new n8n_workflow_1.UnexpectedError('Expected stream but received different type', {
|
|
91
|
-
extra: { bodyType: typeof body },
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
const wrapper = new node_stream_1.PassThrough();
|
|
95
|
-
let bodyFullyConsumed = false;
|
|
96
|
-
body.on('end', () => {
|
|
97
|
-
bodyFullyConsumed = true;
|
|
98
|
-
});
|
|
99
|
-
wrapper.on('close', () => {
|
|
100
|
-
if (!bodyFullyConsumed) {
|
|
101
|
-
abortController.abort();
|
|
102
|
-
body.destroy();
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
body.on('error', (error) => wrapper.destroy(error));
|
|
106
|
-
body.pipe(wrapper);
|
|
107
|
-
if (chunkSize > 0) {
|
|
108
|
-
const rechunker = (0, utils_1.createFixedSizeChunker)(chunkSize);
|
|
109
|
-
(0, node_stream_1.pipeline)(wrapper, rechunker, () => { });
|
|
110
|
-
return rechunker;
|
|
111
|
-
}
|
|
112
|
-
return wrapper;
|
|
113
|
-
}
|
|
114
|
-
return await blockBlobClient.downloadToBuffer();
|
|
115
|
-
}
|
|
116
|
-
catch (e) {
|
|
117
|
-
if (e instanceof n8n_workflow_1.UnexpectedError)
|
|
118
|
-
throw e;
|
|
119
|
-
this.handleError(e);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
async getMetadata(blobName) {
|
|
123
|
-
try {
|
|
124
|
-
const props = await this.containerClient.getBlockBlobClient(blobName).getProperties();
|
|
125
|
-
const metadata = { fileSize: props.contentLength ?? 0 };
|
|
126
|
-
if (props.contentType)
|
|
127
|
-
metadata.mimeType = props.contentType;
|
|
128
|
-
const fileName = props.metadata?.filename;
|
|
129
|
-
if (fileName)
|
|
130
|
-
metadata.fileName = decodeURIComponent(fileName);
|
|
131
|
-
return metadata;
|
|
132
|
-
}
|
|
133
|
-
catch (e) {
|
|
134
|
-
this.handleError(e);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
async delete(blobName) {
|
|
138
|
-
try {
|
|
139
|
-
await this.containerClient.getBlockBlobClient(blobName).deleteIfExists();
|
|
140
|
-
}
|
|
141
|
-
catch (e) {
|
|
142
|
-
this.handleError(e);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
handleError(e) {
|
|
146
|
-
const error = (0, ensure_error_1.ensureError)(e);
|
|
147
|
-
throw new n8n_workflow_1.UnexpectedError(`Request to Azure Blob storage failed: ${error.message}`, {
|
|
148
|
-
cause: error,
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
exports.AzureBlobService = AzureBlobService;
|
|
153
|
-
exports.AzureBlobService = AzureBlobService = __decorate([
|
|
154
|
-
(0, di_1.Service)(),
|
|
155
|
-
__metadata("design:paramtypes", [backend_common_1.Logger, azure_blob_config_1.AzureBlobConfig])
|
|
156
|
-
], AzureBlobService);
|
|
157
|
-
//# sourceMappingURL=azure-blob.service.ee.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,iEAA6D;AAC7D,+CAA0D;AAC1D,6CAA8D;AAE9D,2DAAsD;AAEtD,oCAAkD;AAG3C,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,EAAE,IAAI,iCAAsB,EAAE,CAAC;YAC1D,CAAC,CAAC,IAAI,gCAAiB,CAAC,GAAG,EAAE,IAAI,yCAA0B,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;QAEvF,OA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C;YACZ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;IACF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAgB;QAC5B,IAAI,CAAC;YACJ,MAAM,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,CAAC;QAC1E,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;IACF,CAAC;IAEO,WAAW,CAAC,CAAU;QAC7B,MAAM,KAAK,GAAG,IAAA,0BAAW,EAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,IAAI,8BAAe,CAAC,yCAAyC,KAAK,CAAC,OAAO,EAAE,EAAE;YACnF,KAAK,EAAE,KAAK;SACZ,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;;2BA9JY,gBAAgB;IAD5B,IAAA,YAAO,GAAE;qCAOiB,uBAAM,EACN,mCAAe;GAP7B,gBAAgB,CA8J5B"}
|
|
@@ -1,81 +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.AzureBlobManager = void 0;
|
|
16
|
-
const backend_network_1 = require("@n8n/backend-network");
|
|
17
|
-
const di_1 = require("@n8n/di");
|
|
18
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
19
|
-
const uuid_1 = require("uuid");
|
|
20
|
-
const azure_blob_service_ee_1 = require("./azure-blob/azure-blob.service.ee");
|
|
21
|
-
let AzureBlobManager = class AzureBlobManager {
|
|
22
|
-
constructor(azureBlobService) {
|
|
23
|
-
this.azureBlobService = azureBlobService;
|
|
24
|
-
}
|
|
25
|
-
async init() {
|
|
26
|
-
await this.azureBlobService.checkConnection();
|
|
27
|
-
}
|
|
28
|
-
async store(location, bufferOrStream, metadata) {
|
|
29
|
-
const fileId = this.toFileId(location);
|
|
30
|
-
const buffer = await (0, backend_network_1.binaryToBuffer)(bufferOrStream);
|
|
31
|
-
await this.azureBlobService.put(fileId, buffer, metadata);
|
|
32
|
-
return { fileId, fileSize: buffer.length };
|
|
33
|
-
}
|
|
34
|
-
getPath(fileId) {
|
|
35
|
-
return fileId;
|
|
36
|
-
}
|
|
37
|
-
async getAsBuffer(fileId) {
|
|
38
|
-
return await this.azureBlobService.get(fileId, { mode: 'buffer' });
|
|
39
|
-
}
|
|
40
|
-
async getAsStream(fileId, chunkSize) {
|
|
41
|
-
return await this.azureBlobService.get(fileId, { mode: 'stream', chunkSize });
|
|
42
|
-
}
|
|
43
|
-
async getMetadata(fileId) {
|
|
44
|
-
return await this.azureBlobService.getMetadata(fileId);
|
|
45
|
-
}
|
|
46
|
-
async copyByFileId(targetLocation, sourceFileId) {
|
|
47
|
-
const targetFileId = this.toFileId(targetLocation);
|
|
48
|
-
const sourceFile = await this.azureBlobService.get(sourceFileId, { mode: 'buffer' });
|
|
49
|
-
const sourceMetadata = await this.azureBlobService.getMetadata(sourceFileId);
|
|
50
|
-
await this.azureBlobService.put(targetFileId, sourceFile, sourceMetadata);
|
|
51
|
-
return targetFileId;
|
|
52
|
-
}
|
|
53
|
-
async copyByFilePath(targetLocation, sourcePath, metadata) {
|
|
54
|
-
const targetFileId = this.toFileId(targetLocation);
|
|
55
|
-
const sourceFile = await promises_1.default.readFile(sourcePath);
|
|
56
|
-
await this.azureBlobService.put(targetFileId, sourceFile, metadata);
|
|
57
|
-
return { fileId: targetFileId, fileSize: sourceFile.length };
|
|
58
|
-
}
|
|
59
|
-
async rename(oldFileId, newFileId) {
|
|
60
|
-
const oldFile = await this.azureBlobService.get(oldFileId, { mode: 'buffer' });
|
|
61
|
-
const oldFileMetadata = await this.azureBlobService.getMetadata(oldFileId);
|
|
62
|
-
await this.azureBlobService.put(newFileId, oldFile, oldFileMetadata);
|
|
63
|
-
await this.azureBlobService.delete(oldFileId);
|
|
64
|
-
}
|
|
65
|
-
toFileId(location) {
|
|
66
|
-
switch (location.type) {
|
|
67
|
-
case 'execution': {
|
|
68
|
-
const executionId = location.executionId || 'temp';
|
|
69
|
-
return `workflows/${location.workflowId}/executions/${executionId}/binary_data/${(0, uuid_1.v4)()}`;
|
|
70
|
-
}
|
|
71
|
-
case 'custom':
|
|
72
|
-
return `${location.pathSegments.join('/')}/binary_data/${(0, uuid_1.v4)()}`;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
exports.AzureBlobManager = AzureBlobManager;
|
|
77
|
-
exports.AzureBlobManager = AzureBlobManager = __decorate([
|
|
78
|
-
(0, di_1.Service)(),
|
|
79
|
-
__metadata("design:paramtypes", [azure_blob_service_ee_1.AzureBlobService])
|
|
80
|
-
], AzureBlobManager);
|
|
81
|
-
//# sourceMappingURL=azure-blob.manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"azure-blob.manager.js","sourceRoot":"","sources":["../../src/binary-data/azure-blob.manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA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AMO,QAAQ,CAAC,QAAiC;QACjD,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;YACvB,KAAK,WAAW,EAAE,CAAC;gBAClB,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,IAAI,MAAM,CAAC;gBACnD,OAAO,aAAa,QAAQ,CAAC,UAAU,eAAe,WAAW,gBAAgB,IAAA,SAAI,GAAE,EAAE,CAAC;YAC3F,CAAC;YACD,KAAK,QAAQ;gBACZ,OAAO,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,IAAA,SAAI,GAAE,EAAE,CAAC;QACpE,CAAC;IACF,CAAC;CACD,CAAA;;2BAlFY,gBAAgB;IAD5B,IAAA,YAAO,GAAE;qCAEsC,wCAAgB;GADnD,gBAAgB,CAkF5B"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Readable } from 'stream';
|
|
2
|
-
import type { ErrorReporter } from '../errors';
|
|
3
|
-
import type { BinaryData } from './types';
|
|
4
|
-
export declare class FileSystemManager implements BinaryData.Manager {
|
|
5
|
-
private storagePath;
|
|
6
|
-
private readonly errorReporter;
|
|
7
|
-
constructor(storagePath: string, errorReporter: ErrorReporter);
|
|
8
|
-
init(): Promise<void>;
|
|
9
|
-
store(location: BinaryData.FileLocation, bufferOrStream: Buffer | Readable, { mimeType, fileName }: BinaryData.PreWriteMetadata): Promise<{
|
|
10
|
-
fileId: string;
|
|
11
|
-
fileSize: number;
|
|
12
|
-
}>;
|
|
13
|
-
getPath(fileId: string): string;
|
|
14
|
-
getAsStream(fileId: string, chunkSize?: number): Promise<import("fs").ReadStream>;
|
|
15
|
-
getAsBuffer(fileId: string): Promise<NonSharedBuffer>;
|
|
16
|
-
getMetadata(fileId: string): Promise<BinaryData.Metadata>;
|
|
17
|
-
deleteMany(locations: BinaryData.FileLocation[]): Promise<void>;
|
|
18
|
-
copyByFilePath(targetLocation: BinaryData.FileLocation, sourcePath: string, { mimeType, fileName }: BinaryData.PreWriteMetadata): Promise<{
|
|
19
|
-
fileId: string;
|
|
20
|
-
fileSize: number;
|
|
21
|
-
}>;
|
|
22
|
-
copyByFileId(targetLocation: BinaryData.FileLocation, sourceFileId: string): Promise<string>;
|
|
23
|
-
rename(oldFileId: string, newFileId: string): Promise<void>;
|
|
24
|
-
deleteManyByFileId(ids: string[]): Promise<void>;
|
|
25
|
-
private toFileId;
|
|
26
|
-
private toRelativePath;
|
|
27
|
-
private parseFileId;
|
|
28
|
-
private resolvePath;
|
|
29
|
-
private storeMetadata;
|
|
30
|
-
private getSize;
|
|
31
|
-
}
|
|
@@ -1,151 +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.FileSystemManager = void 0;
|
|
7
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
-
const node_fs_1 = require("node:fs");
|
|
9
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
10
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
-
const uuid_1 = require("uuid");
|
|
12
|
-
const utils_1 = require("./utils");
|
|
13
|
-
const disallowed_filepath_error_1 = require("../errors/disallowed-filepath.error");
|
|
14
|
-
const file_not_found_error_1 = require("../errors/file-not-found.error");
|
|
15
|
-
const EXECUTION_PATH_MATCHER = /^workflows\/([^/]+)\/executions\/([^/]+)\//;
|
|
16
|
-
class FileSystemManager {
|
|
17
|
-
constructor(storagePath, errorReporter) {
|
|
18
|
-
this.storagePath = storagePath;
|
|
19
|
-
this.errorReporter = errorReporter;
|
|
20
|
-
}
|
|
21
|
-
async init() {
|
|
22
|
-
await (0, utils_1.assertDir)(this.storagePath);
|
|
23
|
-
}
|
|
24
|
-
async store(location, bufferOrStream, { mimeType, fileName }) {
|
|
25
|
-
const fileId = this.toFileId(location);
|
|
26
|
-
const filePath = this.resolvePath(fileId);
|
|
27
|
-
await (0, utils_1.assertDir)(node_path_1.default.dirname(filePath));
|
|
28
|
-
await promises_1.default.writeFile(filePath, bufferOrStream);
|
|
29
|
-
const fileSize = await this.getSize(fileId);
|
|
30
|
-
await this.storeMetadata(fileId, { mimeType, fileName, fileSize });
|
|
31
|
-
return { fileId, fileSize };
|
|
32
|
-
}
|
|
33
|
-
getPath(fileId) {
|
|
34
|
-
return this.resolvePath(fileId);
|
|
35
|
-
}
|
|
36
|
-
async getAsStream(fileId, chunkSize) {
|
|
37
|
-
const filePath = this.resolvePath(fileId);
|
|
38
|
-
if (!(await (0, utils_1.exists)(filePath))) {
|
|
39
|
-
throw new file_not_found_error_1.FileNotFoundError(filePath);
|
|
40
|
-
}
|
|
41
|
-
return (0, node_fs_1.createReadStream)(filePath, { highWaterMark: chunkSize });
|
|
42
|
-
}
|
|
43
|
-
async getAsBuffer(fileId) {
|
|
44
|
-
const filePath = this.resolvePath(fileId);
|
|
45
|
-
if (!(await (0, utils_1.exists)(filePath))) {
|
|
46
|
-
throw new file_not_found_error_1.FileNotFoundError(filePath);
|
|
47
|
-
}
|
|
48
|
-
return await promises_1.default.readFile(filePath);
|
|
49
|
-
}
|
|
50
|
-
async getMetadata(fileId) {
|
|
51
|
-
const filePath = this.resolvePath(`${fileId}.metadata`);
|
|
52
|
-
return await (0, n8n_workflow_1.jsonParse)(await promises_1.default.readFile(filePath, { encoding: 'utf-8' }));
|
|
53
|
-
}
|
|
54
|
-
async deleteMany(locations) {
|
|
55
|
-
if (locations.length === 0)
|
|
56
|
-
return;
|
|
57
|
-
const binaryDataDirs = locations.map((location) => this.resolvePath(this.toRelativePath(location)));
|
|
58
|
-
await Promise.all(binaryDataDirs.map(async (dir) => {
|
|
59
|
-
await promises_1.default.rm(dir, { recursive: true, force: true });
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
async copyByFilePath(targetLocation, sourcePath, { mimeType, fileName }) {
|
|
63
|
-
const targetFileId = this.toFileId(targetLocation);
|
|
64
|
-
const targetPath = this.resolvePath(targetFileId);
|
|
65
|
-
await (0, utils_1.assertDir)(node_path_1.default.dirname(targetPath));
|
|
66
|
-
await promises_1.default.cp(sourcePath, targetPath);
|
|
67
|
-
const fileSize = await this.getSize(targetFileId);
|
|
68
|
-
await this.storeMetadata(targetFileId, { mimeType, fileName, fileSize });
|
|
69
|
-
return { fileId: targetFileId, fileSize };
|
|
70
|
-
}
|
|
71
|
-
async copyByFileId(targetLocation, sourceFileId) {
|
|
72
|
-
const targetFileId = this.toFileId(targetLocation);
|
|
73
|
-
const sourcePath = this.resolvePath(sourceFileId);
|
|
74
|
-
const targetPath = this.resolvePath(targetFileId);
|
|
75
|
-
const sourceMetadata = await this.getMetadata(sourceFileId);
|
|
76
|
-
await (0, utils_1.assertDir)(node_path_1.default.dirname(targetPath));
|
|
77
|
-
await promises_1.default.copyFile(sourcePath, targetPath);
|
|
78
|
-
await this.storeMetadata(targetFileId, sourceMetadata);
|
|
79
|
-
return targetFileId;
|
|
80
|
-
}
|
|
81
|
-
async rename(oldFileId, newFileId) {
|
|
82
|
-
const oldPath = this.resolvePath(oldFileId);
|
|
83
|
-
const newPath = this.resolvePath(newFileId);
|
|
84
|
-
await (0, utils_1.assertDir)(node_path_1.default.dirname(newPath));
|
|
85
|
-
await Promise.all([
|
|
86
|
-
promises_1.default.rename(oldPath, newPath),
|
|
87
|
-
promises_1.default.rename(`${oldPath}.metadata`, `${newPath}.metadata`),
|
|
88
|
-
]);
|
|
89
|
-
}
|
|
90
|
-
async deleteManyByFileId(ids) {
|
|
91
|
-
const parsedIds = ids.flatMap((id) => {
|
|
92
|
-
try {
|
|
93
|
-
const parsed = this.parseFileId(id);
|
|
94
|
-
return [parsed];
|
|
95
|
-
}
|
|
96
|
-
catch (e) {
|
|
97
|
-
this.errorReporter.warn(`Could not parse file ID ${id}. Skip deletion`);
|
|
98
|
-
return [];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
await this.deleteMany(parsedIds);
|
|
102
|
-
}
|
|
103
|
-
toFileId(location) {
|
|
104
|
-
return `${this.toRelativePath(location)}/binary_data/${(0, uuid_1.v4)()}`;
|
|
105
|
-
}
|
|
106
|
-
toRelativePath(location) {
|
|
107
|
-
switch (location.type) {
|
|
108
|
-
case 'execution': {
|
|
109
|
-
const executionId = location.executionId || 'temp';
|
|
110
|
-
return `workflows/${location.workflowId}/executions/${executionId}`;
|
|
111
|
-
}
|
|
112
|
-
case 'custom':
|
|
113
|
-
return location.pathSegments.join('/');
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
parseFileId(fileId) {
|
|
117
|
-
const executionMatch = fileId.match(EXECUTION_PATH_MATCHER);
|
|
118
|
-
if (executionMatch) {
|
|
119
|
-
return utils_1.FileLocation.ofExecution(executionMatch[1], executionMatch[2]);
|
|
120
|
-
}
|
|
121
|
-
const binaryDataIndex = fileId.indexOf('/binary_data/');
|
|
122
|
-
if (binaryDataIndex !== -1) {
|
|
123
|
-
const pathSegments = fileId.substring(0, binaryDataIndex).split('/');
|
|
124
|
-
return utils_1.FileLocation.ofCustom({ pathSegments });
|
|
125
|
-
}
|
|
126
|
-
throw new n8n_workflow_1.UnexpectedError(`File ID ${fileId} has invalid format.`);
|
|
127
|
-
}
|
|
128
|
-
resolvePath(...args) {
|
|
129
|
-
const returnPath = node_path_1.default.join(this.storagePath, ...args);
|
|
130
|
-
if (node_path_1.default.relative(this.storagePath, returnPath).startsWith('..')) {
|
|
131
|
-
throw new disallowed_filepath_error_1.DisallowedFilepathError(returnPath);
|
|
132
|
-
}
|
|
133
|
-
return returnPath;
|
|
134
|
-
}
|
|
135
|
-
async storeMetadata(fileId, metadata) {
|
|
136
|
-
const filePath = this.resolvePath(`${fileId}.metadata`);
|
|
137
|
-
await promises_1.default.writeFile(filePath, JSON.stringify(metadata), { encoding: 'utf-8' });
|
|
138
|
-
}
|
|
139
|
-
async getSize(fileId) {
|
|
140
|
-
const filePath = this.resolvePath(fileId);
|
|
141
|
-
try {
|
|
142
|
-
const stats = await promises_1.default.stat(filePath);
|
|
143
|
-
return stats.size;
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
throw new file_not_found_error_1.FileNotFoundError(filePath);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
exports.FileSystemManager = FileSystemManager;
|
|
151
|
-
//# sourceMappingURL=file-system.manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.manager.js","sourceRoot":"","sources":["../../src/binary-data/file-system.manager.ts"],"names":[],"mappings":";;;;;;AAAA,+CAA0D;AAC1D,qCAA2C;AAC3C,gEAAkC;AAClC,0DAA6B;AAE7B,+BAAkC;AAKlC,mCAA0D;AAC1D,mFAA8E;AAC9E,yEAAmE;AAEnE,MAAM,sBAAsB,GAAG,4CAA4C,CAAC;AAE5E;IACC,YACS,WAAmB,EACV,aAA4B;2BADrC,WAAW;6BACF,aAAa;IAC5B,CAAC;IAEJ,KAAK,CAAC,IAAI;QACT,MAAM,IAAA,iBAAS,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,KAAK,CACV,QAAiC,EACjC,cAAiC,EACjC,EAAE,QAAQ,EAAE,QAAQ,EAA+B;QAEnD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAE1C,MAAM,IAAA,iBAAS,EAAC,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAExC,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAE5C,MAAM,IAAI,CAAC,aAAa,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AAW,CAAC,GAAG,IAAc;QACpC,MAAM,UAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,CAAC;QAExD,IAAI,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAClE,MAAM,IAAI,mDAAuB,CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,MAAc,EAAE,QAA6B;QACxE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,MAAM,WAAW,CAAC,CAAC;QAExD,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAEO,KAAK,CAAC,OAAO,CAAC,MAAc;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAE1C,IAAI,CAAC;YACJ,MAAM,KAAK,GAAG,MAAM,kBAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtC,OAAO,KAAK,CAAC,IAAI,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,wCAAiB,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
declare const protocolSchema: z.ZodEnum<["http", "https"]>;
|
|
3
|
-
export type Protocol = z.infer<typeof protocolSchema>;
|
|
4
|
-
declare class ObjectStoreBucketConfig {
|
|
5
|
-
name: string;
|
|
6
|
-
region: string;
|
|
7
|
-
}
|
|
8
|
-
declare class ObjectStoreCredentialsConfig {
|
|
9
|
-
accessKey: string;
|
|
10
|
-
accessSecret: string;
|
|
11
|
-
authAutoDetect: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare class ObjectStoreConfig {
|
|
14
|
-
host: string;
|
|
15
|
-
protocol: Protocol;
|
|
16
|
-
forcePathStyle: boolean;
|
|
17
|
-
maxAttempts: number;
|
|
18
|
-
bucket: ObjectStoreBucketConfig;
|
|
19
|
-
credentials: ObjectStoreCredentialsConfig;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,93 +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.ObjectStoreConfig = void 0;
|
|
13
|
-
const config_1 = require("@n8n/config");
|
|
14
|
-
const zod_1 = require("zod");
|
|
15
|
-
const protocolSchema = zod_1.z.enum(['http', 'https']);
|
|
16
|
-
let ObjectStoreBucketConfig = class ObjectStoreBucketConfig {
|
|
17
|
-
constructor() {
|
|
18
|
-
this.name = '';
|
|
19
|
-
this.region = '';
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_BUCKET_NAME'),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], ObjectStoreBucketConfig.prototype, "name", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_BUCKET_REGION'),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], ObjectStoreBucketConfig.prototype, "region", void 0);
|
|
30
|
-
ObjectStoreBucketConfig = __decorate([
|
|
31
|
-
config_1.Config
|
|
32
|
-
], ObjectStoreBucketConfig);
|
|
33
|
-
let ObjectStoreCredentialsConfig = class ObjectStoreCredentialsConfig {
|
|
34
|
-
constructor() {
|
|
35
|
-
this.accessKey = '';
|
|
36
|
-
this.accessSecret = '';
|
|
37
|
-
this.authAutoDetect = false;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_ACCESS_KEY'),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], ObjectStoreCredentialsConfig.prototype, "accessKey", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_ACCESS_SECRET'),
|
|
46
|
-
__metadata("design:type", String)
|
|
47
|
-
], ObjectStoreCredentialsConfig.prototype, "accessSecret", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_AUTH_AUTO_DETECT'),
|
|
50
|
-
__metadata("design:type", Boolean)
|
|
51
|
-
], ObjectStoreCredentialsConfig.prototype, "authAutoDetect", void 0);
|
|
52
|
-
ObjectStoreCredentialsConfig = __decorate([
|
|
53
|
-
config_1.Config
|
|
54
|
-
], ObjectStoreCredentialsConfig);
|
|
55
|
-
let ObjectStoreConfig = class ObjectStoreConfig {
|
|
56
|
-
constructor() {
|
|
57
|
-
this.host = '';
|
|
58
|
-
this.protocol = 'https';
|
|
59
|
-
this.forcePathStyle = true;
|
|
60
|
-
this.maxAttempts = 3;
|
|
61
|
-
this.bucket = {};
|
|
62
|
-
this.credentials = {};
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
exports.ObjectStoreConfig = ObjectStoreConfig;
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_HOST'),
|
|
68
|
-
__metadata("design:type", String)
|
|
69
|
-
], ObjectStoreConfig.prototype, "host", void 0);
|
|
70
|
-
__decorate([
|
|
71
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_PROTOCOL', protocolSchema),
|
|
72
|
-
__metadata("design:type", String)
|
|
73
|
-
], ObjectStoreConfig.prototype, "protocol", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_FORCE_PATH_STYLE'),
|
|
76
|
-
__metadata("design:type", Boolean)
|
|
77
|
-
], ObjectStoreConfig.prototype, "forcePathStyle", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, config_1.Env)('N8N_EXTERNAL_STORAGE_S3_MAX_ATTEMPTS'),
|
|
80
|
-
__metadata("design:type", Number)
|
|
81
|
-
], ObjectStoreConfig.prototype, "maxAttempts", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
config_1.Nested,
|
|
84
|
-
__metadata("design:type", ObjectStoreBucketConfig)
|
|
85
|
-
], ObjectStoreConfig.prototype, "bucket", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
config_1.Nested,
|
|
88
|
-
__metadata("design:type", ObjectStoreCredentialsConfig)
|
|
89
|
-
], ObjectStoreConfig.prototype, "credentials", void 0);
|
|
90
|
-
exports.ObjectStoreConfig = ObjectStoreConfig = __decorate([
|
|
91
|
-
config_1.Config
|
|
92
|
-
], ObjectStoreConfig);
|
|
93
|
-
//# sourceMappingURL=object-store.config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-store.config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c,CAAC;;mDAC3B;AAI7B;IADC,IAAA,YAAG,EAAC,0CAA0C,CAAC;;yDACjB;AAI/B;IADC,IAAA,YAAG,EAAC,sCAAsC,CAAC;;sDACpB;AAGxB;IADC,eAAM;8BACC,uBAAuB;iDAAiC;AAGhE;IADC,eAAM;8BACM,4BAA4B;sDAAsC;4BAvBnE,iBAAiB;IAD7B,eAAM;GACM,iBAAiB,CAwB7B"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { S3ClientConfig } from '@aws-sdk/client-s3';
|
|
2
|
-
import { Logger } from '@n8n/backend-common';
|
|
3
|
-
import { Readable } from 'node:stream';
|
|
4
|
-
import { ObjectStoreConfig } from './object-store.config';
|
|
5
|
-
import type { MetadataResponseHeaders } from './types';
|
|
6
|
-
import type { BinaryData } from '../types';
|
|
7
|
-
export declare class ObjectStoreService {
|
|
8
|
-
private readonly logger;
|
|
9
|
-
private readonly s3Config;
|
|
10
|
-
private s3Client;
|
|
11
|
-
private isReady;
|
|
12
|
-
private bucket;
|
|
13
|
-
constructor(logger: Logger, s3Config: ObjectStoreConfig);
|
|
14
|
-
getClientConfig(): S3ClientConfig;
|
|
15
|
-
init(): Promise<void>;
|
|
16
|
-
setReady(newState: boolean): void;
|
|
17
|
-
checkConnection(): Promise<void>;
|
|
18
|
-
put(filename: string, buffer: Buffer, metadata?: BinaryData.PreWriteMetadata): Promise<import("@aws-sdk/client-s3").PutObjectCommandOutput>;
|
|
19
|
-
get(fileId: string, opts: {
|
|
20
|
-
mode: 'buffer';
|
|
21
|
-
}): Promise<Buffer>;
|
|
22
|
-
get(fileId: string, opts: {
|
|
23
|
-
mode: 'stream';
|
|
24
|
-
chunkSize?: number;
|
|
25
|
-
}): Promise<Readable>;
|
|
26
|
-
getMetadata(fileId: string): Promise<MetadataResponseHeaders>;
|
|
27
|
-
deleteOne(fileId: string): Promise<import("@aws-sdk/client-s3").DeleteObjectCommandOutput>;
|
|
28
|
-
deleteMany(prefix: string): Promise<void>;
|
|
29
|
-
deleteByKeys(keys: string[]): Promise<void>;
|
|
30
|
-
list(prefix: string): Promise<{
|
|
31
|
-
key: string;
|
|
32
|
-
lastModified: string;
|
|
33
|
-
eTag: string;
|
|
34
|
-
size: number;
|
|
35
|
-
storageClass: string;
|
|
36
|
-
}[]>;
|
|
37
|
-
getListPage(prefix: string, continuationToken?: string): Promise<{
|
|
38
|
-
contents: {
|
|
39
|
-
key: string;
|
|
40
|
-
lastModified: string;
|
|
41
|
-
eTag: string;
|
|
42
|
-
size: number;
|
|
43
|
-
storageClass: string;
|
|
44
|
-
}[];
|
|
45
|
-
isTruncated: boolean;
|
|
46
|
-
nextContinuationToken: string | undefined;
|
|
47
|
-
}>;
|
|
48
|
-
private handleS3Error;
|
|
49
|
-
}
|