mongodb-memory-server-core 8.15.1 → 9.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/lib/MongoMemoryReplSet.d.ts +4 -20
  2. package/lib/MongoMemoryReplSet.d.ts.map +1 -1
  3. package/lib/MongoMemoryReplSet.js +283 -294
  4. package/lib/MongoMemoryReplSet.js.map +1 -1
  5. package/lib/MongoMemoryServer.d.ts +13 -26
  6. package/lib/MongoMemoryServer.d.ts.map +1 -1
  7. package/lib/MongoMemoryServer.js +340 -332
  8. package/lib/MongoMemoryServer.js.map +1 -1
  9. package/lib/util/DryMongoBinary.d.ts +2 -2
  10. package/lib/util/DryMongoBinary.d.ts.map +1 -1
  11. package/lib/util/DryMongoBinary.js +158 -172
  12. package/lib/util/DryMongoBinary.js.map +1 -1
  13. package/lib/util/MongoBinary.js +85 -85
  14. package/lib/util/MongoBinary.js.map +1 -1
  15. package/lib/util/MongoBinaryDownload.d.ts +2 -11
  16. package/lib/util/MongoBinaryDownload.d.ts.map +1 -1
  17. package/lib/util/MongoBinaryDownload.js +210 -262
  18. package/lib/util/MongoBinaryDownload.js.map +1 -1
  19. package/lib/util/MongoBinaryDownloadUrl.d.ts +3 -5
  20. package/lib/util/MongoBinaryDownloadUrl.d.ts.map +1 -1
  21. package/lib/util/MongoBinaryDownloadUrl.js +70 -100
  22. package/lib/util/MongoBinaryDownloadUrl.js.map +1 -1
  23. package/lib/util/MongoInstance.d.ts +3 -1
  24. package/lib/util/MongoInstance.d.ts.map +1 -1
  25. package/lib/util/MongoInstance.js +125 -126
  26. package/lib/util/MongoInstance.js.map +1 -1
  27. package/lib/util/errors.d.ts +10 -9
  28. package/lib/util/errors.d.ts.map +1 -1
  29. package/lib/util/errors.js +16 -27
  30. package/lib/util/errors.js.map +1 -1
  31. package/lib/util/getos/index.d.ts +1 -1
  32. package/lib/util/getos/index.d.ts.map +1 -1
  33. package/lib/util/getos/index.js +53 -59
  34. package/lib/util/getos/index.js.map +1 -1
  35. package/lib/util/getport/index.d.ts +34 -0
  36. package/lib/util/getport/index.d.ts.map +1 -0
  37. package/lib/util/getport/index.js +108 -0
  38. package/lib/util/getport/index.js.map +1 -0
  39. package/lib/util/lockfile.d.ts.map +1 -1
  40. package/lib/util/lockfile.js +155 -169
  41. package/lib/util/lockfile.js.map +1 -1
  42. package/lib/util/postinstallHelper.js +15 -18
  43. package/lib/util/postinstallHelper.js.map +1 -1
  44. package/lib/util/resolveConfig.d.ts +1 -1
  45. package/lib/util/resolveConfig.d.ts.map +1 -1
  46. package/lib/util/resolveConfig.js +10 -9
  47. package/lib/util/resolveConfig.js.map +1 -1
  48. package/lib/util/utils.d.ts +20 -4
  49. package/lib/util/utils.d.ts.map +1 -1
  50. package/lib/util/utils.js +135 -118
  51. package/lib/util/utils.js.map +1 -1
  52. package/package.json +9 -12
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MongoBinary = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const os_1 = (0, tslib_1.__importDefault)(require("os"));
6
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
7
- const MongoBinaryDownload_1 = (0, tslib_1.__importDefault)(require("./MongoBinaryDownload"));
8
- const resolveConfig_1 = (0, tslib_1.__importStar)(require("./resolveConfig"));
9
- const debug_1 = (0, tslib_1.__importDefault)(require("debug"));
10
- const semver = (0, tslib_1.__importStar)(require("semver"));
5
+ const os_1 = tslib_1.__importDefault(require("os"));
6
+ const path_1 = tslib_1.__importDefault(require("path"));
7
+ const MongoBinaryDownload_1 = tslib_1.__importDefault(require("./MongoBinaryDownload"));
8
+ const resolveConfig_1 = tslib_1.__importStar(require("./resolveConfig"));
9
+ const debug_1 = tslib_1.__importDefault(require("debug"));
10
+ const semver = tslib_1.__importStar(require("semver"));
11
11
  const utils_1 = require("./utils");
