From 726f1d08430fcccd895689a6e6fae7752ef5337b Mon Sep 17 00:00:00 2001 From: Petr Matousek Date: Wed, 15 Feb 2023 15:51:33 +0100 Subject: [PATCH 1/2] FIX(formatter): creation_time field format for details, see https://github.com/amqp/rhea/releases/tag/2.0.0 --- lib/formatter.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/formatter.js b/lib/formatter.js index bcc9287..a76cd8e 100644 --- a/lib/formatter.js +++ b/lib/formatter.js @@ -158,7 +158,7 @@ class Formatter { workDict['content-type'] = dict['content_type']; workDict['content-encoding'] = dict['content_encoding']; workDict['absolute-expiry-time'] = dict['absolute_expiry_time']; - workDict['creation-time'] = dict['creation_time']; + workDict['creation-time'] = dict['creation_time'].getTime(); workDict['group-id'] = dict['group_id']; workDict['group-sequence'] = dict['group_sequence']; workDict['reply-to-group-id'] = dict['reply_to_group_id']; @@ -211,7 +211,7 @@ class Formatter { workDict['content_type'] = dict['content_type']; workDict['content_encoding'] = dict['content_encoding']; workDict['absolute-expiry-time'] = dict['absolute_expiry_time']; - workDict['creation_time'] = dict['creation_time']; + workDict['creation-time'] = dict['creation_time'].getTime(); workDict['group-id'] = dict['group_id']; workDict['group-sequence'] = dict['group_sequence']; workDict['reply-to-group-id'] = dict['reply_to_group_id']; diff --git a/package.json b/package.json index 8a1dc21..b5c650f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cli-rhea", - "version": "2.6.2", + "version": "2.6.3", "description": "Client interface built on amqp/rhea lib", "scripts": { "test": "mocha test/*Test.js", From f0ce667d8a237fcb21a4c5e25c04151203cf7426 Mon Sep 17 00:00:00 2001 From: Petr Matousek Date: Wed, 15 Feb 2023 15:56:15 +0100 Subject: [PATCH 2/2] FIX(formatter) use dashes not underscores for message field keys --- lib/formatter.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/formatter.js b/lib/formatter.js index a76cd8e..0dc6311 100644 --- a/lib/formatter.js +++ b/lib/formatter.js @@ -203,13 +203,13 @@ class Formatter { //amqp properties workDict['id'] = dict['message_id']; - workDict['user_id'] = Formatter.castUserId(dict['user_id']); + workDict['user-id'] = Formatter.castUserId(dict['user_id']); workDict['to'] = dict['to']; workDict['subject'] = dict['subject']; - workDict['reply_to'] = dict['reply_to']; - workDict['correlation_id'] = dict['correlation_id']; - workDict['content_type'] = dict['content_type']; - workDict['content_encoding'] = dict['content_encoding']; + workDict['reply-to'] = dict['reply_to']; + workDict['correlation-id'] = dict['correlation_id']; + workDict['content-type'] = dict['content_type']; + workDict['content-encoding'] = dict['content_encoding']; workDict['absolute-expiry-time'] = dict['absolute_expiry_time']; workDict['creation-time'] = dict['creation_time'].getTime(); workDict['group-id'] = dict['group_id'];