aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/logs/logs-command.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands/logs/logs-command.ts')
-rw-r--r--shared/server-commands/logs/logs-command.ts56
1 files changed, 0 insertions, 56 deletions
diff --git a/shared/server-commands/logs/logs-command.ts b/shared/server-commands/logs/logs-command.ts
deleted file mode 100644
index 1c5de7f59..000000000
--- a/shared/server-commands/logs/logs-command.ts
+++ /dev/null
@@ -1,56 +0,0 @@
1import { ClientLogCreate, HttpStatusCode, ServerLogLevel } from '@shared/models'
2import { AbstractCommand, OverrideCommandOptions } from '../shared'
3
4export class LogsCommand extends AbstractCommand {
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
19 getLogs (options: OverrideCommandOptions & {
20 startDate: Date
21 endDate?: Date
22 level?: ServerLogLevel
23 tagsOneOf?: string[]
24 }) {
25 const { startDate, endDate, tagsOneOf, level } = options
26 const path = '/api/v1/server/logs'
27
28 return this.getRequestBody<any[]>({
29 ...options,
30
31 path,
32 query: { startDate, endDate, level, tagsOneOf },
33 implicitToken: true,
34 defaultExpectedStatus: HttpStatusCode.OK_200
35 })
36 }
37
38 getAuditLogs (options: OverrideCommandOptions & {
39 startDate: Date
40 endDate?: Date
41 }) {
42 const { startDate, endDate } = options
43
44 const path = '/api/v1/server/audit-logs'
45
46 return this.getRequestBody({
47 ...options,
48
49 path,
50 query: { startDate, endDate },
51 implicitToken: true,
52 defaultExpectedStatus: HttpStatusCode.OK_200
53 })
54 }
55
56}