• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mongodb-js / mongodb-mcp-server / 16292766252

15 Jul 2025 12:05PM UTC coverage: 77.587%. First build
16292766252

Pull #363

github

web-flow
Merge b254655f9 into ab6aae635
Pull Request #363: chore(tests): switch to vitest MCP-65

501 of 690 branches covered (72.61%)

Branch coverage included in aggregate %.

0 of 27 new or added lines in 2 files covered. (0.0%)

2836 of 3611 relevant lines covered (78.54%)

28.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

1.54
/scripts/filter.ts
1
import { OpenAPIV3_1 } from "openapi-types";
2✔
2

3
async function readStdin() {
×
4
    return new Promise<string>((resolve, reject) => {
×
5
        let data = "";
×
6
        process.stdin.setEncoding("utf8");
×
7
        process.stdin.on("error", (err) => {
×
8
            reject(err);
×
9
        });
×
10
        process.stdin.on("data", (chunk) => {
×
11
            // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
12
            data += chunk;
×
13
        });
×
14
        process.stdin.on("end", () => {
×
15
            resolve(data);
×
16
        });
×
17
    });
×
18
}
×
19

20
function filterOpenapi(openapi: OpenAPIV3_1.Document): OpenAPIV3_1.Document {
×
21
    const allowedOperations = [
×
22
        "listProjects",
×
23
        "listOrganizations",
×
24
        "getProject",
×
25
        "createProject",
×
26
        "deleteProject",
×
27
        "listClusters",
×
28
        "listFlexClusters",
×
29
        "getCluster",
×
30
        "getFlexCluster",
×
31
        "createCluster",
×
32
        "createFlexCluster",
×
33
        "deleteCluster",
×
34
        "deleteFlexCluster",
×
35
        "listClustersForAllProjects",
×
36
        "createDatabaseUser",
×
37
        "deleteDatabaseUser",
×
38
        "listDatabaseUsers",
×
39
        "listProjectIpAccessLists",
×
40
        "createProjectIpAccessList",
×
41
        "deleteProjectIpAccessList",
×
42
        "listOrganizationProjects",
×
43
        "listAlerts",
×
44
    ];
×
45

46
    const filteredPaths = {};
×
47

48
    for (const path in openapi.paths) {
×
49
        const filteredMethods = {} as OpenAPIV3_1.PathItemObject;
×
50
        for (const method in openapi.paths[path]) {
×
51
            // @ts-expect-error This is a workaround for the OpenAPI types
52
            if (allowedOperations.includes((openapi.paths[path][method] as { operationId: string }).operationId)) {
×
53
                // @ts-expect-error This is a workaround for the OpenAPI types
54
                filteredMethods[method] = openapi.paths[path][method] as OpenAPIV3_1.OperationObject;
×
55
            }
×
56
        }
×
57
        if (Object.keys(filteredMethods).length > 0) {
×
58
            // @ts-expect-error This is a workaround for the OpenAPI types
59
            filteredPaths[path] = filteredMethods;
×
60
        }
×
61
    }
×
62

63
    return { ...openapi, paths: filteredPaths };
×
64
}
×
65

66
async function main() {
×
67
    const openapiText = await readStdin();
×
68
    const openapi = JSON.parse(openapiText) as OpenAPIV3_1.Document;
×
69
    const filteredOpenapi = filterOpenapi(openapi);
×
70
    console.log(JSON.stringify(filteredOpenapi));
×
71
}
×
72

73
main().catch((error) => {
×
74
    console.error("Error:", error);
×
75
    process.exit(1);
×
76
});
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc