n8n-nodes-richpanel 1.1.0 → 1.1.1

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.
@@ -1,4 +1,4 @@
1
- import { ISupplyDataFunctions, INodeType, INodeTypeDescription, SupplyData } from 'n8n-workflow';
1
+ import { INodeType, INodeTypeDescription, ISupplyDataFunctions, SupplyData } from 'n8n-workflow';
2
2
  export declare class RichpanelTool implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  supplyData(this: ISupplyDataFunctions): Promise<SupplyData>;
@@ -9,7 +9,7 @@ class RichpanelTool {
9
9
  icon: 'file:richpanel-logo.png',
10
10
  group: ['transform'],
11
11
  version: 1,
12
- description: 'Use Richpanel operations as AI Agent tools',
12
+ description: 'Use Richpanel with AI Agents - enable AI to manage support conversations, customers, and orders',
13
13
  defaults: {
14
14
  name: 'Richpanel Tool',
15
15
  },
@@ -44,7 +44,7 @@ class RichpanelTool {
44
44
  },
45
45
  properties: [
46
46
  {
47
- displayName: 'This node will be available as a tool for AI agents. Configure which Richpanel operations the AI can use.',
47
+ displayName: 'Connect this node to an AI Agent to give it access to Richpanel operations. The AI can create tickets, look up customers, check orders, and more.',
48
48
  name: 'notice',
49
49
  type: 'notice',
50
50
  default: '',
@@ -53,48 +53,48 @@ class RichpanelTool {
53
53
  displayName: 'Available Operations',
54
54
  name: 'operations',
55
55
  type: 'multiOptions',
56
- description: 'Select which operations the AI agent can perform',
57
- default: ['getConversation', 'createConversation', 'getCustomer'],
56
+ description: 'Select which Richpanel operations the AI agent can perform',
57
+ default: ['getConversation', 'createConversation', 'getCustomer', 'getOrder'],
58
58
  options: [
59
59
  {
60
60
  name: 'Create Conversation',
61
61
  value: 'createConversation',
62
- description: 'Create a new support conversation/ticket',
62
+ description: 'Let AI create new support tickets',
63
63
  },
64
64
  {
65
65
  name: 'Get Conversation',
66
66
  value: 'getConversation',
67
- description: 'Retrieve a conversation by ID',
67
+ description: 'Let AI retrieve conversation details',
68
68
  },
69
69
  {
70
70
  name: 'Update Conversation',
71
71
  value: 'updateConversation',
72
- description: 'Update conversation status, priority, or tags',
72
+ description: 'Let AI update conversation status or priority',
73
73
  },
74
74
  {
75
75
  name: 'Get Customer',
76
76
  value: 'getCustomer',
77
- description: 'Retrieve customer information by email or phone',
77
+ description: 'Let AI look up customer information',
78
78
  },
79
79
  {
80
80
  name: 'Create/Update Customer',
81
81
  value: 'upsertCustomer',
82
- description: 'Create or update customer information',
82
+ description: 'Let AI create or update customer records',
83
83
  },
84
84
  {
85
85
  name: 'Get Order',
86
86
  value: 'getOrder',
87
- description: 'Retrieve order information',
87
+ description: 'Let AI retrieve order information',
88
88
  },
89
89
  {
90
- name: 'Add Tags to Conversation',
90
+ name: 'Add Tags',
91
91
  value: 'addTags',
92
- description: 'Add tags to a conversation',
92
+ description: 'Let AI add tags to conversations',
93
93
  },
94
94
  {
95
95
  name: 'List Users',
96
96
  value: 'listUsers',
97
- description: 'Get list of support agents/users',
97
+ description: 'Let AI see available support agents',
98
98
  },
99
99
  ],
100
100
  },
@@ -102,296 +102,205 @@ class RichpanelTool {
102
102
  };
103
103
  }
104
104
  async supplyData() {
105
- const operations = this.getNodeParameter('operations', 0);
106
- const tools = [];
107
- // Define tool schemas based on selected operations
105
+ const operations = this.getNodeParameter('operations', 0, []);
106
+ const toolDefinitions = [];
107
+ // Create Conversation Tool
108
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
- },
109
+ toolDefinitions.push({
110
+ name: 'richpanel_create_conversation',
111
+ description: 'Create a new support conversation/ticket in Richpanel. Use this when a customer needs help, reports an issue, or has a question that needs tracking.',
112
+ schema: {
113
+ type: 'object',
114
+ properties: {
115
+ messageBody: {
116
+ type: 'string',
117
+ description: 'The customer message content or issue description',
134
118
  },
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
- },
119
+ customerEmail: {
120
+ type: 'string',
121
+ description: 'Customer email address',
122
+ },
123
+ subject: {
124
+ type: 'string',
125
+ description: 'Subject line for the conversation/ticket',
126
+ },
127
+ priority: {
128
+ type: 'string',
129
+ enum: ['HIGH', 'LOW'],
130
+ description: 'Priority level (HIGH for urgent issues, LOW for general questions)',
158
131
  },
159
- json: true,
160
- });
132
+ },
133
+ required: ['messageBody', 'customerEmail'],
161
134
  },
162
135
  });
163
136
  }
137
+ // Get Conversation Tool
164
138
  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
- },
139
+ toolDefinitions.push({
140
+ name: 'richpanel_get_conversation',
141
+ description: 'Retrieve details about an existing conversation/ticket by ID. Use this to check ticket status, see assigned agent, read conversation history, or verify if an issue is resolved.',
142
+ schema: {
143
+ type: 'object',
144
+ properties: {
145
+ conversationId: {
146
+ type: 'string',
147
+ description: 'The unique ID of the conversation/ticket',
177
148
  },
178
- required: ['conversationId'],
179
149
  },
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
- });
150
+ required: ['conversationId'],
187
151
  },
