useApiReport.ts 876 B

1234567891011121314151617181920212223242526272829
  1. import { vi } from 'vitest'
  2. export const useApiReport = vi.fn().mockReturnValue({
  3. data: {
  4. totalRequests: [{ count: 4, timestamp: '2024-05-09T04:00:00.000Z' }],
  5. topRoutes: [
  6. { count: 1, method: 'HEAD', path: '/rest/v1/', search: null, status_code: 200 },
  7. { count: 2, method: 'GET', path: '/rest/v1/', search: null, status_code: 200 },
  8. { count: 3, method: 'GET', path: '/auth/v1/health', search: null, status_code: 200 },
  9. ],
  10. topErrorRoutes: [
  11. { count: 1, method: 'GET', path: '/auth/v1/user', search: null, status_code: 403 },
  12. ],
  13. },
  14. params: {
  15. totalRequests: {
  16. iso_timestamp_start: '2024-05-09T03:00:00.000Z',
  17. project: 'default',
  18. sql: '',
  19. },
  20. },
  21. filters: [],
  22. isLoading: false,
  23. mergeParams: vi.fn(),
  24. addFilter: vi.fn(),
  25. removeFilter: vi.fn(),
  26. removeFilters: vi.fn(),
  27. refresh: vi.fn(),
  28. })