n8n/packages/nodes-base/nodes/Intercom/CompanyDescription.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

382 lines
7.9 KiB
TypeScript
Raw Normal View History

import type { INodeProperties } from 'n8n-workflow';
2019-11-21 09:39:04 -08:00
export const companyOperations: INodeProperties[] = [
2019-11-21 09:39:04 -08:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
refactor: Apply more nodelinting rules (#3324) * :pencil2: Alphabetize lint rules * :fire: Remove duplicates * :zap: Update `lintfix` script * :shirt: Apply `node-param-operation-without-no-data-expression` (#3329) * :shirt: Apply `node-param-operation-without-no-data-expression` * :shirt: Add exceptions * :shirt: Apply `node-param-description-weak` (#3328) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-value-duplicate` (#3331) * :shirt: Apply `node-param-description-miscased-json` (#3337) * :shirt: Apply `node-param-display-name-excess-inner-whitespace` (#3335) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-type-options-missing-from-limit` (#3336) * Rule workig as intended * :pencil2: Uncomment rules Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-name-duplicate` (#3338) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-wrong-for-simplify` (#3334) * :zap: fix * :zap: exceptions * :zap: changed rule ignoring from file to line * :shirt: Apply `node-param-resource-without-no-data-expression` (#3339) * :shirt: Apply `node-param-display-name-untrimmed` (#3341) * :shirt: Apply `node-param-display-name-miscased-id` (#3340) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-resource-with-plural-option` (#3342) * :shirt: Apply `node-param-description-wrong-for-upsert` (#3333) * :zap: fix * :zap: replaced record with contact in description * :zap: fix Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-description-identical-to-name` (#3343) * :shirt: Apply `node-param-option-name-containing-star` (#3347) * :shirt: Apply `node-param-display-name-wrong-for-update-fields` (#3348) * :shirt: Apply `node-param-option-name-wrong-for-get-all` (#3345) * :zap: fix * :zap: exceptions * :shirt: Apply node-param-display-name-wrong-for-simplify (#3344) * Rule working as intended * Uncomented other rules * :shirt: Undo and add exceptions Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :zap: Alphabetize lint rules * :zap: 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>
2022-05-20 14:47:24 -07:00
noDataExpression: true,
2019-11-21 09:39:04 -08:00
displayOptions: {
show: {
resource: ['company'],
2019-11-21 09:39:04 -08:00
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new company',
action: 'Create a company',
2019-11-21 09:39:04 -08:00
},
{
name: 'Get',
value: 'get',
description: 'Get data of a company',
action: 'Get a company',
2019-11-21 09:39:04 -08:00
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get data of many companies',
action: 'Get many companies',
2019-11-21 09:39:04 -08:00
},
{
name: 'Update',
value: 'update',
description: 'Update a company',
action: 'Update a company',
2019-11-21 09:39:04 -08:00
},
{
2019-11-21 09:52:57 -08:00
name: 'Users',
value: 'users',
description: "List company's users",
action: 'List users of a company',
2019-11-21 09:39:04 -08:00
},
],
default: 'create',
2019-11-21 09:39:04 -08:00
},
];
2019-11-21 09:39:04 -08:00
export const companyFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* company:users */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'List By',
name: 'listBy',
type: 'options',
displayOptions: {
show: {
resource: ['company'],
operation: ['users'],
2019-11-21 09:39:04 -08:00
},
},
options: [
{
name: 'ID',
value: 'id',
description: 'The Intercom defined ID representing the company',
2019-11-21 09:39:04 -08:00
},
{
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'],
2019-11-21 09:39:04 -08:00
},
},
description: 'View by value',
},
2021-04-24 08:42:31 -07:00
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['company'],
operation: ['users'],
2021-04-24 08:42:31 -07:00
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
2021-04-24 08:42:31 -07:00
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['company'],
operation: ['users'],
returnAll: [false],
2021-04-24 08:42:31 -07:00
},
},
typeOptions: {
minValue: 1,
maxValue: 60,
},
default: 50,
description: 'Max number of results to return',
2021-04-24 08:42:31 -07:00
},
/* -------------------------------------------------------------------------- */
/* company:getAll */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
2019-11-21 09:39:04 -08:00
displayOptions: {
show: {
resource: ['company'],
operation: ['getAll'],
2019-11-21 09:39:04 -08:00
},
},
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],
2019-11-21 09:39:04 -08:00
},
},
typeOptions: {
minValue: 1,
maxValue: 60,
},
default: 50,
description: 'Max number of results to return',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
2019-11-21 09:39:04 -08:00
displayOptions: {
show: {
resource: ['company'],
operation: ['getAll'],
2019-11-21 09:39:04 -08:00
},
},
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',
},
2020-10-22 06:46:03 -07:00
],
2019-11-21 09:39:04 -08:00
},
/* -------------------------------------------------------------------------- */
/* company:get */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'Select By',
name: 'selectBy',
2019-11-21 09:39:04 -08:00
type: 'options',
displayOptions: {
show: {
resource: ['company'],
operation: ['get'],
2019-11-21 09:39:04 -08:00
},
},
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',
},
2019-11-21 09:39:04 -08:00
{
name: 'Name',
value: 'name',
description: 'The name of the company',
},
],
default: '',
description: 'What property to use to query the company',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['company'],
operation: ['get'],
2019-11-21 09:39:04 -08:00
},
},
description: 'View by value',
},
/* -------------------------------------------------------------------------- */
/* company:create/update */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
refactor: Apply more nodelinting rules (#3324) * :pencil2: Alphabetize lint rules * :fire: Remove duplicates * :zap: Update `lintfix` script * :shirt: Apply `node-param-operation-without-no-data-expression` (#3329) * :shirt: Apply `node-param-operation-without-no-data-expression` * :shirt: Add exceptions * :shirt: Apply `node-param-description-weak` (#3328) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-value-duplicate` (#3331) * :shirt: Apply `node-param-description-miscased-json` (#3337) * :shirt: Apply `node-param-display-name-excess-inner-whitespace` (#3335) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-type-options-missing-from-limit` (#3336) * Rule workig as intended * :pencil2: Uncomment rules Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-name-duplicate` (#3338) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-wrong-for-simplify` (#3334) * :zap: fix * :zap: exceptions * :zap: changed rule ignoring from file to line * :shirt: Apply `node-param-resource-without-no-data-expression` (#3339) * :shirt: Apply `node-param-display-name-untrimmed` (#3341) * :shirt: Apply `node-param-display-name-miscased-id` (#3340) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-resource-with-plural-option` (#3342) * :shirt: Apply `node-param-description-wrong-for-upsert` (#3333) * :zap: fix * :zap: replaced record with contact in description * :zap: fix Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-description-identical-to-name` (#3343) * :shirt: Apply `node-param-option-name-containing-star` (#3347) * :shirt: Apply `node-param-display-name-wrong-for-update-fields` (#3348) * :shirt: Apply `node-param-option-name-wrong-for-get-all` (#3345) * :zap: fix * :zap: exceptions * :shirt: Apply node-param-display-name-wrong-for-simplify (#3344) * Rule working as intended * Uncomented other rules * :shirt: Undo and add exceptions Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :zap: Alphabetize lint rules * :zap: 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>
2022-05-20 14:47:24 -07:00
displayName: 'Company ID',
2019-11-21 09:39:04 -08:00
name: 'companyId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: ['company'],
operation: ['create', 'update'],
2019-11-21 09:39:04 -08:00
},
},
description: 'The company ID you have defined for the company',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'JSON Parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
displayOptions: {
show: {
operation: ['create', 'update'],
resource: ['company'],
2019-11-21 09:39:04 -08:00
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
2019-11-21 09:39:04 -08:00
type: 'collection',
placeholder: 'Add Field',
2019-11-21 09:39:04 -08:00
default: {},
displayOptions: {
show: {
operation: ['create', 'update'],
resource: ['company'],
2019-11-21 09:39:04 -08:00
},
},
options: [
{
displayName: 'Industry',
name: 'industry',
type: 'string',
default: '',
description: 'The industry that this company operates in',
},
2019-11-21 09:39:04 -08:00
{
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.",
2019-11-21 09:39:04 -08:00
},
2020-10-22 06:46:03 -07:00
],
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Custom Attributes',
name: 'customAttributesJson',
type: 'json',
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
resource: ['company'],
operation: ['create', 'update'],
jsonParameters: [true],
2019-11-21 09:39:04 -08:00
},
},
default: '',
description:
'A hash of key/value pairs to represent custom data you want to attribute to a user',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Custom Attributes',
name: 'customAttributesUi',
type: 'fixedCollection',
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
default: {},
2019-11-21 09:39:04 -08:00
placeholder: 'Add Attribute',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
resource: ['company'],
operation: ['create', 'update'],
jsonParameters: [false],
2019-11-21 09:39:04 -08:00
},
},
options: [
{
name: 'customAttributesValues',
displayName: 'Attributes',
values: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
},
],
2020-10-22 06:46:03 -07:00
},
2019-11-21 09:39:04 -08:00
],
description:
'A hash of key/value pairs to represent custom data you want to attribute to a user',
2019-11-21 09:39:04 -08:00
},
];