mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 08:04:06 -08:00
6dcdb30bf4
* ✏️ Alphabetize lint rules * 🔥 Remove duplicates * ⚡ Update `lintfix` script * 👕 Apply `node-param-operation-without-no-data-expression` (#3329) * 👕 Apply `node-param-operation-without-no-data-expression` * 👕 Add exceptions * 👕 Apply `node-param-description-weak` (#3328) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-option-value-duplicate` (#3331) * 👕 Apply `node-param-description-miscased-json` (#3337) * 👕 Apply `node-param-display-name-excess-inner-whitespace` (#3335) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-type-options-missing-from-limit` (#3336) * Rule workig as intended * ✏️ Uncomment rules Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-option-name-duplicate` (#3338) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-description-wrong-for-simplify` (#3334) * ⚡ fix * ⚡ exceptions * ⚡ changed rule ignoring from file to line * 👕 Apply `node-param-resource-without-no-data-expression` (#3339) * 👕 Apply `node-param-display-name-untrimmed` (#3341) * 👕 Apply `node-param-display-name-miscased-id` (#3340) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-resource-with-plural-option` (#3342) * 👕 Apply `node-param-description-wrong-for-upsert` (#3333) * ⚡ fix * ⚡ replaced record with contact in description * ⚡ fix Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-option-description-identical-to-name` (#3343) * 👕 Apply `node-param-option-name-containing-star` (#3347) * 👕 Apply `node-param-display-name-wrong-for-update-fields` (#3348) * 👕 Apply `node-param-option-name-wrong-for-get-all` (#3345) * ⚡ fix * ⚡ exceptions * 👕 Apply node-param-display-name-wrong-for-simplify (#3344) * Rule working as intended * Uncomented other rules * 👕 Undo and add exceptions Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * ⚡ Alphabetize lint rules * ⚡ Restore `lintfix` script Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com> Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
509 lines
9.8 KiB
TypeScript
509 lines
9.8 KiB
TypeScript
import {
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export const accountOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create an account',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete an account',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Retrieve an account',
|
|
},
|
|
{
|
|
name: 'Get All',
|
|
value: 'getAll',
|
|
description: 'Retrieve all accounts',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update an account',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
];
|
|
|
|
export const accountFields: INodeProperties[] = [
|
|
// ----------------------------------------
|
|
// account: create
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
description: 'Name of the account',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Additional Fields',
|
|
name: 'additionalFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Address',
|
|
name: 'address',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Address of the account',
|
|
},
|
|
{
|
|
displayName: 'Annual Revenue',
|
|
name: 'annual_revenue',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Annual revenue of the account',
|
|
},
|
|
{
|
|
displayName: 'Business Type ID',
|
|
name: 'business_type_id',
|
|
type: 'options',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getBusinessTypes',
|
|
},
|
|
description: 'ID of the business that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'City',
|
|
name: 'city',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'City that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'Country',
|
|
name: 'country',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Country that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'Facebook',
|
|
name: 'facebook',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Facebook username of the account',
|
|
},
|
|
{
|
|
displayName: 'Industry Type ID',
|
|
name: 'industry_type_id',
|
|
type: 'options',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getIndustryTypes',
|
|
},
|
|
description: 'ID of the industry that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'LinkedIn',
|
|
name: 'linkedin',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'LinkedIn account of the account',
|
|
},
|
|
{
|
|
displayName: 'Number of Employees',
|
|
name: 'number_of_employees',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Number of employees in the account',
|
|
},
|
|
{
|
|
displayName: 'Owner ID',
|
|
name: 'owner_id',
|
|
type: 'options',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getUsers',
|
|
},
|
|
description: 'ID of the user to whom the account is assigned',
|
|
},
|
|
{
|
|
displayName: 'Parent Sales Account ID',
|
|
name: 'parent_sales_account_id',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Parent account ID of the account',
|
|
},
|
|
{
|
|
displayName: 'Phone',
|
|
name: 'phone',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Phone number of the account',
|
|
},
|
|
{
|
|
displayName: 'State',
|
|
name: 'state',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'State that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'Territory ID',
|
|
name: 'territory_id',
|
|
type: 'options',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getTerritories',
|
|
},
|
|
description: 'ID of the territory that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'Twitter',
|
|
name: 'twitter',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Twitter username of the account',
|
|
},
|
|
{
|
|
displayName: 'Website',
|
|
name: 'website',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Website of the account',
|
|
},
|
|
{
|
|
displayName: 'Zipcode',
|
|
name: 'zipcode',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Zipcode of the region that the account belongs to',
|
|
},
|
|
],
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// account: delete
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Account ID',
|
|
name: 'accountId',
|
|
description: 'ID of the account to delete',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'delete',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// account: get
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Account ID',
|
|
name: 'accountId',
|
|
description: 'ID of the account to retrieve',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// account: getAll
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'View',
|
|
name: 'view',
|
|
type: 'options',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getAccountViews',
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
},
|
|
},
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
default: 50,
|
|
description: 'Max number of results to return',
|
|
typeOptions: {
|
|
minValue: 1,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
returnAll: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// account: update
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Account ID',
|
|
name: 'accountId',
|
|
description: 'ID of the account to update',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Update Fields',
|
|
name: 'updateFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'account',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Address',
|
|
name: 'address',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Address of the account',
|
|
},
|
|
{
|
|
displayName: 'Annual Revenue',
|
|
name: 'annual_revenue',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Annual revenue of the account',
|
|
},
|
|
{
|
|
displayName: 'Business Type ID',
|
|
name: 'business_type_id',
|
|
type: 'options',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getBusinessTypes',
|
|
},
|
|
description: 'ID of the business that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'City',
|
|
name: 'city',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'City that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'Country',
|
|
name: 'country',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Country that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'Facebook',
|
|
name: 'facebook',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Facebook username of the account',
|
|
},
|
|
{
|
|
displayName: 'Industry Type ID',
|
|
name: 'industry_type_id',
|
|
type: 'options',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getIndustryTypes',
|
|
},
|
|
description: 'ID of the industry that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'LinkedIn',
|
|
name: 'linkedin',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'LinkedIn account of the account',
|
|
},
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Name of the account',
|
|
},
|
|
{
|
|
displayName: 'Number of Employees',
|
|
name: 'number_of_employees',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Number of employees in the account',
|
|
},
|
|
{
|
|
displayName: 'Owner ID',
|
|
name: 'owner_id',
|
|
type: 'options',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getUsers',
|
|
},
|
|
description: 'ID of the user to whom the account is assigned',
|
|
},
|
|
{
|
|
displayName: 'Parent Sales Account ID',
|
|
name: 'parent_sales_account_id',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Parent account ID of the account',
|
|
},
|
|
{
|
|
displayName: 'Phone',
|
|
name: 'phone',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Phone number of the account',
|
|
},
|
|
{
|
|
displayName: 'State',
|
|
name: 'state',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'State that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'Territory ID',
|
|
name: 'territory_id',
|
|
type: 'options',
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getTerritories',
|
|
},
|
|
description: 'ID of the territory that the account belongs to',
|
|
},
|
|
{
|
|
displayName: 'Twitter',
|
|
name: 'twitter',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Twitter username of the account',
|
|
},
|
|
{
|
|
displayName: 'Website',
|
|
name: 'website',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Website of the account',
|
|
},
|
|
{
|
|
displayName: 'Zipcode',
|
|
name: 'zipcode',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Zipcode of the region that the account belongs to',
|
|
},
|
|
],
|
|
},
|
|
];
|