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

appcd-client

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appcd-client - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0-0

481

dist/client.js

@@ -1,34 +0,26 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.default = undefined;
exports.default = void 0;
var _fs = require('fs');
var _appcdLogger = _interopRequireDefault(require("appcd-logger"));
var _fs2 = _interopRequireDefault(_fs);
var _fs = _interopRequireDefault(require("fs"));
var _msgpackLite = require('msgpack-lite');
var _msgpackLite = _interopRequireDefault(require("msgpack-lite"));
var _msgpackLite2 = _interopRequireDefault(_msgpackLite);
var _path = _interopRequireDefault(require("path"));
var _path = require('path');
var _uuid = _interopRequireDefault(require("uuid"));
var _path2 = _interopRequireDefault(_path);
var _ws = _interopRequireDefault(require("ws"));
var _uuid = require('uuid');
var _appcdUtil = require("appcd-util");
var _uuid2 = _interopRequireDefault(_uuid);
var _events = require("events");
var _ws = require('ws');
var _appcdResponse = require("appcd-response");
var _ws2 = _interopRequireDefault(_ws);
var _appcdUtil = require('appcd-util');
var _events = require('events');
var _appcdResponse = require('appcd-response');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -38,194 +30,229 @@

if (!Error.prepareStackTrace) {
require('source-map-support/register');
require('source-map-support/register');
}
const {
log
} = (0, _appcdLogger.default)('appcd:client');
const {
alert,
highlight,
note,
ok
} = _appcdLogger.default.styles;
/**
* The client for connecting to the appcd server.
*/
let Client = class Client {
/**
* Initializes the client.
*
* @param {Object} [opts] - Various options.
* @param {String} [opts.host='127.0.0.1'] - The host to connect to.
* @param {Number} [opts.port=1732] - The port to connect to.
* @param {String} [opts.userAgent] - The user agent containing the name and
* version of the client. If not specified, one will be generated.
* @access public
*/
constructor(opts = {}) {
/**
* The websocket to the server.
* @type {WebSocket}
* @access private
/**
* Initializes the client.
*
* @param {Object} [opts] - Various options.
* @param {String} [opts.host='127.0.0.1'] - The host to connect to.
* @param {Number} [opts.port=1732] - The port to connect to.
* @param {String} [opts.userAgent] - The user agent containing the name and
* version of the client. If not specified, one will be generated.
* @access public
*/
this.socket = null;
constructor(opts = {}) {
/**
* The websocket to the server.
* @type {WebSocket}
* @access private
*/
this.socket = null;
/**
* An internal map used to dispatch responses to requesters.
* @type {Object}
* @access private
*/
/**
* An internal map used to dispatch responses to requesters.
* @type {Object}
* @access private
*/
this.requests = {};
this.requests = {};
/**
* The host to connect to.
* @type {String}
* @access private
*/
/**
* The host to connect to.
* @type {String}
* @access private
*/
this.host = opts.host || '127.0.0.1';
this.host = opts.host || '127.0.0.1';
/**
* The port to connect to.
* @type {Number}
* @access private
*/
/**
* The port to connect to.
* @type {Number}
* @access private
*/
if (opts.port && (typeof opts.port !== 'number' || opts.port < 1 || opts.port > 65535)) {
throw new TypeError('Invalid port, expected a number between 1 and 65535');
}
this.port = opts.port || 1732;
if (opts.port && (typeof opts.port !== 'number' || opts.port < 1 || opts.port > 65535)) {
throw new TypeError('Invalid port, expected a number between 1 and 65535');
}
/**
* The user agent containing the name and version of the client. If not
* specified, one will be generated.
* @type {String}
* @access private
this.port = opts.port || 1732;
/**
* The user agent containing the name and version of the client. If not
* specified, one will be generated.
* @type {String}
* @access private
*/
this.userAgent = constructUserAgent(opts.userAgent);
}
/**
* Connects to the server via a websocket. You do not need to call this.
* `request()` will automatically call this function.
*
* @returns {EventEmitter} Emits events `connected`, `close`, and `error`.
* @access public
*/
this.userAgent = constructUserAgent(opts.userAgent);
}
/**
* Connects to the server via a websocket. You do not need to call this.
* `request()` will automatically call this function.
*
* @returns {EventEmitter} Emits events `connected`, `close`, and `error`.
* @access public
*/
connect() {
const emitter = new _events.EventEmitter();
// need to delay request so event emitter can be returned and events can
// be wired up
setImmediate(async () => {
try {
if (this.socket) {
emitter.emit('connected', this);
return;
}
connect() {
const emitter = new _events.EventEmitter(); // need to delay request so event emitter can be returned and events can
// be wired up
const headers = {
'User-Agent': this.userAgent
};
setImmediate(async () => {
try {
if (this.socket) {
emitter.emit('connected', this);
return;
}
const localeValue = process.env.APPCD_LOCALE || (await (0, _appcdResponse.locale)());
if (localeValue) {
headers['Accept-Language'] = localeValue;
}
const headers = {
'User-Agent': this.userAgent
};
const localeValue = process.env.APPCD_LOCALE || (await (0, _appcdResponse.locale)());
const socket = this.socket = new _ws2.default(`ws://${this.host}:${this.port}`, {
headers
});
if (localeValue) {
headers['Accept-Language'] = localeValue;
}
socket.on('message', data => {
let json = null;
if (typeof data === 'string') {
try {
json = JSON.parse(data);
} catch (e) {
// bad response, shouldn't ever happen
emitter.emit('warning', `Server returned invalid JSON: ${e.message}`);
return;
}
} else {
json = _msgpackLite2.default.decode(data);
}
const url = `ws://${this.host}:${this.port}`;
log(`Connecting to ${highlight(url)}`);
const socket = this.socket = new _ws.default(url, {
headers
});
socket.on('message', data => {
let json = null;
if (json && typeof json === 'object' && this.requests[json.id]) {
this.requests[json.id](json);
} else {
emitter.emit('warning', 'Server response is not an object or has an invalid id');
}
});
if (typeof data === 'string') {
try {
json = JSON.parse(data);
} catch (e) {
// bad response, shouldn't ever happen
emitter.emit('warning', `Server returned invalid JSON: ${e.message}`);
return;
}
} else {
json = _msgpackLite.default.decode(data);
}
socket.on('open', () => emitter.emit('connected', this)).once('close', () => emitter.emit('close')).once('error', err => {
socket.close();
this.socket = null;
emitter.emit('error', err);
});
} catch (e) {
emitter.emit('error', e);
}
});
if (json && typeof json === 'object' && this.requests[json.id]) {
this.requests[json.id](json);
} else {
emitter.emit('warning', 'Server response is not an object or has an invalid id');
}
}).on('open', () => emitter.emit('connected', this)).once('close', () => emitter.emit('close')).once('error', err => {
socket.close();
this.socket = null;
emitter.emit('error', err);
});
} catch (e) {
emitter.emit('error', e);
}
});
return emitter;
}
/**
* Issues a request to the server over a websocket.
*
* @param {String} path - The path to send.
* @param {Object} [data] - An object to send.
* @param {String} [type] - The request type. Valid types include `call`, `subscribe`, and
* `unsubscribe`.
* @returns {EventEmitter} Emits events `response` and `error`.
* @access public
*/
return emitter;
}
/**
* Issues a request to the server over a websocket.
*
* @param {String} path - The path to send.
* @param {Object} [data] - An object to send.
* @param {String} [type] - The request type. Valid types include `call`, `subscribe`, and
* `unsubscribe`.
* @returns {EventEmitter} Emits events `response` and `error`.
* @access public
*/
request({ path, data, type } = {}) {
const emitter = new _events.EventEmitter();
request({
path,
data,
type
} = {}) {
const emitter = new _events.EventEmitter();
const startTime = new Date(); // need to delay request so event emitter can be returned and events can
// be wired up
// need to delay request so event emitter can be returned and events can
// be wired up
setImmediate(() => {
const id = _uuid2.default.v4();
setImmediate(() => {
const id = _uuid.default.v4();
return this.connect().on('connected', client => {
this.requests[id] = response => {
const status = ~~response.status || 500;
const statusClass = Math.floor(status / 100);
return this.connect().on('connected', client => {
this.requests[id] = response => {
const status = response.status = ~~response.status || 500;
const statusClass = Math.floor(status / 100);
const style = status < 400 ? ok : alert; // no need for the id anymore
switch (statusClass) {
case 2:
emitter.emit('response', response.message, response);
break;
delete response.id;
log(`${style(status)} ${highlight(path)} ${note(`${new Date() - startTime}ms`)}`);
case 4:
case 5:
const err = new Error(response.message || 'Server Error');
err.errorCode = status;
err.code = String(response.statusCode ? response.statusCode : status);
emitter.emit('error', err, response);
}
};
switch (statusClass) {
case 2:
emitter.emit('response', response.message, response);
break;
client.socket.send(JSON.stringify({
version: '1.0',
path: path,
id: id,
data,
type
}));
}).on('warning', (...args) => emitter.emit('warning', ...args)).once('close', () => {
delete this.requests[id];
}).once('error', err => {
delete this.requests[id];
emitter.emit('error', err);
});
});
case 4:
case 5:
const err = new Error(response.message || 'Server Error');
return emitter;
}
if (!response.statusCode) {
response.statusCode = String(status);
}
/**
* Disconnects from the server.
*
* @access public
*/
disconnect() {
if (this.socket) {
this.socket.close();
}
this.socket = null;
}
for (const prop of Object.keys(response)) {
// we need to use defineProperty() to force properties to be created
Object.defineProperty(err, prop, {
configurable: true,
enumerable: true,
value: response[prop],
writable: true
});
}
emitter.emit('error', err, response);
}
};
const req = {
version: '1.0',
path,
id,
data,
type
};
log('Sending request:', req);
client.socket.send(JSON.stringify(req));
}).on('warning', (...args) => emitter.emit('warning', ...args)).once('close', () => {
delete this.requests[id];
}).once('error', err => {
delete this.requests[id];
emitter.emit('error', err);
});
});
return emitter;
}
/**
* Disconnects from the server.
*
* @access public
*/
disconnect() {
if (this.socket) {
this.socket.close();
}
this.socket = null;
}
};
/**

@@ -241,56 +268,60 @@ * Generates a user agent string containing the name of the parent-most script

exports.default = Client;
function constructUserAgent(userAgent) {
if (userAgent && typeof userAgent !== 'string') {
throw new TypeError('Expected user agent to be a string');
}
if (userAgent && typeof userAgent !== 'string') {
throw new TypeError('Expected user agent to be a string');
}
const parts = userAgent ? userAgent.split(' ') : [];
const parts = userAgent ? userAgent.split(' ') : [];
if (!parts.length) {
let entry = module;
while (entry.parent) {
entry = entry.parent;
}
if (!parts.length) {
let entry = module;
const name = _path2.default.basename(entry.filename);
const root = _path2.default.resolve('/');
let dir = _path2.default.dirname(entry.filename);
while (entry.parent) {
entry = entry.parent;
}
do {
const pkgJsonFile = _path2.default.join(dir, 'package.json');
const name = _path.default.basename(entry.filename);
try {
if (_fs2.default.statSync(pkgJsonFile)) {
parts.push(`${name}/${JSON.parse(_fs2.default.readFileSync(pkgJsonFile)).version || ''}`);
break;
}
} catch (e) {
// either the package.json doesn't exist or the JSON was malformed
if (e.code !== 'ENOENT') {
// must be malformed JSON, we can stop
break;
}
}
const root = _path.default.resolve('/');
dir = _path2.default.dirname(dir);
} while (dir !== root);
}
let dir = _path.default.dirname(entry.filename);
parts.push(`appcd-client/${JSON.parse(_fs2.default.readFileSync(_path2.default.resolve(__dirname, '..', 'package.json'))).version}`);
do {
const pkgJsonFile = _path.default.join(dir, 'package.json');
if (!parts.some(p => p.indexOf('node/') === 0)) {
parts.push(`node/${process.version.replace(/^v/, '')}`);
}
try {
if (_fs.default.statSync(pkgJsonFile)) {
parts.push(`${name}/${JSON.parse(_fs.default.readFileSync(pkgJsonFile)).version || ''}`);
break;
}
} catch (e) {
// either the package.json doesn't exist or the JSON was malformed
if (e.code !== 'ENOENT') {
// must be malformed JSON, we can stop
break;
}
}
if (!parts.some(p => p === process.platform)) {
parts.push(process.platform);
}
dir = _path.default.dirname(dir);
} while (dir !== root);
}
const architecture = (0, _appcdUtil.arch)();
if (!parts.some(p => p === architecture)) {
parts.push(architecture);
}
parts.push(`appcd-client/${JSON.parse(_fs.default.readFileSync(_path.default.resolve(__dirname, '..', 'package.json'))).version}`);
return parts.join(' ');
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsaWVudC5qcyJdLCJuYW1lcyI6WyJFcnJvciIsInByZXBhcmVTdGFja1RyYWNlIiwicmVxdWlyZSIsIkNsaWVudCIsImNvbnN0cnVjdG9yIiwib3B0cyIsInNvY2tldCIsInJlcXVlc3RzIiwiaG9zdCIsInBvcnQiLCJUeXBlRXJyb3IiLCJ1c2VyQWdlbnQiLCJjb25zdHJ1Y3RVc2VyQWdlbnQiLCJjb25uZWN0IiwiZW1pdHRlciIsInNldEltbWVkaWF0ZSIsImVtaXQiLCJoZWFkZXJzIiwibG9jYWxlVmFsdWUiLCJwcm9jZXNzIiwiZW52IiwiQVBQQ0RfTE9DQUxFIiwib24iLCJkYXRhIiwianNvbiIsIkpTT04iLCJwYXJzZSIsImUiLCJtZXNzYWdlIiwiZGVjb2RlIiwiaWQiLCJvbmNlIiwiZXJyIiwiY2xvc2UiLCJyZXF1ZXN0IiwicGF0aCIsInR5cGUiLCJ2NCIsImNsaWVudCIsInJlc3BvbnNlIiwic3RhdHVzIiwic3RhdHVzQ2xhc3MiLCJNYXRoIiwiZmxvb3IiLCJlcnJvckNvZGUiLCJjb2RlIiwiU3RyaW5nIiwic3RhdHVzQ29kZSIsInNlbmQiLCJzdHJpbmdpZn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XNoKGBub2RlLyR7cHJvY2Vzcy52ZXJzaW9uLnJlcGxhY2UoL152LywgJycpfWApO1xuXHR9XG5cblx0aWYgKCFwYXJ0cy5zb21lKHAgPT4gcCA9PT0gcHJvY2Vzcy5wbGF0Zm9ybSkpIHtcblx0XHRwYXJ0cy5wdXNoKHByb2Nlc3MucGxhdGZvcm0pO1xuXHR9XG5cblx0Y29uc3QgYXJjaGl0ZWN0dXJlID0gYXJjaCgpO1xuXHRpZiAoIXBhcnRzLnNvbWUocCA9PiBwID09PSBhcmNoaXRlY3R1cmUpKSB7XG5cdFx0cGFydHMucHVzaChhcmNoaXRlY3R1cmUpO1xuXHR9XG5cblx0cmV0dXJuIHBhcnRzLmpvaW4oJyAnKTtcbn1cbiJdfQ==
if (!parts.some(p => p.indexOf('node/') === 0)) {
parts.push(`node/${process.version.replace(/^v/, '')}`);
}
if (!parts.some(p => p === process.platform)) {
parts.push(process.platform);
}
const architecture = (0, _appcdUtil.arch)();
if (!parts.some(p => p === architecture)) {
parts.push(architecture);
}
return parts.join(' ');
}
{
"name": "appcd-client",
"version": "1.0.1",
"version": "1.1.0-0",
"description": "The Node.js client for connecting to the Appc Daemon.",

@@ -25,11 +25,12 @@ "main": "./dist/client",

"dependencies": {
"appcd-response": "^1.0.1",
"appcd-util": "^1.0.1",
"appcd-logger": "^1.1.0-0",
"appcd-response": "^1.1.0-0",
"appcd-util": "^1.1.0-0",
"msgpack-lite": "^0.1.26",
"source-map-support": "^0.5.0",
"uuid": "^3.1.0",
"ws": "^3.3.2"
"source-map-support": "^0.5.4",
"uuid": "^3.2.1",
"ws": "^5.1.0"
},
"devDependencies": {
"appcd-gulp": "^1.0.1",
"appcd-gulp": "^1.1.0-0",
"gulp": "^3.9.1"

@@ -36,0 +37,0 @@ },

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