@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/
|
|
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
|
-
|
|
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
|
},
|