Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nats-io/nats-core

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nats-io/nats-core - npm Package Compare versions

Comparing version 3.0.0-17 to 3.0.0-18

build/src/authenticator.ts

15

lib/authenticator.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.credsAuthenticator = exports.jwtAuthenticator = exports.nkeyAuthenticator = exports.tokenAuthenticator = exports.usernamePasswordAuthenticator = exports.noAuthFn = exports.multiAuthenticator = void 0;
exports.multiAuthenticator = multiAuthenticator;
exports.noAuthFn = noAuthFn;
exports.usernamePasswordAuthenticator = usernamePasswordAuthenticator;
exports.tokenAuthenticator = tokenAuthenticator;
exports.nkeyAuthenticator = nkeyAuthenticator;
exports.jwtAuthenticator = jwtAuthenticator;
exports.credsAuthenticator = credsAuthenticator;
/*

@@ -31,3 +37,2 @@ * Copyright 2020-2023 The NATS Authors

}
exports.multiAuthenticator = multiAuthenticator;
function noAuthFn() {

@@ -38,3 +43,2 @@ return () => {

}
exports.noAuthFn = noAuthFn;
/**

@@ -53,3 +57,2 @@ * Returns a user/pass authenticator for the specified user and optional password

}
exports.usernamePasswordAuthenticator = usernamePasswordAuthenticator;
/**

@@ -66,3 +69,2 @@ * Returns a token authenticator for the specified token

}
exports.tokenAuthenticator = tokenAuthenticator;
/**

@@ -85,3 +87,2 @@ * Returns an Authenticator that returns a NKeyAuth based that uses the

}
exports.nkeyAuthenticator = nkeyAuthenticator;
/**

@@ -104,3 +105,2 @@ * Returns an Authenticator function that returns a JwtAuth.

}
exports.jwtAuthenticator = jwtAuthenticator;
/**

@@ -145,3 +145,2 @@ * Returns an Authenticator function that returns a JwtAuth.

}
exports.credsAuthenticator = credsAuthenticator;
//# sourceMappingURL=authenticator.js.map

@@ -17,3 +17,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.humanizeBytes = exports.msgThroughput = exports.throughput = exports.Bench = exports.Metric = void 0;
exports.Bench = exports.Metric = void 0;
exports.throughput = throughput;
exports.msgThroughput = msgThroughput;
exports.humanizeBytes = humanizeBytes;
const types_1 = require("./types");

@@ -349,7 +352,5 @@ const nuid_1 = require("./nuid");

}
exports.throughput = throughput;
function msgThroughput(msgs, seconds) {
return `${(Math.floor(msgs / seconds))} msgs/sec`;
}
exports.msgThroughput = msgThroughput;
function humanizeBytes(bytes, si = false) {

@@ -368,3 +369,2 @@ const base = si ? 1000 : 1024;

}
exports.humanizeBytes = humanizeBytes;
function humanizeNumber(n) {

@@ -371,0 +371,0 @@ return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");

@@ -17,3 +17,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.JSONCodec = exports.StringCodec = void 0;
exports.StringCodec = StringCodec;
exports.JSONCodec = JSONCodec;
const encoders_1 = require("./encoders");

@@ -36,3 +37,2 @@ const core_1 = require("./core");

}
exports.StringCodec = StringCodec;
/**

@@ -69,3 +69,2 @@ * Returns a {@link Codec} for encoding JavaScript object to JSON and

}
exports.JSONCodec = JSONCodec;
//# sourceMappingURL=codec.js.map

@@ -261,2 +261,3 @@ /**

debug?: boolean;
resolve?: boolean;
}>): Promise<Server[]>;

@@ -849,2 +850,9 @@ }

noAsyncTraces?: boolean;
/**
* When false, the connect function will not perform any hostname resolution. Note that
* by default this option will be true if the client supports hostname resolution.
* Note that on clients that don't supported (mainly the websocket client, setting this
* option to true, will throw an exception as this option is not available.
*/
resolve?: boolean;
}

