mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 13:33:11 +00:00
test: update tests for v2.28.5 behavior changes (v2.28.6) (#470)
- Update n8n-version tests: 'v' prefix now supported in version strings
- Update n8n-validation tests: empty settings now return minimal defaults
{ executionOrder: 'v1' } instead of {} to avoid API rejection (Issue #431)
Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Romuald Członkowski <romualdczlonkowski@MacBook-Pro-Romuald.local>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
90407f845d
commit
60479e0eb4
29
dist/services/n8n-api-client.js
vendored
29
dist/services/n8n-api-client.js
vendored
@@ -45,7 +45,7 @@ const n8n_version_1 = require("./n8n-version");
|
||||
class N8nApiClient {
|
||||
constructor(config) {
|
||||
this.versionInfo = null;
|
||||
this.versionFetched = false;
|
||||
this.versionPromise = null;
|
||||
const { baseUrl, apiKey, timeout = 30000, maxRetries = 3 } = config;
|
||||
this.maxRetries = maxRetries;
|
||||
this.baseUrl = baseUrl;
|
||||
@@ -80,14 +80,27 @@ class N8nApiClient {
|
||||
});
|
||||
}
|
||||
async getVersion() {
|
||||
if (!this.versionFetched) {
|
||||
this.versionInfo = (0, n8n_version_1.getCachedVersion)(this.baseUrl);
|
||||
if (!this.versionInfo) {
|
||||
this.versionInfo = await (0, n8n_version_1.fetchN8nVersion)(this.baseUrl);
|
||||
}
|
||||
this.versionFetched = true;
|
||||
if (this.versionInfo) {
|
||||
return this.versionInfo;
|
||||
}
|
||||
return this.versionInfo;
|
||||
if (this.versionPromise) {
|
||||
return this.versionPromise;
|
||||
}
|
||||
this.versionPromise = this.fetchVersionOnce();
|
||||
try {
|
||||
this.versionInfo = await this.versionPromise;
|
||||
return this.versionInfo;
|
||||
}
|
||||
finally {
|
||||
this.versionPromise = null;
|
||||
}
|
||||
}
|
||||
async fetchVersionOnce() {
|
||||
let version = (0, n8n_version_1.getCachedVersion)(this.baseUrl);
|
||||
if (!version) {
|
||||
version = await (0, n8n_version_1.fetchN8nVersion)(this.baseUrl);
|
||||
}
|
||||
return version;
|
||||
}
|
||||
getCachedVersionInfo() {
|
||||
return this.versionInfo;
|
||||
|
||||
Reference in New Issue
Block a user