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

570 lines
11 KiB
TypeScript
Raw Normal View History

2021-01-13 11:20:30 -08:00
import { INodeProperties } from 'n8n-workflow';
2019-11-21 09:39:04 -08:00
export const userOpeations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'user',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new user',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a user',
},
2019-11-21 09:39:04 -08:00
{
name: 'Get',
value: 'get',
description: 'Get data of a user',
2019-11-21 09:39:04 -08:00
},
{
name: 'Get All',
value: 'getAll',
description: 'Get data of all users',
2019-11-21 09:39:04 -08:00
},
{
name: 'Update',
value: 'update',
description: 'Update a user',
2019-11-21 09:39:04 -08:00
},
],
default: 'create',
2019-11-21 09:39:04 -08:00
description: 'The operation to perform.',
},
] as INodeProperties[];
export const userFields = [
/* -------------------------------------------------------------------------- */
/* user:delete */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'ID',
name: 'id',
type: 'string',
required: true,
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'delete',
],
},
},
default: '',
description: 'The Intercom defined id representing the Lead',
},
/* -------------------------------------------------------------------------- */
/* user: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: [
'user',
],
operation: [
'getAll',
2019-11-21 09:39:04 -08:00
],
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 60,
},
default: 50,
description: 'How many results to return.',
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'getAll',
],
2019-11-21 09:39:04 -08:00
},
},
options: [
2019-11-21 09:39:04 -08:00
{
displayName: 'Company ID',
name: 'company_id',
type: 'string',
2019-11-21 09:39:04 -08:00
default: '',
description: 'Company ID representing the user',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Email',
name: 'email',
type: 'string',
2019-11-21 09:39:04 -08:00
default: '',
description: 'The email address of the user',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Segment ID',
name: 'segment_id',
type: 'string',
2019-11-21 09:39:04 -08:00
default: '',
description: 'Segment representing the user',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Tag ID',
name: 'tag_id',
type: 'string',
2019-11-21 09:39:04 -08:00
default: '',
description: 'Tag representing the user',
2019-11-21 09:39:04 -08:00
},
],
},
/* -------------------------------------------------------------------------- */
/* user: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: [
'user',
],
operation: [
'get',
2019-11-21 09:39:04 -08:00
],
},
},
options: [
{
name: 'ID',
value: 'id',
default: '',
description: 'The Intercom defined id representing the Lead',
},
{
name: 'User ID',
value: 'userId',
default: '',
description: 'Automatically generated identifier for the Lead',
},
],
default: '',
description: 'The property to select the user by.',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'get',
2019-11-21 09:39:04 -08:00
],
},
},
description: 'View by value',
},
/* -------------------------------------------------------------------------- */
/* user:update */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'Update By',
name: 'updateBy',
type: 'options',
2019-11-21 09:39:04 -08:00
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'update',
],
},
},
options: [
{
name: 'ID',
value: 'id',
description: 'The Intercom defined id representing the user',
2019-11-21 09:39:04 -08:00
},
{
name: 'Email',
value: 'email',
description: 'The email address of user',
},
{
name: 'User ID',
value: 'userId',
description: 'Automatically generated identifier for the user',
},
],
default: 'id',
description: 'The property via which to query the user.',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Value',
name: 'value',
2019-11-21 09:39:04 -08:00
type: 'string',
default: '',
required: true,
2019-11-21 09:39:04 -08:00
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'update',
],
},
},
description: 'Value of the property to identify the user to update',
2019-11-21 09:39:04 -08:00
},
/* -------------------------------------------------------------------------- */
/* user:create */
/* -------------------------------------------------------------------------- */
2019-11-21 09:39:04 -08:00
{
displayName: 'Identifier Type',
name: 'identifierType',
2019-11-21 09:39:04 -08:00
type: 'options',
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'create',
],
},
},
options: [
{
name: 'User ID',
2019-11-21 09:39:04 -08:00
value: 'userId',
description: 'A unique string identifier for the user. It is required on creation if an email is not supplied.',
},
{
name: 'Email',
value: 'email',
description: `The user's email address. It is required on creation if a user_id is not supplied.`,
},
],
default: '',
description: 'Unique string identifier',
},
{
displayName: 'Value',
name: 'idValue',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'create',
],
},
},
description: 'Unique string identifier value',
},
{
displayName: 'JSON Parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
description: '',
displayOptions: {
show: {
operation: [
'create',
'update',
],
resource: [
2020-10-22 06:46:03 -07:00
'user',
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: [
2020-10-22 06:46:03 -07:00
'user',
2019-11-21 09:39:04 -08:00
],
},
},
options: [
{
displayName: 'Avatar',
name: 'avatar',
type: 'string',
default: '',
description: 'An avatar image URL. note: the image url needs to be https.',
},
{
displayName: 'Companies',
name: 'companies',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getCompanies',
},
default: [],
description: 'Identifies the companies this user belongs to.',
},
{
displayName: 'Email',
name: 'email',
displayOptions: {
show: {
'/operation': [
'update',
],
'/resource': [
2020-10-22 06:46:03 -07:00
'user',
],
},
hide: {
'/updateBy': [
'email',
2020-10-22 06:46:03 -07:00
],
},
},
type: 'string',
default: '',
description: 'Email of the user',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
placeholder: '',
description: 'Name of the user',
},
{
displayName: 'Phone',
name: 'phone',
type: 'string',
default: '',
description: 'The phone number of the user',
},
{
displayName: 'Session Count',
name: 'sessionCount',
type: 'number',
default: false,
options: [],
description: `How many sessions the user has recorded`,
},
{
displayName: 'User ID',
name: 'userId',
displayOptions: {
show: {
'/operation': [
'update',
],
'/resource': [
2020-10-22 06:46:03 -07:00
'user',
],
},
hide: {
'/updateBy': [
'email',
'userId',
2020-10-22 06:46:03 -07:00
],
},
},
type: 'string',
default: '',
description: 'Email of the user',
},
2019-11-21 09:39:04 -08:00
{
displayName: 'Unsubscribed From Emails',
name: 'unsubscribedFromEmails',
type: 'boolean',
default: '',
placeholder: '',
description: 'Whether the user is unsubscribed from emails',
},
{
displayName: 'Update Last Request At',
name: 'updateLastRequestAt',
type: 'boolean',
default: false,
options: [],
: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: 'A boolean value, which if true, instructs Intercom to update the users last_request_at value to the current API service time in UTC.',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'UTM Campaign',
name: 'utmCampaign',
2019-11-21 09:39:04 -08:00
type: 'string',
default: '',
description: 'Identifies a specific product promotion or strategic campaign',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'UTM Content',
name: 'utmContent',
2019-11-21 09:39:04 -08:00
type: 'string',
default: '',
description: 'Identifies what specifically was clicked to bring the user to the site',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'UTM Medium',
name: 'utmMedium',
type: 'string',
default: '',
description: 'Identifies what type of link was used',
},
{
displayName: 'UTM Source',
name: 'utmSource',
2019-11-21 09:39:04 -08:00
type: 'string',
default: '',
description: 'An avatar image URL. note: the image url needs to be https.',
2019-11-21 09:39:04 -08:00
},
{
displayName: 'UTM Term',
name: 'utmTerm',
type: 'string',
default: '',
description: 'Identifies search terms',
},
2020-10-22 06:46:03 -07:00
],
2019-11-21 09:39:04 -08:00
},
{
displayName: 'Custom Attributes',
name: 'customAttributesJson',
type: 'json',
required: false,
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
resource: [
'user',
],
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,
},
required: false,
displayOptions: {
show: {
resource: [
'user',
],
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: '',
},
],
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.',
},
] as INodeProperties[];