import { apiRequest } from './client'

export function activityLogs(params = {}) {
  const qs = new URLSearchParams()
  if (params.type) qs.set('type', params.type)
  if (params.skip != null) qs.set('skip', String(params.skip))
  if (params.limit != null) qs.set('limit', String(params.limit))
  const q = qs.toString()
  return apiRequest(`/logs/activity${q ? `?${q}` : ''}`)
}

export function auditLogs(params = {}) {
  const qs = new URLSearchParams()
  if (params.actor) qs.set('actor', params.actor)
  if (params.skip != null) qs.set('skip', String(params.skip))
  if (params.limit != null) qs.set('limit', String(params.limit))
  const q = qs.toString()
  return apiRequest(`/logs/audit${q ? `?${q}` : ''}`)
}
