mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-16 01:24:05 -08:00
1529550b14
* ✨ Create Monica node * ⚡ Fix default values * 🔥 Remove excess spacing * ⚡ Improvements * ⚡ Improvements * ⚡ Add environment parameter * ⚡ Add sort parameter to contact:getAll * ⚡ Minor improvements Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
208 lines
3.6 KiB
TypeScript
208 lines
3.6 KiB
TypeScript
import {
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export const conversationOperations = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create a conversation',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete a conversation',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Retrieve a conversation',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update a conversation',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
] as INodeProperties[];
|
|
|
|
export const conversationFields = [
|
|
// ----------------------------------------
|
|
// conversation: create
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Contact ID',
|
|
name: 'contactId',
|
|
description: 'ID of the contact to associate the conversation with',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Contact Field Type',
|
|
name: 'contactFieldTypeId',
|
|
type: 'options',
|
|
required: true,
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getContactFieldTypes',
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Happened At',
|
|
name: 'happenedAt',
|
|
description: 'Date when the conversation happened',
|
|
type: 'dateTime',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// conversation: delete
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Conversation ID',
|
|
name: 'conversationId',
|
|
description: 'ID of the conversation to delete',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
operation: [
|
|
'delete',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// conversation: get
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Conversation ID',
|
|
name: 'conversationId',
|
|
description: 'ID of the conversation to retrieve',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
operation: [
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// conversation: update
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Conversation ID',
|
|
name: 'conversationId',
|
|
description: 'ID of the conversation to update',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Contact Field Type',
|
|
name: 'contactFieldTypeId',
|
|
type: 'options',
|
|
required: true,
|
|
default: '',
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getContactFieldTypes',
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Happened At',
|
|
name: 'happenedAt',
|
|
description: 'Date when the conversation happened',
|
|
type: 'dateTime',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'conversation',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
] as INodeProperties[];
|