Files
supabase/apps/studio/lib/api/self-hosted/lints.ts
T
Joshen Lim 98b1b79909 Chore/shift manual queries into pg meta 04 (#43956)
## Context

Shifts all remaining dashboard queries into pg-meta so that we
centralize all manually written queries in one place
Having them in packages/pg-meta also allows us to write tests for them

## To test

Just needs a smoke test on
- Role Impersonation
- Lints
- Data API
- Database
  - Enumerated Types
- Integrations
  - Foreign Data Wrappers
  - Vault
2026-03-24 16:23:13 +08:00

22 lines
645 B
TypeScript

import { enrichLintsQuery, getLintsSQL } from '@supabase/pg-meta'
import { paths } from 'api-types'
import { DOCS_URL } from 'lib/constants'
import { executeQuery } from './query'
interface GetLintsOptions {
headers?: HeadersInit
exposedSchemas?: string
}
export async function getLints({ headers, exposedSchemas }: GetLintsOptions) {
const sql = getLintsSQL({ docsUrl: DOCS_URL })
return await executeQuery<ResponseData[number]>({
query: enrichLintsQuery(sql, exposedSchemas),
headers,
})
}
export type ResponseData =
paths['/platform/projects/{ref}/run-lints']['get']['responses']['200']['content']['application/json']