Socket
Socket
Sign inDemoInstall

@pact-foundation/pact-node

Package Overview
Dependencies
Maintainers
7
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pact-foundation/pact-node - npm Package Compare versions

Comparing version 10.17.7 to 10.18.0

build/binding.Makefile

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

## [10.18.0](https://github.com/pact-foundation/pact-node/compare/v10.17.7...v10.18.0) (2024-02-28)
### Features
* v2 pact-standalone with arm64 linux/macos support (pact-node branch) ([#491](https://github.com/pact-foundation/pact-node/issues/491)) ([74a14d5](https://github.com/pact-foundation/pact-node/commit/74a14d56793d7d6d37916a9710b8da3b180b5aa9))
### [10.17.7](https://github.com/pact-foundation/pact-node/compare/v10.17.6...v10.17.7) (2022-12-22)

@@ -7,0 +14,0 @@

112

package.json
{
"version": "10.17.7",
"version": "10.18.0",
"name": "@pact-foundation/pact-node",

@@ -54,74 +54,74 @@ "description": "Core of @pact-foundation/pact. You almost certainly don't want to depend on this directly.",

"dependencies": {
"@types/needle": "^2.5.1",
"@types/pino": "^6.3.5",
"@types/q": "1.0.7",
"@types/request": "2.48.2",
"chalk": "2.3.1",
"check-types": "7.3.0",
"cross-spawn": "^7.0.1",
"@types/needle": "^2.5.3",
"@types/q": "1.5.5",
"@types/request": "2.48.8",
"chalk": "2.4.2",
"check-types": "7.4.0",
"cross-spawn": "^7.0.3",
"libnpmconfig": "^1.2.1",
"mkdirp": "1.0.0",
"needle": "^2.6.0",
"pino": "^6.11.0",
"pino-pretty": "^4.1.0",
"mkdirp": "1.0.4",
"needle": "^2.9.1",
"pino": "^8.11.0",
"pino-pretty": "^9.4.0",
"q": "1.5.1",
"rimraf": "2.6.2",
"rimraf": "2.7.1",
"sumchecker": "^2.0.2",
"tar": "^6.1.11",
"underscore": "1.12.1",
"tar": "^6.1.13",
"underscore": "1.13.6",
"unixify": "1.0.0",
"unzipper": "^0.10.10",
"url-join": "^4.0.0"
"unzipper": "^0.10.11",
"url-join": "^4.0.1"
},
"devDependencies": {
"@pact-foundation/pact-js-prettier-config": "^1.0.0",
"@types/basic-auth": "^1.1.2",
"@types/chai": "4.1.2",
"@types/chai-as-promised": "7.1.0",
"@types/check-types": "^7.3.1",
"@types/cors": "^2.8.6",
"@types/cross-spawn": "^6.0.1",
"@types/decompress": "^4.2.3",
"@types/express": "4.11.1",
"@types/jest": "^27.0.2",
"@types/basic-auth": "^1.1.3",
"@types/chai": "4.3.4",
"@types/chai-as-promised": "7.1.5",
"@types/check-types": "^7.3.4",
"@types/cors": "^2.8.13",
"@types/cross-spawn": "^6.0.2",
"@types/decompress": "^4.2.4",
"@types/express": "4.17.17",
"@types/jest": "^27.5.2",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "2.2.48",
"@types/node": "9.4.6",
"@types/rimraf": "^2.0.2",
"@types/tar": "^4.0.3",
"@types/underscore": "1.8.7",
"@types/unzipper": "^0.10.2",
"@types/url-join": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"basic-auth": "2.0.0",
"body-parser": "1.18.2",
"chai": "4.1.2",
"@types/node": "9.6.61",
"@types/rimraf": "^2.0.5",
"@types/tar": "^4.0.5",
"@types/underscore": "1.11.4",
"@types/unzipper": "^0.10.5",
"@types/url-join": "^4.0.1",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"basic-auth": "2.0.1",
"body-parser": "1.20.2",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"cors": "2.8.4",
"cross-env": "^5.1.3",
"cors": "2.8.5",
"cross-env": "^5.2.1",
"decamelize": "2.0.0",
"eslint": "^8.1.0",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-prettier": "^3.1.1",
"express": "4.16.2",
"jest": "^27.3.1",
"mocha": "^9.1.3",
"nodemon": "^2.0.4",
"prettier": "^1.18.2",
"eslint": "^8.38.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.4.1",
"express": "4.18.2",
"jest": "^27.5.1",
"mocha": "^9.2.2",
"nodemon": "^2.0.22",
"prettier": "^1.19.1",
"sinon": "9.2.4",
"snyk": "^1.747.0",
"standard-version": "^9.3.1",
"ts-jest": "^27.0.7",
"ts-node": "10.4.0",
"typescript": "4.4.4"
"snyk": "^1.1142.0",
"standard-version": "^9.5.0",
"ts-jest": "^27.1.5",
"ts-node": "10.9.1",
"typescript": "4.9.5"
},
"scripts": {
"postinstall": "node postinstall.js",
"install:all": "npm run install:osx && npm run install:win && npm run install:linux32 && npm run install:linux64 && npm run install:current",
"install:all": "npm run install:osx:arm64 && npm run install:osx:x64 && npm run install:win && npm run install:linux:x64 && npm run install:linux:arm64 && npm run install:current",
"install:current": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js",
"install:osx": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js darwin",
"install:osx:arm64": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js darwin arm64",
"install:osx:x64": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js darwin x64",
"install:win": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js win32",
"install:linux32": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js linux ia32",
"install:linux64": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js linux x64",
"install:linux:x64": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js linux x64",
"install:linux:arm64": "cross-env PACT_DO_NOT_TRACK=true node postinstall.js linux arm64",
"clean": "rimraf '{src,test,bin,standalone}/**/*.{js,map,d.ts}' 'package.zip' '.tmp' 'tmp', 'standalone/{darwin,linux,win}*'",

@@ -128,0 +128,0 @@ "lint": "eslint . --ext .ts --config .eslintrc",

@@ -99,4 +99,8 @@ "use strict";

var _this = this;
logger_1.default.info("Asking broker at " + this.options.pactBroker + " if it is possible to deploy");
logger_1.default.info("Asking broker at ".concat(this.options.pactBroker, " if it is possible to deploy"));
var deferred = q.defer();
if (this.options.output === 'json') {
logger_1.default.warn('both json and verbose options were set, unsetting verbose');
this.options.verbose = false;
}
var instance = spawn_1.default.spawnBinary(pact_standalone_1.default.brokerFullPath, __spreadArray([

@@ -116,7 +120,7 @@ { cliVerb: 'can-i-deploy' }

if (startIndex === -1) {
logger_1.default.error("can-i-deploy produced no json output:\n" + result);
logger_1.default.error("can-i-deploy produced no json output:\n".concat(result));
return deferred.reject(new Error(result));
}
if (startIndex !== 0) {
logger_1.default.warn("can-i-deploy produced additional output: \n" + output.slice(0, startIndex));
logger_1.default.warn("can-i-deploy produced additional output: \n".concat(output.slice(0, startIndex)));
}

@@ -131,3 +135,3 @@ var jsonPart = output.slice(startIndex).join('\n');

catch (e) {
logger_1.default.error("can-i-deploy produced non-json output:\n" + result);
logger_1.default.error("can-i-deploy produced non-json output:\n".concat(result));
return deferred.reject(new Error(result));

@@ -140,6 +144,6 @@ }

}
logger_1.default.error("can-i-deploy did not return success message:\n" + result);
logger_1.default.error("can-i-deploy did not return success message:\n".concat(result));
return deferred.reject(new CannotDeployError(result));
});
return deferred.promise.timeout(this.options.timeout, "Timeout waiting for verification process to complete (PID: " + instance.pid + ")");
return deferred.promise.timeout(this.options.timeout, "Timeout waiting for verification process to complete (PID: ".concat(instance.pid, ")"));
};

@@ -146,0 +150,0 @@ return CanDeploy;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -1,7 +0,7 @@

import pino = require('pino');
export declare type Logger = pino.Logger;
export declare type LogLevels = pino.Level;
import { pino } from 'pino';
export type Logger = pino.Logger;
export type LogLevels = pino.Level;
declare const logger: pino.Logger;
export declare const setLogLevel: (wantedLevel?: number | pino.Level | undefined) => number | void;
export declare const setLogLevel: (wantedLevel?: pino.Level | number) => number | void;
export declare const verboseIsImplied: () => boolean;
export default logger;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.verboseIsImplied = exports.setLogLevel = void 0;
var pino = require("pino");
var pino_1 = require("pino");
var pkg = require('../package.json');

@@ -9,7 +9,10 @@ var DEFAULT_LEVEL = (process.env.LOGLEVEL || 'info');

if (level === void 0) { level = DEFAULT_LEVEL; }
return pino({
return (0, pino_1.pino)({
level: level.toLowerCase(),
prettyPrint: {
messageFormat: "pact-node@" + pkg.version + ": {msg}",
translateTime: true,
transport: {
target: 'pino-pretty',
options: {
messageFormat: "pact-node@".concat(pkg.version, ": {msg}"),
translateTime: true,
},
},

@@ -16,0 +19,0 @@ });

@@ -16,4 +16,4 @@ export interface PactStandalone {

}
export declare const standalone: (platform?: string | undefined, arch?: string | undefined) => PactStandalone;
export declare const standalone: (platform?: string, arch?: string) => PactStandalone;
declare const _default: PactStandalone;
export default _default;

@@ -8,6 +8,6 @@ "use strict";

var standalone = function (platform, arch) {
platform = platform || process.platform;
arch = arch || process.arch;
if (platform === void 0) { platform = process.platform; }
if (arch === void 0) { arch = process.arch; }
var binName = function (name) {
return "" + name + (pact_environment_1.default.isWindows(platform) ? '.bat' : '');
return "".concat(name).concat(pact_environment_1.default.isWindows(platform) ? '.bat' : '');
};

@@ -14,0 +14,0 @@ var mock = binName('pact-mock-service');

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

_.some(this.__servers, function (s) { return s.options.port === options.port; })) {
var msg = "Port '" + options.port + "' is already in use by another process.";
var msg = "Port '".concat(options.port, "' is already in use by another process.");
logger_1.default.error(msg);

@@ -53,5 +53,5 @@ throw new Error(msg);

this.__servers.push(server);
logger_1.default.info("Creating Pact Server with options: \n" + JSON.stringify(server.options));
logger_1.default.info("Creating Pact Server with options: \n".concat(JSON.stringify(server.options)));
server.once(service_1.AbstractService.Events.DELETE_EVENT, function (s) {
logger_1.default.info("Deleting Pact Server with options: \n" + JSON.stringify(s.options));
logger_1.default.info("Deleting Pact Server with options: \n".concat(JSON.stringify(s.options)));
_this.__servers = _.without(_this.__servers, s);

@@ -77,3 +77,3 @@ });

_.some(this.__stubs, function (s) { return s.options.port === options.port; })) {
var msg = "Port '" + options.port + "' is already in use by another process.";
var msg = "Port '".concat(options.port, "' is already in use by another process.");
logger_1.default.error(msg);

@@ -84,5 +84,5 @@ throw new Error(msg);

this.__stubs.push(stub);
logger_1.default.info("Creating Pact Stub with options: \n" + JSON.stringify(stub.options));
logger_1.default.info("Creating Pact Stub with options: \n".concat(JSON.stringify(stub.options)));
stub.once(service_1.AbstractService.Events.DELETE_EVENT, function (s) {
logger_1.default.info("Deleting Pact Stub with options: \n" + JSON.stringify(stub.options));
logger_1.default.info("Deleting Pact Stub with options: \n".concat(JSON.stringify(stub.options)));
_this.__stubs = _.without(_this.__stubs, s);

@@ -89,0 +89,0 @@ });

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

if (!fs.existsSync(newPath)) {
throw new Error("Path '" + v + "' given in pactFilesOrDirs does not exists.");
throw new Error("Path '".concat(v, "' given in pactFilesOrDirs does not exists."));
}

@@ -68,3 +68,3 @@ return newPath;

Publisher.prototype.publish = function () {
logger_1.default.info("Publishing pacts to broker at: " + this.options.pactBroker);
logger_1.default.info("Publishing pacts to broker at: ".concat(this.options.pactBroker));
var deferred = q.defer();

@@ -79,3 +79,3 @@ var instance = spawn_1.default.spawnBinary(pact_standalone_1.default.brokerFullPath, [{ cliVerb: 'publish' }, this.options], this.__argMapping);

if (code !== 0) {
var message = "Pact publication failed with non-zero exit code. Full output was:\n" + o;
var message = "Pact publication failed with non-zero exit code. Full output was:\n".concat(o);
logger_1.default.error(message);

@@ -85,3 +85,3 @@ return deferred.reject(new Error(message));

if (!pactUrls) {
var message = "Publication appeared to fail, as we did not detect any pact URLs in the following output:\n" + o;
var message = "Publication appeared to fail, as we did not detect any pact URLs in the following output:\n".concat(o);
logger_1.default.error(message);

@@ -93,3 +93,3 @@ return deferred.reject(new Error(message));

});
return deferred.promise.timeout(this.options.timeout, "Timeout waiting for verification process to complete (PID: " + instance.pid + ")");
return deferred.promise.timeout(this.options.timeout, "Timeout waiting for verification process to complete (PID: ".concat(instance.pid, ")"));
};

@@ -96,0 +96,0 @@ Publisher.create = (0, util_1.deprecate)(function (options) { return new Publisher(options); }, 'Create function will be removed in future release, please use the default export function or use `new Publisher()`');

import { AbstractService, LogLevel } from './service';
export declare class Server extends AbstractService {
static create: (options?: ServerOptions | undefined) => Server;
static create: (options?: ServerOptions) => Server;
readonly options: ServerOptions;
constructor(options?: ServerOptions);
}
declare const _default: (options?: ServerOptions | undefined) => Server;
declare const _default: (options?: ServerOptions) => Server;
export default _default;

@@ -9,0 +9,0 @@ export interface ServerOptions {

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

catch (e) {
throw new Error("Monkeypatch ruby file not found at path: " + options.monkeypatch);
throw new Error("Monkeypatch ruby file not found at path: ".concat(options.monkeypatch));
}

@@ -74,0 +74,0 @@ }

@@ -40,3 +40,3 @@ /// <reference types="node" />

}
export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error';
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
export interface HTTPConfig extends Omit<needle.NeedleOptions, 'headers'> {

@@ -43,0 +43,0 @@ headers: {

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

catch (e) {
throw new Error("Custom ssl certificate not found at path: " + options.sslcert);
throw new Error("Custom ssl certificate not found at path: ".concat(options.sslcert));
}

@@ -81,3 +81,3 @@ }

catch (e) {
throw new Error("Custom ssl key not found at path: " + options.sslkey);
throw new Error("Custom ssl key not found at path: ".concat(options.sslkey));
}

@@ -122,3 +122,3 @@ }

if (this.__instance && this.__instance.connected) {
logger_1.default.warn("You already have a process running with PID: " + this.__instance.pid);
logger_1.default.warn("You already have a process running with PID: ".concat(this.__instance.pid));
return q.resolve(this);

@@ -136,3 +136,3 @@ }

}
logger_1.default.info("Pact running on port " + _this.options.port);
logger_1.default.info("Pact running on port ".concat(_this.options.port));
}

@@ -143,6 +143,6 @@ };

this.__instance.stderr.on('data', function (data) {
return logger_1.default.error("Pact Binary Error: " + data);
return logger_1.default.error("Pact Binary Error: ".concat(data));
});
return this.__waitForServiceUp()
.timeout(getTimeout(this.options), "Couldn't start Pact with PID: " + this.__instance.pid)
.timeout(getTimeout(this.options), "Couldn't start Pact with PID: ".concat(this.__instance.pid))
.then(function () {

@@ -159,3 +159,3 @@ _this.__running = true;

.then(function () { return _this.__waitForServiceDown(); })
.timeout(getTimeout(this.options), "Couldn't stop Pact with PID '" + pid + "'")
.timeout(getTimeout(this.options), "Couldn't stop Pact with PID '".concat(pid, "'"))
.then(function () {

@@ -235,6 +235,6 @@ _this.__running = false;

}
needle('get', "http" + (options.ssl ? 's' : '') + "://" + options.host + ":" + options.port, config)
needle('get', "http".concat(options.ssl ? 's' : '', "://").concat(options.host, ":").concat(options.port), config)
.then(function (res) {
if (res.statusCode !== 200) {
throw new Error("HTTP Error: '" + JSON.stringify(res) + "'");
throw new Error("HTTP Error: '".concat(JSON.stringify(res), "'"));
}

@@ -241,0 +241,0 @@ })

@@ -6,3 +6,3 @@ import { CanDeployOptions } from '../can-deploy';

import { VerifierOptions } from '../verifier';
export declare type CliVerbOptions = {
export type CliVerbOptions = {
cliVerb: string;

@@ -13,5 +13,5 @@ };

}
declare type Mapping = string | ((val: unknown) => string[]);
export declare type SpawnArgument = CanDeployOptions | MessageOptions | PublisherOptions | ServiceOptions | VerifierOptions | CliVerbOptions | unknown;
export declare type SpawnArguments = Array<SpawnArgument> | SpawnArgument;
type Mapping = string | ((val: unknown) => string[]);
export type SpawnArgument = CanDeployOptions | MessageOptions | PublisherOptions | ServiceOptions | VerifierOptions | CliVerbOptions | unknown;
export type SpawnArguments = Array<SpawnArgument> | SpawnArgument;
export declare const DEFAULT_ARG = "DEFAULT";

@@ -18,0 +18,0 @@ export declare const PACT_NODE_NO_VALUE = "PACT_NODE_NO_VALUE";

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

}
return v !== exports.PACT_NODE_NO_VALUE ? ["" + v] : [];
return v !== exports.PACT_NODE_NO_VALUE ? ["".concat(v)] : [];
};

@@ -15,0 +15,0 @@ var mapFor = function (mapping, v) {

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

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

var spawnArgs = arguments_1.default.toArgumentsArray(args, __assign({ cliVerb: arguments_1.DEFAULT_ARG }, argMapping));
logger_1.default.debug("Starting pact binary '" + command + "', with arguments [" + spawnArgs.join(' ') + "]");
logger_1.default.trace("Environment: " + JSON.stringify(opts));
logger_1.default.debug("Starting pact binary '".concat(command, "', with arguments [").concat(spawnArgs.join(' '), "]"));
logger_1.default.trace("Environment: ".concat(JSON.stringify(opts)));
var instance = spawn(command, spawnArgs, opts);

@@ -53,6 +53,6 @@ instance.stdout.setEncoding('utf8');

if (code !== 0) {
logger_1.default.warn("Pact exited with code " + code + ".");
logger_1.default.warn("Pact exited with code ".concat(code, "."));
}
});
logger_1.default.debug("Created '" + command + "' process with PID: " + instance.pid);
logger_1.default.debug("Created '".concat(command, "' process with PID: ").concat(instance.pid));
return instance;

@@ -63,7 +63,7 @@ };

var pid = binary.pid;
logger_1.default.info("Removing Pact process with PID: " + pid);
logger_1.default.info("Removing Pact process with PID: ".concat(pid));
binary.removeAllListeners();
try {
pact_environment_1.default.isWindows()
? cp.execSync("taskkill /f /t /pid " + pid)
? cp.execSync("taskkill /f /t /pid ".concat(pid))
: process.kill(-pid, 'SIGINT');

@@ -70,0 +70,0 @@ }

import { AbstractService, LogLevel } from './service';
export declare class Stub extends AbstractService {
static create: (options?: StubOptions | undefined) => Stub;
static create: (options?: StubOptions) => Stub;
readonly options: StubOptions;
constructor(options?: StubOptions);
}
declare const _default: (options?: StubOptions | undefined) => Stub;
declare const _default: (options?: StubOptions) => Stub;
export default _default;

@@ -9,0 +9,0 @@ export interface StubOptions {

@@ -61,2 +61,2 @@ import q = require('q');

}
export declare type VerifierOptions = CurrentVerifierOptions & DeprecatedVerifierOptions;
export type VerifierOptions = CurrentVerifierOptions & DeprecatedVerifierOptions;

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

catch (e) {
throw new Error("Pact file: " + uri + " doesn\"t exist");
throw new Error("Pact file: ".concat(uri, " doesn\"t exist"));
}

@@ -174,3 +174,3 @@ }

catch (e) {
throw new Error("Monkeypatch ruby file not found at path: " + options.monkeypatch);
throw new Error("Monkeypatch ruby file not found at path: ".concat(options.monkeypatch));
}

@@ -192,3 +192,3 @@ }

