n8n/packages/nodes-base/nodes/InvoiceNinja/ClientDescription.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

437 lines
7.7 KiB
TypeScript

import { INodeProperties } from 'n8n-workflow';
export const clientOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'client',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new client',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a client',
},
{
name: 'Get',
value: 'get',
description: 'Get data of a client',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get data of all clients',
},
],
default: 'create',
description: 'The operation to perform.',
},
];
export const clientFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* client:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'client',
],
},
},
options: [
{
displayName: 'Client Name',
name: 'clientName',
type: 'string',
default: '',
},
{
displayName: 'ID Number',
name: 'idNumber',
type: 'string',
default: '',
},
{
displayName: 'Private Notes',
name: 'privateNotes',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
},
{
displayName: 'VAT Number',
name: 'vatNumber',
type: 'string',
default: '',
},
{
displayName: 'Work Phone',
name: 'workPhone',
type: 'string',
default: '',
},
{
displayName: 'Website',
name: 'website',
type: 'string',
default: '',
},
],
},
{
displayName: 'Billing Address',
name: 'billingAddressUi',
placeholder: 'Add Billing Address',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'create',
],
},
},
default: {},
options: [
{
name: 'billingAddressValue',
displayName: 'Billing Address',
values: [
{
displayName: 'Street Address',
name: 'streetAddress',
type: 'string',
default: '',
},
{
displayName: 'Apt/Suite',
name: 'aptSuite',
type: 'string',
default: '',
},
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
},
{
displayName: 'Postal Code',
name: 'postalCode',
type: 'string',
default: '',
},
{
displayName: 'Country Code',
name: 'countryCode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCountryCodes',
},
default: '',
},
],
},
],
},
{
displayName: 'Contacts',
name: 'contactsUi',
placeholder: 'Add Contact',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'create',
],
},
},
default: {},
options: [
{
name: 'contacstValues',
displayName: 'Contact',
values: [
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
default: '',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
default: '',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Shipping Address',
name: 'shippingAddressUi',
placeholder: 'Add Shipping Address',
type: 'fixedCollection',
typeOptions: {
multipleValues: false,
},
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'create',
],
},
},
default: {},
options: [
{
name: 'shippingAddressValue',
displayName: 'Shipping Address',
values: [
{
displayName: 'Street Address',
name: 'streetAddress',
type: 'string',
default: '',
},
{
displayName: 'Apt/Suite',
name: 'aptSuite',
type: 'string',
default: '',
},
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
},
{
displayName: 'Postal Code',
name: 'postalCode',
type: 'string',
default: '',
},
{
displayName: 'Country Code',
name: 'countryCode',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCountryCodes',
},
default: '',
},
],
},
],
},
/* -------------------------------------------------------------------------- */
/* client:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Client ID',
name: 'clientId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'delete',
],
},
},
},
/* -------------------------------------------------------------------------- */
/* client:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Client ID',
name: 'clientId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'get',
],
},
},
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'client',
],
},
},
options: [
{
displayName: 'Include',
name: 'include',
type: 'options',
options: [
{
name: 'Invoices',
value: 'invoices',
},
],
default: 'invoices',
},
],
},
/* -------------------------------------------------------------------------- */
/* client:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: [
'client',
],
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: [
'client',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 60,
},
default: 50,
description: 'Max number of results to return',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'client',
],
},
},
options: [
{
displayName: 'Include',
name: 'include',
type: 'options',
options: [
{
name: 'Invoices',
value: 'invoices',
},
],
default: 'invoices',
},
],
},
];