@thecolvinco/nodejs-messenger
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,25 +0,6 @@ | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) { return e; } else { | ||
var n = {}; | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
}); | ||
}); | ||
} | ||
n['default'] = e; | ||
return n; | ||
} | ||
} | ||
import { v4 } from 'uuid'; | ||
import { connect } from 'amqplib'; | ||
import { EventEmitter } from 'events'; | ||
import { resolve } from 'path'; | ||
var uuid = require('uuid'); | ||
var amqplib = require('amqplib'); | ||
var events = require('events'); | ||
var path = require('path'); | ||
const parse = ({ | ||
@@ -39,3 +20,3 @@ payload, | ||
data: { | ||
messageId: uuid.v4(), | ||
messageId: v4(), | ||
occurredOn: Date.now(), | ||
@@ -242,3 +223,3 @@ attributes: payload, | ||
const amqpConnect = connectionString => { | ||
return amqplib.connect(connectionString); | ||
return connect(connectionString); | ||
}; | ||
@@ -359,3 +340,3 @@ | ||
class DomainEventEmitter extends events.EventEmitter { | ||
class DomainEventEmitter extends EventEmitter { | ||
on(eventName, originalFunction) { | ||
@@ -383,3 +364,3 @@ const decoratedFunction = async ({ | ||
class CommandEmitter extends events.EventEmitter { | ||
class CommandEmitter extends EventEmitter { | ||
on(eventName, originalFunction) { | ||
@@ -415,3 +396,3 @@ const decoratedFunction = async ({ | ||
commandsPath.forEach(async commandPath => { | ||
const resolvedModule = await new Promise(function (resolve) { resolve(_interopNamespace(require(path.resolve(commandPath.trim())))); }); | ||
const resolvedModule = await import(resolve(commandPath.trim())); | ||
const Command = resolvedModule['default']; | ||
@@ -436,4 +417,4 @@ emitter.on(eventName, message => { | ||
}) { | ||
const resolvedHandlerModule = await new Promise(function (resolve) { resolve(_interopNamespace(require(path.resolve(handlerPath.trim())))); }); | ||
const resolvedCommandModule = await new Promise(function (resolve) { resolve(_interopNamespace(require(path.resolve(handlerPath.replace('Handler', '').trim())))); }); | ||
const resolvedHandlerModule = await import(resolve(handlerPath.trim())); | ||
const resolvedCommandModule = await import(resolve(handlerPath.replace('Handler', '').trim())); | ||
const Handler = resolvedHandlerModule['default']; | ||
@@ -759,19 +740,3 @@ const Command = resolvedCommandModule['default']; | ||
exports.CommandConsumer = CommandConsumer; | ||
exports.CommandEmitter = CommandEmitter; | ||
exports.DomainEventConsumer = DomainEventConsumer; | ||
exports.DomainEventEmitter = DomainEventEmitter; | ||
exports.EventDispatcher = EventDispatcher; | ||
exports.amqpConnect = amqpConnect; | ||
exports.commandSubscriber = commandSubscriber; | ||
exports.createCommand = createCommand; | ||
exports.createEvent = createEvent; | ||
exports.deadLetter = deadLetter; | ||
exports.domainEventSubscriber = domainEventSubscriber; | ||
exports.producer = producer; | ||
exports.pubSubInitialization = pubSubInitialization; | ||
exports.retryable = retryable; | ||
exports.toJSON = toJSON; | ||
exports.transportsInitialization = transportsInitialization; | ||
exports.worker = worker; | ||
export { CommandConsumer, CommandEmitter, DomainEventConsumer, DomainEventEmitter, EventDispatcher, amqpConnect, commandSubscriber, createCommand, createEvent, deadLetter, domainEventSubscriber, producer, pubSubInitialization, retryable, toJSON, transportsInitialization, worker }; | ||
//# sourceMappingURL=main.esm.js.map |
{ | ||
"name": "@thecolvinco/nodejs-messenger", | ||
"description": "Message library for nodejs applications", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"source": "src/main.ts", | ||
"main": "dist/main.esm.js", | ||
"main": "dist/main.js", | ||
"types": "dist/main.d.ts", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
3
232281
32
2867