n8n/packages/nodes-base/nodes/HelpScout/ThreadDescription.ts

296 lines
5.2 KiB
TypeScript
Raw Normal View History

2020-03-29 10:10:54 -07:00
import { INodeProperties } from 'n8n-workflow';
2020-03-16 19:02:48 -07:00
export const threadOperations: INodeProperties[] = [
2020-03-16 19:02:48 -07:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'thread',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new chat thread',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all chat threads',
},
],
default: 'create',
description: 'The operation to perform.',
},
];
2020-03-16 19:02:48 -07:00
export const threadFields: INodeProperties[] = [
2020-03-16 19:02:48 -07:00
/* -------------------------------------------------------------------------- */
/* thread:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Conversation ID',
name: 'conversationId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'thread',
],
operation: [
'create',
],
},
},
},
{
displayName: 'Type',
name: 'type',
type: 'options',
required: true,
displayOptions: {
show: {
resource: [
'thread',
],
operation: [
'create',
],
},
},
options: [
{
name: 'Chat',
2020-10-22 06:46:03 -07:00
value: 'chat',
2020-03-16 19:02:48 -07:00
},
{
name: 'Customer',
2020-10-22 06:46:03 -07:00
value: 'customer',
2020-03-16 19:02:48 -07:00
},
{
name: 'Note',
2020-10-22 06:46:03 -07:00
value: 'note',
2020-03-16 19:02:48 -07:00
},
{
name: 'Phone',
2020-10-22 06:46:03 -07:00
value: 'phone',
2020-03-16 19:02:48 -07:00
},
{
name: 'Reply',
2020-10-22 06:46:03 -07:00
value: 'reply',
2020-03-16 19:02:48 -07:00
},
],
default: '',
},
{
displayName: 'Text',
name: 'text',
type: 'string',
default: '',
typeOptions: {
alwaysOpenEditWindow: true,
},
required: true,
displayOptions: {
show: {
resource: [
'thread',
],
operation: [
'create',
],
},
},
description: 'The chat text',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'thread',
],
},
},
options: [
2020-03-29 10:10:54 -07:00
{
displayName: 'Created At',
name: 'createdAt',
type: 'dateTime',
default: '',
},
2020-03-16 19:02:48 -07:00
{
displayName: 'Customer Email',
name: 'customerEmail',
type: 'string',
default: '',
},
{
displayName: 'Customer ID',
name: 'customerId',
type: 'number',
default: 0,
},
{
displayName: 'Draft',
name: 'draft',
type: 'boolean',
default: false,
displayOptions: {
show: {
'/type': [
'note',
],
},
},
description: 'If set to true, a draft reply is created',
},
{
displayName: 'Imported',
name: 'imported',
type: 'boolean',
default: false,
description: 'When imported is set to true, no outgoing emails or notifications will be generated',
2020-03-16 19:02:48 -07:00
},
2020-10-22 06:46:03 -07:00
],
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Attachments',
name: 'attachmentsUi',
placeholder: 'Add Attachments',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'thread',
],
},
},
options: [
{
name: 'attachmentsValues',
displayName: 'Attachments Values',
values: [
{
displayName: 'FileName',
name: 'fileName',
type: 'string',
default: '',
description: 'Attachments file name',
},
{
displayName: 'Mime Type',
name: 'mimeType',
type: 'string',
default: '',
description: 'Attachments mime type',
},
{
displayName: 'Data',
name: 'data',
type: 'string',
default: '',
placeholder: 'ZXhhbXBsZSBmaWxl',
description: 'Base64-encoded stream of data',
2020-03-16 19:02:48 -07:00
},
],
},
{
name: 'attachmentsBinary',
displayName: 'Attachments Binary',
values: [
{
displayName: 'Property',
name: 'property',
type: 'string',
default: 'data',
description: 'Name of the binary properties which contain data which should be added to email as attachment',
},
],
},
],
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: {},
description: 'Array of supported attachments to add to the message',
2020-03-16 19:02:48 -07:00
},
/* -------------------------------------------------------------------------- */
/* thread:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Conversation ID',
name: 'conversationId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'thread',
],
operation: [
'getAll',
],
},
},
},
2020-03-29 19:08:00 -07:00
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'thread',
],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
2020-03-29 19:08:00 -07:00
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'thread',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
2020-03-29 19:08:00 -07:00
},
];