Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongodb-memory-server-core

Package Overview
Dependencies
Maintainers
1
Versions
274
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-memory-server-core - npm Package Compare versions

Comparing version 6.0.2 to 6.1.0

lib/util/getos/index.d.ts

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [6.1.0](https://github.com/nodkz/mongodb-memory-server/compare/v6.0.2...v6.1.0) (2019-12-20)
### Features
* add support for Linux Mint (tnx [@hasezoey](https://github.com/hasezoey)) ([92a9381](https://github.com/nodkz/mongodb-memory-server/commit/92a9381))
## [6.0.2](https://github.com/nodkz/mongodb-memory-server/compare/v6.0.1...v6.0.2) (2019-12-03)

@@ -8,0 +19,0 @@

25

lib/util/MongoBinaryDownloadUrl.d.ts

@@ -1,2 +0,2 @@

import getos from 'getos';
import { AnyOS, LinuxOS } from './getos';
export interface MongoBinaryDownloadUrlOpts {

@@ -6,3 +6,3 @@ version: string;

arch: string;
os?: getos.Os;
os?: AnyOS;
}

@@ -13,3 +13,3 @@ export default class MongoBinaryDownloadUrl {

version: string;
os: getos.Os | undefined;
os: AnyOS | undefined;
constructor({ platform, arch, version, os }: MongoBinaryDownloadUrlOpts);

@@ -21,12 +21,11 @@ getDownloadUrl(): Promise<string>;

getArchiveNameLinux(): Promise<string>;
getos(): Promise<getos.Os>;
getLinuxOSVersionString(os: getos.LinuxOs): string;
getDebianVersionString(os: getos.Os): string;
getFedoraVersionString(os: getos.Os): string;
getRhelVersionString(os: getos.Os): string;
getElementaryOSVersionString(os: getos.Os): string;
getMintVersionString(os: getos.Os): string;
getLegacyVersionString(os: getos.Os): string;
getSuseVersionString(os: getos.Os): string;
getUbuntuVersionString(os: getos.LinuxOs): string;
getLinuxOSVersionString(os: LinuxOS): string;
getDebianVersionString(os: LinuxOS): string;
getFedoraVersionString(os: LinuxOS): string;
getRhelVersionString(os: LinuxOS): string;
getElementaryOSVersionString(os: LinuxOS): string;
getMintVersionString(os: LinuxOS): string;
getLegacyVersionString(os: AnyOS): string;
getSuseVersionString(os: LinuxOS): string;
getUbuntuVersionString(os: LinuxOS): string;
translatePlatform(platform: string): string;

@@ -33,0 +32,0 @@ translateArch(arch: string, mongoPlatform: string): string;

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

Object.defineProperty(exports, "__esModule", { value: true });
var getos_1 = __importDefault(require("getos"));
var getos_1 = __importDefault(require("./getos"));
var child_process_1 = require("child_process");

@@ -136,5 +136,6 @@ var resolve_config_1 = __importDefault(require("./resolve-config"));

_a = this;
return [4 /*yield*/, this.getos()];
return [4 /*yield*/, getos_1.default()];
case 1:
_a.os = _b.sent();
console.log('got back:', this.os);
_b.label = 2;

@@ -154,15 +155,2 @@ case 2:

};
MongoBinaryDownloadUrl.prototype.getos = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
getos_1.default(function (e, os) {
if (e)
reject(e);
resolve(os);
});
})];
});
});
};
MongoBinaryDownloadUrl.prototype.getLinuxOSVersionString = function (os) {

@@ -190,2 +178,7 @@ if (/ubuntu/i.test(os.dist)) {

}
else if (/unkown/i.test(os.dist)) {
// in some cases this is redundant, but this is here to notify users to report if their Distro couldnt be parsed
console.warn('Couldnt parse dist infomation, please report this to https://github.com/nodkz/mongodb-memory-server/issues');
}
// this is when the os.dist couldnt be handled by MongoBinaryDownloadUrl
console.warn("Unknown linux distro " + os.dist + ", falling back to legacy MongoDB build");

@@ -249,6 +242,22 @@ return this.getLegacyVersionString(os);

};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
MongoBinaryDownloadUrl.prototype.getMintVersionString = function (os) {
// unfortunately getos doesn't return version for Mint
return 'ubuntu1404';
var name = 'ubuntu';
var mintMajorVer = parseInt(os.release ? os.release.split('.')[0] : os.release);
if (mintMajorVer < 17) {
throw new Error('Mint Versions under 17 are not supported!');
}
switch (mintMajorVer) {
case 17:
name += '1404';
break;
case 18:
name += '1604';
break;
case 19:
default:
// a default to support versions > 19
name += '1804';
break;
}
return name;
};

@@ -255,0 +264,0 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars

{
"name": "mongodb-memory-server-core",
"version": "6.0.2",
"version": "6.1.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.",

@@ -37,3 +37,2 @@ "main": "lib/index",

"@types/get-port": "^4.0.1",
"@types/getos": "^3.0.0",
"@types/lockfile": "^1.0.1",

@@ -43,3 +42,3 @@ "@types/md5-file": "^4.0.0",

"@types/tmp": "0.1.0",
"@types/uuid": "^3.4.5",
"@types/uuid": "3.4.6",
"rimraf": "^3.0.0"

@@ -53,7 +52,6 @@ },

"dedent": "^0.7.0",
"find-cache-dir": "^3.0.0",
"find-cache-dir": "3.2.0",
"find-package-json": "^1.2.0",
"get-port": "^5.0.0",
"getos": "^3.1.1",
"https-proxy-agent": "^3.0.0",
"get-port": "5.0.0",
"https-proxy-agent": "4.0.0",
"lockfile": "^1.0.4",

@@ -69,2 +67,3 @@ "md5-file": "^4.0.0",

"scripts": {
"cleanup": "rimraf tmp lib coverage node_modules/.cache",
"build": "npm-run-all build:*",

@@ -79,3 +78,3 @@ "build:ts": "rimraf ./lib && tsc -p ./tsconfig.json",

},
"gitHead": "a7ea18591910151abd3eb87607f7f3dfa04f1429"
"gitHead": "8853d9c1b6e3af699071589c7a75d8c30c5d0800"
}

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc