+ listSessions (options: OverrideCommandOptions & {
+ videoId: number | string
+ }) {
+ const path = `/api/v1/videos/live/${options.videoId}/sessions`
+
+ return this.getRequestBody<ResultList<LiveVideoSession>>({
+ ...options,
+
+ path,
+ implicitToken: true,
+ defaultExpectedStatus: HttpStatusCode.OK_200
+ })
+ }
+
+ async findLatestSession (options: OverrideCommandOptions & {
+ videoId: number | string
+ }) {
+ const { data: sessions } = await this.listSessions(options)
+
+ return sessions[sessions.length - 1]
+ }
+
+ getReplaySession (options: OverrideCommandOptions & {
+ videoId: number | string
+ }) {
+ const path = `/api/v1/videos/${options.videoId}/live-session`
+
+ return this.getRequestBody<LiveVideoSession>({
+ ...options,
+
+ path,
+ implicitToken: true,
+ defaultExpectedStatus: HttpStatusCode.OK_200
+ })
+ }
+