Socket
Socket
Sign inDemoInstall

mongodb-memory-server-core

Package Overview
Dependencies
181
Maintainers
2
Versions
261
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.12.2 to 8.13.0

8

lib/util/errors.d.ts

@@ -109,4 +109,12 @@ export declare class StateError extends Error {

}
/**
* Error for when downloading fails
*/
export declare class DownloadError extends Error {
url: string;
msg: string;
constructor(url: string, msg: string);
}
export declare class GenericMMSError extends Error {
}
//# sourceMappingURL=errors.d.ts.map

13

lib/util/errors.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenericMMSError = exports.UnknownVersionError = exports.UnexpectedCloseError = exports.StdoutInstanceError = exports.KnownVersionIncompatibilityError = exports.NoRegexMatchError = exports.ParseArchiveRegexError = exports.ReplsetCountLowError = exports.AssertionFallbackError = exports.BinaryNotFoundError = exports.InsufficientPermissionsError = exports.AuthNotObjectError = exports.KeyFileMissingError = exports.InstanceInfoError = exports.StartBinaryFailedError = exports.Md5CheckFailedError = exports.NoSystemBinaryFoundError = exports.EnsureInstanceError = exports.WaitForPrimaryTimeoutError = exports.UnknownArchitectureError = exports.UnknownPlatformError = exports.UnableToUnlockLockfileError = exports.UnknownLockfileStatusError = exports.StateError = void 0;
exports.GenericMMSError = exports.DownloadError = exports.UnknownVersionError = exports.UnexpectedCloseError = exports.StdoutInstanceError = exports.KnownVersionIncompatibilityError = exports.NoRegexMatchError = exports.ParseArchiveRegexError = exports.ReplsetCountLowError = exports.AssertionFallbackError = exports.BinaryNotFoundError = exports.InsufficientPermissionsError = exports.AuthNotObjectError = exports.KeyFileMissingError = exports.InstanceInfoError = exports.StartBinaryFailedError = exports.Md5CheckFailedError = exports.NoSystemBinaryFoundError = exports.EnsureInstanceError = exports.WaitForPrimaryTimeoutError = exports.UnknownArchitectureError = exports.UnknownPlatformError = exports.UnableToUnlockLockfileError = exports.UnknownLockfileStatusError = exports.StateError = void 0;
const utils_1 = require("./utils");

@@ -213,2 +213,13 @@ class StateError extends Error {

exports.UnknownVersionError = UnknownVersionError;
/**
* Error for when downloading fails
*/
class DownloadError extends Error {
constructor(url, msg) {
super(`Download failed for url \"${url}\", Details:\n${msg}`);
this.url = url;
this.msg = msg;
}
}
exports.DownloadError = DownloadError;
/* Custom Generic Error class for MMS */

@@ -215,0 +226,0 @@ class GenericMMSError extends Error {

11

lib/util/MongoBinaryDownload.js

@@ -320,5 +320,4 @@ "use strict";

if (response.statusCode === 403) {
reject(new Error("Status Code is 403 (MongoDB's 404)\n" +
reject(new errors_1.DownloadError(downloadUrl, "Status Code is 403 (MongoDB's 404)\n" +
"This means that the requested version-platform combination doesn't exist\n" +
` Used Url: "${downloadUrl}"\n` +
"Try to use different version 'new MongoMemoryServer({ binary: { version: 'X.Y.Z' } })'\n" +

@@ -329,7 +328,7 @@ 'List of available versions can be found here: ' +

}
reject(new Error(`Status Code isnt 200! (it is ${response.statusCode})`));
reject(new errors_1.DownloadError(downloadUrl, `Status Code isnt 200! (it is ${response.statusCode})`));
return;
}
if (typeof response.headers['content-length'] != 'string') {
reject(new Error('Response header "content-length" is empty!'));
reject(new errors_1.DownloadError(downloadUrl, 'Response header "content-length" is empty!'));
return;

@@ -346,3 +345,3 @@ }

!((_a = httpOptions.path) === null || _a === void 0 ? void 0 : _a.endsWith('.md5'))) {
reject(new Error(`Too small (${this.dlProgress.current} bytes) mongod binary downloaded from ${downloadUrl}`));
reject(new errors_1.DownloadError(downloadUrl, `Too small (${this.dlProgress.current} bytes) mongod binary downloaded.`));
return;

@@ -363,3 +362,3 @@ }

console.error(`Couldnt download "${downloadUrl}"!`, err.message);
reject(err);
reject(new errors_1.DownloadError(downloadUrl, err.message));
});

@@ -366,0 +365,0 @@ });

@@ -23,3 +23,3 @@ /** Enum of all possible config options */

/** This Value exists here, because "defaultValues" can be changed with "setDefaultValue", but this property is constant */
export declare const DEFAULT_VERSION = "5.0.13";
export declare const DEFAULT_VERSION = "5.0.18";
/** Default values for some config options that require explicit setting, it is constant so that the default values cannot be interfered with */

@@ -26,0 +26,0 @@ export declare const defaultValues: Map<ResolveConfigVariables, string>;

@@ -35,3 +35,3 @@ "use strict";

/** This Value exists here, because "defaultValues" can be changed with "setDefaultValue", but this property is constant */
exports.DEFAULT_VERSION = '5.0.13';
exports.DEFAULT_VERSION = '5.0.18';
/** Default values for some config options that require explicit setting, it is constant so that the default values cannot be interfered with */

@@ -38,0 +38,0 @@ exports.defaultValues = new Map([

{
"name": "mongodb-memory-server-core",
"version": "8.12.2",
"version": "8.13.0",
"description": "MongoDB Server for testing (core package, without autodownload). The server will allow you to connect your favourite ODM or client library to the MongoDB Server and run parallel integration tests isolated from each other.",

@@ -34,7 +34,7 @@ "main": "lib/index",

"devDependencies": {
"@types/debug": "^4.1.7",
"@types/debug": "^4.1.8",
"@types/find-cache-dir": "^3.2.1",
"@types/semver": "^7.3.13",
"@types/semver": "^7.5.0",
"@types/tar-stream": "^2.2.2",
"@types/uuid": "^9.0.1",
"@types/uuid": "^9.0.2",
"@types/yauzl": "^2.10.0",

@@ -53,7 +53,7 @@ "@types/yazl": "^2.4.2",

"md5-file": "^5.0.0",
"mongodb": "^4.13.0",
"mongodb": "^4.16.0",
"new-find-package-json": "^2.0.0",
"semver": "^7.3.8",
"semver": "^7.5.1",
"tar-stream": "^2.1.4",
"tslib": "^2.5.0",
"tslib": "^2.5.3",
"uuid": "^9.0.0",

@@ -60,0 +60,0 @@ "yauzl": "^2.10.0"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc