n8n/packages/nodes-base/nodes/LinkedIn/PostDescription.ts
Iván Ovejero 70ae90fa3c
refactor: Apply more eslint-plugin-n8n-nodes-base autofixable rules (#3432)
*  Update `lintfix` script

* 👕 Remove unneeded lint exceptions

* 👕 Run baseline `lintfix`

* 👕 Apply `node-param-description-miscased-url` (#3441)

* 👕 Apply `rule node-param-placeholder-miscased-id` (#3443)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-option-name-wrong-for-upsert` (#3446)

* 👕 Apply `node-param-min-value-wrong-for-limit` (#3442)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* Apply `node-param-display-name-wrong-for-dynamic-options` (#3454)

* 🔨 fix

*  Fix `Assigned To` fields

Co-authored-by: Michael Kret <michael.k@radency.com>

* 👕 Apply `rule node-param-default-wrong-for-number` (#3453)

* 👕 Apply `node-param-default-wrong-for-string` (#3452)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* Apply `node-param-display-name-miscased` (#3449)

* 🔨 fix

* 🔨 exceptions

*  review fixes

* 👕 Apply `node-param-description-lowercase-first-char` (#3451)

*  fix

*  review fixes

*  fix

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-description-wrong-for-dynamic-options` (#3456)

* Rule working as intended

* Add rule

* 🔥 Remove repetitions

* 👕 Add exceptions

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Small fix for `node-param-description-wrong-for-dynamic-options`

* 👕 Apply `node-param-default-wrong-for-fixed-collection` (#3460)

* 👕 Apply `node-param-description-line-break-html-tag` (#3462)

* 👕 Run baseline `lintfix`

* 👕 Apply `node-param-options-type-unsorted-items` (#3459)

*  fix

* 🔨 exceptions

* Add exception for Salesmate and Zoom

Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

*  Restore `lintfix` command

Co-authored-by: Omar Ajoue <krynble@gmail.com>
Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: brianinoa <54530642+brianinoa@users.noreply.github.com>
2022-06-03 19:23:49 +02:00

252 lines
4.5 KiB
TypeScript

import { INodeProperties } from 'n8n-workflow';
export const postOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
'post',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new post',
},
],
default: 'create',
},
];
export const postFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* post:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Post As',
name: 'postAs',
type: 'options',
default: '',
description: 'If to post on behalf of a user or an organization',
options: [
{
name: 'Person',
value: 'person',
},
{
name: 'Organization',
value: 'organization',
},
],
},
{
displayName: 'Person Name or ID',
name: 'person',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getPersonUrn',
},
default: '',
required: true,
description: 'Person as which the post should be posted as. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
displayOptions: {
show: {
operation: [
'create',
],
postAs: [
'person',
],
resource: [
'post',
],
},
},
},
{
displayName: 'Organization URN',
name: 'organization',
type: 'string',
default: '',
placeholder: '1234567',
description: 'URN of Organization as which the post should be posted as',
displayOptions: {
show: {
operation: [
'create',
],
postAs: [
'organization',
],
resource: [
'post',
],
},
},
},
{
displayName: 'Text',
name: 'text',
type: 'string',
default: '',
description: 'The primary content of the post',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'post',
],
},
},
},
{
displayName: 'Media Category',
name: 'shareMediaCategory',
type: 'options',
default: 'NONE',
options: [
{
name: 'None',
value: 'NONE',
description: 'The post does not contain any media, and will only consist of text',
},
{
name: 'Article',
value: 'ARTICLE',
description: 'The post contains an article URL',
},
{
name: 'Image',
value: 'IMAGE',
description: 'The post contains an image',
},
],
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'post',
],
},
},
},
{
displayName: 'Binary Property',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'post',
],
shareMediaCategory: [
'IMAGE',
],
},
},
name: 'binaryPropertyName',
type: 'string',
default: 'data',
description: 'Object property name which holds binary data',
required: true,
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'post',
],
},
},
options: [
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'Provide a short description for your image or article',
displayOptions: {
show: {
'/shareMediaCategory': [
'ARTICLE',
'IMAGE',
],
},
},
},
{
displayName: 'Original URL',
name: 'originalUrl',
type: 'string',
default: '',
description: 'Provide the URL of the article you would like to share here',
displayOptions: {
show: {
'/shareMediaCategory': [
'ARTICLE',
],
},
},
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'Customize the title of your image or article',
displayOptions: {
show: {
'/shareMediaCategory': [
'ARTICLE',
'IMAGE',
],
},
},
},
{
displayName: 'Visibility',
name: 'visibility',
type: 'options',
default: 'PUBLIC',
description: 'Dictate if post will be seen by the public or only connections',
displayOptions: {
show: {
'/postAs': [
'person',
],
},
},
options: [
{
name: 'Connections',
value: 'CONNECTIONS',
},
{
name: 'Public',
value: 'PUBLIC',
},
],
},
],
},
];