n8n/packages/nodes-base/nodes/Freshdesk/ContactDescription.ts

400 lines
8.9 KiB
TypeScript
Raw Normal View History

import { INodeProperties } from 'n8n-workflow';
export const contactOperations: INodeProperties[] = [
{
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,
required: true,
displayOptions: {
show: {
resource: ['contact'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new contact',
action: 'Create a contact',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a contact',
action: 'Delete a contact',
},
{
name: 'Get',
value: 'get',
description: 'Get a contact',
action: 'Get a contact',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many contacts',
action: 'Get many contacts',
},
{
name: 'Update',
value: 'update',
description: 'Update a contact',
action: 'Update a contact',
},
],
default: 'create',
},
];
export const contactFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* contact:create/update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Name',
name: 'name',
type: 'string',
placeholder: '',
displayOptions: {
show: {
operation: ['create'],
resource: ['contact'],
},
},
default: '',
description: 'Name of the contact',
required: true,
},
{
displayName: 'Email',
name: 'email',
type: 'string',
refactor: Apply more `eslint-plugin-n8n-nodes-base` rules (#3534) * :zap: Update `lintfix` script * :zap: Run baseline `lintfix` * :fire: Remove unneeded exceptions (#3538) * :fire: Remove exceptions for `node-param-default-wrong-for-simplify` * :fire: Remove exceptions for `node-param-placeholder-miscased-id` * :zap: Update version * :shirt: Apply `node-param-placeholder-missing` (#3542) * :shirt: Apply `filesystem-wrong-cred-filename` (#3543) * :shirt: Apply `node-param-description-missing-from-dynamic-options` (#3545) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-class-description-empty-string` (#3546) * :shirt: Apply `node-class-description-icon-not-svg` (#3548) * :shirt: Apply `filesystem-wrong-node-filename` (#3549) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Expand lintings to credentials (#3550) * :shirt: Apply `node-param-multi-options-type-unsorted-items` (#3552) * :zap: fix * :zap: Minor fixes Co-authored-by: Michael Kret <michael.k@radency.com> * :shirt: Apply `node-param-description-wrong-for-dynamic-multi-options` (#3541) * :zap: Add new lint rule, node-param-description-wrong-for-dynamic-multi-options * :zap: Fix with updated linting rules * :zap: Minor fixes Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-boolean-without-whether` (#3553) * :zap: fix * Update packages/nodes-base/nodes/Clockify/ProjectDescription.ts Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply node-param-display-name-wrong-for-dynamic-multi-options (#3537) * :shirt: Add exceptions * :shirt: Add exception * :pencil2: Alphabetize rules * :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: 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>
2022-06-20 07:54:01 -07:00
placeholder: 'name@email.com',
default: '',
displayOptions: {
show: {
operation: ['create'],
resource: ['contact'],
},
},
description:
'Primary email address of the contact. If you want to associate additional email(s) with this contact, use the other_emails attribute.',
},
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: ['contact'],
operation: ['update'],
},
},
required: true,
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: ['create', 'update'],
resource: ['contact'],
},
},
default: {},
options: [
{
displayName: 'Address',
name: 'address',
type: 'string',
default: '',
description: 'Address of the contact',
},
// {
// displayName: 'Avatar',
// name: 'avatar',
// type: '',
// default: '',
// description: `Avatar image of the contact The maximum file size is 5MB
// and the supported file types are .jpg, .jpeg, .jpe, and .png.`,
// },
{
displayName: 'Company ID',
name: 'company_id',
type: 'number',
default: '',
description: 'ID of the primary company to which this contact belongs',
},
{
displayName: 'Custom Fields',
name: 'customFields',
type: 'fixedCollection',
placeholder: 'Add Custom Field',
typeOptions: {
multipleValues: true,
},
description:
'Key value pairs containing the name and value of the custom field. Only dates in the format YYYY-MM-DD are accepted as input for custom date fields.',
default: [],
options: [
{
displayName: 'Custom Field',
name: 'customField',
values: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: "Custom Field's name",
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
description: "Custom Field's values",
},
2020-10-22 06:46:03 -07:00
],
},
],
},
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'A small description of the contact',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
refactor: Apply more `eslint-plugin-n8n-nodes-base` rules (#3534) * :zap: Update `lintfix` script * :zap: Run baseline `lintfix` * :fire: Remove unneeded exceptions (#3538) * :fire: Remove exceptions for `node-param-default-wrong-for-simplify` * :fire: Remove exceptions for `node-param-placeholder-miscased-id` * :zap: Update version * :shirt: Apply `node-param-placeholder-missing` (#3542) * :shirt: Apply `filesystem-wrong-cred-filename` (#3543) * :shirt: Apply `node-param-description-missing-from-dynamic-options` (#3545) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-class-description-empty-string` (#3546) * :shirt: Apply `node-class-description-icon-not-svg` (#3548) * :shirt: Apply `filesystem-wrong-node-filename` (#3549) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Expand lintings to credentials (#3550) * :shirt: Apply `node-param-multi-options-type-unsorted-items` (#3552) * :zap: fix * :zap: Minor fixes Co-authored-by: Michael Kret <michael.k@radency.com> * :shirt: Apply `node-param-description-wrong-for-dynamic-multi-options` (#3541) * :zap: Add new lint rule, node-param-description-wrong-for-dynamic-multi-options * :zap: Fix with updated linting rules * :zap: Minor fixes Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-boolean-without-whether` (#3553) * :zap: fix * Update packages/nodes-base/nodes/Clockify/ProjectDescription.ts Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply node-param-display-name-wrong-for-dynamic-multi-options (#3537) * :shirt: Add exceptions * :shirt: Add exception * :pencil2: Alphabetize rules * :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: 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>
2022-06-20 07:54:01 -07:00
placeholder: 'name@email.com',
default: '',
displayOptions: {
show: {
'/operation': ['update'],
},
},
description:
'Primary email address of the contact. If you want to associate additional email(s) with this contact, use the other_emails attribute.',
},
{
displayName: 'Job Title',
name: 'job_title',
type: 'string',
default: '',
description: 'Job title of the contact',
},
{
displayName: 'Language',
name: 'language',
type: 'string',
default: '',
description:
'Language of the contact. Default language is "en". This attribute can only be set if the Multiple Language feature is enabled (Garden plan and above).',
},
{
displayName: 'Mobile',
name: 'mobile',
type: 'string',
default: '',
description: 'Mobile number of the contact',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
displayOptions: {
show: {
'/operation': ['update'],
},
},
description: 'Name of the contact',
},
{
displayName: 'Other Companies',
name: 'other_companies',
type: 'string',
default: [],
typeOptions: {
multipleValues: true,
},
placeholder: 'Add Company',
description:
'Additional companies associated with the contact. This attribute can only be set if the Multiple Companies feature is enabled (Estate plan and above).',
},
{
displayName: 'Other Emails',
name: 'other_emails',
type: 'string',
default: [],
typeOptions: {
multipleValues: true,
},
placeholder: 'Add Email',
description: 'Additional emails associated with the contact',
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
description: 'Telephone number of the contact',
},
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: [],
typeOptions: {
multipleValues: true,
},
description: 'Tags associated with this contact',
},
{
displayName: 'Time Zone',
name: 'time_zone',
type: 'string',
default: '',
description:
'Time zone of the contact. Default value is the time zone of the domain. This attribute can only be set if the Multiple Time Zone feature is enabled (Garden plan and above).',
},
{
displayName: 'Twitter ID',
name: 'twitter_id',
type: 'string',
default: '',
description: 'Twitter handle of the contact',
},
{
displayName: 'Unique External ID',
name: 'unique_external_id',
type: 'string',
default: '',
description: 'External ID of the contact',
},
{
displayName: 'View All Tickets',
name: 'view_all_tickets',
type: 'boolean',
default: false,
description:
'Whether the contact can see all the tickets that are associated with the company to which they belong',
},
],
},
/* -------------------------------------------------------------------------- */
/* contact:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: ['contact'],
operation: ['delete'],
},
},
required: true,
},
/* -------------------------------------------------------------------------- */
/* contact:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: ['contact'],
operation: ['get'],
},
},
required: true,
},
/* -------------------------------------------------------------------------- */
/* contact:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
operation: ['getAll'],
resource: ['contact'],
},
},
options: [
{
displayName: 'Company ID',
name: 'company_id',
type: 'number',
default: '',
},
{
displayName: 'Email',
name: 'email',
type: 'string',
refactor: Apply more `eslint-plugin-n8n-nodes-base` rules (#3534) * :zap: Update `lintfix` script * :zap: Run baseline `lintfix` * :fire: Remove unneeded exceptions (#3538) * :fire: Remove exceptions for `node-param-default-wrong-for-simplify` * :fire: Remove exceptions for `node-param-placeholder-miscased-id` * :zap: Update version * :shirt: Apply `node-param-placeholder-missing` (#3542) * :shirt: Apply `filesystem-wrong-cred-filename` (#3543) * :shirt: Apply `node-param-description-missing-from-dynamic-options` (#3545) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-class-description-empty-string` (#3546) * :shirt: Apply `node-class-description-icon-not-svg` (#3548) * :shirt: Apply `filesystem-wrong-node-filename` (#3549) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Expand lintings to credentials (#3550) * :shirt: Apply `node-param-multi-options-type-unsorted-items` (#3552) * :zap: fix * :zap: Minor fixes Co-authored-by: Michael Kret <michael.k@radency.com> * :shirt: Apply `node-param-description-wrong-for-dynamic-multi-options` (#3541) * :zap: Add new lint rule, node-param-description-wrong-for-dynamic-multi-options * :zap: Fix with updated linting rules * :zap: Minor fixes Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-boolean-without-whether` (#3553) * :zap: fix * Update packages/nodes-base/nodes/Clockify/ProjectDescription.ts Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply node-param-display-name-wrong-for-dynamic-multi-options (#3537) * :shirt: Add exceptions * :shirt: Add exception * :pencil2: Alphabetize rules * :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: 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>
2022-06-20 07:54:01 -07:00
placeholder: 'name@email.com',
default: '',
},
{
displayName: 'Mobile',
name: 'mobile',
type: 'string',
default: '',
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'options',
default: '',
options: [
{
name: 'Blocked',
value: 'blocked',
},
{
name: 'Deleted',
value: 'deleted',
},
{
name: 'Unverified',
value: 'unverified',
},
{
name: 'Verified',
value: 'verified',
},
],
},
{
displayName: 'Updated Since',
name: 'updated_since',
type: 'dateTime',
default: '',
},
],
},
];