n8n-nodes-richpanel 1.1.3 → 1.1.4

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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Richpanel = void 0;
4
4
  const n8n_workflow_1 = require("n8n-workflow");
5
+ const BASE_URL = 'https://api.richpanel.com/v1';
5
6
  class Richpanel {
6
7
  constructor() {
7
8
  this.description = {
@@ -1356,7 +1357,7 @@ async function handleConversationOperations(operation, itemIndex) {
1356
1357
  }
1357
1358
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1358
1359
  method: 'POST',
1359
- url: '/tickets',
1360
+ url: `${BASE_URL}/tickets`,
1360
1361
  body,
1361
1362
  json: true,
1362
1363
  });
@@ -1378,7 +1379,7 @@ async function handleConversationOperations(operation, itemIndex) {
1378
1379
  }
1379
1380
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1380
1381
  method: 'PUT',
1381
- url: `/tickets/${conversationId}`,
1382
+ url: `${BASE_URL}/tickets/${conversationId}`,
1382
1383
  body,
1383
1384
  json: true,
1384
1385
  });
@@ -1387,7 +1388,7 @@ async function handleConversationOperations(operation, itemIndex) {
1387
1388
  const conversationId = this.getNodeParameter('conversationId', itemIndex);
1388
1389
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1389
1390
  method: 'GET',
1390
- url: `/tickets/${conversationId}`,
1391
+ url: `${BASE_URL}/tickets/${conversationId}`,
1391
1392
  json: true,
1392
1393
  });
1393
1394
  }
@@ -1395,7 +1396,7 @@ async function handleConversationOperations(operation, itemIndex) {
1395
1396
  const conversationNumber = this.getNodeParameter('conversationNumber', itemIndex);
1396
1397
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1397
1398
  method: 'GET',
1398
- url: `/tickets/number/${conversationNumber}`,
1399
+ url: `${BASE_URL}/tickets/number/${conversationNumber}`,
1399
1400
  json: true,
1400
1401
  });
1401
1402
  }
@@ -1404,7 +1405,7 @@ async function handleConversationOperations(operation, itemIndex) {
1404
1405
  const customerIdentifier = this.getNodeParameter('customerIdentifier', itemIndex);
1405
1406
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1406
1407
  method: 'GET',
1407
- url: `/tickets/${customerType}/${customerIdentifier}`,
1408
+ url: `${BASE_URL}/tickets/${customerType}/${customerIdentifier}`,
1408
1409
  json: true,
1409
1410
  });
1410
1411
  }
@@ -1481,7 +1482,7 @@ async function handleCustomerOperations(operation, itemIndex) {
1481
1482
  }
1482
1483
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1483
1484
  method: 'POST',
1484
- url: '/customers',
1485
+ url: `${BASE_URL}/customers`,
1485
1486
  body,
1486
1487
  json: true,
1487
1488
  });
@@ -1491,7 +1492,7 @@ async function handleCustomerOperations(operation, itemIndex) {
1491
1492
  const customerIdentifier = this.getNodeParameter('customerIdentifier', itemIndex);
1492
1493
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1493
1494
  method: 'GET',
1494
- url: `/customers/${customerType}/${customerIdentifier}`,
1495
+ url: `${BASE_URL}/customers/${customerType}/${customerIdentifier}`,
1495
1496
  json: true,
1496
1497
  });
1497
1498
  }
@@ -1560,7 +1561,7 @@ async function handleOrderOperations(operation, itemIndex) {
1560
1561
  }
1561
1562
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1562
1563
  method: 'POST',
1563
- url: `/order/${appClientId}`,
1564
+ url: `${BASE_URL}/order/${appClientId}`,
1564
1565
  body,
1565
1566
  json: true,
1566
1567
  });
@@ -1569,7 +1570,7 @@ async function handleOrderOperations(operation, itemIndex) {
1569
1570
  const orderIdGet = this.getNodeParameter('orderIdGet', itemIndex);
1570
1571
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1571
1572
  method: 'GET',
1572
- url: `/order/${orderIdGet}`,
1573
+ url: `${BASE_URL}/order/${orderIdGet}`,
1573
1574
  json: true,
1574
1575
  });
