Comparing version 2.0.0-204 to 2.0.0-205
@@ -68,3 +68,3 @@ #!/usr/bin/env node | ||
} | ||
if (m.respond(argv.e ? m.data : sc.encode(payload), hdrs)) { | ||
if (m.respond(argv.e ? m.data : sc.encode(payload), {headers: hdrs})) { | ||
console.log(`[${sub.getProcessed()}]: ${m.reply}: ${m.data}`); | ||
@@ -71,0 +71,0 @@ } else { |
import { Msg } from "./types"; | ||
import { MsgHdrs, MsgHdrsImpl } from "./headers"; | ||
import { MsgHdrs } from "./headers"; | ||
import { Publisher } from "./protocol"; | ||
@@ -18,3 +18,6 @@ import { MsgArg } from "./parser"; | ||
get data(): Uint8Array; | ||
respond(data?: Uint8Array, headers?: MsgHdrsImpl): boolean; | ||
respond(data?: Uint8Array, opts?: { | ||
headers?: MsgHdrs; | ||
reply?: string; | ||
}): boolean; | ||
} |
@@ -60,5 +60,5 @@ "use strict"; | ||
// eslint-ignore-next-line @typescript-eslint/no-explicit-any | ||
respond(data = types_1.Empty, headers) { | ||
respond(data = types_1.Empty, opts) { | ||
if (this.reply) { | ||
this.publisher.publish(this.reply, data, { headers: headers }); | ||
this.publisher.publish(this.reply, data, opts); | ||
return true; | ||
@@ -65,0 +65,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { ConnectionOptions, Status, Subscription } from "./types"; | ||
import { ConnectionOptions, Status, Subscription, PublishOptions } from "./types"; | ||
import { Transport } from "./transport"; | ||
@@ -77,6 +77,3 @@ import { NatsError } from "./error"; | ||
sendCommand(cmd: (string | Uint8Array), ...payloads: Uint8Array[]): void; | ||
publish(subject: string, data: Uint8Array, options?: { | ||
reply?: string; | ||
headers?: MsgHdrs; | ||
}): void; | ||
publish(subject: string, data: Uint8Array, options?: PublishOptions): void; | ||
request(r: Request): Request; | ||
@@ -83,0 +80,0 @@ subscribe(s: SubscriptionImpl): Subscription; |
@@ -85,3 +85,3 @@ import { NatsError } from "./error"; | ||
headers?: MsgHdrs; | ||
respond(data?: Uint8Array, headers?: MsgHdrs): boolean; | ||
respond(data?: Uint8Array, opts?: PublishOptions): boolean; | ||
} | ||
@@ -88,0 +88,0 @@ export interface SubscriptionOptions { |
@@ -45,3 +45,3 @@ "use strict"; | ||
const { readFile, existsSync } = require("fs"); | ||
const VERSION = "2.0.0-204"; | ||
const VERSION = "2.0.0-205"; | ||
const LANG = "nats.js"; | ||
@@ -48,0 +48,0 @@ class NodeTransport { |
{ | ||
"name": "nats", | ||
"version": "2.0.0-204", | ||
"version": "2.0.0-205", | ||
"description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system", | ||
@@ -44,3 +44,3 @@ "keywords": [ | ||
"clean": "rm -Rf ./lib/* ./nats-base-client ./.deps", | ||
"clone-nbc": "mkdir -p ./.deps && cd ./.deps && git clone --branch=v1.0.0-4 https://github.com/nats-io/nats.deno.git", | ||
"clone-nbc": "mkdir -p ./.deps && cd ./.deps && git clone --branch=v1.0.0-5 https://github.com/nats-io/nats.deno.git", | ||
"fmt": "deno fmt ./src/ ./examples/ ./test/", | ||
@@ -47,0 +47,0 @@ "prepack": "npm run clone-nbc && npm run cjs && npm run build", |
@@ -14,8 +14,7 @@ # NATS.js - A [NATS](http://nats.io) client for [Node.Js](https://nodejs.org/en/) | ||
** :warning: NATS.js v2 is a preview** you can get the current development version by: | ||
** :warning: NATS.js v2 beta is a preview** you can get the current development version by: | ||
```bash | ||
npm install nats@v2' | ||
npm install nats@beta' | ||
``` | ||
The nats.js v2 client is under active development. All tests are passing. | ||
@@ -22,0 +21,0 @@ The nats.js v2 client is not API compatible with previous versions of nats.js. |
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
348589
534