Skip to content

Commit 3276e59

Browse files
committed
fix: review update
1 parent f2a47c5 commit 3276e59

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

src/resource.helpers.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,23 @@ const paramCompletion = async (filters: FilterPatternFlyFilters) => {
1717
const schemas = new Set<string>();
1818

1919
for (const entry of byEntry) {
20-
names.add(entry.name);
21-
categories.add(entry.category);
22-
sections.add(entry.section);
23-
versions.add(entry.version);
20+
if (typeof entry.name === 'string') {
21+
names.add(entry.name);
22+
}
23+
24+
if (typeof entry.category === 'string') {
25+
categories.add(entry.category);
26+
}
27+
28+
if (typeof entry.section === 'string') {
29+
sections.add(entry.section);
30+
}
31+
32+
if (typeof entry.version === 'string') {
33+
versions.add(entry.version);
34+
}
2435

25-
if (entry.uriSchemas !== undefined) {
36+
if (entry.uriSchemas !== undefined && typeof entry.name === 'string') {
2637
schemas.add(entry.name);
2738
}
2839
}

src/resource.patternFlyComponentsIndex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const CONFIG = {
4646
* @note We use "byVersionComponentNames" instead of "byVersion" because it's specific to components.
4747
* Docs resources don't necessarily contain all components.
4848
*
49-
* @returns {Promise<PatterFlyListResourceResult>} The list of available resources.
49+
* @returns {Promise<PatternFlyListResourceResult>} The list of available resources.
5050
*/
5151
const listResources = async () => {
5252
const { availableVersions, byVersionComponentNames } = await getPatternFlyMcpResources.memo();
@@ -103,7 +103,7 @@ const uriCategoryComplete: ExtendedCompleteResourceTemplateCallback = async (cat
103103
uriCategoryComplete.memo = memo(uriCategoryComplete);
104104

105105
/**
106-
* Name completion callback for the URI template.
106+
* Version completion callback for the URI template.
107107
*
108108
* @param version - The value to complete.
109109
* @param context - The completion context containing arguments for the URI template.

src/resource.patternFlyDocsIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const CONFIG = {
6666
*
6767
* @note It's important to keep lists focused and concise, avoid listing all resources.
6868
*
69-
* @returns {Promise<PatterFlyListResourceResult>} The list of available resources.
69+
* @returns {Promise<PatternFlyListResourceResult>} The list of available resources.
7070
*/
7171
const listResources = async () => {
7272
const { availableVersions, byVersion } = await getPatternFlyMcpResources.memo();

src/resource.patternFlySchemasIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const CONFIG = {
4040
/**
4141
* List resources callback for the URI template.
4242
*
43-
* @returns {Promise<PatterFlyListResourceResult>} The list of available resources.
43+
* @returns {Promise<PatternFlyListResourceResult>} The list of available resources.
4444
*/
4545
const listResources = async () => {
4646
const { availableSchemasVersions, byVersionComponentNames } = await getPatternFlyMcpResources.memo();

0 commit comments

Comments
 (0)