first commit
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

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,76 @@
import type {
IExecuteFunctions,
ILoadOptionsFunctions,
IDataObject,
JsonObject,
IHttpRequestMethods,
IRequestOptions,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
export async function wordpressApiRequest(
this: IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
resource: string,
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
): Promise<any> {
const credentials = await this.getCredentials('wordpressApi');
let options: IRequestOptions = {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'User-Agent': 'n8n',
},
method,
qs,
body,
uri: uri || `${credentials.url}/wp-json/wp/v2${resource}`,
rejectUnauthorized: !credentials.allowUnauthorizedCerts,
json: true,
};
options = Object.assign({}, options, option);
if (Object.keys(options.body as IDataObject).length === 0) {
delete options.body;
}
try {
const credentialType = 'wordpressApi';
return await this.helpers.requestWithAuthentication.call(this, credentialType, options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
export async function wordpressApiRequestAllItems(
this: IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
endpoint: string,
body: any = {},
query: IDataObject = {},
): Promise<any> {
const returnData: IDataObject[] = [];
let responseData;
query.per_page = 10;
query.page = 0;
do {
query.page++;
responseData = await wordpressApiRequest.call(this, method, endpoint, body, query, undefined, {
resolveWithFullResponse: true,
});
returnData.push.apply(returnData, responseData.body as IDataObject[]);
} while (
responseData.headers['x-wp-totalpages'] !== undefined &&
responseData.headers['x-wp-totalpages'] !== '0' &&
parseInt(responseData.headers['x-wp-totalpages'] as string, 10) !== query.page
);
return returnData;
}
@@ -0,0 +1,817 @@
import type { INodeProperties } from 'n8n-workflow';
export const pageOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['page'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a page',
action: 'Create a page',
},
{
name: 'Get',
value: 'get',
description: 'Get a page',
action: 'Get a page',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many pages',
action: 'Get many pages',
},
{
name: 'Update',
value: 'update',
description: 'Update a page',
action: 'Update a page',
},
],
default: 'create',
},
];
export const pageFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* page:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Title',
name: 'title',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['page'],
operation: ['create'],
},
},
description: 'The title for the page',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['page'],
operation: ['create'],
},
},
options: [
{
displayName: 'Author Name or ID',
name: 'authorId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
default: '',
description:
'The ID for the author of the object. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Parent ID',
name: 'parent',
type: 'number',
default: '',
description: 'The ID for the parent of the post',
},
{
displayName: 'Content',
name: 'content',
type: 'string',
default: '',
description: 'The content for the page',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
description: 'An alphanumeric identifier for the object unique to its type',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: { password: true },
default: '',
description: 'A password to protect access to the content and excerpt',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Draft',
value: 'draft',
},
{
name: 'Future',
value: 'future',
},
{
name: 'Pending',
value: 'pending',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Publish',
value: 'publish',
},
],
default: 'draft',
description: 'A named status for the page',
},
{
displayName: 'Comment Status',
name: 'commentStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Close',
value: 'closed',
},
],
default: 'open',
description: 'Whether or not comments are open on the page',
},
{
displayName: 'Ping Status',
name: 'pingStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Close',
value: 'closed',
},
],
default: 'open',
description: 'If the a message should be send to announce the page',
},
{
displayName: 'Template',
name: 'pageTemplate',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: false,
},
options: [
{
displayName: 'Values',
name: 'values',
values: [
{
displayName: 'Elementor Template',
name: 'elementor',
type: 'boolean',
default: true,
description: 'Whether site uses elementor page builder',
},
{
displayName: 'Template',
name: 'template',
type: 'string',
default: '',
description: 'The theme file to use',
displayOptions: {
show: {
elementor: [false],
},
},
},
{
displayName: 'Template',
name: 'template',
type: 'options',
options: [
{
name: 'Standard',
value: '',
},
{
name: 'Elementor Canvas',
value: 'elementor_canvas',
},
{
name: 'Elementor Header Footer',
value: 'elementor_header_footer',
},
{
name: 'Elementor Theme',
value: 'elementor_theme',
},
],
default: '',
description: 'The Elementor template to use',
displayOptions: {
show: {
elementor: [true],
},
},
},
],
},
],
},
{
displayName: 'Menu Order',
name: 'menuOrder',
type: 'number',
default: 0,
description: 'The order of the page in relation to other pages',
},
{
displayName: 'Featured Media ID',
name: 'featuredMediaId',
type: 'number',
default: '',
description: 'The ID of the featured media for the page',
},
],
},
/* -------------------------------------------------------------------------- */
/* page:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Page ID',
name: 'pageId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['page'],
operation: ['update'],
},
},
description: 'Unique identifier for the object',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['page'],
operation: ['update'],
},
},
options: [
{
displayName: 'Author Name or ID',
name: 'authorId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
default: '',
description:
'The ID for the author of the object. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Parent ID',
name: 'parent',
type: 'number',
default: '',
description: 'The ID for the parent of the post',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'The title for the page',
},
{
displayName: 'Content',
name: 'content',
type: 'string',
default: '',
description: 'The content for the page',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
description: 'An alphanumeric identifier for the object unique to its type',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: { password: true },
default: '',
description: 'A password to protect access to the content and excerpt',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Draft',
value: 'draft',
},
{
name: 'Future',
value: 'future',
},
{
name: 'Pending',
value: 'pending',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Publish',
value: 'publish',
},
],
default: 'draft',
description: 'A named status for the page',
},
{
displayName: 'Comment Status',
name: 'commentStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Close',
value: 'closed',
},
],
default: 'open',
description: 'Whether or not comments are open on the page',
},
{
displayName: 'Ping Status',
name: 'pingStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Close',
value: 'closed',
},
],
default: 'open',
description: 'Whether or not comments are open on the page',
},
{
displayName: 'Template',
name: 'pageTemplate',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: false,
},
options: [
{
displayName: 'Values',
name: 'values',
values: [
{
displayName: 'Elementor Template',
name: 'elementor',
type: 'boolean',
default: true,
description: 'Whether site uses elementor page builder',
},
{
displayName: 'Template',
name: 'template',
type: 'string',
default: '',
description: 'The theme file to use',
displayOptions: {
show: {
elementor: [false],
},
},
},
{
displayName: 'Template',
name: 'template',
type: 'options',
options: [
{
name: 'Standard',
value: '',
},
{
name: 'Elementor Canvas',
value: 'elementor_canvas',
},
{
name: 'Elementor Header Footer',
value: 'elementor_header_footer',
},
{
name: 'Elementor Theme',
value: 'elementor_theme',
},
],
default: '',
description: 'The Elementor template to use',
displayOptions: {
show: {
elementor: [true],
},
},
},
],
},
],
},
{
displayName: 'Menu Order',
name: 'menuOrder',
type: 'number',
default: 0,
description: 'The order of the page in relation to other pages',
},
{
displayName: 'Comment Status',
name: 'commentStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Closed',
value: 'closed',
},
],
default: 'open',
description: 'Whether or not comments are open on the page',
},
{
displayName: 'Featured Media ID',
name: 'featuredMediaId',
type: 'number',
default: '',
description: 'The ID of the featured media for the page',
},
],
},
/* -------------------------------------------------------------------------- */
/* page:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Page ID',
name: 'pageId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['page'],
operation: ['get'],
},
},
description: 'Unique identifier for the object',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['page'],
operation: ['get'],
},
},
options: [
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: { password: true },
default: '',
description: 'The password for the page 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',
},
],
},
/* -------------------------------------------------------------------------- */
/* page:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['page'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['page'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 10,
},
default: 5,
description: 'Max number of results to return',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['page'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'After',
name: 'after',
type: 'dateTime',
default: '',
description: 'Limit response to pages published after a given ISO8601 compliant date',
},
{
displayName: 'Author Names or IDs',
name: 'author',
type: 'multiOptions',
default: [],
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
description:
'Limit result set to pages assigned to specific authors. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Before',
name: 'before',
type: 'dateTime',
default: '',
description: 'Limit response to pages published before a given ISO8601 compliant date',
},
{
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',
},
{
displayName: 'Menu Order',
name: 'menuOrder',
type: 'number',
default: 0,
description: 'Limit result set to items with a specific menu order value',
},
{
displayName: 'Order',
name: 'order',
type: 'options',
options: [
{
name: 'ASC',
value: 'asc',
},
{
name: 'DESC',
value: 'desc',
},
],
default: 'desc',
description: 'Order sort attribute ascending or descending',
},
{
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: 'Include Slugs',
value: 'include_slugs',
},
{
name: 'Modified',
value: 'modified',
},
{
name: 'Parent',
value: 'parent',
},
{
name: 'Relevance',
value: 'relevance',
},
{
name: 'Slug',
value: 'slug',
},
{
name: 'Title',
value: 'title',
},
],
default: 'id',
description: 'Sort collection by object attribute',
},
{
displayName: 'Page',
name: 'page',
type: 'number',
default: 1,
description: 'Current page of the collection',
},
{
displayName: 'Parent Page ID',
name: 'parent',
type: 'number',
default: '',
description: 'Limit result set to items with a particular parent page ID',
},
{
displayName: 'Search',
name: 'search',
type: 'string',
default: '',
description: 'Limit results to those matching a string',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Draft',
value: 'draft',
},
{
name: 'Future',
value: 'future',
},
{
name: 'Pending',
value: 'pending',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Publish',
value: 'publish',
},
],
default: 'publish',
description: 'The status of the page',
},
],
},
/* -------------------------------------------------------------------------- */
/* page:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Page ID',
name: 'pageId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['page'],
operation: ['delete'],
},
},
description: 'Unique identifier for the object',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['page'],
operation: ['delete'],
},
},
options: [
{
displayName: 'Force',
name: 'force',
type: 'boolean',
default: false,
description: 'Whether to bypass trash and force deletion',
},
],
},
];
@@ -0,0 +1,16 @@
export interface IPage {
author?: number;
comment_status?: string;
content?: string;
featured_media?: number;
id?: number;
menu_order?: number;
page?: number;
parent?: number;
password?: string;
ping_status?: string;
slug?: string;
status?: string;
template?: string;
title?: string;
}
@@ -0,0 +1,960 @@
import type { 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 post',
action: 'Create a post',
},
{
name: 'Get',
value: 'get',
description: 'Get a post',
action: 'Get a post',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many posts',
action: 'Get many posts',
},
{
name: 'Update',
value: 'update',
description: 'Update a post',
action: 'Update a post',
},
],
default: 'create',
},
];
export const postFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* post:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Title',
name: 'title',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
description: 'The title for the post',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
options: [
{
displayName: 'Author Name or ID',
name: 'authorId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
default: '',
description:
'The ID for the author of the object. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Content',
name: 'content',
type: 'string',
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',
typeOptions: { password: true },
default: '',
description: 'A password to protect access to the content and excerpt',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Draft',
value: 'draft',
},
{
name: 'Future',
value: 'future',
},
{
name: 'Pending',
value: 'pending',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Publish',
value: 'publish',
},
],
default: 'draft',
description: 'A named status for the post',
},
{
displayName: 'Date',
name: 'date',
type: 'dateTime',
default: '',
description: "The date the post was published, in the site's timezone",
},
{
displayName: 'Comment Status',
name: 'commentStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Close',
value: 'closed',
},
],
default: 'open',
description: 'Whether or not comments are open on the post',
},
{
displayName: 'Ping Status',
name: 'pingStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Close',
value: 'closed',
},
],
default: 'open',
description: 'If the a message should be send to announce the post',
},
{
displayName: 'Format',
name: 'format',
type: 'options',
options: [
{
name: 'Aside',
value: 'aside',
},
{
name: 'Audio',
value: 'audio',
},
{
name: 'Chat',
value: 'chat',
},
{
name: 'Gallery',
value: 'gallery',
},
{
name: 'Image',
value: 'image',
},
{
name: 'Link',
value: 'link',
},
{
name: 'Quote',
value: 'quote',
},
{
name: 'Standard',
value: 'standard',
},
{
name: 'Status',
value: 'status',
},
{
name: 'Video',
value: 'video',
},
],
default: 'standard',
description: 'Whether or not comments are open on the post',
},
{
displayName: 'Sticky',
name: 'sticky',
type: 'boolean',
default: false,
description: 'Whether or not the object should be treated as sticky',
},
{
displayName: 'Category Names or IDs',
name: 'categories',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getCategories',
},
default: [],
description:
'The terms assigned to the object in the category taxonomy. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Tag Names or IDs',
name: 'tags',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getTags',
},
default: [],
description:
'The terms assigned to the object in the post_tag taxonomy. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Template',
name: 'postTemplate',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: false,
},
options: [
{
displayName: 'Values',
name: 'values',
values: [
{
displayName: 'Elementor Template',
name: 'elementor',
type: 'boolean',
default: true,
description: 'Whether site uses elementor page builder',
},
{
displayName: 'Template',
name: 'template',
type: 'string',
default: '',
description: 'The theme file to use',
displayOptions: {
show: {
elementor: [false],
},
},
},
{
displayName: 'Template',
name: 'template',
type: 'options',
options: [
{
name: 'Standard',
value: '',
},
{
name: 'Elementor Canvas',
value: 'elementor_canvas',
},
{
name: 'Elementor Header Footer',
value: 'elementor_header_footer',
},
{
name: 'Elementor Theme',
value: 'elementor_theme',
},
],
default: '',
description: 'The Elementor template to use',
displayOptions: {
show: {
elementor: [true],
},
},
},
],
},
],
},
],
},
/* -------------------------------------------------------------------------- */
/* post:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Post ID',
name: 'postId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['post'],
operation: ['update'],
},
},
description: 'Unique identifier for the object',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['post'],
operation: ['update'],
},
},
options: [
{
displayName: 'Author Name or ID',
name: 'authorId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
default: '',
description:
'The ID for the author of the object. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'The title for the post',
},
{
displayName: 'Content',
name: 'content',
type: 'string',
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',
typeOptions: { password: true },
default: '',
description: 'A password to protect access to the content and excerpt',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Draft',
value: 'draft',
},
{
name: 'Future',
value: 'future',
},
{
name: 'Pending',
value: 'pending',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Publish',
value: 'publish',
},
],
default: 'draft',
description: 'A named status for the post',
},
{
displayName: 'Date',
name: 'date',
type: 'dateTime',
default: '',
description: "The date the post was published, in the site's timezone",
},
{
displayName: 'Comment Status',
name: 'commentStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Close',
value: 'closed',
},
],
default: 'open',
description: 'Whether or not comments are open on the post',
},
{
displayName: 'Ping Status',
name: 'pingStatus',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Close',
value: 'closed',
},
],
default: 'open',
description: 'Whether or not comments are open on the post',
},
{
displayName: 'Format',
name: 'format',
type: 'options',
options: [
{
name: 'Aside',
value: 'aside',
},
{
name: 'Audio',
value: 'audio',
},
{
name: 'Chat',
value: 'chat',
},
{
name: 'Gallery',
value: 'gallery',
},
{
name: 'Image',
value: 'image',
},
{
name: 'Link',
value: 'link',
},
{
name: 'Quote',
value: 'quote',
},
{
name: 'Standard',
value: 'standard',
},
{
name: 'Status',
value: 'status',
},
{
name: 'Video',
value: 'video',
},
],
default: 'standard',
description: 'The format of the post',
},
{
displayName: 'Sticky',
name: 'sticky',
type: 'boolean',
default: false,
description: 'Whether or not the object should be treated as sticky',
},
{
displayName: 'Category Names or IDs',
name: 'categories',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getCategories',
},
default: [],
description:
'The terms assigned to the object in the category taxonomy. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Tag Names or IDs',
name: 'tags',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getTags',
},
default: [],
description:
'The terms assigned to the object in the post_tag taxonomy. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Template',
name: 'postTemplate',
type: 'fixedCollection',
default: {},
typeOptions: {
multipleValues: false,
},
options: [
{
displayName: 'Values',
name: 'values',
values: [
{
displayName: 'Elementor Template',
name: 'elementor',
type: 'boolean',
default: true,
description: 'Whether site uses elementor page builder',
},
{
displayName: 'Template',
name: 'template',
type: 'string',
default: '',
description: 'The theme file to use',
displayOptions: {
show: {
elementor: [false],
},
},
},
{
displayName: 'Template',
name: 'template',
type: 'options',
options: [
{
name: 'Standard',
value: '',
},
{
name: 'Elementor Canvas',
value: 'elementor_canvas',
},
{
name: 'Elementor Header Footer',
value: 'elementor_header_footer',
},
{
name: 'Elementor Theme',
value: 'elementor_theme',
},
],
default: '',
description: 'The Elementor template to use',
displayOptions: {
show: {
elementor: [true],
},
},
},
],
},
],
},
],
},
/* -------------------------------------------------------------------------- */
/* post:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Post ID',
name: 'postId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['post'],
operation: ['get'],
},
},
description: 'Unique identifier for the object',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['post'],
operation: ['get'],
},
},
options: [
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: { password: true },
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',
},
],
},
/* -------------------------------------------------------------------------- */
/* post:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['post'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['post'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 10,
},
default: 5,
description: 'Max number of results to return',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['post'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'After',
name: 'after',
type: 'dateTime',
default: '',
description: 'Limit response to posts published after a given ISO8601 compliant date',
},
{
displayName: 'Author Names or IDs',
name: 'author',
type: 'multiOptions',
default: [],
typeOptions: {
loadOptionsMethod: 'getAuthors',
},
description:
'Limit result set to posts assigned to specific authors. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Before',
name: 'before',
type: 'dateTime',
default: '',
description: 'Limit response to posts published before a given ISO8601 compliant date',
},
{
displayName: 'Category Names or IDs',
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. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
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',
},
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options
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. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options
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. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Order',
name: 'order',
type: 'options',
options: [
{
name: 'ASC',
value: 'asc',
},
{
name: 'DESC',
value: 'desc',
},
],
default: 'desc',
description: 'Order sort attribute ascending or descending',
},
{
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: 'Include Slugs',
value: 'include_slugs',
},
{
name: 'Modified',
value: 'modified',
},
{
name: 'Parent',
value: 'parent',
},
{
name: 'Relevance',
value: 'relevance',
},
{
name: 'Slug',
value: 'slug',
},
{
name: 'Title',
value: 'title',
},
],
default: 'id',
description: 'Sort collection by object attribute',
},
{
displayName: 'Search',
name: 'search',
type: 'string',
default: '',
description: 'Limit results to those matching a string',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Draft',
value: 'draft',
},
{
name: 'Future',
value: 'future',
},
{
name: 'Pending',
value: 'pending',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Publish',
value: 'publish',
},
],
default: 'publish',
description: 'The status of the post',
},
{
displayName: 'Sticky',
name: 'sticky',
type: 'boolean',
default: false,
description: 'Whether to limit the result set to items that are sticky',
},
{
displayName: 'Tag Names or IDs',
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. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
],
},
/* -------------------------------------------------------------------------- */
/* post:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Post ID',
name: 'postId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['post'],
operation: ['delete'],
},
},
description: 'Unique identifier for the object',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['post'],
operation: ['delete'],
},
},
options: [
{
displayName: 'Force',
name: 'force',
type: 'boolean',
default: false,
description: 'Whether to bypass trash and force deletion',
},
],
},
];
@@ -0,0 +1,17 @@
export interface IPost {
date?: string;
author?: number;
id?: number;
title?: string;
content?: string;
slug?: string;
password?: string;
status?: string;
comment_status?: string;
ping_status?: string;
format?: string;
sticky?: boolean;
template?: string;
categories?: number[];
tags?: number[];
}
@@ -0,0 +1,499 @@
import type { INodeProperties } from 'n8n-workflow';
export const userOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['user'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a user',
action: 'Create a user',
},
{
name: 'Get',
value: 'get',
description: 'Get a user',
action: 'Get a user',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many users',
action: 'Get many users',
},
{
name: 'Update',
value: 'update',
description: 'Update a user',
action: 'Update a user',
},
],
default: 'create',
},
];
export const userFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* user:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Username',
name: 'username',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['create'],
},
},
description: 'Login name for the user',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['create'],
},
},
description: 'Display name for the user',
},
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['create'],
},
},
description: 'First name for the user',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['create'],
},
},
description: 'Last name for the user',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
placeholder: 'name@email.com',
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['create'],
},
},
description: 'The email address for the user',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['create'],
},
},
description: 'Password for the user (never included)',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['user'],
operation: ['create'],
},
},
options: [
{
displayName: 'URL',
name: 'url',
type: 'string',
default: '',
description: 'URL of the user',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'Description of the user',
},
{
displayName: 'Nickname',
name: 'nickname',
type: 'string',
default: '',
description: 'The nickname for the user',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
description: 'An alphanumeric identifier for the user',
},
],
},
/* -------------------------------------------------------------------------- */
/* user:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'User ID',
name: 'userId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['update'],
},
},
description: 'Unique identifier for the user',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['user'],
operation: ['update'],
},
},
options: [
{
displayName: 'Username',
name: 'username',
type: 'string',
default: '',
description: 'Login name for the user',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'Display name for the user',
},
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
default: '',
description: 'First name for the user',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
default: '',
description: 'Last name for the user',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
placeholder: 'name@email.com',
default: '',
description: 'The email address for the user',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: { password: true },
default: '',
description: 'Password for the user (never included)',
},
{
displayName: 'URL',
name: 'url',
type: 'string',
default: '',
description: 'URL of the user',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'Description of the user',
},
{
displayName: 'Nickname',
name: 'nickname',
type: 'string',
default: '',
description: 'The nickname for the user',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
description: 'An alphanumeric identifier for the user',
},
],
},
/* -------------------------------------------------------------------------- */
/* user:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'User ID',
name: 'userId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['get'],
},
},
description: 'Unique identifier for the user',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['user'],
operation: ['get'],
},
},
options: [
{
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',
},
],
},
/* -------------------------------------------------------------------------- */
/* user:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['user'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['user'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 10,
},
default: 5,
description: 'Max number of results to return',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
displayOptions: {
show: {
resource: ['user'],
operation: ['getAll'],
},
},
options: [
{
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',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'options',
options: [
{
name: 'Email',
value: 'email',
},
{
name: 'ID',
value: 'id',
},
{
name: 'Include',
value: 'include',
},
{
name: 'Include Slugs',
value: 'include_slugs',
},
{
name: 'Name',
value: 'name',
},
{
name: 'Registered Date',
value: 'registered_date',
},
{
name: 'Slug',
value: 'slug',
},
{
name: 'URL',
value: 'url',
},
],
default: 'id',
description: 'Sort collection by object attribute',
},
{
displayName: 'Order',
name: 'order',
type: 'options',
options: [
{
name: 'ASC',
value: 'asc',
},
{
name: 'DESC',
value: 'desc',
},
],
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: 'Who',
name: 'who',
type: 'options',
options: [
{
name: 'Authors',
value: 'authors',
},
],
default: 'authors',
description: 'Limit result set to users who are considered authors',
},
],
},
/* -------------------------------------------------------------------------- */
/* user:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Reassign',
name: 'reassign',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['user'],
operation: ['delete'],
},
},
description: "Reassign the deleted user's posts and links to this user ID",
},
];
@@ -0,0 +1,13 @@
export interface IUser {
id?: number;
username?: string;
name?: string;
first_name?: string;
nickname?: string;
slug?: string;
last_name?: string;
email?: string;
url?: string;
description?: string;
password?: string;
}
@@ -0,0 +1,18 @@
{
"node": "n8n-nodes-base.wordpress",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Marketing"],
"resources": {
"credentialDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/credentials/wordpress/"
}
],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.wordpress/"
}
]
}
}
@@ -0,0 +1,625 @@
import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { NodeConnectionTypes } from 'n8n-workflow';
import { wordpressApiRequest, wordpressApiRequestAllItems } from './GenericFunctions';
import { pageFields, pageOperations } from './PageDescription';
import type { IPage } from './PageInterface';
import { postFields, postOperations } from './PostDescription';
import type { IPost } from './PostInterface';
import { userFields, userOperations } from './UserDescription';
import type { IUser } from './UserInterface';
export class Wordpress implements INodeType {
description: INodeTypeDescription = {
displayName: 'Wordpress',
name: 'wordpress',
icon: 'file:wordpress.svg',
group: ['output'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Wordpress API',
defaults: {
name: 'Wordpress',
},
usableAsTool: true,
inputs: [NodeConnectionTypes.Main],
outputs: [NodeConnectionTypes.Main],
credentials: [
{
name: 'wordpressApi',
required: true,
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Post',
value: 'post',
},
{
name: 'Page',
value: 'page',
},
{
name: 'User',
value: 'user',
},
],
default: 'post',
},
...postOperations,
...postFields,
...pageOperations,
...pageFields,
...userOperations,
...userFields,
],
};
methods = {
loadOptions: {
// Get all the available categories to display them to user so that they can
// select them easily
async getCategories(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const categories = await wordpressApiRequestAllItems.call(this, 'GET', '/categories', {});
for (const category of categories) {
const categoryName = category.name;
const categoryId = category.id;
returnData.push({
name: categoryName,
value: categoryId,
});
}
return returnData;
},
// Get all the available tags to display them to user so that they can
// select them easily
async getTags(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const tags = await wordpressApiRequestAllItems.call(this, 'GET', '/tags', {});
for (const tag of tags) {
const tagName = tag.name;
const tagId = tag.id;
returnData.push({
name: tagName,
value: tagId,
});
}
return returnData;
},
// Get all the available authors to display them to user so that they can
// select them easily
async getAuthors(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const authors = await wordpressApiRequestAllItems.call(
this,
'GET',
'/users',
{},
{ who: 'authors' },
);
for (const author of authors) {
const authorName = author.name;
const authorId = author.id;
returnData.push({
name: authorName,
value: authorId,
});
}
return returnData;
},
},
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
const length = items.length;
let responseData;
const qs: IDataObject = {};
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
for (let i = 0; i < length; i++) {
try {
if (resource === 'post') {
//https://developer.wordpress.org/rest-api/reference/posts/#create-a-post
if (operation === 'create') {
const title = this.getNodeParameter('title', i) as string;
const additionalFields = this.getNodeParameter('additionalFields', i);
const body: IPost = {
title,
};
if (additionalFields.authorId) {
body.author = additionalFields.authorId as number;
}
if (additionalFields.content) {
body.content = additionalFields.content as string;
}
if (additionalFields.slug) {
body.slug = additionalFields.slug as string;
}
if (additionalFields.password) {
body.password = additionalFields.password as string;
}
if (additionalFields.status) {
body.status = additionalFields.status as string;
}
if (additionalFields.commentStatus) {
body.comment_status = additionalFields.commentStatus as string;
}
if (additionalFields.pingStatus) {
body.ping_status = additionalFields.pingStatus as string;
}
if (additionalFields.sticky) {
body.sticky = additionalFields.sticky as boolean;
}
if (additionalFields.postTemplate) {
body.template = this.getNodeParameter(
'additionalFields.postTemplate.values.template',
i,
'',
) as string;
}
if (additionalFields.categories) {
body.categories = additionalFields.categories as number[];
}
if (additionalFields.tags) {
body.tags = additionalFields.tags as number[];
}
if (additionalFields.format) {
body.format = additionalFields.format as string;
}
if (additionalFields.date) {
body.date = additionalFields.date as string;
}
responseData = await wordpressApiRequest.call(this, 'POST', '/posts', body);
}
//https://developer.wordpress.org/rest-api/reference/posts/#update-a-post
if (operation === 'update') {
const postId = this.getNodeParameter('postId', i) as string;
const updateFields = this.getNodeParameter('updateFields', i);
const body: IPost = {
id: parseInt(postId, 10),
};
if (updateFields.authorId) {
body.author = updateFields.authorId as number;
}
if (updateFields.title) {
body.title = updateFields.title as string;
}
if (updateFields.content) {
body.content = updateFields.content as string;
}
if (updateFields.slug) {
body.slug = updateFields.slug as string;
}
if (updateFields.password) {
body.password = updateFields.password as string;
}
if (updateFields.status) {
body.status = updateFields.status as string;
}
if (updateFields.commentStatus) {
body.comment_status = updateFields.commentStatus as string;
}
if (updateFields.pingStatus) {
body.ping_status = updateFields.pingStatus as string;
}
if (updateFields.sticky) {
body.sticky = updateFields.sticky as boolean;
}
if (updateFields.postTemplate) {
body.template = this.getNodeParameter(
'updateFields.postTemplate.values.template',
i,
'',
) as string;
}
if (updateFields.categories) {
body.categories = updateFields.categories as number[];
}
if (updateFields.tags) {
body.tags = updateFields.tags as number[];
}
if (updateFields.format) {
body.format = updateFields.format as string;
}
if (updateFields.date) {
body.date = updateFields.date as string;
}
responseData = await wordpressApiRequest.call(this, 'POST', `/posts/${postId}`, body);
}
//https://developer.wordpress.org/rest-api/reference/posts/#retrieve-a-post
if (operation === 'get') {
const postId = this.getNodeParameter('postId', i) as string;
const options = this.getNodeParameter('options', i);
if (options.password) {
qs.password = options.password as string;
}
if (options.context) {
qs.context = options.context as string;
}
responseData = await wordpressApiRequest.call(this, 'GET', `/posts/${postId}`, {}, qs);
}
//https://developer.wordpress.org/rest-api/reference/posts/#list-posts
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i);
const options = this.getNodeParameter('options', i);
if (options.context) {
qs.context = options.context as string;
}
if (options.orderBy) {
qs.orderby = options.orderBy as string;
}
if (options.order) {
qs.order = options.order as string;
}
if (options.search) {
qs.search = options.search as string;
}
if (options.before) {
qs.before = options.before as string;
}
if (options.after) {
qs.after = options.after as string;
}
if (options.author) {
qs.author = options.author as number[];
}
if (options.categories) {
qs.categories = options.categories as number[];
}
if (options.excludedCategories) {
qs.categories_exclude = options.excludedCategories as number[];
}
if (options.tags) {
qs.tags = options.tags as number[];
}
if (options.excludedTags) {
qs.tags_exclude = options.excludedTags as number[];
}
if (options.sticky) {
qs.sticky = options.sticky as boolean;
}
if (options.status) {
qs.status = options.status as string;
}
if (returnAll) {
responseData = await wordpressApiRequestAllItems.call(this, 'GET', '/posts', {}, qs);
} else {
qs.per_page = this.getNodeParameter('limit', i);
responseData = await wordpressApiRequest.call(this, 'GET', '/posts', {}, qs);
}
}
//https://developer.wordpress.org/rest-api/reference/posts/#delete-a-post
if (operation === 'delete') {
const postId = this.getNodeParameter('postId', i) as string;
const options = this.getNodeParameter('options', i);
if (options.force) {
qs.force = options.force as boolean;
}
responseData = await wordpressApiRequest.call(
this,
'DELETE',
`/posts/${postId}`,
{},
qs,
);
}
}
if (resource === 'page') {
//https://developer.wordpress.org/rest-api/reference/pages/#create-a-page
if (operation === 'create') {
const title = this.getNodeParameter('title', i) as string;
const additionalFields = this.getNodeParameter('additionalFields', i);
const body: IPage = {
title,
};
if (additionalFields.authorId) {
body.author = additionalFields.authorId as number;
}
if (additionalFields.content) {
body.content = additionalFields.content as string;
}
if (additionalFields.slug) {
body.slug = additionalFields.slug as string;
}
if (additionalFields.password) {
body.password = additionalFields.password as string;
}
if (additionalFields.status) {
body.status = additionalFields.status as string;
}
if (additionalFields.commentStatus) {
body.comment_status = additionalFields.commentStatus as string;
}
if (additionalFields.pingStatus) {
body.ping_status = additionalFields.pingStatus as string;
}
if (additionalFields.pageTemplate) {
body.template = this.getNodeParameter(
'additionalFields.pageTemplate.values.template',
i,
'',
) as string;
}
if (additionalFields.menuOrder) {
body.menu_order = additionalFields.menuOrder as number;
}
if (additionalFields.parent) {
body.parent = additionalFields.parent as number;
}
if (additionalFields.featuredMediaId) {
body.featured_media = additionalFields.featuredMediaId as number;
}
responseData = await wordpressApiRequest.call(this, 'POST', '/pages', body);
}
//https://developer.wordpress.org/rest-api/reference/pages/#update-a-page
if (operation === 'update') {
const pageId = this.getNodeParameter('pageId', i) as string;
const updateFields = this.getNodeParameter('updateFields', i);
const body: IPage = {
id: parseInt(pageId, 10),
};
if (updateFields.authorId) {
body.author = updateFields.authorId as number;
}
if (updateFields.title) {
body.title = updateFields.title as string;
}
if (updateFields.content) {
body.content = updateFields.content as string;
}
if (updateFields.slug) {
body.slug = updateFields.slug as string;
}
if (updateFields.password) {
body.password = updateFields.password as string;
}
if (updateFields.status) {
body.status = updateFields.status as string;
}
if (updateFields.commentStatus) {
body.comment_status = updateFields.commentStatus as string;
}
if (updateFields.pingStatus) {
body.ping_status = updateFields.pingStatus as string;
}
if (updateFields.pageTemplate) {
body.template = this.getNodeParameter(
'updateFields.pageTemplate.values.template',
i,
'',
) as string;
}
if (updateFields.menuOrder) {
body.menu_order = updateFields.menuOrder as number;
}
if (updateFields.parent) {
body.parent = updateFields.parent as number;
}
if (updateFields.featuredMediaId) {
body.featured_media = updateFields.featuredMediaId as number;
}
responseData = await wordpressApiRequest.call(this, 'POST', `/pages/${pageId}`, body);
}
//https://developer.wordpress.org/rest-api/reference/pages/#retrieve-a-page
if (operation === 'get') {
const pageId = this.getNodeParameter('pageId', i) as string;
const options = this.getNodeParameter('options', i);
if (options.password) {
qs.password = options.password as string;
}
if (options.context) {
qs.context = options.context as string;
}
responseData = await wordpressApiRequest.call(this, 'GET', `/pages/${pageId}`, {}, qs);
}
//https://developer.wordpress.org/rest-api/reference/pages/#list-pages
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i);
const options = this.getNodeParameter('options', i);
if (options.context) {
qs.context = options.context as string;
}
if (options.orderBy) {
qs.orderby = options.orderBy as string;
}
if (options.order) {
qs.order = options.order as string;
}
if (options.search) {
qs.search = options.search as string;
}
if (options.before) {
qs.before = options.before as string;
}
if (options.after) {
qs.after = options.after as string;
}
if (options.author) {
qs.author = options.author as number[];
}
if (options.parent) {
qs.parent = options.parent as number;
}
if (options.menuOrder) {
qs.menu_order = options.menuOrder as number;
}
if (options.status) {
qs.status = options.status as string;
}
if (options.page) {
qs.page = options.page as number;
}
if (returnAll) {
responseData = await wordpressApiRequestAllItems.call(this, 'GET', '/pages', {}, qs);
} else {
qs.per_page = this.getNodeParameter('limit', i);
responseData = await wordpressApiRequest.call(this, 'GET', '/pages', {}, qs);
}
}
//https://developer.wordpress.org/rest-api/reference/pages/#delete-a-page
if (operation === 'delete') {
const pageId = this.getNodeParameter('pageId', i) as string;
const options = this.getNodeParameter('options', i);
if (options.force) {
qs.force = options.force as boolean;
}
responseData = await wordpressApiRequest.call(
this,
'DELETE',
`/pages/${pageId}`,
{},
qs,
);
}
}
if (resource === 'user') {
//https://developer.wordpress.org/rest-api/reference/users/#create-a-user
if (operation === 'create') {
const name = this.getNodeParameter('name', i) as string;
const username = this.getNodeParameter('username', i) as string;
const firstName = this.getNodeParameter('firstName', i) as string;
const lastName = this.getNodeParameter('lastName', i) as string;
const email = this.getNodeParameter('email', i) as string;
const password = this.getNodeParameter('password', i) as string;
const additionalFields = this.getNodeParameter('additionalFields', i);
const body: IUser = {
name,
username,
first_name: firstName,
last_name: lastName,
email,
password,
};
if (additionalFields.url) {
body.url = additionalFields.url as string;
}
if (additionalFields.description) {
body.description = additionalFields.description as string;
}
if (additionalFields.nickname) {
body.nickname = additionalFields.nickname as string;
}
if (additionalFields.slug) {
body.slug = additionalFields.slug as string;
}
responseData = await wordpressApiRequest.call(this, 'POST', '/users', body);
}
//https://developer.wordpress.org/rest-api/reference/users/#update-a-user
if (operation === 'update') {
const userId = this.getNodeParameter('userId', i) as number;
const updateFields = this.getNodeParameter('updateFields', i);
const body: IUser = {
id: userId,
};
if (updateFields.name) {
body.name = updateFields.name as string;
}
if (updateFields.firstName) {
body.first_name = updateFields.firstName as string;
}
if (updateFields.lastName) {
body.last_name = updateFields.lastName as string;
}
if (updateFields.email) {
body.email = updateFields.email as string;
}
if (updateFields.password) {
body.password = updateFields.password as string;
}
if (updateFields.username) {
body.username = updateFields.username as string;
}
if (updateFields.url) {
body.url = updateFields.url as string;
}
if (updateFields.description) {
body.description = updateFields.description as string;
}
if (updateFields.nickname) {
body.nickname = updateFields.nickname as string;
}
if (updateFields.slug) {
body.slug = updateFields.slug as string;
}
responseData = await wordpressApiRequest.call(this, 'POST', `/users/${userId}`, body);
}
//https://developer.wordpress.org/rest-api/reference/users/#retrieve-a-user
if (operation === 'get') {
const userId = this.getNodeParameter('userId', i) as string;
const options = this.getNodeParameter('options', i);
if (options.context) {
qs.context = options.context as string;
}
responseData = await wordpressApiRequest.call(this, 'GET', `/users/${userId}`, {}, qs);
}
//https://developer.wordpress.org/rest-api/reference/users/#list-users
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i);
const options = this.getNodeParameter('options', i);
if (options.context) {
qs.context = options.context as string;
}
if (options.orderBy) {
qs.orderby = options.orderBy as string;
}
if (options.order) {
qs.order = options.order as string;
}
if (options.search) {
qs.search = options.search as string;
}
if (options.who) {
qs.who = options.who as string;
}
if (returnAll) {
responseData = await wordpressApiRequestAllItems.call(this, 'GET', '/users', {}, qs);
} else {
qs.per_page = this.getNodeParameter('limit', i);
responseData = await wordpressApiRequest.call(this, 'GET', '/users', {}, qs);
}
}
//https://developer.wordpress.org/rest-api/reference/users/#delete-a-user
if (operation === 'delete') {
const reassign = this.getNodeParameter('reassign', i) as string;
qs.reassign = reassign;
qs.force = true;
responseData = await wordpressApiRequest.call(this, 'DELETE', '/users/me', {}, qs);
}
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData as IDataObject[]),
{ itemData: { item: i } },
);
returnData.push(...executionData);
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ json: { error: error.message } });
continue;
}
throw error;
}
}
return [returnData];
}
}
@@ -0,0 +1,273 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"about": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"replies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"version-history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"href": {
"type": "string"
}
}
}
},
"wp:action-assign-author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-publish": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-unfiltered-html": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:attachment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
}
}
},
"author": {
"type": "integer"
},
"comment_status": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"block_version": {
"type": "integer"
},
"protected": {
"type": "boolean"
},
"raw": {
"type": "string"
}
}
},
"date": {
"type": "string"
},
"date_gmt": {
"type": "string"
},
"excerpt": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"featured_media": {
"type": "integer"
},
"generated_slug": {
"type": "string"
},
"guid": {
"type": "object",
"properties": {
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"id": {
"type": "integer"
},
"link": {
"type": "string"
},
"menu_order": {
"type": "integer"
},
"meta": {
"type": "object",
"properties": {
"footnotes": {
"type": "string"
}
}
},
"modified": {
"type": "string"
},
"modified_gmt": {
"type": "string"
},
"parent": {
"type": "integer"
},
"password": {
"type": "string"
},
"permalink_template": {
"type": "string"
},
"ping_status": {
"type": "string"
},
"slug": {
"type": "string"
},
"status": {
"type": "string"
},
"template": {
"type": "string"
},
"title": {
"type": "object",
"properties": {
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
},
"version": 3
}
@@ -0,0 +1,236 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"about": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"predecessor-version": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"id": {
"type": "integer"
}
}
}
},
"replies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"version-history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"href": {
"type": "string"
}
}
}
},
"wp:attachment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
}
}
},
"author": {
"type": "integer"
},
"class_list": {
"type": "array",
"items": {
"type": "string"
}
},
"comment_status": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"rendered": {
"type": "string"
}
}
},
"date": {
"type": "string"
},
"date_gmt": {
"type": "string"
},
"excerpt": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"rendered": {
"type": "string"
}
}
},
"featured_media": {
"type": "integer"
},
"guid": {
"type": "object",
"properties": {
"rendered": {
"type": "string"
}
}
},
"link": {
"type": "string"
},
"menu_order": {
"type": "integer"
},
"meta": {
"type": "object",
"properties": {
"footnotes": {
"type": "string"
}
}
},
"modified": {
"type": "string"
},
"modified_gmt": {
"type": "string"
},
"parent": {
"type": "integer"
},
"ping_status": {
"type": "string"
},
"slug": {
"type": "string"
},
"status": {
"type": "string"
},
"template": {
"type": "string"
},
"title": {
"type": "object",
"properties": {
"rendered": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
},
"version": 1
}
@@ -0,0 +1,233 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"about": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"predecessor-version": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"id": {
"type": "integer"
}
}
}
},
"replies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"version-history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"href": {
"type": "string"
}
}
}
},
"wp:attachment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
}
}
},
"author": {
"type": "integer"
},
"comment_status": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"rendered": {
"type": "string"
}
}
},
"date": {
"type": "string"
},
"date_gmt": {
"type": "string"
},
"excerpt": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"rendered": {
"type": "string"
}
}
},
"featured_media": {
"type": "integer"
},
"guid": {
"type": "object",
"properties": {
"rendered": {
"type": "string"
}
}
},
"id": {
"type": "integer"
},
"link": {
"type": "string"
},
"menu_order": {
"type": "integer"
},
"meta": {
"type": "object",
"properties": {
"footnotes": {
"type": "string"
}
}
},
"modified": {
"type": "string"
},
"modified_gmt": {
"type": "string"
},
"parent": {
"type": "integer"
},
"ping_status": {
"type": "string"
},
"slug": {
"type": "string"
},
"status": {
"type": "string"
},
"template": {
"type": "string"
},
"title": {
"type": "object",
"properties": {
"rendered": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
},
"version": 1
}
@@ -0,0 +1,290 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"about": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"predecessor-version": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"id": {
"type": "integer"
}
}
}
},
"replies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"version-history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"href": {
"type": "string"
}
}
}
},
"wp:action-assign-author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-publish": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-unfiltered-html": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:attachment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
}
}
},
"author": {
"type": "integer"
},
"comment_status": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"block_version": {
"type": "integer"
},
"protected": {
"type": "boolean"
},
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"date": {
"type": "string"
},
"date_gmt": {
"type": "string"
},
"excerpt": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"featured_media": {
"type": "integer"
},
"generated_slug": {
"type": "string"
},
"guid": {
"type": "object",
"properties": {
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"id": {
"type": "integer"
},
"link": {
"type": "string"
},
"menu_order": {
"type": "integer"
},
"meta": {
"type": "object",
"properties": {
"footnotes": {
"type": "string"
}
}
},
"modified": {
"type": "string"
},
"modified_gmt": {
"type": "string"
},
"parent": {
"type": "integer"
},
"password": {
"type": "string"
},
"permalink_template": {
"type": "string"
},
"ping_status": {
"type": "string"
},
"slug": {
"type": "string"
},
"status": {
"type": "string"
},
"template": {
"type": "string"
},
"title": {
"type": "object",
"properties": {
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
},
"version": 1
}
@@ -0,0 +1,360 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"about": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"replies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"version-history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"href": {
"type": "string"
}
}
}
},
"wp:action-assign-author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-assign-categories": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-assign-tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-create-categories": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-create-tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-publish": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-sticky": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-unfiltered-html": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:attachment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:term": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
},
"taxonomy": {
"type": "string"
}
}
}
}
}
},
"author": {
"type": "integer"
},
"categories": {
"type": "array",
"items": {
"type": "integer"
}
},
"comment_status": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"block_version": {
"type": "integer"
},
"protected": {
"type": "boolean"
},
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"date": {
"type": "string"
},
"date_gmt": {
"type": "string"
},
"excerpt": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"featured_media": {
"type": "integer"
},
"format": {
"type": "string"
},
"generated_slug": {
"type": "string"
},
"guid": {
"type": "object",
"properties": {
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"id": {
"type": "integer"
},
"link": {
"type": "string"
},
"meta": {
"type": "object",
"properties": {
"footnotes": {
"type": "string"
}
}
},
"modified": {
"type": "string"
},
"modified_gmt": {
"type": "string"
},
"password": {
"type": "string"
},
"permalink_template": {
"type": "string"
},
"ping_status": {
"type": "string"
},
"slug": {
"type": "string"
},
"status": {
"type": "string"
},
"sticky": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {
"type": "integer"
}
},
"template": {
"type": "string"
},
"title": {
"type": "object",
"properties": {
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
},
"version": 1
}
@@ -0,0 +1,276 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"about": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"predecessor-version": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"id": {
"type": "integer"
}
}
}
},
"replies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"version-history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"href": {
"type": "string"
}
}
}
},
"wp:attachment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:featuredmedia": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"wp:term": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
},
"taxonomy": {
"type": "string"
}
}
}
}
}
},
"author": {
"type": "integer"
},
"categories": {
"type": "array",
"items": {
"type": "integer"
}
},
"comment_status": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"rendered": {
"type": "string"
}
}
},
"date": {
"type": "string"
},
"date_gmt": {
"type": "string"
},
"excerpt": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"rendered": {
"type": "string"
}
}
},
"featured_media": {
"type": "integer"
},
"format": {
"type": "string"
},
"guid": {
"type": "object",
"properties": {
"rendered": {
"type": "string"
}
}
},
"id": {
"type": "integer"
},
"link": {
"type": "string"
},
"meta": {
"type": "object",
"properties": {
"footnotes": {
"type": "string"
}
}
},
"modified": {
"type": "string"
},
"modified_gmt": {
"type": "string"
},
"ping_status": {
"type": "string"
},
"slug": {
"type": "string"
},
"status": {
"type": "string"
},
"sticky": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {
"type": "integer"
}
},
"template": {
"type": "string"
},
"title": {
"type": "object",
"properties": {
"rendered": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
},
"version": 3
}
@@ -0,0 +1,276 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"about": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"predecessor-version": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"id": {
"type": "integer"
}
}
}
},
"replies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"version-history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"href": {
"type": "string"
}
}
}
},
"wp:attachment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:featuredmedia": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"wp:term": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
},
"taxonomy": {
"type": "string"
}
}
}
}
}
},
"author": {
"type": "integer"
},
"categories": {
"type": "array",
"items": {
"type": "integer"
}
},
"comment_status": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"rendered": {
"type": "string"
}
}
},
"date": {
"type": "string"
},
"date_gmt": {
"type": "string"
},
"excerpt": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"rendered": {
"type": "string"
}
}
},
"featured_media": {
"type": "integer"
},
"format": {
"type": "string"
},
"guid": {
"type": "object",
"properties": {
"rendered": {
"type": "string"
}
}
},
"id": {
"type": "integer"
},
"link": {
"type": "string"
},
"meta": {
"type": "object",
"properties": {
"footnotes": {
"type": "string"
}
}
},
"modified": {
"type": "string"
},
"modified_gmt": {
"type": "string"
},
"ping_status": {
"type": "string"
},
"slug": {
"type": "string"
},
"status": {
"type": "string"
},
"sticky": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {
"type": "integer"
}
},
"template": {
"type": "string"
},
"title": {
"type": "object",
"properties": {
"rendered": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
},
"version": 4
}
@@ -0,0 +1,374 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"about": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
},
"predecessor-version": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"id": {
"type": "integer"
}
}
}
},
"replies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"version-history": {
"type": "array",
"items": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"href": {
"type": "string"
}
}
}
},
"wp:action-assign-author": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-assign-categories": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-assign-tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-create-categories": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-create-tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-publish": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-sticky": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:action-unfiltered-html": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:attachment": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"wp:term": {
"type": "array",
"items": {
"type": "object",
"properties": {
"embeddable": {
"type": "boolean"
},
"href": {
"type": "string"
},
"taxonomy": {
"type": "string"
}
}
}
}
}
},
"author": {
"type": "integer"
},
"categories": {
"type": "array",
"items": {
"type": "integer"
}
},
"comment_status": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"block_version": {
"type": "integer"
},
"protected": {
"type": "boolean"
},
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"date": {
"type": "string"
},
"date_gmt": {
"type": "string"
},
"excerpt": {
"type": "object",
"properties": {
"protected": {
"type": "boolean"
},
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"featured_media": {
"type": "integer"
},
"format": {
"type": "string"
},
"generated_slug": {
"type": "string"
},
"guid": {
"type": "object",
"properties": {
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"id": {
"type": "integer"
},
"link": {
"type": "string"
},
"meta": {
"type": "object",
"properties": {
"footnotes": {
"type": "string"
}
}
},
"modified": {
"type": "string"
},
"modified_gmt": {
"type": "string"
},
"password": {
"type": "string"
},
"permalink_template": {
"type": "string"
},
"ping_status": {
"type": "string"
},
"slug": {
"type": "string"
},
"status": {
"type": "string"
},
"sticky": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {
"type": "integer"
}
},
"template": {
"type": "string"
},
"title": {
"type": "object",
"properties": {
"raw": {
"type": "string"
},
"rendered": {
"type": "string"
}
}
},
"type": {
"type": "string"
}
},
"version": 1
}
@@ -0,0 +1,125 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
},
"targetHints": {
"type": "object",
"properties": {
"allow": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
},
"avatar_urls": {
"type": "object",
"properties": {
"24": {
"type": "string"
},
"48": {
"type": "string"
},
"96": {
"type": "string"
}
}
},
"capabilities": {
"type": "object",
"properties": {
"level_0": {
"type": "boolean"
},
"read": {
"type": "boolean"
},
"subscriber": {
"type": "boolean"
}
}
},
"description": {
"type": "string"
},
"email": {
"type": "string"
},
"extra_capabilities": {
"type": "object",
"properties": {
"subscriber": {
"type": "boolean"
}
}
},
"first_name": {
"type": "string"
},
"id": {
"type": "integer"
},
"last_name": {
"type": "string"
},
"link": {
"type": "string"
},
"locale": {
"type": "string"
},
"name": {
"type": "string"
},
"nickname": {
"type": "string"
},
"registered_date": {
"type": "string"
},
"roles": {
"type": "array",
"items": {
"type": "string"
}
},
"slug": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"type": "string"
}
},
"version": 1
}
@@ -0,0 +1,51 @@
{
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
},
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
}
}
}
}
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"link": {
"type": "string"
},
"name": {
"type": "string"
},
"slug": {
"type": "string"
},
"url": {
"type": "string"
}
},
"version": 1
}
@@ -0,0 +1,90 @@
{
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
},
"description": {
"type": "string"
},
"link": {
"type": "string"
},
"slug": {
"type": "string"
},
"avatar_urls": {
"type": "object",
"properties": {
"24": {
"type": "string"
},
"48": {
"type": "string"
},
"96": {
"type": "string"
}
},
"required": [
"24",
"48",
"96"
]
},
"_links": {
"type": "object",
"properties": {
"self": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
},
"required": [
"href"
]
}
},
"collection": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string"
}
},
"required": [
"href"
]
}
}
},
"required": [
"self",
"collection"
]
}
},
"required": [
"id",
"name",
"url",
"description",
"link",
"slug",
"meta",
"_links"
],
"version": 1
}
@@ -0,0 +1,57 @@
import { NodeApiError } from 'n8n-workflow';
import { wordpressApiRequest, wordpressApiRequestAllItems } from '../GenericFunctions';
describe('Wordpress > GenericFunctions', () => {
const mockFunctions: any = {
helpers: {
requestWithAuthentication: jest.fn(),
},
getCredentials: jest.fn().mockResolvedValue({
url: 'http://example.com',
allowUnauthorizedCerts: false,
}),
getNode: jest.fn(),
};
beforeEach(() => {
jest.clearAllMocks();
});
describe('wordpressApiRequest', () => {
it('should make a successful request', async () => {
mockFunctions.helpers.requestWithAuthentication.mockResolvedValue({ data: 'testData' });
const result = await wordpressApiRequest.call(mockFunctions, 'GET', '/posts', {}, {});
expect(result).toEqual({ data: 'testData' });
expect(mockFunctions.helpers.requestWithAuthentication).toHaveBeenCalled();
});
it('should throw NodeApiError on failure', async () => {
mockFunctions.helpers.requestWithAuthentication.mockRejectedValue({ message: 'fail' });
await expect(
wordpressApiRequest.call(mockFunctions, 'GET', '/posts', {}, {}),
).rejects.toThrow(NodeApiError);
});
});
describe('wordpressApiRequestAllItems', () => {
it('should accumulate all pages', async () => {
mockFunctions.helpers.requestWithAuthentication
.mockResolvedValueOnce({
body: [{ post: 1 }],
headers: {
'x-wp-totalpages': '2',
},
})
.mockResolvedValueOnce({
body: [{ post: 2 }],
headers: {
'x-wp-totalpages': '2',
},
});
const results = await wordpressApiRequestAllItems.call(mockFunctions, 'GET', '/posts');
expect(results).toEqual([{ post: 1 }, { post: 2 }]);
});
});
});
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
export const credentials = {
wordpressApi: {
url: 'https://myblog.com',
allowUnauthorizedCerts: false,
username: 'nodeqa',
password: 'fake-password',
},
};
@@ -0,0 +1,37 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { pageCreate, pageGet, pageGetMany, pageUpdate } from '../apiResponses';
import { credentials } from '../credentials';
describe('Wordpress > Page Workflows', () => {
beforeAll(() => {
const mock = nock(credentials.wordpressApi.url);
mock
.post('/wp-json/wp/v2/pages', {
title: 'A new page',
content: 'Some content',
status: 'draft',
comment_status: 'closed',
ping_status: 'closed',
menu_order: 1,
})
.reply(200, pageCreate);
mock.get('/wp-json/wp/v2/pages/2').reply(200, pageGet);
mock.get('/wp-json/wp/v2/pages').query({ per_page: 1 }).reply(200, pageGetMany);
mock
.get('/wp-json/wp/v2/pages')
.query({ per_page: 1, before: '2026-01-01T00:00:00' })
.reply(200, pageGetMany);
mock
.post('/wp-json/wp/v2/pages/2', {
id: 2,
title: 'New Title',
content: 'Updated Content',
slug: 'new-slug',
})
.reply(200, pageUpdate);
});
new NodeTestHarness().setupTests({ credentials });
});
@@ -0,0 +1,762 @@
{
"name": "Wordpress Test - Pages",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [-32, 464],
"id": "246376de-5cc4-4fd2-9671-0a45b8bff10d",
"name": "When clicking Execute workflow"
},
{
"parameters": {
"resource": "page",
"title": "A new page",
"additionalFields": {
"content": "Some content",
"status": "draft",
"commentStatus": "closed",
"pingStatus": "closed",
"menuOrder": 1
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 80],
"id": "36cf31d4-ad52-4bbc-8abf-bd384b6968f7",
"name": "Page > Create",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {
"resource": "page",
"operation": "get",
"pageId": "2",
"options": {}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 272],
"id": "236d9c67-319b-435f-94e1-1719f2752a72",
"name": "Page > Get",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {
"resource": "page",
"operation": "getAll",
"limit": 1,
"options": {}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 464],
"id": "b1a3788f-9c81-4591-8a4c-e138612d3fb2",
"name": "Page > Get Many",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {
"resource": "page",
"operation": "update",
"pageId": "2",
"updateFields": {
"title": "New Title",
"content": "Updated Content",
"slug": "new-slug"
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 848],
"id": "cac71c1a-3367-4d5b-ba8d-d2285934be4e",
"name": "Page > Update",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 80],
"id": "bb846050-d39c-4e34-ad64-a97ccbbef256",
"name": "Create Response"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 272],
"id": "9634f881-592c-4165-8f9c-5a1aad5f76ee",
"name": "Get Response"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 464],
"id": "4343c931-3ded-4505-950c-43ba56929692",
"name": "Get Many Response"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 848],
"id": "e159e8fa-a9c9-4f54-a941-29dc7983fd3a",
"name": "Update Response"
},
{
"parameters": {
"resource": "page",
"operation": "getAll",
"limit": 1,
"options": {
"before": "2026-01-01T00:00:00"
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 656],
"id": "a08d9d51-e97f-4ea7-b189-d109b77e9f57",
"name": "Page > Get Many (With Filters)",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 656],
"id": "18c8cd20-de15-4ceb-9d6f-e4279532fe3c",
"name": "Get Many Response (With Filters)"
}
],
"pinData": {
"Create Response": [
{
"json": {
"id": 9,
"date": "2025-03-27T20:17:01",
"date_gmt": "2025-03-27T20:17:01",
"guid": {
"rendered": "https://myblog.com/?page_id=9",
"raw": "https://myblog.com/?page_id=9"
},
"modified": "2025-03-27T20:17:01",
"modified_gmt": "2025-03-27T20:17:01",
"password": "",
"slug": "",
"status": "draft",
"type": "page",
"link": "https://myblog.com/?page_id=9",
"title": {
"raw": "A new page",
"rendered": "A new page"
},
"content": {
"raw": "Some content",
"rendered": "<p>Some content</p>\n",
"protected": false,
"block_version": 0
},
"excerpt": {
"raw": "",
"rendered": "<p>Some content</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 1,
"comment_status": "closed",
"ping_status": "closed",
"template": "",
"meta": {
"footnotes": ""
},
"permalink_template": "https://myblog.com/%pagename%/",
"generated_slug": "a-new-page",
"class_list": ["post-9", "page", "type-page", "status-draft", "hentry"],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/9",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/page"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=9"
}
],
"version-history": [
{
"count": 0,
"href": "https://myblog.com/wp-json/wp/v2/pages/9/revisions"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=9"
}
],
"wp:action-publish": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/9"
}
],
"wp:action-unfiltered-html": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/9"
}
],
"wp:action-assign-author": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/9"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
],
"Get Response": [
{
"json": {
"id": 2,
"date": "2025-03-27T18:05:01",
"date_gmt": "2025-03-27T18:05:01",
"guid": {
"rendered": "https://myblog.com/?page_id=2"
},
"modified": "2025-03-27T18:05:01",
"modified_gmt": "2025-03-27T18:05:01",
"slug": "sample-page",
"status": "publish",
"type": "page",
"link": "https://myblog.com/sample-page/",
"title": {
"rendered": "Sample Page"
},
"content": {
"rendered": "\n<p>This is an example page. It&#8217;s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:</p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Hi there! I&#8217;m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin&#8217; caught in the rain.)</p></blockquote>\n\n\n\n<p>&#8230;or something like this:</p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</p></blockquote>\n\n\n\n<p>As a new WordPress user, you should go to <a href=\"https://myblog.com/wp-admin/\">your dashboard</a> to delete this page and create new pages for your content. Have fun!</p>\n",
"protected": false
},
"excerpt": {
"rendered": "<p>This is an example page. It&#8217;s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this: Hi there! I&#8217;m a bike messenger [&hellip;]</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "open",
"template": "",
"meta": {
"footnotes": ""
},
"class_list": ["post-2", "page", "type-page", "status-publish", "hentry"],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/2",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/page"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=2"
}
],
"version-history": [
{
"count": 0,
"href": "https://myblog.com/wp-json/wp/v2/pages/2/revisions"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=2"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
],
"Get Many Response": [
{
"json": {
"id": 2,
"date": "2025-03-27T18:05:01",
"date_gmt": "2025-03-27T18:05:01",
"guid": {
"rendered": "https://myblog.com/?page_id=2"
},
"modified": "2025-03-27T18:05:01",
"modified_gmt": "2025-03-27T18:05:01",
"slug": "sample-page",
"status": "publish",
"type": "page",
"link": "https://myblog.com/sample-page/",
"title": {
"rendered": "Sample Page"
},
"content": {
"rendered": "\n<p>This is an example page. It&#8217;s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:</p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Hi there! I&#8217;m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin&#8217; caught in the rain.)</p></blockquote>\n\n\n\n<p>&#8230;or something like this:</p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</p></blockquote>\n\n\n\n<p>As a new WordPress user, you should go to <a href=\"https://myblog.com/wp-admin/\">your dashboard</a> to delete this page and create new pages for your content. Have fun!</p>\n",
"protected": false
},
"excerpt": {
"rendered": "<p>This is an example page. It&#8217;s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this: Hi there! I&#8217;m a bike messenger [&hellip;]</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "open",
"template": "",
"meta": {
"footnotes": ""
},
"class_list": ["post-2", "page", "type-page", "status-publish", "hentry"],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/2",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/page"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=2"
}
],
"version-history": [
{
"count": 0,
"href": "https://myblog.com/wp-json/wp/v2/pages/2/revisions"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=2"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
],
"Update Response": [
{
"json": {
"id": 2,
"date": "2025-03-27T18:05:01",
"date_gmt": "2025-03-27T18:05:01",
"guid": {
"rendered": "https://myblog.com/?page_id=2",
"raw": "https://myblog.com/?page_id=2"
},
"modified": "2025-03-27T20:21:11",
"modified_gmt": "2025-03-27T20:21:11",
"password": "",
"slug": "new-slug",
"status": "publish",
"type": "page",
"link": "https://myblog.com/new-slug/",
"title": {
"raw": "New Title",
"rendered": "New Title"
},
"content": {
"raw": "Updated Content",
"rendered": "<p>Updated Content</p>\n",
"protected": false,
"block_version": 0
},
"excerpt": {
"raw": "",
"rendered": "<p>Updated Content</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "open",
"template": "",
"meta": {
"footnotes": ""
},
"permalink_template": "https://myblog.com/%pagename%/",
"generated_slug": "new-title",
"class_list": ["post-2", "page", "type-page", "status-publish", "hentry"],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/2",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/page"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=2"
}
],
"version-history": [
{
"count": 1,
"href": "https://myblog.com/wp-json/wp/v2/pages/2/revisions"
}
],
"predecessor-version": [
{
"id": 10,
"href": "https://myblog.com/wp-json/wp/v2/pages/2/revisions/10"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=2"
}
],
"wp:action-publish": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/2"
}
],
"wp:action-unfiltered-html": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/2"
}
],
"wp:action-assign-author": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/2"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
],
"Get Many Response (With Filters)": [
{
"json": {
"id": 2,
"date": "2025-03-27T18:05:01",
"date_gmt": "2025-03-27T18:05:01",
"guid": {
"rendered": "https://myblog.com/?page_id=2"
},
"modified": "2025-03-27T18:05:01",
"modified_gmt": "2025-03-27T18:05:01",
"slug": "sample-page",
"status": "publish",
"type": "page",
"link": "https://myblog.com/sample-page/",
"title": {
"rendered": "Sample Page"
},
"content": {
"rendered": "\n<p>This is an example page. It&#8217;s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:</p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Hi there! I&#8217;m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin&#8217; caught in the rain.)</p></blockquote>\n\n\n\n<p>&#8230;or something like this:</p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</p></blockquote>\n\n\n\n<p>As a new WordPress user, you should go to <a href=\"https://myblog.com/wp-admin/\">your dashboard</a> to delete this page and create new pages for your content. Have fun!</p>\n",
"protected": false
},
"excerpt": {
"rendered": "<p>This is an example page. It&#8217;s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this: Hi there! I&#8217;m a bike messenger [&hellip;]</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "open",
"template": "",
"meta": {
"footnotes": ""
},
"class_list": ["post-2", "page", "type-page", "status-publish", "hentry"],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages/2",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/pages"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/page"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=2"
}
],
"version-history": [
{
"count": 0,
"href": "https://myblog.com/wp-json/wp/v2/pages/2/revisions"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=2"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Page > Create",
"type": "main",
"index": 0
},
{
"node": "Page > Get",
"type": "main",
"index": 0
},
{
"node": "Page > Get Many",
"type": "main",
"index": 0
},
{
"node": "Page > Update",
"type": "main",
"index": 0
},
{
"node": "Page > Get Many (With Filters)",
"type": "main",
"index": 0
}
]
]
},
"Page > Create": {
"main": [
[
{
"node": "Create Response",
"type": "main",
"index": 0
}
]
]
},
"Page > Update": {
"main": [
[
{
"node": "Update Response",
"type": "main",
"index": 0
}
]
]
},
"Page > Get Many": {
"main": [
[
{
"node": "Get Many Response",
"type": "main",
"index": 0
}
]
]
},
"Page > Get": {
"main": [
[
{
"node": "Get Response",
"type": "main",
"index": 0
}
]
]
},
"Page > Get Many (With Filters)": {
"main": [
[
{
"node": "Get Many Response (With Filters)",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "b76bf6d6-3a62-4e01-938a-f63e55ef236b",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "eeda9e3069aca300d1dfceeb64beb5b53d715db44a50461bbc5cb0cf6daa01e3"
},
"id": "W7kWl5BZvsrmZeVw",
"tags": []
}
@@ -0,0 +1,43 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { postCreate, postGet, postGetMany, postUpdate } from '../apiResponses';
import { credentials } from '../credentials';
describe('Wordpress > Post Workflows', () => {
beforeAll(() => {
const mock = nock(credentials.wordpressApi.url);
mock.get('/wp-json/wp/v2/posts/1').reply(200, postGet);
mock.get('/wp-json/wp/v2/posts').query({ per_page: 10, page: 1 }).reply(200, postGetMany);
mock
.get('/wp-json/wp/v2/posts')
.query({ per_page: 10, page: 1, before: '2026-01-01T00:00:00' })
.reply(200, postGetMany);
mock
.post('/wp-json/wp/v2/posts', {
title: 'New Post',
author: 1,
content: 'This is my content',
slug: 'new-post',
status: 'future',
comment_status: 'closed',
ping_status: 'closed',
sticky: true,
categories: [1],
format: 'standard',
date: '2025-03-27T18:30:04',
})
.reply(200, postCreate);
mock
.post('/wp-json/wp/v2/posts/1', {
id: 1,
title: 'New Title',
content: 'Some new content',
status: 'publish',
date: '2025-03-27T18:05:01',
})
.reply(200, postUpdate);
});
new NodeTestHarness().setupTests({ credentials });
});
@@ -0,0 +1,941 @@
{
"name": "Wordpress Test - Posts",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [-32, 688],
"id": "d9528df2-82cb-47fe-8176-238283d1827e",
"name": "When clicking Execute workflow"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 688],
"id": "1f61c57c-8bf3-44bd-86a7-651906c1b06d",
"name": "Update Response"
},
{
"parameters": {
"operation": "update",
"postId": "1",
"updateFields": {
"title": "New Title",
"content": "Some new content",
"status": "publish",
"date": "2025-03-27T18:05:01"
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 688],
"id": "eb2e2d7a-48e9-49fb-a808-e2546ce14a2b",
"name": "Post > Update",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {
"operation": "getAll",
"returnAll": true,
"options": {}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 304],
"id": "72a59773-a15a-4e58-8bed-be1108449550",
"name": "Post > Get Many",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 304],
"id": "11b128da-9b78-4f02-93a7-c3db1bc3363a",
"name": "Get Many"
},
{
"parameters": {
"operation": "get",
"postId": "1",
"options": {}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 880],
"id": "3ff21988-4d92-4c87-831f-4e684248c761",
"name": "Post > Get",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 880],
"id": "dc730fc9-a28d-4eb4-aa8d-a1b85ff45ef9",
"name": "Get Response"
},
{
"parameters": {
"title": "New Post",
"additionalFields": {
"authorId": 1,
"content": "This is my content",
"slug": "new-post",
"status": "future",
"date": "2025-03-27T18:30:04",
"commentStatus": "closed",
"pingStatus": "closed",
"format": "standard",
"sticky": true,
"categories": [1]
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 1072],
"id": "f2e1c5f0-fbfa-419e-ba7a-ef60c8853304",
"name": "Post > Create",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 1072],
"id": "c386bee8-4bb9-4a1e-b4bc-4f8689722729",
"name": "Create Response"
},
{
"parameters": {
"operation": "getAll",
"returnAll": true,
"options": {
"before": "2026-01-01T00:00:00"
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [192, 496],
"id": "cc61993a-ac13-42d7-aace-c501da128361",
"name": "Post > Get Many (With Filters)",
"credentials": {
"wordpressApi": {
"id": "f5S0ZnKe8cDEPpjx",
"name": "Wordpress (localhost)"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [416, 496],
"id": "770a6cf9-93ca-4b56-a23b-b1d9904de993",
"name": "Get Many (With Filters)"
}
],
"pinData": {
"Update Response": [
{
"json": {
"id": 1,
"date": "2025-03-27T18:05:01",
"date_gmt": "2025-03-27T18:05:01",
"guid": {
"rendered": "https://myblog.com/?p=1",
"raw": "https://myblog.com/?p=1"
},
"modified": "2025-03-27T18:22:36",
"modified_gmt": "2025-03-27T18:22:36",
"password": "",
"slug": "hello-world",
"status": "publish",
"type": "post",
"link": "https://myblog.com/2025/03/27/hello-world/",
"title": {
"raw": "New Title",
"rendered": "New Title"
},
"content": {
"raw": "Some new content",
"rendered": "<p>Some new content</p>\n",
"protected": false,
"block_version": 0
},
"excerpt": {
"raw": "",
"rendered": "<p>Some new content</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": {
"footnotes": ""
},
"categories": [1],
"tags": [],
"permalink_template": "https://myblog.com/2025/03/27/%postname%/",
"generated_slug": "new-title",
"class_list": [
"post-1",
"post",
"type-post",
"status-publish",
"format-standard",
"hentry",
"category-uncategorised"
],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/post"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=1"
}
],
"version-history": [
{
"count": 1,
"href": "https://myblog.com/wp-json/wp/v2/posts/1/revisions"
}
],
"predecessor-version": [
{
"id": 6,
"href": "https://myblog.com/wp-json/wp/v2/posts/1/revisions/6"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=1"
}
],
"wp:term": [
{
"taxonomy": "category",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/categories?post=1"
},
{
"taxonomy": "post_tag",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/tags?post=1"
}
],
"wp:action-publish": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1"
}
],
"wp:action-unfiltered-html": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1"
}
],
"wp:action-sticky": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1"
}
],
"wp:action-assign-author": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1"
}
],
"wp:action-create-categories": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1"
}
],
"wp:action-assign-categories": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1"
}
],
"wp:action-create-tags": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1"
}
],
"wp:action-assign-tags": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
],
"Get Many": [
{
"json": {
"id": 1,
"date": "2025-03-27T18:05:01",
"date_gmt": "2025-03-27T18:05:01",
"guid": {
"rendered": "https://myblog.com/?p=1"
},
"modified": "2025-03-27T18:22:36",
"modified_gmt": "2025-03-27T18:22:36",
"slug": "hello-world",
"status": "publish",
"type": "post",
"link": "https://myblog.com/2025/03/27/hello-world/",
"title": {
"rendered": "Hello world!"
},
"content": {
"rendered": "\n<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
"protected": false
},
"excerpt": {
"rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": {
"footnotes": ""
},
"categories": [1],
"tags": [],
"class_list": [
"post-1",
"post",
"type-post",
"status-publish",
"format-standard",
"hentry",
"category-uncategorised"
],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/post"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=1"
}
],
"version-history": [
{
"count": 1,
"href": "https://myblog.com/wp-json/wp/v2/posts/1/revisions"
}
],
"predecessor-version": [
{
"id": 6,
"href": "https://myblog.com/wp-json/wp/v2/posts/1/revisions/6"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=1"
}
],
"wp:term": [
{
"taxonomy": "category",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/categories?post=1"
},
{
"taxonomy": "post_tag",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/tags?post=1"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
],
"Get Response": [
{
"json": {
"id": 1,
"date": "2025-03-27T18:05:01",
"date_gmt": "2025-03-27T18:05:01",
"guid": {
"rendered": "https://myblog.com/?p=1"
},
"modified": "2025-03-27T18:22:36",
"modified_gmt": "2025-03-27T18:22:36",
"slug": "hello-world",
"status": "publish",
"type": "post",
"link": "https://myblog.com/2025/03/27/hello-world/",
"title": {
"rendered": "New Title"
},
"content": {
"rendered": "<p>Some new content</p>\n",
"protected": false
},
"excerpt": {
"rendered": "<p>Some new content</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": {
"footnotes": ""
},
"categories": [1],
"tags": [],
"class_list": [
"post-1",
"post",
"type-post",
"status-publish",
"format-standard",
"hentry",
"category-uncategorised"
],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/post"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=1"
}
],
"version-history": [
{
"count": 1,
"href": "https://myblog.com/wp-json/wp/v2/posts/1/revisions"
}
],
"predecessor-version": [
{
"id": 6,
"href": "https://myblog.com/wp-json/wp/v2/posts/1/revisions/6"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=1"
}
],
"wp:term": [
{
"taxonomy": "category",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/categories?post=1"
},
{
"taxonomy": "post_tag",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/tags?post=1"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
],
"Create Response": [
{
"json": {
"id": 7,
"date": "2025-03-27T18:30:04",
"date_gmt": "2025-03-27T18:30:04",
"guid": {
"rendered": "https://myblog.com/2025/03/27/new-post/",
"raw": "https://myblog.com/2025/03/27/new-post/"
},
"modified": "2025-03-27T18:30:04",
"modified_gmt": "2025-03-27T18:30:04",
"password": "",
"slug": "new-post",
"status": "publish",
"type": "post",
"link": "https://myblog.com/2025/03/27/new-post/",
"title": {
"raw": "New Post",
"rendered": "New Post"
},
"content": {
"raw": "This is my content",
"rendered": "<p>This is my content</p>\n",
"protected": false,
"block_version": 0
},
"excerpt": {
"raw": "",
"rendered": "<p>This is my content</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"comment_status": "closed",
"ping_status": "closed",
"sticky": true,
"template": "",
"format": "standard",
"meta": {
"footnotes": ""
},
"categories": [1],
"tags": [],
"permalink_template": "https://myblog.com/2025/03/27/%postname%/",
"generated_slug": "new-post",
"class_list": [
"post-7",
"post",
"type-post",
"status-publish",
"format-standard",
"hentry",
"category-uncategorised"
],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/post"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=7"
}
],
"version-history": [
{
"count": 0,
"href": "https://myblog.com/wp-json/wp/v2/posts/7/revisions"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=7"
}
],
"wp:term": [
{
"taxonomy": "category",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/categories?post=7"
},
{
"taxonomy": "post_tag",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/tags?post=7"
}
],
"wp:action-publish": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7"
}
],
"wp:action-unfiltered-html": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7"
}
],
"wp:action-sticky": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7"
}
],
"wp:action-assign-author": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7"
}
],
"wp:action-create-categories": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7"
}
],
"wp:action-assign-categories": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7"
}
],
"wp:action-create-tags": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7"
}
],
"wp:action-assign-tags": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/7"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
],
"Get Many (With Filters)": [
{
"json": {
"id": 1,
"date": "2025-03-27T18:05:01",
"date_gmt": "2025-03-27T18:05:01",
"guid": {
"rendered": "https://myblog.com/?p=1"
},
"modified": "2025-03-27T18:22:36",
"modified_gmt": "2025-03-27T18:22:36",
"slug": "hello-world",
"status": "publish",
"type": "post",
"link": "https://myblog.com/2025/03/27/hello-world/",
"title": {
"rendered": "Hello world!"
},
"content": {
"rendered": "\n<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
"protected": false
},
"excerpt": {
"rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": {
"footnotes": ""
},
"categories": [1],
"tags": [],
"class_list": [
"post-1",
"post",
"type-post",
"status-publish",
"format-standard",
"hentry",
"category-uncategorised"
],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts/1",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/posts"
}
],
"about": [
{
"href": "https://myblog.com/wp-json/wp/v2/types/post"
}
],
"author": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/comments?post=1"
}
],
"version-history": [
{
"count": 1,
"href": "https://myblog.com/wp-json/wp/v2/posts/1/revisions"
}
],
"predecessor-version": [
{
"id": 6,
"href": "https://myblog.com/wp-json/wp/v2/posts/1/revisions/6"
}
],
"wp:attachment": [
{
"href": "https://myblog.com/wp-json/wp/v2/media?parent=1"
}
],
"wp:term": [
{
"taxonomy": "category",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/categories?post=1"
},
{
"taxonomy": "post_tag",
"embeddable": true,
"href": "https://myblog.com/wp-json/wp/v2/tags?post=1"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "Post > Update",
"type": "main",
"index": 0
},
{
"node": "Post > Get Many",
"type": "main",
"index": 0
},
{
"node": "Post > Get",
"type": "main",
"index": 0
},
{
"node": "Post > Create",
"type": "main",
"index": 0
},
{
"node": "Post > Get Many (With Filters)",
"type": "main",
"index": 0
}
]
]
},
"Post > Update": {
"main": [
[
{
"node": "Update Response",
"type": "main",
"index": 0
}
]
]
},
"Post > Get Many": {
"main": [
[
{
"node": "Get Many",
"type": "main",
"index": 0
}
]
]
},
"Post > Get": {
"main": [
[
{
"node": "Get Response",
"type": "main",
"index": 0
}
]
]
},
"Post > Create": {
"main": [
[
{
"node": "Create Response",
"type": "main",
"index": 0
}
]
]
},
"Post > Get Many (With Filters)": {
"main": [
[
{
"node": "Get Many (With Filters)",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "15a2bfaf-cdca-4010-81ee-e589d6fddc1e",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "eeda9e3069aca300d1dfceeb64beb5b53d715db44a50461bbc5cb0cf6daa01e3"
},
"id": "W7kWl5BZvsrmZeVw",
"tags": []
}
@@ -0,0 +1,34 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import nock from 'nock';
import { userCreate, userGet, userGetMany, userUpdate } from '../apiResponses';
import { credentials } from '../credentials';
describe('Wordpress > User Workflows', () => {
beforeAll(() => {
const mock = nock(credentials.wordpressApi.url);
mock
.post('/wp-json/wp/v2/users', {
name: 'nathan tester',
username: 'new-user',
first_name: 'Nathan',
last_name: 'Tester',
email: 'nathan@domain.com',
password: 'fake-password',
})
.reply(200, userCreate);
mock.get('/wp-json/wp/v2/users/2').query({ context: 'view' }).reply(200, userGet);
mock.get('/wp-json/wp/v2/users').query({ orderby: 'id', per_page: 1 }).reply(200, userGetMany);
mock
.post('/wp-json/wp/v2/users/2', {
id: '2',
name: 'Name Change',
first_name: 'Name',
last_name: 'Change',
nickname: 'newuser',
})
.reply(200, userUpdate);
});
new NodeTestHarness().setupTests({ credentials });
});
@@ -0,0 +1,387 @@
{
"name": "Wordpress Tests - User",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [0, 300],
"id": "15748f86-cdf3-4dad-aa75-a27442073de8",
"name": "When clicking Execute workflow"
},
{
"parameters": {
"resource": "user",
"username": "new-user",
"name": "nathan tester",
"firstName": "Nathan",
"lastName": "Tester",
"email": "nathan@domain.com",
"password": "fake-password",
"additionalFields": {}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [220, 0],
"id": "f5058499-b6c5-42e3-8912-53de6124f811",
"name": "User > Create",
"credentials": {
"wordpressApi": {
"id": "vNOAnwp9mSIq39cD",
"name": "nodeqa"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [440, 0],
"id": "ffcae931-d165-41a0-b49d-12afbfa73238",
"name": "Create Response"
},
{
"parameters": {
"resource": "user",
"operation": "get",
"userId": "2",
"options": {
"context": "view"
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [220, 200],
"id": "707abdd8-4976-45c4-a1ec-aac08cdcf530",
"name": "User > Get",
"credentials": {
"wordpressApi": {
"id": "vNOAnwp9mSIq39cD",
"name": "nodeqa"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [440, 200],
"id": "ca7f1e89-6b2b-4c96-8a43-ef758a39cfa1",
"name": "Get Response"
},
{
"parameters": {
"resource": "user",
"operation": "getAll",
"limit": 1,
"options": {
"orderBy": "id"
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [220, 400],
"id": "2a2ac1a3-a163-49cc-8974-eb81b87d2aee",
"name": "User > Get Many",
"credentials": {
"wordpressApi": {
"id": "vNOAnwp9mSIq39cD",
"name": "nodeqa"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [440, 400],
"id": "1b4ccb5b-e3e5-4741-b533-2274501971c1",
"name": "Get Many Response"
},
{
"parameters": {
"resource": "user",
"operation": "update",
"userId": "2",
"updateFields": {
"name": "Name Change",
"firstName": "Name",
"lastName": "Change",
"nickname": "newuser"
}
},
"type": "n8n-nodes-base.wordpress",
"typeVersion": 1,
"position": [220, 600],
"id": "8d000d21-c5c6-421a-b11d-193813adf35f",
"name": "User > Update",
"credentials": {
"wordpressApi": {
"id": "vNOAnwp9mSIq39cD",
"name": "nodeqa"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [440, 600],
"id": "60e0f507-00ab-42f0-81af-47692bc508c9",
"name": "Update Response"
}
],
"pinData": {
"Create Response": [
{
"json": {
"id": 2,
"username": "new-user",
"name": "nathan tester",
"first_name": "Nathan",
"last_name": "Tester",
"email": "nathan@domain.com",
"url": "",
"description": "",
"link": "https://myblog.com/author/new-user/",
"locale": "en_GB",
"nickname": "new-user",
"slug": "new-user",
"roles": ["subscriber"],
"registered_date": "2025-03-27T19:49:07+00:00",
"capabilities": {
"read": true,
"level_0": true,
"subscriber": true
},
"extra_capabilities": {
"subscriber": true
},
"avatar_urls": {
"24": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=96&d=mm&r=g"
},
"meta": {
"persisted_preferences": []
},
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/users/2",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/users"
}
]
}
}
}
],
"Get Response": [
{
"json": {
"id": 2,
"name": "nathan tester",
"url": "",
"description": "",
"link": "https://myblog.com/author/new-user/",
"slug": "new-user",
"avatar_urls": {
"24": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=96&d=mm&r=g"
},
"meta": [],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/users/2",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/users"
}
]
}
}
}
],
"Get Many Response": [
{
"json": {
"id": 1,
"name": "nodeqa",
"url": "https://myblog.com",
"description": "",
"link": "https://myblog.com/author/nodeqa/",
"slug": "nodeqa",
"avatar_urls": {
"24": "https://secure.gravatar.com/avatar/de2d127be16acfb3d435ff80b5e13687?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/de2d127be16acfb3d435ff80b5e13687?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/de2d127be16acfb3d435ff80b5e13687?s=96&d=mm&r=g"
},
"meta": [],
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/users/1",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/users"
}
]
}
}
}
],
"Update Response": [
{
"json": {
"id": 2,
"username": "new-user",
"name": "Name Change",
"first_name": "Name",
"last_name": "Change",
"email": "nathan@domain.com",
"url": "",
"description": "",
"link": "https://myblog.com/author/new-user/",
"locale": "en_GB",
"nickname": "newuser",
"slug": "new-user",
"roles": ["subscriber"],
"registered_date": "2025-03-27T19:49:07+00:00",
"capabilities": {
"read": true,
"level_0": true,
"subscriber": true
},
"extra_capabilities": {
"subscriber": true
},
"avatar_urls": {
"24": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=24&d=mm&r=g",
"48": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=48&d=mm&r=g",
"96": "https://secure.gravatar.com/avatar/6eabaa023affb379ccfd92d522ab0e37?s=96&d=mm&r=g"
},
"meta": {
"persisted_preferences": []
},
"_links": {
"self": [
{
"href": "https://myblog.com/wp-json/wp/v2/users/2",
"targetHints": {
"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]
}
}
],
"collection": [
{
"href": "https://myblog.com/wp-json/wp/v2/users"
}
]
}
}
}
]
},
"connections": {
"When clicking Execute workflow": {
"main": [
[
{
"node": "User > Create",
"type": "main",
"index": 0
},
{
"node": "User > Get",
"type": "main",
"index": 0
},
{
"node": "User > Get Many",
"type": "main",
"index": 0
},
{
"node": "User > Update",
"type": "main",
"index": 0
}
]
]
},
"User > Create": {
"main": [
[
{
"node": "Create Response",
"type": "main",
"index": 0
}
]
]
},
"User > Get": {
"main": [
[
{
"node": "Get Response",
"type": "main",
"index": 0
}
]
]
},
"User > Get Many": {
"main": [
[
{
"node": "Get Many Response",
"type": "main",
"index": 0
}
]
]
},
"User > Update": {
"main": [
[
{
"node": "Update Response",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "b301e130-8b6e-4802-9b86-388040843566",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "0fa937d34dcabeff4bd6480d3b42cc95edf3bc20e6810819086ef1ce2623639d"
},
"id": "K7sj1qC0d2JFoMGp",
"tags": []
}
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="2500" height="2500" viewBox="8.399 8.4 51.2 51.2"><path fill="#21759B" d="M34 59.6C19.813 59.6 8.293 48.293 8.4 34S19.28 8.4 34 8.4 59.6 19.92 59.6 34 48.187 59.6 34 59.6m7.573-3.947-7.253-19.52-6.827 19.947c5.014 1.174 8.427 1.493 14.08-.427m-17.706-1.066-10.88-29.76c-1.494 3.2-1.813 5.867-2.027 9.173.107 8.746 5.013 16.746 12.907 20.587M56.934 34c.106-5.653-2.453-10.133-2.667-10.773.214 4.374-.427 6.613-1.173 9.067l-7.467 21.44C55.014 48.08 56.826 39.653 57.04 34zm-23.68-.96-3.627-9.92-2.667-.213c-1.066-.747-.427-1.92.32-1.92 4.8.32 7.466.32 12.267 0 1.174 0 1.493 1.707.106 1.92l-2.56.213 8.319 24.533 3.946-13.44c.214-5.866-1.387-6.506-3.52-10.773-1.707-3.307.107-6.507 3.414-6.613-2.668-2.56-8.107-5.76-15.254-5.867s-14.72 3.52-19.2 10.347l7.894-.213c.96.427.533 1.813 0 1.92l-2.773.213 8.32 24.96z"/></svg>

After

Width:  |  Height:  |  Size: 865 B