@blaxel/core 0.2.49-dev.212 → 0.2.49-dev.213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/common/settings.js +2 -2
- package/dist/cjs/sandbox/process/process-ws.js +1 -1
- package/dist/cjs/sandbox/websocket/client.js +3 -9
- package/dist/cjs/types/sandbox/websocket/client.d.ts +0 -1
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/common/settings.js +2 -2
- package/dist/cjs-browser/sandbox/process/process-ws.js +1 -1
- package/dist/cjs-browser/sandbox/websocket/client.js +3 -9
- package/dist/cjs-browser/types/sandbox/websocket/client.d.ts +0 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/common/settings.js +2 -2
- package/dist/esm/sandbox/process/process-ws.js +1 -1
- package/dist/esm/sandbox/websocket/client.js +3 -9
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/common/settings.js +2 -2
- package/dist/esm-browser/sandbox/process/process-ws.js +1 -1
- package/dist/esm-browser/sandbox/websocket/client.js +3 -9
- package/package.json +2 -2
|
@@ -107,7 +107,7 @@ export class SandboxProcessWebSocket extends SandboxAction {
|
|
|
107
107
|
}
|
|
108
108
|
async list() {
|
|
109
109
|
const data = await this.wsClient.send("process:list", {});
|
|
110
|
-
return data;
|
|
110
|
+
return data.processes || [];
|
|
111
111
|
}
|
|
112
112
|
async stop(identifier) {
|
|
113
113
|
const data = await this.wsClient.send("process:stop", { identifier });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from "uuid";
|
|
2
2
|
import { getWebSocket } from "../../common/node.js";
|
|
3
|
+
import { settings } from "../../common/settings.js";
|
|
3
4
|
export class WebSocketClient {
|
|
4
5
|
ws = null;
|
|
5
6
|
WebSocketClass = null;
|
|
6
7
|
url;
|
|
7
|
-
headers;
|
|
8
8
|
reconnect;
|
|
9
9
|
reconnectInterval;
|
|
10
10
|
maxReconnectAttempts;
|
|
@@ -18,7 +18,6 @@ export class WebSocketClient {
|
|
|
18
18
|
lastPongReceived = Date.now();
|
|
19
19
|
constructor(options) {
|
|
20
20
|
this.url = options.url;
|
|
21
|
-
this.headers = options.headers || {};
|
|
22
21
|
this.reconnect = options.reconnect ?? true;
|
|
23
22
|
this.reconnectInterval = options.reconnectInterval ?? 5000;
|
|
24
23
|
this.maxReconnectAttempts = options.maxReconnectAttempts ?? 5;
|
|
@@ -52,14 +51,9 @@ export class WebSocketClient {
|
|
|
52
51
|
if (!wsUrl.endsWith("/ws")) {
|
|
53
52
|
wsUrl = `${wsUrl}/ws`;
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
const wsOptions = {};
|
|
57
|
-
if (Object.keys(this.headers).length > 0) {
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
59
|
-
wsOptions.headers = this.headers;
|
|
60
|
-
}
|
|
54
|
+
wsUrl = `${wsUrl}?token=${settings.token}`;
|
|
61
55
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
|
62
|
-
this.ws = new this.WebSocketClass(wsUrl
|
|
56
|
+
this.ws = new this.WebSocketClass(wsUrl);
|
|
63
57
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
64
58
|
this.ws.onopen = () => {
|
|
65
59
|
this.reconnectAttempts = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaxel/core",
|
|
3
|
-
"version": "0.2.49-dev.
|
|
3
|
+
"version": "0.2.49-dev.213",
|
|
4
4
|
"description": "Blaxel Core SDK for TypeScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Blaxel, INC (https://blaxel.ai)",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"vite": "^5.2.0",
|
|
75
75
|
"vitest": "^1.5.0"
|
|
76
76
|
},
|
|
77
|
-
"commit": "
|
|
77
|
+
"commit": "6b51b11f0b2030cfdcd965e446466b79a79707f5",
|
|
78
78
|
"scripts": {
|
|
79
79
|
"lint": "eslint src/",
|
|
80
80
|
"dev": "tsc --watch",
|