Socket
Socket
Sign inDemoInstall

@croquiscom/thrift

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@croquiscom/thrift - npm Package Compare versions

Comparing version 0.10.0-cr1 to 0.10.0-cr10

lib/nodejs/lib/thrift/index.d.ts

2

lib/nodejs/lib/thrift/binary_protocol.js

@@ -58,3 +58,2 @@ /*

if (this._seqid) {
// TODO better logging log warning
log.warning('SeqId already set', { 'name': name });

@@ -181,3 +180,2 @@ } else {

if (version != VERSION_1) {
console.log("BAD: " + version);
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.BAD_VERSION, "Bad version in readMessageBegin: " + sz);

@@ -184,0 +182,0 @@ }

@@ -252,3 +252,2 @@ /*

if (this._seqid) {
// TODO better logging log warning
log.warning('SeqId already set', { 'name': name });

@@ -255,0 +254,0 @@ } else {

@@ -20,6 +20,8 @@ /*

var util = require('util');
var EventEmitter = require("events").EventEmitter;
var EventEmitter = require('events').EventEmitter;
var constants = require('constants');
var net = require('net');
var tls = require('tls');
var thrift = require('./thrift');
var log = require('./log');

@@ -125,3 +127,2 @@ var TBufferedTransport = require('./buffered_transport');

client = self.client[service_name];
delete self.seqId2Service[header.rseqid];
}

@@ -134,2 +135,5 @@ /*jshint -W083 */

