mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
shared/ typescript types dir server-commands
This commit is contained in:
parent
6b5f72beda
commit
bf54587a3e
242 changed files with 228 additions and 172 deletions
33
shared/server-commands/server/debug-command.ts
Normal file
33
shared/server-commands/server/debug-command.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { Debug, HttpStatusCode, SendDebugCommand } from '@shared/models'
|
||||
import { AbstractCommand, OverrideCommandOptions } from '../shared'
|
||||
|
||||
export class DebugCommand extends AbstractCommand {
|
||||
|
||||
getDebug (options: OverrideCommandOptions = {}) {
|
||||
const path = '/api/v1/server/debug'
|
||||
|
||||
return this.getRequestBody<Debug>({
|
||||
...options,
|
||||
|
||||
path,
|
||||
implicitToken: true,
|
||||
defaultExpectedStatus: HttpStatusCode.OK_200
|
||||
})
|
||||
}
|
||||
|
||||
sendCommand (options: OverrideCommandOptions & {
|
||||
body: SendDebugCommand
|
||||
}) {
|
||||
const { body } = options
|
||||
const path = '/api/v1/server/debug/run-command'
|
||||
|
||||
return this.postBodyRequest({
|
||||
...options,
|
||||
|
||||
path,
|
||||
fields: body,
|
||||
implicitToken: true,
|
||||
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue