2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2020-01-24 04:28:05 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const attachmentOperations: INodeProperties[] = [
|
2020-01-24 04:28:05 -08:00
|
|
|
// ----------------------------------
|
|
|
|
// attachment
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-01-24 04:28:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a new attachment for a card',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create an attachment',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete an attachment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete an attachment',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
2020-07-09 05:33:05 -07:00
|
|
|
description: 'Get the data of an attachment',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get an attachment',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Returns all attachments for the card',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get all attachments',
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-01-24 04:28:05 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const attachmentFields: INodeProperties[] = [
|
2020-01-24 04:28:05 -08:00
|
|
|
// ----------------------------------
|
|
|
|
// attachment:create
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Card ID',
|
|
|
|
name: 'cardId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the card to add attachment to',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Source URL',
|
|
|
|
name: 'url',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The URL of the attachment to add',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'MIME Type',
|
|
|
|
name: 'mimeType',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'image/png',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The MIME type of the attachment to add',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The name of the attachment to add',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// attachment:delete
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Card ID',
|
|
|
|
name: 'cardId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['delete'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the card that attachment belongs to',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Attachment ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['delete'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the attachment to delete',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// attachment:getAll
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Card ID',
|
|
|
|
name: 'cardId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the card to get attachments',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
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: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['get'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the card to get attachment',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Attachment ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['get'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the attachment to get',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['get'],
|
|
|
|
resource: ['attachment'],
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Fields',
|
|
|
|
name: 'fields',
|
|
|
|
type: 'string',
|
|
|
|
default: 'all',
|
|
|
|
description: 'Fields to return. Either "all" or a comma-separated list of fields.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|