n8n/packages/nodes-base/nodes/Trello/AttachmentDescription.ts
Michael Kret 91d7e16c81
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
2022-08-17 17:50:24 +02:00

236 lines
4.6 KiB
TypeScript

import { INodeProperties } from 'n8n-workflow';
export const attachmentOperations: INodeProperties[] = [
// ----------------------------------
// attachment
// ----------------------------------
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['attachment'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new attachment for a card',
action: 'Create an attachment',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete an attachment',
action: 'Delete an attachment',
},
{
name: 'Get',
value: 'get',
description: 'Get the data of an attachment',
action: 'Get an attachment',
},
{
name: 'Get All',
value: 'getAll',
description: 'Returns all attachments for the card',
action: 'Get all attachments',
},
],
default: 'getAll',
},
];
export const attachmentFields: INodeProperties[] = [
// ----------------------------------
// attachment:create
// ----------------------------------
{
displayName: 'Card ID',
name: 'cardId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['create'],
resource: ['attachment'],
},
},
description: 'The ID of the card to add attachment to',
},
{
displayName: 'Source URL',
name: 'url',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['create'],
resource: ['attachment'],
},
},
description: 'The URL of the attachment to add',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: ['create'],
resource: ['attachment'],
},
},
default: {},
options: [
{
displayName: 'MIME Type',
name: 'mimeType',
type: 'string',
default: '',
placeholder: 'image/png',
description: 'The MIME type of the attachment to add',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'The name of the attachment to add',
},
],
},
// ----------------------------------
// attachment:delete
// ----------------------------------
{
displayName: 'Card ID',
name: 'cardId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['delete'],
resource: ['attachment'],
},
},
description: 'The ID of the card that attachment belongs to',
},
{
displayName: 'Attachment ID',
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['delete'],
resource: ['attachment'],
},
},
description: 'The ID of the attachment to delete',
},
// ----------------------------------
// attachment:getAll
// ----------------------------------
{
displayName: 'Card ID',
name: 'cardId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['getAll'],
resource: ['attachment'],
},
},
description: 'The ID of the card to get attachments',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: ['getAll'],
resource: ['attachment'],
},
},
default: {},
options: [
{
displayName: 'Fields',
name: 'fields',
type: 'string',
default: 'all',
description: 'Fields to return. Either "all" or a comma-separated list of fields.',
},
],
},
// ----------------------------------
// attachment:get
// ----------------------------------
{
displayName: 'Card ID',
name: 'cardId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['get'],
resource: ['attachment'],
},
},
description: 'The ID of the card to get attachment',
},
{
displayName: 'Attachment ID',
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['get'],
resource: ['attachment'],
},
},
description: 'The ID of the attachment to get',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: ['get'],
resource: ['attachment'],
},
},
default: {},
options: [
{
displayName: 'Fields',
name: 'fields',
type: 'string',
default: 'all',
description: 'Fields to return. Either "all" or a comma-separated list of fields.',
},
],
},
];