Comparing version 2.0.0-206 to 2.0.0-209
@@ -68,3 +68,3 @@ #!/usr/bin/env node | ||
} | ||
if (m.respond(argv.e ? m.data : sc.encode(payload), {headers: 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 { |
@@ -1,2 +0,2 @@ | ||
import { ConnectionOptions } from "./types"; | ||
import type { ConnectionOptions } from "./types"; | ||
export declare type NoAuth = void; | ||
@@ -3,0 +3,0 @@ export interface TokenAuth { |
@@ -44,3 +44,3 @@ "use strict"; | ||
const a = mh.values(k); | ||
if (v.length !== (a === null || a === void 0 ? void 0 : a.length)) { | ||
if (v.length !== a.length) { | ||
return false; | ||
@@ -47,0 +47,0 @@ } |
export { NatsConnectionImpl } from "./nats"; | ||
export { Nuid, nuid } from "./nuid"; | ||
export { ErrorCode, NatsError } from "./error"; | ||
export { ConnectionOptions, DebugEvents, Empty, Events, Msg, NatsConnection, PublishOptions, RequestOptions, ServerInfo, ServersChanged, Status, Subscription, SubscriptionOptions, } from "./types"; | ||
export type { ConnectionOptions, Msg, NatsConnection, PublishOptions, RequestOptions, Server, ServerInfo, ServersChanged, Status, Subscription, SubscriptionOptions, } from "./types"; | ||
export { Events, DebugEvents, Empty, } from "./types"; | ||
export { MsgImpl, } from "./msg"; | ||
export { SubscriptionImpl, } from "./subscription"; | ||
export { Subscriptions, } from "./subscriptions"; | ||
export { Transport, setTransportFactory, } from "./transport"; | ||
export { setTransportFactory, setUrlParseFn, } from "./transport"; | ||
export type { Transport, } from "./transport"; | ||
export { Connect, ProtocolHandler, INFO, createInbox, } from "./protocol"; | ||
export { render, extractProtocolMessage, Timeout, delay, Deferred, deferred, timeout, } from "./util"; | ||
export { MsgHdrsImpl, MsgHdrs, headers, } from "./headers"; | ||
export { Heartbeat, PH } from "./heartbeats"; | ||
export type { Timeout, Deferred, } from "./util"; | ||
export { render, extractProtocolMessage, delay, deferred, timeout, } from "./util"; | ||
export type { MsgHdrs, } from "./headers"; | ||
export { MsgHdrsImpl, headers, } from "./headers"; | ||
export { Heartbeat } from "./heartbeats"; | ||
export type { PH } from "./heartbeats"; | ||
export { MuxSubscription } from "./muxsubscription"; | ||
@@ -17,9 +22,14 @@ export { DataBuffer } from "./databuffer"; | ||
export { Request } from "./request"; | ||
export { Authenticator, nkeyAuthenticator, jwtAuthenticator, credsAuthenticator, } from "./authenticator"; | ||
export { Codec, JSONCodec, StringCodec, } from "./codec"; | ||
export type { Authenticator, } from "./authenticator"; | ||
export { nkeyAuthenticator, jwtAuthenticator, credsAuthenticator, } from "./authenticator"; | ||
export type { Codec, } from "./codec"; | ||
export { JSONCodec, StringCodec, } from "./codec"; | ||
export * from "./nkeys"; | ||
export { Dispatcher, QueuedIterator, } from "./queued_iterator"; | ||
export { Kind, Parser, ParserEvent, State } from "./parser"; | ||
export type { Dispatcher, } from "./queued_iterator"; | ||
export { QueuedIterator, } from "./queued_iterator"; | ||
export type { ParserEvent } from "./parser"; | ||
export { Parser, State, Kind } from "./parser"; | ||
export { DenoBuffer, MAX_SIZE, readAll, writeAll } from "./denobuffer"; | ||
export { Bench, BenchOpts, Metric } from "./bench"; | ||
export { Bench, Metric } from "./bench"; | ||
export type { BenchOpts } from "./bench"; | ||
export { TE, TD } from "./encoders"; |
@@ -10,5 +10,6 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TD = exports.TE = exports.Metric = exports.Bench = exports.writeAll = exports.readAll = exports.MAX_SIZE = exports.DenoBuffer = exports.Kind = exports.State = exports.Parser = exports.QueuedIterator = exports.StringCodec = exports.JSONCodec = exports.credsAuthenticator = exports.jwtAuthenticator = exports.nkeyAuthenticator = exports.Request = exports.checkOptions = exports.DataBuffer = exports.MuxSubscription = exports.Heartbeat = exports.headers = exports.MsgHdrsImpl = exports.timeout = exports.deferred = exports.delay = exports.extractProtocolMessage = exports.render = exports.createInbox = exports.INFO = exports.ProtocolHandler = exports.Connect = exports.setUrlParseFn = exports.setTransportFactory = exports.Subscriptions = exports.SubscriptionImpl = exports.MsgImpl = exports.Empty = exports.DebugEvents = exports.Events = exports.NatsError = exports.ErrorCode = exports.nuid = exports.Nuid = exports.NatsConnectionImpl = void 0; | ||
var nats_1 = require("./nats"); | ||
@@ -23,5 +24,5 @@ Object.defineProperty(exports, "NatsConnectionImpl", { enumerable: true, get: function () { return nats_1.NatsConnectionImpl; } }); | ||
var types_1 = require("./types"); | ||
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return types_1.Events; } }); | ||
Object.defineProperty(exports, "DebugEvents", { enumerable: true, get: function () { return types_1.DebugEvents; } }); | ||
Object.defineProperty(exports, "Empty", { enumerable: true, get: function () { return types_1.Empty; } }); | ||
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return types_1.Events; } }); | ||
var msg_1 = require("./msg"); | ||
@@ -35,2 +36,3 @@ Object.defineProperty(exports, "MsgImpl", { enumerable: true, get: function () { return msg_1.MsgImpl; } }); | ||
Object.defineProperty(exports, "setTransportFactory", { enumerable: true, get: function () { return transport_1.setTransportFactory; } }); | ||
Object.defineProperty(exports, "setUrlParseFn", { enumerable: true, get: function () { return transport_1.setUrlParseFn; } }); | ||
var protocol_1 = require("./protocol"); | ||
@@ -71,5 +73,5 @@ Object.defineProperty(exports, "Connect", { enumerable: true, get: function () { return protocol_1.Connect; } }); | ||
var parser_1 = require("./parser"); | ||
Object.defineProperty(exports, "Kind", { enumerable: true, get: function () { return parser_1.Kind; } }); | ||
Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return parser_1.Parser; } }); | ||
Object.defineProperty(exports, "State", { enumerable: true, get: function () { return parser_1.State; } }); | ||
Object.defineProperty(exports, "Kind", { enumerable: true, get: function () { return parser_1.Kind; } }); | ||
var denobuffer_1 = require("./denobuffer"); | ||
@@ -76,0 +78,0 @@ Object.defineProperty(exports, "DenoBuffer", { enumerable: true, get: function () { return denobuffer_1.DenoBuffer; } }); |
@@ -1,1 +0,2 @@ | ||
export { Authenticator, Codec, ConnectionOptions, createInbox, credsAuthenticator, Empty, ErrorCode, Events, headers, JSONCodec, jwtAuthenticator, Msg, MsgHdrs, NatsConnection, NatsError, nkeyAuthenticator, Nuid, PublishOptions, RequestOptions, ServersChanged, Status, StringCodec, Subscription, SubscriptionOptions, } from "./internal_mod"; | ||
export { Bench, ErrorCode, NatsError, Empty, Events, createInbox, credsAuthenticator, headers, JSONCodec, jwtAuthenticator, nkeyAuthenticator, Nuid, StringCodec, } from "./internal_mod"; | ||
export type { Authenticator, Codec, ConnectionOptions, Msg, MsgHdrs, NatsConnection, PublishOptions, RequestOptions, ServersChanged, Status, Subscription, SubscriptionOptions, } from "./internal_mod"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StringCodec = exports.Nuid = exports.nkeyAuthenticator = exports.jwtAuthenticator = exports.JSONCodec = exports.headers = exports.credsAuthenticator = exports.createInbox = exports.Events = exports.Empty = exports.NatsError = exports.ErrorCode = exports.Bench = void 0; | ||
var internal_mod_1 = require("./internal_mod"); | ||
Object.defineProperty(exports, "Bench", { enumerable: true, get: function () { return internal_mod_1.Bench; } }); | ||
Object.defineProperty(exports, "ErrorCode", { enumerable: true, get: function () { return internal_mod_1.ErrorCode; } }); | ||
Object.defineProperty(exports, "NatsError", { enumerable: true, get: function () { return internal_mod_1.NatsError; } }); | ||
Object.defineProperty(exports, "Empty", { enumerable: true, get: function () { return internal_mod_1.Empty; } }); | ||
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return internal_mod_1.Events; } }); | ||
Object.defineProperty(exports, "createInbox", { enumerable: true, get: function () { return internal_mod_1.createInbox; } }); | ||
Object.defineProperty(exports, "credsAuthenticator", { enumerable: true, get: function () { return internal_mod_1.credsAuthenticator; } }); | ||
Object.defineProperty(exports, "Empty", { enumerable: true, get: function () { return internal_mod_1.Empty; } }); | ||
Object.defineProperty(exports, "ErrorCode", { enumerable: true, get: function () { return internal_mod_1.ErrorCode; } }); | ||
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return internal_mod_1.Events; } }); | ||
Object.defineProperty(exports, "headers", { enumerable: true, get: function () { return internal_mod_1.headers; } }); | ||
Object.defineProperty(exports, "JSONCodec", { enumerable: true, get: function () { return internal_mod_1.JSONCodec; } }); | ||
Object.defineProperty(exports, "jwtAuthenticator", { enumerable: true, get: function () { return internal_mod_1.jwtAuthenticator; } }); | ||
Object.defineProperty(exports, "NatsError", { enumerable: true, get: function () { return internal_mod_1.NatsError; } }); | ||
Object.defineProperty(exports, "nkeyAuthenticator", { enumerable: true, get: function () { return internal_mod_1.nkeyAuthenticator; } }); | ||
@@ -14,0 +16,0 @@ Object.defineProperty(exports, "Nuid", { enumerable: true, get: function () { return internal_mod_1.Nuid; } }); |
import { Msg } from "./types"; | ||
import { MsgHdrs } from "./headers"; | ||
import { Publisher } from "./protocol"; | ||
import { MsgArg } from "./parser"; | ||
import type { Publisher } from "./protocol"; | ||
import type { MsgArg } from "./parser"; | ||
export declare class MsgImpl implements Msg { | ||
@@ -6,0 +6,0 @@ _headers?: MsgHdrs; |
@@ -1,3 +0,3 @@ | ||
import { Request } from "./request"; | ||
import { Msg } from "./types"; | ||
import type { Request } from "./request"; | ||
import type { Msg } from "./types"; | ||
import { NatsError } from "./error"; | ||
@@ -4,0 +4,0 @@ export declare class MuxSubscription { |
@@ -1,2 +0,2 @@ | ||
import { Dispatcher } from "./queued_iterator"; | ||
import type { Dispatcher } from "./queued_iterator"; | ||
import { DenoBuffer } from "./denobuffer"; | ||
@@ -3,0 +3,0 @@ export declare enum Kind { |
@@ -6,9 +6,9 @@ import { ConnectionOptions, Status, Subscription, PublishOptions } from "./types"; | ||
import { DataBuffer } from "./databuffer"; | ||
import { Server } from "./servers"; | ||
import { ServerImpl } from "./servers"; | ||
import { Dispatcher, QueuedIterator } from "./queued_iterator"; | ||
import { MsgHdrs } from "./headers"; | ||
import type { MsgHdrs } from "./headers"; | ||
import { SubscriptionImpl } from "./subscription"; | ||
import { Subscriptions } from "./subscriptions"; | ||
import { MuxSubscription } from "./muxsubscription"; | ||
import { Request } from "./request"; | ||
import type { Request } from "./request"; | ||
import { Heartbeat } from "./heartbeats"; | ||
@@ -22,2 +22,15 @@ import { MsgArg, Parser, ParserEvent } from "./parser"; | ||
protocol: number; | ||
verbose?: boolean; | ||
pedantic?: boolean; | ||
jwt?: string; | ||
nkey?: string; | ||
sig?: string; | ||
user?: string; | ||
pass?: string; | ||
auth_token?: string; | ||
tls_required?: boolean; | ||
name?: string; | ||
lang: string; | ||
version: string; | ||
headers?: boolean; | ||
constructor(transport: { | ||
@@ -68,3 +81,3 @@ version: string; | ||
disconnected(err?: Error): Promise<void>; | ||
dial(srv: Server): Promise<void>; | ||
dial(srv: ServerImpl): Promise<void>; | ||
dialLoop(): Promise<void>; | ||
@@ -94,3 +107,3 @@ static connect(options: ConnectionOptions, publisher: Publisher): Promise<ProtocolHandler>; | ||
private selectServer; | ||
getServer(): Server | undefined; | ||
getServer(): ServerImpl | undefined; | ||
} |
@@ -60,10 +60,13 @@ "use strict"; | ||
this.protocol = 1; | ||
if (opts.noEcho) { | ||
this.echo = false; | ||
} | ||
if (opts.noResponders) { | ||
this.no_responders = true; | ||
} | ||
const creds = ((opts === null || opts === void 0 ? void 0 : opts.authenticator) ? opts.authenticator(nonce) : {}) || {}; | ||
util_1.extend(this, opts, transport, creds); | ||
this.version = transport.version; | ||
this.lang = transport.lang; | ||
this.echo = opts.noEcho ? false : undefined; | ||
this.no_responders = opts.noResponders ? true : undefined; | ||
this.verbose = opts.verbose; | ||
this.pedantic = opts.pedantic; | ||
this.tls_required = opts.tls ? true : undefined; | ||
this.name = opts.name; | ||
this.headers = opts.headers; | ||
const creds = (opts && opts.authenticator ? opts.authenticator(nonce) : {}) || {}; | ||
util_1.extend(this, creds); | ||
} | ||
@@ -170,3 +173,2 @@ } | ||
dial(srv) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -176,9 +178,9 @@ const pong = this.prepare(); | ||
try { | ||
yield this.transport.connect(srv.hostport(), this.options); | ||
yield this.transport.connect(srv, this.options); | ||
(() => __awaiter(this, void 0, void 0, function* () { | ||
var e_1, _b; | ||
var e_1, _a; | ||
try { | ||
try { | ||
for (var _c = __asyncValues(this.transport), _d; _d = yield _c.next(), !_d.done;) { | ||
const b = _d.value; | ||
for (var _b = __asyncValues(this.transport), _c; _c = yield _b.next(), !_c.done;) { | ||
const b = _c.value; | ||
this.parser.parse(b); | ||
@@ -190,3 +192,3 @@ } | ||
try { | ||
if (_d && !_d.done && (_b = _c.return)) yield _b.call(_c); | ||
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); | ||
} | ||
@@ -219,3 +221,3 @@ finally { if (e_1) throw e_1.error; } | ||
timer.cancel(); | ||
yield ((_a = this.transport) === null || _a === void 0 ? void 0 : _a.close(err)); | ||
yield this.transport.close(err); | ||
throw err; | ||
@@ -324,3 +326,5 @@ } | ||
this.info = JSON.parse(encoders_1.fastDecoder(m)); | ||
const updates = this.servers.update(this.info); | ||
const updates = this.options && this.options.ignoreClusterUpdates | ||
? undefined | ||
: this.servers.update(this.info); | ||
if (!this.infoReceived) { | ||
@@ -327,0 +331,0 @@ // send connect |
@@ -5,2 +5,3 @@ export interface Dispatcher<T> { | ||
export declare class QueuedIterator<T> implements Dispatcher<T> { | ||
inflight: number; | ||
processed: number; | ||
@@ -7,0 +8,0 @@ received: number; |
@@ -34,2 +34,3 @@ "use strict"; | ||
constructor() { | ||
this.inflight = 0; | ||
this.processed = 0; | ||
@@ -65,2 +66,3 @@ this.received = 0; // this is updated by the protocol | ||
const yields = this.yields; | ||
this.inflight = yields.length; | ||
this.yields = []; | ||
@@ -70,2 +72,3 @@ for (let i = 0; i < yields.length; i++) { | ||
yield yield __await(yields[i]); | ||
this.inflight--; | ||
} | ||
@@ -95,3 +98,3 @@ // yielding could have paused and microtask | ||
getPending() { | ||
return this.yields.length; | ||
return this.yields.length + this.inflight; | ||
} | ||
@@ -98,0 +101,0 @@ getReceived() { |
import { Deferred, Timeout } from "./util"; | ||
import { Msg, RequestOptions } from "./types"; | ||
import type { Msg, RequestOptions } from "./types"; | ||
import { NatsError } from "./error"; | ||
import { MuxSubscription } from "./muxsubscription"; | ||
import type { MuxSubscription } from "./muxsubscription"; | ||
export declare class Request { | ||
@@ -6,0 +6,0 @@ token: string; |
@@ -1,6 +0,7 @@ | ||
import { ServerInfo, ServersChanged } from "./types"; | ||
import { ServerInfo, ServersChanged, Server, URLParseFn } from "./types"; | ||
/** | ||
* @hidden | ||
*/ | ||
export declare class Server { | ||
export declare class ServerImpl implements Server { | ||
src: string; | ||
listen: string; | ||
@@ -15,7 +16,6 @@ hostname: string; | ||
toString(): string; | ||
hostport(): { | ||
hostname: string; | ||
port: number; | ||
}; | ||
} | ||
export interface ServersOptions { | ||
urlParseFn?: URLParseFn; | ||
} | ||
/** | ||
@@ -28,12 +28,12 @@ * @hidden | ||
private currentServer; | ||
constructor(randomize: boolean, listens?: string[], firstServer?: string); | ||
getCurrentServer(): Server; | ||
constructor(randomize: boolean, listens?: string[], opts?: ServersOptions); | ||
getCurrentServer(): ServerImpl; | ||
addServer(u: string, implicit?: boolean): void; | ||
selectServer(): Server | undefined; | ||
selectServer(): ServerImpl | undefined; | ||
removeCurrentServer(): void; | ||
removeServer(server: Server | undefined): void; | ||
removeServer(server: ServerImpl | undefined): void; | ||
length(): number; | ||
next(): Server | undefined; | ||
getServers(): Server[]; | ||
next(): ServerImpl | undefined; | ||
getServers(): ServerImpl[]; | ||
update(info: ServerInfo): ServersChanged; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Servers = exports.Server = void 0; | ||
exports.Servers = exports.ServerImpl = void 0; | ||
/* | ||
@@ -20,2 +20,3 @@ * Copyright 2018-2020 The NATS Authors | ||
const types_1 = require("./types"); | ||
const transport_1 = require("./transport"); | ||
const util_1 = require("./util"); | ||
@@ -25,4 +26,5 @@ /** | ||
*/ | ||
class Server { | ||
class ServerImpl { | ||
constructor(u, gossiped = false) { | ||
this.src = u; | ||
// remove any protocol that may have been provided | ||
@@ -50,7 +52,4 @@ if (u.match(/^(.*:\/\/)(.*)/m)) { | ||
} | ||
hostport() { | ||
return this; | ||
} | ||
} | ||
exports.Server = Server; | ||
exports.ServerImpl = ServerImpl; | ||
/** | ||
@@ -60,3 +59,3 @@ * @hidden | ||
class Servers { | ||
constructor(randomize, listens = [], firstServer) { | ||
constructor(randomize, listens = [], opts = {}) { | ||
this.firstSelect = true; | ||
@@ -66,3 +65,4 @@ this.servers = []; | ||
listens.forEach((hp) => { | ||
this.servers.push(new Server(hp)); | ||
hp = transport_1.urlParseFn ? transport_1.urlParseFn(hp) : hp; | ||
this.servers.push(new ServerImpl(hp)); | ||
}); | ||
@@ -73,18 +73,5 @@ if (randomize) { | ||
} | ||
if (firstServer) { | ||
let index = listens.indexOf(firstServer); | ||
if (index === -1) { | ||
this.servers.unshift(new Server(firstServer)); | ||
} | ||
else { | ||
let fs = this.servers[index]; | ||
this.servers.splice(index, 1); | ||
this.servers.unshift(fs); | ||
} | ||
if (this.servers.length === 0) { | ||
this.addServer(types_1.DEFAULT_HOSTPORT, false); | ||
} | ||
else { | ||
if (this.servers.length === 0) { | ||
this.addServer(types_1.DEFAULT_HOSTPORT, false); | ||
} | ||
} | ||
this.currentServer = this.servers[0]; | ||
@@ -96,3 +83,4 @@ } | ||
addServer(u, implicit = false) { | ||
this.servers.push(new Server(u, implicit)); | ||
u = transport_1.urlParseFn ? transport_1.urlParseFn(u) : u; | ||
this.servers.push(new ServerImpl(u, implicit)); | ||
} | ||
@@ -136,3 +124,4 @@ selectServer() { | ||
info.connect_urls.forEach((hp) => { | ||
discovered.set(hp, new Server(hp, true)); | ||
hp = transport_1.urlParseFn ? transport_1.urlParseFn(hp) : hp; | ||
discovered.set(hp, new ServerImpl(hp, true)); | ||
}); | ||
@@ -139,0 +128,0 @@ } |
import { QueuedIterator } from "./queued_iterator"; | ||
import { Base, Msg, Subscription, SubscriptionOptions } from "./types"; | ||
import type { Base, Msg, Subscription, SubscriptionOptions } from "./types"; | ||
import { Timeout } from "./util"; | ||
import { NatsError } from "./error"; | ||
import { ProtocolHandler } from "./protocol"; | ||
import type { ProtocolHandler } from "./protocol"; | ||
export declare class SubscriptionImpl extends QueuedIterator<Msg> implements Base, Subscription { | ||
@@ -7,0 +7,0 @@ sid: number; |
@@ -1,3 +0,3 @@ | ||
import { SubscriptionImpl } from "./subscription"; | ||
import { NatsError } from "./error"; | ||
import type { SubscriptionImpl } from "./subscription"; | ||
import type { NatsError } from "./error"; | ||
export declare class Subscriptions { | ||
@@ -4,0 +4,0 @@ mux: SubscriptionImpl; |
@@ -1,2 +0,4 @@ | ||
import { ConnectionOptions } from "./types"; | ||
import { ConnectionOptions, Server, URLParseFn } from "./types"; | ||
export declare let urlParseFn: URLParseFn | undefined; | ||
export declare function setUrlParseFn(fn?: URLParseFn): void; | ||
export declare function setTransportFactory(fn: TransportFactory): void; | ||
@@ -12,6 +14,3 @@ export declare function newTransport(): Transport; | ||
readonly closeError?: Error; | ||
connect(hp: { | ||
hostname: string; | ||
port: number; | ||
}, opts: ConnectionOptions): Promise<void>; | ||
connect(server: Server, opts: ConnectionOptions): Promise<void>; | ||
[Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>; | ||
@@ -18,0 +17,0 @@ isEncrypted(): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.newTransport = exports.setTransportFactory = void 0; | ||
exports.newTransport = exports.setTransportFactory = exports.setUrlParseFn = exports.urlParseFn = void 0; | ||
function setUrlParseFn(fn) { | ||
exports.urlParseFn = fn; | ||
} | ||
exports.setUrlParseFn = setUrlParseFn; | ||
let transportFactory; | ||
@@ -5,0 +9,0 @@ function setTransportFactory(fn) { |
import { NatsError } from "./error"; | ||
import { MsgHdrs } from "./headers"; | ||
import { Authenticator } from "./authenticator"; | ||
import type { MsgHdrs } from "./headers"; | ||
import type { Authenticator } from "./authenticator"; | ||
export declare const Empty: Uint8Array; | ||
@@ -73,2 +73,3 @@ export declare const Events: Readonly<{ | ||
waitOnFirstConnect?: boolean; | ||
ignoreClusterUpdates?: boolean; | ||
} | ||
@@ -124,2 +125,8 @@ export interface TlsOptions { | ||
} | ||
export interface Server { | ||
hostname: string; | ||
port: number; | ||
listen: string; | ||
src: string; | ||
} | ||
export interface ServersChanged { | ||
@@ -157,1 +164,4 @@ readonly added: string[]; | ||
} | ||
export interface URLParseFn { | ||
(u: string): string; | ||
} |
@@ -10,5 +10,6 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.connect = void 0; | ||
/* | ||
@@ -15,0 +16,0 @@ * Copyright 2020 The NATS Authors |
@@ -10,3 +10,3 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +13,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -45,3 +45,3 @@ "use strict"; | ||
const { readFile, existsSync } = require("fs"); | ||
const VERSION = "2.0.0-206"; | ||
const VERSION = "2.0.0-209"; | ||
const LANG = "nats.js"; | ||
@@ -48,0 +48,0 @@ class NodeTransport { |
{ | ||
"name": "nats", | ||
"version": "2.0.0-206", | ||
"version": "2.0.0-209", | ||
"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-5 https://github.com/nats-io/nats.deno.git", | ||
"clone-nbc": "mkdir -p ./.deps && cd ./.deps && git clone --branch=constrain-connect-opts https://github.com/nats-io/nats.deno.git", | ||
"fmt": "deno fmt ./src/ ./examples/ ./test/", | ||
@@ -56,3 +56,3 @@ "prepack": "npm run clone-nbc && npm run cjs && npm run build", | ||
"engines": { | ||
"node": ">= 8.0.0" | ||
"node": ">= 10.0.0" | ||
}, | ||
@@ -63,3 +63,3 @@ "dependencies": { | ||
"devDependencies": { | ||
"@types/node": "^14.6.0", | ||
"@types/node": "^14.11.1", | ||
"ava": "^3.11.1", | ||
@@ -69,3 +69,3 @@ "minimist": "^1.2.5", | ||
"tslint": "^6.1.3", | ||
"typescript": "^3.9.7" | ||
"typescript": "^4.0.3" | ||
}, | ||
@@ -72,0 +72,0 @@ "typings": "./index.d.ts", |
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
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
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
358286
6020
0