@ctera/n8n-nodes-ctera-ai 0.4.0 → 0.4.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.
|
@@ -361,10 +361,8 @@ class CteraFilesystem {
|
|
|
361
361
|
async execute() {
|
|
362
362
|
const items = this.getInputData();
|
|
363
363
|
const returnData = [];
|
|
364
|
-
// Get OAuth2 credentials
|
|
364
|
+
// Get OAuth2 credentials - token refresh is handled automatically by httpRequestWithAuthentication
|
|
365
365
|
const oauth2Credentials = await this.getCredentials('cteraPortalOAuth2Api');
|
|
366
|
-
const oauthTokenData = oauth2Credentials.oauthTokenData;
|
|
367
|
-
const bearerToken = oauthTokenData === null || oauthTokenData === void 0 ? void 0 : oauthTokenData.access_token;
|
|
368
366
|
const mcpServerUrl = `${oauth2Credentials.portalUrl.replace(/\/$/, '')}/_SRV/MCP`;
|
|
369
367
|
const allowUnauthorizedCerts = oauth2Credentials.allowUnauthorizedCerts;
|
|
370
368
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -494,15 +492,15 @@ class CteraFilesystem {
|
|
|
494
492
|
},
|
|
495
493
|
id: i + 1,
|
|
496
494
|
};
|
|
497
|
-
// Make HTTP request to MCP server
|
|
498
|
-
|
|
495
|
+
// Make HTTP request to MCP server using authenticated helper
|
|
496
|
+
// This automatically handles OAuth2 token refresh when tokens expire
|
|
497
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'cteraPortalOAuth2Api', {
|
|
499
498
|
method: 'POST',
|
|
500
499
|
url: `${mcpServerUrl}/mcp/`,
|
|
501
500
|
headers: {
|
|
502
501
|
'Content-Type': 'application/json',
|
|
503
|
-
Authorization: `Bearer ${bearerToken}`,
|
|
504
502
|
},
|
|
505
|
-
body:
|
|
503
|
+
body: requestBody,
|
|
506
504
|
skipSslCertificateValidation: allowUnauthorizedCerts,
|
|
507
505
|
});
|
|
508
506
|
// Parse response
|
package/package.json
CHANGED