Files
n8n/packages/nodes-base/nodes/Trello/CardCommentDescription.ts
alighasami 3d5eaf9445
Some checks failed
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
first commit
2026-03-17 16:22:57 +03:30

170 lines
3.3 KiB
TypeScript

import type { INodeProperties } from 'n8n-workflow';
export const cardCommentOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['cardComment'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a comment on a card',
action: 'Create a card comment',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a comment from a card',
action: 'Delete a card comment',
},
{
name: 'Update',
value: 'update',
description: 'Update a comment on a card',
action: 'Update a card comment',
},
],
default: 'create',
},
];
export const cardCommentFields: INodeProperties[] = [
{
displayName: 'Card',
name: 'cardId',
type: 'resourceLocator',
default: { mode: 'list', value: '' },
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a Card...',
typeOptions: {
searchListMethod: 'searchCards',
searchFilterRequired: true,
searchable: true,
},
},
{
displayName: 'By URL',
name: 'url',
type: 'string',
placeholder: 'https://trello.com/c/e123456/card-name',
validation: [
{
type: 'regex',
properties: {
regex: 'http(s)?://trello.com/c/([a-zA-Z0-9]{2,})/.*',
errorMessage: 'Not a valid Trello Card URL',
},
},
],
extractValue: {
type: 'regex',
regex: 'https://trello.com/c/([a-zA-Z0-9]{2,})',
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
validation: [
{
type: 'regex',
properties: {
regex: '[a-zA-Z0-9]{2,}',
errorMessage: 'Not a valid Trello Card ID',
},
},
],
placeholder: 'wiIaGwqE',
url: '=https://trello.com/c/{{$value}}',
},
],
displayOptions: {
show: {
operation: ['update', 'delete', 'create'],
resource: ['cardComment'],
},
},
description: 'The ID of the card',
},
// ----------------------------------
// cardComment:create
// ----------------------------------
{
displayName: 'Text',
name: 'text',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['create'],
resource: ['cardComment'],
},
},
description: 'Text of the comment',
},
// ----------------------------------
// cardComment:remove
// ----------------------------------
{
displayName: 'Comment ID',
name: 'commentId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['delete'],
resource: ['cardComment'],
},
},
description: 'The ID of the comment to delete',
},
// ----------------------------------
// cardComment:update
// ----------------------------------
{
displayName: 'Comment ID',
name: 'commentId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['update'],
resource: ['cardComment'],
},
},
description: 'The ID of the comment to delete',
},
{
displayName: 'Text',
name: 'text',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['update'],
resource: ['cardComment'],
},
},
description: 'Text of the comment',
},
];