node-nats-streaming
Advanced tools
Comparing version 0.2.4 to 0.2.6
@@ -1,1 +0,1 @@ | ||
{"processes":{"03f74aea-ee06-4a02-bfc6-52a716bd6b9f":{"parent":"1efd0468-8839-4165-af72-1c16112a010b","children":[]},"1efd0468-8839-4165-af72-1c16112a010b":{"parent":null,"children":["03f74aea-ee06-4a02-bfc6-52a716bd6b9f"]}},"files":{"/Users/synadia/Dropbox/code/src/github.com/nats-io/stan.js/lib/stan.js":["03f74aea-ee06-4a02-bfc6-52a716bd6b9f"]},"externalIds":{}} | ||
{"processes":{"5477888d-d217-4e59-ad8a-aae8b60eb0ae":{"parent":"8c7c2be7-fc12-4ea5-8eea-1b93e8a38b8c","children":[]},"8c7c2be7-fc12-4ea5-8eea-1b93e8a38b8c":{"parent":null,"children":["5477888d-d217-4e59-ad8a-aae8b60eb0ae"]}},"files":{"/Users/synadia/Dropbox/code/src/github.com/nats-io/stan.js/lib/stan.js":["5477888d-d217-4e59-ad8a-aae8b60eb0ae"]},"externalIds":{}} |
@@ -19,3 +19,2 @@ /* | ||
import * as tls from 'tls'; | ||
// import proto = require('./lib/pb'); | ||
@@ -22,0 +21,0 @@ export const version: string; |
@@ -35,3 +35,3 @@ /* | ||
*/ | ||
const VERSION = '0.2.4', | ||
const VERSION = '0.2.6', | ||
DEFAULT_PORT = 4222, | ||
@@ -169,2 +169,3 @@ DEFAULT_PRE = 'nats://localhost:', | ||
this.assignOption(opts, 'token'); | ||
this.assignOption(opts, 'tokenHandler'); | ||
this.assignOption(opts, 'password', 'pass'); | ||
@@ -296,3 +297,3 @@ this.assignOption(opts, 'verbose'); | ||
if (msg) { | ||
const pingResponse = proto.PingResponse.deserializeBinary(Buffer.from(msg, 'binary')); | ||
const pingResponse = proto.pb.PingResponse.deserializeBinary(Buffer.from(msg, 'binary')); | ||
const err = pingResponse.getError(); | ||
@@ -312,3 +313,3 @@ if (err) { | ||
this.connId = Buffer.from(nuid.next(), "utf8"); | ||
const req = new proto.ConnectRequest(); | ||
const req = new proto.pb.ConnectRequest(); | ||
req.setClientId(this.clientID); | ||
@@ -326,3 +327,3 @@ req.setHeartbeatInbox(hbInbox); | ||
if (msg.code === nats.REQ_TIMEOUT) { | ||
err = CONNECT_REQ_TIMEOUT; | ||
err = new nats.NatsError(CONNECT_REQ_TIMEOUT, CONNECT_REQ_TIMEOUT, err); | ||
} | ||
@@ -333,3 +334,3 @@ this.closeWithError('error', err); | ||
const cr = proto.ConnectResponse.deserializeBinary(Buffer.from(msg, 'binary')); | ||
const cr = proto.pb.ConnectResponse.deserializeBinary(Buffer.from(msg, 'binary')); | ||
if (cr.getError() !== "") { | ||
@@ -354,3 +355,3 @@ this.closeWithError('error', cr.getError()); | ||
const ping = new proto.Ping(); | ||
const ping = new proto.pb.Ping(); | ||
ping.setConnId(this.connId); | ||
@@ -476,3 +477,3 @@ this.pingBytes = Buffer.from(ping.serializeBinary()); | ||
if (this.nc && this.closeRequests) { | ||
const req = new proto.CloseRequest(); | ||
const req = new proto.pb.CloseRequest(); | ||
req.setClientId(this.clientID); | ||
@@ -488,3 +489,3 @@ this.nc.requestOne(this.closeRequests, Buffer.from(req.serializeBinary()), {}, this.options.connectTimeout, (msgOrError) => { | ||
} else { | ||
const cr = proto.CloseResponse.deserializeBinary(Buffer.from(msgOrError, 'binary')); | ||
const cr = proto.pb.CloseResponse.deserializeBinary(Buffer.from(msgOrError, 'binary')); | ||
const err = cr.getError(); | ||
@@ -518,3 +519,3 @@ if (err && err.length > 0) { | ||
//noinspection JSUnresolvedVariable | ||
const pa = proto.PubAck.deserializeBinary(Buffer.from(msg, 'binary')); | ||
const pa = proto.pb.PubAck.deserializeBinary(Buffer.from(msg, 'binary')); | ||
const guid = pa.getGuid(); | ||
@@ -581,3 +582,3 @@ const a = this.removeAck(guid); | ||
//noinspection JSUnresolvedFunction | ||
const pe = new proto.PubMsg(); | ||
const pe = new proto.pb.PubMsg(); | ||
pe.setClientId(this.clientID); | ||
@@ -665,3 +666,3 @@ pe.setConnId(this.connId); | ||
retVal.inboxSub = this.nc.subscribe(retVal.inbox, this.processMsg()); | ||
const sr = new proto.SubscriptionRequest(); | ||
const sr = new proto.pb.SubscriptionRequest(); | ||
sr.setClientId(this.clientID); | ||
@@ -677,6 +678,6 @@ sr.setSubject(subject); | ||
switch (sr.getStartPosition()) { | ||
case proto.StartPosition.TIME_DELTA_START: | ||
case proto.pb.StartPosition.TIME_DELTA_START: | ||
sr.setStartTimeDelta(retVal.opts.startTime); | ||
break; | ||
case proto.StartPosition.SEQUENCE_START: | ||
case proto.pb.StartPosition.SEQUENCE_START: | ||
sr.setStartSequence(retVal.opts.startSequence); | ||
@@ -697,3 +698,3 @@ break; | ||
//noinspection JSUnresolvedVariable | ||
const r = proto.SubscriptionResponse.deserializeBinary(Buffer.from(msg, 'binary')); | ||
const r = proto.pb.SubscriptionResponse.deserializeBinary(Buffer.from(msg, 'binary')); | ||
const err = r.getError(); | ||
@@ -832,3 +833,3 @@ if (err && err.length !== 0) { | ||
//noinspection JSUnresolvedFunction | ||
const ur = new proto.UnsubscribeRequest(); | ||
const ur = new proto.pb.UnsubscribeRequest(); | ||
ur.setClientId(sc.clientID); | ||
@@ -851,3 +852,3 @@ ur.setSubject(this.subject); | ||
//noinspection JSUnresolvedVariable | ||
const r = proto.SubscriptionResponse.deserializeBinary(Buffer.from(msg, 'binary')); | ||
const r = proto.pb.SubscriptionResponse.deserializeBinary(Buffer.from(msg, 'binary')); | ||
err = r.getError(); | ||
@@ -874,3 +875,3 @@ if (err && err.length > 0) { | ||
//noinspection JSUnresolvedVariable | ||
const m = proto.MsgProto.deserializeBinary(Buffer.from(rawMsg, 'binary')); | ||
const m = proto.pb.MsgProto.deserializeBinary(Buffer.from(rawMsg, 'binary')); | ||
if (sub === undefined || !this.nc) { | ||
@@ -992,3 +993,3 @@ return; | ||
if (!this.subscription.isClosed()) { | ||
const ack = new proto.Ack(); | ||
const ack = new proto.pb.Ack(); | ||
ack.setSubject(this.getSubject()); | ||
@@ -1018,3 +1019,3 @@ ack.setSequence(this.getSequence()); | ||
*/ | ||
exports.StartPosition = proto.StartPosition; | ||
exports.StartPosition = proto.pb.StartPosition; | ||
@@ -1028,3 +1029,3 @@ function SubscriptionOptions(durableName, maxInFlight, ackWait, startPosition, startSequence, startTime, manualAcks) { | ||
this.ackWait = ackWait || DEFAULT_ACK_WAIT; | ||
// StartPosition enum from proto. | ||
// StartPosition enum from proto.pb | ||
this.startPosition = startPosition; | ||
@@ -1067,3 +1068,3 @@ // Optional start sequence number. | ||
SubscriptionOptions.prototype.setStartAtSequence = function(sequence) { | ||
this.startPosition = proto.StartPosition.SEQUENCE_START; | ||
this.startPosition = proto.pb.StartPosition.SEQUENCE_START; | ||
this.startSequence = sequence; | ||
@@ -1079,3 +1080,3 @@ return this; | ||
SubscriptionOptions.prototype.setStartTime = function(date) { | ||
this.startPosition = proto.StartPosition.TIME_DELTA_START; | ||
this.startPosition = proto.pb.StartPosition.TIME_DELTA_START; | ||
// server expects values in ns | ||
@@ -1091,3 +1092,3 @@ this.startTime = (Date.now() - date.valueOf()) * 1000000; | ||
SubscriptionOptions.prototype.setStartAtTimeDelta = function(millis) { | ||
this.startPosition = proto.StartPosition.TIME_DELTA_START; | ||
this.startPosition = proto.pb.StartPosition.TIME_DELTA_START; | ||
//noinspection JSUnresolvedFunction | ||
@@ -1104,3 +1105,3 @@ // server expects values in ns | ||
SubscriptionOptions.prototype.setStartWithLastReceived = function() { | ||
this.startPosition = proto.StartPosition.LAST_RECEIVED; | ||
this.startPosition = proto.pb.StartPosition.LAST_RECEIVED; | ||
return this; | ||
@@ -1114,3 +1115,3 @@ }; | ||
SubscriptionOptions.prototype.setDeliverAllAvailable = function() { | ||
this.startPosition = proto.StartPosition.FIRST; | ||
this.startPosition = proto.pb.StartPosition.FIRST; | ||
return this; | ||
@@ -1117,0 +1118,0 @@ }; |
{ | ||
"name": "node-nats-streaming", | ||
"version": "0.2.4", | ||
"version": "0.2.6", | ||
"description": "Node.js client for NATS Streaming, a lightweight, high-performance cloud native messaging system", | ||
@@ -37,3 +37,3 @@ "keywords": [ | ||
"fmt": "js-beautify -n --config crockford.jscsrc -r lib/stan.js test/*.js test/support/*.js examples/* bench/*.js", | ||
"gen": "protoc --js_out=import_style=commonjs,binary:. lib/pb/protocol.proto", | ||
"gen": "protoc --js_out=import_style=commonjs_strict,binary:. lib/pb/protocol.proto", | ||
"lint": "eslint ./lib/stan.js ./examples ./bench ./test", | ||
@@ -48,3 +48,3 @@ "test": "npm run depcheck && npm run depcheck:unused && npm run lint && npm run test:unit", | ||
"dependencies": { | ||
"google-protobuf": "^3.8.0", | ||
"google-protobuf": "^3.9.0", | ||
"nats": "^1.3.0", | ||
@@ -54,4 +54,5 @@ "nuid": "^1.1.0" | ||
"devDependencies": { | ||
"acorn": "^6.1.1", | ||
"coveralls": "^3.0.4", | ||
"@types/node": "^12.6.2", | ||
"acorn": "^6.2.0", | ||
"coveralls": "^3.0.5", | ||
"dependency-check": "2.6.x", | ||
@@ -64,3 +65,4 @@ "eslint": "^5.16.0", | ||
"nyc": "^14.1.1", | ||
"should": "^13.2.3" | ||
"should": "^13.2.3", | ||
"typescript": "^3.5.3" | ||
}, | ||
@@ -67,0 +69,0 @@ "typings": "./index.d.ts", |
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
243848
4025
0
12
Updatedgoogle-protobuf@^3.9.0