delete client._reqs[header.rseqid];
if (service_name) {
delete self.seqId2Service[header.rseqid];
}
if (callback) {

@@ -207,5 +211,3 @@ callback(err, success);

if (self._debug) {
console.log("Retry connection in " + this.retry_delay + " ms");
}
log.debug("Retry connection in " + this.retry_delay + " ms");

@@ -226,5 +228,3 @@ if (this.max_attempts && this.attempts >= this.max_attempts) {

this.retry_timer = setTimeout(function () {
if (self._debug) {
console.log("Retrying connection...");
}
log.debug("Retrying connection...");

@@ -255,2 +255,7 @@ self.retry_totaltime += self.retry_delay;

exports.createSSLConnection = function(host, port, options) {
if (!('secureProtocol' in options) && !('secureOptions' in options)) {
options.secureProtocol = "SSLv23_method";
options.secureOptions = constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3;
}
var stream = tls.connect(port, host, options);

@@ -277,3 +282,2 @@ var connection = new Connection(stream, options);

this._debug = options.debug || false;
this.connection = child.stdin;

@@ -285,9 +289,9 @@ this.options = options || {};

if(this._debug === true){
this.child.stderr.on('data',function(err){
console.log(err.toString(),'CHILD ERROR');
if (log.getLogLevel() === 'debug') {
this.child.stderr.on('data', function (err) {
log.debug(err.toString(), 'CHILD ERROR');
});
this.child.on('exit',function(code,signal){
console.log(code+':'+signal,'CHILD EXITED');
this.child.on('exit', function (code,signal) {
log.debug(code + ':' + signal, 'CHILD EXITED');
});

@@ -294,0 +298,0 @@ }

@@ -172,2 +172,6 @@ /*

if (response.statusCode !== 200) {
this.emit("error", new THTTPException(response.statusCode, response));
}
response.on('error', function (e) {

@@ -214,6 +218,9 @@ self.emit("error", e);

var self = this;
self.nodeOptions.headers["Content-length"] = data.length;
var opts = self.nodeOptions;
opts.headers["Content-length"] = data.length;
if (!opts.headers["Content-Type"])
opts.headers["Content-Type"] = "application/x-thrift";
var req = (self.https) ?
https.request(self.nodeOptions, self.responseCallback) :
http.request(self.nodeOptions, self.responseCallback);
https.request(opts, self.responseCallback) :
http.request(opts, self.responseCallback);
req.on('error', function(err) {

@@ -254,1 +261,12 @@ var service_name = self.seqId2Service[seqid];

function THTTPException(statusCode, response) {
thrift.TApplicationException.call(this);
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.statusCode = statusCode;
this.response = response;
this.type = thrift.TApplicationExceptionType.PROTOCOL_ERROR;
this.message = "Received a response with a bad HTTP status code: " + response.statusCode;
}
util.inherits(THTTPException, thrift.TApplicationException);

@@ -21,2 +21,7 @@ /*

var log = require('./log');
exports.setLogFunc = log.setLogFunc;
exports.setLogLevel = log.setLogLevel;
exports.getLogLevel = log.getLogLevel;
var connection = require('./connection');

@@ -45,2 +50,6 @@ exports.Connection = connection.Connection;

var lambdaConnection = require('./lambda_connection');
exports.LambdaConnection = lambdaConnection.LambdaConnection;
exports.createLambdaConnection = lambdaConnection.createLambdaConnection;
var server = require('./server');

@@ -53,2 +62,5 @@ exports.createServer = server.createServer;

var lambda_handler = require('./lambda_handler');
exports.createLambdaHandler = lambda_handler.createLambdaHandler;
exports.Int64 = require('node-int64');

@@ -55,0 +67,0 @@ exports.Q = require('q');

@@ -20,3 +20,2 @@ /*

var log = require('./log');
var Int64 = require('node-int64');

@@ -23,0 +22,0 @@ var InputBufferUnderrunError = require('./transport').InputBufferUnderrunError;

@@ -20,8 +20,69 @@ /*

module.exports = {
'info' : function logInfo() {},
'warning' : function logWarning() {},
'error' : function logError() {},
'debug' : function logDebug() {},
'trace' : function logTrace() {}
var util = require('util');
var disabled = function () {};
var logFunc = console.log;
var logLevel = 'error'; // default level
function factory(level) {
return function () {
// better use spread syntax, but due to compatibility,
// use legacy method here.
var args = ['thrift: [' + level + '] '].concat(Array.from(arguments));
return logFunc(util.format.apply(null, args));
};
}
var trace = disabled;
var debug = disabled;
var error = disabled;
var warning = disabled;
var info = disabled;
exports.setLogFunc = function (func) {
logFunc = func;
};
var setLogLevel = exports.setLogLevel = function (level) {
trace = debug = error = warning = info = disabled;
logLevel = level;
switch (logLevel) {
case 'trace':
trace = factory('TRACE');
case 'debug':
debug = factory('DEBUG');
case 'error':
error = factory('ERROR');
case 'warning':
warning = factory('WARN');
case 'info':
info = factory('INFO');
}
};
// set default
setLogLevel(logLevel);
exports.getLogLevel = function () {
return logLevel;
};
exports.trace = function () {
return trace.apply(null, arguments);
};
exports.debug = function () {
return debug.apply(null, arguments);
};
exports.error = function () {
return error.apply(null, arguments);
};
exports.warning = function () {
return warning.apply(null, arguments);
};
exports.info = function () {
return info.apply(null, arguments);
};

@@ -57,7 +57,2 @@ /*

}
var self = this;
ServiceClient.prototype.new_seqid = function() {
self.seqid += 1;
return self.seqid;
};
var writeCb = function(buf, seqid) {

@@ -69,2 +64,7 @@ connection.write(buf,seqid);

var client = new ServiceClient(transport, protocolWrapper);
var self = this;
client.new_seqid = function() {
self.seqid += 1;
return self.seqid;
};

@@ -71,0 +71,0 @@ if (typeof connection.client !== 'object') {

@@ -19,2 +19,4 @@ /*

*/
var constants = require('constants');
var net = require('net');

@@ -91,2 +93,6 @@ var tls = require('tls');

if (options && options.tls) {
if (!('secureProtocol' in options.tls) && !('secureOptions' in options.tls)) {
options.tls.secureProtocol = "SSLv23_method";
options.tls.secureOptions = constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3;
}
return tls.createServer(options.tls, serverImpl);

@@ -93,0 +99,0 @@ } else {

@@ -25,2 +25,3 @@ /*

var crypto = require("crypto");
var log = require('./log');

@@ -288,3 +289,3 @@ var MultiplexedProcessor = require('./multiplexed_processor').MultiplexedProcessor;

'.png': 'image/png',
  '.svg': 'image/svg+xml'
'.svg': 'image/svg+xml'
};

@@ -552,3 +553,3 @@

} catch(e) {
console.log("TWebSocketTransport Exception: " + e);
log.error('TWebSocketTransport Exception: ' + e);
socket.destroy();

@@ -562,7 +563,1 @@ }

};

@@ -20,2 +20,4 @@ /*

var log = require('./log');
module.exports = TWebSocketTransport;

@@ -109,3 +111,3 @@

TWebSocketTransport.prototype.__onError = function(evt) {
console.log("Thrift WebSocket Error: " + evt.toString());
log.error('websocket: ' + evt.toString());
this.socket.close();

@@ -112,0 +114,0 @@ };

@@ -23,3 +23,6 @@ Thrift Node.js Library

## Compatibility
node version 4 or later is required
## Install

@@ -62,3 +65,3 @@

Since JavaScript represents all numbers as doubles, int64 values cannot be accurately represented naturally. To solve this, int64 values in responses will be wrapped with Thirft.Int64 objects. The Int64 implementation used is [broofa/node-int64](https://github.com/broofa/node-int64).
Since JavaScript represents all numbers as doubles, int64 values cannot be accurately represented naturally. To solve this, int64 values in responses will be wrapped with Thrift.Int64 objects. The Int64 implementation used is [broofa/node-int64](https://github.com/broofa/node-int64).

@@ -65,0 +68,0 @@ ## Client and server examples

@@ -9,3 +9,3 @@ {

},
"version": "0.10.0-cr1",
"version": "0.10.0-cr10",
"author": {

@@ -35,17 +35,24 @@ "name": "Apache Thrift Developers",

"main": "./lib/nodejs/lib/thrift",
"types": "./lib/nodejs/lib/thrift/index.d.ts",
"engines": {
"node": ">= 0.2.4"
"node": ">= 10.0.0"
},
"dependencies": {
"node-int64": "~0.3.0",
"q": "1.0.x",
"ws": "~0.4.32"
"@types/node-int64": "^0.4.29",
"@types/q": "^1.0.7",
"node-int64": "^0.4.0",
"q": "^1.5.0",
"ws": ">= 2.2.3"
},
"devDependencies": {
"buffer-equals": "^1.0.3",
"commander": "2.1.x",
"connect": "2.7.x",
"istanbul": "^0.3.5",
"run-browser": "^2.0.1",
"tape": "~3.5.0"
"buffer-equals": "^1.0.4",
"commander": "^2.11.0",
"connect": "^3.6.4",
"istanbul": "^0.4.5",
"jsdoc": ">=3.5.5",
"minimatch": "^3.0.4",
"phantomjs-prebuilt": "^2.1.7",
"run-browser": "^2.0.2",
"tape": "^4.8.0",
"utf-8-validate": "^3.0.0"
},

@@ -52,0 +59,0 @@ "scripts": {

Apache Thrift
=============
Last Modified: 2014-03-16
Last Modified: 2017-11-10

@@ -36,2 +36,9 @@ License

![Apache Thrift Layered Architecture](doc/images/thrift-layers.png)
Thrift makes it easy for programs written in different programming
languages to share data and call remote procedures. With support
for [over 20 programming languages](LANGUAGES.md), chances are Thrift
supports the ones that you currently use.
Thrift is specifically designed to support non-atomic version changes

@@ -41,7 +48,7 @@ across client and server code.

For more details on Thrift's design and implementation, take a gander at
the Thrift whitepaper included in this distribution or at the README.md files
the Thrift whitepaper included in this distribution or at the README.md file
in your particular subdirectory of interest.
Hierarchy
=========
Project Hierarchy
=================

@@ -65,2 +72,3 @@ thrift/

rb/
...

@@ -168,1 +176,7 @@ test/

servers.
Development
===========
To build the same way Travis CI builds the project you should use docker.
We have [comprehensive building instructions for docker](build/docker/README.md).

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