]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/server-commands/socket/socket-io-command.ts
Fix tests
[github/Chocobozzz/PeerTube.git] / shared / server-commands / socket / socket-io-command.ts
CommitLineData
87e2635a
C
1import { io } from 'socket.io-client'
2import { AbstractCommand, OverrideCommandOptions } from '../shared'
3
4export class SocketIOCommand extends AbstractCommand {
5
6 getUserNotificationSocket (options: OverrideCommandOptions = {}) {
7 return io(this.server.url + '/user-notifications', {
5f8bd4cb 8 query: { accessToken: options.token ?? this.server.accessToken }
87e2635a
C
9 })
10 }
11
12 getLiveNotificationSocket () {
13 return io(this.server.url + '/live-videos')
14 }
d102de1b
C
15
16 getRunnersSocket (options: {
17 runnerToken: string
18 }) {
19 return io(this.server.url + '/runners', {
20 reconnection: false,
21 auth: { runnerToken: options.runnerToken }
22 })
23 }
87e2635a 24}