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 " ;
22import { OpenAPIV3_1 } from "openapi-types" ;
33import argv from "yargs-parser" ;
4- import { promisify } from "util" ;
5-
6- const readFileAsync = promisify ( fs . readFile ) ;
7- const writeFileAsync = promisify ( fs . writeFile ) ;
84
95function findParamFromRef ( ref : string , openapi : OpenAPIV3_1 . Document ) : OpenAPIV3_1 . ParameterObject {
106 const paramParts = ref . split ( "/" ) ;
@@ -28,7 +24,7 @@ async function main() {
2824 process . exit ( 1 ) ;
2925 }
3026
31- const specFile = ( await readFileAsync ( spec , "utf8" ) ) as string ;
27+ const specFile = ( await fs . readFile ( spec , "utf8" ) ) as string ;
3228
3329 const operations : {
3430 path : string ;
@@ -81,13 +77,13 @@ async function main() {
8177 } )
8278 . join ( "\n" ) ;
8379
84- const templateFile = ( await readFileAsync ( file , "utf8" ) ) as string ;
80+ const templateFile = ( await fs . readFile ( file , "utf8" ) ) as string ;
8581 const output = templateFile . replace (
8682 / \/ \/ 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,
8783 operationOutput
8884 ) ;
8985
90- await writeFileAsync ( file , output , "utf8" ) ;
86+ await fs . writeFile ( file , output , "utf8" ) ;
9187}
9288
9389main ( ) . catch ( ( error ) => {
Original file line number Diff line number Diff line change 1- import fs from "fs" ;
1+ import fs from "fs/promises " ;
22import { MongoLogId , MongoLogManager , MongoLogWriter } from "mongodb-log-writer" ;
33import config from "./config.js" ;
44import redact from "mongodb-redact" ;
55import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js" ;
66import { LoggingMessageNotification } from "@modelcontextprotocol/sdk/types.js" ;
7- import { promisify } from "util" ;
87
98export type LogLevel = LoggingMessageNotification [ "params" ] [ "level" ] ;
109
@@ -99,10 +98,8 @@ class ProxyingLogger extends LoggerBase {
9998const logger = new ProxyingLogger ( ) ;
10099export default logger ;
101100
102- const mkdirAsync = promisify ( fs . mkdir ) ;
103-
104101export async function initializeLogger ( server : McpServer ) : Promise < void > {
105- await mkdirAsync ( config . logPath , { recursive : true } ) ;
102+ await fs . mkdir ( config . logPath , { recursive : true } ) ;
106103
107104 const manager = new MongoLogManager ( {
108105 directory : config . logPath ,
You can’t perform that action at this time.
0 commit comments