]>
Commit | Line | Data |
---|---|---|
fd8710b8 C |
1 | import { makeGetRequest } from '../requests/requests' |
2 | import { LogLevel } from '../../models/server/log-level.type' | |
3 | ||
fd8710b8 C |
4 | function getLogs (url: string, accessToken: string, startDate: Date, endDate?: Date, level?: LogLevel) { |
5 | const path = '/api/v1/server/logs' | |
6 | ||
7 | return makeGetRequest({ | |
8 | url, | |
9 | path, | |
10 | token: accessToken, | |
11 | query: { startDate, endDate, level }, | |
12 | statusCodeExpected: 200 | |
13 | }) | |
14 | } | |
15 | ||
566c125d C |
16 | function getAuditLogs (url: string, accessToken: string, startDate: Date, endDate?: Date) { |
17 | const path = '/api/v1/server/audit-logs' | |
18 | ||
19 | return makeGetRequest({ | |
20 | url, | |
21 | path, | |
22 | token: accessToken, | |
23 | query: { startDate, endDate }, | |
24 | statusCodeExpected: 200 | |
25 | }) | |
26 | } | |
27 | ||
fd8710b8 | 28 | export { |
566c125d C |
29 | getLogs, |
30 | getAuditLogs | |
fd8710b8 | 31 | } |