return deferred.promise
.timeout(this.options.timeout, "Timeout waiting for verification process to complete (PID: " + instance.pid + ")")
.timeout(this.options.timeout, "Timeout waiting for verification process to complete (PID: ".concat(instance.pid, ")"))
.tap(function () { return logger_1.default.info('Pact Verification succeeded.'); });

@@ -195,0 +195,0 @@ };

@@ -1,6 +0,6 @@

export declare const PACT_STANDALONE_VERSION = "1.91.0";
export declare const PACT_STANDALONE_VERSION = "2.4.1";
export declare function createConfig(location?: string): Config;
export declare function getBinaryEntry(platform?: string, arch?: string): BinaryEntry;
export declare function downloadChecksums(): Promise<void>;
declare const _default: (platform?: string | undefined, arch?: string | undefined) => Promise<Data>;
declare const _default: (platform?: string, arch?: string) => Promise<Data>;
export default _default;

@@ -7,0 +7,0 @@ export interface PackageConfig {

@@ -31,4 +31,4 @@ "use strict";

}
exports.PACT_STANDALONE_VERSION = '1.91.0';
var PACT_DEFAULT_LOCATION = "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v" + exports.PACT_STANDALONE_VERSION + "/";
exports.PACT_STANDALONE_VERSION = '2.4.1';
var PACT_DEFAULT_LOCATION = "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v".concat(exports.PACT_STANDALONE_VERSION, "/");
var HTTP_REGEX = /^http(s?):\/\//;

