mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
88dea330b9
* ⚡ Update `lintfix` script * ⚡ Run baseline `lintfix` * 🔥 Remove unneeded exceptions (#3538) * 🔥 Remove exceptions for `node-param-default-wrong-for-simplify` * 🔥 Remove exceptions for `node-param-placeholder-miscased-id` * ⚡ Update version * 👕 Apply `node-param-placeholder-missing` (#3542) * 👕 Apply `filesystem-wrong-cred-filename` (#3543) * 👕 Apply `node-param-description-missing-from-dynamic-options` (#3545) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-class-description-empty-string` (#3546) * 👕 Apply `node-class-description-icon-not-svg` (#3548) * 👕 Apply `filesystem-wrong-node-filename` (#3549) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Expand lintings to credentials (#3550) * 👕 Apply `node-param-multi-options-type-unsorted-items` (#3552) * ⚡ fix * ⚡ Minor fixes Co-authored-by: Michael Kret <michael.k@radency.com> * 👕 Apply `node-param-description-wrong-for-dynamic-multi-options` (#3541) * ⚡ Add new lint rule, node-param-description-wrong-for-dynamic-multi-options * ⚡ Fix with updated linting rules * ⚡ Minor fixes Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-description-boolean-without-whether` (#3553) * ⚡ fix * Update packages/nodes-base/nodes/Clockify/ProjectDescription.ts Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-display-name-wrong-for-dynamic-multi-options (#3537) * 👕 Add exceptions * 👕 Add exception * ✏️ Alphabetize rules * ⚡ Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: brianinoa <54530642+brianinoa@users.noreply.github.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
440 lines
8 KiB
TypeScript
440 lines
8 KiB
TypeScript
import { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const clientOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
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',
|
|
},
|
|
];
|
|
|
|
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 or ID',
|
|
name: 'countryCode',
|
|
type: 'options',
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
|
|
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',
|
|
placeholder: 'name@email.com',
|
|
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 or ID',
|
|
name: 'countryCode',
|
|
type: 'options',
|
|
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
|
|
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',
|
|
},
|
|
],
|
|
},
|
|
];
|