@ivotoby/openapi-mcp-server 1.10.0 → 1.10.2
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.
- package/dist/bundle.js +27 -3
- package/dist/cli.js +27 -3
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -18606,6 +18606,7 @@ var ApiClient = class {
|
|
|
18606
18606
|
return str2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
18607
18607
|
};
|
|
18608
18608
|
const headerParams = {};
|
|
18609
|
+
const queryParams = {};
|
|
18609
18610
|
if (toolDef?.inputSchema?.properties) {
|
|
18610
18611
|
for (const [key, value] of Object.entries(paramsCopy)) {
|
|
18611
18612
|
const paramDef = toolDef.inputSchema.properties[key];
|
|
@@ -18626,6 +18627,9 @@ var ApiClient = class {
|
|
|
18626
18627
|
resolvedPath = resolvedPath.replace(`/${key}`, `/${encodeURIComponent(value)}`);
|
|
18627
18628
|
}
|
|
18628
18629
|
delete paramsCopy[key];
|
|
18630
|
+
} else if (paramLocation === "query") {
|
|
18631
|
+
queryParams[key] = value;
|
|
18632
|
+
delete paramsCopy[key];
|
|
18629
18633
|
} else if (paramLocation === "header") {
|
|
18630
18634
|
headerParams[key] = String(value);
|
|
18631
18635
|
delete paramsCopy[key];
|
|
@@ -18657,10 +18661,18 @@ var ApiClient = class {
|
|
|
18657
18661
|
url: resolvedPath,
|
|
18658
18662
|
headers: { ...authHeaders, ...headerParams }
|
|
18659
18663
|
};
|
|
18664
|
+
if (Object.keys(queryParams).length > 0) {
|
|
18665
|
+
config.params = this.processQueryParams(queryParams);
|
|
18666
|
+
}
|
|
18660
18667
|
if (isGetLikeMethod(method)) {
|
|
18661
|
-
|
|
18668
|
+
if (Object.keys(paramsCopy).length > 0) {
|
|
18669
|
+
config.params = {
|
|
18670
|
+
...config.params,
|
|
18671
|
+
...this.processQueryParams(paramsCopy)
|
|
18672
|
+
};
|
|
18673
|
+
}
|
|
18662
18674
|
} else {
|
|
18663
|
-
config.data = paramsCopy;
|
|
18675
|
+
config.data = Object.keys(paramsCopy).length > 0 ? paramsCopy : {};
|
|
18664
18676
|
}
|
|
18665
18677
|
const response = await this.axiosInstance(config);
|
|
18666
18678
|
return response.data;
|
|
@@ -23966,6 +23978,18 @@ function loadConfig() {
|
|
|
23966
23978
|
}
|
|
23967
23979
|
const apiBaseUrl = argv["api-base-url"] || process.env.API_BASE_URL;
|
|
23968
23980
|
const disableAbbreviation = argv["disable-abbreviation"] || (process.env.DISABLE_ABBREVIATION ? process.env.DISABLE_ABBREVIATION === "true" : false);
|
|
23981
|
+
const toolsModeInput = (typeof argv.tools === "string" ? argv.tools : void 0) || process.env.TOOLS_MODE;
|
|
23982
|
+
let toolsMode = "all";
|
|
23983
|
+
if (typeof toolsModeInput === "string" && toolsModeInput.trim().length > 0) {
|
|
23984
|
+
const normalized = toolsModeInput.toLowerCase();
|
|
23985
|
+
if (normalized === "all" || normalized === "dynamic" || normalized === "explicit") {
|
|
23986
|
+
toolsMode = normalized;
|
|
23987
|
+
} else {
|
|
23988
|
+
throw new Error(
|
|
23989
|
+
"Invalid tools mode. Expected one of: all, dynamic, explicit"
|
|
23990
|
+
);
|
|
23991
|
+
}
|
|
23992
|
+
}
|
|
23969
23993
|
if (!apiBaseUrl) {
|
|
23970
23994
|
throw new Error("API base URL is required (--api-base-url or API_BASE_URL)");
|
|
23971
23995
|
}
|
|
@@ -23986,7 +24010,7 @@ function loadConfig() {
|
|
|
23986
24010
|
includeTags: argv.tag,
|
|
23987
24011
|
includeResources: argv.resource,
|
|
23988
24012
|
includeOperations: argv.operation,
|
|
23989
|
-
toolsMode
|
|
24013
|
+
toolsMode,
|
|
23990
24014
|
disableAbbreviation: disableAbbreviation ? true : void 0
|
|
23991
24015
|
};
|
|
23992
24016
|
}
|
package/dist/cli.js
CHANGED
|
@@ -18606,6 +18606,7 @@ var ApiClient = class {
|
|
|
18606
18606
|
return str2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
18607
18607
|
};
|
|
18608
18608
|
const headerParams = {};
|
|
18609
|
+
const queryParams = {};
|
|
18609
18610
|
if (toolDef?.inputSchema?.properties) {
|
|
18610
18611
|
for (const [key, value] of Object.entries(paramsCopy)) {
|
|
18611
18612
|
const paramDef = toolDef.inputSchema.properties[key];
|
|
@@ -18626,6 +18627,9 @@ var ApiClient = class {
|
|
|
18626
18627
|
resolvedPath = resolvedPath.replace(`/${key}`, `/${encodeURIComponent(value)}`);
|
|
18627
18628
|
}
|
|
18628
18629
|
delete paramsCopy[key];
|
|
18630
|
+
} else if (paramLocation === "query") {
|
|
18631
|
+
queryParams[key] = value;
|
|
18632
|
+
delete paramsCopy[key];
|
|
18629
18633
|
} else if (paramLocation === "header") {
|
|
18630
18634
|
headerParams[key] = String(value);
|
|
18631
18635
|
delete paramsCopy[key];
|
|
@@ -18657,10 +18661,18 @@ var ApiClient = class {
|
|
|
18657
18661
|
url: resolvedPath,
|
|
18658
18662
|
headers: { ...authHeaders, ...headerParams }
|
|
18659
18663
|
};
|
|
18664
|
+
if (Object.keys(queryParams).length > 0) {
|
|
18665
|
+
config.params = this.processQueryParams(queryParams);
|
|
18666
|
+
}
|
|
18660
18667
|
if (isGetLikeMethod(method)) {
|
|
18661
|
-
|
|
18668
|
+
if (Object.keys(paramsCopy).length > 0) {
|
|
18669
|
+
config.params = {
|
|
18670
|
+
...config.params,
|
|
18671
|
+
...this.processQueryParams(paramsCopy)
|
|
18672
|
+
};
|
|
18673
|
+
}
|
|
18662
18674
|
} else {
|
|
18663
|
-
config.data = paramsCopy;
|
|
18675
|
+
config.data = Object.keys(paramsCopy).length > 0 ? paramsCopy : {};
|
|
18664
18676
|
}
|
|
18665
18677
|
const response = await this.axiosInstance(config);
|
|
18666
18678
|
return response.data;
|
|
@@ -23966,6 +23978,18 @@ function loadConfig() {
|
|
|
23966
23978
|
}
|
|
23967
23979
|
const apiBaseUrl = argv["api-base-url"] || process.env.API_BASE_URL;
|
|
23968
23980
|
const disableAbbreviation = argv["disable-abbreviation"] || (process.env.DISABLE_ABBREVIATION ? process.env.DISABLE_ABBREVIATION === "true" : false);
|
|
23981
|
+
const toolsModeInput = (typeof argv.tools === "string" ? argv.tools : void 0) || process.env.TOOLS_MODE;
|
|
23982
|
+
let toolsMode = "all";
|
|
23983
|
+
if (typeof toolsModeInput === "string" && toolsModeInput.trim().length > 0) {
|
|
23984
|
+
const normalized = toolsModeInput.toLowerCase();
|
|
23985
|
+
if (normalized === "all" || normalized === "dynamic" || normalized === "explicit") {
|
|
23986
|
+
toolsMode = normalized;
|
|
23987
|
+
} else {
|
|
23988
|
+
throw new Error(
|
|
23989
|
+
"Invalid tools mode. Expected one of: all, dynamic, explicit"
|
|
23990
|
+
);
|
|
23991
|
+
}
|
|
23992
|
+
}
|
|
23969
23993
|
if (!apiBaseUrl) {
|
|
23970
23994
|
throw new Error("API base URL is required (--api-base-url or API_BASE_URL)");
|
|
23971
23995
|
}
|
|
@@ -23986,7 +24010,7 @@ function loadConfig() {
|
|
|
23986
24010
|
includeTags: argv.tag,
|
|
23987
24011
|
includeResources: argv.resource,
|
|
23988
24012
|
includeOperations: argv.operation,
|
|
23989
|
-
toolsMode
|
|
24013
|
+
toolsMode,
|
|
23990
24014
|
disableAbbreviation: disableAbbreviation ? true : void 0
|
|
23991
24015
|
};
|
|
23992
24016
|
}
|