Skip to content

Commit 10cfa19

Browse files
committed
refactor(tools): pf-3836 allow resource uris in search tool
* build, tsconfig move to es2023 target * pf.getResource, hash, uri, and path index maps for search * pf.search, hash, uri, and path as search, dynamic filtering option * resources, optimize entry lookup loops, separate responses for templates * server.getResources, optimize processDocsFunction for metadata, better errors * server.helpers, new isUrlObject, parseUrl, enhance buildSearchString, add decodeURIComponent * server.search, enhance findClosest with distance and memo * tool.patternFlyDocs, zod add min to urlList * tool.searchPatternFlyDocs, recommendations for available sections, categories
1 parent 20faaba commit 10cfa19

20 files changed

Lines changed: 616 additions & 235 deletions

src/__tests__/__snapshots__/patternFly.getResources.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ exports[`getPatternFlyMcpResources should return multiple organized facets: prop
2828
"keywordsIndex",
2929
"keywordsMap",
3030
"pathIndex",
31+
"uriIndex",
32+
"hashIndex",
3133
"byPath",
3234
"byUri",
3335
"byVersion",

src/__tests__/__snapshots__/patternFly.search.test.ts.snap

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/__tests__/patternFly.getResources.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,12 @@ describe('getPatternFlyMcpResources', () => {
151151
it('should have a memoized property', async () => {
152152
expect(getPatternFlyMcpResources).toHaveProperty('memo');
153153
});
154+
155+
it('should have lowercased index keys', async () => {
156+
const result = await getPatternFlyMcpResources();
157+
158+
expect(Array.from(result.pathIndex.keys()).some(key => /[A-Z]/.test(key))).toBe(false);
159+
expect(Array.from(result.uriIndex.keys()).some(key => /[A-Z]/.test(key))).toBe(false);
160+
expect(Array.from(result.hashIndex.keys()).some(key => /[A-Z]/.test(key))).toBe(false);
161+
});
154162
});

0 commit comments

Comments
 (0)