n8n/packages/nodes-base/nodes/Trello/AttachmentDescription.ts
Iván Ovejero 6f95121fac
refactor: Add action to all operations on all nodes (#3655)
* 👕 Add `action` to `INodePropertyOptions`

* 👕 Apply `node-param-operation-option-without-action`

* ✏️ Fix add/remove phrasing

* ✏️ Fix email template phrasing

* ✏️ Fix add/remove phrasing

* ✏️ Fix custom fields phrasing

* ✏️ Fix job report phrasing

* ✏️ Fix query phrasing

* ✏️ Various phrasing fixes

* ✏️ Fix final phrasings

* ✏️ Remove `conversation`

* ✏️ Fix plural
2022-07-10 23:50:51 +03:00

283 lines
4.9 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.',
},
],
},
];