@ivotoby/openapi-mcp-server 1.8.2 → 1.8.3

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 CHANGED
@@ -14381,10 +14381,15 @@ function parseToolId(toolId) {
14381
14381
  return { method, path: "/" + path };
14382
14382
  }
14383
14383
  function sanitizeForToolId(input) {
14384
- return input.replace(/[^A-Za-z0-9_-]/g, "").replace(/_{3,}/g, "__").replace(/^[_-]+|[_-]+$/g, "");
14384
+ let result = input.replace(/[^A-Za-z0-9_-]/g, "").replace(/_{3,}/g, "__");
14385
+ result = collapseExcessiveHyphens(result);
14386
+ return result.replace(/^[_-]+|[_-]+$/g, "");
14387
+ }
14388
+ function collapseExcessiveHyphens(input) {
14389
+ return input.replace(/-{4,}/g, "---");
14385
14390
  }
14386
14391
  function generateToolId(method, path) {
14387
- const cleanPath = path.replace(/^\//, "").replace(/\/+/g, "/").replace(/\{([^}]+)\}/g, "$1").replace(/\//g, "__");
14392
+ const cleanPath = path.replace(/^\//, "").replace(/\/+/g, "/").replace(/\{([^}]+)\}/g, "---$1").replace(/\//g, "__");
14388
14393
  const sanitizedPath = sanitizeForToolId(cleanPath);
14389
14394
  return `${method.toUpperCase()}::${sanitizedPath}`;
14390
14395
  }
@@ -18604,7 +18609,10 @@ var ApiClient = class {
18604
18609
  const paramLocation = paramDef_any?.["x-parameter-location"];
18605
18610
  if (paramLocation === "path") {
18606
18611
  const escapedKey = escapeRegExp(key);
18607
- const paramRegex = new RegExp(`\\{${escapedKey}\\}|:${escapedKey}(?:\\/|$)`, "g");
18612
+ const paramRegex = new RegExp(
18613
+ `\\{${escapedKey}\\}|:${escapedKey}(?:\\/|$)|---${escapedKey}(?=__|/|$)`,
18614
+ "g"
18615
+ );
18608
18616
  if (paramRegex.test(resolvedPath)) {
18609
18617
  resolvedPath = resolvedPath.replace(
18610
18618
  paramRegex,
@@ -18620,7 +18628,10 @@ var ApiClient = class {
18620
18628
  for (const key of Object.keys(paramsCopy)) {
18621
18629
  const value = paramsCopy[key];
18622
18630
  const escapedKey = escapeRegExp(key);
18623
- const paramRegex = new RegExp(`\\{${escapedKey}\\}|:${escapedKey}(?:\\/|$)`, "g");
18631
+ const paramRegex = new RegExp(
18632
+ `\\{${escapedKey}\\}|:${escapedKey}(?:\\/|$)|---${escapedKey}(?=__|/|$)`,
18633
+ "g"
18634
+ );
18624
18635
  if (paramRegex.test(resolvedPath)) {
18625
18636
  resolvedPath = resolvedPath.replace(
18626
18637
  paramRegex,
package/dist/cli.js CHANGED
@@ -14381,10 +14381,15 @@ function parseToolId(toolId) {
14381
14381
  return { method, path: "/" + path };
14382
14382
  }
14383
14383
  function sanitizeForToolId(input) {
14384
- return input.replace(/[^A-Za-z0-9_-]/g, "").replace(/_{3,}/g, "__").replace(/^[_-]+|[_-]+$/g, "");
14384
+ let result = input.replace(/[^A-Za-z0-9_-]/g, "").replace(/_{3,}/g, "__");
14385
+ result = collapseExcessiveHyphens(result);
14386
+ return result.replace(/^[_-]+|[_-]+$/g, "");
14387
+ }
14388
+ function collapseExcessiveHyphens(input) {
14389
+ return input.replace(/-{4,}/g, "---");
14385
14390
  }
14386
14391
  function generateToolId(method, path) {
14387
- const cleanPath = path.replace(/^\//, "").replace(/\/+/g, "/").replace(/\{([^}]+)\}/g, "$1").replace(/\//g, "__");
14392
+ const cleanPath = path.replace(/^\//, "").replace(/\/+/g, "/").replace(/\{([^}]+)\}/g, "---$1").replace(/\//g, "__");
14388
14393
  const sanitizedPath = sanitizeForToolId(cleanPath);
14389
14394
  return `${method.toUpperCase()}::${sanitizedPath}`;
14390
14395
  }
@@ -18604,7 +18609,10 @@ var ApiClient = class {
18604
18609
  const paramLocation = paramDef_any?.["x-parameter-location"];
18605
18610
  if (paramLocation === "path") {
18606
18611
  const escapedKey = escapeRegExp(key);
18607
- const paramRegex = new RegExp(`\\{${escapedKey}\\}|:${escapedKey}(?:\\/|$)`, "g");
18612
+ const paramRegex = new RegExp(
18613
+ `\\{${escapedKey}\\}|:${escapedKey}(?:\\/|$)|---${escapedKey}(?=__|/|$)`,
18614
+ "g"
18615
+ );
18608
18616
  if (paramRegex.test(resolvedPath)) {
18609
18617
  resolvedPath = resolvedPath.replace(
18610
18618
  paramRegex,
@@ -18620,7 +18628,10 @@ var ApiClient = class {
18620
18628
  for (const key of Object.keys(paramsCopy)) {
18621
18629
  const value = paramsCopy[key];
18622
18630
  const escapedKey = escapeRegExp(key);
18623
- const paramRegex = new RegExp(`\\{${escapedKey}\\}|:${escapedKey}(?:\\/|$)`, "g");
18631
+ const paramRegex = new RegExp(
18632
+ `\\{${escapedKey}\\}|:${escapedKey}(?:\\/|$)|---${escapedKey}(?=__|/|$)`,
18633
+ "g"
18634
+ );
18624
18635
  if (paramRegex.test(resolvedPath)) {
18625
18636
  resolvedPath = resolvedPath.replace(
18626
18637
  paramRegex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ivotoby/openapi-mcp-server",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "An MCP server that exposes OpenAPI endpoints as resources",
5
5
  "license": "MIT",
6
6
  "type": "module",