12
12
  const child_process_1 = require("child_process");
13
13
  const lockfile_1 = require("./lockfile");
@@ -22,40 +22,38 @@ class MongoBinary {
22
22
  * @param options Options Configuring which binary to download and to which path
23
23
  * @returns The BinaryPath the binary has been downloaded to
24
24
  */
25
- static download(options) {
26
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
27
- log('download');
28
- const { downloadDir, version } = options;
29
- // create downloadDir
30
- yield (0, utils_1.mkdir)(downloadDir);
31
- /** Lockfile path */
32
- const lockfile = path_1.default.resolve(downloadDir, `${version}.lock`);
33
- log(`download: Waiting to acquire Download lock for file "${lockfile}"`);
34
- // wait to get a lock
35
- // downloading of binaries may be quite long procedure
36
- // that's why we are using so big wait/stale periods
37
- const lock = yield lockfile_1.LockFile.lock(lockfile);
38
- log('download: Download lock acquired');
39
- // this is to ensure that the lockfile gets removed in case of an error
40
- try {
41
- // check cache if it got already added to the cache
42
- if (!DryMongoBinary_1.DryMongoBinary.binaryCache.has(version)) {
43
- log(`download: Adding version ${version} to cache`);
44
- const downloader = new MongoBinaryDownload_1.default(options);
45
- DryMongoBinary_1.DryMongoBinary.binaryCache.set(version, yield downloader.getMongodPath());
46
- }
47
- }
48
- finally {
49
- log('download: Removing Download lock');
50
- // remove lock
51
- yield lock.unlock();
52
- log('download: Download lock removed');
25
+ static async download(options) {
26
+ log('download');
27
+ const { downloadDir, version } = options;
28
+ // create downloadDir
29
+ await (0, utils_1.mkdir)(downloadDir);
30
+ /** Lockfile path */
31
+ const lockfile = path_1.default.resolve(downloadDir, `${version}.lock`);
32
+ log(`download: Waiting to acquire Download lock for file "${lockfile}"`);
33
+ // wait to get a lock
34
+ // downloading of binaries may be quite long procedure
35
+ // that's why we are using so big wait/stale periods
36
+ const lock = await lockfile_1.LockFile.lock(lockfile);
37
+ log('download: Download lock acquired');
38
+ // this is to ensure that the lockfile gets removed in case of an error
39
+ try {
40
+ // check cache if it got already added to the cache
41
+ if (!DryMongoBinary_1.DryMongoBinary.binaryCache.has(version)) {
42
+ log(`download: Adding version ${version} to cache`);
43
+ const downloader = new MongoBinaryDownload_1.default(options);
44
+ DryMongoBinary_1.DryMongoBinary.binaryCache.set(version, await downloader.getMongodPath());
53
45
  }
54
- const cachePath = DryMongoBinary_1.DryMongoBinary.binaryCache.get(version);
55
- // ensure that "path" exists, so the return type does not change
56
- (0, utils_1.assertion)(typeof cachePath === 'string', new Error(`No Cache Path for version "${version}" found (and download failed silently?)`));
57
- return cachePath;
58
- });
46
+ }
47
+ finally {
48
+ log('download: Removing Download lock');
49
+ // remove lock
50
+ await lock.unlock();
51
+ log('download: Download lock removed');
52
+ }
53
+ const cachePath = DryMongoBinary_1.DryMongoBinary.binaryCache.get(version);
54
+ // ensure that "path" exists, so the return type does not change
55
+ (0, utils_1.assertion)(typeof cachePath === 'string', new Error(`No Cache Path for version "${version}" found (and download failed silently?)`));
56
+ return cachePath;
59
57
  }
60
58
  /**
61
59
  * Probe all supported paths for an binary and return the binary path
@@ -63,57 +61,59 @@ class MongoBinary {
63
61
  * @throws {Error} if no valid BinaryPath has been found
64
62
  * @returns The first found BinaryPath
65
63
  */
66
- static getPath(opts = {}) {
67
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
68
- log('getPath');
69
- // "||" is still used here, because it should default if the value is false-y (like an empty string)
70
- const options = Object.assign(Object.assign({}, (yield DryMongoBinary_1.DryMongoBinary.generateOptions(opts))), { platform: opts.platform || (0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.PLATFORM) || os_1.default.platform(), checkMD5: opts.checkMD5 || (0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.MD5_CHECK)) });
71
- log(`getPath: MongoBinary options:`, JSON.stringify(options, null, 2));
72
- let binaryPath = yield DryMongoBinary_1.DryMongoBinary.locateBinary(options);
73
- // check if the system binary has the same version as requested
74
- if (!!options.systemBinary) {
75
- // this case should actually never be false, because if "SYSTEM_BINARY" is set, "locateBinary" will run "getSystemPath" which tests the path for permissions
76
- if (!(0, utils_1.isNullOrUndefined)(binaryPath)) {
77
- log(`getPath: Spawning binaryPath "${binaryPath}" to get version`);
78
- const spawnOutput = (0, child_process_1.spawnSync)(binaryPath, ['--version'])
79
- .stdout.toString()
80
- // this regex is to match the first line of the "mongod --version" output "db version v4.0.25" OR "db version v4.2.19-11-ge2f2736"
81
- .match(/^\s*db\s+version\s+v?(\d+\.\d+\.\d+)(-\d*)?(-[a-zA-Z0-9].*)?\s*$/im);
82
- (0, utils_1.assertion)(!(0, utils_1.isNullOrUndefined)(spawnOutput), new Error('Couldnt find an version from system binary output!'));
83
- // dont warn if the versions dont match if "SYSTEM_BINARY_VERSION_CHECK" is false, but still test the binary if it is available to be executed
84
- if ((0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.SYSTEM_BINARY_VERSION_CHECK))) {
85
- log('getPath: Checking & Warning about version conflicts');
86
- const binaryVersion = spawnOutput[1];
87
- if (semver.neq(options.version, binaryVersion)) {
88
- // we will log the version number of the system binary and the version requested so the user can see the difference
89
- console.warn('getPath: MongoMemoryServer: Possible version conflict\n' +
90
- ` SystemBinary version: "${binaryVersion}"\n` +
91
- ` Requested version: "${options.version}"\n\n` +
92
- ' Using SystemBinary!');
93
- }
64
+ static async getPath(opts = {}) {
65
+ log('getPath');
66
+ // "||" is still used here, because it should default if the value is false-y (like an empty string)
67
+ const options = {
68
+ ...(await DryMongoBinary_1.DryMongoBinary.generateOptions(opts)),
69
+ platform: opts.platform || (0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.PLATFORM) || os_1.default.platform(),
70
+ checkMD5: opts.checkMD5 || (0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.MD5_CHECK)),
71
+ };
72
+ log(`getPath: MongoBinary options:`, JSON.stringify(options, null, 2));
73
+ let binaryPath = await DryMongoBinary_1.DryMongoBinary.locateBinary(options);
74
+ // check if the system binary has the same version as requested
75
+ if (!!options.systemBinary) {
76
+ // this case should actually never be false, because if "SYSTEM_BINARY" is set, "locateBinary" will run "getSystemPath" which tests the path for permissions
77
+ if (!(0, utils_1.isNullOrUndefined)(binaryPath)) {
78
+ log(`getPath: Spawning binaryPath "${binaryPath}" to get version`);
79
+ const spawnOutput = (0, child_process_1.spawnSync)(binaryPath, ['--version'])
80
+ .stdout.toString()
81
+ // this regex is to match the first line of the "mongod --version" output "db version v4.0.25" OR "db version v4.2.19-11-ge2f2736"
82
+ .match(/^\s*db\s+version\s+v?(\d+\.\d+\.\d+)(-\d*)?(-[a-zA-Z0-9].*)?\s*$/im);
83
+ (0, utils_1.assertion)(!(0, utils_1.isNullOrUndefined)(spawnOutput), new Error('Couldnt find an version from system binary output!'));
84
+ // dont warn if the versions dont match if "SYSTEM_BINARY_VERSION_CHECK" is false, but still test the binary if it is available to be executed
85
+ if ((0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.SYSTEM_BINARY_VERSION_CHECK))) {
86
+ log('getPath: Checking & Warning about version conflicts');
87
+ const binaryVersion = spawnOutput[1];
88
+ if (semver.neq(options.version, binaryVersion)) {
89
+ // we will log the version number of the system binary and the version requested so the user can see the difference
90
+ console.warn('getPath: MongoMemoryServer: Possible version conflict\n' +
91
+ ` SystemBinary version: "${binaryVersion}"\n` +
92
+ ` Requested version: "${options.version}"\n\n` +
93
+ ' Using SystemBinary!');
94
94
  }
95
95
  }
96
- else {
97
- throw new Error('Option "SYSTEM_BINARY" was set, but binaryPath was empty! (system binary could not be found?) [This Error should normally not be thrown, please report this]');
98
- }
99
96
  }
100
- (0, utils_1.assertion)(typeof options.version === 'string', new Error('"MongoBinary.options.version" is not an string!'));
101
- if (!binaryPath) {
102
- if ((0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.RUNTIME_DOWNLOAD))) {
103
- log('getPath: "RUNTIME_DOWNLOAD" is "true", trying to download');
104
- binaryPath = yield this.download(options);
105
- }
106
- else {
107
- log('getPath: "RUNTIME_DOWNLOAD" is "false", not downloading');
108
- }
97
+ else {
98
+ throw new Error('Option "SYSTEM_BINARY" was set, but binaryPath was empty! (system binary could not be found?) [This Error should normally not be thrown, please report this]');
99
+ }
100
+ }
101
+ (0, utils_1.assertion)(typeof options.version === 'string', new Error('"MongoBinary.options.version" is not an string!'));
102
+ if (!binaryPath) {
103
+ if ((0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.RUNTIME_DOWNLOAD))) {
104
+ log('getPath: "RUNTIME_DOWNLOAD" is "true", trying to download');
105
+ binaryPath = await this.download(options);
109
106
  }
110
- if (!binaryPath) {
111
- const runtimeDownload = (0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.RUNTIME_DOWNLOAD));
112
- throw new Error(`MongoBinary.getPath: could not find an valid binary path! (Got: "${binaryPath}", RUNTIME_DOWNLOAD: "${runtimeDownload}")`);
107
+ else {
108
+ log('getPath: "RUNTIME_DOWNLOAD" is "false", not downloading');
113
109
  }
114
- log(`getPath: Mongod binary path: "${binaryPath}"`);
115
- return binaryPath;
116
- });
110
+ }
111
+ if (!binaryPath) {
112
+ const runtimeDownload = (0, resolveConfig_1.envToBool)((0, resolveConfig_1.default)(resolveConfig_1.ResolveConfigVariables.RUNTIME_DOWNLOAD));
113
+ throw new Error(`MongoBinary.getPath: could not find an valid binary path! (Got: "${binaryPath}", RUNTIME_DOWNLOAD: "${runtimeDownload}")`);
114
+ }
115
+ log(`getPath: Mongod binary path: "${binaryPath}"`);
116
+ return binaryPath;
117
117
  }
