n8n/packages/nodes-base/nodes/Yourls/UrlDescription.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

141 lines
2.7 KiB
TypeScript

import {
INodeProperties,
} from 'n8n-workflow';
export const urlOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
'url',
],
},
},
options: [
{
name: 'Expand',
value: 'expand',
description: 'Expand a URL',
action: 'Expand a URL',
},
{
name: 'Shorten',
value: 'shorten',
description: 'Shorten a URL',
action: 'Shorten a URL',
},
{
name: 'Stats',
value: 'stats',
description: 'Get stats about one short URL',
action: 'Get stats for a URL',
},
],
default: 'shorten',
},
];
export const urlFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* url:shorten */
/* -------------------------------------------------------------------------- */
{
displayName: 'URL',
name: 'url',
type: 'string',
required: true,
displayOptions: {
show: {
resource: [
'url',
],
operation: [
'shorten',
],
},
},
default: '',
description: 'The URL to shorten',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'url',
],
operation: [
'shorten',
],
},
},
options: [
{
displayName: 'Keyword',
name: 'keyword',
type: 'string',
default: '',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'Title for custom short URLs',
},
],
},
/* -------------------------------------------------------------------------- */
/* url:expand */
/* -------------------------------------------------------------------------- */
{
displayName: 'Short URL',
name: 'shortUrl',
type: 'string',
required: true,
displayOptions: {
show: {
resource: [
'url',
],
operation: [
'expand',
],
},
},
default: '',
description: 'The short URL to expand',
},
/* -------------------------------------------------------------------------- */
/* url:stats */
/* -------------------------------------------------------------------------- */
{
displayName: 'Short URL',
name: 'shortUrl',
type: 'string',
required: true,
displayOptions: {
show: {
resource: [
'url',
],
operation: [
'stats',
],
},
},
default: '',
description: 'The short URL for which to get stats',
},
];