Files
supabase/apps/studio/data/auth/keys.ts
Joshen Lim fc7fb50aa2 Organize pg meta queries for studio (#43562)
## Context

We reached to a consensus that we'll keep manually written queries
within the `pg-meta` package

I'll shift queries over in several PRs but wanted to double check if the
changes here is a good folder structure

## Changes involved

- Am organizing dashboard queries in `pg-meta` based on product
  - So folder structure will be `/sql/studio/[product]/*.ts`
- Every constant will be exported directly from `pg-meta`'s index
- So consumption in dashboard will just be `import { xxx } from
'@supabase/pg-meta`

cc @avallete and @soedirgo on this one - lemme know if this is alright,
or if there's a preferred way to do this
2026-03-10 09:34:11 +07:00

37 lines
1.3 KiB
TypeScript

import type { OptimizedSearchColumns } from '@supabase/pg-meta'
export const authKeys = {
user: (projectRef: string | undefined, userId?: string | null) =>
['projects', projectRef, 'user', userId] as const,
usersInfinite: (
projectRef: string | undefined,
params?: {
keywords?: string
filter?: string
providers?: string[]
sort?: string
order?: string
column?: OptimizedSearchColumns
}
) => ['projects', projectRef, 'users-infinite', params].filter(Boolean),
usersCount: (
projectRef: string | undefined,
params?: {
keywords?: string
filter?: string
providers?: string[]
forceExactCount?: boolean
column?: OptimizedSearchColumns
}
) => ['projects', projectRef, 'users-count', params].filter(Boolean),
usersIndexStatuses: (projectRef: string | undefined) =>
['projects', projectRef, 'users-index-statuses'] as const,
indexWorkerStatus: (projectRef: string | undefined) =>
['projects', projectRef, 'index-worker-status'] as const,
authConfig: (projectRef: string | undefined) => ['projects', projectRef, 'auth-config'] as const,
accessToken: () => ['access-token'] as const,
overviewMetrics: (projectRef: string | undefined) =>
['projects', projectRef, 'auth-overview-metrics'] as const,
}