@silenteer/natsu
Advanced tools
Comparing version 1.0.26 to 1.0.27
@@ -1,8 +0,9 @@ | ||
import type { Msg, RequestOptions, PublishOptions, SubscriptionOptions } from 'nats'; | ||
import type { NatsService, NatsRequest, NatsResponse } from '@silenteer/natsu-type'; | ||
import type { NatsConnection } from 'nats'; | ||
import type { NatsService } from '@silenteer/natsu-type'; | ||
import type { NatsInjection, NatsHandler } from './type'; | ||
declare function createNatsService<TService extends NatsService<string, unknown, unknown>, TInjection extends Record<string, unknown> = Record<string, unknown>>(client: NatsConnection): NatsInjection<TService, TInjection>["natsService"]; | ||
declare const _default: { | ||
setup: <TInjection extends Record<string, unknown> & Pick<NatsInjection<NatsService<string, unknown, unknown>, Record<string, unknown>>, "logService">>(params: { | ||
urls: string[]; | ||
injection?: TInjection; | ||
injection?: (natsService: ReturnType<typeof createNatsService>) => Promise<TInjection>; | ||
user?: string; | ||
@@ -16,10 +17,4 @@ pass?: string; | ||
register: (handlers: NatsHandler<NatsService<string, unknown, unknown>, TInjection>[]) => Promise<void>; | ||
getNatsService: () => { | ||
request: (subject: string, data?: NatsRequest<unknown>, opts?: RequestOptions) => Promise<Msg>; | ||
publish: (subject: string, data?: NatsResponse, opts?: PublishOptions) => Promise<void>; | ||
subscribe: (subject: string, opts?: SubscriptionOptions) => import("nats").Subscription; | ||
drain: () => Promise<void>; | ||
}; | ||
}; | ||
}; | ||
export default _default; |
@@ -485,3 +485,3 @@ "use strict"; | ||
handlers, | ||
injection, | ||
injection: yield injection(natsService), | ||
logLevels, | ||
@@ -491,3 +491,2 @@ }); | ||
}), | ||
getNatsService: () => natsService, | ||
}; | ||
@@ -494,0 +493,0 @@ return client; |
{ | ||
"name": "@silenteer/natsu", | ||
"version": "1.0.26", | ||
"version": "1.0.27", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "private": false, |
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
51959
725