File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @codebolt/codeboltjs" ,
3
- "version" : " 1.1.16 " ,
3
+ "version" : " 1.1.17 " ,
4
4
"description" : " " ,
5
5
"keywords" : [],
6
6
"author" : " " ,
Original file line number Diff line number Diff line change @@ -63,15 +63,34 @@ const cbterminal = {
63
63
* @param {string } command - The command to be executed.
64
64
* @returns {Promise<any> } A promise that resolves when an interruption signal is received during command execution.
65
65
*/
66
- executeCommandRunUnitlIntrupt : async ( command : string ) : Promise < any > => {
66
+ executeCommandRunUnitlInterrupt : async ( command : string ) : Promise < any > => {
67
67
return new Promise ( ( resolve , reject ) => {
68
68
cbws . getWebsocket . send ( JSON . stringify ( {
69
- "type" : "executeCommandRunUnitlIntrupt " ,
69
+ "type" : "executeCommandRunUnitlInterrupt " ,
70
70
"message" : command ,
71
71
} ) ) ;
72
72
cbws . getWebsocket . on ( 'message' , ( data : string ) => {
73
73
const response = JSON . parse ( data ) ;
74
- if ( response . type === "terminalIntruptResponse" ) {
74
+ if ( response . type === "terminalInterruptResponse" ) {
75
+ resolve ( response ) ;
76
+ }
77
+ } ) ;
78
+ } ) ;
79
+ } ,
80
+ /**
81
+ * Sends a manual interrupt signal to the terminal.
82
+ *
83
+ * @returns {void }
84
+ */
85
+ sendManualInterrupt ( ) : Promise < any > {
86
+
87
+ return new Promise ( ( resolve , reject ) => {
88
+ cbws . getWebsocket . send ( JSON . stringify ( {
89
+ "type" : "sendInterruptToTerminal"
90
+ } ) ) ;
91
+ cbws . getWebsocket . on ( 'message' , ( data : string ) => {
92
+ const response = JSON . parse ( data ) ;
93
+ if ( response . type === "terminalInterrupted" ) {
75
94
resolve ( response ) ;
76
95
}
77
96
} ) ;
You can’t perform that action at this time.
0 commit comments