1575
1576
  }
@@ -1635,7 +1636,7 @@ async function handleSubscriptionOperations(operation, itemIndex) {
1635
1636
  }
1636
1637
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1637
1638
  method: 'POST',
1638
- url: `/subscription/${appClientId}`,
1639
+ url: `${BASE_URL}/subscription/${appClientId}`,
1639
1640
  body,
1640
1641
  json: true,
1641
1642
  });
@@ -1650,7 +1651,7 @@ async function handleUserOperations(operation, itemIndex) {
1650
1651
  const userId = this.getNodeParameter('userId', itemIndex);
1651
1652
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1652
1653
  method: 'GET',
1653
- url: `/users/${userId}`,
1654
+ url: `${BASE_URL}/users/${userId}`,
1654
1655
  json: true,
1655
1656
  });
1656
1657
  }
@@ -1670,7 +1671,7 @@ async function handleUserOperations(operation, itemIndex) {
1670
1671
  qs.per_page = options.perPage;
1671
1672
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1672
1673
  method: 'GET',
1673
- url: '/users',
1674
+ url: `${BASE_URL}/users`,
1674
1675
  qs,
1675
1676
  json: true,
1676
1677
  });
@@ -1687,7 +1688,7 @@ async function handleTagOperations(operation, itemIndex) {
1687
1688
  const tagColor = this.getNodeParameter('tagColor', itemIndex);
1688
1689
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1689
1690
  method: 'POST',
1690
- url: '/tags',
1691
+ url: `${BASE_URL}/tags`,
1691
1692
  body: {
1692
1693
  name: tagName,
1693
1694
  color: tagColor,
@@ -1711,7 +1712,7 @@ async function handleTagOperations(operation, itemIndex) {
1711
1712
  qs.per_page = options.perPage;
1712
1713
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1713
1714
  method: 'GET',
1714
- url: '/tags',
1715
+ url: `${BASE_URL}/tags`,
1715
1716
  qs,
1716
1717
  json: true,
1717
1718
  });
@@ -1727,7 +1728,7 @@ async function handleChannelOperations(operation, itemIndex) {
1727
1728
  const channelId = this.getNodeParameter('channelId', itemIndex);
1728
1729
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1729
1730
  method: 'GET',
1730
- url: `/channel/${channelId}`,
1731
+ url: `${BASE_URL}/channel/${channelId}`,
1731
1732
  json: true,
1732
1733
  });
1733
1734
  }
@@ -1747,7 +1748,7 @@ async function handleChannelOperations(operation, itemIndex) {
1747
1748
  qs.per_page = options.perPage;
1748
1749
  return await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1749
1750
  method: 'GET',
1750
- url: '/channel',
1751
+ url: `${BASE_URL}/channel`,
1751
1752
  qs,
1752
1753
  json: true,
1753
1754
  });
@@ -1765,7 +1766,7 @@ async function paginateResults(endpoint) {
1765
1766
  while (hasMore) {
1766
1767
  const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'richpanelApi', {
1767
1768
  method: 'GET',
1768
- url: endpoint,
1769
+ url: `${BASE_URL}${endpoint}`,
1769
1770
  qs: { page, per_page: 100 },
1770
1771
  json: true,
1771
1772
  }));
@@ -108,6 +108,8 @@ class RichpanelTool {
108
108
  const credentials = await this.getCredentials('richpanelApi');
109
109
  const apiKey = credentials.apiKey;
110
110
  const tools = [];
111
+ // Capture the context for use in tool implementations
112
+ const context = this;
111
113
  // Helper function to make API requests
112
114
  const makeApiRequest = async (method, endpoint, body) => {
113
115
  const options = {
@@ -122,7 +124,7 @@ class RichpanelTool {
122
124
  json: true,
123
125
  };
124
126
  try {
125
- const response = await this.helpers.httpRequest(options);
127
+ const response = await context.helpers.httpRequest(options);
126
128
  return response;
127
129
  }
128
130
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-richpanel",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "n8n community node for Richpanel customer support platform - manage conversations, customers, orders, and subscriptions",
5
5
  "keywords": [
6
6
  "n8n",