@ivotoby/openapi-mcp-server 1.7.0 → 1.8.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.
- package/dist/bundle.js +19 -3
- package/dist/cli.js +19 -3
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -14858,6 +14858,18 @@ var OpenAPISpecLoader = class {
|
|
|
14858
14858
|
});
|
|
14859
14859
|
return combinedParts.map((p) => p.trim()).filter((p) => p.length > 0);
|
|
14860
14860
|
}
|
|
14861
|
+
// Helper to split only by underscore and camelCase, but not by numbers
|
|
14862
|
+
// Used when abbreviation is disabled to preserve number-letter combinations like "web3"
|
|
14863
|
+
splitCombinedWithoutNumbers(input) {
|
|
14864
|
+
const underscoreParts = input.split("_");
|
|
14865
|
+
let combinedParts = [];
|
|
14866
|
+
underscoreParts.forEach((part) => {
|
|
14867
|
+
const spacedPart = part.replace(/([A-Z]+)/g, " $1").replace(/([A-Z][a-z])/g, " $1");
|
|
14868
|
+
const splitParts = spacedPart.split(" ").filter((p) => p.length > 0);
|
|
14869
|
+
combinedParts = combinedParts.concat(splitParts);
|
|
14870
|
+
});
|
|
14871
|
+
return combinedParts.map((p) => p.trim()).filter((p) => p.length > 0);
|
|
14872
|
+
}
|
|
14861
14873
|
_initialSanitizeAndValidate(originalId, maxLength) {
|
|
14862
14874
|
if (!originalId || originalId.trim().length === 0)
|
|
14863
14875
|
return { currentName: "", originalWasLong: false, errorName: "unnamed-tool" };
|
|
@@ -14950,7 +14962,7 @@ var OpenAPISpecLoader = class {
|
|
|
14950
14962
|
if (errorName) return errorName;
|
|
14951
14963
|
let processedName;
|
|
14952
14964
|
if (this.disableAbbreviation) {
|
|
14953
|
-
processedName = this.
|
|
14965
|
+
processedName = this.splitCombinedWithoutNumbers(sanitizedName).join("-");
|
|
14954
14966
|
} else {
|
|
14955
14967
|
processedName = this._performSemanticAbbreviation(sanitizedName);
|
|
14956
14968
|
processedName = this._applyVowelRemovalIfOverLength(processedName, maxLength);
|
|
@@ -23563,8 +23575,12 @@ function parseHeaders(headerStr) {
|
|
|
23563
23575
|
const headers = {};
|
|
23564
23576
|
if (headerStr) {
|
|
23565
23577
|
headerStr.split(",").forEach((header) => {
|
|
23566
|
-
const
|
|
23567
|
-
if (
|
|
23578
|
+
const colonIndex = header.indexOf(":");
|
|
23579
|
+
if (colonIndex > 0) {
|
|
23580
|
+
const key = header.substring(0, colonIndex).trim();
|
|
23581
|
+
const value = header.substring(colonIndex + 1).trim();
|
|
23582
|
+
if (key) headers[key] = value;
|
|
23583
|
+
}
|
|
23568
23584
|
});
|
|
23569
23585
|
}
|
|
23570
23586
|
return headers;
|
package/dist/cli.js
CHANGED
|
@@ -14858,6 +14858,18 @@ var OpenAPISpecLoader = class {
|
|
|
14858
14858
|
});
|
|
14859
14859
|
return combinedParts.map((p) => p.trim()).filter((p) => p.length > 0);
|
|
14860
14860
|
}
|
|
14861
|
+
// Helper to split only by underscore and camelCase, but not by numbers
|
|
14862
|
+
// Used when abbreviation is disabled to preserve number-letter combinations like "web3"
|
|
14863
|
+
splitCombinedWithoutNumbers(input) {
|
|
14864
|
+
const underscoreParts = input.split("_");
|
|
14865
|
+
let combinedParts = [];
|
|
14866
|
+
underscoreParts.forEach((part) => {
|
|
14867
|
+
const spacedPart = part.replace(/([A-Z]+)/g, " $1").replace(/([A-Z][a-z])/g, " $1");
|
|
14868
|
+
const splitParts = spacedPart.split(" ").filter((p) => p.length > 0);
|
|
14869
|
+
combinedParts = combinedParts.concat(splitParts);
|
|
14870
|
+
});
|
|
14871
|
+
return combinedParts.map((p) => p.trim()).filter((p) => p.length > 0);
|
|
14872
|
+
}
|
|
14861
14873
|
_initialSanitizeAndValidate(originalId, maxLength) {
|
|
14862
14874
|
if (!originalId || originalId.trim().length === 0)
|
|
14863
14875
|
return { currentName: "", originalWasLong: false, errorName: "unnamed-tool" };
|
|
@@ -14950,7 +14962,7 @@ var OpenAPISpecLoader = class {
|
|
|
14950
14962
|
if (errorName) return errorName;
|
|
14951
14963
|
let processedName;
|
|
14952
14964
|
if (this.disableAbbreviation) {
|
|
14953
|
-
processedName = this.
|
|
14965
|
+
processedName = this.splitCombinedWithoutNumbers(sanitizedName).join("-");
|
|
14954
14966
|
} else {
|
|
14955
14967
|
processedName = this._performSemanticAbbreviation(sanitizedName);
|
|
14956
14968
|
processedName = this._applyVowelRemovalIfOverLength(processedName, maxLength);
|
|
@@ -23563,8 +23575,12 @@ function parseHeaders(headerStr) {
|
|
|
23563
23575
|
const headers = {};
|
|
23564
23576
|
if (headerStr) {
|
|
23565
23577
|
headerStr.split(",").forEach((header) => {
|
|
23566
|
-
const
|
|
23567
|
-
if (
|
|
23578
|
+
const colonIndex = header.indexOf(":");
|
|
23579
|
+
if (colonIndex > 0) {
|
|
23580
|
+
const key = header.substring(0, colonIndex).trim();
|
|
23581
|
+
const value = header.substring(colonIndex + 1).trim();
|
|
23582
|
+
if (key) headers[key] = value;
|
|
23583
|
+
}
|
|
23568
23584
|
});
|
|
23569
23585
|
}
|
|
23570
23586
|
return headers;
|