Commit Graph

25 Commits

Author SHA1 Message Date
Austin Tran
6e8538f957 fix: the pagination of storage is not functioning on self-hosted systems (#21925) 2024-03-14 15:18:55 +01:00
Ivan Vasilov
5ebdd4aeb7 fix: Fix all errored queries when self-hosting studio (#21815)
* Hide the logout button in selfhosted version.

* Don't call project-eligibility-query on selfhosted version.

* Add local api handlers for self-hosting version.

* Fix a missing monaco editor file in the self-hosting version.

* Deleted an obsolete api route.

* Import the right get function.
2024-03-08 14:36:42 +01:00
Ivan Vasilov
7548fd1850 feat: Conversational AI for the SQL Editor (#21388)
* Add a API endpoint for generating queries for the SQL editor.

* Merge all multiline props.

* Add a new component for diff actions.

* Copy components for the AI panel.

* Add useChat hook.

* Add a feature preview for the this feature. The preview is dependent on the feature flag.

* Reorder the nesting in the SQL editor to accomodate the AI assistant.

* Try to fit both AI assistants in the SQL editor, available via a feature preview.

* Refactor the SQL editor to make the diff work correctly in all cases.

* Minor fixes for the old AI feature.

* Fix the debug functionality to work with both assistants.

* Fix some copy-paste leftovers.

* Remove unneeded code.

* Make the icons softer.

* Fix the name of the panel component.

* Fix console.logs.

* Add overflow to the AI assistant.

* surface opt in config in ai settings button

* Skip diffing if editor is empty

* Add selected state when selecting a message to insert/replace code

* Add sample prompts

* Add SQL ai dislaimer when replacing code

* Light mode action bar nudges

* Add text for the feature preview.

* lang nudges

* Hide the command suggestions for now.

* Set the discussion url to undefined.

* Don't add the disclaimer twice.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-03-05 17:26:11 +01:00
Kevin Grüneberg
f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
Joshen Lim
8fa042930e Update content to show project ref (#21680)
* Update content to show project ref

* fix

* Fix

* Remove stray console logs

* Fix

* Update
2024-03-04 14:14:24 +08:00
Terry Sutton
cc008ef983 Feat/homepage connect modal combined (#20328)
* First

* Update

* Move connection string panel to its own component

* Add connection strings

* Format button

* Add dummy files to get logic working

* Add mdx packages

* add file handling and change logic

* Support connections

* Fix icons, add direct and graphql

* Remove mdx stuff

* Add pooler toggle

* Fix child logic

* Fix grandchild logic

* Refactor data object

* Move back to dialog ui

* Refactor to shadcn tabs

* Find the files

* Wire up icons

* Loop over connection types

* Reformat file paths

* Remove from project home

* fix tab rendering issue

* Check for unique keys

* Add new libs

* comment

* Add direct connection ui

* Get project connection strings

* Cleanup

* Add project keys

* Add types file

* Undo update

* Add next app files

* Add files

* Add next pages files

* Add nuxt

* Fix env vars

* Add rest of frameworks, graphql and orms

* Add orms

* Fix types

* Add guide links

* Run prettier

* Separate graphql

* Move ui

* Move direct connection to first position

* Move to single files

* Update styling

* Fix locations

* Fix next content

* Fix dialog close button, add proper light mode theme

* Fix dialog style issues

* CleanupA

* Pin to top

* Feat/homepage connect modal combined  styling update (#21079)

* chore: update styling. also moved useStates as it was sort of duplicated

* Cleanup

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>

* Close pooler modal

* Make the db connection panel blend in

* Allow for DatabaseSelector

* Dont open by default

* Some fixes

* Set min height to loader

* Fix

* Small styling fixes for table editor sort filter popover

* Make connect button stand out

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-15 09:25:17 -03:30
Ivan Vasilov
4dac01e378 chore: Migrate Clippy to Nextjs API docs (#20903)
* Add a new function to ai-commands package.

* Add a new API route to all three apps.

* Refactor the Command component to use the new URL.

* Resort the imports.
2024-02-12 10:10:52 +01:00
Joshen Lim
0c155ec552 Chore/update pgbouncer status check (#20862)
* Update pg-bouncer status check

* Remove nextjs endpoint for pgbouncer check

* Add is platform check
2024-01-30 16:43:51 +07:00
Ivan Vasilov
3f75f791a6 feat: Show a badge if the pgbouncer hasn't been removed. (#20830)
* Add a badge if the pgbouncer hasn't been removed.

* Force the response to be a boolean.

* Add a CSP exception, just for testing.

* Minor correction for the CSP rule.

* Add a API route for checking whether the pgbouncer has been removed.

* Log the response and error.

* Minor fixes.

* Update based on feedback

* Add additional sanity checks on pg bouncer nextjs endpoint

* Update check

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-01-30 14:10:57 +07:00
Joel Lee
a9057f401a feat: drop deprecated linkedin provider from frontend (#20510)
Co-authored-by: joel <joel@joels-MacBook-Pro.local>
2024-01-18 05:25:17 +00:00
Austin Tran
8fbf22a9d3 fix: remove mfa factor is broken (#19734)
* chore: fixed issue when remove mfa factor is broken

* chore: use auth to remove mfa users

* chore: remove unuse code
2024-01-10 06:19:34 +00:00
Austin Tran
f8eda80924 fix: prevent crashing when attempting to enable wrappers (#20237) 2024-01-08 11:38:52 -03:30
Gulfaraz Rahman
7f1c6a04c2 fix(self-hosted): do not ignore additional config in create storage bucket request (#20213)
fix: do not ignore additional config in create storage bucket request

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-01-08 05:32:41 +00:00
Austin Tran
a637a73847 chore: fixed issue when delete sorted column cause crash on table editor (#19178)
* chore: fixed issue when delete sorted column cause crash on table editor

* chore: fixed issue on typecheck

* chore: better way to check and handle error

* chore: reduce nested error in error response

* chore: revert checking error in error response

* chore: solved conflict
2023-12-20 14:35:23 +00:00
Greg Richardson
a6f1313490 AI SQL: Update model + add test suite (#19644)
* refactor: ai sql logic to common package

* feat: ai sql tests

* feat: test rls policy ai chat assistant

* refactor: jest env loading

* feat(ai): improve sql title and description quality

* fix: ai message role type

* Move the new files to a separate package.

* Remove a forgotten console.log.

* Migrate the tests to use snapshots and commit the snapshots.

* Separate the functions which require edge runtime to be exported via /edge subpath.

* Bust the turbo cache when one of the deps has been rebuilt.

* chore: fix package main/type references

* fix: package lock out of sync

* fix: ai sql debugging to fix typos

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-12-18 11:23:59 -07:00
Monica Khoury
2cf0194315 feat: highlight user's banned IP in UI (#19666) 2023-12-14 17:38:07 +01:00
Kang Ming
e9a6a40625 feat: add identity linking config (#19615)
* refactor: linkedin config

* docs: update admonitions

* fix: broken docs link in linkedin provider

* feat: add manual linking toggle

* Link to docs for manual linking APIs

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2023-12-12 10:12:51 -08:00
Ivan Vasilov
eb83b51d98 fix: Add some more instructions to the AI Editor (#19507)
* Add some more instructions to the AI Editor.

* More updates to the suggestion instructions.

* Add spacing to policy details

* Monaco settings

* Copy changes to check when clicked

* Spelling

* More instructions for the AI.

* Make the error panel wrap text. Calculate the height of the editor dynamically.

* Add a comment.

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2023-12-11 11:20:04 +01:00
Ivan Vasilov
efa055f068 fix: RLS Editor with Streaming AI - second attempt (#19462)
* Reapply all changes from the reverted PR.

* Move the API route to pages folder.

* Turn off outputFileTracing.
2023-12-06 15:54:22 +01:00
Kevin Grüneberg
d6b7c1b7ba Revert "feat: Add streaming responses to the new RLS Editor (#19304)" (#19439)
This reverts commit a2b01e0bc5.
2023-12-05 16:50:26 +00:00
Ivan Vasilov
a2b01e0bc5 feat: Add streaming responses to the new RLS Editor (#19304)
* Add vercel/ai. Commit additional next types.

* Add a API route in /app for streaming responses.

* Make the components work with streaming response.

* Add a dummy page to /app folder to fix a linking bug.

* Fix the dummy page.

* Fix the dummy page again.

* Add an empty layout to the app folder.

* Make the code snippets in the chat read-only.

* Remove queries and mutations for suggest.

* Reset the chat when closing the panel.

* Make the AI instructions a bit better.

* Don't render empty code blocks.

* Try to use remark for rendering the code. Style fixes for CodeBlock in AI assistant panel.

* Fix the styling of the definitions when sending them to OpenAI.

* Fix the css styling of the messages and code blocks.

* Move the suggest API route from app to pages folder.

* Revert the change for app API routes.

* Make the API route look like the rest of the API routes.

* Use Pre instead of Code because the <code> tags aren't working if between spans.

* Minor leftovers.

* Revert to using app route handlers.

* Change the wording on the diff header.

* Add nextjs types.

* Fix a missing import.

* Move AssistantChatForm back to db-new.

* Fix a build error.

* Rename the suggest route to assistant.

* Fix Joshen's comments.
2023-12-05 16:05:02 +01:00
Joshen Lim
9d48e8c770 Chore/rls ai assistant updates 041223 (#19404)
* Send policy definition to AI when editing a policy

* Only send entity definitions if opted into AI for RLS ai assistant

* Scaffold collapsible policy details

* Update comment

* Update

* Update height

* fix messages sorting
2023-12-05 15:42:07 +08:00
Ivan Vasilov
33f617a6cc Migrate all apps and packages to use OpenAI v4 lib (#19270)
* Migrate all apps and packages to use OpenAI v4 lib.

* Minor fix.

* refactor: improve types for completion chunks

---------

Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
2023-11-30 09:01:51 +00:00
Ivan Vasilov
1f38fe2012 feat: New Policy Editor (#19166)
* Add two more sizes to the Panel component.

* Add alias for the older openai-api library. The new one is added under the openai name.

* Add API routes

* Add components for the new AI RLS panel.

* Bunch of changes to the AI Policy Editor.

* Add a button for opening the new Policy Editor.

* Add a feature flag for the new editor.

* Add a confirmation modal when closing the panel.

* Fix leftover data when closing the panel.

* Make the copy button work.

* Add the next/swc packages to package-lock.json.

* Merge master

* Scaffold debug sql in rls editor

* Small improvements to policy chat

* Hook up debug to ai assistant panel

* Improve debug UX

* Add debug request badge

* Some styling fix

* Small styling fix

* Another small styling fix

* Shift create new policy ai button + fix error stylign with code editor height

* Add tooltips to apply changes and copy code from assistant message

* Hide assistant button is not platform

* Small lint

* Add default error handlers to all AI RQ mutations

* Small fix

* Remove IS PLATFORM check for rls assistant

* Add placeholder to RLS code editor

* Fix diff + rls code editor

* Add placeholder message after sending prompt

* Small style

* RLSCodeEditor hit tab if empty to populate placeholder text

* Light mode nudeges

* Update logic for when confirmation close modal should show

* Set render overview ruler as false for rls diff editor

* improve chat UX to make it smoother (thank you alaister for your help 🙏)

* Dynamically do keepPreviousData

* Gracefully handle errors for add prompt

* Use animated ai icon while message is loading

* using Sheet component

* Address commernts

* Bit more improvements

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2023-11-29 17:12:50 +08:00
Ivan Vasilov
436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00