@nestjs-plugins/nestjs-nats-jetstream-transport
Advanced tools
Comparing version 1.1.2 to 1.1.3
import { ClientProxy, ReadPacket, WritePacket } from "@nestjs/microservices"; | ||
import { NatsConnection } from "nats"; | ||
import { NatsConnection, NatsError } from "nats"; | ||
import { NatsJetStreamClientOptions } from "./interfaces/nats-jetstream-client-options.interface"; | ||
@@ -11,4 +11,5 @@ export declare class NatsJetStreamClientProxy extends ClientProxy { | ||
close(): Promise<void>; | ||
serializeError(err: NatsError): NatsError; | ||
protected publish(packet: ReadPacket<any>, callback: (packet: WritePacket<any>) => void): () => void; | ||
protected dispatchEvent(packet: ReadPacket): Promise<any>; | ||
} |
@@ -36,2 +36,8 @@ "use strict"; | ||
} | ||
serializeError(err) { | ||
if (err.code === nats_1.ErrorCode.NoResponders) { | ||
err.message = "NO_RESPONDERS"; | ||
} | ||
return err; | ||
} | ||
publish(packet, callback) { | ||
@@ -44,3 +50,5 @@ const payload = this.codec.encode(packet.data); | ||
.then((packet) => callback(packet)) | ||
.catch((err) => callback({ err })); | ||
.catch((err) => { | ||
callback({ err }); | ||
}); | ||
return () => null; | ||
@@ -47,0 +55,0 @@ } |
{ | ||
"name": "@nestjs-plugins/nestjs-nats-jetstream-transport", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Nats JetStream Transport for NestJS", | ||
@@ -44,3 +44,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "868db2c55ee77af898151d4ae6700e1c461cb7df" | ||
"gitHead": "a11cbe493879a0aafc4b18c28275392bcaa602a8" | ||
} |
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
137056
381