2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2021-07-30 07:12:30 -07:00
2021-12-03 00:44:16 -08:00
export const accountOperations : INodeProperties [ ] = [
2021-07-30 07:12:30 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-07-30 07:12:30 -07:00
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create an account' ,
2022-07-10 13:50:51 -07:00
action : 'Create an account' ,
2021-07-30 07:12:30 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete an account' ,
2022-07-10 13:50:51 -07:00
action : 'Delete an account' ,
2021-07-30 07:12:30 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Retrieve an account' ,
2022-07-10 13:50:51 -07:00
action : 'Get an account' ,
2021-07-30 07:12:30 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2021-07-30 07:12:30 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Retrieve many accounts' ,
2022-09-08 08:10:13 -07:00
action : 'Get many accounts' ,
2021-07-30 07:12:30 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update an account' ,
2022-07-10 13:50:51 -07:00
action : 'Update an account' ,
2021-07-30 07:12:30 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-07-30 07:12:30 -07:00
2021-12-03 00:44:16 -08:00
export const accountFields : INodeProperties [ ] = [
2021-07-30 07:12:30 -07:00
// ----------------------------------------
// account: create
// ----------------------------------------
{
displayName : 'Name' ,
name : 'name' ,
description : 'Name of the account' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'create' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'create' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Business Type Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'business_type_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getBusinessTypes' ,
} ,
2022-08-01 13:47:55 -07:00
description :
'ID of the business that the account belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Industry Type Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'industry_type_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getIndustryTypes' ,
} ,
2022-08-01 13:47:55 -07:00
description :
'ID of the industry that the account belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Owner Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'owner_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
2022-08-01 13:47:55 -07:00
description :
'ID of the user to whom the account is assigned. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Territory Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'territory_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getTerritories' ,
} ,
2022-08-01 13:47:55 -07:00
description :
'ID of the territory that the account belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
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 : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'delete' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
// ----------------------------------------
// account: get
// ----------------------------------------
{
displayName : 'Account ID' ,
name : 'accountId' ,
description : 'ID of the account to retrieve' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'get' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
// ----------------------------------------
// account: getAll
// ----------------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'View Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'view' ,
type : 'options' ,
2022-08-01 13:47:55 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2021-07-30 07:12:30 -07:00
required : true ,
typeOptions : {
loadOptionsMethod : 'getAccountViews' ,
} ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'getAll' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
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 : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'getAll' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2021-07-30 07:12:30 -07:00
typeOptions : {
minValue : 1 ,
} ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
// ----------------------------------------
// account: update
// ----------------------------------------
{
displayName : 'Account ID' ,
name : 'accountId' ,
description : 'ID of the account to update' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'update' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'account' ] ,
operation : [ 'update' ] ,
2021-07-30 07:12:30 -07:00
} ,
} ,
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Business Type Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'business_type_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getBusinessTypes' ,
} ,
2022-08-01 13:47:55 -07:00
description :
'ID of the business that the account belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Industry Type Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'industry_type_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getIndustryTypes' ,
} ,
2022-08-01 13:47:55 -07:00
description :
'ID of the industry that the account belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Owner Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'owner_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
2022-08-01 13:47:55 -07:00
description :
'ID of the user to whom the account is assigned. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
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' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Territory Name or ID' ,
2021-07-30 07:12:30 -07:00
name : 'territory_id' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getTerritories' ,
} ,
2022-08-01 13:47:55 -07:00
description :
'ID of the territory that the account belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-30 07:12:30 -07:00
} ,
{
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' ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;