@softeria/ms-365-mcp-server 0.191.0 → 0.191.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/graph-tools.js +15 -3
- package/package.json +1 -1
package/dist/graph-tools.js
CHANGED
|
@@ -2083,6 +2083,18 @@ function rawValueAddsSegments(template, names, value) {
|
|
|
2083
2083
|
const isTail = names.some((n) => template.endsWith(`/{${n}}`) || template.endsWith(`/:${n}`));
|
|
2084
2084
|
return isTail ? value.includes(":") : value.includes("/");
|
|
2085
2085
|
}
|
|
2086
|
+
function colonPlaceholder(name) {
|
|
2087
|
+
return new RegExp(`:${name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![A-Za-z0-9])`);
|
|
2088
|
+
}
|
|
2089
|
+
function fillPathParam(path2, names, value) {
|
|
2090
|
+
for (const name of new Set(names)) {
|
|
2091
|
+
path2 = path2.replace(`{${name}}`, () => value).replace(colonPlaceholder(name), () => value);
|
|
2092
|
+
}
|
|
2093
|
+
return path2;
|
|
2094
|
+
}
|
|
2095
|
+
function hasPathPlaceholder(path2, names) {
|
|
2096
|
+
return names.some((name) => path2.includes(`{${name}}`) || colonPlaceholder(name).test(path2));
|
|
2097
|
+
}
|
|
2086
2098
|
function invalidPathParameter(message) {
|
|
2087
2099
|
return {
|
|
2088
2100
|
content: [
|
|
@@ -2243,7 +2255,7 @@ async function executeGraphTool(tool, config, graphClient, params, authManager,
|
|
|
2243
2255
|
/%3D/g,
|
|
2244
2256
|
"="
|
|
2245
2257
|
);
|
|
2246
|
-
path2 = path2
|
|
2258
|
+
path2 = fillPathParam(path2, names, encodedValue);
|
|
2247
2259
|
break;
|
|
2248
2260
|
}
|
|
2249
2261
|
case "Query":
|
|
@@ -2280,11 +2292,11 @@ async function executeGraphTool(tool, config, graphClient, params, authManager,
|
|
|
2280
2292
|
} else if (paramName === "body") {
|
|
2281
2293
|
body = paramValue;
|
|
2282
2294
|
logger.info(`Set body param: ${describeShape(body)} (${serializedSize(body)} bytes)`);
|
|
2283
|
-
} else if (path2
|
|
2295
|
+
} else if (hasPathPlaceholder(path2, [paramName, camelCaseParamName])) {
|
|
2284
2296
|
const encodedValue = encodeURIComponent(
|
|
2285
2297
|
escapeIfStringLiteral(tool.path, [paramName, camelCaseParamName], paramValue)
|
|
2286
2298
|
).replace(/%3D/g, "=");
|
|
2287
|
-
path2 = path2
|
|
2299
|
+
path2 = fillPathParam(path2, [paramName, camelCaseParamName], encodedValue);
|
|
2288
2300
|
logger.info(`Path param fallback: replaced :${camelCaseParamName} with encoded value`);
|
|
2289
2301
|
} else if (paramName.toLowerCase() === "accept" && config?.acceptType) {
|
|
2290
2302
|
if (paramValue !== "" && paramValue != null) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softeria/ms-365-mcp-server",
|
|
3
3
|
"mcpName": "io.github.Softeria/ms-365-mcp-server",
|
|
4
|
-
"version": "0.191.
|
|
4
|
+
"version": "0.191.2",
|
|
5
5
|
"description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|