lints.ts21 lines · main
1import { enrichLintsQuery, getLintsSQL } from '@supabase/pg-meta'
2import { paths } from 'api-types'
3
4import { executeQuery } from './query'
5import { DOCS_URL } from '@/lib/constants'
6
7interface GetLintsOptions {
8 headers?: HeadersInit
9 exposedSchemas?: string
10}
11
12export async function getLints({ headers, exposedSchemas }: GetLintsOptions) {
13 const sql = getLintsSQL({ docsUrl: DOCS_URL })
14 return await executeQuery<ResponseData[number]>({
15 query: enrichLintsQuery(sql, exposedSchemas),
16 headers,
17 })
18}
19
20export type ResponseData =
21 paths['/platform/projects/{ref}/run-lints']['get']['responses']['200']['content']['application/json']