@@ -8,7 +8,7 @@ import type { Secret } from "./keychain.js";
88import levenshtein from "ts-levenshtein" ;
99
1010// From: https://github.com/mongodb-js/mongosh/blob/main/packages/cli-repl/src/arg-parser.ts
11- const MONGOSH_OPTIONS = {
11+ const OPTIONS = {
1212 string : [
1313 "apiBaseUrl" ,
1414 "apiClientId" ,
@@ -48,6 +48,7 @@ const MONGOSH_OPTIONS = {
4848 "tlsCertificateSelector" ,
4949 "tlsDisabledProtocols" ,
5050 "username" ,
51+ "atlasTemporaryDatabaseUserLifetimeMs" ,
5152 ] ,
5253 boolean : [
5354 "apiDeprecationErrors" ,
@@ -92,10 +93,6 @@ const MONGOSH_OPTIONS = {
9293 } ,
9394} as Readonly < Options > ;
9495
95- const MCP_SERVER_OPTIONS = {
96- string : [ "atlasTemporaryDatabaseUserLifetimeMs" ] ,
97- } as Readonly < Partial < Options > > ;
98-
9996interface Options {
10097 string : string [ ] ;
10198 boolean : string [ ] ;
@@ -104,21 +101,6 @@ interface Options {
104101 configuration : Record < string , boolean > ;
105102}
106103
107- function mergeOptions ( ...optionSources : Array < Partial < Options > > ) : Readonly < Options > {
108- return {
109- string : optionSources . flatMap ( ( opts ) => opts . string ?? [ ] ) ,
110- boolean : optionSources . flatMap ( ( opts ) => opts . boolean ?? [ ] ) ,
111- array : optionSources . flatMap ( ( opts ) => opts . array ?? [ ] ) ,
112- alias : Object . assign ( { } , ...optionSources . map ( ( opts ) => opts . alias ?? { } ) ) as Record < string , string > ,
113- configuration : Object . assign ( { } , ...optionSources . map ( ( opts ) => opts . configuration ?? { } ) ) as Record <
114- string ,
115- boolean
116- > ,
117- } ;
118- }
119-
120- const OPTIONS = mergeOptions ( MONGOSH_OPTIONS , MCP_SERVER_OPTIONS ) ;
121-
122104const ALL_CONFIG_KEYS = new Set (
123105 ( OPTIONS . string as readonly string [ ] )
124106 . concat ( OPTIONS . array )
0 commit comments