Create generic S3 node

This commit is contained in:
Denis Palashevskii
2020-08-18 16:56:53 +04:00
parent a3c5a971e5
commit 77eb0f4955
9 changed files with 2325 additions and 60 deletions

View File

@@ -65,44 +65,9 @@ export class AwsS3 implements INodeType {
{
name: 'aws',
required: true,
displayOptions: {
show: {
endpoint: [
'aws',
],
},
},
},
{
name: 'customS3Endpoint',
required: true,
displayOptions: {
show: {
endpoint: [
'customS3Endpoint',
],
},
},
},
],
properties: [
{
displayName: 'Endpoint',
name: 'endpoint',
type: 'options',
options: [
{
name: 'AWS',
value: 'aws',
},
{
name: 'Custom S3 endpoint',
value: 'customS3Endpoint',
},
],
default: 'aws',
description: 'The endpoint of S3 compatible service.',
},
{
displayName: 'Resource',
name: 'resource',
@@ -151,14 +116,8 @@ export class AwsS3 implements INodeType {
let credentials;
const endpointType = this.getNodeParameter('endpoint', 0);
try {
if (endpointType === 'aws') {
credentials = this.getCredentials('aws');
} else {
credentials = this.getCredentials('customS3Endpoint');
}
credentials = this.getCredentials('aws');
} catch (error) {
throw new Error(error);
}