mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 07:09:07 +03:00
* monaco complete * progress * just add panel to sqleditor * update panel and prompt * adjust prompt * clean up * clean up and improve prompt * update prompt * refine prompt * remove package * use constants file * revert v3 prompt * combine diff action bars * use widget * refactor * Some updates * fix: useCompletion base path * fix: typo on monaco action label * feat: use entire selected line(s) for inline completions * fix widget consistency * widget styling * Fix TS * feat: lock llm model version * fix enter key issue * move complete endpoint * update complete prompt * remove file * placeholder text --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
29 lines
745 B
TypeScript
29 lines
745 B
TypeScript
import { IS_PLATFORM } from 'lib/constants'
|
|
import type { NextRequest } from 'next/server'
|
|
|
|
export const config = {
|
|
matcher: '/api/:function*',
|
|
}
|
|
|
|
// [Joshen] Return 404 for all next.js API endpoints EXCEPT the ones we use in hosted:
|
|
const HOSTED_SUPPORTED_API_URLS = [
|
|
'/ai/sql/suggest',
|
|
'/ai/sql/generate-v2',
|
|
'/ai/sql/generate-v3',
|
|
'/ai/sql/complete',
|
|
'/ai/sql/title',
|
|
'/ai/sql/debug',
|
|
'/ai/sql/cron',
|
|
'/get-ip-address',
|
|
]
|
|
|
|
export function middleware(request: NextRequest) {
|
|
const url = request.url
|
|
if (IS_PLATFORM && !HOSTED_SUPPORTED_API_URLS.some((url) => request.url.endsWith(url))) {
|
|
return Response.json(
|
|
{ success: false, message: 'Endpoint not supported on hosted' },
|
|
{ status: 404 }
|
|
)
|
|
}
|
|
}
|