File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 1
- import fs from "fs" ;
1
+ import fs from "fs/promises " ;
2
2
import { OpenAPIV3_1 } from "openapi-types" ;
3
3
import argv from "yargs-parser" ;
4
- import { promisify } from "util" ;
5
-
6
- const readFileAsync = promisify ( fs . readFile ) ;
7
- const writeFileAsync = promisify ( fs . writeFile ) ;
8
4
9
5
function findParamFromRef ( ref : string , openapi : OpenAPIV3_1 . Document ) : OpenAPIV3_1 . ParameterObject {
10
6
const paramParts = ref . split ( "/" ) ;
@@ -28,7 +24,7 @@ async function main() {
28
24
process . exit ( 1 ) ;
29
25
}
30
26
31
- const specFile = ( await readFileAsync ( spec , "utf8" ) ) as string ;
27
+ const specFile = ( await fs . readFile ( spec , "utf8" ) ) as string ;
32
28
33
29
const operations : {
34
30
path : string ;
@@ -81,13 +77,13 @@ async function main() {
81
77
} )
82
78
. join ( "\n" ) ;
83
79
84
- const templateFile = ( await readFileAsync ( file , "utf8" ) ) as string ;
80
+ const templateFile = ( await fs . readFile ( file , "utf8" ) ) as string ;
85
81
const output = templateFile . replace (
86
82
/ \/ \/ D O N O T E D I T \. T h i s i s a u t o - g e n e r a t e d c o d e \. \n .* \/ \/ D O N O T E D I T \. T h i s i s a u t o - g e n e r a t e d c o d e \. / g,
87
83
operationOutput
88
84
) ;
89
85
90
- await writeFileAsync ( file , output , "utf8" ) ;
86
+ await fs . writeFile ( file , output , "utf8" ) ;
91
87
}
92
88
93
89
main ( ) . catch ( ( error ) => {
Original file line number Diff line number Diff line change 1
- import fs from "fs" ;
1
+ import fs from "fs/promises " ;
2
2
import { MongoLogId , MongoLogManager , MongoLogWriter } from "mongodb-log-writer" ;
3
3
import config from "./config.js" ;
4
4
import redact from "mongodb-redact" ;
5
5
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js" ;
6
6
import { LoggingMessageNotification } from "@modelcontextprotocol/sdk/types.js" ;
7
- import { promisify } from "util" ;
8
7
9
8
export type LogLevel = LoggingMessageNotification [ "params" ] [ "level" ] ;
10
9
@@ -99,10 +98,8 @@ class ProxyingLogger extends LoggerBase {
99
98
const logger = new ProxyingLogger ( ) ;
100
99
export default logger ;
101
100
102
- const mkdirAsync = promisify ( fs . mkdir ) ;
103
-
104
101
export async function initializeLogger ( server : McpServer ) : Promise < void > {
105
- await mkdirAsync ( config . logPath , { recursive : true } ) ;
102
+ await fs . mkdir ( config . logPath , { recursive : true } ) ;
106
103
107
104
const manager = new MongoLogManager ( {
108
105
directory : config . logPath ,
You can’t perform that action at this time.
0 commit comments