@silenteer/natsu
Advanced tools
Comparing version 1.0.20 to 1.0.21
import type { NatsService } from '@silenteer/natsu-type'; | ||
import type { NatsInjection, NatsHandler } from './type'; | ||
declare const _default: { | ||
setup: <TInjection extends Pick<NatsInjection<NatsService<string, unknown, unknown>, Record<string, unknown>>, "logService">>(params: { | ||
setup: <TInjection extends Record<string, unknown> & Pick<NatsInjection<NatsService<string, unknown, unknown>, Record<string, unknown>>, "logService">>(params: { | ||
urls: string[]; | ||
injections?: TInjection; | ||
injection?: TInjection; | ||
user?: string; | ||
@@ -8,0 +8,0 @@ pass?: string; |
@@ -138,3 +138,3 @@ "use strict"; | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { | ||
const { logService, handlers, logLevels } = params; | ||
const { injection, handlers, logLevels } = params; | ||
const result = {}; | ||
@@ -146,17 +146,13 @@ for (const handler of handlers) { | ||
prefix: `[${subject}]`, | ||
logService, | ||
logService: injection.logService, | ||
logLevels, | ||
}); | ||
const injection = { | ||
subject, | ||
handler: { | ||
const registeredInjection = Object.assign(Object.assign({}, injection), { subject, handler: { | ||
validate: handler.validate, | ||
authorize: handler.authorize, | ||
handle: handler.handle, | ||
}, | ||
logService: handlerLogService, | ||
}; | ||
}, logService: handlerLogService }); | ||
const middlewares = yield loadMiddlewares({ | ||
handler, | ||
injection, | ||
injection: registeredInjection, | ||
}); | ||
@@ -166,3 +162,3 @@ result[subject] = { | ||
middlewares, | ||
injection, | ||
injection: registeredInjection, | ||
}; | ||
@@ -464,3 +460,3 @@ } | ||
setup: (params) => { | ||
const { urls, injections, user, pass, verbose, logLevels } = params; | ||
const { urls, injection, user, pass, verbose, logLevels } = params; | ||
let natsHandlers; | ||
@@ -490,3 +486,3 @@ let natsService; | ||
handlers, | ||
logService: injections === null || injections === void 0 ? void 0 : injections.logService, | ||
injection, | ||
logLevels, | ||
@@ -493,0 +489,0 @@ }); |
{ | ||
"name": "@silenteer/natsu", | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "private": false, |
Sorry, the diff of this file is not supported yet
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
72415
730