@codebolt/codeboltjs 1.1.17 → 1.1.18
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/modules/terminal.d.ts +1 -11
- package/modules/terminal.js +1 -24
- package/package.json +1 -1
- package/src/modules/terminal.ts +3 -24
package/modules/terminal.d.ts
CHANGED
|
@@ -27,14 +27,6 @@ declare const cbterminal: {
|
|
|
27
27
|
* @returns {Promise<any>} A promise that resolves when an error occurs during command execution.
|
|
28
28
|
*/
|
|
29
29
|
executeCommandRunUntilError: (command: string) => Promise<any>;
|
|
30
|
-
/**
|
|
31
|
-
* Executes a given command and keeps running until interrupted.
|
|
32
|
-
* Listens for messages from the WebSocket and resolves the promise when an interruption signal is received.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} command - The command to be executed.
|
|
35
|
-
* @returns {Promise<any>} A promise that resolves when an interruption signal is received during command execution.
|
|
36
|
-
*/
|
|
37
|
-
executeCommandRunUnitlInterrupt: (command: string) => Promise<any>;
|
|
38
30
|
/**
|
|
39
31
|
* Sends a manual interrupt signal to the terminal.
|
|
40
32
|
*
|
|
@@ -48,8 +40,6 @@ declare const cbterminal: {
|
|
|
48
40
|
* @param {string} command - The command to be executed.
|
|
49
41
|
* @returns {Promise<any>} A promise that streams the output data during command execution.
|
|
50
42
|
*/
|
|
51
|
-
executeCommandWithStream(command: string):
|
|
52
|
-
event: CustomEventEmitter;
|
|
53
|
-
};
|
|
43
|
+
executeCommandWithStream(command: string): CustomEventEmitter;
|
|
54
44
|
};
|
|
55
45
|
export default cbterminal;
|
package/modules/terminal.js
CHANGED
|
@@ -58,27 +58,6 @@ const cbterminal = {
|
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
60
|
},
|
|
61
|
-
/**
|
|
62
|
-
* Executes a given command and keeps running until interrupted.
|
|
63
|
-
* Listens for messages from the WebSocket and resolves the promise when an interruption signal is received.
|
|
64
|
-
*
|
|
65
|
-
* @param {string} command - The command to be executed.
|
|
66
|
-
* @returns {Promise<any>} A promise that resolves when an interruption signal is received during command execution.
|
|
67
|
-
*/
|
|
68
|
-
executeCommandRunUnitlInterrupt: async (command) => {
|
|
69
|
-
return new Promise((resolve, reject) => {
|
|
70
|
-
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
71
|
-
"type": "executeCommandRunUnitlInterrupt",
|
|
72
|
-
"message": command,
|
|
73
|
-
}));
|
|
74
|
-
websocket_1.default.getWebsocket.on('message', (data) => {
|
|
75
|
-
const response = JSON.parse(data);
|
|
76
|
-
if (response.type === "terminalInterruptResponse") {
|
|
77
|
-
resolve(response);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
},
|
|
82
61
|
/**
|
|
83
62
|
* Sends a manual interrupt signal to the terminal.
|
|
84
63
|
*
|
|
@@ -119,9 +98,7 @@ const cbterminal = {
|
|
|
119
98
|
this.eventEmitter.emit("serverEvents", response.response);
|
|
120
99
|
});
|
|
121
100
|
// Return an object that includes the event emitter and the stopProcess method
|
|
122
|
-
return
|
|
123
|
-
event: this.eventEmitter
|
|
124
|
-
};
|
|
101
|
+
return this.eventEmitter;
|
|
125
102
|
}
|
|
126
103
|
};
|
|
127
104
|
exports.default = cbterminal;
|
package/package.json
CHANGED
package/src/modules/terminal.ts
CHANGED
|
@@ -56,27 +56,7 @@ const cbterminal = {
|
|
|
56
56
|
});
|
|
57
57
|
},
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
* Executes a given command and keeps running until interrupted.
|
|
61
|
-
* Listens for messages from the WebSocket and resolves the promise when an interruption signal is received.
|
|
62
|
-
*
|
|
63
|
-
* @param {string} command - The command to be executed.
|
|
64
|
-
* @returns {Promise<any>} A promise that resolves when an interruption signal is received during command execution.
|
|
65
|
-
*/
|
|
66
|
-
executeCommandRunUnitlInterrupt: async (command: string): Promise<any> => {
|
|
67
|
-
return new Promise((resolve, reject) => {
|
|
68
|
-
cbws.getWebsocket.send(JSON.stringify({
|
|
69
|
-
"type": "executeCommandRunUnitlInterrupt",
|
|
70
|
-
"message": command,
|
|
71
|
-
}));
|
|
72
|
-
cbws.getWebsocket.on('message', (data: string) => {
|
|
73
|
-
const response = JSON.parse(data);
|
|
74
|
-
if (response.type === "terminalInterruptResponse") {
|
|
75
|
-
resolve(response);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
},
|
|
59
|
+
|
|
80
60
|
/**
|
|
81
61
|
* Sends a manual interrupt signal to the terminal.
|
|
82
62
|
*
|
|
@@ -120,9 +100,8 @@ const cbterminal = {
|
|
|
120
100
|
});
|
|
121
101
|
|
|
122
102
|
// Return an object that includes the event emitter and the stopProcess method
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
};
|
|
103
|
+
return this.eventEmitter
|
|
104
|
+
|
|
126
105
|
}
|
|
127
106
|
|
|
128
107
|
|