@@ -26,7 +26,7 @@ export type MongoDBDownloaderOptions = {
2626 /** The directory to download the artifacts to. */
2727 directory : string ;
2828 /** The semantic version specifier for the target version. */
29- version : string ;
29+ version ? : string ;
3030 /** Whether to use a lockfile for preventing concurrent downloads of the same version. */
3131 useLockfile : boolean ;
3232 /** The options to pass to the download URL lookup. */
@@ -36,7 +36,7 @@ export type MongoDBDownloaderOptions = {
3636export class MongoDBDownloader {
3737 async downloadMongoDbWithVersionInfo ( {
3838 downloadOptions = { } ,
39- version,
39+ version = '*' ,
4040 directory,
4141 useLockfile,
4242 } : MongoDBDownloaderOptions ) : Promise < DownloadResult > {
@@ -199,13 +199,6 @@ export class MongoDBDownloader {
199199 } ) ;
200200 }
201201
202- public async downloadMongoDb (
203- ...args : Parameters < typeof this . downloadMongoDbWithVersionInfo >
204- ) : Promise < string > {
205- return ( await this . downloadMongoDbWithVersionInfo ( ...args ) )
206- . downloadedBinDir ;
207- }
208-
209202 private async getCurrentDownloadedFile ( {
210203 bindir,
211204 artifactInfoFile,
@@ -238,7 +231,7 @@ const downloader = new MongoDBDownloader();
238231/** Download mongod + mongos with version info and return version info and the path to a directory containing them. */
239232export async function downloadMongoDbWithVersionInfo ( {
240233 downloadOptions = { } ,
241- version,
234+ version = '*' ,
242235 directory,
243236 useLockfile,
244237} : MongoDBDownloaderOptions ) : Promise < DownloadResult > {
@@ -250,8 +243,18 @@ export async function downloadMongoDbWithVersionInfo({
250243 } ) ;
251244}
252245/** Download mongod + mongos and return the path to a directory containing them. */
253- export async function downloadMongoDb (
254- ...args : Parameters < typeof downloadMongoDbWithVersionInfo >
255- ) : Promise < string > {
256- return await downloader . downloadMongoDb ( ...args ) ;
246+ export async function downloadMongoDb ( {
247+ downloadOptions = { } ,
248+ version = '*' ,
249+ directory,
250+ useLockfile,
251+ } : MongoDBDownloaderOptions ) : Promise < string > {
252+ return (
253+ await downloader . downloadMongoDbWithVersionInfo ( {
254+ downloadOptions,
255+ version,
256+ directory,
257+ useLockfile,
258+ } )
259+ ) . downloadedBinDir ;
257260}
0 commit comments