@node-ts/bus-core
Advanced tools
Comparing version 0.6.10 to 0.6.11
@@ -78,7 +78,7 @@ "use strict"; | ||
ApplicationBootstrap = tslib_1.__decorate([ | ||
inversify_1.injectable(), | ||
tslib_1.__param(0, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.Bus)), | ||
tslib_1.__param(1, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.Transport)), | ||
tslib_1.__param(2, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.HandlerRegistry)), | ||
tslib_1.__param(3, inversify_1.inject(logger_core_1.LOGGER_SYMBOLS.Logger)), | ||
(0, inversify_1.injectable)(), | ||
tslib_1.__param(0, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.Bus)), | ||
tslib_1.__param(1, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.Transport)), | ||
tslib_1.__param(2, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.HandlerRegistry)), | ||
tslib_1.__param(3, (0, inversify_1.inject)(logger_core_1.LOGGER_SYMBOLS.Logger)), | ||
tslib_1.__metadata("design:paramtypes", [Object, Object, handler_1.HandlerRegistry, Object]) | ||
@@ -85,0 +85,0 @@ ], ApplicationBootstrap); |
import { ContainerModule, interfaces } from 'inversify'; | ||
export declare type SessionScopeBinder = (bind: interfaces.Bind) => void; | ||
export type SessionScopeBinder = (bind: interfaces.Bind) => void; | ||
export declare const defaultSessionScopeBinder: SessionScopeBinder; | ||
@@ -4,0 +4,0 @@ export declare class BusModule extends ContainerModule { |
@@ -21,4 +21,4 @@ "use strict"; | ||
bind(bus_symbols_1.BUS_INTERNAL_SYMBOLS.SessionScopeBinder).toConstantValue(exports.defaultSessionScopeBinder); | ||
exports.defaultSessionScopeBinder(bind); | ||
logger_core_1.bindLogger(bind, service_bus_1.ServiceBus); | ||
(0, exports.defaultSessionScopeBinder)(bind); | ||
(0, logger_core_1.bindLogger)(bind, service_bus_1.ServiceBus); | ||
bindService(bind, bus_symbols_1.BUS_SYMBOLS.Transport, transport_1.MemoryQueue).inSingletonScope(); | ||
@@ -38,5 +38,5 @@ bindService(bind, bus_symbols_1.BUS_SYMBOLS.Serializer, serialization_1.JsonSerializer); | ||
function bindService(bind, symbol, service) { | ||
logger_core_1.bindLogger(bind, service); | ||
(0, logger_core_1.bindLogger)(bind, service); | ||
return bind(symbol).to(service); | ||
} | ||
//# sourceMappingURL=bus-module.js.map |
@@ -6,3 +6,3 @@ import { Message } from '@node-ts/bus-messages'; | ||
import { Logger } from '@node-ts/logger-core'; | ||
declare type HandlerType = ClassConstructor<Handler<Message>> | ((context: interfaces.Context) => Handler<Message>); | ||
type HandlerType = ClassConstructor<Handler<Message>> | ((context: interfaces.Context) => Handler<Message>); | ||
export interface HandlerRegistration<TMessage extends MessageType> { | ||
@@ -9,0 +9,0 @@ defaultContainer: Container; |
@@ -34,6 +34,6 @@ "use strict"; | ||
} | ||
if (class_constructor_1.isClassConstructor(handler)) { | ||
if ((0, class_constructor_1.isClassConstructor)(handler)) { | ||
try { | ||
// Ensure the handler is available for injection | ||
inversify_1.decorate(inversify_1.injectable(), handler); | ||
(0, inversify_1.decorate)((0, inversify_1.injectable)(), handler); | ||
this.logger.trace(`Handler "${handler.name}" was missing the "injectable()" decorator. ` | ||
@@ -118,3 +118,3 @@ + `This has been added automatically`); | ||
this.logger.debug('Binding handler to message', { handlerName }); | ||
if (class_constructor_1.isClassConstructor(handlerRegistration.handler)) { | ||
if ((0, class_constructor_1.isClassConstructor)(handlerRegistration.handler)) { | ||
this.container | ||
@@ -135,4 +135,4 @@ .bind(handlerRegistration.symbol) | ||
HandlerRegistry = tslib_1.__decorate([ | ||
inversify_1.injectable(), | ||
tslib_1.__param(0, inversify_1.inject(logger_core_1.LOGGER_SYMBOLS.Logger)), | ||
(0, inversify_1.injectable)(), | ||
tslib_1.__param(0, (0, inversify_1.inject)(logger_core_1.LOGGER_SYMBOLS.Logger)), | ||
tslib_1.__metadata("design:paramtypes", [Object]) | ||
@@ -142,3 +142,3 @@ ], HandlerRegistry); | ||
function getHandlerName(handler) { | ||
return class_constructor_1.isClassConstructor(handler) | ||
return (0, class_constructor_1.isClassConstructor)(handler) | ||
? handler.prototype.constructor.name | ||
@@ -145,0 +145,0 @@ : handler.constructor.name; |
import { MessageAttributes, Message } from '@node-ts/bus-messages'; | ||
import { ClassConstructor } from '@node-ts/logger-core'; | ||
export declare type MessageType = Message | {}; | ||
export type MessageType = Message | {}; | ||
export interface HandlerPrototype<T extends MessageType> { | ||
@@ -5,0 +5,0 @@ /** |
@@ -10,3 +10,3 @@ "use strict"; | ||
prototype.$topicIdentifier = topicIdentifier; | ||
const isBusMessage = util_1.isClassConstructor(resolveWith); | ||
const isBusMessage = (0, util_1.isClassConstructor)(resolveWith); | ||
if (isBusMessage) { | ||
@@ -13,0 +13,0 @@ const messageConstructor = resolveWith; |
@@ -15,18 +15,18 @@ "use strict"; | ||
serialize(obj) { | ||
return class_transformer_1.serialize(obj); | ||
return (0, class_transformer_1.serialize)(obj); | ||
} | ||
deserialize(serialized, classConstructor) { | ||
return class_transformer_1.deserialize(classConstructor, serialized); | ||
return (0, class_transformer_1.deserialize)(classConstructor, serialized); | ||
} | ||
toPlain(obj) { | ||
return class_transformer_1.classToPlain(obj); | ||
return (0, class_transformer_1.classToPlain)(obj); | ||
} | ||
toClass(obj, classConstructor) { | ||
return class_transformer_1.plainToClass(classConstructor, obj); | ||
return (0, class_transformer_1.plainToClass)(classConstructor, obj); | ||
} | ||
}; | ||
JsonSerializer = tslib_1.__decorate([ | ||
inversify_1.injectable() | ||
(0, inversify_1.injectable)() | ||
], JsonSerializer); | ||
exports.JsonSerializer = JsonSerializer; | ||
//# sourceMappingURL=json-serializer.js.map |
@@ -32,5 +32,5 @@ "use strict"; | ||
MessageSerializer = tslib_1.__decorate([ | ||
inversify_1.injectable(), | ||
tslib_1.__param(0, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.Serializer)), | ||
tslib_1.__param(1, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.HandlerRegistry)), | ||
(0, inversify_1.injectable)(), | ||
tslib_1.__param(0, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.Serializer)), | ||
tslib_1.__param(1, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.HandlerRegistry)), | ||
tslib_1.__metadata("design:paramtypes", [Object, handler_1.HandlerRegistry]) | ||
@@ -37,0 +37,0 @@ ], MessageSerializer); |
@@ -12,5 +12,5 @@ "use strict"; | ||
DefaultBusConfiguration = tslib_1.__decorate([ | ||
inversify_1.injectable() | ||
(0, inversify_1.injectable)() | ||
], DefaultBusConfiguration); | ||
exports.DefaultBusConfiguration = DefaultBusConfiguration; | ||
//# sourceMappingURL=bus-configuration.js.map |
@@ -43,5 +43,5 @@ "use strict"; | ||
BusHooks = tslib_1.__decorate([ | ||
inversify_1.injectable() | ||
(0, inversify_1.injectable)() | ||
], BusHooks); | ||
exports.BusHooks = BusHooks; | ||
//# sourceMappingURL=bus-hooks.js.map |
@@ -10,6 +10,6 @@ import { Event, Command, MessageAttributes, Message } from '@node-ts/bus-messages'; | ||
} | ||
export declare type HookAction = 'send' | 'publish' | 'error'; | ||
export declare type StandardHookCallback = (message: Message, messageAttributes?: MessageAttributes) => Promise<void> | void; | ||
export declare type ErrorHookCallback<TransportMessageType> = (message: Message, error: Error, messageAttributes?: MessageAttributes, rawMessage?: TransportMessage<TransportMessageType>) => Promise<void> | void; | ||
export declare type HookCallback<TransportMessageType> = StandardHookCallback | ErrorHookCallback<TransportMessageType>; | ||
export type HookAction = 'send' | 'publish' | 'error'; | ||
export type StandardHookCallback = (message: Message, messageAttributes?: MessageAttributes) => Promise<void> | void; | ||
export type ErrorHookCallback<TransportMessageType> = (message: Message, error: Error, messageAttributes?: MessageAttributes, rawMessage?: TransportMessage<TransportMessageType>) => Promise<void> | void; | ||
export type HookCallback<TransportMessageType> = StandardHookCallback | ErrorHookCallback<TransportMessageType>; | ||
export interface Bus { | ||
@@ -16,0 +16,0 @@ /** |
@@ -86,3 +86,3 @@ "use strict"; | ||
while (this.runningWorkerCount > 0) { | ||
await util_1.sleep(100); | ||
await (0, util_1.sleep)(100); | ||
} | ||
@@ -149,12 +149,12 @@ this.internalState = bus_1.BusState.Stopped; | ||
ServiceBus = tslib_1.__decorate([ | ||
inversify_1.injectable(), | ||
(0, inversify_1.injectable)(), | ||
autobind_decorator_1.default, | ||
tslib_1.__param(0, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.Transport)), | ||
tslib_1.__param(1, inversify_1.inject(logger_core_1.LOGGER_SYMBOLS.Logger)), | ||
tslib_1.__param(2, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.HandlerRegistry)), | ||
tslib_1.__param(3, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.MessageHandlingContext)), | ||
tslib_1.__param(4, inversify_1.inject(bus_symbols_1.BUS_INTERNAL_SYMBOLS.BusHooks)), | ||
tslib_1.__param(5, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.BusConfiguration)), | ||
tslib_1.__param(6, inversify_1.optional()), | ||
tslib_1.__param(6, inversify_1.inject(bus_symbols_1.BUS_INTERNAL_SYMBOLS.RawMessage)), | ||
tslib_1.__param(0, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.Transport)), | ||
tslib_1.__param(1, (0, inversify_1.inject)(logger_core_1.LOGGER_SYMBOLS.Logger)), | ||
tslib_1.__param(2, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.HandlerRegistry)), | ||
tslib_1.__param(3, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.MessageHandlingContext)), | ||
tslib_1.__param(4, (0, inversify_1.inject)(bus_symbols_1.BUS_INTERNAL_SYMBOLS.BusHooks)), | ||
tslib_1.__param(5, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.BusConfiguration)), | ||
tslib_1.__param(6, (0, inversify_1.optional)()), | ||
tslib_1.__param(6, (0, inversify_1.inject)(bus_symbols_1.BUS_INTERNAL_SYMBOLS.RawMessage)), | ||
tslib_1.__metadata("design:paramtypes", [Object, Object, handler_1.HandlerRegistry, | ||
@@ -161,0 +161,0 @@ bus_messages_1.MessageAttributes, |
@@ -107,3 +107,3 @@ "use strict"; | ||
if (!isBusMessage || this.messagesWithHandlers[message.$name]) { | ||
const transportMessage = exports.toTransportMessage(message, messageOptions, false); | ||
const transportMessage = (0, exports.toTransportMessage)(message, messageOptions, false); | ||
this.queue.push(transportMessage); | ||
@@ -138,5 +138,5 @@ this.queuePushed.emit('pushed'); | ||
MemoryQueue = tslib_1.__decorate([ | ||
inversify_1.injectable(), | ||
tslib_1.__param(0, inversify_1.inject(logger_core_1.LOGGER_SYMBOLS.Logger)), | ||
tslib_1.__param(1, inversify_1.inject(bus_symbols_1.BUS_SYMBOLS.HandlerRegistry)), | ||
(0, inversify_1.injectable)(), | ||
tslib_1.__param(0, (0, inversify_1.inject)(logger_core_1.LOGGER_SYMBOLS.Logger)), | ||
tslib_1.__param(1, (0, inversify_1.inject)(bus_symbols_1.BUS_SYMBOLS.HandlerRegistry)), | ||
tslib_1.__metadata("design:paramtypes", [Object, handler_1.HandlerRegistry]) | ||
@@ -143,0 +143,0 @@ ], MemoryQueue); |
export declare function isClassConstructor(obj: object): obj is ClassConstructor<any>; | ||
export declare type ClassConstructor<TReturn> = new (...args: any[]) => TReturn; | ||
export type ClassConstructor<TReturn> = new (...args: any[]) => TReturn; |
@@ -8,7 +8,7 @@ /** | ||
*/ | ||
export declare type Next = () => void | Promise<void>; | ||
export type Next = () => void | Promise<void>; | ||
/** | ||
* A middleware | ||
*/ | ||
export declare type Middleware<T> = (context: T, next: Next) => Promise<void> | void; | ||
export type Middleware<T> = (context: T, next: Next) => Promise<void> | void; | ||
/** | ||
@@ -15,0 +15,0 @@ * A middleware container and invoker |
{ | ||
"name": "@node-ts/bus-core", | ||
"version": "0.6.10", | ||
"version": "0.6.11", | ||
"description": "A service bus for message-based, distributed node applications", | ||
@@ -16,4 +16,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@node-ts/bus-messages": "^0.3.3", | ||
"@types/node": "^14.14.31", | ||
"@node-ts/bus-messages": "^0.3.4", | ||
"autobind-decorator": "^2.4.0", | ||
@@ -33,3 +32,3 @@ "class-transformer": "^0.3.1", | ||
"typemoq": "^2.1.0", | ||
"typescript": "^4.3.5" | ||
"typescript": "^4.9.4" | ||
}, | ||
@@ -52,3 +51,3 @@ "peerDependencies": { | ||
], | ||
"gitHead": "8fe41d2fa97bd4147252685db6a0cef324eb7f22" | ||
"gitHead": "229b6fbb0cee7c101b85841cc11d6edfe667f73d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
197030
8
- Removed@types/node@^14.14.31
- Removed@types/node@14.18.63(transitive)
Updated@node-ts/bus-messages@^0.3.4