Socket
Socket
Sign inDemoInstall

@automattic/vip

Package Overview
Dependencies
Maintainers
20
Versions
194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/vip - npm Package Compare versions

Comparing version 1.4.0-dev8 to 1.4.0-dev9

.circleci/config.yml

26

dist/bin/vip-wp.js

@@ -20,2 +20,4 @@ #!/usr/bin/env node

var _os = require("os");
var _api = _interopRequireWildcard(require("../lib/api"));

@@ -154,3 +156,5 @@

if (isSubShell) {
console.log(`Welcome to the WP CLI shell for the ${(0, _format.formatEnvironment)(envName)} environment of ${_chalk.default.green(appName)} (${opts.env.primaryDomain.name})!`);
console.log(`Welcome to the WP CLI shell for the ${(0, _format.formatEnvironment)(envName)} environment of ${_chalk.default.green(appName)} (${opts.env.primaryDomain.name})!`); // We'll handle our own errors, thank you
(0, _api.disableGlobalGraphQLErrorHandling)();
const promptIdentifier = `${appName}.${(0, _command.getEnvIdentifier)(opts.env)}`;

@@ -203,3 +207,13 @@ let commandRunning = false;

} catch (e) {
console.log(e);
// If this was a GraphQL error, print that to the message to the line
if (e.graphQLErrors) {
e.graphQLErrors.forEach(error => {
console.log(_chalk.default.red('Error:'), error.message);
});
} else {
// Else, other type of error, just dump it
console.log(e);
}
subShellRl.prompt();
return;

@@ -231,3 +245,9 @@ }

process.stdin.unpipe(commandStreams.stdinStream);
commandStreams.stdoutStream.unpipe(process.stdout);
commandStreams.stdoutStream.unpipe(process.stdout); // Need a newline - WP CLI doesn't always send one :(
// https://github.com/wp-cli/wp-cli/blob/779bdd16025cb718260b35fd2b69ae47ca80cb91/php/WP_CLI/Formatter.php#L129-L141
if (line.includes('--format=count') || line.includes('--format="count"') || line.includes('--format=\'count\'') || line.includes('--format=ids') || line.includes('--format="ids"') || line.includes('--format=\'ids\'')) {
process.stdout.write(_os.EOL);
}
subShellRl.resume();

@@ -234,0 +254,0 @@ subShellRl.prompt();

4

dist/bin/vip.js

@@ -111,4 +111,6 @@ #!/usr/bin/env node

throw e;
}
} //de-anonymize user for tracking
await (0, _tracker.aliasUser)(token.id);
await (0, _tracker.trackEvent)('login_command_token_submit_success'); // Exec the command we originally wanted

@@ -115,0 +117,0 @@

@@ -6,2 +6,3 @@ "use strict";

});
exports.disableGlobalGraphQLErrorHandling = disableGlobalGraphQLErrorHandling;
exports.default = API;

@@ -36,3 +37,8 @@ exports.API_URL = exports.API_HOST = exports.PRODUCTION_API_HOST = void 0;

exports.API_URL = API_URL;
let globalGraphQLErrorHandlingEnabled = true;
function disableGlobalGraphQLErrorHandling() {
globalGraphQLErrorHandlingEnabled = false;
}
async function API() {

@@ -55,3 +61,3 @@ const token = await _token.default.get();

if (graphQLErrors && graphQLErrors.length) {
if (graphQLErrors && graphQLErrors.length && globalGraphQLErrorHandlingEnabled) {
graphQLErrors.forEach(error => {

@@ -58,0 +64,0 @@ console.error(_chalk.default.red('Error:'), error.message);

@@ -97,2 +97,7 @@ "use strict";

static async setUuid(_uuid) {
const service = Token.getServiceName('-uuid');
await _keychain.default.setPassword(service, _uuid);
}
static async set(token) {

@@ -99,0 +104,0 @@ const service = Token.getServiceName();

@@ -7,2 +7,3 @@ "use strict";

exports.trackEvent = trackEvent;
exports.aliasUser = aliasUser;

@@ -56,2 +57,4 @@ var _index = _interopRequireDefault(require("./analytics/index"));

async function trackEvent(...args) {
const id = await _token.default.uuid();
try {

@@ -63,2 +66,18 @@ const client = await getInstance();

}
}
async function aliasUser(vipUserId) {
try {
if (vipUserId) {
await trackEvent('_alias_user', {
ui: vipUserId,
_ut: _config.default.tracksUserType,
anonid: _token.default.uuid()
});
_token.default.setUuid(vipUserId);
}
} catch (e) {
debug('aliasUser() failed', e);
}
}
{
"name": "@automattic/vip",
"version": "1.4.0-dev8",
"version": "1.4.0-dev9",
"description": "The VIP Go Javascript library & CLI",

@@ -50,5 +50,5 @@ "main": "index.js",

"devDependencies": {
"@babel/cli": "7.2.3",
"@babel/core": "7.4.0",
"@babel/plugin-transform-modules-commonjs": "7.4.0",
"@babel/cli": "7.4.4",
"@babel/core": "7.4.4",
"@babel/plugin-transform-modules-commonjs": "7.4.4",
"@babel/preset-flow": "7.0.0",

@@ -59,3 +59,3 @@ "babel-core": "7.0.0-bridge.0",

"babel-plugin-module-resolver": "3.2.0",
"core-js": "3.0.0",
"core-js": "3.0.1",
"eslines": "1.1.0",

@@ -65,3 +65,3 @@ "eslint": "5.16.0",

"eslint-plugin-flowtype": "3.4.2",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-import": "2.17.2",
"eslint-plugin-json": "1.4.0",

@@ -78,29 +78,29 @@ "eslint-plugin-jsx-a11y": "6.2.1",

"dependencies": {
"apollo-cache-inmemory": "~1.5.0",
"apollo-client": "~2.5.0",
"apollo-link-error": "^1.1.8",
"apollo-link-http": "~1.5.5",
"args": "~5.0.0",
"chalk": "~2.4.1",
"apollo-cache-inmemory": "1.5.0",
"apollo-client": "2.5.0",
"apollo-link-error": "1.1.8",
"apollo-link-http": "1.5.5",
"args": "5.0.0",
"chalk": "2.4.1",
"cli-table": "github:automattic/cli-table#7b14232",
"configstore": "^4.0.0",
"debug": "~4.1.0",
"enquirer": "^2.3.0",
"graphql": "~14.1.0",
"graphql-tag": "~2.10.0",
"ini": "~1.3.5",
"isomorphic-fetch": "~2.2.1",
"json2csv": "~4.3.0",
"jwt-decode": "~2.2.0",
"opn": "~5.4.0",
"semver": "~5.6.0",
"single-line-log": "~1.1.2",
"socket.io-client": "^2.2.0",
"socket.io-stream": "^0.9.1",
"update-notifier": "~2.5.0",
"uuid": "~3.3.0"
"configstore": "4.0.0",
"debug": "4.1.0",
"enquirer": "2.3.0",
"graphql": "14.1.0",
"graphql-tag": "2.10.0",
"ini": "1.3.5",
"isomorphic-fetch": "2.2.1",
"json2csv": "4.3.0",
"jwt-decode": "2.2.0",
"opn": "5.4.0",
"semver": "6.0.0",
"single-line-log": "1.1.2",
"socket.io-client": "2.2.0",
"socket.io-stream": "0.9.1",
"update-notifier": "2.5.0",
"uuid": "3.3.0"
},
"optionalDependencies": {
"keytar": "^4.1.0"
"keytar": "4.1.0"
}
}
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