From 566c125d6eee3bd907404523d94e1e0b5e403a46 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 11 Dec 2019 14:14:01 +0100 Subject: Serve audit logs to client --- shared/extra-utils/logs/logs.ts | 15 ++++++++++++++- shared/models/server/log-level.type.ts | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'shared') diff --git a/shared/extra-utils/logs/logs.ts b/shared/extra-utils/logs/logs.ts index cbb1afb93..c494c1f1e 100644 --- a/shared/extra-utils/logs/logs.ts +++ b/shared/extra-utils/logs/logs.ts @@ -13,6 +13,19 @@ function getLogs (url: string, accessToken: string, startDate: Date, endDate?: D }) } +function getAuditLogs (url: string, accessToken: string, startDate: Date, endDate?: Date) { + const path = '/api/v1/server/audit-logs' + + return makeGetRequest({ + url, + path, + token: accessToken, + query: { startDate, endDate }, + statusCodeExpected: 200 + }) +} + export { - getLogs + getLogs, + getAuditLogs } diff --git a/shared/models/server/log-level.type.ts b/shared/models/server/log-level.type.ts index ce91559e3..4afb92d11 100644 --- a/shared/models/server/log-level.type.ts +++ b/shared/models/server/log-level.type.ts @@ -1 +1 @@ -export type LogLevel = 'debug' | 'info' | 'warn' | 'error' +export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'audit' -- cgit v1.2.3