Comparing version 2.3.0 to 2.3.1-1
@@ -19,3 +19,3 @@ import type { ConnectionOptions } from "./types"; | ||
} | ||
declare type Auth = NoAuth | TokenAuth | UserPass | NKeyAuth | JwtAuth; | ||
export declare type Auth = NoAuth | TokenAuth | UserPass | NKeyAuth | JwtAuth; | ||
/** | ||
@@ -51,2 +51,1 @@ * Authenticator is an interface that returns credentials | ||
export declare function credsAuthenticator(creds: Uint8Array): Authenticator; | ||
export {}; |
@@ -27,2 +27,3 @@ import type { ConsumerOptsBuilder, Views } from "./types"; | ||
deliver: string; | ||
bind: boolean; | ||
"ordered_consumer_sequence": { | ||
@@ -29,0 +30,0 @@ "delivery_seq": number; |
@@ -266,2 +266,3 @@ "use strict"; | ||
: opts); | ||
jsi.isBind = (0, jsconsumeropts_1.isConsumerOptsBuilder)(opts) ? opts.isBind : false; | ||
jsi.flow_control = { | ||
@@ -369,2 +370,5 @@ heartbeat_count: 0, | ||
} | ||
if (jsi.isBind) { | ||
throw new Error(`unable to bind - durable consumer ${jsi.config.durable_name} doesn't exist in ${jsi.stream}`); | ||
} | ||
jsi.config = Object.assign({ | ||
@@ -371,0 +375,0 @@ deliver_policy: types_1.DeliverPolicy.All, |
@@ -11,2 +11,3 @@ import { ConsumerConfig, ConsumerOpts, ConsumerOptsBuilder, JsMsgCallback } from "./types"; | ||
qname?: string; | ||
isBind?: boolean; | ||
constructor(opts?: Partial<ConsumerConfig>); | ||
@@ -45,3 +46,4 @@ getOpts(): ConsumerOpts; | ||
orderedConsumer(): void; | ||
bind(stream: string, durable: string): void; | ||
} | ||
export declare function isConsumerOptsBuilder(o: ConsumerOptsBuilder | Partial<ConsumerOpts>): o is ConsumerOptsBuilderImpl; |
@@ -48,2 +48,3 @@ "use strict"; | ||
o.config.ack_policy = o.ordered ? types_1.AckPolicy.None : o.config.ack_policy; | ||
o.isBind = o.isBind || false; | ||
return o; | ||
@@ -155,2 +156,7 @@ } | ||
} | ||
bind(stream, durable) { | ||
this.stream = stream; | ||
this.config.durable_name = durable; | ||
this.isBind = true; | ||
} | ||
} | ||
@@ -157,0 +163,0 @@ exports.ConsumerOptsBuilderImpl = ConsumerOptsBuilderImpl; |
@@ -256,2 +256,3 @@ import { NatsError } from "./error"; | ||
debug?: boolean; | ||
isBind?: boolean; | ||
} | ||
@@ -290,2 +291,3 @@ export interface ConsumerOptsBuilder { | ||
orderedConsumer(): void; | ||
bind(stream: string, durable: string): void; | ||
} | ||
@@ -292,0 +294,0 @@ export interface Lister<T> { |
@@ -46,3 +46,3 @@ "use strict"; | ||
const dns = require("dns"); | ||
const VERSION = "2.3.0"; | ||
const VERSION = "2.3.1-1"; | ||
const LANG = "nats.js"; | ||
@@ -49,0 +49,0 @@ class NodeTransport { |
{ | ||
"name": "nats", | ||
"version": "2.3.0", | ||
"version": "2.3.1-1", | ||
"description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system", | ||
@@ -43,3 +43,3 @@ "keywords": [ | ||
"clean": "shx rm -Rf ./lib/* ./nats-base-client ./.deps", | ||
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.3.1 https://github.com/nats-io/nats.deno.git", | ||
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch main https://github.com/nats-io/nats.deno.git", | ||
"fmt": "deno fmt ./src/ ./examples/ ./test/", | ||
@@ -46,0 +46,0 @@ "prepack": "npm run clone-nbc && npm run cjs && npm run check-package && npm run build", |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
604067
9667
1