@@ -82,6 +82,8 @@ export class WorkspacesClient implements TDebuggable {
82
82
if ( result . err ) {
83
83
return result
84
84
}
85
+
86
+ return result
85
87
}
86
88
87
89
public setDebug ( isEnabled : boolean ) : void {
@@ -93,7 +95,7 @@ export class WorkspacesClient implements TDebuggable {
93
95
}
94
96
95
97
public async getStatus ( id : TWorkspaceID ) : Promise < Result < TWorkspace [ "status" ] > > {
96
- const result = await WorkspaceCommands . GetWorkspaceStatus ( id )
98
+ const result = await WorkspaceCommands . FetchWorkspaceStatus ( id )
97
99
if ( result . err ) {
98
100
return result
99
101
}
@@ -114,7 +116,7 @@ export class WorkspacesClient implements TDebuggable {
114
116
) : Promise < Result < TWorkspace [ "status" ] > > {
115
117
const cmd = WorkspaceCommands . StartWorkspace ( ctx . id , config )
116
118
const result = await this . execActionCmd ( cmd , { ...ctx , listener, actionName : "start" } )
117
- if ( result ? .err ) {
119
+ if ( result . err ) {
118
120
return result
119
121
}
120
122
@@ -127,7 +129,7 @@ export class WorkspacesClient implements TDebuggable {
127
129
) : Promise < Result < TWorkspace [ "status" ] > > {
128
130
const cmd = WorkspaceCommands . StopWorkspace ( ctx . id )
129
131
const result = await this . execActionCmd ( cmd , { ...ctx , listener, actionName : "stop" } )
130
- if ( result ? .err ) {
132
+ if ( result . err ) {
131
133
return result
132
134
}
133
135
@@ -140,7 +142,7 @@ export class WorkspacesClient implements TDebuggable {
140
142
) : Promise < Result < TWorkspace [ "status" ] > > {
141
143
const cmd = WorkspaceCommands . RebuildWorkspace ( ctx . id )
142
144
const result = await this . execActionCmd ( cmd , { ...ctx , listener, actionName : "rebuild" } )
143
- if ( result ? .err ) {
145
+ if ( result . err ) {
144
146
return result
145
147
}
146
148
@@ -151,10 +153,23 @@ export class WorkspacesClient implements TDebuggable {
151
153
force : boolean ,
152
154
listener : TStreamEventListenerFn | undefined ,
153
155
ctx : TWorkspaceClientContext
154
- ) : Promise < ResultError > {
156
+ ) : Promise < Result < TWorkspace [ "status" ] > > {
155
157
const cmd = WorkspaceCommands . RemoveWorkspace ( ctx . id , force )
156
158
const result = await this . execActionCmd ( cmd , { ...ctx , listener, actionName : "remove" } )
157
- if ( result ?. err ) {
159
+ if ( result . err ) {
160
+ return result
161
+ }
162
+
163
+ return result
164
+ }
165
+
166
+ public async checkStatus (
167
+ listener : TStreamEventListenerFn | undefined ,
168
+ ctx : TWorkspaceClientContext
169
+ ) : Promise < ResultError > {
170
+ const cmd = WorkspaceCommands . GetStatusLogs ( ctx . id )
171
+ const result = await this . execActionCmd ( cmd , { ...ctx , listener, actionName : "checkStatus" } )
172
+ if ( result . err ) {
158
173
return result
159
174
}
160
175
0 commit comments