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

636 lines
12 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 conversationOperations: INodeProperties[] = [
2020-03-16 19:02:48 -07: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,
2020-03-16 19:02:48 -07:00
displayOptions: {
show: {
resource: [
'conversation',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new conversation',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a conversation',
},
{
name: 'Get',
value: 'get',
description: 'Get a conversation',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all conversations',
},
],
default: 'create',
},
];
2020-03-16 19:02:48 -07:00
export const conversationFields: INodeProperties[] = [
2020-03-16 19:02:48 -07:00
/* -------------------------------------------------------------------------- */
/* conversation:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Mailbox',
name: 'mailboxId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getMailboxes',
},
required: true,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'conversation',
],
},
},
default: '',
description: 'ID of a mailbox where the conversation is being created',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
required: true,
options: [
{
name: 'Active',
value: 'active',
},
{
name: 'Closed',
value: 'closed',
},
{
name: 'Pending',
value: 'pending',
},
],
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'conversation',
],
},
},
default: '',
description: 'Conversation status',
},
{
displayName: 'Subject',
name: 'subject',
type: 'string',
required: true,
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'conversation',
],
},
},
default: '',
description: 'Conversations subject',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Type',
name: 'type',
required: true,
type: 'options',
options: [
{
name: 'Chat',
value: 'chat',
},
{
name: 'Email',
value: 'email',
},
{
name: 'Phone',
value: 'phone',
},
],
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'conversation',
],
},
},
default: '',
description: 'Conversation type',
},
{
displayName: 'Resolve Data',
name: 'resolveData',
type: 'boolean',
default: true,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'conversation',
],
},
},
:zap: Remove unnessasry <br/> (#2340) * introduce analytics * add user survey backend * add user survey backend * set answers on survey submit Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * change name to personalization * lint Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * N8n 2495 add personalization modal (#2280) * update modals * add onboarding modal * implement questions * introduce analytics * simplify impl * implement survey handling * add personalized cateogry * update modal behavior * add thank you view * handle empty cases * rename modal * standarize modal names * update image, add tags to headings * remove unused file * remove unused interfaces * clean up footer spacing * introduce analytics * refactor to fix bug * update endpoint * set min height * update stories * update naming from questions to survey * remove spacing after core categories * fix bug in logic * sort nodes * rename types * merge with be * rename userSurvey * clean up rest api * use constants for keys * use survey keys * clean up types * move personalization to its own file Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> * update parameter inputs to be multiline * update spacing * Survey new options (#2300) * split up options * fix quotes * remove unused import * refactor node credentials * add user created workflow event (#2301) * update multi params * simplify env vars * fix versionCli on FE * update personalization env * clean up node detail settings * fix event User opened Credentials panel * fix font sizes across modals * clean up input spacing * fix select modal spacing * increase spacing * fix input copy * fix webhook, tab spacing, retry button * fix button sizes * fix button size * add mini xlarge sizes * fix webhook spacing * fix nodes panel event * fix workflow id in workflow execute event * improve telemetry error logging * fix config and stop process events * add flush call on n8n stop * ready for release * fix input error highlighting * revert change * update toggle spacing * fix delete positioning * keep tooltip while focused * set strict size * increase left spacing * fix sort icons * remove unnessasry <br/> * remove unnessary break * remove unnessary margin * clean unused functionality * remove unnessary css * remove duplicate tracking * only show tooltip when hovering over label * remove extra space * add br * remove extra space * clean up commas * clean up commas * remove extra space * remove extra space * rewrite desc * add commas * add space * remove extra space * add space * add dot * update credentials section * use includes Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-10-27 13:00:13 -07:00
description: 'By default the response only contain the ID to resource. If this option gets activated, it will resolve the data automatically.',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'conversation',
],
},
},
options: [
{
displayName: 'Assign To',
name: 'assignTo',
type: 'number',
default: 0,
description: 'The Help Scout user assigned to the conversation',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Auto Reply',
name: 'autoReply',
type: 'boolean',
default: false,
description: 'When autoReply is set to true, an auto reply will be sent as long as there is at least one customer thread in the conversation',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Closed At',
name: 'closedAt',
type: 'dateTime',
default: '',
description: 'When the conversation was closed, only applicable for imported conversations',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Created At',
name: 'createdAt',
type: 'dateTime',
default: '',
description: 'When this conversation was created - ISO 8601 date time',
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: '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
},
{
displayName: 'Tags',
name: 'tags',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getTags',
},
default: [],
description: 'List of tags to be be added to the conversation',
},
{
displayName: 'User ID',
name: 'user',
type: 'number',
default: 0,
description: 'ID of the user who is adding the conversation and threads',
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: 'Threads',
name: 'threadsUi',
placeholder: 'Add Thread',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'conversation',
],
},
},
default: {},
options: [
{
displayName: 'Thread',
name: 'threadsValues',
values: [
{
displayName: 'Type',
name: 'type',
type: 'options',
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',
typeOptions: {
2020-10-22 06:46:03 -07:00
alwaysOpenEditWindow: true,
2020-03-16 19:02:48 -07:00
},
default: '',
description: 'The message text',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Bcc',
name: 'bcc',
displayOptions: {
show: {
type: [
2020-10-22 06:46:03 -07:00
'customer',
2020-03-16 19:02:48 -07:00
],
},
},
type: 'string',
typeOptions: {
multipleValues: true,
multipleValueButtonText: 'Add Email',
},
default: [],
description: 'Email addresses',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Cc',
name: 'cc',
displayOptions: {
show: {
type: [
2020-10-22 06:46:03 -07:00
'customer',
2020-03-16 19:02:48 -07:00
],
},
},
type: 'string',
typeOptions: {
multipleValues: true,
multipleValueButtonText: 'Add Email',
},
default: [],
description: 'Email addresses',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Draft',
name: 'draft',
displayOptions: {
show: {
type: [
2020-10-22 06:46:03 -07:00
'reply',
2020-03-16 19:02:48 -07:00
],
},
},
type: 'boolean',
default: false,
description: 'If set to true, a draft reply is created',
},
],
},
],
},
/* -------------------------------------------------------------------------- */
/* conversation:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Conversation ID',
name: 'conversationId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'conversation',
],
operation: [
'get',
],
},
},
},
/* -------------------------------------------------------------------------- */
/* conversation:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Conversation ID',
name: 'conversationId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'conversation',
],
operation: [
'delete',
],
},
},
},
/* -------------------------------------------------------------------------- */
/* conversation:getAll */
/* -------------------------------------------------------------------------- */
2020-03-29 19:08:00 -07:00
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'conversation',
],
},
},
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: [
'conversation',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
2020-03-29 19:08:00 -07:00
},
2020-03-16 19:02:48 -07:00
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
resource: [
'conversation',
],
operation: [
'getAll',
],
},
},
options: [
2020-03-29 10:10:54 -07:00
{
displayName: 'Assign To',
name: 'assignTo',
type: 'number',
default: 0,
description: 'Filters conversations by assignee ID',
2020-03-29 10:10:54 -07:00
},
2020-03-16 19:02:48 -07:00
{
displayName: 'Embed',
name: 'embed',
type: 'options',
options: [
{
name: 'Threads',
value: 'threads',
},
],
default: '',
description: 'Allows embedding/loading of sub-entities',
},
{
displayName: 'Folder ID',
name: 'folder',
type: 'string',
default: '',
description: 'Filters conversations from a specific folder ID',
2020-03-16 19:02:48 -07:00
},
{
2020-03-29 10:10:54 -07:00
displayName: 'Mailbox ID',
name: 'mailbox',
type: 'string',
default: '',
description: 'Filters conversations from a specific mailbox',
2020-03-16 19:02:48 -07:00
},
{
displayName: 'Modified Since',
name: 'modifiedSince',
type: 'dateTime',
default: '',
description: 'Returns only conversations that were modified after this date',
},
{
displayName: 'Number',
name: 'number',
type: 'number',
default: 0,
typeOptions: {
minValue: 0,
},
description: 'Looks up conversation by conversation number',
},
2020-03-29 10:10:54 -07:00
{
displayName: 'Query',
name: 'query',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
2020-10-22 06:46:03 -07:00
description: 'Advanced search <a href="https://developer.helpscout.com/mailbox-api/endpoints/conversations/list/#query">Examples</a>',
2020-03-29 10:10:54 -07:00
},
2020-03-16 19:02:48 -07:00
{
displayName: 'Sort Field',
name: 'sortField',
type: 'options',
options: [
{
name: 'Created At',
value: 'createdAt',
},
{
name: 'customer Email',
value: 'customerEmail',
},
{
name: 'customer Name',
value: 'customerName',
},
{
name: 'Mailbox ID',
value: 'mailboxid',
},
{
name: 'Modified At',
value: 'modifiedAt',
},
{
name: 'Number',
value: 'number',
},
{
name: 'Score',
value: 'score',
},
{
name: 'Status',
value: 'status',
},
{
name: 'Subject',
value: 'subject',
},
],
default: '',
description: 'Sorts the result by specified field',
},
{
displayName: 'Sort Order',
name: 'sortOrder',
type: 'options',
options: [
{
name: 'ASC',
value: 'asc',
},
{
2020-03-30 00:20:40 -07:00
name: 'DESC',
2020-03-16 19:02:48 -07:00
value: 'desc',
},
],
default: 'desc',
},
{
2020-03-29 10:10:54 -07:00
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Active',
value: 'active',
},
{
name: 'All',
value: 'all',
},
{
name: 'Closed',
value: 'closed',
},
{
name: 'Open',
value: 'open',
},
{
name: 'Pending',
value: 'pending',
},
{
name: 'Spam',
value: 'spam',
},
],
default: 'active',
description: 'Filter conversation by status',
},
{
displayName: 'Tags',
name: 'tags',
type: 'multiOptions',
2020-03-16 19:02:48 -07:00
typeOptions: {
2020-03-29 10:10:54 -07:00
loadOptionsMethod: 'getTags',
2020-03-16 19:02:48 -07:00
},
2020-03-29 10:10:54 -07:00
default: [],
description: 'Filter conversation by tags',
2020-03-16 19:02:48 -07:00
},
],
},
];