diff --git a/package-lock.json b/package-lock.json index 857fe625..c0e9a8aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nats", - "version": "2.0.3-3", + "version": "2.0.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nats", - "version": "2.0.3-3", + "version": "2.0.6", "license": "Apache-2.0", "dependencies": { "nkeys.js": "^1.0.0-9" @@ -1832,6 +1832,15 @@ "node": ">=10" } }, + "node_modules/global-dirs/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -2027,12 +2036,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -5885,6 +5888,14 @@ "dev": true, "requires": { "ini": "2.0.0" + }, + "dependencies": { + "ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true + } } }, "globals": { @@ -6042,11 +6053,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "ini": { - "version": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, "interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", diff --git a/package.json b/package.json index a5064f03..a1661e87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nats", - "version": "2.0.4", + "version": "2.0.6", "description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system", "keywords": [ "nats", @@ -41,7 +41,7 @@ "build": "tsc", "cjs": "deno run --allow-all bin/cjs-fix-imports.ts -o nats-base-client/ ./.deps/nats.deno/nats-base-client/", "clean": "shx rm -Rf ./lib/* ./nats-base-client ./.deps", - "clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.0.4 https://github.com/nats-io/nats.deno.git", + "clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.0.6 https://github.com/nats-io/nats.deno.git", "fmt": "deno fmt ./src/ ./examples/ ./test/", "prepack": "npm run clone-nbc && npm run cjs && npm run build", "ava": "nyc ava --verbose -T 60000", diff --git a/src/node_transport.ts b/src/node_transport.ts index cc3565da..36fac388 100644 --- a/src/node_transport.ts +++ b/src/node_transport.ts @@ -33,7 +33,7 @@ import { connect as tlsConnect, TlsOptions, TLSSocket } from "tls"; const { resolve } = require("path"); const { readFile, existsSync } = require("fs"); -const VERSION = "2.0.4"; +const VERSION = "2.0.6"; const LANG = "nats.js"; export class NodeTransport implements Transport { diff --git a/test/jetstream.js b/test/jetstream.js index 7e683875..45655cf9 100644 --- a/test/jetstream.js +++ b/test/jetstream.js @@ -13,7 +13,7 @@ * limitations under the License. */ const test = require("ava"); -const { connect, Empty } = require( +const { connect, Empty, headers } = require( "../", ); const { AckPolicy } = require("../lib/nats-base-client/types"); @@ -45,8 +45,10 @@ test("jetstream - jsm", async (t) => { t.is(streams.length, 1); t.is(streams[0].config.name, "stream"); - nc.publish("hello.world"); - nc.publish("hello.world"); + const h = headers(); + h.set("xxx", "a"); + nc.publish("hello.world", Empty, { headers: h }); + nc.publish("hello.world", Empty, { headers: h }); si = await jsm.streams.info("stream"); t.is(si.state.messages, 2); @@ -84,6 +86,8 @@ test("jetstream - jsm", async (t) => { const sm = await jsm.streams.getMessage("stream", 2); t.is(sm.seq, 2); + t.truthy(sm.header); + t.is(sm.header.get("xxx"), "a"); ok = await jsm.streams.deleteMessage("stream", 1); t.is(ok, true);