New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

remit

Package Overview
Dependencies
Maintainers
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remit - npm Package Compare versions

Comparing version 2.0.0-beta.4 to 2.0.0-beta.5

examples/dataAndPromise/index.js

36

lib/handleMessage.js
const getCallbackHandler = require('./handleCallback')
const parseEvent = require('./utils/parseEvent')

@@ -24,37 +25,4 @@ function handleMessage (type, response, message) {

let event = {
eventId: message.properties.messageId,
eventType: message.fields.routingKey,
resource: message.properties.appId,
data: messageContent
}
const event = parseEvent(message.properties, message.fields, messageContent)
if (message.properties.headers) {
if (message.properties.headers.uuid) {
event.eventId = message.properties.headers.uuid
}
if (message.properties.headers.scheduled) {
event.scheduled = new Date(message.properties.headers.scheduled)
}
if (message.properties.headers.delay) {
event.delay = message.properties.headers.delay
}
if (message.properties.headers.trace) {
event.resourceTrace = message.properties.headers.trace
}
}
if (message.properties.timestamp) {
if (message.properties.timestamp.toString().length === 10) {
message.properties.timestamp *= 1000
}
event.timestamp = new Date(message.properties.timestamp)
}
event.started = new Date()
response._emitter.once('done', getCallbackHandler.apply(remit, [type, response, message, event]))

@@ -61,0 +29,0 @@ type._emitter.emit('data', event, callback)

@@ -6,2 +6,3 @@ const debug = require('debug')('remit:request')

const uuid = require('uuid')
const parseEvent = require('./utils/parseEvent')

@@ -193,4 +194,8 @@ function RequestType (masterOptions) {

type._emitter.emit('sent', data)
request._emitter.emit('sent', data)
const sentEvent = parseEvent(messageOptions, {
routingKey: options.event
}, data)
type._emitter.emit('sent', sentEvent)
request._emitter.emit('sent', sentEvent)
})

@@ -216,3 +221,3 @@

if (type.options.expectReply) {
request._emitter.on('data', a => cleanUp(null, a))
request._emitter.on('data', cleanUp)
request._emitter.on('timeout', cleanUp)

@@ -219,0 +224,0 @@ } else {

{
"name": "remit",
"version": "2.0.0-beta.4",
"version": "2.0.0-beta.5",
"description": "A small set of functionality used to create microservices that don't need to be aware of one-another's existence.",

@@ -5,0 +5,0 @@ "main": "index.js",

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