188
152
  });
189
153
  }
154
+ // Update Conversation Tool
190
155
  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
- },
156
+ toolDefinitions.push({
157
+ name: 'richpanel_update_conversation',
158
+ description: 'Update conversation properties like status or priority. Use this to close resolved tickets, change priority levels, or update conversation state.',
159
+ schema: {
160
+ type: 'object',
161
+ properties: {
162
+ conversationId: {
163
+ type: 'string',
164
+ description: 'The unique ID of the conversation to update',
165
+ },
166
+ status: {
167
+ type: 'string',
168
+ enum: ['OPEN', 'CLOSED'],
169
+ description: 'New status (CLOSED when issue is resolved, OPEN otherwise)',
170
+ },
171
+ priority: {
172
+ type: 'string',
173
+ enum: ['HIGH', 'LOW'],
174
+ description: 'New priority level',
213
175
  },
214
- required: ['conversationId'],
215
176
  },
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
- });
177
+ required: ['conversationId'],
229
178
  },
230
179
  });
231
180
  }
181
+ // Get Customer Tool
232
182
  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
- },
183
+ toolDefinitions.push({
184
+ name: 'richpanel_get_customer',
185
+ description: 'Retrieve customer information by email or phone number. Use this to look up customer details, see order history, check customer status, or verify customer information.',
186
+ schema: {
187
+ type: 'object',
188
+ properties: {
189
+ identifier: {
190
+ type: 'string',
191
+ description: 'Customer email address or phone number',
192
+ },
193
+ type: {
194
+ type: 'string',
195
+ enum: ['email', 'phone'],
196
+ description: 'Type of identifier (email or phone)',
197
+ default: 'email',
251
198
  },
252
- required: ['identifier'],
253
199
  },
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
- });
200
+ required: ['identifier'],
262
201
  },
263
202
  });
264
203
  }
204
+ // Create/Update Customer Tool
265
205
  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
- },
206
+ toolDefinitions.push({
207
+ name: 'richpanel_create_update_customer',
208
+ description: 'Create a new customer or update existing customer information. Use this when a customer provides updated details or to add a new customer to the system.',
209
+ schema: {
210
+ type: 'object',
211
+ properties: {
212
+ email: {
213
+ type: 'string',
214
+ description: 'Customer email address (required)',
215
+ },
216
+ firstName: {
217
+ type: 'string',
218
+ description: 'Customer first name',
219
+ },
220
+ lastName: {
221
+ type: 'string',
222
+ description: 'Customer last name',
223
+ },
224
+ phone: {
225
+ type: 'string',
226
+ description: 'Customer phone number',
227
+ },
228
+ city: {
229
+ type: 'string',
230
+ description: 'Customer city',
231
+ },
232
+ country: {
233
+ type: 'string',
234
+ description: 'Customer country',
298
235
  },
299
- required: ['email'],
300
236
  },
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
- });
237
+ required: ['email'],
309
238
  },
310
239
  });
311
240
  }
241
+ // Get Order Tool
312
242
  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
- },
243
+ toolDefinitions.push({
244
+ name: 'richpanel_get_order',
245
+ description: 'Retrieve order information by order ID. Use this when a customer asks about order status, shipping, tracking, or order details.',
246
+ schema: {
247
+ type: 'object',
248
+ properties: {
249
+ orderId: {
250
+ type: 'string',
251
+ description: 'The unique order ID/number',
325
252
  },
326
- required: ['orderId'],
327
253
  },
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
- });
254
+ required: ['orderId'],
335
255
  },
336
256
  });
337
257
  }
258
+ // Add Tags Tool
338
259
  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: {
260
+ toolDefinitions.push({
261
+ name: 'richpanel_add_tags',
262
+ description: 'Add tags to a conversation for categorization and organization. Use this to tag tickets by issue type, urgency, department, or any other category.',
263
+ schema: {
264
+ type: 'object',
265
+ properties: {
266
+ conversationId: {
267
+ type: 'string',
268
+ description: 'The conversation ID to add tags to',
269
+ },
270
+ tags: {
271
+ type: 'array',
272
+ items: {
348
273
  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
274
  },
275
+ description: 'Array of tag names (e.g., ["billing", "urgent", "refund"])',
358
276
  },
359
- required: ['conversationId', 'tags'],
360
277
  },
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
- });
278
+ required: ['conversationId', 'tags'],
371
279
  },
372
280
  });
373
281
  }
282
+ // List Users Tool
374
283
  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
- });
284
+ toolDefinitions.push({
285
+ name: 'richpanel_list_users',
286
+ description: 'Get a list of all support agents/users in Richpanel. Use this when a customer asks to speak with an agent, or to find available support staff.',
287
+ schema: {
288
+ type: 'object',
289
+ properties: {},
391
290
  },
392
291
  });
393
292
  }
394
- return { response: tools };
293
+ // Return tool definitions for AI agent
294
+ return {
295
+ response: toolDefinitions.map((tool) => ({
296
+ type: 'function',
297
+ function: {
298
+ name: tool.name,
299
+ description: tool.description,
300
+ parameters: tool.schema,
301
+ },
302
+ })),
303
+ };
395
304
  }
396
305
  }
397
306
  exports.RichpanelTool = RichpanelTool;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-richpanel",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "n8n community node for Richpanel customer support platform - manage conversations, customers, orders, and subscriptions",
5
5
  "keywords": [
6
6
  "n8n",