File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -631,6 +631,18 @@ export class RobotClient extends EventDispatcher implements Robot {
631
631
}
632
632
}
633
633
634
+ // SESSIONS
635
+
636
+ async getSessions ( ) {
637
+ const { robotService } = this ;
638
+ const request = new proto . GetSessionsRequest ( ) ;
639
+ const response = await promisify <
640
+ proto . GetSessionsRequest ,
641
+ proto . GetSessionsResponse
642
+ > ( robotService . getSessions . bind ( robotService ) , request ) ;
643
+ return response . getSessionsList ( ) . map ( ( session ) => session . toObject ( ) ) ;
644
+ }
645
+
634
646
// OPERATIONS
635
647
636
648
async getOperations ( ) {
Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ export type CloudMetadata = proto.GetCloudMetadataResponse.AsObject;
14
14
type Callback = ( args : unknown ) => void ;
15
15
16
16
export interface Robot {
17
+ /**
18
+ * Get the list of sessions currently connected to the robot.
19
+ *
20
+ * @group Sessions
21
+ * @alpha
22
+ */
23
+ getSessions ( ) : Promise < proto . Session . AsObject [ ] > ;
24
+
17
25
/**
18
26
* Get the list of operations currently running on the robot.
19
27
*
You can’t perform that action at this time.
0 commit comments