logs.ts 720 B

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