n8n/packages/nodes-base/nodes/Wordpress/PostDescription.ts

827 lines
16 KiB
TypeScript
Raw Normal View History

2019-12-31 13:24:01 -08:00
import { INodeProperties } from 'n8n-workflow';
export const postOperations: INodeProperties[] = [
2019-12-31 13:24:01 -08:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'post',
],
},
},
options: [
{
name: 'Create',
value: 'create',
2020-01-02 14:34:48 -08:00
description: 'Create a post',
},
// {
// name: 'Delete',
// value: 'delete',
// description: 'Delete a post',
// },
2020-01-02 14:34:48 -08:00
{
name: 'Get',
value: 'get',
description: 'Get a post',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all posts',
},
{
name: 'Update',
value: 'update',
description: 'Update a post',
2019-12-31 13:24:01 -08:00
},
],
default: 'create',
description: 'The operation to perform.',
},
];
2019-12-31 13:24:01 -08:00
export const postFields: INodeProperties[] = [
2019-12-31 13:24:01 -08:00
/* -------------------------------------------------------------------------- */
/* post:create */
/* -------------------------------------------------------------------------- */
{
2020-01-01 07:58:27 -08:00
displayName: 'Title',
name: 'title',
2019-12-31 13:24:01 -08:00
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
2020-01-01 07:58:27 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
'create',
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-01 07:58:27 -08:00
description: 'The title for the post',
2019-12-31 13:24:01 -08:00
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
2020-01-01 07:58:27 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
'create',
],
},
},
options: [
{
displayName: 'Author ID',
name: 'authorId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
default: '',
description: 'The ID for the author of the object.',
},
2019-12-31 13:24:01 -08:00
{
2020-01-01 07:58:27 -08:00
displayName: 'Content',
name: 'content',
2019-12-31 13:24:01 -08:00
type: 'string',
2020-01-02 14:34:48 -08:00
typeOptions: {
alwaysOpenEditWindow: true,
},
2019-12-31 13:24:01 -08:00
default: '',
2020-01-01 07:58:27 -08:00
description: 'The content for the post',
2019-12-31 13:24:01 -08:00
},
2020-01-01 07:58:27 -08:00
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
description: 'An alphanumeric identifier for the object unique to its type.',
2019-12-31 13:24:01 -08:00
},
{
2020-01-01 07:58:27 -08:00
displayName: 'Password',
name: 'password',
type: 'string',
default: '',
description: 'A password to protect access to the content and excerpt.',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
2019-12-31 13:24:01 -08:00
{
name: 'Draft',
value: 'draft',
2019-12-31 13:24:01 -08:00
},
{
2020-01-01 07:58:27 -08:00
name: 'Future',
value: 'future',
2020-01-01 07:58:27 -08:00
},
{
name: 'Pending',
value: 'pending',
2020-01-01 07:58:27 -08:00
},
{
name: 'Private',
value: 'private',
},
{
name: 'Publish',
value: 'publish',
2019-12-31 13:24:01 -08:00
},
],
default: 'draft',
2020-01-01 07:58:27 -08:00
description: 'A named status for the post.',
},
{
2020-01-02 14:34:48 -08:00
displayName: 'Comment Status',
name: 'commentStatus',
2020-01-01 07:58:27 -08:00
type: 'options',
options: [
{
name: 'Open',
value: 'open',
2020-01-01 07:58:27 -08:00
},
{
name: 'Close',
value: 'closed',
2020-01-01 07:58:27 -08:00
},
2019-12-31 13:24:01 -08:00
],
default: 'open',
2020-01-01 07:58:27 -08:00
description: 'Whether or not comments are open on the post.',
},
{
displayName: 'Ping Status',
name: 'pingStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
2020-01-01 07:58:27 -08:00
},
{
name: 'Close',
value: 'closed',
2020-01-01 07:58:27 -08:00
},
2019-12-31 13:24:01 -08:00
],
default: 'open',
description: 'If the a message should be send to announce the post.',
2019-12-31 13:24:01 -08:00
},
2020-01-02 14:34:48 -08:00
{
displayName: 'Format',
name: 'format',
type: 'options',
options: [
{
name: 'Standard',
value: 'standard',
2020-01-02 14:34:48 -08:00
},
{
name: 'Aside',
value: 'aside',
2020-01-02 14:34:48 -08:00
},
{
name: 'Chat',
value: 'chat',
2020-01-02 14:34:48 -08:00
},
{
name: 'Gallery',
value: 'gallery',
2020-01-02 14:34:48 -08:00
},
{
name: 'Link',
value: 'link',
2020-01-02 14:34:48 -08:00
},
{
name: 'Image',
value: 'image',
2020-01-02 14:34:48 -08:00
},
{
name: 'Quote',
value: 'quote',
2020-01-02 14:34:48 -08:00
},
{
name: 'Status',
value: 'status',
2020-01-02 14:34:48 -08:00
},
{
name: 'Video',
value: 'video',
2020-01-02 14:34:48 -08:00
},
{
name: 'Audio',
value: 'audio',
2020-01-02 14:34:48 -08:00
},
],
default: 'standard',
2020-01-02 14:34:48 -08:00
description: 'Whether or not comments are open on the post.',
},
2020-01-01 07:58:27 -08:00
{
displayName: 'Sticky',
name: 'sticky',
type: 'boolean',
2020-01-02 14:34:48 -08:00
default: false,
2020-01-01 07:58:27 -08:00
description: 'Whether or not the object should be treated as sticky.',
},
{
displayName: 'Categories',
name: 'categories',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getCategories',
},
default: [],
description: 'The terms assigned to the object in the category taxonomy.',
},
2020-01-02 14:34:48 -08:00
{
displayName: 'Tags',
name: 'tags',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getTags',
},
default: [],
description: 'The terms assigned to the object in the post_tag taxonomy.',
},
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
/* -------------------------------------------------------------------------- */
2020-01-02 14:34:48 -08:00
/* post:update */
2019-12-31 13:24:01 -08:00
/* -------------------------------------------------------------------------- */
{
2020-01-02 14:34:48 -08:00
displayName: 'Post ID',
name: 'postId',
2019-12-31 13:24:01 -08:00
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'update',
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
description: 'Unique identifier for the object.',
2019-12-31 13:24:01 -08:00
},
{
2020-01-02 14:34:48 -08:00
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
2019-12-31 13:24:01 -08:00
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'update',
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
options: [
{
displayName: 'Author ID',
name: 'authorId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
default: '',
description: 'The ID for the author of the object.',
},
2020-01-02 14:34:48 -08:00
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'The title for the post',
},
{
displayName: 'Content',
name: 'content',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
description: 'The content for the post',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
description: 'An alphanumeric identifier for the object unique to its type.',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
default: '',
description: 'A password to protect access to the content and excerpt.',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Publish',
value: 'publish',
2020-01-02 14:34:48 -08:00
},
{
name: 'Future',
value: 'future',
2020-01-02 14:34:48 -08:00
},
{
name: 'Draft',
value: 'draft',
2020-01-02 14:34:48 -08:00
},
{
name: 'Pending',
value: 'pending',
2020-01-02 14:34:48 -08:00
},
{
name: 'Private',
value: 'private',
2020-01-02 14:34:48 -08:00
},
],
default: 'draft',
2020-01-02 14:34:48 -08:00
description: 'A named status for the post.',
},
{
displayName: 'Comment Status',
name: 'commentStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
2020-01-02 14:34:48 -08:00
},
{
name: 'Close',
value: 'closed',
2020-01-02 14:34:48 -08:00
},
],
default: 'open',
2020-01-02 14:34:48 -08:00
description: 'Whether or not comments are open on the post.',
},
{
displayName: 'Ping Status',
name: 'pingStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
2020-01-02 14:34:48 -08:00
},
{
name: 'Close',
value: 'closed',
2020-01-02 14:34:48 -08:00
},
],
default: 'open',
2020-01-02 14:34:48 -08:00
description: 'Whether or not comments are open on the post.',
},
{
displayName: 'Format',
name: 'format',
type: 'options',
options: [
{
name: 'Standard',
value: 'standard',
2020-01-02 14:34:48 -08:00
},
{
name: 'Aside',
value: 'aside',
2020-01-02 14:34:48 -08:00
},
{
name: 'Chat',
value: 'chat',
2020-01-02 14:34:48 -08:00
},
{
name: 'Gallery',
value: 'gallery',
2020-01-02 14:34:48 -08:00
},
{
name: 'Link',
value: 'link',
2020-01-02 14:34:48 -08:00
},
{
name: 'Image',
value: 'image',
2020-01-02 14:34:48 -08:00
},
{
name: 'Quote',
value: 'quote',
2020-01-02 14:34:48 -08:00
},
{
name: 'Status',
value: 'status',
2020-01-02 14:34:48 -08:00
},
{
name: 'Video',
value: 'video',
2020-01-02 14:34:48 -08:00
},
{
name: 'Audio',
value: 'audio',
2020-01-02 14:34:48 -08:00
},
],
default: 'standard',
description: 'The format of the post.',
2020-01-02 14:34:48 -08:00
},
{
displayName: 'Sticky',
name: 'sticky',
type: 'boolean',
default: false,
description: 'Whether or not the object should be treated as sticky.',
},
{
displayName: 'Categories',
name: 'categories',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getCategories',
},
default: [],
description: 'The terms assigned to the object in the category taxonomy.',
},
{
displayName: 'Tags',
name: 'tags',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getTags',
},
default: [],
description: 'The terms assigned to the object in the post_tag taxonomy.',
},
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
/* -------------------------------------------------------------------------- */
2020-01-02 14:34:48 -08:00
/* post:get */
2019-12-31 13:24:01 -08:00
/* -------------------------------------------------------------------------- */
{
2020-01-02 14:34:48 -08:00
displayName: 'Post ID',
name: 'postId',
2019-12-31 13:24:01 -08:00
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'get',
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
description: 'Unique identifier for the object.',
2019-12-31 13:24:01 -08:00
},
{
2020-01-02 14:34:48 -08:00
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
2019-12-31 13:24:01 -08:00
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'get',
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
options: [
{
displayName: 'Password',
name: 'password',
type: 'string',
default: '',
description: 'The password for the post if it is password protected.',
},
{
displayName: 'Context',
name: 'context',
type: 'options',
options: [
{
name: 'View',
value: 'view',
},
{
name: 'Embed',
value: 'embed',
},
{
name: 'Edit',
value: 'edit',
},
],
default: 'view',
description: 'Scope under which the request is made; determines fields present in response.',
},
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
/* -------------------------------------------------------------------------- */
2020-01-02 14:34:48 -08:00
/* post:getAll */
2019-12-31 13:24:01 -08:00
/* -------------------------------------------------------------------------- */
{
2020-01-02 14:34:48 -08:00
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
2019-12-31 13:24:01 -08:00
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'getAll',
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
default: false,
description: 'If all results should be returned or only up to a given limit.',
2019-12-31 13:24:01 -08:00
},
{
2020-01-02 14:34:48 -08:00
displayName: 'Limit',
name: 'limit',
type: 'number',
2019-12-31 13:24:01 -08:00
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'getAll',
],
returnAll: [
false,
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
typeOptions: {
minValue: 1,
maxValue: 10,
},
default: 5,
description: 'How many results to return.',
2019-12-31 13:24:01 -08:00
},
{
displayName: 'Options',
name: 'options',
2020-01-02 14:34:48 -08:00
type: 'collection',
placeholder: 'Add Option',
2020-01-02 14:34:48 -08:00
default: {},
2019-12-31 13:24:01 -08:00
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'getAll',
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
options: [
{
displayName: 'Context',
name: 'context',
type: 'options',
options: [
{
name: 'View',
value: 'view',
},
{
name: 'Embed',
value: 'embed',
},
{
name: 'Edit',
value: 'edit',
},
],
default: 'view',
2020-01-02 14:34:48 -08:00
description: 'Scope under which the request is made; determines fields present in response.',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'options',
options: [
{
name: 'Author',
value: 'author',
},
{
name: 'Date',
value: 'date',
},
{
name: 'ID',
value: 'id',
},
{
name: 'Include',
value: 'include',
},
{
name: 'Modified',
value: 'modified',
},
{
name: 'Parent',
value: 'parent',
},
{
name: 'Relevance',
value: 'relevance',
},
{
name: 'Slug',
value: 'slug',
},
{
name: 'Include Slugs',
2020-01-03 11:37:15 -08:00
value: 'include_slugs',
2020-01-02 14:34:48 -08:00
},
{
name: 'Title',
value: 'title',
},
],
default: 'id',
2020-01-02 14:34:48 -08:00
description: 'Sort collection by object attribute.',
},
{
displayName: 'Order',
name: 'order',
type: 'options',
options: [
{
name: 'ASC',
value: 'asc',
2020-01-02 14:34:48 -08:00
},
{
name: 'DESC',
value: 'desc',
2020-01-02 14:34:48 -08:00
},
],
default: 'desc',
description: 'Order sort attribute ascending or descending.',
},
{
displayName: 'Search',
name: 'search',
type: 'string',
default: '',
description: 'Limit results to those matching a string.',
},
{
displayName: 'After',
name: 'after',
type: 'dateTime',
default: '',
description: 'Limit response to posts published after a given ISO8601 compliant date.',
},
{
displayName: 'Before',
name: 'before',
type: 'dateTime',
default: '',
description: 'Limit response to posts published before a given ISO8601 compliant date.',
},
{
displayName: 'Author',
name: 'author',
type: 'multiOptions',
default: [],
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
description: 'Limit result set to posts assigned to specific authors.',
},
{
displayName: 'Categories',
name: 'categories',
type: 'multiOptions',
default: [],
typeOptions: {
loadOptionsMethod: 'getCategories',
},
description: 'Limit result set to all items that have the specified term assigned in the categories taxonomy.',
},
{
displayName: 'Exclude Categories',
name: 'excludedCategories',
type: 'multiOptions',
default: [],
typeOptions: {
loadOptionsMethod: 'getCategories',
},
description: 'Limit result set to all items except those that have the specified term assigned in the categories taxonomy.',
},
{
displayName: 'Tags',
name: 'tags',
type: 'multiOptions',
default: [],
typeOptions: {
loadOptionsMethod: 'getTags',
},
description: 'Limit result set to all items that have the specified term assigned in the tags taxonomy.',
},
{
displayName: 'Exclude Tags',
name: 'excludedTags',
type: 'multiOptions',
default: [],
typeOptions: {
loadOptionsMethod: 'getTags',
},
description: 'Limit result set to all items except those that have the specified term assigned in the tags taxonomy.',
},
{
displayName: 'Sticky',
name: 'sticky',
type: 'boolean',
default: false,
description: 'Limit result set to items that are sticky.',
},
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
/* -------------------------------------------------------------------------- */
2020-01-02 14:34:48 -08:00
/* post:delete */
2019-12-31 13:24:01 -08:00
/* -------------------------------------------------------------------------- */
{
2020-01-02 14:34:48 -08:00
displayName: 'Post ID',
name: 'postId',
2019-12-31 13:24:01 -08:00
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'delete',
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
description: 'Unique identifier for the object.',
2019-12-31 13:24:01 -08:00
},
{
2020-01-02 14:34:48 -08:00
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
2019-12-31 13:24:01 -08:00
displayOptions: {
show: {
resource: [
2020-01-02 14:34:48 -08:00
'post',
2019-12-31 13:24:01 -08:00
],
operation: [
2020-01-02 14:34:48 -08:00
'delete',
],
2019-12-31 13:24:01 -08:00
},
},
2020-01-02 14:34:48 -08:00
options: [
{
displayName: 'Force',
name: 'force',
type: 'boolean',
default: false,
description: 'Whether to bypass trash and force deletion.',
},
2020-10-22 06:46:03 -07:00
],
2019-12-31 13:24:01 -08:00
},
];