2021-07-07 05:55:16 -04:00
|
|
|
import { io } from 'socket.io-client'
|
|
|
|
import { AbstractCommand, OverrideCommandOptions } from '../shared'
|
|
|
|
|
|
|
|
export class SocketIOCommand extends AbstractCommand {
|
|
|
|
|
|
|
|
getUserNotificationSocket (options: OverrideCommandOptions = {}) {
|
|
|
|
return io(this.server.url + '/user-notifications', {
|
2021-07-07 10:02:46 -04:00
|
|
|
query: { accessToken: options.token ?? this.server.accessToken }
|
2021-07-07 05:55:16 -04:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
getLiveNotificationSocket () {
|
|
|
|
return io(this.server.url + '/live-videos')
|
|
|
|
}
|
2023-04-21 09:00:01 -04:00
|
|
|
|
|
|
|
getRunnersSocket (options: {
|
|
|
|
runnerToken: string
|
|
|
|
}) {
|
|
|
|
return io(this.server.url + '/runners', {
|
|
|
|
reconnection: false,
|
|
|
|
auth: { runnerToken: options.runnerToken }
|
|
|
|
})
|
|
|
|
}
|
2021-07-07 05:55:16 -04:00
|
|
|
}
|