@codebolt/codeboltjs 1.1.61 → 1.1.63

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.
@@ -96,9 +96,9 @@ const cbterminal = {
96
96
  websocket_1.default.getWebsocket.on('message', (data) => {
97
97
  const response = JSON.parse(data);
98
98
  console.log("Received message:", response);
99
- if (response.type === "commandOutput" || response.type === "commandError" || response.type === "commandFinish")
100
- // Emit a custom event based on the message type
101
- this.eventEmitter.emit("serverEvents", response.response);
99
+ if (response.type === "commandOutput" || response.type === "commandError" || response.type === "commandFinish") {
100
+ this.eventEmitter.emit(response.type, response);
101
+ }
102
102
  });
103
103
  // Return an object that includes the event emitter and the stopProcess method
104
104
  return this.eventEmitter;
@@ -17,7 +17,7 @@ class cbws {
17
17
  const uniqueConnectionId = this.getUniqueConnectionId();
18
18
  const initialMessage = this.getInitialMessage();
19
19
  console.log(uniqueConnectionId);
20
- this.websocket = new ws_1.default(`ws://localhost:12345/codebolt?id=${uniqueConnectionId}`);
20
+ this.websocket = new ws_1.default(`ws://localhost:${process.env.SOCKET_PORT}/codebolt?id=${uniqueConnectionId}`);
21
21
  this.initializeWebSocket(initialMessage).catch(error => {
22
22
  console.error("WebSocket connection failed:", error);
23
23
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/codeboltjs",
3
- "version": "1.1.61",
3
+ "version": "1.1.63",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -97,9 +97,9 @@ const cbterminal = {
97
97
  cbws.getWebsocket.on('message', (data: string) => {
98
98
  const response = JSON.parse(data);
99
99
  console.log("Received message:", response);
100
- if (response.type === "commandOutput" || response.type === "commandError" || response.type === "commandFinish")
101
- // Emit a custom event based on the message type
102
- this.eventEmitter.emit("serverEvents", response.response);
100
+ if (response.type === "commandOutput" || response.type === "commandError" || response.type === "commandFinish") {
101
+ this.eventEmitter.emit(response.type, response);
102
+ }
103
103
  });
104
104
 
105
105
  // Return an object that includes the event emitter and the stopProcess method
@@ -15,7 +15,7 @@ class cbws {
15
15
  const uniqueConnectionId = this.getUniqueConnectionId();
16
16
  const initialMessage = this.getInitialMessage();
17
17
  console.log(uniqueConnectionId)
18
- this.websocket = new WebSocket(`ws://localhost:12345/codebolt?id=${uniqueConnectionId}`);
18
+ this.websocket = new WebSocket(`ws://localhost:${process.env.SOCKET_PORT}/codebolt?id=${uniqueConnectionId}`);
19
19
  this.initializeWebSocket(initialMessage).catch(error => {
20
20
  console.error("WebSocket connection failed:", error);
21
21
  });
package/tsconfig.json CHANGED
@@ -32,7 +32,7 @@
32
32
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
33
  // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
34
  // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
35
+ "types": ["node"], /* Specify type package names to be included without being referenced in a source file. */
36
36
  // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
37
  // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
38
  // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */