2022-08-01 13:47:55 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-04-15 15:42:37 -07:00
2021-12-03 00:44:16 -08:00
export const folderOperations : INodeProperties [ ] = [
2020-04-15 15:42:37 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-04-15 15:42:37 -07:00
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'folder' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a folder' ,
2022-07-10 13:50:51 -07:00
action : 'Create a folder' ,
2020-04-15 15:42:37 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a folder' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a folder' ,
2020-04-15 15:42:37 -07:00
} ,
{
name : 'Get All' ,
value : 'getAll' ,
description : 'Get all folders' ,
2022-07-10 13:50:51 -07:00
action : 'Get all folders' ,
2020-04-15 15:42:37 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-04-15 15:42:37 -07:00
2021-12-03 00:44:16 -08:00
export const folderFields : INodeProperties [ ] = [
2022-08-01 13:47:55 -07:00
/* -------------------------------------------------------------------------- */
/* folder:create */
/* -------------------------------------------------------------------------- */
2020-04-15 15:42:37 -07:00
{
displayName : 'Bucket Name' ,
name : 'bucketName' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'folder' ] ,
operation : [ 'create' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
} ,
{
displayName : 'Folder Name' ,
name : 'folderName' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'folder' ] ,
operation : [ 'create' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'folder' ] ,
operation : [ 'create' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Parent Folder Key' ,
name : 'parentFolderKey' ,
type : 'string' ,
default : '' ,
2020-10-22 06:46:03 -07:00
description : 'Parent folder you want to create the folder in' ,
2020-04-15 15:42:37 -07:00
} ,
{
displayName : 'Requester Pays' ,
name : 'requesterPays' ,
type : 'boolean' ,
default : false ,
2022-08-01 13:47:55 -07:00
description :
'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.' ,
2020-04-15 15:42:37 -07:00
} ,
{
displayName : 'Storage Class' ,
name : 'storageClass' ,
type : 'options' ,
options : [
{
name : 'Deep Archive' ,
value : 'deepArchive' ,
} ,
2022-06-03 10:23:49 -07:00
{
name : 'Glacier' ,
value : 'glacier' ,
} ,
2020-04-15 15:42:37 -07:00
{
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' ,
2022-05-06 14:01:25 -07:00
description : 'Amazon S3 storage classes' ,
2020-04-15 15:42:37 -07:00
} ,
] ,
} ,
2022-08-01 13:47:55 -07:00
/* -------------------------------------------------------------------------- */
/* folder:delete */
/* -------------------------------------------------------------------------- */
2020-04-15 15:42:37 -07:00
{
displayName : 'Bucket Name' ,
name : 'bucketName' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'folder' ] ,
operation : [ 'delete' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
} ,
{
displayName : 'Folder Key' ,
name : 'folderKey' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'folder' ] ,
operation : [ 'delete' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
} ,
2022-08-01 13:47:55 -07:00
/* -------------------------------------------------------------------------- */
/* folder:getAll */
/* -------------------------------------------------------------------------- */
2020-04-15 15:42:37 -07:00
{
displayName : 'Bucket Name' ,
name : 'bucketName' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'folder' ] ,
operation : [ 'getAll' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
operation : [ 'getAll' ] ,
resource : [ 'folder' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-04-15 15:42:37 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
operation : [ 'getAll' ] ,
resource : [ 'folder' ] ,
returnAll : [ false ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 500 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-04-15 15:42:37 -07:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'folder' ] ,
operation : [ 'getAll' ] ,
2020-04-15 15:42:37 -07:00
} ,
} ,
options : [
{
displayName : 'Fetch Owner' ,
name : 'fetchOwner' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-08-01 13:47:55 -07:00
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' ,
2020-04-15 15:42:37 -07:00
} ,
{
displayName : 'Folder Key' ,
name : 'folderKey' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;