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

limitd-client

Package Overview
Dependencies
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

limitd-client - npm Package Compare versions

Comparing version 1.13.1 to 2.0.0

24

client.js

@@ -188,3 +188,3 @@ const url = require('url');

this.stream.write(request.encodeDelimited().toBuffer());
this.stream.write(RequestMessage.encodeDelimited(request).finish());

@@ -231,3 +231,3 @@ const start = Date.now();

var request = new RequestMessage({
var request = RequestMessage.create({
'id': randomstring.generate(7),

@@ -237,10 +237,6 @@ 'type': type,

'method': RequestMessage.Method[method],
'all': count === 'all' || null,
'count': count !== 'all' ? count : null
});
if (count === 'all') {
request.set('all', true);
} else {
request.set('count', count);
}
return this._request(request, type, done);

@@ -273,3 +269,3 @@ };

var request = new RequestMessage({
var request = RequestMessage.create({
'id': randomstring.generate(7),

@@ -279,10 +275,6 @@ 'type': type,

'method': RequestMessage.Method.PUT,
'all': count === 'all' ? true : null,
'count': count !== 'all' ? count : null
});
if (count === 'all') {
request.set('all', true);
} else {
request.set('count', count);
}
return this._request(request, type, done);

@@ -292,3 +284,3 @@ };

LimitdClient.prototype.status = function (type, key, done) {
var request = new RequestMessage({
var request = RequestMessage.create({
'id': randomstring.generate(7),

@@ -295,0 +287,0 @@ 'type': type,

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

var ProtoBuf = require('protobufjs');
require('protobufjs/src/parse').defaults.keepCase = true;
var path = require('path');
const ProtoBuf = require('protobufjs');
const path = require('path');
const protoPath = path.join(__dirname, '/../protocol/Index.proto');
const builder = ProtoBuf.loadSync(protoPath);
var builder = ProtoBuf.loadProtoFile(path.join(__dirname, '/../protocol/Index.proto'));
module.exports = builder.build('limitd');
module.exports = builder.lookup('limitd');
{
"name": "limitd-client",
"version": "1.13.1",
"version": "2.0.0",
"description": "limitd client for node.js",

@@ -15,3 +15,3 @@ "main": "index.js",

"lodash": "~3.7.0",
"protobufjs": "auth0/protobuf.js#4.0.0-auth0",
"protobufjs": "^6.6.5",
"randomstring": "~1.0.5",

@@ -18,0 +18,0 @@ "reconnect-net": "0.0.0",

@@ -75,7 +75,3 @@ var LimitdClient = require('../');

server.once('request', function (request, reply) {
var response = new Response({
request_id: request.id,
});
var takeResponse = new TakeResponse({
var takeResponse = TakeResponse.create({
conformant: true,

@@ -87,4 +83,8 @@ remaining: 10,

response.set('.limitd.TakeResponse.response', takeResponse);
var response = Response.create({
request_id: request.id,
'.limitd.TakeResponse.response': takeResponse
});
reply(response);

@@ -107,12 +107,11 @@ });

server.once('request', function (request, reply) {
var response = new Response({
request_id: request.id
var errorResponse = ErrorResponse.create({
type: ErrorResponse.Type.UNKNOWN_BUCKET_TYPE
});
var errorResponse = new ErrorResponse({
type: ErrorResponse.Type.UNKNOWN_BUCKET_TYPE
var response = Response.create({
request_id: request.id,
'.limitd.ErrorResponse.response': errorResponse
});
response.set('.limitd.ErrorResponse.response', errorResponse);
reply(response);

@@ -119,0 +118,0 @@ });

@@ -50,3 +50,3 @@ const net = require('net');

}))
.pipe(stream_map(response => response.encodeDelimited().toBuffer()))
.pipe(stream_map(response => protocol.Response.encodeDelimited(response).finish()))
.pipe(socket);

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

@@ -10,7 +10,3 @@ var LimitdClient = require('../');

function mock_response (request, reply) {
var response = new Response({
request_id: request.id
});
var takeResponse = new TakeResponse({
var takeResponse = TakeResponse.create({
conformant: true,

@@ -22,3 +18,6 @@ remaining: 10,

response.set('.limitd.TakeResponse.response', takeResponse);
var response = Response.create({
request_id: request.id,
'.limitd.TakeResponse.response': takeResponse
});

@@ -55,2 +54,2 @@ reply(response);

});
});
});
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