Comparing version 1.0.24 to 2.0.0
@@ -464,3 +464,5 @@ /* | ||
if (!this._is_fatal(error.condition)) { | ||
this.closed_with_non_fatal_error = true; | ||
if (this.state.local_open) { | ||
this.closed_with_non_fatal_error = true; | ||
} | ||
} else if (!handled) { | ||
@@ -467,0 +469,0 @@ this.dispatch('error', new errors.ConnectionError(error.description, error.condition, this)); |
@@ -41,3 +41,3 @@ /* | ||
this.description = message; | ||
Object.defineProperty(this, 'connection', { value: connection, enumerable: false }); | ||
Object.defineProperty(this, 'connection', { value: connection }); | ||
} | ||
@@ -44,0 +44,0 @@ |
@@ -29,3 +29,4 @@ /* | ||
if (name !== 'AMQP') { | ||
throw new errors.ProtocolError('Invalid protocol header for AMQP ' + name); | ||
// output name in hex (null-bytes can be tough to deal with in ascii) | ||
throw new errors.ProtocolError('Invalid protocol header for AMQP: ' + buffer.toString('hex', 0, offset)); | ||
} | ||
@@ -67,3 +68,3 @@ header.protocol_id = buffer.readUInt8(offset++); | ||
frame.size = reader.read_uint(4); | ||
if (reader.remaining < frame.size) { | ||
if (reader.remaining() < (frame.size-4)) { | ||
return null; | ||
@@ -70,0 +71,0 @@ } |
@@ -48,3 +48,3 @@ /* | ||
this.description = message; | ||
this.link = link; | ||
Object.defineProperty(this, 'link', { value: link }); | ||
} | ||
@@ -51,0 +51,0 @@ require('util').inherits(LinkError, Error); |
@@ -34,3 +34,3 @@ /* | ||
this.description = message; | ||
this.session = session; | ||
Object.defineProperty(this, 'session', { value: session }); | ||
} | ||
@@ -316,3 +316,7 @@ require('util').inherits(SessionError, Error); | ||
} | ||
data = Buffer.concat([current.data, frame.payload], current.data.length + frame.payload.length); | ||
if (frame.payload) { | ||
data = Buffer.concat([current.data, frame.payload], current.data.length + frame.payload.length); | ||
} else { | ||
data = current.data; | ||
} | ||
} else if (this.next_delivery_id === frame.performative.delivery_id) { | ||
@@ -319,0 +323,0 @@ current = {'id':frame.performative.delivery_id, |
@@ -269,2 +269,7 @@ /* | ||
function read_timestamp(buffer, offset) { | ||
const l = read_long(buffer, offset); | ||
return new Date(l); | ||
} | ||
define_type('Null', 0x40, undefined, null); | ||
@@ -294,3 +299,3 @@ define_type('Boolean', 0x56, buffer_uint8_ops()); | ||
define_type('CharUTF32', 0x73, buffer_uint32be_ops()); | ||
define_type('Timestamp', 0x83, {'write':write_long, 'read':read_long});//TODO: convert to/from Date | ||
define_type('Timestamp', 0x83, {'write':write_long, 'read':read_timestamp}); | ||
define_type('Uuid', 0x98);//TODO: convert to/from stringified form? | ||
@@ -297,0 +302,0 @@ define_type('Vbin8', 0xa0); |
{ | ||
"name": "rhea", | ||
"version": "1.0.24", | ||
"version": "2.0.0", | ||
"description": "reactive AMQP 1.0 library", | ||
@@ -20,20 +20,21 @@ "homepage": "http://github.com/amqp/rhea", | ||
"devDependencies": { | ||
"@types/node": "^8.0.37", | ||
"@types/debug": "^0.0.30", | ||
"@types/mocha": "^5.2.0", | ||
"@types/node": "^8.0.37", | ||
"browserify": "", | ||
"eslint": "^4.19.1", | ||
"istanbul": "1.1.0-alpha.1", | ||
"minimist": "", | ||
"mocha": "^3.0.0", | ||
"mocha": "^8.2.1", | ||
"nyc": "^15.1.0", | ||
"require-self": "^0.2.1", | ||
"ts-node": "^7.0.0", | ||
"typescript": "^3.0.1", | ||
"uglify-js": "", | ||
"require-self": "^0.2.1", | ||
"ws": "^6.0.0", | ||
"typescript": "^3.0.1", | ||
"ts-node": "^7.0.0" | ||
"wtfnode": "^0.8.4" | ||
}, | ||
"scripts": { | ||
"lint": "eslint lib/*.js", | ||
"test": "npm run lint && npm run tsc && mocha -r ts-node/register ./test/*.ts", | ||
"coverage": "istanbul cover _mocha -- test/*.ts --compilers ts-node/register", | ||
"test": "mocha --require ts-node/register ./test/*.ts", | ||
"coverage": "nyc --reporter=json --reporter=lcov --reporter=text-summary npm run test", | ||
"browserify": "browserify -r .:rhea -o dist/rhea.js", | ||
@@ -40,0 +41,0 @@ "run-examples": "require-self && mocha examples/test_examples.js", |
@@ -1,2 +0,2 @@ | ||
[![Build Status](https://travis-ci.org/amqp/rhea.svg?branch=master)](https://travis-ci.org/amqp/rhea) | ||
![Node.js CI](https://github.com/amqp/rhea/workflows/Node.js%20CI/badge.svg) | ||
@@ -3,0 +3,0 @@ # rhea |
@@ -462,7 +462,7 @@ /// <reference types="node" /> | ||
*/ | ||
absolute_expiry_time?: number; | ||
absolute_expiry_time?: Date; | ||
/** | ||
* @property {number} [creation_time] The time this message was created. | ||
*/ | ||
creation_time?: number; | ||
creation_time?: Date; | ||
/** | ||
@@ -522,2 +522,16 @@ * @property {string} [group_id] The group this message belongs to. | ||
/** | ||
* Describes the footer section. It is used for details about the message or delivery | ||
* which can only be calculated or evaluated once the whole bare message has been | ||
* constructed or seen (for example message hashes, HMACs, signatures and encryption details). | ||
* | ||
* @interface MessageFooter | ||
*/ | ||
export interface MessageFooter { | ||
/** | ||
* @property {any} Any Supported footer section | ||
*/ | ||
[x: string]: any; | ||
} | ||
/** | ||
* Describes the AMQP message that is sent or received on the wire. | ||
@@ -547,2 +561,6 @@ * @interface Message | ||
delivery_annotations?: DeliveryAnnotations; | ||
/** | ||
* @property {MessageFooter} [footer] A dictionary used for the footer section of the message. | ||
*/ | ||
footer?: MessageFooter; | ||
} | ||
@@ -549,0 +567,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
892579
14177
14
43