@codebolt/codeboltjs 1.1.60 → 1.1.61
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/index.d.ts +3 -3
- package/modules/terminal.d.ts +3 -3
- package/modules/terminal.js +6 -3
- package/package.json +1 -1
- package/src/modules/terminal.ts +7 -4
package/index.d.ts
CHANGED
|
@@ -130,10 +130,10 @@ declare class Codebolt {
|
|
|
130
130
|
prependOnceListener<K_11>(eventName: string | symbol, listener: (...args: any[]) => void): any;
|
|
131
131
|
eventNames(): (string | symbol)[];
|
|
132
132
|
};
|
|
133
|
-
executeCommand: (command: string) => Promise<import("@codebolt/types").CommandOutput | import("@codebolt/types").CommandError>;
|
|
134
|
-
executeCommandRunUntilError: (command: string) => Promise<import("@codebolt/types").CommandError>;
|
|
133
|
+
executeCommand: (command: string, executeInMain?: boolean) => Promise<import("@codebolt/types").CommandOutput | import("@codebolt/types").CommandError>;
|
|
134
|
+
executeCommandRunUntilError: (command: string, executeInMain?: boolean) => Promise<import("@codebolt/types").CommandError>;
|
|
135
135
|
sendManualInterrupt(): Promise<import("@codebolt/types").TerminalInterruptResponse>;
|
|
136
|
-
executeCommandWithStream(command: string): EventEmitter<[never]>;
|
|
136
|
+
executeCommandWithStream(command: string, executeInMain?: boolean): EventEmitter<[never]>;
|
|
137
137
|
};
|
|
138
138
|
codeutils: {
|
|
139
139
|
getJsTree: (filePath?: string | undefined) => Promise<any>;
|
package/modules/terminal.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare const cbterminal: {
|
|
|
19
19
|
* @param {string} command - The command to be executed.
|
|
20
20
|
* @returns {Promise<CommandOutput|CommandError>} A promise that resolves with the command's output, error, or finish signal.
|
|
21
21
|
*/
|
|
22
|
-
executeCommand: (command: string) => Promise<CommandOutput | CommandError>;
|
|
22
|
+
executeCommand: (command: string, executeInMain?: boolean) => Promise<CommandOutput | CommandError>;
|
|
23
23
|
/**
|
|
24
24
|
* Executes a given command and keeps running until an error occurs.
|
|
25
25
|
* Listens for messages from the WebSocket and resolves the promise when an error is encountered.
|
|
@@ -27,7 +27,7 @@ declare const cbterminal: {
|
|
|
27
27
|
* @param {string} command - The command to be executed.
|
|
28
28
|
* @returns {Promise<CommandError>} A promise that resolves when an error occurs during command execution.
|
|
29
29
|
*/
|
|
30
|
-
executeCommandRunUntilError: (command: string) => Promise<CommandError>;
|
|
30
|
+
executeCommandRunUntilError: (command: string, executeInMain?: boolean) => Promise<CommandError>;
|
|
31
31
|
/**
|
|
32
32
|
* Sends a manual interrupt signal to the terminal.
|
|
33
33
|
*
|
|
@@ -41,6 +41,6 @@ declare const cbterminal: {
|
|
|
41
41
|
* @param {string} command - The command to be executed.
|
|
42
42
|
* @returns {EventEmitter} A promise that streams the output data during command execution.
|
|
43
43
|
*/
|
|
44
|
-
executeCommandWithStream(command: string): EventEmitter;
|
|
44
|
+
executeCommandWithStream(command: string, executeInMain?: boolean): EventEmitter;
|
|
45
45
|
};
|
|
46
46
|
export default cbterminal;
|
package/modules/terminal.js
CHANGED
|
@@ -23,11 +23,12 @@ const cbterminal = {
|
|
|
23
23
|
* @param {string} command - The command to be executed.
|
|
24
24
|
* @returns {Promise<CommandOutput|CommandError>} A promise that resolves with the command's output, error, or finish signal.
|
|
25
25
|
*/
|
|
26
|
-
executeCommand: async (command) => {
|
|
26
|
+
executeCommand: async (command, executeInMain = false) => {
|
|
27
27
|
return new Promise((resolve, reject) => {
|
|
28
28
|
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
29
29
|
"type": "executeCommand",
|
|
30
30
|
"message": command,
|
|
31
|
+
executeInMain
|
|
31
32
|
}));
|
|
32
33
|
websocket_1.default.getWebsocket.on('message', (data) => {
|
|
33
34
|
const response = JSON.parse(data);
|
|
@@ -44,11 +45,12 @@ const cbterminal = {
|
|
|
44
45
|
* @param {string} command - The command to be executed.
|
|
45
46
|
* @returns {Promise<CommandError>} A promise that resolves when an error occurs during command execution.
|
|
46
47
|
*/
|
|
47
|
-
executeCommandRunUntilError: async (command) => {
|
|
48
|
+
executeCommandRunUntilError: async (command, executeInMain = false) => {
|
|
48
49
|
return new Promise((resolve, reject) => {
|
|
49
50
|
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
50
51
|
"type": "executeCommandRunUntilError",
|
|
51
52
|
"message": command,
|
|
53
|
+
executeInMain
|
|
52
54
|
}));
|
|
53
55
|
websocket_1.default.getWebsocket.on('message', (data) => {
|
|
54
56
|
const response = JSON.parse(data);
|
|
@@ -83,11 +85,12 @@ const cbterminal = {
|
|
|
83
85
|
* @param {string} command - The command to be executed.
|
|
84
86
|
* @returns {EventEmitter} A promise that streams the output data during command execution.
|
|
85
87
|
*/
|
|
86
|
-
executeCommandWithStream(command) {
|
|
88
|
+
executeCommandWithStream(command, executeInMain = false) {
|
|
87
89
|
// Send the process started message
|
|
88
90
|
websocket_1.default.getWebsocket.send(JSON.stringify({
|
|
89
91
|
"type": "executeCommandWithStream",
|
|
90
92
|
"message": command,
|
|
93
|
+
executeInMain
|
|
91
94
|
}));
|
|
92
95
|
// Register event listener for WebSocket messages
|
|
93
96
|
websocket_1.default.getWebsocket.on('message', (data) => {
|
package/package.json
CHANGED
package/src/modules/terminal.ts
CHANGED
|
@@ -19,11 +19,12 @@ const cbterminal = {
|
|
|
19
19
|
* @param {string} command - The command to be executed.
|
|
20
20
|
* @returns {Promise<CommandOutput|CommandError>} A promise that resolves with the command's output, error, or finish signal.
|
|
21
21
|
*/
|
|
22
|
-
executeCommand: async (command: string): Promise<CommandOutput|CommandError> => {
|
|
22
|
+
executeCommand: async (command: string,executeInMain=false): Promise<CommandOutput|CommandError> => {
|
|
23
23
|
return new Promise((resolve, reject) => {
|
|
24
24
|
cbws.getWebsocket.send(JSON.stringify({
|
|
25
25
|
"type": "executeCommand",
|
|
26
26
|
"message": command,
|
|
27
|
+
executeInMain
|
|
27
28
|
}));
|
|
28
29
|
cbws.getWebsocket.on('message', (data: string) => {
|
|
29
30
|
const response = JSON.parse(data);
|
|
@@ -41,11 +42,12 @@ const cbterminal = {
|
|
|
41
42
|
* @param {string} command - The command to be executed.
|
|
42
43
|
* @returns {Promise<CommandError>} A promise that resolves when an error occurs during command execution.
|
|
43
44
|
*/
|
|
44
|
-
executeCommandRunUntilError: async (command: string): Promise<CommandError> => {
|
|
45
|
+
executeCommandRunUntilError: async (command: string,executeInMain=false): Promise<CommandError> => {
|
|
45
46
|
return new Promise((resolve, reject) => {
|
|
46
47
|
cbws.getWebsocket.send(JSON.stringify({
|
|
47
48
|
"type": "executeCommandRunUntilError",
|
|
48
49
|
"message": command,
|
|
50
|
+
executeInMain
|
|
49
51
|
}));
|
|
50
52
|
cbws.getWebsocket.on('message', (data: string) => {
|
|
51
53
|
const response = JSON.parse(data);
|
|
@@ -84,11 +86,12 @@ const cbterminal = {
|
|
|
84
86
|
* @param {string} command - The command to be executed.
|
|
85
87
|
* @returns {EventEmitter} A promise that streams the output data during command execution.
|
|
86
88
|
*/
|
|
87
|
-
executeCommandWithStream(command: string):EventEmitter {
|
|
89
|
+
executeCommandWithStream(command: string,executeInMain=false):EventEmitter {
|
|
88
90
|
// Send the process started message
|
|
89
91
|
cbws.getWebsocket.send(JSON.stringify({
|
|
90
92
|
"type": "executeCommandWithStream",
|
|
91
|
-
"message": command
|
|
93
|
+
"message": command
|
|
94
|
+
,executeInMain
|
|
92
95
|
}));
|
|
93
96
|
// Register event listener for WebSocket messages
|
|
94
97
|
cbws.getWebsocket.on('message', (data: string) => {
|