X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fserver%2Fdebug.ts;h=f196812b710b431e2e6283346d0f06d0b2aced1f;hb=428ccb8b7a44ce60cabb7401a5464cf5fcbd4dba;hp=5cf80a5fb367874957c480644a9612628fbec601;hpb=fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/server/debug.ts b/shared/extra-utils/server/debug.ts index 5cf80a5fb..f196812b7 100644 --- a/shared/extra-utils/server/debug.ts +++ b/shared/extra-utils/server/debug.ts @@ -1,5 +1,6 @@ -import { makeGetRequest } from '../requests/requests' +import { makeGetRequest, makePostBodyRequest } from '../requests/requests' import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes' +import { SendDebugCommand } from '@shared/models' function getDebug (url: string, token: string) { const path = '/api/v1/server/debug' @@ -12,8 +13,21 @@ function getDebug (url: string, token: string) { }) } +function sendDebugCommand (url: string, token: string, body: SendDebugCommand) { + const path = '/api/v1/server/debug/run-command' + + return makePostBodyRequest({ + url, + path, + token, + fields: body, + statusCodeExpected: HttpStatusCode.NO_CONTENT_204 + }) +} + // --------------------------------------------------------------------------- export { - getDebug + getDebug, + sendDebugCommand }