Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

1.8 KB
Raw Blame
import { QuerySearchParamsType } from '@/components/interfaces/UnifiedLogs/UnifiedLogs.types'

export const logsKeys = {
  otelLogKeys: (projectRef: string | undefined, source: string | undefined) =>
    ['projects', projectRef, 'otel-log-keys', source] as const,
  unifiedLogsInfinite: (
    projectRef: string | undefined,
    searchParams: QuerySearchParamsType | undefined
  ) =>
    [
      'projects',
      projectRef,
      'unified-logs',
      'logs-data',
      ...(searchParams ? [searchParams].filter(Boolean) : []),
    ] as const,
  unifiedLogsCount: (
    projectRef: string | undefined,
    searchParams: QuerySearchParamsType | undefined
  ) =>
    [
      'projects',
      projectRef,
      'unified-logs',
      'count-data',
      ...(searchParams ? [searchParams].filter(Boolean) : []),
    ] as const,
  unifiedLogsChart: (
    projectRef: string | undefined,
    searchParams: QuerySearchParamsType | undefined
  ) =>
    [
      'projects',
      projectRef,
      'unified-logs',
      'chart-data',
      ...(searchParams ? [searchParams].filter(Boolean) : []),
    ] as const,
  unifiedLogsFacetCount: (
    projectRef: string | undefined,
    facet: string,
    facetSearch: string | undefined,
    searchParams: QuerySearchParamsType | undefined
  ) =>
    [
      'projects',
      projectRef,
      'unified-logs',
      'count-data',
      facet,
      facetSearch,
      ...(searchParams ? [searchParams].filter(Boolean) : []),
    ] as const,
  serviceFlow: (
    projectRef: string | undefined,
    searchParams: QuerySearchParamsType | undefined,
    logId: string | undefined
  ) =>
    [
      'projects',
      projectRef,
      'unified-logs',
      'service-flow',
      logId,
      ...(searchParams ? [searchParams].filter(Boolean) : []),
    ] as const,
}