New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More →

@interval/sdk

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interval/sdk - npm Package Compare versions

Comparing version

to
1.4.2-noisy

@@ -52,3 +52,2 @@ import type { WebSocket as NodeWebSocket, MessageEvent as NodeWSMessageEvent } from 'ws';

private timeouts;
private isClosed;
onMessage: Evt<string>;

@@ -71,2 +70,3 @@ onOpen: Evt<void>;

confirmAuthentication(): Promise<void>;
get isOpen(): boolean;
/** Both **/

@@ -73,0 +73,0 @@ /**

@@ -71,9 +71,13 @@ "use strict";

set onopen(cb) {
const handleOpen = () => {
__classPrivateFieldSet(this, _DataChannelSocket_readyState, 'open', "f");
cb();
};
if ('onOpen' in this.dc) {
// node
this.dc.onOpen(cb);
this.dc.onOpen(handleOpen);
}
else {
// web
this.dc.onopen = cb;
this.dc.onopen = handleOpen;
}

@@ -157,3 +161,2 @@ }

var _a, _b, _c;
this.isClosed = false;
this.pendingMessages = new Map();

@@ -173,3 +176,2 @@ this.onMessage = new evt_1.Evt();

this.onClose.attach(() => {
this.isClosed = true;
for (const timeout of this.timeouts) {

@@ -181,3 +183,2 @@ clearTimeout(timeout);

this.ws.onopen = () => {
this.isClosed = false;
this.onOpen.post();

@@ -198,3 +199,3 @@ };

}
if (this.isClosed)
if (!this.isOpen)
return;

@@ -248,3 +249,3 @@ const data = JSON.parse(evt.data.toString());

return new Promise((resolve, reject) => {
if (this.ws.readyState === this.ws.OPEN && this.isAuthenticated) {
if (this.isOpen && this.isAuthenticated) {
return resolve();

@@ -265,2 +266,5 @@ }

}
get isOpen() {
return this.ws.readyState === this.ws.OPEN;
}
/** Both **/

@@ -272,3 +276,3 @@ /**

async send(data, options = {}) {
if (this.isClosed)
if (!this.isOpen)
throw new NotConnectedError();

@@ -299,3 +303,2 @@ return new Promise((resolve, reject) => {

close(code, reason) {
this.isClosed = true;
this.onMessage.detach();

@@ -316,3 +319,3 @@ return this.ws.close(code, reason);

async ping() {
if (this.isClosed)
if (!this.isOpen)
throw new NotConnectedError();

@@ -319,0 +322,0 @@ const ws = this.ws;

@@ -23,2 +23,3 @@ import Routes from './classes/Routes';

logLevel?: LogLevel;
verboseMessageLogs?: boolean;
retryIntervalMs?: number;

@@ -25,0 +26,0 @@ retryChunkIntervalMs?: number;

{
"name": "@interval/sdk",
"version": "1.4.1",
"version": "1.4.2-noisy",
"description": "The frontendless framework for high growth companies. Interval automatically generates apps by inlining the UI in your backend code. It's a faster and more maintainable way to build internal tools, rapid prototypes, and more.",

@@ -5,0 +5,0 @@ "homepage": "https://interval.com",

Sorry, the diff of this file is too big to display