118
118
  }
119
119
  exports.MongoBinary = MongoBinary;
@@ -1 +1 @@
1
- {"version":3,"file":"MongoBinary.js","sourceRoot":"","sources":["../../src/util/MongoBinary.ts"],"names":[],"mappings":";;;;AAAA,yDAAoB;AACpB,6DAAwB;AACxB,6FAAwD;AACxD,8EAAmF;AACnF,+DAA0B;AAC1B,4DAAiC;AACjC,mCAA8D;AAC9D,iDAA0C;AAC1C,yCAAsC;A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yDAAyD,CAAC,CAAC;aAChE;SACF;QAED,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,eAAe,GAAG,IAAA,yBAAS,EAAC,IAAA,uBAAa,EAAC,sCAAsB,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAC1F,MAAM,IAAI,KAAK,CACb,oEAAoE,UAAU,yBAAyB,eAAe,IAAI,CAC3H,CAAC;SACH;QAED,GAAG,CAAC,iCAAiC,UAAU,GAAG,CAAC,CAAC;QAEpD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAhID,kCAgIC;AAED,kBAAe,WAAW,CAAC"}
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { URL } from 'url';
3
4
  import { MongoBinaryOpts } from './MongoBinary';
4
5
  import { RequestOptions } from 'https';
@@ -13,19 +14,9 @@ export interface MongoBinaryDownloadProgress {
13
14
  */
14
15
  export declare class MongoBinaryDownload {
15
16
  dlProgress: MongoBinaryDownloadProgress;
16
- _downloadingUrl?: string;
17
+ protected _downloadingUrl?: string;
17
18
  /** These options are kind of raw, they are not run through DryMongoBinary.generateOptions */
18
19
  binaryOpts: Required<MongoBinaryOpts>;
19
- get checkMD5(): boolean;
20
- set checkMD5(val: boolean);
21
- get downloadDir(): string;
22
- set downloadDir(val: string);
23
- get arch(): string;
24
- set arch(val: string);
25
- get version(): string;
26
- set version(val: string);
27
- get platform(): string;
28
- set platform(val: string);
29
20
  constructor(opts: MongoBinaryOpts);
30
21
  /**
31
22
  * Get the full path with filename
@@ -1 +1 @@
1
- {"version":3,"file":"MongoBinaryDownload.d.ts","sourceRoot":"","sources":["../../src/util/MongoBinaryDownload.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAc1B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,2BAA2B;IAC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