@connectorx/n8n-nodes-cortex 0.1.11 → 0.1.12

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.
@@ -29,7 +29,7 @@ class CortexApi {
29
29
  this.test = {
30
30
  request: {
31
31
  baseURL: '={{$credentials.apiBaseUrl.replace(/\\/$/, "")}}',
32
- url: '/functions/v1/api/auth/me',
32
+ url: '/functions/v1/api/integrations/validate',
33
33
  method: 'GET',
34
34
  headers: {
35
35
  Authorization: '={{ "Bearer " + $credentials.accessToken }}',
@@ -311,7 +311,19 @@ class Cortex {
311
311
  }));
312
312
  }
313
313
  catch (error) {
314
- console.error('getTenants error:', error);
314
+ try {
315
+ options.uri = `${baseUrl}/integrations/validate`;
316
+ const validateResponse = await this.helpers.request(options);
317
+ if (validateResponse.valid && validateResponse.tenant_id) {
318
+ return [{
319
+ name: `Current Tenant (${validateResponse.tenant_id.slice(0, 8)}...)`,
320
+ value: validateResponse.tenant_id
321
+ }];
322
+ }
323
+ }
324
+ catch (e) {
325
+ }
326
+ console.error('getTenants error: Failed to fetch tenants via list or validate', error);
315
327
  return [];
316
328
  }
317
329
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectorx/n8n-nodes-cortex",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "n8n nodes for Cortex API",
5
5
  "keywords": [
6
6
  "n8n-community-node-package"