nats-hemera
Advanced tools
Comparing version 5.8.4 to 5.8.5
100
index.d.ts
/// <reference types="node" /> | ||
import * as pino from 'pino' | ||
import * as nats from 'nats' | ||
import { Stream } from 'stream' | ||
@@ -49,9 +50,39 @@ | ||
interface HemeraMessagePayload { | ||
request: Request$, | ||
meta: any, | ||
trace: Trace$, | ||
result: any, | ||
request: Request$ | ||
meta: any | ||
trace: Trace$ | ||
result: any | ||
error: Error | null | ||
} | ||
interface NatsTransport { | ||
driver(): any | ||
timeout( | ||
sid: number, | ||
timeout: number, | ||
expected: number, | ||
callback: (sid: number) => void | ||
): void | ||
send( | ||
subject: string, | ||
msg?: string | Buffer, | ||
reply?: string, | ||
callback?: Function | ||
): void | ||
close(): void | ||
flush(callback?: Function): void | ||
subscribe( | ||
subject: string, | ||
opts: nats.SubscribeOptions, | ||
callback: Function | ||
): number | ||
unsubscribe(sid: number, max?: number): void | ||
request( | ||
subject: string, | ||
msg?: string, | ||
options?: nats.SubscribeOptions, | ||
callback?: Function | ||
): number | ||
} | ||
interface Config { | ||
@@ -149,8 +180,3 @@ timeout?: number | 2000 | ||
): AddDefinition | ||
end( | ||
action: ( | ||
request: ServerPattern, | ||
cb: NodeCallback | ||
) => void | ||
): void | ||
end(action: (request: ServerPattern, cb: NodeCallback) => void): void | ||
end(action: (request: ServerPattern) => Promise<any>): void | ||
@@ -212,2 +238,4 @@ } | ||
type NoContext = null | ||
interface Request$ { | ||
@@ -256,3 +284,3 @@ id: string | ||
plugin: ( | ||
instance: Hemera<Hemera.Request, Hemera.Response>, | ||
instance: Hemera<Hemera.NoContext, Hemera.NoContext>, | ||
opts: object, | ||
@@ -265,3 +293,3 @@ callback: Hemera.NodeCallback | ||
plugin: ( | ||
instance: Hemera<Hemera.Request, Hemera.Response>, | ||
instance: Hemera<Hemera.NoContext, Hemera.NoContext>, | ||
opts: object | ||
@@ -283,3 +311,3 @@ ) => Promise<void>, | ||
dependencies?: Array<string> | ||
): Hemera<Hemera.Request, Hemera.Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
hasDecorator(name: string): Boolean | ||
@@ -291,3 +319,3 @@ | ||
dependencies?: Array<string> | ||
): Hemera<Hemera.Request, Hemera.Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
@@ -300,3 +328,3 @@ createError(name: string): any | ||
handler: (addDefinition: Hemera.AddDefinition) => void | ||
): Hemera<Hemera.Request, Hemera.Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
@@ -306,6 +334,6 @@ ext( | ||
handler: ( | ||
instance: Hemera<Hemera.Request, Hemera.Response>, | ||
instance: Hemera<Hemera.NoContext, Hemera.NoContext>, | ||
next: Hemera.NodeCallback | ||
) => void | ||
): Hemera<Hemera.Request, Hemera.Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
ext(name: 'onClose'): Promise<void> | ||
@@ -464,3 +492,3 @@ | ||
handler: ( | ||
this: Hemera<Hemera.ServerRequest, Hemera.ServerResponse>,, | ||
this: Hemera<Hemera.ServerRequest, Hemera.ServerResponse>, | ||
error: Error | ||
@@ -480,3 +508,3 @@ ) => void | ||
removeAll(): any | ||
removeAll(): void | ||
@@ -486,26 +514,26 @@ // serialization | ||
encoder: (message: Object | Buffer) => Hemera.EncoderResult | ||
): Hemera<Request, Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
setClientDecoder( | ||
encoder: (message: String | Buffer) => Hemera.DecoderResult | ||
): Hemera<Request, Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
setServerEncoder( | ||
encoder: (message: Object | Buffer) => Hemera.EncoderResult | ||
): Hemera<Request, Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
setServerDecoder( | ||
encoder: (message: String | Buffer) => Hemera.DecoderResult | ||
): Hemera<Request, Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
setSchemaCompiler( | ||
compilerFunction: (schema: Object) => Function | ||
): Hemera<Request, Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
setSchemaCompiler( | ||
compilerFunction: (schema: Object) => Promise<any> | ||
): Hemera<Request, Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
setResponseSchemaCompiler( | ||
compilerFunction: (schema: Object) => Function | ||
): Hemera<Request, Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
setResponseSchemaCompiler( | ||
compilerFunction: (schema: Object) => Promise<any> | ||
): Hemera<Request, Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
@@ -516,3 +544,3 @@ setNotFoundPattern(pattern: string | Hemera.ServerPattern | null): void | ||
generatorFunction: () => string | ||
): Hemera<Hemera.Request, Hemera.Response> | ||
): Hemera<Hemera.NoContext, Hemera.NoContext> | ||
checkPluginDependencies(plugin: Hemera.Plugin): void | ||
@@ -522,3 +550,17 @@ | ||
/** | ||
* Returns the Bloomrun instance | ||
* https://github.com/mcollina/bloomrun | ||
* | ||
* @type {*} | ||
* @memberof Hemera | ||
*/ | ||
router: any | ||
/** | ||
* Returns the load propert from heavy instance | ||
* https://github.com/hapijs/heavy | ||
* | ||
* @type {*} | ||
* @memberof Hemera | ||
*/ | ||
load: any | ||
@@ -528,3 +570,3 @@ errors: { [key: string]: Error } | ||
topics: { [key: string]: number } | ||
transport: any | ||
transport: Hemera.NatsTransport | ||
notFoundPattern: Hemera.ServerPattern | ||
@@ -531,0 +573,0 @@ |
{ | ||
"name": "nats-hemera", | ||
"author": "Dustin Deus (https://github.com/StarpTech)", | ||
"version": "5.8.4", | ||
"version": "5.8.5", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "homepage": "https://hemerajs.github.io/hemera/", |
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
83727
3208