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

@oada/client

Package Overview
Dependencies
Maintainers
8
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oada/client - npm Package Compare versions

Comparing version 2.2.2 to 2.3.0

11

dist/client.d.ts

@@ -43,3 +43,4 @@ /// <reference types="node" />

}
export interface WatchRequest {
export interface WatchRequestSingle {
type?: "single";
path: string;

@@ -50,2 +51,10 @@ rev?: string;

}
export interface WatchRequestTree {
type: "tree";
path: string;
rev?: string;
watchCallback: (response: readonly Readonly<Change>[]) => void;
timeout?: number;
}
export declare type WatchRequest = WatchRequestSingle | WatchRequestTree;
export interface PUTRequest {

@@ -52,0 +61,0 @@ path: string;

9

dist/client.js

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

let headers = {};
if (typeof (request.rev) !== 'undefined') {
if (typeof request.rev !== "undefined") {
headers["x-oada-rev"] = request.rev;

@@ -127,4 +127,9 @@ }

var _a;
if (request.type === "tree") {
request.watchCallback(resp.change);
}
for (const change of resp.change) {
request.watchCallback(change);
if (!request.type || request.type === "single") {
request.watchCallback(change);
}
if (change.path === "") {

@@ -131,0 +136,0 @@ const watchRequest = this._watchList.get(resp.requestId[0]);

@@ -48,20 +48,23 @@ "use strict";

this._status = ConnectionStatus.Connecting;
this._ws = new Promise((resolve) => {
const ws = new reconnecting_websocket_1.default("wss://" + this._domain, [], {
connectionTimeout: 30 * 1000,
WebSocket: BetterWebSocket,
});
ws.onopen = () => {
trace("Connection opened.");
this._status = ConnectionStatus.Connected;
resolve(ws);
this.emit("open");
};
ws.onclose = () => {
trace("Connection closed.");
this._status = ConnectionStatus.Disconnected;
this.emit("close");
};
ws.onmessage = this._receive.bind(this);
const ws = new reconnecting_websocket_1.default("wss://" + this._domain, [], {
connectionTimeout: 30 * 1000,
WebSocket: BetterWebSocket,
});
const openP = events_1.once(ws, "open").then(() => ws);
const errP = events_1.once(ws, "error").then((err) => Promise.reject(err));
this._ws = Promise.race([openP, errP]);
ws.onopen = () => {
trace("Connection opened.");
this._status = ConnectionStatus.Connected;
this.emit("open");
};
ws.onclose = () => {
trace("Connection closed.");
this._status = ConnectionStatus.Disconnected;
this.emit("close");
};
ws.onerror = (err) => {
trace("Connection error %O", err);
};
ws.onmessage = this._receive.bind(this);
this._q = new p_queue_1.default({ concurrency });

@@ -68,0 +71,0 @@ this._q.on("active", () => {

{
"name": "@oada/client",
"version": "2.2.2",
"version": "2.3.0",
"description": "A lightweight client tool to interact with an OADA-compliant server",

@@ -5,0 +5,0 @@ "repository": "https://github.com/OADA/client",

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