first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,321 @@
import type { INodeProperties } from 'n8n-workflow';
export const bucketOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['bucket'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a bucket',
action: 'Create a bucket',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a bucket',
action: 'Delete a bucket',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many buckets',
action: 'Get many buckets',
},
{
name: 'Search',
value: 'search',
description: 'Search within a bucket',
action: 'Search a bucket',
},
],
default: 'create',
},
];
export const bucketFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* bucket:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Name',
name: 'name',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['bucket'],
operation: ['create'],
},
},
description: 'A succinct description of the nature, symptoms, cause, or effect of the bucket',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: ['bucket'],
operation: ['create'],
},
},
default: {},
options: [
{
displayName: 'ACL',
name: 'acl',
type: 'options',
options: [
{
name: 'Authenticated Read',
value: 'authenticatedRead',
},
{
name: 'Private',
value: 'Private',
},
{
name: 'Public Read',
value: 'publicRead',
},
{
name: 'Public Read Write',
value: 'publicReadWrite',
},
],
default: '',
description: 'The canned ACL to apply to the bucket',
},
{
displayName: 'Bucket Object Lock Enabled',
name: 'bucketObjectLockEnabled',
type: 'boolean',
default: false,
description: 'Whether you want S3 Object Lock to be enabled for the new bucket',
},
{
displayName: 'Grant Full Control',
name: 'grantFullControl',
type: 'boolean',
default: false,
description:
'Whether to allow grantee the read, write, read ACP, and write ACP permissions on the bucket',
},
{
displayName: 'Grant Read',
name: 'grantRead',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to list the objects in the bucket',
},
{
displayName: 'Grant Read ACP',
name: 'grantReadAcp',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to read the bucket ACL',
},
{
displayName: 'Grant Write',
name: 'grantWrite',
type: 'boolean',
default: false,
description:
'Whether to allow grantee to create, overwrite, and delete any object in the bucket',
},
{
displayName: 'Grant Write ACP',
name: 'grantWriteAcp',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to write the ACL for the applicable bucket',
},
{
displayName: 'Region',
name: 'region',
type: 'string',
default: '',
description:
'Region you want to create the bucket in, by default the buckets are created on the region defined on the credentials',
},
],
},
/* -------------------------------------------------------------------------- */
/* bucket:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Name',
name: 'name',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['bucket'],
operation: ['delete'],
},
},
description: 'Name of the AWS S3 bucket to delete',
},
/* -------------------------------------------------------------------------- */
/* bucket:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['bucket'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['bucket'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
},
/* -------------------------------------------------------------------------- */
/* bucket:search */
/* -------------------------------------------------------------------------- */
{
displayName: 'Bucket Name',
name: 'bucketName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['bucket'],
operation: ['search'],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: ['search'],
resource: ['bucket'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: ['search'],
resource: ['bucket'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: ['bucket'],
operation: ['search'],
},
},
default: {},
options: [
{
displayName: 'Delimiter',
name: 'delimiter',
type: 'string',
default: '',
description: 'A delimiter is a character you use to group keys',
},
{
displayName: 'Encoding Type',
name: 'encodingType',
type: 'options',
options: [
{
name: 'URL',
value: 'url',
},
],
default: '',
description: 'Encoding type used by Amazon S3 to encode object keys in the response',
},
{
displayName: 'Fetch Owner',
name: 'fetchOwner',
type: 'boolean',
default: false,
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
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: 'Prefix',
name: 'prefix',
type: 'string',
default: '',
description: 'Limits the response to keys that begin with the specified prefix',
},
{
displayName: 'Requester Pays',
name: 'requesterPays',
type: 'boolean',
default: false,
description:
'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.',
},
{
displayName: 'Start After',
name: 'startAfter',
type: 'string',
default: '',
description:
'StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key.',
},
],
},
];
@@ -0,0 +1,841 @@
import type { INodeProperties } from 'n8n-workflow';
export const fileOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['file'],
},
},
options: [
{
name: 'Copy',
value: 'copy',
description: 'Copy a file',
action: 'Copy a file',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a file',
action: 'Delete a file',
},
{
name: 'Download',
value: 'download',
description: 'Download a file',
action: 'Download a file',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many files',
action: 'Get many files',
},
{
name: 'Upload',
value: 'upload',
description: 'Upload a file',
action: 'Upload a file',
},
],
default: 'download',
},
];
export const fileFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* file:copy */
/* -------------------------------------------------------------------------- */
{
displayName: 'Source Path',
name: 'sourcePath',
type: 'string',
required: true,
default: '',
placeholder: '/bucket/my-image.jpg',
displayOptions: {
show: {
resource: ['file'],
operation: ['copy'],
},
},
description:
'The name of the source bucket should start with (/) and key name of the source object, separated by a slash (/)',
},
{
displayName: 'Destination Path',
name: 'destinationPath',
type: 'string',
required: true,
default: '',
placeholder: '/bucket/my-second-image.jpg',
displayOptions: {
show: {
resource: ['file'],
operation: ['copy'],
},
},
description:
'The name of the destination bucket and key name of the destination object, separated by a slash (/)',
},
{
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',
value: 'authenticatedRead',
},
{
name: 'AWS Exec Read',
value: 'awsExecRead',
},
{
name: 'Bucket Owner Full Control',
value: 'bucketOwnerFullControl',
},
{
name: 'Bucket Owner Read',
value: 'bucketOwnerRead',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Public Read',
value: 'publicRead',
},
{
name: 'Public Read Write',
value: 'publicReadWrite',
},
],
default: 'private',
description: 'The canned ACL to apply to the object',
},
{
displayName: 'Grant Full Control',
name: 'grantFullControl',
type: 'boolean',
default: false,
description:
'Whether to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object',
},
{
displayName: 'Grant Read',
name: 'grantRead',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to read the object data and its metadata',
},
{
displayName: 'Grant Read ACP',
name: 'grantReadAcp',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to read the object ACL',
},
{
displayName: 'Grant Write ACP',
name: 'grantWriteAcp',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to write the ACL for the applicable object',
},
{
displayName: 'Lock Legal Hold',
name: 'lockLegalHold',
type: 'boolean',
default: false,
description: '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:
'Whether 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: 'Glacier',
value: 'glacier',
},
{
name: 'Intelligent Tiering',
value: 'intelligentTiering',
},
{
name: 'One Zone IA',
value: 'onezoneIA',
},
{
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 File',
name: 'binaryData',
type: 'boolean',
default: true,
displayOptions: {
show: {
operation: ['upload'],
resource: ['file'],
},
},
description: 'Whether the data to upload should be taken from binary field',
},
{
displayName: 'File Content',
name: 'fileContent',
type: 'string',
default: '',
displayOptions: {
show: {
operation: ['upload'],
resource: ['file'],
binaryData: [false],
},
},
placeholder: '',
description: 'The text content of the file to upload',
},
{
displayName: 'Input Binary Field',
name: 'binaryPropertyName',
type: 'string',
default: 'data',
required: true,
displayOptions: {
show: {
operation: ['upload'],
resource: ['file'],
binaryData: [true],
},
},
placeholder: '',
hint: 'The name of the input binary field containing the file to be uploaded',
},
{
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',
value: 'authenticatedRead',
},
{
name: 'AWS Exec Read',
value: 'awsExecRead',
},
{
name: 'Bucket Owner Full Control',
value: 'bucketOwnerFullControl',
},
{
name: 'Bucket Owner Read',
value: 'bucketOwnerRead',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Public Read',
value: 'publicRead',
},
{
name: 'Public Read Write',
value: 'publicReadWrite',
},
],
default: 'private',
description: 'The canned ACL to apply to the object',
},
{
displayName: 'Grant Full Control',
name: 'grantFullControl',
type: 'boolean',
default: false,
description:
'Whether to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object',
},
{
displayName: 'Grant Read',
name: 'grantRead',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to read the object data and its metadata',
},
{
displayName: 'Grant Read ACP',
name: 'grantReadAcp',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to read the object ACL',
},
{
displayName: 'Grant Write ACP',
name: 'grantWriteAcp',
type: 'boolean',
default: false,
description: 'Whether to allow grantee to write the ACL for the applicable object',
},
{
displayName: 'Lock Legal Hold',
name: 'lockLegalHold',
type: 'boolean',
default: false,
description: '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 folder you want to create the file in',
},
{
displayName: 'Requester Pays',
name: 'requesterPays',
type: 'boolean',
default: false,
description:
'Whether 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: 'Glacier',
value: 'glacier',
},
{
name: 'Intelligent Tiering',
value: 'intelligentTiering',
},
{
name: 'One Zone IA',
value: 'onezoneIA',
},
{
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: '',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
},
],
},
],
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: 'Put Output File in Field',
name: 'binaryPropertyName',
type: 'string',
required: true,
default: 'data',
displayOptions: {
show: {
operation: ['download'],
resource: ['file'],
},
},
hint: 'The name of the output binary field to put the file in',
},
/* -------------------------------------------------------------------------- */
/* 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: 'Whether to return all results 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: 'Max number of 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,
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
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: '',
},
],
},
];
@@ -0,0 +1,241 @@
import type { INodeProperties } from 'n8n-workflow';
export const folderOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['folder'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a folder',
action: 'Create a folder',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a folder',
action: 'Delete a folder',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many folders',
action: 'Get many folders',
},
],
default: 'create',
},
];
export const folderFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* folder:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Bucket Name',
name: 'bucketName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['folder'],
operation: ['create'],
},
},
},
{
displayName: 'Folder Name',
name: 'folderName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['folder'],
operation: ['create'],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: ['folder'],
operation: ['create'],
},
},
default: {},
options: [
{
displayName: 'Parent Folder Key',
name: 'parentFolderKey',
type: 'string',
default: '',
description: 'Parent folder you want to create the folder in',
},
{
displayName: 'Requester Pays',
name: 'requesterPays',
type: 'boolean',
default: false,
description:
'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.',
},
{
displayName: 'Storage Class',
name: 'storageClass',
type: 'options',
options: [
{
name: 'Deep Archive',
value: 'deepArchive',
},
{
name: 'Glacier',
value: 'glacier',
},
{
name: 'Intelligent Tiering',
value: 'intelligentTiering',
},
{
name: 'One Zone IA',
value: 'onezoneIA',
},
{
name: 'Reduced Redundancy',
value: 'RecudedRedundancy',
},
{
name: 'Standard',
value: 'standard',
},
{
name: 'Standard IA',
value: 'standardIA',
},
],
default: 'standard',
description: 'Amazon S3 storage classes',
},
],
},
/* -------------------------------------------------------------------------- */
/* folder:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Bucket Name',
name: 'bucketName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['folder'],
operation: ['delete'],
},
},
},
{
displayName: 'Folder Key',
name: 'folderKey',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['folder'],
operation: ['delete'],
},
},
},
/* -------------------------------------------------------------------------- */
/* folder:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Bucket Name',
name: 'bucketName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['folder'],
operation: ['getAll'],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['folder'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['folder'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['folder'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Fetch Owner',
name: 'fetchOwner',
type: 'boolean',
default: false,
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
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: '',
},
],
},
];
@@ -0,0 +1,136 @@
import get from 'lodash/get';
import type {
IDataObject,
IExecuteFunctions,
IHookFunctions,
ILoadOptionsFunctions,
IWebhookFunctions,
IHttpRequestOptions,
IHttpRequestMethods,
} from 'n8n-workflow';
import { parseString } from 'xml2js';
import { getAwsCredentials } from '../../GenericFunctions';
export async function awsApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
service: string,
method: IHttpRequestMethods,
path: string,
body?: string | Buffer | any,
query: IDataObject = {},
headers?: object,
option: IDataObject = {},
_region?: string,
): Promise<any> {
const requestOptions = {
qs: {
...query,
service,
path,
query,
_region,
},
method,
body,
url: '',
headers,
} as IHttpRequestOptions;
if (Object.keys(option).length !== 0) {
Object.assign(requestOptions, option);
}
const { credentialsType } = await getAwsCredentials(this);
return await this.helpers.requestWithAuthentication.call(this, credentialsType, requestOptions);
}
export async function awsApiRequestREST(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
service: string,
method: IHttpRequestMethods,
path: string,
body?: string | Buffer | any,
query: IDataObject = {},
headers?: object,
options: IDataObject = {},
region?: string,
): Promise<any> {
const response = await awsApiRequest.call(
this,
service,
method,
path,
body,
query,
headers,
options,
region,
);
try {
if (response.includes('<?xml version="1.0" encoding="UTF-8"?>')) {
return await new Promise((resolve, reject) => {
parseString(response as string, { explicitArray: false }, (err, data) => {
if (err) {
return reject(err);
}
resolve(data);
});
});
}
return JSON.parse(response as string);
} catch (error) {
return response;
}
}
export async function awsApiRequestRESTAllItems(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
propertyName: string,
service: string,
method: IHttpRequestMethods,
path: string,
body?: string,
query: IDataObject = {},
headers?: object,
option: IDataObject = {},
region?: string,
): Promise<any> {
const returnData: IDataObject[] = [];
let responseData;
do {
responseData = await awsApiRequestREST.call(
this,
service,
method,
path,
body,
query,
headers,
option,
region,
);
//https://forums.aws.amazon.com/thread.jspa?threadID=55746
if (get(responseData, [propertyName.split('.')[0], 'NextContinuationToken'])) {
query['continuation-token'] = get(responseData, [
propertyName.split('.')[0],
'NextContinuationToken',
]);
}
if (get(responseData, propertyName)) {
if (Array.isArray(get(responseData, propertyName))) {
returnData.push.apply(returnData, get(responseData, propertyName) as IDataObject[]);
} else {
returnData.push(get(responseData, propertyName) as IDataObject);
}
}
const limit = query.limit as number | undefined;
if (limit && limit <= returnData.length) {
return returnData;
}
} while (
get(responseData, [propertyName.split('.')[0], 'IsTruncated']) !== undefined &&
get(responseData, [propertyName.split('.')[0], 'IsTruncated']) !== 'false'
);
return returnData;
}