@@ -851,0 +859,0 @@ /**

@@ -17,3 +17,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_HOST = exports.DEFAULT_PORT = exports.createInbox = exports.syncIterator = exports.RequestStrategy = exports.Match = exports.NatsError = exports.Messages = exports.isNatsError = exports.ErrorCode = exports.DebugEvents = exports.Events = void 0;
exports.DEFAULT_HOST = exports.DEFAULT_PORT = exports.RequestStrategy = exports.Match = exports.NatsError = exports.Messages = exports.ErrorCode = exports.DebugEvents = exports.Events = void 0;
exports.isNatsError = isNatsError;
exports.syncIterator = syncIterator;
exports.createInbox = createInbox;
const nuid_1 = require("./nuid");

@@ -97,3 +100,2 @@ /**

}
exports.isNatsError = isNatsError;
class Messages {

@@ -201,3 +203,2 @@ messages;

}
exports.syncIterator = syncIterator;
function createInbox(prefix = "") {

@@ -216,5 +217,4 @@ prefix = prefix || "_INBOX";

}
exports.createInbox = createInbox;
exports.DEFAULT_PORT = 4222;
exports.DEFAULT_HOST = "127.0.0.1";
//# sourceMappingURL=core.js.map
"use strict";
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeAll = exports.readAll = exports.DenoBuffer = exports.append = exports.concat = exports.MAX_SIZE = exports.assert = exports.AssertionError = void 0;
exports.DenoBuffer = exports.MAX_SIZE = exports.AssertionError = void 0;
exports.assert = assert;
exports.concat = concat;
exports.append = append;
exports.readAll = readAll;
exports.writeAll = writeAll;
// This code has been ported almost directly from Go's src/bytes/buffer.go

@@ -25,3 +30,2 @@ // Copyright 2009 The Go Authors. All rights reserved. BSD license.

}
exports.assert = assert;
// MIN_READ is the minimum ArrayBuffer size passed to a read call by

@@ -59,7 +63,5 @@ // buffer.ReadFrom. As long as the Buffer has at least MIN_READ bytes beyond

}
exports.concat = concat;
function append(origin, b) {
return concat(origin, Uint8Array.of(b));
}
exports.append = append;
class DenoBuffer {

@@ -216,3 +218,2 @@ _buf; // contents are the bytes _buf[off : len(_buf)]

}
exports.readAll = readAll;
function writeAll(w, arr) {

@@ -224,3 +225,2 @@ let nwritten = 0;

}
exports.writeAll = writeAll;
//# sourceMappingURL=denobuffer.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decode = exports.encode = exports.TD = exports.TE = exports.Empty = void 0;
exports.TD = exports.TE = exports.Empty = void 0;
exports.encode = encode;
exports.decode = decode;
/*

@@ -47,3 +49,2 @@ * Copyright 2020 The NATS Authors

}
exports.encode = encode;
function decode(a) {

@@ -55,3 +56,2 @@ if (!a || a.length === 0) {

}
exports.decode = decode;
//# sourceMappingURL=encoders.js.map

@@ -17,3 +17,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.MsgHdrsImpl = exports.headers = exports.canonicalMIMEHeaderKey = void 0;
exports.MsgHdrsImpl = void 0;
exports.canonicalMIMEHeaderKey = canonicalMIMEHeaderKey;
exports.headers = headers;
// Heavily inspired by Golang's https://golang.org/src/net/http/header.go

@@ -62,3 +64,2 @@ const encoders_1 = require("./encoders");

}
exports.canonicalMIMEHeaderKey = canonicalMIMEHeaderKey;
function headers(code = 0, description = "") {

@@ -70,3 +71,2 @@ if ((code === 0 && description !== "") || (code > 0 && description === "")) {

}
exports.headers = headers;
const HEADER = "NATS/1.0";

@@ -73,0 +73,0 @@ class MsgHdrsImpl {

@@ -5,3 +5,3 @@ export { NatsConnectionImpl } from "./nats";

export { MsgImpl } from "./msg";
export { setTransportFactory } from "./transport";
export { getResolveFn, setTransportFactory } from "./transport";
export type { Transport, TransportFactory } from "./transport";

@@ -37,3 +37,3 @@ export { Connect, INFO, ProtocolHandler } from "./protocol";

export { extractProtocolMessage, protoLen } from "./transport";
export type { ApiError, Auth, Authenticator, ConnectionOptions, Dispatcher, JwtAuth, Msg, MsgHdrs, Nanos, NatsConnection, NKeyAuth, NoAuth, Payload, Publisher, PublishOptions, QueuedIterator, Request, RequestManyOptions, RequestOptions, ReviverFn, Server, ServerInfo, ServersChanged, Stats, Status, Sub, SubOpts, Subscription, SubscriptionOptions, SyncIterator, TlsOptions, TokenAuth, UserPass, } from "./core";
export type { ApiError, Auth, Authenticator, ConnectionOptions, Dispatcher, JwtAuth, Msg, MsgCallback, MsgHdrs, Nanos, NatsConnection, NKeyAuth, NoAuth, Payload, Publisher, PublishOptions, QueuedIterator, Request, RequestManyOptions, RequestOptions, ReviverFn, Server, ServerInfo, ServersChanged, Stats, Status, Sub, SubOpts, Subscription, SubscriptionOptions, SyncIterator, TlsOptions, TokenAuth, UserPass, } from "./core";
export { createInbox, DebugEvents, ErrorCode, Events, isNatsError, Match, NatsError, RequestStrategy, syncIterator, } from "./core";

@@ -46,1 +46,2 @@ export { SubscriptionImpl, Subscriptions } from "./protocol";

export { SHA256 } from "./sha256";
export { wsconnect, wsUrlParseFn } from "./ws_transport";

@@ -17,4 +17,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.TD = exports.Metric = exports.Bench = exports.writeAll = exports.readAll = exports.MAX_SIZE = exports.DenoBuffer = exports.State = exports.Parser = exports.Kind = exports.QueuedIteratorImpl = exports.StringCodec = exports.JSONCodec = exports.usernamePasswordAuthenticator = exports.tokenAuthenticator = exports.nkeyAuthenticator = exports.jwtAuthenticator = exports.credsAuthenticator = exports.RequestOne = exports.parseOptions = exports.defaultOptions = exports.DEFAULT_MAX_RECONNECT_ATTEMPTS = exports.checkUnsupportedOption = exports.checkOptions = exports.buildAuthenticator = exports.DataBuffer = exports.MuxSubscription = exports.Heartbeat = exports.MsgHdrsImpl = exports.headers = exports.canonicalMIMEHeaderKey = exports.timeout = exports.SimpleMutex = exports.render = exports.nanos = exports.millis = exports.extend = exports.delay = exports.deferred = exports.deadline = exports.collect = exports.backoff = exports.ProtocolHandler = exports.INFO = exports.Connect = exports.setTransportFactory = exports.MsgImpl = exports.nuid = exports.Nuid = exports.NatsConnectionImpl = void 0;
exports.SHA256 = exports.Base64UrlPaddedCodec = exports.Base64UrlCodec = exports.Base64Codec = exports.Servers = exports.isIPV4OrHostname = exports.IdleHeartbeatMonitor = exports.Subscriptions = exports.SubscriptionImpl = exports.syncIterator = exports.RequestStrategy = exports.NatsError = exports.Match = exports.isNatsError = exports.Events = exports.ErrorCode = exports.DebugEvents = exports.createInbox = exports.protoLen = exports.extractProtocolMessage = exports.Empty = exports.parseSemVer = exports.Features = exports.Feature = exports.compare = exports.TypedSubscription = exports.checkFn = exports.parseIP = exports.isIP = exports.ipV4 = exports.TE = void 0;
exports.Metric = exports.Bench = exports.writeAll = exports.readAll = exports.MAX_SIZE = exports.DenoBuffer = exports.State = exports.Parser = exports.Kind = exports.QueuedIteratorImpl = exports.StringCodec = exports.JSONCodec = exports.usernamePasswordAuthenticator = exports.tokenAuthenticator = exports.nkeyAuthenticator = exports.jwtAuthenticator = exports.credsAuthenticator = exports.RequestOne = exports.parseOptions = exports.defaultOptions = exports.DEFAULT_MAX_RECONNECT_ATTEMPTS = exports.checkUnsupportedOption = exports.checkOptions = exports.buildAuthenticator = exports.DataBuffer = exports.MuxSubscription = exports.Heartbeat = exports.MsgHdrsImpl = exports.headers = exports.canonicalMIMEHeaderKey = exports.timeout = exports.SimpleMutex = exports.render = exports.nanos = exports.millis = exports.extend = exports.delay = exports.deferred = exports.deadline = exports.collect = exports.backoff = exports.ProtocolHandler = exports.INFO = exports.Connect = exports.setTransportFactory = exports.getResolveFn = exports.MsgImpl = exports.nuid = exports.Nuid = exports.NatsConnectionImpl = void 0;
exports.wsUrlParseFn = exports.wsconnect = exports.SHA256 = exports.Base64UrlPaddedCodec = exports.Base64UrlCodec = exports.Base64Codec = exports.Servers = exports.isIPV4OrHostname = exports.IdleHeartbeatMonitor = exports.Subscriptions = exports.SubscriptionImpl = exports.syncIterator = exports.RequestStrategy = exports.NatsError = exports.Match = exports.isNatsError = exports.Events = exports.ErrorCode = exports.DebugEvents = exports.createInbox = exports.protoLen = exports.extractProtocolMessage = exports.Empty = exports.parseSemVer = exports.Features = exports.Feature = exports.compare = exports.TypedSubscription = exports.checkFn = exports.parseIP = exports.isIP = exports.ipV4 = exports.TE = exports.TD = void 0;
var nats_1 = require("./nats");

@@ -28,2 +28,3 @@ Object.defineProperty(exports, "NatsConnectionImpl", { enumerable: true, get: function () { return nats_1.NatsConnectionImpl; } });

var transport_1 = require("./transport");
Object.defineProperty(exports, "getResolveFn", { enumerable: true, get: function () { return transport_1.getResolveFn; } });
Object.defineProperty(exports, "setTransportFactory", { enumerable: true, get: function () { return transport_1.setTransportFactory; } });

@@ -133,2 +134,5 @@ var protocol_1 = require("./protocol");

Object.defineProperty(exports, "SHA256", { enumerable: true, get: function () { return sha256_1.SHA256; } });
var ws_transport_1 = require("./ws_transport");
Object.defineProperty(exports, "wsconnect", { enumerable: true, get: function () { return ws_transport_1.wsconnect; } });
Object.defineProperty(exports, "wsUrlParseFn", { enumerable: true, get: function () { return ws_transport_1.wsUrlParseFn; } });
//# sourceMappingURL=internal_mod.js.map

@@ -17,3 +17,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.parseIP = exports.isIP = exports.ipV4 = void 0;
exports.ipV4 = ipV4;
exports.isIP = isIP;
exports.parseIP = parseIP;
// JavaScript port of go net/ip/ParseIP

@@ -45,7 +47,5 @@ // https://github.com/golang/go/blob/master/src/net/ip.go

}
exports.ipV4 = ipV4;
function isIP(h) {
return parseIP(h) !== undefined;
}
exports.isIP = isIP;
function parseIP(h) {

@@ -62,3 +62,2 @@ for (let i = 0; i < h.length; i++) {

}
exports.parseIP = parseIP;
function parseIPv4(s) {

@@ -65,0 +64,0 @@ const ip = new Uint8Array(IPv4LEN);

@@ -1,2 +0,2 @@

export { backoff, Bench, buildAuthenticator, canonicalMIMEHeaderKey, createInbox, credsAuthenticator, deadline, DebugEvents, deferred, delay, Empty, ErrorCode, Events, headers, JSONCodec, jwtAuthenticator, Match, Metric, millis, MsgHdrsImpl, nanos, NatsError, nkeyAuthenticator, nkeys, Nuid, nuid, RequestStrategy, StringCodec, syncIterator, tokenAuthenticator, usernamePasswordAuthenticator, } from "./internal_mod";
export type { ApiError, Auth, Authenticator, Backoff, BenchOpts, Codec, ConnectionOptions, Deferred, Delay, DispatchedFn, IngestionFilterFn, IngestionFilterFnResult, JwtAuth, Msg, MsgAdapter, MsgHdrs, Nanos, NatsConnection, NKeyAuth, NoAuth, Payload, Perf, ProtocolFilterFn, Publisher, PublishOptions, QueuedIterator, RequestManyOptions, RequestOptions, ReviverFn, ServerInfo, ServersChanged, Stats, Status, Sub, SubOpts, Subscription, SubscriptionOptions, SyncIterator, Timeout, TlsOptions, TokenAuth, TypedCallback, TypedSubscriptionOptions, UserPass, } from "./internal_mod";
export { backoff, Bench, buildAuthenticator, canonicalMIMEHeaderKey, createInbox, credsAuthenticator, deadline, DebugEvents, deferred, delay, Empty, ErrorCode, Events, headers, JSONCodec, jwtAuthenticator, Match, Metric, millis, MsgHdrsImpl, nanos, NatsError, nkeyAuthenticator, nkeys, Nuid, nuid, RequestStrategy, StringCodec, syncIterator, tokenAuthenticator, usernamePasswordAuthenticator, wsconnect, } from "./internal_mod";
export type { ApiError, Auth, Authenticator, Backoff, BenchOpts, Codec, ConnectionOptions, Deferred, Delay, DispatchedFn, IngestionFilterFn, IngestionFilterFnResult, JwtAuth, Msg, MsgAdapter, MsgCallback, MsgHdrs, Nanos, NatsConnection, NKeyAuth, NoAuth, Payload, Perf, ProtocolFilterFn, Publisher, PublishOptions, QueuedIterator, RequestManyOptions, RequestOptions, ReviverFn, ServerInfo, ServersChanged, Stats, Status, Sub, SubOpts, Subscription, SubscriptionOptions, SyncIterator, Timeout, TlsOptions, TokenAuth, TypedCallback, TypedSubscriptionOptions, UserPass, } from "./internal_mod";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usernamePasswordAuthenticator = exports.tokenAuthenticator = exports.syncIterator = exports.StringCodec = exports.RequestStrategy = exports.nuid = exports.Nuid = exports.nkeys = exports.nkeyAuthenticator = exports.NatsError = exports.nanos = exports.MsgHdrsImpl = exports.millis = exports.Metric = exports.Match = exports.jwtAuthenticator = exports.JSONCodec = exports.headers = exports.Events = exports.ErrorCode = exports.Empty = exports.delay = exports.deferred = exports.DebugEvents = exports.deadline = exports.credsAuthenticator = exports.createInbox = exports.canonicalMIMEHeaderKey = exports.buildAuthenticator = exports.Bench = exports.backoff = void 0;
exports.wsconnect = exports.usernamePasswordAuthenticator = exports.tokenAuthenticator = exports.syncIterator = exports.StringCodec = exports.RequestStrategy = exports.nuid = exports.Nuid = exports.nkeys = exports.nkeyAuthenticator = exports.NatsError = exports.nanos = exports.MsgHdrsImpl = exports.millis = exports.Metric = exports.Match = exports.jwtAuthenticator = exports.JSONCodec = exports.headers = exports.Events = exports.ErrorCode = exports.Empty = exports.delay = exports.deferred = exports.DebugEvents = exports.deadline = exports.credsAuthenticator = exports.createInbox = exports.canonicalMIMEHeaderKey = exports.buildAuthenticator = exports.Bench = exports.backoff = void 0;
var internal_mod_1 = require("./internal_mod");

@@ -36,2 +36,3 @@ Object.defineProperty(exports, "backoff", { enumerable: true, get: function () { return internal_mod_1.backoff; } });

Object.defineProperty(exports, "usernamePasswordAuthenticator", { enumerable: true, get: function () { return internal_mod_1.usernamePasswordAuthenticator; } });
Object.defineProperty(exports, "wsconnect", { enumerable: true, get: function () { return internal_mod_1.wsconnect; } });
//# sourceMappingURL=mod.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MsgImpl = exports.isRequestError = void 0;
exports.MsgImpl = void 0;
exports.isRequestError = isRequestError;
/*

@@ -31,3 +32,2 @@ * Copyright 2020-2024 The NATS Authors

}
exports.isRequestError = isRequestError;
class MsgImpl {

@@ -34,0 +34,0 @@ _headers;

@@ -205,2 +205,3 @@ "use strict";

});
sub.requestSubject = subject;
sub.closed

@@ -305,2 +306,3 @@ .then(() => {

}
sub.unsubscribe();
d.reject(err);

@@ -307,0 +309,0 @@ }

@@ -1,1 +0,1 @@

export * as nkeys from "nkeys.js";
export * as nkeys from "@nats-io/nkeys";

@@ -27,3 +27,3 @@ "use strict";

exports.nkeys = void 0;
exports.nkeys = __importStar(require("nkeys.js"));
exports.nkeys = __importStar(require("@nats-io/nkeys"));
//# sourceMappingURL=nkeys.js.map

@@ -1,1 +0,1 @@

export { Nuid, nuid } from "nuid";
export { Nuid, nuid } from "@nats-io/nuid";

@@ -18,5 +18,5 @@ "use strict";

exports.nuid = exports.Nuid = void 0;
var nuid_1 = require("nuid");
var nuid_1 = require("@nats-io/nuid");
Object.defineProperty(exports, "Nuid", { enumerable: true, get: function () { return nuid_1.Nuid; } });
Object.defineProperty(exports, "nuid", { enumerable: true, get: function () { return nuid_1.nuid; } });
//# sourceMappingURL=nuid.js.map

@@ -17,3 +17,8 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.checkUnsupportedOption = exports.checkOptions = exports.parseOptions = exports.buildAuthenticator = exports.defaultOptions = exports.DEFAULT_RECONNECT_TIME_WAIT = exports.DEFAULT_MAX_PING_OUT = exports.DEFAULT_PING_INTERVAL = exports.DEFAULT_JITTER_TLS = exports.DEFAULT_JITTER = exports.DEFAULT_MAX_RECONNECT_ATTEMPTS = void 0;
exports.DEFAULT_RECONNECT_TIME_WAIT = exports.DEFAULT_MAX_PING_OUT = exports.DEFAULT_PING_INTERVAL = exports.DEFAULT_JITTER_TLS = exports.DEFAULT_JITTER = exports.DEFAULT_MAX_RECONNECT_ATTEMPTS = void 0;
exports.defaultOptions = defaultOptions;
exports.buildAuthenticator = buildAuthenticator;
exports.parseOptions = parseOptions;
exports.checkOptions = checkOptions;
exports.checkUnsupportedOption = checkUnsupportedOption;
const util_1 = require("./util");

@@ -48,3 +53,2 @@ const transport_1 = require("./transport");

}
exports.defaultOptions = defaultOptions;
function buildAuthenticator(opts) {

@@ -69,3 +73,2 @@ const buf = [];

}
exports.buildAuthenticator = buildAuthenticator;
function parseOptions(opts) {

@@ -114,2 +117,7 @@ const dhp = `${core_1.DEFAULT_HOST}:${(0, transport_1.defaultPort)()}`;

}
// if not set - we set it
if (options.resolve === undefined) {
// set a default based on whether the client can resolve or not
options.resolve = typeof (0, transport_1.getResolveFn)() === "function";
}
if (options.resolve) {

@@ -122,3 +130,2 @@ if (typeof (0, transport_1.getResolveFn)() !== "function") {

}
exports.parseOptions = parseOptions;
function checkOptions(info, options) {

@@ -134,3 +141,2 @@ const { proto, tls_required: tlsRequired, tls_available: tlsAvailable } = info;

}
exports.checkOptions = checkOptions;
function checkUnsupportedOption(prop, v) {

@@ -141,3 +147,2 @@ if (v) {

}
exports.checkUnsupportedOption = checkUnsupportedOption;
//# sourceMappingURL=options.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.State = exports.Parser = exports.describe = exports.Kind = void 0;
exports.State = exports.Parser = exports.Kind = void 0;
exports.describe = describe;
// deno-lint-ignore-file no-undef

@@ -56,3 +57,2 @@ /*

}
exports.describe = describe;
function newMsgArg() {

@@ -59,0 +59,0 @@ const ma = {};

@@ -494,2 +494,3 @@ "use strict";

async _doDial(srv) {
const { resolve } = this.options;
const alts = await srv.resolve({

@@ -499,2 +500,3 @@ fn: (0, transport_1.getResolveFn)(),

randomize: !this.options.noRandomize,
resolve,
});

@@ -501,0 +503,0 @@ let lastErr = null;

import type { Deferred } from "./util";
import type { QueuedIterator } from "./core";
import { CallbackFn, Dispatcher } from "./core";
import type { CallbackFn, Dispatcher } from "./core";
export type IngestionFilterFnResult = {

@@ -5,0 +5,0 @@ ingest: boolean;

@@ -17,3 +17,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Features = exports.Feature = exports.compare = exports.parseSemVer = void 0;
exports.Features = exports.Feature = void 0;
exports.parseSemVer = parseSemVer;
exports.compare = compare;
function parseSemVer(s = "") {

@@ -30,3 +32,2 @@ const m = s.match(/(\d+).(\d+).(\d+)/);

}
exports.parseSemVer = parseSemVer;
function compare(a, b) {

@@ -47,3 +48,2 @@ if (a.major < b.major)

}
exports.compare = compare;
var Feature;

@@ -50,0 +50,0 @@ (function (Feature) {

@@ -28,3 +28,3 @@ import type { DnsResolveFn, Server, ServerInfo, ServersChanged } from "./core";

resolve: boolean;
debug?: boolean;
debug: boolean;
}>): Promise<Server[]>;

@@ -31,0 +31,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Servers = exports.ServerImpl = exports.hostPort = exports.isIPV4OrHostname = void 0;
exports.Servers = exports.ServerImpl = void 0;
exports.isIPV4OrHostname = isIPV4OrHostname;
exports.hostPort = hostPort;
/*

@@ -35,3 +37,2 @@ * Copyright 2018-2024 The NATS Authors

}
exports.isIPV4OrHostname = isIPV4OrHostname;
function isIPV6(hp) {

@@ -88,3 +89,2 @@ return !isIPV4OrHostname(hp);

}
exports.hostPort = hostPort;
/**

@@ -120,4 +120,5 @@ * @hidden

async resolve(opts) {
if (!opts.fn) {
if (!opts.fn || opts.resolve === false) {
// we cannot resolve - transport doesn't support it
// or user opted out
// don't add - to resolves or we get a circ reference

@@ -124,0 +125,0 @@ return [this];

@@ -6,3 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.sha256 = exports.SHA256 = exports.BYTES = void 0;
exports.SHA256 = exports.BYTES = void 0;
exports.sha256 = sha256;
// deno bundle https://deno.land/x/sha256@v1.0.2/mod.ts

@@ -371,3 +372,2 @@ // The MIT License (MIT)

}
exports.sha256 = sha256;
//# sourceMappingURL=sha256.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractProtocolMessage = exports.protoLen = exports.LF = exports.CR = exports.CRLF = exports.CR_LF_LEN = exports.CR_LF = exports.getResolveFn = exports.newTransport = exports.getUrlParseFn = exports.defaultPort = exports.setTransportFactory = void 0;
exports.LF = exports.CR = exports.CRLF = exports.CR_LF_LEN = exports.CR_LF = void 0;
exports.setTransportFactory = setTransportFactory;
exports.defaultPort = defaultPort;
exports.getUrlParseFn = getUrlParseFn;
exports.newTransport = newTransport;
exports.getResolveFn = getResolveFn;
exports.protoLen = protoLen;
exports.extractProtocolMessage = extractProtocolMessage;
/*

@@ -25,3 +32,2 @@ * Copyright 2020-2024 The NATS Authors

}
exports.setTransportFactory = setTransportFactory;
function defaultPort() {

@@ -33,3 +39,2 @@ return transportConfig !== undefined &&

}
exports.defaultPort = defaultPort;
function getUrlParseFn() {

@@ -40,3 +45,2 @@ return transportConfig !== undefined && transportConfig.urlParseFn

}
exports.getUrlParseFn = getUrlParseFn;
function newTransport() {

@@ -48,3 +52,2 @@ if (!transportConfig || typeof transportConfig.factory !== "function") {

}
exports.newTransport = newTransport;
function getResolveFn() {

@@ -55,3 +58,2 @@ return transportConfig !== undefined && transportConfig.dnsResolveFn

}
exports.getResolveFn = getResolveFn;
exports.CR_LF = "\r\n";

@@ -71,3 +73,2 @@ exports.CR_LF_LEN = exports.CR_LF.length;

}
exports.protoLen = protoLen;
function extractProtocolMessage(a) {

@@ -83,3 +84,2 @@ // protocol messages are ascii, so Uint8Array

}
exports.extractProtocolMessage = extractProtocolMessage;
//# sourceMappingURL=transport.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypedSubscription = exports.checkFn = void 0;
exports.TypedSubscription = void 0;
exports.checkFn = checkFn;
const util_1 = require("./util");

@@ -15,3 +16,2 @@ const queued_iterator_1 = require("./queued_iterator");

}
exports.checkFn = checkFn;
/**

@@ -18,0 +18,0 @@ * TypedSubscription wraps a subscription to provide payload specific

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.millis = exports.nanos = exports.backoff = exports.jitter = exports.SimpleMutex = exports.Perf = exports.collect = exports.shuffle = exports.debugDeferred = exports.deferred = exports.deadline = exports.delay = exports.timeout = exports.render = exports.extend = void 0;
exports.SimpleMutex = exports.Perf = void 0;
exports.extend = extend;
exports.render = render;
exports.timeout = timeout;
exports.delay = delay;
exports.deadline = deadline;
exports.deferred = deferred;
exports.debugDeferred = debugDeferred;
exports.shuffle = shuffle;
exports.collect = collect;
exports.jitter = jitter;
exports.backoff = backoff;
exports.nanos = nanos;
exports.millis = millis;
/*

@@ -30,3 +43,2 @@ * Copyright 2018-2024 The NATS Authors

}
exports.extend = extend;
function render(frame) {

@@ -39,3 +51,2 @@ const cr = "␍";

}
exports.render = render;
function timeout(ms, asyncTraces = true) {

@@ -66,3 +77,2 @@ // by generating the stack here to help identify what timed out

}
exports.timeout = timeout;
function delay(ms = 0) {

@@ -83,3 +93,2 @@ let methods;

}
exports.delay = delay;
function deadline(p, millis = 1000) {

@@ -91,3 +100,2 @@ const err = new Error(`deadline exceeded`);

}
exports.deadline = deadline;
/**

@@ -104,3 +112,2 @@ * Returns a Promise that has a resolve/reject methods that can

}
exports.deferred = deferred;
function debugDeferred() {

@@ -122,3 +129,2 @@ let methods = {};

}
exports.debugDeferred = debugDeferred;
function shuffle(a) {

@@ -131,3 +137,2 @@ for (let i = a.length - 1; i > 0; i--) {

}
exports.shuffle = shuffle;
async function collect(iter) {

@@ -140,3 +145,2 @@ const buf = [];

}
exports.collect = collect;
class Perf {

@@ -222,3 +226,2 @@ timers;

}
exports.jitter = jitter;
/**

@@ -239,3 +242,2 @@ * Returns a Backoff with the specified interval policy set.

}
exports.backoff = backoff;
/**

@@ -248,3 +250,2 @@ * Converts the specified millis into Nanos

}
exports.nanos = nanos;
/**

@@ -257,3 +258,2 @@ * Convert the specified Nanos into millis

}
exports.millis = millis;
//# sourceMappingURL=util.js.map
{
"name": "@nats-io/nats-core",
"version": "3.0.0-17",
"version": "3.0.0-18",
"files": [
"lib/"
"lib/",
"build/src/"
],

@@ -15,7 +16,7 @@ "types": "./lib/mod.d.js",

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "shx rm -Rf ./lib ./cjs",
"pre-process": "npm run clean && deno run -A bin/cjs-fix-imports.ts -o ./cjs ./src",
"clean": "shx rm -Rf ./build ./lib",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./build/src ./src",
"build-cjs": "npm run pre-process && tsc",
"build": "npm run build-cjs",
"doc": "npm run build && node_modules/.bin/typedoc --out ../docs/core && touch ../docs/core/.nojekyll",
"prepack": "npm run build"

@@ -29,4 +30,8 @@ },

"dependencies": {
"nkeys.js": "^1.2.0-4",
"nuid": "^2.0.1-2",
"@nats-io/nkeys": "1.2.0-4",
"@nats-io/nuid": "2.0.1-2"
},
"devDependencies": {
"@types/node": "^20.11.30",
"typedoc": "^0.25.12",
"shx": "^0.3.4",

@@ -33,0 +38,0 @@ "typescript": "^5.4.5"

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

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc