Skip to content

Commit d9017f7

Browse files
lucbpzlucadruda
andauthored
remove node-fetch (#46)
* remove node-fetch * include dom lib and remove type --------- Co-authored-by: Luca Druda <[email protected]>
1 parent aa1aa5c commit d9017f7

File tree

5 files changed

+3
-92
lines changed

5 files changed

+3
-92
lines changed

package-lock.json

Lines changed: 0 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"@modelcontextprotocol/specification": "github:modelcontextprotocol/specification",
3232
"express": "^5.1.0",
3333
"jwt-decode": "^4.0.0",
34-
"node-fetch": "^3.3.2",
3534
"winston": "^3.17.0",
3635
"zod": "^3.25.67"
3736
},

src/scout.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import { Asset, AssetConfig } from './asset';
1818
import { ScoutClient } from './scout/client';
19-
import fetch, { RequestInfo, RequestInit } from 'node-fetch';
2019
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2120
import z from 'zod';
2221
import { logger } from './logger';
@@ -36,7 +35,7 @@ export class ScoutAPI extends Asset {
3635
headers: {
3736
'Content-Type': 'application/json',
3837
},
39-
fetchFn: async (input: RequestInfo | URL, init?: RequestInit) => {
38+
fetchFn: async (input: Request | URL, init?: RequestInit) => {
4039
const headers = {
4140
...init?.headers,
4241
'Content-Type': 'application/json',

src/scout/client.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import { createClient, GenqlError, Client, FieldsSelection } from './genql';
1818
import type { Mutation, MutationGenqlSelection, Query, QueryGenqlSelection } from './genql/schema';
19-
import { RequestInfo, RequestInit, Response, HeadersInit } from 'node-fetch';
2019

2120
/**
2221
* @see https://spec.graphql.org/October2021/#example-8b658
@@ -77,7 +76,7 @@ export class ScoutClient {
7776
constructor(options: {
7877
url: string;
7978
headers?: HeadersInit;
80-
fetchFn: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
79+
fetchFn: (input: Request | URL, init?: RequestInit) => Promise<Response>;
8180
reportErrorFn: (error: Error, onErrorCallback?: () => void) => void;
8281
}) {
8382
const { url, headers, fetchFn, reportErrorFn } = options;

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"target": "ES2020",
44
"module": "CommonJS",
5-
"lib": ["ES2020"],
5+
"lib": ["ES2020", "DOM"],
66
"outDir": "./dist",
77
"rootDir": "./src",
88
"strict": true,

0 commit comments

Comments
 (0)