n8n/packages/nodes-base/nodes/Aws/S3/FileDescription.ts

923 lines
19 KiB
TypeScript
Raw Normal View History

2020-04-15 15:42:37 -07:00
import {
INodeProperties,
} from 'n8n-workflow';
export const fileOperations: INodeProperties[] = [
2020-04-15 15:42:37 -07:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'file',
],
},
},
options: [
{
name: 'Copy',
value: 'copy',
description: 'Copy a file',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a file',
},
{
name: 'Download',
value: 'download',
description: 'Download a file',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all files',
},
{
name: 'Upload',
value: 'upload',
description: 'Upload a file',
},
],
2020-04-20 11:44:22 -07:00
default: 'download',
2020-04-15 15:42:37 -07:00
description: 'The operation to perform.',
},
];
2020-04-15 15:42:37 -07:00
export const fileFields: INodeProperties[] = [
2020-04-15 15:42:37 -07:00
/* -------------------------------------------------------------------------- */
/* file:copy */
/* -------------------------------------------------------------------------- */
{
2020-04-21 21:13:30 -07:00
displayName: 'Source Path',
name: 'sourcePath',
2020-04-15 15:42:37 -07:00
type: 'string',
required: true,
default: '',
placeholder: '/bucket/my-image.jpg',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'copy',
],
},
},
description: 'The name of the source bucket and key name of the source object, separated by a slash (/)',
},
{
2020-04-21 21:13:30 -07:00
displayName: 'Destination Path',
name: 'destinationPath',
2020-04-15 15:42:37 -07:00
type: 'string',
required: true,
default: '',
2020-04-21 21:13:30 -07:00
placeholder: '/bucket/my-second-image.jpg',
2020-04-15 15:42:37 -07:00
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'copy',
],
},
},
2020-04-21 21:13:30 -07:00
description: 'The name of the destination bucket and key name of the destination object, separated by a slash (/)',
2020-04-15 15:42:37 -07:00
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'copy',
],
},
},
default: {},
options: [
{
displayName: 'ACL',
name: 'acl',
type: 'options',
options: [
{
name: 'Authenticated Read',
2020-10-22 06:46:03 -07:00
value: 'authenticatedRead',
2020-04-15 15:42:37 -07:00
},
{
name: 'AWS Exec Read',
2020-10-22 06:46:03 -07:00
value: 'awsExecRead',
2020-04-15 15:42:37 -07:00
},
{
name: 'Bucket Owner Full Control',
2020-10-22 06:46:03 -07:00
value: 'bucketOwnerFullControl',
2020-04-15 15:42:37 -07:00
},
{
name: 'Bucket Owner Read',
2020-10-22 06:46:03 -07:00
value: 'bucketOwnerRead',
2020-04-15 15:42:37 -07:00
},
{
name: 'Private',
value: 'private',
},
{
name: 'Public Read',
2020-10-22 06:46:03 -07:00
value: 'publicRead',
2020-04-15 15:42:37 -07:00
},
{
name: 'Public Read Write',
2020-10-22 06:46:03 -07:00
value: 'publicReadWrite',
2020-04-15 15:42:37 -07:00
},
],
default: 'private',
2020-10-22 06:46:03 -07:00
description: 'The canned ACL to apply to the object.',
2020-04-15 15:42:37 -07:00
},
{
displayName: 'Grant Full Control',
name: 'grantFullControl',
type: 'boolean',
default: false,
description: 'Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.',
},
{
displayName: 'Grant Read',
name: 'grantRead',
type: 'boolean',
default: false,
description: 'Allows grantee to read the object data and its metadata.',
},
{
displayName: 'Grant Read ACP',
name: 'grantReadAcp',
type: 'boolean',
default: false,
description: 'Allows grantee to read the object ACL.',
},
{
displayName: 'Grant Write ACP',
name: 'grantWriteAcp',
type: 'boolean',
default: false,
description: 'Allows grantee to write the ACL for the applicable object.',
},
{
displayName: 'Lock Legal Hold',
name: 'lockLegalHold',
type: 'boolean',
default: false,
description: 'Specifies whether a legal hold will be applied to this object',
},
{
displayName: 'Lock Mode',
name: 'lockMode',
type: 'options',
options: [
{
name: 'Governance',
value: 'governance',
},
{
name: 'Compliance',
value: 'compliance',
},
],
default: '',
description: 'The Object Lock mode that you want to apply to this object.',
},
{
displayName: 'Lock Retain Until Date',
name: 'lockRetainUntilDate',
type: 'dateTime',
default: '',
description: `The date and time when you want this object's Object Lock to expire.`,
},
{
displayName: 'Metadata Directive',
name: 'metadataDirective',
type: 'options',
options: [
{
name: 'Copy',
value: 'copy',
},
{
name: 'Replace',
value: 'replace',
},
],
default: '',
description: 'Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.',
},
{
displayName: 'Requester Pays',
name: 'requesterPays',
type: 'boolean',
default: false,
description: 'Weather the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.',
},
{
displayName: 'Server Side Encryption',
name: 'serverSideEncryption',
type: 'options',
options: [
{
name: 'AES256',
value: 'AES256',
},
{
name: 'AWS:KMS',
value: 'aws:kms',
},
],
default: '',
description: 'The server-side encryption algorithm used when storing this object in Amazon S3',
},
{
displayName: 'Server Side Encryption Context',
name: 'serverSideEncryptionContext',
type: 'string',
default: '',
description: 'Specifies the AWS KMS Encryption Context to use for object encryption',
},
{
displayName: 'Server Side Encryption AWS KMS Key ID',
name: 'encryptionAwsKmsKeyId',
type: 'string',
default: '',
description: 'If x-amz-server-side-encryption is present and has the value of aws:kms',
},
{
displayName: 'Server Side Encryption Customer Algorithm',
name: 'serversideEncryptionCustomerAlgorithm',
type: 'string',
default: '',
description: 'Specifies the algorithm to use to when encrypting the object (for example, AES256).',
},
{
displayName: 'Server Side Encryption Customer Key',
name: 'serversideEncryptionCustomerKey',
type: 'string',
default: '',
description: 'Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data',
},
{
displayName: 'Server Side Encryption Customer Key MD5',
name: 'serversideEncryptionCustomerKeyMD5',
type: 'string',
default: '',
description: 'Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321.',
},
{
displayName: 'Storage Class',
name: 'storageClass',
type: 'options',
options: [
{
name: 'Deep Archive',
value: 'deepArchive',
},
{
name: 'Intelligent Tiering',
value: 'intelligentTiering',
},
{
name: 'One Zone IA',
value: 'onezoneIA',
},
{
name: 'Glacier',
value: 'glacier',
},
{
name: 'Standard',
value: 'standard',
},
{
name: 'Standard IA',
value: 'standardIA',
},
],
default: 'standard',
description: 'Amazon S3 storage classes.',
},
{
displayName: 'Tagging Directive',
name: 'taggingDirective',
type: 'options',
options: [
{
name: 'Copy',
value: 'copy',
},
{
name: 'Replace',
value: 'replace',
},
],
default: '',
description: 'Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.',
},
],
},
/* -------------------------------------------------------------------------- */
/* file:upload */
/* -------------------------------------------------------------------------- */
{
displayName: 'Bucket Name',
name: 'bucketName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'upload',
],
},
},
},
{
displayName: 'File Name',
name: 'fileName',
type: 'string',
default: '',
placeholder: 'hello.txt',
required: true,
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'upload',
],
binaryData: [
false,
],
},
},
},
{
displayName: 'File Name',
name: 'fileName',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'upload',
],
binaryData: [
true,
],
},
},
description: 'If not set the binary data filename will be used.',
},
{
displayName: 'Binary Data',
name: 'binaryData',
type: 'boolean',
2020-04-22 02:20:26 -07:00
default: true,
2020-04-15 15:42:37 -07:00
displayOptions: {
show: {
operation: [
2020-10-22 06:46:03 -07:00
'upload',
2020-04-15 15:42:37 -07:00
],
resource: [
'file',
],
},
},
description: 'If the data to upload should be taken from binary field.',
},
{
displayName: 'File Content',
name: 'fileContent',
type: 'string',
default: '',
displayOptions: {
show: {
operation: [
2020-10-22 06:46:03 -07:00
'upload',
2020-04-15 15:42:37 -07:00
],
resource: [
'file',
],
binaryData: [
2020-10-22 06:46:03 -07:00
false,
2020-04-15 15:42:37 -07:00
],
},
},
placeholder: '',
description: 'The text content of the file to upload.',
},
{
displayName: 'Binary Property',
name: 'binaryPropertyName',
type: 'string',
default: 'data',
required: true,
displayOptions: {
show: {
operation: [
2020-10-22 06:46:03 -07:00
'upload',
2020-04-15 15:42:37 -07:00
],
resource: [
'file',
],
binaryData: [
2020-10-22 06:46:03 -07:00
true,
2020-04-15 15:42:37 -07:00
],
},
},
placeholder: '',
:zap: Remove unnessasry <br/> (#2340) * introduce analytics * add user survey backend * add user survey backend * set answers on survey submit Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * change name to personalization * lint Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * N8n 2495 add personalization modal (#2280) * update modals * add onboarding modal * implement questions * introduce analytics * simplify impl * implement survey handling * add personalized cateogry * update modal behavior * add thank you view * handle empty cases * rename modal * standarize modal names * update image, add tags to headings * remove unused file * remove unused interfaces * clean up footer spacing * introduce analytics * refactor to fix bug * update endpoint * set min height * update stories * update naming from questions to survey * remove spacing after core categories * fix bug in logic * sort nodes * rename types * merge with be * rename userSurvey * clean up rest api * use constants for keys * use survey keys * clean up types * move personalization to its own file Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> * update parameter inputs to be multiline * update spacing * Survey new options (#2300) * split up options * fix quotes * remove unused import * refactor node credentials * add user created workflow event (#2301) * update multi params * simplify env vars * fix versionCli on FE * update personalization env * clean up node detail settings * fix event User opened Credentials panel * fix font sizes across modals * clean up input spacing * fix select modal spacing * increase spacing * fix input copy * fix webhook, tab spacing, retry button * fix button sizes * fix button size * add mini xlarge sizes * fix webhook spacing * fix nodes panel event * fix workflow id in workflow execute event * improve telemetry error logging * fix config and stop process events * add flush call on n8n stop * ready for release * fix input error highlighting * revert change * update toggle spacing * fix delete positioning * keep tooltip while focused * set strict size * increase left spacing * fix sort icons * remove unnessasry <br/> * remove unnessary break * remove unnessary margin * clean unused functionality * remove unnessary css * remove duplicate tracking * only show tooltip when hovering over label * remove extra space * add br * remove extra space * clean up commas * clean up commas * remove extra space * remove extra space * rewrite desc * add commas * add space * remove extra space * add space * add dot * update credentials section * use includes Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-10-27 13:00:13 -07:00
description: 'Name of the binary property which contains the data for the file to be uploaded.',
2020-04-15 15:42:37 -07:00
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'upload',
],
},
},
default: {},
options: [
{
displayName: 'ACL',
name: 'acl',
type: 'options',
options: [
{
name: 'Authenticated Read',
2020-10-22 06:46:03 -07:00
value: 'authenticatedRead',
2020-04-15 15:42:37 -07:00
},
{
name: 'AWS Exec Read',
2020-10-22 06:46:03 -07:00
value: 'awsExecRead',
2020-04-15 15:42:37 -07:00
},
{
name: 'Bucket Owner Full Control',
2020-10-22 06:46:03 -07:00
value: 'bucketOwnerFullControl',
2020-04-15 15:42:37 -07:00
},
{
name: 'Bucket Owner Read',
2020-10-22 06:46:03 -07:00
value: 'bucketOwnerRead',
2020-04-15 15:42:37 -07:00
},
{
name: 'Private',
value: 'private',
},
{
name: 'Public Read',
2020-10-22 06:46:03 -07:00
value: 'publicRead',
2020-04-15 15:42:37 -07:00
},
{
name: 'Public Read Write',
2020-10-22 06:46:03 -07:00
value: 'publicReadWrite',
2020-04-15 15:42:37 -07:00
},
],
default: 'private',
2020-10-22 06:46:03 -07:00
description: 'The canned ACL to apply to the object.',
2020-04-15 15:42:37 -07:00
},
{
displayName: 'Grant Full Control',
name: 'grantFullControl',
type: 'boolean',
default: false,
description: 'Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.',
},
{
displayName: 'Grant Read',
name: 'grantRead',
type: 'boolean',
default: false,
description: 'Allows grantee to read the object data and its metadata.',
},
{
displayName: 'Grant Read ACP',
name: 'grantReadAcp',
type: 'boolean',
default: false,
description: 'Allows grantee to read the object ACL.',
},
{
displayName: 'Grant Write ACP',
name: 'grantWriteAcp',
type: 'boolean',
default: false,
description: 'Allows grantee to write the ACL for the applicable object.',
},
{
displayName: 'Lock Legal Hold',
name: 'lockLegalHold',
type: 'boolean',
default: false,
description: 'Specifies whether a legal hold will be applied to this object',
},
{
displayName: 'Lock Mode',
name: 'lockMode',
type: 'options',
options: [
{
name: 'Governance',
value: 'governance',
},
{
name: 'Compliance',
value: 'compliance',
},
],
default: '',
description: 'The Object Lock mode that you want to apply to this object.',
},
{
displayName: 'Lock Retain Until Date',
name: 'lockRetainUntilDate',
type: 'dateTime',
default: '',
description: `The date and time when you want this object's Object Lock to expire.`,
},
{
displayName: 'Parent Folder Key',
name: 'parentFolderKey',
type: 'string',
default: '',
description: 'Parent file you want to create the file in',
},
{
displayName: 'Requester Pays',
name: 'requesterPays',
type: 'boolean',
default: false,
description: 'Weather the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.',
},
{
displayName: 'Server Side Encryption',
name: 'serverSideEncryption',
type: 'options',
options: [
{
name: 'AES256',
value: 'AES256',
},
{
name: 'AWS:KMS',
value: 'aws:kms',
},
],
default: '',
description: 'The server-side encryption algorithm used when storing this object in Amazon S3',
},
{
displayName: 'Server Side Encryption Context',
name: 'serverSideEncryptionContext',
type: 'string',
default: '',
description: 'Specifies the AWS KMS Encryption Context to use for object encryption',
},
{
displayName: 'Server Side Encryption AWS KMS Key ID',
name: 'encryptionAwsKmsKeyId',
type: 'string',
default: '',
description: 'If x-amz-server-side-encryption is present and has the value of aws:kms',
},
{
displayName: 'Server Side Encryption Customer Algorithm',
name: 'serversideEncryptionCustomerAlgorithm',
type: 'string',
default: '',
description: 'Specifies the algorithm to use to when encrypting the object (for example, AES256).',
},
{
displayName: 'Server Side Encryption Customer Key',
name: 'serversideEncryptionCustomerKey',
type: 'string',
default: '',
description: 'Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data',
},
{
displayName: 'Server Side Encryption Customer Key MD5',
name: 'serversideEncryptionCustomerKeyMD5',
type: 'string',
default: '',
description: 'Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321.',
},
{
displayName: 'Storage Class',
name: 'storageClass',
type: 'options',
options: [
{
name: 'Deep Archive',
value: 'deepArchive',
},
{
name: 'Intelligent Tiering',
value: 'intelligentTiering',
},
{
name: 'One Zone IA',
value: 'onezoneIA',
},
{
name: 'Glacier',
value: 'glacier',
},
{
name: 'Standard',
value: 'standard',
},
{
name: 'Standard IA',
value: 'standardIA',
},
],
default: 'standard',
description: 'Amazon S3 storage classes.',
},
],
},
{
displayName: 'Tags',
name: 'tagsUi',
placeholder: 'Add Tag',
type: 'fixedCollection',
default: '',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'upload',
],
},
},
options: [
{
name: 'tagsValues',
displayName: 'Tag',
values: [
{
displayName: 'Key',
name: 'key',
type: 'string',
default: '',
description: '',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
description: '',
},
],
2020-10-22 06:46:03 -07:00
},
2020-04-15 15:42:37 -07:00
],
description: 'Optional extra headers to add to the message (most headers are allowed).',
},
/* -------------------------------------------------------------------------- */
/* file:download */
/* -------------------------------------------------------------------------- */
{
displayName: 'Bucket Name',
name: 'bucketName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'download',
],
},
},
},
{
displayName: 'File Key',
name: 'fileKey',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'download',
],
},
},
},
{
displayName: 'Binary Property',
name: 'binaryPropertyName',
type: 'string',
required: true,
default: 'data',
displayOptions: {
show: {
operation: [
2020-10-22 06:46:03 -07:00
'download',
2020-04-15 15:42:37 -07:00
],
resource: [
'file',
],
},
},
:zap: Remove unnessasry <br/> (#2340) * introduce analytics * add user survey backend * add user survey backend * set answers on survey submit Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * change name to personalization * lint Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * N8n 2495 add personalization modal (#2280) * update modals * add onboarding modal * implement questions * introduce analytics * simplify impl * implement survey handling * add personalized cateogry * update modal behavior * add thank you view * handle empty cases * rename modal * standarize modal names * update image, add tags to headings * remove unused file * remove unused interfaces * clean up footer spacing * introduce analytics * refactor to fix bug * update endpoint * set min height * update stories * update naming from questions to survey * remove spacing after core categories * fix bug in logic * sort nodes * rename types * merge with be * rename userSurvey * clean up rest api * use constants for keys * use survey keys * clean up types * move personalization to its own file Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> * update parameter inputs to be multiline * update spacing * Survey new options (#2300) * split up options * fix quotes * remove unused import * refactor node credentials * add user created workflow event (#2301) * update multi params * simplify env vars * fix versionCli on FE * update personalization env * clean up node detail settings * fix event User opened Credentials panel * fix font sizes across modals * clean up input spacing * fix select modal spacing * increase spacing * fix input copy * fix webhook, tab spacing, retry button * fix button sizes * fix button size * add mini xlarge sizes * fix webhook spacing * fix nodes panel event * fix workflow id in workflow execute event * improve telemetry error logging * fix config and stop process events * add flush call on n8n stop * ready for release * fix input error highlighting * revert change * update toggle spacing * fix delete positioning * keep tooltip while focused * set strict size * increase left spacing * fix sort icons * remove unnessasry <br/> * remove unnessary break * remove unnessary margin * clean unused functionality * remove unnessary css * remove duplicate tracking * only show tooltip when hovering over label * remove extra space * add br * remove extra space * clean up commas * clean up commas * remove extra space * remove extra space * rewrite desc * add commas * add space * remove extra space * add space * add dot * update credentials section * use includes Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-10-27 13:00:13 -07:00
description: 'Name of the binary property to which to write the data of the read file.',
2020-04-15 15:42:37 -07:00
},
/* -------------------------------------------------------------------------- */
/* file:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Bucket Name',
name: 'bucketName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'delete',
],
},
},
},
{
displayName: 'File Key',
name: 'fileKey',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'delete',
],
},
},
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'delete',
],
},
},
options: [
{
displayName: 'Version ID',
name: 'versionId',
type: 'string',
default: '',
},
],
},
/* -------------------------------------------------------------------------- */
/* file:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Bucket Name',
name: 'bucketName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'getAll',
],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'file',
],
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'file',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'How many results to return.',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'file',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Fetch Owner',
name: 'fetchOwner',
type: 'boolean',
default: false,
description: 'The owner field is not present in listV2 by default, if you want to return owner field with each key in the result then set the fetch owner field to true.',
},
{
displayName: 'Folder Key',
name: 'folderKey',
type: 'string',
default: '',
},
],
},
];