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

nats

Package Overview
Dependencies
Maintainers
3
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nats - npm Package Compare versions

Comparing version 2.10.2 to 2.10.3

2

lib/nats-base-client/internal_mod.d.ts
export { NatsConnectionImpl } from "./nats";
export { Nuid, nuid } from "./nuid";
export { ErrorCode, isNatsError, NatsError } from "./error";
export type { AccountLimits, Advisory, ApiError, ApiPagedRequest, callbackFn, Closed, ClusterInfo, ConnectionOptions, Consumer, ConsumerAPI, ConsumerConfig, ConsumerInfo, ConsumerInfoable, ConsumerOpts, ConsumerOptsBuilder, ConsumerUpdateConfig, DeliveryInfo, Destroyable, ExternalStream, JetStreamAccountStats, JetStreamApiStats, JetStreamClient, JetStreamManager, JetStreamOptions, JetStreamPublishOptions, JetStreamPullSubscription, JetStreamSubscription, JetStreamSubscriptionOptions, JetStreamUsageAccountLimits, JsMsg, JsMsgCallback, KV, KvCodec, KvCodecs, KvEntry, KvLimits, KvOptions, KvPutOptions, KvRemove, KvStatus, KvWatchOptions, LastForMsgRequest, Lister, LostStreamData, Msg, MsgDeleteRequest, MsgRequest, Nanos, NatsConnection, ObjectInfo, ObjectResult, ObjectStore, ObjectStoreLink, ObjectStoreMeta, ObjectStoreMetaOptions, ObjectStoreOptions, ObjectStoreStatus, PeerInfo, Placement, PubAck, PublishOptions, Pullable, PullOptions, PurgeBySeq, PurgeBySubject, PurgeOpts, PurgeResponse, PurgeTrimOpts, Republish, RequestManyOptions, RequestOptions, RoKV, SeqMsgRequest, SequenceInfo, Server, ServerInfo, ServersChanged, ServiceClient, ServicesAPI, Stats, Status, StoredMsg, StreamAlternate, StreamAPI, StreamConfig, StreamInfo, StreamInfoRequestOptions, StreamNames, StreamSource, StreamSourceInfo, StreamState, StreamUpdateConfig, Sub, SubOpts, Subscription, SubscriptionOptions, TlsOptions, TypedSubscriptionOptions, Views, } from "./types";
export type { AccountLimits, Advisory, ApiError, ApiPagedRequest, callbackFn, Closed, ClusterInfo, ConnectionOptions, Consumer, ConsumerAPI, ConsumerConfig, ConsumerInfo, ConsumerInfoable, ConsumerOpts, ConsumerOptsBuilder, ConsumerUpdateConfig, DeliveryInfo, Destroyable, ExternalStream, JetStreamAccountStats, JetStreamApiStats, JetStreamClient, JetStreamManager, JetStreamOptions, JetStreamPublishOptions, JetStreamPullSubscription, JetStreamSubscription, JetStreamSubscriptionOptions, JetStreamUsageAccountLimits, JsMsg, JsMsgCallback, KV, KvCodec, KvCodecs, KvEntry, KvLimits, KvOptions, KvPutOptions, KvRemove, KvStatus, KvWatchOptions, LastForMsgRequest, Lister, LostStreamData, Msg, MsgDeleteRequest, MsgRequest, Nanos, NatsConnection, ObjectInfo, ObjectResult, ObjectStore, ObjectStoreLink, ObjectStoreMeta, ObjectStoreMetaOptions, ObjectStoreOptions, ObjectStorePutOpts, ObjectStoreStatus, PeerInfo, Placement, PubAck, PublishOptions, Pullable, PullOptions, PurgeBySeq, PurgeBySubject, PurgeOpts, PurgeResponse, PurgeTrimOpts, Republish, RequestManyOptions, RequestOptions, RoKV, SeqMsgRequest, SequenceInfo, Server, ServerInfo, ServersChanged, ServiceClient, ServicesAPI, Stats, Status, StoredMsg, StreamAlternate, StreamAPI, StreamConfig, StreamInfo, StreamInfoRequestOptions, StreamNames, StreamSource, StreamSourceInfo, StreamState, StreamUpdateConfig, Sub, SubOpts, Subscription, SubscriptionOptions, TlsOptions, TypedSubscriptionOptions, Views, } from "./types";
export { AckPolicy, AdvisoryKind, DeliverPolicy, DirectMsgHeaders, DiscardPolicy, ReplayPolicy, RepublishHeaders, RequestStrategy, RetentionPolicy, StorageType, } from "./types";

