fastmcp 4.22.5 → 4.22.6
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/README.md +2 -0
- package/dist/FastMCP.cjs +3 -3
- package/dist/FastMCP.js +2 -2
- package/dist/auth/index.cjs +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{chunk-XPKMA7DH.js → chunk-ISYL7EKR.js} +5 -2
- package/dist/{chunk-XPKMA7DH.js.map → chunk-ISYL7EKR.js.map} +1 -1
- package/dist/{chunk-A6QGY7T7.js → chunk-OAM6AYJY.js} +18 -4
- package/dist/chunk-OAM6AYJY.js.map +1 -0
- package/dist/{chunk-PAWIMJ72.cjs → chunk-QJIFKZYZ.cjs} +21 -7
- package/dist/chunk-QJIFKZYZ.cjs.map +1 -0
- package/dist/{chunk-YOBCXNFP.cjs → chunk-YLLBANV4.cjs} +5 -2
- package/dist/chunk-YLLBANV4.cjs.map +1 -0
- package/dist/examples/custom-routes.cjs +3 -3
- package/dist/examples/custom-routes.js +2 -2
- package/dist/openapi/index.cjs +7 -7
- package/dist/openapi/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-A6QGY7T7.js.map +0 -1
- package/dist/chunk-PAWIMJ72.cjs.map +0 -1
- package/dist/chunk-YOBCXNFP.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cancelResponseBody
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ISYL7EKR.js";
|
|
4
4
|
import {
|
|
5
5
|
strictInputSchema
|
|
6
6
|
} from "./chunk-UMDUIBFW.js";
|
|
@@ -1306,7 +1306,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1306
1306
|
const uriTemplate = parseURITemplate(
|
|
1307
1307
|
resourceTemplate.uriTemplate
|
|
1308
1308
|
);
|
|
1309
|
-
const match = uriTemplate
|
|
1309
|
+
const match = matchUriTemplate(uriTemplate, request.params.uri);
|
|
1310
1310
|
if (!match) {
|
|
1311
1311
|
continue;
|
|
1312
1312
|
}
|
|
@@ -1670,6 +1670,20 @@ function convertObjectToSnakeCase(obj) {
|
|
|
1670
1670
|
function joinPaths(basePath, path) {
|
|
1671
1671
|
return `${basePath}${normalizePath(path)}`;
|
|
1672
1672
|
}
|
|
1673
|
+
function matchUriTemplate(template, uri) {
|
|
1674
|
+
const match = template.fromUri(uri);
|
|
1675
|
+
if (!match) {
|
|
1676
|
+
return void 0;
|
|
1677
|
+
}
|
|
1678
|
+
const checksQuery = !/\{[?&]/.test(template.template);
|
|
1679
|
+
const checksFragment = !template.template.includes("{#");
|
|
1680
|
+
const shape = (value) => [
|
|
1681
|
+
value.split(/[?#]/, 1)[0].split("/").length,
|
|
1682
|
+
checksQuery && value.includes("?"),
|
|
1683
|
+
checksFragment && value.includes("#")
|
|
1684
|
+
].join();
|
|
1685
|
+
return shape(template.fill(match)) === shape(uri) ? match : void 0;
|
|
1686
|
+
}
|
|
1673
1687
|
function normalizeBasePath(path) {
|
|
1674
1688
|
if (!path || path === "/") {
|
|
1675
1689
|
return "";
|
|
@@ -1950,7 +1964,7 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
1950
1964
|
}
|
|
1951
1965
|
for (const template of this.#resourcesTemplates) {
|
|
1952
1966
|
const parsedTemplate = parseURITemplate(template.uriTemplate);
|
|
1953
|
-
const params = parsedTemplate
|
|
1967
|
+
const params = matchUriTemplate(parsedTemplate, uri);
|
|
1954
1968
|
if (!params) {
|
|
1955
1969
|
continue;
|
|
1956
1970
|
}
|
|
@@ -3052,4 +3066,4 @@ export {
|
|
|
3052
3066
|
FastMCPSession,
|
|
3053
3067
|
FastMCP
|
|
3054
3068
|
};
|
|
3055
|
-
//# sourceMappingURL=chunk-
|
|
3069
|
+
//# sourceMappingURL=chunk-OAM6AYJY.js.map
|