n8n/packages/nodes-base/nodes/Wordpress/UserDescription.ts
Iván Ovejero 63b6c9f128
refactor: Apply more eslint-plugin-n8n-nodes-base autofixable rules (#3243)
* ✏️ Alphabetize rules

* 🔖 Update version

*  Update lintfix command

*  Run baseline lintfix

* 📦 Update package-lock.json

* 👕 Apply `node-param-description-untrimmed` (#3200)

* Removing unneeded backticks (#3249)

* 👕 Apply node-param-description-wrong-for-return-all (#3253)

* 👕 Apply node-param-description-missing-limit (#3252)

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

* 👕 Apply node-param-description-excess-final-period (#3250)

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

* 👕 Apply node-param-description-unencoded-angle-brackets (#3256)

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

* 👕 Apply node-param-description-url-missing-protocol (#3258)

* 👕 Apply `node-param-description-miscased-id` (#3254)

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

* 👕 Apply node-param-description-wrong-for-limit (#3257)

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

* 👕 Apply node-param-description-wrong-for-ignore-ssl-issues (#3261)

* 👕 Apply rule

*  Restore lintfix script

*  Restore lintfix script

Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
Co-authored-by: Omar Ajoue <krynble@gmail.com>
Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
2022-05-06 23:01:25 +02:00

568 lines
10 KiB
TypeScript

import { INodeProperties } from 'n8n-workflow';
export const userOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'user',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a user',
},
// {
// name: 'Delete',
// value: 'delete',
// description: 'Delete a user',
// },
{
name: 'Get',
value: 'get',
description: 'Get a user',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all users',
},
{
name: 'Update',
value: 'update',
description: 'Update a user',
},
],
default: 'create',
description: 'The operation to perform.',
},
];
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',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'create',
],
},
},
description: 'The email address for the user',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
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',
typeOptions: {
alwaysOpenEditWindow: true,
},
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',
default: '',
description: 'The email address for the user',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
default: '',
description: 'Password for the user (never included)',
},
{
displayName: 'URL',
name: 'url',
type: 'string',
default: '',
description: 'URL of the user',
},
{
displayName: 'Description',
name: 'description',
typeOptions: {
alwaysOpenEditWindow: true,
},
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',
},
];