@@ -6,0 +6,0 @@ export { consumerOpts } from "./jsconsumeropts";

@@ -158,10 +158,10 @@ "use strict";

/*
* Returns available messages upto specified batch count.
* If expires is set the iterator will wait for the specified
* amount of millis before closing the subscription.
* If no_wait is specified, the iterator will return no messages.
* @param stream
* @param durable
* @param opts
*/
* Returns available messages upto specified batch count.
* If expires is set the iterator will wait for the specified
* amount of millis before closing the subscription.
* If no_wait is specified, the iterator will return no messages.
* @param stream
* @param durable
* @param opts
*/
fetch(stream, durable, opts = {}) {

@@ -168,0 +168,0 @@ var _a;

export { AckPolicy, AdvisoryKind, Bench, canonicalMIMEHeaderKey, checkJsError, consumerOpts, createInbox, credsAuthenticator, DebugEvents, deferred, DeliverPolicy, DiscardPolicy, Empty, ErrorCode, Events, headers, isFlowControlMsg, isHeartbeatMsg, JsHeaders, JSONCodec, jwtAuthenticator, Match, Metric, millis, MsgHdrsImpl, nanos, NatsError, nkeyAuthenticator, Nuid, nuid, ReplayPolicy, RequestStrategy, RetentionPolicy, ServiceError, ServiceErrorCodeHeader, ServiceErrorHeader, ServiceVerb, StorageType, StringCodec, toJsMsg, tokenAuthenticator, usernamePasswordAuthenticator, } from "./internal_mod";
export type { AccountLimits, Advisory, ApiError, ApiPagedRequest, Auth, Authenticator, BenchOpts, callbackFn, Closed, ClusterInfo, Codec, ConnectionOptions, Consumer, ConsumerAPI, ConsumerConfig, ConsumerInfo, ConsumerInfoable, ConsumerOpts, ConsumerOptsBuilder, ConsumerUpdateConfig, Deferred, DeliveryInfo, Destroyable, DirectMsgHeaders, DispatchedFn, Endpoint, EndpointStats, ExternalStream, IngestionFilterFn, IngestionFilterFnResult, JetStreamAccountStats, JetStreamApiStats, JetStreamClient, JetStreamManager, JetStreamOptions, JetStreamPublishOptions, JetStreamPullSubscription, JetStreamSubscription, JetStreamSubscriptionOptions, JetStreamUsageAccountLimits, JsMsg, JsMsgCallback, JwtAuth, KV, KvCodec, KvCodecs, KvEntry, KvLimits, KvOptions, KvPutOptions, KvStatus, KvWatchOptions, LastForMsgRequest, Lister, LostStreamData, Msg, MsgAdapter, MsgDeleteRequest, MsgHdrs, MsgRequest, Nanos, NatsConnection, NKeyAuth, NoAuth, ObjectInfo, ObjectResult, ObjectStore, ObjectStoreLink, ObjectStoreMeta, ObjectStoreMetaOptions, ObjectStoreOptions, ObjectStoreStatus, PeerInfo, Perf, Placement, ProtocolFilterFn, PubAck, PublishOptions, Pullable, PullOptions, PurgeBySeq, PurgeBySubject, PurgeOpts, PurgeResponse, PurgeTrimOpts, QueuedIterator, Republish, RepublishHeaders, RequestManyOptions, RequestOptions, RoKV, SchemaInfo, SeqMsgRequest, SequenceInfo, ServerInfo, ServersChanged, Service, ServiceClient, ServiceConfig, ServiceIdentity, ServiceInfo, ServiceMsg, ServicesAPI, ServiceSchema, ServiceStats, Stats, Status, StoredMsg, StreamAlternate, StreamAPI, StreamConfig, StreamInfo, StreamInfoRequestOptions, StreamNames, StreamSource, StreamSourceInfo, StreamState, StreamUpdateConfig, Sub, SubOpts, Subscription, SubscriptionOptions, TlsOptions, TokenAuth, TypedCallback, TypedSubscriptionOptions, UserPass, Views, } from "./internal_mod";
export type { AccountLimits, Advisory, ApiError, ApiPagedRequest, Auth, Authenticator, BenchOpts, callbackFn, Closed, ClusterInfo, Codec, ConnectionOptions, Consumer, ConsumerAPI, ConsumerConfig, ConsumerInfo, ConsumerInfoable, ConsumerOpts, ConsumerOptsBuilder, ConsumerUpdateConfig, Deferred, DeliveryInfo, Destroyable, DirectMsgHeaders, DispatchedFn, Endpoint, EndpointStats, ExternalStream, IngestionFilterFn, IngestionFilterFnResult, JetStreamAccountStats, JetStreamApiStats, JetStreamClient, JetStreamManager, JetStreamOptions, JetStreamPublishOptions, JetStreamPullSubscription, JetStreamSubscription, JetStreamSubscriptionOptions, JetStreamUsageAccountLimits, JsMsg, JsMsgCallback, JwtAuth, KV, KvCodec, KvCodecs, KvEntry, KvLimits, KvOptions, KvPutOptions, KvStatus, KvWatchOptions, LastForMsgRequest, Lister, LostStreamData, Msg, MsgAdapter, MsgDeleteRequest, MsgHdrs, MsgRequest, Nanos, NatsConnection, NKeyAuth, NoAuth, ObjectInfo, ObjectResult, ObjectStore, ObjectStoreLink, ObjectStoreMeta, ObjectStoreMetaOptions, ObjectStoreOptions, ObjectStorePutOpts, ObjectStoreStatus, PeerInfo, Perf, Placement, ProtocolFilterFn, PubAck, PublishOptions, Pullable, PullOptions, PurgeBySeq, PurgeBySubject, PurgeOpts, PurgeResponse, PurgeTrimOpts, QueuedIterator, Republish, RepublishHeaders, RequestManyOptions, RequestOptions, RoKV, SchemaInfo, SeqMsgRequest, SequenceInfo, ServerInfo, ServersChanged, Service, ServiceClient, ServiceConfig, ServiceIdentity, ServiceInfo, ServiceMsg, ServicesAPI, ServiceSchema, ServiceStats, Stats, Status, StoredMsg, StreamAlternate, StreamAPI, StreamConfig, StreamInfo, StreamInfoRequestOptions, StreamNames, StreamSource, StreamSourceInfo, StreamState, StreamUpdateConfig, Sub, SubOpts, Subscription, SubscriptionOptions, TlsOptions, TokenAuth, TypedCallback, TypedSubscriptionOptions, UserPass, Views, } from "./internal_mod";
/*
* Copyright 2016-2021 The NATS Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* Copyright 2016-2021 The NATS Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"use strict";

@@ -16,0 +16,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

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

import { JetStreamClient, JetStreamManager, ObjectInfo, ObjectResult, ObjectStore, ObjectStoreMeta, ObjectStoreMetaOptions, ObjectStoreOptions, ObjectStoreStatus, PubAck, PurgeResponse, StorageType, StreamInfo, StreamInfoRequestOptions } from "./types";
import { JetStreamClient, JetStreamManager, ObjectInfo, ObjectResult, ObjectStore, ObjectStoreMeta, ObjectStoreMetaOptions, ObjectStoreOptions, ObjectStorePutOpts, ObjectStoreStatus, PubAck, PurgeResponse, StorageType, StreamInfo, StreamInfoRequestOptions } from "./types";
import { QueuedIterator } from "./queued_iterator";

@@ -52,4 +52,4 @@ export declare const osPrefix = "OBJ_";

destroy(): Promise<boolean>;
_put(meta: ObjectStoreMeta, rs: ReadableStream<Uint8Array> | null): Promise<ObjectInfo>;
put(meta: ObjectStoreMeta, rs: ReadableStream<Uint8Array> | null): Promise<ObjectInfo>;
_put(meta: ObjectStoreMeta, rs: ReadableStream<Uint8Array> | null, opts?: ObjectStorePutOpts): Promise<ObjectInfo>;
put(meta: ObjectStoreMeta, rs: ReadableStream<Uint8Array> | null, opts?: ObjectStorePutOpts): Promise<ObjectInfo>;
get(name: string): Promise<ObjectResult | null>;

@@ -56,0 +56,0 @@ linkStore(name: string, bucket: ObjectStore): Promise<ObjectInfo>;

"use strict";
/*
* Copyright 2022 The NATS Authors
* Copyright 2022-2023 The NATS Authors
* Licensed under the Apache License, Version 2.0 (the "License");

@@ -288,6 +288,9 @@ * you may not use this file except in compliance with the License.

}
_put(meta, rs) {
_put(meta, rs, opts) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
const jsi = this.js;
opts = opts || { timeout: jsi.timeout };
opts.timeout = opts.timeout || 1000;
const { timeout } = opts;
const maxPayload = ((_a = jsi.nc.info) === null || _a === void 0 ? void 0 : _a.max_payload) || 1024;

@@ -330,3 +333,3 @@ meta = meta || {};

info.size += payload.length;
proms.push(this.js.publish(chunkSubj, payload));
proms.push(this.js.publish(chunkSubj, payload, { timeout }));
}

@@ -342,3 +345,6 @@ info.mtime = new Date().toISOString();

h.set(types_1.JsHeaders.RollupHdr, types_1.JsHeaders.RollupValueSubject);
proms.push(this.js.publish(metaSubj, (0, codec_1.JSONCodec)().encode(info), { headers: h }));
proms.push(this.js.publish(metaSubj, (0, codec_1.JSONCodec)().encode(info), {
headers: h,
timeout,
}));
// if we had this object trim it out

@@ -363,3 +369,3 @@ if (old) {

sha.update(payload);
proms.push(this.js.publish(chunkSubj, payload));
proms.push(this.js.publish(chunkSubj, payload, { timeout }));
}

@@ -377,3 +383,3 @@ }

}
put(meta, rs) {
put(meta, rs, opts) {
var _a;

@@ -383,3 +389,3 @@ if ((_a = meta === null || meta === void 0 ? void 0 : meta.options) === null || _a === void 0 ? void 0 : _a.link) {

}
return this._put(meta, rs);
return this._put(meta, rs, opts);
}

@@ -386,0 +392,0 @@ get(name) {

"use strict";
/*
* Copyright 2021 The NATS Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* Copyright 2021 The NATS Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -17,0 +17,0 @@ exports.checkUnsupportedOption = exports.checkOptions = exports.parseOptions = exports.defaultOptions = void 0;

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

.then(() => {
var _a;
this.dispatchStatus({

@@ -176,2 +177,10 @@ type: types_1.Events.Reconnect,

});
// if we are here we reconnected, but we have an authentication
// that expired, we need to clean it up, otherwise we'll queue up
// two of these, and the default for the client will be to
// close, rather than attempt again - possibly they have an
// authenticator that dynamically updates
if (((_a = this.lastError) === null || _a === void 0 ? void 0 : _a.code) === error_1.ErrorCode.AuthenticationExpired) {
this.lastError = undefined;
}
})

@@ -178,0 +187,0 @@ .catch((err) => {

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

* limitations under the License.
*
*/

@@ -29,0 +28,0 @@ const types_1 = require("./types");

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

/*
* Copyright 2020-2022 The NATS Authors
* Copyright 2020-2023 The NATS Authors
* Licensed under the Apache License, Version 2.0 (the "License");

@@ -47,3 +47,3 @@ * you may not use this file except in compliance with the License.

const dns = require("dns");
const VERSION = "2.10.2";
const VERSION = "2.10.3";
const LANG = "nats.js";

@@ -50,0 +50,0 @@ class NodeTransport {

{
"name": "nats",
"version": "2.10.2",
"version": "2.10.3",
"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.10.2 https://github.com/nats-io/nats.deno.git",
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.10.3 https://github.com/nats-io/nats.deno.git",
"fmt": "deno fmt ./src/ ./examples/ ./test/",

@@ -65,4 +65,4 @@ "prepack": "npm run clone-nbc && npm run cjs && npm run check-package && npm run build",

"devDependencies": {
"@types/node": "^18.11.0",
"ava": "^4.2.0",
"@types/node": "^18.11.18",
"ava": "^5.1.0",
"minimist": "^1.2.7",

@@ -69,0 +69,0 @@ "nats-jwt": "^0.0.3-1",

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 too big to display

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