mirror of
https://github.com/supabase/supabase.git
synced 2026-07-05 03:24:19 +08:00
* try a really long context window to maximize caching
* update examples
* attempt to update packages and useChat
* update endpoints
* update zod
* zod
* update to v5
* message update
* Revert "zod"
This reverts commit ec39bac6b6.
* revert zod
* zod i
* fix complete endpoints
* remove async
* change to content
* type cleanup
* Revert the package bumps to rebuild them.
* Bump zod to 2.25.76 in all packages.
* Bump openai in all packages.
* Bump ai and ai-related packages.
* Remove unneeded files.
* Fix the rest of the migration stuff.
* Prettier fixes.
* add policy list tool
* refactor
* ai sdk 5 fixes
* refactor complete endpoint
* edge function prompt
* remove example
* slight prompt change
* Minor clean up
* More clean up
---------
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
35 lines
857 B
TypeScript
35 lines
857 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/generate-v4',
|
|
'/ai/code/complete',
|
|
'/ai/sql/cron-v2',
|
|
'/ai/sql/title-v2',
|
|
'/ai/onboarding/design',
|
|
'/ai/feedback/classify',
|
|
'/get-ip-address',
|
|
'/get-utc-time',
|
|
'/get-deployment-commit',
|
|
'/check-cname',
|
|
'/edge-functions/test',
|
|
'/edge-functions/body',
|
|
]
|
|
|
|
export function middleware(request: NextRequest) {
|
|
if (
|
|
IS_PLATFORM &&
|
|
!HOSTED_SUPPORTED_API_URLS.some((url) => request.nextUrl.pathname.endsWith(url))
|
|
) {
|
|
return Response.json(
|
|
{ success: false, message: 'Endpoint not supported on hosted' },
|
|
{ status: 404 }
|
|
)
|
|
}
|
|
}
|