@@ -43,3 +43,3 @@ function join() {

function throwError(msg) {
throw new Error(chalk_1.default.red("Error while installing binary: " + msg));
throw new Error(chalk_1.default.red("Error while installing binary: ".concat(msg)));
}

@@ -83,22 +83,39 @@ function getBinaryLocation(location, basePath) {

platform: 'win32',
binary: "pact-" + exports.PACT_STANDALONE_VERSION + "-win32.zip",
binaryChecksum: "pact-" + exports.PACT_STANDALONE_VERSION + "-win32.zip" + CHECKSUM_SUFFIX,
binary: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-windows-x86.zip"),
binaryChecksum: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-windows-x86.zip").concat(CHECKSUM_SUFFIX),
folderName: "windows-x64-".concat(exports.PACT_STANDALONE_VERSION),
downloadLocation: PACT_BINARY_LOCATION,
folderName: "win32-" + exports.PACT_STANDALONE_VERSION,
},
{
platform: 'darwin',
binary: "pact-" + exports.PACT_STANDALONE_VERSION + "-osx.tar.gz",
binaryChecksum: "pact-" + exports.PACT_STANDALONE_VERSION + "-osx.tar.gz" + CHECKSUM_SUFFIX,
arch: 'x64',
binary: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-osx-x86_64.tar.gz"),
binaryChecksum: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-osx-x86_64.tar.gz").concat(CHECKSUM_SUFFIX),
folderName: "darwin-x64-".concat(exports.PACT_STANDALONE_VERSION),
downloadLocation: PACT_BINARY_LOCATION,
folderName: "darwin-" + exports.PACT_STANDALONE_VERSION,
},
{
platform: 'darwin',
arch: 'arm64',
binary: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-osx-arm64.tar.gz"),
binaryChecksum: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-osx-arm64.tar.gz").concat(CHECKSUM_SUFFIX),
folderName: "darwin-arm64-".concat(exports.PACT_STANDALONE_VERSION),
downloadLocation: PACT_BINARY_LOCATION,
},
{
platform: 'linux',
arch: 'x64',
binary: "pact-" + exports.PACT_STANDALONE_VERSION + "-linux-x86_64.tar.gz",
binaryChecksum: "pact-" + exports.PACT_STANDALONE_VERSION + "-linux-x86_64.tar.gz" + CHECKSUM_SUFFIX,
binary: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-linux-x86_64.tar.gz"),
binaryChecksum: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-linux-x86_64.tar.gz").concat(CHECKSUM_SUFFIX),
folderName: "linux-x64-".concat(exports.PACT_STANDALONE_VERSION),
downloadLocation: PACT_BINARY_LOCATION,
folderName: "linux-x64-" + exports.PACT_STANDALONE_VERSION,
},
{
platform: 'linux',
arch: 'arm64',
binary: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-linux-arm64.tar.gz"),
binaryChecksum: "pact-".concat(exports.PACT_STANDALONE_VERSION, "-linux-arm64.tar.gz").concat(CHECKSUM_SUFFIX),
folderName: "linux-arm64-".concat(exports.PACT_STANDALONE_VERSION),
downloadLocation: PACT_BINARY_LOCATION,
},
],

