n8n-nodes-richpanel 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -6,6 +6,10 @@ This is an n8n community node that provides integration with the [Richpanel](htt
|
|
|
6
6
|
|
|
7
7
|
[Richpanel](https://www.richpanel.com/) is a customer service platform for e-commerce businesses that combines live chat, helpdesk, and self-service capabilities.
|
|
8
8
|
|
|
9
|
+
## ✨ NEW: AI Agent Support
|
|
10
|
+
|
|
11
|
+
This package includes **AI Agent tool support**! Enable AI assistants (OpenAI, Claude, etc.) to automatically perform Richpanel actions. [Read the AI Agent Guide](AI_AGENT_GUIDE.md) to get started.
|
|
12
|
+
|
|
9
13
|
## Table of Contents
|
|
10
14
|
|
|
11
15
|
- [Installation](#installation)
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RichpanelTool = void 0;
|
|
4
|
+
class RichpanelTool {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'Richpanel Tool',
|
|
8
|
+
name: 'richpanelTool',
|
|
9
|
+
icon: 'file:richpanel-logo.png',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
description: 'Use Richpanel operations as AI Agent tools',
|
|
13
|
+
defaults: {
|
|
14
|
+
name: 'Richpanel Tool',
|
|
15
|
+
},
|
|
16
|
+
codex: {
|
|
17
|
+
categories: ['AI'],
|
|
18
|
+
subcategories: {
|
|
19
|
+
AI: ['Tools'],
|
|
20
|
+
},
|
|
21
|
+
resources: {
|
|
22
|
+
primaryDocumentation: [
|
|
23
|
+
{
|
|
24
|
+
url: 'https://developer.richpanel.com/reference/getting-started-with-your-api',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
inputs: [],
|
|
30
|
+
outputs: ['ai_tool'],
|
|
31
|
+
outputNames: ['Tool'],
|
|
32
|
+
credentials: [
|
|
33
|
+
{
|
|
34
|
+
name: 'richpanelApi',
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
requestDefaults: {
|
|
39
|
+
baseURL: 'https://api.richpanel.com/v1',
|
|
40
|
+
headers: {
|
|
41
|
+
Accept: 'application/json',
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
properties: [
|
|
46
|
+
{
|
|
47
|
+
displayName: 'This node will be available as a tool for AI agents. Configure which Richpanel operations the AI can use.',
|
|
48
|
+
name: 'notice',
|
|
49
|
+
type: 'notice',
|
|
50
|
+
default: '',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Available Operations',
|
|
54
|
+
name: 'operations',
|
|
55
|
+
type: 'multiOptions',
|
|
56
|
+
description: 'Select which operations the AI agent can perform',
|
|
57
|
+
default: ['getConversation', 'createConversation', 'getCustomer'],
|
|
58
|
+
options: [
|
|
59
|
+
{
|
|
60
|
+
name: 'Create Conversation',
|
|
61
|
+
value: 'createConversation',
|
|
62
|
+
description: 'Create a new support conversation/ticket',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'Get Conversation',
|
|
66
|
+
value: 'getConversation',
|
|
67
|
+
description: 'Retrieve a conversation by ID',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Update Conversation',
|
|
71
|
+
value: 'updateConversation',
|
|
72
|
+
description: 'Update conversation status, priority, or tags',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'Get Customer',
|
|
76
|
+
value: 'getCustomer',
|
|
77
|
+
description: 'Retrieve customer information by email or phone',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'Create/Update Customer',
|
|
81
|
+
value: 'upsertCustomer',
|
|
82
|
+
description: 'Create or update customer information',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Get Order',
|
|
86
|
+
value: 'getOrder',
|
|
87
|
+
description: 'Retrieve order information',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Add Tags to Conversation',
|
|
91
|
+
value: 'addTags',
|
|
92
|
+
description: 'Add tags to a conversation',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'List Users',
|
|
96
|
+
value: 'listUsers',
|
|
97
|
+
description: 'Get list of support agents/users',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
async supplyData() {
|
|
105
|
+
const operations = this.getNodeParameter('operations', 0);
|
|
106
|
+
const tools = [];
|
|
107
|
+
// Define tool schemas based on selected operations
|
|
108
|
+
if (operations.includes('createConversation')) {
|
|
109
|
+
tools.push({
|
|
110
|
+
type: 'function',
|
|
111
|
+
function: {
|
|
112
|
+
name: 'richpanel_create_conversation',
|
|
113
|
+
description: 'Create a new support conversation/ticket in Richpanel. Use this when a customer needs help or has a question.',
|
|
114
|
+
parameters: {
|
|
115
|
+
type: 'object',
|
|
116
|
+
properties: {
|
|
117
|
+
messageBody: {
|
|
118
|
+
type: 'string',
|
|
119
|
+
description: 'The message content from the customer',
|
|
120
|
+
},
|
|
121
|
+
customerEmail: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
description: 'Customer email address',
|
|
124
|
+
},
|
|
125
|
+
subject: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
description: 'Subject line for the conversation',
|
|
128
|
+
},
|
|
129
|
+
priority: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
enum: ['HIGH', 'LOW'],
|
|
132
|
+
description: 'Priority level of the conversation',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ['messageBody', 'customerEmail'],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
implementation: async (params) => {
|
|
139
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
|
|
140
|
+
method: 'POST',
|
|
141
|
+
url: '/tickets',
|
|
142
|
+
body: {
|
|
143
|
+
ticket: {
|
|
144
|
+
comment: {
|
|
145
|
+
sender_type: 'customer',
|
|
146
|
+
body: params.messageBody,
|
|
147
|
+
},
|
|
148
|
+
via: {
|
|
149
|
+
channel: 'email',
|
|
150
|
+
source: {
|
|
151
|
+
from: { address: params.customerEmail },
|
|
152
|
+
to: { address: 'support@company.com' },
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
subject: params.subject || 'Support Request',
|
|
156
|
+
priority: params.priority || 'LOW',
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
json: true,
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (operations.includes('getConversation')) {
|
|
165
|
+
tools.push({
|
|
166
|
+
type: 'function',
|
|
167
|
+
function: {
|
|
168
|
+
name: 'richpanel_get_conversation',
|
|
169
|
+
description: 'Retrieve a conversation/ticket by ID. Use this to get details about an existing support conversation.',
|
|
170
|
+
parameters: {
|
|
171
|
+
type: 'object',
|
|
172
|
+
properties: {
|
|
173
|
+
conversationId: {
|
|
174
|
+
type: 'string',
|
|
175
|
+
description: 'The unique ID of the conversation',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
required: ['conversationId'],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
implementation: async (params) => {
|
|
182
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
|
|
183
|
+
method: 'GET',
|
|
184
|
+
url: `/tickets/${params.conversationId}`,
|
|
185
|
+
json: true,
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
if (operations.includes('updateConversation')) {
|
|
191
|
+
tools.push({
|
|
192
|
+
type: 'function',
|
|
193
|
+
function: {
|
|
194
|
+
name: 'richpanel_update_conversation',
|
|
195
|
+
description: 'Update a conversation status, priority, or tags. Use this to mark tickets as closed, change priority, etc.',
|
|
196
|
+
parameters: {
|
|
197
|
+
type: 'object',
|
|
198
|
+
properties: {
|
|
199
|
+
conversationId: {
|
|
200
|
+
type: 'string',
|
|
201
|
+
description: 'The unique ID of the conversation',
|
|
202
|
+
},
|
|
203
|
+
status: {
|
|
204
|
+
type: 'string',
|
|
205
|
+
enum: ['OPEN', 'CLOSED'],
|
|
206
|
+
description: 'New status for the conversation',
|
|
207
|
+
},
|
|
208
|
+
priority: {
|
|
209
|
+
type: 'string',
|
|
210
|
+
enum: ['HIGH', 'LOW'],
|
|
211
|
+
description: 'New priority level',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
required: ['conversationId'],
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
implementation: async (params) => {
|
|
218
|
+
const body = { ticket: {} };
|
|
219
|
+
if (params.status)
|
|
220
|
+
body.ticket.status = params.status;
|
|
221
|
+
if (params.priority)
|
|
222
|
+
body.ticket.priority = params.priority;
|
|
223
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
|
|
224
|
+
method: 'PUT',
|
|
225
|
+
url: `/tickets/${params.conversationId}`,
|
|
226
|
+
body,
|
|
227
|
+
json: true,
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
if (operations.includes('getCustomer')) {
|
|
233
|
+
tools.push({
|
|
234
|
+
type: 'function',
|
|
235
|
+
function: {
|
|
236
|
+
name: 'richpanel_get_customer',
|
|
237
|
+
description: 'Retrieve customer information by email or phone number. Use this to look up customer details.',
|
|
238
|
+
parameters: {
|
|
239
|
+
type: 'object',
|
|
240
|
+
properties: {
|
|
241
|
+
identifier: {
|
|
242
|
+
type: 'string',
|
|
243
|
+
description: 'Customer email address or phone number',
|
|
244
|
+
},
|
|
245
|
+
type: {
|
|
246
|
+
type: 'string',
|
|
247
|
+
enum: ['email', 'phone'],
|
|
248
|
+
description: 'Type of identifier (email or phone)',
|
|
249
|
+
default: 'email',
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
required: ['identifier'],
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
implementation: async (params) => {
|
|
256
|
+
const type = params.type || 'email';
|
|
257
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
|
|
258
|
+
method: 'GET',
|
|
259
|
+
url: `/customers/${type}/${params.identifier}`,
|
|
260
|
+
json: true,
|
|
261
|
+
});
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
if (operations.includes('upsertCustomer')) {
|
|
266
|
+
tools.push({
|
|
267
|
+
type: 'function',
|
|
268
|
+
function: {
|
|
269
|
+
name: 'richpanel_create_update_customer',
|
|
270
|
+
description: 'Create a new customer or update existing customer information. Use this to add or modify customer details.',
|
|
271
|
+
parameters: {
|
|
272
|
+
type: 'object',
|
|
273
|
+
properties: {
|
|
274
|
+
email: {
|
|
275
|
+
type: 'string',
|
|
276
|
+
description: 'Customer email address',
|
|
277
|
+
},
|
|
278
|
+
firstName: {
|
|
279
|
+
type: 'string',
|
|
280
|
+
description: 'Customer first name',
|
|
281
|
+
},
|
|
282
|
+
lastName: {
|
|
283
|
+
type: 'string',
|
|
284
|
+
description: 'Customer last name',
|
|
285
|
+
},
|
|
286
|
+
phone: {
|
|
287
|
+
type: 'string',
|
|
288
|
+
description: 'Customer phone number',
|
|
289
|
+
},
|
|
290
|
+
city: {
|
|
291
|
+
type: 'string',
|
|
292
|
+
description: 'Customer city',
|
|
293
|
+
},
|
|
294
|
+
country: {
|
|
295
|
+
type: 'string',
|
|
296
|
+
description: 'Customer country',
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
required: ['email'],
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
implementation: async (params) => {
|
|
303
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
|
|
304
|
+
method: 'POST',
|
|
305
|
+
url: '/customers',
|
|
306
|
+
body: params,
|
|
307
|
+
json: true,
|
|
308
|
+
});
|
|
309
|
+
},
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
if (operations.includes('getOrder')) {
|
|
313
|
+
tools.push({
|
|
314
|
+
type: 'function',
|
|
315
|
+
function: {
|
|
316
|
+
name: 'richpanel_get_order',
|
|
317
|
+
description: 'Retrieve order information by order ID. Use this to look up order details.',
|
|
318
|
+
parameters: {
|
|
319
|
+
type: 'object',
|
|
320
|
+
properties: {
|
|
321
|
+
orderId: {
|
|
322
|
+
type: 'string',
|
|
323
|
+
description: 'The unique order ID',
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
required: ['orderId'],
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
implementation: async (params) => {
|
|
330
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
|
|
331
|
+
method: 'GET',
|
|
332
|
+
url: `/order/${params.orderId}`,
|
|
333
|
+
json: true,
|
|
334
|
+
});
|
|
335
|
+
},
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
if (operations.includes('addTags')) {
|
|
339
|
+
tools.push({
|
|
340
|
+
type: 'function',
|
|
341
|
+
function: {
|
|
342
|
+
name: 'richpanel_add_tags',
|
|
343
|
+
description: 'Add tags to a conversation. Use this to categorize or label support tickets.',
|
|
344
|
+
parameters: {
|
|
345
|
+
type: 'object',
|
|
346
|
+
properties: {
|
|
347
|
+
conversationId: {
|
|
348
|
+
type: 'string',
|
|
349
|
+
description: 'The conversation ID to add tags to',
|
|
350
|
+
},
|
|
351
|
+
tags: {
|
|
352
|
+
type: 'array',
|
|
353
|
+
items: {
|
|
354
|
+
type: 'string',
|
|
355
|
+
},
|
|
356
|
+
description: 'Array of tag names to add',
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
required: ['conversationId', 'tags'],
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
implementation: async (params) => {
|
|
363
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
|
|
364
|
+
method: 'PUT',
|
|
365
|
+
url: `/tickets/${params.conversationId}/add-tags`,
|
|
366
|
+
body: {
|
|
367
|
+
tags: params.tags,
|
|
368
|
+
},
|
|
369
|
+
json: true,
|
|
370
|
+
});
|
|
371
|
+
},
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
if (operations.includes('listUsers')) {
|
|
375
|
+
tools.push({
|
|
376
|
+
type: 'function',
|
|
377
|
+
function: {
|
|
378
|
+
name: 'richpanel_list_users',
|
|
379
|
+
description: 'Get a list of support agents/users. Use this to find available agents or user information.',
|
|
380
|
+
parameters: {
|
|
381
|
+
type: 'object',
|
|
382
|
+
properties: {},
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
implementation: async () => {
|
|
386
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
|
|
387
|
+
method: 'GET',
|
|
388
|
+
url: '/users',
|
|
389
|
+
json: true,
|
|
390
|
+
});
|
|
391
|
+
},
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
return { response: tools };
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
exports.RichpanelTool = RichpanelTool;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-richpanel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "n8n community node for Richpanel customer support platform - manage conversations, customers, orders, and subscriptions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n",
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"dist/credentials/RichpanelApi.credentials.js"
|
|
49
49
|
],
|
|
50
50
|
"nodes": [
|
|
51
|
-
"dist/nodes/Richpanel/Richpanel.node.js"
|
|
51
|
+
"dist/nodes/Richpanel/Richpanel.node.js",
|
|
52
|
+
"dist/nodes/Richpanel/RichpanelTool.tool.js"
|
|
52
53
|
]
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|