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

@node-ts/bus-core

Package Overview
Dependencies
Maintainers
2
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-ts/bus-core - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

1

dist/application-bootstrap/application-bootstrap.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationBootstrap = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const logger_core_1 = require("@node-ts/logger-core");

4

dist/bus-module.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BusModule = exports.defaultSessionScopeBinder = void 0;
const inversify_1 = require("inversify");

@@ -12,5 +13,6 @@ const bus_symbols_1 = require("./bus-symbols");

const logger_core_1 = require("@node-ts/logger-core");
exports.defaultSessionScopeBinder = (bind) => {
const defaultSessionScopeBinder = (bind) => {
bind(bus_symbols_1.BUS_SYMBOLS.Bus).to(service_bus_1.ServiceBus).inSingletonScope();
};
exports.defaultSessionScopeBinder = defaultSessionScopeBinder;
class BusModule extends inversify_1.ContainerModule {

@@ -17,0 +19,0 @@ constructor() {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BUS_INTERNAL_SYMBOLS = exports.BUS_SYMBOLS = void 0;
exports.BUS_SYMBOLS = {

@@ -4,0 +5,0 @@ Transport: Symbol.for('@node-ts/bus-core/transport'),

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FailMessageOutsideHandlingContext = void 0;
class FailMessageOutsideHandlingContext extends Error {

@@ -4,0 +5,0 @@ /**

@@ -60,5 +60,5 @@ import { Message } from '@node-ts/bus-messages';

*/
readonly messageSubscriptions: HandlerResolver[];
get messageSubscriptions(): HandlerResolver[];
private bindHandlers;
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandlerRegistry = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const inversify_1 = require("inversify");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandlesMessage = void 0;
const util_1 = require("../util");

@@ -4,0 +5,0 @@ function HandlesMessage(resolveWith, topicIdentifier) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BUS_SYMBOLS = void 0;
const tslib_1 = require("tslib");
var bus_symbols_1 = require("./bus-symbols");
exports.BUS_SYMBOLS = bus_symbols_1.BUS_SYMBOLS;
Object.defineProperty(exports, "BUS_SYMBOLS", { enumerable: true, get: function () { return bus_symbols_1.BUS_SYMBOLS; } });
tslib_1.__exportStar(require("./bus-module"), exports);

@@ -7,0 +8,0 @@ tslib_1.__exportStar(require("./service-bus"), exports);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./serializer"), exports);
tslib_1.__exportStar(require("./json-serializer"), exports);
tslib_1.__exportStar(require("./message-serializer"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonSerializer = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const inversify_1 = require("inversify");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageSerializer = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const inversify_1 = require("inversify");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultBusConfiguration = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const inversify_1 = require("inversify");

@@ -16,5 +16,5 @@ import { HookCallback, HookAction, ErrorHookCallback, StandardHookCallback } from './bus';

off(action: HookAction, callback: HookCallback<TransportMessageType>): void;
readonly send: StandardHookCallback[];
readonly publish: StandardHookCallback[];
readonly error: ErrorHookCallback<TransportMessageType>[];
get send(): StandardHookCallback[];
get publish(): StandardHookCallback[];
get error(): ErrorHookCallback<TransportMessageType>[];
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BusHooks = void 0;
const tslib_1 = require("tslib");

@@ -15,11 +16,2 @@ const inversify_1 = require("inversify");

let BusHooks = class BusHooks {
/**
* A singleton repository for all hook events registered with the Bus. This persists across scope boundaries
* so that Bus instances that are scoped to a message handling context still have access to the global set
* of registered hooks
*
* @template TransportMessageType - The raw message type returned from the transport that will be passed to the hooks
* @example BusHooks<InMemoryMessage>
* @example BusHooks<SQS.Message>
*/
constructor() {

@@ -26,0 +18,0 @@ this.messageHooks = {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BusState = void 0;
var BusState;

@@ -4,0 +5,0 @@ (function (BusState) {

@@ -7,3 +7,4 @@ "use strict";

tslib_1.__exportStar(require("./bus-hooks"), exports);
tslib_1.__exportStar(require("./message-handling-context"), exports);
tslib_1.__exportStar(require("./bus-configuration"), exports);
//# sourceMappingURL=index.js.map

@@ -24,4 +24,4 @@ import { Bus, BusState } from './bus';

stop(): Promise<void>;
readonly state: BusState;
readonly runningParallelWorkerCount: number;
get state(): BusState;
get runningParallelWorkerCount(): number;
on: any;

@@ -28,0 +28,0 @@ off: any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceBus = void 0;
const tslib_1 = require("tslib");

@@ -122,3 +123,3 @@ const inversify_1 = require("inversify");

attributes: clientOptions.attributes,
stickyAttributes: Object.assign({}, clientOptions.stickyAttributes, this.messageHandlingContext.stickyAttributes)
stickyAttributes: Object.assign(Object.assign({}, clientOptions.stickyAttributes), this.messageHandlingContext.stickyAttributes)
};

@@ -137,3 +138,4 @@ return result;

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(6, inversify_1.optional()),
tslib_1.__param(6, inversify_1.inject(bus_symbols_1.BUS_INTERNAL_SYMBOLS.RawMessage)),
tslib_1.__metadata("design:paramtypes", [Object, Object, handler_1.HandlerRegistry,

@@ -140,0 +142,0 @@ bus_messages_1.MessageAttributes,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RECEIVE_TIMEOUT_MS = exports.RETRY_LIMIT = exports.MemoryQueue = void 0;
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./transport"), exports);
var memory_queue_1 = require("./memory-queue");
exports.MemoryQueue = memory_queue_1.MemoryQueue;
exports.RETRY_LIMIT = memory_queue_1.RETRY_LIMIT;
exports.RECEIVE_TIMEOUT_MS = memory_queue_1.RECEIVE_TIMEOUT_MS;
Object.defineProperty(exports, "MemoryQueue", { enumerable: true, get: function () { return memory_queue_1.MemoryQueue; } });
Object.defineProperty(exports, "RETRY_LIMIT", { enumerable: true, get: function () { return memory_queue_1.RETRY_LIMIT; } });
Object.defineProperty(exports, "RECEIVE_TIMEOUT_MS", { enumerable: true, get: function () { return memory_queue_1.RECEIVE_TIMEOUT_MS; } });
tslib_1.__exportStar(require("./transport-message"), exports);
//# sourceMappingURL=index.js.map

@@ -53,10 +53,10 @@ import { Transport } from './transport';

*/
readonly depth: number;
get depth(): number;
/**
* Gets the number of messages in the queue, excluding those in flight
*/
readonly numberMessagesVisible: number;
readonly deadLetterQueueDepth: number;
get numberMessagesVisible(): number;
get deadLetterQueueDepth(): number;
private sendToDeadLetterQueue;
}
export declare const toTransportMessage: (message: MessageType, messageAttributes: MessageAttributes<import("@node-ts/bus-messages").MessageAttributeMap, import("@node-ts/bus-messages").MessageAttributeMap>, isProcessing: boolean) => TransportMessage<InMemoryMessage>;
export declare const toTransportMessage: (message: MessageType, messageAttributes: MessageAttributes, isProcessing: boolean) => TransportMessage<InMemoryMessage>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toTransportMessage = exports.MemoryQueue = exports.RECEIVE_TIMEOUT_MS = exports.RETRY_LIMIT = void 0;
const tslib_1 = require("tslib");

@@ -75,3 +76,3 @@ const inversify_1 = require("inversify");

unsubscribeEmitter();
resolve();
resolve(undefined);
}, exports.RECEIVE_TIMEOUT_MS);

@@ -132,3 +133,3 @@ const nextMessage = getNextMessage();

async sendToDeadLetterQueue(message) {
this.deadLetterQueue.push(Object.assign({}, message, { raw: Object.assign({}, message.raw, { inFlight: false }) }));
this.deadLetterQueue.push(Object.assign(Object.assign({}, message), { raw: Object.assign(Object.assign({}, message.raw), { inFlight: false }) }));
await this.deleteMessage(message);

@@ -144,3 +145,3 @@ }

exports.MemoryQueue = MemoryQueue;
exports.toTransportMessage = (message, messageAttributes, isProcessing) => {
const toTransportMessage = (message, messageAttributes, isProcessing) => {
return {

@@ -157,2 +158,3 @@ id: undefined,

};
exports.toTransportMessage = toTransportMessage;
//# sourceMappingURL=memory-queue.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertUnreachable = void 0;
/**

@@ -4,0 +5,0 @@ * This raises transpile time errors any time the tokenizer hits this function in the code

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isClassConstructor = void 0;
// tslint:disable-next-line:no-any Valid spread args type

@@ -4,0 +5,0 @@ function isClassConstructor(obj) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sleep = void 0;
async function sleep(timeoutMs) {

@@ -4,0 +5,0 @@ return new Promise(resolve => setTimeout(resolve, timeoutMs));

{
"name": "@node-ts/bus-core",
"version": "0.6.5",
"version": "0.6.6",
"description": "A service bus for message-based, distributed node applications",

@@ -16,7 +16,6 @@ "main": "./dist/index.js",

"dependencies": {
"@node-ts/bus-messages": "^0.3.1",
"@types/node": "^12.12.39",
"@node-ts/bus-messages": "^0.3.2",
"@types/node": "^14.14.31",
"autobind-decorator": "^2.4.0",
"class-transformer": "^0.3.1",
"inversify": "^5.0.1",
"reflect-metadata": "^0.1.13",

@@ -34,7 +33,7 @@ "serialize-error": "^4.1.0",

"typemoq": "^2.1.0",
"typescript": "^3.3.3"
"typescript": "^4.3.5"
},
"peerDependencies": {
"@node-ts/logger-core": "^0.0.17",
"inversify": ">= 5.0.1"
"inversify": "^5.0.1"
},

@@ -53,3 +52,3 @@ "keywords": [

],
"gitHead": "73b0b9a89aa107f452ce31ffe25a84786aea77b9"
"gitHead": "9c29dcef5e9a60c07f1d9716598e6f64bfc024c3"
}

@@ -21,3 +21,3 @@ import { ContainerModule, interfaces } from 'inversify'

super(bind => {
bind<SessionScopeBinder>(BUS_INTERNAL_SYMBOLS.SessionScopeBinder).toConstantValue(defaultSessionScopeBinder)
bind(BUS_INTERNAL_SYMBOLS.SessionScopeBinder).toConstantValue(defaultSessionScopeBinder)
defaultSessionScopeBinder(bind)

@@ -24,0 +24,0 @@ bindLogger(bind, ServiceBus)

@@ -7,3 +7,2 @@ // tslint:disable:no-unsafe-any - Any used for mock assertions

import { Mock, It } from 'typemoq'
import { assertUnreachable } from '../util'

@@ -21,16 +20,7 @@ export class TestContainer extends Container {

* the test output.
*
* @param errorLevel The error to dispay logs for. @default 'warn'
*/
silenceLogs (errorLevel: keyof Logger = 'warn'): this {
silenceLogs (): this {
const factory = this.get<LoggerFactory>(LOGGER_SYMBOLS.LoggerFactory)
const logger = factory.build('test-logger', this)
const mockLogger = Mock.ofInstance(logger)
logsToOutput(errorLevel).forEach(level => {
mockLogger
.setup(l => l[level](It.isAnyString(), It.isAny()))
.callBase()
})
this.rebind(LOGGER_SYMBOLS.Logger).toConstantValue(mockLogger.object)

@@ -40,13 +30,1 @@ return this

}
function logsToOutput (errorLevel: keyof Logger): (keyof Logger)[] {
const levels: (keyof Logger)[] = [
'debug',
'trace',
'info',
'warn',
'error',
'fatal'
]
return levels.slice(levels.indexOf(errorLevel), levels.length)
}

@@ -110,3 +110,3 @@ import { injectable, inject } from 'inversify'

unsubscribeEmitter()
resolve()
resolve(undefined)
}, RECEIVE_TIMEOUT_MS)

@@ -113,0 +113,0 @@

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

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

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