@@ -161,3 +178,3 @@ };

time = now;
console.log(chalk_1.default.gray("Downloaded " + ((100 * downloaded) / len).toFixed(2) + "%..."));
console.log(chalk_1.default.gray("Downloaded ".concat(((100 * downloaded) / len).toFixed(2), "%...")));
}

@@ -172,3 +189,3 @@ })

function download(data) {
console.log(chalk_1.default.gray("Installing Pact Standalone Binary for " + data.platform + "."));
console.log(chalk_1.default.gray("Installing Pact Standalone Binary for ".concat(data.platform, ".")));
return new Promise(function (resolve, reject) {

@@ -180,3 +197,3 @@ if (fs.existsSync(path.resolve(data.filepath))) {

}
console.log(chalk_1.default.yellow("Downloading Pact Standalone Binary v" + exports.PACT_STANDALONE_VERSION + " for platform " + data.platform + " from " + data.binaryDownloadPath));
console.log(chalk_1.default.yellow("Downloading Pact Standalone Binary v".concat(exports.PACT_STANDALONE_VERSION, " for platform ").concat(data.platform, " from ").concat(data.binaryDownloadPath)));
if (!CONFIG.doNotTrack) {

@@ -196,4 +213,4 @@ console.log(chalk_1.default.gray('Please note: we are tracking this download anonymously to gather important usage statistics. ' +

aid: 'pact-node',
aiid: "standalone-" + exports.PACT_STANDALONE_VERSION,
cd: "download-node-" + data.platform + "-" + (isCI ? 'ci' : 'user'),
aiid: "standalone-".concat(exports.PACT_STANDALONE_VERSION),
cd: "download-node-".concat(data.platform, "-").concat(isCI ? 'ci' : 'user'),
aip: true,

@@ -207,6 +224,6 @@ },

downloadFileRetry(data.binaryDownloadPath, data.filepath).then(function () {
console.log(chalk_1.default.green("Finished downloading binary to " + data.filepath));
console.log(chalk_1.default.green("Finished downloading binary to ".concat(data.filepath)));
resolve(data);
}, function (e) {
return reject("Error downloading binary from " + data.binaryDownloadPath + ": " + e);
return reject("Error downloading binary from ".concat(data.binaryDownloadPath, ": ").concat(e));
});

@@ -217,3 +234,3 @@ }

.on('error', function (e) {
return reject("Error reading the file at '" + data.binaryDownloadPath + "': " + e);
return reject("Error reading the file at '".concat(data.binaryDownloadPath, "': ").concat(e));
})

@@ -223,3 +240,3 @@ .pipe(fs

.on('error', function (e) {
return reject("Error writing the file to '" + data.filepath + "': " + e);
return reject("Error writing the file to '".concat(data.filepath, "': ").concat(e));
})

@@ -229,3 +246,3 @@ .on('close', function () { return resolve(data); }));

else {
reject("Could not get binary from '" + data.binaryDownloadPath + "' as it's not a URL and does not exist at the path specified.");
reject("Could not get binary from '".concat(data.binaryDownloadPath, "' as it's not a URL and does not exist at the path specified."));
}

@@ -242,7 +259,7 @@ });

fs.mkdirSync(data.platformFolderPath);
console.log(chalk_1.default.yellow("Extracting binary from " + data.filepath + "."));
console.log(chalk_1.default.yellow("Extracting binary from ".concat(data.filepath, ".")));
var basename = path.basename(data.filepath);
return (sumchecker('sha1', data.checksumFilepath, __dirname, basename)
.then(function () { return console.log(chalk_1.default.green("Checksum passed for '" + basename + "'.")); }, function () {
return throwError("Checksum rejected for file '" + basename + "' with checksum " + path.basename(data.checksumFilepath));
.then(function () { return console.log(chalk_1.default.green("Checksum passed for '".concat(basename, "'."))); }, function () {
return throwError("Checksum rejected for file '".concat(basename, "' with checksum ").concat(path.basename(data.checksumFilepath)));
})

@@ -265,3 +282,3 @@ .then(function () {

.then(function () {
var publishPath = path.resolve(data.platformFolderPath, 'pact', 'bin', "pact-publish" + (pact_environment_1.default.isWindows() ? '.bat' : ''));
var publishPath = path.resolve(data.platformFolderPath, 'pact', 'bin', "pact-publish".concat(pact_environment_1.default.isWindows() ? '.bat' : ''));
if (fs.existsSync(publishPath)) {

@@ -282,3 +299,3 @@ fs.unlinkSync(publishPath);

.catch(function (e) {
return throwError("Extraction failed for " + data.filepath + ": " + e);
return throwError("Extraction failed for ".concat(data.filepath, ": ").concat(e));
}));

@@ -296,3 +313,3 @@ }

}
throw throwError("Cannot find binary for platform '" + platform + "' with architecture '" + arch + "'.");
throw throwError("Cannot find binary for platform '".concat(platform, "' with architecture '").concat(arch, "'."));
}

@@ -318,9 +335,9 @@ exports.getBinaryEntry = getBinaryEntry;

return downloadFileRetry(data.checksumDownloadPath, data.checksumFilepath).then(function () {
console.log(chalk_1.default.green("Finished downloading checksum " + path.basename(data.checksumFilepath)));
console.log(chalk_1.default.green("Finished downloading checksum ".concat(path.basename(data.checksumFilepath))));
return data;
}, function (e) {
return throwError("Error downloading checksum from " + data.checksumDownloadPath + ": " + e);
return throwError("Error downloading checksum from ".concat(data.checksumDownloadPath, ": ").concat(e));
});
});
})).then(function () { return console.log(chalk_1.default.green('All checksums downloaded.')); }, function (e) { return throwError("Checksum Download Failed Unexpectedly: " + e); });
})).then(function () { return console.log(chalk_1.default.green('All checksums downloaded.')); }, function (e) { return throwError("Checksum Download Failed Unexpectedly: ".concat(e)); });
}

@@ -343,5 +360,5 @@ exports.downloadChecksums = downloadChecksums;

.catch(function (e) {
return throwError("Postinstalled Failed Unexpectedly: " + e);
return throwError("Postinstalled Failed Unexpectedly: ".concat(e));
});
});
//# sourceMappingURL=install.js.map

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

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

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

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