mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -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>
446 lines
8.1 KiB
TypeScript
446 lines
8.1 KiB
TypeScript
import { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const companyOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create a new company',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Get data of a company',
|
|
},
|
|
{
|
|
name: 'Get All',
|
|
value: 'getAll',
|
|
description: 'Get data of all companies',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update a company',
|
|
},
|
|
{
|
|
name: 'Users',
|
|
value: 'users',
|
|
description: 'List company\'s users',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
];
|
|
|
|
export const companyFields: INodeProperties[] = [
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* company:users */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'List By',
|
|
name: 'listBy',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'users',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'ID',
|
|
value: 'id',
|
|
description: 'The Intercom defined ID representing the company',
|
|
},
|
|
{
|
|
name: 'Company ID',
|
|
value: 'companyId',
|
|
description: 'The company_id you have given to the company',
|
|
},
|
|
],
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'users',
|
|
],
|
|
},
|
|
},
|
|
description: 'View by value',
|
|
},
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'users',
|
|
],
|
|
},
|
|
},
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'users',
|
|
],
|
|
returnAll: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 60,
|
|
},
|
|
default: 50,
|
|
description: 'Max number of results to return',
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* company:getAll */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
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: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
returnAll: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 60,
|
|
},
|
|
default: 50,
|
|
description: 'Max number of results to return',
|
|
},
|
|
{
|
|
displayName: 'Filters',
|
|
name: 'filters',
|
|
type: 'collection',
|
|
placeholder: 'Add Filter',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Segment ID',
|
|
name: 'segment_id',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Segment representing the Lead',
|
|
},
|
|
{
|
|
displayName: 'Tag ID',
|
|
name: 'tag_id',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Tag representing the Lead',
|
|
},
|
|
],
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* company:get */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Select By',
|
|
name: 'selectBy',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Company ID',
|
|
value: 'companyId',
|
|
description: 'The company_id you have given to the company',
|
|
},
|
|
{
|
|
name: 'ID',
|
|
value: 'id',
|
|
description: 'The Intercom defined ID representing the company',
|
|
},
|
|
{
|
|
name: 'Name',
|
|
value: 'name',
|
|
description: 'The name of the company',
|
|
},
|
|
],
|
|
default: '',
|
|
description: 'What property to use to query the company',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
description: 'View by value',
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* company:create/update */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Company ID',
|
|
name: 'companyId',
|
|
type: 'string',
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
description: 'The company ID you have defined for the company',
|
|
},
|
|
{
|
|
displayName: 'JSON Parameters',
|
|
name: 'jsonParameters',
|
|
type: 'boolean',
|
|
default: false,
|
|
displayOptions: {
|
|
show: {
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
],
|
|
resource: [
|
|
'company',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Additional Fields',
|
|
name: 'additionalFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
],
|
|
resource: [
|
|
'company',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Industry',
|
|
name: 'industry',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'The industry that this company operates in',
|
|
},
|
|
{
|
|
displayName: 'Monthly Spend',
|
|
name: 'monthlySpend',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'The phone number of the user',
|
|
},
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
type: 'string',
|
|
default: '',
|
|
placeholder: '',
|
|
description: 'Name of the user',
|
|
},
|
|
{
|
|
displayName: 'Plan',
|
|
name: 'plan',
|
|
type: 'string',
|
|
default: '',
|
|
placeholder: '',
|
|
description: 'The name of the plan you have associated with the company',
|
|
},
|
|
{
|
|
displayName: 'Size',
|
|
name: 'size',
|
|
type: 'number',
|
|
default: '',
|
|
description: 'The number of employees in this company',
|
|
},
|
|
{
|
|
displayName: 'Website',
|
|
name: 'website',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'The URL for this company\'s website. Please note that the value specified here is not validated. Accepts any string.',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Custom Attributes',
|
|
name: 'customAttributesJson',
|
|
type: 'json',
|
|
typeOptions: {
|
|
alwaysOpenEditWindow: true,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
],
|
|
jsonParameters: [
|
|
true,
|
|
],
|
|
},
|
|
},
|
|
default: '',
|
|
description: 'A hash of key/value pairs to represent custom data you want to attribute to a user',
|
|
},
|
|
{
|
|
displayName: 'Custom Attributes',
|
|
name: 'customAttributesUi',
|
|
type: 'fixedCollection',
|
|
default: {},
|
|
placeholder: 'Add Attribute',
|
|
typeOptions: {
|
|
multipleValues: true,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'company',
|
|
],
|
|
operation: [
|
|
'create',
|
|
'update',
|
|
],
|
|
jsonParameters: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'customAttributesValues',
|
|
displayName: 'Attributes',
|
|
values: [
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Value',
|
|
name: 'value',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
description: 'A hash of key/value pairs to represent custom data you want to attribute to a user',
|
|
},
|
|
];
|