From 42b40636991b97fe818007fab19091764fc5db73 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 15 Jul 2022 15:30:14 +0200 Subject: Add ability for client to create server logs --- shared/server-commands/logs/logs-command.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'shared/server-commands/logs') diff --git a/shared/server-commands/logs/logs-command.ts b/shared/server-commands/logs/logs-command.ts index 8f63383ea..1c5de7f59 100644 --- a/shared/server-commands/logs/logs-command.ts +++ b/shared/server-commands/logs/logs-command.ts @@ -1,12 +1,25 @@ -import { HttpStatusCode, LogLevel } from '@shared/models' +import { ClientLogCreate, HttpStatusCode, ServerLogLevel } from '@shared/models' import { AbstractCommand, OverrideCommandOptions } from '../shared' export class LogsCommand extends AbstractCommand { + createLogClient (options: OverrideCommandOptions & { payload: ClientLogCreate }) { + const path = '/api/v1/server/logs/client' + + return this.postBodyRequest({ + ...options, + + path, + fields: options.payload, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 + }) + } + getLogs (options: OverrideCommandOptions & { startDate: Date endDate?: Date - level?: LogLevel + level?: ServerLogLevel tagsOneOf?: string[] }) { const { startDate, endDate, tagsOneOf, level } = options -- cgit v1.2.3