mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
⚡ Fix an issue with S3-Node
This commit is contained in:
@@ -1,7 +1,21 @@
|
||||
|
||||
import {
|
||||
snakeCase,
|
||||
paramCase,
|
||||
} from 'change-case';
|
||||
|
||||
import {
|
||||
createHash,
|
||||
} from 'crypto';
|
||||
|
||||
import {
|
||||
Builder,
|
||||
} from 'xml2js';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
BINARY_ENCODING,
|
||||
} from 'n8n-core';
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import {
|
||||
IBinaryKeyData,
|
||||
@@ -17,13 +31,13 @@ import {
|
||||
} from './BucketDescription';
|
||||
|
||||
import {
|
||||
folderOperations,
|
||||
folderFields,
|
||||
folderFields,
|
||||
folderOperations,
|
||||
} from './FolderDescription';
|
||||
|
||||
import {
|
||||
fileOperations,
|
||||
fileFields,
|
||||
fileOperations,
|
||||
} from './FileDescription';
|
||||
|
||||
import {
|
||||
@@ -32,19 +46,6 @@ import {
|
||||
awsApiRequestSOAPAllItems,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import {
|
||||
snakeCase,
|
||||
paramCase,
|
||||
} from 'change-case';
|
||||
|
||||
import {
|
||||
createHash,
|
||||
} from 'crypto';
|
||||
|
||||
import {
|
||||
Builder,
|
||||
} from 'xml2js';
|
||||
|
||||
export class AwsS3 implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'AWS S3',
|
||||
@@ -76,16 +77,16 @@ export class AwsS3 implements INodeType {
|
||||
name: 'Bucket',
|
||||
value: 'bucket',
|
||||
},
|
||||
{
|
||||
name: 'Folder',
|
||||
value: 'folder',
|
||||
},
|
||||
{
|
||||
name: 'File',
|
||||
value: 'file',
|
||||
},
|
||||
{
|
||||
name: 'Folder',
|
||||
value: 'folder',
|
||||
},
|
||||
],
|
||||
default: 'bucket',
|
||||
default: 'file',
|
||||
description: 'The operation to perform.',
|
||||
},
|
||||
// BUCKET
|
||||
@@ -142,10 +143,16 @@ export class AwsS3 implements INodeType {
|
||||
'$': {
|
||||
xmlns: 'http://s3.amazonaws.com/doc/2006-03-01/',
|
||||
},
|
||||
LocationConstraint: [credentials!.region],
|
||||
}
|
||||
};
|
||||
|
||||
// For some reasons does AWS not allow to supply "us-east-1" if you want to
|
||||
// create it there it has to be empty?!?!
|
||||
if (credentials!.region !== 'us-east-1') {
|
||||
// @ts-ignore
|
||||
body.CreateBucketConfiguration.LocationConstraint = [credentials!.region];
|
||||
}
|
||||
|
||||
const builder = new Builder();
|
||||
const data = builder.buildObject(body);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user