lints.ts21 lines · main
| 1 | import { enrichLintsQuery, getLintsSQL } from '@supabase/pg-meta' |
| 2 | import { paths } from 'api-types' |
| 3 | |
| 4 | import { executeQuery } from './query' |
| 5 | import { DOCS_URL } from '@/lib/constants' |
| 6 | |
| 7 | interface GetLintsOptions { |
| 8 | headers?: HeadersInit |
| 9 | exposedSchemas?: string |
| 10 | } |
| 11 | |
| 12 | export 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 | |
| 20 | export type ResponseData = |
| 21 | paths['/platform/projects/{ref}/run-lints']['get']['responses']['200']['content']['application/json'] |