2021-07-16 08:27:30 -04:00
|
|
|
import { Debug, HttpStatusCode, SendDebugCommand } from '@shared/models'
|
2021-07-06 10:02:11 -04:00
|
|
|
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,
|
2021-07-08 04:55:16 -04:00
|
|
|
implicitToken: true,
|
2021-07-06 10:02:11 -04:00
|
|
|
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,
|
2021-07-08 04:55:16 -04:00
|
|
|
implicitToken: true,
|
2021-07-06 10:02:11 -04:00
|
|
|
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|