mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
63b6c9f128
* ✏️ Alphabetize rules * 🔖 Update version * ⚡ Update lintfix command * ⚡ Run baseline lintfix * 📦 Update package-lock.json * 👕 Apply `node-param-description-untrimmed` (#3200) * Removing unneeded backticks (#3249) * 👕 Apply node-param-description-wrong-for-return-all (#3253) * 👕 Apply node-param-description-missing-limit (#3252) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-excess-final-period (#3250) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-unencoded-angle-brackets (#3256) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-url-missing-protocol (#3258) * 👕 Apply `node-param-description-miscased-id` (#3254) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-wrong-for-limit (#3257) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-wrong-for-ignore-ssl-issues (#3261) * 👕 Apply rule * ⚡ Restore lintfix script * ⚡ Restore lintfix script Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
232 lines
4.3 KiB
TypeScript
232 lines
4.3 KiB
TypeScript
import {
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export const postCommentOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
default: 'create',
|
|
description: 'Operation to perform',
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create a top-level comment in a post',
|
|
},
|
|
{
|
|
name: 'Get All',
|
|
value: 'getAll',
|
|
description: 'Retrieve all comments in a post',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Remove a comment from a post',
|
|
},
|
|
{
|
|
name: 'Reply',
|
|
value: 'reply',
|
|
description: 'Write a reply to a comment in a post',
|
|
},
|
|
],
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
];
|
|
|
|
export const postCommentFields: INodeProperties[] = [
|
|
// ----------------------------------
|
|
// postComment: create
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Post ID',
|
|
name: 'postId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'ID of the post to write the comment to. Found in the post URL: <code>/r/[subreddit_name]/comments/[post_id]/[post_title]</code>',
|
|
placeholder: 'l0me7x',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Comment Text',
|
|
name: 'commentText',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'Text of the comment. Markdown supported.',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------
|
|
// postComment: getAll
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Subreddit',
|
|
name: 'subreddit',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'The name of subreddit where the post is',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Post ID',
|
|
name: 'postId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'ID of the post to get all comments from. Found in the post URL: <code>/r/[subreddit_name]/comments/[post_id]/[post_title]</code>',
|
|
placeholder: 'l0me7x',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
default: 100,
|
|
description: 'Max number of results to return',
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 100,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
returnAll: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------
|
|
// postComment: delete
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Comment ID',
|
|
name: 'commentId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'ID of the comment to remove. Found in the comment URL:<code>/r/[subreddit_name]/comments/[post_id]/[post_title]/[comment_id]</code>',
|
|
placeholder: 'gla7fmt',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'delete',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------
|
|
// postComment: reply
|
|
// ----------------------------------
|
|
{
|
|
displayName: 'Comment ID',
|
|
name: 'commentId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'ID of the comment to reply to. To be found in the comment URL: <code>www.reddit.com/r/[subreddit_name]/comments/[post_id]/[post_title]/[comment_id]</code>',
|
|
placeholder: 'gl9iroa',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'reply',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Reply Text',
|
|
name: 'replyText',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
description: 'Text of the reply. Markdown supported.',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'postComment',
|
|
],
|
|
operation: [
|
|
'reply',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
];
|