aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands')
-rw-r--r--shared/server-commands/logs/logs-command.ts17
1 files changed, 15 insertions, 2 deletions
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 @@
1import { HttpStatusCode, LogLevel } from '@shared/models' 1import { ClientLogCreate, HttpStatusCode, ServerLogLevel } from '@shared/models'
2import { AbstractCommand, OverrideCommandOptions } from '../shared' 2import { AbstractCommand, OverrideCommandOptions } from '../shared'
3 3
4export class LogsCommand extends AbstractCommand { 4export class LogsCommand extends AbstractCommand {
5 5
6 createLogClient (options: OverrideCommandOptions & { payload: ClientLogCreate }) {
7 const path = '/api/v1/server/logs/client'
8
9 return this.postBodyRequest({
10 ...options,
11
12 path,
13 fields: options.payload,
14 implicitToken: true,
15 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
16 })
17 }
18
6 getLogs (options: OverrideCommandOptions & { 19 getLogs (options: OverrideCommandOptions & {
7 startDate: Date 20 startDate: Date
8 endDate?: Date 21 endDate?: Date
9 level?: LogLevel 22 level?: ServerLogLevel
10 tagsOneOf?: string[] 23 tagsOneOf?: string[]
11 }) { 24 }) {
12 const { startDate, endDate, tagsOneOf, level } = options 25 const { startDate, endDate, tagsOneOf, level } = options