From f9a55935f5ab3cd1f614b97c722354a63da413c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Mon, 4 Mar 2024 20:48:22 +0800 Subject: [PATCH 001/163] chore: use type imports for types/interfaces (#21738) --- apps/studio/components/grid/SupabaseGrid.tsx | 2 +- apps/studio/components/grid/SupabaseGrid.utils.ts | 4 ++-- .../components/grid/components/common/Shortcuts.tsx | 2 +- .../grid/components/editor/BooleanEditor.tsx | 2 +- .../components/grid/components/editor/DateEditor.tsx | 2 +- .../grid/components/editor/DateTimeEditor.tsx | 4 ++-- .../components/grid/components/editor/JsonEditor.tsx | 2 +- .../grid/components/editor/NumberEditor.tsx | 2 +- .../grid/components/editor/SelectEditor.tsx | 2 +- .../components/grid/components/editor/TextEditor.tsx | 2 +- .../components/grid/components/editor/TimeEditor.tsx | 2 +- .../grid/components/formatter/BooleanFormatter.tsx | 6 +++--- .../grid/components/formatter/DefaultFormatter.tsx | 4 ++-- .../components/formatter/ForeignKeyFormatter.tsx | 6 +++--- .../grid/components/formatter/JsonFormatter.tsx | 4 ++-- .../components/grid/components/grid/AddColumn.tsx | 2 +- .../components/grid/components/grid/ColumnHeader.tsx | 2 +- apps/studio/components/grid/components/grid/Grid.tsx | 2 +- .../components/grid/components/grid/RowRenderer.tsx | 4 ++-- .../components/grid/components/grid/SelectColumn.tsx | 2 +- .../components/grid/components/header/Header.tsx | 2 +- .../grid/components/header/RefreshButton.tsx | 6 +++--- .../grid/components/header/filter/FilterPopover.tsx | 2 +- .../grid/components/header/filter/FilterRow.tsx | 2 +- .../grid/components/header/sort/SortPopover.tsx | 2 +- .../grid/components/header/sort/SortRow.tsx | 2 +- .../components/grid/components/menu/ColumnMenu.tsx | 2 +- .../grid/components/menu/RowContextMenu.tsx | 2 +- apps/studio/components/grid/constants.ts | 4 ---- apps/studio/components/grid/query/Query.utils.ts | 2 +- apps/studio/components/grid/query/QueryAction.ts | 2 +- apps/studio/components/grid/query/QueryFilter.ts | 2 +- apps/studio/components/grid/query/QueryModifier.ts | 2 +- apps/studio/components/grid/queue.ts | 3 +++ apps/studio/components/grid/store/reducers/base.ts | 2 +- .../components/grid/store/reducers/callback.ts | 2 +- apps/studio/components/grid/store/reducers/column.ts | 2 +- apps/studio/components/grid/store/reducers/row.ts | 2 +- apps/studio/components/grid/utils/column.ts | 2 +- apps/studio/components/grid/utils/gridColumns.tsx | 2 +- apps/studio/components/grid/utils/types.ts | 2 +- .../components/interfaces/Account/AuditLogs.tsx | 2 +- .../Account/Preferences/AccountInformation.tsx | 2 +- .../Account/Preferences/ProfileInformation.tsx | 4 ++-- .../components/interfaces/App/CommandMenuWrapper.tsx | 2 +- .../interfaces/AuditLogs/LogDetailsPanel.tsx | 2 +- .../interfaces/Auth/AuthProvidersForm/FormField.tsx | 2 +- .../Auth/AuthProvidersForm/ProviderForm.tsx | 4 ++-- .../Auth/EmailTemplates/TemplateEditor.tsx | 2 +- .../AIPolicyEditorPanel/AIPolicyEditorPanel.utils.ts | 2 +- .../Policies/AIPolicyEditorPanel/AIPolicyHeader.tsx | 2 +- .../Policies/AIPolicyEditorPanel/PolicyDetails.tsx | 2 +- .../Auth/Policies/AIPolicyEditorPanel/index.tsx | 2 +- .../interfaces/Auth/Policies/PolicyReview.tsx | 2 +- .../interfaces/Auth/SmtpForm/SmtpForm.utils.ts | 2 +- .../interfaces/Auth/Users/UserDropdown.tsx | 2 +- .../interfaces/Auth/Users/UserListItem.utils.ts | 2 +- .../interfaces/Auth/Users/UserSidePanel.tsx | 2 +- .../components/interfaces/Auth/Users/UsersList.tsx | 4 ++-- .../interfaces/Auth/Users/UsersListItem.tsx | 2 +- .../interfaces/Billing/NoProjectsOnPaidOrgInfo.tsx | 2 +- .../Billing/Subscription/Subscription.utils.ts | 2 +- .../interfaces/BranchManagement/BranchPanels.tsx | 4 ++-- .../BranchManagement/BranchStatusBadge.tsx | 2 +- .../interfaces/BranchManagement/Overview.tsx | 4 ++-- .../interfaces/Database/Backups/BackupItem.tsx | 2 +- .../interfaces/Database/Backups/PITR/PITR.utils.ts | 4 ++-- .../Database/Backups/PITR/PITRSelection.tsx | 2 +- .../interfaces/Database/Backups/PITR/PITRStatus.tsx | 2 +- .../interfaces/Database/Backups/PITR/TimeInput.tsx | 2 +- .../Database/Backups/PITR/TimezoneSelection.tsx | 2 +- .../EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx | 2 +- .../interfaces/Database/Functions/CreateFunction.tsx | 2 +- .../interfaces/Database/Functions/Functions.utils.ts | 2 +- .../Functions/FunctionsList/FunctionsList.tsx | 2 +- .../interfaces/Database/Hooks/DeleteHookModal.tsx | 2 +- .../interfaces/Database/Hooks/EditHookPanel.tsx | 2 +- .../Database/Privileges/Privileges.utils.ts | 4 ++-- .../Database/Privileges/PrivilegesHead.tsx | 2 +- .../Database/Privileges/PrivilegesTable.tsx | 2 +- .../interfaces/Database/Roles/DeleteRoleModal.tsx | 2 +- .../components/interfaces/Database/Roles/RoleRow.tsx | 2 +- .../interfaces/Database/Schemas/SchemaGraph.tsx | 2 +- .../Database/Triggers/ChooseFunctionForm.tsx | 2 +- .../interfaces/Database/Triggers/CreateTrigger.tsx | 2 +- .../Database/Wrappers/DeleteWrapperModal.tsx | 2 +- .../interfaces/Database/Wrappers/InputField.tsx | 2 +- .../interfaces/Database/Wrappers/WrapperRow.tsx | 4 ++-- .../Database/Wrappers/WrapperTableEditor.tsx | 2 +- .../Database/Wrappers/Wrappers.constants.ts | 2 +- .../interfaces/Database/Wrappers/Wrappers.utils.ts | 2 +- .../components/interfaces/Docs/Authentication.tsx | 2 +- .../components/interfaces/Docs/Introduction.tsx | 2 +- .../components/interfaces/Docs/LangSelector.tsx | 2 +- .../interfaces/Docs/Pages/UserManagement.tsx | 2 +- .../EdgeFunctionSecrets/EdgeFunctionSecret.tsx | 2 +- .../interfaces/Functions/EdgeFunctionsListItem.tsx | 2 +- .../interfaces/Functions/TerminalInstructions.tsx | 2 +- .../interfaces/Home/Connect/ConnectTabContent.tsx | 2 +- .../Connect/content/astro/supabasejs/content.tsx | 2 +- .../Home/Connect/content/drizzle/content.tsx | 2 +- .../content/exporeactnative/supabasejs/content.tsx | 2 +- .../content/nextjs/app/supabasejs/content.tsx | 2 +- .../content/nextjs/pages/supabasejs/content.tsx | 2 +- .../Home/Connect/content/nuxt/supabasejs/content.tsx | 2 +- .../Home/Connect/content/prisma/content.tsx | 2 +- .../Connect/content/react/supabasejs/content.tsx | 2 +- .../Connect/content/refine/supabasejs/content.tsx | 2 +- .../Connect/content/remix/supabasejs/content.tsx | 2 +- .../Connect/content/solidjs/supabasejs/content.tsx | 2 +- .../Connect/content/sveltekit/supabasejs/content.tsx | 2 +- .../Connect/content/vuejs/supabasejs/content.tsx | 2 +- .../interfaces/Home/ProjectList/ProjectCard.tsx | 6 +++--- .../interfaces/Home/ProjectList/ProjectCard.utils.ts | 2 +- .../Home/ProjectList/ProjectCardStatus.tsx | 2 +- .../interfaces/Home/ProjectList/ProjectList.tsx | 2 +- .../components/interfaces/Home/ProjectUsage.tsx | 2 +- .../Integrations/IntegrationConnection.tsx | 2 +- .../interfaces/Integrations/IntegrationPanels.tsx | 5 ++++- .../interfaces/Integrations/OrganizationPicker.tsx | 4 ++-- .../BillingBreakdown/BillingMetric.tsx | 4 ++-- .../BillingBreakdown/ComputeMetric.tsx | 2 +- .../PaymentMethods/ChangePaymentMethodModal.tsx | 4 ++-- .../PaymentMethods/DeletePaymentMethodModal.tsx | 2 +- .../BillingSettings/Subscription/DowngradeModal.tsx | 4 ++-- .../BillingSettings/Subscription/ExitSurveyModal.tsx | 2 +- .../Subscription/PlanUpdateSidePanel.tsx | 2 +- .../IntegrationSettings/IntegrationSettings.tsx | 2 +- .../SidePanelGitHubRepoLinker.tsx | 2 +- .../NewProject/FreeProjectLimitWarning.tsx | 2 +- .../Organization/OAuthApps/AuthorizedAppRow.tsx | 2 +- .../Organization/OAuthApps/DeleteAppModal.tsx | 2 +- .../Organization/OAuthApps/OAuthAppRow.tsx | 2 +- .../OAuthApps/PublishAppSidePanel/index.tsx | 4 ++-- .../Organization/OAuthApps/RevokeAppModal.tsx | 2 +- .../interfaces/Organization/Organization.utils.ts | 2 +- .../Organization/TeamSettings/InviteMemberButton.tsx | 4 ++-- .../Organization/TeamSettings/MemberActions.tsx | 4 ++-- .../Organization/TeamSettings/TeamSettings.utils.ts | 4 ++-- .../interfaces/Organization/Usage/Activity.tsx | 2 +- .../interfaces/Organization/Usage/Bandwidth.tsx | 2 +- .../interfaces/Organization/Usage/Compute.tsx | 2 +- .../interfaces/Organization/Usage/SizeAndCounts.tsx | 2 +- .../interfaces/Organization/Usage/TotalUsage.tsx | 2 +- .../Organization/Usage/Usage.constants.tsx | 4 ++-- .../interfaces/Organization/Usage/Usage.utils.ts | 2 +- .../Organization/Usage/UsageChartTooltips.tsx | 2 +- .../Usage/UsageSection/AttributeUsage.tsx | 6 +++--- .../Organization/Usage/UsageSection/UsageSection.tsx | 2 +- .../interfaces/ProjectAPIDocs/Content/Bucket.tsx | 2 +- .../ProjectAPIDocs/Content/EdgeFunction.tsx | 2 +- .../ProjectAPIDocs/Content/EdgeFunctions.tsx | 2 +- .../interfaces/ProjectAPIDocs/Content/Entities.tsx | 2 +- .../interfaces/ProjectAPIDocs/Content/Entity.tsx | 2 +- .../ProjectAPIDocs/Content/Introduction.tsx | 2 +- .../interfaces/ProjectAPIDocs/Content/RPC.tsx | 2 +- .../interfaces/ProjectAPIDocs/Content/Realtime.tsx | 2 +- .../interfaces/ProjectAPIDocs/Content/Storage.tsx | 2 +- .../ProjectAPIDocs/Content/StoredProcedures.tsx | 2 +- .../ProjectAPIDocs/Content/UserManagement.tsx | 2 +- .../Realtime/Inspector/MessageSelection.tsx | 2 +- .../interfaces/Realtime/Inspector/MessagesTable.tsx | 2 +- .../Inspector/RealtimeMessageColumnRenderer.tsx | 2 +- .../Inspector/SelectedRealtimeMessagePanel.tsx | 2 +- .../Realtime/Inspector/useRealtimeMessages.ts | 2 +- .../interfaces/Reports/ReportFilterBar.tsx | 2 +- .../components/interfaces/Reports/ReportWidget.tsx | 2 +- .../components/interfaces/Reports/Reports.queries.ts | 2 -- .../components/interfaces/Reports/Reports.types.ts | 2 +- .../components/interfaces/Reports/Reports.utils.tsx | 2 +- .../RoleImpersonationPopover.tsx | 2 +- .../interfaces/SQLEditor/DownloadSnippetModal.tsx | 2 +- .../components/interfaces/SQLEditor/MonacoEditor.tsx | 4 ++-- .../interfaces/SQLEditor/RenameQueryModal.tsx | 2 +- .../interfaces/SQLEditor/SQLEditor.constants.ts | 4 ++-- .../components/interfaces/SQLEditor/SQLEditor.tsx | 4 ++-- .../interfaces/SQLEditor/SQLEditor.utils.ts | 2 +- .../SQLEditor/SQLTemplates/SQLQuickstarts.tsx | 2 +- .../SQLEditor/SQLTemplates/SQLTemplates.tsx | 2 +- .../SQLEditor/UtilityPanel/FavoriteButton.tsx | 2 +- .../components/interfaces/Settings/Addons/Addons.tsx | 2 +- .../Settings/Addons/ComputeInstanceSidePanel.tsx | 2 +- .../Settings/Addons/CustomDomainSidePanel.tsx | 2 +- .../interfaces/Settings/Addons/IPv4SidePanel.tsx | 2 +- .../interfaces/Settings/Addons/PITRSidePanel.tsx | 2 +- .../DatabaseSettings/DatabaseSettings.utils.ts | 2 +- .../CustomDomainConfig/CustomDomainActivate.tsx | 2 +- .../CustomDomainConfig/CustomDomainDelete.tsx | 2 +- .../CustomDomainConfig/CustomDomainVerify.tsx | 4 ++-- .../DropReplicaConfirmationModal.tsx | 2 +- .../InstanceConfiguration.utils.ts | 4 ++-- .../GitHubIntegrationConnectionForm.tsx | 2 +- .../Integrations/GithubIntegration/GithubSection.tsx | 5 ++++- .../VercelIntegrationConnectionForm.tsx | 5 ++++- .../Integrations/VercelIntegration/VercelSection.tsx | 5 ++++- .../LogColumnRenderers/DatabaseApiColumnRender.tsx | 2 +- .../DatabasePostgresColumnRender.tsx | 2 +- .../LogColumnRenderers/FunctionsEdgeColumnRender.tsx | 2 +- .../LogColumnRenderers/FunctionsLogsColumnRender.tsx | 2 +- .../interfaces/Settings/Logs/LogEventChart.tsx | 2 +- .../interfaces/Settings/Logs/LogSelection.tsx | 2 +- .../components/interfaces/Settings/Logs/LogTable.tsx | 2 +- .../interfaces/Settings/Logs/Logs.types.ts | 2 +- .../interfaces/Settings/Logs/Logs.utils.ts | 2 +- .../interfaces/Settings/Logs/RecentQueriesItem.tsx | 2 +- .../Settings/Vault/Secrets/DeleteSecretModal.tsx | 2 +- .../Settings/Vault/Secrets/EditSecretModal.tsx | 2 +- .../interfaces/Settings/Vault/Secrets/SecretRow.tsx | 2 +- .../Settings/Vault/Secrets/SecretsManagement.tsx | 2 +- .../components/interfaces/SignIn/SignInForm.tsx | 3 +-- .../components/interfaces/SignIn/SignInMfaForm.tsx | 2 +- .../interfaces/Storage/EditBucketModal.tsx | 2 +- .../components/interfaces/Storage/Storage.types.ts | 2 +- .../components/interfaces/Support/SupportForm.tsx | 2 +- .../TableGridEditor/DeleteConfirmationDialogs.tsx | 5 ++--- .../ColumnEditor/ColumnDefaultValue.tsx | 6 +++--- .../ColumnEditor/ColumnEditor.constants.ts | 4 ++-- .../SidePanelEditor/ColumnEditor/ColumnEditor.tsx | 10 +++++++--- .../ColumnEditor/ColumnEditor.utils.ts | 4 ++-- .../ColumnEditor/ColumnForeignKey.tsx | 4 ++-- .../SidePanelEditor/ColumnEditor/ColumnType.tsx | 4 ++-- .../ColumnEditor/InputWithSuggestions.tsx | 2 +- .../ForeignKeySelector/ForeignKeySelector.tsx | 6 +++--- .../ForeignKeySelector/ForeignKeySelector.utils.tsx | 4 ++-- .../ForeignRowSelector/ForeignRowSelector.tsx | 4 ++-- .../RowEditor/ForeignRowSelector/SelectorGrid.tsx | 2 +- .../SidePanelEditor/RowEditor/InputField.tsx | 2 +- .../JsonEditor/DrilldownViewer/DrilldownPane.tsx | 2 +- .../JsonEditor/DrilldownViewer/DrilldownViewer.tsx | 2 +- .../SidePanelEditor/RowEditor/RowEditor.tsx | 4 ++-- .../SidePanelEditor/RowEditor/RowEditor.utils.ts | 4 ++-- .../SidePanelEditor/SidePanelEditor.constants.ts | 2 +- .../SidePanelEditor/SidePanelEditor.tsx | 12 ++++++------ .../SidePanelEditor/SidePanelEditor.utils.tsx | 12 ++++++------ .../SpreadSheetImportConfiguration.tsx | 2 +- .../SpreadsheetImport/SpreadsheetImport.constants.ts | 2 +- .../SpreadsheetImport/SpreadsheetImport.tsx | 6 +++--- .../SpreadsheetImport/SpreadsheetImport.types.ts | 2 +- .../SpreadsheetImport/SpreadsheetImportPreview.tsx | 4 ++-- .../SidePanelEditor/TableEditor/Column.tsx | 6 +++--- .../SidePanelEditor/TableEditor/ColumnManagement.tsx | 8 ++++---- .../ForeignKeysManagement/ForeignKeyRow.tsx | 2 +- .../ForeignKeysManagement/ForeignKeysManagement.tsx | 6 +++--- .../ForeignKeysManagement.utils.ts | 4 ++-- .../TableEditor/TableEditor.constants.ts | 2 +- .../SidePanelEditor/TableEditor/TableEditor.tsx | 6 +++--- .../SidePanelEditor/TableEditor/TableEditor.types.ts | 4 ++-- .../SidePanelEditor/TableEditor/TableEditor.utils.ts | 6 +++--- .../interfaces/TableGridEditor/TableGridEditor.tsx | 4 ++-- .../components/layouts/APIAuthorizationLayout.tsx | 2 +- .../layouts/AccountLayout/AccountLayout.tsx | 2 +- .../components/layouts/AccountLayout/WithSidebar.tsx | 2 +- .../GithubRepositorySelection.tsx | 2 +- .../components/layouts/AppLayout/ProjectDropdown.tsx | 2 +- .../layouts/AuthLayout/AuthLayout.utils.ts | 2 +- apps/studio/components/layouts/BillingLayout.tsx | 2 +- .../layouts/DatabaseLayout/DatabaseMenu.utils.ts | 4 ++-- .../layouts/DocsLayout/DocsLayout.utils.tsx | 2 +- apps/studio/components/layouts/FunctionsLayout.tsx | 2 +- .../layouts/IntegrationsLayout/Integrations.utils.ts | 6 +++--- .../components/layouts/LogsLayout/LogsMenu.utils.ts | 7 +++++-- .../studio/components/layouts/OrganizationLayout.tsx | 3 +-- .../layouts/ProjectLayout/ConnectingState.tsx | 2 +- .../NotificationsPopoverV2/NotificationRow.tsx | 4 ++-- .../NavigationBar/NavigationBar.utils.tsx | 4 ++-- .../NavigationBar/NavigationIconLink.tsx | 2 +- .../ProjectSettingsLayout/SettingsMenu.utils.ts | 6 +++--- .../layouts/RealtimeLayout/RealtimeMenu.utils.ts | 4 ++-- .../components/layouts/SQLEditorLayout/QueryItem.tsx | 2 +- .../layouts/SQLEditorLayout/QueryItemActions.tsx | 2 +- .../components/layouts/StorageLayout/BucketRow.tsx | 2 +- .../layouts/StorageLayout/StorageBucketsError.tsx | 2 +- .../components/layouts/StorageLayout/StorageMenu.tsx | 2 +- .../layouts/TableEditorLayout/EntityListItem.tsx | 4 ++-- .../layouts/TableEditorLayout/TableEditorMenu.tsx | 2 -- .../components/layouts/VercelIntegrationLayout.tsx | 2 +- apps/studio/components/layouts/WizardLayout.tsx | 2 +- .../components/to-be-cleaned/Charts/ChartHandler.tsx | 4 ++-- .../to-be-cleaned/Storage/EmptyBucketModal.tsx | 2 +- .../to-be-cleaned/Storage/Storage.utils.ts | 2 +- .../Storage/StorageExplorer/FileExplorer.tsx | 2 +- .../Storage/StorageExplorer/FileExplorerColumn.tsx | 2 +- .../Storage/StorageExplorer/FileExplorerRow.tsx | 2 +- .../Storage/StorageExplorer/StorageExplorer.tsx | 2 +- apps/studio/components/ui/AlertError.tsx | 2 +- apps/studio/components/ui/Charts/AreaChart.tsx | 2 +- apps/studio/components/ui/Charts/BarChart.tsx | 4 ++-- apps/studio/components/ui/Charts/Charts.utils.tsx | 2 +- apps/studio/components/ui/Charts/StackedBarChart.tsx | 2 +- .../CodeEditor/Providers/PgSQLCompletionProvider.ts | 8 ++++---- .../components/ui/DatePicker/TimeSplitInput.tsx | 2 +- apps/studio/components/ui/Flag/FlagProvider.tsx | 2 +- .../ui/OveragesBanner/OveragesBanner.utils.ts | 2 +- .../studio/components/ui/ProductMenu/ProductMenu.tsx | 2 +- .../ResourceExhaustionWarningBanner.utils.ts | 2 +- apps/studio/data/__templates/resource-query.ts | 2 +- .../data/__templates/resource-update-mutation.ts | 2 +- apps/studio/data/__templates/resources-query.ts | 2 +- .../access-tokens/access-tokens-create-mutation.ts | 4 ++-- .../access-tokens/access-tokens-delete-mutation.ts | 2 +- apps/studio/data/ai/sql-debug-mutation.ts | 2 +- apps/studio/data/ai/sql-edit-mutation.ts | 2 +- apps/studio/data/ai/sql-generate-mutation.ts | 2 +- apps/studio/data/ai/sql-title-mutation.ts | 2 +- apps/studio/data/analytics/infra-monitoring-query.ts | 2 +- .../data/analytics/org-daily-compute-stats-query.ts | 4 ++-- apps/studio/data/analytics/org-daily-stats-query.ts | 2 +- .../analytics/project-log-requests-count-query.ts | 2 +- .../api-authorization-approve-mutation.ts | 2 +- .../api-authorization-decline-mutation.ts | 2 +- .../api-authorization/api-authorization-query.ts | 2 +- apps/studio/data/auth/auth-config-query.ts | 4 ++-- apps/studio/data/auth/auth-config-update-mutation.ts | 4 ++-- apps/studio/data/auth/user-create-mutation.ts | 2 +- .../data/auth/user-delete-mfa-factors-mutation.ts | 2 +- apps/studio/data/auth/user-delete-mutation.ts | 4 ++-- apps/studio/data/auth/user-invite-mutation.ts | 2 +- .../studio/data/auth/user-reset-password-mutation.ts | 4 ++-- .../data/auth/user-send-magic-link-mutation.ts | 4 ++-- apps/studio/data/auth/user-send-otp-mutation.ts | 4 ++-- apps/studio/data/auth/users-query.ts | 4 ++-- .../data/banned-ips/banned-ips-delete-mutations.ts | 2 +- apps/studio/data/banned-ips/banned-ips-query.ts | 2 +- apps/studio/data/branches/branch-create-mutation.ts | 2 +- apps/studio/data/branches/branch-delete-mutation.ts | 2 +- apps/studio/data/branches/branch-query.ts | 2 +- apps/studio/data/branches/branch-update-mutation.ts | 2 +- .../data/branches/branches-disable-mutation.ts | 2 +- apps/studio/data/branches/branches-query.ts | 4 ++-- .../studio/data/config/jwt-secret-update-mutation.ts | 2 +- apps/studio/data/config/pgbouncer-enabled-query.ts | 2 +- apps/studio/data/config/project-api-query.ts | 2 +- .../data/config/project-disk-resize-mutation.ts | 2 +- .../project-postgrest-config-update-mutation.ts | 2 +- apps/studio/data/config/project-settings-query.ts | 4 ++-- .../data/config/project-storage-config-query.ts | 2 +- .../config/project-storage-config-update-mutation.ts | 2 +- .../project-temp-disable-read-only-mutation.ts | 2 +- .../data/config/project-upgrade-eligibility-query.ts | 2 +- apps/studio/data/content/content-delete-mutation.ts | 2 +- apps/studio/data/content/content-insert-mutation.ts | 6 +++--- apps/studio/data/content/content-query.ts | 2 +- apps/studio/data/content/content-upsert-mutation.ts | 6 +++--- .../data/custom-domains/check-cname-mutation.ts | 2 +- .../custom-domains-activate-mutation.ts | 2 +- .../custom-domains/custom-domains-create-mutation.ts | 2 +- .../custom-domains/custom-domains-delete-mutation.ts | 2 +- .../data/custom-domains/custom-domains-query.ts | 2 +- .../custom-domains-reverify-mutation.ts | 2 +- .../database-column-create-mutation.ts | 4 ++-- .../database-column-delete-mutation.ts | 4 ++-- .../database-column-update-mutation.ts | 4 ++-- .../database-extension-disable-mutation.ts | 2 +- .../database-extension-enable-mutation.ts | 2 +- .../database-extensions/database-extensions-query.ts | 2 +- .../database-functions-create-mutation.ts | 4 ++-- .../database-functions-delete-mutation.ts | 2 +- .../database-functions/database-functions-query.ts | 4 ++-- .../database-functions-update-mutation.ts | 4 ++-- .../database-policies/database-policies-query.ts | 2 +- .../database-policy-create-mutation.ts | 4 ++-- .../database-policy-delete-mutation.ts | 2 +- .../database-policy-update-mutation.ts | 2 +- .../database-publications-create-mutation.ts | 2 +- .../database-publications-query.ts | 2 +- .../database-publications-update-mutation.ts | 2 +- .../database-roles/database-role-create-mutation.ts | 4 ++-- .../database-roles/database-role-delete-mutation.ts | 2 +- .../database-roles/database-role-update-mutation.ts | 4 ++-- .../data/database-roles/database-roles-query.ts | 4 ++-- .../database-trigger-create-mutation.ts | 4 ++-- .../database-trigger-delete-mutation.ts | 4 ++-- .../database-trigger-update-mutation.ts | 4 ++-- .../database-trigger-update-transaction-mutation.ts | 2 +- .../database-triggers/database-triggers-query.ts | 4 ++-- .../studio/data/database/backup-download-mutation.ts | 2 +- apps/studio/data/database/backup-restore-mutation.ts | 4 ++-- apps/studio/data/database/backups-query.ts | 4 ++-- .../database/database-password-reset-mutation.ts | 2 +- apps/studio/data/database/hooks-enable-mutation.ts | 2 +- apps/studio/data/database/indexes-query.ts | 2 +- apps/studio/data/database/pitr-restore-mutation.ts | 2 +- .../data/database/pooling-configuration-query.ts | 4 ++-- .../pooling-configuration-update-mutation.ts | 4 ++-- apps/studio/data/database/schema-create-mutation.ts | 2 +- apps/studio/data/database/schemas-query.ts | 4 ++-- apps/studio/data/documents/document-query.ts | 2 +- .../edge-functions/edge-functions-delete-mutation.ts | 2 +- .../data/edge-functions/edge-functions-query.ts | 2 +- .../edge-functions/edge-functions-update-mutation.ts | 2 +- .../data/entity-types/entity-types-infinite-query.ts | 2 +- .../enumerated-type-create-mutation.ts | 2 +- .../enumerated-type-delete-mutation.ts | 2 +- .../enumerated-type-update-mutation.ts | 2 +- .../data/enumerated-types/enumerated-types-query.ts | 4 ++-- apps/studio/data/fdw/fdw-create-mutation.ts | 2 +- apps/studio/data/fdw/fdw-delete-mutation.ts | 4 ++-- apps/studio/data/fdw/fdw-update-mutation.ts | 4 ++-- apps/studio/data/feedback/exit-survey-send.ts | 2 +- apps/studio/data/feedback/feedback-send.ts | 2 +- apps/studio/data/feedback/support-ticket-send.ts | 2 +- apps/studio/data/fetchers.ts | 4 ++-- .../data/foreign-tables/foreign-table-query.ts | 2 +- .../github-authorization-create-mutation.ts | 2 +- .../data/integrations/github-authorization-query.ts | 2 +- .../data/integrations/github-branch-check-query.ts | 2 +- .../data/integrations/github-branches-query.ts | 2 +- .../github-connection-create-mutation.ts | 4 ++-- .../github-connection-delete-mutation.ts | 2 +- .../github-connection-update-mutation.ts | 2 +- .../data/integrations/github-connections-query.ts | 2 +- .../data/integrations/github-pull-requests-query.ts | 4 ++-- .../data/integrations/github-repositories-query.ts | 2 +- .../data/integrations/integrations-query-org-only.ts | 4 ++-- apps/studio/data/integrations/integrations-query.ts | 2 +- ...egrations-vercel-connection-sync-envs-mutation.ts | 2 +- ...ntegrations-vercel-connections-create-mutation.ts | 4 ++-- ...ns-vercel-installed-connection-delete-mutation.ts | 2 +- .../integrations-vercel-projects-query.ts | 2 +- apps/studio/data/integrations/integrations.types.ts | 2 +- .../integrations/vercel-connection-update-mutate.ts | 4 ++-- .../vercel-integration-create-mutation.ts | 2 +- apps/studio/data/invoices/invoice-query.ts | 2 +- apps/studio/data/invoices/invoices-count-query.ts | 2 +- apps/studio/data/invoices/invoices-overdue-query.ts | 2 +- apps/studio/data/invoices/invoices-query.ts | 2 +- .../data/invoices/org-invoice-upcoming-query.ts | 2 +- .../materialized-views/materialized-view-query.ts | 2 +- apps/studio/data/misc/get-default-region-query.ts | 2 +- apps/studio/data/misc/reset-password-mutation.ts | 2 +- apps/studio/data/misc/signup-mutation.ts | 2 +- .../network-retrictions-apply-mutation.ts | 2 +- .../notifications/notifications-dismiss-mutation.ts | 2 +- .../studio/data/notifications/notifications-query.ts | 2 +- .../notifications/notifications-update-mutation.ts | 2 +- .../notifications-v2-archive-all-mutation.ts | 2 +- .../data/notifications/notifications-v2-query.ts | 4 ++-- .../notifications/notifications-v2-summary-query.ts | 4 ++-- .../notifications-v2-update-mutation.ts | 2 +- .../data/oauth/authorized-app-revoke-mutation.ts | 2 +- apps/studio/data/oauth/authorized-apps-query.ts | 2 +- apps/studio/data/oauth/oauth-app-create-mutation.ts | 4 ++-- apps/studio/data/oauth/oauth-app-delete-mutation.ts | 2 +- apps/studio/data/oauth/oauth-app-update-mutation.ts | 4 ++-- apps/studio/data/oauth/oauth-apps-query.ts | 4 ++-- apps/studio/data/open-api/api-spec-query.ts | 2 +- .../organizations/free-project-limit-check-query.ts | 3 +-- .../organizations/organization-audit-logs-query.ts | 2 +- .../organization-billing-subscription-preview.ts | 4 ++-- .../organization-by-fly-organization-id-mutation.ts | 2 +- .../organizations/organization-create-mutation.ts | 2 +- .../organization-customer-profile-query.ts | 5 ++--- .../organization-customer-profile-update-mutation.ts | 2 +- .../organizations/organization-delete-mutation.ts | 2 +- .../organization-join-decline-mutation.ts | 2 +- .../data/organizations/organization-join-mutation.ts | 2 +- .../organization-join-token-validation-query.ts | 4 ++-- .../organization-member-delete-mutation.ts | 2 +- .../organization-member-invite-create-mutation.ts | 2 +- .../organization-member-invite-delete-mutation.ts | 2 +- .../organization-member-update-mutation.ts | 2 +- .../data/organizations/organization-members-query.ts | 4 ++-- .../organization-payment-method-delete-mutation.ts | 2 +- ...anization-payment-method-setup-intent-mutation.ts | 2 +- .../organization-payment-methods-query.ts | 5 ++--- .../data/organizations/organization-roles-query.ts | 2 +- .../data/organizations/organization-tax-ids-query.ts | 2 +- .../organization-tax-ids-update-mutation.ts | 4 ++-- .../organizations/organization-update-mutation.ts | 4 ++-- .../studio/data/organizations/organizations-query.ts | 2 +- apps/studio/data/permissions/permissions-query.ts | 2 +- .../pg-sodium-keys/pg-sodium-key-create-mutation.ts | 3 +-- .../pg-sodium-keys/pg-sodium-key-delete-mutation.ts | 3 +-- .../privileges/column-privileges-grant-mutation.ts | 4 ++-- .../data/privileges/column-privileges-query.ts | 4 ++-- .../privileges/column-privileges-revoke-mutation.ts | 4 ++-- .../privileges/table-privileges-grant-mutation.ts | 4 ++-- .../studio/data/privileges/table-privileges-query.ts | 4 ++-- .../privileges/table-privileges-revoke-mutation.ts | 4 ++-- .../mfa-authenticator-assurance-level-query.ts | 4 ++-- .../profile/mfa-challenge-and-verify-mutation.ts | 2 +- apps/studio/data/profile/mfa-enroll-mutation.ts | 2 +- apps/studio/data/profile/mfa-list-factors-query.ts | 2 +- apps/studio/data/profile/mfa-unenroll-mutation.ts | 2 +- apps/studio/data/profile/profile-audit-logs-query.ts | 4 ++-- apps/studio/data/profile/profile-create-mutation.ts | 4 ++-- apps/studio/data/profile/profile-query.ts | 4 ++-- apps/studio/data/profile/profile-update-mutation.ts | 2 +- apps/studio/data/profile/types.ts | 2 +- .../projects/project-by-fly-extension-id-mutation.ts | 2 +- apps/studio/data/projects/project-create-mutation.ts | 6 +++--- apps/studio/data/projects/project-delete-mutation.ts | 2 +- apps/studio/data/projects/project-detail-query.ts | 4 ++-- apps/studio/data/projects/project-pause-mutation.ts | 2 +- .../studio/data/projects/project-restart-mutation.ts | 2 +- .../projects/project-restart-services-mutation.ts | 2 +- .../studio/data/projects/project-restore-mutation.ts | 2 +- apps/studio/data/projects/project-status-query.ts | 2 +- .../data/projects/project-type-generation-query.ts | 2 +- apps/studio/data/projects/project-update-mutation.ts | 2 +- .../studio/data/projects/project-upgrade-mutation.ts | 2 +- apps/studio/data/projects/projects-query.ts | 6 +++--- .../data/read-replicas/load-balancers-query.ts | 4 ++-- .../data/read-replicas/replica-remove-mutation.ts | 4 ++-- .../data/read-replicas/replica-setup-mutation.ts | 4 ++-- apps/studio/data/read-replicas/replicas-query.ts | 4 ++-- .../data/read-replicas/replicas-status-query.ts | 2 +- apps/studio/data/secrets/secrets-create-mutation.ts | 2 +- apps/studio/data/secrets/secrets-delete-mutation.ts | 2 +- apps/studio/data/secrets/secrets-query.ts | 4 ++-- .../service-status/edge-functions-status-query.ts | 2 +- .../service-status/postgres-service-status-query.ts | 2 +- .../data/service-status/service-status-query.ts | 2 +- apps/studio/data/sql/keys.ts | 2 +- .../ssl-enforcement-update-mutation.ts | 2 +- apps/studio/data/storage/bucket-create-mutation.ts | 2 +- apps/studio/data/storage/bucket-delete-mutation.ts | 2 +- apps/studio/data/storage/bucket-empty-mutation.ts | 2 +- apps/studio/data/storage/bucket-update-mutation.ts | 2 +- apps/studio/data/storage/buckets-query.ts | 2 +- apps/studio/data/stripe/setup-intent-mutation.ts | 2 +- .../org-subscription-cancel-schedule-mutation.ts | 2 +- .../data/subscriptions/org-subscription-query.ts | 2 +- .../org-subscription-update-mutation.ts | 4 ++-- .../subscriptions/project-addon-remove-mutation.ts | 4 ++-- .../subscriptions/project-addon-update-mutation.ts | 4 ++-- .../data/subscriptions/project-addons-query.ts | 2 +- apps/studio/data/subscriptions/types.ts | 2 +- .../data/table-rows/table-row-create-mutation.ts | 2 +- .../data/table-rows/table-row-delete-all-mutation.ts | 2 +- .../data/table-rows/table-row-delete-mutation.ts | 4 ++-- .../data/table-rows/table-row-truncate-mutation.ts | 2 +- .../data/table-rows/table-row-update-mutation.ts | 2 +- .../studio/data/table-rows/table-rows-count-query.ts | 2 +- apps/studio/data/table-rows/table-rows-query.ts | 2 +- apps/studio/data/table-rows/utils.ts | 4 ++-- apps/studio/data/tables/table-create-mutation.ts | 4 ++-- apps/studio/data/tables/table-delete-mutation.ts | 2 +- apps/studio/data/tables/table-query.ts | 2 +- apps/studio/data/tables/table-update-mutation.ts | 4 ++-- apps/studio/data/tables/tables-query.ts | 4 ++-- apps/studio/data/usage/org-usage-query.ts | 4 ++-- apps/studio/data/usage/resource-warnings-query.ts | 4 ++-- .../data/vault/vault-secret-create-mutation.ts | 2 +- .../data/vault/vault-secret-delete-mutation.ts | 2 +- .../data/vault/vault-secret-update-mutation.ts | 2 +- apps/studio/data/vault/vault-secrets-query.ts | 2 +- apps/studio/data/views/view-query.ts | 4 ++-- apps/studio/data/views/views-query.ts | 2 +- apps/studio/hooks/analytics/useLogsQuery.tsx | 6 +++++- apps/studio/hooks/misc/useCheckPermissions.ts | 2 +- apps/studio/hooks/misc/useEntityType.ts | 2 +- apps/studio/hooks/misc/useIsFeatureEnabled.ts | 2 +- apps/studio/hooks/misc/useStore.tsx | 2 +- apps/studio/lib/api/apiAuthenticate.ts | 2 +- apps/studio/lib/api/apiWrapper.ts | 2 +- apps/studio/lib/common/fetch/base.ts | 2 +- apps/studio/lib/common/fetch/delete.ts | 2 +- apps/studio/lib/common/fetch/get.ts | 2 +- apps/studio/lib/common/fetch/head.ts | 2 +- apps/studio/lib/common/fetch/patch.ts | 2 +- apps/studio/lib/common/fetch/post.ts | 2 +- apps/studio/lib/common/fetch/put.ts | 2 +- apps/studio/lib/configcat.ts | 2 +- apps/studio/lib/constants/infrastructure.ts | 2 +- apps/studio/lib/integration-utils.ts | 4 ++-- apps/studio/lib/profile.tsx | 4 ++-- apps/studio/lib/role-impersonation.ts | 2 +- apps/studio/lib/telemetry.ts | 4 ++-- apps/studio/pages/_app.tsx | 2 +- apps/studio/pages/account/audit.tsx | 2 +- apps/studio/pages/account/me.tsx | 2 +- apps/studio/pages/account/security.tsx | 2 +- apps/studio/pages/account/tokens.tsx | 2 +- apps/studio/pages/api/projects/[ref]/content.ts | 2 +- apps/studio/pages/authorize.tsx | 2 +- apps/studio/pages/forgot-password.tsx | 2 +- .../vercel/[slug]/deploy-button/new-project.tsx | 2 +- .../vercel/[slug]/marketplace/choose-project.tsx | 2 +- apps/studio/pages/integrations/vercel/install.tsx | 2 +- apps/studio/pages/new/[slug].tsx | 4 ++-- apps/studio/pages/new/index.tsx | 2 +- apps/studio/pages/org/[slug]/apps.tsx | 2 +- apps/studio/pages/org/[slug]/audit.tsx | 2 +- apps/studio/pages/org/[slug]/billing.tsx | 2 +- apps/studio/pages/org/[slug]/documents.tsx | 2 +- apps/studio/pages/org/[slug]/general.tsx | 2 +- apps/studio/pages/org/[slug]/index.tsx | 2 +- apps/studio/pages/org/[slug]/integrations.tsx | 2 +- apps/studio/pages/org/[slug]/invoices.tsx | 2 +- apps/studio/pages/org/[slug]/team.tsx | 2 +- apps/studio/pages/org/[slug]/usage.tsx | 2 +- apps/studio/pages/project/[ref]/api/graphiql.tsx | 2 +- apps/studio/pages/project/[ref]/api/index.tsx | 2 +- .../pages/project/[ref]/auth/column-privileges.tsx | 4 ++-- apps/studio/pages/project/[ref]/auth/hooks.tsx | 2 +- apps/studio/pages/project/[ref]/auth/index.tsx | 2 +- apps/studio/pages/project/[ref]/auth/policies.tsx | 4 ++-- apps/studio/pages/project/[ref]/auth/providers.tsx | 2 +- apps/studio/pages/project/[ref]/auth/rate-limits.tsx | 2 +- apps/studio/pages/project/[ref]/auth/templates.tsx | 2 +- .../pages/project/[ref]/auth/url-configuration.tsx | 2 +- apps/studio/pages/project/[ref]/auth/users.tsx | 2 +- apps/studio/pages/project/[ref]/branches.tsx | 2 +- apps/studio/pages/project/[ref]/building.tsx | 2 +- .../pages/project/[ref]/database/backups/pitr.tsx | 2 +- .../project/[ref]/database/backups/scheduled.tsx | 2 +- .../pages/project/[ref]/database/extensions.tsx | 2 +- .../pages/project/[ref]/database/functions.tsx | 2 +- apps/studio/pages/project/[ref]/database/hooks.tsx | 2 +- apps/studio/pages/project/[ref]/database/index.tsx | 2 +- apps/studio/pages/project/[ref]/database/indexes.tsx | 2 +- .../pages/project/[ref]/database/migrations.tsx | 2 +- .../pages/project/[ref]/database/replication.tsx | 2 +- apps/studio/pages/project/[ref]/database/roles.tsx | 2 +- apps/studio/pages/project/[ref]/database/schemas.tsx | 2 +- apps/studio/pages/project/[ref]/database/tables.tsx | 6 +++--- .../studio/pages/project/[ref]/database/triggers.tsx | 2 +- apps/studio/pages/project/[ref]/database/types.tsx | 2 +- .../pages/project/[ref]/database/wrappers/[id].tsx | 2 +- .../pages/project/[ref]/database/wrappers/index.tsx | 2 +- .../pages/project/[ref]/database/wrappers/new.tsx | 2 +- apps/studio/pages/project/[ref]/editor/[id].tsx | 2 +- apps/studio/pages/project/[ref]/editor/index.tsx | 4 ++-- .../[ref]/functions/[functionSlug]/details.tsx | 2 +- .../project/[ref]/functions/[functionSlug]/index.tsx | 2 +- .../[ref]/functions/[functionSlug]/invocations.tsx | 2 +- .../project/[ref]/functions/[functionSlug]/logs.tsx | 2 +- apps/studio/pages/project/[ref]/functions/index.tsx | 2 +- apps/studio/pages/project/[ref]/index.tsx | 2 +- apps/studio/pages/project/[ref]/logs/auth-logs.tsx | 2 +- apps/studio/pages/project/[ref]/logs/edge-logs.tsx | 2 +- .../pages/project/[ref]/logs/explorer/index.tsx | 2 +- .../pages/project/[ref]/logs/explorer/recent.tsx | 2 +- .../pages/project/[ref]/logs/explorer/saved.tsx | 2 +- .../pages/project/[ref]/logs/explorer/templates.tsx | 2 +- apps/studio/pages/project/[ref]/logs/pooler-logs.tsx | 2 +- .../pages/project/[ref]/logs/postgres-logs.tsx | 2 +- .../pages/project/[ref]/logs/postgrest-logs.tsx | 2 +- .../pages/project/[ref]/logs/realtime-logs.tsx | 2 +- .../studio/pages/project/[ref]/logs/storage-logs.tsx | 2 +- .../pages/project/[ref]/realtime/inspector.tsx | 2 +- apps/studio/pages/project/[ref]/reports/[id].tsx | 2 +- apps/studio/pages/project/[ref]/reports/database.tsx | 4 ++-- apps/studio/pages/project/[ref]/reports/index.tsx | 2 +- .../project/[ref]/reports/query-performance.tsx | 2 +- apps/studio/pages/project/[ref]/reports/storage.tsx | 2 +- apps/studio/pages/project/[ref]/settings/addons.tsx | 2 +- apps/studio/pages/project/[ref]/settings/api.tsx | 2 +- apps/studio/pages/project/[ref]/settings/auth.tsx | 2 +- .../pages/project/[ref]/settings/billing/usage.tsx | 2 +- .../studio/pages/project/[ref]/settings/database.tsx | 2 +- .../pages/project/[ref]/settings/functions.tsx | 2 +- apps/studio/pages/project/[ref]/settings/general.tsx | 2 +- apps/studio/pages/project/[ref]/settings/index.tsx | 2 +- .../pages/project/[ref]/settings/infrastructure.tsx | 2 +- .../pages/project/[ref]/settings/integrations.tsx | 2 +- apps/studio/pages/project/[ref]/settings/storage.tsx | 2 +- .../pages/project/[ref]/settings/vault/keys.tsx | 2 +- .../pages/project/[ref]/settings/vault/secrets.tsx | 2 +- apps/studio/pages/project/[ref]/sql/[id].tsx | 2 +- apps/studio/pages/project/[ref]/sql/quickstarts.tsx | 2 +- apps/studio/pages/project/[ref]/sql/templates.tsx | 2 +- .../project/[ref]/storage/buckets/[bucketId].tsx | 2 +- .../pages/project/[ref]/storage/buckets/index.tsx | 2 +- apps/studio/pages/project/[ref]/storage/index.tsx | 2 +- apps/studio/pages/project/[ref]/storage/policies.tsx | 2 +- apps/studio/pages/projects.tsx | 2 +- apps/studio/pages/reset-password.tsx | 2 +- apps/studio/pages/sign-in-mfa.tsx | 2 +- apps/studio/pages/sign-in-sso.tsx | 2 +- apps/studio/pages/sign-in.tsx | 2 +- apps/studio/pages/sign-up.tsx | 2 +- apps/studio/pages/vercel/integrate.tsx | 2 +- apps/studio/pages/vercel/setupProject.tsx | 2 +- apps/studio/state/sql-editor.ts | 4 ++-- apps/studio/state/table-editor.tsx | 8 ++++---- apps/studio/stores/RootStore.ts | 2 +- apps/studio/stores/UiStore.ts | 4 ++-- .../schema/AuthProviders/AuthTemplatesValidation.tsx | 2 +- apps/studio/stores/pgmeta/MetaStore.ts | 4 ++-- apps/studio/stores/projectContentStore.ts | 2 +- apps/studio/types/next.ts | 6 +++--- 683 files changed, 903 insertions(+), 893 deletions(-) create mode 100644 apps/studio/components/grid/queue.ts diff --git a/apps/studio/components/grid/SupabaseGrid.tsx b/apps/studio/components/grid/SupabaseGrid.tsx index a2e4d95132c..c8b9c63a569 100644 --- a/apps/studio/components/grid/SupabaseGrid.tsx +++ b/apps/studio/components/grid/SupabaseGrid.tsx @@ -23,7 +23,7 @@ import { Grid } from './components/grid' import Header from './components/header/Header' import { RowContextMenu } from './components/menu' import { StoreProvider, useDispatch, useTrackedState } from './store' -import { SupabaseGridProps } from './types' +import type { SupabaseGridProps } from './types' /** Supabase Grid: React component to render database table */ diff --git a/apps/studio/components/grid/SupabaseGrid.utils.ts b/apps/studio/components/grid/SupabaseGrid.utils.ts index a654246490a..cab71d76a52 100644 --- a/apps/studio/components/grid/SupabaseGrid.utils.ts +++ b/apps/studio/components/grid/SupabaseGrid.utils.ts @@ -1,11 +1,11 @@ import AwesomeDebouncePromise from 'awesome-debounce-promise' import { STORAGE_KEY_PREFIX } from './constants' import { InitialStateType } from './store/reducers' -import { Sort, SupabaseGridProps, SupaColumn, SupaTable } from './types' +import type { Sort, SupabaseGridProps, SupaColumn, SupaTable } from './types' import type { Dictionary } from 'types' import { getGridColumns } from './utils/gridColumns' import { FilterOperatorOptions } from './components/header/filter' -import { Filter } from 'components/grid/types' +import type { Filter } from 'components/grid/types' export function defaultErrorHandler(error: any) { console.error('Supabase grid error: ', error) diff --git a/apps/studio/components/grid/components/common/Shortcuts.tsx b/apps/studio/components/grid/components/common/Shortcuts.tsx index e9d4ba0b56a..4d14f6dae20 100644 --- a/apps/studio/components/grid/components/common/Shortcuts.tsx +++ b/apps/studio/components/grid/components/common/Shortcuts.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { useTrackedState } from '../../store' import { useKeyboardShortcuts } from './Hooks' -import { DataGridHandle } from 'react-data-grid' +import type { DataGridHandle } from 'react-data-grid' import { formatClipboardValue, copyToClipboard } from '../../utils' type ShortcutsProps = { diff --git a/apps/studio/components/grid/components/editor/BooleanEditor.tsx b/apps/studio/components/grid/components/editor/BooleanEditor.tsx index 9c7772db08d..3ae4643b42d 100644 --- a/apps/studio/components/grid/components/editor/BooleanEditor.tsx +++ b/apps/studio/components/grid/components/editor/BooleanEditor.tsx @@ -1,5 +1,5 @@ import { Select } from 'ui' -import { RenderEditCellProps } from 'react-data-grid' +import type { RenderEditCellProps } from 'react-data-grid' import { useTrackedState } from 'components/grid/store' interface Props extends RenderEditCellProps { diff --git a/apps/studio/components/grid/components/editor/DateEditor.tsx b/apps/studio/components/grid/components/editor/DateEditor.tsx index 02f4e24da04..a32acca76c0 100644 --- a/apps/studio/components/grid/components/editor/DateEditor.tsx +++ b/apps/studio/components/grid/components/editor/DateEditor.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { RenderEditCellProps } from 'react-data-grid' +import type { RenderEditCellProps } from 'react-data-grid' function autoFocusAndSelect(input: HTMLInputElement | null) { input?.focus() diff --git a/apps/studio/components/grid/components/editor/DateTimeEditor.tsx b/apps/studio/components/grid/components/editor/DateTimeEditor.tsx index a3ce7605c1c..aa6cfc69cbe 100644 --- a/apps/studio/components/grid/components/editor/DateTimeEditor.tsx +++ b/apps/studio/components/grid/components/editor/DateTimeEditor.tsx @@ -1,5 +1,5 @@ -import { ChangeEvent } from 'react' -import { RenderEditCellProps } from 'react-data-grid' +import type { ChangeEvent } from 'react' +import type { RenderEditCellProps } from 'react-data-grid' import dayjs from 'dayjs' import customParseFormat from 'dayjs/plugin/customParseFormat' diff --git a/apps/studio/components/grid/components/editor/JsonEditor.tsx b/apps/studio/components/grid/components/editor/JsonEditor.tsx index 4423413f064..694bf7e4916 100644 --- a/apps/studio/components/grid/components/editor/JsonEditor.tsx +++ b/apps/studio/components/grid/components/editor/JsonEditor.tsx @@ -1,5 +1,5 @@ import * as Tooltip from '@radix-ui/react-tooltip' -import { RenderEditCellProps } from 'react-data-grid' +import type { RenderEditCellProps } from 'react-data-grid' import { useCallback, useState } from 'react' import { IconMaximize, Popover } from 'ui' diff --git a/apps/studio/components/grid/components/editor/NumberEditor.tsx b/apps/studio/components/grid/components/editor/NumberEditor.tsx index c660fb1a5fb..54ee0c7e285 100644 --- a/apps/studio/components/grid/components/editor/NumberEditor.tsx +++ b/apps/studio/components/grid/components/editor/NumberEditor.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { RenderEditCellProps } from 'react-data-grid' +import type { RenderEditCellProps } from 'react-data-grid' function autoFocusAndSelect(input: HTMLInputElement | null) { input?.focus() diff --git a/apps/studio/components/grid/components/editor/SelectEditor.tsx b/apps/studio/components/grid/components/editor/SelectEditor.tsx index dcb7705a17f..06828236b06 100644 --- a/apps/studio/components/grid/components/editor/SelectEditor.tsx +++ b/apps/studio/components/grid/components/editor/SelectEditor.tsx @@ -1,5 +1,5 @@ import { Select } from 'ui' -import { RenderEditCellProps } from 'react-data-grid' +import type { RenderEditCellProps } from 'react-data-grid' import { useTrackedState } from 'components/grid/store' diff --git a/apps/studio/components/grid/components/editor/TextEditor.tsx b/apps/studio/components/grid/components/editor/TextEditor.tsx index e900ca36038..590cd3fd5b0 100644 --- a/apps/studio/components/grid/components/editor/TextEditor.tsx +++ b/apps/studio/components/grid/components/editor/TextEditor.tsx @@ -1,6 +1,6 @@ import * as Tooltip from '@radix-ui/react-tooltip' import { useCallback, useState } from 'react' -import { RenderEditCellProps } from 'react-data-grid' +import type { RenderEditCellProps } from 'react-data-grid' import { Button, IconMaximize, Popover } from 'ui' import { useTrackedState } from '../../store' import { BlockKeys, EmptyValue, MonacoEditor, NullValue } from '../common' diff --git a/apps/studio/components/grid/components/editor/TimeEditor.tsx b/apps/studio/components/grid/components/editor/TimeEditor.tsx index 21fc1e34011..ba9a34fdcab 100644 --- a/apps/studio/components/grid/components/editor/TimeEditor.tsx +++ b/apps/studio/components/grid/components/editor/TimeEditor.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { RenderEditCellProps } from 'react-data-grid' +import type { RenderEditCellProps } from 'react-data-grid' import dayjs from 'dayjs' import customParseFormat from 'dayjs/plugin/customParseFormat' diff --git a/apps/studio/components/grid/components/formatter/BooleanFormatter.tsx b/apps/studio/components/grid/components/formatter/BooleanFormatter.tsx index 795ae864d70..a7f766806d5 100644 --- a/apps/studio/components/grid/components/formatter/BooleanFormatter.tsx +++ b/apps/studio/components/grid/components/formatter/BooleanFormatter.tsx @@ -1,6 +1,6 @@ -import { PropsWithChildren } from 'react' -import { RenderCellProps } from 'react-data-grid' -import { SupaRow } from '../../types' +import type { PropsWithChildren } from 'react' +import type { RenderCellProps } from 'react-data-grid' +import type { SupaRow } from '../../types' import { NullValue } from '../common' export const BooleanFormatter = (p: PropsWithChildren>) => { diff --git a/apps/studio/components/grid/components/formatter/DefaultFormatter.tsx b/apps/studio/components/grid/components/formatter/DefaultFormatter.tsx index b1e405b139b..325fee62e19 100644 --- a/apps/studio/components/grid/components/formatter/DefaultFormatter.tsx +++ b/apps/studio/components/grid/components/formatter/DefaultFormatter.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { RenderCellProps } from 'react-data-grid' -import { SupaRow } from '../../types' +import type { RenderCellProps } from 'react-data-grid' +import type { SupaRow } from '../../types' import { NullValue } from '../common' import { EmptyValue } from '../common/EmptyValue' diff --git a/apps/studio/components/grid/components/formatter/ForeignKeyFormatter.tsx b/apps/studio/components/grid/components/formatter/ForeignKeyFormatter.tsx index 0f7693cdf24..034f4be7a05 100644 --- a/apps/studio/components/grid/components/formatter/ForeignKeyFormatter.tsx +++ b/apps/studio/components/grid/components/formatter/ForeignKeyFormatter.tsx @@ -1,14 +1,14 @@ import * as Tooltip from '@radix-ui/react-tooltip' import Link from 'next/link' -import { PropsWithChildren } from 'react' -import { RenderCellProps } from 'react-data-grid' +import type { PropsWithChildren } from 'react' +import type { RenderCellProps } from 'react-data-grid' import { Button, IconArrowRight } from 'ui' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useTableQuery } from 'data/tables/table-query' import { useTablesQuery } from 'data/tables/tables-query' import { useTableEditorStateSnapshot } from 'state/table-editor' -import { SupaRow } from '../../types' +import type { SupaRow } from '../../types' import { NullValue } from '../common' interface Props extends PropsWithChildren> { diff --git a/apps/studio/components/grid/components/formatter/JsonFormatter.tsx b/apps/studio/components/grid/components/formatter/JsonFormatter.tsx index 083baf10a6e..21d5df8828d 100644 --- a/apps/studio/components/grid/components/formatter/JsonFormatter.tsx +++ b/apps/studio/components/grid/components/formatter/JsonFormatter.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { RenderCellProps } from 'react-data-grid' -import { SupaRow } from '../../types' +import type { RenderCellProps } from 'react-data-grid' +import type { SupaRow } from '../../types' import { EmptyValue, NullValue } from '../common' export const JsonFormatter = (p: React.PropsWithChildren>) => { diff --git a/apps/studio/components/grid/components/grid/AddColumn.tsx b/apps/studio/components/grid/components/grid/AddColumn.tsx index 37a94a0daf3..b9cb11ce8d1 100644 --- a/apps/studio/components/grid/components/grid/AddColumn.tsx +++ b/apps/studio/components/grid/components/grid/AddColumn.tsx @@ -1,4 +1,4 @@ -import { CalculatedColumn } from 'react-data-grid' +import type { CalculatedColumn } from 'react-data-grid' import { Button, IconPlus } from 'ui' import { ADD_COLUMN_KEY } from '../../constants' diff --git a/apps/studio/components/grid/components/grid/ColumnHeader.tsx b/apps/studio/components/grid/components/grid/ColumnHeader.tsx index a0443ce381e..a8fac748b5b 100644 --- a/apps/studio/components/grid/components/grid/ColumnHeader.tsx +++ b/apps/studio/components/grid/components/grid/ColumnHeader.tsx @@ -6,7 +6,7 @@ import * as React from 'react' import { useDrag, useDrop } from 'react-dnd' import { IconArrowRight, IconKey, IconLink, IconLock } from 'ui' import { useDispatch, useTrackedState } from '../../store' -import { ColumnHeaderProps, ColumnType, DragItem, GridForeignKey } from '../../types' +import type { ColumnHeaderProps, ColumnType, DragItem, GridForeignKey } from '../../types' import { ColumnMenu } from '../menu' import { useEffect } from 'react' diff --git a/apps/studio/components/grid/components/grid/Grid.tsx b/apps/studio/components/grid/components/grid/Grid.tsx index 3b849262131..dfd01db594a 100644 --- a/apps/studio/components/grid/components/grid/Grid.tsx +++ b/apps/studio/components/grid/components/grid/Grid.tsx @@ -16,7 +16,7 @@ import { useForeignKeyConstraintsQuery } from 'data/database/foreign-key-constra import { useKeyboardShortcuts, useUrlState } from 'hooks' import { copyToClipboard } from 'lib/helpers' import { useDispatch, useTrackedState } from '../../store' -import { Filter, GridProps, SupaRow } from '../../types' +import type { Filter, GridProps, SupaRow } from '../../types' import RowRenderer from './RowRenderer' const rowKeyGetter = (row: SupaRow) => { diff --git a/apps/studio/components/grid/components/grid/RowRenderer.tsx b/apps/studio/components/grid/components/grid/RowRenderer.tsx index 12df5f412a2..fe5da9a4cf5 100644 --- a/apps/studio/components/grid/components/grid/RowRenderer.tsx +++ b/apps/studio/components/grid/components/grid/RowRenderer.tsx @@ -1,7 +1,7 @@ -import { Key } from 'react' +import type { Key } from 'react' import { TriggerEvent, useContextMenu } from 'react-contexify' import { Row, RenderRowProps } from 'react-data-grid' -import { SupaRow } from '../../types' +import type { SupaRow } from '../../types' import { ROW_CONTEXT_MENU_ID } from '../menu' export default function RowRenderer(key: Key, props: RenderRowProps) { diff --git a/apps/studio/components/grid/components/grid/SelectColumn.tsx b/apps/studio/components/grid/components/grid/SelectColumn.tsx index f73a610fc20..9148100d51a 100644 --- a/apps/studio/components/grid/components/grid/SelectColumn.tsx +++ b/apps/studio/components/grid/components/grid/SelectColumn.tsx @@ -11,7 +11,7 @@ import { Button, IconMaximize2 } from 'ui' import { SELECT_COLUMN_KEY } from '../../constants' import { useTrackedState } from '../../store' -import { SupaRow } from '../../types' +import type { SupaRow } from '../../types' export const SelectColumn: CalculatedColumn = { key: SELECT_COLUMN_KEY, diff --git a/apps/studio/components/grid/components/header/Header.tsx b/apps/studio/components/grid/components/header/Header.tsx index b4d786f212f..03495120e1a 100644 --- a/apps/studio/components/grid/components/header/Header.tsx +++ b/apps/studio/components/grid/components/header/Header.tsx @@ -7,7 +7,7 @@ import { ReactNode, useState } from 'react' import toast from 'react-hot-toast' import { useDispatch, useTrackedState } from 'components/grid/store' -import { Filter, Sort, SupaTable } from 'components/grid/types' +import type { Filter, Sort, SupaTable } from 'components/grid/types' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useTableRowsCountQuery } from 'data/table-rows/table-rows-count-query' import { fetchAllTableRows, useTableRowsQuery } from 'data/table-rows/table-rows-query' diff --git a/apps/studio/components/grid/components/header/RefreshButton.tsx b/apps/studio/components/grid/components/header/RefreshButton.tsx index 1ebd04dfb72..78e8741e3ba 100644 --- a/apps/studio/components/grid/components/header/RefreshButton.tsx +++ b/apps/studio/components/grid/components/header/RefreshButton.tsx @@ -1,11 +1,11 @@ import { useQueryClient } from '@tanstack/react-query' import { useParams } from 'common/hooks' -import { SupaTable } from 'components/grid/types' +import type { SupaTable } from 'components/grid/types' import { sqlKeys } from 'data/sql/keys' import { useEffect, useState } from 'react' import { Button, IconCheck, IconRefreshCw } from 'ui' -import { SupabaseGridQueue } from '../../constants' -import { TableLike } from 'hooks/misc/useTable' +import { SupabaseGridQueue } from '../../queue' +import type { TableLike } from 'hooks/misc/useTable' export type RefreshButtonProps = { table: TableLike | SupaTable diff --git a/apps/studio/components/grid/components/header/filter/FilterPopover.tsx b/apps/studio/components/grid/components/header/filter/FilterPopover.tsx index 1a438911474..7aa07a06982 100644 --- a/apps/studio/components/grid/components/header/filter/FilterPopover.tsx +++ b/apps/studio/components/grid/components/header/filter/FilterPopover.tsx @@ -5,7 +5,7 @@ import { KeyboardEvent, useCallback, useMemo, useState } from 'react' import { Button, IconFilter, IconPlus, Popover } from 'ui' import { formatFilterURLParams } from 'components/grid/SupabaseGrid.utils' -import { Filter, SupaTable } from 'components/grid/types' +import type { Filter, SupaTable } from 'components/grid/types' import { FilterOperatorOptions } from './Filter.constants' import FilterRow from './FilterRow' diff --git a/apps/studio/components/grid/components/header/filter/FilterRow.tsx b/apps/studio/components/grid/components/header/filter/FilterRow.tsx index b35d58b8b0a..bf20b15603c 100644 --- a/apps/studio/components/grid/components/header/filter/FilterRow.tsx +++ b/apps/studio/components/grid/components/header/filter/FilterRow.tsx @@ -2,7 +2,7 @@ import { KeyboardEvent, memo } from 'react' import { Button, IconChevronDown, IconX, Input } from 'ui' import { DropdownControl } from 'components/grid/components/common' -import { Filter, FilterOperator, SupaTable } from 'components/grid/types' +import type { Filter, FilterOperator, SupaTable } from 'components/grid/types' import { FilterOperatorOptions } from './Filter.constants' export interface FilterRowProps { diff --git a/apps/studio/components/grid/components/header/sort/SortPopover.tsx b/apps/studio/components/grid/components/header/sort/SortPopover.tsx index ddba5c7134f..80c3ef223ac 100644 --- a/apps/studio/components/grid/components/header/sort/SortPopover.tsx +++ b/apps/studio/components/grid/components/header/sort/SortPopover.tsx @@ -6,7 +6,7 @@ import { Button, IconChevronDown, IconList, Popover } from 'ui' import { DropdownControl } from 'components/grid/components/common' import { formatSortURLParams } from 'components/grid/SupabaseGrid.utils' -import { Sort, SupaTable } from 'components/grid/types' +import type { Sort, SupaTable } from 'components/grid/types' import SortRow from './SortRow' export interface SortPopoverProps { diff --git a/apps/studio/components/grid/components/header/sort/SortRow.tsx b/apps/studio/components/grid/components/header/sort/SortRow.tsx index 3ccc908f691..6fdeb0a63c7 100644 --- a/apps/studio/components/grid/components/header/sort/SortRow.tsx +++ b/apps/studio/components/grid/components/header/sort/SortRow.tsx @@ -3,7 +3,7 @@ import { memo, useRef } from 'react' import { useDrag, useDrop } from 'react-dnd' import { Button, IconMenu, IconX, Toggle } from 'ui' -import { DragItem, Sort, SupaTable } from 'components/grid/types' +import type { DragItem, Sort, SupaTable } from 'components/grid/types' export interface SortRowProps { table: SupaTable diff --git a/apps/studio/components/grid/components/menu/ColumnMenu.tsx b/apps/studio/components/grid/components/menu/ColumnMenu.tsx index 1323e9ba5fc..c669e66025d 100644 --- a/apps/studio/components/grid/components/menu/ColumnMenu.tsx +++ b/apps/studio/components/grid/components/menu/ColumnMenu.tsx @@ -1,5 +1,5 @@ import * as Tooltip from '@radix-ui/react-tooltip' -import { CalculatedColumn } from 'react-data-grid' +import type { CalculatedColumn } from 'react-data-grid' import { Button, Divider, diff --git a/apps/studio/components/grid/components/menu/RowContextMenu.tsx b/apps/studio/components/grid/components/menu/RowContextMenu.tsx index 196417110e9..d2e6a1078b8 100644 --- a/apps/studio/components/grid/components/menu/RowContextMenu.tsx +++ b/apps/studio/components/grid/components/menu/RowContextMenu.tsx @@ -1,7 +1,7 @@ import { Item, ItemParams, Menu, PredicateParams, Separator } from 'react-contexify' import { IconClipboard, IconEdit, IconTrash } from 'ui' -import { SupaRow } from 'components/grid/types' +import type { SupaRow } from 'components/grid/types' import { useCallback } from 'react' import { useTableEditorStateSnapshot } from 'state/table-editor' import { useTrackedState } from '../../store' diff --git a/apps/studio/components/grid/constants.ts b/apps/studio/components/grid/constants.ts index 6fe451e7931..31559971291 100644 --- a/apps/studio/components/grid/constants.ts +++ b/apps/studio/components/grid/constants.ts @@ -1,7 +1,3 @@ -import PQueue from 'p-queue' - -export const SupabaseGridQueue = new PQueue({ concurrency: 1 }) - export const COLUMN_MIN_WIDTH = 100 export const STORAGE_KEY_PREFIX = 'supabase_grid' diff --git a/apps/studio/components/grid/query/Query.utils.ts b/apps/studio/components/grid/query/Query.utils.ts index 891af809b7b..fcfd7f05eca 100644 --- a/apps/studio/components/grid/query/Query.utils.ts +++ b/apps/studio/components/grid/query/Query.utils.ts @@ -1,5 +1,5 @@ import { ident, literal, format } from '@scaleleap/pg-format' -import { Filter, QueryPagination, QueryTable, Sort } from '../types' +import type { Filter, QueryPagination, QueryTable, Sort } from '../types' import type { Dictionary } from 'types' export function countQuery( diff --git a/apps/studio/components/grid/query/QueryAction.ts b/apps/studio/components/grid/query/QueryAction.ts index 3646e2cb836..cddc6acb0a9 100644 --- a/apps/studio/components/grid/query/QueryAction.ts +++ b/apps/studio/components/grid/query/QueryAction.ts @@ -1,4 +1,4 @@ -import { QueryTable } from '../types' +import type { QueryTable } from '../types' import type { Dictionary } from 'types' import { IQueryFilter, QueryFilter } from './QueryFilter' diff --git a/apps/studio/components/grid/query/QueryFilter.ts b/apps/studio/components/grid/query/QueryFilter.ts index f92fbd93493..03de13571ac 100644 --- a/apps/studio/components/grid/query/QueryFilter.ts +++ b/apps/studio/components/grid/query/QueryFilter.ts @@ -1,4 +1,4 @@ -import { Filter, FilterOperator, QueryTable, Sort } from '../types' +import type { Filter, FilterOperator, QueryTable, Sort } from '../types' import type { Dictionary } from 'types' import { IQueryModifier, QueryModifier } from './QueryModifier' diff --git a/apps/studio/components/grid/query/QueryModifier.ts b/apps/studio/components/grid/query/QueryModifier.ts index d9cced581ef..52eb3b7940a 100644 --- a/apps/studio/components/grid/query/QueryModifier.ts +++ b/apps/studio/components/grid/query/QueryModifier.ts @@ -1,5 +1,5 @@ import type { Dictionary } from 'types' -import { Filter, QueryPagination, QueryTable, Sort } from '../types' +import type { Filter, QueryPagination, QueryTable, Sort } from '../types' import { countQuery, deleteQuery, diff --git a/apps/studio/components/grid/queue.ts b/apps/studio/components/grid/queue.ts new file mode 100644 index 00000000000..0eaa984d86c --- /dev/null +++ b/apps/studio/components/grid/queue.ts @@ -0,0 +1,3 @@ +import PQueue from 'p-queue' + +export const SupabaseGridQueue = new PQueue({ concurrency: 1 }) diff --git a/apps/studio/components/grid/store/reducers/base.ts b/apps/studio/components/grid/store/reducers/base.ts index c08c6eb5b67..77877b02c62 100644 --- a/apps/studio/components/grid/store/reducers/base.ts +++ b/apps/studio/components/grid/store/reducers/base.ts @@ -1,6 +1,6 @@ import { CalculatedColumn } from 'react-data-grid' import { TOTAL_ROWS_RESET } from '../../constants' -import { GridProps, SavedState, SupaTable } from '../../types' +import type { GridProps, SavedState, SupaTable } from '../../types' export interface BaseInitialState { table: SupaTable | null diff --git a/apps/studio/components/grid/store/reducers/callback.ts b/apps/studio/components/grid/store/reducers/callback.ts index 30d7b4bb735..5fcb97e4c14 100644 --- a/apps/studio/components/grid/store/reducers/callback.ts +++ b/apps/studio/components/grid/store/reducers/callback.ts @@ -1,4 +1,4 @@ -import { SupaRow } from '../../types' +import type { SupaRow } from '../../types' export interface CallbackInitialState { onAddColumn: (() => void) | null diff --git a/apps/studio/components/grid/store/reducers/column.ts b/apps/studio/components/grid/store/reducers/column.ts index f6425bf8fee..a97bbd444e2 100644 --- a/apps/studio/components/grid/store/reducers/column.ts +++ b/apps/studio/components/grid/store/reducers/column.ts @@ -1,5 +1,5 @@ import update from 'immutability-helper' -import { CalculatedColumn } from 'react-data-grid' +import type { CalculatedColumn } from 'react-data-grid' import { cloneColumn, getInitialGridColumns } from '../../utils' import { INIT_ACTIONTYPE } from './base' diff --git a/apps/studio/components/grid/store/reducers/row.ts b/apps/studio/components/grid/store/reducers/row.ts index 637b4852388..c3d55664626 100644 --- a/apps/studio/components/grid/store/reducers/row.ts +++ b/apps/studio/components/grid/store/reducers/row.ts @@ -1,5 +1,5 @@ import { TOTAL_ROWS_INITIAL, TOTAL_ROWS_RESET } from '../../constants' -import { SupaRow } from '../../types' +import type { SupaRow } from '../../types' import { INIT_ACTIONTYPE } from './base' export interface RowInitialState { diff --git a/apps/studio/components/grid/utils/column.ts b/apps/studio/components/grid/utils/column.ts index c0870713639..b826f5fcd9e 100644 --- a/apps/studio/components/grid/utils/column.ts +++ b/apps/studio/components/grid/utils/column.ts @@ -1,6 +1,6 @@ import { CalculatedColumn } from 'react-data-grid' import { ADD_COLUMN_KEY, SELECT_COLUMN_KEY } from '../constants' -import { SavedState } from '../types' +import type { SavedState } from '../types' import { deepClone } from './common' export function cloneColumn(column: CalculatedColumn) { diff --git a/apps/studio/components/grid/utils/gridColumns.tsx b/apps/studio/components/grid/utils/gridColumns.tsx index e2c259b2c4d..d04773f0ef1 100644 --- a/apps/studio/components/grid/utils/gridColumns.tsx +++ b/apps/studio/components/grid/utils/gridColumns.tsx @@ -1,5 +1,5 @@ import { CalculatedColumn } from 'react-data-grid' -import { ColumnType, SupaColumn, SupaRow, SupaTable } from '../types' +import type { ColumnType, SupaColumn, SupaRow, SupaTable } from '../types' import { isArrayColumn, isBoolColumn, diff --git a/apps/studio/components/grid/utils/types.ts b/apps/studio/components/grid/utils/types.ts index f39279960b3..1c80442ab52 100644 --- a/apps/studio/components/grid/utils/types.ts +++ b/apps/studio/components/grid/utils/types.ts @@ -1,4 +1,4 @@ -import { SupaColumn } from '../types' +import type { SupaColumn } from '../types' const NUMERICAL_TYPES = [ 'smallint', diff --git a/apps/studio/components/interfaces/Account/AuditLogs.tsx b/apps/studio/components/interfaces/Account/AuditLogs.tsx index 93ec9d85a0c..2273b229437 100644 --- a/apps/studio/components/interfaces/Account/AuditLogs.tsx +++ b/apps/studio/components/interfaces/Account/AuditLogs.tsx @@ -8,7 +8,7 @@ import Table from 'components/to-be-cleaned/Table' import AlertError from 'components/ui/AlertError' import { DatePicker } from 'components/ui/DatePicker' import ShimmeringLoader from 'components/ui/ShimmeringLoader' -import { AuditLog } from 'data/organizations/organization-audit-logs-query' +import type { AuditLog } from 'data/organizations/organization-audit-logs-query' import { useOrganizationsQuery } from 'data/organizations/organizations-query' import { useProfileAuditLogsQuery } from 'data/profile/profile-audit-logs-query' import { useProjectsQuery } from 'data/projects/projects-query' diff --git a/apps/studio/components/interfaces/Account/Preferences/AccountInformation.tsx b/apps/studio/components/interfaces/Account/Preferences/AccountInformation.tsx index 543021e3011..c6c940aa975 100644 --- a/apps/studio/components/interfaces/Account/Preferences/AccountInformation.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/AccountInformation.tsx @@ -3,7 +3,7 @@ import Link from 'next/link' import Panel from 'components/ui/Panel' import { useSession } from 'lib/auth' -import { Profile } from 'data/profile/types' +import type { Profile } from 'data/profile/types' const AccountInformation = ({ profile }: { profile?: Profile }) => { const session = useSession() diff --git a/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx b/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx index edba22306aa..525acd01e82 100644 --- a/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx +++ b/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx @@ -14,9 +14,9 @@ import z from 'zod' import { FormActions } from 'components/ui/Forms' import Panel from 'components/ui/Panel' import { useProfileUpdateMutation } from 'data/profile/profile-update-mutation' -import { Profile } from 'data/profile/types' +import type { Profile } from 'data/profile/types' import { useStore } from 'hooks' -import { FormSchema } from 'types' +import type { FormSchema } from 'types' const FormSchema = z.object({ first_name: z.string().optional(), diff --git a/apps/studio/components/interfaces/App/CommandMenuWrapper.tsx b/apps/studio/components/interfaces/App/CommandMenuWrapper.tsx index bd1d47edd5d..ca9daaa5688 100644 --- a/apps/studio/components/interfaces/App/CommandMenuWrapper.tsx +++ b/apps/studio/components/interfaces/App/CommandMenuWrapper.tsx @@ -6,7 +6,7 @@ import { CommandMenuProvider } from 'ui' import { codeBlock } from 'common-tags' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useProjectApiQuery } from 'data/config/project-api-query' -import { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useEntityDefinitionsQuery } from 'data/database/entity-definitions-query' import { useCheckPermissions, useSelectedOrganization, useStore } from 'hooks' import { uuidv4 } from 'lib/helpers' diff --git a/apps/studio/components/interfaces/AuditLogs/LogDetailsPanel.tsx b/apps/studio/components/interfaces/AuditLogs/LogDetailsPanel.tsx index 99c53e2f906..473a420974e 100644 --- a/apps/studio/components/interfaces/AuditLogs/LogDetailsPanel.tsx +++ b/apps/studio/components/interfaces/AuditLogs/LogDetailsPanel.tsx @@ -1,5 +1,5 @@ import { FormSection, FormSectionContent, FormSectionLabel } from 'components/ui/Forms' -import { AuditLog } from 'data/organizations/organization-audit-logs-query' +import type { AuditLog } from 'data/organizations/organization-audit-logs-query' import { useOrganizationsQuery } from 'data/organizations/organizations-query' import { useProjectsQuery } from 'data/projects/projects-query' import dayjs from 'dayjs' diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx index fa318e3075e..937b1535029 100644 --- a/apps/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx +++ b/apps/studio/components/interfaces/Auth/AuthProvidersForm/FormField.tsx @@ -5,7 +5,7 @@ import ReactMarkdown from 'react-markdown' import { Button, IconEye, IconEyeOff, Input, InputNumber, Listbox, Toggle } from 'ui' import { BASE_PATH } from 'lib/constants' -import { Enum } from './AuthProvidersForm.types' +import type { Enum } from './AuthProvidersForm.types' interface FormFieldProps { name: string diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx index 0dddeec961b..e9cf4695643 100644 --- a/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx +++ b/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx @@ -5,13 +5,13 @@ import ReactMarkdown from 'react-markdown' import { Alert, Button, Collapsible, Form, IconCheck, IconChevronUp, Input } from 'ui' import { useParams } from 'common' -import { components } from 'data/api' +import type { components } from 'data/api' import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation' import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query' import { useCheckPermissions, useStore } from 'hooks' import { BASE_PATH } from 'lib/constants' import { ProviderCollapsibleClasses } from './AuthProvidersForm.constants' -import { Provider } from './AuthProvidersForm.types' +import type { Provider } from './AuthProvidersForm.types' import FormField from './FormField' export interface ProviderFormProps { diff --git a/apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx b/apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx index 0b3a5bf69f0..4b76b63eb1f 100644 --- a/apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx +++ b/apps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsx @@ -19,7 +19,7 @@ import { FormActions, FormSection, FormSectionContent, FormSectionLabel } from ' import InformationBox from 'components/ui/InformationBox' import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation' import { useCheckPermissions } from 'hooks' -import { FormSchema } from 'types' +import type { FormSchema } from 'types' interface TemplateEditorProps { template: FormSchema diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/AIPolicyEditorPanel.utils.ts b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/AIPolicyEditorPanel.utils.ts index adb8328a37b..d15b78a73d4 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/AIPolicyEditorPanel.utils.ts +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/AIPolicyEditorPanel.utils.ts @@ -1,4 +1,4 @@ -import { PostgresPolicy } from '@supabase/postgres-meta' +import type { PostgresPolicy } from '@supabase/postgres-meta' import { Message } from 'ai/react' import { uuidv4 } from 'lib/helpers' diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/AIPolicyHeader.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/AIPolicyHeader.tsx index 26ff309e444..2b3ea1336d9 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/AIPolicyHeader.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/AIPolicyHeader.tsx @@ -1,4 +1,4 @@ -import { PostgresPolicy } from '@supabase/postgres-meta' +import type { PostgresPolicy } from '@supabase/postgres-meta' import clsx from 'clsx' import { PanelLeftClose, PanelRightClose, X } from 'lucide-react' import { diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/PolicyDetails.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/PolicyDetails.tsx index a911d69967f..e5148c1faa9 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/PolicyDetails.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/PolicyDetails.tsx @@ -1,4 +1,4 @@ -import { PostgresPolicy } from '@supabase/postgres-meta' +import type { PostgresPolicy } from '@supabase/postgres-meta' import { CollapsibleContent_Shadcn_, CollapsibleTrigger_Shadcn_, diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx index 89d88937ca8..fcb02298024 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx @@ -1,4 +1,4 @@ -import { PostgresPolicy } from '@supabase/postgres-meta' +import type { PostgresPolicy } from '@supabase/postgres-meta' import { useQueryClient } from '@tanstack/react-query' import { useChat } from 'ai/react' import { useParams, useTelemetryProps } from 'common' diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyReview.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyReview.tsx index 1d6e4820392..a9f8a75ee9c 100644 --- a/apps/studio/components/interfaces/Auth/Policies/PolicyReview.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/PolicyReview.tsx @@ -2,7 +2,7 @@ import SqlEditor from 'components/ui/SqlEditor' import { isEmpty, noop } from 'lodash' import { useState } from 'react' import { Button, Modal } from 'ui' -import { PolicyForReview } from './Policies.types' +import type { PolicyForReview } from './Policies.types' interface PolicyReviewProps { policy: PolicyForReview diff --git a/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.utils.ts b/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.utils.ts index 8d33cbaf2a9..b69ad2be5a1 100644 --- a/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.utils.ts +++ b/apps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.utils.ts @@ -1,4 +1,4 @@ -import { components } from 'data/api' +import type { components } from 'data/api' type AuthConfig = components['schemas']['GoTrueConfigResponse'] diff --git a/apps/studio/components/interfaces/Auth/Users/UserDropdown.tsx b/apps/studio/components/interfaces/Auth/Users/UserDropdown.tsx index 1ec734d5fcd..82e1b24415f 100644 --- a/apps/studio/components/interfaces/Auth/Users/UserDropdown.tsx +++ b/apps/studio/components/interfaces/Auth/Users/UserDropdown.tsx @@ -8,7 +8,7 @@ import { useUserDeleteMutation } from 'data/auth/user-delete-mutation' import { useUserResetPasswordMutation } from 'data/auth/user-reset-password-mutation' import { useUserSendMagicLinkMutation } from 'data/auth/user-send-magic-link-mutation' import { useUserSendOTPMutation } from 'data/auth/user-send-otp-mutation' -import { User } from 'data/auth/users-query' +import type { User } from 'data/auth/users-query' import { useStore } from 'hooks' import { timeout } from 'lib/helpers' import { diff --git a/apps/studio/components/interfaces/Auth/Users/UserListItem.utils.ts b/apps/studio/components/interfaces/Auth/Users/UserListItem.utils.ts index cf48113df31..a2e1d1d34d8 100644 --- a/apps/studio/components/interfaces/Auth/Users/UserListItem.utils.ts +++ b/apps/studio/components/interfaces/Auth/Users/UserListItem.utils.ts @@ -1,4 +1,4 @@ -import { User } from 'data/auth/users-query' +import type { User } from 'data/auth/users-query' export function getDisplayName(user: User, fallback = '-'): string { const { diff --git a/apps/studio/components/interfaces/Auth/Users/UserSidePanel.tsx b/apps/studio/components/interfaces/Auth/Users/UserSidePanel.tsx index 5ade2553bb0..441b4969588 100644 --- a/apps/studio/components/interfaces/Auth/Users/UserSidePanel.tsx +++ b/apps/studio/components/interfaces/Auth/Users/UserSidePanel.tsx @@ -1,5 +1,5 @@ import SimpleCodeBlock from 'components/to-be-cleaned/SimpleCodeBlock' -import { User } from 'data/auth/users-query' +import type { User } from 'data/auth/users-query' import { SidePanel } from 'ui' interface UsersSidePanelProps { diff --git a/apps/studio/components/interfaces/Auth/Users/UsersList.tsx b/apps/studio/components/interfaces/Auth/Users/UsersList.tsx index bc625873e3c..1c1d5d5b8f3 100644 --- a/apps/studio/components/interfaces/Auth/Users/UsersList.tsx +++ b/apps/studio/components/interfaces/Auth/Users/UsersList.tsx @@ -2,9 +2,9 @@ import { PermissionAction } from '@supabase/shared-types/out/constants' import Table from 'components/to-be-cleaned/Table' import AlertError from 'components/ui/AlertError' -import { User } from 'data/auth/users-query' +import type { User } from 'data/auth/users-query' import { useCheckPermissions } from 'hooks' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { IconAlertCircle } from 'ui' import UserListItem from './UsersListItem' import UsersListItemSkeleton from './UsersListItemSkeleton' diff --git a/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx b/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx index 3841efc6be1..1d300bcd92e 100644 --- a/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx +++ b/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx @@ -3,7 +3,7 @@ import { Badge } from 'ui' import SimpleCodeBlock from 'components/to-be-cleaned/SimpleCodeBlock' import Table from 'components/to-be-cleaned/Table' -import { User } from 'data/auth/users-query' +import type { User } from 'data/auth/users-query' import UserDropdown from './UserDropdown' import { getDisplayName } from './UserListItem.utils' diff --git a/apps/studio/components/interfaces/Billing/NoProjectsOnPaidOrgInfo.tsx b/apps/studio/components/interfaces/Billing/NoProjectsOnPaidOrgInfo.tsx index 47dc6839423..fec7938f1b3 100644 --- a/apps/studio/components/interfaces/Billing/NoProjectsOnPaidOrgInfo.tsx +++ b/apps/studio/components/interfaces/Billing/NoProjectsOnPaidOrgInfo.tsx @@ -4,7 +4,7 @@ import { IconInfo } from 'ui' import InformationBox from 'components/ui/InformationBox' import { useProjectsQuery } from 'data/projects/projects-query' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' -import { Organization } from 'types' +import type { Organization } from 'types' interface NoProjectsOnPaidOrgInfoProps { organization?: Organization diff --git a/apps/studio/components/interfaces/Billing/Subscription/Subscription.utils.ts b/apps/studio/components/interfaces/Billing/Subscription/Subscription.utils.ts index f39ae7270f8..24ffa175b3a 100644 --- a/apps/studio/components/interfaces/Billing/Subscription/Subscription.utils.ts +++ b/apps/studio/components/interfaces/Billing/Subscription/Subscription.utils.ts @@ -1,5 +1,5 @@ import { IS_PLATFORM } from 'lib/constants' -import { OrgSubscription, ProjectSelectedAddon } from 'data/subscriptions/types' +import type { OrgSubscription, ProjectSelectedAddon } from 'data/subscriptions/types' export const getAddons = (selectedAddons: ProjectSelectedAddon[]) => { const computeInstance = selectedAddons.find((addon) => addon.type === 'compute_instance') diff --git a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx index d60b2a11144..0e5690f8c9e 100644 --- a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx +++ b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx @@ -7,8 +7,8 @@ import { useInView } from 'react-intersection-observer' import ShimmeringLoader from 'components/ui/ShimmeringLoader' import { useBranchQuery } from 'data/branches/branch-query' -import { Branch } from 'data/branches/branches-query' -import { GitHubPullRequest } from 'data/integrations/github-pull-requests-query' +import type { Branch } from 'data/branches/branches-query' +import type { GitHubPullRequest } from 'data/integrations/github-pull-requests-query' import { Badge, Button, diff --git a/apps/studio/components/interfaces/BranchManagement/BranchStatusBadge.tsx b/apps/studio/components/interfaces/BranchManagement/BranchStatusBadge.tsx index 091c2a6bc70..247e91f0037 100644 --- a/apps/studio/components/interfaces/BranchManagement/BranchStatusBadge.tsx +++ b/apps/studio/components/interfaces/BranchManagement/BranchStatusBadge.tsx @@ -1,5 +1,5 @@ import { WarningIcon } from 'components/ui/Icons' -import { BranchData } from 'data/branches/branch-query' +import type { BranchData } from 'data/branches/branch-query' import { ClockIcon } from 'lucide-react' import { Badge } from 'ui' diff --git a/apps/studio/components/interfaces/BranchManagement/Overview.tsx b/apps/studio/components/interfaces/BranchManagement/Overview.tsx index 1de91499180..01dd04d28a6 100644 --- a/apps/studio/components/interfaces/BranchManagement/Overview.tsx +++ b/apps/studio/components/interfaces/BranchManagement/Overview.tsx @@ -1,8 +1,8 @@ import { noop } from 'lodash' import { Button, IconChevronRight } from 'ui' -import { Branch } from 'data/branches/branches-query' -import { GitHubPullRequest } from 'data/integrations/github-pull-requests-query' +import type { Branch } from 'data/branches/branches-query' +import type { GitHubPullRequest } from 'data/integrations/github-pull-requests-query' import { BranchLoader, BranchManagementSection, BranchRow, BranchRowLoader } from './BranchPanels' import { PreviewBranchesEmptyState } from './EmptyStates' diff --git a/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx b/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx index e95775b7c1f..007c84f945a 100644 --- a/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx +++ b/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx @@ -3,7 +3,7 @@ import dayjs from 'dayjs' import { Badge, Button, IconDownload } from 'ui' import { useBackupDownloadMutation } from 'data/database/backup-download-mutation' -import { DatabaseBackup } from 'data/database/backups-query' +import type { DatabaseBackup } from 'data/database/backups-query' import { useCheckPermissions } from 'hooks' interface BackupItemProps { diff --git a/apps/studio/components/interfaces/Database/Backups/PITR/PITR.utils.ts b/apps/studio/components/interfaces/Database/Backups/PITR/PITR.utils.ts index a380e8c86d4..c885e6fe5ee 100644 --- a/apps/studio/components/interfaces/Database/Backups/PITR/PITR.utils.ts +++ b/apps/studio/components/interfaces/Database/Backups/PITR/PITR.utils.ts @@ -1,7 +1,7 @@ import dayjs from 'dayjs' import { ALL_TIMEZONES } from './PITR.constants' -import { Time } from './PITR.types' -import { ProjectSelectedAddon } from 'data/subscriptions/types' +import type { Time } from './PITR.types' +import type { ProjectSelectedAddon } from 'data/subscriptions/types' export const getPITRRetentionDuration = (addons: ProjectSelectedAddon[]) => { const pitrAddon = addons.find((addon) => addon.type === 'pitr') diff --git a/apps/studio/components/interfaces/Database/Backups/PITR/PITRSelection.tsx b/apps/studio/components/interfaces/Database/Backups/PITR/PITRSelection.tsx index 2a92aa8409e..befe3e3f0ed 100644 --- a/apps/studio/components/interfaces/Database/Backups/PITR/PITRSelection.tsx +++ b/apps/studio/components/interfaces/Database/Backups/PITR/PITRSelection.tsx @@ -28,7 +28,7 @@ import { useReadReplicasQuery } from 'data/read-replicas/replicas-query' import { PROJECT_STATUS } from 'lib/constants' import Link from 'next/link' import BackupsEmpty from '../BackupsEmpty' -import { Timezone } from './PITR.types' +import type { Timezone } from './PITR.types' import { constrainDateToRange, formatNumberToTwoDigits, diff --git a/apps/studio/components/interfaces/Database/Backups/PITR/PITRStatus.tsx b/apps/studio/components/interfaces/Database/Backups/PITR/PITRStatus.tsx index ca0a413309e..a41a1437a6f 100644 --- a/apps/studio/components/interfaces/Database/Backups/PITR/PITRStatus.tsx +++ b/apps/studio/components/interfaces/Database/Backups/PITR/PITRStatus.tsx @@ -8,7 +8,7 @@ import { FormPanel } from 'components/ui/Forms' import { useBackupsQuery } from 'data/database/backups-query' import { useReadReplicasQuery } from 'data/read-replicas/replicas-query' import { useCheckPermissions } from 'hooks' -import { Timezone } from './PITR.types' +import type { Timezone } from './PITR.types' import { TimezoneSelection } from './TimezoneSelection' interface PITRStatusProps { diff --git a/apps/studio/components/interfaces/Database/Backups/PITR/TimeInput.tsx b/apps/studio/components/interfaces/Database/Backups/PITR/TimeInput.tsx index f5ea08bd3d5..afae7774c37 100644 --- a/apps/studio/components/interfaces/Database/Backups/PITR/TimeInput.tsx +++ b/apps/studio/components/interfaces/Database/Backups/PITR/TimeInput.tsx @@ -4,7 +4,7 @@ import { isNaN, noop } from 'lodash' import { ChangeEvent, useEffect, useState } from 'react' import { IconClock } from 'ui' -import { Time } from './PITR.types' +import type { Time } from './PITR.types' import { formatNumberToTwoDigits, formatTimeToTimeString } from './PITR.utils' // [Joshen] This is trying to do the same thing as TimeSplitInput.tsx diff --git a/apps/studio/components/interfaces/Database/Backups/PITR/TimezoneSelection.tsx b/apps/studio/components/interfaces/Database/Backups/PITR/TimezoneSelection.tsx index 1b71f9414b6..34048f65597 100644 --- a/apps/studio/components/interfaces/Database/Backups/PITR/TimezoneSelection.tsx +++ b/apps/studio/components/interfaces/Database/Backups/PITR/TimezoneSelection.tsx @@ -16,7 +16,7 @@ import { import { CheckIcon, ChevronsUpDown } from 'lucide-react' import { ALL_TIMEZONES } from './PITR.constants' -import { Timezone } from './PITR.types' +import type { Timezone } from './PITR.types' interface TimezoneSelectionProps { selectedTimezone: Timezone diff --git a/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx b/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx index 620183f6bd4..6cef8de572b 100644 --- a/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx +++ b/apps/studio/components/interfaces/Database/EnumeratedTypes/EditEnumeratedTypeSidePanel.tsx @@ -26,7 +26,7 @@ import * as z from 'zod' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useEnumeratedTypeUpdateMutation } from 'data/enumerated-types/enumerated-type-update-mutation' -import { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' +import type { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' import { DragDropContext, Droppable, DroppableProvided } from 'react-beautiful-dnd' import EnumeratedTypeValueRow from './EnumeratedTypeValueRow' diff --git a/apps/studio/components/interfaces/Database/Functions/CreateFunction.tsx b/apps/studio/components/interfaces/Database/Functions/CreateFunction.tsx index f368883f318..1fa4c50e6c8 100644 --- a/apps/studio/components/interfaces/Database/Functions/CreateFunction.tsx +++ b/apps/studio/components/interfaces/Database/Functions/CreateFunction.tsx @@ -15,7 +15,7 @@ import { useDatabaseFunctionCreateMutation } from 'data/database-functions/datab import { useDatabaseFunctionUpdateMutation } from 'data/database-functions/database-functions-update-mutation' import { useSchemasQuery } from 'data/database/schemas-query' import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import { convertArgumentTypes, convertConfigParams, hasWhitespace } from './Functions.utils' // [Refactor] Remove local state, just use the Form component diff --git a/apps/studio/components/interfaces/Database/Functions/Functions.utils.ts b/apps/studio/components/interfaces/Database/Functions/Functions.utils.ts index ea3b07a4131..f342c295a78 100644 --- a/apps/studio/components/interfaces/Database/Functions/Functions.utils.ts +++ b/apps/studio/components/interfaces/Database/Functions/Functions.utils.ts @@ -1,4 +1,4 @@ -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import { isEmpty } from 'lodash' /** diff --git a/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx b/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx index 734c7d54ae4..4fb98099095 100644 --- a/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx +++ b/apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionsList.tsx @@ -1,5 +1,5 @@ import * as Tooltip from '@radix-ui/react-tooltip' -import { PostgresFunction } from '@supabase/postgres-meta' +import type { PostgresFunction } from '@supabase/postgres-meta' import { PermissionAction } from '@supabase/shared-types/out/constants' import { noop, partition } from 'lodash' import { useState } from 'react' diff --git a/apps/studio/components/interfaces/Database/Hooks/DeleteHookModal.tsx b/apps/studio/components/interfaces/Database/Hooks/DeleteHookModal.tsx index 115884584e4..31768e8066d 100644 --- a/apps/studio/components/interfaces/Database/Hooks/DeleteHookModal.tsx +++ b/apps/studio/components/interfaces/Database/Hooks/DeleteHookModal.tsx @@ -1,4 +1,4 @@ -import { PostgresTrigger } from '@supabase/postgres-meta' +import type { PostgresTrigger } from '@supabase/postgres-meta' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import TextConfirmModal from 'ui-patterns/Dialogs/TextConfirmModal' diff --git a/apps/studio/components/interfaces/Database/Hooks/EditHookPanel.tsx b/apps/studio/components/interfaces/Database/Hooks/EditHookPanel.tsx index 47dc88148cf..a146b94780d 100644 --- a/apps/studio/components/interfaces/Database/Hooks/EditHookPanel.tsx +++ b/apps/studio/components/interfaces/Database/Hooks/EditHookPanel.tsx @@ -1,4 +1,4 @@ -import { PostgresTable, PostgresTrigger } from '@supabase/postgres-meta' +import type { PostgresTable, PostgresTrigger } from '@supabase/postgres-meta' import Image from 'next/legacy/image' import { MutableRefObject, useEffect, useMemo, useRef, useState } from 'react' diff --git a/apps/studio/components/interfaces/Database/Privileges/Privileges.utils.ts b/apps/studio/components/interfaces/Database/Privileges/Privileges.utils.ts index 16718b688ca..42d9d4e6250 100644 --- a/apps/studio/components/interfaces/Database/Privileges/Privileges.utils.ts +++ b/apps/studio/components/interfaces/Database/Privileges/Privileges.utils.ts @@ -6,7 +6,7 @@ import { ColumnPrivilegesGrant, grantColumnPrivileges, } from 'data/privileges/column-privileges-grant-mutation' -import { ColumnPrivilege } from 'data/privileges/column-privileges-query' +import type { ColumnPrivilege } from 'data/privileges/column-privileges-query' import { ColumnPrivilegesRevoke, revokeColumnPrivileges, @@ -15,7 +15,7 @@ import { TablePrivilegesGrant, grantTablePrivileges, } from 'data/privileges/table-privileges-grant-mutation' -import { TablePrivilege } from 'data/privileges/table-privileges-query' +import type { TablePrivilege } from 'data/privileges/table-privileges-query' import { TablePrivilegesRevoke, revokeTablePrivileges, diff --git a/apps/studio/components/interfaces/Database/Privileges/PrivilegesHead.tsx b/apps/studio/components/interfaces/Database/Privileges/PrivilegesHead.tsx index 268b497597f..6d425a25f82 100644 --- a/apps/studio/components/interfaces/Database/Privileges/PrivilegesHead.tsx +++ b/apps/studio/components/interfaces/Database/Privileges/PrivilegesHead.tsx @@ -1,4 +1,4 @@ -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import SchemaSelector from 'components/ui/SchemaSelector' import { diff --git a/apps/studio/components/interfaces/Database/Privileges/PrivilegesTable.tsx b/apps/studio/components/interfaces/Database/Privileges/PrivilegesTable.tsx index 5eb8543e471..2ecd97f29d3 100644 --- a/apps/studio/components/interfaces/Database/Privileges/PrivilegesTable.tsx +++ b/apps/studio/components/interfaces/Database/Privileges/PrivilegesTable.tsx @@ -1,5 +1,5 @@ import Table from 'components/to-be-cleaned/Table' -import { ColumnPrivilege } from 'data/privileges/column-privileges-query' +import type { ColumnPrivilege } from 'data/privileges/column-privileges-query' import { Switch } from 'ui' import { ALL_PRIVILEGE_TYPES, diff --git a/apps/studio/components/interfaces/Database/Roles/DeleteRoleModal.tsx b/apps/studio/components/interfaces/Database/Roles/DeleteRoleModal.tsx index 7990e809ae3..efb5dfdd93c 100644 --- a/apps/studio/components/interfaces/Database/Roles/DeleteRoleModal.tsx +++ b/apps/studio/components/interfaces/Database/Roles/DeleteRoleModal.tsx @@ -1,4 +1,4 @@ -import { PostgresRole } from '@supabase/postgres-meta' +import type { PostgresRole } from '@supabase/postgres-meta' import toast from 'react-hot-toast' import { Modal } from 'ui' diff --git a/apps/studio/components/interfaces/Database/Roles/RoleRow.tsx b/apps/studio/components/interfaces/Database/Roles/RoleRow.tsx index 5ef3e1f2af0..a138fd08ee9 100644 --- a/apps/studio/components/interfaces/Database/Roles/RoleRow.tsx +++ b/apps/studio/components/interfaces/Database/Roles/RoleRow.tsx @@ -1,5 +1,5 @@ import * as Tooltip from '@radix-ui/react-tooltip' -import { PostgresRole } from '@supabase/postgres-meta' +import type { PostgresRole } from '@supabase/postgres-meta' import { useState } from 'react' import toast from 'react-hot-toast' import { diff --git a/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx b/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx index ea316a695ac..d647e2c85de 100644 --- a/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx +++ b/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx @@ -13,7 +13,7 @@ import ReactFlow, { useReactFlow, } from 'reactflow' -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useTablesQuery } from 'data/tables/tables-query' import { useTheme } from 'next-themes' diff --git a/apps/studio/components/interfaces/Database/Triggers/ChooseFunctionForm.tsx b/apps/studio/components/interfaces/Database/Triggers/ChooseFunctionForm.tsx index 32530d157b1..680da26e4c5 100644 --- a/apps/studio/components/interfaces/Database/Triggers/ChooseFunctionForm.tsx +++ b/apps/studio/components/interfaces/Database/Triggers/ChooseFunctionForm.tsx @@ -9,7 +9,7 @@ import { Button, IconChevronDown, IconHelpCircle, IconTerminal, SidePanel } from import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState' import InformationBox from 'components/ui/InformationBox' import SqlEditor from 'components/ui/SqlEditor' -import { DatabaseFunction } from 'data/database-functions/database-functions-query' +import type { DatabaseFunction } from 'data/database-functions/database-functions-query' export interface ChooseFunctionFormProps { triggerFunctions: DatabaseFunction[] diff --git a/apps/studio/components/interfaces/Database/Triggers/CreateTrigger.tsx b/apps/studio/components/interfaces/Database/Triggers/CreateTrigger.tsx index 824f19a46be..1a4722645b0 100644 --- a/apps/studio/components/interfaces/Database/Triggers/CreateTrigger.tsx +++ b/apps/studio/components/interfaces/Database/Triggers/CreateTrigger.tsx @@ -5,7 +5,7 @@ import { createContext, useContext, useEffect, useState } from 'react' import toast from 'react-hot-toast' import SVG from 'react-inlinesvg' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import FormEmptyBox from 'components/ui/FormBoxEmpty' diff --git a/apps/studio/components/interfaces/Database/Wrappers/DeleteWrapperModal.tsx b/apps/studio/components/interfaces/Database/Wrappers/DeleteWrapperModal.tsx index a6ab8041e05..37b62bbef6f 100644 --- a/apps/studio/components/interfaces/Database/Wrappers/DeleteWrapperModal.tsx +++ b/apps/studio/components/interfaces/Database/Wrappers/DeleteWrapperModal.tsx @@ -1,6 +1,6 @@ import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useFDWDeleteMutation } from 'data/fdw/fdw-delete-mutation' -import { FDW } from 'data/fdw/fdws-query' +import type { FDW } from 'data/fdw/fdws-query' import { useStore } from 'hooks' import { Modal } from 'ui' import { WRAPPERS } from './Wrappers.constants' diff --git a/apps/studio/components/interfaces/Database/Wrappers/InputField.tsx b/apps/studio/components/interfaces/Database/Wrappers/InputField.tsx index b85d46da7ce..500b950c9a2 100644 --- a/apps/studio/components/interfaces/Database/Wrappers/InputField.tsx +++ b/apps/studio/components/interfaces/Database/Wrappers/InputField.tsx @@ -2,7 +2,7 @@ import Link from 'next/link' import { useState } from 'react' import { Button, IconEye, IconEyeOff, IconHelpCircle, IconLoader, Input } from 'ui' -import { ServerOption } from './Wrappers.types' +import type { ServerOption } from './Wrappers.types' interface InputFieldProps { option: ServerOption diff --git a/apps/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx b/apps/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx index 9d7c4b9f766..dbb2e3e816a 100644 --- a/apps/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx +++ b/apps/studio/components/interfaces/Database/Wrappers/WrapperRow.tsx @@ -6,9 +6,9 @@ import Link from 'next/link' import { Button, Collapsible, IconChevronUp, IconEdit, IconExternalLink, IconTrash } from 'ui' import { useParams } from 'common/hooks' -import { FDW } from 'data/fdw/fdws-query' +import type { FDW } from 'data/fdw/fdws-query' import { useCheckPermissions } from 'hooks' -import { WrapperMeta } from './Wrappers.types' +import type { WrapperMeta } from './Wrappers.types' interface WrapperRowProps { wrappers: FDW[] diff --git a/apps/studio/components/interfaces/Database/Wrappers/WrapperTableEditor.tsx b/apps/studio/components/interfaces/Database/Wrappers/WrapperTableEditor.tsx index cc335f5a88a..997cff04d64 100644 --- a/apps/studio/components/interfaces/Database/Wrappers/WrapperTableEditor.tsx +++ b/apps/studio/components/interfaces/Database/Wrappers/WrapperTableEditor.tsx @@ -6,7 +6,7 @@ import ShimmeringLoader from 'components/ui/ShimmeringLoader' import { useSchemasQuery } from 'data/database/schemas-query' import { Form, IconDatabase, IconPlus, Input, Listbox, Modal, SidePanel } from 'ui' import WrapperDynamicColumns from './WrapperDynamicColumns' -import { Table, TableOption } from './Wrappers.types' +import type { Table, TableOption } from './Wrappers.types' import { makeValidateRequired } from './Wrappers.utils' export type WrapperTableEditorProps = { diff --git a/apps/studio/components/interfaces/Database/Wrappers/Wrappers.constants.ts b/apps/studio/components/interfaces/Database/Wrappers/Wrappers.constants.ts index 6dbc3a8b2af..cb67d097fb9 100644 --- a/apps/studio/components/interfaces/Database/Wrappers/Wrappers.constants.ts +++ b/apps/studio/components/interfaces/Database/Wrappers/Wrappers.constants.ts @@ -1,5 +1,5 @@ import { BASE_PATH } from 'lib/constants' -import { WrapperMeta } from './Wrappers.types' +import type { WrapperMeta } from './Wrappers.types' export const WRAPPER_HANDLERS = { STRIPE: 'stripe_fdw_handler', diff --git a/apps/studio/components/interfaces/Database/Wrappers/Wrappers.utils.ts b/apps/studio/components/interfaces/Database/Wrappers/Wrappers.utils.ts index 06e49f0beb7..80ceb01f40c 100644 --- a/apps/studio/components/interfaces/Database/Wrappers/Wrappers.utils.ts +++ b/apps/studio/components/interfaces/Database/Wrappers/Wrappers.utils.ts @@ -1,5 +1,5 @@ import { WRAPPER_HANDLERS } from './Wrappers.constants' -import { WrapperMeta } from './Wrappers.types' +import type { WrapperMeta } from './Wrappers.types' export const makeValidateRequired = (options: { name: string; required: boolean }[]) => { const requiredOptionsSet = new Set( diff --git a/apps/studio/components/interfaces/Docs/Authentication.tsx b/apps/studio/components/interfaces/Docs/Authentication.tsx index 296584ac070..d3a44692039 100644 --- a/apps/studio/components/interfaces/Docs/Authentication.tsx +++ b/apps/studio/components/interfaces/Docs/Authentication.tsx @@ -1,6 +1,6 @@ import Link from 'next/link' -import { AutoApiService } from 'data/config/project-api-query' +import type { AutoApiService } from 'data/config/project-api-query' import CodeSnippet from './CodeSnippet' import Snippets from './Snippets' diff --git a/apps/studio/components/interfaces/Docs/Introduction.tsx b/apps/studio/components/interfaces/Docs/Introduction.tsx index fcdd3f48e13..579e13dec51 100644 --- a/apps/studio/components/interfaces/Docs/Introduction.tsx +++ b/apps/studio/components/interfaces/Docs/Introduction.tsx @@ -1,4 +1,4 @@ -import { AutoApiService } from 'data/config/project-api-query' +import type { AutoApiService } from 'data/config/project-api-query' import Snippets from 'components/interfaces/Docs/Snippets' import CodeSnippet from './CodeSnippet' diff --git a/apps/studio/components/interfaces/Docs/LangSelector.tsx b/apps/studio/components/interfaces/Docs/LangSelector.tsx index 290bf97097e..64cfd60e1da 100644 --- a/apps/studio/components/interfaces/Docs/LangSelector.tsx +++ b/apps/studio/components/interfaces/Docs/LangSelector.tsx @@ -9,7 +9,7 @@ import { IconKey, } from 'ui' -import { showApiKey } from 'components/interfaces/Docs/Docs.types' +import type { showApiKey } from 'components/interfaces/Docs/Docs.types' const DEFAULT_KEY = { name: 'hide', key: 'SUPABASE_KEY' } diff --git a/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx b/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx index 7184b7e8002..a1006a97540 100644 --- a/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx +++ b/apps/studio/components/interfaces/Docs/Pages/UserManagement.tsx @@ -1,7 +1,7 @@ import Link from 'next/link' import { useRouter } from 'next/router' -import { AutoApiService } from 'data/config/project-api-query' +import type { AutoApiService } from 'data/config/project-api-query' import { makeRandomString } from 'lib/helpers' import CodeSnippet from '../CodeSnippet' import Snippets from '../Snippets' diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx index 19ee0b99205..222d25d9e2f 100644 --- a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx +++ b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecret.tsx @@ -1,5 +1,5 @@ import Table from 'components/to-be-cleaned/Table' -import { ProjectSecret } from 'data/secrets/secrets-query' +import type { ProjectSecret } from 'data/secrets/secrets-query' import { Button, IconTrash } from 'ui' interface EdgeFunctionSecretProps { diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx index fc600816fe6..0d882a09d21 100644 --- a/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx +++ b/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx @@ -8,7 +8,7 @@ import { useParams } from 'common/hooks' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import Table from 'components/to-be-cleaned/Table' import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query' -import { EdgeFunctionsResponse } from 'data/edge-functions/edge-functions-query' +import type { EdgeFunctionsResponse } from 'data/edge-functions/edge-functions-query' interface EdgeFunctionsListItemProps { function: EdgeFunctionsResponse diff --git a/apps/studio/components/interfaces/Functions/TerminalInstructions.tsx b/apps/studio/components/interfaces/Functions/TerminalInstructions.tsx index 0249d62f150..ce184e3625b 100644 --- a/apps/studio/components/interfaces/Functions/TerminalInstructions.tsx +++ b/apps/studio/components/interfaces/Functions/TerminalInstructions.tsx @@ -8,7 +8,7 @@ import CommandRender from 'components/interfaces/Functions/CommandRender' import { useAccessTokensQuery } from 'data/access-tokens/access-tokens-query' import { useProjectApiQuery } from 'data/config/project-api-query' import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query' -import { Commands } from './Functions.types' +import type { Commands } from './Functions.types' interface TerminalInstructionsProps { closable?: boolean diff --git a/apps/studio/components/interfaces/Home/Connect/ConnectTabContent.tsx b/apps/studio/components/interfaces/Home/Connect/ConnectTabContent.tsx index bf47d10edff..6561f818160 100644 --- a/apps/studio/components/interfaces/Home/Connect/ConnectTabContent.tsx +++ b/apps/studio/components/interfaces/Home/Connect/ConnectTabContent.tsx @@ -6,7 +6,7 @@ import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useProjectSettingsQuery } from 'data/config/project-settings-query' import { usePoolingConfigurationQuery } from 'data/database/pooling-configuration-query' import { pluckObjectFields } from 'lib/helpers' -import { projectKeys } from './Connect.types' +import type { projectKeys } from './Connect.types' interface ConnectContentTabProps { projectKeys: projectKeys diff --git a/apps/studio/components/interfaces/Home/Connect/content/astro/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/astro/supabasejs/content.tsx index 338da090d58..aecccde06e9 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/astro/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/astro/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/drizzle/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/drizzle/content.tsx index c862728307e..9c6a34acf27 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/drizzle/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/drizzle/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/exporeactnative/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/exporeactnative/supabasejs/content.tsx index 56e535f80c3..820bac7fe5f 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/exporeactnative/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/exporeactnative/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/nextjs/app/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/nextjs/app/supabasejs/content.tsx index cb9e66fe3c6..077a7dfc9b5 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/nextjs/app/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/nextjs/app/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/nextjs/pages/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/nextjs/pages/supabasejs/content.tsx index cf0d13d153a..4131fd593cf 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/nextjs/pages/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/nextjs/pages/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/nuxt/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/nuxt/supabasejs/content.tsx index c42375e073e..137f60e09c1 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/nuxt/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/nuxt/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/prisma/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/prisma/content.tsx index 1295875560a..8ec64311300 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/prisma/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/prisma/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/react/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/react/supabasejs/content.tsx index dbd7d2fdae9..3a6e6e6a2f1 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/react/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/react/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/refine/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/refine/supabasejs/content.tsx index 1454a0c4692..1d56893b856 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/refine/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/refine/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/remix/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/remix/supabasejs/content.tsx index d584a944daf..80e12a0a088 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/remix/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/remix/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/solidjs/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/solidjs/supabasejs/content.tsx index a0e2c647066..54f2ca88ca6 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/solidjs/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/solidjs/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/sveltekit/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/sveltekit/supabasejs/content.tsx index 6307039c60e..7a6c11670ce 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/sveltekit/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/sveltekit/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/Connect/content/vuejs/supabasejs/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/vuejs/supabasejs/content.tsx index 0bf5c3b5f4b..a2765379e87 100644 --- a/apps/studio/components/interfaces/Home/Connect/content/vuejs/supabasejs/content.tsx +++ b/apps/studio/components/interfaces/Home/Connect/content/vuejs/supabasejs/content.tsx @@ -1,4 +1,4 @@ -import { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' import { ConnectTabs, diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx index 490b8616805..36741d0d1b0 100644 --- a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx +++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx @@ -1,9 +1,9 @@ import { GitBranch, Github } from 'lucide-react' import CardButton from 'components/ui/CardButton' -import { IntegrationProjectConnection } from 'data/integrations/integrations.types' -import { ProjectInfo } from 'data/projects/projects-query' -import { ResourceWarning } from 'data/usage/resource-warnings-query' +import type { IntegrationProjectConnection } from 'data/integrations/integrations.types' +import type { ProjectInfo } from 'data/projects/projects-query' +import type { ResourceWarning } from 'data/usage/resource-warnings-query' import { BASE_PATH } from 'lib/constants' import { inferProjectStatus } from './ProjectCard.utils' import { ProjectCardStatus } from './ProjectCardStatus' diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.utils.ts b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.utils.ts index 99dbf03c183..26b01d598e2 100644 --- a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.utils.ts +++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.utils.ts @@ -1,4 +1,4 @@ -import { ProjectInfo } from 'data/projects/projects-query' +import type { ProjectInfo } from 'data/projects/projects-query' import { PROJECT_STATUS } from 'lib/constants' export const inferProjectStatus = (project: ProjectInfo) => { diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectCardStatus.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectCardStatus.tsx index d937c8d1071..65fa35bf8ba 100644 --- a/apps/studio/components/interfaces/Home/ProjectList/ProjectCardStatus.tsx +++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectCardStatus.tsx @@ -1,7 +1,7 @@ import * as Tooltip from '@radix-ui/react-tooltip' import { RESOURCE_WARNING_MESSAGES } from 'components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.constants' import { getWarningContent } from 'components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.utils' -import { ResourceWarning } from 'data/usage/resource-warnings-query' +import type { ResourceWarning } from 'data/usage/resource-warnings-query' import { AlertTriangle, Info, RefreshCcw } from 'lucide-react' import { Alert_Shadcn_, AlertTitle_Shadcn_, cn, IconPauseCircle } from 'ui' import { InferredProjectStatus } from './ProjectCard.utils' diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx index 5d3cc9b5b19..758c23f4a04 100644 --- a/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx +++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx @@ -16,7 +16,7 @@ import { ResourceWarning, useResourceWarningsQuery } from 'data/usage/resource-w import { useSelectedOrganization } from 'hooks' import { IS_PLATFORM } from 'lib/constants' import { makeRandomString } from 'lib/helpers' -import { Organization, ResponseError } from 'types' +import type { Organization, ResponseError } from 'types' import { Button, IconPlus } from 'ui' import ProjectCard from './ProjectCard' import ShimmeringCard from './ShimmeringCard' diff --git a/apps/studio/components/interfaces/Home/ProjectUsage.tsx b/apps/studio/components/interfaces/Home/ProjectUsage.tsx index fd0ad92a724..cdd7def1fe3 100644 --- a/apps/studio/components/interfaces/Home/ProjectUsage.tsx +++ b/apps/studio/components/interfaces/Home/ProjectUsage.tsx @@ -4,7 +4,7 @@ import sumBy from 'lodash/sumBy' import Link from 'next/link' import { useRouter } from 'next/router' import { useState } from 'react' -import { ChartIntervals } from 'types' +import type { ChartIntervals } from 'types' import { Button, DropdownMenu, diff --git a/apps/studio/components/interfaces/Integrations/IntegrationConnection.tsx b/apps/studio/components/interfaces/Integrations/IntegrationConnection.tsx index 14ea02bebf9..3c3f1fd8474 100644 --- a/apps/studio/components/interfaces/Integrations/IntegrationConnection.tsx +++ b/apps/studio/components/interfaces/Integrations/IntegrationConnection.tsx @@ -25,7 +25,7 @@ import { } from 'components/interfaces/Integrations/IntegrationPanels' import { WarningIcon } from 'components/ui/Icons' import { useIntegrationsVercelConnectionSyncEnvsMutation } from 'data/integrations/integrations-vercel-connection-sync-envs-mutation' -import { IntegrationProjectConnection } from 'data/integrations/integrations.types' +import type { IntegrationProjectConnection } from 'data/integrations/integrations.types' import { useProjectsQuery } from 'data/projects/projects-query' import { useStore } from 'hooks' diff --git a/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx b/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx index 58caf455aaa..f72e7bceeef 100644 --- a/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx +++ b/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx @@ -3,7 +3,10 @@ import Image from 'next/legacy/image' import React from 'react' import { Markdown } from 'components/interfaces/Markdown' -import { Integration, IntegrationProjectConnection } from 'data/integrations/integrations.types' +import type { + Integration, + IntegrationProjectConnection, +} from 'data/integrations/integrations.types' import { useProjectsQuery } from 'data/projects/projects-query' import { BASE_PATH } from 'lib/constants' import { getIntegrationConfigurationUrl } from 'lib/integration-utils' diff --git a/apps/studio/components/interfaces/Integrations/OrganizationPicker.tsx b/apps/studio/components/interfaces/Integrations/OrganizationPicker.tsx index f706b5f120c..e4ca69f3e94 100644 --- a/apps/studio/components/interfaces/Integrations/OrganizationPicker.tsx +++ b/apps/studio/components/interfaces/Integrations/OrganizationPicker.tsx @@ -1,10 +1,10 @@ import { getHasInstalledObject } from 'components/layouts/IntegrationsLayout/Integrations.utils' import { useIntegrationsQuery } from 'data/integrations/integrations-query' -import { IntegrationName } from 'data/integrations/integrations.types' +import type { IntegrationName } from 'data/integrations/integrations.types' import { useOrganizationsQuery } from 'data/organizations/organizations-query' import { useMemo, useRef, useState } from 'react' -import { Organization } from 'types' +import type { Organization } from 'types' import { Badge, Button, diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx index ee1684e5c4e..5943872e241 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx @@ -1,8 +1,8 @@ import * as Tooltip from '@radix-ui/react-tooltip' import Link from 'next/link' -import { OrgSubscription } from 'data/subscriptions/types' -import { OrgUsageResponse } from 'data/usage/org-usage-query' +import type { OrgSubscription } from 'data/subscriptions/types' +import type { OrgUsageResponse } from 'data/usage/org-usage-query' import { Button, IconChevronRight, IconPieChart } from 'ui' import { Metric, USAGE_APPROACHING_THRESHOLD } from './BillingBreakdown.constants' import { billingMetricUnit, formatUsage } from '../helpers' diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx index 2746c44e686..54e89157e60 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/ComputeMetric.tsx @@ -1,7 +1,7 @@ import * as Tooltip from '@radix-ui/react-tooltip' import Link from 'next/link' -import { OrgUsageResponse } from 'data/usage/org-usage-query' +import type { OrgUsageResponse } from 'data/usage/org-usage-query' import { IconChevronRight, IconPieChart } from 'ui' import { Metric } from './BillingBreakdown.constants' import { formatUsage } from '../helpers' diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/ChangePaymentMethodModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/ChangePaymentMethodModal.tsx index 7b4485b01a8..95247b0905c 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/ChangePaymentMethodModal.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/ChangePaymentMethodModal.tsx @@ -1,8 +1,8 @@ import { useParams } from 'common' -import { OrganizationPaymentMethod } from 'data/organizations/organization-payment-methods-query' +import type { OrganizationPaymentMethod } from 'data/organizations/organization-payment-methods-query' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' import { useOrgSubscriptionUpdateMutation } from 'data/subscriptions/org-subscription-update-mutation' -import { SubscriptionTier } from 'data/subscriptions/types' +import type { SubscriptionTier } from 'data/subscriptions/types' import { useStore } from 'hooks' import { Button, Modal } from 'ui' diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/DeletePaymentMethodModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/DeletePaymentMethodModal.tsx index 68bc419fa7e..770976f4009 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/DeletePaymentMethodModal.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/DeletePaymentMethodModal.tsx @@ -1,6 +1,6 @@ import { useParams } from 'common' import { useOrganizationPaymentMethodDeleteMutation } from 'data/organizations/organization-payment-method-delete-mutation' -import { OrganizationPaymentMethod } from 'data/organizations/organization-payment-methods-query' +import type { OrganizationPaymentMethod } from 'data/organizations/organization-payment-methods-query' import { useStore } from 'hooks' import { Alert, Button, Modal } from 'ui' diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx index 32b384ba0bf..da23dd296e5 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx @@ -1,5 +1,5 @@ -import { ProjectInfo } from 'data/projects/projects-query' -import { OrgSubscription, ProjectAddon } from 'data/subscriptions/types' +import type { ProjectInfo } from 'data/projects/projects-query' +import type { OrgSubscription, ProjectAddon } from 'data/subscriptions/types' import { PricingInformation } from 'shared-data' import { Alert, IconAlertOctagon, IconMinusCircle, IconPauseCircle, Modal } from 'ui' diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx index 29019f47d5c..ed7f6166289 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/ExitSurveyModal.tsx @@ -4,7 +4,7 @@ import { useReducer, useRef, useState } from 'react' import { useParams } from 'common' import { useSendDowngradeFeedbackMutation } from 'data/feedback/exit-survey-send' -import { OrgSubscription } from 'data/subscriptions/types' +import type { OrgSubscription } from 'data/subscriptions/types' import { useOrgSubscriptionUpdateMutation } from 'data/subscriptions/org-subscription-update-mutation' import { useFlag, useStore } from 'hooks' import { Alert, Button, Input, Modal } from 'ui' diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx index a8910fead88..fbdae99ac0b 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx @@ -15,7 +15,7 @@ import { useOrganizationBillingSubscriptionPreview } from 'data/organizations/or import { useOrgPlansQuery } from 'data/subscriptions/org-plans-query' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' import { useOrgSubscriptionUpdateMutation } from 'data/subscriptions/org-subscription-update-mutation' -import { OrgPlan, SubscriptionTier } from 'data/subscriptions/types' +import type { OrgPlan, SubscriptionTier } from 'data/subscriptions/types' import { useCheckPermissions, useSelectedOrganization, useStore } from 'hooks' import { PRICING_TIER_PRODUCT_IDS } from 'lib/constants' import Telemetry from 'lib/telemetry' diff --git a/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx b/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx index 911baec6c53..2a694d3cf24 100644 --- a/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx +++ b/apps/studio/components/interfaces/Organization/IntegrationSettings/IntegrationSettings.tsx @@ -12,7 +12,7 @@ import { } from 'components/layouts/Scaffold' import { useGitHubConnectionDeleteMutation } from 'data/integrations/github-connection-delete-mutation' import { useGitHubConnectionsQuery } from 'data/integrations/github-connections-query' -import { IntegrationProjectConnection } from 'data/integrations/integrations.types' +import type { IntegrationProjectConnection } from 'data/integrations/integrations.types' import { useSelectedOrganization, useStore } from 'hooks' import { BASE_PATH, OPT_IN_TAGS } from 'lib/constants' import { useSidePanelsStateSnapshot } from 'state/side-panels' diff --git a/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelGitHubRepoLinker.tsx b/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelGitHubRepoLinker.tsx index 95e04e19a31..33cc3504f94 100644 --- a/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelGitHubRepoLinker.tsx +++ b/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelGitHubRepoLinker.tsx @@ -7,7 +7,7 @@ import { Markdown } from 'components/interfaces/Markdown' import { useGitHubAuthorizationQuery } from 'data/integrations/github-authorization-query' import { useGitHubConnectionCreateMutation } from 'data/integrations/github-connection-create-mutation' import { useGitHubRepositoriesQuery } from 'data/integrations/github-repositories-query' -import { IntegrationConnectionsCreateVariables } from 'data/integrations/integrations.types' +import type { IntegrationConnectionsCreateVariables } from 'data/integrations/integrations.types' import { useProjectsQuery } from 'data/projects/projects-query' import { useSelectedOrganization } from 'hooks' import { openInstallGitHubIntegrationWindow } from 'lib/github' diff --git a/apps/studio/components/interfaces/Organization/NewProject/FreeProjectLimitWarning.tsx b/apps/studio/components/interfaces/Organization/NewProject/FreeProjectLimitWarning.tsx index b3b1101188e..0aefed076b3 100644 --- a/apps/studio/components/interfaces/Organization/NewProject/FreeProjectLimitWarning.tsx +++ b/apps/studio/components/interfaces/Organization/NewProject/FreeProjectLimitWarning.tsx @@ -2,7 +2,7 @@ import Link from 'next/link' import { Button, IconAlertCircle } from 'ui' import InformationBox from 'components/ui/InformationBox' -import { MemberWithFreeProjectLimit } from 'data/organizations/free-project-limit-check-query' +import type { MemberWithFreeProjectLimit } from 'data/organizations/free-project-limit-check-query' interface FreeProjectLimitWarningProps { membersExceededLimit: MemberWithFreeProjectLimit[] diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/AuthorizedAppRow.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/AuthorizedAppRow.tsx index 3402be2d4d7..4e2d61718f2 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/AuthorizedAppRow.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/AuthorizedAppRow.tsx @@ -1,5 +1,5 @@ import Table from 'components/to-be-cleaned/Table' -import { AuthorizedApp } from 'data/oauth/authorized-apps-query' +import type { AuthorizedApp } from 'data/oauth/authorized-apps-query' import dayjs from 'dayjs' import { Button, IconTrash } from 'ui' diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/DeleteAppModal.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/DeleteAppModal.tsx index aa9a5a6ed49..69abd09e844 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/DeleteAppModal.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/DeleteAppModal.tsx @@ -1,6 +1,6 @@ import { useParams } from 'common' import { useOAuthAppDeleteMutation } from 'data/oauth/oauth-app-delete-mutation' -import { OAuthApp } from 'data/oauth/oauth-apps-query' +import type { OAuthApp } from 'data/oauth/oauth-apps-query' import { useStore } from 'hooks' import { Alert, IconLock, Modal } from 'ui' diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthAppRow.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthAppRow.tsx index b906ddc904d..76391b71602 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthAppRow.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthAppRow.tsx @@ -1,5 +1,5 @@ import Table from 'components/to-be-cleaned/Table' -import { OAuthApp } from 'data/oauth/oauth-apps-query' +import type { OAuthApp } from 'data/oauth/oauth-apps-query' import dayjs from 'dayjs' import { copyToClipboard } from 'lib/helpers' import { useState } from 'react' diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx index ec73cc2897c..179f341a6f1 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx @@ -1,14 +1,14 @@ import clsx from 'clsx' import { ChangeEvent, useEffect, useRef, useState } from 'react' -import { OAuthScope } from '@supabase/shared-types/out/constants' +import type { OAuthScope } from '@supabase/shared-types/out/constants' import { useParams } from 'common' import { OAuthAppCreateResponse, useOAuthAppCreateMutation, } from 'data/oauth/oauth-app-create-mutation' import { useOAuthAppUpdateMutation } from 'data/oauth/oauth-app-update-mutation' -import { OAuthApp } from 'data/oauth/oauth-apps-query' +import type { OAuthApp } from 'data/oauth/oauth-apps-query' import { useStore } from 'hooks' import { isValidHttpUrl, uuidv4 } from 'lib/helpers' import { uploadAttachment } from 'lib/upload' diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/RevokeAppModal.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/RevokeAppModal.tsx index dcedd1fde07..47f7e64bcb9 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/RevokeAppModal.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/RevokeAppModal.tsx @@ -1,6 +1,6 @@ import { useParams } from 'common' import { useAuthorizedAppRevokeMutation } from 'data/oauth/authorized-app-revoke-mutation' -import { AuthorizedApp } from 'data/oauth/authorized-apps-query' +import type { AuthorizedApp } from 'data/oauth/authorized-apps-query' import { useStore } from 'hooks' import { Alert, IconLock, Modal } from 'ui' diff --git a/apps/studio/components/interfaces/Organization/Organization.utils.ts b/apps/studio/components/interfaces/Organization/Organization.utils.ts index 44e6c600804..e8bd15acadf 100644 --- a/apps/studio/components/interfaces/Organization/Organization.utils.ts +++ b/apps/studio/components/interfaces/Organization/Organization.utils.ts @@ -1,4 +1,4 @@ -import { OrganizationMember } from 'data/organizations/organization-members-query' +import type { OrganizationMember } from 'data/organizations/organization-members-query' // Invite is expired if older than 24hrs export function isInviteExpired(timestamp: string) { diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx index 87f91c21ffe..4a80d1e590d 100644 --- a/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx +++ b/apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx @@ -7,9 +7,9 @@ import { Button, Form, IconMail, Input, Listbox, Modal } from 'ui' import { object, string } from 'yup' import { useOrganizationMemberInviteCreateMutation } from 'data/organizations/organization-member-invite-create-mutation' -import { OrganizationMember } from 'data/organizations/organization-members-query' +import type { OrganizationMember } from 'data/organizations/organization-members-query' import { doPermissionsCheck, useGetPermissions, useStore } from 'hooks' -import { Role } from 'types' +import type { Role } from 'types' export interface InviteMemberButtonProps { orgId: number diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/MemberActions.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/MemberActions.tsx index 4e73f696c3d..6a22efd6008 100644 --- a/apps/studio/components/interfaces/Organization/TeamSettings/MemberActions.tsx +++ b/apps/studio/components/interfaces/Organization/TeamSettings/MemberActions.tsx @@ -19,10 +19,10 @@ import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import { useOrganizationMemberDeleteMutation } from 'data/organizations/organization-member-delete-mutation' import { useOrganizationMemberInviteCreateMutation } from 'data/organizations/organization-member-invite-create-mutation' import { useOrganizationMemberInviteDeleteMutation } from 'data/organizations/organization-member-invite-delete-mutation' -import { OrganizationMember } from 'data/organizations/organization-members-query' +import type { OrganizationMember } from 'data/organizations/organization-members-query' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { useCheckPermissions, useIsFeatureEnabled, useSelectedOrganization, useStore } from 'hooks' -import { Role } from 'types' +import type { Role } from 'types' import { isInviteExpired } from '../Organization.utils' import { useGetRolesManagementPermissions } from './TeamSettings.utils' diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.utils.ts b/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.utils.ts index 942362c98bb..7f5136cba16 100644 --- a/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.utils.ts +++ b/apps/studio/components/interfaces/Organization/TeamSettings/TeamSettings.utils.ts @@ -1,7 +1,7 @@ import { PermissionAction } from '@supabase/shared-types/out/constants' -import { OrganizationMember } from 'data/organizations/organization-members-query' +import type { OrganizationMember } from 'data/organizations/organization-members-query' import { doPermissionsCheck, useGetPermissions } from 'hooks' -import { Permission, Role } from 'types' +import type { Permission, Role } from 'types' export const useGetRolesManagementPermissions = ( orgId?: number, diff --git a/apps/studio/components/interfaces/Organization/Usage/Activity.tsx b/apps/studio/components/interfaces/Organization/Usage/Activity.tsx index 6ff0b0c997b..f80c6923fb6 100644 --- a/apps/studio/components/interfaces/Organization/Usage/Activity.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/Activity.tsx @@ -1,6 +1,6 @@ import { DataPoint } from 'data/analytics/constants' import { PricingMetric, useOrgDailyStatsQuery } from 'data/analytics/org-daily-stats-query' -import { OrgSubscription } from 'data/subscriptions/types' +import type { OrgSubscription } from 'data/subscriptions/types' import UsageSection from './UsageSection/UsageSection' export interface ActivityProps { diff --git a/apps/studio/components/interfaces/Organization/Usage/Bandwidth.tsx b/apps/studio/components/interfaces/Organization/Usage/Bandwidth.tsx index bac6769df6b..f6bbf70669b 100644 --- a/apps/studio/components/interfaces/Organization/Usage/Bandwidth.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/Bandwidth.tsx @@ -1,6 +1,6 @@ import { DataPoint } from 'data/analytics/constants' import { PricingMetric, useOrgDailyStatsQuery } from 'data/analytics/org-daily-stats-query' -import { OrgSubscription } from 'data/subscriptions/types' +import type { OrgSubscription } from 'data/subscriptions/types' import UsageSection from './UsageSection/UsageSection' export interface BandwidthProps { diff --git a/apps/studio/components/interfaces/Organization/Usage/Compute.tsx b/apps/studio/components/interfaces/Organization/Usage/Compute.tsx index f4b54733bc0..7753a06f78a 100644 --- a/apps/studio/components/interfaces/Organization/Usage/Compute.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/Compute.tsx @@ -1,6 +1,6 @@ import { DataPoint } from 'data/analytics/constants' import { ComputeUsageMetric, computeUsageMetricLabel } from 'data/analytics/org-daily-stats-query' -import { OrgSubscription } from 'data/subscriptions/types' +import type { OrgSubscription } from 'data/subscriptions/types' import SectionContent from './SectionContent' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import AlertError from 'components/ui/AlertError' diff --git a/apps/studio/components/interfaces/Organization/Usage/SizeAndCounts.tsx b/apps/studio/components/interfaces/Organization/Usage/SizeAndCounts.tsx index 9ba7b468ef4..96bc874ff8e 100644 --- a/apps/studio/components/interfaces/Organization/Usage/SizeAndCounts.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/SizeAndCounts.tsx @@ -1,6 +1,6 @@ import { DataPoint } from 'data/analytics/constants' import { PricingMetric, useOrgDailyStatsQuery } from 'data/analytics/org-daily-stats-query' -import { OrgSubscription } from 'data/subscriptions/types' +import type { OrgSubscription } from 'data/subscriptions/types' import UsageSection from './UsageSection/UsageSection' export interface SizeAndCountsProps { diff --git a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx index ba4785f9f49..f56de7d4206 100644 --- a/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/TotalUsage.tsx @@ -1,4 +1,4 @@ -import { OrgSubscription } from 'data/subscriptions/types' +import type { OrgSubscription } from 'data/subscriptions/types' import SectionContent from './SectionContent' import ShimmeringLoader from 'components/ui/ShimmeringLoader' import AlertError from 'components/ui/AlertError' diff --git a/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx b/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx index 708de836d82..d4e6a4708ed 100644 --- a/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/Usage.constants.tsx @@ -1,7 +1,7 @@ import { USAGE_APPROACHING_THRESHOLD } from 'components/interfaces/Billing/Billing.constants' import { EgressType, PricingMetric } from 'data/analytics/org-daily-stats-query' -import { OrgSubscription } from 'data/subscriptions/types' -import { OrgUsageResponse } from 'data/usage/org-usage-query' +import type { OrgSubscription } from 'data/subscriptions/types' +import type { OrgUsageResponse } from 'data/usage/org-usage-query' import { Alert } from 'ui' export const COLOR_MAP = { diff --git a/apps/studio/components/interfaces/Organization/Usage/Usage.utils.ts b/apps/studio/components/interfaces/Organization/Usage/Usage.utils.ts index ab58f60e7ca..4e68b9e278a 100644 --- a/apps/studio/components/interfaces/Organization/Usage/Usage.utils.ts +++ b/apps/studio/components/interfaces/Organization/Usage/Usage.utils.ts @@ -1,5 +1,5 @@ import { DataPoint } from 'data/analytics/constants' -import { OrgSubscription } from 'data/subscriptions/types' +import type { OrgSubscription } from 'data/subscriptions/types' // [Joshen] This is just for development to generate some test data for chart rendering export const generateUsageData = (attribute: string, days: number): DataPoint[] => { diff --git a/apps/studio/components/interfaces/Organization/Usage/UsageChartTooltips.tsx b/apps/studio/components/interfaces/Organization/Usage/UsageChartTooltips.tsx index ea59cdd0649..da6f20200c6 100644 --- a/apps/studio/components/interfaces/Organization/Usage/UsageChartTooltips.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/UsageChartTooltips.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx' -import { Payload, ValueType } from 'recharts/types/component/DefaultTooltipContent' +import type { Payload, ValueType } from 'recharts/types/component/DefaultTooltipContent' import { Attribute, COLOR_MAP } from './Usage.constants' export interface SingleAttributeTooltipContentProps { diff --git a/apps/studio/components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx b/apps/studio/components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx index 987f544f56f..e0a01bd76c1 100644 --- a/apps/studio/components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/UsageSection/AttributeUsage.tsx @@ -6,11 +6,11 @@ import AlertError from 'components/ui/AlertError' import Panel from 'components/ui/Panel' import ShimmeringLoader from 'components/ui/ShimmeringLoader' import SparkBar from 'components/ui/SparkBar' -import { OrgSubscription } from 'data/subscriptions/types' -import { OrgMetricsUsage, OrgUsageResponse } from 'data/usage/org-usage-query' +import type { OrgSubscription } from 'data/subscriptions/types' +import type { OrgMetricsUsage, OrgUsageResponse } from 'data/usage/org-usage-query' import { USAGE_APPROACHING_THRESHOLD } from 'lib/constants' import { useMemo } from 'react' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { Button, IconAlertTriangle, IconBarChart2 } from 'ui' import SectionContent from '../SectionContent' import { CategoryAttribute } from '../Usage.constants' diff --git a/apps/studio/components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx b/apps/studio/components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx index 7f8347332ac..f5a4fe47b8f 100644 --- a/apps/studio/components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/UsageSection/UsageSection.tsx @@ -1,6 +1,6 @@ import { ScaffoldContainer, ScaffoldDivider } from 'components/layouts/Scaffold' import { DataPoint } from 'data/analytics/constants' -import { OrgSubscription } from 'data/subscriptions/types' +import type { OrgSubscription } from 'data/subscriptions/types' import { useOrgUsageQuery } from 'data/usage/org-usage-query' import SectionHeader from '../SectionHeader' import { CategoryMetaKey, USAGE_CATEGORIES } from '../Usage.constants' diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx index 02361fe320e..22bf7499a4e 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx @@ -6,7 +6,7 @@ import { formatBytes } from 'lib/helpers' import { useAppStateSnapshot } from 'state/app-state' import { DOCS_RESOURCE_CONTENT } from '../ProjectAPIDocs.constants' import ResourceContent from '../ResourceContent' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const Bucket = ({ language, apikey, endpoint }: ContentProps) => { const { ref } = useParams() diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.tsx index 0bc0fcd63c8..dca7cce0c52 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.tsx @@ -4,7 +4,7 @@ import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query' import { useAppStateSnapshot } from 'state/app-state' import { DOCS_RESOURCE_CONTENT } from '../ProjectAPIDocs.constants' import ResourceContent from '../ResourceContent' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const Bucket = ({ language, apikey = 'API_KEY', endpoint }: ContentProps) => { const { ref } = useParams() diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunctions.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunctions.tsx index c3ed52dfdb1..c33ccd8a267 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunctions.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunctions.tsx @@ -1,6 +1,6 @@ import ContentSnippet from '../ContentSnippet' import { DOCS_CONTENT } from '../ProjectAPIDocs.constants' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const EdgeFunctions = ({ language }: ContentProps) => { return ( diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx index 9a669a98b8f..165c1bce3dd 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx @@ -7,7 +7,7 @@ import { generateTypes } from 'data/projects/project-type-generation-query' import { useStore } from 'hooks' import ContentSnippet from '../ContentSnippet' import { DOCS_CONTENT } from '../ProjectAPIDocs.constants' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const Entities = ({ language }: ContentProps) => { const { ui } = useStore() diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entity.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entity.tsx index a497204147b..5d35d677bd8 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entity.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entity.tsx @@ -6,7 +6,7 @@ import { useProjectJsonSchemaQuery } from 'data/docs/project-json-schema-query' import { useAppStateSnapshot } from 'state/app-state' import { DOCS_RESOURCE_CONTENT } from '../ProjectAPIDocs.constants' import ResourceContent from '../ResourceContent' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' import { tempRemovePostgrestText } from './Content.utils' import LanguageSelector from '../LanguageSelector' diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx index c308dd63ba1..a79d78b3ac4 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx @@ -4,7 +4,7 @@ import { Button, IconCopy, Input } from 'ui' import { useProjectApiQuery } from 'data/config/project-api-query' import ContentSnippet from '../ContentSnippet' import { DOCS_CONTENT } from '../ProjectAPIDocs.constants' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' import { copyToClipboard } from 'lib/helpers' import { useEffect, useState } from 'react' diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/RPC.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/RPC.tsx index f57d4af9d25..09cc8e1d785 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/RPC.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/RPC.tsx @@ -8,7 +8,7 @@ import { useOpenAPISpecQuery } from 'data/open-api/api-spec-query' import { useAppStateSnapshot } from 'state/app-state' import { DOCS_RESOURCE_CONTENT } from '../ProjectAPIDocs.constants' import ResourceContent from '../ResourceContent' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const RPC = ({ language }: ContentProps) => { const { ref } = useParams() diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Realtime.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Realtime.tsx index abf69033170..e628ddca522 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Realtime.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Realtime.tsx @@ -1,6 +1,6 @@ import ContentSnippet from '../ContentSnippet' import { DOCS_CONTENT } from '../ProjectAPIDocs.constants' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const Realtime = ({ language }: ContentProps) => { return ( diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Storage.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Storage.tsx index c9a76f5c415..18f7b851799 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Storage.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Storage.tsx @@ -1,6 +1,6 @@ import ContentSnippet from '../ContentSnippet' import { DOCS_CONTENT } from '../ProjectAPIDocs.constants' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const Storage = ({ language }: ContentProps) => { return ( diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/StoredProcedures.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/StoredProcedures.tsx index 977e88a777d..20ef8e3767c 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/StoredProcedures.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/StoredProcedures.tsx @@ -1,6 +1,6 @@ import ContentSnippet from '../ContentSnippet' import { DOCS_CONTENT } from '../ProjectAPIDocs.constants' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const StoredProcedures = ({ language }: ContentProps) => { return ( diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx index 4f75a2c2663..22e762d9eb5 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx @@ -1,6 +1,6 @@ import ContentSnippet from '../ContentSnippet' import { DOCS_CONTENT } from '../ProjectAPIDocs.constants' -import { ContentProps } from './Content.types' +import type { ContentProps } from './Content.types' const UserManagement = ({ language, apikey, endpoint }: ContentProps) => { return ( diff --git a/apps/studio/components/interfaces/Realtime/Inspector/MessageSelection.tsx b/apps/studio/components/interfaces/Realtime/Inspector/MessageSelection.tsx index dde4f3d36ad..db121fd1bb3 100644 --- a/apps/studio/components/interfaces/Realtime/Inspector/MessageSelection.tsx +++ b/apps/studio/components/interfaces/Realtime/Inspector/MessageSelection.tsx @@ -5,7 +5,7 @@ import { Button, IconX, cn } from 'ui' import CopyButton from 'components/ui/CopyButton' import Telemetry from 'lib/telemetry' -import { LogData } from './Messages.types' +import type { LogData } from './Messages.types' import { SelectedRealtimeMessagePanel } from './SelectedRealtimeMessagePanel' export interface MessageSelectionProps { diff --git a/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx b/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx index 75473d1a61d..3078c96e5f2 100644 --- a/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx +++ b/apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx @@ -10,7 +10,7 @@ import ShimmerLine from 'components/ui/ShimmerLine' import Telemetry from 'lib/telemetry' import { useRouter } from 'next/router' import MessageSelection from './MessageSelection' -import { LogData } from './Messages.types' +import type { LogData } from './Messages.types' import NoChannelEmptyState from './NoChannelEmptyState' import { ColumnRenderer } from './RealtimeMessageColumnRenderer' diff --git a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeMessageColumnRenderer.tsx b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeMessageColumnRenderer.tsx index ac0315e1274..9c7308c6a23 100644 --- a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeMessageColumnRenderer.tsx +++ b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeMessageColumnRenderer.tsx @@ -1,7 +1,7 @@ import { Column } from 'react-data-grid' import { IconAlertTriangle, IconBroadcast, IconDatabaseChanges, IconPresence, cn } from 'ui' -import { LogData, PreviewLogData } from './Messages.types' +import type { LogData, PreviewLogData } from './Messages.types' import { RowLayout } from './MessagesFormatters' import { isErrorLog } from './MessagesTable' diff --git a/apps/studio/components/interfaces/Realtime/Inspector/SelectedRealtimeMessagePanel.tsx b/apps/studio/components/interfaces/Realtime/Inspector/SelectedRealtimeMessagePanel.tsx index 44f0a236042..529dfb5dca9 100644 --- a/apps/studio/components/interfaces/Realtime/Inspector/SelectedRealtimeMessagePanel.tsx +++ b/apps/studio/components/interfaces/Realtime/Inspector/SelectedRealtimeMessagePanel.tsx @@ -1,4 +1,4 @@ -import { LogData } from './Messages.types' +import type { LogData } from './Messages.types' import { jsonSyntaxHighlight, SelectionDetailedTimestampRow } from './MessagesFormatters' const LogsDivider = () => { diff --git a/apps/studio/components/interfaces/Realtime/Inspector/useRealtimeMessages.ts b/apps/studio/components/interfaces/Realtime/Inspector/useRealtimeMessages.ts index 9dd8a914613..6e3dd7a23ab 100644 --- a/apps/studio/components/interfaces/Realtime/Inspector/useRealtimeMessages.ts +++ b/apps/studio/components/interfaces/Realtime/Inspector/useRealtimeMessages.ts @@ -6,7 +6,7 @@ import toast from 'react-hot-toast' import { useProjectApiQuery } from 'data/config/project-api-query' import { uuidv4 } from 'lib/helpers' import { EMPTY_ARR } from 'lib/void' -import { LogData } from './Messages.types' +import type { LogData } from './Messages.types' function reducer( state: LogData[], diff --git a/apps/studio/components/interfaces/Reports/ReportFilterBar.tsx b/apps/studio/components/interfaces/Reports/ReportFilterBar.tsx index bed81a02361..18e49316f3d 100644 --- a/apps/studio/components/interfaces/Reports/ReportFilterBar.tsx +++ b/apps/studio/components/interfaces/Reports/ReportFilterBar.tsx @@ -22,7 +22,7 @@ import { import DatePickers from '../Settings/Logs/Logs.DatePickers' import { REPORTS_DATEPICKER_HELPERS } from './Reports.constants' -import { ReportFilterItem } from './Reports.types' +import type { ReportFilterItem } from './Reports.types' interface ReportFilterBarProps { filters: ReportFilterItem[] diff --git a/apps/studio/components/interfaces/Reports/ReportWidget.tsx b/apps/studio/components/interfaces/Reports/ReportWidget.tsx index 17a409494b8..f8bf9fa3524 100644 --- a/apps/studio/components/interfaces/Reports/ReportWidget.tsx +++ b/apps/studio/components/interfaces/Reports/ReportWidget.tsx @@ -3,7 +3,7 @@ import Panel from 'components/ui/Panel' import { NextRouter, useRouter } from 'next/router' import { Button, IconExternalLink, IconHelpCircle, Loading } from 'ui' import { LogsEndpointParams } from '../Settings/Logs' -import { BaseReportParams, ReportQueryType } from './Reports.types' +import type { BaseReportParams, ReportQueryType } from './Reports.types' export interface ReportWidgetProps { data: T[] diff --git a/apps/studio/components/interfaces/Reports/Reports.queries.ts b/apps/studio/components/interfaces/Reports/Reports.queries.ts index 11e6cdded25..a20c94b481b 100644 --- a/apps/studio/components/interfaces/Reports/Reports.queries.ts +++ b/apps/studio/components/interfaces/Reports/Reports.queries.ts @@ -1,8 +1,6 @@ -import { useProjectContentStore } from 'stores/projectContentStore' import { PRESET_CONFIG } from './Reports.constants' import { Presets } from './Reports.types' import useDbQuery from 'hooks/analytics/useDbQuery' -import { useMutation, useQuery } from '@tanstack/react-query' type QueryPerformanceQueryOpts = { searchQuery: string diff --git a/apps/studio/components/interfaces/Reports/Reports.types.ts b/apps/studio/components/interfaces/Reports/Reports.types.ts index b1f5c8da7be..17e18e61120 100644 --- a/apps/studio/components/interfaces/Reports/Reports.types.ts +++ b/apps/studio/components/interfaces/Reports/Reports.types.ts @@ -1,4 +1,4 @@ -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { DEFAULT_QUERY_PARAMS } from './Reports.constants' export enum Presets { diff --git a/apps/studio/components/interfaces/Reports/Reports.utils.tsx b/apps/studio/components/interfaces/Reports/Reports.utils.tsx index 3182492f658..cbf86b4693c 100644 --- a/apps/studio/components/interfaces/Reports/Reports.utils.tsx +++ b/apps/studio/components/interfaces/Reports/Reports.utils.tsx @@ -1,6 +1,6 @@ import useDbQuery, { DbQueryHook } from 'hooks/analytics/useDbQuery' import useLogsQuery, { LogsQueryHook } from 'hooks/analytics/useLogsQuery' -import { BaseQueries, PresetConfig, ReportQuery } from './Reports.types' +import type { BaseQueries, PresetConfig, ReportQuery } from './Reports.types' /** * Converts a query params string to an object diff --git a/apps/studio/components/interfaces/RoleImpersonationSelector/RoleImpersonationPopover.tsx b/apps/studio/components/interfaces/RoleImpersonationSelector/RoleImpersonationPopover.tsx index b86d8b24b83..216963c7a3d 100644 --- a/apps/studio/components/interfaces/RoleImpersonationSelector/RoleImpersonationPopover.tsx +++ b/apps/studio/components/interfaces/RoleImpersonationSelector/RoleImpersonationPopover.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { Button, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_, cn } from 'ui' -import { User } from 'data/auth/users-query' +import type { User } from 'data/auth/users-query' import { ChevronDown, User as IconUser } from 'lucide-react' import { useRoleImpersonationStateSnapshot } from 'state/role-impersonation-state' import { getAvatarUrl, getDisplayName } from '../Auth/Users/UserListItem.utils' diff --git a/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx b/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx index 213ce51acf4..2d0c335907c 100644 --- a/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx +++ b/apps/studio/components/interfaces/SQLEditor/DownloadSnippetModal.tsx @@ -1,4 +1,4 @@ -import { ModalProps } from '@ui/components/Modal/Modal' +import type { ModalProps } from '@ui/components/Modal/Modal' import { snakeCase } from 'lodash' import Link from 'next/link' import { useState } from 'react' diff --git a/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx b/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx index b6a50b8ad43..9430592dd39 100644 --- a/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx +++ b/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx @@ -5,12 +5,12 @@ import { useRouter } from 'next/router' import { MutableRefObject, useEffect, useRef, useState } from 'react' import { cn } from 'ui' -import { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useLocalStorageQuery, useSelectedProject } from 'hooks' import { useProfile } from 'lib/profile' import { useSqlEditorStateSnapshot } from 'state/sql-editor' import { untitledSnippetTitle } from './SQLEditor.constants' -import { IStandaloneCodeEditor } from './SQLEditor.types' +import type { IStandaloneCodeEditor } from './SQLEditor.types' import { createSqlSnippetSkeleton } from './SQLEditor.utils' import { LOCAL_STORAGE_KEYS } from 'lib/constants' diff --git a/apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx b/apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx index 268dea8c989..d9bba744401 100644 --- a/apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx +++ b/apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx @@ -1,7 +1,7 @@ import { useParams } from 'common' import { useSqlTitleGenerateMutation } from 'data/ai/sql-title-mutation' -import { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippet } from 'data/content/sql-snippets-query' import { isError } from 'data/utils/error-check' import { useSelectedOrganization, useStore } from 'hooks' import { useEffect, useState } from 'react' diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts b/apps/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts index 4d7055b9ebd..95ef97c400e 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts @@ -1,6 +1,6 @@ import { stripIndent } from 'common-tags' -import { SqlSnippets, UserContent } from 'types' -import { SQLTemplate } from './SQLEditor.types' +import type { SqlSnippets, UserContent } from 'types' +import type { SQLTemplate } from './SQLEditor.types' export const SQL_TEMPLATES: SQLTemplate[] = [ { diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx index 91fa4582592..713ddefb011 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx @@ -1,4 +1,4 @@ -import { Monaco } from '@monaco-editor/react' +import type { Monaco } from '@monaco-editor/react' import { useParams, useTelemetryProps } from 'common' import { AnimatePresence, motion } from 'framer-motion' import dynamic from 'next/dynamic' @@ -31,7 +31,7 @@ import ConfirmModal from 'ui-patterns/Dialogs/ConfirmDialog' import { useSqlEditMutation } from 'data/ai/sql-edit-mutation' import { useSqlGenerateMutation } from 'data/ai/sql-generate-mutation' import { useSqlTitleGenerateMutation } from 'data/ai/sql-title-mutation' -import { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useEntityDefinitionsQuery } from 'data/database/entity-definitions-query' import { useReadReplicasQuery } from 'data/read-replicas/replicas-query' import { useExecuteSqlMutation } from 'data/sql/execute-sql-mutation' diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts b/apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts index 24012e3a73c..18ca6c224cd 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts @@ -1,6 +1,6 @@ // @ts-ignore import { NEW_SQL_SNIPPET_SKELETON, destructiveSqlRegex } from './SQLEditor.constants' -import { SqlSnippets, UserContent } from 'types' +import type { SqlSnippets, UserContent } from 'types' import { DiffType } from './SQLEditor.types' import { removeCommentsFromSql } from 'lib/helpers' import { stripIndent } from 'common-tags' diff --git a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx index 988b254a787..7db43451822 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx +++ b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx @@ -4,7 +4,7 @@ import { observer } from 'mobx-react-lite' import { useParams, useTelemetryProps } from 'common' import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.constants' -import { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useCheckPermissions, useSelectedProject, useStore } from 'hooks' import { uuidv4 } from 'lib/helpers' import { useProfile } from 'lib/profile' diff --git a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx index df84619c0f9..390f495976d 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx +++ b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx @@ -5,7 +5,7 @@ import { observer } from 'mobx-react-lite' import { useTelemetryProps } from 'common' import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.constants' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' -import { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useCheckPermissions, useStore } from 'hooks' import { uuidv4 } from 'lib/helpers' import { useProfile } from 'lib/profile' diff --git a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/FavoriteButton.tsx b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/FavoriteButton.tsx index 9e5dc5b4a84..53b373ffa91 100644 --- a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/FavoriteButton.tsx +++ b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/FavoriteButton.tsx @@ -7,7 +7,7 @@ import { } from 'ui' import { useQueryClient } from '@tanstack/react-query' import { contentKeys } from 'data/content/keys' -import { Content, ContentData } from 'data/content/content-query' +import type { Content, ContentData } from 'data/content/content-query' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useSqlEditorStateSnapshot } from 'state/sql-editor' diff --git a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx index 2361900fc4d..187b3339195 100644 --- a/apps/studio/components/interfaces/Settings/Addons/Addons.tsx +++ b/apps/studio/components/interfaces/Settings/Addons/Addons.tsx @@ -40,7 +40,7 @@ import { useInfraMonitoringQuery } from 'data/analytics/infra-monitoring-query' import { useProjectSettingsQuery } from 'data/config/project-settings-query' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query' -import { ProjectAddonVariantMeta } from 'data/subscriptions/types' +import type { ProjectAddonVariantMeta } from 'data/subscriptions/types' import { useFlag, useProjectByRef, useSelectedOrganization } from 'hooks' import { getCloudProviderArchitecture } from 'lib/cloudprovider-utils' import { BASE_PATH, INSTANCE_MICRO_SPECS, INSTANCE_NANO_SPECS } from 'lib/constants' diff --git a/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx index 32343e818f2..041bd8725d6 100644 --- a/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx +++ b/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx @@ -29,7 +29,7 @@ import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-que import { useProjectAddonRemoveMutation } from 'data/subscriptions/project-addon-remove-mutation' import { useProjectAddonUpdateMutation } from 'data/subscriptions/project-addon-update-mutation' import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query' -import { AddonVariantId, ProjectAddonVariantMeta } from 'data/subscriptions/types' +import type { AddonVariantId, ProjectAddonVariantMeta } from 'data/subscriptions/types' import { useCheckPermissions, useFlag, useSelectedOrganization, useStore } from 'hooks' import { getCloudProviderArchitecture } from 'lib/cloudprovider-utils' import { INSTANCE_MICRO_SPECS, PROJECT_STATUS } from 'lib/constants' diff --git a/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx index c70c8ffe13f..b8b4affbbfa 100644 --- a/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx +++ b/apps/studio/components/interfaces/Settings/Addons/CustomDomainSidePanel.tsx @@ -24,7 +24,7 @@ import { SidePanel, } from 'ui' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' -import { AddonVariantId } from 'data/subscriptions/types' +import type { AddonVariantId } from 'data/subscriptions/types' import { formatCurrency } from 'lib/helpers' import { useFlag } from 'hooks' diff --git a/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx index 3286477e8e3..e652ff5078e 100644 --- a/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx +++ b/apps/studio/components/interfaces/Settings/Addons/IPv4SidePanel.tsx @@ -9,7 +9,7 @@ import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-que import { useProjectAddonRemoveMutation } from 'data/subscriptions/project-addon-remove-mutation' import { useProjectAddonUpdateMutation } from 'data/subscriptions/project-addon-update-mutation' import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query' -import { AddonVariantId } from 'data/subscriptions/types' +import type { AddonVariantId } from 'data/subscriptions/types' import { useCheckPermissions, useSelectedOrganization, useStore } from 'hooks' import { formatCurrency } from 'lib/helpers' import Telemetry from 'lib/telemetry' diff --git a/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx index 70a052fa4d0..86c5cba401e 100644 --- a/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx +++ b/apps/studio/components/interfaces/Settings/Addons/PITRSidePanel.tsx @@ -17,7 +17,7 @@ import { subscriptionHasHipaaAddon } from 'components/interfaces/Billing/Subscri import { CriticalIcon, WarningIcon } from 'components/ui/Icons' import { useReadReplicasQuery } from 'data/read-replicas/replicas-query' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' -import { AddonVariantId } from 'data/subscriptions/types' +import type { AddonVariantId } from 'data/subscriptions/types' import { formatCurrency } from 'lib/helpers' import { useSubscriptionPageStateSnapshot } from 'state/subscription-page' import { diff --git a/apps/studio/components/interfaces/Settings/Database/DatabaseSettings/DatabaseSettings.utils.ts b/apps/studio/components/interfaces/Settings/Database/DatabaseSettings/DatabaseSettings.utils.ts index 70b0671d318..e04f1d64f19 100644 --- a/apps/studio/components/interfaces/Settings/Database/DatabaseSettings/DatabaseSettings.utils.ts +++ b/apps/studio/components/interfaces/Settings/Database/DatabaseSettings/DatabaseSettings.utils.ts @@ -1,4 +1,4 @@ -import { PoolingConfiguration } from 'data/database/pooling-configuration-query' +import type { PoolingConfiguration } from 'data/database/pooling-configuration-query' export const getConnectionStrings = ( connectionInfo: { diff --git a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx index 1724ed66231..b7d20ff1703 100644 --- a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx +++ b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainActivate.tsx @@ -17,7 +17,7 @@ import { useProjectApiQuery } from 'data/config/project-api-query' import { useCheckCNAMERecordMutation } from 'data/custom-domains/check-cname-mutation' import { useCustomDomainActivateMutation } from 'data/custom-domains/custom-domains-activate-mutation' import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domains-delete-mutation' -import { CustomDomainResponse } from 'data/custom-domains/custom-domains-query' +import type { CustomDomainResponse } from 'data/custom-domains/custom-domains-query' import { useStore } from 'hooks' export type CustomDomainActivateProps = { diff --git a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx index 9c6a909a18a..4e4341ef4c2 100644 --- a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx +++ b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainDelete.tsx @@ -6,7 +6,7 @@ import { Button, IconExternalLink, IconTrash } from 'ui' import ConfirmModal from 'ui-patterns/Dialogs/ConfirmDialog' import Panel from 'components/ui/Panel' import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domains-delete-mutation' -import { CustomDomainResponse } from 'data/custom-domains/custom-domains-query' +import type { CustomDomainResponse } from 'data/custom-domains/custom-domains-query' import { useStore } from 'hooks' export type CustomDomainDeleteProps = { diff --git a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx index 4356a6a677e..bd2083d96b0 100644 --- a/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx +++ b/apps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainVerify.tsx @@ -14,9 +14,9 @@ import { } from 'ui' import Panel from 'components/ui/Panel' -import { ProjectApiResponse } from 'data/config/project-api-query' +import type { ProjectApiResponse } from 'data/config/project-api-query' import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domains-delete-mutation' -import { CustomDomainResponse } from 'data/custom-domains/custom-domains-query' +import type { CustomDomainResponse } from 'data/custom-domains/custom-domains-query' import { useCustomDomainReverifyMutation } from 'data/custom-domains/custom-domains-reverify-mutation' import DNSRecord from './DNSRecord' diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx index 0ee6a859a46..50ea8ea2e21 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx @@ -10,7 +10,7 @@ import { import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import { useReadReplicaRemoveMutation } from 'data/read-replicas/replica-remove-mutation' -import { Database } from 'data/read-replicas/replicas-query' +import type { Database } from 'data/read-replicas/replicas-query' import { formatDatabaseID } from 'data/read-replicas/replicas.utils' interface DropReplicaConfirmationModalProps { diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.utils.ts b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.utils.ts index c7a4ab2e687..2cf452f0d59 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.utils.ts +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.utils.ts @@ -8,8 +8,8 @@ import { NODE_WIDTH, } from './InstanceConfiguration.constants' import { groupBy } from 'lodash' -import { Database } from 'data/read-replicas/replicas-query' -import { LoadBalancer } from 'data/read-replicas/load-balancers-query' +import type { Database } from 'data/read-replicas/replicas-query' +import type { LoadBalancer } from 'data/read-replicas/load-balancers-query' // [Joshen] Just FYI the nodes generation assumes each project only has one load balancer // Will need to change if this eventually becomes otherwise diff --git a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx index 7e3fe15e480..07aa954d7b4 100644 --- a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx +++ b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsx @@ -36,7 +36,7 @@ import { useBranchUpdateMutation } from 'data/branches/branch-update-mutation' import { useBranchesQuery } from 'data/branches/branches-query' import { useGitHubBranchesQuery } from 'data/integrations/github-branches-query' import { useGitHubConnectionUpdateMutation } from 'data/integrations/github-connection-update-mutation' -import { IntegrationProjectConnection } from 'data/integrations/integrations.types' +import type { IntegrationProjectConnection } from 'data/integrations/integrations.types' import { useSelectedOrganization, useSelectedProject } from 'hooks' interface GitHubIntegrationConnectionFormProps { diff --git a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx index a9645e1005b..35be467a13b 100644 --- a/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx +++ b/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx @@ -13,7 +13,10 @@ import { import { useBranchesDisableMutation } from 'data/branches/branches-disable-mutation' import { useGitHubConnectionDeleteMutation } from 'data/integrations/github-connection-delete-mutation' import { useGitHubConnectionsQuery } from 'data/integrations/github-connections-query' -import { IntegrationName, IntegrationProjectConnection } from 'data/integrations/integrations.types' +import type { + IntegrationName, + IntegrationProjectConnection, +} from 'data/integrations/integrations.types' import { useSelectedOrganization, useSelectedProject, useStore } from 'hooks' import { OPT_IN_TAGS } from 'lib/constants' import { useSidePanelsStateSnapshot } from 'state/side-panels' diff --git a/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx b/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx index e4574e7045b..4078c84eb67 100644 --- a/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx +++ b/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelIntegrationConnectionForm.tsx @@ -17,7 +17,10 @@ import { import * as z from 'zod' import { ScaffoldDivider } from 'components/layouts/Scaffold' -import { Integration, IntegrationProjectConnection } from 'data/integrations/integrations.types' +import type { + Integration, + IntegrationProjectConnection, +} from 'data/integrations/integrations.types' import { useVercelConnectionUpdateMutation } from 'data/integrations/vercel-connection-update-mutate' import { useFlag, useStore } from 'hooks' diff --git a/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelSection.tsx b/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelSection.tsx index 0055238a699..53b49161d45 100644 --- a/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelSection.tsx +++ b/apps/studio/components/interfaces/Settings/Integrations/VercelIntegration/VercelSection.tsx @@ -18,7 +18,10 @@ import { import { useOrgIntegrationsQuery } from 'data/integrations/integrations-query-org-only' import { useIntegrationsVercelInstalledConnectionDeleteMutation } from 'data/integrations/integrations-vercel-installed-connection-delete-mutation' import { useVercelProjectsQuery } from 'data/integrations/integrations-vercel-projects-query' -import { IntegrationName, IntegrationProjectConnection } from 'data/integrations/integrations.types' +import type { + IntegrationName, + IntegrationProjectConnection, +} from 'data/integrations/integrations.types' import { useSelectedOrganization, useSelectedProject, useStore } from 'hooks' import { pluralize } from 'lib/helpers' import { getIntegrationConfigurationUrl } from 'lib/integration-utils' diff --git a/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx b/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx index 17ef7e738e5..19f3a978bdd 100644 --- a/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabaseApiColumnRender.tsx @@ -1,5 +1,5 @@ import { Column } from 'react-data-grid' -import { LogData } from '../Logs.types' +import type { LogData } from '../Logs.types' import { ResponseCodeFormatter, RowLayout, diff --git a/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabasePostgresColumnRender.tsx b/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabasePostgresColumnRender.tsx index 9704667ae67..687410b835b 100644 --- a/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabasePostgresColumnRender.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/DatabasePostgresColumnRender.tsx @@ -1,5 +1,5 @@ import { Column } from 'react-data-grid' -import { LogData } from '../Logs.types' +import type { LogData } from '../Logs.types' import { RowLayout, SeverityFormatter, diff --git a/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsEdgeColumnRender.tsx b/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsEdgeColumnRender.tsx index ed4e9c10a42..c1ebb546780 100644 --- a/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsEdgeColumnRender.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsEdgeColumnRender.tsx @@ -1,5 +1,5 @@ import { Column } from 'react-data-grid' -import { LogData } from '../Logs.types' +import type { LogData } from '../Logs.types' import { ResponseCodeFormatter, RowLayout, diff --git a/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsLogsColumnRender.tsx b/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsLogsColumnRender.tsx index 33ce303e045..5983e74eacb 100644 --- a/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsLogsColumnRender.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsLogsColumnRender.tsx @@ -1,5 +1,5 @@ import { Column } from 'react-data-grid' -import { LogData } from '../Logs.types' +import type { LogData } from '../Logs.types' import { RowLayout, SeverityFormatter, diff --git a/apps/studio/components/interfaces/Settings/Logs/LogEventChart.tsx b/apps/studio/components/interfaces/Settings/Logs/LogEventChart.tsx index b96a88dfc5a..a98008faeeb 100644 --- a/apps/studio/components/interfaces/Settings/Logs/LogEventChart.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/LogEventChart.tsx @@ -1,5 +1,5 @@ import BarChart from 'components/ui/Charts/BarChart' -import { Datum } from 'components/ui/Charts/Charts.types' +import type { Datum } from 'components/ui/Charts/Charts.types' import { EventChartData } from '.' export interface LogEventChartProps { diff --git a/apps/studio/components/interfaces/Settings/Logs/LogSelection.tsx b/apps/studio/components/interfaces/Settings/Logs/LogSelection.tsx index b791eaa29b0..c88a751281c 100644 --- a/apps/studio/components/interfaces/Settings/Logs/LogSelection.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/LogSelection.tsx @@ -10,7 +10,7 @@ import { LogsEndpointParams, unixMicroToIsoTimestamp, } from '.' -import { LogData, QueryType } from './Logs.types' +import type { LogData, QueryType } from './Logs.types' import AuthSelectionRenderer from './LogSelectionRenderers/AuthSelectionRenderer' import DatabaseApiSelectionRender from './LogSelectionRenderers/DatabaseApiSelectionRender' import DatabasePostgresSelectionRender from './LogSelectionRenderers/DatabasePostgresSelectionRender' diff --git a/apps/studio/components/interfaces/Settings/Logs/LogTable.tsx b/apps/studio/components/interfaces/Settings/Logs/LogTable.tsx index ae9c56950c8..c9e802289d8 100644 --- a/apps/studio/components/interfaces/Settings/Logs/LogTable.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/LogTable.tsx @@ -28,7 +28,7 @@ import DefaultPreviewColumnRenderer from './LogColumnRenderers/DefaultPreviewCol import FunctionsEdgeColumnRender from './LogColumnRenderers/FunctionsEdgeColumnRender' import FunctionsLogsColumnRender from './LogColumnRenderers/FunctionsLogsColumnRender' import LogSelection, { LogSelectionProps } from './LogSelection' -import { LogData, QueryType } from './Logs.types' +import type { LogData, QueryType } from './Logs.types' import DefaultErrorRenderer from './LogsErrorRenderers/DefaultErrorRenderer' import ResourcesExceededErrorRenderer from './LogsErrorRenderers/ResourcesExceededErrorRenderer' import { CSVLink } from 'react-csv' diff --git a/apps/studio/components/interfaces/Settings/Logs/Logs.types.ts b/apps/studio/components/interfaces/Settings/Logs/Logs.types.ts index 0346c3f4797..6f63652772f 100644 --- a/apps/studio/components/interfaces/Settings/Logs/Logs.types.ts +++ b/apps/studio/components/interfaces/Settings/Logs/Logs.types.ts @@ -1,4 +1,4 @@ -import { Datum } from 'components/ui/Charts/Charts.types' +import type { Datum } from 'components/ui/Charts/Charts.types' import React from 'react' interface Metadata { diff --git a/apps/studio/components/interfaces/Settings/Logs/Logs.utils.ts b/apps/studio/components/interfaces/Settings/Logs/Logs.utils.ts index a0133c2f4af..73a036c4309 100644 --- a/apps/studio/components/interfaces/Settings/Logs/Logs.utils.ts +++ b/apps/studio/components/interfaces/Settings/Logs/Logs.utils.ts @@ -6,7 +6,7 @@ import { useEffect } from 'react' import logConstants from 'shared-data/logConstants' import BackwardIterator from 'components/ui/CodeEditor/Providers/BackwardIterator' -import { PlanId } from 'data/subscriptions/types' +import type { PlanId } from 'data/subscriptions/types' import { Filters, LogData, LogsEndpointParams, LogsTableName, SQL_FILTER_TEMPLATES } from '.' /** diff --git a/apps/studio/components/interfaces/Settings/Logs/RecentQueriesItem.tsx b/apps/studio/components/interfaces/Settings/Logs/RecentQueriesItem.tsx index 11925c422cd..5d881103338 100644 --- a/apps/studio/components/interfaces/Settings/Logs/RecentQueriesItem.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/RecentQueriesItem.tsx @@ -1,7 +1,7 @@ import { Button, IconPlay } from 'ui' import Table from 'components/to-be-cleaned/Table' import { useRouter } from 'next/router' -import { LogSqlSnippets } from 'types' +import type { LogSqlSnippets } from 'types' import SqlSnippetCode from './Logs.SqlSnippetCode' interface Props { diff --git a/apps/studio/components/interfaces/Settings/Vault/Secrets/DeleteSecretModal.tsx b/apps/studio/components/interfaces/Settings/Vault/Secrets/DeleteSecretModal.tsx index 6c17951aed3..6d05a4ad92e 100644 --- a/apps/studio/components/interfaces/Settings/Vault/Secrets/DeleteSecretModal.tsx +++ b/apps/studio/components/interfaces/Settings/Vault/Secrets/DeleteSecretModal.tsx @@ -4,7 +4,7 @@ import { Modal } from 'ui' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useVaultSecretDeleteMutation } from 'data/vault/vault-secret-delete-mutation' import { useStore } from 'hooks' -import { VaultSecret } from 'types' +import type { VaultSecret } from 'types' interface DeleteSecretModalProps { selectedSecret: VaultSecret | undefined diff --git a/apps/studio/components/interfaces/Settings/Vault/Secrets/EditSecretModal.tsx b/apps/studio/components/interfaces/Settings/Vault/Secrets/EditSecretModal.tsx index 9c83c613482..a91ba6cecc0 100644 --- a/apps/studio/components/interfaces/Settings/Vault/Secrets/EditSecretModal.tsx +++ b/apps/studio/components/interfaces/Settings/Vault/Secrets/EditSecretModal.tsx @@ -8,7 +8,7 @@ import { usePgSodiumKeyCreateMutation } from 'data/pg-sodium-keys/pg-sodium-key- import { useVaultSecretDecryptedValueQuery } from 'data/vault/vault-secret-decrypted-value-query' import { useVaultSecretUpdateMutation } from 'data/vault/vault-secret-update-mutation' import { useStore } from 'hooks' -import { VaultSecret } from 'types' +import type { VaultSecret } from 'types' import EncryptionKeySelector from '../Keys/EncryptionKeySelector' interface EditSecretModalProps { diff --git a/apps/studio/components/interfaces/Settings/Vault/Secrets/SecretRow.tsx b/apps/studio/components/interfaces/Settings/Vault/Secrets/SecretRow.tsx index 4366896e4a1..9f4177203a7 100644 --- a/apps/studio/components/interfaces/Settings/Vault/Secrets/SecretRow.tsx +++ b/apps/studio/components/interfaces/Settings/Vault/Secrets/SecretRow.tsx @@ -23,7 +23,7 @@ import { import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useVaultSecretDecryptedValueQuery } from 'data/vault/vault-secret-decrypted-value-query' import { useCheckPermissions } from 'hooks' -import { VaultSecret } from 'types' +import type { VaultSecret } from 'types' interface SecretRowProps { secret: VaultSecret diff --git a/apps/studio/components/interfaces/Settings/Vault/Secrets/SecretsManagement.tsx b/apps/studio/components/interfaces/Settings/Vault/Secrets/SecretsManagement.tsx index e978dc8e0aa..30c62774ddd 100644 --- a/apps/studio/components/interfaces/Settings/Vault/Secrets/SecretsManagement.tsx +++ b/apps/studio/components/interfaces/Settings/Vault/Secrets/SecretsManagement.tsx @@ -11,7 +11,7 @@ import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectConte import Divider from 'components/ui/Divider' import { useVaultSecretsQuery } from 'data/vault/vault-secrets-query' import { useCheckPermissions } from 'hooks' -import { VaultSecret } from 'types' +import type { VaultSecret } from 'types' import AddNewSecretModal from './AddNewSecretModal' import DeleteSecretModal from './DeleteSecretModal' import EditSecretModal from './EditSecretModal' diff --git a/apps/studio/components/interfaces/SignIn/SignInForm.tsx b/apps/studio/components/interfaces/SignIn/SignInForm.tsx index 84a88eb6568..506b13568e4 100644 --- a/apps/studio/components/interfaces/SignIn/SignInForm.tsx +++ b/apps/studio/components/interfaces/SignIn/SignInForm.tsx @@ -1,6 +1,5 @@ import HCaptcha from '@hcaptcha/react-hcaptcha' -import * as Sentry from '@sentry/nextjs' -import { AuthError } from '@supabase/supabase-js' +import type { AuthError } from '@supabase/supabase-js' import { useQueryClient } from '@tanstack/react-query' import Link from 'next/link' import { useRouter } from 'next/router' diff --git a/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx b/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx index d30110e2ff2..f5f2cfc2c64 100644 --- a/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx +++ b/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx @@ -1,5 +1,5 @@ import { AuthError } from '@supabase/gotrue-js' -import { Factor } from '@supabase/supabase-js' +import type { Factor } from '@supabase/supabase-js' import { useQueryClient } from '@tanstack/react-query' import Link from 'next/link' import { useRouter } from 'next/router' diff --git a/apps/studio/components/interfaces/Storage/EditBucketModal.tsx b/apps/studio/components/interfaces/Storage/EditBucketModal.tsx index bb470d8e067..c030d2cd4c5 100644 --- a/apps/studio/components/interfaces/Storage/EditBucketModal.tsx +++ b/apps/studio/components/interfaces/Storage/EditBucketModal.tsx @@ -22,7 +22,7 @@ import { Modal, Toggle, } from 'ui' -import { StorageBucket } from './Storage.types' +import type { StorageBucket } from './Storage.types' export interface EditBucketModalProps { visible: boolean diff --git a/apps/studio/components/interfaces/Storage/Storage.types.ts b/apps/studio/components/interfaces/Storage/Storage.types.ts index 14216ae8d95..37b00902f28 100644 --- a/apps/studio/components/interfaces/Storage/Storage.types.ts +++ b/apps/studio/components/interfaces/Storage/Storage.types.ts @@ -1,4 +1,4 @@ -import { PolicyFormField } from 'components/interfaces/Auth/Policies/Policies.types' +import type { PolicyFormField } from 'components/interfaces/Auth/Policies/Policies.types' export interface StoragePolicyFormField extends PolicyFormField { allowedOperations: string[] diff --git a/apps/studio/components/interfaces/Support/SupportForm.tsx b/apps/studio/components/interfaces/Support/SupportForm.tsx index 7545bda0b21..fad2969fe46 100644 --- a/apps/studio/components/interfaces/Support/SupportForm.tsx +++ b/apps/studio/components/interfaces/Support/SupportForm.tsx @@ -27,7 +27,7 @@ import ShimmeringLoader from 'components/ui/ShimmeringLoader' import { getProjectAuthConfig } from 'data/auth/auth-config-query' import { useSendSupportTicketMutation } from 'data/feedback/support-ticket-send' import { useOrganizationsQuery } from 'data/organizations/organizations-query' -import { Project } from 'data/projects/project-detail-query' +import type { Project } from 'data/projects/project-detail-query' import { useProjectsQuery } from 'data/projects/projects-query' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' import { useFlag, useStore } from 'hooks' diff --git a/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx b/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx index 862349967e4..1fae2696aaf 100644 --- a/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx @@ -2,7 +2,7 @@ import Link from 'next/link' import toast from 'react-hot-toast' import { Alert, Button, Checkbox, IconExternalLink, Modal } from 'ui' -import { SupaRow } from 'components/grid' +import type { SupaRow } from 'components/grid' import { formatFilterURLParams } from 'components/grid/SupabaseGrid.utils' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' @@ -13,11 +13,10 @@ import { useTableRowTruncateMutation } from 'data/table-rows/table-row-truncate- import { useTableDeleteMutation } from 'data/tables/table-delete-mutation' import { useGetTables } from 'data/tables/tables-query' import { useUrlState } from 'hooks' -import { TableLike } from 'hooks/misc/useTable' +import type { TableLike } from 'hooks/misc/useTable' import { noop } from 'lib/void' import { useGetImpersonatedRole } from 'state/role-impersonation-state' import { useTableEditorStateSnapshot } from 'state/table-editor' -import { tableKeys } from 'data/tables/keys' export type DeleteConfirmationDialogsProps = { projectRef?: string diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnDefaultValue.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnDefaultValue.tsx index 98872c0c5b1..37298ca9a5a 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnDefaultValue.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnDefaultValue.tsx @@ -1,11 +1,11 @@ import { noop } from 'lodash' import { Select } from 'ui' -import { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' +import type { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' import { POSTGRES_DATA_TYPES } from '../SidePanelEditor.constants' -import { ColumnField } from '../SidePanelEditor.types' +import type { ColumnField } from '../SidePanelEditor.types' import { typeExpressionSuggestions } from './ColumnEditor.constants' -import { Suggestion } from './ColumnEditor.types' +import type { Suggestion } from './ColumnEditor.types' import InputWithSuggestions from './InputWithSuggestions' interface ColumnDefaultValueProps { diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.constants.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.constants.ts index 434a83f28c3..ad364b3ca4f 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.constants.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.constants.ts @@ -1,5 +1,5 @@ -import { Dictionary } from 'types' -import { Suggestion } from './ColumnEditor.types' +import type { Dictionary } from 'types' +import type { Suggestion } from './ColumnEditor.types' const defaultTimeBasedExpressions: Suggestion[] = [ { diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx index fd562a11a04..000d0c387e9 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.tsx @@ -31,12 +31,16 @@ import { } from 'data/database/foreign-key-constraints-query' import { useEnumeratedTypesQuery } from 'data/enumerated-types/enumerated-types-query' import { EXCLUDED_SCHEMAS_WITHOUT_EXTENSIONS } from 'lib/constants/schemas' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import ActionBar from '../ActionBar' -import { ForeignKey } from '../ForeignKeySelector/ForeignKeySelector.types' +import type { ForeignKey } from '../ForeignKeySelector/ForeignKeySelector.types' import { formatForeignKeys } from '../ForeignKeySelector/ForeignKeySelector.utils' import { TEXT_TYPES } from '../SidePanelEditor.constants' -import { ColumnField, CreateColumnPayload, UpdateColumnPayload } from '../SidePanelEditor.types' +import type { + ColumnField, + CreateColumnPayload, + UpdateColumnPayload, +} from '../SidePanelEditor.types' import ColumnDefaultValue from './ColumnDefaultValue' import { generateColumnField, diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts index d5afd301545..29f91559951 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts @@ -1,9 +1,9 @@ import type { PostgresColumn, PostgresTable } from '@supabase/postgres-meta' import { find, isEqual, isNull } from 'lodash' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import { FOREIGN_KEY_CASCADE_ACTION } from 'data/database/database-query-constants' -import { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' +import type { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' import { uuidv4 } from 'lib/helpers' import { ColumnField, diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnForeignKey.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnForeignKey.tsx index d55d02e9e09..7b398f584de 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnForeignKey.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnForeignKey.tsx @@ -6,8 +6,8 @@ import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectConte import { useForeignKeyConstraintsQuery } from 'data/database/foreign-key-constraints-query' import useTable from 'hooks/misc/useTable' import { ForeignKeySelector } from '../ForeignKeySelector/ForeignKeySelector' -import { ForeignKey } from '../ForeignKeySelector/ForeignKeySelector.types' -import { ColumnField } from '../SidePanelEditor.types' +import type { ForeignKey } from '../ForeignKeySelector/ForeignKeySelector.types' +import type { ColumnField } from '../SidePanelEditor.types' import { ForeignKeyRow } from '../TableEditor/ForeignKeysManagement/ForeignKeyRow' import { checkIfRelationChanged } from '../TableEditor/ForeignKeysManagement/ForeignKeysManagement.utils' diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx index bd9443e4be8..7385da373ba 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnType.tsx @@ -20,9 +20,9 @@ import { POSTGRES_DATA_TYPE_OPTIONS, RECOMMENDED_ALTERNATIVE_DATA_TYPE, } from '../SidePanelEditor.constants' -import { PostgresDataTypeOption } from '../SidePanelEditor.types' +import type { PostgresDataTypeOption } from '../SidePanelEditor.types' import { ListPlus } from 'lucide-react' -import { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' +import type { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' interface ColumnTypeProps { value: string diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/InputWithSuggestions.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/InputWithSuggestions.tsx index 5a63560fa75..2a787b8f7a6 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/InputWithSuggestions.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/InputWithSuggestions.tsx @@ -20,7 +20,7 @@ import { Input, } from 'ui' -import { Suggestion } from './ColumnEditor.types' +import type { Suggestion } from './ColumnEditor.types' const MAX_SUGGESTIONS = 3 diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx index 16f0a622a9f..036b66936aa 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx @@ -1,4 +1,4 @@ -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import { sortBy } from 'lodash' import { Table } from 'lucide-react' import { Fragment, useEffect, useState } from 'react' @@ -26,9 +26,9 @@ import { useTableEditorStateSnapshot } from 'state/table-editor' import ActionBar from '../ActionBar' import { NUMERICAL_TYPES, TEXT_TYPES } from '../SidePanelEditor.constants' import { FOREIGN_KEY_CASCADE_OPTIONS } from './ForeignKeySelector.constants' -import { ForeignKey } from './ForeignKeySelector.types' +import type { ForeignKey } from './ForeignKeySelector.types' import { generateCascadeActionDescription } from './ForeignKeySelector.utils' -import { ColumnField } from '../SidePanelEditor.types' +import type { ColumnField } from '../SidePanelEditor.types' const EMPTY_STATE: ForeignKey = { id: undefined, diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.utils.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.utils.tsx index 5b5352ac721..39d7f79553d 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.utils.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.utils.tsx @@ -2,9 +2,9 @@ import * as Tooltip from '@radix-ui/react-tooltip' import { IconHelpCircle } from 'ui' import { FOREIGN_KEY_CASCADE_ACTION } from 'data/database/database-query-constants' -import { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' +import type { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' import { getForeignKeyCascadeAction } from '../ColumnEditor/ColumnEditor.utils' -import { ForeignKey } from './ForeignKeySelector.types' +import type { ForeignKey } from './ForeignKeySelector.types' export const formatForeignKeys = (fks: ForeignKeyConstraint[]): ForeignKey[] => { return fks.map((x) => { diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector.tsx index 2d22e95b91a..01735c01ae6 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector.tsx @@ -1,4 +1,4 @@ -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import { useState } from 'react' import { DndProvider } from 'react-dnd' import { HTML5Backend } from 'react-dnd-html5-backend' @@ -10,7 +10,7 @@ import RefreshButton from 'components/grid/components/header/RefreshButton' import { FilterPopover } from 'components/grid/components/header/filter' import { SortPopover } from 'components/grid/components/header/sort' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' -import { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' +import type { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' import { useTableRowsQuery } from 'data/table-rows/table-rows-query' import { useTableQuery } from 'data/tables/table-query' import { useRoleImpersonationStateSnapshot } from 'state/role-impersonation-state' diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/SelectorGrid.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/SelectorGrid.tsx index d27be3f85ce..699a0f0cd36 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/SelectorGrid.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/SelectorGrid.tsx @@ -1,5 +1,5 @@ import * as Tooltip from '@radix-ui/react-tooltip' -import { SupaRow, SupaTable } from 'components/grid' +import type { SupaRow, SupaTable } from 'components/grid' import { COLUMN_MIN_WIDTH } from 'components/grid/constants' import { ESTIMATED_CHARACTER_PIXEL_WIDTH, diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/InputField.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/InputField.tsx index 9754a3f8ca0..f09076ef328 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/InputField.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/InputField.tsx @@ -3,7 +3,7 @@ import { Button, IconEdit2, IconLink, Input, Listbox, Select } from 'ui' import { DATETIME_TYPES, JSON_TYPES, TEXT_TYPES } from '../SidePanelEditor.constants' import { DateTimeInput } from './DateTimeInput' -import { RowField } from './RowEditor.types' +import type { RowField } from './RowEditor.types' export interface InputFieldProps { field: RowField diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownPane.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownPane.tsx index 38bd01beb42..9894c655630 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownPane.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownPane.tsx @@ -1,7 +1,7 @@ import { isNull, noop } from 'lodash' import { IconChevronRight } from 'ui' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' interface DrilldownPaneProps { pane: number diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownViewer.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownViewer.tsx index 8fda83bfecf..49d6f37d19f 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownViewer.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/JsonEditor/DrilldownViewer/DrilldownViewer.tsx @@ -1,7 +1,7 @@ import { isEmpty, last } from 'lodash' import { useState } from 'react' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import DrilldownBreadCrumbs from './DrilldownBreadCrumbs' import DrilldownPane from './DrilldownPane' diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.tsx index 90652720084..8995af9a952 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.tsx @@ -1,5 +1,5 @@ import type { PostgresTable } from '@supabase/postgres-meta' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import { isEmpty, isUndefined, noop, partition } from 'lodash' import { useEffect, useMemo, useState } from 'react' import { SidePanel } from 'ui' @@ -11,7 +11,7 @@ import ForeignRowSelector from './ForeignRowSelector/ForeignRowSelector' import HeaderTitle from './HeaderTitle' import InputField from './InputField' import { JsonEditor } from './JsonEditor' -import { JsonEditValue, RowField } from './RowEditor.types' +import type { JsonEditValue, RowField } from './RowEditor.types' import { generateRowFields, generateRowObjectFromFields, diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts index 43e863e68f2..55e83c2a5d0 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.utils.ts @@ -1,5 +1,5 @@ import type { PostgresTable } from '@supabase/postgres-meta' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import dayjs from 'dayjs' import { compact, find, isEqual, isNull, isString, isUndefined, omitBy } from 'lodash' @@ -10,7 +10,7 @@ import { TIMESTAMP_TYPES, TIME_TYPES, } from '../SidePanelEditor.constants' -import { RowField } from './RowEditor.types' +import type { RowField } from './RowEditor.types' export const generateRowFields = ( row: Dictionary | undefined, diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.constants.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.constants.ts index 47140892b7f..a57859a09a9 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.constants.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.constants.ts @@ -1,5 +1,5 @@ import { sortBy, concat } from 'lodash' -import { PostgresDataTypeOption } from './SidePanelEditor.types' +import type { PostgresDataTypeOption } from './SidePanelEditor.types' export const NUMERICAL_TYPES = [ 'int2', diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx index 20810bdc520..227d0aef15d 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx @@ -10,7 +10,7 @@ import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import { useDatabasePublicationCreateMutation } from 'data/database-publications/database-publications-create-mutation' import { useDatabasePublicationsQuery } from 'data/database-publications/database-publications-query' import { useDatabasePublicationUpdateMutation } from 'data/database-publications/database-publications-update-mutation' -import { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' +import type { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' import { entityTypeKeys } from 'data/entity-types/keys' import { sqlKeys } from 'data/sql/keys' import { useTableRowCreateMutation } from 'data/table-rows/table-row-create-mutation' @@ -20,14 +20,14 @@ import { getTables } from 'data/tables/tables-query' import { useStore, useUrlState } from 'hooks' import { useGetImpersonatedRole } from 'state/role-impersonation-state' import { useTableEditorStateSnapshot } from 'state/table-editor' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import { ColumnEditor, RowEditor, SpreadsheetImport, TableEditor } from '.' -import { ForeignKey } from './ForeignKeySelector/ForeignKeySelector.types' +import type { ForeignKey } from './ForeignKeySelector/ForeignKeySelector.types' import ForeignRowSelector from './RowEditor/ForeignRowSelector/ForeignRowSelector' import JsonEditor from './RowEditor/JsonEditor/JsonEditor' import { TextEditor } from './RowEditor/TextEditor' import SchemaEditor from './SchemaEditor' -import { ColumnField, CreateColumnPayload, UpdateColumnPayload } from './SidePanelEditor.types' +import type { ColumnField, CreateColumnPayload, UpdateColumnPayload } from './SidePanelEditor.types' import { createColumn, createTable, @@ -37,8 +37,8 @@ import { updateColumn, updateTable, } from './SidePanelEditor.utils' -import { ImportContent } from './TableEditor/TableEditor.types' -import { Constraint } from 'data/database/constraints-query' +import type { ImportContent } from './TableEditor/TableEditor.types' +import type { Constraint } from 'data/database/constraints-query' export interface SidePanelEditorProps { editable?: boolean diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.utils.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.utils.tsx index e9bf7ee13ed..5795e48f70f 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.utils.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.utils.tsx @@ -1,4 +1,4 @@ -import { PostgresPrimaryKey, PostgresTable } from '@supabase/postgres-meta' +import type { PostgresPrimaryKey, PostgresTable } from '@supabase/postgres-meta' import { chunk, find, isEmpty, isEqual } from 'lodash' import Papa from 'papaparse' import { useEffect, useState } from 'react' @@ -24,16 +24,16 @@ import { getTables } from 'data/tables/tables-query' import { getViews } from 'data/views/views-query' import { useStore } from 'hooks' import { timeout, tryParseJson } from 'lib/helpers' -import { IMetaStore } from 'stores/pgmeta/MetaStore' +import type { IMetaStore } from 'stores/pgmeta/MetaStore' import { generateCreateColumnPayload, generateUpdateColumnPayload, } from './ColumnEditor/ColumnEditor.utils' -import { ForeignKey } from './ForeignKeySelector/ForeignKeySelector.types' -import { ColumnField, CreateColumnPayload, UpdateColumnPayload } from './SidePanelEditor.types' +import type { ForeignKey } from './ForeignKeySelector/ForeignKeySelector.types' +import type { ColumnField, CreateColumnPayload, UpdateColumnPayload } from './SidePanelEditor.types' import { checkIfRelationChanged } from './TableEditor/ForeignKeysManagement/ForeignKeysManagement.utils' -import { ImportContent } from './TableEditor/TableEditor.types' -import { Constraint } from 'data/database/constraints-query' +import type { ImportContent } from './TableEditor/TableEditor.types' +import type { Constraint } from 'data/database/constraints-query' const BATCH_SIZE = 1000 const CHUNK_SIZE = 1024 * 1024 * 0.1 // 0.1MB diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetImportConfiguration.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetImportConfiguration.tsx index a80e2283b99..d21cc095668 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetImportConfiguration.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadSheetImportConfiguration.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx' import { useState } from 'react' import { Button, Collapsible, IconChevronDown, SidePanel } from 'ui' -import { SpreadsheetData } from './SpreadsheetImport.types' +import type { SpreadsheetData } from './SpreadsheetImport.types' interface SpreadSheetImportConfigurationProps { spreadsheetData: SpreadsheetData diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.constants.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.constants.ts index 7c29186ce9a..e25fdbe42b2 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.constants.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.constants.ts @@ -1,4 +1,4 @@ -import { SpreadsheetData } from './SpreadsheetImport.types' +import type { SpreadsheetData } from './SpreadsheetImport.types' export const UPLOAD_FILE_TYPES = [ 'text/csv', diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.tsx index b7735a82981..3f5ca626dc6 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.tsx @@ -1,17 +1,17 @@ import Link from 'next/link' -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import { debounce, includes, noop } from 'lodash' import { useCallback, useEffect, useState } from 'react' import { Button, IconExternalLink, SidePanel, Tabs } from 'ui' import { useStore } from 'hooks' import ActionBar from '../ActionBar' -import { ImportContent } from '../TableEditor/TableEditor.types' +import type { ImportContent } from '../TableEditor/TableEditor.types' import SpreadSheetFileUpload from './SpreadSheetFileUpload' import SpreadsheetImportConfiguration from './SpreadSheetImportConfiguration' import SpreadSheetTextInput from './SpreadSheetTextInput' import { EMPTY_SPREADSHEET_DATA, UPLOAD_FILE_TYPES } from './SpreadsheetImport.constants' -import { SpreadsheetData } from './SpreadsheetImport.types' +import type { SpreadsheetData } from './SpreadsheetImport.types' import { acceptedFileExtension, parseSpreadsheet, diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.types.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.types.ts index 553a1dfa6c9..54771df8f74 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.types.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImport.types.ts @@ -1,4 +1,4 @@ -import { Dictionary } from 'types' +import type { Dictionary } from 'types' export interface SpreadsheetData { headers: string[] diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx index 46d002c9d45..e9c0c638637 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx @@ -11,8 +11,8 @@ import { SidePanel, } from 'ui' -import { PostgresTable } from '@supabase/postgres-meta' -import { SpreadsheetData } from './SpreadsheetImport.types' +import type { PostgresTable } from '@supabase/postgres-meta' +import type { SpreadsheetData } from './SpreadsheetImport.types' import SpreadsheetPreviewGrid from './SpreadsheetPreviewGrid' const MAX_ROWS = 20 diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx index b9104a5154e..141518e4fc6 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/Column.tsx @@ -1,13 +1,13 @@ import { noop } from 'lodash' import { Checkbox, IconMenu, IconSettings, IconX, Input, Popover } from 'ui' -import { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' +import type { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' import { EMPTY_ARR, EMPTY_OBJ } from 'lib/void' import { typeExpressionSuggestions } from '../ColumnEditor/ColumnEditor.constants' -import { Suggestion } from '../ColumnEditor/ColumnEditor.types' +import type { Suggestion } from '../ColumnEditor/ColumnEditor.types' import ColumnType from '../ColumnEditor/ColumnType' import InputWithSuggestions from '../ColumnEditor/InputWithSuggestions' -import { ColumnField } from '../SidePanelEditor.types' +import type { ColumnField } from '../SidePanelEditor.types' /** * [Joshen] For context: diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx index 72decdd4b43..c0c183f9956 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ColumnManagement.tsx @@ -10,13 +10,13 @@ import { import { Alert, Button, IconEdit, IconExternalLink, IconHelpCircle, IconKey, IconTrash } from 'ui' import InformationBox from 'components/ui/InformationBox' -import { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' +import type { EnumeratedType } from 'data/enumerated-types/enumerated-types-query' import { generateColumnField } from '../ColumnEditor/ColumnEditor.utils' -import { ForeignKey } from '../ForeignKeySelector/ForeignKeySelector.types' +import type { ForeignKey } from '../ForeignKeySelector/ForeignKeySelector.types' import { TEXT_TYPES } from '../SidePanelEditor.constants' -import { ColumnField, ExtendedPostgresRelationship } from '../SidePanelEditor.types' +import type { ColumnField, ExtendedPostgresRelationship } from '../SidePanelEditor.types' import Column from './Column' -import { ImportContent } from './TableEditor.types' +import type { ImportContent } from './TableEditor.types' interface ColumnManagementProps { columns?: ColumnField[] diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeyRow.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeyRow.tsx index 3787487df2d..f0ae05142db 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeyRow.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeyRow.tsx @@ -5,7 +5,7 @@ import SVG from 'react-inlinesvg' import { Badge, Button, IconArrowRight } from 'ui' import { BASE_PATH } from 'lib/constants' -import { ForeignKey } from '../../ForeignKeySelector/ForeignKeySelector.types' +import type { ForeignKey } from '../../ForeignKeySelector/ForeignKeySelector.types' interface ForeignKeyProps { foreignKey: ForeignKey diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeysManagement.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeysManagement.tsx index 2115fb9e03c..f016c0f7416 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeysManagement.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeysManagement.tsx @@ -6,11 +6,11 @@ import AlertError from 'components/ui/AlertError' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useForeignKeyConstraintsQuery } from 'data/database/foreign-key-constraints-query' import { useTableEditorStateSnapshot } from 'state/table-editor' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { ForeignKeySelector } from '../../ForeignKeySelector/ForeignKeySelector' -import { TableField } from '../TableEditor.types' +import type { TableField } from '../TableEditor.types' import { ForeignKeyRow } from './ForeignKeyRow' -import { ForeignKey } from '../../ForeignKeySelector/ForeignKeySelector.types' +import type { ForeignKey } from '../../ForeignKeySelector/ForeignKeySelector.types' import { checkIfRelationChanged } from './ForeignKeysManagement.utils' import { uuidv4 } from 'lib/helpers' diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeysManagement.utils.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeysManagement.utils.ts index 7d8c54e726d..13f38a6092f 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeysManagement.utils.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/ForeignKeysManagement/ForeignKeysManagement.utils.ts @@ -1,5 +1,5 @@ -import { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' -import { ForeignKey } from '../../ForeignKeySelector/ForeignKeySelector.types' +import type { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' +import type { ForeignKey } from '../../ForeignKeySelector/ForeignKeySelector.types' import { isEqual } from 'lodash' export const checkIfRelationChanged = (existing: ForeignKeyConstraint, state: ForeignKey) => { diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.constants.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.constants.ts index 069d613bdf0..3a8fbc9430e 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.constants.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.constants.ts @@ -1,5 +1,5 @@ import { uuidv4 } from 'lib/helpers' -import { ColumnField } from '../SidePanelEditor.types' +import type { ColumnField } from '../SidePanelEditor.types' export const DEFAULT_COLUMNS: ColumnField[] = [ { diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx index c380a34b371..264958f5f59 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx @@ -22,15 +22,15 @@ import { EXCLUDED_SCHEMAS_WITHOUT_EXTENSIONS } from 'lib/constants/schemas' import { useTableEditorStateSnapshot } from 'state/table-editor' import { SpreadsheetImport } from '../' import ActionBar from '../ActionBar' -import { ForeignKey } from '../ForeignKeySelector/ForeignKeySelector.types' +import type { ForeignKey } from '../ForeignKeySelector/ForeignKeySelector.types' import { formatForeignKeys } from '../ForeignKeySelector/ForeignKeySelector.utils' -import { ColumnField } from '../SidePanelEditor.types' +import type { ColumnField } from '../SidePanelEditor.types' import ColumnManagement from './ColumnManagement' import { ForeignKeysManagement } from './ForeignKeysManagement/ForeignKeysManagement' import HeaderTitle from './HeaderTitle' import RLSDisableModalContent from './RLSDisableModal' import { DEFAULT_COLUMNS } from './TableEditor.constants' -import { ImportContent, TableField } from './TableEditor.types' +import type { ImportContent, TableField } from './TableEditor.types' import { formatImportedContentToColumnFields, generateTableField, diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.types.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.types.ts index 18cd6f1f87c..32e17c65317 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.types.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.types.ts @@ -1,5 +1,5 @@ -import { Dictionary } from 'types' -import { ColumnField } from '../SidePanelEditor.types' +import type { Dictionary } from 'types' +import type { ColumnField } from '../SidePanelEditor.types' export interface TableField { id: number diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.utils.ts b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.utils.ts index c79570968ce..82bd8a63d67 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.utils.ts +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.utils.ts @@ -1,14 +1,14 @@ import { some } from 'lodash' import type { PostgresColumn, PostgresTable } from '@supabase/postgres-meta' -import { ImportContent, TableField } from './TableEditor.types' +import type { ImportContent, TableField } from './TableEditor.types' import { DEFAULT_COLUMNS } from './TableEditor.constants' -import { ColumnField } from '../SidePanelEditor.types' +import type { ColumnField } from '../SidePanelEditor.types' import { generateColumnField, generateColumnFieldFromPostgresColumn, } from '../ColumnEditor/ColumnEditor.utils' -import { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' +import type { ForeignKeyConstraint } from 'data/database/foreign-key-constraints-query' export const validateFields = (field: TableField) => { const errors = {} as any diff --git a/apps/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx index 8adbe4342f4..85cd6b28494 100644 --- a/apps/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx @@ -20,12 +20,12 @@ import { sqlKeys } from 'data/sql/keys' import { useTableRowUpdateMutation } from 'data/table-rows/table-row-update-mutation' import { useCheckPermissions, useLatest, useStore, useUrlState } from 'hooks' import useEntityType from 'hooks/misc/useEntityType' -import { TableLike } from 'hooks/misc/useTable' +import type { TableLike } from 'hooks/misc/useTable' import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas' import { EMPTY_ARR } from 'lib/void' import { useGetImpersonatedRole } from 'state/role-impersonation-state' import { useTableEditorStateSnapshot } from 'state/table-editor' -import { Dictionary, SchemaView } from 'types' +import type { Dictionary, SchemaView } from 'types' import GridHeaderActions from './GridHeaderActions' import NotFoundState from './NotFoundState' import { SidePanelEditor } from './SidePanelEditor' diff --git a/apps/studio/components/layouts/APIAuthorizationLayout.tsx b/apps/studio/components/layouts/APIAuthorizationLayout.tsx index 08a179110f5..960dd6f8f83 100644 --- a/apps/studio/components/layouts/APIAuthorizationLayout.tsx +++ b/apps/studio/components/layouts/APIAuthorizationLayout.tsx @@ -3,7 +3,7 @@ import { BASE_PATH } from 'lib/constants' import { useTheme } from 'next-themes' import Head from 'next/head' import Image from 'next/legacy/image' -import { PropsWithChildren } from 'react' +import type { PropsWithChildren } from 'react' export interface APIAuthorizationLayoutProps {} diff --git a/apps/studio/components/layouts/AccountLayout/AccountLayout.tsx b/apps/studio/components/layouts/AccountLayout/AccountLayout.tsx index ecbef0713e5..9ff40c78187 100644 --- a/apps/studio/components/layouts/AccountLayout/AccountLayout.tsx +++ b/apps/studio/components/layouts/AccountLayout/AccountLayout.tsx @@ -7,7 +7,7 @@ import { useFlag, useSelectedOrganization, withAuth } from 'hooks' import { useSignOut } from 'lib/auth' import { IS_PLATFORM } from 'lib/constants' import SettingsLayout from '../SettingsLayout/SettingsLayout' -import { SidebarSection } from './AccountLayout.types' +import type { SidebarSection } from './AccountLayout.types' import WithSidebar from './WithSidebar' export interface AccountLayoutProps { diff --git a/apps/studio/components/layouts/AccountLayout/WithSidebar.tsx b/apps/studio/components/layouts/AccountLayout/WithSidebar.tsx index 81b4f347cfc..2a308c682cd 100644 --- a/apps/studio/components/layouts/AccountLayout/WithSidebar.tsx +++ b/apps/studio/components/layouts/AccountLayout/WithSidebar.tsx @@ -5,7 +5,7 @@ import { Badge, IconArrowUpRight, IconLogOut, Menu } from 'ui' import { useFlag } from 'hooks' import { LayoutHeader } from '../ProjectLayout/LayoutHeader' -import { SidebarLink, SidebarSection } from './AccountLayout.types' +import type { SidebarLink, SidebarSection } from './AccountLayout.types' interface WithSidebarProps { title: string diff --git a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx index 4dd459aeb71..dfd40edd4f6 100644 --- a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx +++ b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx @@ -3,7 +3,7 @@ import { EmptyIntegrationConnection, IntegrationConnection, } from 'components/interfaces/Integrations/IntegrationPanels' -import { GitHubConnection } from 'data/integrations/github-connections-query' +import type { GitHubConnection } from 'data/integrations/github-connections-query' import { useSelectedOrganization } from 'hooks' import { useSidePanelsStateSnapshot } from 'state/side-panels' import { diff --git a/apps/studio/components/layouts/AppLayout/ProjectDropdown.tsx b/apps/studio/components/layouts/AppLayout/ProjectDropdown.tsx index 3d7fa037419..35f7477dc9a 100644 --- a/apps/studio/components/layouts/AppLayout/ProjectDropdown.tsx +++ b/apps/studio/components/layouts/AppLayout/ProjectDropdown.tsx @@ -8,7 +8,7 @@ import ShimmeringLoader from 'components/ui/ShimmeringLoader' import { ProjectInfo, useProjectsQuery } from 'data/projects/projects-query' import { useIsFeatureEnabled, useSelectedOrganization, useSelectedProject } from 'hooks' import { IS_PLATFORM } from 'lib/constants' -import { Organization } from 'types' +import type { Organization } from 'types' import { Button, CommandEmpty_Shadcn_, diff --git a/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts b/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts index 4704150201f..bbdf9edad7e 100644 --- a/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts +++ b/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts @@ -1,4 +1,4 @@ -import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' +import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' import { IS_PLATFORM } from 'lib/constants' export const generateAuthMenu = ( diff --git a/apps/studio/components/layouts/BillingLayout.tsx b/apps/studio/components/layouts/BillingLayout.tsx index abb764fd1cc..b62bd596fac 100644 --- a/apps/studio/components/layouts/BillingLayout.tsx +++ b/apps/studio/components/layouts/BillingLayout.tsx @@ -1,5 +1,5 @@ import Link from 'next/link' -import { PropsWithChildren } from 'react' +import type { PropsWithChildren } from 'react' import { ProjectLayout } from 'components/layouts' import { useSelectedOrganization, useSelectedProject, withAuth } from 'hooks' diff --git a/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.ts b/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.ts index 5ae95f71503..4f6f6f81c07 100644 --- a/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.ts +++ b/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.ts @@ -1,5 +1,5 @@ -import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' -import { Project } from 'data/projects/project-detail-query' +import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' +import type { Project } from 'data/projects/project-detail-query' import { IS_PLATFORM } from 'lib/constants' export const generateDatabaseMenu = ( diff --git a/apps/studio/components/layouts/DocsLayout/DocsLayout.utils.tsx b/apps/studio/components/layouts/DocsLayout/DocsLayout.utils.tsx index beb9bf2efce..dd1efef6c57 100644 --- a/apps/studio/components/layouts/DocsLayout/DocsLayout.utils.tsx +++ b/apps/studio/components/layouts/DocsLayout/DocsLayout.utils.tsx @@ -1,5 +1,5 @@ import SVG from 'react-inlinesvg' -import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' +import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' import { IconBook, IconBookOpen } from 'ui' import { BASE_PATH } from 'lib/constants' diff --git a/apps/studio/components/layouts/FunctionsLayout.tsx b/apps/studio/components/layouts/FunctionsLayout.tsx index 2247126ac9e..a41dd3b0ab1 100644 --- a/apps/studio/components/layouts/FunctionsLayout.tsx +++ b/apps/studio/components/layouts/FunctionsLayout.tsx @@ -2,7 +2,7 @@ import { PermissionAction } from '@supabase/shared-types/out/constants' import { useParams } from 'common' import { observer } from 'mobx-react-lite' import Link from 'next/link' -import { PropsWithChildren } from 'react' +import type { PropsWithChildren } from 'react' import { Button, IconCode, IconExternalLink } from 'ui' import { useIsAPIDocsSidePanelEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' diff --git a/apps/studio/components/layouts/IntegrationsLayout/Integrations.utils.ts b/apps/studio/components/layouts/IntegrationsLayout/Integrations.utils.ts index 0d19f996f5c..3875773143c 100644 --- a/apps/studio/components/layouts/IntegrationsLayout/Integrations.utils.ts +++ b/apps/studio/components/layouts/IntegrationsLayout/Integrations.utils.ts @@ -1,6 +1,6 @@ -import { IntegrationsData } from 'data/integrations/integrations-query' -import { IntegrationName } from 'data/integrations/integrations.types' -import { Organization } from 'types' +import type { IntegrationsData } from 'data/integrations/integrations-query' +import type { IntegrationName } from 'data/integrations/integrations.types' +import type { Organization } from 'types' export function getHasInstalledObject({ integrationName, diff --git a/apps/studio/components/layouts/LogsLayout/LogsMenu.utils.ts b/apps/studio/components/layouts/LogsLayout/LogsMenu.utils.ts index d4fd1fd22a2..5c34890d454 100644 --- a/apps/studio/components/layouts/LogsLayout/LogsMenu.utils.ts +++ b/apps/studio/components/layouts/LogsLayout/LogsMenu.utils.ts @@ -1,5 +1,8 @@ -import { ProductMenuGroup, ProductMenuGroupItem } from 'components/ui/ProductMenu/ProductMenu.types' -import { Project } from 'data/projects/project-detail-query' +import type { + ProductMenuGroup, + ProductMenuGroupItem, +} from 'components/ui/ProductMenu/ProductMenu.types' +import type { Project } from 'data/projects/project-detail-query' import { IS_PLATFORM } from 'lib/constants' export const generateLogsMenu = ( diff --git a/apps/studio/components/layouts/OrganizationLayout.tsx b/apps/studio/components/layouts/OrganizationLayout.tsx index 58093c0e8af..7e18c7a7df7 100644 --- a/apps/studio/components/layouts/OrganizationLayout.tsx +++ b/apps/studio/components/layouts/OrganizationLayout.tsx @@ -1,5 +1,5 @@ import { useRouter } from 'next/router' -import { PropsWithChildren } from 'react' +import type { PropsWithChildren } from 'react' import { useParams } from 'common' import { useFlag, useIsFeatureEnabled, useSelectedOrganization } from 'hooks' @@ -13,7 +13,6 @@ const OrganizationLayout = ({ children }: PropsWithChildren<{}>) => { const selectedOrganization = useSelectedOrganization() const router = useRouter() const { slug } = useParams() - const id = router.asPath.split('/').at(-1)?.split('?')[0]?.split('#')[0] const invoicesEnabled = useIsFeatureEnabled('billing:invoices') diff --git a/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx b/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx index 3944a18b3a4..3ddee584421 100644 --- a/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx +++ b/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx @@ -7,7 +7,7 @@ import { Badge, Button, IconExternalLink, IconLoader, IconMonitor, IconServer } import ShimmerLine from 'components/ui/ShimmerLine' import { setProjectPostgrestStatus } from 'data/projects/projects-query' import pingPostgrest from 'lib/pingPostgrest' -import { Project } from 'data/projects/project-detail-query' +import type { Project } from 'data/projects/project-detail-query' export interface ConnectingStateProps { project: Project diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationRow.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationRow.tsx index c525b3c1011..355bf61de16 100644 --- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationRow.tsx +++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationRow.tsx @@ -9,10 +9,10 @@ import { Button, IconArchive, IconExternalLink } from 'ui' import { Markdown } from 'components/interfaces/Markdown' import { CriticalIcon, WarningIcon } from 'components/ui/Icons' -import { ItemRenderer } from 'components/ui/InfiniteList' +import type { ItemRenderer } from 'components/ui/InfiniteList' import { Notification, NotificationData } from 'data/notifications/notifications-v2-query' import { ProjectInfo } from 'data/projects/projects-query' -import { Organization } from 'types' +import type { Organization } from 'types' interface NotificationRowProps { setRowHeight: (idx: number, height: number) => void diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx index f584fcd1a00..30ecb4d6c66 100644 --- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx +++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx @@ -1,5 +1,5 @@ -import { Route } from 'components/ui/ui.types' -import { Project } from 'data/projects/project-detail-query' +import type { Route } from 'components/ui/ui.types' +import type { Project } from 'data/projects/project-detail-query' import { IS_PLATFORM, PROJECT_STATUS } from 'lib/constants' import { Auth, diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx index 0e1dc0770c6..8849eac61e7 100644 --- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx +++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationIconLink.tsx @@ -3,7 +3,7 @@ import Link from 'next/link' import { AnchorHTMLAttributes, forwardRef } from 'react' import { cn } from 'ui' -import { Route } from 'components/ui/ui.types' +import type { Route } from 'components/ui/ui.types' import { useAppStateSnapshot } from 'state/app-state' interface NavigationIconButtonProps extends AnchorHTMLAttributes { diff --git a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.ts b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.ts index ca762cb2df0..dc5230b9404 100644 --- a/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.ts +++ b/apps/studio/components/layouts/ProjectSettingsLayout/SettingsMenu.utils.ts @@ -1,7 +1,7 @@ -import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' -import { Project } from 'data/projects/project-detail-query' +import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' +import type { Project } from 'data/projects/project-detail-query' import { IS_PLATFORM, PROJECT_STATUS } from 'lib/constants' -import { Organization } from 'types' +import type { Organization } from 'types' export const generateSettingsMenu = ( ref?: string, diff --git a/apps/studio/components/layouts/RealtimeLayout/RealtimeMenu.utils.ts b/apps/studio/components/layouts/RealtimeLayout/RealtimeMenu.utils.ts index e6d83293fb0..c8d612494a7 100644 --- a/apps/studio/components/layouts/RealtimeLayout/RealtimeMenu.utils.ts +++ b/apps/studio/components/layouts/RealtimeLayout/RealtimeMenu.utils.ts @@ -1,5 +1,5 @@ -import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' -import { Project } from 'data/projects/project-detail-query' +import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' +import type { Project } from 'data/projects/project-detail-query' export const generateRealtimeMenu = (project?: Project): ProductMenuGroup[] => { const ref = project?.ref ?? 'default' diff --git a/apps/studio/components/layouts/SQLEditorLayout/QueryItem.tsx b/apps/studio/components/layouts/SQLEditorLayout/QueryItem.tsx index 20c100e91db..d4e8fac4baa 100644 --- a/apps/studio/components/layouts/SQLEditorLayout/QueryItem.tsx +++ b/apps/studio/components/layouts/SQLEditorLayout/QueryItem.tsx @@ -27,7 +27,7 @@ import SimpleCodeBlock from 'components/to-be-cleaned/SimpleCodeBlock' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import CopyButton from 'components/ui/CopyButton' import { useContentDeleteMutation } from 'data/content/content-delete-mutation' -import { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useSqlEditorStateSnapshot } from 'state/sql-editor' import { QueryItemActions } from './QueryItemActions' diff --git a/apps/studio/components/layouts/SQLEditorLayout/QueryItemActions.tsx b/apps/studio/components/layouts/SQLEditorLayout/QueryItemActions.tsx index a01b5a7c930..2eedc7458d9 100644 --- a/apps/studio/components/layouts/SQLEditorLayout/QueryItemActions.tsx +++ b/apps/studio/components/layouts/SQLEditorLayout/QueryItemActions.tsx @@ -18,7 +18,7 @@ import { } from 'ui' import { createSqlSnippetSkeleton } from 'components/interfaces/SQLEditor/SQLEditor.utils' -import { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useCheckPermissions, useSelectedProject, useStore } from 'hooks' import { uuidv4 } from 'lib/helpers' import { useProfile } from 'lib/profile' diff --git a/apps/studio/components/layouts/StorageLayout/BucketRow.tsx b/apps/studio/components/layouts/StorageLayout/BucketRow.tsx index fb54059a4d3..3d69401793b 100644 --- a/apps/studio/components/layouts/StorageLayout/BucketRow.tsx +++ b/apps/studio/components/layouts/StorageLayout/BucketRow.tsx @@ -17,7 +17,7 @@ import { IconXCircle, } from 'ui' -import { Bucket } from 'data/storage/buckets-query' +import type { Bucket } from 'data/storage/buckets-query' import { useCheckPermissions } from 'hooks' export interface BucketRowProps { diff --git a/apps/studio/components/layouts/StorageLayout/StorageBucketsError.tsx b/apps/studio/components/layouts/StorageLayout/StorageBucketsError.tsx index c5bddff3a9c..247847fdae4 100644 --- a/apps/studio/components/layouts/StorageLayout/StorageBucketsError.tsx +++ b/apps/studio/components/layouts/StorageLayout/StorageBucketsError.tsx @@ -1,6 +1,6 @@ import { useParams } from 'common' import Link from 'next/link' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { Alert, Button } from 'ui' export interface StorageBucketsErrorProps { diff --git a/apps/studio/components/layouts/StorageLayout/StorageMenu.tsx b/apps/studio/components/layouts/StorageLayout/StorageMenu.tsx index f272bb2d967..594e943b816 100644 --- a/apps/studio/components/layouts/StorageLayout/StorageMenu.tsx +++ b/apps/studio/components/layouts/StorageLayout/StorageMenu.tsx @@ -16,7 +16,7 @@ import { import CreateBucketModal from 'components/interfaces/Storage/CreateBucketModal' import EditBucketModal from 'components/interfaces/Storage/EditBucketModal' -import { StorageBucket } from 'components/interfaces/Storage/Storage.types' +import type { StorageBucket } from 'components/interfaces/Storage/Storage.types' import { DeleteBucketModal } from 'components/to-be-cleaned/Storage' import { EmptyBucketModal } from 'components/to-be-cleaned/Storage/EmptyBucketModal' import ShimmeringLoader from 'components/ui/ShimmeringLoader' diff --git a/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx b/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx index f72e396098a..6f68ae1466a 100644 --- a/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx +++ b/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx @@ -20,9 +20,9 @@ import { } from 'ui' import { parseSupaTable } from 'components/grid' -import { ItemRenderer } from 'components/ui/InfiniteList' +import type { ItemRenderer } from 'components/ui/InfiniteList' import { ENTITY_TYPE } from 'data/entity-types/entity-type-constants' -import { Entity } from 'data/entity-types/entity-type-query' +import type { Entity } from 'data/entity-types/entity-type-query' import { fetchAllTableRows } from 'data/table-rows/table-rows-query' import { getTable } from 'data/tables/table-query' import { useStore } from 'hooks' diff --git a/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx b/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx index 6d2afdd80df..96d2134c589 100644 --- a/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx +++ b/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx @@ -57,11 +57,9 @@ const TableEditorMenu = () => { isError, error, refetch, - isRefetching, hasNextPage, isFetchingNextPage, fetchNextPage, - isPreviousData: isSearching, } = useEntityTypesQuery( { projectRef: project?.ref, diff --git a/apps/studio/components/layouts/VercelIntegrationLayout.tsx b/apps/studio/components/layouts/VercelIntegrationLayout.tsx index 8c42daffedb..34bf4f2983a 100644 --- a/apps/studio/components/layouts/VercelIntegrationLayout.tsx +++ b/apps/studio/components/layouts/VercelIntegrationLayout.tsx @@ -1,5 +1,5 @@ import Head from 'next/head' -import { PropsWithChildren } from 'react' +import type { PropsWithChildren } from 'react' import Divider from 'components/ui/Divider' import { BASE_PATH } from 'lib/constants' diff --git a/apps/studio/components/layouts/WizardLayout.tsx b/apps/studio/components/layouts/WizardLayout.tsx index 5e51f9721b8..d181a263a1a 100644 --- a/apps/studio/components/layouts/WizardLayout.tsx +++ b/apps/studio/components/layouts/WizardLayout.tsx @@ -5,7 +5,7 @@ import { IconChevronRight } from 'ui' import { withAuth } from 'hooks' import { BASE_PATH } from 'lib/constants' -import { Organization, Project } from 'types' +import type { Organization, Project } from 'types' import { FeedbackDropdown } from './ProjectLayout/LayoutHeader/FeedbackDropdown' import HelpPopover from './ProjectLayout/LayoutHeader/HelpPopover' diff --git a/apps/studio/components/to-be-cleaned/Charts/ChartHandler.tsx b/apps/studio/components/to-be-cleaned/Charts/ChartHandler.tsx index e996f82213c..2b7f8062ea8 100644 --- a/apps/studio/components/to-be-cleaned/Charts/ChartHandler.tsx +++ b/apps/studio/components/to-be-cleaned/Charts/ChartHandler.tsx @@ -1,4 +1,4 @@ -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import { isUndefined } from 'lodash' import { useRouter } from 'next/router' import { PropsWithChildren, useEffect, useState } from 'react' @@ -7,7 +7,7 @@ import { Button, IconActivity, IconAlertCircle, IconBarChart, IconLoader } from import AreaChart from 'components/ui/Charts/AreaChart' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ChartData } from './ChartHandler.types' +import type { ChartData } from './ChartHandler.types' import { BarChart } from './ChartRenderer' interface ChartHandlerProps { diff --git a/apps/studio/components/to-be-cleaned/Storage/EmptyBucketModal.tsx b/apps/studio/components/to-be-cleaned/Storage/EmptyBucketModal.tsx index 3bf0fd86d25..c8ec9060e0c 100644 --- a/apps/studio/components/to-be-cleaned/Storage/EmptyBucketModal.tsx +++ b/apps/studio/components/to-be-cleaned/Storage/EmptyBucketModal.tsx @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import { useBucketEmptyMutation } from 'data/storage/bucket-empty-mutation' -import { Bucket } from 'data/storage/buckets-query' +import type { Bucket } from 'data/storage/buckets-query' import { useStorageStore } from 'localStores/storageExplorer/StorageExplorerStore' import { AlertDescription_Shadcn_, diff --git a/apps/studio/components/to-be-cleaned/Storage/Storage.utils.ts b/apps/studio/components/to-be-cleaned/Storage/Storage.utils.ts index 79406cf3487..5a50eab4ec4 100644 --- a/apps/studio/components/to-be-cleaned/Storage/Storage.utils.ts +++ b/apps/studio/components/to-be-cleaned/Storage/Storage.utils.ts @@ -1,6 +1,6 @@ import { groupBy, difference } from 'lodash' import { STORAGE_CLIENT_LIBRARY_MAPPINGS } from './Storage.constants' -import { StoragePolicyFormField } from 'components/interfaces/Storage/Storage.types' +import type { StoragePolicyFormField } from 'components/interfaces/Storage/Storage.types' const shortHash = (str: string) => { let hash = 0 diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorer.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorer.tsx index 7b5b02dcb99..9392c7e5db9 100644 --- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorer.tsx +++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorer.tsx @@ -7,7 +7,7 @@ import FolderContextMenu from './FolderContextMenu' import ColumnContextMenu from './ColumnContextMenu' import FileExplorerColumn from './FileExplorerColumn' import { noop } from 'lodash' -import { StorageColumn } from '../Storage.types' +import type { StorageColumn } from '../Storage.types' export interface FileExplorerProps { view: string diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerColumn.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerColumn.tsx index b2ccb1cf02a..19a316628d6 100644 --- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerColumn.tsx +++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerColumn.tsx @@ -15,7 +15,7 @@ import { STORAGE_ROW_TYPES, STORAGE_VIEWS, } from '../Storage.constants' -import { StorageColumn } from '../Storage.types' +import type { StorageColumn } from '../Storage.types' import FileExplorerRow from './FileExplorerRow' const DragOverOverlay = ({ isOpen, onDragLeave, onDrop, folderIsEmpty }: any) => { diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerRow.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerRow.tsx index 05ceb155cc9..6ece67a3f98 100644 --- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerRow.tsx +++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerRow.tsx @@ -28,7 +28,7 @@ import { IconTrash2, } from 'ui' -import { ItemRenderer } from 'components/ui/InfiniteList' +import type { ItemRenderer } from 'components/ui/InfiniteList' import { useCheckPermissions } from 'hooks' import { BASE_PATH } from 'lib/constants' import { formatBytes } from 'lib/helpers' diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.tsx index 1f8bbb6ab7f..0c0beb8cbd1 100644 --- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.tsx +++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.tsx @@ -5,7 +5,7 @@ import { useEffect, useRef, useState } from 'react' import { useProjectSettingsQuery } from 'data/config/project-settings-query' import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query' -import { Bucket } from 'data/storage/buckets-query' +import type { Bucket } from 'data/storage/buckets-query' import { useStore } from 'hooks' import { DEFAULT_PROJECT_API_SERVICE_ID } from 'lib/constants' import { copyToClipboard } from 'lib/helpers' diff --git a/apps/studio/components/ui/AlertError.tsx b/apps/studio/components/ui/AlertError.tsx index 331e2c1beb1..4bb1a367db3 100644 --- a/apps/studio/components/ui/AlertError.tsx +++ b/apps/studio/components/ui/AlertError.tsx @@ -1,5 +1,5 @@ import Link from 'next/link' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, diff --git a/apps/studio/components/ui/Charts/AreaChart.tsx b/apps/studio/components/ui/Charts/AreaChart.tsx index d0f0e0bbfa0..4d6fcef6861 100644 --- a/apps/studio/components/ui/Charts/AreaChart.tsx +++ b/apps/studio/components/ui/Charts/AreaChart.tsx @@ -4,7 +4,7 @@ import utc from 'dayjs/plugin/utc' import { useState } from 'react' import { Area, AreaChart as RechartAreaChart, Tooltip, XAxis } from 'recharts' import ChartHeader from './ChartHeader' -import { CommonChartProps, Datum } from './Charts.types' +import type { CommonChartProps, Datum } from './Charts.types' import { numberFormatter, useChartSize } from './Charts.utils' import ChartNoData from './NoDataPlaceholder' dayjs.extend(utc) diff --git a/apps/studio/components/ui/Charts/BarChart.tsx b/apps/studio/components/ui/Charts/BarChart.tsx index 9f843aa9426..2e45ba94213 100644 --- a/apps/studio/components/ui/Charts/BarChart.tsx +++ b/apps/studio/components/ui/Charts/BarChart.tsx @@ -3,9 +3,9 @@ import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import { useState } from 'react' import { Bar, BarChart as RechartBarChart, Cell, Tooltip, XAxis, Legend } from 'recharts' -import { CategoricalChartState } from 'recharts/types/chart/generateCategoricalChart' +import type { CategoricalChartState } from 'recharts/types/chart/generateCategoricalChart' import ChartHeader from './ChartHeader' -import { CommonChartProps, Datum } from './Charts.types' +import type { CommonChartProps, Datum } from './Charts.types' import { numberFormatter, useChartSize } from './Charts.utils' import ChartNoData from './NoDataPlaceholder' dayjs.extend(utc) diff --git a/apps/studio/components/ui/Charts/Charts.utils.tsx b/apps/studio/components/ui/Charts/Charts.utils.tsx index 34c9f6783f1..89acca19e3b 100644 --- a/apps/studio/components/ui/Charts/Charts.utils.tsx +++ b/apps/studio/components/ui/Charts/Charts.utils.tsx @@ -2,7 +2,7 @@ import dayjs from 'dayjs' import React, { useMemo } from 'react' import { ResponsiveContainer } from 'recharts' import { DateTimeFormats } from './Charts.constants' -import { CommonChartProps, StackedChartProps } from './Charts.types' +import type { CommonChartProps, StackedChartProps } from './Charts.types' import utc from 'dayjs/plugin/utc' dayjs.extend(utc) diff --git a/apps/studio/components/ui/Charts/StackedBarChart.tsx b/apps/studio/components/ui/Charts/StackedBarChart.tsx index 3c252cc7039..1bf9b9a4528 100644 --- a/apps/studio/components/ui/Charts/StackedBarChart.tsx +++ b/apps/studio/components/ui/Charts/StackedBarChart.tsx @@ -10,7 +10,7 @@ import { genStackColorScales, ValidStackColor, } from './Charts.constants' -import { CommonChartProps } from './Charts.types' +import type { CommonChartProps } from './Charts.types' import { numberFormatter, precisionFormatter, diff --git a/apps/studio/components/ui/CodeEditor/Providers/PgSQLCompletionProvider.ts b/apps/studio/components/ui/CodeEditor/Providers/PgSQLCompletionProvider.ts index e9534735c9b..599c67c4e04 100644 --- a/apps/studio/components/ui/CodeEditor/Providers/PgSQLCompletionProvider.ts +++ b/apps/studio/components/ui/CodeEditor/Providers/PgSQLCompletionProvider.ts @@ -1,8 +1,8 @@ -import { RefObject } from 'react' +import type { RefObject } from 'react' import BackwardIterator from './BackwardIterator' -import { Schema } from 'data/database/schemas-query' -import { TableColumn } from 'data/database/table-columns-query' -import { DatabaseFunction } from 'data/database/functions-query' +import type { Schema } from 'data/database/schemas-query' +import type { TableColumn } from 'data/database/table-columns-query' +import type { DatabaseFunction } from 'data/database/functions-query' // [Joshen] Needs to be fixed diff --git a/apps/studio/components/ui/DatePicker/TimeSplitInput.tsx b/apps/studio/components/ui/DatePicker/TimeSplitInput.tsx index b86024b611c..9021eb08793 100644 --- a/apps/studio/components/ui/DatePicker/TimeSplitInput.tsx +++ b/apps/studio/components/ui/DatePicker/TimeSplitInput.tsx @@ -3,7 +3,7 @@ import { IconClock } from 'ui' import { format } from 'date-fns' -import { TimeSplitInputProps, TimeType } from './DatePicker.types' +import type { TimeSplitInputProps, TimeType } from './DatePicker.types' const TimeSplitInput = ({ type, diff --git a/apps/studio/components/ui/Flag/FlagProvider.tsx b/apps/studio/components/ui/Flag/FlagProvider.tsx index e949bca4201..57f11d9fd69 100644 --- a/apps/studio/components/ui/Flag/FlagProvider.tsx +++ b/apps/studio/components/ui/Flag/FlagProvider.tsx @@ -1,4 +1,4 @@ -import { User } from '@supabase/supabase-js' +import type { User } from '@supabase/supabase-js' import { PropsWithChildren, useEffect, useState } from 'react' import { IS_PLATFORM } from 'lib/constants' diff --git a/apps/studio/components/ui/OveragesBanner/OveragesBanner.utils.ts b/apps/studio/components/ui/OveragesBanner/OveragesBanner.utils.ts index 9011364f955..0a33a6342ce 100644 --- a/apps/studio/components/ui/OveragesBanner/OveragesBanner.utils.ts +++ b/apps/studio/components/ui/OveragesBanner/OveragesBanner.utils.ts @@ -1,4 +1,4 @@ -import { OrgMetricsUsage } from 'data/usage/org-usage-query' +import type { OrgMetricsUsage } from 'data/usage/org-usage-query' export const getResourcesExceededLimitsOrg = (usageMetrics: OrgMetricsUsage[]): string[] => { if (!usageMetrics.length) return [] diff --git a/apps/studio/components/ui/ProductMenu/ProductMenu.tsx b/apps/studio/components/ui/ProductMenu/ProductMenu.tsx index 7f9e952de2c..2993d7d1535 100644 --- a/apps/studio/components/ui/ProductMenu/ProductMenu.tsx +++ b/apps/studio/components/ui/ProductMenu/ProductMenu.tsx @@ -1,6 +1,6 @@ import { Badge, Menu } from 'ui' -import { ProductMenuGroup } from './ProductMenu.types' +import type { ProductMenuGroup } from './ProductMenu.types' import ProductMenuItem from './ProductMenuItem' interface ProductMenuProps { diff --git a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.utils.ts b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.utils.ts index 8665089241b..23e35345f36 100644 --- a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.utils.ts +++ b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.utils.ts @@ -1,4 +1,4 @@ -import { ResourceWarning } from 'data/usage/resource-warnings-query' +import type { ResourceWarning } from 'data/usage/resource-warnings-query' import { RESOURCE_WARNING_MESSAGES } from './ResourceExhaustionWarningBanner.constants' export const getWarningContent = ( diff --git a/apps/studio/data/__templates/resource-query.ts b/apps/studio/data/__templates/resource-query.ts index 6fa63c86e78..0f0b0501376 100644 --- a/apps/studio/data/__templates/resource-query.ts +++ b/apps/studio/data/__templates/resource-query.ts @@ -2,7 +2,7 @@ import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query import { useCallback } from 'react' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { resourceKeys } from './keys' export type ResourceVariables = { diff --git a/apps/studio/data/__templates/resource-update-mutation.ts b/apps/studio/data/__templates/resource-update-mutation.ts index 2fd34512f8f..ae277f09c54 100644 --- a/apps/studio/data/__templates/resource-update-mutation.ts +++ b/apps/studio/data/__templates/resource-update-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import toast from 'react-hot-toast' import { handleError, patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { resourceKeys } from './keys' export type ResourceUpdateVariables = { diff --git a/apps/studio/data/__templates/resources-query.ts b/apps/studio/data/__templates/resources-query.ts index 5ed424df8b4..9d15bd55ee7 100644 --- a/apps/studio/data/__templates/resources-query.ts +++ b/apps/studio/data/__templates/resources-query.ts @@ -2,7 +2,7 @@ import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query import { useCallback } from 'react' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { resourceKeys } from './keys' export type ResourcesVariables = { diff --git a/apps/studio/data/access-tokens/access-tokens-create-mutation.ts b/apps/studio/data/access-tokens/access-tokens-create-mutation.ts index 6fb92b70ed4..6afa1a4d01c 100644 --- a/apps/studio/data/access-tokens/access-tokens-create-mutation.ts +++ b/apps/studio/data/access-tokens/access-tokens-create-mutation.ts @@ -2,8 +2,8 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { isResponseOk, post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' -import { AccessToken } from './access-tokens-query' +import type { ResponseError } from 'types' +import type { AccessToken } from './access-tokens-query' import { accessTokenKeys } from './keys' export type AccessTokenCreateVariables = { diff --git a/apps/studio/data/access-tokens/access-tokens-delete-mutation.ts b/apps/studio/data/access-tokens/access-tokens-delete-mutation.ts index f94f5734be6..84e7047ecad 100644 --- a/apps/studio/data/access-tokens/access-tokens-delete-mutation.ts +++ b/apps/studio/data/access-tokens/access-tokens-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import toast from 'react-hot-toast' import { delete_, isResponseOk } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { accessTokenKeys } from './keys' export type AccessTokenDeleteVariables = { diff --git a/apps/studio/data/ai/sql-debug-mutation.ts b/apps/studio/data/ai/sql-debug-mutation.ts index 61843e3f308..32f3a462704 100644 --- a/apps/studio/data/ai/sql-debug-mutation.ts +++ b/apps/studio/data/ai/sql-debug-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { isResponseOk, post } from 'lib/common/fetch' import { BASE_PATH } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type SqlDebugResponse = { solution: string diff --git a/apps/studio/data/ai/sql-edit-mutation.ts b/apps/studio/data/ai/sql-edit-mutation.ts index 891bd7ace12..0127f17d1bf 100644 --- a/apps/studio/data/ai/sql-edit-mutation.ts +++ b/apps/studio/data/ai/sql-edit-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { isResponseOk, post } from 'lib/common/fetch' import { BASE_PATH } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type SqlEditResponse = { sql: string diff --git a/apps/studio/data/ai/sql-generate-mutation.ts b/apps/studio/data/ai/sql-generate-mutation.ts index fa076045b2c..e26b54a0776 100644 --- a/apps/studio/data/ai/sql-generate-mutation.ts +++ b/apps/studio/data/ai/sql-generate-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { isResponseOk, post } from 'lib/common/fetch' import { BASE_PATH } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type SqlGenerateResponse = { title: string diff --git a/apps/studio/data/ai/sql-title-mutation.ts b/apps/studio/data/ai/sql-title-mutation.ts index 339cb0ec66a..7306ec2df7a 100644 --- a/apps/studio/data/ai/sql-title-mutation.ts +++ b/apps/studio/data/ai/sql-title-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { isResponseOk, post } from 'lib/common/fetch' import { BASE_PATH } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type SqlTitleGenerateResponse = { title: string diff --git a/apps/studio/data/analytics/infra-monitoring-query.ts b/apps/studio/data/analytics/infra-monitoring-query.ts index 6f8101451af..ce73629d8b4 100644 --- a/apps/studio/data/analytics/infra-monitoring-query.ts +++ b/apps/studio/data/analytics/infra-monitoring-query.ts @@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import dayjs from 'dayjs' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { AnalyticsData } from './constants' +import type { AnalyticsData } from './constants' import { analyticsKeys } from './keys' export type InfraMonitoringVariables = { diff --git a/apps/studio/data/analytics/org-daily-compute-stats-query.ts b/apps/studio/data/analytics/org-daily-compute-stats-query.ts index a4bf2e24e1f..60232b64243 100644 --- a/apps/studio/data/analytics/org-daily-compute-stats-query.ts +++ b/apps/studio/data/analytics/org-daily-compute-stats-query.ts @@ -1,9 +1,9 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import dayjs from 'dayjs' import { get } from 'data/fetchers' -import { AnalyticsData } from './constants' +import type { AnalyticsData } from './constants' import { analyticsKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrgDailyComputeStatsVariables = { // API parameters diff --git a/apps/studio/data/analytics/org-daily-stats-query.ts b/apps/studio/data/analytics/org-daily-stats-query.ts index 9e92da29293..90202c60cf7 100644 --- a/apps/studio/data/analytics/org-daily-stats-query.ts +++ b/apps/studio/data/analytics/org-daily-stats-query.ts @@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import dayjs from 'dayjs' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { AnalyticsData } from './constants' +import type { AnalyticsData } from './constants' import { analyticsKeys } from './keys' export enum EgressType { diff --git a/apps/studio/data/analytics/project-log-requests-count-query.ts b/apps/studio/data/analytics/project-log-requests-count-query.ts index dd092593fc1..e5436f71363 100644 --- a/apps/studio/data/analytics/project-log-requests-count-query.ts +++ b/apps/studio/data/analytics/project-log-requests-count-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { analyticsKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectLogRequestsCountVariables = { projectRef?: string diff --git a/apps/studio/data/api-authorization/api-authorization-approve-mutation.ts b/apps/studio/data/api-authorization/api-authorization-approve-mutation.ts index 1185cc12dfd..8ee802a666f 100644 --- a/apps/studio/data/api-authorization/api-authorization-approve-mutation.ts +++ b/apps/studio/data/api-authorization/api-authorization-approve-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_ADMIN_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ApiAuthorizationApproveVariables = { id: string diff --git a/apps/studio/data/api-authorization/api-authorization-decline-mutation.ts b/apps/studio/data/api-authorization/api-authorization-decline-mutation.ts index aaff42dca99..5a55574d679 100644 --- a/apps/studio/data/api-authorization/api-authorization-decline-mutation.ts +++ b/apps/studio/data/api-authorization/api-authorization-decline-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_ADMIN_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ApiAuthorizationDeclineVariables = { id: string diff --git a/apps/studio/data/api-authorization/api-authorization-query.ts b/apps/studio/data/api-authorization/api-authorization-query.ts index bfd3efc235a..425cb98deb7 100644 --- a/apps/studio/data/api-authorization/api-authorization-query.ts +++ b/apps/studio/data/api-authorization/api-authorization-query.ts @@ -1,4 +1,4 @@ -import { OAuthScope } from '@supabase/shared-types/out/constants' +import type { OAuthScope } from '@supabase/shared-types/out/constants' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_ADMIN_URL } from 'lib/constants' diff --git a/apps/studio/data/auth/auth-config-query.ts b/apps/studio/data/auth/auth-config-query.ts index 293b47b039a..d8a6e34c4a6 100644 --- a/apps/studio/data/auth/auth-config-query.ts +++ b/apps/studio/data/auth/auth-config-query.ts @@ -1,8 +1,8 @@ import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get, handleError } from 'data/fetchers' import { useCallback } from 'react' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { authKeys } from './keys' export type AuthConfigVariables = { diff --git a/apps/studio/data/auth/auth-config-update-mutation.ts b/apps/studio/data/auth/auth-config-update-mutation.ts index c64a0d903a2..7e0c9f21000 100644 --- a/apps/studio/data/auth/auth-config-update-mutation.ts +++ b/apps/studio/data/auth/auth-config-update-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { authKeys } from './keys' export type AuthConfigUpdateVariables = { diff --git a/apps/studio/data/auth/user-create-mutation.ts b/apps/studio/data/auth/user-create-mutation.ts index 233ac115447..b737368acee 100644 --- a/apps/studio/data/auth/user-create-mutation.ts +++ b/apps/studio/data/auth/user-create-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import toast from 'react-hot-toast' import { post } from 'lib/common/fetch' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { authKeys } from './keys' export type UserCreateVariables = { diff --git a/apps/studio/data/auth/user-delete-mfa-factors-mutation.ts b/apps/studio/data/auth/user-delete-mfa-factors-mutation.ts index 96a05ee37d2..1b58cfcc842 100644 --- a/apps/studio/data/auth/user-delete-mfa-factors-mutation.ts +++ b/apps/studio/data/auth/user-delete-mfa-factors-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type UserDeleteMFAFactorsVariables = { projectRef: string diff --git a/apps/studio/data/auth/user-delete-mutation.ts b/apps/studio/data/auth/user-delete-mutation.ts index c5007295417..a6a50713e69 100644 --- a/apps/studio/data/auth/user-delete-mutation.ts +++ b/apps/studio/data/auth/user-delete-mutation.ts @@ -3,8 +3,8 @@ import toast from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' -import { User } from './users-query' +import type { ResponseError } from 'types' +import type { User } from './users-query' import { authKeys } from './keys' export type UserDeleteVariables = { diff --git a/apps/studio/data/auth/user-invite-mutation.ts b/apps/studio/data/auth/user-invite-mutation.ts index ed92c179c15..ca0924e05a5 100644 --- a/apps/studio/data/auth/user-invite-mutation.ts +++ b/apps/studio/data/auth/user-invite-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import toast from 'react-hot-toast' import { post } from 'lib/common/fetch' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { API_URL } from 'lib/constants' import { authKeys } from './keys' diff --git a/apps/studio/data/auth/user-reset-password-mutation.ts b/apps/studio/data/auth/user-reset-password-mutation.ts index 14220772625..ff76c1a1b15 100644 --- a/apps/studio/data/auth/user-reset-password-mutation.ts +++ b/apps/studio/data/auth/user-reset-password-mutation.ts @@ -3,8 +3,8 @@ import toast from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' -import { User } from './users-query' +import type { ResponseError } from 'types' +import type { User } from './users-query' export type UserResetPasswordVariables = { projectRef: string diff --git a/apps/studio/data/auth/user-send-magic-link-mutation.ts b/apps/studio/data/auth/user-send-magic-link-mutation.ts index ad339580490..6caed79dea3 100644 --- a/apps/studio/data/auth/user-send-magic-link-mutation.ts +++ b/apps/studio/data/auth/user-send-magic-link-mutation.ts @@ -3,8 +3,8 @@ import toast from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' -import { User } from './users-query' +import type { ResponseError } from 'types' +import type { User } from './users-query' export type UserSendMagicLinkVariables = { projectRef: string diff --git a/apps/studio/data/auth/user-send-otp-mutation.ts b/apps/studio/data/auth/user-send-otp-mutation.ts index 35df55e88c2..7630b637656 100644 --- a/apps/studio/data/auth/user-send-otp-mutation.ts +++ b/apps/studio/data/auth/user-send-otp-mutation.ts @@ -3,8 +3,8 @@ import toast from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' -import { User } from './users-query' +import type { ResponseError } from 'types' +import type { User } from './users-query' export type UserSendOTPVariables = { projectRef: string diff --git a/apps/studio/data/auth/users-query.ts b/apps/studio/data/auth/users-query.ts index a4fcc4123c4..8a9486f302a 100644 --- a/apps/studio/data/auth/users-query.ts +++ b/apps/studio/data/auth/users-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { authKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' export type UsersVariables = { projectRef?: string diff --git a/apps/studio/data/banned-ips/banned-ips-delete-mutations.ts b/apps/studio/data/banned-ips/banned-ips-delete-mutations.ts index fda7e1b04ae..179ef255ef8 100644 --- a/apps/studio/data/banned-ips/banned-ips-delete-mutations.ts +++ b/apps/studio/data/banned-ips/banned-ips-delete-mutations.ts @@ -1,6 +1,6 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { BannedIPKeys } from './keys' import toast from 'react-hot-toast' diff --git a/apps/studio/data/banned-ips/banned-ips-query.ts b/apps/studio/data/banned-ips/banned-ips-query.ts index 66e914ee14c..0ac314d39e1 100644 --- a/apps/studio/data/banned-ips/banned-ips-query.ts +++ b/apps/studio/data/banned-ips/banned-ips-query.ts @@ -1,6 +1,6 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { handleError, post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { BannedIPKeys } from './keys' export type BannedIPVariables = { diff --git a/apps/studio/data/branches/branch-create-mutation.ts b/apps/studio/data/branches/branch-create-mutation.ts index 45ae4585913..c056ae84f0d 100644 --- a/apps/studio/data/branches/branch-create-mutation.ts +++ b/apps/studio/data/branches/branch-create-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { branchKeys } from './keys' import { projectKeys } from 'data/projects/keys' diff --git a/apps/studio/data/branches/branch-delete-mutation.ts b/apps/studio/data/branches/branch-delete-mutation.ts index 736a66b9162..2ebe359a25f 100644 --- a/apps/studio/data/branches/branch-delete-mutation.ts +++ b/apps/studio/data/branches/branch-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { branchKeys } from './keys' export type BranchDeleteVariables = { diff --git a/apps/studio/data/branches/branch-query.ts b/apps/studio/data/branches/branch-query.ts index 5b40d9f8178..4959e155748 100644 --- a/apps/studio/data/branches/branch-query.ts +++ b/apps/studio/data/branches/branch-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { branchKeys } from './keys' export type BranchVariables = { diff --git a/apps/studio/data/branches/branch-update-mutation.ts b/apps/studio/data/branches/branch-update-mutation.ts index 2b70d82bb48..5ccec5ecbd8 100644 --- a/apps/studio/data/branches/branch-update-mutation.ts +++ b/apps/studio/data/branches/branch-update-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { branchKeys } from './keys' export type BranchUpdateVariables = { diff --git a/apps/studio/data/branches/branches-disable-mutation.ts b/apps/studio/data/branches/branches-disable-mutation.ts index 32f3cdbaedc..c5185da3899 100644 --- a/apps/studio/data/branches/branches-disable-mutation.ts +++ b/apps/studio/data/branches/branches-disable-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' import { projectKeys } from 'data/projects/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { deleteBranch } from './branch-delete-mutation' import { branchKeys } from './keys' diff --git a/apps/studio/data/branches/branches-query.ts b/apps/studio/data/branches/branches-query.ts index 91a95c3d753..67c27347e40 100644 --- a/apps/studio/data/branches/branches-query.ts +++ b/apps/studio/data/branches/branches-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { branchKeys } from './keys' export type BranchesVariables = { diff --git a/apps/studio/data/config/jwt-secret-update-mutation.ts b/apps/studio/data/config/jwt-secret-update-mutation.ts index 6d50154a832..95087a12902 100644 --- a/apps/studio/data/config/jwt-secret-update-mutation.ts +++ b/apps/studio/data/config/jwt-secret-update-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { configKeys } from './keys' export type JwtSecretUpdateVariables = { diff --git a/apps/studio/data/config/pgbouncer-enabled-query.ts b/apps/studio/data/config/pgbouncer-enabled-query.ts index 6a7b84ac92a..fa176d2e9a6 100644 --- a/apps/studio/data/config/pgbouncer-enabled-query.ts +++ b/apps/studio/data/config/pgbouncer-enabled-query.ts @@ -1,6 +1,6 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { configKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { get } from 'data/fetchers' import { IS_PLATFORM } from 'lib/constants' diff --git a/apps/studio/data/config/project-api-query.ts b/apps/studio/data/config/project-api-query.ts index 64ae4284cfa..ae1e960a9d8 100644 --- a/apps/studio/data/config/project-api-query.ts +++ b/apps/studio/data/config/project-api-query.ts @@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { configKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectApiVariables = { projectRef?: string diff --git a/apps/studio/data/config/project-disk-resize-mutation.ts b/apps/studio/data/config/project-disk-resize-mutation.ts index c07ca3245f1..dcc9977bb5f 100644 --- a/apps/studio/data/config/project-disk-resize-mutation.ts +++ b/apps/studio/data/config/project-disk-resize-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { usageKeys } from '../usage/keys' export type ProjectDiskResizeVariables = { diff --git a/apps/studio/data/config/project-postgrest-config-update-mutation.ts b/apps/studio/data/config/project-postgrest-config-update-mutation.ts index 8b87c192ae2..0e319361257 100644 --- a/apps/studio/data/config/project-postgrest-config-update-mutation.ts +++ b/apps/studio/data/config/project-postgrest-config-update-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { configKeys } from './keys' export type ProjectPostgrestConfigUpdateVariables = { diff --git a/apps/studio/data/config/project-settings-query.ts b/apps/studio/data/config/project-settings-query.ts index 91de0d3df78..7123a015e65 100644 --- a/apps/studio/data/config/project-settings-query.ts +++ b/apps/studio/data/config/project-settings-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get } from 'data/fetchers' import { DEFAULT_PROJECT_API_SERVICE_ID } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { configKeys } from './keys' export type ProjectSettingsVariables = { diff --git a/apps/studio/data/config/project-storage-config-query.ts b/apps/studio/data/config/project-storage-config-query.ts index 6fdefd55786..8408f0e74d9 100644 --- a/apps/studio/data/config/project-storage-config-query.ts +++ b/apps/studio/data/config/project-storage-config-query.ts @@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { configKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectStorageConfigVariables = { projectRef?: string diff --git a/apps/studio/data/config/project-storage-config-update-mutation.ts b/apps/studio/data/config/project-storage-config-update-mutation.ts index d1faba61008..b3ff8aa6eaa 100644 --- a/apps/studio/data/config/project-storage-config-update-mutation.ts +++ b/apps/studio/data/config/project-storage-config-update-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { configKeys } from './keys' export type ProjectStorageConfigUpdateUpdateVariables = { diff --git a/apps/studio/data/config/project-temp-disable-read-only-mutation.ts b/apps/studio/data/config/project-temp-disable-read-only-mutation.ts index 769fce31388..b7c47d4173c 100644 --- a/apps/studio/data/config/project-temp-disable-read-only-mutation.ts +++ b/apps/studio/data/config/project-temp-disable-read-only-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' import { usageKeys } from 'data/usage/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type TempDisableReadOnlyModeVariables = { projectRef: string diff --git a/apps/studio/data/config/project-upgrade-eligibility-query.ts b/apps/studio/data/config/project-upgrade-eligibility-query.ts index 1968c3efa75..685618c8c6d 100644 --- a/apps/studio/data/config/project-upgrade-eligibility-query.ts +++ b/apps/studio/data/config/project-upgrade-eligibility-query.ts @@ -3,7 +3,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_ADMIN_URL } from 'lib/constants' import { configKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectUpgradeEligibilityVariables = { projectRef?: string } export type ProjectUpgradeEligibilityResponse = { diff --git a/apps/studio/data/content/content-delete-mutation.ts b/apps/studio/data/content/content-delete-mutation.ts index 91dc03c343f..fdae3e32f0f 100644 --- a/apps/studio/data/content/content-delete-mutation.ts +++ b/apps/studio/data/content/content-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import toast from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { contentKeys } from './keys' type DeleteContentVariables = { projectRef: string; ids: string[] } diff --git a/apps/studio/data/content/content-insert-mutation.ts b/apps/studio/data/content/content-insert-mutation.ts index e7499042335..c7bdfab3b3c 100644 --- a/apps/studio/data/content/content-insert-mutation.ts +++ b/apps/studio/data/content/content-insert-mutation.ts @@ -1,10 +1,10 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { post } from 'data/fetchers' -import { ResponseError } from 'types' -import { Content } from './content-query' +import type { ResponseError } from 'types' +import type { Content } from './content-query' import { contentKeys } from './keys' export type InsertContentPayload = Omit & { diff --git a/apps/studio/data/content/content-query.ts b/apps/studio/data/content/content-query.ts index 364e7499b43..578b7bf674e 100644 --- a/apps/studio/data/content/content-query.ts +++ b/apps/studio/data/content/content-query.ts @@ -2,7 +2,7 @@ import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { useCallback } from 'react' -import { Dashboards, LogSqlSnippets, Owner, SqlSnippets } from 'types' +import type { Dashboards, LogSqlSnippets, Owner, SqlSnippets } from 'types' import { contentKeys } from './keys' type ContentBase = { diff --git a/apps/studio/data/content/content-upsert-mutation.ts b/apps/studio/data/content/content-upsert-mutation.ts index faaf59eca9b..a3fe29ef1cd 100644 --- a/apps/studio/data/content/content-upsert-mutation.ts +++ b/apps/studio/data/content/content-upsert-mutation.ts @@ -1,10 +1,10 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { put } from 'data/fetchers' -import { ResponseError } from 'types' -import { Content } from './content-query' +import type { ResponseError } from 'types' +import type { Content } from './content-query' import { contentKeys } from './keys' export type UpsertContentPayload = Omit & { diff --git a/apps/studio/data/custom-domains/check-cname-mutation.ts b/apps/studio/data/custom-domains/check-cname-mutation.ts index 62bfcaf7de7..5249707314c 100644 --- a/apps/studio/data/custom-domains/check-cname-mutation.ts +++ b/apps/studio/data/custom-domains/check-cname-mutation.ts @@ -1,7 +1,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type CheckCNAMERecordVariables = { domain: string diff --git a/apps/studio/data/custom-domains/custom-domains-activate-mutation.ts b/apps/studio/data/custom-domains/custom-domains-activate-mutation.ts index c0c44d6e52c..091b8e196a3 100644 --- a/apps/studio/data/custom-domains/custom-domains-activate-mutation.ts +++ b/apps/studio/data/custom-domains/custom-domains-activate-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import toast from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { customDomainKeys } from './keys' export type CustomDomainActivateVariables = { diff --git a/apps/studio/data/custom-domains/custom-domains-create-mutation.ts b/apps/studio/data/custom-domains/custom-domains-create-mutation.ts index 816a978b955..b50b0a1bd00 100644 --- a/apps/studio/data/custom-domains/custom-domains-create-mutation.ts +++ b/apps/studio/data/custom-domains/custom-domains-create-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { customDomainKeys } from './keys' export type CustomDomainCreateVariables = { diff --git a/apps/studio/data/custom-domains/custom-domains-delete-mutation.ts b/apps/studio/data/custom-domains/custom-domains-delete-mutation.ts index 615b0a583f9..2285c138304 100644 --- a/apps/studio/data/custom-domains/custom-domains-delete-mutation.ts +++ b/apps/studio/data/custom-domains/custom-domains-delete-mutation.ts @@ -1,7 +1,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { del } from 'data/fetchers' import { toast } from 'react-hot-toast' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { customDomainKeys } from './keys' export type CustomDomainDeleteVariables = { diff --git a/apps/studio/data/custom-domains/custom-domains-query.ts b/apps/studio/data/custom-domains/custom-domains-query.ts index 4a4ea190cbc..1ffd8cd0f8e 100644 --- a/apps/studio/data/custom-domains/custom-domains-query.ts +++ b/apps/studio/data/custom-domains/custom-domains-query.ts @@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get, handleError } from 'data/fetchers' import { IS_PLATFORM } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { customDomainKeys } from './keys' export type CustomDomainsVariables = { diff --git a/apps/studio/data/custom-domains/custom-domains-reverify-mutation.ts b/apps/studio/data/custom-domains/custom-domains-reverify-mutation.ts index a33fe58a6ed..8d7988a2ba1 100644 --- a/apps/studio/data/custom-domains/custom-domains-reverify-mutation.ts +++ b/apps/studio/data/custom-domains/custom-domains-reverify-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { post } from 'data/fetchers' import { toast } from 'react-hot-toast' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { customDomainKeys } from './keys' export type CustomDomainReverifyVariables = { diff --git a/apps/studio/data/database-columns/database-column-create-mutation.ts b/apps/studio/data/database-columns/database-column-create-mutation.ts index 1df9fd8364a..28793eaa760 100644 --- a/apps/studio/data/database-columns/database-column-create-mutation.ts +++ b/apps/studio/data/database-columns/database-column-create-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type CreateColumnBody = components['schemas']['CreateColumnBody'] diff --git a/apps/studio/data/database-columns/database-column-delete-mutation.ts b/apps/studio/data/database-columns/database-column-delete-mutation.ts index e4c9960104a..b067ea240c9 100644 --- a/apps/studio/data/database-columns/database-column-delete-mutation.ts +++ b/apps/studio/data/database-columns/database-column-delete-mutation.ts @@ -2,10 +2,10 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { sqlKeys } from 'data/sql/keys' import { entityTypeKeys } from 'data/entity-types/keys' -import { TableLike } from 'hooks/misc/useTable' +import type { TableLike } from 'hooks/misc/useTable' import { tableKeys } from 'data/tables/keys' import { viewKeys } from 'data/views/keys' diff --git a/apps/studio/data/database-columns/database-column-update-mutation.ts b/apps/studio/data/database-columns/database-column-update-mutation.ts index 01b80d363eb..17ba65de6a5 100644 --- a/apps/studio/data/database-columns/database-column-update-mutation.ts +++ b/apps/studio/data/database-columns/database-column-update-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type UpdateColumnBody = components['schemas']['UpdateColumnBody'] diff --git a/apps/studio/data/database-extensions/database-extension-disable-mutation.ts b/apps/studio/data/database-extensions/database-extension-disable-mutation.ts index 93e0740c124..a1e3d029136 100644 --- a/apps/studio/data/database-extensions/database-extension-disable-mutation.ts +++ b/apps/studio/data/database-extensions/database-extension-disable-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseExtensionsKeys } from './keys' export type DatabaseExtensionDisableVariables = { diff --git a/apps/studio/data/database-extensions/database-extension-enable-mutation.ts b/apps/studio/data/database-extensions/database-extension-enable-mutation.ts index 855426a78bc..4f88ed07992 100644 --- a/apps/studio/data/database-extensions/database-extension-enable-mutation.ts +++ b/apps/studio/data/database-extensions/database-extension-enable-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseExtensionsKeys } from './keys' import { executeSql } from 'data/sql/execute-sql-query' diff --git a/apps/studio/data/database-extensions/database-extensions-query.ts b/apps/studio/data/database-extensions/database-extensions-query.ts index 47b2086eb42..2d57aecf21d 100644 --- a/apps/studio/data/database-extensions/database-extensions-query.ts +++ b/apps/studio/data/database-extensions/database-extensions-query.ts @@ -1,6 +1,6 @@ import { UseQueryOptions, useQuery } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseExtensionsKeys } from './keys' export type DatabaseExtensionsVariables = { diff --git a/apps/studio/data/database-functions/database-functions-create-mutation.ts b/apps/studio/data/database-functions/database-functions-create-mutation.ts index 0e75b1b1101..b43c65ea3ef 100644 --- a/apps/studio/data/database-functions/database-functions-create-mutation.ts +++ b/apps/studio/data/database-functions/database-functions-create-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseFunctionsKeys } from './keys' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' export type DatabaseFunctionCreateVariables = { projectRef: string diff --git a/apps/studio/data/database-functions/database-functions-delete-mutation.ts b/apps/studio/data/database-functions/database-functions-delete-mutation.ts index ff125580ba8..1b6a6c3191e 100644 --- a/apps/studio/data/database-functions/database-functions-delete-mutation.ts +++ b/apps/studio/data/database-functions/database-functions-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseFunctionsKeys } from './keys' export type DatabaseFunctionDeleteVariables = { diff --git a/apps/studio/data/database-functions/database-functions-query.ts b/apps/studio/data/database-functions/database-functions-query.ts index 4f2af0855ed..4e42d9a43c1 100644 --- a/apps/studio/data/database-functions/database-functions-query.ts +++ b/apps/studio/data/database-functions/database-functions-query.ts @@ -1,8 +1,8 @@ import { UseQueryOptions, useQuery } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseFunctionsKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' export type DatabaseFunctionsVariables = { projectRef?: string diff --git a/apps/studio/data/database-functions/database-functions-update-mutation.ts b/apps/studio/data/database-functions/database-functions-update-mutation.ts index ccda983833e..0010303742c 100644 --- a/apps/studio/data/database-functions/database-functions-update-mutation.ts +++ b/apps/studio/data/database-functions/database-functions-update-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseFunctionsKeys } from './keys' export type DatabaseFunctionUpdateVariables = { diff --git a/apps/studio/data/database-policies/database-policies-query.ts b/apps/studio/data/database-policies/database-policies-query.ts index 7245e5af1d1..4dcc3618de8 100644 --- a/apps/studio/data/database-policies/database-policies-query.ts +++ b/apps/studio/data/database-policies/database-policies-query.ts @@ -1,7 +1,7 @@ import { UseQueryOptions, useQuery } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databasePoliciesKeys } from './keys' export type DatabasePoliciesVariables = { diff --git a/apps/studio/data/database-policies/database-policy-create-mutation.ts b/apps/studio/data/database-policies/database-policy-create-mutation.ts index c0eb3a3978f..eb23a4e6117 100644 --- a/apps/studio/data/database-policies/database-policy-create-mutation.ts +++ b/apps/studio/data/database-policies/database-policy-create-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databasePoliciesKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' type CreatePolicyBody = components['schemas']['CreatePolicyBody'] diff --git a/apps/studio/data/database-policies/database-policy-delete-mutation.ts b/apps/studio/data/database-policies/database-policy-delete-mutation.ts index e7de0668589..d312458f630 100644 --- a/apps/studio/data/database-policies/database-policy-delete-mutation.ts +++ b/apps/studio/data/database-policies/database-policy-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databasePoliciesKeys } from './keys' export type DatabasePolicyDeleteVariables = { diff --git a/apps/studio/data/database-policies/database-policy-update-mutation.ts b/apps/studio/data/database-policies/database-policy-update-mutation.ts index 9640784b8a9..6accc7fdc9d 100644 --- a/apps/studio/data/database-policies/database-policy-update-mutation.ts +++ b/apps/studio/data/database-policies/database-policy-update-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databasePoliciesKeys } from './keys' export type DatabasePolicyUpdateVariables = { diff --git a/apps/studio/data/database-publications/database-publications-create-mutation.ts b/apps/studio/data/database-publications/database-publications-create-mutation.ts index 79545fbf589..2945ce701e0 100644 --- a/apps/studio/data/database-publications/database-publications-create-mutation.ts +++ b/apps/studio/data/database-publications/database-publications-create-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databasePublicationsKeys } from './keys' export type DatabasePublicationCreateVariables = { diff --git a/apps/studio/data/database-publications/database-publications-query.ts b/apps/studio/data/database-publications/database-publications-query.ts index 4c4055703f1..72e376d8604 100644 --- a/apps/studio/data/database-publications/database-publications-query.ts +++ b/apps/studio/data/database-publications/database-publications-query.ts @@ -1,6 +1,6 @@ import { UseQueryOptions, useQuery } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databasePublicationsKeys } from './keys' export type DatabasePublicationsVariables = { diff --git a/apps/studio/data/database-publications/database-publications-update-mutation.ts b/apps/studio/data/database-publications/database-publications-update-mutation.ts index 990f15adf85..42f98b61e30 100644 --- a/apps/studio/data/database-publications/database-publications-update-mutation.ts +++ b/apps/studio/data/database-publications/database-publications-update-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databasePublicationsKeys } from './keys' export type DatabasePublicationUpdateVariables = { diff --git a/apps/studio/data/database-roles/database-role-create-mutation.ts b/apps/studio/data/database-roles/database-role-create-mutation.ts index 1d359a7407d..ecaaa44fa47 100644 --- a/apps/studio/data/database-roles/database-role-create-mutation.ts +++ b/apps/studio/data/database-roles/database-role-create-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseRolesKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' type CreateRoleBody = components['schemas']['CreateRoleBody'] diff --git a/apps/studio/data/database-roles/database-role-delete-mutation.ts b/apps/studio/data/database-roles/database-role-delete-mutation.ts index c735da3e9bd..ac0569614ab 100644 --- a/apps/studio/data/database-roles/database-role-delete-mutation.ts +++ b/apps/studio/data/database-roles/database-role-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseRolesKeys } from './keys' export type DatabaseRoleDeleteVariables = { diff --git a/apps/studio/data/database-roles/database-role-update-mutation.ts b/apps/studio/data/database-roles/database-role-update-mutation.ts index f55623e43a8..c8876fb55e7 100644 --- a/apps/studio/data/database-roles/database-role-update-mutation.ts +++ b/apps/studio/data/database-roles/database-role-update-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseRolesKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' type UpdateRoleBody = components['schemas']['UpdateRoleBody'] diff --git a/apps/studio/data/database-roles/database-roles-query.ts b/apps/studio/data/database-roles/database-roles-query.ts index 4c276154d39..fc107b656a2 100644 --- a/apps/studio/data/database-roles/database-roles-query.ts +++ b/apps/studio/data/database-roles/database-roles-query.ts @@ -1,8 +1,8 @@ import { UseQueryOptions, useQuery } from '@tanstack/react-query' -import { PostgresRole } from '@supabase/postgres-meta' +import type { PostgresRole } from '@supabase/postgres-meta' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseRolesKeys } from './keys' export type DatabaseRolesVariables = { diff --git a/apps/studio/data/database-triggers/database-trigger-create-mutation.ts b/apps/studio/data/database-triggers/database-trigger-create-mutation.ts index d20ade72ef7..4b9a819fa26 100644 --- a/apps/studio/data/database-triggers/database-trigger-create-mutation.ts +++ b/apps/studio/data/database-triggers/database-trigger-create-mutation.ts @@ -1,10 +1,10 @@ -import { PostgresTrigger } from '@supabase/postgres-meta' +import type { PostgresTrigger } from '@supabase/postgres-meta' import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseTriggerKeys } from './keys' export type DatabaseTriggerCreateVariables = { diff --git a/apps/studio/data/database-triggers/database-trigger-delete-mutation.ts b/apps/studio/data/database-triggers/database-trigger-delete-mutation.ts index e8d1fce75b5..275b4ed2a66 100644 --- a/apps/studio/data/database-triggers/database-trigger-delete-mutation.ts +++ b/apps/studio/data/database-triggers/database-trigger-delete-mutation.ts @@ -1,11 +1,11 @@ import { toast } from 'react-hot-toast' -import { PostgresTrigger } from '@supabase/postgres-meta' +import type { PostgresTrigger } from '@supabase/postgres-meta' import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { delete_ } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { databaseTriggerKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type DatabaseTriggerDeleteVariables = { id: number diff --git a/apps/studio/data/database-triggers/database-trigger-update-mutation.ts b/apps/studio/data/database-triggers/database-trigger-update-mutation.ts index 7e29c2bf500..77ae421992d 100644 --- a/apps/studio/data/database-triggers/database-trigger-update-mutation.ts +++ b/apps/studio/data/database-triggers/database-trigger-update-mutation.ts @@ -1,10 +1,10 @@ -import { PostgresTrigger } from '@supabase/postgres-meta' +import type { PostgresTrigger } from '@supabase/postgres-meta' import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseTriggerKeys } from './keys' export type DatabaseTriggerUpdateVariables = { diff --git a/apps/studio/data/database-triggers/database-trigger-update-transaction-mutation.ts b/apps/studio/data/database-triggers/database-trigger-update-transaction-mutation.ts index 3f4c1536244..57a5991a455 100644 --- a/apps/studio/data/database-triggers/database-trigger-update-transaction-mutation.ts +++ b/apps/studio/data/database-triggers/database-trigger-update-transaction-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { executeSql } from 'data/sql/execute-sql-query' import { quoteLiteral } from 'lib/pg-format' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseTriggerKeys } from './keys' // [Joshen] Writing this query within FE as the PATCH endpoint from pg-meta only supports updating diff --git a/apps/studio/data/database-triggers/database-triggers-query.ts b/apps/studio/data/database-triggers/database-triggers-query.ts index 8c3202045f2..46fc96cfc2b 100644 --- a/apps/studio/data/database-triggers/database-triggers-query.ts +++ b/apps/studio/data/database-triggers/database-triggers-query.ts @@ -1,9 +1,9 @@ -import { PostgresTrigger } from '@supabase/postgres-meta' +import type { PostgresTrigger } from '@supabase/postgres-meta' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { databaseTriggerKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type DatabaseTriggersVariables = { projectRef?: string diff --git a/apps/studio/data/database/backup-download-mutation.ts b/apps/studio/data/database/backup-download-mutation.ts index 7079cbd6d2b..8c9d4a832b1 100644 --- a/apps/studio/data/database/backup-download-mutation.ts +++ b/apps/studio/data/database/backup-download-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { Backup } from './backup-restore-mutation' export type BackupDownloadVariables = { diff --git a/apps/studio/data/database/backup-restore-mutation.ts b/apps/studio/data/database/backup-restore-mutation.ts index e8f27f9e628..8fb0ff7fb7f 100644 --- a/apps/studio/data/database/backup-restore-mutation.ts +++ b/apps/studio/data/database/backup-restore-mutation.ts @@ -2,8 +2,8 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' -import { components } from 'data/api' +import type { ResponseError } from 'types' +import type { components } from 'data/api' export type BackupRestoreVariables = { ref: string diff --git a/apps/studio/data/database/backups-query.ts b/apps/studio/data/database/backups-query.ts index 95908321674..d2c38ae3555 100644 --- a/apps/studio/data/database/backups-query.ts +++ b/apps/studio/data/database/backups-query.ts @@ -1,9 +1,9 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' export type BackupsVariables = { projectRef?: string diff --git a/apps/studio/data/database/database-password-reset-mutation.ts b/apps/studio/data/database/database-password-reset-mutation.ts index fef0e3c6fb3..832fe483098 100644 --- a/apps/studio/data/database/database-password-reset-mutation.ts +++ b/apps/studio/data/database/database-password-reset-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' import { projectKeys } from 'data/projects/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type DatabasePasswordResetVariables = { ref: string diff --git a/apps/studio/data/database/hooks-enable-mutation.ts b/apps/studio/data/database/hooks-enable-mutation.ts index 6ca08f5090b..504e891968e 100644 --- a/apps/studio/data/database/hooks-enable-mutation.ts +++ b/apps/studio/data/database/hooks-enable-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseKeys } from './keys' export type HooksEnableVariables = { diff --git a/apps/studio/data/database/indexes-query.ts b/apps/studio/data/database/indexes-query.ts index 8ccd8971234..e45702479cc 100644 --- a/apps/studio/data/database/indexes-query.ts +++ b/apps/studio/data/database/indexes-query.ts @@ -1,6 +1,6 @@ import { UseQueryOptions } from '@tanstack/react-query' import { ExecuteSqlData, useExecuteSqlQuery } from '../sql/execute-sql-query' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' // [Joshen] Future refactor to move to pg-meta once available diff --git a/apps/studio/data/database/pitr-restore-mutation.ts b/apps/studio/data/database/pitr-restore-mutation.ts index b94c070e0ad..8089acb85d9 100644 --- a/apps/studio/data/database/pitr-restore-mutation.ts +++ b/apps/studio/data/database/pitr-restore-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type PitrRestoreVariables = { ref: string diff --git a/apps/studio/data/database/pooling-configuration-query.ts b/apps/studio/data/database/pooling-configuration-query.ts index 7e03ccb3cd5..006bcde9676 100644 --- a/apps/studio/data/database/pooling-configuration-query.ts +++ b/apps/studio/data/database/pooling-configuration-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseKeys } from './keys' export type PoolingConfigurationVariables = { diff --git a/apps/studio/data/database/pooling-configuration-update-mutation.ts b/apps/studio/data/database/pooling-configuration-update-mutation.ts index aa0bb1aceb9..96bcc57afff 100644 --- a/apps/studio/data/database/pooling-configuration-update-mutation.ts +++ b/apps/studio/data/database/pooling-configuration-update-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseKeys } from './keys' export type PoolingConfigurationUpdateVariables = { diff --git a/apps/studio/data/database/schema-create-mutation.ts b/apps/studio/data/database/schema-create-mutation.ts index a5519a6e9aa..4bdc1aca4f8 100644 --- a/apps/studio/data/database/schema-create-mutation.ts +++ b/apps/studio/data/database/schema-create-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseKeys } from './keys' export type SchemaCreateVariables = { diff --git a/apps/studio/data/database/schemas-query.ts b/apps/studio/data/database/schemas-query.ts index 926d19a13a1..4fdbf7a1d51 100644 --- a/apps/studio/data/database/schemas-query.ts +++ b/apps/studio/data/database/schemas-query.ts @@ -1,8 +1,8 @@ import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { databaseKeys } from './keys' export type SchemasVariables = { diff --git a/apps/studio/data/documents/document-query.ts b/apps/studio/data/documents/document-query.ts index 708db983b41..a9a674e61fc 100644 --- a/apps/studio/data/documents/document-query.ts +++ b/apps/studio/data/documents/document-query.ts @@ -1,6 +1,6 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { documentKeys } from './keys' export type DocType = 'standard-security-questionnaire' | 'soc2-type-2-report' diff --git a/apps/studio/data/edge-functions/edge-functions-delete-mutation.ts b/apps/studio/data/edge-functions/edge-functions-delete-mutation.ts index c1ec1a32526..eb5c2cb5d49 100644 --- a/apps/studio/data/edge-functions/edge-functions-delete-mutation.ts +++ b/apps/studio/data/edge-functions/edge-functions-delete-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_ADMIN_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { edgeFunctionsKeys } from './keys' export type EdgeFunctionsDeleteVariables = { diff --git a/apps/studio/data/edge-functions/edge-functions-query.ts b/apps/studio/data/edge-functions/edge-functions-query.ts index 2c34d320c9d..6792b10fe92 100644 --- a/apps/studio/data/edge-functions/edge-functions-query.ts +++ b/apps/studio/data/edge-functions/edge-functions-query.ts @@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_ADMIN_URL, IS_PLATFORM } from 'lib/constants' import { edgeFunctionsKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type EdgeFunctionsVariables = { projectRef?: string } diff --git a/apps/studio/data/edge-functions/edge-functions-update-mutation.ts b/apps/studio/data/edge-functions/edge-functions-update-mutation.ts index a77f9d0e3d1..2bd6c09e0b6 100644 --- a/apps/studio/data/edge-functions/edge-functions-update-mutation.ts +++ b/apps/studio/data/edge-functions/edge-functions-update-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_ADMIN_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { edgeFunctionsKeys } from './keys' export type EdgeFunctionsUpdateVariables = { diff --git a/apps/studio/data/entity-types/entity-types-infinite-query.ts b/apps/studio/data/entity-types/entity-types-infinite-query.ts index 8e911e2af3d..f24f0bf96d1 100644 --- a/apps/studio/data/entity-types/entity-types-infinite-query.ts +++ b/apps/studio/data/entity-types/entity-types-infinite-query.ts @@ -1,6 +1,6 @@ import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query' import { executeSql, ExecuteSqlVariables } from 'data/sql/execute-sql-query' -import { Entity } from './entity-type-query' +import type { Entity } from './entity-type-query' import { entityTypeKeys } from './keys' export type EntityTypesVariables = { diff --git a/apps/studio/data/enumerated-types/enumerated-type-create-mutation.ts b/apps/studio/data/enumerated-types/enumerated-type-create-mutation.ts index 29e53e4c136..37fa2323d92 100644 --- a/apps/studio/data/enumerated-types/enumerated-type-create-mutation.ts +++ b/apps/studio/data/enumerated-types/enumerated-type-create-mutation.ts @@ -1,7 +1,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { enumeratedTypesKeys } from './keys' import { executeSql } from 'data/sql/execute-sql-query' import { wrapWithTransaction } from 'data/sql/utils/transaction' diff --git a/apps/studio/data/enumerated-types/enumerated-type-delete-mutation.ts b/apps/studio/data/enumerated-types/enumerated-type-delete-mutation.ts index 7461f6c1e5d..a4cf539aec5 100644 --- a/apps/studio/data/enumerated-types/enumerated-type-delete-mutation.ts +++ b/apps/studio/data/enumerated-types/enumerated-type-delete-mutation.ts @@ -1,7 +1,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { enumeratedTypesKeys } from './keys' import { executeSql } from 'data/sql/execute-sql-query' diff --git a/apps/studio/data/enumerated-types/enumerated-type-update-mutation.ts b/apps/studio/data/enumerated-types/enumerated-type-update-mutation.ts index 6048694212d..037314bcb6e 100644 --- a/apps/studio/data/enumerated-types/enumerated-type-update-mutation.ts +++ b/apps/studio/data/enumerated-types/enumerated-type-update-mutation.ts @@ -1,7 +1,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { enumeratedTypesKeys } from './keys' import { executeSql } from 'data/sql/execute-sql-query' import { wrapWithTransaction } from 'data/sql/utils/transaction' diff --git a/apps/studio/data/enumerated-types/enumerated-types-query.ts b/apps/studio/data/enumerated-types/enumerated-types-query.ts index 942ee05ff1a..f8b9a7cf7ac 100644 --- a/apps/studio/data/enumerated-types/enumerated-types-query.ts +++ b/apps/studio/data/enumerated-types/enumerated-types-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { enumeratedTypesKeys } from './keys' export type EnumeratedTypesVariables = { diff --git a/apps/studio/data/fdw/fdw-create-mutation.ts b/apps/studio/data/fdw/fdw-create-mutation.ts index 046e36754e5..36e936df1a6 100644 --- a/apps/studio/data/fdw/fdw-create-mutation.ts +++ b/apps/studio/data/fdw/fdw-create-mutation.ts @@ -10,7 +10,7 @@ import { executeSql } from 'data/sql/execute-sql-query' import { sqlKeys } from 'data/sql/keys' import { wrapWithTransaction } from 'data/sql/utils/transaction' import { vaultSecretsKeys } from 'data/vault/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { entityTypeKeys } from 'data/entity-types/keys' export type FDWCreateVariables = { diff --git a/apps/studio/data/fdw/fdw-delete-mutation.ts b/apps/studio/data/fdw/fdw-delete-mutation.ts index cd495398a22..9c121f9aa4e 100644 --- a/apps/studio/data/fdw/fdw-delete-mutation.ts +++ b/apps/studio/data/fdw/fdw-delete-mutation.ts @@ -1,13 +1,13 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { WrapperMeta } from 'components/interfaces/Database/Wrappers/Wrappers.types' +import type { WrapperMeta } from 'components/interfaces/Database/Wrappers/Wrappers.types' import { pgSodiumKeys } from 'data/pg-sodium-keys/keys' import { executeSql } from 'data/sql/execute-sql-query' import { sqlKeys } from 'data/sql/keys' import { wrapWithTransaction } from 'data/sql/utils/transaction' import { vaultSecretsKeys } from 'data/vault/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { FDW } from './fdws-query' import { entityTypeKeys } from 'data/entity-types/keys' diff --git a/apps/studio/data/fdw/fdw-update-mutation.ts b/apps/studio/data/fdw/fdw-update-mutation.ts index fd808471af3..9268d6b7dc7 100644 --- a/apps/studio/data/fdw/fdw-update-mutation.ts +++ b/apps/studio/data/fdw/fdw-update-mutation.ts @@ -1,13 +1,13 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { WrapperMeta } from 'components/interfaces/Database/Wrappers/Wrappers.types' +import type { WrapperMeta } from 'components/interfaces/Database/Wrappers/Wrappers.types' import { pgSodiumKeys } from 'data/pg-sodium-keys/keys' import { executeSql } from 'data/sql/execute-sql-query' import { sqlKeys } from 'data/sql/keys' import { wrapWithTransaction } from 'data/sql/utils/transaction' import { vaultSecretsKeys } from 'data/vault/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { getCreateFDWSql } from './fdw-create-mutation' import { getDeleteFDWSql } from './fdw-delete-mutation' import { FDW } from './fdws-query' diff --git a/apps/studio/data/feedback/exit-survey-send.ts b/apps/studio/data/feedback/exit-survey-send.ts index d95a8422356..d710e69d9e0 100644 --- a/apps/studio/data/feedback/exit-survey-send.ts +++ b/apps/studio/data/feedback/exit-survey-send.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type SendDowngradeFeedbackVariables = { projectRef?: string diff --git a/apps/studio/data/feedback/feedback-send.ts b/apps/studio/data/feedback/feedback-send.ts index 969919c3979..6bd5b084e49 100644 --- a/apps/studio/data/feedback/feedback-send.ts +++ b/apps/studio/data/feedback/feedback-send.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import toast from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type SendFeedbackVariables = { message: string diff --git a/apps/studio/data/feedback/support-ticket-send.ts b/apps/studio/data/feedback/support-ticket-send.ts index 334a5faeba8..aa7ad8f6450 100644 --- a/apps/studio/data/feedback/support-ticket-send.ts +++ b/apps/studio/data/feedback/support-ticket-send.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type sendSupportTicketVariables = { subject: string diff --git a/apps/studio/data/fetchers.ts b/apps/studio/data/fetchers.ts index 0799e1a1dcb..88df2a923bb 100644 --- a/apps/studio/data/fetchers.ts +++ b/apps/studio/data/fetchers.ts @@ -2,8 +2,8 @@ import { API_URL, IS_PLATFORM } from 'lib/constants' import { getAccessToken } from 'lib/gotrue' import { uuidv4 } from 'lib/helpers' import createClient from 'openapi-fetch' -import { paths } from './api' // generated from openapi-typescript -import { ResponseError } from 'types' +import type { paths } from './api' // generated from openapi-typescript +import type { ResponseError } from 'types' const DEFAULT_HEADERS = { 'Content-Type': 'application/json', diff --git a/apps/studio/data/foreign-tables/foreign-table-query.ts b/apps/studio/data/foreign-tables/foreign-table-query.ts index 01ac0317ebf..d6e3af3748f 100644 --- a/apps/studio/data/foreign-tables/foreign-table-query.ts +++ b/apps/studio/data/foreign-tables/foreign-table-query.ts @@ -1,4 +1,4 @@ -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' diff --git a/apps/studio/data/integrations/github-authorization-create-mutation.ts b/apps/studio/data/integrations/github-authorization-create-mutation.ts index b7c9d56f2d0..53e73b0f524 100644 --- a/apps/studio/data/integrations/github-authorization-create-mutation.ts +++ b/apps/studio/data/integrations/github-authorization-create-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import toast from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type GitHubAuthorizationCreateVariables = { code: string diff --git a/apps/studio/data/integrations/github-authorization-query.ts b/apps/studio/data/integrations/github-authorization-query.ts index d2be21a104e..03b1846330d 100644 --- a/apps/studio/data/integrations/github-authorization-query.ts +++ b/apps/studio/data/integrations/github-authorization-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { integrationKeys } from './keys' // FIXME(kamil): Do not retry, a single check is fine. diff --git a/apps/studio/data/integrations/github-branch-check-query.ts b/apps/studio/data/integrations/github-branch-check-query.ts index 0c82002e71b..9ac754fe668 100644 --- a/apps/studio/data/integrations/github-branch-check-query.ts +++ b/apps/studio/data/integrations/github-branch-check-query.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type GithubBranchVariables = { connectionId: number diff --git a/apps/studio/data/integrations/github-branches-query.ts b/apps/studio/data/integrations/github-branches-query.ts index 94260616aa9..9b621eab61d 100644 --- a/apps/studio/data/integrations/github-branches-query.ts +++ b/apps/studio/data/integrations/github-branches-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { integrationKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type GitHubBranchesVariables = { connectionId?: number diff --git a/apps/studio/data/integrations/github-connection-create-mutation.ts b/apps/studio/data/integrations/github-connection-create-mutation.ts index 62a494ed2e1..569827c5f5e 100644 --- a/apps/studio/data/integrations/github-connection-create-mutation.ts +++ b/apps/studio/data/integrations/github-connection-create-mutation.ts @@ -2,8 +2,8 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' -import { GitHubConnectionCreateVariables } from './integrations.types' +import type { ResponseError } from 'types' +import type { GitHubConnectionCreateVariables } from './integrations.types' import { integrationKeys } from './keys' export async function createGitHubConnection({ connection }: GitHubConnectionCreateVariables) { diff --git a/apps/studio/data/integrations/github-connection-delete-mutation.ts b/apps/studio/data/integrations/github-connection-delete-mutation.ts index d6fc6067e10..85c59938212 100644 --- a/apps/studio/data/integrations/github-connection-delete-mutation.ts +++ b/apps/studio/data/integrations/github-connection-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { integrationKeys } from './keys' type DeleteVariables = { diff --git a/apps/studio/data/integrations/github-connection-update-mutation.ts b/apps/studio/data/integrations/github-connection-update-mutation.ts index 3af0320f8ea..9424cdd73c4 100644 --- a/apps/studio/data/integrations/github-connection-update-mutation.ts +++ b/apps/studio/data/integrations/github-connection-update-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { integrationKeys } from './keys' type UpdateVariables = { diff --git a/apps/studio/data/integrations/github-connections-query.ts b/apps/studio/data/integrations/github-connections-query.ts index ef491049153..638445d0297 100644 --- a/apps/studio/data/integrations/github-connections-query.ts +++ b/apps/studio/data/integrations/github-connections-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { integrationKeys } from './keys' export type GitHubConnectionsVariables = { diff --git a/apps/studio/data/integrations/github-pull-requests-query.ts b/apps/studio/data/integrations/github-pull-requests-query.ts index 76345211bdc..6adfbeaa95d 100644 --- a/apps/studio/data/integrations/github-pull-requests-query.ts +++ b/apps/studio/data/integrations/github-pull-requests-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { integrationKeys } from './keys' -import { ResponseError } from 'types' -import { components } from 'data/api' +import type { ResponseError } from 'types' +import type { components } from 'data/api' export type GitHubPullRequestsVariables = { connectionId?: number diff --git a/apps/studio/data/integrations/github-repositories-query.ts b/apps/studio/data/integrations/github-repositories-query.ts index 07fc7ad3c9b..d03f7d06448 100644 --- a/apps/studio/data/integrations/github-repositories-query.ts +++ b/apps/studio/data/integrations/github-repositories-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { integrationKeys } from './keys' export async function getGitHubRepositories(signal?: AbortSignal) { diff --git a/apps/studio/data/integrations/integrations-query-org-only.ts b/apps/studio/data/integrations/integrations-query-org-only.ts index 926897a5dba..93872903086 100644 --- a/apps/studio/data/integrations/integrations-query-org-only.ts +++ b/apps/studio/data/integrations/integrations-query-org-only.ts @@ -2,8 +2,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' -import { Integration, IntegrationsVariables } from './integrations.types' +import type { ResponseError } from 'types' +import type { Integration, IntegrationsVariables } from './integrations.types' import { integrationKeys } from './keys' export type IntegrationsResponse = Integration[] diff --git a/apps/studio/data/integrations/integrations-query.ts b/apps/studio/data/integrations/integrations-query.ts index 9ec6b5a0353..cae79239865 100644 --- a/apps/studio/data/integrations/integrations-query.ts +++ b/apps/studio/data/integrations/integrations-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { integrationKeys } from './keys' export async function getIntegrations(signal?: AbortSignal) { diff --git a/apps/studio/data/integrations/integrations-vercel-connection-sync-envs-mutation.ts b/apps/studio/data/integrations/integrations-vercel-connection-sync-envs-mutation.ts index 78240f76f43..ebd690f9908 100644 --- a/apps/studio/data/integrations/integrations-vercel-connection-sync-envs-mutation.ts +++ b/apps/studio/data/integrations/integrations-vercel-connection-sync-envs-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type IntegrationsVercelConnectionSyncEnvsVariables = { connectionId: string diff --git a/apps/studio/data/integrations/integrations-vercel-connections-create-mutation.ts b/apps/studio/data/integrations/integrations-vercel-connections-create-mutation.ts index 7a4ab1b9bca..21f9050ddb7 100644 --- a/apps/studio/data/integrations/integrations-vercel-connections-create-mutation.ts +++ b/apps/studio/data/integrations/integrations-vercel-connections-create-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { integrationKeys } from './keys' -import { IntegrationConnectionsCreateVariables } from './integrations.types' +import type { IntegrationConnectionsCreateVariables } from './integrations.types' import { useIntegrationInstallationSnapshot } from 'state/integration-installation' export async function createIntegrationVercelConnections({ diff --git a/apps/studio/data/integrations/integrations-vercel-installed-connection-delete-mutation.ts b/apps/studio/data/integrations/integrations-vercel-installed-connection-delete-mutation.ts index 9a8de1036ba..c7a5d1b1ec0 100644 --- a/apps/studio/data/integrations/integrations-vercel-installed-connection-delete-mutation.ts +++ b/apps/studio/data/integrations/integrations-vercel-installed-connection-delete-mutation.ts @@ -1,7 +1,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { delete_, isResponseOk } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError, UserContent } from 'types' +import type { ResponseError, UserContent } from 'types' import { integrationKeys } from './keys' import { toast } from 'react-hot-toast' diff --git a/apps/studio/data/integrations/integrations-vercel-projects-query.ts b/apps/studio/data/integrations/integrations-vercel-projects-query.ts index 5f21333cbc7..a7568f0539a 100644 --- a/apps/studio/data/integrations/integrations-vercel-projects-query.ts +++ b/apps/studio/data/integrations/integrations-vercel-projects-query.ts @@ -1,7 +1,7 @@ import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { useCallback } from 'react' -import { VercelFramework } from './integrations.types' +import type { VercelFramework } from './integrations.types' import { integrationKeys } from './keys' export type VercelProjectsVariables = { diff --git a/apps/studio/data/integrations/integrations.types.ts b/apps/studio/data/integrations/integrations.types.ts index efd87d3f4f6..844b531a735 100644 --- a/apps/studio/data/integrations/integrations.types.ts +++ b/apps/studio/data/integrations/integrations.types.ts @@ -1,4 +1,4 @@ -import { components } from 'data/api' +import type { components } from 'data/api' export type VercelFramework = | ( diff --git a/apps/studio/data/integrations/vercel-connection-update-mutate.ts b/apps/studio/data/integrations/vercel-connection-update-mutate.ts index 0f48971a7df..89194cf0288 100644 --- a/apps/studio/data/integrations/vercel-connection-update-mutate.ts +++ b/apps/studio/data/integrations/vercel-connection-update-mutate.ts @@ -2,8 +2,8 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' -import { UpdateConnectionPayload } from './integrations.types' +import type { ResponseError } from 'types' +import type { UpdateConnectionPayload } from './integrations.types' import { integrationKeys } from './keys' export async function updateVercelConnection({ diff --git a/apps/studio/data/integrations/vercel-integration-create-mutation.ts b/apps/studio/data/integrations/vercel-integration-create-mutation.ts index 15c7b7966e9..6798d5b4a24 100644 --- a/apps/studio/data/integrations/vercel-integration-create-mutation.ts +++ b/apps/studio/data/integrations/vercel-integration-create-mutation.ts @@ -3,7 +3,7 @@ import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { integrationKeys } from './keys' import { toast } from 'react-hot-toast' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type VercelIntegrationCreateVariables = { code: string diff --git a/apps/studio/data/invoices/invoice-query.ts b/apps/studio/data/invoices/invoice-query.ts index e1ff6e23fd5..3ad78d6d1db 100644 --- a/apps/studio/data/invoices/invoice-query.ts +++ b/apps/studio/data/invoices/invoice-query.ts @@ -1,6 +1,6 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { invoicesKeys } from './keys' export type InvoiceVariables = { diff --git a/apps/studio/data/invoices/invoices-count-query.ts b/apps/studio/data/invoices/invoices-count-query.ts index 241ff0c5341..f301925b87d 100644 --- a/apps/studio/data/invoices/invoices-count-query.ts +++ b/apps/studio/data/invoices/invoices-count-query.ts @@ -1,6 +1,6 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { head } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { invoicesKeys } from './keys' export type InvoicesCountVariables = { diff --git a/apps/studio/data/invoices/invoices-overdue-query.ts b/apps/studio/data/invoices/invoices-overdue-query.ts index a34b563e09f..a5597c76e1d 100644 --- a/apps/studio/data/invoices/invoices-overdue-query.ts +++ b/apps/studio/data/invoices/invoices-overdue-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { invoicesKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' export type OverdueInvoicesResponse = components['schemas']['OverdueInvoiceCount'] diff --git a/apps/studio/data/invoices/invoices-query.ts b/apps/studio/data/invoices/invoices-query.ts index 617fd32b6a3..f6248b0827b 100644 --- a/apps/studio/data/invoices/invoices-query.ts +++ b/apps/studio/data/invoices/invoices-query.ts @@ -1,6 +1,6 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { invoicesKeys } from './keys' export type InvoicesVariables = { diff --git a/apps/studio/data/invoices/org-invoice-upcoming-query.ts b/apps/studio/data/invoices/org-invoice-upcoming-query.ts index 8d39a183fc3..cc6533fbcd1 100644 --- a/apps/studio/data/invoices/org-invoice-upcoming-query.ts +++ b/apps/studio/data/invoices/org-invoice-upcoming-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { invoicesKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { PricingMetric } from 'data/analytics/org-daily-stats-query' export type UpcomingInvoiceVariables = { diff --git a/apps/studio/data/materialized-views/materialized-view-query.ts b/apps/studio/data/materialized-views/materialized-view-query.ts index b718d8dbe83..0b714667b9b 100644 --- a/apps/studio/data/materialized-views/materialized-view-query.ts +++ b/apps/studio/data/materialized-views/materialized-view-query.ts @@ -1,4 +1,4 @@ -import { PostgresMaterializedView } from '@supabase/postgres-meta' +import type { PostgresMaterializedView } from '@supabase/postgres-meta' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' diff --git a/apps/studio/data/misc/get-default-region-query.ts b/apps/studio/data/misc/get-default-region-query.ts index fb5c623eaf2..31b0fbd20d5 100644 --- a/apps/studio/data/misc/get-default-region-query.ts +++ b/apps/studio/data/misc/get-default-region-query.ts @@ -1,6 +1,6 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { miscKeys } from './keys' import { COUNTRY_LAT_LON } from 'components/interfaces/ProjectCreation/ProjectCreation.constants' import { getDistanceLatLonKM } from 'lib/helpers' diff --git a/apps/studio/data/misc/reset-password-mutation.ts b/apps/studio/data/misc/reset-password-mutation.ts index c9f1e6cbb12..f4b4de7e327 100644 --- a/apps/studio/data/misc/reset-password-mutation.ts +++ b/apps/studio/data/misc/reset-password-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ResetPasswordVariables = { email: string diff --git a/apps/studio/data/misc/signup-mutation.ts b/apps/studio/data/misc/signup-mutation.ts index d056c3cbc21..4713a950cdb 100644 --- a/apps/studio/data/misc/signup-mutation.ts +++ b/apps/studio/data/misc/signup-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type SignUpVariables = { email: string diff --git a/apps/studio/data/network-restrictions/network-retrictions-apply-mutation.ts b/apps/studio/data/network-restrictions/network-retrictions-apply-mutation.ts index 455594126ad..52b93336630 100644 --- a/apps/studio/data/network-restrictions/network-retrictions-apply-mutation.ts +++ b/apps/studio/data/network-restrictions/network-retrictions-apply-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { networkRestrictionKeys } from './keys' export type NetworkRestrictionsApplyVariables = { diff --git a/apps/studio/data/notifications/notifications-dismiss-mutation.ts b/apps/studio/data/notifications/notifications-dismiss-mutation.ts index 81f5e2c8b61..f7d4c9c7349 100644 --- a/apps/studio/data/notifications/notifications-dismiss-mutation.ts +++ b/apps/studio/data/notifications/notifications-dismiss-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { notificationKeys } from './keys' export type NotificationsDismissVariables = { diff --git a/apps/studio/data/notifications/notifications-query.ts b/apps/studio/data/notifications/notifications-query.ts index 031ba399f68..052cd4ae473 100644 --- a/apps/studio/data/notifications/notifications-query.ts +++ b/apps/studio/data/notifications/notifications-query.ts @@ -1,4 +1,4 @@ -import { Notification } from '@supabase/shared-types/out/notifications' +import type { Notification } from '@supabase/shared-types/out/notifications' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' diff --git a/apps/studio/data/notifications/notifications-update-mutation.ts b/apps/studio/data/notifications/notifications-update-mutation.ts index 88fa96b24c1..e601f8ba38c 100644 --- a/apps/studio/data/notifications/notifications-update-mutation.ts +++ b/apps/studio/data/notifications/notifications-update-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { notificationKeys } from './keys' export type NotificationsUpdateVariables = { diff --git a/apps/studio/data/notifications/notifications-v2-archive-all-mutation.ts b/apps/studio/data/notifications/notifications-v2-archive-all-mutation.ts index 02d0a507551..a8401911315 100644 --- a/apps/studio/data/notifications/notifications-v2-archive-all-mutation.ts +++ b/apps/studio/data/notifications/notifications-v2-archive-all-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { notificationKeys } from './keys' export async function archiveAllNotifications() { diff --git a/apps/studio/data/notifications/notifications-v2-query.ts b/apps/studio/data/notifications/notifications-v2-query.ts index 9df9b8e5412..669400d4faa 100644 --- a/apps/studio/data/notifications/notifications-v2-query.ts +++ b/apps/studio/data/notifications/notifications-v2-query.ts @@ -1,8 +1,8 @@ import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { components } from 'data/api' -import { ResponseError } from 'types' +import type { components } from 'data/api' +import type { ResponseError } from 'types' import { notificationKeys } from './keys' const NOTIFICATIONS_PAGE_LIMIT = 10 diff --git a/apps/studio/data/notifications/notifications-v2-summary-query.ts b/apps/studio/data/notifications/notifications-v2-summary-query.ts index 8cf0b4ed091..8204845afb4 100644 --- a/apps/studio/data/notifications/notifications-v2-summary-query.ts +++ b/apps/studio/data/notifications/notifications-v2-summary-query.ts @@ -1,8 +1,8 @@ -import { Notification } from '@supabase/shared-types/out/notifications' +import type { Notification } from '@supabase/shared-types/out/notifications' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { notificationKeys } from './keys' export type NotificationsResponse = Notification[] diff --git a/apps/studio/data/notifications/notifications-v2-update-mutation.ts b/apps/studio/data/notifications/notifications-v2-update-mutation.ts index f8269138cf8..4ed3818a37e 100644 --- a/apps/studio/data/notifications/notifications-v2-update-mutation.ts +++ b/apps/studio/data/notifications/notifications-v2-update-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type NotificationsUpdateVariables = { ids: string[] diff --git a/apps/studio/data/oauth/authorized-app-revoke-mutation.ts b/apps/studio/data/oauth/authorized-app-revoke-mutation.ts index 304b58bbd6d..11fb114586b 100644 --- a/apps/studio/data/oauth/authorized-app-revoke-mutation.ts +++ b/apps/studio/data/oauth/authorized-app-revoke-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { oauthAppKeys } from './keys' export type AuthorizedAppRevokeVariables = { diff --git a/apps/studio/data/oauth/authorized-apps-query.ts b/apps/studio/data/oauth/authorized-apps-query.ts index b35995693a8..fcf8f11cf0d 100644 --- a/apps/studio/data/oauth/authorized-apps-query.ts +++ b/apps/studio/data/oauth/authorized-apps-query.ts @@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { oauthAppKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type AuthorizedAppsVariables = { slug?: string diff --git a/apps/studio/data/oauth/oauth-app-create-mutation.ts b/apps/studio/data/oauth/oauth-app-create-mutation.ts index ae71bad9e47..d47deb1f7bc 100644 --- a/apps/studio/data/oauth/oauth-app-create-mutation.ts +++ b/apps/studio/data/oauth/oauth-app-create-mutation.ts @@ -1,10 +1,10 @@ -import { OAuthScope } from '@supabase/shared-types/out/constants' +import type { OAuthScope } from '@supabase/shared-types/out/constants' import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { oauthAppKeys } from './keys' export type OAuthAppCreateVariables = { diff --git a/apps/studio/data/oauth/oauth-app-delete-mutation.ts b/apps/studio/data/oauth/oauth-app-delete-mutation.ts index 94d982a7109..471a93f11c8 100644 --- a/apps/studio/data/oauth/oauth-app-delete-mutation.ts +++ b/apps/studio/data/oauth/oauth-app-delete-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { oauthAppKeys } from './keys' export type OAuthAppDeleteVariables = { diff --git a/apps/studio/data/oauth/oauth-app-update-mutation.ts b/apps/studio/data/oauth/oauth-app-update-mutation.ts index ddd4ac6af18..8b2513bfc0c 100644 --- a/apps/studio/data/oauth/oauth-app-update-mutation.ts +++ b/apps/studio/data/oauth/oauth-app-update-mutation.ts @@ -1,10 +1,10 @@ -import { OAuthScope } from '@supabase/shared-types/out/constants' +import type { OAuthScope } from '@supabase/shared-types/out/constants' import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { put } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { oauthAppKeys } from './keys' export type OAuthAppUpdateVariables = { diff --git a/apps/studio/data/oauth/oauth-apps-query.ts b/apps/studio/data/oauth/oauth-apps-query.ts index 3a30e47d489..63ea17efcd4 100644 --- a/apps/studio/data/oauth/oauth-apps-query.ts +++ b/apps/studio/data/oauth/oauth-apps-query.ts @@ -1,8 +1,8 @@ -import { OAuthScope } from '@supabase/shared-types/out/constants' +import type { OAuthScope } from '@supabase/shared-types/out/constants' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { oauthAppKeys } from './keys' export type OAuthAppsVariables = { diff --git a/apps/studio/data/open-api/api-spec-query.ts b/apps/studio/data/open-api/api-spec-query.ts index 489746e2b21..bbb362f2f59 100644 --- a/apps/studio/data/open-api/api-spec-query.ts +++ b/apps/studio/data/open-api/api-spec-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { openApiKeys } from './keys' export type OpenAPISpecVariables = { diff --git a/apps/studio/data/organizations/free-project-limit-check-query.ts b/apps/studio/data/organizations/free-project-limit-check-query.ts index bce36e2e6b3..8f7a46f9a90 100644 --- a/apps/studio/data/organizations/free-project-limit-check-query.ts +++ b/apps/studio/data/organizations/free-project-limit-check-query.ts @@ -1,7 +1,6 @@ -import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query' +import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { useCallback } from 'react' import { organizationKeys } from './keys' export type MemberWithFreeProjectLimit = { diff --git a/apps/studio/data/organizations/organization-audit-logs-query.ts b/apps/studio/data/organizations/organization-audit-logs-query.ts index 269419e97bd..0c3a63c76a7 100644 --- a/apps/studio/data/organizations/organization-audit-logs-query.ts +++ b/apps/studio/data/organizations/organization-audit-logs-query.ts @@ -3,7 +3,7 @@ import dayjs from 'dayjs' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type AuditLog = { diff --git a/apps/studio/data/organizations/organization-billing-subscription-preview.ts b/apps/studio/data/organizations/organization-billing-subscription-preview.ts index 93d23d6133a..3d2ba7a852b 100644 --- a/apps/studio/data/organizations/organization-billing-subscription-preview.ts +++ b/apps/studio/data/organizations/organization-billing-subscription-preview.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { post } from 'data/fetchers' import { organizationKeys } from './keys' -import { ResponseError } from 'types' -import { SubscriptionTier } from 'data/subscriptions/types' +import type { ResponseError } from 'types' +import type { SubscriptionTier } from 'data/subscriptions/types' export type OrganizationBillingSubscriptionPreviewVariables = { organizationSlug?: string diff --git a/apps/studio/data/organizations/organization-by-fly-organization-id-mutation.ts b/apps/studio/data/organizations/organization-by-fly-organization-id-mutation.ts index e8525103870..9e171d74c85 100644 --- a/apps/studio/data/organizations/organization-by-fly-organization-id-mutation.ts +++ b/apps/studio/data/organizations/organization-by-fly-organization-id-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import toast from 'react-hot-toast' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrganizationByFlyOrgIdVariables = { flyOrganizationId: string diff --git a/apps/studio/data/organizations/organization-create-mutation.ts b/apps/studio/data/organizations/organization-create-mutation.ts index 40966f240ee..daa82c1e998 100644 --- a/apps/studio/data/organizations/organization-create-mutation.ts +++ b/apps/studio/data/organizations/organization-create-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' import { permissionKeys } from 'data/permissions/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationCreateVariables = { diff --git a/apps/studio/data/organizations/organization-customer-profile-query.ts b/apps/studio/data/organizations/organization-customer-profile-query.ts index a5719b52316..63bf11ab89e 100644 --- a/apps/studio/data/organizations/organization-customer-profile-query.ts +++ b/apps/studio/data/organizations/organization-customer-profile-query.ts @@ -1,9 +1,8 @@ -import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query' +import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { useCallback } from 'react' import { organizationKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrganizationCustomerProfileVariables = { slug?: string diff --git a/apps/studio/data/organizations/organization-customer-profile-update-mutation.ts b/apps/studio/data/organizations/organization-customer-profile-update-mutation.ts index 47f3cd7a942..c03b3d5a134 100644 --- a/apps/studio/data/organizations/organization-customer-profile-update-mutation.ts +++ b/apps/studio/data/organizations/organization-customer-profile-update-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationCustomerProfileUpdateVariables = { diff --git a/apps/studio/data/organizations/organization-delete-mutation.ts b/apps/studio/data/organizations/organization-delete-mutation.ts index db4af223347..e075389270e 100644 --- a/apps/studio/data/organizations/organization-delete-mutation.ts +++ b/apps/studio/data/organizations/organization-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' import { permissionKeys } from 'data/permissions/keys' diff --git a/apps/studio/data/organizations/organization-join-decline-mutation.ts b/apps/studio/data/organizations/organization-join-decline-mutation.ts index 480bcd1a57e..397ceeb0cad 100644 --- a/apps/studio/data/organizations/organization-join-decline-mutation.ts +++ b/apps/studio/data/organizations/organization-join-decline-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrganizationJoinDeclineVariables = { slug: string diff --git a/apps/studio/data/organizations/organization-join-mutation.ts b/apps/studio/data/organizations/organization-join-mutation.ts index 0a7c407e69c..3f07c2d4757 100644 --- a/apps/studio/data/organizations/organization-join-mutation.ts +++ b/apps/studio/data/organizations/organization-join-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationJoinVariables = { diff --git a/apps/studio/data/organizations/organization-join-token-validation-query.ts b/apps/studio/data/organizations/organization-join-token-validation-query.ts index 09c7af60ccd..cbc28c9d778 100644 --- a/apps/studio/data/organizations/organization-join-token-validation-query.ts +++ b/apps/studio/data/organizations/organization-join-token-validation-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { components } from 'data/api' -import { ResponseError } from 'types' +import type { components } from 'data/api' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationJoinTokenValidationVariables = { diff --git a/apps/studio/data/organizations/organization-member-delete-mutation.ts b/apps/studio/data/organizations/organization-member-delete-mutation.ts index 9c7092b6222..cc888e9787b 100644 --- a/apps/studio/data/organizations/organization-member-delete-mutation.ts +++ b/apps/studio/data/organizations/organization-member-delete-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationMemberDeleteVariables = { diff --git a/apps/studio/data/organizations/organization-member-invite-create-mutation.ts b/apps/studio/data/organizations/organization-member-invite-create-mutation.ts index d9534743384..487c8b0ae44 100644 --- a/apps/studio/data/organizations/organization-member-invite-create-mutation.ts +++ b/apps/studio/data/organizations/organization-member-invite-create-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationMemberInviteCreateVariables = { diff --git a/apps/studio/data/organizations/organization-member-invite-delete-mutation.ts b/apps/studio/data/organizations/organization-member-invite-delete-mutation.ts index 97ffcb9d626..41a640feb65 100644 --- a/apps/studio/data/organizations/organization-member-invite-delete-mutation.ts +++ b/apps/studio/data/organizations/organization-member-invite-delete-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationMemberInviteDeleteVariables = { diff --git a/apps/studio/data/organizations/organization-member-update-mutation.ts b/apps/studio/data/organizations/organization-member-update-mutation.ts index 15181506d5e..58f6fa7b0b2 100644 --- a/apps/studio/data/organizations/organization-member-update-mutation.ts +++ b/apps/studio/data/organizations/organization-member-update-mutation.ts @@ -3,7 +3,7 @@ import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { organizationKeys } from './keys' import { toast } from 'react-hot-toast' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrganizationMemberUpdateVariables = { slug: string diff --git a/apps/studio/data/organizations/organization-members-query.ts b/apps/studio/data/organizations/organization-members-query.ts index bb7d124e428..581f0a2dd50 100644 --- a/apps/studio/data/organizations/organization-members-query.ts +++ b/apps/studio/data/organizations/organization-members-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationMembersVariables = { diff --git a/apps/studio/data/organizations/organization-payment-method-delete-mutation.ts b/apps/studio/data/organizations/organization-payment-method-delete-mutation.ts index 34d8181755d..ce3bf220dc1 100644 --- a/apps/studio/data/organizations/organization-payment-method-delete-mutation.ts +++ b/apps/studio/data/organizations/organization-payment-method-delete-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' export type OrganizationPaymentMethodDeleteVariables = { diff --git a/apps/studio/data/organizations/organization-payment-method-setup-intent-mutation.ts b/apps/studio/data/organizations/organization-payment-method-setup-intent-mutation.ts index e442afa877f..d6f581f32ca 100644 --- a/apps/studio/data/organizations/organization-payment-method-setup-intent-mutation.ts +++ b/apps/studio/data/organizations/organization-payment-method-setup-intent-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrganizationPaymentMethodSetupIntentVariables = { slug: string diff --git a/apps/studio/data/organizations/organization-payment-methods-query.ts b/apps/studio/data/organizations/organization-payment-methods-query.ts index 1632feff6c4..2ab0d9ca69f 100644 --- a/apps/studio/data/organizations/organization-payment-methods-query.ts +++ b/apps/studio/data/organizations/organization-payment-methods-query.ts @@ -1,9 +1,8 @@ -import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query' +import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { useCallback } from 'react' import { organizationKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrganizationPaymentMethodsVariables = { slug?: string } export type OrganizationPaymentMethod = { diff --git a/apps/studio/data/organizations/organization-roles-query.ts b/apps/studio/data/organizations/organization-roles-query.ts index 5079dcb0f4b..517d6359386 100644 --- a/apps/studio/data/organizations/organization-roles-query.ts +++ b/apps/studio/data/organizations/organization-roles-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError, Role } from 'types' +import type { ResponseError, Role } from 'types' import { organizationKeys } from './keys' export type OrganizationRolesVariables = { diff --git a/apps/studio/data/organizations/organization-tax-ids-query.ts b/apps/studio/data/organizations/organization-tax-ids-query.ts index df39b05b599..8b650ef6089 100644 --- a/apps/studio/data/organizations/organization-tax-ids-query.ts +++ b/apps/studio/data/organizations/organization-tax-ids-query.ts @@ -3,7 +3,7 @@ import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { useCallback } from 'react' import { organizationKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrganizationTaxIDsVariables = { slug?: string diff --git a/apps/studio/data/organizations/organization-tax-ids-update-mutation.ts b/apps/studio/data/organizations/organization-tax-ids-update-mutation.ts index 69153bdd356..9a87e5b4c3a 100644 --- a/apps/studio/data/organizations/organization-tax-ids-update-mutation.ts +++ b/apps/studio/data/organizations/organization-tax-ids-update-mutation.ts @@ -3,9 +3,9 @@ import { toast } from 'react-hot-toast' import { delete_, post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' -import { TaxId } from './organization-tax-ids-query' +import type { TaxId } from './organization-tax-ids-query' export interface TaxIdValue { id: string diff --git a/apps/studio/data/organizations/organization-update-mutation.ts b/apps/studio/data/organizations/organization-update-mutation.ts index 7550c0637da..b89d3ac700c 100644 --- a/apps/studio/data/organizations/organization-update-mutation.ts +++ b/apps/studio/data/organizations/organization-update-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { organizationKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' export type OrganizationUpdateVariables = { slug: string diff --git a/apps/studio/data/organizations/organizations-query.ts b/apps/studio/data/organizations/organizations-query.ts index be097cd02e5..5d081a9d91f 100644 --- a/apps/studio/data/organizations/organizations-query.ts +++ b/apps/studio/data/organizations/organizations-query.ts @@ -2,7 +2,7 @@ import { QueryClient, useQuery, useQueryClient, UseQueryOptions } from '@tanstac import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' import { useCallback } from 'react' -import { Organization, ResponseError } from 'types' +import type { Organization, ResponseError } from 'types' import { organizationKeys } from './keys' export async function getOrganizations(signal?: AbortSignal): Promise { diff --git a/apps/studio/data/permissions/permissions-query.ts b/apps/studio/data/permissions/permissions-query.ts index 6d685c87c49..e247de4f916 100644 --- a/apps/studio/data/permissions/permissions-query.ts +++ b/apps/studio/data/permissions/permissions-query.ts @@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL, IS_PLATFORM } from 'lib/constants' -import { Permission, ResponseError } from 'types' +import type { Permission, ResponseError } from 'types' import { permissionKeys } from './keys' export type PermissionsResponse = Permission[] diff --git a/apps/studio/data/pg-sodium-keys/pg-sodium-key-create-mutation.ts b/apps/studio/data/pg-sodium-keys/pg-sodium-key-create-mutation.ts index 930e32af5de..0bb24027091 100644 --- a/apps/studio/data/pg-sodium-keys/pg-sodium-key-create-mutation.ts +++ b/apps/studio/data/pg-sodium-keys/pg-sodium-key-create-mutation.ts @@ -2,8 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import toast from 'react-hot-toast' import { executeSql } from 'data/sql/execute-sql-query' -import { sqlKeys } from 'data/sql/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { pgSodiumKeys } from './keys' export type CreateEncryptionKeyVariables = { diff --git a/apps/studio/data/pg-sodium-keys/pg-sodium-key-delete-mutation.ts b/apps/studio/data/pg-sodium-keys/pg-sodium-key-delete-mutation.ts index a5bdac551d7..e6dfb8cfc0c 100644 --- a/apps/studio/data/pg-sodium-keys/pg-sodium-key-delete-mutation.ts +++ b/apps/studio/data/pg-sodium-keys/pg-sodium-key-delete-mutation.ts @@ -3,9 +3,8 @@ import toast from 'react-hot-toast' import { Query } from 'components/grid/query/Query' import { executeSql } from 'data/sql/execute-sql-query' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { pgSodiumKeys } from './keys' -import { sqlKeys } from 'data/sql/keys' export type VaultSecretDeleteVariables = { projectRef: string diff --git a/apps/studio/data/privileges/column-privileges-grant-mutation.ts b/apps/studio/data/privileges/column-privileges-grant-mutation.ts index d068d9a0cff..54c551ea636 100644 --- a/apps/studio/data/privileges/column-privileges-grant-mutation.ts +++ b/apps/studio/data/privileges/column-privileges-grant-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { privilegeKeys } from './keys' export type ColumnPrivilegesGrant = components['schemas']['GrantColumnPrivilegesBody'] diff --git a/apps/studio/data/privileges/column-privileges-query.ts b/apps/studio/data/privileges/column-privileges-query.ts index e2e69eda20f..06b4242489d 100644 --- a/apps/studio/data/privileges/column-privileges-query.ts +++ b/apps/studio/data/privileges/column-privileges-query.ts @@ -1,9 +1,9 @@ import { UseQueryOptions, useQuery } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { privilegeKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' export type ColumnPrivilegesVariables = { projectRef?: string diff --git a/apps/studio/data/privileges/column-privileges-revoke-mutation.ts b/apps/studio/data/privileges/column-privileges-revoke-mutation.ts index 71ebaa7e9b7..5a2bd2d0e51 100644 --- a/apps/studio/data/privileges/column-privileges-revoke-mutation.ts +++ b/apps/studio/data/privileges/column-privileges-revoke-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { privilegeKeys } from './keys' export type ColumnPrivilegesRevoke = components['schemas']['RevokeColumnPrivilegesBody'] diff --git a/apps/studio/data/privileges/table-privileges-grant-mutation.ts b/apps/studio/data/privileges/table-privileges-grant-mutation.ts index 1865b497d13..a609b0f6ffb 100644 --- a/apps/studio/data/privileges/table-privileges-grant-mutation.ts +++ b/apps/studio/data/privileges/table-privileges-grant-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { privilegeKeys } from './keys' export type TablePrivilegesGrant = components['schemas']['GrantTablePrivilegesBody'] diff --git a/apps/studio/data/privileges/table-privileges-query.ts b/apps/studio/data/privileges/table-privileges-query.ts index 0d7572f732d..1e025e6d3db 100644 --- a/apps/studio/data/privileges/table-privileges-query.ts +++ b/apps/studio/data/privileges/table-privileges-query.ts @@ -1,8 +1,8 @@ import { UseQueryOptions, useQuery } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { privilegeKeys } from './keys' export type TablePrivilegesVariables = { diff --git a/apps/studio/data/privileges/table-privileges-revoke-mutation.ts b/apps/studio/data/privileges/table-privileges-revoke-mutation.ts index 337800c5c62..ae352fbb808 100644 --- a/apps/studio/data/privileges/table-privileges-revoke-mutation.ts +++ b/apps/studio/data/privileges/table-privileges-revoke-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { privilegeKeys } from './keys' export type TablePrivilegesRevoke = components['schemas']['RevokeTablePrivilegesBody'] diff --git a/apps/studio/data/profile/mfa-authenticator-assurance-level-query.ts b/apps/studio/data/profile/mfa-authenticator-assurance-level-query.ts index d0d5c440e35..ad093941f40 100644 --- a/apps/studio/data/profile/mfa-authenticator-assurance-level-query.ts +++ b/apps/studio/data/profile/mfa-authenticator-assurance-level-query.ts @@ -1,8 +1,8 @@ -import { AuthMFAGetAuthenticatorAssuranceLevelResponse } from '@supabase/supabase-js' +import type { AuthMFAGetAuthenticatorAssuranceLevelResponse } from '@supabase/supabase-js' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { auth } from 'lib/gotrue' import { profileKeys } from './keys' -import { Profile } from './types' +import type { Profile } from './types' export type ProfileResponse = Profile diff --git a/apps/studio/data/profile/mfa-challenge-and-verify-mutation.ts b/apps/studio/data/profile/mfa-challenge-and-verify-mutation.ts index 7edd05daefe..29f3d141661 100644 --- a/apps/studio/data/profile/mfa-challenge-and-verify-mutation.ts +++ b/apps/studio/data/profile/mfa-challenge-and-verify-mutation.ts @@ -1,4 +1,4 @@ -import { AuthMFAVerifyResponse, MFAChallengeAndVerifyParams } from '@supabase/supabase-js' +import type { AuthMFAVerifyResponse, MFAChallengeAndVerifyParams } from '@supabase/supabase-js' import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { auth } from 'lib/gotrue' import { profileKeys } from './keys' diff --git a/apps/studio/data/profile/mfa-enroll-mutation.ts b/apps/studio/data/profile/mfa-enroll-mutation.ts index 332f3e7aa7a..905f0a18c2c 100644 --- a/apps/studio/data/profile/mfa-enroll-mutation.ts +++ b/apps/studio/data/profile/mfa-enroll-mutation.ts @@ -1,4 +1,4 @@ -import { AuthMFAEnrollResponse, MFAEnrollParams } from '@supabase/supabase-js' +import type { AuthMFAEnrollResponse, MFAEnrollParams } from '@supabase/supabase-js' import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { auth } from 'lib/gotrue' import { toast } from 'react-hot-toast' diff --git a/apps/studio/data/profile/mfa-list-factors-query.ts b/apps/studio/data/profile/mfa-list-factors-query.ts index 108cce7bbdb..a4a7f9ae8c4 100644 --- a/apps/studio/data/profile/mfa-list-factors-query.ts +++ b/apps/studio/data/profile/mfa-list-factors-query.ts @@ -1,4 +1,4 @@ -import { AuthMFAListFactorsResponse, Factor } from '@supabase/supabase-js' +import type { AuthMFAListFactorsResponse, Factor } from '@supabase/supabase-js' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { auth } from 'lib/gotrue' import { profileKeys } from './keys' diff --git a/apps/studio/data/profile/mfa-unenroll-mutation.ts b/apps/studio/data/profile/mfa-unenroll-mutation.ts index e10a772e0f3..581d83a78f5 100644 --- a/apps/studio/data/profile/mfa-unenroll-mutation.ts +++ b/apps/studio/data/profile/mfa-unenroll-mutation.ts @@ -1,4 +1,4 @@ -import { AuthMFAUnenrollResponse, MFAUnenrollParams } from '@supabase/supabase-js' +import type { AuthMFAUnenrollResponse, MFAUnenrollParams } from '@supabase/supabase-js' import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { auth } from 'lib/gotrue' import { profileKeys } from './keys' diff --git a/apps/studio/data/profile/profile-audit-logs-query.ts b/apps/studio/data/profile/profile-audit-logs-query.ts index 6c536df3795..5b850b54a73 100644 --- a/apps/studio/data/profile/profile-audit-logs-query.ts +++ b/apps/studio/data/profile/profile-audit-logs-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { AuditLog } from 'data/organizations/organization-audit-logs-query' -import { ResponseError } from 'types' +import type { AuditLog } from 'data/organizations/organization-audit-logs-query' +import type { ResponseError } from 'types' import { profileKeys } from './keys' export type ProfileAuditLogsVariables = { diff --git a/apps/studio/data/profile/profile-create-mutation.ts b/apps/studio/data/profile/profile-create-mutation.ts index 37ff0d23424..cecd1ad8276 100644 --- a/apps/studio/data/profile/profile-create-mutation.ts +++ b/apps/studio/data/profile/profile-create-mutation.ts @@ -5,9 +5,9 @@ import { organizationKeys } from 'data/organizations/keys' import { permissionKeys } from 'data/permissions/keys' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { profileKeys } from './keys' -import { Profile } from './types' +import type { Profile } from './types' export type ProfileResponse = Profile diff --git a/apps/studio/data/profile/profile-query.ts b/apps/studio/data/profile/profile-query.ts index 86a59c86e26..1a536b77864 100644 --- a/apps/studio/data/profile/profile-query.ts +++ b/apps/studio/data/profile/profile-query.ts @@ -2,9 +2,9 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' import { API_URL, IS_PLATFORM } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { profileKeys } from './keys' -import { Profile } from './types' +import type { Profile } from './types' export type ProfileResponse = Profile diff --git a/apps/studio/data/profile/profile-update-mutation.ts b/apps/studio/data/profile/profile-update-mutation.ts index 39cc5bd1c6c..eed2847c746 100644 --- a/apps/studio/data/profile/profile-update-mutation.ts +++ b/apps/studio/data/profile/profile-update-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { profileKeys } from './keys' export type ProfileUpdateVariables = { diff --git a/apps/studio/data/profile/types.ts b/apps/studio/data/profile/types.ts index f9224301270..c16127203bb 100644 --- a/apps/studio/data/profile/types.ts +++ b/apps/studio/data/profile/types.ts @@ -1,4 +1,4 @@ -import { components } from 'data/api' +import type { components } from 'data/api' export type Profile = components['schemas']['ProfileResponse'] diff --git a/apps/studio/data/projects/project-by-fly-extension-id-mutation.ts b/apps/studio/data/projects/project-by-fly-extension-id-mutation.ts index fc6b3e32740..63dcc99cf13 100644 --- a/apps/studio/data/projects/project-by-fly-extension-id-mutation.ts +++ b/apps/studio/data/projects/project-by-fly-extension-id-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import toast from 'react-hot-toast' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectByFlyExtensionIdVariables = { flyExtensionId: string diff --git a/apps/studio/data/projects/project-create-mutation.ts b/apps/studio/data/projects/project-create-mutation.ts index 411de893df8..dd46ed8026e 100644 --- a/apps/studio/data/projects/project-create-mutation.ts +++ b/apps/studio/data/projects/project-create-mutation.ts @@ -1,10 +1,10 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { post } from 'data/fetchers' -import { PRICING_TIER_PRODUCT_IDS, PROVIDERS } from 'lib/constants' -import { ResponseError } from 'types' +import { PROVIDERS } from 'lib/constants' +import type { ResponseError } from 'types' import { projectKeys } from './keys' export type DbInstanceSize = components['schemas']['DesiredInstanceSize'] diff --git a/apps/studio/data/projects/project-delete-mutation.ts b/apps/studio/data/projects/project-delete-mutation.ts index feab99f1c68..6eaeaf1055b 100644 --- a/apps/studio/data/projects/project-delete-mutation.ts +++ b/apps/studio/data/projects/project-delete-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { delete_ } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { projectKeys } from './keys' export type ProjectDeleteVariables = { diff --git a/apps/studio/data/projects/project-detail-query.ts b/apps/studio/data/projects/project-detail-query.ts index 4e346a22b0d..971fbbea5cd 100644 --- a/apps/studio/data/projects/project-detail-query.ts +++ b/apps/studio/data/projects/project-detail-query.ts @@ -1,9 +1,9 @@ import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { projectKeys } from './keys' -import { components } from 'data/api' +import type { components } from 'data/api' export type ProjectDetailVariables = { ref?: string } diff --git a/apps/studio/data/projects/project-pause-mutation.ts b/apps/studio/data/projects/project-pause-mutation.ts index a7ceada4d5a..c4de3a1f733 100644 --- a/apps/studio/data/projects/project-pause-mutation.ts +++ b/apps/studio/data/projects/project-pause-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectPauseVariables = { ref: string diff --git a/apps/studio/data/projects/project-restart-mutation.ts b/apps/studio/data/projects/project-restart-mutation.ts index 13ced13112d..f6de0ae1be2 100644 --- a/apps/studio/data/projects/project-restart-mutation.ts +++ b/apps/studio/data/projects/project-restart-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectRestartVariables = { ref: string diff --git a/apps/studio/data/projects/project-restart-services-mutation.ts b/apps/studio/data/projects/project-restart-services-mutation.ts index 0739ab2e42b..edbb5f70935 100644 --- a/apps/studio/data/projects/project-restart-services-mutation.ts +++ b/apps/studio/data/projects/project-restart-services-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectRestartServicesVariables = { ref: string diff --git a/apps/studio/data/projects/project-restore-mutation.ts b/apps/studio/data/projects/project-restore-mutation.ts index 4fe249a0952..f4ef82e3772 100644 --- a/apps/studio/data/projects/project-restore-mutation.ts +++ b/apps/studio/data/projects/project-restore-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectRestoreVariables = { ref: string diff --git a/apps/studio/data/projects/project-status-query.ts b/apps/studio/data/projects/project-status-query.ts index d5d4339d424..1d2ac92f0cc 100644 --- a/apps/studio/data/projects/project-status-query.ts +++ b/apps/studio/data/projects/project-status-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { projectKeys } from './keys' export type ProjectStatusVariables = { diff --git a/apps/studio/data/projects/project-type-generation-query.ts b/apps/studio/data/projects/project-type-generation-query.ts index f950459d43f..290c88d0316 100644 --- a/apps/studio/data/projects/project-type-generation-query.ts +++ b/apps/studio/data/projects/project-type-generation-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { projectKeys } from './keys' export type GenerateTypesVariables = { ref?: string } diff --git a/apps/studio/data/projects/project-update-mutation.ts b/apps/studio/data/projects/project-update-mutation.ts index 92de3c042b9..00f4d457f5e 100644 --- a/apps/studio/data/projects/project-update-mutation.ts +++ b/apps/studio/data/projects/project-update-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { projectKeys } from './keys' export type ProjectUpdateVariables = { diff --git a/apps/studio/data/projects/project-upgrade-mutation.ts b/apps/studio/data/projects/project-upgrade-mutation.ts index 8bec6df6c10..8d1040c73fc 100644 --- a/apps/studio/data/projects/project-upgrade-mutation.ts +++ b/apps/studio/data/projects/project-upgrade-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectUpgradeVariables = { ref: string diff --git a/apps/studio/data/projects/projects-query.ts b/apps/studio/data/projects/projects-query.ts index 3b1276a1746..3bb52c015df 100644 --- a/apps/studio/data/projects/projects-query.ts +++ b/apps/studio/data/projects/projects-query.ts @@ -1,11 +1,11 @@ import { QueryClient, useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query' import { useCallback, useRef } from 'react' -import { components } from 'data/api' +import type { components } from 'data/api' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { projectKeys } from './keys' -import { Project } from './project-detail-query' +import type { Project } from './project-detail-query' export type ProjectsVariables = { ref?: string diff --git a/apps/studio/data/read-replicas/load-balancers-query.ts b/apps/studio/data/read-replicas/load-balancers-query.ts index e80df9f15ed..38c34fadd49 100644 --- a/apps/studio/data/read-replicas/load-balancers-query.ts +++ b/apps/studio/data/read-replicas/load-balancers-query.ts @@ -1,9 +1,9 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get, handleError } from 'data/fetchers' import { useProjectDetailQuery } from 'data/projects/project-detail-query' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { replicaKeys } from './keys' export type LoadBalancersVariables = { diff --git a/apps/studio/data/read-replicas/replica-remove-mutation.ts b/apps/studio/data/read-replicas/replica-remove-mutation.ts index 416830d6a6b..6cbc22aab3e 100644 --- a/apps/studio/data/read-replicas/replica-remove-mutation.ts +++ b/apps/studio/data/read-replicas/replica-remove-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { replicaKeys } from './keys' -import { Database } from './replicas-query' +import type { Database } from './replicas-query' export type ReadReplicaRemoveVariables = { projectRef: string diff --git a/apps/studio/data/read-replicas/replica-setup-mutation.ts b/apps/studio/data/read-replicas/replica-setup-mutation.ts index 44f44e32e4e..6fc0f28cc0b 100644 --- a/apps/studio/data/read-replicas/replica-setup-mutation.ts +++ b/apps/studio/data/read-replicas/replica-setup-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { replicaKeys } from './keys' -import { Database } from './replicas-query' +import type { Database } from './replicas-query' export type Region = | 'us-east-1' diff --git a/apps/studio/data/read-replicas/replicas-query.ts b/apps/studio/data/read-replicas/replicas-query.ts index a4ad7f648db..545f17b34e0 100644 --- a/apps/studio/data/read-replicas/replicas-query.ts +++ b/apps/studio/data/read-replicas/replicas-query.ts @@ -1,9 +1,9 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' -import { components } from 'data/api' +import type { components } from 'data/api' import { get } from 'data/fetchers' import { useProjectDetailQuery } from 'data/projects/project-detail-query' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { replicaKeys } from './keys' export type ReadReplicasVariables = { diff --git a/apps/studio/data/read-replicas/replicas-status-query.ts b/apps/studio/data/read-replicas/replicas-status-query.ts index a0430316a42..b1645bb7cdb 100644 --- a/apps/studio/data/read-replicas/replicas-status-query.ts +++ b/apps/studio/data/read-replicas/replicas-status-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { useProjectDetailQuery } from 'data/projects/project-detail-query' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { replicaKeys } from './keys' export type ReadReplicasStatusesVariables = { diff --git a/apps/studio/data/secrets/secrets-create-mutation.ts b/apps/studio/data/secrets/secrets-create-mutation.ts index 7b97c4275c2..d2d6354de70 100644 --- a/apps/studio/data/secrets/secrets-create-mutation.ts +++ b/apps/studio/data/secrets/secrets-create-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { secretsKeys } from './keys' export type SecretsCreateVariables = { diff --git a/apps/studio/data/secrets/secrets-delete-mutation.ts b/apps/studio/data/secrets/secrets-delete-mutation.ts index 26768ac5ef8..c887aae19d0 100644 --- a/apps/studio/data/secrets/secrets-delete-mutation.ts +++ b/apps/studio/data/secrets/secrets-delete-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { secretsKeys } from './keys' export type SecretsDeleteVariables = { diff --git a/apps/studio/data/secrets/secrets-query.ts b/apps/studio/data/secrets/secrets-query.ts index 0ffabb9a5dd..a06a5fbc96d 100644 --- a/apps/studio/data/secrets/secrets-query.ts +++ b/apps/studio/data/secrets/secrets-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { secretsKeys } from './keys' -import { ResponseError } from 'types' -import { components } from 'data/api' +import type { ResponseError } from 'types' +import type { components } from 'data/api' export type SecretsVariables = { projectRef?: string diff --git a/apps/studio/data/service-status/edge-functions-status-query.ts b/apps/studio/data/service-status/edge-functions-status-query.ts index 6e8eacaca36..9010e058064 100644 --- a/apps/studio/data/service-status/edge-functions-status-query.ts +++ b/apps/studio/data/service-status/edge-functions-status-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'lib/common/fetch' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { serviceStatusKeys } from './keys' export type EdgeFunctionServiceStatusVariables = { diff --git a/apps/studio/data/service-status/postgres-service-status-query.ts b/apps/studio/data/service-status/postgres-service-status-query.ts index db3a22a7311..0ba96d5e079 100644 --- a/apps/studio/data/service-status/postgres-service-status-query.ts +++ b/apps/studio/data/service-status/postgres-service-status-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { post } from 'lib/common/fetch' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { serviceStatusKeys } from './keys' import { API_URL } from 'lib/constants' diff --git a/apps/studio/data/service-status/service-status-query.ts b/apps/studio/data/service-status/service-status-query.ts index 38c82b0e23e..332d01079db 100644 --- a/apps/studio/data/service-status/service-status-query.ts +++ b/apps/studio/data/service-status/service-status-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { serviceStatusKeys } from './keys' export type ProjectServiceStatusVariables = { diff --git a/apps/studio/data/sql/keys.ts b/apps/studio/data/sql/keys.ts index b651bbfe087..06fc4f4c803 100644 --- a/apps/studio/data/sql/keys.ts +++ b/apps/studio/data/sql/keys.ts @@ -1,4 +1,4 @@ -import { QueryKey } from '@tanstack/react-query' +import type { QueryKey } from '@tanstack/react-query' export const sqlKeys = { query: (projectRef: string | undefined, queryKey: QueryKey) => diff --git a/apps/studio/data/ssl-enforcement/ssl-enforcement-update-mutation.ts b/apps/studio/data/ssl-enforcement/ssl-enforcement-update-mutation.ts index ca0e41cf65b..e4b5d88f2ad 100644 --- a/apps/studio/data/ssl-enforcement/ssl-enforcement-update-mutation.ts +++ b/apps/studio/data/ssl-enforcement/ssl-enforcement-update-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { put } from 'lib/common/fetch' import { API_ADMIN_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { sslEnforcementKeys } from './keys' export type SSLEnforcementUpdateVariables = { diff --git a/apps/studio/data/storage/bucket-create-mutation.ts b/apps/studio/data/storage/bucket-create-mutation.ts index 56602c3b993..16089a2a175 100644 --- a/apps/studio/data/storage/bucket-create-mutation.ts +++ b/apps/studio/data/storage/bucket-create-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { storageKeys } from './keys' export type BucketCreateVariables = { diff --git a/apps/studio/data/storage/bucket-delete-mutation.ts b/apps/studio/data/storage/bucket-delete-mutation.ts index 399dcc20d1e..63142b9c93c 100644 --- a/apps/studio/data/storage/bucket-delete-mutation.ts +++ b/apps/studio/data/storage/bucket-delete-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { delete_, post } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { storageKeys } from './keys' export type BucketDeleteVariables = { diff --git a/apps/studio/data/storage/bucket-empty-mutation.ts b/apps/studio/data/storage/bucket-empty-mutation.ts index 2e14636ccb4..ab50fda6feb 100644 --- a/apps/studio/data/storage/bucket-empty-mutation.ts +++ b/apps/studio/data/storage/bucket-empty-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { storageKeys } from './keys' export type BucketEmptyVariables = { diff --git a/apps/studio/data/storage/bucket-update-mutation.ts b/apps/studio/data/storage/bucket-update-mutation.ts index ec920849b1e..be17dd7f714 100644 --- a/apps/studio/data/storage/bucket-update-mutation.ts +++ b/apps/studio/data/storage/bucket-update-mutation.ts @@ -3,7 +3,7 @@ import { toast } from 'react-hot-toast' import { patch } from 'lib/common/fetch' import { API_URL } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { storageKeys } from './keys' export type BucketUpdateVariables = { diff --git a/apps/studio/data/storage/buckets-query.ts b/apps/studio/data/storage/buckets-query.ts index 762df8b94bf..613578063d1 100644 --- a/apps/studio/data/storage/buckets-query.ts +++ b/apps/studio/data/storage/buckets-query.ts @@ -3,7 +3,7 @@ import { get } from 'data/fetchers' import { API_URL } from 'lib/constants' import { useCallback } from 'react' import { storageKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type BucketsVariables = { projectRef?: string } diff --git a/apps/studio/data/stripe/setup-intent-mutation.ts b/apps/studio/data/stripe/setup-intent-mutation.ts index cad5489d964..37d9153a66b 100644 --- a/apps/studio/data/stripe/setup-intent-mutation.ts +++ b/apps/studio/data/stripe/setup-intent-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions } from '@tanstack/react-query' import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type SetupIntentVariables = { hcaptchaToken: string diff --git a/apps/studio/data/subscriptions/org-subscription-cancel-schedule-mutation.ts b/apps/studio/data/subscriptions/org-subscription-cancel-schedule-mutation.ts index de320dbf0a6..a5ecb39b648 100644 --- a/apps/studio/data/subscriptions/org-subscription-cancel-schedule-mutation.ts +++ b/apps/studio/data/subscriptions/org-subscription-cancel-schedule-mutation.ts @@ -2,7 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { subscriptionKeys } from './keys' export type OrganizationBillingSubscriptionCancelScheduleVariables = { diff --git a/apps/studio/data/subscriptions/org-subscription-query.ts b/apps/studio/data/subscriptions/org-subscription-query.ts index c28c69c2443..d4faeb1d255 100644 --- a/apps/studio/data/subscriptions/org-subscription-query.ts +++ b/apps/studio/data/subscriptions/org-subscription-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { subscriptionKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type OrgSubscriptionVariables = { orgSlug?: string diff --git a/apps/studio/data/subscriptions/org-subscription-update-mutation.ts b/apps/studio/data/subscriptions/org-subscription-update-mutation.ts index da5490d4db4..bb1869fa064 100644 --- a/apps/studio/data/subscriptions/org-subscription-update-mutation.ts +++ b/apps/studio/data/subscriptions/org-subscription-update-mutation.ts @@ -1,10 +1,10 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { put } from 'data/fetchers' import { toast } from 'react-hot-toast' -import { ResponseError } from 'types/base' +import type { ResponseError } from 'types/base' import { subscriptionKeys } from './keys' import { usageKeys } from 'data/usage/keys' -import { SubscriptionTier } from './types' +import type { SubscriptionTier } from './types' import { invoicesKeys } from 'data/invoices/keys' export type OrgSubscriptionUpdateVariables = { diff --git a/apps/studio/data/subscriptions/project-addon-remove-mutation.ts b/apps/studio/data/subscriptions/project-addon-remove-mutation.ts index 5c0bcf06b87..0b8b5261359 100644 --- a/apps/studio/data/subscriptions/project-addon-remove-mutation.ts +++ b/apps/studio/data/subscriptions/project-addon-remove-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { del } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { subscriptionKeys } from './keys' -import { AddonVariantId } from './types' +import type { AddonVariantId } from './types' export type ProjectAddonRemoveVariables = { projectRef: string diff --git a/apps/studio/data/subscriptions/project-addon-update-mutation.ts b/apps/studio/data/subscriptions/project-addon-update-mutation.ts index 010dada62a9..73638b12763 100644 --- a/apps/studio/data/subscriptions/project-addon-update-mutation.ts +++ b/apps/studio/data/subscriptions/project-addon-update-mutation.ts @@ -2,9 +2,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react import { toast } from 'react-hot-toast' import { post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { subscriptionKeys } from './keys' -import { AddonVariantId, ProjectAddonType } from './types' +import type { AddonVariantId, ProjectAddonType } from './types' export type ProjectAddonUpdateVariables = { projectRef: string diff --git a/apps/studio/data/subscriptions/project-addons-query.ts b/apps/studio/data/subscriptions/project-addons-query.ts index f81ee6df3c9..eb037de72b0 100644 --- a/apps/studio/data/subscriptions/project-addons-query.ts +++ b/apps/studio/data/subscriptions/project-addons-query.ts @@ -1,7 +1,7 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { subscriptionKeys } from './keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProjectAddonsVariables = { projectRef?: string diff --git a/apps/studio/data/subscriptions/types.ts b/apps/studio/data/subscriptions/types.ts index e4ec4475247..a47351d1549 100644 --- a/apps/studio/data/subscriptions/types.ts +++ b/apps/studio/data/subscriptions/types.ts @@ -1,4 +1,4 @@ -import { components } from 'data/api' +import type { components } from 'data/api' export type SubscriptionTier = | 'tier_free' diff --git a/apps/studio/data/table-rows/table-row-create-mutation.ts b/apps/studio/data/table-rows/table-row-create-mutation.ts index 1a3cc009716..2a136b0dad2 100644 --- a/apps/studio/data/table-rows/table-row-create-mutation.ts +++ b/apps/studio/data/table-rows/table-row-create-mutation.ts @@ -5,7 +5,7 @@ import { Query, SupaTable } from 'components/grid' import { sqlKeys } from 'data/sql/keys' import { ImpersonationRole, wrapWithRoleImpersonation } from 'lib/role-impersonation' import { isRoleImpersonationEnabled } from 'state/role-impersonation-state' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { executeSql } from 'data/sql/execute-sql-query' export type TableRowCreateVariables = { diff --git a/apps/studio/data/table-rows/table-row-delete-all-mutation.ts b/apps/studio/data/table-rows/table-row-delete-all-mutation.ts index a35d7937240..c63c992d4cf 100644 --- a/apps/studio/data/table-rows/table-row-delete-all-mutation.ts +++ b/apps/studio/data/table-rows/table-row-delete-all-mutation.ts @@ -6,7 +6,7 @@ import { executeSql } from 'data/sql/execute-sql-query' import { sqlKeys } from 'data/sql/keys' import { ImpersonationRole, wrapWithRoleImpersonation } from 'lib/role-impersonation' import { isRoleImpersonationEnabled } from 'state/role-impersonation-state' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { formatFilterValue } from './utils' export type TableRowDeleteAllVariables = { diff --git a/apps/studio/data/table-rows/table-row-delete-mutation.ts b/apps/studio/data/table-rows/table-row-delete-mutation.ts index 1cbff02d640..9ebd685c439 100644 --- a/apps/studio/data/table-rows/table-row-delete-mutation.ts +++ b/apps/studio/data/table-rows/table-row-delete-mutation.ts @@ -4,10 +4,10 @@ import { toast } from 'react-hot-toast' import { Query, SupaRow } from 'components/grid' import { executeSql } from 'data/sql/execute-sql-query' import { sqlKeys } from 'data/sql/keys' -import { Table } from 'data/tables/table-query' +import type { Table } from 'data/tables/table-query' import { ImpersonationRole, wrapWithRoleImpersonation } from 'lib/role-impersonation' import { isRoleImpersonationEnabled } from 'state/role-impersonation-state' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { getPrimaryKeys } from './utils' export type TableRowDeleteVariables = { diff --git a/apps/studio/data/table-rows/table-row-truncate-mutation.ts b/apps/studio/data/table-rows/table-row-truncate-mutation.ts index c14b8aa25c8..44688fc0ace 100644 --- a/apps/studio/data/table-rows/table-row-truncate-mutation.ts +++ b/apps/studio/data/table-rows/table-row-truncate-mutation.ts @@ -4,7 +4,7 @@ import { toast } from 'react-hot-toast' import { Query, SupaTable } from 'components/grid' import { executeSql } from 'data/sql/execute-sql-query' import { sqlKeys } from 'data/sql/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type TableRowTruncateVariables = { projectRef: string diff --git a/apps/studio/data/table-rows/table-row-update-mutation.ts b/apps/studio/data/table-rows/table-row-update-mutation.ts index e11e1095458..b00b202d9ed 100644 --- a/apps/studio/data/table-rows/table-row-update-mutation.ts +++ b/apps/studio/data/table-rows/table-row-update-mutation.ts @@ -6,7 +6,7 @@ import { executeSql } from 'data/sql/execute-sql-query' import { sqlKeys } from 'data/sql/keys' import { ImpersonationRole, wrapWithRoleImpersonation } from 'lib/role-impersonation' import { isRoleImpersonationEnabled } from 'state/role-impersonation-state' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type TableRowUpdateVariables = { projectRef: string diff --git a/apps/studio/data/table-rows/table-rows-count-query.ts b/apps/studio/data/table-rows/table-rows-count-query.ts index 9f2446d88f3..8f5c3e271e1 100644 --- a/apps/studio/data/table-rows/table-rows-count-query.ts +++ b/apps/studio/data/table-rows/table-rows-count-query.ts @@ -1,4 +1,4 @@ -import { QueryKey, UseQueryOptions } from '@tanstack/react-query' +import type { QueryKey, UseQueryOptions } from '@tanstack/react-query' import { Filter, Query, SupaTable } from 'components/grid' import { ImpersonationRole, wrapWithRoleImpersonation } from 'lib/role-impersonation' diff --git a/apps/studio/data/table-rows/table-rows-query.ts b/apps/studio/data/table-rows/table-rows-query.ts index 1f6bd4df728..879d4c8d37e 100644 --- a/apps/studio/data/table-rows/table-rows-query.ts +++ b/apps/studio/data/table-rows/table-rows-query.ts @@ -1,4 +1,4 @@ -import { QueryKey, UseQueryOptions } from '@tanstack/react-query' +import type { QueryKey, UseQueryOptions } from '@tanstack/react-query' import { IS_PLATFORM } from 'common' import { Filter, Query, Sort, SupaRow, SupaTable } from 'components/grid' diff --git a/apps/studio/data/table-rows/utils.ts b/apps/studio/data/table-rows/utils.ts index 55c6c305b07..b5796abed1b 100644 --- a/apps/studio/data/table-rows/utils.ts +++ b/apps/studio/data/table-rows/utils.ts @@ -1,7 +1,7 @@ -import { Filter, ServiceError, SupaTable } from 'components/grid' +import type { Filter, ServiceError, SupaTable } from 'components/grid' import { ERROR_PRIMARY_KEY_NOTFOUND } from 'components/grid/constants' import { isNumericalColumn } from 'components/grid/utils' -import { Table } from 'data/tables/table-query' +import type { Table } from 'data/tables/table-query' /** * temporary fix until we implement a better filter UI diff --git a/apps/studio/data/tables/table-create-mutation.ts b/apps/studio/data/tables/table-create-mutation.ts index fc1975ed6d1..ad99da6c144 100644 --- a/apps/studio/data/tables/table-create-mutation.ts +++ b/apps/studio/data/tables/table-create-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { handleError, post } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { tableKeys } from './keys' export type CreateTableBody = components['schemas']['CreateTableBody'] diff --git a/apps/studio/data/tables/table-delete-mutation.ts b/apps/studio/data/tables/table-delete-mutation.ts index cd8d7be5dce..1f445aca64d 100644 --- a/apps/studio/data/tables/table-delete-mutation.ts +++ b/apps/studio/data/tables/table-delete-mutation.ts @@ -4,7 +4,7 @@ import { toast } from 'react-hot-toast' import { entityTypeKeys } from 'data/entity-types/keys' import { del, handleError } from 'data/fetchers' import { viewKeys } from 'data/views/keys' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { tableKeys } from './keys' export type TableDeleteVariables = { diff --git a/apps/studio/data/tables/table-query.ts b/apps/studio/data/tables/table-query.ts index 2bec6eb5a18..ae9b159e9f3 100644 --- a/apps/studio/data/tables/table-query.ts +++ b/apps/studio/data/tables/table-query.ts @@ -1,4 +1,4 @@ -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query' // import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' diff --git a/apps/studio/data/tables/table-update-mutation.ts b/apps/studio/data/tables/table-update-mutation.ts index 274b91c035e..76db54f9a98 100644 --- a/apps/studio/data/tables/table-update-mutation.ts +++ b/apps/studio/data/tables/table-update-mutation.ts @@ -1,9 +1,9 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query' import { toast } from 'react-hot-toast' -import { components } from 'data/api' +import type { components } from 'data/api' import { handleError, patch } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { tableKeys } from './keys' export type UpdateTableBody = components['schemas']['UpdateTableBody'] diff --git a/apps/studio/data/tables/tables-query.ts b/apps/studio/data/tables/tables-query.ts index 14472190c21..8e1ebf85199 100644 --- a/apps/studio/data/tables/tables-query.ts +++ b/apps/studio/data/tables/tables-query.ts @@ -1,10 +1,10 @@ -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query' import { sortBy } from 'lodash' import { useCallback } from 'react' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { tableKeys } from './keys' export type TablesVariables = { diff --git a/apps/studio/data/usage/org-usage-query.ts b/apps/studio/data/usage/org-usage-query.ts index 4bc23315c7a..d7a2216c325 100644 --- a/apps/studio/data/usage/org-usage-query.ts +++ b/apps/studio/data/usage/org-usage-query.ts @@ -1,8 +1,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { usageKeys } from './keys' -import { ResponseError } from 'types' -import { components } from 'data/api' +import type { ResponseError } from 'types' +import type { components } from 'data/api' export type OrgUsageVariables = { orgSlug?: string diff --git a/apps/studio/data/usage/resource-warnings-query.ts b/apps/studio/data/usage/resource-warnings-query.ts index 7a1c588f52f..78817a1f3af 100644 --- a/apps/studio/data/usage/resource-warnings-query.ts +++ b/apps/studio/data/usage/resource-warnings-query.ts @@ -2,8 +2,8 @@ import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get } from 'data/fetchers' import { usageKeys } from './keys' -import { ResponseError } from 'types' -import { components } from 'data/api' +import type { ResponseError } from 'types' +import type { components } from 'data/api' import { IS_PLATFORM } from 'common' export async function getResourceWarnings(signal?: AbortSignal) { diff --git a/apps/studio/data/vault/vault-secret-create-mutation.ts b/apps/studio/data/vault/vault-secret-create-mutation.ts index 147a96cc03e..67798e557c2 100644 --- a/apps/studio/data/vault/vault-secret-create-mutation.ts +++ b/apps/studio/data/vault/vault-secret-create-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { Query } from 'components/grid/query/Query' import { executeSql } from 'data/sql/execute-sql-query' -import { ResponseError, VaultSecret } from 'types' +import type { ResponseError, VaultSecret } from 'types' import { vaultSecretsKeys } from './keys' import { sqlKeys } from 'data/sql/keys' diff --git a/apps/studio/data/vault/vault-secret-delete-mutation.ts b/apps/studio/data/vault/vault-secret-delete-mutation.ts index 0bed4e196bf..0532ef5ab3b 100644 --- a/apps/studio/data/vault/vault-secret-delete-mutation.ts +++ b/apps/studio/data/vault/vault-secret-delete-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { Query } from 'components/grid/query/Query' import { executeSql } from 'data/sql/execute-sql-query' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { vaultSecretsKeys } from './keys' import { sqlKeys } from 'data/sql/keys' diff --git a/apps/studio/data/vault/vault-secret-update-mutation.ts b/apps/studio/data/vault/vault-secret-update-mutation.ts index 96a00180814..c8ba8fcf1ad 100644 --- a/apps/studio/data/vault/vault-secret-update-mutation.ts +++ b/apps/studio/data/vault/vault-secret-update-mutation.ts @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { Query } from 'components/grid/query/Query' import { executeSql } from 'data/sql/execute-sql-query' -import { ResponseError, VaultSecret } from 'types' +import type { ResponseError, VaultSecret } from 'types' import { vaultSecretsKeys } from './keys' import { sqlKeys } from 'data/sql/keys' diff --git a/apps/studio/data/vault/vault-secrets-query.ts b/apps/studio/data/vault/vault-secrets-query.ts index cb3621aa5c2..8ac2377ee97 100644 --- a/apps/studio/data/vault/vault-secrets-query.ts +++ b/apps/studio/data/vault/vault-secrets-query.ts @@ -1,6 +1,6 @@ import { UseQueryOptions } from '@tanstack/react-query' import { Query } from 'components/grid/query/Query' -import { VaultSecret } from 'types' +import type { VaultSecret } from 'types' import { ExecuteSqlData, useExecuteSqlQuery } from '../sql/execute-sql-query' import { vaultSecretsKeys } from './keys' diff --git a/apps/studio/data/views/view-query.ts b/apps/studio/data/views/view-query.ts index 5a7b365f317..ae6d11b6c2d 100644 --- a/apps/studio/data/views/view-query.ts +++ b/apps/studio/data/views/view-query.ts @@ -1,8 +1,8 @@ -import { PostgresView } from '@supabase/postgres-meta' +import type { PostgresView } from '@supabase/postgres-meta' import { useQuery, UseQueryOptions } from '@tanstack/react-query' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { viewKeys } from './keys' export type ViewVariables = { diff --git a/apps/studio/data/views/views-query.ts b/apps/studio/data/views/views-query.ts index 12767524c84..b5c884f06f0 100644 --- a/apps/studio/data/views/views-query.ts +++ b/apps/studio/data/views/views-query.ts @@ -2,7 +2,7 @@ import { UseQueryOptions, useQuery, useQueryClient } from '@tanstack/react-query import { useCallback } from 'react' import { get, handleError } from 'data/fetchers' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' import { viewKeys } from './keys' export type ViewsVariables = { diff --git a/apps/studio/hooks/analytics/useLogsQuery.tsx b/apps/studio/hooks/analytics/useLogsQuery.tsx index e0b0516d27c..2460f8d2c2e 100644 --- a/apps/studio/hooks/analytics/useLogsQuery.tsx +++ b/apps/studio/hooks/analytics/useLogsQuery.tsx @@ -5,7 +5,11 @@ import { getDefaultHelper, } from 'components/interfaces/Settings/Logs' import { Dispatch, SetStateAction, useState } from 'react' -import { LogsEndpointParams, Logs, LogData } from 'components/interfaces/Settings/Logs/Logs.types' +import type { + LogsEndpointParams, + Logs, + LogData, +} from 'components/interfaces/Settings/Logs/Logs.types' import { API_URL } from 'lib/constants' import { get, isResponseOk } from 'lib/common/fetch' export interface LogsQueryHook { diff --git a/apps/studio/hooks/misc/useCheckPermissions.ts b/apps/studio/hooks/misc/useCheckPermissions.ts index c8b7d4fb640..b88983594e0 100644 --- a/apps/studio/hooks/misc/useCheckPermissions.ts +++ b/apps/studio/hooks/misc/useCheckPermissions.ts @@ -4,7 +4,7 @@ import jsonLogic from 'json-logic-js' import { useOrganizationsQuery } from 'data/organizations/organizations-query' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { IS_PLATFORM } from 'lib/constants' -import { Permission } from 'types' +import type { Permission } from 'types' import { useSelectedOrganization } from './useSelectedOrganization' const toRegexpString = (actionOrResource: string) => diff --git a/apps/studio/hooks/misc/useEntityType.ts b/apps/studio/hooks/misc/useEntityType.ts index 52211c72833..336b83fb5df 100644 --- a/apps/studio/hooks/misc/useEntityType.ts +++ b/apps/studio/hooks/misc/useEntityType.ts @@ -1,6 +1,6 @@ import { useQueryClient } from '@tanstack/react-query' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' -import { Entity, useEntityTypeQuery } from 'data/entity-types/entity-type-query' +import { type Entity, useEntityTypeQuery } from 'data/entity-types/entity-type-query' import { entityTypeKeys } from 'data/entity-types/keys' import { useMemo } from 'react' diff --git a/apps/studio/hooks/misc/useIsFeatureEnabled.ts b/apps/studio/hooks/misc/useIsFeatureEnabled.ts index e3117e901ef..2542fb5ddb3 100644 --- a/apps/studio/hooks/misc/useIsFeatureEnabled.ts +++ b/apps/studio/hooks/misc/useIsFeatureEnabled.ts @@ -1,4 +1,4 @@ -import { Feature } from 'data/profile/types' +import type { Feature } from 'data/profile/types' import { useProfile } from 'lib/profile' function checkFeature(feature: Feature, features?: Feature[]) { diff --git a/apps/studio/hooks/misc/useStore.tsx b/apps/studio/hooks/misc/useStore.tsx index be8ae8c5048..0f5b229a303 100644 --- a/apps/studio/hooks/misc/useStore.tsx +++ b/apps/studio/hooks/misc/useStore.tsx @@ -3,7 +3,7 @@ import { createContext, PropsWithChildren, useContext, useEffect } from 'react' import toast from 'react-hot-toast' import SparkBar from 'components/ui/SparkBar' -import { IRootStore } from 'stores' +import type { IRootStore } from 'stores' import { useSelectedProject } from './useSelectedProject' const StoreContext = createContext(undefined!) diff --git a/apps/studio/lib/api/apiAuthenticate.ts b/apps/studio/lib/api/apiAuthenticate.ts index d7d85dcee84..f121dfa050a 100644 --- a/apps/studio/lib/api/apiAuthenticate.ts +++ b/apps/studio/lib/api/apiAuthenticate.ts @@ -1,6 +1,6 @@ import type { NextApiRequest, NextApiResponse } from 'next' import { readOnly } from './supabaseClient' -import { SupaResponse, User } from 'types' +import type { SupaResponse, User } from 'types' import { getAuth0Id, getAuthUser, getIdentity } from 'lib/gotrue' /** diff --git a/apps/studio/lib/api/apiWrapper.ts b/apps/studio/lib/api/apiWrapper.ts index 4b9008a09c3..a0deb511610 100644 --- a/apps/studio/lib/api/apiWrapper.ts +++ b/apps/studio/lib/api/apiWrapper.ts @@ -1,6 +1,6 @@ import { withSentry } from '@sentry/nextjs' import { isResponseOk } from 'lib/common/fetch' -import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next' +import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next' import { IS_PLATFORM } from '../constants' import { apiAuthenticate } from './apiAuthenticate' diff --git a/apps/studio/lib/common/fetch/base.ts b/apps/studio/lib/common/fetch/base.ts index c7140a3820d..38f4eda7dcd 100644 --- a/apps/studio/lib/common/fetch/base.ts +++ b/apps/studio/lib/common/fetch/base.ts @@ -1,6 +1,6 @@ import { getAccessToken } from 'lib/gotrue' import { isUndefined } from 'lodash' -import { SupaResponse } from 'types/base' +import type { SupaResponse } from 'types/base' export function handleError(e: any, requestId: string): SupaResponse { const message = e?.message ? `An error has occurred: ${e.message}` : 'An error has occurred' diff --git a/apps/studio/lib/common/fetch/delete.ts b/apps/studio/lib/common/fetch/delete.ts index 6a68c4b001b..b8da5a117dc 100644 --- a/apps/studio/lib/common/fetch/delete.ts +++ b/apps/studio/lib/common/fetch/delete.ts @@ -1,6 +1,6 @@ import { handleError, handleResponse, handleResponseError, constructHeaders } from './base' import { uuidv4 } from '../../helpers' -import { SupaResponse } from 'types/base' +import type { SupaResponse } from 'types/base' /** * @deprecated please use del method from data/fetchers instead diff --git a/apps/studio/lib/common/fetch/get.ts b/apps/studio/lib/common/fetch/get.ts index 5c3c895a58f..941c5eb4b58 100644 --- a/apps/studio/lib/common/fetch/get.ts +++ b/apps/studio/lib/common/fetch/get.ts @@ -1,6 +1,6 @@ import { handleError, handleResponse, handleResponseError, constructHeaders } from './base' import { uuidv4 } from '../../helpers' -import { SupaResponse } from 'types/base' +import type { SupaResponse } from 'types/base' /** * @deprecated please use get method from data/fetchers instead diff --git a/apps/studio/lib/common/fetch/head.ts b/apps/studio/lib/common/fetch/head.ts index dcdb88e864c..97d3e514c62 100644 --- a/apps/studio/lib/common/fetch/head.ts +++ b/apps/studio/lib/common/fetch/head.ts @@ -1,6 +1,6 @@ import { handleError, handleHeadResponse, handleResponseError, constructHeaders } from './base' import { uuidv4 } from '../../helpers' -import { SupaResponse } from 'types/base' +import type { SupaResponse } from 'types/base' /** * @deprecated please use head method from data/fetchers instead diff --git a/apps/studio/lib/common/fetch/patch.ts b/apps/studio/lib/common/fetch/patch.ts index f99f3ca8ef0..f8b3bb47d4a 100644 --- a/apps/studio/lib/common/fetch/patch.ts +++ b/apps/studio/lib/common/fetch/patch.ts @@ -1,6 +1,6 @@ import { constructHeaders, handleError, handleResponse, handleResponseError } from './base' import { uuidv4 } from '../../helpers' -import { SupaResponse } from 'types/base' +import type { SupaResponse } from 'types/base' /** * @deprecated please use patch method from data/fetchers instead diff --git a/apps/studio/lib/common/fetch/post.ts b/apps/studio/lib/common/fetch/post.ts index 2f398b470c4..32e717e54a7 100644 --- a/apps/studio/lib/common/fetch/post.ts +++ b/apps/studio/lib/common/fetch/post.ts @@ -1,6 +1,6 @@ import { handleError, handleResponse, handleResponseError, constructHeaders } from './base' import { uuidv4 } from 'lib/helpers' -import { SupaResponse } from 'types/base' +import type { SupaResponse } from 'types/base' /** * @deprecated please use post method from data/fetchers instead diff --git a/apps/studio/lib/common/fetch/put.ts b/apps/studio/lib/common/fetch/put.ts index 1eec77c933f..a2439e23d87 100644 --- a/apps/studio/lib/common/fetch/put.ts +++ b/apps/studio/lib/common/fetch/put.ts @@ -1,6 +1,6 @@ import { constructHeaders, handleError, handleResponse, handleResponseError } from './base' import { uuidv4 } from '../../helpers' -import { SupaResponse } from 'types/base' +import type { SupaResponse } from 'types/base' /** * @deprecated please use post method from data/fetchers instead diff --git a/apps/studio/lib/configcat.ts b/apps/studio/lib/configcat.ts index 6f9f4177679..048e0bda771 100644 --- a/apps/studio/lib/configcat.ts +++ b/apps/studio/lib/configcat.ts @@ -1,4 +1,4 @@ -import { User } from '@supabase/supabase-js' +import type { User } from '@supabase/supabase-js' import * as configcat from 'configcat-js' let client: configcat.IConfigCatClient diff --git a/apps/studio/lib/constants/infrastructure.ts b/apps/studio/lib/constants/infrastructure.ts index a05be565680..6107a01645e 100644 --- a/apps/studio/lib/constants/infrastructure.ts +++ b/apps/studio/lib/constants/infrastructure.ts @@ -1,4 +1,4 @@ -import { components } from 'data/api' +import type { components } from 'data/api' export type CloudProvider = 'FLY' | 'AWS' export type Region = typeof AWS_REGIONS | typeof FLY_REGIONS diff --git a/apps/studio/lib/integration-utils.ts b/apps/studio/lib/integration-utils.ts index b71945aa0bd..d33610e48c8 100644 --- a/apps/studio/lib/integration-utils.ts +++ b/apps/studio/lib/integration-utils.ts @@ -1,5 +1,5 @@ -import { Integration } from 'data/integrations/integrations.types' -import { SupaResponse } from 'types' +import type { Integration } from 'data/integrations/integrations.types' +import type { SupaResponse } from 'types' import { isResponseOk } from './common/fetch' async function fetchGitHub(url: string, responseJson = true): Promise> { diff --git a/apps/studio/lib/profile.tsx b/apps/studio/lib/profile.tsx index 41203d29913..2e779f1b815 100644 --- a/apps/studio/lib/profile.tsx +++ b/apps/studio/lib/profile.tsx @@ -5,10 +5,10 @@ import { useIsLoggedIn, useTelemetryProps } from 'common' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { useProfileCreateMutation } from 'data/profile/profile-create-mutation' import { useProfileQuery } from 'data/profile/profile-query' -import { Profile } from 'data/profile/types' +import type { Profile } from 'data/profile/types' import { useStore } from 'hooks' import Telemetry from 'lib/telemetry' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' export type ProfileContextType = { profile: Profile | undefined diff --git a/apps/studio/lib/role-impersonation.ts b/apps/studio/lib/role-impersonation.ts index 634045fc9ec..4901119789a 100644 --- a/apps/studio/lib/role-impersonation.ts +++ b/apps/studio/lib/role-impersonation.ts @@ -1,4 +1,4 @@ -import { User } from 'data/auth/users-query' +import type { User } from 'data/auth/users-query' import { uuidv4 } from './helpers' type PostgrestImpersonationRole = diff --git a/apps/studio/lib/telemetry.ts b/apps/studio/lib/telemetry.ts index 00fa755e193..08496f8ee66 100644 --- a/apps/studio/lib/telemetry.ts +++ b/apps/studio/lib/telemetry.ts @@ -1,7 +1,7 @@ import { post } from 'lib/common/fetch' import { API_URL, IS_PLATFORM, LOCAL_STORAGE_KEYS } from 'lib/constants' -import { NextRouter } from 'next/router' -import { User } from 'types' +import type { NextRouter } from 'next/router' +import type { User } from 'types' export interface TelemetryProps { screenResolution?: string diff --git a/apps/studio/pages/_app.tsx b/apps/studio/pages/_app.tsx index 42a3b45a640..1889589c012 100644 --- a/apps/studio/pages/_app.tsx +++ b/apps/studio/pages/_app.tsx @@ -54,7 +54,7 @@ import { ProfileProvider } from 'lib/profile' import { useAppStateSnapshot } from 'state/app-state' import { RootStore } from 'stores' import HCaptchaLoadedStore from 'stores/hcaptcha-loaded-store' -import { AppPropsWithLayout } from 'types' +import type { AppPropsWithLayout } from 'types' import { Toaster } from 'ui' import { FeaturePreviewContextProvider } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' import FeaturePreviewModal from 'components/interfaces/App/FeaturePreview/FeaturePreviewModal' diff --git a/apps/studio/pages/account/audit.tsx b/apps/studio/pages/account/audit.tsx index 1e6398b63d4..11125b8b49a 100644 --- a/apps/studio/pages/account/audit.tsx +++ b/apps/studio/pages/account/audit.tsx @@ -2,7 +2,7 @@ import { AuditLogs } from 'components/interfaces/Account' import { AccountLayout } from 'components/layouts' import { ScaffoldContainerLegacy } from 'components/layouts/Scaffold' import { FormHeader } from 'components/ui/Forms' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const User: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/account/me.tsx b/apps/studio/pages/account/me.tsx index ae09829457f..e109f0b743f 100644 --- a/apps/studio/pages/account/me.tsx +++ b/apps/studio/pages/account/me.tsx @@ -13,7 +13,7 @@ import Panel from 'components/ui/Panel' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useFlag, useIsFeatureEnabled } from 'hooks' import { useProfile } from 'lib/profile' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const User: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/account/security.tsx b/apps/studio/pages/account/security.tsx index 37855cffc83..4ca6e0ae9e4 100644 --- a/apps/studio/pages/account/security.tsx +++ b/apps/studio/pages/account/security.tsx @@ -1,4 +1,4 @@ -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { Badge, cn, Collapsible, IconSmartphone } from 'ui' import { TOTPFactors } from 'components/interfaces/Account' diff --git a/apps/studio/pages/account/tokens.tsx b/apps/studio/pages/account/tokens.tsx index 51a767a0d18..da86f7daf8b 100644 --- a/apps/studio/pages/account/tokens.tsx +++ b/apps/studio/pages/account/tokens.tsx @@ -1,5 +1,5 @@ import { useState } from 'react' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { FormHeader } from 'components/ui/Forms' import { AccountLayout } from 'components/layouts' import { diff --git a/apps/studio/pages/api/projects/[ref]/content.ts b/apps/studio/pages/api/projects/[ref]/content.ts index 6345476fa57..2fb7bd01c41 100644 --- a/apps/studio/pages/api/projects/[ref]/content.ts +++ b/apps/studio/pages/api/projects/[ref]/content.ts @@ -1,6 +1,6 @@ import { NextApiRequest, NextApiResponse } from 'next' import apiWrapper from 'lib/api/apiWrapper' -import { UserContent } from 'types' +import type { UserContent } from 'types' export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler) diff --git a/apps/studio/pages/authorize.tsx b/apps/studio/pages/authorize.tsx index 6183ac81c1d..b9181d5afeb 100644 --- a/apps/studio/pages/authorize.tsx +++ b/apps/studio/pages/authorize.tsx @@ -12,7 +12,7 @@ import { useApiAuthorizationDeclineMutation } from 'data/api-authorization/api-a import { useApiAuthorizationQuery } from 'data/api-authorization/api-authorization-query' import { useOrganizationsQuery } from 'data/organizations/organizations-query' import { useStore, withAuth } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { Alert, Button, Listbox } from 'ui' // Need to handle if no organizations in account diff --git a/apps/studio/pages/forgot-password.tsx b/apps/studio/pages/forgot-password.tsx index 4efe3077133..44b43b46cc6 100644 --- a/apps/studio/pages/forgot-password.tsx +++ b/apps/studio/pages/forgot-password.tsx @@ -1,7 +1,7 @@ import ForgotPasswordForm from 'components/interfaces/SignIn/ForgotPasswordForm' import { ForgotPasswordLayout } from 'components/layouts' import Link from 'next/link' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ForgotPasswordPage: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx b/apps/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx index 0cabcedb04f..0b5e5ebd7cf 100644 --- a/apps/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx +++ b/apps/studio/pages/integrations/vercel/[slug]/deploy-button/new-project.tsx @@ -20,7 +20,7 @@ import { AWS_REGIONS, DEFAULT_MINIMUM_PASSWORD_STRENGTH, PROVIDERS } from 'lib/c import { passwordStrength } from 'lib/helpers' import { getInitialMigrationSQLFromGitHubRepo } from 'lib/integration-utils' import { useIntegrationInstallationSnapshot } from 'state/integration-installation' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { Alert, Button, Checkbox, Input, Listbox } from 'ui' const VercelIntegration: NextPageWithLayout = () => { diff --git a/apps/studio/pages/integrations/vercel/[slug]/marketplace/choose-project.tsx b/apps/studio/pages/integrations/vercel/[slug]/marketplace/choose-project.tsx index 420a6610d3f..42ca0935117 100644 --- a/apps/studio/pages/integrations/vercel/[slug]/marketplace/choose-project.tsx +++ b/apps/studio/pages/integrations/vercel/[slug]/marketplace/choose-project.tsx @@ -18,7 +18,7 @@ import { useProjectsQuery } from 'data/projects/projects-query' import { BASE_PATH, PROJECT_STATUS } from 'lib/constants' import { EMPTY_ARR } from 'lib/void' import { useIntegrationInstallationSnapshot } from 'state/integration-installation' -import { NextPageWithLayout, Organization } from 'types' +import type { NextPageWithLayout, Organization } from 'types' const VERCEL_ICON = ( Vercel Icon diff --git a/apps/studio/pages/integrations/vercel/install.tsx b/apps/studio/pages/integrations/vercel/install.tsx index f2c707c4117..1318c60ec4d 100644 --- a/apps/studio/pages/integrations/vercel/install.tsx +++ b/apps/studio/pages/integrations/vercel/install.tsx @@ -13,7 +13,7 @@ import { useVercelIntegrationCreateMutation } from 'data/integrations/vercel-int import { useOrganizationsQuery } from 'data/organizations/organizations-query' import { useStore } from 'hooks' import Link from 'next/link' -import { NextPageWithLayout, Organization } from 'types' +import type { NextPageWithLayout, Organization } from 'types' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, diff --git a/apps/studio/pages/new/[slug].tsx b/apps/studio/pages/new/[slug].tsx index 0fdc1557886..9325a1c8c81 100644 --- a/apps/studio/pages/new/[slug].tsx +++ b/apps/studio/pages/new/[slug].tsx @@ -33,9 +33,9 @@ import { Region, } from 'lib/constants' import { passwordStrength, pluckObjectFields } from 'lib/helpers' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { Badge, Button, IconExternalLink, IconUsers, Input, Listbox } from 'ui' -import { components } from 'data/api' +import type { components } from 'data/api' import { WizardLayoutWithoutAuth } from 'components/layouts/WizardLayout' type DesiredInstanceSize = components['schemas']['DesiredInstanceSize'] diff --git a/apps/studio/pages/new/index.tsx b/apps/studio/pages/new/index.tsx index 5319effb991..95fbc992686 100644 --- a/apps/studio/pages/new/index.tsx +++ b/apps/studio/pages/new/index.tsx @@ -10,7 +10,7 @@ import { WizardLayout } from 'components/layouts' import { useSetupIntent } from 'data/stripe/setup-intent-mutation' import { STRIPE_PUBLIC_KEY } from 'lib/constants' import { useIsHCaptchaLoaded } from 'stores/hcaptcha-loaded-store' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const stripePromise = loadStripe(STRIPE_PUBLIC_KEY) diff --git a/apps/studio/pages/org/[slug]/apps.tsx b/apps/studio/pages/org/[slug]/apps.tsx index b55b3ebd927..8d1d248ce4b 100644 --- a/apps/studio/pages/org/[slug]/apps.tsx +++ b/apps/studio/pages/org/[slug]/apps.tsx @@ -3,7 +3,7 @@ import { OrganizationLayout } from 'components/layouts' import { Loading } from 'components/ui/Loading' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { useSelectedOrganization } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const OrgOAuthApps: NextPageWithLayout = () => { const selectedOrganization = useSelectedOrganization() diff --git a/apps/studio/pages/org/[slug]/audit.tsx b/apps/studio/pages/org/[slug]/audit.tsx index e8ae6ef1e4c..94dd76ac24a 100644 --- a/apps/studio/pages/org/[slug]/audit.tsx +++ b/apps/studio/pages/org/[slug]/audit.tsx @@ -3,7 +3,7 @@ import { OrganizationLayout } from 'components/layouts' import { Loading } from 'components/ui/Loading' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { useSelectedOrganization } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const OrgAuditLogs: NextPageWithLayout = () => { const { isLoading: isLoadingPermissions } = usePermissionsQuery() diff --git a/apps/studio/pages/org/[slug]/billing.tsx b/apps/studio/pages/org/[slug]/billing.tsx index 4555aac2a9d..f973ac75108 100644 --- a/apps/studio/pages/org/[slug]/billing.tsx +++ b/apps/studio/pages/org/[slug]/billing.tsx @@ -9,7 +9,7 @@ import { ORG_SETTINGS_PANEL_KEYS, useOrgSettingsPageStateSnapshot, } from 'state/organization-settings' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const OrgBillingSettings: NextPageWithLayout = () => { const { panel } = useParams() diff --git a/apps/studio/pages/org/[slug]/documents.tsx b/apps/studio/pages/org/[slug]/documents.tsx index d890fc06c6d..b92bdbe9f2c 100644 --- a/apps/studio/pages/org/[slug]/documents.tsx +++ b/apps/studio/pages/org/[slug]/documents.tsx @@ -1,4 +1,4 @@ -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { OrganizationLayout } from 'components/layouts' import { Documents } from 'components/interfaces/Organization' diff --git a/apps/studio/pages/org/[slug]/general.tsx b/apps/studio/pages/org/[slug]/general.tsx index 9e1803d79b9..4eb742b05ac 100644 --- a/apps/studio/pages/org/[slug]/general.tsx +++ b/apps/studio/pages/org/[slug]/general.tsx @@ -3,7 +3,7 @@ import { OrganizationLayout } from 'components/layouts' import { Loading } from 'components/ui/Loading' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { useSelectedOrganization } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const OrgGeneralSettings: NextPageWithLayout = () => { const { isLoading: isLoadingPermissions } = usePermissionsQuery() diff --git a/apps/studio/pages/org/[slug]/index.tsx b/apps/studio/pages/org/[slug]/index.tsx index f52f3bcc022..060d94ab9e9 100644 --- a/apps/studio/pages/org/[slug]/index.tsx +++ b/apps/studio/pages/org/[slug]/index.tsx @@ -11,7 +11,7 @@ import { useGitHubConnectionsQuery } from 'data/integrations/github-connections- import { useOrgIntegrationsQuery } from 'data/integrations/integrations-query-org-only' import { useProjectsQuery } from 'data/projects/projects-query' import { useSelectedOrganization } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ProjectsPage: NextPageWithLayout = () => { const { diff --git a/apps/studio/pages/org/[slug]/integrations.tsx b/apps/studio/pages/org/[slug]/integrations.tsx index 0e54ef2778c..87fdf96add2 100644 --- a/apps/studio/pages/org/[slug]/integrations.tsx +++ b/apps/studio/pages/org/[slug]/integrations.tsx @@ -1,4 +1,4 @@ -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { OrganizationLayout } from 'components/layouts' import { IntegrationSettings } from 'components/interfaces/Organization' diff --git a/apps/studio/pages/org/[slug]/invoices.tsx b/apps/studio/pages/org/[slug]/invoices.tsx index 7d9f643546f..a532196b72e 100644 --- a/apps/studio/pages/org/[slug]/invoices.tsx +++ b/apps/studio/pages/org/[slug]/invoices.tsx @@ -3,7 +3,7 @@ import { OrganizationLayout } from 'components/layouts' import { Loading } from 'components/ui/Loading' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { useSelectedOrganization } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const OrgInvoices: NextPageWithLayout = () => { const { isLoading: isLoadingPermissions } = usePermissionsQuery() diff --git a/apps/studio/pages/org/[slug]/team.tsx b/apps/studio/pages/org/[slug]/team.tsx index de36efe5d32..4c46eec6c11 100644 --- a/apps/studio/pages/org/[slug]/team.tsx +++ b/apps/studio/pages/org/[slug]/team.tsx @@ -3,7 +3,7 @@ import { OrganizationLayout } from 'components/layouts' import { Loading } from 'components/ui/Loading' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { useSelectedOrganization } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const OrgTeamSettings: NextPageWithLayout = () => { const { isLoading: isLoadingPermissions } = usePermissionsQuery() diff --git a/apps/studio/pages/org/[slug]/usage.tsx b/apps/studio/pages/org/[slug]/usage.tsx index 67585db31f9..484ed40d286 100644 --- a/apps/studio/pages/org/[slug]/usage.tsx +++ b/apps/studio/pages/org/[slug]/usage.tsx @@ -3,7 +3,7 @@ import { OrganizationLayout } from 'components/layouts' import { Loading } from 'components/ui/Loading' import { usePermissionsQuery } from 'data/permissions/permissions-query' import { useSelectedOrganization } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const OrgUsage: NextPageWithLayout = () => { const { isLoading: isLoadingPermissions } = usePermissionsQuery() diff --git a/apps/studio/pages/project/[ref]/api/graphiql.tsx b/apps/studio/pages/project/[ref]/api/graphiql.tsx index c5f19532f03..e8e8598cd2b 100644 --- a/apps/studio/pages/project/[ref]/api/graphiql.tsx +++ b/apps/studio/pages/project/[ref]/api/graphiql.tsx @@ -18,7 +18,7 @@ import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-ex import { API_URL, IS_PLATFORM } from 'lib/constants' import { getRoleImpersonationJWT } from 'lib/role-impersonation' import { useGetImpersonatedRole } from 'state/role-impersonation-state' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const GraphiQLPage: NextPageWithLayout = () => { const { resolvedTheme } = useTheme() diff --git a/apps/studio/pages/project/[ref]/api/index.tsx b/apps/studio/pages/project/[ref]/api/index.tsx index 3e83002e03d..899fa9ef981 100644 --- a/apps/studio/pages/project/[ref]/api/index.tsx +++ b/apps/studio/pages/project/[ref]/api/index.tsx @@ -9,7 +9,7 @@ import { DocsLayout } from 'components/layouts' import { useProjectApiQuery } from 'data/config/project-api-query' import { useProjectJsonSchemaQuery } from 'data/docs/project-json-schema-query' import { snakeToCamel } from 'lib/helpers' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageContext = createContext(null) diff --git a/apps/studio/pages/project/[ref]/auth/column-privileges.tsx b/apps/studio/pages/project/[ref]/auth/column-privileges.tsx index 973c1e2ae63..3ca71115b86 100644 --- a/apps/studio/pages/project/[ref]/auth/column-privileges.tsx +++ b/apps/studio/pages/project/[ref]/auth/column-privileges.tsx @@ -1,4 +1,4 @@ -import { PostgresRole } from '@supabase/postgres-meta' +import type { PostgresRole } from '@supabase/postgres-meta' import { useParams } from 'common' import { XIcon } from 'lucide-react' import Link from 'next/link' @@ -35,7 +35,7 @@ import { useTablesQuery } from 'data/tables/tables-query' import { useLocalStorage } from 'hooks' import { LOCAL_STORAGE_KEYS } from 'lib/constants' import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { useAppStateSnapshot } from 'state/app-state' const EDITABLE_ROLES = ['authenticated', 'anon', 'service_role'] diff --git a/apps/studio/pages/project/[ref]/auth/hooks.tsx b/apps/studio/pages/project/[ref]/auth/hooks.tsx index e6e13fd19f1..7713c734dce 100644 --- a/apps/studio/pages/project/[ref]/auth/hooks.tsx +++ b/apps/studio/pages/project/[ref]/auth/hooks.tsx @@ -6,7 +6,7 @@ import { AuthLayout } from 'components/layouts' import { FormsContainer } from 'components/ui/Forms' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const Hooks: NextPageWithLayout = () => { const canReadAuthSettings = useCheckPermissions(PermissionAction.READ, 'custom_config_gotrue') diff --git a/apps/studio/pages/project/[ref]/auth/index.tsx b/apps/studio/pages/project/[ref]/auth/index.tsx index 4544e8a6cdb..b6252441731 100644 --- a/apps/studio/pages/project/[ref]/auth/index.tsx +++ b/apps/studio/pages/project/[ref]/auth/index.tsx @@ -1,7 +1,7 @@ import { observer } from 'mobx-react-lite' import { AuthLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const Authentication: NextPageWithLayout = () => { return <>{/*

Use this as a template for authentication pages

*/} diff --git a/apps/studio/pages/project/[ref]/auth/policies.tsx b/apps/studio/pages/project/[ref]/auth/policies.tsx index f3cc4c7e0ca..86b2e177206 100644 --- a/apps/studio/pages/project/[ref]/auth/policies.tsx +++ b/apps/studio/pages/project/[ref]/auth/policies.tsx @@ -1,5 +1,5 @@ import * as Tooltip from '@radix-ui/react-tooltip' -import { PostgresPolicy, PostgresTable } from '@supabase/postgres-meta' +import type { PostgresPolicy, PostgresTable } from '@supabase/postgres-meta' import { PermissionAction } from '@supabase/shared-types/out/constants' import { partition } from 'lodash' import { useEffect, useState } from 'react' @@ -20,7 +20,7 @@ import { useTablesQuery } from 'data/tables/tables-query' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas' import { useTableEditorStateSnapshot } from 'state/table-editor' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { Button, IconExternalLink, IconSearch, Input } from 'ui' /** diff --git a/apps/studio/pages/project/[ref]/auth/providers.tsx b/apps/studio/pages/project/[ref]/auth/providers.tsx index ea9d2e25a11..93c03890799 100644 --- a/apps/studio/pages/project/[ref]/auth/providers.tsx +++ b/apps/studio/pages/project/[ref]/auth/providers.tsx @@ -5,7 +5,7 @@ import { AuthLayout } from 'components/layouts' import { FormsContainer } from 'components/ui/Forms' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => { const canReadAuthSettings = useCheckPermissions(PermissionAction.READ, 'custom_config_gotrue') diff --git a/apps/studio/pages/project/[ref]/auth/rate-limits.tsx b/apps/studio/pages/project/[ref]/auth/rate-limits.tsx index 2ed9bff964f..705a81047ef 100644 --- a/apps/studio/pages/project/[ref]/auth/rate-limits.tsx +++ b/apps/studio/pages/project/[ref]/auth/rate-limits.tsx @@ -5,7 +5,7 @@ import { AuthLayout } from 'components/layouts' import { FormsContainer } from 'components/ui/Forms' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => { const canReadAuthSettings = useCheckPermissions(PermissionAction.READ, 'custom_config_gotrue') diff --git a/apps/studio/pages/project/[ref]/auth/templates.tsx b/apps/studio/pages/project/[ref]/auth/templates.tsx index f403d698ed0..0710001fff7 100644 --- a/apps/studio/pages/project/[ref]/auth/templates.tsx +++ b/apps/studio/pages/project/[ref]/auth/templates.tsx @@ -5,7 +5,7 @@ import { AuthLayout } from 'components/layouts' import { FormsContainer } from 'components/ui/Forms' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => { const canReadAuthSettings = useCheckPermissions(PermissionAction.READ, 'custom_config_gotrue') diff --git a/apps/studio/pages/project/[ref]/auth/url-configuration.tsx b/apps/studio/pages/project/[ref]/auth/url-configuration.tsx index e910d8ab261..560632d38ae 100644 --- a/apps/studio/pages/project/[ref]/auth/url-configuration.tsx +++ b/apps/studio/pages/project/[ref]/auth/url-configuration.tsx @@ -6,7 +6,7 @@ import { AuthLayout } from 'components/layouts' import { FormsContainer } from 'components/ui/Forms' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const URLConfiguration: NextPageWithLayout = () => { const canReadAuthSettings = useCheckPermissions(PermissionAction.READ, 'custom_config_gotrue') diff --git a/apps/studio/pages/project/[ref]/auth/users.tsx b/apps/studio/pages/project/[ref]/auth/users.tsx index 1767354d942..45a315c1131 100644 --- a/apps/studio/pages/project/[ref]/auth/users.tsx +++ b/apps/studio/pages/project/[ref]/auth/users.tsx @@ -1,6 +1,6 @@ import { Users } from 'components/interfaces/Auth/Users' import { AuthLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const UsersPage: NextPageWithLayout = () => { return diff --git a/apps/studio/pages/project/[ref]/branches.tsx b/apps/studio/pages/project/[ref]/branches.tsx index dd2573bdab4..cd3e6b107cd 100644 --- a/apps/studio/pages/project/[ref]/branches.tsx +++ b/apps/studio/pages/project/[ref]/branches.tsx @@ -1,6 +1,6 @@ import BranchManagement from 'components/interfaces/BranchManagement/BranchManagement' import { ProjectLayoutWithAuth } from 'components/layouts/ProjectLayout/ProjectLayout' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const BranchManagementPage: NextPageWithLayout = () => { return diff --git a/apps/studio/pages/project/[ref]/building.tsx b/apps/studio/pages/project/[ref]/building.tsx index 88255e3d491..e1e600e0089 100644 --- a/apps/studio/pages/project/[ref]/building.tsx +++ b/apps/studio/pages/project/[ref]/building.tsx @@ -1,7 +1,7 @@ import { ProjectLayoutWithAuth } from 'components/layouts/ProjectLayout/ProjectLayout' import { useRouter } from 'next/router' import { useEffect } from 'react' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ProjectBuildingPage: NextPageWithLayout = () => { return diff --git a/apps/studio/pages/project/[ref]/database/backups/pitr.tsx b/apps/studio/pages/project/[ref]/database/backups/pitr.tsx index 0f6f7c1036c..7e8b641d68a 100644 --- a/apps/studio/pages/project/[ref]/database/backups/pitr.tsx +++ b/apps/studio/pages/project/[ref]/database/backups/pitr.tsx @@ -10,7 +10,7 @@ import UpgradeToPro from 'components/ui/UpgradeToPro' import { useBackupsQuery } from 'data/database/backups-query' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' import { useCheckPermissions, usePermissionsLoaded, useSelectedOrganization } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import DatabaseBackupsNav from 'components/interfaces/Database/Backups/DatabaseBackupsNav' const DatabasePhysicalBackups: NextPageWithLayout = () => { diff --git a/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx b/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx index 9ca82a280f6..d702ce67417 100644 --- a/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx +++ b/apps/studio/pages/project/[ref]/database/backups/scheduled.tsx @@ -11,7 +11,7 @@ import NoPermission from 'components/ui/NoPermission' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useBackupsQuery } from 'data/database/backups-query' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { IconInfo, Tabs } from 'ui' import DatabaseBackupsNav from 'components/interfaces/Database/Backups/DatabaseBackupsNav' diff --git a/apps/studio/pages/project/[ref]/database/extensions.tsx b/apps/studio/pages/project/[ref]/database/extensions.tsx index 171528d9333..c982c9dd42d 100644 --- a/apps/studio/pages/project/[ref]/database/extensions.tsx +++ b/apps/studio/pages/project/[ref]/database/extensions.tsx @@ -5,7 +5,7 @@ import { DatabaseLayout } from 'components/layouts' import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const DatabaseExtensions: NextPageWithLayout = () => { const canReadExtensions = useCheckPermissions( diff --git a/apps/studio/pages/project/[ref]/database/functions.tsx b/apps/studio/pages/project/[ref]/database/functions.tsx index 47765d795f0..bf2d66c8f28 100644 --- a/apps/studio/pages/project/[ref]/database/functions.tsx +++ b/apps/studio/pages/project/[ref]/database/functions.tsx @@ -7,7 +7,7 @@ import { DatabaseLayout } from 'components/layouts' import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const FunctionsPage: NextPageWithLayout = () => { const [selectedFunction, setSelectedFunction] = useState() diff --git a/apps/studio/pages/project/[ref]/database/hooks.tsx b/apps/studio/pages/project/[ref]/database/hooks.tsx index 1ff5a7484a9..1d54496413a 100644 --- a/apps/studio/pages/project/[ref]/database/hooks.tsx +++ b/apps/studio/pages/project/[ref]/database/hooks.tsx @@ -14,7 +14,7 @@ import NoPermission from 'components/ui/NoPermission' import { useHooksEnableMutation } from 'data/database/hooks-enable-mutation' import { useSchemasQuery } from 'data/database/schemas-query' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const HooksPage: NextPageWithLayout = () => { const { project } = useProjectContext() diff --git a/apps/studio/pages/project/[ref]/database/index.tsx b/apps/studio/pages/project/[ref]/database/index.tsx index e5d224ba985..8580eef05bd 100644 --- a/apps/studio/pages/project/[ref]/database/index.tsx +++ b/apps/studio/pages/project/[ref]/database/index.tsx @@ -1,5 +1,5 @@ import { DatabaseLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const Database: NextPageWithLayout = () => { return <>{/*

Use this as a page template for database

*/} diff --git a/apps/studio/pages/project/[ref]/database/indexes.tsx b/apps/studio/pages/project/[ref]/database/indexes.tsx index 97c834a167e..72c8b34d418 100644 --- a/apps/studio/pages/project/[ref]/database/indexes.tsx +++ b/apps/studio/pages/project/[ref]/database/indexes.tsx @@ -1,7 +1,7 @@ import Indexes from 'components/interfaces/Database/Indexes/Indexes' import { DatabaseLayout } from 'components/layouts' import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const IndexesPage: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/database/migrations.tsx b/apps/studio/pages/project/[ref]/database/migrations.tsx index 9d7fc9bc9a0..9e8f9061dae 100644 --- a/apps/studio/pages/project/[ref]/database/migrations.tsx +++ b/apps/studio/pages/project/[ref]/database/migrations.tsx @@ -1,7 +1,7 @@ import Migrations from 'components/interfaces/Database/Migrations/Migrations' import { DatabaseLayout } from 'components/layouts' import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const MigrationsPage: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/database/replication.tsx b/apps/studio/pages/project/[ref]/database/replication.tsx index e6dcabcc7ee..68bb20bab86 100644 --- a/apps/studio/pages/project/[ref]/database/replication.tsx +++ b/apps/studio/pages/project/[ref]/database/replication.tsx @@ -8,7 +8,7 @@ import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' import NoPermission from 'components/ui/NoPermission' import { useDatabasePublicationsQuery } from 'data/database-publications/database-publications-query' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' // [Joshen] Technically, best that we have these as separate URLs // makes it easier to manage state, but foresee that this page might diff --git a/apps/studio/pages/project/[ref]/database/roles.tsx b/apps/studio/pages/project/[ref]/database/roles.tsx index 133f57e796e..6d4f48871ad 100644 --- a/apps/studio/pages/project/[ref]/database/roles.tsx +++ b/apps/studio/pages/project/[ref]/database/roles.tsx @@ -1,7 +1,7 @@ import { RolesList } from 'components/interfaces/Database' import { DatabaseLayout } from 'components/layouts' import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const DatabaseRoles: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/database/schemas.tsx b/apps/studio/pages/project/[ref]/database/schemas.tsx index 5563db13520..390eea29f1f 100644 --- a/apps/studio/pages/project/[ref]/database/schemas.tsx +++ b/apps/studio/pages/project/[ref]/database/schemas.tsx @@ -8,7 +8,7 @@ import AlertError from 'components/ui/AlertError' import SchemaSelector from 'components/ui/SchemaSelector' import { useSchemasQuery } from 'data/database/schemas-query' import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const SchemasPage: NextPageWithLayout = () => { const { project } = useProjectContext() diff --git a/apps/studio/pages/project/[ref]/database/tables.tsx b/apps/studio/pages/project/[ref]/database/tables.tsx index 3401501391b..96804803cd2 100644 --- a/apps/studio/pages/project/[ref]/database/tables.tsx +++ b/apps/studio/pages/project/[ref]/database/tables.tsx @@ -1,15 +1,15 @@ import { useParams } from 'common' import { useState } from 'react' -import { PostgresTable } from '@supabase/postgres-meta' +import type { PostgresTable } from '@supabase/postgres-meta' import { ColumnList, TableList } from 'components/interfaces/Database' import { SidePanelEditor } from 'components/interfaces/TableGridEditor' import DeleteConfirmationDialogs from 'components/interfaces/TableGridEditor/DeleteConfirmationDialogs' import { DatabaseLayout } from 'components/layouts' import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' -import { Table } from 'data/tables/table-query' +import type { Table } from 'data/tables/table-query' import { useTableEditorStateSnapshot } from 'state/table-editor' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import useTable from 'hooks/misc/useTable' const DatabaseTables: NextPageWithLayout = () => { diff --git a/apps/studio/pages/project/[ref]/database/triggers.tsx b/apps/studio/pages/project/[ref]/database/triggers.tsx index dd363817016..4fd2c098dce 100644 --- a/apps/studio/pages/project/[ref]/database/triggers.tsx +++ b/apps/studio/pages/project/[ref]/database/triggers.tsx @@ -7,7 +7,7 @@ import { DatabaseLayout } from 'components/layouts' import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const TriggersPage: NextPageWithLayout = () => { const [selectedTrigger, setSelectedTrigger] = useState() diff --git a/apps/studio/pages/project/[ref]/database/types.tsx b/apps/studio/pages/project/[ref]/database/types.tsx index 6edecf41260..450b9a8fee3 100644 --- a/apps/studio/pages/project/[ref]/database/types.tsx +++ b/apps/studio/pages/project/[ref]/database/types.tsx @@ -9,7 +9,7 @@ import { ScaffoldSectionContent, ScaffoldSectionDetail, } from 'components/layouts/Scaffold' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const DatabaseEnumeratedTypes: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/database/wrappers/[id].tsx b/apps/studio/pages/project/[ref]/database/wrappers/[id].tsx index d7fca6009d8..1259a2c67ed 100644 --- a/apps/studio/pages/project/[ref]/database/wrappers/[id].tsx +++ b/apps/studio/pages/project/[ref]/database/wrappers/[id].tsx @@ -4,7 +4,7 @@ import { EditWrapper } from 'components/interfaces/Database' import { DatabaseLayout } from 'components/layouts' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const DatabaseWrappersNew: NextPageWithLayout = () => { const canReadWrappers = useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_READ, 'wrappers') diff --git a/apps/studio/pages/project/[ref]/database/wrappers/index.tsx b/apps/studio/pages/project/[ref]/database/wrappers/index.tsx index 77da4de2ac5..7b18ac978df 100644 --- a/apps/studio/pages/project/[ref]/database/wrappers/index.tsx +++ b/apps/studio/pages/project/[ref]/database/wrappers/index.tsx @@ -5,7 +5,7 @@ import { DatabaseLayout } from 'components/layouts' import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const DatabaseWrappers: NextPageWithLayout = () => { const canReadWrappers = useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_READ, 'tables') diff --git a/apps/studio/pages/project/[ref]/database/wrappers/new.tsx b/apps/studio/pages/project/[ref]/database/wrappers/new.tsx index 4aa779c2906..0ca29ffc4c0 100644 --- a/apps/studio/pages/project/[ref]/database/wrappers/new.tsx +++ b/apps/studio/pages/project/[ref]/database/wrappers/new.tsx @@ -4,7 +4,7 @@ import { CreateWrapper } from 'components/interfaces/Database' import { DatabaseLayout } from 'components/layouts' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const DatabaseWrappersNew: NextPageWithLayout = () => { const canCreateWrappers = useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_WRITE, 'tables') diff --git a/apps/studio/pages/project/[ref]/editor/[id].tsx b/apps/studio/pages/project/[ref]/editor/[id].tsx index 1b84514ea61..f392a1f4e77 100644 --- a/apps/studio/pages/project/[ref]/editor/[id].tsx +++ b/apps/studio/pages/project/[ref]/editor/[id].tsx @@ -6,7 +6,7 @@ import { TableEditorLayout } from 'components/layouts' import { ProjectContextFromParamsProvider } from 'components/layouts/ProjectLayout/ProjectContext' import useTable from 'hooks/misc/useTable' import { useRouter } from 'next/router' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const TableEditorPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/project/[ref]/editor/index.tsx b/apps/studio/pages/project/[ref]/editor/index.tsx index 55c2cfe0189..f5773b81f96 100644 --- a/apps/studio/pages/project/[ref]/editor/index.tsx +++ b/apps/studio/pages/project/[ref]/editor/index.tsx @@ -4,8 +4,8 @@ import { useParams } from 'common' import { EmptyState, SidePanelEditor } from 'components/interfaces/TableGridEditor' import { TableEditorLayout } from 'components/layouts' import { ProjectContextFromParamsProvider } from 'components/layouts/ProjectLayout/ProjectContext' -import { Table } from 'data/tables/table-query' -import { NextPageWithLayout } from 'types' +import type { Table } from 'data/tables/table-query' +import type { NextPageWithLayout } from 'types' const TableEditorPage: NextPageWithLayout = () => { const { ref: projectRef } = useParams() diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/details.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/details.tsx index 030918419f7..88e563b343f 100644 --- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/details.tsx +++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/details.tsx @@ -1,6 +1,6 @@ import { EdgeFunctionDetails } from 'components/interfaces/Functions' import FunctionsLayout from 'components/layouts/FunctionsLayout' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => PageLayout.getLayout = (page) => {page} diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx index 1ddd875a970..0316665378a 100644 --- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx +++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/index.tsx @@ -17,7 +17,7 @@ import { useFunctionsResourceUsageQuery } from 'data/analytics/functions-resourc import { useEdgeFunctionQuery } from 'data/edge-functions/edge-function-query' import { useCheckPermissions } from 'hooks' import useFillTimeseriesSorted from 'hooks/analytics/useFillTimeseriesSorted' -import { ChartIntervals, NextPageWithLayout } from 'types' +import type { ChartIntervals, NextPageWithLayout } from 'types' const CHART_INTERVALS: ChartIntervals[] = [ { diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/invocations.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/invocations.tsx index 409d295fb8a..94d90a18b09 100644 --- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/invocations.tsx +++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/invocations.tsx @@ -3,7 +3,7 @@ import { useParams } from 'common' import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer' import FunctionsLayout from 'components/layouts/FunctionsLayout' import { useEdgeFunctionQuery } from 'data/edge-functions/edge-function-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' /** * Placeholder page for logs previewers until we figure out where to slot them diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/logs.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/logs.tsx index 404985c654a..429241aeda1 100644 --- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/logs.tsx +++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/logs.tsx @@ -1,5 +1,5 @@ import { observer } from 'mobx-react-lite' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { useParams } from 'common/hooks' import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer' import FunctionsLayout from 'components/layouts/FunctionsLayout' diff --git a/apps/studio/pages/project/[ref]/functions/index.tsx b/apps/studio/pages/project/[ref]/functions/index.tsx index fb4755a8794..bfd9e6b3260 100644 --- a/apps/studio/pages/project/[ref]/functions/index.tsx +++ b/apps/studio/pages/project/[ref]/functions/index.tsx @@ -12,7 +12,7 @@ import Table from 'components/to-be-cleaned/Table' import AlertError from 'components/ui/AlertError' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => { const { ref } = useParams() diff --git a/apps/studio/pages/project/[ref]/index.tsx b/apps/studio/pages/project/[ref]/index.tsx index a64e832739a..2e6b233a64c 100644 --- a/apps/studio/pages/project/[ref]/index.tsx +++ b/apps/studio/pages/project/[ref]/index.tsx @@ -12,7 +12,7 @@ import ProjectUpgradeFailedBanner from 'components/ui/ProjectUpgradeFailedBanner import { useSelectedProject } from 'hooks' import { IS_PLATFORM, PROJECT_STATUS } from 'lib/constants' import { useAppStateSnapshot } from 'state/app-state' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const Home: NextPageWithLayout = () => { const project = useSelectedProject() diff --git a/apps/studio/pages/project/[ref]/logs/auth-logs.tsx b/apps/studio/pages/project/[ref]/logs/auth-logs.tsx index de0f83e1d43..61ba4ceaddb 100644 --- a/apps/studio/pages/project/[ref]/logs/auth-logs.tsx +++ b/apps/studio/pages/project/[ref]/logs/auth-logs.tsx @@ -5,7 +5,7 @@ import { LogsLayout } from 'components/layouts' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import NoPermission from 'components/ui/NoPermission' import { useCheckPermissions } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const LogsPage: NextPageWithLayout = () => { const { project } = useProjectContext() diff --git a/apps/studio/pages/project/[ref]/logs/edge-logs.tsx b/apps/studio/pages/project/[ref]/logs/edge-logs.tsx index 94fc37d0a85..4d2c517b187 100644 --- a/apps/studio/pages/project/[ref]/logs/edge-logs.tsx +++ b/apps/studio/pages/project/[ref]/logs/edge-logs.tsx @@ -2,7 +2,7 @@ import { useRouter } from 'next/router' import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer' import { LogsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' export const LogPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/project/[ref]/logs/explorer/index.tsx b/apps/studio/pages/project/[ref]/logs/explorer/index.tsx index 0980bc94b3c..23d42bef428 100644 --- a/apps/studio/pages/project/[ref]/logs/explorer/index.tsx +++ b/apps/studio/pages/project/[ref]/logs/explorer/index.tsx @@ -37,7 +37,7 @@ import useLogsQuery from 'hooks/analytics/useLogsQuery' import { useUpgradePrompt } from 'hooks/misc/useUpgradePrompt' import { LOCAL_STORAGE_KEYS } from 'lib/constants' import { uuidv4 } from 'lib/helpers' -import { LogSqlSnippets, NextPageWithLayout } from 'types' +import type { LogSqlSnippets, NextPageWithLayout } from 'types' const PLACEHOLDER_QUERY = 'select\n cast(timestamp as datetime) as timestamp,\n event_message, metadata \nfrom edge_logs \nlimit 5' diff --git a/apps/studio/pages/project/[ref]/logs/explorer/recent.tsx b/apps/studio/pages/project/[ref]/logs/explorer/recent.tsx index 23f0851b43b..65d3cd86987 100644 --- a/apps/studio/pages/project/[ref]/logs/explorer/recent.tsx +++ b/apps/studio/pages/project/[ref]/logs/explorer/recent.tsx @@ -7,7 +7,7 @@ import LogsLayout from 'components/layouts/LogsLayout/LogsLayout' import Table from 'components/to-be-cleaned/Table' import LogsExplorerHeader from 'components/ui/Logs/LogsExplorerHeader' import { useLocalStorage } from 'hooks' -import { LogSqlSnippets, NextPageWithLayout } from 'types' +import type { LogSqlSnippets, NextPageWithLayout } from 'types' export const LogsSavedPage: NextPageWithLayout = () => { const { ref } = useParams() diff --git a/apps/studio/pages/project/[ref]/logs/explorer/saved.tsx b/apps/studio/pages/project/[ref]/logs/explorer/saved.tsx index 6b121f1ae30..6549bb5823f 100644 --- a/apps/studio/pages/project/[ref]/logs/explorer/saved.tsx +++ b/apps/studio/pages/project/[ref]/logs/explorer/saved.tsx @@ -7,7 +7,7 @@ import { LogsLayout } from 'components/layouts' import Table from 'components/to-be-cleaned/Table' import LogsExplorerHeader from 'components/ui/Logs/LogsExplorerHeader' import { useContentQuery } from 'data/content/content-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' export const LogsSavedPage: NextPageWithLayout = () => { const { ref } = useParams() diff --git a/apps/studio/pages/project/[ref]/logs/explorer/templates.tsx b/apps/studio/pages/project/[ref]/logs/explorer/templates.tsx index 59e3814d89b..633da843ac6 100644 --- a/apps/studio/pages/project/[ref]/logs/explorer/templates.tsx +++ b/apps/studio/pages/project/[ref]/logs/explorer/templates.tsx @@ -6,7 +6,7 @@ import { LogTemplate, TEMPLATES } from 'components/interfaces/Settings/Logs' import LogsLayout from 'components/layouts/LogsLayout/LogsLayout' import CardButton from 'components/ui/CardButton' import LogsExplorerHeader from 'components/ui/Logs/LogsExplorerHeader' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' export const LogsTemplatesPage: NextPageWithLayout = () => { const { ref: projectRef } = useParams() diff --git a/apps/studio/pages/project/[ref]/logs/pooler-logs.tsx b/apps/studio/pages/project/[ref]/logs/pooler-logs.tsx index 1b69384a7e1..ac8d3c81a2a 100644 --- a/apps/studio/pages/project/[ref]/logs/pooler-logs.tsx +++ b/apps/studio/pages/project/[ref]/logs/pooler-logs.tsx @@ -4,7 +4,7 @@ import { LogsTableName } from 'components/interfaces/Settings/Logs' import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer' import { LogsLayout } from 'components/layouts' import { usePoolingConfigurationQuery } from 'data/database/pooling-configuration-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { Loading } from 'components/ui/Loading' export const LogPage: NextPageWithLayout = () => { diff --git a/apps/studio/pages/project/[ref]/logs/postgres-logs.tsx b/apps/studio/pages/project/[ref]/logs/postgres-logs.tsx index 796854e036d..e8277e57f10 100644 --- a/apps/studio/pages/project/[ref]/logs/postgres-logs.tsx +++ b/apps/studio/pages/project/[ref]/logs/postgres-logs.tsx @@ -2,7 +2,7 @@ import { useRouter } from 'next/router' import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer' import { LogsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' export const LogPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx b/apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx index e3499994612..9d265ead1dc 100644 --- a/apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx +++ b/apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx @@ -3,7 +3,7 @@ import { useRouter } from 'next/router' import { LogsTableName } from 'components/interfaces/Settings/Logs' import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer' import { LogsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' export const LogPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/project/[ref]/logs/realtime-logs.tsx b/apps/studio/pages/project/[ref]/logs/realtime-logs.tsx index 06a216fad65..edc0fbff207 100644 --- a/apps/studio/pages/project/[ref]/logs/realtime-logs.tsx +++ b/apps/studio/pages/project/[ref]/logs/realtime-logs.tsx @@ -2,7 +2,7 @@ import { useRouter } from 'next/router' import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer' import { LogsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' export const LogPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/project/[ref]/logs/storage-logs.tsx b/apps/studio/pages/project/[ref]/logs/storage-logs.tsx index 40b8ee28b31..3aceb7b19a9 100644 --- a/apps/studio/pages/project/[ref]/logs/storage-logs.tsx +++ b/apps/studio/pages/project/[ref]/logs/storage-logs.tsx @@ -2,7 +2,7 @@ import { useRouter } from 'next/router' import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer' import { LogsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' export const LogPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/project/[ref]/realtime/inspector.tsx b/apps/studio/pages/project/[ref]/realtime/inspector.tsx index e23f5f7f97c..3d3c3efe2f2 100644 --- a/apps/studio/pages/project/[ref]/realtime/inspector.tsx +++ b/apps/studio/pages/project/[ref]/realtime/inspector.tsx @@ -1,5 +1,5 @@ import { PermissionAction } from '@supabase/shared-types/out/constants' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { RealtimeInspector } from 'components/interfaces/Realtime/Inspector' import RealtimeLayout from 'components/layouts/RealtimeLayout/RealtimeLayout' diff --git a/apps/studio/pages/project/[ref]/reports/[id].tsx b/apps/studio/pages/project/[ref]/reports/[id].tsx index 05069cb2c68..fd048568f65 100644 --- a/apps/studio/pages/project/[ref]/reports/[id].tsx +++ b/apps/studio/pages/project/[ref]/reports/[id].tsx @@ -1,7 +1,7 @@ import Reports from 'components/interfaces/Reports/Reports' import { ReportsLayout } from 'components/layouts' import EditReportModal from 'components/to-be-cleaned/Reports/EditReportModal' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => ( <> diff --git a/apps/studio/pages/project/[ref]/reports/database.tsx b/apps/studio/pages/project/[ref]/reports/database.tsx index 08308123808..e55d4e0983b 100644 --- a/apps/studio/pages/project/[ref]/reports/database.tsx +++ b/apps/studio/pages/project/[ref]/reports/database.tsx @@ -20,10 +20,10 @@ import DateRangePicker from 'components/to-be-cleaned/DateRangePicker' import Table from 'components/to-be-cleaned/Table' import Panel from 'components/ui/Panel' import { useDatabaseSizeQuery } from 'data/database/database-size-query' -import { DbQueryHook } from 'hooks/analytics/useDbQuery' +import type { DbQueryHook } from 'hooks/analytics/useDbQuery' import { TIME_PERIODS_INFRA } from 'lib/constants/metrics' import { formatBytes } from 'lib/helpers' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const DatabaseReport: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/reports/index.tsx b/apps/studio/pages/project/[ref]/reports/index.tsx index 5bf2027ab5f..bbcb2d7d49c 100644 --- a/apps/studio/pages/project/[ref]/reports/index.tsx +++ b/apps/studio/pages/project/[ref]/reports/index.tsx @@ -10,7 +10,7 @@ import { Loading } from 'components/ui/Loading' import { useCheckPermissions, useStore } from 'hooks' import { useProfile } from 'lib/profile' import { useProjectContentStore } from 'stores/projectContentStore' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { CreateReportModal } from 'components/interfaces/Reports/Reports.CreateReportModal' export const UserReportPage: NextPageWithLayout = () => { diff --git a/apps/studio/pages/project/[ref]/reports/query-performance.tsx b/apps/studio/pages/project/[ref]/reports/query-performance.tsx index 224d28e89ac..ac235d68aa5 100644 --- a/apps/studio/pages/project/[ref]/reports/query-performance.tsx +++ b/apps/studio/pages/project/[ref]/reports/query-performance.tsx @@ -34,7 +34,7 @@ import Table from 'components/to-be-cleaned/Table' import ShimmeringLoader from 'components/ui/ShimmeringLoader' import { executeSql } from 'data/sql/execute-sql-query' import { useFlag } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' type QueryPerformancePreset = 'time' | 'frequent' | 'slowest' diff --git a/apps/studio/pages/project/[ref]/reports/storage.tsx b/apps/studio/pages/project/[ref]/reports/storage.tsx index fc77bdd08d1..80a147f492e 100644 --- a/apps/studio/pages/project/[ref]/reports/storage.tsx +++ b/apps/studio/pages/project/[ref]/reports/storage.tsx @@ -1,5 +1,5 @@ import { observer } from 'mobx-react-lite' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { ReportsLayout } from 'components/layouts' import { PRESET_CONFIG, diff --git a/apps/studio/pages/project/[ref]/settings/addons.tsx b/apps/studio/pages/project/[ref]/settings/addons.tsx index b6c18133f2d..f2ecf92b3d0 100644 --- a/apps/studio/pages/project/[ref]/settings/addons.tsx +++ b/apps/studio/pages/project/[ref]/settings/addons.tsx @@ -1,6 +1,6 @@ import Addons from 'components/interfaces/Settings/Addons/Addons' import { SettingsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ProjectAddons: NextPageWithLayout = () => { return diff --git a/apps/studio/pages/project/[ref]/settings/api.tsx b/apps/studio/pages/project/[ref]/settings/api.tsx index 658356e69e4..2f4446fdaf2 100644 --- a/apps/studio/pages/project/[ref]/settings/api.tsx +++ b/apps/studio/pages/project/[ref]/settings/api.tsx @@ -1,6 +1,6 @@ import ServiceList from 'components/interfaces/Settings/API/ServiceList' import { SettingsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ApiSettings: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/settings/auth.tsx b/apps/studio/pages/project/[ref]/settings/auth.tsx index a96017e7b15..4183bf35886 100644 --- a/apps/studio/pages/project/[ref]/settings/auth.tsx +++ b/apps/studio/pages/project/[ref]/settings/auth.tsx @@ -10,7 +10,7 @@ import { FormHeader } from 'components/ui/Forms' import NoPermission from 'components/ui/NoPermission' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useCheckPermissions, usePermissionsLoaded } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const AuthSettings: NextPageWithLayout = () => { const isPermissionsLoaded = usePermissionsLoaded() diff --git a/apps/studio/pages/project/[ref]/settings/billing/usage.tsx b/apps/studio/pages/project/[ref]/settings/billing/usage.tsx index 77a4e9b1624..2a84f5e0c0c 100644 --- a/apps/studio/pages/project/[ref]/settings/billing/usage.tsx +++ b/apps/studio/pages/project/[ref]/settings/billing/usage.tsx @@ -1,5 +1,5 @@ import { SettingsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { useRouter } from 'next/router' import { useEffect } from 'react' import { useSelectedOrganization } from 'hooks' diff --git a/apps/studio/pages/project/[ref]/settings/database.tsx b/apps/studio/pages/project/[ref]/settings/database.tsx index 86395618170..f4ceecc5eea 100644 --- a/apps/studio/pages/project/[ref]/settings/database.tsx +++ b/apps/studio/pages/project/[ref]/settings/database.tsx @@ -5,7 +5,7 @@ import { } from 'components/interfaces/Settings/Database' import { SettingsLayout } from 'components/layouts' import { observer } from 'mobx-react-lite' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import BannedIPs from 'components/interfaces/Settings/Database/BannedIPs' import { DatabaseReadOnlyAlert } from 'components/interfaces/Settings/Database/DatabaseReadOnlyAlert' diff --git a/apps/studio/pages/project/[ref]/settings/functions.tsx b/apps/studio/pages/project/[ref]/settings/functions.tsx index cffa8f66673..e13db6297db 100644 --- a/apps/studio/pages/project/[ref]/settings/functions.tsx +++ b/apps/studio/pages/project/[ref]/settings/functions.tsx @@ -1,6 +1,6 @@ import EdgeFunctionSecrets from 'components/interfaces/Functions/EdgeFunctionSecrets/EdgeFunctionSecrets' import { SettingsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/settings/general.tsx b/apps/studio/pages/project/[ref]/settings/general.tsx index 7d15f69fe2b..8abcbe7f75a 100644 --- a/apps/studio/pages/project/[ref]/settings/general.tsx +++ b/apps/studio/pages/project/[ref]/settings/general.tsx @@ -7,7 +7,7 @@ import { import { SettingsLayout } from 'components/layouts' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { useIsFeatureEnabled } from 'hooks' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ProjectSettings: NextPageWithLayout = () => { const { project } = useProjectContext() diff --git a/apps/studio/pages/project/[ref]/settings/index.tsx b/apps/studio/pages/project/[ref]/settings/index.tsx index de9d7c708d1..80acf1c70ca 100644 --- a/apps/studio/pages/project/[ref]/settings/index.tsx +++ b/apps/studio/pages/project/[ref]/settings/index.tsx @@ -1,7 +1,7 @@ import { observer } from 'mobx-react-lite' import { SettingsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const Settings: NextPageWithLayout = () => { return <>{/*

Use this as a page template for settings pages

*/} diff --git a/apps/studio/pages/project/[ref]/settings/infrastructure.tsx b/apps/studio/pages/project/[ref]/settings/infrastructure.tsx index a5456c9de88..3c640727222 100644 --- a/apps/studio/pages/project/[ref]/settings/infrastructure.tsx +++ b/apps/studio/pages/project/[ref]/settings/infrastructure.tsx @@ -2,7 +2,7 @@ import InfrastructureActivity from 'components/interfaces/Settings/Infrastructur import InfrastructureInfo from 'components/interfaces/Settings/Infrastructure/InfrastructureInfo' import { SettingsLayout } from 'components/layouts' import { ScaffoldDivider } from 'components/layouts/Scaffold' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ProjectInfrastructure: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/settings/integrations.tsx b/apps/studio/pages/project/[ref]/settings/integrations.tsx index bb9bbc89de2..dbd9a203c0e 100644 --- a/apps/studio/pages/project/[ref]/settings/integrations.tsx +++ b/apps/studio/pages/project/[ref]/settings/integrations.tsx @@ -1,6 +1,6 @@ import IntegrationSettings from 'components/interfaces/Settings/Integrations/IntegrationsSettings' import { SettingsLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const OrgIntegrationSettings: NextPageWithLayout = () => { return diff --git a/apps/studio/pages/project/[ref]/settings/storage.tsx b/apps/studio/pages/project/[ref]/settings/storage.tsx index 96caad2fbdb..ecbcb6b4fdc 100644 --- a/apps/studio/pages/project/[ref]/settings/storage.tsx +++ b/apps/studio/pages/project/[ref]/settings/storage.tsx @@ -1,6 +1,6 @@ import { SettingsLayout } from 'components/layouts' import { StorageSettings } from 'components/to-be-cleaned/Storage' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/project/[ref]/settings/vault/keys.tsx b/apps/studio/pages/project/[ref]/settings/vault/keys.tsx index a3716a453bf..20d4f47830b 100644 --- a/apps/studio/pages/project/[ref]/settings/vault/keys.tsx +++ b/apps/studio/pages/project/[ref]/settings/vault/keys.tsx @@ -7,7 +7,7 @@ import { SettingsLayout } from 'components/layouts' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { FormHeader } from 'components/ui/Forms' import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-extensions-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import ShimmeringLoader from 'components/ui/ShimmeringLoader' import Link from 'next/link' import VaultNavTabs from 'components/interfaces/Settings/Vault/VaultNavTabs' diff --git a/apps/studio/pages/project/[ref]/settings/vault/secrets.tsx b/apps/studio/pages/project/[ref]/settings/vault/secrets.tsx index 503d5108564..8140d093233 100644 --- a/apps/studio/pages/project/[ref]/settings/vault/secrets.tsx +++ b/apps/studio/pages/project/[ref]/settings/vault/secrets.tsx @@ -6,7 +6,7 @@ import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectConte import { FormHeader } from 'components/ui/Forms' import ShimmeringLoader from 'components/ui/ShimmeringLoader' import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-extensions-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import VaultNavTabs from 'components/interfaces/Settings/Vault/VaultNavTabs' const VaultSettingsSecrets: NextPageWithLayout = () => { diff --git a/apps/studio/pages/project/[ref]/sql/[id].tsx b/apps/studio/pages/project/[ref]/sql/[id].tsx index eeca39984aa..accfced29d6 100644 --- a/apps/studio/pages/project/[ref]/sql/[id].tsx +++ b/apps/studio/pages/project/[ref]/sql/[id].tsx @@ -9,7 +9,7 @@ import { useKeywordsQuery } from 'data/database/keywords-query' import { useSchemasQuery } from 'data/database/schemas-query' import { useTableColumnsQuery } from 'data/database/table-columns-query' import { useFormatQueryMutation } from 'data/sql/format-sql-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import SQLEditor from 'components/interfaces/SQLEditor/SQLEditor' import { SQLEditorLayout } from 'components/layouts' diff --git a/apps/studio/pages/project/[ref]/sql/quickstarts.tsx b/apps/studio/pages/project/[ref]/sql/quickstarts.tsx index 5b2edba2fdc..fe8ae458afe 100644 --- a/apps/studio/pages/project/[ref]/sql/quickstarts.tsx +++ b/apps/studio/pages/project/[ref]/sql/quickstarts.tsx @@ -1,5 +1,5 @@ import { observer } from 'mobx-react-lite' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { SQLEditorLayout } from 'components/layouts' import SQLQuickstarts from 'components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts' diff --git a/apps/studio/pages/project/[ref]/sql/templates.tsx b/apps/studio/pages/project/[ref]/sql/templates.tsx index 050b608233b..9a12c0a78bf 100644 --- a/apps/studio/pages/project/[ref]/sql/templates.tsx +++ b/apps/studio/pages/project/[ref]/sql/templates.tsx @@ -1,5 +1,5 @@ import { observer } from 'mobx-react-lite' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' import { SQLEditorLayout } from 'components/layouts' import SQLTemplates from 'components/interfaces/SQLEditor/SQLTemplates/SQLTemplates' diff --git a/apps/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx b/apps/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx index e631591593c..38559efc142 100644 --- a/apps/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx +++ b/apps/studio/pages/project/[ref]/storage/buckets/[bucketId].tsx @@ -7,7 +7,7 @@ import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectConte import StorageBucketsError from 'components/layouts/StorageLayout/StorageBucketsError' import { StorageExplorer } from 'components/to-be-cleaned/Storage' import { useBucketsQuery } from 'data/storage/buckets-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const PageLayout: NextPageWithLayout = () => { const { ref, bucketId } = useParams() diff --git a/apps/studio/pages/project/[ref]/storage/buckets/index.tsx b/apps/studio/pages/project/[ref]/storage/buckets/index.tsx index 072f853fb75..e92ef391bc8 100644 --- a/apps/studio/pages/project/[ref]/storage/buckets/index.tsx +++ b/apps/studio/pages/project/[ref]/storage/buckets/index.tsx @@ -5,7 +5,7 @@ import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectConte import StorageBucketsError from 'components/layouts/StorageLayout/StorageBucketsError' import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState' import { useBucketsQuery } from 'data/storage/buckets-query' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' /** * PageLayout is used to setup layout - as usual it will requires inject global store diff --git a/apps/studio/pages/project/[ref]/storage/index.tsx b/apps/studio/pages/project/[ref]/storage/index.tsx index 884d5909fff..23206ef662a 100644 --- a/apps/studio/pages/project/[ref]/storage/index.tsx +++ b/apps/studio/pages/project/[ref]/storage/index.tsx @@ -1,7 +1,7 @@ import { observer } from 'mobx-react-lite' import { StorageLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const Storage: NextPageWithLayout = () => { return <>{/*

Use this as a template for storage pages

*/} diff --git a/apps/studio/pages/project/[ref]/storage/policies.tsx b/apps/studio/pages/project/[ref]/storage/policies.tsx index 2a99d20adac..f0cbe7b0b8d 100644 --- a/apps/studio/pages/project/[ref]/storage/policies.tsx +++ b/apps/studio/pages/project/[ref]/storage/policies.tsx @@ -1,6 +1,6 @@ import { StorageLayout } from 'components/layouts' import { StoragePolicies } from 'components/to-be-cleaned/Storage' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const StoragePoliciesPage: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/projects.tsx b/apps/studio/pages/projects.tsx index 05ebe5d58c0..9a2fc5231f0 100644 --- a/apps/studio/pages/projects.tsx +++ b/apps/studio/pages/projects.tsx @@ -10,7 +10,7 @@ import { useOrganizationsQuery } from 'data/organizations/organizations-query' import { useAutoProjectsPrefetch } from 'data/projects/projects-query' import { useFlag, useIsFeatureEnabled } from 'hooks' import { IS_PLATFORM, LOCAL_STORAGE_KEYS } from 'lib/constants' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ProjectsPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/reset-password.tsx b/apps/studio/pages/reset-password.tsx index f691d5a91e7..d8dbf7bcd8f 100644 --- a/apps/studio/pages/reset-password.tsx +++ b/apps/studio/pages/reset-password.tsx @@ -2,7 +2,7 @@ import ResetPasswordForm from 'components/interfaces/SignIn/ResetPasswordForm' import { ForgotPasswordLayout } from 'components/layouts' import { withAuth } from 'hooks' import Link from 'next/link' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const ResetPasswordPage: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/sign-in-mfa.tsx b/apps/studio/pages/sign-in-mfa.tsx index d72348b7431..1eeb20fe3be 100644 --- a/apps/studio/pages/sign-in-mfa.tsx +++ b/apps/studio/pages/sign-in-mfa.tsx @@ -9,7 +9,7 @@ import { SignInLayout } from 'components/layouts' import { Loading } from 'components/ui/Loading' import { auth, buildPathWithParams, getAccessToken, getReturnToPath } from 'lib/gotrue' import Telemetry from 'lib/telemetry' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const SignInMfaPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/sign-in-sso.tsx b/apps/studio/pages/sign-in-sso.tsx index fe1896dfc5b..348d36f5ba7 100644 --- a/apps/studio/pages/sign-in-sso.tsx +++ b/apps/studio/pages/sign-in-sso.tsx @@ -1,6 +1,6 @@ import SignInSSOForm from 'components/interfaces/SignIn/SignInSSOForm' import { SignInLayout } from 'components/layouts' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const SignInSSOPage: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/sign-in.tsx b/apps/studio/pages/sign-in.tsx index 6609705ddb5..e9d03e1caea 100644 --- a/apps/studio/pages/sign-in.tsx +++ b/apps/studio/pages/sign-in.tsx @@ -7,7 +7,7 @@ import { SignInLayout } from 'components/layouts' import { IS_PLATFORM } from 'lib/constants' import { useRouter } from 'next/router' import { useEffect } from 'react' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const SignInPage: NextPageWithLayout = () => { const router = useRouter() diff --git a/apps/studio/pages/sign-up.tsx b/apps/studio/pages/sign-up.tsx index 81e9aff76a3..4dc6e50ad33 100644 --- a/apps/studio/pages/sign-up.tsx +++ b/apps/studio/pages/sign-up.tsx @@ -2,7 +2,7 @@ import SignInWithGitHub from 'components/interfaces/SignIn/SignInWithGitHub' import SignUpForm from 'components/interfaces/SignIn/SignUpForm' import { SignInLayout } from 'components/layouts' import Link from 'next/link' -import { NextPageWithLayout } from 'types' +import type { NextPageWithLayout } from 'types' const SignUpPage: NextPageWithLayout = () => { return ( diff --git a/apps/studio/pages/vercel/integrate.tsx b/apps/studio/pages/vercel/integrate.tsx index 04a8e2183c2..ea09d378697 100644 --- a/apps/studio/pages/vercel/integrate.tsx +++ b/apps/studio/pages/vercel/integrate.tsx @@ -6,7 +6,7 @@ import { useRouter } from 'next/router' import { ChangeEvent, createContext, useContext, useEffect, useState } from 'react' import { toast } from 'react-hot-toast' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import VercelIntegrationLayout from 'components/layouts/VercelIntegrationLayout' import { createVercelEnv, diff --git a/apps/studio/pages/vercel/setupProject.tsx b/apps/studio/pages/vercel/setupProject.tsx index c1a90490f38..4fa8bed92e3 100644 --- a/apps/studio/pages/vercel/setupProject.tsx +++ b/apps/studio/pages/vercel/setupProject.tsx @@ -7,7 +7,7 @@ import { ChangeEvent, createContext, useContext, useEffect, useRef, useState } f import { toast } from 'react-hot-toast' import { Button, Input, Listbox } from 'ui' -import { Dictionary } from 'types' +import type { Dictionary } from 'types' import VercelIntegrationLayout from 'components/layouts/VercelIntegrationLayout' import { createVercelEnv, diff --git a/apps/studio/state/sql-editor.ts b/apps/studio/state/sql-editor.ts index fdc98e1b0ab..6764bdac3ac 100644 --- a/apps/studio/state/sql-editor.ts +++ b/apps/studio/state/sql-editor.ts @@ -4,8 +4,8 @@ import { proxy, snapshot, subscribe, useSnapshot } from 'valtio' import { devtools, proxySet } from 'valtio/utils' import { upsertContent, UpsertContentPayload } from 'data/content/content-upsert-mutation' -import { SqlSnippet } from 'data/content/sql-snippets-query' -import { SqlSnippets } from 'types' +import type { SqlSnippet } from 'data/content/sql-snippets-query' +import type { SqlSnippets } from 'types' export type StateSnippet = { snippet: SqlSnippet diff --git a/apps/studio/state/table-editor.tsx b/apps/studio/state/table-editor.tsx index 4103dfcbfd1..cc1f72ea2b3 100644 --- a/apps/studio/state/table-editor.tsx +++ b/apps/studio/state/table-editor.tsx @@ -1,8 +1,8 @@ -import { PostgresColumn } from '@supabase/postgres-meta' -import { SupaRow } from 'components/grid' -import { Dictionary } from 'types' +import type { PostgresColumn } from '@supabase/postgres-meta' +import type { SupaRow } from 'components/grid' +import type { Dictionary } from 'types' import { ForeignRowSelectorProps } from 'components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/ForeignRowSelector/ForeignRowSelector' -import { JsonEditValue } from 'components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.types' +import type { JsonEditValue } from 'components/interfaces/TableGridEditor/SidePanelEditor/RowEditor/RowEditor.types' import { PropsWithChildren, createContext, useContext, useRef } from 'react' import { proxy, useSnapshot } from 'valtio' diff --git a/apps/studio/stores/RootStore.ts b/apps/studio/stores/RootStore.ts index c428eec6a4b..0f59e15a128 100644 --- a/apps/studio/stores/RootStore.ts +++ b/apps/studio/stores/RootStore.ts @@ -1,6 +1,6 @@ import { configure } from 'mobx' -import { Project } from 'data/projects/project-detail-query' +import type { Project } from 'data/projects/project-detail-query' import UiStore, { IUiStore } from './UiStore' import MetaStore, { IMetaStore } from './pgmeta/MetaStore' diff --git a/apps/studio/stores/UiStore.ts b/apps/studio/stores/UiStore.ts index 91734dd99de..345bbbb3fa8 100644 --- a/apps/studio/stores/UiStore.ts +++ b/apps/studio/stores/UiStore.ts @@ -1,8 +1,8 @@ import { action, makeAutoObservable } from 'mobx' import { uuidv4 } from 'lib/helpers' -import { Notification } from 'types' -import { IRootStore } from './RootStore' +import type { Notification } from 'types' +import type { IRootStore } from './RootStore' export interface IUiStore { language: 'en-US' diff --git a/apps/studio/stores/authConfig/schema/AuthProviders/AuthTemplatesValidation.tsx b/apps/studio/stores/authConfig/schema/AuthProviders/AuthTemplatesValidation.tsx index e14db176c22..466aa4945e5 100644 --- a/apps/studio/stores/authConfig/schema/AuthProviders/AuthTemplatesValidation.tsx +++ b/apps/studio/stores/authConfig/schema/AuthProviders/AuthTemplatesValidation.tsx @@ -1,4 +1,4 @@ -import { FormSchema } from 'types' +import type { FormSchema } from 'types' import { object, string } from 'yup' const JSON_SCHEMA_VERSION = 'http://json-schema.org/draft-07/schema#' diff --git a/apps/studio/stores/pgmeta/MetaStore.ts b/apps/studio/stores/pgmeta/MetaStore.ts index 7dee87467ad..87b23323129 100644 --- a/apps/studio/stores/pgmeta/MetaStore.ts +++ b/apps/studio/stores/pgmeta/MetaStore.ts @@ -2,9 +2,9 @@ import { makeObservable } from 'mobx' import { post } from 'lib/common/fetch' import { API_URL, IS_PLATFORM } from 'lib/constants' -import { ResponseError } from 'types' +import type { ResponseError } from 'types' -import { IRootStore } from '../RootStore' +import type { IRootStore } from '../RootStore' export interface IMetaStore { projectRef?: string diff --git a/apps/studio/stores/projectContentStore.ts b/apps/studio/stores/projectContentStore.ts index 6abf8092fe0..cac7ff84f35 100644 --- a/apps/studio/stores/projectContentStore.ts +++ b/apps/studio/stores/projectContentStore.ts @@ -1,7 +1,7 @@ import { makeObservable, observable, computed } from 'mobx' import { get, patch, post, delete_ } from 'lib/common/fetch' import { keyBy } from 'lodash' -import { UserContent } from 'types' +import type { UserContent } from 'types' import { API_URL } from 'lib/constants' /** diff --git a/apps/studio/types/next.ts b/apps/studio/types/next.ts index 440e552e411..1748d732da0 100644 --- a/apps/studio/types/next.ts +++ b/apps/studio/types/next.ts @@ -1,6 +1,6 @@ -import { NextPage } from 'next' -import { AppProps } from 'next/app' -import { ComponentType, ReactElement, ReactNode } from 'react' +import type { NextPage } from 'next' +import type { AppProps } from 'next/app' +import type { ComponentType, ReactElement, ReactNode } from 'react' export type AppPropsWithLayout = AppProps<{ dehydratedState: any }> & { Component: NextPageWithLayout From 7ce6958030508ec2acf14cba2d557c874a658546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thor=20=E9=9B=B7=E7=A5=9E=20Schaeff?= <5748289+thorwebdev@users.noreply.github.com> Date: Mon, 4 Mar 2024 22:24:32 +0800 Subject: [PATCH 002/163] feat: add rbac claim auth hook. (#21263) * feat: add rbac claim auth hook. * feat: get user role from jwt. * chore: update full-schema. * feat: add RBAC guide. * feat: use plpgsql. * Apply suggestions from code review Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * chore: make top level claim. * chore: set search_paths. * chore: accessing custom claims. --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../NavigationMenu.constants.ts | 4 + apps/docs/content/guides/auth/auth-hooks.mdx | 2 +- ...ims-and-role-based-access-control-rbac.mdx | 278 ++++++++ .../slack-clone/nextjs-slack-clone/README.md | 169 +---- .../nextjs-slack-clone/components/Layout.js | 7 +- .../nextjs-slack-clone/components/Message.js | 7 +- .../nextjs-slack-clone/full-schema.sql | 105 ++- .../nextjs-slack-clone/lib/Store.js | 61 +- .../nextjs-slack-clone/package-lock.json | 611 +++++------------- .../nextjs-slack-clone/package.json | 4 +- .../nextjs-slack-clone/pages/_app.js | 24 +- .../nextjs-slack-clone/supabase/.gitignore | 4 + .../nextjs-slack-clone/supabase/config.toml | 155 +++++ .../migrations/20240214102356_init.sql | 165 +++++ .../migrations/20240214114147_auth-hook.sql | 58 ++ .../nextjs-slack-clone/supabase/seed.sql | 23 + 16 files changed, 969 insertions(+), 708 deletions(-) create mode 100644 apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx create mode 100644 examples/slack-clone/nextjs-slack-clone/supabase/.gitignore create mode 100644 examples/slack-clone/nextjs-slack-clone/supabase/config.toml create mode 100644 examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214102356_init.sql create mode 100644 examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214114147_auth-hook.sql create mode 100644 examples/slack-clone/nextjs-slack-clone/supabase/seed.sql diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index b533e6779b9..3f3f3cf9754 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -607,6 +607,10 @@ export const auth = { name: 'Column Level Security', url: '/guides/auth/column-level-security', }, + { + name: 'Custom Claims & RBAC', + url: '/guides/auth/custom-claims-and-role-based-access-control-rbac', + }, ], }, { diff --git a/apps/docs/content/guides/auth/auth-hooks.mdx b/apps/docs/content/guides/auth/auth-hooks.mdx index f094433bcd6..c6a833b30fc 100644 --- a/apps/docs/content/guides/auth/auth-hooks.mdx +++ b/apps/docs/content/guides/auth/auth-hooks.mdx @@ -572,7 +572,7 @@ as $$ is_admin boolean; begin -- Check if the user is marked as admin in the profiles table - select is_admin into is_admin from profiles where user_id = event->>'user_id'::uuid; + select is_admin into is_admin from profiles where user_id = (event->>'user_id')::uuid; -- Proceed only if the user is an admin if is_admin then diff --git a/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx b/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx new file mode 100644 index 00000000000..b1f22158f9b --- /dev/null +++ b/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx @@ -0,0 +1,278 @@ +--- +id: 'custom-claims-and-role-based-access-control-rbac' +title: 'Custom Claims & Role-based Access Control (RBAC)' +description: 'Use Auth Hooks to add custom claims for managing role-based access control.' +--- + +Custom Claims are special attributes attached to a user that you can use to control access to portions of your application. For example: + +```json +{ + "user_role": "admin", + "plan": "TRIAL", + "user_level": 100, + "group_name": "Super Guild!", + "joined_on": "2022-05-20T14:28:18.217Z", + "group_manager": false, + "items": ["toothpick", "string", "ring"] +} +``` + +To implement Role-Based Access Control (RBAC) with `custom claims`, use a [Custom Access Token Auth Hook](/guides/auth/auth-hooks#hook-custom-access-token). This hook runs before a token is issued. You can use it to add additional claims to the user's JWT. + +This guide uses the [Slack Clone example](https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone) to demonstrate how to add a `user_role` claim and use it in your [Row Level Security (RLS) policies](/guides/auth/row-level-security). + +## Create a table to track user roles and permissions + +In this example, you will implement two user roles with specific permissions: + +- `moderator`: A moderator can delete all messages but not channels. +- `admin`: An admin can delete all messages and channels. + +```sql supabase/migrations/init.sql +-- Custom types +create type public.app_permission as enum ('channels.delete', 'messages.delete'); +create type public.app_role as enum ('admin', 'moderator'); + +-- USER ROLES +create table public.user_roles ( + id bigint generated by default as identity primary key, + user_id uuid references public.users on delete cascade not null, + role app_role not null, + unique (user_id, role) +); +comment on table public.user_roles is 'Application roles for each user.'; + +-- ROLE PERMISSIONS +create table public.role_permissions ( + id bigint generated by default as identity primary key, + role app_role not null, + permission app_permission not null, + unique (role, permission) +); +comment on table public.role_permissions is 'Application permissions for each role.'; +``` + + + + For the [full schema](https://github.com/supabase/supabase/blob/master/examples/slack-clone/nextjs-slack-clone/README.md), see the example application on [GitHub](https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone). + + + +You can now manage your roles and permissions in SQL. For example, to add the mentioned roles and permissions from above, run: + +```sql supabase/seed.sql +insert into public.role_permissions (role, permission) +values + ('admin', 'channels.delete'), + ('admin', 'messages.delete'), + ('moderator', 'messages.delete'); +``` + +## Create Auth Hook to apply user role + +The [Custom Access Token Auth Hook](/guides/auth/auth-hooks#hook-custom-access-token) runs before a token is issued. You can use it edit the JWT. + + + + +```sql supabase/migrations/auth_hook.sql +-- Create the auth hook function +create or replace function public.custom_access_token_hook(event jsonb) +returns jsonb +language plpgsql +immutable +as $$ + declare + claims jsonb; + user_role public.app_role; + begin + -- Check if the user is marked as admin in the profiles table + select role into user_role from public.user_roles where user_id = (event->>'user_id')::uuid; + + claims := event->'claims'; + + if user_role is not null then + -- Set the claim + claims := jsonb_set(claims, '{user_role}', to_jsonb(user_role)); + else + claims := jsonb_set(claims, '{user_role}', 'null'); + end if; + + -- Update the 'claims' object in the original event + event := jsonb_set(event, '{claims}', claims); + + -- Return the modified or original event + return event; + end; +$$; + +grant usage on schema public to supabase_auth_admin; + +grant execute + on function public.custom_access_token_hook + to supabase_auth_admin; + +revoke execute + on function public.custom_access_token_hook + from authenticated, anon; + +grant all + on table public.user_roles +to supabase_auth_admin; + +revoke all + on table public.user_roles + from authenticated, anon; + +create policy "Allow auth admin to read user roles" ON public.user_roles +as permissive for select +to supabase_auth_admin +using (true) +``` + + + + +```sql supabase/migrations/auth_hook.sql +-- Enable the "plv8" extension +create extension plv8; + +-- Create the auth hook function +create or replace function custom_access_token_hook(event jsonb) +returns jsonb +language plv8 +as $$ + var user_role; + + // Fetch the current user's user_role from the public user_roles table. + var result = plv8.execute("select role from public.user_roles where user_id = $1", [event.user_id]); + if (result.length > 0) { + user_role = result[0].role; + } else { + // Assign null + user_role = null; + } + + // Check if 'claims' exists in the event object; if not, initialize it + if (!event.claims) { + event.claims = {}; + } + + // Update the level in the claims + event.claims.user_role = user_role; + + return event; +$$; + +grant usage on schema public to supabase_auth_admin; + +grant execute + on function public.custom_access_token_hook + to supabase_auth_admin; + +revoke execute + on function public.custom_access_token_hook + from authenticated, anon; + +grant all + on table public.user_roles +to supabase_auth_admin; + +revoke all + on table public.user_roles + from authenticated, anon; + +create policy "Allow auth admin to read user roles" ON public.user_roles +as permissive for select +to supabase_auth_admin +using (true) +``` + + + + +### Enable the hook + +In the dashboard, navigate to [`Authentication > Hooks (Beta)`](/dashboard/project/_/auth/hooks) and select the appropriate PostgreSQL function from the dropdown menu. + +When developing locally, follow the [local development](/guides/auth/auth-hooks#local-development) instructions. + + + +To learn more about Auth Hooks, see the [Auth Hooks docs](/guides/auth/auth-hooks). + + + +## Accessing custom claims in RLS policies + +To utilize Role-Based Access Control (RBAC) in Row Level Security (RLS) policies, create an `authorize` method that reads the user's role from their JWT and checks the role's permissions: + +```sql supabase/migrations/init.sql +create function public.authorize( + requested_permission app_permission, + user_id uuid +) +returns boolean as $$ +declare + bind_permissions int; +begin + select count(*) + from public.role_permissions + where role_permissions.permission = authorize.requested_permission + and role_permissions.role = (auth.jwt() ->> 'user_role')::public.app_role + into bind_permissions; + + return bind_permissions > 0; +end; +$$ language plpgsql security definer set search_path = public; +``` + + + +You can read more about using functions in RLS policies in the [RLS guide](/guides/auth/row-level-security#using-functions). + + + +You can then use the `authorize` method within your RLS policies. For example, to enable the desired delete access, you would add the following policies: + +```sql +create policy "Allow authorized delete access" on public.channels for delete using ( authorize('channels.delete', auth.uid()) ); +create policy "Allow authorized delete access" on public.messages for delete using ( authorize('messages.delete', auth.uid()) ); +``` + +## Accessing custom claims in your application + +The auth hook will only modify the access token JWT but not the auth response. Therefore, to access the custom claims in your application, e.g. your browser client, or server-side middleware, you will need to decode the `access_token` JWT on the auth session. + +In a JavaScript client application you can for example use the [`jwt-decode` package](https://www.npmjs.com/package/jwt-decode): + +```js +import { jwtDecode } from 'jwt-decode' + +const { subscription: authListener } = supabase.auth.onAuthStateChange(async (event, session) => { + if (session) { + const jwt = jwtDecode(session.access_token) + const userRole = jwt.user_role + } +}) +``` + +For server-side logic you can use packages like [express-jwt](https://github.com/auth0/express-jwt), [koa-jwt](https://github.com/stiang/koa-jwt), [PyJWT](https://github.com/jpadilla/pyjwt), [dart_jsonwebtoken](https://pub.dev/packages/dart_jsonwebtoken), [Microsoft.AspNetCore.Authentication.JwtBearer](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.JwtBearer), etc. + +## Conclusion + +You now have a robust system in place to manage user roles and permissions within your database that automatically propagates to Supabase Auth. + +## More resources + +- [Auth Hooks](/guides/auth/auth-hooks) +- [Row Level Security](/guides/auth/row-level-security) +- [RLS Functions](/guides/auth/row-level-security#using-functions) +- [Next.js Slack Clone Example](https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone) diff --git a/examples/slack-clone/nextjs-slack-clone/README.md b/examples/slack-clone/nextjs-slack-clone/README.md index 6041b6b84ea..183701a7358 100644 --- a/examples/slack-clone/nextjs-slack-clone/README.md +++ b/examples/slack-clone/nextjs-slack-clone/README.md @@ -115,173 +115,8 @@ When you start a Postgres database on Supabase, we populate it with an `auth` sc When a user logs in, they are issued a JWT with the role `authenticated` and their UUID. We can use these details to provide fine-grained control over what each user can and cannot do. -Full schema here with role-based access control: - -```sql --- --- For use with https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone --- - --- Custom types -create type public.app_permission as enum ('channels.delete', 'messages.delete'); -create type public.app_role as enum ('admin', 'moderator'); -create type public.user_status as enum ('ONLINE', 'OFFLINE'); - --- USERS -create table public.users ( - id uuid not null primary key, -- UUID from auth.users - username text, - status user_status default 'OFFLINE'::public.user_status -); -comment on table public.users is 'Profile data for each user.'; -comment on column public.users.id is 'References the internal Supabase Auth user.'; - --- CHANNELS -create table public.channels ( - id bigint generated by default as identity primary key, - inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, - slug text not null unique, - created_by uuid references public.users not null -); -comment on table public.channels is 'Topics and groups.'; - --- MESSAGES -create table public.messages ( - id bigint generated by default as identity primary key, - inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, - message text, - user_id uuid references public.users not null, - channel_id bigint references public.channels on delete cascade not null -); -comment on table public.messages is 'Individual messages sent by each user.'; - --- USER ROLES -create table public.user_roles ( - id bigint generated by default as identity primary key, - user_id uuid references public.users on delete cascade not null, - role app_role not null, - unique (user_id, role) -); -comment on table public.user_roles is 'Application roles for each user.'; - --- ROLE PERMISSIONS -create table public.role_permissions ( - id bigint generated by default as identity primary key, - role app_role not null, - permission app_permission not null, - unique (role, permission) -); -comment on table public.role_permissions is 'Application permissions for each role.'; - --- authorize with role-based access control (RBAC) -create function public.authorize( - requested_permission app_permission, - user_id uuid -) -returns boolean as $$ -declare - bind_permissions int; -begin - select count(*) - from public.role_permissions - inner join public.user_roles on role_permissions.role = user_roles.role - where role_permissions.permission = authorize.requested_permission - and user_roles.user_id = authorize.user_id - into bind_permissions; - - return bind_permissions > 0; -end; -$$ language plpgsql security definer; - --- Secure the tables -alter table public.users enable row level security; -alter table public.channels enable row level security; -alter table public.messages enable row level security; -alter table public.user_roles enable row level security; -alter table public.role_permissions enable row level security; -create policy "Allow logged-in read access" on public.users for select using ( auth.role() = 'authenticated' ); -create policy "Allow individual insert access" on public.users for insert with check ( auth.uid() = id ); -create policy "Allow individual update access" on public.users for update using ( auth.uid() = id ); -create policy "Allow logged-in read access" on public.channels for select using ( auth.role() = 'authenticated' ); -create policy "Allow individual insert access" on public.channels for insert with check ( auth.uid() = created_by ); -create policy "Allow individual delete access" on public.channels for delete using ( auth.uid() = created_by ); -create policy "Allow authorized delete access" on public.channels for delete using ( authorize('channels.delete', auth.uid()) ); -create policy "Allow logged-in read access" on public.messages for select using ( auth.role() = 'authenticated' ); -create policy "Allow individual insert access" on public.messages for insert with check ( auth.uid() = user_id ); -create policy "Allow individual update access" on public.messages for update using ( auth.uid() = user_id ); -create policy "Allow individual delete access" on public.messages for delete using ( auth.uid() = user_id ); -create policy "Allow authorized delete access" on public.messages for delete using ( authorize('messages.delete', auth.uid()) ); -create policy "Allow individual read access" on public.user_roles for select using ( auth.uid() = user_id ); - --- Send "previous data" on change -alter table public.users replica identity full; -alter table public.channels replica identity full; -alter table public.messages replica identity full; - --- inserts a row into public.users and assigns roles -create function public.handle_new_user() -returns trigger as $$ -declare is_admin boolean; -begin - insert into public.users (id, username) - values (new.id, new.email); - - select count(*) = 1 from auth.users into is_admin; - - if position('+supaadmin@' in new.email) > 0 then - insert into public.user_roles (user_id, role) values (new.id, 'admin'); - elsif position('+supamod@' in new.email) > 0 then - insert into public.user_roles (user_id, role) values (new.id, 'moderator'); - end if; - - return new; -end; -$$ language plpgsql security definer; - --- trigger the function every time a user is created -create trigger on_auth_user_created - after insert on auth.users - for each row execute procedure public.handle_new_user(); - -/** - * REALTIME SUBSCRIPTIONS - * Only allow realtime listening on public tables. - */ - -begin; - -- remove the realtime publication - drop publication if exists supabase_realtime; - - -- re-create the publication but don't enable it for any tables - create publication supabase_realtime; -commit; - --- add tables to the publication -alter publication supabase_realtime add table public.channels; -alter publication supabase_realtime add table public.messages; -alter publication supabase_realtime add table public.users; - --- DUMMY DATA -insert into public.users (id, username) -values - ('8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e', 'supabot'); - -insert into public.channels (slug, created_by) -values - ('public', '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'), - ('random', '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'); - -insert into public.messages (message, channel_id, user_id) -values - ('Hello World 👋', 1, '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'), - ('Perfection is attained, not when there is nothing more to add, but when there is nothing left to take away.', 2, '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'); - -insert into public.role_permissions (role, permission) -values - ('admin', 'channels.delete'), - ('admin', 'messages.delete'), - ('moderator', 'messages.delete'); -``` +- For the full schema refer to [full-schema.sql](./full-schema.sql). +- For documentation on Role-based Access Control, refer to the [docs](https://supabase.com/docs/guides/auth/custom-claims-and-role-based-access-control-rbac). ## Authors diff --git a/examples/slack-clone/nextjs-slack-clone/components/Layout.js b/examples/slack-clone/nextjs-slack-clone/components/Layout.js index a592e0d83be..46da4ce13dc 100644 --- a/examples/slack-clone/nextjs-slack-clone/components/Layout.js +++ b/examples/slack-clone/nextjs-slack-clone/components/Layout.js @@ -5,7 +5,7 @@ import { addChannel, deleteChannel } from '~/lib/Store' import TrashIcon from '~/components/TrashIcon' export default function Layout(props) { - const { signOut, user, userRoles } = useContext(UserContext) + const { signOut, user } = useContext(UserContext) const slugify = (text) => { return text @@ -60,7 +60,6 @@ export default function Layout(props) { key={x.id} isActiveChannel={x.id === props.activeChannelId} user={user} - userRoles={userRoles} /> ))} @@ -73,13 +72,13 @@ export default function Layout(props) { ) } -const SidebarItem = ({ channel, isActiveChannel, user, userRoles }) => ( +const SidebarItem = ({ channel, isActiveChannel, user }) => ( <>
  • {channel.slug} - {channel.id !== 1 && (channel.created_by === user?.id || userRoles.includes('admin')) && ( + {channel.id !== 1 && (channel.created_by === user?.id || user?.appRole === 'admin') && ( diff --git a/examples/slack-clone/nextjs-slack-clone/components/Message.js b/examples/slack-clone/nextjs-slack-clone/components/Message.js index 201012e089d..825bbca39aa 100644 --- a/examples/slack-clone/nextjs-slack-clone/components/Message.js +++ b/examples/slack-clone/nextjs-slack-clone/components/Message.js @@ -4,20 +4,19 @@ import { deleteMessage } from '~/lib/Store' import TrashIcon from '~/components/TrashIcon' const Message = ({ message }) => { - const { user, userRoles } = useContext(UserContext) + const { user } = useContext(UserContext) return (
    - {(user?.id === message.user_id || - userRoles.some((role) => ['admin', 'moderator'].includes(role))) && ( + {(user?.id === message.user_id || ['admin', 'moderator'].includes(user?.appRole)) && ( )}
    -

    {message.author.username}

    +

    {message?.author?.username}

    {message.message}

    diff --git a/examples/slack-clone/nextjs-slack-clone/full-schema.sql b/examples/slack-clone/nextjs-slack-clone/full-schema.sql index 58b277df895..1fafb7f5bef 100644 --- a/examples/slack-clone/nextjs-slack-clone/full-schema.sql +++ b/examples/slack-clone/nextjs-slack-clone/full-schema.sql @@ -9,7 +9,7 @@ create type public.user_status as enum ('ONLINE', 'OFFLINE'); -- USERS create table public.users ( - id uuid not null primary key, -- UUID from auth.users + id uuid references auth.users not null primary key, -- UUID from auth.users username text, status user_status default 'OFFLINE'::public.user_status ); @@ -64,14 +64,13 @@ declare begin select count(*) from public.role_permissions - inner join public.user_roles on role_permissions.role = user_roles.role where role_permissions.permission = authorize.requested_permission - and user_roles.user_id = authorize.user_id + and role_permissions.role = (auth.jwt() ->> 'user_role')::public.app_role into bind_permissions; return bind_permissions > 0; end; -$$ language plpgsql security definer; +$$ language plpgsql security definer set search_path = public; -- Secure the tables alter table public.users enable row level security; @@ -116,7 +115,7 @@ begin return new; end; -$$ language plpgsql security definer; +$$ language plpgsql security definer set search_path = auth, public; -- trigger the function every time a user is created create trigger on_auth_user_created @@ -141,24 +140,86 @@ alter publication supabase_realtime add table public.channels; alter publication supabase_realtime add table public.messages; alter publication supabase_realtime add table public.users; --- DUMMY DATA -insert into public.users (id, username) -values - ('8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e', 'supabot'); +/** + * AUTH HOOKS + * Create an auth hook to add a custom claim to the access token jwt. + */ -insert into public.channels (slug, created_by) -values - ('public', '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'), - ('random', '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'); +-- Create the auth hook function +-- https://supabase.com/docs/guides/auth/auth-hooks#hook-custom-access-token +create or replace function public.custom_access_token_hook(event jsonb) +returns jsonb +language plpgsql +immutable +as $$ + declare + claims jsonb; + user_role public.app_role; + begin + -- Check if the user is marked as admin in the profiles table + select role into user_role from public.user_roles where user_id = (event->>'user_id')::uuid; -insert into public.messages (message, channel_id, user_id) -values - ('Hello World 👋', 1, '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'), - ('Perfection is attained, not when there is nothing more to add, but when there is nothing left to take away.', 2, '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'); + claims := event->'claims'; + + if user_role is not null then + -- Set the claim + claims := jsonb_set(claims, '{user_role}', to_jsonb(user_role)); + else + claims := jsonb_set(claims, '{user_role}', 'null'); + end if; + + -- Update the 'claims' object in the original event + event := jsonb_set(event, '{claims}', claims); + + -- Return the modified or original event + return event; + end; +$$; + +grant usage on schema public to supabase_auth_admin; + +grant execute + on function public.custom_access_token_hook + to supabase_auth_admin; + +revoke execute + on function public.custom_access_token_hook + from authenticated, anon; + +grant all + on table public.user_roles +to supabase_auth_admin; + +revoke all + on table public.user_roles + from authenticated, anon; + +create policy "Allow auth admin to read user roles" ON public.user_roles +as permissive for select +to supabase_auth_admin +using (true) + + +/** + * HELPER FUNCTIONS + * Create test user helper method. + */ +create or replace function public.create_user( + email text +) returns uuid + security definer + set search_path = auth +as $$ + declare + user_id uuid; +begin + user_id := extensions.uuid_generate_v4(); -insert into public.role_permissions (role, permission) -values - ('admin', 'channels.delete'), - ('admin', 'messages.delete'), - ('moderator', 'messages.delete'); + insert into auth.users (id, email) + values (user_id, email) + returning id into user_id; + + return user_id; +end; +$$ language plpgsql; diff --git a/examples/slack-clone/nextjs-slack-clone/lib/Store.js b/examples/slack-clone/nextjs-slack-clone/lib/Store.js index c4382c872c4..545cf55e372 100644 --- a/examples/slack-clone/nextjs-slack-clone/lib/Store.js +++ b/examples/slack-clone/nextjs-slack-clone/lib/Store.js @@ -1,7 +1,10 @@ import { useState, useEffect } from 'react' -import { createPagesBrowserClient } from '@supabase/auth-helpers-nextjs' +import { createClient } from '@supabase/supabase-js' -export const supabase = createPagesBrowserClient() +export const supabase = createClient( + process.env.NEXT_PUBLIC_SUPABASE_URL, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY +) /** * @param {number} channelId the currently selected Channel @@ -23,38 +26,28 @@ export const useStore = (props) => { // Listen for new and deleted messages const messageListener = supabase .channel('public:messages') - .on( - 'postgres_changes', - { event: 'INSERT', schema: 'public', table: 'messages' }, - (payload) => handleNewMessage(payload.new) + .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'messages' }, (payload) => + handleNewMessage(payload.new) ) - .on( - 'postgres_changes', - { event: 'DELETE', schema: 'public', table: 'messages' }, - (payload) => handleDeletedMessage(payload.old) + .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'messages' }, (payload) => + handleDeletedMessage(payload.old) ) .subscribe() // Listen for changes to our users const userListener = supabase .channel('public:users') - .on( - 'postgres_changes', - { event: '*', schema: 'public', table: 'users' }, - (payload) => handleNewOrUpdatedUser(payload.new) + .on('postgres_changes', { event: '*', schema: 'public', table: 'users' }, (payload) => + handleNewOrUpdatedUser(payload.new) ) .subscribe() // Listen for new and deleted channels const channelListener = supabase .channel('public:channels') - .on( - 'postgres_changes', - { event: 'INSERT', schema: 'public', table: 'channels' }, - (payload) => handleNewChannel(payload.new) + .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'channels' }, (payload) => + handleNewChannel(payload.new) ) - .on( - 'postgres_changes', - { event: 'DELETE', schema: 'public', table: 'channels' }, - (payload) => handleDeletedChannel(payload.old) + .on('postgres_changes', { event: 'DELETE', schema: 'public', table: 'channels' }, (payload) => + handleDeletedChannel(payload.old) ) .subscribe() // Cleanup on unmount @@ -151,20 +144,6 @@ export const fetchUser = async (userId, setState) => { } } -/** - * Fetch all roles for the current user - * @param {function} setState Optionally pass in a hook or callback to set the state - */ -export const fetchUserRoles = async (setState) => { - try { - let { data } = await supabase.from('user_roles').select(`*`) - if (setState) setState(data) - return data - } catch (error) { - console.log('error', error) - } -} - /** * Fetch all messages and their authors * @param {number} channelId @@ -191,7 +170,10 @@ export const fetchMessages = async (channelId, setState) => { */ export const addChannel = async (slug, user_id) => { try { - let { data } = await supabase.from('channels').insert([{ slug, created_by: user_id }]).select() + let { data } = await supabase + .from('channels') + .insert([{ slug, created_by: user_id }]) + .select() return data } catch (error) { console.log('error', error) @@ -206,7 +188,10 @@ export const addChannel = async (slug, user_id) => { */ export const addMessage = async (message, channel_id, user_id) => { try { - let { data } = await supabase.from('messages').insert([{ message, channel_id, user_id }]).select() + let { data } = await supabase + .from('messages') + .insert([{ message, channel_id, user_id }]) + .select() return data } catch (error) { console.log('error', error) diff --git a/examples/slack-clone/nextjs-slack-clone/package-lock.json b/examples/slack-clone/nextjs-slack-clone/package-lock.json index dd187f4f898..2ac89187de9 100644 --- a/examples/slack-clone/nextjs-slack-clone/package-lock.json +++ b/examples/slack-clone/nextjs-slack-clone/package-lock.json @@ -9,8 +9,8 @@ "version": "0.2.0", "license": "MIT", "dependencies": { - "@supabase/auth-helpers-nextjs": "^0.7.2", - "@supabase/supabase-js": "^2.26.0", + "@supabase/supabase-js": "^2.39.6", + "jwt-decode": "^4.0.0", "next": "latest", "react": "^18.2.0", "react-dom": "^18.2.0" @@ -307,98 +307,90 @@ "node": ">= 8" } }, - "node_modules/@supabase/auth-helpers-nextjs": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@supabase/auth-helpers-nextjs/-/auth-helpers-nextjs-0.7.2.tgz", - "integrity": "sha512-n5IyGBYJV/WiR5Rgw4CUaiJYiOv9yW2of4ZP4EyzKt2O6/6rztt7PcGE4AoK2vERw+fb5F2QtJBdt6J5eOYCCw==", - "dependencies": { - "@supabase/auth-helpers-shared": "0.4.1", - "set-cookie-parser": "^2.6.0" - }, - "peerDependencies": { - "@supabase/supabase-js": "^2.19.0" - } - }, - "node_modules/@supabase/auth-helpers-shared": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@supabase/auth-helpers-shared/-/auth-helpers-shared-0.4.1.tgz", - "integrity": "sha512-IEDX9JzWkIjQiLUaP4Qy5YDiG0jFQatWfS+jw8cCQs6QfbNdEPd2Y3qonwGHnM90CZom9SvjuylBv2pFVAL7Lw==", - "dependencies": { - "jose": "^4.14.3" - }, - "peerDependencies": { - "@supabase/supabase-js": "^2.19.0" - } - }, "node_modules/@supabase/functions-js": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.2.tgz", - "integrity": "sha512-QCR6pwJs9exCl37bmpMisUd6mf+0SUBJ6mUpiAjEkSJ/+xW8TCuO14bvkWHADd5hElJK9MxNlMQXxSA4DRz9nQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.5.tgz", + "integrity": "sha512-BNzC5XhCzzCaggJ8s53DP+WeHHGT/NfTsx2wUSSGKR2/ikLFQTBCDzMvGz/PxYMqRko/LwncQtKXGOYp1PkPaw==", "dependencies": { - "cross-fetch": "^3.1.5" + "@supabase/node-fetch": "^2.6.14" } }, "node_modules/@supabase/gotrue-js": { - "version": "2.38.0", - "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.38.0.tgz", - "integrity": "sha512-iitNthPLQjAD73FtnUNUalwPFpsiiE7t/0mVw14b+3rqzr52Efri8gAjzT9hi7p35uOLA76HMY3aWJj6Gy7ozw==", + "version": "2.62.2", + "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.62.2.tgz", + "integrity": "sha512-AP6e6W9rQXFTEJ7sTTNYQrNf0LCcnt1hUW+RIgUK+Uh3jbWvcIST7wAlYyNZiMlS9+PYyymWQ+Ykz/rOYSO0+A==", "dependencies": { - "cross-fetch": "^3.1.5" + "@supabase/node-fetch": "^2.6.14" + } + }, + "node_modules/@supabase/node-fetch": { + "version": "2.6.15", + "resolved": "https://registry.npmjs.org/@supabase/node-fetch/-/node-fetch-2.6.15.tgz", + "integrity": "sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" } }, "node_modules/@supabase/postgrest-js": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.7.1.tgz", - "integrity": "sha512-xPRYLaZrkLbXNlzmHW6Wtf9hmcBLjjI5xUz2zj8oE2hgXGaYoZBBkpN9bmW9i17Z1f6Ujxa942AqK439XOA36A==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.9.2.tgz", + "integrity": "sha512-I6yHo8CC9cxhOo6DouDMy9uOfW7hjdsnCxZiaJuIVZm1dBGTFiQPgfMa9zXCamEWzNyWRjZvupAUuX+tqcl5Sw==", "dependencies": { - "cross-fetch": "^3.1.5" + "@supabase/node-fetch": "^2.6.14" } }, "node_modules/@supabase/realtime-js": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.7.3.tgz", - "integrity": "sha512-c7TzL81sx2kqyxsxcDduJcHL9KJdCOoKimGP6lQSqiZKX42ATlBZpWbyy9KFGFBjAP4nyopMf5JhPi2ZH9jyNw==", + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.9.3.tgz", + "integrity": "sha512-lAp50s2n3FhGJFq+wTSXLNIDPw5Y0Wxrgt44eM5nLSA3jZNUUP3Oq2Ccd1CbZdVntPCWLZvJaU//pAd2NE+QnQ==", "dependencies": { + "@supabase/node-fetch": "^2.6.14", "@types/phoenix": "^1.5.4", - "@types/websocket": "^1.0.3", - "websocket": "^1.0.34" + "@types/ws": "^8.5.10", + "ws": "^8.14.2" } }, "node_modules/@supabase/storage-js": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.5.1.tgz", - "integrity": "sha512-nkR0fQA9ScAtIKA3vNoPEqbZv1k5B5HVRYEvRWdlP6mUpFphM9TwPL2jZ/ztNGMTG5xT6SrHr+H7Ykz8qzbhjw==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.5.5.tgz", + "integrity": "sha512-OpLoDRjFwClwc2cjTJZG8XviTiQH4Ik8sCiMK5v7et0MDu2QlXjCAW3ljxJB5+z/KazdMOTnySi+hysxWUPu3w==", "dependencies": { - "cross-fetch": "^3.1.5" + "@supabase/node-fetch": "^2.6.14" } }, "node_modules/@supabase/supabase-js": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.26.0.tgz", - "integrity": "sha512-RXmTPTobaYAwkSobadHZmEVLmzX3SGrtRZIGfLWnLv92VzBRrjuXn0a+bJqKl50GUzsyqPA+j5pod7EwMkcH5A==", + "version": "2.39.6", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.39.6.tgz", + "integrity": "sha512-HlflDzem0+l3KYYTqHV0UsqkDooV9my5UcBCV2zvvTrl77UtW97uKTZWn9lSWMuiy+ZvRLsiuG+WTiBuKMQl0Q==", "dependencies": { - "@supabase/functions-js": "^2.1.0", - "@supabase/gotrue-js": "^2.31.0", - "@supabase/postgrest-js": "^1.7.0", - "@supabase/realtime-js": "^2.7.3", - "@supabase/storage-js": "^2.5.1", - "cross-fetch": "^3.1.5" + "@supabase/functions-js": "2.1.5", + "@supabase/gotrue-js": "2.62.2", + "@supabase/node-fetch": "2.6.15", + "@supabase/postgrest-js": "1.9.2", + "@supabase/realtime-js": "2.9.3", + "@supabase/storage-js": "2.5.5" } }, "node_modules/@types/node": { - "version": "20.3.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz", - "integrity": "sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==" + "version": "20.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", + "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/phoenix": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.0.tgz", - "integrity": "sha512-qwfpsHmFuhAS/dVd4uBIraMxRd56vwBUYQGZ6GpXnFuM2XMRFJbIyruFKKlW2daQliuYZwe0qfn/UjFCDKic5g==" + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.4.tgz", + "integrity": "sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA==" }, - "node_modules/@types/websocket": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz", - "integrity": "sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==", + "node_modules/@types/ws": { + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", "dependencies": { "@types/node": "*" } @@ -530,18 +522,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/bufferutil": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/camelcase-css": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", @@ -612,14 +592,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/cross-fetch": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.7.tgz", - "integrity": "sha512-Ff9FKeIMm0Rx1o8TEV87bTK5M232akt7uSAYrSTU/QA/W6Jj9P+fWn1mxGgl+dwDzpFoAY35OIS2SJXA8WEWKA==", - "dependencies": { - "node-fetch": "2.6.12" - } - }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -632,23 +604,6 @@ "node": ">=4" } }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, "node_modules/didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -667,39 +622,6 @@ "integrity": "sha512-sxX0LXh+uL41hSJsujAN86PjhrV/6c79XmpY0TvjZStV6VxIgarf8SRkUoUTuYmFcZQTemsoqo8qXOGw5npWfw==", "dev": true }, - "node_modules/es5-ext": { - "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", - "hasInstallScript": true, - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -709,19 +631,6 @@ "node": ">=6" } }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "dependencies": { - "type": "^2.7.2" - } - }, - "node_modules/ext/node_modules/type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -919,11 +828,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, "node_modules/jiti": { "version": "1.18.2", "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.18.2.tgz", @@ -933,19 +837,19 @@ "jiti": "bin/jiti.js" } }, - "node_modules/jose": { - "version": "4.14.4", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.4.tgz", - "integrity": "sha512-j8GhLiKmUAh+dsFXlX1aJCbt5KMibuKb+d7j1JaOJG6s2UjX1PQlW+OKB/sD4a/5ZYF4RcmYmLSndOoU3Lt/3g==", - "funding": { - "url": "https://github.com/sponsors/panva" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, + "node_modules/jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", + "engines": { + "node": ">=18" + } + }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -1006,11 +910,6 @@ "node": "*" } }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -1088,11 +987,6 @@ } } }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, "node_modules/next/node_modules/postcss": { "version": "8.4.5", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz", @@ -1110,35 +1004,6 @@ "url": "https://opencollective.com/postcss/" } }, - "node_modules/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, "node_modules/node-releases": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", @@ -1492,11 +1357,6 @@ "loose-envify": "^1.1.0" } }, - "node_modules/set-cookie-parser": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz", - "integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==" - }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -1671,18 +1531,10 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "dev": true }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dependencies": { - "is-typedarray": "^1.0.0" - } + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/update-browserslist-db": { "version": "1.0.11", @@ -1714,18 +1566,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1737,22 +1577,6 @@ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, - "node_modules/websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "dependencies": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -1768,12 +1592,24 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, - "node_modules/yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", + "node_modules/ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "engines": { - "node": ">=0.10.32" + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/yaml": { @@ -1943,92 +1779,87 @@ "fastq": "^1.6.0" } }, - "@supabase/auth-helpers-nextjs": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@supabase/auth-helpers-nextjs/-/auth-helpers-nextjs-0.7.2.tgz", - "integrity": "sha512-n5IyGBYJV/WiR5Rgw4CUaiJYiOv9yW2of4ZP4EyzKt2O6/6rztt7PcGE4AoK2vERw+fb5F2QtJBdt6J5eOYCCw==", - "requires": { - "@supabase/auth-helpers-shared": "0.4.1", - "set-cookie-parser": "^2.6.0" - } - }, - "@supabase/auth-helpers-shared": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@supabase/auth-helpers-shared/-/auth-helpers-shared-0.4.1.tgz", - "integrity": "sha512-IEDX9JzWkIjQiLUaP4Qy5YDiG0jFQatWfS+jw8cCQs6QfbNdEPd2Y3qonwGHnM90CZom9SvjuylBv2pFVAL7Lw==", - "requires": { - "jose": "^4.14.3" - } - }, "@supabase/functions-js": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.2.tgz", - "integrity": "sha512-QCR6pwJs9exCl37bmpMisUd6mf+0SUBJ6mUpiAjEkSJ/+xW8TCuO14bvkWHADd5hElJK9MxNlMQXxSA4DRz9nQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.5.tgz", + "integrity": "sha512-BNzC5XhCzzCaggJ8s53DP+WeHHGT/NfTsx2wUSSGKR2/ikLFQTBCDzMvGz/PxYMqRko/LwncQtKXGOYp1PkPaw==", "requires": { - "cross-fetch": "^3.1.5" + "@supabase/node-fetch": "^2.6.14" } }, "@supabase/gotrue-js": { - "version": "2.38.0", - "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.38.0.tgz", - "integrity": "sha512-iitNthPLQjAD73FtnUNUalwPFpsiiE7t/0mVw14b+3rqzr52Efri8gAjzT9hi7p35uOLA76HMY3aWJj6Gy7ozw==", + "version": "2.62.2", + "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.62.2.tgz", + "integrity": "sha512-AP6e6W9rQXFTEJ7sTTNYQrNf0LCcnt1hUW+RIgUK+Uh3jbWvcIST7wAlYyNZiMlS9+PYyymWQ+Ykz/rOYSO0+A==", "requires": { - "cross-fetch": "^3.1.5" + "@supabase/node-fetch": "^2.6.14" + } + }, + "@supabase/node-fetch": { + "version": "2.6.15", + "resolved": "https://registry.npmjs.org/@supabase/node-fetch/-/node-fetch-2.6.15.tgz", + "integrity": "sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==", + "requires": { + "whatwg-url": "^5.0.0" } }, "@supabase/postgrest-js": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.7.1.tgz", - "integrity": "sha512-xPRYLaZrkLbXNlzmHW6Wtf9hmcBLjjI5xUz2zj8oE2hgXGaYoZBBkpN9bmW9i17Z1f6Ujxa942AqK439XOA36A==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.9.2.tgz", + "integrity": "sha512-I6yHo8CC9cxhOo6DouDMy9uOfW7hjdsnCxZiaJuIVZm1dBGTFiQPgfMa9zXCamEWzNyWRjZvupAUuX+tqcl5Sw==", "requires": { - "cross-fetch": "^3.1.5" + "@supabase/node-fetch": "^2.6.14" } }, "@supabase/realtime-js": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.7.3.tgz", - "integrity": "sha512-c7TzL81sx2kqyxsxcDduJcHL9KJdCOoKimGP6lQSqiZKX42ATlBZpWbyy9KFGFBjAP4nyopMf5JhPi2ZH9jyNw==", + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.9.3.tgz", + "integrity": "sha512-lAp50s2n3FhGJFq+wTSXLNIDPw5Y0Wxrgt44eM5nLSA3jZNUUP3Oq2Ccd1CbZdVntPCWLZvJaU//pAd2NE+QnQ==", "requires": { + "@supabase/node-fetch": "^2.6.14", "@types/phoenix": "^1.5.4", - "@types/websocket": "^1.0.3", - "websocket": "^1.0.34" + "@types/ws": "^8.5.10", + "ws": "^8.14.2" } }, "@supabase/storage-js": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.5.1.tgz", - "integrity": "sha512-nkR0fQA9ScAtIKA3vNoPEqbZv1k5B5HVRYEvRWdlP6mUpFphM9TwPL2jZ/ztNGMTG5xT6SrHr+H7Ykz8qzbhjw==", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.5.5.tgz", + "integrity": "sha512-OpLoDRjFwClwc2cjTJZG8XviTiQH4Ik8sCiMK5v7et0MDu2QlXjCAW3ljxJB5+z/KazdMOTnySi+hysxWUPu3w==", "requires": { - "cross-fetch": "^3.1.5" + "@supabase/node-fetch": "^2.6.14" } }, "@supabase/supabase-js": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.26.0.tgz", - "integrity": "sha512-RXmTPTobaYAwkSobadHZmEVLmzX3SGrtRZIGfLWnLv92VzBRrjuXn0a+bJqKl50GUzsyqPA+j5pod7EwMkcH5A==", + "version": "2.39.6", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.39.6.tgz", + "integrity": "sha512-HlflDzem0+l3KYYTqHV0UsqkDooV9my5UcBCV2zvvTrl77UtW97uKTZWn9lSWMuiy+ZvRLsiuG+WTiBuKMQl0Q==", "requires": { - "@supabase/functions-js": "^2.1.0", - "@supabase/gotrue-js": "^2.31.0", - "@supabase/postgrest-js": "^1.7.0", - "@supabase/realtime-js": "^2.7.3", - "@supabase/storage-js": "^2.5.1", - "cross-fetch": "^3.1.5" + "@supabase/functions-js": "2.1.5", + "@supabase/gotrue-js": "2.62.2", + "@supabase/node-fetch": "2.6.15", + "@supabase/postgrest-js": "1.9.2", + "@supabase/realtime-js": "2.9.3", + "@supabase/storage-js": "2.5.5" } }, "@types/node": { - "version": "20.3.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.3.tgz", - "integrity": "sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==" + "version": "20.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", + "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", + "requires": { + "undici-types": "~5.26.4" + } }, "@types/phoenix": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.0.tgz", - "integrity": "sha512-qwfpsHmFuhAS/dVd4uBIraMxRd56vwBUYQGZ6GpXnFuM2XMRFJbIyruFKKlW2daQliuYZwe0qfn/UjFCDKic5g==" + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.4.tgz", + "integrity": "sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA==" }, - "@types/websocket": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz", - "integrity": "sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==", + "@types/ws": { + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", "requires": { "@types/node": "*" } @@ -2112,14 +1943,6 @@ "update-browserslist-db": "^1.0.11" } }, - "bufferutil": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", - "requires": { - "node-gyp-build": "^4.3.0" - } - }, "camelcase-css": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", @@ -2159,37 +1982,12 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "cross-fetch": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.7.tgz", - "integrity": "sha512-Ff9FKeIMm0Rx1o8TEV87bTK5M232akt7uSAYrSTU/QA/W6Jj9P+fWn1mxGgl+dwDzpFoAY35OIS2SJXA8WEWKA==", - "requires": { - "node-fetch": "2.6.12" - } - }, "cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "dev": true }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, "didyoumean": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", @@ -2208,56 +2006,12 @@ "integrity": "sha512-sxX0LXh+uL41hSJsujAN86PjhrV/6c79XmpY0TvjZStV6VxIgarf8SRkUoUTuYmFcZQTemsoqo8qXOGw5npWfw==", "dev": true }, - "es5-ext": { - "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", - "requires": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true }, - "ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "requires": { - "type": "^2.7.2" - }, - "dependencies": { - "type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - } - } - }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -2408,27 +2162,22 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "devOptional": true }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, "jiti": { "version": "1.18.2", "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.18.2.tgz", "integrity": "sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==", "dev": true }, - "jose": { - "version": "4.14.4", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.4.tgz", - "integrity": "sha512-j8GhLiKmUAh+dsFXlX1aJCbt5KMibuKb+d7j1JaOJG6s2UjX1PQlW+OKB/sD4a/5ZYF4RcmYmLSndOoU3Lt/3g==" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, + "jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==" + }, "lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -2474,11 +2223,6 @@ "brace-expansion": "^1.1.7" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -2530,24 +2274,6 @@ } } }, - "next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, - "node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==" - }, "node-releases": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", @@ -2766,11 +2492,6 @@ "loose-envify": "^1.1.0" } }, - "set-cookie-parser": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz", - "integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==" - }, "source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -2892,18 +2613,10 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "dev": true }, - "type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "requires": { - "is-typedarray": "^1.0.0" - } + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "update-browserslist-db": { "version": "1.0.11", @@ -2915,14 +2628,6 @@ "picocolors": "^1.0.0" } }, - "utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "requires": { - "node-gyp-build": "^4.3.0" - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -2934,19 +2639,6 @@ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, - "websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "requires": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - } - }, "whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -2962,10 +2654,11 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, - "yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==" + "ws": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "requires": {} }, "yaml": { "version": "2.3.1", diff --git a/examples/slack-clone/nextjs-slack-clone/package.json b/examples/slack-clone/nextjs-slack-clone/package.json index 4af29dafd8a..ecdf31d00da 100644 --- a/examples/slack-clone/nextjs-slack-clone/package.json +++ b/examples/slack-clone/nextjs-slack-clone/package.json @@ -9,8 +9,8 @@ "start": "next start" }, "dependencies": { - "@supabase/supabase-js": "^2.26.0", - "@supabase/auth-helpers-nextjs": "^0.7.2", + "@supabase/supabase-js": "^2.39.6", + "jwt-decode": "^4.0.0", "next": "latest", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/slack-clone/nextjs-slack-clone/pages/_app.js b/examples/slack-clone/nextjs-slack-clone/pages/_app.js index 3db2d706fa3..d915c72915d 100644 --- a/examples/slack-clone/nextjs-slack-clone/pages/_app.js +++ b/examples/slack-clone/nextjs-slack-clone/pages/_app.js @@ -2,13 +2,13 @@ import '~/styles/style.scss' import React, { useState, useEffect } from 'react' import { useRouter } from 'next/router' import UserContext from 'lib/UserContext' -import { supabase, fetchUserRoles } from 'lib/Store' +import { supabase } from 'lib/Store' +import { jwtDecode } from 'jwt-decode' export default function SupabaseSlackClone({ Component, pageProps }) { const [userLoaded, setUserLoaded] = useState(false) const [user, setUser] = useState(null) const [session, setSession] = useState(null) - const [userRoles, setUserRoles] = useState([]) const router = useRouter() useEffect(() => { @@ -18,27 +18,31 @@ export default function SupabaseSlackClone({ Component, pageProps }) { ) { setSession(session) const currentUser = session?.user + if (session) { + const jwt = jwtDecode(session.access_token) + currentUser.appRole = jwt.user_role + } setUser(currentUser ?? null) setUserLoaded(!!currentUser) if (currentUser) { - signIn(currentUser.id, currentUser.email) router.push('/channels/[id]', '/channels/1') } } - supabase.auth.getSession().then(({ data: { session }}) => saveSession(session)) + supabase.auth.getSession().then(({ data: { session } }) => saveSession(session)) - const { subscription: authListener } = supabase.auth.onAuthStateChange(async (event, session) => saveSession(session)) + const { subscription: authListener } = supabase.auth.onAuthStateChange( + async (event, session) => { + console.log(session) + saveSession(session) + } + ) return () => { authListener.unsubscribe() } }, []) - const signIn = async () => { - await fetchUserRoles((userRoles) => setUserRoles(userRoles.map((userRole) => userRole.role))) - } - const signOut = async () => { const { error } = await supabase.auth.signOut() if (!error) { @@ -51,8 +55,6 @@ export default function SupabaseSlackClone({ Component, pageProps }) { value={{ userLoaded, user, - userRoles, - signIn, signOut, }} > diff --git a/examples/slack-clone/nextjs-slack-clone/supabase/.gitignore b/examples/slack-clone/nextjs-slack-clone/supabase/.gitignore new file mode 100644 index 00000000000..a3ad88055b7 --- /dev/null +++ b/examples/slack-clone/nextjs-slack-clone/supabase/.gitignore @@ -0,0 +1,4 @@ +# Supabase +.branches +.temp +.env diff --git a/examples/slack-clone/nextjs-slack-clone/supabase/config.toml b/examples/slack-clone/nextjs-slack-clone/supabase/config.toml new file mode 100644 index 00000000000..c5ff45b294f --- /dev/null +++ b/examples/slack-clone/nextjs-slack-clone/supabase/config.toml @@ -0,0 +1,155 @@ +# A string used to distinguish different Supabase projects on the same host. Defaults to the +# working directory name when running `supabase init`. +project_id = "slack-clone" + +[api] +enabled = true +# Port to use for the API URL. +port = 54321 +# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API +# endpoints. public and storage are always included. +schemas = ["public", "storage", "graphql_public"] +# Extra schemas to add to the search_path of every request. public is always included. +extra_search_path = ["public", "extensions"] +# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size +# for accidental or malicious requests. +max_rows = 1000 + +[db] +# Port to use for the local database URL. +port = 54322 +# Port used by db diff command to initialize the shadow database. +shadow_port = 54320 +# The database major version to use. This has to be the same as your remote database's. Run `SHOW +# server_version;` on the remote database to check. +major_version = 15 + +[db.pooler] +enabled = false +# Port to use for the local connection pooler. +port = 54329 +# Specifies when a server connection can be reused by other clients. +# Configure one of the supported pooler modes: `transaction`, `session`. +pool_mode = "transaction" +# How many server connections to allow per user/database pair. +default_pool_size = 20 +# Maximum number of client connections allowed. +max_client_conn = 100 + +[realtime] +enabled = true +# Bind realtime via either IPv4 or IPv6. (default: IPv6) +# ip_version = "IPv6" + +[studio] +enabled = true +# Port to use for Supabase Studio. +port = 54323 +# External URL of the API server that frontend connects to. +api_url = "http://127.0.0.1" + +# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they +# are monitored, and you can view the emails that would have been sent from the web interface. +[inbucket] +enabled = true +# Port to use for the email testing server web interface. +port = 54324 +# Uncomment to expose additional ports for testing user applications that send emails. +# smtp_port = 54325 +# pop3_port = 54326 + +[storage] +enabled = true +# The maximum file size allowed (e.g. "5MB", "500KB"). +file_size_limit = "50MiB" + +[auth] +enabled = true +# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used +# in emails. +site_url = "http://127.0.0.1:3000" +# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. +additional_redirect_urls = ["https://127.0.0.1:3000"] +# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). +jwt_expiry = 3600 +# If disabled, the refresh token will never expire. +enable_refresh_token_rotation = true +# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. +# Requires enable_refresh_token_rotation = true. +refresh_token_reuse_interval = 10 +# Allow/disallow new user signups to your project. +enable_signup = true + +[auth.email] +# Allow/disallow new user signups via email to your project. +enable_signup = true +# If enabled, a user will be required to confirm any email change on both the old, and new email +# addresses. If disabled, only the new email is required to confirm. +double_confirm_changes = true +# If enabled, users need to confirm their email address before signing in. +enable_confirmations = false + +# Uncomment to customize email template +# [auth.email.template.invite] +# subject = "You have been invited" +# content_path = "./supabase/templates/invite.html" + +[auth.sms] +# Allow/disallow new user signups via SMS to your project. +enable_signup = true +# If enabled, users need to confirm their phone number before signing in. +enable_confirmations = false +# Template for sending OTP to users +template = "Your code is {{ .Code }} ." + +# Use pre-defined map of phone number to OTP for testing. +[auth.sms.test_otp] +# 4152127777 = "123456" + +# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. +[auth.sms.twilio] +enabled = false +account_sid = "" +message_service_sid = "" +# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: +auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" + +# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, +# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin`, `notion`, `twitch`, +# `twitter`, `slack`, `spotify`, `workos`, `zoom`. +[auth.external.apple] +enabled = false +client_id = "" +# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: +secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" +# Overrides the default auth redirectUrl. +redirect_uri = "" +# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, +# or any other third-party OIDC providers. +url = "" + +# Enable auth hooks +# https://supabase.com/docs/guides/auth/auth-hooks#local-development +[auth.hook.custom_access_token] +enabled = true +uri = "pg-functions://postgres/public/custom_access_token_hook" + +[analytics] +enabled = false +port = 54327 +vector_port = 54328 +# Configure one of the supported backends: `postgres`, `bigquery`. +backend = "postgres" + +# Experimental features may be deprecated any time +[experimental] +# Configures Postgres storage engine to use OrioleDB (S3) +orioledb_version = "" +# Configures S3 bucket URL, eg. .s3-.amazonaws.com +s3_host = "env(S3_HOST)" +# Configures S3 bucket region, eg. us-east-1 +s3_region = "env(S3_REGION)" +# Configures AWS_ACCESS_KEY_ID for S3 bucket +s3_access_key = "env(S3_ACCESS_KEY)" +# Configures AWS_SECRET_ACCESS_KEY for S3 bucket +s3_secret_key = "env(S3_SECRET_KEY)" diff --git a/examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214102356_init.sql b/examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214102356_init.sql new file mode 100644 index 00000000000..fd568a6d106 --- /dev/null +++ b/examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214102356_init.sql @@ -0,0 +1,165 @@ +-- +-- For use with https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone +-- + +-- Custom types +create type public.app_permission as enum ('channels.delete', 'messages.delete'); +create type public.app_role as enum ('admin', 'moderator'); +create type public.user_status as enum ('ONLINE', 'OFFLINE'); + +-- USERS +create table public.users ( + id uuid references auth.users not null primary key, -- UUID from auth.users + username text, + status user_status default 'OFFLINE'::public.user_status +); +comment on table public.users is 'Profile data for each user.'; +comment on column public.users.id is 'References the internal Supabase Auth user.'; + +-- CHANNELS +create table public.channels ( + id bigint generated by default as identity primary key, + inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, + slug text not null unique, + created_by uuid references public.users not null +); +comment on table public.channels is 'Topics and groups.'; + +-- MESSAGES +create table public.messages ( + id bigint generated by default as identity primary key, + inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, + message text, + user_id uuid references public.users not null, + channel_id bigint references public.channels on delete cascade not null +); +comment on table public.messages is 'Individual messages sent by each user.'; + +-- USER ROLES +create table public.user_roles ( + id bigint generated by default as identity primary key, + user_id uuid references public.users on delete cascade not null, + role app_role not null, + unique (user_id, role) +); +comment on table public.user_roles is 'Application roles for each user.'; + +-- ROLE PERMISSIONS +create table public.role_permissions ( + id bigint generated by default as identity primary key, + role app_role not null, + permission app_permission not null, + unique (role, permission) +); +comment on table public.role_permissions is 'Application permissions for each role.'; + +-- authorize with role-based access control (RBAC) +create function public.authorize( + requested_permission app_permission, + user_id uuid +) +returns boolean as $$ +declare + bind_permissions int; +begin + select count(*) + from public.role_permissions + where role_permissions.permission = authorize.requested_permission + and role_permissions.role = (auth.jwt() ->> 'user_role')::public.app_role + into bind_permissions; + + return bind_permissions > 0; +end; +$$ language plpgsql security definer set search_path = public; + +-- Secure the tables +alter table public.users enable row level security; +alter table public.channels enable row level security; +alter table public.messages enable row level security; +alter table public.user_roles enable row level security; +alter table public.role_permissions enable row level security; +create policy "Allow logged-in read access" on public.users for select using ( auth.role() = 'authenticated' ); +create policy "Allow individual insert access" on public.users for insert with check ( auth.uid() = id ); +create policy "Allow individual update access" on public.users for update using ( auth.uid() = id ); +create policy "Allow logged-in read access" on public.channels for select using ( auth.role() = 'authenticated' ); +create policy "Allow individual insert access" on public.channels for insert with check ( auth.uid() = created_by ); +create policy "Allow individual delete access" on public.channels for delete using ( auth.uid() = created_by ); +create policy "Allow authorized delete access" on public.channels for delete using ( authorize('channels.delete', auth.uid()) ); +create policy "Allow logged-in read access" on public.messages for select using ( auth.role() = 'authenticated' ); +create policy "Allow individual insert access" on public.messages for insert with check ( auth.uid() = user_id ); +create policy "Allow individual update access" on public.messages for update using ( auth.uid() = user_id ); +create policy "Allow individual delete access" on public.messages for delete using ( auth.uid() = user_id ); +create policy "Allow authorized delete access" on public.messages for delete using ( authorize('messages.delete', auth.uid()) ); +create policy "Allow individual read access" on public.user_roles for select using ( auth.uid() = user_id ); + +-- Send "previous data" on change +alter table public.users replica identity full; +alter table public.channels replica identity full; +alter table public.messages replica identity full; + +-- inserts a row into public.users and assigns roles +create function public.handle_new_user() +returns trigger as $$ +declare is_admin boolean; +begin + insert into public.users (id, username) + values (new.id, new.email); + + select count(*) = 1 from auth.users into is_admin; + + if position('+supaadmin@' in new.email) > 0 then + insert into public.user_roles (user_id, role) values (new.id, 'admin'); + elsif position('+supamod@' in new.email) > 0 then + insert into public.user_roles (user_id, role) values (new.id, 'moderator'); + end if; + + return new; +end; +$$ language plpgsql security definer set search_path = auth, public; + +-- trigger the function every time a user is created +create trigger on_auth_user_created + after insert on auth.users + for each row execute procedure public.handle_new_user(); + +/** + * REALTIME SUBSCRIPTIONS + * Only allow realtime listening on public tables. + */ + +begin; + -- remove the realtime publication + drop publication if exists supabase_realtime; + + -- re-create the publication but don't enable it for any tables + create publication supabase_realtime; +commit; + +-- add tables to the publication +alter publication supabase_realtime add table public.channels; +alter publication supabase_realtime add table public.messages; +alter publication supabase_realtime add table public.users; + +/** + * HELPER FUNCTIONS + * Create test user helper method. + */ +create or replace function public.create_user( + email text +) returns uuid + security definer + set search_path = auth +as $$ + declare + user_id uuid; +begin + user_id := extensions.uuid_generate_v4(); + + insert into auth.users (id, email) + values (user_id, email) + returning id into user_id; + + return user_id; +end; +$$ language plpgsql; + diff --git a/examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214114147_auth-hook.sql b/examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214114147_auth-hook.sql new file mode 100644 index 00000000000..ea17d1dec7a --- /dev/null +++ b/examples/slack-clone/nextjs-slack-clone/supabase/migrations/20240214114147_auth-hook.sql @@ -0,0 +1,58 @@ +/** + * AUTH HOOKS + * Create an auth hook to add a custom claim to the access token jwt. + */ + +-- Create the auth hook function +-- https://supabase.com/docs/guides/auth/auth-hooks#hook-custom-access-token +create or replace function public.custom_access_token_hook(event jsonb) +returns jsonb +language plpgsql +immutable +as $$ + declare + claims jsonb; + user_role public.app_role; + begin + -- Check if the user is marked as admin in the profiles table + select role into user_role from public.user_roles where user_id = (event->>'user_id')::uuid; + + claims := event->'claims'; + + if user_role is not null then + -- Set the claim + claims := jsonb_set(claims, '{user_role}', to_jsonb(user_role)); + else + claims := jsonb_set(claims, '{user_role}', 'null'); + end if; + + -- Update the 'claims' object in the original event + event := jsonb_set(event, '{claims}', claims); + + -- Return the modified or original event + return event; + end; +$$; + +grant usage on schema public to supabase_auth_admin; + +grant execute + on function public.custom_access_token_hook + to supabase_auth_admin; + +revoke execute + on function public.custom_access_token_hook + from authenticated, anon; + +grant all + on table public.user_roles +to supabase_auth_admin; + +revoke all + on table public.user_roles + from authenticated, anon; + +create policy "Allow auth admin to read user roles" ON public.user_roles +as permissive for select +to supabase_auth_admin +using (true) diff --git a/examples/slack-clone/nextjs-slack-clone/supabase/seed.sql b/examples/slack-clone/nextjs-slack-clone/supabase/seed.sql new file mode 100644 index 00000000000..5e208015da7 --- /dev/null +++ b/examples/slack-clone/nextjs-slack-clone/supabase/seed.sql @@ -0,0 +1,23 @@ +insert into public.role_permissions (role, permission) +values + ('admin', 'channels.delete'), + ('admin', 'messages.delete'), + ('moderator', 'messages.delete'); + +DO $$ +DECLARE + user_id uuid; +BEGIN + user_id := public.create_user('supabot+supaadmin@example.com'); + + insert into public.channels (slug, created_by) + values + ('public', user_id), + ('random', user_id); + + insert into public.messages (message, channel_id, user_id) + values + ('Hello World 👋', 1, user_id), + ('Perfection is attained, not when there is nothing more to add, but when there is nothing left to take away.', 2, user_id); +END $$; + From b7ea0994e451c4287f28a1cca066863bdaafcfb1 Mon Sep 17 00:00:00 2001 From: Michael Owen <62911962+eastcoasting@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:36:44 -0500 Subject: [PATCH 003/163] Format numbers in statistics charts #21742 (#21750) use Intl.NumberFormat() without explicit locale. --- apps/studio/components/interfaces/Home/ProjectUsage.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/studio/components/interfaces/Home/ProjectUsage.tsx b/apps/studio/components/interfaces/Home/ProjectUsage.tsx index cdd7def1fe3..bbf1f9870c7 100644 --- a/apps/studio/components/interfaces/Home/ProjectUsage.tsx +++ b/apps/studio/components/interfaces/Home/ProjectUsage.tsx @@ -71,6 +71,7 @@ const ProjectUsage = () => { endDateLocal.toISOString() ) const datetimeFormat = selectedInterval.format || 'MMM D, ha' + const numberFormat = new Intl.NumberFormat() const handleBarClick = ( value: UsageApiCounts, @@ -129,7 +130,7 @@ const ProjectUsage = () => { yAxisKey="total_rest_requests" onBarClick={(v: unknown) => handleBarClick(v as UsageApiCounts, 'rest')} customDateFormat={datetimeFormat} - highlightedValue={sumBy(charts, 'total_rest_requests')} + highlightedValue={numberFormat.format(sumBy(charts, 'total_rest_requests'))} /> @@ -154,7 +155,7 @@ const ProjectUsage = () => { yAxisKey="total_auth_requests" onBarClick={(v: unknown) => handleBarClick(v as UsageApiCounts, 'auth')} customDateFormat={datetimeFormat} - highlightedValue={sumBy(charts || [], 'total_auth_requests')} + highlightedValue={numberFormat.format(sumBy(charts || [], 'total_auth_requests'))} /> @@ -181,7 +182,7 @@ const ProjectUsage = () => { yAxisKey="total_storage_requests" onBarClick={(v: unknown) => handleBarClick(v as UsageApiCounts, 'storage')} customDateFormat={datetimeFormat} - highlightedValue={sumBy(charts, 'total_storage_requests')} + highlightedValue={numberFormat.format(sumBy(charts, 'total_storage_requests'))} /> @@ -206,7 +207,7 @@ const ProjectUsage = () => { yAxisKey="total_realtime_requests" onBarClick={(v: unknown) => handleBarClick(v as UsageApiCounts, 'realtime')} customDateFormat={datetimeFormat} - highlightedValue={sumBy(charts, 'total_realtime_requests')} + highlightedValue={numberFormat.format(sumBy(charts, 'total_realtime_requests'))} /> From 4085e3130430a612767cae39081ffbe6a1069067 Mon Sep 17 00:00:00 2001 From: Wen Bo Xie <5532241+w3b6x9@users.noreply.github.com> Date: Mon, 4 Mar 2024 15:09:12 -0800 Subject: [PATCH 004/163] docs: re-order Read Replicas doc sections (#21703) * docs: re-order Read Replicas doc sections * chore: fix typo about compute size change * Update apps/docs/content/guides/platform/read-replicas.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/platform/read-replicas.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/platform/read-replicas.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * docs: remove duplicate image --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../content/guides/platform/read-replicas.mdx | 167 +++++++++--------- .../Addons/ComputeInstanceSidePanel.tsx | 4 +- 2 files changed, 81 insertions(+), 90 deletions(-) diff --git a/apps/docs/content/guides/platform/read-replicas.mdx b/apps/docs/content/guides/platform/read-replicas.mdx index 29f048a7a1b..d638036313c 100644 --- a/apps/docs/content/guides/platform/read-replicas.mdx +++ b/apps/docs/content/guides/platform/read-replicas.mdx @@ -1,71 +1,15 @@ --- title: 'Read Replicas' -description: 'Spin up additional read-only databases for your project.' -subtitle: 'Spin up additional read-only databases for your project' +description: 'Deploy additional read-only databases in multiple regions for your project.' +subtitle: 'Deploy additional read-only databases in multiple regions for your project' --- - + -To try out read replicas, [request access here](https://forms.supabase.com/read-replica). +[Request early access here](https://forms.supabase.com/read-replica). -Read replicas continuously replicate data from a primary database. You can both read and write data on a primary database, but you can _only_ read (for example, use `select` statements), and not write, on a read replica. - -| | select | insert | update | delete | -| ------------ | ------ | ------ | ------ | ------ | -| Primary | ✅ | ✅ | ✅ | ✅ | -| Read Replica | ✅ | - | - | - | - -When you create a project, the automatically created database is considered the primary database. If you then add read replicas, they will receive and synchronize data from this primary database. Replication is asynchronous. It happens in the background, so transactions on the primary aren't blocked. The time delay between writing data to the primary and the read replica receiving the change is called replication lag. - -Read replicas have many applications: - -- They reduce read load on the primary database. - - For example, you can use a read replica for complex analytical queries and reserve the primary for user-facing create, update, and delete operations. -- For projects that need to cover a global audience, additional databases can be spun up closer to users in any of our twelve supported regions to reduce latency. -- Read replicas provide data redundancy. - -## How are Read Replicas made? - -We use a hybrid approach to replicate data from a primary to its read replicas, combining the native methods of streaming replication and file-based log shipping. - -### Streaming replication - -Postgres generates a Write Ahead Log (WAL) as database changes occur. With streaming replication, these changes stream from the primary to the read replica server. The WAL alone is sufficient to reconstruct the database to its current state. - -This replication method is fast, since changes are streamed directly from the primary to the read replica. On the other hand, it faces challenges when the read replica can't keep up with the WAL changes from its primary. This can happen when the read replica is too small, running on degraded hardware, or has a heavier workload running. - -To address this, Postgres does provide tunable configuration, like `wal_keep_size`, to adjust the WAL retained by the primary. If the read replica fails to “catch up” before the WAL surpasses the `wal_keep_size` setting, the replication is terminated. Tuning is a bit of an art - the amount of WAL required is variable for every situation. - -### File-based log shipping - -In this replication method, the primary continuously buffers WAL changes to a local file and then sends the file to the read replica. If multiple read replicas are present, files could also be sent to an intermediary location accessible by all. The read replica then reads the WAL files and applies those changes. There is higher replication lag than streaming replication since the primary buffers the changes locally first. It also means there is a small chance that WAL changes do not reach read replicas if the primary goes down before the file is transferred. In these cases, if the primary fails a replica using streaming replication would (in most cases) be more up-to-date than a replica using file-based log shipping. - -### File-based log shipping 🤝 streaming replication - -
    - How replication is achieved. - - How replication is achieved. -
    How replication is achieved.
    - -
    - -We bring these two methods together to achieve quick, stable, and reliable replication. Each method addresses the limitations of the other. Streaming replication minimizes replication lag, while file-based log shipping provides a fallback. For file-based log shipping, we use our existing Point In Time Recovery (PITR) infrastructure. We regularly archive files from the primary using [WAL-G](https://github.com/wal-g/wal-g), an open source archival and restoration tool, and ship the WAL files to S3. - -We combine it with streaming replication to reduce replication lag. Once WAL-G files have been synced from S3, read replicas connect to the primary and stream the WAL directly. - -## Getting started -
    -Read replicas can be managed from the [infrastructure settings page](https://supabase.com/dashboard/project/_/settings/infrastructure). For now, each project can only spin up to two read replicas. Read replicas also inherit the compute size of their primary database. +Read Replicas are Postgres databases that are continuously synced to a Supabase project's Primary database. You can both read from and write to a Primary database, but you can _only_ read from a Read Replica, such as using `select` statements. -Read replicas offer the following features: +| | select | insert | update | delete | +| ------------ | ------ | ------ | ------ | ------ | +| Primary | ✅ | ✅ | ✅ | ✅ | +| Read Replica | ✅ | - | - | - | + +A database is spun up automatically with every Supabase project. This database is the Primary database. You can choose to add Read Replicas to your project and those Replicas will receive and synchronize data from the Primary database. + +Replication is asynchronous and happens in the background so transactions on the Primary aren't blocked. The time delay between writing data to the Primary and the Read Replica receiving the change is replication lag. + +Read Replicas have many applications: + +- They reduce read load on the Primary database. + - For example, you can use a Read Replica for complex analytical queries and reserve the Primary for user-facing create, update, and delete operations. +- For projects that need to cover a global audience, additional databases can be deployed closer to users in any of our twelve supported regions to reduce latency. +- Read Replicas provide data redundancy. + +## Prerequisites + +A project needs to satisfy these requirements to deploy a Read Replica: + +1. Running on AWS. + - Support for projects on Fly.io is coming. +1. Running on at least a [Small compute add-on](/docs/guides/platform/compute-add-ons). + - Read Replicas are currently placed on the same compute instance as the database to make sure they can keep up with the Primary's activities. +1. Using [physical backups](/docs/guides/platform/backups#point-in-time-recovery) + - Physical backups are automatically enabled if using [PITR](/docs/guides/platform/backups#point-in-time-recovery) +1. Running on Postgres 15. + - For projects running on older versions of PostgreSQL, you will need to [upgrade to the latest platform version](/docs/guides/platform/migrating-and-upgrading-projects#pgupgrade). + +## Getting started + +Read Replicas can be managed from the [infrastructure settings page](https://supabase.com/dashboard/project/_/settings/infrastructure). For now, each project can only deploy up to two Read Replicas and all Read Replicas inherit the compute size of their Primary database. + +Read Replicas offer the following features: ### Dedicated endpoints -Each read replica has its own dedicated database and API endpoints. The database endpoint can be found in your [dashboard database settings](https://supabase.com/dashboard/project/_/settings/database) under **Connection info**. The API endpoint can be found in [dashboard API settings](https://supabase.com/dashboard/project/_/settings/api) under **Project URL**. +Each Read Replica has its own dedicated database and API endpoints. The database endpoint can be found in your [dashboard database settings](https://supabase.com/dashboard/project/_/settings/database) under **Connection info**. The API endpoint can be found in [dashboard API settings](https://supabase.com/dashboard/project/_/settings/api) under **Project URL**. -A read replica's API endpoint only supports `GET` requests to the [REST API](https://supabase.com/docs/guides/api). Requests towards other Supabase products, such as Auth, Storage, and Realtime are not able to utilize a read replica nor its API endpoint for now. We are working on adding read replica support for them. +A Read Replica's API endpoint only supports `GET` requests to the [REST API](https://supabase.com/docs/guides/api). Requests towards other Supabase products, such as Auth, Storage, and Realtime, are not able to utilize a Read Replica nor its API endpoint for now. We are working on adding Read Replica support for them. ### Dedicated connection pool -A connection pool through Supavisor is also available for each read replica. Its unique connection string can be found in your [dashboard database settings](https://supabase.com/dashboard/project/_/settings/database) under **Connection string**. +A connection pool through Supavisor is also available for each Read Replica. Its unique connection string can be found in your [dashboard database settings](https://supabase.com/dashboard/project/_/settings/database) under **Connection string**. ### Querying through the SQL editor @@ -112,45 +89,59 @@ A connection pool through Supavisor is also available for each read replica. Its
    -In the SQL editor, you can choose if you want to run the query on the primary or one of the replicas. +In the SQL editor, you can choose if you want to run the query on the Primary or one of the Replicas. ### API load balancer -When read replicas are spun up, an API load balancer becomes available for the project. An endpoint for it is provisioned and can be found [here](https://supabase.com/dashboard/project/_/settings/api). +When Read Replicas are deployed, an API load balancer becomes available for the project. An endpoint for it is provisioned and can be found [here](https://supabase.com/dashboard/project/_/settings/api). -The load balancer uses a round-robin strategy to route `GET` requests to any of the API endpoints available, including that of the primary database. Non-`GET` requests can also be sent through this endpoint. They are immediately redirected to the primary database. +The load balancer uses a round-robin strategy to route `GET` requests to any of the API endpoints available, including that of the Primary database. Non-`GET` requests can also be sent through this endpoint. They are immediately redirected to the Primary database. -Similar to the read replica API endpoints, only requests to the REST API are available for now. Support for other Supabase products will become available once read replica support has been completed for them. +Similar to the Read Replica API endpoints, only requests to the REST API are available for now. Support for other Supabase products will become available once Read Replica support has been completed for them. -When a project no longer has any read replicas, the load balancer and its endpoint are brought down as well. +When a project no longer has any Read Replicas, the load balancer and its endpoint are brought down as well. ### Centralized configuration management -All settings made through the dashboard will be propagated across all databases of a project. This ensures that no read replica get out of sync with its primary database or with other read replicas. +All settings made through the dashboard will be propagated across all databases of a project. This ensures that no Read Replica get out of sync with its Primary database or with other Read Replicas. -## Limitations +## How are Read Replicas made? -### Prerequisites for using read replicas +We use a hybrid approach to replicate data from a Primary to its Read Replicas, combining the native methods of streaming replication and file-based log shipping. -A project needs to satisfy these requirements to spin up a read replica: +### Streaming replication -1. Running on AWS. - - Support for projects on Fly.io will be added at a later date. -1. Running on at least a [Small compute add-on](/docs/guides/platform/compute-add-ons). -1. Using [physical backups](/docs/guides/platform/backups#point-in-time-recovery) - - Physical backups are automatically enabled if using [PITR](/docs/guides/platform/backups#point-in-time-recovery) -1. Running on Postgres 15. - - For projects running on older versions of PostgreSQL, you will need to [upgrade to the latest platform version](/docs/guides/platform/migrating-and-upgrading-projects#pgupgrade). +Postgres generates a Write Ahead Log (WAL) as database changes occur. With streaming replication, these changes stream from the Primary to the Read Replica server. The WAL alone is sufficient to reconstruct the database to its current state. -### Read replicas need to be brought down before starting the following procedures +This replication method is fast, since changes are streamed directly from the Primary to the Read Replica. On the other hand, it faces challenges when the Read Replica can't keep up with the WAL changes from its Primary. This can happen when the Read Replica is too small, running on degraded hardware, or has a heavier workload running. -The following procedures require all read replicas for a project to be brought down before they can be started: +To address this, Postgres does provide tunable configuration, like `wal_keep_size`, to adjust the WAL retained by the Primary. If the Read Replica fails to “catch up” before the WAL surpasses the `wal_keep_size` setting, the replication is terminated. Tuning is a bit of an art - the amount of WAL required is variable for every situation. -1. [Upgrading a project](/docs/guides/platform/migrating-and-upgrading-projects#pgupgrade) -1. Performing [data restoration](/docs/guides/platform/backups#pitr-restoration-process). +### File-based log shipping -Once these operations complete, read replicas can be spun back up. +In this replication method, the Primary continuously buffers WAL changes to a local file and then sends the file to the Read Replica. If multiple Read Replicas are present, files could also be sent to an intermediary location accessible by all. The Read Replica then reads the WAL files and applies those changes. There is higher replication lag than streaming replication since the Primary buffers the changes locally first. It also means there is a small chance that WAL changes do not reach Read Replicas if the Primary goes down before the file is transferred. In these cases, if the Primary fails a Replica using streaming replication would (in most cases) be more up-to-date than a Replica using file-based log shipping. -### Compute Add-ons +### File-based log shipping 🤝 streaming replication -In order to avoid replicas being unable to keep up with activity on the primaries they're following, Read Replicas are currently placed on the same Compute Add-on as the primary they're following. +
    + Map view of Primary and Read Replica databases +
    Map view of Primary and Read Replica databases
    +
    + +We bring these two methods together to achieve quick, stable, and reliable replication. Each method addresses the limitations of the other. Streaming replication minimizes replication lag, while file-based log shipping provides a fallback. For file-based log shipping, we use our existing Point In Time Recovery (PITR) infrastructure. We regularly archive files from the Primary using [WAL-G](https://github.com/wal-g/wal-g), an open source archival and restoration tool, and ship the WAL files to S3. + +We combine it with streaming replication to reduce replication lag. Once WAL-G files have been synced from S3, Read Replicas connect to the Primary and stream the WAL directly. + +## Operations blocked by Read Replicas + +### Project upgrades and data restorations + +The following procedures require all Read Replicas for a project to be brought down before they can be performed: + +1. [Project upgrades](/docs/guides/platform/migrating-and-upgrading-projects#pgupgrade) +1. [Data restorations](/docs/guides/platform/backups#pitr-restoration-process) + +These operations need to be completed before Read Replicas can be re-deployed. diff --git a/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx b/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx index 041bd8725d6..dbf847aa52f 100644 --- a/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx +++ b/apps/studio/components/interfaces/Settings/Addons/ComputeInstanceSidePanel.tsx @@ -399,7 +399,7 @@ const ComputeInstanceSidePanel = () => { - Your project will need to be restarted when changing it's compute size + Your project will need to be restarted when changing its compute size Your project will be unavailable for up to 2 minutes while the changes take place. @@ -485,7 +485,7 @@ const ComputeInstanceSidePanel = () => { Your project will be unavailable for up to 2 minutes while the changes take place. From 148a872e17265b051139873910dc9ae5194b214c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Tue, 5 Mar 2024 00:37:25 +0100 Subject: [PATCH 005/163] docs(branching): Specify that only migrations are applied (#21759) --- apps/docs/content/guides/platform/branching.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/content/guides/platform/branching.mdx b/apps/docs/content/guides/platform/branching.mdx index 57d949e501c..e766fb1db27 100644 --- a/apps/docs/content/guides/platform/branching.mdx +++ b/apps/docs/content/guides/platform/branching.mdx @@ -119,7 +119,7 @@ For security reasons, Preview Branches do not contain production data. Future ve ### Merging production changes -When you merge your Git branch into the production branch, all changes will be applied to your Production environment. +When you merge your Git branch into the production branch, all new migrations will be applied to your Production environment. ### Git providers From 70c118df900e4cd334fd5975f005f9cbb823599e Mon Sep 17 00:00:00 2001 From: Madhav Bansal <52946553+madhav23bansal@users.noreply.github.com> Date: Tue, 5 Mar 2024 06:41:57 +0530 Subject: [PATCH 006/163] Guide to Setting Up TextLocal as Your Phone Login Provider (#21499) * Add TextLocal SMS Login to NavigationMenu.constants.ts and create guide for Phone Auth with TextLocal * Fix typo in Textlocal SMS Login * Update Textlocal integration and documentation for DLT compliance. * Addressed comments * Update Textlocal SMS Login name * Update Textlocal SMS Login name to 'Textlocal SMS Login (Community Supported)' --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../NavigationMenu.constants.ts | 6 ++ .../guides/auth/phone-login/textlocal.mdx | 63 +++++++++++++++++++ apps/docs/public/img/icons/textlocal-icon.svg | 22 +++++++ 3 files changed, 91 insertions(+) create mode 100644 apps/docs/content/guides/auth/phone-login/textlocal.mdx create mode 100644 apps/docs/public/img/icons/textlocal-icon.svg diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 3f3f3cf9754..8fca482d4a6 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -492,6 +492,12 @@ export const PhoneLoginsItems = [ isDarkMode: true, hasLightIcon: true, }, + { + name: 'Textlocal SMS Login (Community Supported)', + icon: '/docs/img/icons/textlocal-icon', + url: '/guides/auth/phone-login/textlocal', + linkDescription: 'Textlocal is a cloud-based SMS platform offering bulk messaging services.', + }, ] export const auth = { diff --git a/apps/docs/content/guides/auth/phone-login/textlocal.mdx b/apps/docs/content/guides/auth/phone-login/textlocal.mdx new file mode 100644 index 00000000000..9a717bfca17 --- /dev/null +++ b/apps/docs/content/guides/auth/phone-login/textlocal.mdx @@ -0,0 +1,63 @@ +--- +id: 'auth-textlocal' +title: 'Phone Auth with Textlocal' +subtitle: 'How to set up and use Mobile OTP with Textlocal and Supabase.' +description: 'How to set up and use Mobile OTP with Textlocal and Supabase.' +--- + + + +To manage costs related to SMS authentication, consider setting project rate limits and configuring CAPTCHA. For additional cost-control strategies, visit the Production Checklist. + +Also check country-specific regulations around sending SMS messages, for example, India's TRAI DLT +regulations. + + + +## Prerequisites + +Before you begin, ensure you have the following: + +- **A Textlocal account**: Sign up for [TextLocal](https://www.textlocal.com/signup) to start sending SMS messages. +- **A Supabase project**: Necessary for SMS authentication integration. Create your project in the [Supabase Dashboard](https://supabase.com/dashboard). +- **A mobile phone**: To receive SMS messages and test your setup. + +## Setting up Textlocal as your SMS provider + +To integrate Textlocal with Supabase: + +1. [Get a Textlocal API key](#get-a-textlocal-api-key) +2. [Customize your sender name](#customize-your-sender-name-optional) +3. [Configure your Supabase project](#configure-supabase) + +### Get a Textlocal API key + +1. Log into your Textlocal account and go to `Settings` > `API Keys`. +2. Generate a new API Key. Save your new API key in a safe location. + +### Customize your sender name (Optional) + +Textlocal defaults to `TXTLCL` as the sender name for all messages. You can customize this to better reflect your brand: + +1. In your Textlocal dashboard, go to `Settings` > `All Settings` > `Sender Names`. +2. Change your sender name. + +### Configure Supabase + +To set up Textlocal as your SMS provider in Supabase, follow these steps: + +1. In your Supabase Dashboard, go to the [Auth Providers section](https://supabase.com/dashboard/project/_/auth/providers). +2. From the list of available authentication providers, select `Phone`. +3. Toggle `Enable Phone Provider`. +4. Under `SMS Provider`, select `Textlocal.` +5. Enter your Textlocal API Key and Sender Name. +6. Customize your SMS Message (optional). + +## Next steps + +To implement Phone Login, see the docs on [using Phone Login](/docs/guides/auth/phone-login#using-phone-login). + +## Resources + +- [Textlocal Signup](https://www.textlocal.com/sign-up) +- [Supabase Dashboard](https://supabase.com/dashboard) diff --git a/apps/docs/public/img/icons/textlocal-icon.svg b/apps/docs/public/img/icons/textlocal-icon.svg new file mode 100644 index 00000000000..6a15d728bd3 --- /dev/null +++ b/apps/docs/public/img/icons/textlocal-icon.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + \ No newline at end of file From cc2425d11b7c75508a7ad0e66244aa7ad9bab1c8 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 5 Mar 2024 09:43:06 +0800 Subject: [PATCH 007/163] fix: typo in region name (#21761) --- .../InstanceConfiguration.constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants.ts b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants.ts index c103157e0d4..a2a9ad88ef1 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants.ts +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants.ts @@ -39,7 +39,7 @@ export const AWS_REGIONS_VALUES: { [key: string]: string } = { NORTHEAST_ASIA_2: 'ap-northeast-2', CENTRAL_CANADA: 'ca-central-1', WEST_US: 'us-west-1', - EAST_US: 'es-east-1', + EAST_US: 'us-east-1', WEST_EU: 'eu-west-1', WEST_EU_2: 'eu-west-2', CENTRAL_EU: 'eu-central-1', From 33d73f2e7a20db29913ae3135fbe98bb7393fce7 Mon Sep 17 00:00:00 2001 From: Ariel Nathan <23708562+ariel-nathan@users.noreply.github.com> Date: Mon, 4 Mar 2024 21:55:48 -0500 Subject: [PATCH 008/163] docs: reword phone login sentence (#21716) Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/content/guides/auth/phone-login.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/content/guides/auth/phone-login.mdx b/apps/docs/content/guides/auth/phone-login.mdx index a608bcb26eb..e35520a002a 100644 --- a/apps/docs/content/guides/auth/phone-login.mdx +++ b/apps/docs/content/guides/auth/phone-login.mdx @@ -108,7 +108,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \ The user receives an SMS with a 6-digit pin that you must [verify](/docs/guides/auth/phone-login#verify-a-user) within 60 seconds. -After their phone number is verified, the user can use their phone number and password to sign in with needing to reverify each time: +Once a user's phone number is verified, they can sign in using their phone number and password without requiring phone number re-verification at each sign-in: Date: Mon, 4 Mar 2024 22:28:56 -0500 Subject: [PATCH 009/163] fixed local development link in RBAC docs (#21762) --- .../auth/custom-claims-and-role-based-access-control-rbac.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx b/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx index b1f22158f9b..acd69948b93 100644 --- a/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx +++ b/apps/docs/content/guides/auth/custom-claims-and-role-based-access-control-rbac.mdx @@ -202,7 +202,7 @@ using (true) In the dashboard, navigate to [`Authentication > Hooks (Beta)`](/dashboard/project/_/auth/hooks) and select the appropriate PostgreSQL function from the dropdown menu. -When developing locally, follow the [local development](/guides/auth/auth-hooks#local-development) instructions. +When developing locally, follow the [local development](/docs/guides/auth/auth-hooks#local-development) instructions. From 950a3f8efbdd1eba6145e47492726fa2bf81687c Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Tue, 5 Mar 2024 04:29:05 +0100 Subject: [PATCH 010/163] chore: update self-hosted image versions (#21763) chore: update image versions for docker/docker-compose.yml --- docker/docker-compose.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 75a059d3cf3..0313ecf14cb 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -10,7 +10,7 @@ services: studio: container_name: supabase-studio - image: supabase/studio:20240205-b145c86 + image: supabase/studio:20240301-0942bfe restart: unless-stopped healthcheck: test: @@ -76,7 +76,7 @@ services: auth: container_name: supabase-auth - image: supabase/gotrue:v2.132.3 + image: supabase/gotrue:v2.143.0 depends_on: db: # Disable this if you are using an external Postgres database @@ -156,7 +156,7 @@ services: realtime: # This container name looks inconsistent but is correct because realtime constructs tenant id by parsing the subdomain container_name: realtime-dev.supabase-realtime - image: supabase/realtime:v2.25.50 + image: supabase/realtime:v2.25.66 depends_on: db: # Disable this if you are using an external Postgres database @@ -256,7 +256,7 @@ services: meta: container_name: supabase-meta - image: supabase/postgres-meta:v0.77.2 + image: supabase/postgres-meta:v0.79.0 depends_on: db: # Disable this if you are using an external Postgres database @@ -274,7 +274,7 @@ services: functions: container_name: supabase-edge-functions - image: supabase/edge-runtime:v1.36.1 + image: supabase/edge-runtime:v1.38.0 restart: unless-stopped depends_on: analytics: From 21d1b8afbb94251e090d28368412e5675e4db2e8 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Tue, 5 Mar 2024 05:27:37 +0100 Subject: [PATCH 011/163] chore: update cli reference doc (#21764) * chore: update cli reference doc * Update apps/docs/spec/cli_v1_commands.yaml --------- Co-authored-by: Han Qiao --- apps/docs/spec/cli_v1_commands.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/docs/spec/cli_v1_commands.yaml b/apps/docs/spec/cli_v1_commands.yaml index 80b218faaaf..fff89d8dfde 100644 --- a/apps/docs/spec/cli_v1_commands.yaml +++ b/apps/docs/spec/cli_v1_commands.yaml @@ -1,7 +1,7 @@ clispec: '001' info: id: cli - version: 1.145.4 + version: 1.148.6 title: Supabase CLI language: sh source: https://github.com/supabase/cli @@ -2349,8 +2349,6 @@ commands: - id: supabase-gen-types-typescript title: supabase gen types typescript summary: Generate types for TypeScript - description: | - Generate types for TypeScript. Must specify one of --local, --linked, --project-id, or --db-url tags: [] links: [] usage: supabase gen types typescript [flags] @@ -2378,8 +2376,8 @@ commands: description: Generate types from a project ID. default_value: '' - id: schema - name: --schema - description: Schemas to generate types for. + name: -s, --schema + description: Comma separated list of schema to include. default_value: '[]' - id: supabase-gen-keys title: supabase gen keys From cb7c67864b2b5deee7fb0498622fc146712fc46b Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Mon, 4 Mar 2024 23:32:46 -0500 Subject: [PATCH 012/163] chore: linting rule tweaks and error fixes (#21678) --- .vale.ini | 6 +- apps/docs/content/guides/ai.mdx | 12 ++++ .../content/guides/database/extensions.mdx | 4 +- .../guides/database/extensions/hypopg.mdx | 8 +-- .../database/extensions/pg_jsonschema.mdx | 4 +- .../database/extensions/pg_plan_filter.mdx | 6 +- .../guides/database/extensions/pgaudit.mdx | 22 +++--- .../guides/database/extensions/pgjwt.mdx | 8 +-- .../guides/database/extensions/pgroonga.mdx | 8 +-- .../guides/database/extensions/pgrouting.mdx | 10 +-- .../guides/database/extensions/pgsodium.mdx | 10 +-- .../guides/database/extensions/pgtap.mdx | 6 +- .../guides/database/extensions/plv8.mdx | 4 +- .../guides/database/full-text-search.mdx | 34 ++++++++- .../guides/database/managing-timezones.mdx | 2 +- .../database/postgres/cascade-deletes.mdx | 22 +++--- .../database/postgres/configuration.mdx | 2 +- .../guides/database/postgres/roles.mdx | 8 +-- .../database/postgres/row-level-security.mdx | 6 +- .../guides/database/postgres/triggers.mdx | 2 +- .../guides/database/query-optimization.mdx | 4 +- apps/docs/content/guides/database/vault.mdx | 8 +-- .../content/guides/functions/dart-edge.mdx | 9 ++- .../guides/getting-started/architecture.mdx | 16 ++--- .../guides/getting-started/features.mdx | 4 +- .../tutorials/with-angular.mdx | 2 +- .../tutorials/with-expo-react-native.mdx | 4 ++ .../tutorials/with-ionic-angular.mdx | 2 +- .../getting-started/tutorials/with-kotlin.mdx | 4 +- .../tutorials/with-redwoodjs.mdx | 8 +-- .../getting-started/tutorials/with-refine.mdx | 4 +- .../tutorials/with-sveltekit.mdx | 2 +- apps/docs/content/guides/realtime.mdx | 16 ++--- apps/docs/content/guides/resources.mdx | 2 + .../content/guides/self-hosting/docker.mdx | 6 +- vale/styles/Custom/Acronyms.yml | 5 +- vale/styles/Custom/Capitalize.yml | 11 +++ vale/styles/Custom/Exclamation.yml | 12 ---- vale/styles/Custom/Filler.yml | 12 ++++ vale/styles/Custom/Parens.yml | 3 +- vale/styles/Custom/Will.yml | 7 -- vale/styles/Custom/WordList.yml | 41 ++++++----- .../config/vocabularies/Supabase/accept.txt | 72 +++++++++++++++++-- 43 files changed, 281 insertions(+), 157 deletions(-) create mode 100644 vale/styles/Custom/Capitalize.yml delete mode 100644 vale/styles/Custom/Exclamation.yml create mode 100644 vale/styles/Custom/Filler.yml delete mode 100644 vale/styles/Custom/Will.yml diff --git a/.vale.ini b/.vale.ini index 6b721717743..1ff9438668a 100644 --- a/.vale.ini +++ b/.vale.ini @@ -8,5 +8,7 @@ mdx = md [*] BasedOnStyles = Vale, Custom -BlockIgnores = (?s) *(.*?) -TokenIgnores = (href=".*?") +BlockIgnores = (?s) *(.*?), \ +(?s) *(export\s+const\s+\S+\s*=\s*\[.*?\]), \ +(?s) *() +TokenIgnores = (href\s*([=:])\s*['"].*?\1), \ diff --git a/apps/docs/content/guides/ai.mdx b/apps/docs/content/guides/ai.mdx index 66c7ffbedae..f089f7a57c0 100644 --- a/apps/docs/content/guides/ai.mdx +++ b/apps/docs/content/guides/ai.mdx @@ -20,6 +20,8 @@ The toolkit includes: Check out all of the AI [templates and examples](https://github.com/supabase/supabase/tree/master/examples/ai) in our GitHub repository. +{/* */} +
    {examples.map((x) => (
    @@ -66,8 +68,12 @@ export const examples = [ }, ] +{/* */} + ## Integrations +{/* */} +
    {integrations.map((x) => (
    @@ -104,8 +110,12 @@ export const integrations = [ }, ] +{/* */} + ## Case studies +{/* */} +
    {[ { @@ -134,3 +144,5 @@ export const integrations = [
    ))}
    + +{/* */} diff --git a/apps/docs/content/guides/database/extensions.mdx b/apps/docs/content/guides/database/extensions.mdx index 5566a391f6a..d5fb2834e26 100644 --- a/apps/docs/content/guides/database/extensions.mdx +++ b/apps/docs/content/guides/database/extensions.mdx @@ -36,7 +36,7 @@ drop extension pgtap; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension call `drop extension`. @@ -48,7 +48,7 @@ Most extensions are installed under the `extensions` schema, which is accessible If you need to restrict user access to tables managed by extensions, we recommend creating a separate schema for installing that specific extension. -Some extensions can only be created under a specific schema, for eg. `postgis_tiger_geocoder` extension creates a schema named `tiger`. Before enabling such extensions, make sure you have not created a conflicting schema with the same name. +Some extensions can only be created under a specific schema, for example, `postgis_tiger_geocoder` extension creates a schema named `tiger`. Before enabling such extensions, make sure you have not created a conflicting schema with the same name. In addition to the pre-configured extensions, you can also install your own SQL extensions directly in the database using Supabase's SQL editor. The SQL code for the extensions, including plpgsql extensions, can be added through the SQL editor. diff --git a/apps/docs/content/guides/database/extensions/hypopg.mdx b/apps/docs/content/guides/database/extensions/hypopg.mdx index 90c8184bbfe..643c0322352 100644 --- a/apps/docs/content/guides/database/extensions/hypopg.mdx +++ b/apps/docs/content/guides/database/extensions/hypopg.mdx @@ -21,7 +21,7 @@ The motivation for HypoPG is to allow users to quickly search for an index to im 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "hypopg" and enable the extension. +3. Search for `hypopg` and enable the extension. @@ -35,7 +35,7 @@ create extension hypopg with schema extensions; drop extension if exists hypopg; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean. @@ -104,10 +104,10 @@ create index on account(id); - [`hypo_create_index(text)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#create-a-hypothetical-index): A function to create a hypothetical index. - [`hypopg_list_indexes`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A View that lists all hypothetical indexes that have been created. -- [`hypopg()`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function that lists all hypothetical indexes that have been created with the same format as pg_index. +- [`hypopg()`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function that lists all hypothetical indexes that have been created with the same format as `pg_index`. - [`hypopg_get_index_def(oid)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to display the `create index` statement that would create the index. - [`hypopg_get_relation_size(oid)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to estimate how large a hypothetical index would be. -- [`hypopg_drop_index(oid)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to remove a given hypothetical index by oid. +- [`hypopg_drop_index(oid)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to remove a given hypothetical index by `oid`. - [`hypopg_reset()`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to remove all hypothetical indexes. ## Resources diff --git a/apps/docs/content/guides/database/extensions/pg_jsonschema.mdx b/apps/docs/content/guides/database/extensions/pg_jsonschema.mdx index 9261c0a65f8..2770de88178 100644 --- a/apps/docs/content/guides/database/extensions/pg_jsonschema.mdx +++ b/apps/docs/content/guides/database/extensions/pg_jsonschema.mdx @@ -19,7 +19,7 @@ description: 'Validate json/jsonb with JSON Schema in PostgreSQL.' 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pg_jsonschema" and enable the extension. +3. Search for `pg_jsonschema` and enable the extension. @@ -33,7 +33,7 @@ create extension pg_jsonschema with schema extensions; drop extension if exists pg_jsonschema; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean. diff --git a/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx b/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx index 9bc6095b4d2..4c9cba45291 100644 --- a/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx +++ b/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx @@ -4,7 +4,7 @@ title: 'pg_plan_filter: Restrict Total Cost' description: 'Block queries over a total cost limit' --- -[pg_plan_filter](https://github.com/pgexperts/pg_plan_filter) is PostgreSQL extension to block execution of statements where query planner's estimate of the total cost exceeds a threshold. This is intended to give database administrators a way to restrict the contribution an individual query has on database load. +[`pg_plan_filter`](https://github.com/pgexperts/pg_plan_filter) is PostgreSQL extension to block execution of statements where query planner's estimate of the total cost exceeds a threshold. This is intended to give database administrators a way to restrict the contribution an individual query has on database load. ## Enable the extension @@ -27,7 +27,7 @@ alter database some_db set session_preload_libraries = 'plan_filter'; `plan_filter.statement_cost_limit`: restricts the maximum total cost for executed statements `plan_filter.limit_select_only`: restricts to `select` statements -Note that `limit_select_only = true` is not the same as read-only because `select` statements may modify data e.g. through a function call. +Note that `limit_select_only = true` is not the same as read-only because `select` statements may modify data, for example, through a function call. ## Example @@ -88,4 +88,4 @@ HINT: The plan for your query shows that it would probably have an excessive ru ## Resources -- Official [pg_plan_filter documentation](https://github.com/pgexperts/pg_plan_filter) +- Official [`pg_plan_filter` documentation](https://github.com/pgexperts/pg_plan_filter) diff --git a/apps/docs/content/guides/database/extensions/pgaudit.mdx b/apps/docs/content/guides/database/extensions/pgaudit.mdx index 5229ffb0ee9..65d8717c67e 100644 --- a/apps/docs/content/guides/database/extensions/pgaudit.mdx +++ b/apps/docs/content/guides/database/extensions/pgaudit.mdx @@ -21,7 +21,7 @@ PGAudit grants fine grain control over which statements and objects are emitted 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgaudit" and enable the extension. +3. Search for `pgaudit` and enable the extension. @@ -35,7 +35,7 @@ create extension pgaudit; drop extension if exists pgaudit; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. @@ -45,13 +45,13 @@ To disable an extension you can call `drop extension`. The `pgaudit.log` setting controls which statements to log. Available values include: -- **read**: `SELECT` and `COPY` when the source is a relation or a query. -- **write**: `INSERT`, `UPDATE`, `DELETE`, `TRUNCATE`, and `COPY` when the destination is a relation. -- **function**: Function calls and `DO` blocks. -- **role**: Statements related to roles and privileges: `GRANT`, `REVOKE`, `CREATE/ALTER/DROP ROLE`. -- **ddl**: All `DDL` that is not included in the `ROLE` class. -- **misc**: Miscellaneous commands, e.g. `DISCARD`, `FETCH`, `CHECKPOINT`, `VACUUM`, `SET`. -- **misc_set**: Miscellaneous `SET` commands, e.g. `SET ROLE`. +- `read`: `SELECT` and `COPY` when the source is a relation or a query. +- `write`: `INSERT`, `UPDATE`, `DELETE`, `TRUNCATE`, and `COPY` when the destination is a relation. +- `function`: Function calls and `DO` blocks. +- `role`: Statements related to roles and privileges: `GRANT`, `REVOKE`, `CREATE/ALTER/DROP ROLE`. +- `ddl`: All `DDL` that is not included in the `ROLE` class. +- `misc`: Miscellaneous commands, for example, `DISCARD`, `FETCH`, `CHECKPOINT`, `VACUUM`, `SET`. +- `misc_set`: Miscellaneous `SET` commands, for example, `SET ROLE`. - **all**: Include all of the above. @@ -59,7 +59,7 @@ For a full list of available settings see [settings docs](https://github.com/pga -We don't currently support configuring `pgaudit.log_parameter` because it may log secrets in encrypted columns if you are using [pgsodium](/docs/guides/database/extensions/pgsodium) or [Vault](/docs/guides/database/vault). +We don't currently support configuring `pgaudit.log_parameter` because it may log secrets in encrypted columns if you are using [`pgsodium`](/docs/guides/database/extensions/pgsodium) or [Vault](/docs/guides/database/vault). You can upvote this [feature request](https://github.com/orgs/supabase/discussions/20183) if you'd like this restriction lifted. @@ -67,7 +67,7 @@ You can upvote this [feature request](https://github.com/orgs/supabase/discussio ## Example -Given a pgaudit setting +Given a `pgaudit` setting {/* prettier-ignore */} ```sql diff --git a/apps/docs/content/guides/database/extensions/pgjwt.mdx b/apps/docs/content/guides/database/extensions/pgjwt.mdx index 3b4fcc23aca..7d8c71069d1 100644 --- a/apps/docs/content/guides/database/extensions/pgjwt.mdx +++ b/apps/docs/content/guides/database/extensions/pgjwt.mdx @@ -4,7 +4,7 @@ title: 'pgjwt: JSON Web Tokens' description: 'Encode and decode JWTs in PostgreSQL' --- -The [pgjwt](https://github.com/michelp/pgjwt) (PostgreSQL JSON Web Token) extension allows you to create and parse [JSON Web Tokens (JWTs)](https://en.wikipedia.org/wiki/JSON_Web_Token) within a PostgreSQL database. JWTs are commonly used for authentication and authorization in web applications and services. +The [`pgjwt`](https://github.com/michelp/pgjwt) (PostgreSQL JSON Web Token) extension allows you to create and parse [JSON Web Tokens (JWTs)](https://en.wikipedia.org/wiki/JSON_Web_Token) within a PostgreSQL database. JWTs are commonly used for authentication and authorization in web applications and services. ## Enable the extension @@ -19,7 +19,7 @@ The [pgjwt](https://github.com/michelp/pgjwt) (PostgreSQL JSON Web Token) extens 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgjwt" and enable the extension. +3. Search for `pgjwt` and enable the extension. @@ -33,7 +33,7 @@ create extension pgjwt schema extensions; drop extension if exists pgjwt; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean. @@ -67,7 +67,7 @@ select ); ``` -The pgjwt_encode function returns a string that represents the JWT, which can then be safely transmitted between parties. +The `pgjwt_encode` function returns a string that represents the JWT, which can then be safely transmitted between parties. {/* prettier-ignore */} ``` diff --git a/apps/docs/content/guides/database/extensions/pgroonga.mdx b/apps/docs/content/guides/database/extensions/pgroonga.mdx index dbdbbe423b5..e3728d85ed2 100644 --- a/apps/docs/content/guides/database/extensions/pgroonga.mdx +++ b/apps/docs/content/guides/database/extensions/pgroonga.mdx @@ -20,7 +20,7 @@ tocVideo: 'Mmmv9g_MiBA' 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgroonga" and enable the extension. +3. Search for `pgroonga` and enable the extension. @@ -34,7 +34,7 @@ create extension pgroonga with schema extensions; drop extension if exists pgroonga; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. @@ -92,7 +92,7 @@ Index Scan using ix_memos_content on memos (cost=0.00..1.11 rows=1 width=36) (2 rows) ``` -The pgroonga index is used to retrieve the result set: +The `pgroonga` index is used to retrieve the result set: ```markdown | id | content | @@ -102,7 +102,7 @@ The pgroonga index is used to retrieve the result set: ## Full text search -The `&@~` operator performs full text search. It returns any matching results. Unlike `LIKE` operator, pgroonga can search any text that contains the keyword case insensitive. +The `&@~` operator performs full text search. It returns any matching results. Unlike `LIKE` operator, `pgroonga` can search any text that contains the keyword case insensitive. Take the following example: diff --git a/apps/docs/content/guides/database/extensions/pgrouting.mdx b/apps/docs/content/guides/database/extensions/pgrouting.mdx index c257613decc..083b19df884 100644 --- a/apps/docs/content/guides/database/extensions/pgrouting.mdx +++ b/apps/docs/content/guides/database/extensions/pgrouting.mdx @@ -4,7 +4,7 @@ title: 'pgrouting: Geospatial Routing' description: 'Extends PostGIS with Geospatial Routing' --- -[pgRouting](http://pgrouting.org) is PostgreSQL and [PostGIS](http://postgis.net) extension adding geospatial routing functionality. +[`pgRouting`](http://pgrouting.org) is PostgreSQL and [PostGIS](http://postgis.net) extension adding geospatial routing functionality. The core functionality of `pgRouting` is a set of path finding algorithms including: @@ -33,7 +33,7 @@ The core functionality of `pgRouting` is a set of path finding algorithms includ 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgrouting" and enable the extension. +3. Search for `pgrouting` and enable the extension. @@ -47,7 +47,7 @@ create extension pgrouting cascade; drop extension if exists pgRouting; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. @@ -55,9 +55,9 @@ To disable an extension you can call `drop extension`. ## Example -As an example, we'll solve the [traveling salesman problem](https://en.wikipedia.org/wiki/Travelling_salesman_problem) using the pgRouting's `pgr_TSPeuclidean` function from some PostGIS coordinates. +As an example, we'll solve the [traveling salesperson problem](https://en.wikipedia.org/wiki/Travelling_salesman_problem) using the `pgRouting`'s `pgr_TSPeuclidean` function from some PostGIS coordinates. -A summary of the traveling salesman problem is, given a set of city coordinates, solve for a path that goes through each city and minimizes the total distance traveled. +A summary of the traveling salesperson problem is, given a set of city coordinates, solve for a path that goes through each city and minimizes the total distance traveled. First we populate a table with some X, Y coordinates diff --git a/apps/docs/content/guides/database/extensions/pgsodium.mdx b/apps/docs/content/guides/database/extensions/pgsodium.mdx index 4c68884799d..8c139f9ef80 100644 --- a/apps/docs/content/guides/database/extensions/pgsodium.mdx +++ b/apps/docs/content/guides/database/extensions/pgsodium.mdx @@ -4,13 +4,13 @@ title: 'pgsodium: Encryption Features' description: 'Encryption library for PostgreSQL' --- -[pgsodium](https://github.com/michelp/pgsodium) is a PostgreSQL extension which provides SQL access to [libsodium's](https://doc.libsodium.org/) high-level cryptographic algorithms. +[`pgsodium`](https://github.com/michelp/pgsodium) is a PostgreSQL extension which provides SQL access to [`libsodium`'s](https://doc.libsodium.org/) high-level cryptographic algorithms. -libsodium is a modern, easy-to-use software library for encryption, decryption, signatures, password hashing, and more. It is a portable, cross-compilable, installable, and packageable fork of the [NaCl](http://nacl.cr.yp.to/) library, with a compatible but extended API to improve usability even further. +`libsodium` is a modern, easy-to-use software library for encryption, decryption, signatures, password hashing, and more. It is a portable, cross-compilable, installable, and packageable fork of the [NaCl](http://nacl.cr.yp.to/) library, with a compatible but extended API to improve usability even further. The design choices emphasize security and ease of use. But despite the emphasis on high security, primitives are faster across-the-board than most implementations. -pgsodium exposes the following libsodium APIs to SQL: +`pgsodium` exposes the following `libsodium` APIs to SQL: - [Generating Random Data](https://github.com/michelp/pgsodium/#generating-random-data) - [Secret key cryptography](https://github.com/michelp/pgsodium/#secret-key-cryptography) @@ -53,7 +53,7 @@ Note that Supabase projects are already encrypted at rest by default. ## Get the root encryption key for your Supabase project -Encryption requires keys. Keeping the keys in the same database as the encrypted data would be unsafe. For more information about managing the pgsodium root encryption key on your Supabase project see **[encryption key location](/docs/guides/database/vault#encryption-key-location)**. This key is required to decrypt values stored in [Supabase Vault](/docs/guides/database/vault) and data encrypted with Transparent Column Encryption. +Encryption requires keys. Keeping the keys in the same database as the encrypted data would be unsafe. For more information about managing the `pgsodium` root encryption key on your Supabase project see **[encryption key location](/docs/guides/database/vault#encryption-key-location)**. This key is required to decrypt values stored in [Supabase Vault](/docs/guides/database/vault) and data encrypted with Transparent Column Encryption. ## Enable the extension @@ -68,7 +68,7 @@ Encryption requires keys. Keeping the keys in the same database as the encrypted 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgsodium" and enable the extension. +3. Search for `pgsodium` and enable the extension. diff --git a/apps/docs/content/guides/database/extensions/pgtap.mdx b/apps/docs/content/guides/database/extensions/pgtap.mdx index 8b00e4c1bbb..bbcd7c3b125 100644 --- a/apps/docs/content/guides/database/extensions/pgtap.mdx +++ b/apps/docs/content/guides/database/extensions/pgtap.mdx @@ -26,7 +26,7 @@ Let's cover some basic concepts: 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgtap" and enable the extension. +3. Search for `pgtap` and enable the extension. @@ -39,7 +39,7 @@ create extension pgtap with schema extensions; drop extension if exists pgtap; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean. @@ -149,7 +149,7 @@ rollback; API: - [`function_returns()`](https://pgtap.org/documentation.html#function_returns): Tests that a particular function returns a particular data type -- [`is_definer()`](https://pgtap.org/documentation.html#is_definer): Tests that a function is a security definer (i.e., a “setuid” function). +- [`is_definer()`](https://pgtap.org/documentation.html#is_definer): Tests that a function is a security definer (that is, a `setuid` function). ## Resources diff --git a/apps/docs/content/guides/database/extensions/plv8.mdx b/apps/docs/content/guides/database/extensions/plv8.mdx index 30ac72e01da..a27592d1270 100644 --- a/apps/docs/content/guides/database/extensions/plv8.mdx +++ b/apps/docs/content/guides/database/extensions/plv8.mdx @@ -8,7 +8,7 @@ The `plv8` extension allows you use JavaScript within Postgres. ## Overview -While Postgres natively runs SQL, it can also run other "procedural languages". +While Postgres natively runs SQL, it can also run other procedural languages. `plv8` allows you to run JavaScript code - specifically any code that runs on the [V8 JavaScript engine](https://v8.dev). It can be used for database functions, triggers, queries and more. @@ -39,7 +39,7 @@ create extension plv8; drop extension if exists plv8; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension, call `drop extension`. Procedural languages are automatically installed within `pg_catalog`, so you don't need to specify a schema. diff --git a/apps/docs/content/guides/database/full-text-search.mdx b/apps/docs/content/guides/database/full-text-search.mdx index c8511c962ab..fde0c4b5b60 100644 --- a/apps/docs/content/guides/database/full-text-search.mdx +++ b/apps/docs/content/guides/database/full-text-search.mdx @@ -30,6 +30,8 @@ For this guide we'll use the following example data: > +{/* */} + | id | title | author | description | | --- | ----------------------------------- | ---------------------- | ------------------------------------------------------------------ | | 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. | @@ -38,6 +40,8 @@ For this guide we'll use the following example data: | 4 | Green Eggs and Ham | Dr. Seuss | Sam has changing food preferences and eats unusually colored food. | | 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. | +{/* */} + @@ -80,7 +84,7 @@ The functions we'll cover in this guide are: ### `to_tsvector()` [#to-tsvector] -Converts your data into searchable "tokens". `to_tsvector()` stands for "to text search vector". For example: +Converts your data into searchable tokens. `to_tsvector()` stands for "to text search vector." For example: ```sql select to_tsvector('green eggs and ham'); @@ -91,10 +95,10 @@ Collectively these tokens are called a "document" which Postgres can use for com ### `to_tsquery()` [#to-tsquery] -Converts a query string into "tokens" to match. `to_tsquery()` stands for "to text search query". +Converts a query string into tokens to match. `to_tsquery()` stands for "to text search query." This conversion step is important because we will want to "fuzzy match" on keywords. -For example if a user searches for "eggs", and a column has the value "egg", we probably still want to return a match. +For example if a user searches for `eggs`, and a column has the value `egg`, we probably still want to return a match. ### Match: `@@` [#match] @@ -253,11 +257,15 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | | --- | ----------------------------------- | ----------------- | ----------------------------------------------- | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | | 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. | +{/* */} + @@ -338,11 +346,15 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | | --- | --------------------- | ---------------------- | ------------------------------------------- | | 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | +{/* */} + @@ -403,10 +415,14 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | | --- | ------ | ----------------- | -------------------------------- | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | +{/* */} + @@ -467,11 +483,15 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | | --- | --------------------- | ---------------------- | ------------------------------------------- | | 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | +{/* */} + @@ -514,6 +534,8 @@ from books; +{/* */} + | id | fts | | --- | --------------------------------------------------------------------------------------------------------------- | | 1 | 'anim':7 'bigger':6 'littl':10 'poki':9 'puppi':1,11 'slower':3 | @@ -522,6 +544,8 @@ from books; | 4 | 'chang':3 'color':9 'eat':7 'egg':12 'food':4,10 'green':11 'ham':14 'prefer':5 'sam':1 'unus':8 | | 5 | 'big':6 'drama':7 'ensu':8 'fire':15 'fourth':1 'goblet':13 'harri':9 'potter':10 'school':4 'start':5 'year':2 | +{/* */} + @@ -578,10 +602,14 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | fts | | --- | ------ | ----------------- | -------------------------------- | ------------------------------------------------------- | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | 'big':5 'dream':6 'littl':1 'tootl':7 'toy':2 'train':3 | +{/* */} + diff --git a/apps/docs/content/guides/database/managing-timezones.mdx b/apps/docs/content/guides/database/managing-timezones.mdx index 2b3ab247ae6..d74a40bf348 100644 --- a/apps/docs/content/guides/database/managing-timezones.mdx +++ b/apps/docs/content/guides/database/managing-timezones.mdx @@ -6,7 +6,7 @@ description: 'How to change your database timezone.' --- Every Supabase database is set to UTC timezone by default. We strongly recommend keeping it this way, even if your users are in a different location. -This is because it makes it much easier to calculate differences between timezones if you adopt the mental model that "everything in my database is in UTC time". +This is because it makes it much easier to calculate differences between timezones if you adopt the mental model that "everything in my database is in UTC time." ### Change timezone diff --git a/apps/docs/content/guides/database/postgres/cascade-deletes.mdx b/apps/docs/content/guides/database/postgres/cascade-deletes.mdx index 8f3b223a120..cad764f94dd 100644 --- a/apps/docs/content/guides/database/postgres/cascade-deletes.mdx +++ b/apps/docs/content/guides/database/postgres/cascade-deletes.mdx @@ -6,10 +6,10 @@ footerHelpType: 'postgres' There are 5 options for foreign key constraint deletes: -1. **CASCADE:** When a row is deleted from the parent table, all related rows in the child table(s) are deleted as well. -2. **RESTRICT:** When a row is deleted from the parent table, the delete operation is aborted if there are any related rows in the child table(s). -3. **SET NULL:** When a row is deleted from the parent table, the values of the foreign key columns in the child table(s) are set to NULL. -4. **SET DEFAULT:** When a row is deleted from the parent table, the values of the foreign key columns in the child table(s) are set to their default values. +1. **CASCADE:** When a row is deleted from the parent table, all related rows in the child tables are deleted as well. +2. **RESTRICT:** When a row is deleted from the parent table, the delete operation is aborted if there are any related rows in the child tables. +3. **SET NULL:** When a row is deleted from the parent table, the values of the foreign key columns in the child tables are set to NULL. +4. **SET DEFAULT:** When a row is deleted from the parent table, the values of the foreign key columns in the child tables are set to their default values. 5. **NO ACTION:** This option is similar to RESTRICT, but it also has the option to be “deferred” to the end of a transaction. This means that other cascading deletes can run first, and then this delete constraint will only throw an error if there is referenced data remaining _at the end of the transaction_. These options can be specified when defining a foreign key constraint using the "ON DELETE" clause. For example, the following SQL statement creates a foreign key constraint with the `CASCADE` option: @@ -20,7 +20,7 @@ add constraint fk_parent foreign key (parent_id) references parent_table (id) on delete cascade; ``` -This means that when a row is deleted from the "parent_table", all related rows in the "child_table" will be deleted as well. +This means that when a row is deleted from the `parent_table`, all related rows in the `child_table` will be deleted as well. ## `RESTRICT` vs `NO ACTION` @@ -28,11 +28,11 @@ The difference between `NO ACTION` and `RESTRICT` is subtle and can be a bit con Both `NO ACTION` and `RESTRICT` are used to prevent deletion of a row in a parent table if there are related rows in a child table. However, there is a subtle difference in how they behave. -When a foreign key constraint is defined with the option `RESTRICT`, it means that if a row in the parent table is deleted, the database will immediately raise an error and prevent the deletion of the row in the parent table. The database will not delete, update or set to NULL any rows in the referenced table(s). +When a foreign key constraint is defined with the option `RESTRICT`, it means that if a row in the parent table is deleted, the database will immediately raise an error and prevent the deletion of the row in the parent table. The database will not delete, update or set to NULL any rows in the referenced tables. When a foreign key constraint is defined with the option `NO ACTION`, it means that if a row in the parent table is deleted, the database will also raise an error and prevent the deletion of the row in the parent table. However unlike `RESTRICT`, `NO ACTION` has the option defer the check using `INITIALLY DEFERRED`. This will only raise the above error _if_ the referenced rows still exist at the end of the transaction. -The difference from `RESTRICT` is that a constraint marked as `NO ACTION INITIALLY DEFERRED` is deferred until the end of the transaction, rather than running immediately. If, for example there is another foreign key constraint between the same tables marked as `CASCADE`, the cascade will occur first and delete the referenced rows, and no error will be thrown by the deferred constraint. Otherwise if there are still rows referencing the parent row by the end of the transaction, an error will be raised just like before. Just like `RESTRICT`, the database will not delete, update or set to NULL any rows in the referenced table(s). +The difference from `RESTRICT` is that a constraint marked as `NO ACTION INITIALLY DEFERRED` is deferred until the end of the transaction, rather than running immediately. If, for example there is another foreign key constraint between the same tables marked as `CASCADE`, the cascade will occur first and delete the referenced rows, and no error will be thrown by the deferred constraint. Otherwise if there are still rows referencing the parent row by the end of the transaction, an error will be raised just like before. Just like `RESTRICT`, the database will not delete, update or set to NULL any rows in the referenced tables. In practice, you can use either `NO ACTION` or `RESTRICT` depending on your needs. `NO ACTION` is the default behavior if you do not specify anything. If you prefer to defer the check until the end of the transaction, use `NO ACTION INITIALLY DEFERRED`. @@ -48,10 +48,10 @@ Let's further illustrate the difference with an example. We'll use the following `parent` -| id | name | parent_id | -| --- | ------- | --------- | -| 1 | Charles | 1 | -| 2 | Diana | 1 | +| id | name | `parent_id` | +| --- | ------- | ----------- | +| 1 | Charles | 1 | +| 2 | Diana | 1 | `child` diff --git a/apps/docs/content/guides/database/postgres/configuration.mdx b/apps/docs/content/guides/database/postgres/configuration.mdx index f9177a0a251..087176ba1d2 100644 --- a/apps/docs/content/guides/database/postgres/configuration.mdx +++ b/apps/docs/content/guides/database/postgres/configuration.mdx @@ -36,7 +36,7 @@ This data can further be used in conjunction with the [`explain`](https://www.po ## Managing timezones Every Supabase database is set to UTC timezone by default. We strongly recommend keeping it this way, even if your users are in a different location. -This is because it makes it much easier to calculate differences between timezones if you adopt the mental model that "everything in my database is in UTC time". +This is because it makes it much easier to calculate differences between timezones if you adopt the mental model that "everything in my database is in UTC time." ### Change timezone diff --git a/apps/docs/content/guides/database/postgres/roles.mdx b/apps/docs/content/guides/database/postgres/roles.mdx index 257d777cd2d..bacad005667 100644 --- a/apps/docs/content/guides/database/postgres/roles.mdx +++ b/apps/docs/content/guides/database/postgres/roles.mdx @@ -38,11 +38,11 @@ Your Postgres database is the core of your Supabase project, so it's important t ### Special symbols in passwords -If you use special symbols in your postgres password, you must remember to [percent-encode](https://en.wikipedia.org/wiki/Percent-encoding) your password later if using the postgres connection string e.g. `postgresql://postgres.projectref:p%3Dword@aws-0-us-east-1.pooler.supabase.com:6543/postgres` +If you use special symbols in your postgres password, you must remember to [percent-encode](https://en.wikipedia.org/wiki/Percent-encoding) your password later if using the postgres connection string, for example, `postgresql://postgres.projectref:p%3Dword@aws-0-us-east-1.pooler.supabase.com:6543/postgres` ### Changing your project password -When you created your project you were also asked to enter a password. This is actually the password for the `postgres` role in your database. You can update this from the Dashboard under the [database settings](https://supabase.com/dashboard/project/_/settings/database) page. You should _never_ give this to 3rd-party service unless you absolutely trust them. Instead, we recommend that you create a new user for every service that you want to give access too. This will also help you with debugging - you can see every query that each role is executing in your database within `pg_stat_statements`. +When you created your project you were also asked to enter a password. This is actually the password for the `postgres` role in your database. You can update this from the Dashboard under the [database settings](https://supabase.com/dashboard/project/_/settings/database) page. You should _never_ give this to third-party service unless you absolutely trust them. Instead, we recommend that you create a new user for every service that you want to give access too. This will also help you with debugging - you can see every query that each role is executing in your database within `pg_stat_statements`. ## Granting permissions @@ -86,7 +86,7 @@ The default Postgres role. This has admin privileges. ### `anon` -For "anonymous access". This is the role which the API (PostgREST) will use when a user _is not_ logged in. +For "anonymous access." This is the role which the API (PostgREST) will use when a user _is not_ logged in. ### `authenticator` @@ -95,7 +95,7 @@ A special role for the API (PostgREST). It has very limited access, and is used ### `authenticated` -For "authenticated access". This is the role which the API (PostgREST) will use when a user _is_ logged in. +For "authenticated access." This is the role which the API (PostgREST) will use when a user _is_ logged in. ### `service_role` diff --git a/apps/docs/content/guides/database/postgres/row-level-security.mdx b/apps/docs/content/guides/database/postgres/row-level-security.mdx index 286391079de..6d7450c3407 100644 --- a/apps/docs/content/guides/database/postgres/row-level-security.mdx +++ b/apps/docs/content/guides/database/postgres/row-level-security.mdx @@ -11,7 +11,7 @@ When you need granular authorization rules, nothing beats Postgres's [Row Level RLS is incredibly powerful and flexible, allowing you to write complex SQL rules that fit your unique business needs. RLS can be [combined with Supabase Auth](/docs/guides/auth/row-level-security) for end-to-end user security from the browser to the database. -RLS is a Postgres primitive and can provide "[defense in depth]()" to protect your data from malicious actors even when accessed through 3rd party tooling. +RLS is a Postgres primitive and can provide "[defense in depth]()" to protect your data from malicious actors even when accessed through third-party tooling. ## Policies @@ -219,7 +219,7 @@ to authenticated using ( (select auth.uid()) = user_id ); ``` -This method works well for JWT functions like `auth.uid()` and `auth.jwt()` as well as `security definer` Functions. Wrapping the function causes an initPlan to be run by the Postgres optimizer, which allows it to "cache" the results per-statement, rather than calling the function on each row. +This method works well for JWT functions like `auth.uid()` and `auth.jwt()` as well as `security definer` Functions. Wrapping the function causes an `initPlan` to be run by the Postgres optimizer, which allows it to "cache" the results per-statement, rather than calling the function on each row. @@ -239,7 +239,7 @@ You can only use this technique if the results of the query or function do not c ### Add filters to every query -Policies are "implicit where clauses", so it's common to run `select` statements without any filters. This is a bad pattern for performance. Instead of doing this (JS client example): +Policies are "implicit where clauses," so it's common to run `select` statements without any filters. This is a bad pattern for performance. Instead of doing this (JS client example): {/* prettier-ignore */} ```js diff --git a/apps/docs/content/guides/database/postgres/triggers.mdx b/apps/docs/content/guides/database/postgres/triggers.mdx index 21db2217f59..e405dfff549 100644 --- a/apps/docs/content/guides/database/postgres/triggers.mdx +++ b/apps/docs/content/guides/database/postgres/triggers.mdx @@ -99,7 +99,7 @@ execute function after_delete_function(); There are two options available for executing triggers: - `for each row`: specifies that the trigger function should be executed once for each affected row. -- `for each statement`: the trigger is executed once for the entire operation (eg, once on insert). This can be more efficient than `for each row` when dealing with multiple rows affected by a single SQL statement, as they allow you to perform calculations or updates on groups of rows at once. +- `for each statement`: the trigger is executed once for the entire operation (for example, once on insert). This can be more efficient than `for each row` when dealing with multiple rows affected by a single SQL statement, as they allow you to perform calculations or updates on groups of rows at once. ## Dropping a trigger diff --git a/apps/docs/content/guides/database/query-optimization.mdx b/apps/docs/content/guides/database/query-optimization.mdx index 7602ae4603e..bf3c2f169b3 100644 --- a/apps/docs/content/guides/database/query-optimization.mdx +++ b/apps/docs/content/guides/database/query-optimization.mdx @@ -14,7 +14,7 @@ This guide is intended to: This is not a comprehensive resource, but rather a helpful starting point for your optimization journey. -If you're new to query optimization, you may be interested in [index_advisor](/docs/guides/database/extensions/index_advisor), our tool for automatically detecting indexes that improve performance on a given query. +If you're new to query optimization, you may be interested in [`index_advisor`](/docs/guides/database/extensions/index_advisor), our tool for automatically detecting indexes that improve performance on a given query. ## Example query @@ -66,7 +66,7 @@ create index idx_orders_customer_id on orders (customer_id); Sorting can also be optimized by indexing: -- An index on `b.date_of_purchase` wcan improve the sorting process, and is particularly beneficial when a subset of rows is being returned with a `limit` clause. +- An index on `b.date_of_purchase` can improve the sorting process, and is particularly beneficial when a subset of rows is being returned with a `limit` clause. ```sql create index idx_orders_date_of_purchase on orders (date_of_purchase); diff --git a/apps/docs/content/guides/database/vault.mdx b/apps/docs/content/guides/database/vault.mdx index a16f814633d..12aa4cc193b 100644 --- a/apps/docs/content/guides/database/vault.mdx +++ b/apps/docs/content/guides/database/vault.mdx @@ -79,7 +79,7 @@ updated_at | 2022-12-14 02:34:23.85159+00 -Alternatively, you can create a secret by `insert`ing data into the `vault.secret` table: +Alternatively, you can create a secret by inserting data into the `vault.secret` table: {/* prettier-ignore */} ```sql @@ -206,11 +206,11 @@ updated_at | 2022-12-14 02:51:13.938396+00 >
    -As we mentioned, the Vault uses pgsodium's Transparent Column Encryption (TCE) to store secrets in an authenticated encrypted form. There are some details around that you may be curious about, what does authenticated mean, and where are encryption keys store? This section explains those details. +As we mentioned, the Vault uses `pgsodium`'s Transparent Column Encryption (TCE) to store secrets in an authenticated encrypted form. There are some details around that you may be curious about, what does authenticated mean, and where are encryption keys store? This section explains those details. ### Authenticated encryption with associated data -The first important feature of TCE is that it uses an [Authenticated Encryption with Associated Data]() encryption algorithm (based on libsodium). +The first important feature of TCE is that it uses an [Authenticated Encryption with Associated Data]() encryption algorithm (based on `libsodium`). ### Encryption key location @@ -218,7 +218,7 @@ The first important feature of TCE is that it uses an [Authenticated Encryption **Associated Data** means that you can include any other columns from the same row as part of the signature computation. This doesn't encrypt those other columns - rather it ensures that your encrypted value is only associated with columns from that row. If an attacker were to copy an encrypted value from another row to the current one, the signature would be rejected (assuming you used a unique column in the associated data). -Another important feature of pgsodium is that the encryption keys are never stored in the database alongside the encrypted data. Instead, only a **Key ID** is stored, which is a reference to the key that is only accessible outside of SQL. Even if an attacker can capture a dump of your entire database, they will see only encrypted data and key IDs, _never the raw key itself_. +Another important feature of `pgsodium` is that the encryption keys are never stored in the database alongside the encrypted data. Instead, only a **Key ID** is stored, which is a reference to the key that is only accessible outside of SQL. Even if an attacker can capture a dump of your entire database, they will see only encrypted data and key IDs, _never the raw key itself_. This is an important safety precaution - there is little value in storing the encryption key in the database itself as this would be like locking your front door but leaving the key in the lock! Storing the key outside the database fixes this issue. diff --git a/apps/docs/content/guides/functions/dart-edge.mdx b/apps/docs/content/guides/functions/dart-edge.mdx index 98b45295dfe..7c50737ddd5 100644 --- a/apps/docs/content/guides/functions/dart-edge.mdx +++ b/apps/docs/content/guides/functions/dart-edge.mdx @@ -13,7 +13,7 @@ Dart Edge is an experimental project - it's probably not ready for production us -## Pre requirements +## Prerequisites Make sure you have [the edge CLI](https://docs.dartedge.dev/#getting-started) installed in addition to [the Supabase CLI](https://supabase.com/docs/guides/cli#installation). @@ -74,7 +74,7 @@ Now let’s try to interact with our Supabase database. We will start by install ### Add dependencies -Add [supabase](https://pub.dev/packages/supabase) to interact with Supabase service. +Add [`supabase`](https://pub.dev/packages/supabase) to interact with Supabase service. ```bash dart pub add supabase @@ -125,14 +125,13 @@ supabase: project_path: './supabase' ``` -Also, currently Dart Edge doesn't work with the latest versions of Flutter. If you do have the latest version of Flutter on your machine, you can use [FVM](https://fvm.app/) to use an older version of Flutter for your Dart Edge project. +Also, currently Dart Edge doesn't work with the latest versions of Flutter. If you do have the latest version of Flutter on your machine, you can use [Flutter Version Management (FVM)](https://fvm.app/) to use an older version of Flutter for your Dart Edge project. ```bash fvm use 3.7.12 -f ``` -You can read more about how to configure FVM (Flutter -Version Management) for your project in the [FVM documentation](https://fvm.app/documentation/getting-started). +You can read more about how to configure FVM for your project in the [FVM documentation](https://fvm.app/documentation/getting-started). Run the following command to compile your Dart code. This command will start a watcher that will recompile anytime you make changes to your code. diff --git a/apps/docs/content/guides/getting-started/architecture.mdx b/apps/docs/content/guides/getting-started/architecture.mdx index 9e3bd8f92f0..943f13b702d 100644 --- a/apps/docs/content/guides/getting-started/architecture.mdx +++ b/apps/docs/content/guides/getting-started/architecture.mdx @@ -29,7 +29,7 @@ Each Supabase project consists of several tools: ### PostgreSQL (database) -PostgreSQL is the core of Supabase. We do not abstract the PostgreSQL database — you can access it and use it with full privileges. We simply provide tools which makes PostgreSQL as easy to use as Firebase. +PostgreSQL is the core of Supabase. We do not abstract the PostgreSQL database—you can access it and use it with full privileges. We simply provide tools which makes PostgreSQL as easy to use as Firebase. - Official Docs: [postgresql.org/docs](https://www.postgresql.org/docs/current/index.html) - Source code: [github.com/postgres/postgres](https://github.com/postgres/postgres) (mirror) @@ -57,7 +57,7 @@ A JWT-based API for managing users and issuing access tokens. This integrates wi ### PostgREST (API) A standalone web server that turns your PostgreSQL database directly into a RESTful API. -We use this with our [pg_graphql](https://github.com/supabase/pg_graphql) extension to provide a GraphQL API. +We use this with our [`pg_graphql`](https://github.com/supabase/pg_graphql) extension to provide a GraphQL API. - Official Docs: [postgrest.org](https://postgrest.org/) - Source code: [github.com/PostgREST/postgrest](https://github.com/PostgREST/postgrest) @@ -86,8 +86,8 @@ An S3-compatible object storage service that stores metadata in Postgres. A modern runtime for JavaScript and TypeScript. -- Official Docs: [deno.land](https://deno.land/) -- Source code: [github.com/denoland/deno](https://github.com/denoland/deno) +- Official Docs: [Deno documentation](https://deno.land/) +- Source code: [Deno source code](https://github.com/denoland/deno) - License: [MIT](https://github.com/denoland/deno/blob/main/LICENSE.md) - Language: TypeScript / Rust @@ -104,14 +104,14 @@ A RESTful API for managing your Postgres. Fetch tables, add roles, and run queri A cloud-native, multi-tenant Postgres connection pooler. -- Official Docs: [Supavisor Github Pages](https://supabase.github.io/supavisor/) -- Source code: [supabase/supavisor](https://github.com/supabase/supavisor) +- Official Docs: [Supavisor GitHub Pages](https://supabase.github.io/supavisor/) +- Source code: [`supabase/supavisor`](https://github.com/supabase/supavisor) - License: [Apache 2.0](https://github.com/supabase/supavisor/blob/main/LICENSE) - Language: Elixir ### Kong (API gateway) -A cloud-native API gateway, built on top of Nginx. +A cloud-native API gateway, built on top of NGINX. - Official Docs: [docs.konghq.com](https://docs.konghq.com/) - Source code: [github.com/kong/kong](https://github.com/kong/kong) @@ -144,7 +144,7 @@ Less, but better. ### Everything is portable To avoid lock-in, we make it easy to migrate in and out. Our cloud offering is compatible with our self-hosted product. -We use existing standards to increase portability (like pg_dump and CSV files). If a new standard emerges which competes with a "Supabase" approach, we will deprecate the approach in favor of the standard. +We use existing standards to increase portability (like `pg_dump` and CSV files). If a new standard emerges which competes with a "Supabase" approach, we will deprecate the approach in favor of the standard. This forces us compete on experience. We aim to be the best Postgres hosting service. ### Play the long game diff --git a/apps/docs/content/guides/getting-started/features.mdx b/apps/docs/content/guides/getting-started/features.mdx index d9956b15c21..e7127c000ea 100644 --- a/apps/docs/content/guides/getting-started/features.mdx +++ b/apps/docs/content/guides/getting-started/features.mdx @@ -68,7 +68,7 @@ Provide phone logins using a third-party SMS provider. [Docs](/docs/guides/auth/ Control the data each user can access with Postgres Policies. [Docs](/docs/guides/auth/row-level-security). -### Serverside Auth helpers +### Server-side Auth helpers Helpers for implementing user authentication in popular frameworks like [Next.js](/docs/guides/auth/auth-helpers/nextjs) and [SvelteKit](/docs/guides/auth/auth-helpers/sveltekit) @@ -82,7 +82,7 @@ Build login and registration pages with custom themes. [Docs](/docs/guides/auth/ ### Auto-generated REST API -RESTful APIs are autogenerated from your database, without a single line of code. [Docs](/docs/guides/api#rest-api-overview). +RESTful APIs are auto-generated from your database, without a single line of code. [Docs](/docs/guides/api#rest-api-overview). ### Auto-generated GraphQL API diff --git a/apps/docs/content/guides/getting-started/tutorials/with-angular.mdx b/apps/docs/content/guides/getting-started/tutorials/with-angular.mdx index 62d9f2c0644..4a308fe33fc 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-angular.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-angular.mdx @@ -492,7 +492,7 @@ export class AvatarComponent { ### Add the new widget -And then we can add the widget on top of the **AccountComponent** html template: +And then we can add the widget on top of the **AccountComponent** HTML template: ```html src/app/account.component.html
    diff --git a/apps/docs/content/guides/getting-started/tutorials/with-expo-react-native.mdx b/apps/docs/content/guides/getting-started/tutorials/with-expo-react-native.mdx index 0bacd902411..43873bc3d77 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-expo-react-native.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-expo-react-native.mdx @@ -460,6 +460,8 @@ expo install expo-image-picker Let's create an avatar for the user so that they can upload a profile photo. We can start by creating a new component: +{/* */} + ```tsx components/Avatar.tsx import { useState, useEffect } from 'react' import { supabase } from '../lib/supabase' @@ -593,6 +595,8 @@ const styles = StyleSheet.create({ }) ``` +{/* */} + ### Add the new widget And then we can add the widget to the Account page: diff --git a/apps/docs/content/guides/getting-started/tutorials/with-ionic-angular.mdx b/apps/docs/content/guides/getting-started/tutorials/with-ionic-angular.mdx index e2a685dbbcd..db01f52844a 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-ionic-angular.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-ionic-angular.mdx @@ -138,7 +138,7 @@ export class SupabaseService { Let's set up a route to manage logins and signups. We'll use Magic Links so users can sign in with their email without using passwords. Create a **LoginPage** with the `ionic g page login` Ionic CLI command. -> This guide will show the template inline, but the example app will have templateUrls +> This guide will show the template inline, but the example app will have `templateUrl`s ```ts src/app/login/login.page.ts import { Component, OnInit } from '@angular/core' diff --git a/apps/docs/content/guides/getting-started/tutorials/with-kotlin.mdx b/apps/docs/content/guides/getting-started/tutorials/with-kotlin.mdx index 167a5b595b5..65bd550fc5e 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-kotlin.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-kotlin.mdx @@ -33,7 +33,7 @@ Open Android Studio > New Project > Base Activity (Jetpack Compose). Create or edit the `local.properties` file at the root (same level as `build.gradle`) of your project. -> **Note**: Do not commit this file to your source control, e.g. by adding it to your `.gitignore` file! +> **Note**: Do not commit this file to your source control, for example, by adding it to your `.gitignore` file! ```kotlin SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY @@ -75,7 +75,7 @@ val apiKey = BuildConfig.SUPABASE_ANON_KEY ![Gradle dependencies](/docs/img/guides/kotlin/gradle-dependencies.png) -In the `build.gradle` (app) file, add these dependencies then press "Sync now". Replace the dependency version placeholders `$supabase_version` and `$ktor_version` with their respective latest versions. +In the `build.gradle` (app) file, add these dependencies then press "Sync now." Replace the dependency version placeholders `$supabase_version` and `$ktor_version` with their respective latest versions. ```kotlin implementation "io.github.jan-tennert.supabase:postgrest-kt:$supabase_version" diff --git a/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx b/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx index f98fe348e90..58300bd88f3 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx @@ -17,12 +17,12 @@ If you get stuck while working through this guide, refer to the [full example on A Redwood application is split into two parts: a frontend and a backend. This is represented as two node projects within a single monorepo. -The frontend project is called **`web`** and the backend project is called **`api`**. For clarity, we will refer to these in prose as **"sides"**, i.e. the "web side" and the "api side". +The frontend project is called **`web`** and the backend project is called **`api`**. For clarity, we will refer to these in prose as **"sides,"** that is, the `web side` and the `api side`. They are separate projects because code on the `web side` will end up running in the user's browser while code on the `api side` will run on a server somewhere. -Important: When this guide refers to "API", that means the Supabase API and when it refers to "api side", that means the RedwoodJS `api side`. +Important: When this guide refers to "API," that means the Supabase API and when it refers to `api side`, that means the RedwoodJS `api side`. @@ -51,7 +51,7 @@ RedwoodJS requires Node.js `>= 14.x <= 16.x` and Yarn `>= 1.15`. -Make sure you have installed yarn since RedwoodJS relies on it to [manage its packages in workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) for its `web` and `api` "sides". +Make sure you have installed yarn since RedwoodJS relies on it to [manage its packages in workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) for its `web` and `api` "sides." ### Initialize a RedwoodJS app @@ -428,7 +428,7 @@ export default Account ``` You'll see the use of `useAuth()` several times. Redwood's `useAuth` hook provides convenient ways to access -logIn, logOut, currentUser, and access the `supabase` authenticate client. We'll use it to get an instance +`logIn`, `logOut`, `currentUser`, and access the `supabase` authenticate client. We'll use it to get an instance of the supabase client to interact with your API. ### Update home page diff --git a/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx b/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx index e3f09494ada..502e4d6cd3a 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx @@ -90,7 +90,7 @@ VITE_SUPABASE_URL=YOUR_SUPABASE_URL VITE_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY ``` -The `supabaseClient` will be used in fetch calls to Supabase endpoints from our app. As we'll see below, the client is instrumental in implementing authentication using refine's auth provider methods and CRUD actions with appropriate data provider methods. +The `supabaseClient` will be used in fetch calls to Supabase endpoints from our app. As we'll see below, the client is instrumental in implementing authentication using Refine's auth provider methods and CRUD actions with appropriate data provider methods. One optional step is to update the CSS file `src/App.css` to make the app look nice. You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/refine-user-management/src/App.css). @@ -404,7 +404,7 @@ Notice above that, we are using three refine hooks, namely the [`useGetIdentity( `useForm()`, in contrast, is a data hook that exposes a series of useful objects that serve the edit form. For example, we are grabbing the `onFinish` function to submit the form with the `handleSubmit` event handler. We are also using `formLoading` property to present state changes of the submitted form. -The `useForm()` hook is a higher-level hook built on top of refine's `useForm()` core hook. It fully supports form state management, field validation and submission using React Hook Form. Behind the scenes, it invokes the `dataProvider.getOne` method to get the user profile data from our Supabase `/profiles` endpoint and also invokes `dataProvider.update` method when `onFinish()` is called. +The `useForm()` hook is a higher-level hook built on top of Refine's `useForm()` core hook. It fully supports form state management, field validation and submission using React Hook Form. Behind the scenes, it invokes the `dataProvider.getOne` method to get the user profile data from our Supabase `/profiles` endpoint and also invokes `dataProvider.update` method when `onFinish()` is called. ### Launch! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx b/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx index 10a8982af85..7610c78ef0e 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx @@ -228,7 +228,7 @@ Add the `Auth` component to your home page
    ``` -Create a `src/routes/+page.server.ts` file that will return our website url to be used in our `redirectTo` above. +Create a `src/routes/+page.server.ts` file that will return our website URL to be used in our `redirectTo` above. ```ts // src/routes/+page.server.ts diff --git a/apps/docs/content/guides/realtime.mdx b/apps/docs/content/guides/realtime.mdx index fa76be5970d..dee6cf6766f 100644 --- a/apps/docs/content/guides/realtime.mdx +++ b/apps/docs/content/guides/realtime.mdx @@ -120,7 +120,13 @@ called `supabase_realtime`, and by managing this publication you can control whi ## Examples
    - {examples.map((x) => ( + {[ + { + name: 'Multiplayer.dev', + description: 'Mouse movements and chat messages.', + href: 'https://multiplayer.dev', + }, + ].map((x) => (
    {x.description} @@ -129,14 +135,6 @@ called `supabase_realtime`, and by managing this publication you can control whi ))}
    -export const examples = [ - { - name: 'Multiplayer.dev', - description: 'Mouse movements and chat messages.', - href: 'https://multiplayer.dev', - }, -] - ## Resources Find the source code and documentation in the Supabase GitHub repository. diff --git a/apps/docs/content/guides/resources.mdx b/apps/docs/content/guides/resources.mdx index d455bae4919..d69a46f7a1e 100644 --- a/apps/docs/content/guides/resources.mdx +++ b/apps/docs/content/guides/resources.mdx @@ -4,6 +4,8 @@ description: 'Resources for getting started building with Supabase.' hideToc: true --- +{/* */} +
    diff --git a/apps/docs/content/guides/self-hosting/docker.mdx b/apps/docs/content/guides/self-hosting/docker.mdx index 24d5793860d..4fee2c0d8ba 100644 --- a/apps/docs/content/guides/self-hosting/docker.mdx +++ b/apps/docs/content/guides/self-hosting/docker.mdx @@ -57,7 +57,7 @@ You should change these credentials as soon as possible using the [instructions] ### Accessing the APIs -Each of the APIs are available through the the same API gateway: +Each of the APIs are available through the same API gateway: - REST: `http://:8000/rest/v1/` - Auth: `http://:8000/auth/v1/` @@ -243,7 +243,7 @@ Each system can be [configured](../self-hosting#configuration) independently. So #### Configuring an email server -You will need to use a production-ready SMTP server for sending emails. You can configure the SMTP server by updating the the following environment variables: +You will need to use a production-ready SMTP server for sending emails. You can configure the SMTP server by updating the following environment variables: ```sh .env SMTP_ADMIN_EMAIL= @@ -318,8 +318,6 @@ docker rm supabase-analytics --- -{/* Finish with a video. This also appears in the Sidebar via the "tocVideo" metadata */} - ## Demo A minimal setup working on Ubuntu, hosted on Digital Ocean. diff --git a/vale/styles/Custom/Acronyms.yml b/vale/styles/Custom/Acronyms.yml index 2fdabe6af4c..025136da501 100644 --- a/vale/styles/Custom/Acronyms.yml +++ b/vale/styles/Custom/Acronyms.yml @@ -1,5 +1,5 @@ extends: conditional -message: "Spell out '%s', if it's unfamiliar to the audience." +message: "The first instance of '%s' should be spelled out, followed by the acronym in brackets. For example: 'Data Definition Language (DDL)'" link: 'https://developers.google.com/style/abbreviations' level: suggestion ignorecase: false @@ -9,6 +9,7 @@ second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)' # ... with the exception of these: exceptions: - API + - ARM - ASP - CLI - CPU @@ -20,6 +21,7 @@ exceptions: - FAQ - GCC - GDB + - GDPR - GET - GPT - GPU @@ -61,6 +63,7 @@ exceptions: - URI - URL - USB + - USD - UTF - XML - XSS diff --git a/vale/styles/Custom/Capitalize.yml b/vale/styles/Custom/Capitalize.yml new file mode 100644 index 00000000000..5413e132ab8 --- /dev/null +++ b/vale/styles/Custom/Capitalize.yml @@ -0,0 +1,11 @@ +extends: substitution +message: "Captalize this to make it a proper noun: '%s' -> '%s'" +link: 'https://developers.google.com/style/word-list' +level: warning +ignorecase: false +action: + name: replace +swap: + auth hooks?: Auth Hooks? + edge functions?: Edge Functions? + 'role[- ]?based access control: Role-Based Access Control diff --git a/vale/styles/Custom/Exclamation.yml b/vale/styles/Custom/Exclamation.yml deleted file mode 100644 index b4e4a1f7e9a..00000000000 --- a/vale/styles/Custom/Exclamation.yml +++ /dev/null @@ -1,12 +0,0 @@ -extends: existence -message: "Don't use exclamation points in text." -link: "https://developers.google.com/style/exclamation-points" -nonword: true -level: error -action: - name: edit - params: - - trim_right - - "!" -tokens: - - '\w+!(?:\s|$)' diff --git a/vale/styles/Custom/Filler.yml b/vale/styles/Custom/Filler.yml new file mode 100644 index 00000000000..6535e560b7a --- /dev/null +++ b/vale/styles/Custom/Filler.yml @@ -0,0 +1,12 @@ +extends: existence +message: "Don't use '%s'. The sentence is more concise and/or the tone is more neutral without it." +ignorecase: true +level: error +tokens: + - easily + - easy + - just + - please + - simple + - simply + - that's it diff --git a/vale/styles/Custom/Parens.yml b/vale/styles/Custom/Parens.yml index 3b8711d0c88..74a7d65bded 100644 --- a/vale/styles/Custom/Parens.yml +++ b/vale/styles/Custom/Parens.yml @@ -4,4 +4,5 @@ link: 'https://developers.google.com/style/parentheses' nonword: true level: suggestion tokens: - - '\(.+\)' + # Ignore acronym definitions + - '\([^A-Z]+\)' diff --git a/vale/styles/Custom/Will.yml b/vale/styles/Custom/Will.yml deleted file mode 100644 index 128a918362b..00000000000 --- a/vale/styles/Custom/Will.yml +++ /dev/null @@ -1,7 +0,0 @@ -extends: existence -message: "Avoid using '%s'." -link: 'https://developers.google.com/style/tense' -ignorecase: true -level: warning -tokens: - - will diff --git a/vale/styles/Custom/WordList.yml b/vale/styles/Custom/WordList.yml index bb53e8f7471..34d5459eb40 100644 --- a/vale/styles/Custom/WordList.yml +++ b/vale/styles/Custom/WordList.yml @@ -1,40 +1,42 @@ extends: substitution message: "Use '%s' instead of '%s'." -link: "https://developers.google.com/style/word-list" +link: 'https://developers.google.com/style/word-list' level: warning ignorecase: false action: name: replace swap: - "(?:API Console|dev|developer) key": API key - "(?:cell ?phone|smart ?phone)": phone|mobile phone - "(?:dev|developer|APIs) console": API console - "(?:e-mail|Email|E-mail)": email - "(?:file ?path|path ?name)": path - "(?:kill|terminate|abort)": stop|exit|cancel|end - "(?:OAuth ?2|Oauth)": OAuth 2.0 - "(?:ok|Okay)": OK|okay - "(?:WiFi|wifi)": Wi-Fi - "(?i)postgresql": Postgres - "(?i)repository": repo + '(?:API Console|dev|developer) key': API key + '(?:cell ?phone|smart ?phone)': phone|mobile phone + '(?:dev|developer|APIs) console': API console + '(?:e-mail|Email|E-mail)': email + '(?:file ?path|path ?name)': path + '(?:kill|terminate|abort)': stop|exit|cancel|end + '(?:Nginx|nginx)': NGINX + '(?:OAuth ?2|Oauth)': OAuth 2.0 + '(?:ok|Okay)': OK|okay + '(?:WiFi|wifi)': Wi-Fi + '(?i)postgresql': Postgres + '(?i)repository': repo '[\.]+apk': APK '3\-D': 3D 'Google (?:I\-O|IO)': Google I/O - "tap (?:&|and) hold": touch & hold - "un(?:check|select)": clear + 'Next(?:js)?': Next.js (if referring to the framework) + 'tap (?:&|and) hold': touch & hold + 'un(?:check|select)': clear + 'utili[sz](?:e[ds]|ing)': use, used, uses, etc. above: preceding account name: username action bar: app bar - admin: administrator Ajax: AJAX a\.k\.a|aka: or|also known as Android device: Android-powered device android: Android API explorer: APIs Explorer - application: app approx\.: approximately authN: authentication authZ: authorization + autogenerated: auto-generated autoupdate: automatically update cellular data: mobile data cellular network: mobile network @@ -54,10 +56,12 @@ swap: file name: filename firewalls: firewall rules functionality: capability|feature + Github: GitHub Google account: Google Account Google accounts: Google Accounts Googling: search with Google grayed-out: unavailable + head over to: go to|see HTTPs: HTTPS in order to: to ingest: import|load @@ -68,9 +72,14 @@ swap: open-source: open source overview screen: recents screen regex: regular expression + refer to: see + serverside: server-side SHA1: SHA-1|HAS-SHA1 sign into: sign in to + sign-ins?: signin(s) (noun) or sign in (verb) sign-?on: single sign-on + sign-outs?: signout(s) (noun) or sign out (verb) + sign-ups?: signup(s) (noun) or sign up (verb) static IP address: static external IP address stylesheet: style sheet synch: sync diff --git a/vale/styles/config/vocabularies/Supabase/accept.txt b/vale/styles/config/vocabularies/Supabase/accept.txt index f02c243b654..331d4806080 100644 --- a/vale/styles/config/vocabularies/Supabase/accept.txt +++ b/vale/styles/config/vocabularies/Supabase/accept.txt @@ -1,18 +1,82 @@ +APIs +[Aa]uth +Berri +[Cc]hatbots? ChatGPT Clippy Colab +[Cc]omposable CPUs? +[Dd]eclarative(ly)? [Dd]eduplicat(e|ion) +[Dd]eeplinks? +[Dd]egit +[Dd]eserializ(e|ed|es|ing) +Deno +[Dd]ev +[Dd]otenv +[Ee]nv +[Ee]nums? +Firestore +Hashicorp +[Gg]eospatial GPUs? +Gradle +GraphQL +Groonga +href +Infisical IVFFlat +JetBrains +Jetpack +JWTs +Lua +Markprompt +[Mm]iddleware +[Nn]amespace(d|s)? +Next.js +Nuxt +OAuth OpenAI +[Pp]ackageable +[Pp]asscodes? +[Pp]asswordless [Pp]erformant +PGAudit +PGroonga pgvector -Postgres +Pinecone +plpgsql +[Pp]olyfill(s|ed)? +[Pp]ooler +[Pp]ostgres +[Pp]rebuild +Prisma +[Rr]ealtime +Refine's +[Rr]eindex(ed|es|ing)? repo +RESTful +[Rr]evalidated? Roboflow [Ss]crollable +[Ss]erializ(e|ed|es|ing) +[Ss]igncryption +[Ss]ignins? +[Ss]ignouts? +[Ss]ignups? SQLAlchemy -Supabase -[Uu]psert - +[Ss]upabase +Supavisor +[Ss]upersets? +Terraform +[Tt]odos? +[Uu]npaus(e|es|ed|ing) +[Uu]psert(s|ed|ing)? +[Uu]pvot(es|ed|ing) +Vercel +Vite +VSCode +Vue +[Ww]eb[Ss]ockets? +Xcode From 136728f6abe5aae7d24d6d1c4022d027b19d640f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Tue, 5 Mar 2024 12:49:58 +0800 Subject: [PATCH 013/163] perf: reorganize a few imports to improve bundle size (#21743) --- .../AIPolicyEditorPanel/RLSCodeEditor.tsx | 2 +- .../Policies/AIPolicyEditorPanel/index.tsx | 1 - .../SQLEditor/SQLEditor.constants.ts | 1526 +---------------- .../interfaces/SQLEditor/SQLEditor.queries.ts | 1517 ++++++++++++++++ .../interfaces/SQLEditor/SQLEditor.types.ts | 2 +- .../interfaces/SQLEditor/SQLEditor.utils.ts | 20 +- .../SQLEditor/SQLTemplates/SQLQuickstarts.tsx | 2 +- .../SQLEditor/SQLTemplates/SQLTemplates.tsx | 2 +- .../data/database/database-query-constants.ts | 570 +----- .../database/database-table-definition.ts | 569 ++++++ apps/studio/lib/helpers.ts | 53 +- apps/studio/lib/password-strength.ts | 46 + apps/studio/lib/uuid.ts | 7 + apps/studio/lib/vercelConfigs.ts | 2 +- packages/common/Providers.tsx | 2 +- 15 files changed, 2161 insertions(+), 2160 deletions(-) create mode 100644 apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts create mode 100644 apps/studio/data/database/database-table-definition.ts create mode 100644 apps/studio/lib/password-strength.ts create mode 100644 apps/studio/lib/uuid.ts diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/RLSCodeEditor.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/RLSCodeEditor.tsx index 6ce0ff4cc0a..39691c5082d 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/RLSCodeEditor.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/RLSCodeEditor.tsx @@ -1,5 +1,5 @@ import Editor, { OnChange, OnMount } from '@monaco-editor/react' -import { editor } from 'monaco-editor' +import type { editor } from 'monaco-editor' import { MutableRefObject, useRef } from 'react' import { cn } from 'ui' diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx index fcb02298024..0465ac80834 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/index.tsx @@ -52,7 +52,6 @@ import RLSCodeEditor from './RLSCodeEditor' import { PolicyTemplates } from './PolicyTemplates' import { subscriptionHasHipaaAddon } from 'components/interfaces/Billing/Subscription/Subscription.utils' import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' -import CardButton from 'components/ui/CardButton' const DiffEditor = dynamic( () => import('@monaco-editor/react').then(({ DiffEditor }) => DiffEditor), diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts b/apps/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts index 95ef97c400e..df5798c3ceb 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.constants.ts @@ -1,1522 +1,4 @@ -import { stripIndent } from 'common-tags' import type { SqlSnippets, UserContent } from 'types' -import type { SQLTemplate } from './SQLEditor.types' - -export const SQL_TEMPLATES: SQLTemplate[] = [ - { - id: 1, - type: 'template', - title: 'Create table', - description: 'Basic table template. Change "table_name" to the name you prefer.', - sql: `create table table_name ( - id bigint generated by default as identity primary key, - inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, - updated_at timestamp with time zone default timezone('utc'::text, now()) not null, - data jsonb, - name text -);`, - }, - { - id: 2, - type: 'template', - title: 'Add view', - description: - 'Template to add a view. Make sure to change the table and column names to ones that already exist.', - sql: `CREATE VIEW countries_view AS -SELECT id, continent -FROM countries;`, - }, - { - id: 3, - type: 'template', - title: 'Add column', - description: 'Template to add a column. Make sure to change the name and type.', - sql: `alter table table_name -add column new_column_name data_type;`, - }, - { - id: 4, - type: 'template', - title: 'Add comments', - description: 'Templates to add a comment to either a table or a column.', - sql: `comment on table table_name is 'Table description'; -comment on column table_name.column_name is 'Column description';`, - }, - { - id: 5, - type: 'template', - title: 'Show extensions', - description: 'Get a list of extensions in your database and status.', - sql: `select - name, comment, default_version, installed_version -from - pg_available_extensions -order by - name asc;`, - }, - { - id: 6, - type: 'template', - title: 'Show version', - description: 'Get your Postgres version.', - sql: `select * from - (select version()) as version, - (select current_setting('server_version_num')) as version_number;`, - }, - { - id: 7, - type: 'template', - title: 'Show active connections', - description: 'Get the number of active and max connections.', - sql: `select * from -(select count(pid) as active_connections FROM pg_stat_activity where state = 'active') active_connections, -(select setting as max_connections from pg_settings where name = 'max_connections') max_connections;`, - }, - { - id: 8, - type: 'template', - title: 'Automatically update timestamps', - description: 'Update a column timestamp on every update.', - sql: ` -create extension if not exists moddatetime schema extensions; - --- assuming the table name is "todos", and a timestamp column "updated_at" --- this trigger will set the "updated_at" column to the current timestamp for every update -create trigger - handle_updated_at before update -on todos -for each row execute - procedure moddatetime(updated_at); - `.trim(), - }, - { - id: 9, - type: 'template', - title: 'Increment field value', - description: 'Update a field with incrementing value using stored procedure.', - sql: ` -create function increment(row_id int) -returns void as -$$ - update table_name - set field_name = field_name + 1 - where id = row_id; -$$ -language sql volatile; - --- you can call the function from your browser with supabase-js --- const { data, error } = await supabase.rpc('increment', { row_id: 2 }) - `.trim(), - }, - { - id: 10, - type: 'template', - title: 'pg_stat_statements report', - description: 'Select from pg_stat_statements and view recent queries', - sql: `-- pg_stat_statements report - --- A limit of 100 has been added below - -select - auth.rolname, - statements.query, - statements.calls, - -- -- Postgres 13, 14 - statements.total_exec_time + statements.total_plan_time as total_time, - statements.min_exec_time + statements.min_plan_time as min_time, - statements.max_exec_time + statements.max_plan_time as max_time, - statements.mean_exec_time + statements.mean_plan_time as mean_time, - -- -- Postgres <= 12 - -- total_time, - -- min_time, - -- max_time, - -- mean_time, - statements.rows / statements.calls as avg_rows, - statements.wal_bytes, - statements.wal_records - from pg_stat_statements as statements - inner join pg_authid as auth on statements.userid = auth.oid - order by - total_time desc - limit - 100;`, - }, - { - id: 11, - type: 'quickstart', - title: 'Countries', - description: 'Create a table with all the countries in the world.', - sql: `create type public.continents as enum ( - 'Africa', - 'Antarctica', - 'Asia', - 'Europe', - 'Oceania', - 'North America', - 'South America' -); -create table public.countries ( - id bigint generated by default as identity primary key, - name text, - iso2 text not null, - iso3 text, - local_name text, - continent continents -); -comment on table countries is 'Full list of countries.'; -comment on column countries.name is 'Full country name.'; -comment on column countries.iso2 is 'ISO 3166-1 alpha-2 code.'; -comment on column countries.iso3 is 'ISO 3166-1 alpha-3 code.'; -comment on column countries.local_name is 'Local variation of the name.'; -insert into public.countries (name,iso2,iso3,local_name,continent) values - ('Bonaire, Sint Eustatius and Saba','BQ','BES',null,null), - ('Curaçao','CW','CUW',null,null), - ('Guernsey','GG','GGY',null,null), - ('Isle of Man','IM','IMN',null,null), - ('Jersey','JE','JEY',null,null), - ('Åland Islands','AX','ALA',null,null), - ('Montenegro','ME','MNE',null,null), - ('Saint BarthÊlemy','BL','BLM',null,null), - ('Saint Martin (French part)','MF','MAF',null,null), - ('Serbia','RS','SRB',null,null), - ('Sint Maarten (Dutch part)','SX','SXM',null,null), - ('South Sudan','SS','SSD',null,null), - ('Timor-Leste','TL','TLS',null,null), - ('American Samoa','as','ASM','Amerika Samoa','Oceania'), - ('Andorra','AD','AND','Andorra','Europe'), - ('Angola','AO','AGO','Angola','Africa'), - ('Anguilla','AI','AIA','Anguilla','North America'), - ('Antarctica','AQ','ATA','','Antarctica'), - ('Antigua and Barbuda','AG','ATG','Antigua and Barbuda','North America'), - ('Argentina','AR','ARG','Argentina','South America'), - ('Armenia','AM','ARM','Hajastan','Asia'), - ('Aruba','AW','ABW','Aruba','North America'), - ('Australia','AU','AUS','Australia','Oceania'), - ('Austria','AT','AUT','Österreich','Europe'), - ('Azerbaijan','AZ','AZE','Azerbaijan','Asia'), - ('Bahamas','BS','BHS','The Bahamas','North America'), - ('Bahrain','BH','BHR','Al-Bahrayn','Asia'), - ('Bangladesh','BD','BGD','Bangladesh','Asia'), - ('Barbados','BB','BRB','Barbados','North America'), - ('Belarus','BY','BLR','Belarus','Europe'), - ('Belgium','BE','BEL','Belgium/Belgique','Europe'), - ('Belize','BZ','BLZ','Belize','North America'), - ('Benin','BJ','BEN','Benin','Africa'), - ('Bermuda','BM','BMU','Bermuda','North America'), - ('Bhutan','BT','BTN','Druk-Yul','Asia'), - ('Bolivia','BO','BOL','Bolivia','South America'), - ('Bosnia and Herzegovina','BA','BIH','Bosna i Hercegovina','Europe'), - ('Botswana','BW','BWA','Botswana','Africa'), - ('Bouvet Island','BV','BVT','Bouvet Island','Antarctica'), - ('Brazil','BR','BRA','Brasil','South America'), - ('British Indian Ocean Territory','IO','IOT','British Indian Ocean Territory','Africa'), - ('Brunei Darussalam','BN','BRN','Brunei Darussalam','Asia'), - ('Bulgaria','BG','BGR','Balgarija','Europe'), - ('Burkina Faso','BF','BFA','Burkina Faso','Africa'), - ('Burundi','BI','BDI','Burundi/Uburundi','Africa'), - ('Cambodia','KH','KHM','Cambodia','Asia'), - ('Cameroon','CM','CMR','Cameroun/Cameroon','Africa'), - ('Canada','CA','CAN','Canada','North America'), - ('Cape Verde','CV','CPV','Cabo Verde','Africa'), - ('Cayman Islands','KY','CYM','Cayman Islands','North America'), - ('Central African Republic','CF','CAF','Centrafrique','Africa'), - ('Chad','TD','TCD','Tchad/Tshad','Africa'), - ('Chile','CL','CHL','Chile','South America'), - ('China','CN','CHN','Zhongquo','Asia'), - ('Christmas Island','CX','CXR','Christmas Island','Oceania'), - ('Cocos (Keeling) Islands','CC','CCK','Cocos (Keeling) Islands','Oceania'), - ('Colombia','CO','COL','Colombia','South America'), - ('Comoros','KM','COM','Komori/Comores','Africa'), - ('Congo','CG','COG','Congo','Africa'), - ('Congo, the Democratic Republic of the','CD','COD','Republique Democratique du Congo','Africa'), - ('Cook Islands','CK','COK','The Cook Islands','Oceania'), - ('Costa Rica','CR','CRI','Costa Rica','North America'), - ('Cote DIvoire','CI','CIV','Côte dIvoire','Africa'), - ('Croatia','HR','HRV','Hrvatska','Europe'), - ('Cuba','CU','CUB','Cuba','North America'), - ('Cyprus','CY','CYP','Cyprus','Asia'), - ('Czech Republic','CZ','CZE','Czech','Europe'), - ('Denmark','DK','DNK','Danmark','Europe'), - ('Djibouti','DJ','DJI','Djibouti/Jibuti','Africa'), - ('Dominica','DM','DMA','Dominica','North America'), - ('Dominican Republic','DO','DOM','Republica Dominicana','North America'), - ('Ecuador','EC','ECU','Ecuador','South America'), - ('Egypt','EG','EGY','Misr','Africa'), - ('El Salvador','SV','SLV','El Salvador','North America'), - ('Equatorial Guinea','GQ','GNQ','Guinea Ecuatorial','Africa'), - ('Eritrea','ER','ERI','Ertra','Africa'), - ('Estonia','EE','EST','Eesti','Europe'), - ('Ethiopia','ET','ETH','Yeityopiya','Africa'), - ('Falkland Islands (Malvinas)','FK','FLK','Falkland Islands','South America'), - ('Faroe Islands','FO','FRO','Faroe Islands','Europe'), - ('Fiji','FJ','FJI','Fiji Islands','Oceania'), - ('Finland','FI','FIN','Suomi','Europe'), - ('France','FR','FRA','France','Europe'), - ('French Guiana','GF','GUF','Guyane francaise','South America'), - ('French Polynesia','PF','PYF','PolynÊsie française','Oceania'), - ('French Southern Territories','TF','ATF','Terres australes françaises','Antarctica'), - ('Gabon','GA','GAB','Le Gabon','Africa'), - ('Gambia','GM','GMB','The Gambia','Africa'), - ('Georgia','GE','GEO','Sakartvelo','Asia'), - ('Germany','DE','DEU','Deutschland','Europe'), - ('Ghana','GH','GHA','Ghana','Africa'), - ('Gibraltar','GI','GIB','Gibraltar','Europe'), - ('Greece','GR','GRC','Greece','Europe'), - ('Greenland','GL','GRL','Kalaallit Nunaat','North America'), - ('Grenada','GD','GRD','Grenada','North America'), - ('Guadeloupe','GP','GLP','Guadeloupe','North America'), - ('Guam','GU','GUM','Guam','Oceania'), - ('Guatemala','GT','GTM','Guatemala','North America'), - ('Guinea','GN','GIN','Guinea','Africa'), - ('Guinea-Bissau','GW','GNB','Guinea-Bissau','Africa'), - ('Guyana','GY','GUY','Guyana','South America'), - ('Haiti','HT','HTI','Haiti/Dayti','North America'), - ('Heard Island and Mcdonald Islands','HM','HMD','Heard and McDonald Islands','Antarctica'), - ('Holy See (Vatican City State)','VA','VAT','Santa Sede/Città del Vaticano','Europe'), - ('Honduras','HN','HND','Honduras','North America'), - ('Hong Kong','HK','HKG','Xianggang/Hong Kong','Asia'), - ('Hungary','HU','HUN','Hungary','Europe'), - ('Iceland','IS','ISL','Iceland','Europe'), - ('India','IN','IND','Bharat/India','Asia'), - ('Indonesia','ID','IDN','Indonesia','Asia'), - ('Iran, Islamic Republic of','IR','IRN','Iran','Asia'), - ('Iraq','IQ','IRQ','Al-Irāq','Asia'), - ('Ireland','IE','IRL','Ireland','Europe'), - ('Israel','IL','ISR','Yisrael','Asia'), - ('Italy','IT','ITA','Italia','Europe'), - ('Jamaica','JM','JAM','Jamaica','North America'), - ('Japan','JP','JPN','Nihon/Nippon','Asia'), - ('Jordan','JO','JOR','Al-Urdunn','Asia'), - ('Kazakhstan','KZ','KAZ','Qazaqstan','Asia'), - ('Kenya','KE','KEN','Kenya','Africa'), - ('Kiribati','KI','KIR','Kiribati','Oceania'), - ('Korea, Democratic People''s Republic of','KP','PRK','Choson Minjujuui Inmin Konghwaguk (Bukhan)','Asia'), - ('Korea, Republic of','KR','KOR','Taehan-minguk (Namhan)','Asia'), - ('Kuwait','KW','KWT','Al-Kuwayt','Asia'), - ('Kyrgyzstan','KG','KGZ','Kyrgyzstan','Asia'), - ('Lao People''s Democratic Republic','LA','LAO','Lao','Asia'), - ('Latvia','LV','LVA','Latvija','Europe'), - ('Lebanon','LB','LBN','Lubnan','Asia'), - ('Lesotho','LS','LSO','Lesotho','Africa'), - ('Liberia','LR','LBR','Liberia','Africa'), - ('Libya','LY','LBY','Libiya','Africa'), - ('Liechtenstein','LI','LIE','Liechtenstein','Europe'), - ('Lithuania','LT','LTU','Lietuva','Europe'), - ('Luxembourg','LU','LUX','Luxembourg','Europe'), - ('Macao','MO','MAC','Macau/Aomen','Asia'), - ('Macedonia, the Former Yugoslav Republic of','MK','MKD','Makedonija','Europe'), - ('Madagascar','MG','MDG','Madagasikara/Madagascar','Africa'), - ('Malawi','MW','MWI','Malawi','Africa'), - ('Malaysia','MY','MYS','Malaysia','Asia'), - ('Maldives','MV','MDV','Dhivehi Raajje/Maldives','Asia'), - ('Mali','ML','MLI','Mali','Africa'), - ('Malta','MT','MLT','Malta','Europe'), - ('Marshall Islands','MH','MHL','Marshall Islands/Majol','Oceania'), - ('Martinique','MQ','MTQ','Martinique','North America'), - ('Mauritania','MR','MRT','Muritaniya/Mauritanie','Africa'), - ('Mauritius','MU','MUS','Mauritius','Africa'), - ('Mayotte','YT','MYT','Mayotte','Africa'), - ('Mexico','MX','MEX','Mexico','North America'), - ('Micronesia, Federated States of','FM','FSM','Micronesia','Oceania'), - ('Moldova, Republic of','MD','MDA','Moldova','Europe'), - ('Monaco','MC','MCO','Monaco','Europe'), - ('Mongolia','MN','MNG','Mongol Uls','Asia'), - ('Albania','AL','ALB','Republika e ShqipÃĢrisÃĢ','Europe'), - ('Montserrat','MS','MSR','Montserrat','North America'), - ('Morocco','MA','MAR','Al-Maghrib','Africa'), - ('Mozambique','MZ','MOZ','Mozambique','Africa'), - ('Myanmar','MM','MMR','Myanma Pye','Asia'), - ('Namibia','NA','NAM','Namibia','Africa'), - ('Nauru','NR','NRU','Naoero/Nauru','Oceania'), - ('Nepal','NP','NPL','Nepal','Asia'), - ('Netherlands','NL','NLD','Nederland','Europe'), - ('New Caledonia','NC','NCL','Nouvelle-CalÊdonie','Oceania'), - ('New Zealand','NZ','NZL','New Zealand/Aotearoa','Oceania'), - ('Nicaragua','NI','NIC','Nicaragua','North America'), - ('Niger','NE','NER','Niger','Africa'), - ('Nigeria','NG','NGA','Nigeria','Africa'), - ('Niue','NU','NIU','Niue','Oceania'), - ('Norfolk Island','NF','NFK','Norfolk Island','Oceania'), - ('Northern Mariana Islands','MP','MNP','Northern Mariana Islands','Oceania'), - ('Norway','NO','NOR','Norge','Europe'), - ('Oman','OM','OMN','Oman','Asia'), - ('Pakistan','PK','PAK','Pakistan','Asia'), - ('Palau','PW','PLW','Belau/Palau','Oceania'), - ('Palestine, State of','PS','PSE','Filastin','Asia'), - ('Panama','PA','PAN','RepÃēblica de PanamÃĄ','North America'), - ('Papua New Guinea','PG','PNG','Papua New Guinea/Papua Niugini','Oceania'), - ('Paraguay','PY','PRY','Paraguay','South America'), - ('Peru','PE','PER','PerÃē/Piruw','South America'), - ('Philippines','PH','PHL','Pilipinas','Asia'), - ('Pitcairn','PN','PCN','Pitcairn','Oceania'), - ('Poland','PL','POL','Polska','Europe'), - ('Portugal','PT','PRT','Portugal','Europe'), - ('Puerto Rico','PR','PRI','Puerto Rico','North America'), - ('Qatar','QA','QAT','Qatar','Asia'), - ('Reunion','RE','REU','Reunion','Africa'), - ('Romania','RO','ROM','Romania','Europe'), - ('Russian Federation','RU','RUS','Rossija','Europe'), - ('Rwanda','RW','RWA','Rwanda/Urwanda','Africa'), - ('Saint Helena, Ascension and Tristan da Cunha','SH','SHN','Saint Helena','Africa'), - ('Saint Kitts and Nevis','KN','KNA','Saint Kitts and Nevis','North America'), - ('Saint Lucia','LC','LCA','Saint Lucia','North America'), - ('Saint Pierre and Miquelon','PM','SPM','Saint-Pierre-et-Miquelon','North America'), - ('Saint Vincent and the Grenadines','VC','VCT','Saint Vincent and the Grenadines','North America'), - ('Samoa','WS','WSM','Samoa','Oceania'), - ('San Marino','SM','SMR','San Marino','Europe'), - ('Sao Tome and Principe','ST','STP','SÃŖo TomÊ e Príncipe','Africa'), - ('Saudi Arabia','SA','SAU','Al-Mamlaka al-Arabiya as-Saudiya','Asia'), - ('Senegal','SN','SEN','SÊnÊgal/Sounougal','Africa'), - ('Seychelles','SC','SYC','Sesel/Seychelles','Africa'), - ('Sierra Leone','SL','SLE','Sierra Leone','Africa'), - ('Singapore','SG','SGP','Singapore/Singapura/Xinjiapo/Singapur','Asia'), - ('Slovakia','SK','SVK','Slovensko','Europe'), - ('Slovenia','SI','SVN','Slovenija','Europe'), - ('Solomon Islands','SB','SLB','Solomon Islands','Oceania'), - ('Somalia','SO','SOM','Soomaaliya','Africa'), - ('South Africa','ZA','ZAF','South Africa','Africa'), - ('South Georgia and the South Sandwich Islands','GS','SGS','South Georgia and the South Sandwich Islands','Antarctica'), - ('Spain','ES','ESP','EspaÃąa','Europe'), - ('Sri Lanka','LK','LKA','Sri Lanka/Ilankai','Asia'), - ('Sudan','SD','SDN','As-Sudan','Africa'), - ('Suriname','SR','SUR','Suriname','South America'), - ('Svalbard and Jan Mayen','SJ','SJM','Svalbard og Jan Mayen','Europe'), - ('Swaziland','SZ','SWZ','kaNgwane','Africa'), - ('Sweden','SE','SWE','Sverige','Europe'), - ('Switzerland','CH','CHE','Schweiz/Suisse/Svizzera/Svizra','Europe'), - ('Syrian Arab Republic','SY','SYR','Suriya','Asia'), - ('Taiwan (Province of China)','TW','TWN','Tai-wan','Asia'), - ('Tajikistan','TJ','TJK','Tajikistan','Asia'), - ('Tanzania, United Republic of','TZ','TZA','Tanzania','Africa'), - ('Thailand','TH','THA','Prathet Thai','Asia'), - ('Togo','TG','TGO','Togo','Africa'), - ('Tokelau','TK','TKL','Tokelau','Oceania'), - ('Tonga','TO','TON','Tonga','Oceania'), - ('Trinidad and Tobago','TT','TTO','Trinidad and Tobago','North America'), - ('Tunisia','TN','TUN','Tunis/Tunisie','Africa'), - ('Turkey','TR','TUR','TÃŧrkiye','Asia'), - ('Turkmenistan','TM','TKM','TÃŧrkmenistan','Asia'), - ('Turks and Caicos Islands','TC','TCA','The Turks and Caicos Islands','North America'), - ('Tuvalu','TV','TUV','Tuvalu','Oceania'), - ('Uganda','UG','UGA','Uganda','Africa'), - ('Ukraine','UA','UKR','Ukrajina','Europe'), - ('United Arab Emirates','AE','ARE','Al-Amirat al-Arabiya al-Muttahida','Asia'), - ('United Kingdom','GB','GBR','United Kingdom','Europe'), - ('United States','US','USA','United States','North America'), - ('United States Minor Outlying Islands','UM','UMI','United States Minor Outlying Islands','Oceania'), - ('Uruguay','UY','URY','Uruguay','South America'), - ('Uzbekistan','UZ','UZB','Uzbekiston','Asia'), - ('Vanuatu','VU','VUT','Vanuatu','Oceania'), - ('Venezuela','VE','VEN','Venezuela','South America'), - ('Viet Nam','VN','VNM','Viet Nam','Asia'), - ('Virgin Islands (British)','VG','VGB','British Virgin Islands','North America'), - ('Virgin Islands (U.S.)','VI','VIR','Virgin Islands of the United States','North America'), - ('Wallis and Futuna','WF','WLF','Wallis-et-Futuna','Oceania'), - ('Western Sahara','EH','ESH','As-Sahrawiya','Africa'), - ('Yemen','YE','YEM','Al-Yaman','Asia'), - ('Zambia','ZM','ZMB','Zambia','Africa'), - ('Zimbabwe','ZW','ZWE','Zimbabwe','Africa'), - ('Afghanistan','AF','AFG','Afganistan/Afqanestan','Asia'), - ('Algeria','DZ','DZA','Al-Jazair/Algerie','Africa'); -`.trim(), - }, - { - id: 12, - type: 'quickstart', - title: 'Slack Clone', - description: 'Build a basic slack clone with Row Level Security.', - sql: ` --- --- For use with https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone - --- Custom types -create type public.app_permission as enum ('channels.delete', 'messages.delete'); -create type public.app_role as enum ('admin', 'moderator'); -create type public.user_status as enum ('ONLINE', 'OFFLINE'); - --- USERS -create table public.users ( - id uuid not null primary key, -- UUID from auth.users - username text, - status user_status default 'OFFLINE'::public.user_status -); -comment on table public.users is 'Profile data for each user.'; -comment on column public.users.id is 'References the internal Supabase Auth user.'; - --- CHANNELS -create table public.channels ( - id bigint generated by default as identity primary key, - inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, - slug text not null unique, - created_by uuid references public.users not null -); -comment on table public.channels is 'Topics and groups.'; - --- MESSAGES -create table public.messages ( - id bigint generated by default as identity primary key, - inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, - message text, - user_id uuid references public.users not null, - channel_id bigint references public.channels on delete cascade not null -); -comment on table public.messages is 'Individual messages sent by each user.'; - --- USER ROLES -create table public.user_roles ( - id bigint generated by default as identity primary key, - user_id uuid references public.users on delete cascade not null, - role app_role not null, - unique (user_id, role) -); -comment on table public.user_roles is 'Application roles for each user.'; - --- ROLE PERMISSIONS -create table public.role_permissions ( - id bigint generated by default as identity primary key, - role app_role not null, - permission app_permission not null, - unique (role, permission) -); -comment on table public.role_permissions is 'Application permissions for each role.'; - --- authorize with role-based access control (RBAC) -create function public.authorize( - requested_permission app_permission, - user_id uuid -) -returns boolean as -$$ - declare - bind_permissions int; - begin - select - count(*) - from public.role_permissions - inner join public.user_roles on role_permissions.role = user_roles.role - where - role_permissions.permission = authorize.requested_permission and - user_roles.user_id = authorize.user_id - into bind_permissions; - - return bind_permissions > 0; - end; -$$ -language plpgsql security definer; - --- Secure the tables -alter table public.users - enable row level security; -alter table public.channels - enable row level security; -alter table public.messages - enable row level security; -alter table public.user_roles - enable row level security; -alter table public.role_permissions - enable row level security; - -create policy "Allow logged-in read access" on public.users - for select using (auth.role() = 'authenticated'); -create policy "Allow individual insert access" on public.users - for insert with check (auth.uid() = id); -create policy "Allow individual update access" on public.users - for update using ( auth.uid() = id ); -create policy "Allow logged-in read access" on public.channels - for select using (auth.role() = 'authenticated'); -create policy "Allow individual insert access" on public.channels - for insert with check (auth.uid() = created_by); -create policy "Allow individual delete access" on public.channels - for delete using (auth.uid() = created_by); -create policy "Allow authorized delete access" on public.channels - for delete using (authorize('channels.delete', auth.uid())); -create policy "Allow logged-in read access" on public.messages - for select using (auth.role() = 'authenticated'); -create policy "Allow individual insert access" on public.messages - for insert with check (auth.uid() = user_id); -create policy "Allow individual update access" on public.messages - for update using (auth.uid() = user_id); -create policy "Allow individual delete access" on public.messages - for delete using (auth.uid() = user_id); -create policy "Allow authorized delete access" on public.messages - for delete using (authorize('messages.delete', auth.uid())); -create policy "Allow individual read access" on public.user_roles - for select using (auth.uid() = user_id); - --- Send "previous data" on change -alter table public.users - replica identity full; -alter table public.channels - replica identity full; -alter table public.messages - replica identity full; - --- inserts a row into public.users and assigns roles -create function public.handle_new_user() -returns trigger as -$$ - declare is_admin boolean; - begin - insert into public.users (id, username) - values (new.id, new.email); - - select count(*) = 1 from auth.users into is_admin; - - if position('+supaadmin@' in new.email) > 0 then - insert into public.user_roles (user_id, role) values (new.id, 'admin'); - elsif position('+supamod@' in new.email) > 0 then - insert into public.user_roles (user_id, role) values (new.id, 'moderator'); - end if; - - return new; - end; -$$ language plpgsql security definer; - --- trigger the function every time a user is created -create trigger on_auth_user_created - after insert on auth.users - for each row execute procedure public.handle_new_user(); - -/** - * REALTIME SUBSCRIPTIONS - * Only allow realtime listening on public tables. - */ - -begin; - -- remove the realtime publication - drop publication if exists supabase_realtime; - - -- re-create the publication but don't enable it for any tables - create publication supabase_realtime; -commit; - --- add tables to the publication -alter publication supabase_realtime add table public.channels; -alter publication supabase_realtime add table public.messages; -alter publication supabase_realtime add table public.users; - --- DUMMY DATA -insert into public.users (id, username) -values - ('8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e', 'supabot'); - -insert into public.channels (slug, created_by) -values - ('public', '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'), - ('random', '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'); - -insert into public.messages (message, channel_id, user_id) -values - ('Hello World 👋', 1, '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'), - ('Perfection is attained, not when there is nothing more to add, but when there is nothing left to take away.', 2, '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'); - -insert into public.role_permissions (role, permission) -values - ('admin', 'channels.delete'), - ('admin', 'messages.delete'), - ('moderator', 'messages.delete'); -`.trim(), - }, - { - id: 13, - type: 'quickstart', - title: 'Todo List', - description: 'Build a basic todo list with Row Level Security.', - sql: ` --- --- For use with: --- https://github.com/supabase/supabase/tree/master/examples/todo-list/sveltejs-todo-list or --- https://github.com/supabase/examples-archive/tree/main/supabase-js-v1/todo-list --- - -create table todos ( - id bigint generated by default as identity primary key, - user_id uuid references auth.users not null, - task text check (char_length(task) > 3), - is_complete boolean default false, - inserted_at timestamp with time zone default timezone('utc'::text, now()) not null -); -alter table todos enable row level security; -create policy "Individuals can create todos." on todos for - insert with check (auth.uid() = user_id); -create policy "Individuals can view their own todos. " on todos for - select using (auth.uid() = user_id); -create policy "Individuals can update their own todos." on todos for - update using (auth.uid() = user_id); -create policy "Individuals can delete their own todos." on todos for - delete using (auth.uid() = user_id); -`.trim(), - }, - { - id: 14, - type: 'quickstart', - title: 'Stripe Subscriptions', - description: 'Starter template for the Next.js Stripe Subscriptions Starter.', - sql: ` -/** -* USERS -* Note: This table contains user data. Users should only be able to view and update their own data. -*/ -create table users ( - -- UUID from auth.users - id uuid references auth.users not null primary key, - full_name text, - avatar_url text, - -- The customer's billing address, stored in JSON format. - billing_address jsonb, - -- Stores your customer's payment instruments. - payment_method jsonb -); -alter table users - enable row level security; -create policy "Can view own user data." on users - for select using (auth.uid() = id); -create policy "Can update own user data." on users - for update using (auth.uid() = id); - -/** -* This trigger automatically creates a user entry when a new user signs up via Supabase Auth. -*/ -create function public.handle_new_user() -returns trigger as -$$ - begin - insert into public.users (id, full_name, avatar_url) - values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url'); - return new; - end; -$$ -language plpgsql security definer; - -create trigger on_auth_user_created - after insert on auth.users - for each row - execute procedure public.handle_new_user(); - -/** -* CUSTOMERS -* Note: this is a private table that contains a mapping of user IDs to Strip customer IDs. -*/ -create table customers ( - -- UUID from auth.users - id uuid references auth.users not null primary key, - -- The user's customer ID in Stripe. User must not be able to update this. - stripe_customer_id text -); -alter table customers enable row level security; --- No policies as this is a private table that the user must not have access to. - -/** -* PRODUCTS -* Note: products are created and managed in Stripe and synced to our DB via Stripe webhooks. -*/ -create table products ( - -- Product ID from Stripe, e.g. prod_1234. - id text primary key, - -- Whether the product is currently available for purchase. - active boolean, - -- The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions. - name text, - -- The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - description text, - -- A URL of the product image in Stripe, meant to be displayable to the customer. - image text, - -- Set of key-value pairs, used to store additional information about the object in a structured format. - metadata jsonb -); -alter table products - enable row level security; -create policy "Allow public read-only access." on products - for select using (true); - -/** -* PRICES -* Note: prices are created and managed in Stripe and synced to our DB via Stripe webhooks. -*/ -create type pricing_type as enum ('one_time', 'recurring'); -create type pricing_plan_interval as enum ('day', 'week', 'month', 'year'); -create table prices ( - -- Price ID from Stripe, e.g. price_1234. - id text primary key, - -- The ID of the prduct that this price belongs to. - product_id text references products, - -- Whether the price can be used for new purchases. - active boolean, - -- A brief description of the price. - description text, - -- The unit amount as a positive integer in the smallest currency unit (e.g., 100 cents for US$1.00 or 100 for ÂĨ100, a zero-decimal currency). - unit_amount bigint, - -- Three-letter ISO currency code, in lowercase. - currency text check (char_length(currency) = 3), - -- One of \`one_time\` or \`recurring\` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. - type pricing_type, - -- The frequency at which a subscription is billed. One of \`day\`, \`week\`, \`month\` or \`year\`. - interval pricing_plan_interval, - -- The number of intervals (specified in the \`interval\` attribute) between subscription billings. For example, \`interval=month\` and \`interval_count=3\` bills every 3 months. - interval_count integer, - -- Default number of trial days when subscribing a customer to this price using [\`trial_from_plan=true\`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - trial_period_days integer, - -- Set of key-value pairs, used to store additional information about the object in a structured format. - metadata jsonb -); -alter table prices - enable row level security; -create policy "Allow public read-only access." on prices - for select using (true); - -/** -* SUBSCRIPTIONS -* Note: subscriptions are created and managed in Stripe and synced to our DB via Stripe webhooks. -*/ -create type subscription_status as enum ('trialing', 'active', 'canceled', 'incomplete', 'incomplete_expired', 'past_due', 'unpaid'); -create table subscriptions ( - -- Subscription ID from Stripe, e.g. sub_1234. - id text primary key, - user_id uuid references auth.users not null, - -- The status of the subscription object, one of subscription_status type above. - status subscription_status, - -- Set of key-value pairs, used to store additional information about the object in a structured format. - metadata jsonb, - -- ID of the price that created this subscription. - price_id text references prices, - -- Quantity multiplied by the unit amount of the price creates the amount of the subscription. Can be used to charge multiple seats. - quantity integer, - -- If true the subscription has been canceled by the user and will be deleted at the end of the billing period. - cancel_at_period_end boolean, - -- Time at which the subscription was created. - created timestamp with time zone default timezone('utc'::text, now()) not null, - -- Start of the current period that the subscription has been invoiced for. - current_period_start timestamp with time zone default timezone('utc'::text, now()) not null, - -- End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. - current_period_end timestamp with time zone default timezone('utc'::text, now()) not null, - -- If the subscription has ended, the timestamp of the date the subscription ended. - ended_at timestamp with time zone default timezone('utc'::text, now()), - -- A date in the future at which the subscription will automatically get canceled. - cancel_at timestamp with time zone default timezone('utc'::text, now()), - -- If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with \`cancel_at_period_end\`, \`canceled_at\` will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state. - canceled_at timestamp with time zone default timezone('utc'::text, now()), - -- If the subscription has a trial, the beginning of that trial. - trial_start timestamp with time zone default timezone('utc'::text, now()), - -- If the subscription has a trial, the end of that trial. - trial_end timestamp with time zone default timezone('utc'::text, now()) -); -alter table subscriptions - enable row level security; -create policy "Can only view own subs data." on subscriptions - for select using (auth.uid() = user_id); - -/** - * REALTIME SUBSCRIPTIONS - * Only allow realtime listening on public tables. - */ -drop publication if exists supabase_realtime; -create publication supabase_realtime - for table products, prices; -`.trim(), - }, - { - id: 15, - type: 'quickstart', - title: 'User Management Starter', - description: 'Sets up a public Profiles table which you can access with your API.', - sql: ` --- Create a table for public profiles -create table profiles ( - id uuid references auth.users on delete cascade not null primary key, - updated_at timestamp with time zone, - username text unique, - full_name text, - avatar_url text, - website text, - - constraint username_length check (char_length(username) >= 3) -); --- Set up Row Level Security (RLS) --- See https://supabase.com/docs/guides/auth/row-level-security for more details. -alter table profiles - enable row level security; - -create policy "Public profiles are viewable by everyone." on profiles - for select using (true); - -create policy "Users can insert their own profile." on profiles - for insert with check (auth.uid() = id); - -create policy "Users can update own profile." on profiles - for update using (auth.uid() = id); - --- This trigger automatically creates a profile entry when a new user signs up via Supabase Auth. --- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details. -create function public.handle_new_user() -returns trigger as $$ -begin - insert into public.profiles (id, full_name, avatar_url) - values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url'); - return new; -end; -$$ language plpgsql security definer; -create trigger on_auth_user_created - after insert on auth.users - for each row execute procedure public.handle_new_user(); - --- Set up Storage! -insert into storage.buckets (id, name) - values ('avatars', 'avatars'); - --- Set up access controls for storage. --- See https://supabase.com/docs/guides/storage#policy-examples for more details. -create policy "Avatar images are publicly accessible." on storage.objects - for select using (bucket_id = 'avatars'); - -create policy "Anyone can upload an avatar." on storage.objects - for insert with check (bucket_id = 'avatars'); -`.trim(), - }, - { - id: 16, - type: 'quickstart', - title: 'NextAuth Schema Setup', - description: 'Sets up a the Schema and Tables for the NextAuth Supabase Adapter.', - sql: ` --- --- Name: next_auth; Type: SCHEMA; --- -CREATE SCHEMA next_auth; - -GRANT USAGE ON SCHEMA next_auth TO service_role; -GRANT ALL ON SCHEMA next_auth TO postgres; - --- --- Create users table --- -CREATE TABLE IF NOT EXISTS next_auth.users -( - id uuid NOT NULL DEFAULT gen_random_uuid(), - name text, - email text, - "emailVerified" timestamp with time zone, - image text, - CONSTRAINT users_pkey PRIMARY KEY (id), - CONSTRAINT email_unique UNIQUE (email) -); - -GRANT ALL ON TABLE next_auth.users TO postgres; -GRANT ALL ON TABLE next_auth.users TO service_role; - ---- uid() function to be used in RLS policies -CREATE FUNCTION next_auth.uid() RETURNS uuid - LANGUAGE sql STABLE - AS $$ - select - coalesce( - nullif(current_setting('request.jwt.claim.sub', true), ''), - (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'sub') - )::uuid -$$; - --- --- Create sessions table --- -CREATE TABLE IF NOT EXISTS next_auth.sessions -( - id uuid NOT NULL DEFAULT gen_random_uuid(), - expires timestamp with time zone NOT NULL, - "sessionToken" text NOT NULL, - "userId" uuid, - CONSTRAINT sessions_pkey PRIMARY KEY (id), - CONSTRAINT sessionToken_unique UNIQUE ("sessionToken"), - CONSTRAINT "sessions_userId_fkey" FOREIGN KEY ("userId") - REFERENCES next_auth.users (id) MATCH SIMPLE - ON UPDATE NO ACTION - ON DELETE CASCADE -); - -GRANT ALL ON TABLE next_auth.sessions TO postgres; -GRANT ALL ON TABLE next_auth.sessions TO service_role; - --- --- Create accounts table --- -CREATE TABLE IF NOT EXISTS next_auth.accounts -( - id uuid NOT NULL DEFAULT gen_random_uuid(), - type text NOT NULL, - provider text NOT NULL, - "providerAccountId" text NOT NULL, - refresh_token text, - access_token text, - expires_at bigint, - token_type text, - scope text, - id_token text, - session_state text, - oauth_token_secret text, - oauth_token text, - "userId" uuid, - CONSTRAINT accounts_pkey PRIMARY KEY (id), - CONSTRAINT provider_unique UNIQUE (provider, "providerAccountId"), - CONSTRAINT "accounts_userId_fkey" FOREIGN KEY ("userId") - REFERENCES next_auth.users (id) MATCH SIMPLE - ON UPDATE NO ACTION - ON DELETE CASCADE -); - -GRANT ALL ON TABLE next_auth.accounts TO postgres; -GRANT ALL ON TABLE next_auth.accounts TO service_role; - --- --- Create verification_tokens table --- -CREATE TABLE IF NOT EXISTS next_auth.verification_tokens -( - identifier text, - token text, - expires timestamp with time zone NOT NULL, - CONSTRAINT verification_tokens_pkey PRIMARY KEY (token), - CONSTRAINT token_unique UNIQUE (token), - CONSTRAINT token_identifier_unique UNIQUE (token, identifier) -); - -GRANT ALL ON TABLE next_auth.verification_tokens TO postgres; -GRANT ALL ON TABLE next_auth.verification_tokens TO service_role; -`.trim(), - }, - { - id: 17, - type: 'template', - title: 'Most frequently invoked', - description: 'Most frequently called queries in your database.', - sql: `-- Most frequently called queries - --- A limit of 100 has been added below - -select - auth.rolname, - statements.query, - statements.calls, - -- -- Postgres 13, 14, 15 - statements.total_exec_time + statements.total_plan_time as total_time, - statements.min_exec_time + statements.min_plan_time as min_time, - statements.max_exec_time + statements.max_plan_time as max_time, - statements.mean_exec_time + statements.mean_plan_time as mean_time, - -- -- Postgres <= 12 - -- total_time, - -- min_time, - -- max_time, - -- mean_time, - statements.rows / statements.calls as avg_rows - - from pg_stat_statements as statements - inner join pg_authid as auth on statements.userid = auth.oid - order by - statements.calls desc - limit - 100;`, - }, - { - id: 18, - type: 'template', - title: 'Most time consuming', - description: 'Aggregate time spent on a query type.', - sql: `-- Most time consuming queries - --- A limit of 100 has been added below - -select - auth.rolname, - statements.query, - statements.calls, - statements.total_exec_time + statements.total_plan_time as total_time, - to_char(((statements.total_exec_time + statements.total_plan_time)/sum(statements.total_exec_time + statements.total_plan_time) over()) * 100, 'FM90D0') || '%' as prop_total_time - from pg_stat_statements as statements - inner join pg_authid as auth on statements.userid = auth.oid - order by - total_time desc - limit - 100;`, - }, - { - id: 19, - type: 'template', - title: 'Slowest execution time', - description: 'Slowest queries based on max execution time.', - sql: `-- Slowest queries by max execution time - --- A limit of 100 has been added below - -select - auth.rolname, - statements.query, - statements.calls, - -- -- Postgres 13, 14, 15 - statements.total_exec_time + statements.total_plan_time as total_time, - statements.min_exec_time + statements.min_plan_time as min_time, - statements.max_exec_time + statements.max_plan_time as max_time, - statements.mean_exec_time + statements.mean_plan_time as mean_time, - -- -- Postgres <= 12 - -- total_time, - -- min_time, - -- max_time, - -- mean_time, - statements.rows / statements.calls as avg_rows - from pg_stat_statements as statements - inner join pg_authid as auth on statements.userid = auth.oid - order by - max_time desc - limit - 100;`, - }, - { - id: 20, - type: 'template', - title: 'Hit rate', - description: 'See your cache and index hit rate.', - sql: `-- Cache and index hit rate - -select - 'index hit rate' as name, - (sum(idx_blks_hit)) / nullif(sum(idx_blks_hit + idx_blks_read),0) as ratio - from pg_statio_user_indexes - union all - select - 'table hit rate' as name, - sum(heap_blks_hit) / nullif(sum(heap_blks_hit) + sum(heap_blks_read),0) as ratio - from pg_statio_user_tables;`, - }, - { - id: 21, - type: 'quickstart', - title: 'OpenAI Vector Search', - description: 'Template for the Next.js OpenAI Doc Search Starter.', - sql: ` --- Enable pg_vector extension -create extension if not exists vector with schema public; - --- Create tables -create table "public"."nods_page" ( - id bigserial primary key, - parent_page_id bigint references public.nods_page, - path text not null unique, - checksum text, - meta jsonb, - type text, - source text -); -alter table "public"."nods_page" enable row level security; - -create table "public"."nods_page_section" ( - id bigserial primary key, - page_id bigint not null references public.nods_page on delete cascade, - content text, - token_count int, - embedding vector(1536), - slug text, - heading text -); -alter table "public"."nods_page_section" enable row level security; - --- Create embedding similarity search functions -create or replace function match_page_sections(embedding vector(1536), match_threshold float, match_count int, min_content_length int) -returns table (id bigint, page_id bigint, slug text, heading text, content text, similarity float) -language plpgsql -as $$ -#variable_conflict use_variable -begin - return query - select - nods_page_section.id, - nods_page_section.page_id, - nods_page_section.slug, - nods_page_section.heading, - nods_page_section.content, - (nods_page_section.embedding <#> embedding) * -1 as similarity - from nods_page_section - - -- We only care about sections that have a useful amount of content - where length(nods_page_section.content) >= min_content_length - - -- The dot product is negative because of a Postgres limitation, so we negate it - and (nods_page_section.embedding <#> embedding) * -1 > match_threshold - - -- OpenAI embeddings are normalized to length 1, so - -- cosine similarity and dot product will produce the same results. - -- Using dot product which can be computed slightly faster. - -- - -- For the different syntaxes, see https://github.com/pgvector/pgvector - order by nods_page_section.embedding <#> embedding - - limit match_count; -end; -$$; - -create or replace function get_page_parents(page_id bigint) -returns table (id bigint, parent_page_id bigint, path text, meta jsonb) -language sql -as $$ - with recursive chain as ( - select * - from nods_page - where id = page_id - - union all - - select child.* - from nods_page as child - join chain on chain.parent_page_id = child.id - ) - select id, parent_page_id, path, meta - from chain; -$$; -`.trim(), - }, - { - id: 22, - type: 'template', - title: 'Replication status report', - description: 'See the status of your replication slots and replication lag.', - sql: `-- Replication status report - -SELECT - s.slot_name, - s.active, - COALESCE(r.state, 'N/A') as state, - COALESCE(r.client_addr, null) as replication_client_address, - GREATEST(0, ROUND((redo_lsn-restart_lsn)/1024/1024/1024, 2)) as replication_lag_gb -FROM pg_control_checkpoint(), pg_replication_slots s -LEFT JOIN pg_stat_replication r ON (r.pid = s.active_pid); -`, - }, - { - id: 23, - type: 'quickstart', - title: 'LangChain', - description: 'LangChain is a popular framework for working with AI, Vectors, and embeddings.', - sql: ` --- Enable the pgvector extension to work with embedding vectors -create extension vector; - --- Create a table to store your documents -create table documents ( - id bigserial primary key, - content text, -- corresponds to Document.pageContent - metadata jsonb, -- corresponds to Document.metadata - embedding vector(1536) -- 1536 works for OpenAI embeddings, change if needed -); - --- Create a function to search for documents -create function match_documents ( - query_embedding vector(1536), - match_count int default null, - filter jsonb DEFAULT '{}' -) returns table ( - id bigint, - content text, - metadata jsonb, - similarity float -) -language plpgsql -as $$ -#variable_conflict use_column -begin - return query - select - id, - content, - metadata, - 1 - (documents.embedding <=> query_embedding) as similarity - from documents - where metadata @> filter - order by documents.embedding <=> query_embedding - limit match_count; -end; -$$; -`.trim(), - }, - { - id: 24, - type: 'template', - title: 'Install dbdev', - description: 'dbdev is a client for installing 3rd party packages into your database.', - sql: ` -create extension if not exists http with schema extensions; -create extension if not exists pg_tle; -select pgtle.uninstall_extension_if_exists('supabase-dbdev'); -drop extension if exists "supabase-dbdev"; -select - pgtle.install_extension( - 'supabase-dbdev', - resp.contents ->> 'version', - 'PostgreSQL package manager', - resp.contents ->> 'sql' - ) -from http( - ( - 'GET', - 'https://api.database.dev/rest/v1/' - || 'package_versions?select=sql,version' - || '&package_name=eq.supabase-dbdev' - || '&order=version.desc' - || '&limit=1', - array[ - ('apiKey', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhtdXB0cHBsZnZpaWZyYndtbXR2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODAxMDczNzIsImV4cCI6MTk5NTY4MzM3Mn0.z2CN0mvO2No8wSi46Gw59DFGCTJrzM0AQKsu_5k134s')::http_header - ], - null, - null - ) -) x, -lateral ( - select - ((row_to_json(x) -> 'content') #>> '{}')::json -> 0 -) resp(contents); -create extension "supabase-dbdev"; -select dbdev.install('supabase-dbdev'); -drop extension if exists "supabase-dbdev"; -create extension "supabase-dbdev"; -`.trim(), - }, - { - id: 25, - type: 'template', - title: 'Large objects', - description: 'List large objects (tables/indexes) in your database.', - sql: `SELECT - SCHEMA_NAME, - relname, - table_size - FROM - (SELECT - pg_catalog.pg_namespace.nspname AS SCHEMA_NAME, - relname, - pg_relation_size(pg_catalog.pg_class.oid) AS table_size - FROM pg_catalog.pg_class - JOIN pg_catalog.pg_namespace ON relnamespace = pg_catalog.pg_namespace.oid - ) t - WHERE SCHEMA_NAME NOT LIKE 'pg_%' - ORDER BY table_size DESC - LIMIT 25`.trim(), - }, - { - id: 26, - type: 'template', - title: 'Limit MFA verification attempts to one in 2 seconds', - description: - 'Create an Auth hook that limits the number of failed MFA verification attempts to one in 2 seconds.', - sql: ` -create function public.hook_mfa_verification_attempt(event jsonb) - returns jsonb - language plpgsql -as $$ - declare - last_failed_at timestamp; - begin - if event->'valid' is true then - -- code is valid, accept it - return jsonb_build_object('decision', 'continue'); - end if; - - select last_failed_at into last_failed_at - from public.mfa_failed_verification_attempts - where - user_id = (event->'user_id')::uuid - and - factor_id = event->'factor_id'; - - if last_failed_at is not null and now() - last_failed_at < interval '2 seconds' then - -- last attempt was done too quickly - return jsonb_build_object( - 'error', jsonb_build_object( - 'http_code', 429, - 'message', 'Please wait a moment before trying again.' - ) - ); - end if; - - -- record this failed attempt - insert into public.mfa_failed_verification_attempts - ( - user_id, - factor_id, - last_refreshed_at - ) - values - ( - event->'user_id', - event->'factor_id', - now() - ) - on conflict do update - set last_refreshed_at = now(); - - -- finally let Supabase Auth do the default behavior for a failed attempt - return jsonb_build_object('decision', 'continue'); - end; -$$; - --- Assign appropriate permissions and revoke access -grant execute - on function public.hook_mfa_verification_attempt - to supabase_auth_admin; - -grant all - on table public.mfa_failed_verification_attempts - to supabase_auth_admin; - -revoke execute - on function public.hook_mfa_verification_attempt - from authenticated, anon; - -revoke all - on table public.mfa_failed_verification_attempts - from authenticated, anon; - -grant usage on schema public to supabase_auth_admin;`.trim(), - }, - { - id: 27, - type: 'template', - title: 'Add Auth Hook (Password Verification Attempt)', - description: - 'Create an Auth Hook that limits number of failed password verification attempts to one in 10 seconds', - sql: ` -create function public.hook_password_verification_attempt(event jsonb) -returns jsonb -language plpgsql -as $$ - declare - last_failed_at timestamp; - begin - if event->'valid' is true then - -- password is valid, accept it - return jsonb_build_object('decision', 'continue'); - end if; - - select last_failed_at into last_failed_at - from public.password_failed_verification_attempts - where - user_id = (event->'user_id')::uuid; - - if last_failed_at is not null and now() - last_failed_at < interval '10 seconds' then - -- last attempt was done too quickly - return jsonb_build_object( - 'error', jsonb_build_object( - 'http_code', 429, - 'message', 'Please wait a moment before trying again.' - ) - ); - end if; - - -- record this failed attempt - insert into public.password_failed_verification_attempts - ( - user_id, - last_failed_at - ) - values - ( - event->'user_id', - now() - ) - on conflict do update - set last_failed_at = now(); - - -- finally let Supabase Auth do the default behavior for a failed attempt - return jsonb_build_object('decision', 'continue'); - end; -$$; - --- Assign appropriate permissions -grant execute - on function public.hook_password_verification_attempt - to supabase_auth_admin; - -grant all - on table public.password_failed_verification_attempts - to supabase_auth_admin; - -revoke execute - on function public.hook_password_verification_attempt - from authenticated, anon; - -revoke all - on table public.password_failed_verification_attempts - from authenticated, anon; - -grant usage on schema public to supabase_auth_admin;`.trim(), - }, - { - id: 28, - type: 'template', - title: 'Add Auth Hook (Custom Access Token)', - description: 'Create an Auth Hook to add custom claims to your Auth Token', - sql: ` --- Assumes that there is an is_admin flag on the profiles table. -create or replace function public.custom_access_token_hook(event jsonb) -returns jsonb -language plpgsql -as $$ - declare - claims jsonb; - is_admin boolean; - begin - -- Check if the user is marked as admin in the profiles table - select is_admin into is_admin from profiles where user_id = (event->>'user_id')::uuid; - - -- Proceed only if the user is an admin - if is_admin then - claims := event->'claims'; - - -- Check if 'user_metadata' exists in claims - if jsonb_typeof(claims->'user_metadata') is null then - -- If 'user_metadata' does not exist, create an empty object - claims := jsonb_set(claims, '{user_metadata}', '{}'); - end if; - - -- Set a claim of 'admin' - claims := jsonb_set(claims, '{user_metadata, admin}', 'true'); - - -- Update the 'claims' object in the original event - event := jsonb_set(event, '{claims}', claims); - end if; - - -- Return the modified or original event - return event; - end; -$$; - -grant execute - on function public.custom_access_token_hook - to supabase_auth_admin; - -revoke execute - on function public.custom_access_token_hook - from authenticated, anon; - -grant usage on schema public to supabase_auth_admin;`.trim(), - }, - - { - id: 29, - type: 'template', - title: 'Add Auth Hook (General)', - description: 'Create an Auth Hook', - sql: ` -create or replace function public.custom_access_token_hook(event jsonb) -returns jsonb -language plpgsql -as $$ -declare - -- Insert variables here -begin - -- Insert logic here - return event; -end; -$$; --- Permissions for the hook -grant execute on function public.custom_access_token_hook to supabase_auth_admin; -revoke execute on function public.custom_access_token_hook from authenticated, anon; - `, - }, -] const SQL_SNIPPET_SCHEMA_VERSION = '1.0' @@ -1533,10 +15,10 @@ export const NEW_SQL_SNIPPET_SKELETON: UserContent = { }, } -export const sqlAiDisclaimerComment = stripIndent` - -- Supabase AI is experimental and may produce incorrect answers - -- Always verify the output before executing -` +export const sqlAiDisclaimerComment = ` +-- Supabase AI is experimental and may produce incorrect answers +-- Always verify the output before executing +`.trim() export const untitledSnippetTitle = 'Untitled query' diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts b/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts new file mode 100644 index 00000000000..4aa2a91e71b --- /dev/null +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.queries.ts @@ -0,0 +1,1517 @@ +import type { SQLTemplate } from './SQLEditor.types' + +export const SQL_TEMPLATES: SQLTemplate[] = [ + { + id: 1, + type: 'template', + title: 'Create table', + description: 'Basic table template. Change "table_name" to the name you prefer.', + sql: `create table table_name ( + id bigint generated by default as identity primary key, + inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, + updated_at timestamp with time zone default timezone('utc'::text, now()) not null, + data jsonb, + name text +);`, + }, + { + id: 2, + type: 'template', + title: 'Add view', + description: + 'Template to add a view. Make sure to change the table and column names to ones that already exist.', + sql: `CREATE VIEW countries_view AS +SELECT id, continent +FROM countries;`, + }, + { + id: 3, + type: 'template', + title: 'Add column', + description: 'Template to add a column. Make sure to change the name and type.', + sql: `alter table table_name +add column new_column_name data_type;`, + }, + { + id: 4, + type: 'template', + title: 'Add comments', + description: 'Templates to add a comment to either a table or a column.', + sql: `comment on table table_name is 'Table description'; +comment on column table_name.column_name is 'Column description';`, + }, + { + id: 5, + type: 'template', + title: 'Show extensions', + description: 'Get a list of extensions in your database and status.', + sql: `select + name, comment, default_version, installed_version +from + pg_available_extensions +order by + name asc;`, + }, + { + id: 6, + type: 'template', + title: 'Show version', + description: 'Get your Postgres version.', + sql: `select * from + (select version()) as version, + (select current_setting('server_version_num')) as version_number;`, + }, + { + id: 7, + type: 'template', + title: 'Show active connections', + description: 'Get the number of active and max connections.', + sql: `select * from +(select count(pid) as active_connections FROM pg_stat_activity where state = 'active') active_connections, +(select setting as max_connections from pg_settings where name = 'max_connections') max_connections;`, + }, + { + id: 8, + type: 'template', + title: 'Automatically update timestamps', + description: 'Update a column timestamp on every update.', + sql: ` +create extension if not exists moddatetime schema extensions; + +-- assuming the table name is "todos", and a timestamp column "updated_at" +-- this trigger will set the "updated_at" column to the current timestamp for every update +create trigger + handle_updated_at before update +on todos +for each row execute + procedure moddatetime(updated_at); + `.trim(), + }, + { + id: 9, + type: 'template', + title: 'Increment field value', + description: 'Update a field with incrementing value using stored procedure.', + sql: ` +create function increment(row_id int) +returns void as +$$ + update table_name + set field_name = field_name + 1 + where id = row_id; +$$ +language sql volatile; + +-- you can call the function from your browser with supabase-js +-- const { data, error } = await supabase.rpc('increment', { row_id: 2 }) + `.trim(), + }, + { + id: 10, + type: 'template', + title: 'pg_stat_statements report', + description: 'Select from pg_stat_statements and view recent queries', + sql: `-- pg_stat_statements report + +-- A limit of 100 has been added below + +select + auth.rolname, + statements.query, + statements.calls, + -- -- Postgres 13, 14 + statements.total_exec_time + statements.total_plan_time as total_time, + statements.min_exec_time + statements.min_plan_time as min_time, + statements.max_exec_time + statements.max_plan_time as max_time, + statements.mean_exec_time + statements.mean_plan_time as mean_time, + -- -- Postgres <= 12 + -- total_time, + -- min_time, + -- max_time, + -- mean_time, + statements.rows / statements.calls as avg_rows, + statements.wal_bytes, + statements.wal_records + from pg_stat_statements as statements + inner join pg_authid as auth on statements.userid = auth.oid + order by + total_time desc + limit + 100;`, + }, + { + id: 11, + type: 'quickstart', + title: 'Countries', + description: 'Create a table with all the countries in the world.', + sql: `create type public.continents as enum ( + 'Africa', + 'Antarctica', + 'Asia', + 'Europe', + 'Oceania', + 'North America', + 'South America' +); +create table public.countries ( + id bigint generated by default as identity primary key, + name text, + iso2 text not null, + iso3 text, + local_name text, + continent continents +); +comment on table countries is 'Full list of countries.'; +comment on column countries.name is 'Full country name.'; +comment on column countries.iso2 is 'ISO 3166-1 alpha-2 code.'; +comment on column countries.iso3 is 'ISO 3166-1 alpha-3 code.'; +comment on column countries.local_name is 'Local variation of the name.'; +insert into public.countries (name,iso2,iso3,local_name,continent) values + ('Bonaire, Sint Eustatius and Saba','BQ','BES',null,null), + ('Curaçao','CW','CUW',null,null), + ('Guernsey','GG','GGY',null,null), + ('Isle of Man','IM','IMN',null,null), + ('Jersey','JE','JEY',null,null), + ('Åland Islands','AX','ALA',null,null), + ('Montenegro','ME','MNE',null,null), + ('Saint BarthÊlemy','BL','BLM',null,null), + ('Saint Martin (French part)','MF','MAF',null,null), + ('Serbia','RS','SRB',null,null), + ('Sint Maarten (Dutch part)','SX','SXM',null,null), + ('South Sudan','SS','SSD',null,null), + ('Timor-Leste','TL','TLS',null,null), + ('American Samoa','as','ASM','Amerika Samoa','Oceania'), + ('Andorra','AD','AND','Andorra','Europe'), + ('Angola','AO','AGO','Angola','Africa'), + ('Anguilla','AI','AIA','Anguilla','North America'), + ('Antarctica','AQ','ATA','','Antarctica'), + ('Antigua and Barbuda','AG','ATG','Antigua and Barbuda','North America'), + ('Argentina','AR','ARG','Argentina','South America'), + ('Armenia','AM','ARM','Hajastan','Asia'), + ('Aruba','AW','ABW','Aruba','North America'), + ('Australia','AU','AUS','Australia','Oceania'), + ('Austria','AT','AUT','Österreich','Europe'), + ('Azerbaijan','AZ','AZE','Azerbaijan','Asia'), + ('Bahamas','BS','BHS','The Bahamas','North America'), + ('Bahrain','BH','BHR','Al-Bahrayn','Asia'), + ('Bangladesh','BD','BGD','Bangladesh','Asia'), + ('Barbados','BB','BRB','Barbados','North America'), + ('Belarus','BY','BLR','Belarus','Europe'), + ('Belgium','BE','BEL','Belgium/Belgique','Europe'), + ('Belize','BZ','BLZ','Belize','North America'), + ('Benin','BJ','BEN','Benin','Africa'), + ('Bermuda','BM','BMU','Bermuda','North America'), + ('Bhutan','BT','BTN','Druk-Yul','Asia'), + ('Bolivia','BO','BOL','Bolivia','South America'), + ('Bosnia and Herzegovina','BA','BIH','Bosna i Hercegovina','Europe'), + ('Botswana','BW','BWA','Botswana','Africa'), + ('Bouvet Island','BV','BVT','Bouvet Island','Antarctica'), + ('Brazil','BR','BRA','Brasil','South America'), + ('British Indian Ocean Territory','IO','IOT','British Indian Ocean Territory','Africa'), + ('Brunei Darussalam','BN','BRN','Brunei Darussalam','Asia'), + ('Bulgaria','BG','BGR','Balgarija','Europe'), + ('Burkina Faso','BF','BFA','Burkina Faso','Africa'), + ('Burundi','BI','BDI','Burundi/Uburundi','Africa'), + ('Cambodia','KH','KHM','Cambodia','Asia'), + ('Cameroon','CM','CMR','Cameroun/Cameroon','Africa'), + ('Canada','CA','CAN','Canada','North America'), + ('Cape Verde','CV','CPV','Cabo Verde','Africa'), + ('Cayman Islands','KY','CYM','Cayman Islands','North America'), + ('Central African Republic','CF','CAF','Centrafrique','Africa'), + ('Chad','TD','TCD','Tchad/Tshad','Africa'), + ('Chile','CL','CHL','Chile','South America'), + ('China','CN','CHN','Zhongquo','Asia'), + ('Christmas Island','CX','CXR','Christmas Island','Oceania'), + ('Cocos (Keeling) Islands','CC','CCK','Cocos (Keeling) Islands','Oceania'), + ('Colombia','CO','COL','Colombia','South America'), + ('Comoros','KM','COM','Komori/Comores','Africa'), + ('Congo','CG','COG','Congo','Africa'), + ('Congo, the Democratic Republic of the','CD','COD','Republique Democratique du Congo','Africa'), + ('Cook Islands','CK','COK','The Cook Islands','Oceania'), + ('Costa Rica','CR','CRI','Costa Rica','North America'), + ('Cote DIvoire','CI','CIV','Côte dIvoire','Africa'), + ('Croatia','HR','HRV','Hrvatska','Europe'), + ('Cuba','CU','CUB','Cuba','North America'), + ('Cyprus','CY','CYP','Cyprus','Asia'), + ('Czech Republic','CZ','CZE','Czech','Europe'), + ('Denmark','DK','DNK','Danmark','Europe'), + ('Djibouti','DJ','DJI','Djibouti/Jibuti','Africa'), + ('Dominica','DM','DMA','Dominica','North America'), + ('Dominican Republic','DO','DOM','Republica Dominicana','North America'), + ('Ecuador','EC','ECU','Ecuador','South America'), + ('Egypt','EG','EGY','Misr','Africa'), + ('El Salvador','SV','SLV','El Salvador','North America'), + ('Equatorial Guinea','GQ','GNQ','Guinea Ecuatorial','Africa'), + ('Eritrea','ER','ERI','Ertra','Africa'), + ('Estonia','EE','EST','Eesti','Europe'), + ('Ethiopia','ET','ETH','Yeityopiya','Africa'), + ('Falkland Islands (Malvinas)','FK','FLK','Falkland Islands','South America'), + ('Faroe Islands','FO','FRO','Faroe Islands','Europe'), + ('Fiji','FJ','FJI','Fiji Islands','Oceania'), + ('Finland','FI','FIN','Suomi','Europe'), + ('France','FR','FRA','France','Europe'), + ('French Guiana','GF','GUF','Guyane francaise','South America'), + ('French Polynesia','PF','PYF','PolynÊsie française','Oceania'), + ('French Southern Territories','TF','ATF','Terres australes françaises','Antarctica'), + ('Gabon','GA','GAB','Le Gabon','Africa'), + ('Gambia','GM','GMB','The Gambia','Africa'), + ('Georgia','GE','GEO','Sakartvelo','Asia'), + ('Germany','DE','DEU','Deutschland','Europe'), + ('Ghana','GH','GHA','Ghana','Africa'), + ('Gibraltar','GI','GIB','Gibraltar','Europe'), + ('Greece','GR','GRC','Greece','Europe'), + ('Greenland','GL','GRL','Kalaallit Nunaat','North America'), + ('Grenada','GD','GRD','Grenada','North America'), + ('Guadeloupe','GP','GLP','Guadeloupe','North America'), + ('Guam','GU','GUM','Guam','Oceania'), + ('Guatemala','GT','GTM','Guatemala','North America'), + ('Guinea','GN','GIN','Guinea','Africa'), + ('Guinea-Bissau','GW','GNB','Guinea-Bissau','Africa'), + ('Guyana','GY','GUY','Guyana','South America'), + ('Haiti','HT','HTI','Haiti/Dayti','North America'), + ('Heard Island and Mcdonald Islands','HM','HMD','Heard and McDonald Islands','Antarctica'), + ('Holy See (Vatican City State)','VA','VAT','Santa Sede/Città del Vaticano','Europe'), + ('Honduras','HN','HND','Honduras','North America'), + ('Hong Kong','HK','HKG','Xianggang/Hong Kong','Asia'), + ('Hungary','HU','HUN','Hungary','Europe'), + ('Iceland','IS','ISL','Iceland','Europe'), + ('India','IN','IND','Bharat/India','Asia'), + ('Indonesia','ID','IDN','Indonesia','Asia'), + ('Iran, Islamic Republic of','IR','IRN','Iran','Asia'), + ('Iraq','IQ','IRQ','Al-Irāq','Asia'), + ('Ireland','IE','IRL','Ireland','Europe'), + ('Israel','IL','ISR','Yisrael','Asia'), + ('Italy','IT','ITA','Italia','Europe'), + ('Jamaica','JM','JAM','Jamaica','North America'), + ('Japan','JP','JPN','Nihon/Nippon','Asia'), + ('Jordan','JO','JOR','Al-Urdunn','Asia'), + ('Kazakhstan','KZ','KAZ','Qazaqstan','Asia'), + ('Kenya','KE','KEN','Kenya','Africa'), + ('Kiribati','KI','KIR','Kiribati','Oceania'), + ('Korea, Democratic People''s Republic of','KP','PRK','Choson Minjujuui Inmin Konghwaguk (Bukhan)','Asia'), + ('Korea, Republic of','KR','KOR','Taehan-minguk (Namhan)','Asia'), + ('Kuwait','KW','KWT','Al-Kuwayt','Asia'), + ('Kyrgyzstan','KG','KGZ','Kyrgyzstan','Asia'), + ('Lao People''s Democratic Republic','LA','LAO','Lao','Asia'), + ('Latvia','LV','LVA','Latvija','Europe'), + ('Lebanon','LB','LBN','Lubnan','Asia'), + ('Lesotho','LS','LSO','Lesotho','Africa'), + ('Liberia','LR','LBR','Liberia','Africa'), + ('Libya','LY','LBY','Libiya','Africa'), + ('Liechtenstein','LI','LIE','Liechtenstein','Europe'), + ('Lithuania','LT','LTU','Lietuva','Europe'), + ('Luxembourg','LU','LUX','Luxembourg','Europe'), + ('Macao','MO','MAC','Macau/Aomen','Asia'), + ('Macedonia, the Former Yugoslav Republic of','MK','MKD','Makedonija','Europe'), + ('Madagascar','MG','MDG','Madagasikara/Madagascar','Africa'), + ('Malawi','MW','MWI','Malawi','Africa'), + ('Malaysia','MY','MYS','Malaysia','Asia'), + ('Maldives','MV','MDV','Dhivehi Raajje/Maldives','Asia'), + ('Mali','ML','MLI','Mali','Africa'), + ('Malta','MT','MLT','Malta','Europe'), + ('Marshall Islands','MH','MHL','Marshall Islands/Majol','Oceania'), + ('Martinique','MQ','MTQ','Martinique','North America'), + ('Mauritania','MR','MRT','Muritaniya/Mauritanie','Africa'), + ('Mauritius','MU','MUS','Mauritius','Africa'), + ('Mayotte','YT','MYT','Mayotte','Africa'), + ('Mexico','MX','MEX','Mexico','North America'), + ('Micronesia, Federated States of','FM','FSM','Micronesia','Oceania'), + ('Moldova, Republic of','MD','MDA','Moldova','Europe'), + ('Monaco','MC','MCO','Monaco','Europe'), + ('Mongolia','MN','MNG','Mongol Uls','Asia'), + ('Albania','AL','ALB','Republika e ShqipÃĢrisÃĢ','Europe'), + ('Montserrat','MS','MSR','Montserrat','North America'), + ('Morocco','MA','MAR','Al-Maghrib','Africa'), + ('Mozambique','MZ','MOZ','Mozambique','Africa'), + ('Myanmar','MM','MMR','Myanma Pye','Asia'), + ('Namibia','NA','NAM','Namibia','Africa'), + ('Nauru','NR','NRU','Naoero/Nauru','Oceania'), + ('Nepal','NP','NPL','Nepal','Asia'), + ('Netherlands','NL','NLD','Nederland','Europe'), + ('New Caledonia','NC','NCL','Nouvelle-CalÊdonie','Oceania'), + ('New Zealand','NZ','NZL','New Zealand/Aotearoa','Oceania'), + ('Nicaragua','NI','NIC','Nicaragua','North America'), + ('Niger','NE','NER','Niger','Africa'), + ('Nigeria','NG','NGA','Nigeria','Africa'), + ('Niue','NU','NIU','Niue','Oceania'), + ('Norfolk Island','NF','NFK','Norfolk Island','Oceania'), + ('Northern Mariana Islands','MP','MNP','Northern Mariana Islands','Oceania'), + ('Norway','NO','NOR','Norge','Europe'), + ('Oman','OM','OMN','Oman','Asia'), + ('Pakistan','PK','PAK','Pakistan','Asia'), + ('Palau','PW','PLW','Belau/Palau','Oceania'), + ('Palestine, State of','PS','PSE','Filastin','Asia'), + ('Panama','PA','PAN','RepÃēblica de PanamÃĄ','North America'), + ('Papua New Guinea','PG','PNG','Papua New Guinea/Papua Niugini','Oceania'), + ('Paraguay','PY','PRY','Paraguay','South America'), + ('Peru','PE','PER','PerÃē/Piruw','South America'), + ('Philippines','PH','PHL','Pilipinas','Asia'), + ('Pitcairn','PN','PCN','Pitcairn','Oceania'), + ('Poland','PL','POL','Polska','Europe'), + ('Portugal','PT','PRT','Portugal','Europe'), + ('Puerto Rico','PR','PRI','Puerto Rico','North America'), + ('Qatar','QA','QAT','Qatar','Asia'), + ('Reunion','RE','REU','Reunion','Africa'), + ('Romania','RO','ROM','Romania','Europe'), + ('Russian Federation','RU','RUS','Rossija','Europe'), + ('Rwanda','RW','RWA','Rwanda/Urwanda','Africa'), + ('Saint Helena, Ascension and Tristan da Cunha','SH','SHN','Saint Helena','Africa'), + ('Saint Kitts and Nevis','KN','KNA','Saint Kitts and Nevis','North America'), + ('Saint Lucia','LC','LCA','Saint Lucia','North America'), + ('Saint Pierre and Miquelon','PM','SPM','Saint-Pierre-et-Miquelon','North America'), + ('Saint Vincent and the Grenadines','VC','VCT','Saint Vincent and the Grenadines','North America'), + ('Samoa','WS','WSM','Samoa','Oceania'), + ('San Marino','SM','SMR','San Marino','Europe'), + ('Sao Tome and Principe','ST','STP','SÃŖo TomÊ e Príncipe','Africa'), + ('Saudi Arabia','SA','SAU','Al-Mamlaka al-Arabiya as-Saudiya','Asia'), + ('Senegal','SN','SEN','SÊnÊgal/Sounougal','Africa'), + ('Seychelles','SC','SYC','Sesel/Seychelles','Africa'), + ('Sierra Leone','SL','SLE','Sierra Leone','Africa'), + ('Singapore','SG','SGP','Singapore/Singapura/Xinjiapo/Singapur','Asia'), + ('Slovakia','SK','SVK','Slovensko','Europe'), + ('Slovenia','SI','SVN','Slovenija','Europe'), + ('Solomon Islands','SB','SLB','Solomon Islands','Oceania'), + ('Somalia','SO','SOM','Soomaaliya','Africa'), + ('South Africa','ZA','ZAF','South Africa','Africa'), + ('South Georgia and the South Sandwich Islands','GS','SGS','South Georgia and the South Sandwich Islands','Antarctica'), + ('Spain','ES','ESP','EspaÃąa','Europe'), + ('Sri Lanka','LK','LKA','Sri Lanka/Ilankai','Asia'), + ('Sudan','SD','SDN','As-Sudan','Africa'), + ('Suriname','SR','SUR','Suriname','South America'), + ('Svalbard and Jan Mayen','SJ','SJM','Svalbard og Jan Mayen','Europe'), + ('Swaziland','SZ','SWZ','kaNgwane','Africa'), + ('Sweden','SE','SWE','Sverige','Europe'), + ('Switzerland','CH','CHE','Schweiz/Suisse/Svizzera/Svizra','Europe'), + ('Syrian Arab Republic','SY','SYR','Suriya','Asia'), + ('Taiwan (Province of China)','TW','TWN','Tai-wan','Asia'), + ('Tajikistan','TJ','TJK','Tajikistan','Asia'), + ('Tanzania, United Republic of','TZ','TZA','Tanzania','Africa'), + ('Thailand','TH','THA','Prathet Thai','Asia'), + ('Togo','TG','TGO','Togo','Africa'), + ('Tokelau','TK','TKL','Tokelau','Oceania'), + ('Tonga','TO','TON','Tonga','Oceania'), + ('Trinidad and Tobago','TT','TTO','Trinidad and Tobago','North America'), + ('Tunisia','TN','TUN','Tunis/Tunisie','Africa'), + ('Turkey','TR','TUR','TÃŧrkiye','Asia'), + ('Turkmenistan','TM','TKM','TÃŧrkmenistan','Asia'), + ('Turks and Caicos Islands','TC','TCA','The Turks and Caicos Islands','North America'), + ('Tuvalu','TV','TUV','Tuvalu','Oceania'), + ('Uganda','UG','UGA','Uganda','Africa'), + ('Ukraine','UA','UKR','Ukrajina','Europe'), + ('United Arab Emirates','AE','ARE','Al-Amirat al-Arabiya al-Muttahida','Asia'), + ('United Kingdom','GB','GBR','United Kingdom','Europe'), + ('United States','US','USA','United States','North America'), + ('United States Minor Outlying Islands','UM','UMI','United States Minor Outlying Islands','Oceania'), + ('Uruguay','UY','URY','Uruguay','South America'), + ('Uzbekistan','UZ','UZB','Uzbekiston','Asia'), + ('Vanuatu','VU','VUT','Vanuatu','Oceania'), + ('Venezuela','VE','VEN','Venezuela','South America'), + ('Viet Nam','VN','VNM','Viet Nam','Asia'), + ('Virgin Islands (British)','VG','VGB','British Virgin Islands','North America'), + ('Virgin Islands (U.S.)','VI','VIR','Virgin Islands of the United States','North America'), + ('Wallis and Futuna','WF','WLF','Wallis-et-Futuna','Oceania'), + ('Western Sahara','EH','ESH','As-Sahrawiya','Africa'), + ('Yemen','YE','YEM','Al-Yaman','Asia'), + ('Zambia','ZM','ZMB','Zambia','Africa'), + ('Zimbabwe','ZW','ZWE','Zimbabwe','Africa'), + ('Afghanistan','AF','AFG','Afganistan/Afqanestan','Asia'), + ('Algeria','DZ','DZA','Al-Jazair/Algerie','Africa'); +`.trim(), + }, + { + id: 12, + type: 'quickstart', + title: 'Slack Clone', + description: 'Build a basic slack clone with Row Level Security.', + sql: ` +-- +-- For use with https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone + +-- Custom types +create type public.app_permission as enum ('channels.delete', 'messages.delete'); +create type public.app_role as enum ('admin', 'moderator'); +create type public.user_status as enum ('ONLINE', 'OFFLINE'); + +-- USERS +create table public.users ( + id uuid not null primary key, -- UUID from auth.users + username text, + status user_status default 'OFFLINE'::public.user_status +); +comment on table public.users is 'Profile data for each user.'; +comment on column public.users.id is 'References the internal Supabase Auth user.'; + +-- CHANNELS +create table public.channels ( + id bigint generated by default as identity primary key, + inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, + slug text not null unique, + created_by uuid references public.users not null +); +comment on table public.channels is 'Topics and groups.'; + +-- MESSAGES +create table public.messages ( + id bigint generated by default as identity primary key, + inserted_at timestamp with time zone default timezone('utc'::text, now()) not null, + message text, + user_id uuid references public.users not null, + channel_id bigint references public.channels on delete cascade not null +); +comment on table public.messages is 'Individual messages sent by each user.'; + +-- USER ROLES +create table public.user_roles ( + id bigint generated by default as identity primary key, + user_id uuid references public.users on delete cascade not null, + role app_role not null, + unique (user_id, role) +); +comment on table public.user_roles is 'Application roles for each user.'; + +-- ROLE PERMISSIONS +create table public.role_permissions ( + id bigint generated by default as identity primary key, + role app_role not null, + permission app_permission not null, + unique (role, permission) +); +comment on table public.role_permissions is 'Application permissions for each role.'; + +-- authorize with role-based access control (RBAC) +create function public.authorize( + requested_permission app_permission, + user_id uuid +) +returns boolean as +$$ + declare + bind_permissions int; + begin + select + count(*) + from public.role_permissions + inner join public.user_roles on role_permissions.role = user_roles.role + where + role_permissions.permission = authorize.requested_permission and + user_roles.user_id = authorize.user_id + into bind_permissions; + + return bind_permissions > 0; + end; +$$ +language plpgsql security definer; + +-- Secure the tables +alter table public.users + enable row level security; +alter table public.channels + enable row level security; +alter table public.messages + enable row level security; +alter table public.user_roles + enable row level security; +alter table public.role_permissions + enable row level security; + +create policy "Allow logged-in read access" on public.users + for select using (auth.role() = 'authenticated'); +create policy "Allow individual insert access" on public.users + for insert with check (auth.uid() = id); +create policy "Allow individual update access" on public.users + for update using ( auth.uid() = id ); +create policy "Allow logged-in read access" on public.channels + for select using (auth.role() = 'authenticated'); +create policy "Allow individual insert access" on public.channels + for insert with check (auth.uid() = created_by); +create policy "Allow individual delete access" on public.channels + for delete using (auth.uid() = created_by); +create policy "Allow authorized delete access" on public.channels + for delete using (authorize('channels.delete', auth.uid())); +create policy "Allow logged-in read access" on public.messages + for select using (auth.role() = 'authenticated'); +create policy "Allow individual insert access" on public.messages + for insert with check (auth.uid() = user_id); +create policy "Allow individual update access" on public.messages + for update using (auth.uid() = user_id); +create policy "Allow individual delete access" on public.messages + for delete using (auth.uid() = user_id); +create policy "Allow authorized delete access" on public.messages + for delete using (authorize('messages.delete', auth.uid())); +create policy "Allow individual read access" on public.user_roles + for select using (auth.uid() = user_id); + +-- Send "previous data" on change +alter table public.users + replica identity full; +alter table public.channels + replica identity full; +alter table public.messages + replica identity full; + +-- inserts a row into public.users and assigns roles +create function public.handle_new_user() +returns trigger as +$$ + declare is_admin boolean; + begin + insert into public.users (id, username) + values (new.id, new.email); + + select count(*) = 1 from auth.users into is_admin; + + if position('+supaadmin@' in new.email) > 0 then + insert into public.user_roles (user_id, role) values (new.id, 'admin'); + elsif position('+supamod@' in new.email) > 0 then + insert into public.user_roles (user_id, role) values (new.id, 'moderator'); + end if; + + return new; + end; +$$ language plpgsql security definer; + +-- trigger the function every time a user is created +create trigger on_auth_user_created + after insert on auth.users + for each row execute procedure public.handle_new_user(); + +/** + * REALTIME SUBSCRIPTIONS + * Only allow realtime listening on public tables. + */ + +begin; + -- remove the realtime publication + drop publication if exists supabase_realtime; + + -- re-create the publication but don't enable it for any tables + create publication supabase_realtime; +commit; + +-- add tables to the publication +alter publication supabase_realtime add table public.channels; +alter publication supabase_realtime add table public.messages; +alter publication supabase_realtime add table public.users; + +-- DUMMY DATA +insert into public.users (id, username) +values + ('8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e', 'supabot'); + +insert into public.channels (slug, created_by) +values + ('public', '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'), + ('random', '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'); + +insert into public.messages (message, channel_id, user_id) +values + ('Hello World 👋', 1, '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'), + ('Perfection is attained, not when there is nothing more to add, but when there is nothing left to take away.', 2, '8d0fd2b3-9ca7-4d9e-a95f-9e13dded323e'); + +insert into public.role_permissions (role, permission) +values + ('admin', 'channels.delete'), + ('admin', 'messages.delete'), + ('moderator', 'messages.delete'); +`.trim(), + }, + { + id: 13, + type: 'quickstart', + title: 'Todo List', + description: 'Build a basic todo list with Row Level Security.', + sql: ` +-- +-- For use with: +-- https://github.com/supabase/supabase/tree/master/examples/todo-list/sveltejs-todo-list or +-- https://github.com/supabase/examples-archive/tree/main/supabase-js-v1/todo-list +-- + +create table todos ( + id bigint generated by default as identity primary key, + user_id uuid references auth.users not null, + task text check (char_length(task) > 3), + is_complete boolean default false, + inserted_at timestamp with time zone default timezone('utc'::text, now()) not null +); +alter table todos enable row level security; +create policy "Individuals can create todos." on todos for + insert with check (auth.uid() = user_id); +create policy "Individuals can view their own todos. " on todos for + select using (auth.uid() = user_id); +create policy "Individuals can update their own todos." on todos for + update using (auth.uid() = user_id); +create policy "Individuals can delete their own todos." on todos for + delete using (auth.uid() = user_id); +`.trim(), + }, + { + id: 14, + type: 'quickstart', + title: 'Stripe Subscriptions', + description: 'Starter template for the Next.js Stripe Subscriptions Starter.', + sql: ` +/** +* USERS +* Note: This table contains user data. Users should only be able to view and update their own data. +*/ +create table users ( + -- UUID from auth.users + id uuid references auth.users not null primary key, + full_name text, + avatar_url text, + -- The customer's billing address, stored in JSON format. + billing_address jsonb, + -- Stores your customer's payment instruments. + payment_method jsonb +); +alter table users + enable row level security; +create policy "Can view own user data." on users + for select using (auth.uid() = id); +create policy "Can update own user data." on users + for update using (auth.uid() = id); + +/** +* This trigger automatically creates a user entry when a new user signs up via Supabase Auth. +*/ +create function public.handle_new_user() +returns trigger as +$$ + begin + insert into public.users (id, full_name, avatar_url) + values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url'); + return new; + end; +$$ +language plpgsql security definer; + +create trigger on_auth_user_created + after insert on auth.users + for each row + execute procedure public.handle_new_user(); + +/** +* CUSTOMERS +* Note: this is a private table that contains a mapping of user IDs to Strip customer IDs. +*/ +create table customers ( + -- UUID from auth.users + id uuid references auth.users not null primary key, + -- The user's customer ID in Stripe. User must not be able to update this. + stripe_customer_id text +); +alter table customers enable row level security; +-- No policies as this is a private table that the user must not have access to. + +/** +* PRODUCTS +* Note: products are created and managed in Stripe and synced to our DB via Stripe webhooks. +*/ +create table products ( + -- Product ID from Stripe, e.g. prod_1234. + id text primary key, + -- Whether the product is currently available for purchase. + active boolean, + -- The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions. + name text, + -- The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + description text, + -- A URL of the product image in Stripe, meant to be displayable to the customer. + image text, + -- Set of key-value pairs, used to store additional information about the object in a structured format. + metadata jsonb +); +alter table products + enable row level security; +create policy "Allow public read-only access." on products + for select using (true); + +/** +* PRICES +* Note: prices are created and managed in Stripe and synced to our DB via Stripe webhooks. +*/ +create type pricing_type as enum ('one_time', 'recurring'); +create type pricing_plan_interval as enum ('day', 'week', 'month', 'year'); +create table prices ( + -- Price ID from Stripe, e.g. price_1234. + id text primary key, + -- The ID of the prduct that this price belongs to. + product_id text references products, + -- Whether the price can be used for new purchases. + active boolean, + -- A brief description of the price. + description text, + -- The unit amount as a positive integer in the smallest currency unit (e.g., 100 cents for US$1.00 or 100 for ÂĨ100, a zero-decimal currency). + unit_amount bigint, + -- Three-letter ISO currency code, in lowercase. + currency text check (char_length(currency) = 3), + -- One of \`one_time\` or \`recurring\` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + type pricing_type, + -- The frequency at which a subscription is billed. One of \`day\`, \`week\`, \`month\` or \`year\`. + interval pricing_plan_interval, + -- The number of intervals (specified in the \`interval\` attribute) between subscription billings. For example, \`interval=month\` and \`interval_count=3\` bills every 3 months. + interval_count integer, + -- Default number of trial days when subscribing a customer to this price using [\`trial_from_plan=true\`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + trial_period_days integer, + -- Set of key-value pairs, used to store additional information about the object in a structured format. + metadata jsonb +); +alter table prices + enable row level security; +create policy "Allow public read-only access." on prices + for select using (true); + +/** +* SUBSCRIPTIONS +* Note: subscriptions are created and managed in Stripe and synced to our DB via Stripe webhooks. +*/ +create type subscription_status as enum ('trialing', 'active', 'canceled', 'incomplete', 'incomplete_expired', 'past_due', 'unpaid'); +create table subscriptions ( + -- Subscription ID from Stripe, e.g. sub_1234. + id text primary key, + user_id uuid references auth.users not null, + -- The status of the subscription object, one of subscription_status type above. + status subscription_status, + -- Set of key-value pairs, used to store additional information about the object in a structured format. + metadata jsonb, + -- ID of the price that created this subscription. + price_id text references prices, + -- Quantity multiplied by the unit amount of the price creates the amount of the subscription. Can be used to charge multiple seats. + quantity integer, + -- If true the subscription has been canceled by the user and will be deleted at the end of the billing period. + cancel_at_period_end boolean, + -- Time at which the subscription was created. + created timestamp with time zone default timezone('utc'::text, now()) not null, + -- Start of the current period that the subscription has been invoiced for. + current_period_start timestamp with time zone default timezone('utc'::text, now()) not null, + -- End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. + current_period_end timestamp with time zone default timezone('utc'::text, now()) not null, + -- If the subscription has ended, the timestamp of the date the subscription ended. + ended_at timestamp with time zone default timezone('utc'::text, now()), + -- A date in the future at which the subscription will automatically get canceled. + cancel_at timestamp with time zone default timezone('utc'::text, now()), + -- If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with \`cancel_at_period_end\`, \`canceled_at\` will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state. + canceled_at timestamp with time zone default timezone('utc'::text, now()), + -- If the subscription has a trial, the beginning of that trial. + trial_start timestamp with time zone default timezone('utc'::text, now()), + -- If the subscription has a trial, the end of that trial. + trial_end timestamp with time zone default timezone('utc'::text, now()) +); +alter table subscriptions + enable row level security; +create policy "Can only view own subs data." on subscriptions + for select using (auth.uid() = user_id); + +/** + * REALTIME SUBSCRIPTIONS + * Only allow realtime listening on public tables. + */ +drop publication if exists supabase_realtime; +create publication supabase_realtime + for table products, prices; +`.trim(), + }, + { + id: 15, + type: 'quickstart', + title: 'User Management Starter', + description: 'Sets up a public Profiles table which you can access with your API.', + sql: ` +-- Create a table for public profiles +create table profiles ( + id uuid references auth.users on delete cascade not null primary key, + updated_at timestamp with time zone, + username text unique, + full_name text, + avatar_url text, + website text, + + constraint username_length check (char_length(username) >= 3) +); +-- Set up Row Level Security (RLS) +-- See https://supabase.com/docs/guides/auth/row-level-security for more details. +alter table profiles + enable row level security; + +create policy "Public profiles are viewable by everyone." on profiles + for select using (true); + +create policy "Users can insert their own profile." on profiles + for insert with check (auth.uid() = id); + +create policy "Users can update own profile." on profiles + for update using (auth.uid() = id); + +-- This trigger automatically creates a profile entry when a new user signs up via Supabase Auth. +-- See https://supabase.com/docs/guides/auth/managing-user-data#using-triggers for more details. +create function public.handle_new_user() +returns trigger as $$ +begin + insert into public.profiles (id, full_name, avatar_url) + values (new.id, new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url'); + return new; +end; +$$ language plpgsql security definer; +create trigger on_auth_user_created + after insert on auth.users + for each row execute procedure public.handle_new_user(); + +-- Set up Storage! +insert into storage.buckets (id, name) + values ('avatars', 'avatars'); + +-- Set up access controls for storage. +-- See https://supabase.com/docs/guides/storage#policy-examples for more details. +create policy "Avatar images are publicly accessible." on storage.objects + for select using (bucket_id = 'avatars'); + +create policy "Anyone can upload an avatar." on storage.objects + for insert with check (bucket_id = 'avatars'); +`.trim(), + }, + { + id: 16, + type: 'quickstart', + title: 'NextAuth Schema Setup', + description: 'Sets up a the Schema and Tables for the NextAuth Supabase Adapter.', + sql: ` +-- +-- Name: next_auth; Type: SCHEMA; +-- +CREATE SCHEMA next_auth; + +GRANT USAGE ON SCHEMA next_auth TO service_role; +GRANT ALL ON SCHEMA next_auth TO postgres; + +-- +-- Create users table +-- +CREATE TABLE IF NOT EXISTS next_auth.users +( + id uuid NOT NULL DEFAULT gen_random_uuid(), + name text, + email text, + "emailVerified" timestamp with time zone, + image text, + CONSTRAINT users_pkey PRIMARY KEY (id), + CONSTRAINT email_unique UNIQUE (email) +); + +GRANT ALL ON TABLE next_auth.users TO postgres; +GRANT ALL ON TABLE next_auth.users TO service_role; + +--- uid() function to be used in RLS policies +CREATE FUNCTION next_auth.uid() RETURNS uuid + LANGUAGE sql STABLE + AS $$ + select + coalesce( + nullif(current_setting('request.jwt.claim.sub', true), ''), + (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'sub') + )::uuid +$$; + +-- +-- Create sessions table +-- +CREATE TABLE IF NOT EXISTS next_auth.sessions +( + id uuid NOT NULL DEFAULT gen_random_uuid(), + expires timestamp with time zone NOT NULL, + "sessionToken" text NOT NULL, + "userId" uuid, + CONSTRAINT sessions_pkey PRIMARY KEY (id), + CONSTRAINT sessionToken_unique UNIQUE ("sessionToken"), + CONSTRAINT "sessions_userId_fkey" FOREIGN KEY ("userId") + REFERENCES next_auth.users (id) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE CASCADE +); + +GRANT ALL ON TABLE next_auth.sessions TO postgres; +GRANT ALL ON TABLE next_auth.sessions TO service_role; + +-- +-- Create accounts table +-- +CREATE TABLE IF NOT EXISTS next_auth.accounts +( + id uuid NOT NULL DEFAULT gen_random_uuid(), + type text NOT NULL, + provider text NOT NULL, + "providerAccountId" text NOT NULL, + refresh_token text, + access_token text, + expires_at bigint, + token_type text, + scope text, + id_token text, + session_state text, + oauth_token_secret text, + oauth_token text, + "userId" uuid, + CONSTRAINT accounts_pkey PRIMARY KEY (id), + CONSTRAINT provider_unique UNIQUE (provider, "providerAccountId"), + CONSTRAINT "accounts_userId_fkey" FOREIGN KEY ("userId") + REFERENCES next_auth.users (id) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE CASCADE +); + +GRANT ALL ON TABLE next_auth.accounts TO postgres; +GRANT ALL ON TABLE next_auth.accounts TO service_role; + +-- +-- Create verification_tokens table +-- +CREATE TABLE IF NOT EXISTS next_auth.verification_tokens +( + identifier text, + token text, + expires timestamp with time zone NOT NULL, + CONSTRAINT verification_tokens_pkey PRIMARY KEY (token), + CONSTRAINT token_unique UNIQUE (token), + CONSTRAINT token_identifier_unique UNIQUE (token, identifier) +); + +GRANT ALL ON TABLE next_auth.verification_tokens TO postgres; +GRANT ALL ON TABLE next_auth.verification_tokens TO service_role; +`.trim(), + }, + { + id: 17, + type: 'template', + title: 'Most frequently invoked', + description: 'Most frequently called queries in your database.', + sql: `-- Most frequently called queries + +-- A limit of 100 has been added below + +select + auth.rolname, + statements.query, + statements.calls, + -- -- Postgres 13, 14, 15 + statements.total_exec_time + statements.total_plan_time as total_time, + statements.min_exec_time + statements.min_plan_time as min_time, + statements.max_exec_time + statements.max_plan_time as max_time, + statements.mean_exec_time + statements.mean_plan_time as mean_time, + -- -- Postgres <= 12 + -- total_time, + -- min_time, + -- max_time, + -- mean_time, + statements.rows / statements.calls as avg_rows + + from pg_stat_statements as statements + inner join pg_authid as auth on statements.userid = auth.oid + order by + statements.calls desc + limit + 100;`, + }, + { + id: 18, + type: 'template', + title: 'Most time consuming', + description: 'Aggregate time spent on a query type.', + sql: `-- Most time consuming queries + +-- A limit of 100 has been added below + +select + auth.rolname, + statements.query, + statements.calls, + statements.total_exec_time + statements.total_plan_time as total_time, + to_char(((statements.total_exec_time + statements.total_plan_time)/sum(statements.total_exec_time + statements.total_plan_time) over()) * 100, 'FM90D0') || '%' as prop_total_time + from pg_stat_statements as statements + inner join pg_authid as auth on statements.userid = auth.oid + order by + total_time desc + limit + 100;`, + }, + { + id: 19, + type: 'template', + title: 'Slowest execution time', + description: 'Slowest queries based on max execution time.', + sql: `-- Slowest queries by max execution time + +-- A limit of 100 has been added below + +select + auth.rolname, + statements.query, + statements.calls, + -- -- Postgres 13, 14, 15 + statements.total_exec_time + statements.total_plan_time as total_time, + statements.min_exec_time + statements.min_plan_time as min_time, + statements.max_exec_time + statements.max_plan_time as max_time, + statements.mean_exec_time + statements.mean_plan_time as mean_time, + -- -- Postgres <= 12 + -- total_time, + -- min_time, + -- max_time, + -- mean_time, + statements.rows / statements.calls as avg_rows + from pg_stat_statements as statements + inner join pg_authid as auth on statements.userid = auth.oid + order by + max_time desc + limit + 100;`, + }, + { + id: 20, + type: 'template', + title: 'Hit rate', + description: 'See your cache and index hit rate.', + sql: `-- Cache and index hit rate + +select + 'index hit rate' as name, + (sum(idx_blks_hit)) / nullif(sum(idx_blks_hit + idx_blks_read),0) as ratio + from pg_statio_user_indexes + union all + select + 'table hit rate' as name, + sum(heap_blks_hit) / nullif(sum(heap_blks_hit) + sum(heap_blks_read),0) as ratio + from pg_statio_user_tables;`, + }, + { + id: 21, + type: 'quickstart', + title: 'OpenAI Vector Search', + description: 'Template for the Next.js OpenAI Doc Search Starter.', + sql: ` +-- Enable pg_vector extension +create extension if not exists vector with schema public; + +-- Create tables +create table "public"."nods_page" ( + id bigserial primary key, + parent_page_id bigint references public.nods_page, + path text not null unique, + checksum text, + meta jsonb, + type text, + source text +); +alter table "public"."nods_page" enable row level security; + +create table "public"."nods_page_section" ( + id bigserial primary key, + page_id bigint not null references public.nods_page on delete cascade, + content text, + token_count int, + embedding vector(1536), + slug text, + heading text +); +alter table "public"."nods_page_section" enable row level security; + +-- Create embedding similarity search functions +create or replace function match_page_sections(embedding vector(1536), match_threshold float, match_count int, min_content_length int) +returns table (id bigint, page_id bigint, slug text, heading text, content text, similarity float) +language plpgsql +as $$ +#variable_conflict use_variable +begin + return query + select + nods_page_section.id, + nods_page_section.page_id, + nods_page_section.slug, + nods_page_section.heading, + nods_page_section.content, + (nods_page_section.embedding <#> embedding) * -1 as similarity + from nods_page_section + + -- We only care about sections that have a useful amount of content + where length(nods_page_section.content) >= min_content_length + + -- The dot product is negative because of a Postgres limitation, so we negate it + and (nods_page_section.embedding <#> embedding) * -1 > match_threshold + + -- OpenAI embeddings are normalized to length 1, so + -- cosine similarity and dot product will produce the same results. + -- Using dot product which can be computed slightly faster. + -- + -- For the different syntaxes, see https://github.com/pgvector/pgvector + order by nods_page_section.embedding <#> embedding + + limit match_count; +end; +$$; + +create or replace function get_page_parents(page_id bigint) +returns table (id bigint, parent_page_id bigint, path text, meta jsonb) +language sql +as $$ + with recursive chain as ( + select * + from nods_page + where id = page_id + + union all + + select child.* + from nods_page as child + join chain on chain.parent_page_id = child.id + ) + select id, parent_page_id, path, meta + from chain; +$$; +`.trim(), + }, + { + id: 22, + type: 'template', + title: 'Replication status report', + description: 'See the status of your replication slots and replication lag.', + sql: `-- Replication status report + +SELECT + s.slot_name, + s.active, + COALESCE(r.state, 'N/A') as state, + COALESCE(r.client_addr, null) as replication_client_address, + GREATEST(0, ROUND((redo_lsn-restart_lsn)/1024/1024/1024, 2)) as replication_lag_gb +FROM pg_control_checkpoint(), pg_replication_slots s +LEFT JOIN pg_stat_replication r ON (r.pid = s.active_pid); +`, + }, + { + id: 23, + type: 'quickstart', + title: 'LangChain', + description: 'LangChain is a popular framework for working with AI, Vectors, and embeddings.', + sql: ` +-- Enable the pgvector extension to work with embedding vectors +create extension vector; + +-- Create a table to store your documents +create table documents ( + id bigserial primary key, + content text, -- corresponds to Document.pageContent + metadata jsonb, -- corresponds to Document.metadata + embedding vector(1536) -- 1536 works for OpenAI embeddings, change if needed +); + +-- Create a function to search for documents +create function match_documents ( + query_embedding vector(1536), + match_count int default null, + filter jsonb DEFAULT '{}' +) returns table ( + id bigint, + content text, + metadata jsonb, + similarity float +) +language plpgsql +as $$ +#variable_conflict use_column +begin + return query + select + id, + content, + metadata, + 1 - (documents.embedding <=> query_embedding) as similarity + from documents + where metadata @> filter + order by documents.embedding <=> query_embedding + limit match_count; +end; +$$; +`.trim(), + }, + { + id: 24, + type: 'template', + title: 'Install dbdev', + description: 'dbdev is a client for installing 3rd party packages into your database.', + sql: ` +create extension if not exists http with schema extensions; +create extension if not exists pg_tle; +select pgtle.uninstall_extension_if_exists('supabase-dbdev'); +drop extension if exists "supabase-dbdev"; +select + pgtle.install_extension( + 'supabase-dbdev', + resp.contents ->> 'version', + 'PostgreSQL package manager', + resp.contents ->> 'sql' + ) +from http( + ( + 'GET', + 'https://api.database.dev/rest/v1/' + || 'package_versions?select=sql,version' + || '&package_name=eq.supabase-dbdev' + || '&order=version.desc' + || '&limit=1', + array[ + ('apiKey', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhtdXB0cHBsZnZpaWZyYndtbXR2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODAxMDczNzIsImV4cCI6MTk5NTY4MzM3Mn0.z2CN0mvO2No8wSi46Gw59DFGCTJrzM0AQKsu_5k134s')::http_header + ], + null, + null + ) +) x, +lateral ( + select + ((row_to_json(x) -> 'content') #>> '{}')::json -> 0 +) resp(contents); +create extension "supabase-dbdev"; +select dbdev.install('supabase-dbdev'); +drop extension if exists "supabase-dbdev"; +create extension "supabase-dbdev"; +`.trim(), + }, + { + id: 25, + type: 'template', + title: 'Large objects', + description: 'List large objects (tables/indexes) in your database.', + sql: `SELECT + SCHEMA_NAME, + relname, + table_size + FROM + (SELECT + pg_catalog.pg_namespace.nspname AS SCHEMA_NAME, + relname, + pg_relation_size(pg_catalog.pg_class.oid) AS table_size + FROM pg_catalog.pg_class + JOIN pg_catalog.pg_namespace ON relnamespace = pg_catalog.pg_namespace.oid + ) t + WHERE SCHEMA_NAME NOT LIKE 'pg_%' + ORDER BY table_size DESC + LIMIT 25`.trim(), + }, + { + id: 26, + type: 'template', + title: 'Limit MFA verification attempts to one in 2 seconds', + description: + 'Create an Auth hook that limits the number of failed MFA verification attempts to one in 2 seconds.', + sql: ` +create function public.hook_mfa_verification_attempt(event jsonb) + returns jsonb + language plpgsql +as $$ + declare + last_failed_at timestamp; + begin + if event->'valid' is true then + -- code is valid, accept it + return jsonb_build_object('decision', 'continue'); + end if; + + select last_failed_at into last_failed_at + from public.mfa_failed_verification_attempts + where + user_id = (event->'user_id')::uuid + and + factor_id = event->'factor_id'; + + if last_failed_at is not null and now() - last_failed_at < interval '2 seconds' then + -- last attempt was done too quickly + return jsonb_build_object( + 'error', jsonb_build_object( + 'http_code', 429, + 'message', 'Please wait a moment before trying again.' + ) + ); + end if; + + -- record this failed attempt + insert into public.mfa_failed_verification_attempts + ( + user_id, + factor_id, + last_refreshed_at + ) + values + ( + event->'user_id', + event->'factor_id', + now() + ) + on conflict do update + set last_refreshed_at = now(); + + -- finally let Supabase Auth do the default behavior for a failed attempt + return jsonb_build_object('decision', 'continue'); + end; +$$; + +-- Assign appropriate permissions and revoke access +grant execute + on function public.hook_mfa_verification_attempt + to supabase_auth_admin; + +grant all + on table public.mfa_failed_verification_attempts + to supabase_auth_admin; + +revoke execute + on function public.hook_mfa_verification_attempt + from authenticated, anon; + +revoke all + on table public.mfa_failed_verification_attempts + from authenticated, anon; + +grant usage on schema public to supabase_auth_admin;`.trim(), + }, + { + id: 27, + type: 'template', + title: 'Add Auth Hook (Password Verification Attempt)', + description: + 'Create an Auth Hook that limits number of failed password verification attempts to one in 10 seconds', + sql: ` +create function public.hook_password_verification_attempt(event jsonb) +returns jsonb +language plpgsql +as $$ + declare + last_failed_at timestamp; + begin + if event->'valid' is true then + -- password is valid, accept it + return jsonb_build_object('decision', 'continue'); + end if; + + select last_failed_at into last_failed_at + from public.password_failed_verification_attempts + where + user_id = (event->'user_id')::uuid; + + if last_failed_at is not null and now() - last_failed_at < interval '10 seconds' then + -- last attempt was done too quickly + return jsonb_build_object( + 'error', jsonb_build_object( + 'http_code', 429, + 'message', 'Please wait a moment before trying again.' + ) + ); + end if; + + -- record this failed attempt + insert into public.password_failed_verification_attempts + ( + user_id, + last_failed_at + ) + values + ( + event->'user_id', + now() + ) + on conflict do update + set last_failed_at = now(); + + -- finally let Supabase Auth do the default behavior for a failed attempt + return jsonb_build_object('decision', 'continue'); + end; +$$; + +-- Assign appropriate permissions +grant execute + on function public.hook_password_verification_attempt + to supabase_auth_admin; + +grant all + on table public.password_failed_verification_attempts + to supabase_auth_admin; + +revoke execute + on function public.hook_password_verification_attempt + from authenticated, anon; + +revoke all + on table public.password_failed_verification_attempts + from authenticated, anon; + +grant usage on schema public to supabase_auth_admin;`.trim(), + }, + { + id: 28, + type: 'template', + title: 'Add Auth Hook (Custom Access Token)', + description: 'Create an Auth Hook to add custom claims to your Auth Token', + sql: ` +-- Assumes that there is an is_admin flag on the profiles table. +create or replace function public.custom_access_token_hook(event jsonb) +returns jsonb +language plpgsql +as $$ + declare + claims jsonb; + is_admin boolean; + begin + -- Check if the user is marked as admin in the profiles table + select is_admin into is_admin from profiles where user_id = (event->>'user_id')::uuid; + + -- Proceed only if the user is an admin + if is_admin then + claims := event->'claims'; + + -- Check if 'user_metadata' exists in claims + if jsonb_typeof(claims->'user_metadata') is null then + -- If 'user_metadata' does not exist, create an empty object + claims := jsonb_set(claims, '{user_metadata}', '{}'); + end if; + + -- Set a claim of 'admin' + claims := jsonb_set(claims, '{user_metadata, admin}', 'true'); + + -- Update the 'claims' object in the original event + event := jsonb_set(event, '{claims}', claims); + end if; + + -- Return the modified or original event + return event; + end; +$$; + +grant execute + on function public.custom_access_token_hook + to supabase_auth_admin; + +revoke execute + on function public.custom_access_token_hook + from authenticated, anon; + +grant usage on schema public to supabase_auth_admin;`.trim(), + }, + + { + id: 29, + type: 'template', + title: 'Add Auth Hook (General)', + description: 'Create an Auth Hook', + sql: ` +create or replace function public.custom_access_token_hook(event jsonb) +returns jsonb +language plpgsql +as $$ +declare + -- Insert variables here +begin + -- Insert logic here + return event; +end; +$$; +-- Permissions for the hook +grant execute on function public.custom_access_token_hook to supabase_auth_admin; +revoke execute on function public.custom_access_token_hook from authenticated, anon; + `, + }, +] diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.types.ts b/apps/studio/components/interfaces/SQLEditor/SQLEditor.types.ts index a084da9cd23..5eb20e019ac 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.types.ts +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.types.ts @@ -1,4 +1,4 @@ -import { DiffOnMount, OnMount } from '@monaco-editor/react' +import type { DiffOnMount, OnMount } from '@monaco-editor/react' import { Dispatch, SetStateAction } from 'react' export interface SQLTemplate { diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts b/apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts index 18ca6c224cd..3d5478114ab 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.utils.ts @@ -1,9 +1,7 @@ -// @ts-ignore import { NEW_SQL_SNIPPET_SKELETON, destructiveSqlRegex } from './SQLEditor.constants' import type { SqlSnippets, UserContent } from 'types' import { DiffType } from './SQLEditor.types' import { removeCommentsFromSql } from 'lib/helpers' -import { stripIndent } from 'common-tags' export const createSqlSnippetSkeleton = ({ id, @@ -62,17 +60,17 @@ export function checkDestructiveQuery(sql: string) { return destructiveSqlRegex.some((regex) => regex.test(removeCommentsFromSql(sql))) } -export const generateMigrationCliCommand = (id: string, name: string, isNpx = false) => stripIndent` - ${isNpx ? 'npx ' : ''}supabase snippets download ${id} | - ${isNpx ? 'npx ' : ''}supabase migration new ${name} +export const generateMigrationCliCommand = (id: string, name: string, isNpx = false) => ` +${isNpx ? 'npx ' : ''}supabase snippets download ${id} | +${isNpx ? 'npx ' : ''}supabase migration new ${name} ` -export const generateSeedCliCommand = (id: string, isNpx = false) => stripIndent` - ${isNpx ? 'npx ' : ''}supabase snippets download ${id} >> \\ - supabase/seed.sql +export const generateSeedCliCommand = (id: string, isNpx = false) => ` +${isNpx ? 'npx ' : ''}supabase snippets download ${id} >> \\ + supabase/seed.sql ` -export const generateFileCliCommand = (id: string, name: string, isNpx = false) => stripIndent` - ${isNpx ? 'npx ' : ''}supabase snippets download ${id} > \\ - ${name}.sql +export const generateFileCliCommand = (id: string, name: string, isNpx = false) => ` +${isNpx ? 'npx ' : ''}supabase snippets download ${id} > \\ + ${name}.sql ` diff --git a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx index 7db43451822..1bb12104b9f 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx +++ b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx @@ -3,7 +3,7 @@ import { partition } from 'lodash' import { observer } from 'mobx-react-lite' import { useParams, useTelemetryProps } from 'common' -import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.constants' +import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.queries' import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useCheckPermissions, useSelectedProject, useStore } from 'hooks' import { uuidv4 } from 'lib/helpers' diff --git a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx index 390f495976d..2de33112c81 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx +++ b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx @@ -3,7 +3,7 @@ import { partition } from 'lodash' import { observer } from 'mobx-react-lite' import { useTelemetryProps } from 'common' -import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.constants' +import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.queries' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import type { SqlSnippet } from 'data/content/sql-snippets-query' import { useCheckPermissions, useStore } from 'hooks' diff --git a/apps/studio/data/database/database-query-constants.ts b/apps/studio/data/database/database-query-constants.ts index 67934d5f686..328a469fecb 100644 --- a/apps/studio/data/database/database-query-constants.ts +++ b/apps/studio/data/database/database-query-constants.ts @@ -1,4 +1,4 @@ -import minify from 'pg-minify' +export { CREATE_PG_GET_TABLEDEF_SQL } from './database-table-definition' // https://www.postgresql.org/docs/current/catalog-pg-constraint.html @@ -9,571 +9,3 @@ export enum FOREIGN_KEY_CASCADE_ACTION { SET_NULL = 'n', SET_DEFAULT = 'd', } - -// Derived from https://github.com/MichaelDBA/pg_get_tabledef -// NOTE: when updating, \n must be replaced with \\n in the SQL below - -export const CREATE_PG_GET_TABLEDEF_SQL = minify( - /* SQL */ ` - DROP TYPE IF EXISTS pg_temp.tabledefs CASCADE; - CREATE TYPE pg_temp.tabledefs AS ENUM ('PKEY_INTERNAL','PKEY_EXTERNAL','FKEYS_INTERNAL', 'FKEYS_EXTERNAL', 'FKEYS_COMMENTED', 'FKEYS_NONE', 'INCLUDE_TRIGGERS', 'NO_TRIGGERS'); - - -- DROP FUNCTION pg_temp.pg_get_coldef(text,text,text,boolean); - CREATE OR REPLACE FUNCTION pg_temp.pg_get_coldef( - in_schema text, - in_table text, - in_column text, - oldway boolean default False - ) - RETURNS text - LANGUAGE plpgsql VOLATILE - AS - $$ - DECLARE - coldef text; - BEGIN - IF oldway THEN - SELECT pg_catalog.format_type(a.atttypid, a.atttypmod) INTO coldef FROM pg_namespace n, pg_class c, pg_attribute a, pg_type t - WHERE n.nspname = in_schema AND n.oid = c.relnamespace AND c.relname = in_table AND a.attname = in_column and a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid ORDER BY a.attnum; - ELSE - -- a.attrelid::regclass::text, a.attname - SELECT CASE WHEN a.atttypid = ANY ('{int,int8,int2}'::regtype[]) AND EXISTS (SELECT FROM pg_attrdef ad WHERE ad.adrelid = a.attrelid AND ad.adnum = a.attnum AND - pg_get_expr(ad.adbin, ad.adrelid) = 'nextval(''' || (pg_get_serial_sequence (a.attrelid::regclass::text, a.attname))::regclass || '''::regclass)') THEN CASE a.atttypid - WHEN 'int'::regtype THEN 'serial' WHEN 'int8'::regtype THEN 'bigserial' WHEN 'int2'::regtype THEN 'smallserial' END ELSE format_type(a.atttypid, a.atttypmod) END AS data_type - INTO coldef FROM pg_namespace n, pg_class c, pg_attribute a, pg_type t - WHERE n.nspname = in_schema AND n.oid = c.relnamespace AND c.relname = in_table AND a.attname = in_column and a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid ORDER BY a.attnum; - END IF; - RETURN coldef; - END; - $$; - - -- SELECT * FROM pg_temp.pg_get_tabledef('sample', 'address', false); - DROP FUNCTION IF EXISTS pg_temp.pg_get_tabledef(character varying,character varying,boolean,tabledefs[]); - CREATE OR REPLACE FUNCTION pg_temp.pg_get_tabledef( - in_schema varchar, - in_table varchar, - _verbose boolean, - VARIADIC arr pg_temp.tabledefs[] DEFAULT '{}':: pg_temp.tabledefs[] - ) - RETURNS text - LANGUAGE plpgsql VOLATILE - AS - $$ - DECLARE - v_qualified text := ''; - v_table_ddl text; - v_table_oid int; - v_colrec record; - v_constraintrec record; - v_trigrec record; - v_indexrec record; - v_primary boolean := False; - v_constraint_name text; - v_constraint_def text; - v_pkey_def text := ''; - v_fkey_defs text; - v_trigger text := ''; - v_partition_key text := ''; - v_partbound text; - v_parent text; - v_parent_schema text; - v_persist text; - v_temp text := ''; - v_relopts text; - v_tablespace text; - v_pgversion int; - bSerial boolean; - bPartition boolean; - bInheritance boolean; - bRelispartition boolean; - constraintarr text[] := '{}'; - constraintelement text; - bSkip boolean; - bVerbose boolean := False; - v_cnt1 integer; - v_cnt2 integer; - - -- assume defaults for ENUMs at the getgo - pkcnt int := 0; - fkcnt int := 0; - trigcnt int := 0; - pktype tabledefs := 'PKEY_INTERNAL'; - fktype tabledefs := 'FKEYS_INTERNAL'; - trigtype tabledefs := 'NO_TRIGGERS'; - arglen integer; - vargs text; - avarg tabledefs; - - -- exception variables - v_ret text; - v_diag1 text; - v_diag2 text; - v_diag3 text; - v_diag4 text; - v_diag5 text; - v_diag6 text; - - BEGIN - SET client_min_messages = 'notice'; - IF _verbose THEN bVerbose = True; END IF; - - -- v17 fix: handle case-sensitive - -- v_qualified = in_schema || '.' || in_table; - - arglen := array_length($4, 1); - IF arglen IS NULL THEN - -- nothing to do, so assume defaults - NULL; - ELSE - -- loop thru args - -- IF 'NO_TRIGGERS' = ANY ($4) - -- select array_to_string($4, ',', '***') INTO vargs; - IF bVerbose THEN RAISE NOTICE 'arguments=%', $4; END IF; - FOREACH avarg IN ARRAY $4 LOOP - IF bVerbose THEN RAISE INFO 'arg=%', avarg; END IF; - IF avarg = 'FKEYS_INTERNAL' OR avarg = 'FKEYS_EXTERNAL' OR avarg = 'FKEYS_COMMENTED' THEN - fkcnt = fkcnt + 1; - fktype = avarg; - ELSEIF avarg = 'INCLUDE_TRIGGERS' OR avarg = 'NO_TRIGGERS' THEN - trigcnt = trigcnt + 1; - trigtype = avarg; - ELSEIF avarg = 'PKEY_EXTERNAL' THEN - pkcnt = pkcnt + 1; - pktype = avarg; - END IF; - END LOOP; - IF fkcnt > 1 THEN - RAISE WARNING 'Only one foreign key option can be provided. You provided %', fkcnt; - RETURN ''; - ELSEIF trigcnt > 1 THEN - RAISE WARNING 'Only one trigger option can be provided. You provided %', trigcnt; - RETURN ''; - ELSEIF pkcnt > 1 THEN - RAISE WARNING 'Only one pkey option can be provided. You provided %', pkcnt; - RETURN ''; - END IF; - END IF; - - SELECT c.oid, (select setting from pg_settings where name = 'server_version_num') INTO v_table_oid, v_pgversion FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace - WHERE c.relkind in ('r','p') AND c.relname = in_table AND n.nspname = in_schema; - - -- throw an error if table was not found - IF (v_table_oid IS NULL) THEN - RAISE EXCEPTION 'table does not exist'; - END IF; - - -- get user-defined tablespaces if applicable - SELECT tablespace INTO v_temp FROM pg_tables WHERE schemaname = in_schema and tablename = in_table and tablespace IS NOT NULL; - IF v_temp IS NULL THEN - v_tablespace := 'TABLESPACE pg_default'; - ELSE - v_tablespace := 'TABLESPACE ' || v_temp; - END IF; - - -- also see if there are any SET commands for this table, ie, autovacuum_enabled=off, fillfactor=70 - WITH relopts AS (SELECT unnest(c.reloptions) relopts FROM pg_class c, pg_namespace n WHERE n.nspname = in_schema and n.oid = c.relnamespace and c.relname = in_table) - SELECT string_agg(r.relopts, ', ') as relopts INTO v_temp from relopts r; - IF v_temp IS NULL THEN - v_relopts := ''; - ELSE - v_relopts := ' WITH (' || v_temp || ')'; - END IF; - - -- ----------------------------------------------------------------------------------- - -- Create table defs for partitions/children using inheritance or declarative methods. - -- inheritance: pg_class.relkind = 'r' pg_class.relispartition=false pg_class.relpartbound is NULL - -- declarative: pg_class.relkind = 'r' pg_class.relispartition=true pg_class.relpartbound is NOT NULL - -- ----------------------------------------------------------------------------------- - v_partbound := ''; - bPartition := False; - bInheritance := False; - IF v_pgversion < 100000 THEN - -- Issue#11: handle parent schema - SELECT c2.relname parent, c2.relnamespace::regnamespace INTO v_parent, v_parent_schema from pg_class c1, pg_namespace n, pg_inherits i, pg_class c2 - WHERE n.nspname = in_schema and n.oid = c1.relnamespace and c1.relname = in_table and c1.oid = i.inhrelid and i.inhparent = c2.oid and c1.relkind = 'r'; - IF (v_parent IS NOT NULL) THEN - bPartition := True; - bInheritance := True; - END IF; - ELSE - -- Issue#11: handle parent schema - SELECT c2.relname parent, c1.relispartition, pg_get_expr(c1.relpartbound, c1.oid, true), c2.relnamespace::regnamespace INTO v_parent, bRelispartition, v_partbound, v_parent_schema from pg_class c1, pg_namespace n, pg_inherits i, pg_class c2 - WHERE n.nspname = in_schema and n.oid = c1.relnamespace and c1.relname = in_table and c1.oid = i.inhrelid and i.inhparent = c2.oid and c1.relkind = 'r'; - IF (v_parent IS NOT NULL) THEN - bPartition := True; - IF bRelispartition THEN - bInheritance := False; - ELSE - bInheritance := True; - END IF; - END IF; - END IF; - IF bPartition THEN - --Issue#17 fix for case-sensitive tables - -- SELECT count(*) INTO v_cnt1 FROM information_schema.tables t WHERE EXISTS (SELECT REGEXP_MATCHES(s.table_name, '([A-Z]+)','g') FROM information_schema.tables s - -- WHERE t.table_schema=s.table_schema AND t.table_name=s.table_name AND t.table_schema = quote_ident(in_schema) AND t.table_name = quote_ident(in_table) AND t.table_type = 'BASE TABLE'); - SELECT count(*) INTO v_cnt1 FROM information_schema.tables t WHERE EXISTS (SELECT REGEXP_MATCHES(s.table_name, '([A-Z]+)','g') FROM information_schema.tables s - WHERE t.table_schema=s.table_schema AND t.table_name=s.table_name AND t.table_schema = in_schema AND t.table_name = in_table AND t.table_type = 'BASE TABLE'); - - --Issue#19 put double-quotes around SQL keyword column names - SELECT COUNT(*) INTO v_cnt2 FROM pg_get_keywords() WHERE word = v_colrec.column_name AND catcode = 'R'; - - IF bInheritance THEN - -- inheritance-based - IF v_cnt1 > 0 OR v_cnt2 > 0 THEN - v_table_ddl := 'CREATE TABLE ' || in_schema || '."' || in_table || '"( '|| E'\\n'; - ELSE - v_table_ddl := 'CREATE TABLE ' || in_schema || '.' || in_table || '( '|| E'\\n'; - END IF; - - -- Jump to constraints section to add the check constraints - ELSE - -- declarative-based - IF v_relopts <> '' THEN - IF v_cnt1 > 0 OR v_cnt2 > 0 THEN - v_table_ddl := 'CREATE TABLE ' || in_schema || '."' || in_table || '" PARTITION OF ' || in_schema || '.' || v_parent || ' ' || v_partbound || v_relopts || ' ' || v_tablespace || '; ' || E'\\n'; - ELSE - v_table_ddl := 'CREATE TABLE ' || in_schema || '.' || in_table || ' PARTITION OF ' || in_schema || '.' || v_parent || ' ' || v_partbound || v_relopts || ' ' || v_tablespace || '; ' || E'\\n'; - END IF; - ELSE - IF v_cnt1 > 0 OR v_cnt2 > 0 THEN - v_table_ddl := 'CREATE TABLE ' || in_schema || '."' || in_table || '" PARTITION OF ' || in_schema || '.' || v_parent || ' ' || v_partbound || ' ' || v_tablespace || '; ' || E'\\n'; - ELSE - v_table_ddl := 'CREATE TABLE ' || in_schema || '.' || in_table || ' PARTITION OF ' || in_schema || '.' || v_parent || ' ' || v_partbound || ' ' || v_tablespace || '; ' || E'\\n'; - END IF; - END IF; - -- Jump to constraints and index section to add the check constraints and indexes and perhaps FKeys - END IF; - END IF; - IF bVerbose THEN RAISE INFO '(1)tabledef so far: %', v_table_ddl; END IF; - - IF NOT bPartition THEN - -- see if this is unlogged or temporary table - select c.relpersistence into v_persist from pg_class c, pg_namespace n where n.nspname = in_schema and n.oid = c.relnamespace and c.relname = in_table and c.relkind = 'r'; - IF v_persist = 'u' THEN - v_temp := 'UNLOGGED'; - ELSIF v_persist = 't' THEN - v_temp := 'TEMPORARY'; - ELSE - v_temp := ''; - END IF; - END IF; - - -- start the create definition for regular tables unless we are in progress creating an inheritance-based child table - IF NOT bPartition THEN - --Issue#17 fix for case-sensitive tables - -- SELECT count(*) INTO v_cnt1 FROM information_schema.tables t WHERE EXISTS (SELECT REGEXP_MATCHES(s.table_name, '([A-Z]+)','g') FROM information_schema.tables s - -- WHERE t.table_schema=s.table_schema AND t.table_name=s.table_name AND t.table_schema = quote_ident(in_schema) AND t.table_name = quote_ident(in_table) AND t.table_type = 'BASE TABLE'); - SELECT count(*) INTO v_cnt1 FROM information_schema.tables t WHERE EXISTS (SELECT REGEXP_MATCHES(s.table_name, '([A-Z]+)','g') FROM information_schema.tables s - WHERE t.table_schema=s.table_schema AND t.table_name=s.table_name AND t.table_schema = in_schema AND t.table_name = in_table AND t.table_type = 'BASE TABLE'); - IF v_cnt1 > 0 THEN - v_table_ddl := 'CREATE ' || v_temp || ' TABLE ' || in_schema || '."' || in_table || '" (' || E'\\n'; - ELSE - v_table_ddl := 'CREATE ' || v_temp || ' TABLE ' || in_schema || '.' || in_table || ' (' || E'\\n'; - END IF; - END IF; - -- RAISE INFO 'DEBUG2: tabledef so far: %', v_table_ddl; - -- define all of the columns in the table unless we are in progress creating an inheritance-based child table - IF NOT bPartition THEN - FOR v_colrec IN - SELECT c.column_name, c.data_type, c.udt_name, c.udt_schema, c.character_maximum_length, c.is_nullable, c.column_default, c.numeric_precision, c.numeric_scale, c.is_identity, c.identity_generation - FROM information_schema.columns c WHERE (table_schema, table_name) = (in_schema, in_table) ORDER BY ordinal_position - LOOP - IF bVerbose THEN RAISE INFO '(col loop) name=% type=% udt_name=% udt_schema=%', v_colrec.column_name, v_colrec.data_type, v_colrec.udt_name, v_colrec.udt_schema; END IF; - -- v17 fix: handle case-sensitive for pg_get_serial_sequence that requires SQL Identifier handling - -- SELECT CASE WHEN pg_get_serial_sequence(v_qualified, v_colrec.column_name) IS NOT NULL THEN True ELSE False END into bSerial; - SELECT CASE WHEN pg_get_serial_sequence(quote_ident(in_schema) || '.' || quote_ident(in_table), v_colrec.column_name) IS NOT NULL THEN True ELSE False END into bSerial; - IF bVerbose THEN - -- v17 fix: handle case-sensitive for pg_get_serial_sequence that requires SQL Identifier handling - -- SELECT pg_get_serial_sequence(v_qualified, v_colrec.column_name) into v_temp; - SELECT pg_get_serial_sequence(quote_ident(in_schema) || '.' || quote_ident(in_table), v_colrec.column_name) into v_temp; - IF v_temp IS NULL THEN v_temp = 'NA'; END IF; - SELECT pg_temp.pg_get_coldef(in_schema, in_table,v_colrec.column_name) INTO v_diag1; - --RAISE NOTICE 'DEBUG table: % Column: % datatype: % Serial=% serialval=% coldef=%', v_qualified, v_colrec.column_name, v_colrec.data_type, bSerial, v_temp, v_diag1; - --RAISE NOTICE 'DEBUG tabledef: %', v_table_ddl; - END IF; - - --Issue#17 put double-quotes around case-sensitive column names - SELECT COUNT(*) INTO v_cnt1 FROM information_schema.columns t WHERE EXISTS (SELECT REGEXP_MATCHES(s.column_name, '([A-Z]+)','g') FROM information_schema.columns s - WHERE t.table_schema=s.table_schema and t.table_name=s.table_name and t.column_name=s.column_name AND t.table_schema = quote_ident(in_schema) AND column_name = v_colrec.column_name); - - --Issue#19 put double-quotes around SQL keyword column names - SELECT COUNT(*) INTO v_cnt2 FROM pg_get_keywords() WHERE word = v_colrec.column_name AND catcode = 'R'; - - IF v_cnt1 > 0 OR v_cnt2 > 0 THEN - v_table_ddl := v_table_ddl || ' "' || v_colrec.column_name || '" '; - ELSE - v_table_ddl := v_table_ddl || ' ' || v_colrec.column_name || ' '; - END IF; - - v_table_ddl := v_table_ddl || - CASE WHEN v_colrec.udt_name in ('geometry', 'box2d', 'box2df', 'box3d', 'geography', 'geometry_dump', 'gidx', 'spheroid', 'valid_detail') - THEN v_colrec.udt_name - WHEN v_colrec.data_type = 'USER-DEFINED' - THEN v_colrec.udt_schema || '.' || v_colrec.udt_name - WHEN v_colrec.data_type = 'ARRAY' - -- Issue#6 fix: handle arrays - THEN pg_temp.pg_get_coldef(in_schema, in_table,v_colrec.column_name) - -- v17 fix: handle case-sensitive for pg_get_serial_sequence that requires SQL Identifier handling - -- WHEN pg_get_serial_sequence(v_qualified, v_colrec.column_name) IS NOT NULL - WHEN pg_get_serial_sequence(quote_ident(in_schema) || '.' || quote_ident(in_table), v_colrec.column_name) IS NOT NULL - -- Issue#8 fix: handle serial. Note: NOT NULL is implied so no need to declare it explicitly - THEN pg_temp.pg_get_coldef(in_schema, in_table,v_colrec.column_name) - ELSE v_colrec.data_type END - || CASE WHEN v_colrec.is_identity = 'YES' THEN CASE WHEN v_colrec.identity_generation = 'ALWAYS' THEN ' GENERATED ALWAYS AS IDENTITY' ELSE ' GENERATED BY DEFAULT AS IDENTITY' END ELSE '' END - || CASE WHEN v_colrec.character_maximum_length IS NOT NULL THEN ('(' || v_colrec.character_maximum_length || ')') - WHEN v_colrec.numeric_precision > 0 AND v_colrec.numeric_scale > 0 THEN '(' || v_colrec.numeric_precision || ',' || v_colrec.numeric_scale || ')' - ELSE '' END || ' ' - || CASE WHEN bSerial THEN '' ELSE CASE WHEN v_colrec.is_nullable = 'NO' THEN 'NOT NULL' ELSE 'NULL' END END - || CASE WHEN bSerial THEN '' ELSE CASE WHEN v_colrec.column_default IS NOT null THEN (' DEFAULT ' || v_colrec.column_default) ELSE '' END END - || ',' || E'\\n'; - END LOOP; - END IF; - IF bVerbose THEN RAISE INFO '(2)tabledef so far: %', v_table_ddl; END IF; - - -- define all the constraints: conparentid does not exist pre PGv11 - IF v_pgversion < 110000 THEN - FOR v_constraintrec IN - SELECT con.conname as constraint_name, con.contype as constraint_type, - CASE - WHEN con.contype = 'p' THEN 1 -- primary key constraint - WHEN con.contype = 'u' THEN 2 -- unique constraint - WHEN con.contype = 'f' THEN 3 -- foreign key constraint - WHEN con.contype = 'c' THEN 4 - ELSE 5 - END as type_rank, - pg_get_constraintdef(con.oid) as constraint_definition - FROM pg_catalog.pg_constraint con JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid JOIN pg_catalog.pg_namespace nsp ON nsp.oid = connamespace - WHERE nsp.nspname = in_schema AND rel.relname = in_table ORDER BY type_rank - LOOP - IF v_constraintrec.type_rank = 1 THEN - v_primary := True; - IF pkcnt = 0 THEN - v_constraint_name := v_constraintrec.constraint_name; - v_constraint_def := v_constraintrec.constraint_definition; - ELSE - -- Issue#16 handle external PG def - v_constraint_name := v_constraintrec.constraint_name; - SELECT 'ALTER TABLE ONLY ' || in_schema || '.' || c.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' INTO v_pkey_def - FROM pg_catalog.pg_constraint r, pg_class c, pg_namespace n where r.conrelid = c.oid and r.contype = 'p' and n.oid = r.connamespace and n.nspname = in_schema AND c.relname = in_table; - END IF; - IF bPartition THEN - continue; - END IF; - ELSE - v_constraint_name := v_constraintrec.constraint_name; - v_constraint_def := v_constraintrec.constraint_definition; - END IF; - if bVerbose THEN RAISE INFO 'DEBUG4: constraint name=% constraint_def=%', v_constraint_name,v_constraint_def; END IF; - constraintarr := constraintarr || v_constraintrec.constraint_name:: text; - - IF fktype <> 'FKEYS_INTERNAL' AND v_constraintrec.constraint_type = 'f' THEN - continue; - END IF; - - IF pkcnt = 0 THEN - v_table_ddl := v_table_ddl || ' ' -- note: two char spacer to start, to indent the column - || 'CONSTRAINT' || ' ' - || v_constraint_name || ' ' - || v_constraint_def - || ',' || E'\\n'; - END IF; - END LOOP; - - ELSE - FOR v_constraintrec IN - SELECT con.conname as constraint_name, con.contype as constraint_type, - CASE - WHEN con.contype = 'p' THEN 1 -- primary key constraint - WHEN con.contype = 'u' THEN 2 -- unique constraint - WHEN con.contype = 'f' THEN 3 -- foreign key constraint - WHEN con.contype = 'c' THEN 4 - ELSE 5 - END as type_rank, - pg_get_constraintdef(con.oid) as constraint_definition - FROM pg_catalog.pg_constraint con JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid JOIN pg_catalog.pg_namespace nsp ON nsp.oid = connamespace - WHERE nsp.nspname = in_schema AND rel.relname = in_table - --Issue#13 added this condition: - AND con.conparentid = 0 - ORDER BY type_rank - LOOP - IF v_constraintrec.type_rank = 1 THEN - v_primary := True; - IF pkcnt = 0 THEN - v_constraint_name := v_constraintrec.constraint_name; - v_constraint_def := v_constraintrec.constraint_definition; - ELSE - -- Issue#16 handle external PG def - v_constraint_name := v_constraintrec.constraint_name; - SELECT 'ALTER TABLE ONLY ' || in_schema || '.' || c.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' INTO v_pkey_def - FROM pg_catalog.pg_constraint r, pg_class c, pg_namespace n where r.conrelid = c.oid and r.contype = 'p' and n.oid = r.connamespace and n.nspname = in_schema AND c.relname = in_table; - END IF; - IF bPartition THEN - continue; - END IF; - ELSE - v_constraint_name := v_constraintrec.constraint_name; - v_constraint_def := v_constraintrec.constraint_definition; - END IF; - -- SELECT 'ALTER TABLE ONLY ' || c.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' as pkeyddl FROM pg_catalog.pg_constraint r, pg_class c, pg_namespace n where r.conrelid = c.oid and r.contype = 'p' and n.oid = r.connamespace and n.nspname = 'sample' AND c.relname = 'extensions_table'; - if bVerbose THEN RAISE INFO 'DEBUG4: constraint name=% constraint_def=%', v_constraint_name,v_constraint_def; END IF; - constraintarr := constraintarr || v_constraintrec.constraint_name:: text; - - IF fktype <> 'FKEYS_INTERNAL' AND v_constraintrec.constraint_type = 'f' THEN - continue; - END IF; - - IF pkcnt = 0 THEN - v_table_ddl := v_table_ddl || ' ' -- note: two char spacer to start, to indent the column - || 'CONSTRAINT' || ' ' - || v_constraint_name || ' ' - || v_constraint_def - || ',' || E'\\n'; - END IF; - END LOOP; - END IF; - IF bVerbose THEN RAISE INFO '(3)tabledef so far: %', v_table_ddl; END IF; - - -- drop the last comma before ending the create statement - v_table_ddl = substr(v_table_ddl, 0, length(v_table_ddl) - 1) || E'\\n'; - - -- --------------------------------------------------------------------------- - -- at this point we have everything up to the last table-enclosing parenthesis - -- --------------------------------------------------------------------------- - IF bVerbose THEN RAISE INFO '(4)tabledef so far: %', v_table_ddl; END IF; - - -- See if this is an inheritance-based child table and finish up the table create. - IF bPartition and bInheritance THEN - -- Issue#11: handle parent schema - -- v_table_ddl := v_table_ddl || ') INHERITS (' || in_schema || '.' || v_parent || ') ' || E'\\n' || v_relopts || ' ' || v_tablespace || ';' || E'\\n'; - IF v_parent_schema = '' OR v_parent_schema IS NULL THEN v_parent_schema = in_schema; END IF; - v_table_ddl := v_table_ddl || ') INHERITS (' || v_parent_schema || '.' || v_parent || ') ' || E'\\n' || v_relopts || ' ' || v_tablespace || ';' || E'\\n'; - END IF; - - IF v_pgversion >= 100000 AND NOT bPartition and NOT bInheritance THEN - -- See if this is a partitioned table (pg_class.relkind = 'p') and add the partitioned key - SELECT pg_get_partkeydef(c1.oid) as partition_key INTO v_partition_key FROM pg_class c1 JOIN pg_namespace n ON (n.oid = c1.relnamespace) LEFT JOIN pg_partitioned_table p ON (c1.oid = p.partrelid) - WHERE n.nspname = in_schema and n.oid = c1.relnamespace and c1.relname = in_table and c1.relkind = 'p'; - - IF v_partition_key IS NOT NULL AND v_partition_key <> '' THEN - -- add partition clause - -- NOTE: cannot specify default tablespace for partitioned relations - -- v_table_ddl := v_table_ddl || ') PARTITION BY ' || v_partition_key || ' ' || v_tablespace || ';' || E'\\n'; - v_table_ddl := v_table_ddl || ') PARTITION BY ' || v_partition_key || ';' || E'\\n'; - ELSEIF v_relopts <> '' THEN - v_table_ddl := v_table_ddl || ') ' || v_relopts || ' ' || v_tablespace || ';' || E'\\n'; - ELSE - -- end the create definition - v_table_ddl := v_table_ddl || ') ' || v_tablespace || ';' || E'\\n'; - END IF; - END IF; - - IF bVerbose THEN RAISE INFO '(5)tabledef so far: %', v_table_ddl; END IF; - - -- Add closing paren for regular tables - -- IF NOT bPartition THEN - -- v_table_ddl := v_table_ddl || ') ' || v_relopts || ' ' || v_tablespace || E';\\n'; - -- END IF; - -- RAISE NOTICE 'ddlsofar3: %', v_table_ddl; - - -- Issue#16 create the external PKEY def if indicated - IF v_pkey_def <> '' THEN - v_table_ddl := v_table_ddl || v_pkey_def || E'\\n'; - END IF; - - IF bVerbose THEN RAISE INFO '(6)tabledef so far: %', v_table_ddl; END IF; - - -- create indexes - FOR v_indexrec IN - SELECT indexdef, COALESCE(tablespace, 'pg_default') as tablespace, indexname FROM pg_indexes WHERE (schemaname, tablename) = (in_schema, in_table) - LOOP - -- RAISE INFO 'DEBUG6: indexname=%', v_indexrec.indexname; - -- loop through constraints and skip ones already defined - bSkip = False; - FOREACH constraintelement IN ARRAY constraintarr - LOOP - IF constraintelement = v_indexrec.indexname THEN - -- RAISE INFO 'DEBUG7: skipping index, %', v_indexrec.indexname; - bSkip = True; - EXIT; - END IF; - END LOOP; - if bSkip THEN CONTINUE; END IF; - - -- Add IF NOT EXISTS clause so partition index additions will not be created if declarative partition in effect and index already created on parent - v_indexrec.indexdef := REPLACE(v_indexrec.indexdef, 'CREATE INDEX', 'CREATE INDEX IF NOT EXISTS'); - -- RAISE INFO 'DEBUG8: adding index, %', v_indexrec.indexname; - - -- NOTE: cannot specify default tablespace for partitioned relations - IF v_partition_key IS NOT NULL AND v_partition_key <> '' THEN - v_table_ddl := v_table_ddl || v_indexrec.indexdef || ';' || E'\\n'; - ELSE - v_table_ddl := v_table_ddl || v_indexrec.indexdef || ' TABLESPACE ' || v_indexrec.tablespace || ';' || E'\\n'; - END IF; - - END LOOP; - IF bVerbose THEN RAISE INFO '(7)tabledef so far: %', v_table_ddl; END IF; - - -- Handle external foreign key defs here if applicable. - IF fktype = 'FKEYS_EXTERNAL' THEN - -- Issue#13 fix here too for conparentid = 0. and had to change to a loop to handle multiple return set, not a select into variable syntax. - -- Also had to account for PG V10 where there is no conparentid - IF v_pgversion < 110000 THEN - FOR v_constraintrec IN - SELECT 'ALTER TABLE ONLY ' || n.nspname || '.' || c2.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' as fkeydef - FROM pg_constraint r, pg_class c1, pg_namespace n, pg_class c2 where r.conrelid = c1.oid and r.contype = 'f' and n.nspname = in_schema and n.oid = r.connamespace and r.conrelid = c2.oid and c2.relname = in_table - LOOP - v_table_ddl := v_table_ddl || v_constraintrec.fkeydef || ';' || E'\\n'; - IF bVerbose THEN RAISE INFO 'keydef = %', v_constraintrec.fkeydef; END IF; - END LOOP; - ELSE - FOR v_constraintrec IN - SELECT 'ALTER TABLE ONLY ' || n.nspname || '.' || c2.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' as fkeydef - FROM pg_constraint r, pg_class c1, pg_namespace n, pg_class c2 where r.conrelid = c1.oid and r.contype = 'f' and n.nspname = in_schema and n.oid = r.connamespace and r.conrelid = c2.oid and c2.relname = in_table and r.conparentid = 0 - LOOP - v_table_ddl := v_table_ddl || v_constraintrec.fkeydef || E'\\n'; - IF bVerbose THEN RAISE INFO 'keydef = %', v_constraintrec.fkeydef; END IF; - END LOOP; - END IF; - - ELSIF fktype = 'FKEYS_COMMENTED' THEN - SELECT '-- ALTER TABLE ONLY ' || n.nspname || '.' || c2.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' into v_fkey_defs - FROM pg_constraint r, pg_class c1, pg_namespace n, pg_class c2 where r.conrelid = c1.oid and r.contype = 'f' and n.nspname = in_schema and n.oid = r.connamespace and r.conrelid = c2.oid and c2.relname = in_table; - IF v_fkey_defs IS NOT NULL THEN - v_table_ddl := v_table_ddl || v_fkey_defs; - END IF; - END IF; - IF bVerbose THEN RAISE INFO '(8)tabledef so far: %', v_table_ddl; END IF; - - IF trigtype = 'INCLUDE_TRIGGERS' THEN - -- Issue#14: handle multiple triggers for a table - FOR v_trigrec IN - select pg_get_triggerdef(t.oid, True) || ';' as triggerdef FROM pg_trigger t, pg_class c, pg_namespace n - WHERE n.nspname = in_schema and n.oid = c.relnamespace and c.relname = in_table and c.relkind = 'r' and t.tgrelid = c.oid and NOT t.tgisinternal - LOOP - v_table_ddl := v_table_ddl || v_trigrec.triggerdef; - v_table_ddl := v_table_ddl || E'\\n'; - IF bVerbose THEN RAISE INFO 'triggerdef = %', v_trigrec.triggerdef; END IF; - END LOOP; - END IF; - - -- add empty line - v_table_ddl := v_table_ddl || E'\\n'; - - RETURN v_table_ddl; - - EXCEPTION - WHEN others THEN - BEGIN - GET STACKED DIAGNOSTICS v_diag1 = MESSAGE_TEXT, v_diag2 = PG_EXCEPTION_DETAIL, v_diag3 = PG_EXCEPTION_HINT, v_diag4 = RETURNED_SQLSTATE, v_diag5 = PG_CONTEXT, v_diag6 = PG_EXCEPTION_CONTEXT; - -- v_ret := 'line=' || v_diag6 || '. '|| v_diag4 || '. ' || v_diag1 || ' .' || v_diag2 || ' .' || v_diag3; - v_ret := 'line=' || v_diag6 || '. '|| v_diag4 || '. ' || v_diag1; - RAISE EXCEPTION '%', v_ret; - -- put additional coding here if necessarY - RETURN ''; - END; - - END; - $$;`, - { compress: true, removeAll: true } -) diff --git a/apps/studio/data/database/database-table-definition.ts b/apps/studio/data/database/database-table-definition.ts new file mode 100644 index 00000000000..bc968581287 --- /dev/null +++ b/apps/studio/data/database/database-table-definition.ts @@ -0,0 +1,569 @@ +import minify from 'pg-minify' + +// Derived from https://github.com/MichaelDBA/pg_get_tabledef +// NOTE: when updating, \n must be replaced with \\n in the SQL below + +export const CREATE_PG_GET_TABLEDEF_SQL = minify( + /* SQL */ ` + DROP TYPE IF EXISTS pg_temp.tabledefs CASCADE; + CREATE TYPE pg_temp.tabledefs AS ENUM ('PKEY_INTERNAL','PKEY_EXTERNAL','FKEYS_INTERNAL', 'FKEYS_EXTERNAL', 'FKEYS_COMMENTED', 'FKEYS_NONE', 'INCLUDE_TRIGGERS', 'NO_TRIGGERS'); + + -- DROP FUNCTION pg_temp.pg_get_coldef(text,text,text,boolean); + CREATE OR REPLACE FUNCTION pg_temp.pg_get_coldef( + in_schema text, + in_table text, + in_column text, + oldway boolean default False + ) + RETURNS text + LANGUAGE plpgsql VOLATILE + AS + $$ + DECLARE + coldef text; + BEGIN + IF oldway THEN + SELECT pg_catalog.format_type(a.atttypid, a.atttypmod) INTO coldef FROM pg_namespace n, pg_class c, pg_attribute a, pg_type t + WHERE n.nspname = in_schema AND n.oid = c.relnamespace AND c.relname = in_table AND a.attname = in_column and a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid ORDER BY a.attnum; + ELSE + -- a.attrelid::regclass::text, a.attname + SELECT CASE WHEN a.atttypid = ANY ('{int,int8,int2}'::regtype[]) AND EXISTS (SELECT FROM pg_attrdef ad WHERE ad.adrelid = a.attrelid AND ad.adnum = a.attnum AND + pg_get_expr(ad.adbin, ad.adrelid) = 'nextval(''' || (pg_get_serial_sequence (a.attrelid::regclass::text, a.attname))::regclass || '''::regclass)') THEN CASE a.atttypid + WHEN 'int'::regtype THEN 'serial' WHEN 'int8'::regtype THEN 'bigserial' WHEN 'int2'::regtype THEN 'smallserial' END ELSE format_type(a.atttypid, a.atttypmod) END AS data_type + INTO coldef FROM pg_namespace n, pg_class c, pg_attribute a, pg_type t + WHERE n.nspname = in_schema AND n.oid = c.relnamespace AND c.relname = in_table AND a.attname = in_column and a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid ORDER BY a.attnum; + END IF; + RETURN coldef; + END; + $$; + + -- SELECT * FROM pg_temp.pg_get_tabledef('sample', 'address', false); + DROP FUNCTION IF EXISTS pg_temp.pg_get_tabledef(character varying,character varying,boolean,tabledefs[]); + CREATE OR REPLACE FUNCTION pg_temp.pg_get_tabledef( + in_schema varchar, + in_table varchar, + _verbose boolean, + VARIADIC arr pg_temp.tabledefs[] DEFAULT '{}':: pg_temp.tabledefs[] + ) + RETURNS text + LANGUAGE plpgsql VOLATILE + AS + $$ + DECLARE + v_qualified text := ''; + v_table_ddl text; + v_table_oid int; + v_colrec record; + v_constraintrec record; + v_trigrec record; + v_indexrec record; + v_primary boolean := False; + v_constraint_name text; + v_constraint_def text; + v_pkey_def text := ''; + v_fkey_defs text; + v_trigger text := ''; + v_partition_key text := ''; + v_partbound text; + v_parent text; + v_parent_schema text; + v_persist text; + v_temp text := ''; + v_relopts text; + v_tablespace text; + v_pgversion int; + bSerial boolean; + bPartition boolean; + bInheritance boolean; + bRelispartition boolean; + constraintarr text[] := '{}'; + constraintelement text; + bSkip boolean; + bVerbose boolean := False; + v_cnt1 integer; + v_cnt2 integer; + + -- assume defaults for ENUMs at the getgo + pkcnt int := 0; + fkcnt int := 0; + trigcnt int := 0; + pktype tabledefs := 'PKEY_INTERNAL'; + fktype tabledefs := 'FKEYS_INTERNAL'; + trigtype tabledefs := 'NO_TRIGGERS'; + arglen integer; + vargs text; + avarg tabledefs; + + -- exception variables + v_ret text; + v_diag1 text; + v_diag2 text; + v_diag3 text; + v_diag4 text; + v_diag5 text; + v_diag6 text; + + BEGIN + SET client_min_messages = 'notice'; + IF _verbose THEN bVerbose = True; END IF; + + -- v17 fix: handle case-sensitive + -- v_qualified = in_schema || '.' || in_table; + + arglen := array_length($4, 1); + IF arglen IS NULL THEN + -- nothing to do, so assume defaults + NULL; + ELSE + -- loop thru args + -- IF 'NO_TRIGGERS' = ANY ($4) + -- select array_to_string($4, ',', '***') INTO vargs; + IF bVerbose THEN RAISE NOTICE 'arguments=%', $4; END IF; + FOREACH avarg IN ARRAY $4 LOOP + IF bVerbose THEN RAISE INFO 'arg=%', avarg; END IF; + IF avarg = 'FKEYS_INTERNAL' OR avarg = 'FKEYS_EXTERNAL' OR avarg = 'FKEYS_COMMENTED' THEN + fkcnt = fkcnt + 1; + fktype = avarg; + ELSEIF avarg = 'INCLUDE_TRIGGERS' OR avarg = 'NO_TRIGGERS' THEN + trigcnt = trigcnt + 1; + trigtype = avarg; + ELSEIF avarg = 'PKEY_EXTERNAL' THEN + pkcnt = pkcnt + 1; + pktype = avarg; + END IF; + END LOOP; + IF fkcnt > 1 THEN + RAISE WARNING 'Only one foreign key option can be provided. You provided %', fkcnt; + RETURN ''; + ELSEIF trigcnt > 1 THEN + RAISE WARNING 'Only one trigger option can be provided. You provided %', trigcnt; + RETURN ''; + ELSEIF pkcnt > 1 THEN + RAISE WARNING 'Only one pkey option can be provided. You provided %', pkcnt; + RETURN ''; + END IF; + END IF; + + SELECT c.oid, (select setting from pg_settings where name = 'server_version_num') INTO v_table_oid, v_pgversion FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace + WHERE c.relkind in ('r','p') AND c.relname = in_table AND n.nspname = in_schema; + + -- throw an error if table was not found + IF (v_table_oid IS NULL) THEN + RAISE EXCEPTION 'table does not exist'; + END IF; + + -- get user-defined tablespaces if applicable + SELECT tablespace INTO v_temp FROM pg_tables WHERE schemaname = in_schema and tablename = in_table and tablespace IS NOT NULL; + IF v_temp IS NULL THEN + v_tablespace := 'TABLESPACE pg_default'; + ELSE + v_tablespace := 'TABLESPACE ' || v_temp; + END IF; + + -- also see if there are any SET commands for this table, ie, autovacuum_enabled=off, fillfactor=70 + WITH relopts AS (SELECT unnest(c.reloptions) relopts FROM pg_class c, pg_namespace n WHERE n.nspname = in_schema and n.oid = c.relnamespace and c.relname = in_table) + SELECT string_agg(r.relopts, ', ') as relopts INTO v_temp from relopts r; + IF v_temp IS NULL THEN + v_relopts := ''; + ELSE + v_relopts := ' WITH (' || v_temp || ')'; + END IF; + + -- ----------------------------------------------------------------------------------- + -- Create table defs for partitions/children using inheritance or declarative methods. + -- inheritance: pg_class.relkind = 'r' pg_class.relispartition=false pg_class.relpartbound is NULL + -- declarative: pg_class.relkind = 'r' pg_class.relispartition=true pg_class.relpartbound is NOT NULL + -- ----------------------------------------------------------------------------------- + v_partbound := ''; + bPartition := False; + bInheritance := False; + IF v_pgversion < 100000 THEN + -- Issue#11: handle parent schema + SELECT c2.relname parent, c2.relnamespace::regnamespace INTO v_parent, v_parent_schema from pg_class c1, pg_namespace n, pg_inherits i, pg_class c2 + WHERE n.nspname = in_schema and n.oid = c1.relnamespace and c1.relname = in_table and c1.oid = i.inhrelid and i.inhparent = c2.oid and c1.relkind = 'r'; + IF (v_parent IS NOT NULL) THEN + bPartition := True; + bInheritance := True; + END IF; + ELSE + -- Issue#11: handle parent schema + SELECT c2.relname parent, c1.relispartition, pg_get_expr(c1.relpartbound, c1.oid, true), c2.relnamespace::regnamespace INTO v_parent, bRelispartition, v_partbound, v_parent_schema from pg_class c1, pg_namespace n, pg_inherits i, pg_class c2 + WHERE n.nspname = in_schema and n.oid = c1.relnamespace and c1.relname = in_table and c1.oid = i.inhrelid and i.inhparent = c2.oid and c1.relkind = 'r'; + IF (v_parent IS NOT NULL) THEN + bPartition := True; + IF bRelispartition THEN + bInheritance := False; + ELSE + bInheritance := True; + END IF; + END IF; + END IF; + IF bPartition THEN + --Issue#17 fix for case-sensitive tables + -- SELECT count(*) INTO v_cnt1 FROM information_schema.tables t WHERE EXISTS (SELECT REGEXP_MATCHES(s.table_name, '([A-Z]+)','g') FROM information_schema.tables s + -- WHERE t.table_schema=s.table_schema AND t.table_name=s.table_name AND t.table_schema = quote_ident(in_schema) AND t.table_name = quote_ident(in_table) AND t.table_type = 'BASE TABLE'); + SELECT count(*) INTO v_cnt1 FROM information_schema.tables t WHERE EXISTS (SELECT REGEXP_MATCHES(s.table_name, '([A-Z]+)','g') FROM information_schema.tables s + WHERE t.table_schema=s.table_schema AND t.table_name=s.table_name AND t.table_schema = in_schema AND t.table_name = in_table AND t.table_type = 'BASE TABLE'); + + --Issue#19 put double-quotes around SQL keyword column names + SELECT COUNT(*) INTO v_cnt2 FROM pg_get_keywords() WHERE word = v_colrec.column_name AND catcode = 'R'; + + IF bInheritance THEN + -- inheritance-based + IF v_cnt1 > 0 OR v_cnt2 > 0 THEN + v_table_ddl := 'CREATE TABLE ' || in_schema || '."' || in_table || '"( '|| E'\\n'; + ELSE + v_table_ddl := 'CREATE TABLE ' || in_schema || '.' || in_table || '( '|| E'\\n'; + END IF; + + -- Jump to constraints section to add the check constraints + ELSE + -- declarative-based + IF v_relopts <> '' THEN + IF v_cnt1 > 0 OR v_cnt2 > 0 THEN + v_table_ddl := 'CREATE TABLE ' || in_schema || '."' || in_table || '" PARTITION OF ' || in_schema || '.' || v_parent || ' ' || v_partbound || v_relopts || ' ' || v_tablespace || '; ' || E'\\n'; + ELSE + v_table_ddl := 'CREATE TABLE ' || in_schema || '.' || in_table || ' PARTITION OF ' || in_schema || '.' || v_parent || ' ' || v_partbound || v_relopts || ' ' || v_tablespace || '; ' || E'\\n'; + END IF; + ELSE + IF v_cnt1 > 0 OR v_cnt2 > 0 THEN + v_table_ddl := 'CREATE TABLE ' || in_schema || '."' || in_table || '" PARTITION OF ' || in_schema || '.' || v_parent || ' ' || v_partbound || ' ' || v_tablespace || '; ' || E'\\n'; + ELSE + v_table_ddl := 'CREATE TABLE ' || in_schema || '.' || in_table || ' PARTITION OF ' || in_schema || '.' || v_parent || ' ' || v_partbound || ' ' || v_tablespace || '; ' || E'\\n'; + END IF; + END IF; + -- Jump to constraints and index section to add the check constraints and indexes and perhaps FKeys + END IF; + END IF; + IF bVerbose THEN RAISE INFO '(1)tabledef so far: %', v_table_ddl; END IF; + + IF NOT bPartition THEN + -- see if this is unlogged or temporary table + select c.relpersistence into v_persist from pg_class c, pg_namespace n where n.nspname = in_schema and n.oid = c.relnamespace and c.relname = in_table and c.relkind = 'r'; + IF v_persist = 'u' THEN + v_temp := 'UNLOGGED'; + ELSIF v_persist = 't' THEN + v_temp := 'TEMPORARY'; + ELSE + v_temp := ''; + END IF; + END IF; + + -- start the create definition for regular tables unless we are in progress creating an inheritance-based child table + IF NOT bPartition THEN + --Issue#17 fix for case-sensitive tables + -- SELECT count(*) INTO v_cnt1 FROM information_schema.tables t WHERE EXISTS (SELECT REGEXP_MATCHES(s.table_name, '([A-Z]+)','g') FROM information_schema.tables s + -- WHERE t.table_schema=s.table_schema AND t.table_name=s.table_name AND t.table_schema = quote_ident(in_schema) AND t.table_name = quote_ident(in_table) AND t.table_type = 'BASE TABLE'); + SELECT count(*) INTO v_cnt1 FROM information_schema.tables t WHERE EXISTS (SELECT REGEXP_MATCHES(s.table_name, '([A-Z]+)','g') FROM information_schema.tables s + WHERE t.table_schema=s.table_schema AND t.table_name=s.table_name AND t.table_schema = in_schema AND t.table_name = in_table AND t.table_type = 'BASE TABLE'); + IF v_cnt1 > 0 THEN + v_table_ddl := 'CREATE ' || v_temp || ' TABLE ' || in_schema || '."' || in_table || '" (' || E'\\n'; + ELSE + v_table_ddl := 'CREATE ' || v_temp || ' TABLE ' || in_schema || '.' || in_table || ' (' || E'\\n'; + END IF; + END IF; + -- RAISE INFO 'DEBUG2: tabledef so far: %', v_table_ddl; + -- define all of the columns in the table unless we are in progress creating an inheritance-based child table + IF NOT bPartition THEN + FOR v_colrec IN + SELECT c.column_name, c.data_type, c.udt_name, c.udt_schema, c.character_maximum_length, c.is_nullable, c.column_default, c.numeric_precision, c.numeric_scale, c.is_identity, c.identity_generation + FROM information_schema.columns c WHERE (table_schema, table_name) = (in_schema, in_table) ORDER BY ordinal_position + LOOP + IF bVerbose THEN RAISE INFO '(col loop) name=% type=% udt_name=% udt_schema=%', v_colrec.column_name, v_colrec.data_type, v_colrec.udt_name, v_colrec.udt_schema; END IF; + -- v17 fix: handle case-sensitive for pg_get_serial_sequence that requires SQL Identifier handling + -- SELECT CASE WHEN pg_get_serial_sequence(v_qualified, v_colrec.column_name) IS NOT NULL THEN True ELSE False END into bSerial; + SELECT CASE WHEN pg_get_serial_sequence(quote_ident(in_schema) || '.' || quote_ident(in_table), v_colrec.column_name) IS NOT NULL THEN True ELSE False END into bSerial; + IF bVerbose THEN + -- v17 fix: handle case-sensitive for pg_get_serial_sequence that requires SQL Identifier handling + -- SELECT pg_get_serial_sequence(v_qualified, v_colrec.column_name) into v_temp; + SELECT pg_get_serial_sequence(quote_ident(in_schema) || '.' || quote_ident(in_table), v_colrec.column_name) into v_temp; + IF v_temp IS NULL THEN v_temp = 'NA'; END IF; + SELECT pg_temp.pg_get_coldef(in_schema, in_table,v_colrec.column_name) INTO v_diag1; + --RAISE NOTICE 'DEBUG table: % Column: % datatype: % Serial=% serialval=% coldef=%', v_qualified, v_colrec.column_name, v_colrec.data_type, bSerial, v_temp, v_diag1; + --RAISE NOTICE 'DEBUG tabledef: %', v_table_ddl; + END IF; + + --Issue#17 put double-quotes around case-sensitive column names + SELECT COUNT(*) INTO v_cnt1 FROM information_schema.columns t WHERE EXISTS (SELECT REGEXP_MATCHES(s.column_name, '([A-Z]+)','g') FROM information_schema.columns s + WHERE t.table_schema=s.table_schema and t.table_name=s.table_name and t.column_name=s.column_name AND t.table_schema = quote_ident(in_schema) AND column_name = v_colrec.column_name); + + --Issue#19 put double-quotes around SQL keyword column names + SELECT COUNT(*) INTO v_cnt2 FROM pg_get_keywords() WHERE word = v_colrec.column_name AND catcode = 'R'; + + IF v_cnt1 > 0 OR v_cnt2 > 0 THEN + v_table_ddl := v_table_ddl || ' "' || v_colrec.column_name || '" '; + ELSE + v_table_ddl := v_table_ddl || ' ' || v_colrec.column_name || ' '; + END IF; + + v_table_ddl := v_table_ddl || + CASE WHEN v_colrec.udt_name in ('geometry', 'box2d', 'box2df', 'box3d', 'geography', 'geometry_dump', 'gidx', 'spheroid', 'valid_detail') + THEN v_colrec.udt_name + WHEN v_colrec.data_type = 'USER-DEFINED' + THEN v_colrec.udt_schema || '.' || v_colrec.udt_name + WHEN v_colrec.data_type = 'ARRAY' + -- Issue#6 fix: handle arrays + THEN pg_temp.pg_get_coldef(in_schema, in_table,v_colrec.column_name) + -- v17 fix: handle case-sensitive for pg_get_serial_sequence that requires SQL Identifier handling + -- WHEN pg_get_serial_sequence(v_qualified, v_colrec.column_name) IS NOT NULL + WHEN pg_get_serial_sequence(quote_ident(in_schema) || '.' || quote_ident(in_table), v_colrec.column_name) IS NOT NULL + -- Issue#8 fix: handle serial. Note: NOT NULL is implied so no need to declare it explicitly + THEN pg_temp.pg_get_coldef(in_schema, in_table,v_colrec.column_name) + ELSE v_colrec.data_type END + || CASE WHEN v_colrec.is_identity = 'YES' THEN CASE WHEN v_colrec.identity_generation = 'ALWAYS' THEN ' GENERATED ALWAYS AS IDENTITY' ELSE ' GENERATED BY DEFAULT AS IDENTITY' END ELSE '' END + || CASE WHEN v_colrec.character_maximum_length IS NOT NULL THEN ('(' || v_colrec.character_maximum_length || ')') + WHEN v_colrec.numeric_precision > 0 AND v_colrec.numeric_scale > 0 THEN '(' || v_colrec.numeric_precision || ',' || v_colrec.numeric_scale || ')' + ELSE '' END || ' ' + || CASE WHEN bSerial THEN '' ELSE CASE WHEN v_colrec.is_nullable = 'NO' THEN 'NOT NULL' ELSE 'NULL' END END + || CASE WHEN bSerial THEN '' ELSE CASE WHEN v_colrec.column_default IS NOT null THEN (' DEFAULT ' || v_colrec.column_default) ELSE '' END END + || ',' || E'\\n'; + END LOOP; + END IF; + IF bVerbose THEN RAISE INFO '(2)tabledef so far: %', v_table_ddl; END IF; + + -- define all the constraints: conparentid does not exist pre PGv11 + IF v_pgversion < 110000 THEN + FOR v_constraintrec IN + SELECT con.conname as constraint_name, con.contype as constraint_type, + CASE + WHEN con.contype = 'p' THEN 1 -- primary key constraint + WHEN con.contype = 'u' THEN 2 -- unique constraint + WHEN con.contype = 'f' THEN 3 -- foreign key constraint + WHEN con.contype = 'c' THEN 4 + ELSE 5 + END as type_rank, + pg_get_constraintdef(con.oid) as constraint_definition + FROM pg_catalog.pg_constraint con JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid JOIN pg_catalog.pg_namespace nsp ON nsp.oid = connamespace + WHERE nsp.nspname = in_schema AND rel.relname = in_table ORDER BY type_rank + LOOP + IF v_constraintrec.type_rank = 1 THEN + v_primary := True; + IF pkcnt = 0 THEN + v_constraint_name := v_constraintrec.constraint_name; + v_constraint_def := v_constraintrec.constraint_definition; + ELSE + -- Issue#16 handle external PG def + v_constraint_name := v_constraintrec.constraint_name; + SELECT 'ALTER TABLE ONLY ' || in_schema || '.' || c.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' INTO v_pkey_def + FROM pg_catalog.pg_constraint r, pg_class c, pg_namespace n where r.conrelid = c.oid and r.contype = 'p' and n.oid = r.connamespace and n.nspname = in_schema AND c.relname = in_table; + END IF; + IF bPartition THEN + continue; + END IF; + ELSE + v_constraint_name := v_constraintrec.constraint_name; + v_constraint_def := v_constraintrec.constraint_definition; + END IF; + if bVerbose THEN RAISE INFO 'DEBUG4: constraint name=% constraint_def=%', v_constraint_name,v_constraint_def; END IF; + constraintarr := constraintarr || v_constraintrec.constraint_name:: text; + + IF fktype <> 'FKEYS_INTERNAL' AND v_constraintrec.constraint_type = 'f' THEN + continue; + END IF; + + IF pkcnt = 0 THEN + v_table_ddl := v_table_ddl || ' ' -- note: two char spacer to start, to indent the column + || 'CONSTRAINT' || ' ' + || v_constraint_name || ' ' + || v_constraint_def + || ',' || E'\\n'; + END IF; + END LOOP; + + ELSE + FOR v_constraintrec IN + SELECT con.conname as constraint_name, con.contype as constraint_type, + CASE + WHEN con.contype = 'p' THEN 1 -- primary key constraint + WHEN con.contype = 'u' THEN 2 -- unique constraint + WHEN con.contype = 'f' THEN 3 -- foreign key constraint + WHEN con.contype = 'c' THEN 4 + ELSE 5 + END as type_rank, + pg_get_constraintdef(con.oid) as constraint_definition + FROM pg_catalog.pg_constraint con JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid JOIN pg_catalog.pg_namespace nsp ON nsp.oid = connamespace + WHERE nsp.nspname = in_schema AND rel.relname = in_table + --Issue#13 added this condition: + AND con.conparentid = 0 + ORDER BY type_rank + LOOP + IF v_constraintrec.type_rank = 1 THEN + v_primary := True; + IF pkcnt = 0 THEN + v_constraint_name := v_constraintrec.constraint_name; + v_constraint_def := v_constraintrec.constraint_definition; + ELSE + -- Issue#16 handle external PG def + v_constraint_name := v_constraintrec.constraint_name; + SELECT 'ALTER TABLE ONLY ' || in_schema || '.' || c.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' INTO v_pkey_def + FROM pg_catalog.pg_constraint r, pg_class c, pg_namespace n where r.conrelid = c.oid and r.contype = 'p' and n.oid = r.connamespace and n.nspname = in_schema AND c.relname = in_table; + END IF; + IF bPartition THEN + continue; + END IF; + ELSE + v_constraint_name := v_constraintrec.constraint_name; + v_constraint_def := v_constraintrec.constraint_definition; + END IF; + -- SELECT 'ALTER TABLE ONLY ' || c.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' as pkeyddl FROM pg_catalog.pg_constraint r, pg_class c, pg_namespace n where r.conrelid = c.oid and r.contype = 'p' and n.oid = r.connamespace and n.nspname = 'sample' AND c.relname = 'extensions_table'; + if bVerbose THEN RAISE INFO 'DEBUG4: constraint name=% constraint_def=%', v_constraint_name,v_constraint_def; END IF; + constraintarr := constraintarr || v_constraintrec.constraint_name:: text; + + IF fktype <> 'FKEYS_INTERNAL' AND v_constraintrec.constraint_type = 'f' THEN + continue; + END IF; + + IF pkcnt = 0 THEN + v_table_ddl := v_table_ddl || ' ' -- note: two char spacer to start, to indent the column + || 'CONSTRAINT' || ' ' + || v_constraint_name || ' ' + || v_constraint_def + || ',' || E'\\n'; + END IF; + END LOOP; + END IF; + IF bVerbose THEN RAISE INFO '(3)tabledef so far: %', v_table_ddl; END IF; + + -- drop the last comma before ending the create statement + v_table_ddl = substr(v_table_ddl, 0, length(v_table_ddl) - 1) || E'\\n'; + + -- --------------------------------------------------------------------------- + -- at this point we have everything up to the last table-enclosing parenthesis + -- --------------------------------------------------------------------------- + IF bVerbose THEN RAISE INFO '(4)tabledef so far: %', v_table_ddl; END IF; + + -- See if this is an inheritance-based child table and finish up the table create. + IF bPartition and bInheritance THEN + -- Issue#11: handle parent schema + -- v_table_ddl := v_table_ddl || ') INHERITS (' || in_schema || '.' || v_parent || ') ' || E'\\n' || v_relopts || ' ' || v_tablespace || ';' || E'\\n'; + IF v_parent_schema = '' OR v_parent_schema IS NULL THEN v_parent_schema = in_schema; END IF; + v_table_ddl := v_table_ddl || ') INHERITS (' || v_parent_schema || '.' || v_parent || ') ' || E'\\n' || v_relopts || ' ' || v_tablespace || ';' || E'\\n'; + END IF; + + IF v_pgversion >= 100000 AND NOT bPartition and NOT bInheritance THEN + -- See if this is a partitioned table (pg_class.relkind = 'p') and add the partitioned key + SELECT pg_get_partkeydef(c1.oid) as partition_key INTO v_partition_key FROM pg_class c1 JOIN pg_namespace n ON (n.oid = c1.relnamespace) LEFT JOIN pg_partitioned_table p ON (c1.oid = p.partrelid) + WHERE n.nspname = in_schema and n.oid = c1.relnamespace and c1.relname = in_table and c1.relkind = 'p'; + + IF v_partition_key IS NOT NULL AND v_partition_key <> '' THEN + -- add partition clause + -- NOTE: cannot specify default tablespace for partitioned relations + -- v_table_ddl := v_table_ddl || ') PARTITION BY ' || v_partition_key || ' ' || v_tablespace || ';' || E'\\n'; + v_table_ddl := v_table_ddl || ') PARTITION BY ' || v_partition_key || ';' || E'\\n'; + ELSEIF v_relopts <> '' THEN + v_table_ddl := v_table_ddl || ') ' || v_relopts || ' ' || v_tablespace || ';' || E'\\n'; + ELSE + -- end the create definition + v_table_ddl := v_table_ddl || ') ' || v_tablespace || ';' || E'\\n'; + END IF; + END IF; + + IF bVerbose THEN RAISE INFO '(5)tabledef so far: %', v_table_ddl; END IF; + + -- Add closing paren for regular tables + -- IF NOT bPartition THEN + -- v_table_ddl := v_table_ddl || ') ' || v_relopts || ' ' || v_tablespace || E';\\n'; + -- END IF; + -- RAISE NOTICE 'ddlsofar3: %', v_table_ddl; + + -- Issue#16 create the external PKEY def if indicated + IF v_pkey_def <> '' THEN + v_table_ddl := v_table_ddl || v_pkey_def || E'\\n'; + END IF; + + IF bVerbose THEN RAISE INFO '(6)tabledef so far: %', v_table_ddl; END IF; + + -- create indexes + FOR v_indexrec IN + SELECT indexdef, COALESCE(tablespace, 'pg_default') as tablespace, indexname FROM pg_indexes WHERE (schemaname, tablename) = (in_schema, in_table) + LOOP + -- RAISE INFO 'DEBUG6: indexname=%', v_indexrec.indexname; + -- loop through constraints and skip ones already defined + bSkip = False; + FOREACH constraintelement IN ARRAY constraintarr + LOOP + IF constraintelement = v_indexrec.indexname THEN + -- RAISE INFO 'DEBUG7: skipping index, %', v_indexrec.indexname; + bSkip = True; + EXIT; + END IF; + END LOOP; + if bSkip THEN CONTINUE; END IF; + + -- Add IF NOT EXISTS clause so partition index additions will not be created if declarative partition in effect and index already created on parent + v_indexrec.indexdef := REPLACE(v_indexrec.indexdef, 'CREATE INDEX', 'CREATE INDEX IF NOT EXISTS'); + -- RAISE INFO 'DEBUG8: adding index, %', v_indexrec.indexname; + + -- NOTE: cannot specify default tablespace for partitioned relations + IF v_partition_key IS NOT NULL AND v_partition_key <> '' THEN + v_table_ddl := v_table_ddl || v_indexrec.indexdef || ';' || E'\\n'; + ELSE + v_table_ddl := v_table_ddl || v_indexrec.indexdef || ' TABLESPACE ' || v_indexrec.tablespace || ';' || E'\\n'; + END IF; + + END LOOP; + IF bVerbose THEN RAISE INFO '(7)tabledef so far: %', v_table_ddl; END IF; + + -- Handle external foreign key defs here if applicable. + IF fktype = 'FKEYS_EXTERNAL' THEN + -- Issue#13 fix here too for conparentid = 0. and had to change to a loop to handle multiple return set, not a select into variable syntax. + -- Also had to account for PG V10 where there is no conparentid + IF v_pgversion < 110000 THEN + FOR v_constraintrec IN + SELECT 'ALTER TABLE ONLY ' || n.nspname || '.' || c2.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' as fkeydef + FROM pg_constraint r, pg_class c1, pg_namespace n, pg_class c2 where r.conrelid = c1.oid and r.contype = 'f' and n.nspname = in_schema and n.oid = r.connamespace and r.conrelid = c2.oid and c2.relname = in_table + LOOP + v_table_ddl := v_table_ddl || v_constraintrec.fkeydef || ';' || E'\\n'; + IF bVerbose THEN RAISE INFO 'keydef = %', v_constraintrec.fkeydef; END IF; + END LOOP; + ELSE + FOR v_constraintrec IN + SELECT 'ALTER TABLE ONLY ' || n.nspname || '.' || c2.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' as fkeydef + FROM pg_constraint r, pg_class c1, pg_namespace n, pg_class c2 where r.conrelid = c1.oid and r.contype = 'f' and n.nspname = in_schema and n.oid = r.connamespace and r.conrelid = c2.oid and c2.relname = in_table and r.conparentid = 0 + LOOP + v_table_ddl := v_table_ddl || v_constraintrec.fkeydef || E'\\n'; + IF bVerbose THEN RAISE INFO 'keydef = %', v_constraintrec.fkeydef; END IF; + END LOOP; + END IF; + + ELSIF fktype = 'FKEYS_COMMENTED' THEN + SELECT '-- ALTER TABLE ONLY ' || n.nspname || '.' || c2.relname || ' ADD CONSTRAINT ' || r.conname || ' ' || pg_catalog.pg_get_constraintdef(r.oid, true) || ';' into v_fkey_defs + FROM pg_constraint r, pg_class c1, pg_namespace n, pg_class c2 where r.conrelid = c1.oid and r.contype = 'f' and n.nspname = in_schema and n.oid = r.connamespace and r.conrelid = c2.oid and c2.relname = in_table; + IF v_fkey_defs IS NOT NULL THEN + v_table_ddl := v_table_ddl || v_fkey_defs; + END IF; + END IF; + IF bVerbose THEN RAISE INFO '(8)tabledef so far: %', v_table_ddl; END IF; + + IF trigtype = 'INCLUDE_TRIGGERS' THEN + -- Issue#14: handle multiple triggers for a table + FOR v_trigrec IN + select pg_get_triggerdef(t.oid, True) || ';' as triggerdef FROM pg_trigger t, pg_class c, pg_namespace n + WHERE n.nspname = in_schema and n.oid = c.relnamespace and c.relname = in_table and c.relkind = 'r' and t.tgrelid = c.oid and NOT t.tgisinternal + LOOP + v_table_ddl := v_table_ddl || v_trigrec.triggerdef; + v_table_ddl := v_table_ddl || E'\\n'; + IF bVerbose THEN RAISE INFO 'triggerdef = %', v_trigrec.triggerdef; END IF; + END LOOP; + END IF; + + -- add empty line + v_table_ddl := v_table_ddl || E'\\n'; + + RETURN v_table_ddl; + + EXCEPTION + WHEN others THEN + BEGIN + GET STACKED DIAGNOSTICS v_diag1 = MESSAGE_TEXT, v_diag2 = PG_EXCEPTION_DETAIL, v_diag3 = PG_EXCEPTION_HINT, v_diag4 = RETURNED_SQLSTATE, v_diag5 = PG_CONTEXT, v_diag6 = PG_EXCEPTION_CONTEXT; + -- v_ret := 'line=' || v_diag6 || '. '|| v_diag4 || '. ' || v_diag1 || ' .' || v_diag2 || ' .' || v_diag3; + v_ret := 'line=' || v_diag6 || '. '|| v_diag4 || '. ' || v_diag1; + RAISE EXCEPTION '%', v_ret; + -- put additional coding here if necessarY + RETURN ''; + END; + + END; + $$;`, + { compress: true, removeAll: true } +) diff --git a/apps/studio/lib/helpers.ts b/apps/studio/lib/helpers.ts index b09b1829750..b84febda2d2 100644 --- a/apps/studio/lib/helpers.ts +++ b/apps/studio/lib/helpers.ts @@ -1,7 +1,5 @@ -import { post } from 'lib/common/fetch' -import { API_URL, DEFAULT_MINIMUM_PASSWORD_STRENGTH, PASSWORD_STRENGTH } from 'lib/constants' -import { toast } from 'react-hot-toast' -import { v4 as _uuidV4 } from 'uuid' +export { default as passwordStrength } from './password-strength' +export { default as uuidv4 } from './uuid' export const tryParseJson = (jsonString: any) => { try { @@ -50,10 +48,6 @@ export const removeJSONTrailingComma = (jsonString: string) => { return jsonString.replace(/,\s*(?=[\}\]])/g, '') } -export const uuidv4 = () => { - return _uuidV4() -} - export const timeout = (ms: number) => { return new Promise((resolve) => setTimeout(resolve, ms)) } @@ -163,49 +157,6 @@ export const copyToClipboard = async (str: string | Promise, callback = } } -export async function passwordStrength(value: string) { - let message: string = '' - let warning: string = '' - let strength: number = 0 - - if (value && value !== '') { - if (value.length > 99) { - message = `${PASSWORD_STRENGTH[0]} Maximum length of password exceeded` - warning = `Password should be less than 100 characters` - } else { - // [Joshen] Unable to use RQ atm due to our Jest tests being in JS - const response = await post(`${API_URL}/profile/password-check`, { password: value }) - if (!response.error) { - const { result } = response - const resultScore = result?.score ?? 0 - - const score = (PASSWORD_STRENGTH as any)[resultScore] - const suggestions = result.feedback?.suggestions - ? result.feedback.suggestions.join(' ') - : '' - - message = `${score} ${suggestions}` - strength = resultScore - - // warning message for anything below 4 strength :string - if (resultScore < DEFAULT_MINIMUM_PASSWORD_STRENGTH) { - warning = `${ - result?.feedback?.warning ? result?.feedback?.warning + '.' : '' - } You need a stronger password.` - } - } else { - toast.error(`Failed to check password strength: ${response.error.message}`) - } - } - } - - return { - message, - warning, - strength, - } -} - export const detectBrowser = () => { if (!navigator) return undefined diff --git a/apps/studio/lib/password-strength.ts b/apps/studio/lib/password-strength.ts new file mode 100644 index 00000000000..d1da5a4255e --- /dev/null +++ b/apps/studio/lib/password-strength.ts @@ -0,0 +1,46 @@ +import { post } from 'lib/common/fetch' +import { API_URL, DEFAULT_MINIMUM_PASSWORD_STRENGTH, PASSWORD_STRENGTH } from 'lib/constants' +import { toast } from 'react-hot-toast' + +export default async function passwordStrength(value: string) { + let message: string = '' + let warning: string = '' + let strength: number = 0 + + if (value && value !== '') { + if (value.length > 99) { + message = `${PASSWORD_STRENGTH[0]} Maximum length of password exceeded` + warning = `Password should be less than 100 characters` + } else { + // [Joshen] Unable to use RQ atm due to our Jest tests being in JS + const response = await post(`${API_URL}/profile/password-check`, { password: value }) + if (!response.error) { + const { result } = response + const resultScore = result?.score ?? 0 + + const score = (PASSWORD_STRENGTH as any)[resultScore] + const suggestions = result.feedback?.suggestions + ? result.feedback.suggestions.join(' ') + : '' + + message = `${score} ${suggestions}` + strength = resultScore + + // warning message for anything below 4 strength :string + if (resultScore < DEFAULT_MINIMUM_PASSWORD_STRENGTH) { + warning = `${ + result?.feedback?.warning ? result?.feedback?.warning + '.' : '' + } You need a stronger password.` + } + } else { + toast.error(`Failed to check password strength: ${response.error.message}`) + } + } + } + + return { + message, + warning, + strength, + } +} diff --git a/apps/studio/lib/uuid.ts b/apps/studio/lib/uuid.ts new file mode 100644 index 00000000000..c33432b302d --- /dev/null +++ b/apps/studio/lib/uuid.ts @@ -0,0 +1,7 @@ +import { v4 as _uuidV4 } from 'uuid' + +const uuidv4 = () => { + return _uuidV4() +} + +export default uuidv4 diff --git a/apps/studio/lib/vercelConfigs.ts b/apps/studio/lib/vercelConfigs.ts index c59555650ed..d0dd57aa583 100644 --- a/apps/studio/lib/vercelConfigs.ts +++ b/apps/studio/lib/vercelConfigs.ts @@ -1,4 +1,4 @@ -import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.constants' +import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.queries' const QuickStart = SQL_TEMPLATES.filter((template) => template.type === 'quickstart') diff --git a/packages/common/Providers.tsx b/packages/common/Providers.tsx index dcb2d3e5162..123c17134fc 100644 --- a/packages/common/Providers.tsx +++ b/packages/common/Providers.tsx @@ -1,5 +1,5 @@ import { ThemeProvider as NextThemesProvider } from 'next-themes' -import { type ThemeProviderProps } from 'next-themes/dist/types' +import type { ThemeProviderProps } from 'next-themes/dist/types' export function ThemeProvider({ children, ...props }: ThemeProviderProps) { // @ts-ignore next-themes is old :/ From 0073518136033b68952a7799d862ae61789da1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Tue, 5 Mar 2024 12:51:11 +0800 Subject: [PATCH 014/163] perf: improve prism-react-renderer setup (#21752) --- .../AIPolicyEditorPanel/PolicyTemplates.tsx | 1 - .../interfaces/Auth/Users/UsersListItem.tsx | 4 +-- .../interfaces/SignIn/SignInMfaForm.tsx | 2 +- .../to-be-cleaned/SimpleCodeBlock.tsx | 20 ++++---------- apps/studio/lib/gotrue.ts | 2 +- apps/studio/package.json | 3 +-- apps/studio/pages/_app.tsx | 7 +---- package-lock.json | 27 +++++++++++++++---- packages/common/auth.tsx | 2 +- 9 files changed, 33 insertions(+), 35 deletions(-) diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/PolicyTemplates.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/PolicyTemplates.tsx index 8e3a65e5ff0..62f1fffdf32 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/PolicyTemplates.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/PolicyTemplates.tsx @@ -8,7 +8,6 @@ import CardButton from 'components/ui/CardButton' import CopyButton from 'components/ui/CopyButton' import NoSearchResults from 'components/ui/NoSearchResults' import { getGeneralPolicyTemplates } from '../PolicyEditorModal/PolicyEditorModal.constants' -import { PolicyTemplate } from '../PolicyTemplates/PolicyTemplates.constants' interface PolicyTemplatesProps { selectedTemplate?: string diff --git a/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx b/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx index 1d300bcd92e..dc2d8eb11ee 100644 --- a/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx +++ b/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx @@ -56,9 +56,7 @@ const UserListItem = ({
    - - {user.id} - + {user.id}
    ...
    diff --git a/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx b/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx index f5f2cfc2c64..23108222919 100644 --- a/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx +++ b/apps/studio/components/interfaces/SignIn/SignInMfaForm.tsx @@ -1,4 +1,4 @@ -import { AuthError } from '@supabase/gotrue-js' +import type { AuthError } from '@supabase/gotrue-js' import type { Factor } from '@supabase/supabase-js' import { useQueryClient } from '@tanstack/react-query' import Link from 'next/link' diff --git a/apps/studio/components/to-be-cleaned/SimpleCodeBlock.tsx b/apps/studio/components/to-be-cleaned/SimpleCodeBlock.tsx index 31750374f04..f238c8fa330 100644 --- a/apps/studio/components/to-be-cleaned/SimpleCodeBlock.tsx +++ b/apps/studio/components/to-be-cleaned/SimpleCodeBlock.tsx @@ -5,16 +5,15 @@ * LICENSE file in the root directory of this source tree. */ -import rangeParser from 'parse-numeric-range' -import Highlight, { Language, defaultProps } from 'prism-react-renderer' -import darkTheme from 'prism-react-renderer/themes/vsDark' -import lightTheme from 'prism-react-renderer/themes/nightOwlLight' +import { Prism, themes, Highlight, Language } from 'prism-react-renderer' import { PropsWithChildren, useEffect, useRef, useState } from 'react' import { Button } from 'ui' import { useTheme } from 'next-themes' import { copyToClipboard } from 'lib/helpers' +import { dart } from 'lib/constants/prism' + +dart(Prism) -const highlightLinesRangeRegex = /{([\d,-]+)}/ const prism = { defaultLanguage: 'js', plugins: ['line-numbers', 'show-language'], @@ -23,7 +22,6 @@ const prism = { interface SimpleCodeBlockProps { parentClassName?: string className?: string - metastring?: string showCopy?: boolean } @@ -31,20 +29,13 @@ const SimpleCodeBlock = ({ children, parentClassName, className: languageClassName, - metastring, showCopy = true, }: PropsWithChildren) => { const { resolvedTheme } = useTheme() const [showCopied, setShowCopied] = useState(false) const target = useRef(null) - const button = useRef(null) let highlightLines: any = [] - if (metastring && highlightLinesRangeRegex.test(metastring)) { - const highlightLinesRange = metastring.match(highlightLinesRangeRegex)?.[1] - if (highlightLinesRange) highlightLines = rangeParser(highlightLinesRange).filter((n) => n > 0) - } - useEffect(() => { if (!showCopied) return const timer = setTimeout(() => setShowCopied(false), 2000) @@ -63,8 +54,7 @@ const SimpleCodeBlock = ({ return ( diff --git a/apps/studio/lib/gotrue.ts b/apps/studio/lib/gotrue.ts index 2884a5395fb..140cddcfe22 100644 --- a/apps/studio/lib/gotrue.ts +++ b/apps/studio/lib/gotrue.ts @@ -1,4 +1,4 @@ -import { Session, User } from '@supabase/gotrue-js' +import type { Session, User } from '@supabase/gotrue-js' import { gotrueClient } from 'common' export const auth = gotrueClient diff --git a/apps/studio/package.json b/apps/studio/package.json index 0536949144d..af058be1ed5 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -69,10 +69,9 @@ "openapi-fetch": "^0.6.1", "p-queue": "^6.6.2", "papaparse": "^5.3.1", - "parse-numeric-range": "^1.3.0", "path-to-regexp": "^6.2.0", "pg-minify": "^1.6.3", - "prism-react-renderer": "^1.2.1", + "prism-react-renderer": "^2.3.1", "react": "^18.2.0", "react-beautiful-dnd": "^13.1.0", "react-contexify": "^5.0.0", diff --git a/apps/studio/pages/_app.tsx b/apps/studio/pages/_app.tsx index 1889589c012..ed5273a01f7 100644 --- a/apps/studio/pages/_app.tsx +++ b/apps/studio/pages/_app.tsx @@ -31,8 +31,6 @@ import utc from 'dayjs/plugin/utc' import Head from 'next/head' import { useEffect, useMemo, useRef, useState } from 'react' import toast from 'react-hot-toast' -// @ts-ignore -import Prism from 'prism-react-renderer/prism' import { ConsentToast } from 'ui-patterns/ConsentToast' import PortalToast from 'ui/src/layout/PortalToast' @@ -49,11 +47,10 @@ import { useRootQueryClient } from 'data/query-client' import { StoreProvider } from 'hooks' import { AuthProvider } from 'lib/auth' import { BASE_PATH, IS_PLATFORM, LOCAL_STORAGE_KEYS } from 'lib/constants' -import { dart } from 'lib/constants/prism' + import { ProfileProvider } from 'lib/profile' import { useAppStateSnapshot } from 'state/app-state' import { RootStore } from 'stores' -import HCaptchaLoadedStore from 'stores/hcaptcha-loaded-store' import type { AppPropsWithLayout } from 'types' import { Toaster } from 'ui' import { FeaturePreviewContextProvider } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' @@ -63,7 +60,6 @@ dayjs.extend(customParseFormat) dayjs.extend(utc) dayjs.extend(timezone) dayjs.extend(relativeTime) -dart(Prism) loader.config({ // [Joshen] Attempt for offline support/bypass ISP issues is to store the assets required for monaco @@ -180,7 +176,6 @@ function CustomApp({ Component, pageProps }: AppPropsWithLayout) { - {!isTestEnv && } diff --git a/package-lock.json b/package-lock.json index 81a1b75a996..34fa14583c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1160,10 +1160,9 @@ "openapi-fetch": "^0.6.1", "p-queue": "^6.6.2", "papaparse": "^5.3.1", - "parse-numeric-range": "^1.3.0", "path-to-regexp": "^6.2.0", "pg-minify": "^1.6.3", - "prism-react-renderer": "^1.2.1", + "prism-react-renderer": "^2.3.1", "react": "^18.2.0", "react-beautiful-dnd": "^13.1.0", "react-contexify": "^5.0.0", @@ -14724,6 +14723,11 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/prismjs": { + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz", + "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==" + }, "node_modules/@types/prop-types": { "version": "15.7.8", "license": "MIT" @@ -33205,10 +33209,23 @@ } }, "node_modules/prism-react-renderer": { - "version": "1.3.5", - "license": "MIT", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/prism-react-renderer/-/prism-react-renderer-2.3.1.tgz", + "integrity": "sha512-Rdf+HzBLR7KYjzpJ1rSoxT9ioO85nZngQEoFIhL07XhtJHlCU3SOz0GJ6+qvMyQe0Se+BV3qpe6Yd/NmQF5Juw==", + "dependencies": { + "@types/prismjs": "^1.26.0", + "clsx": "^2.0.0" + }, "peerDependencies": { - "react": ">=0.14.9" + "react": ">=16.0.0" + } + }, + "node_modules/prism-react-renderer/node_modules/clsx": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", + "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==", + "engines": { + "node": ">=6" } }, "node_modules/prismjs": { diff --git a/packages/common/auth.tsx b/packages/common/auth.tsx index 4d5a943ab9d..86cfffdaabc 100644 --- a/packages/common/auth.tsx +++ b/packages/common/auth.tsx @@ -1,4 +1,4 @@ -import { Session } from '@supabase/supabase-js' +import type { Session } from '@supabase/supabase-js' import { createContext, PropsWithChildren, From c98c59938ad60ddc0dfc6ee3dbffd5bbea14f413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Tue, 5 Mar 2024 12:51:47 +0800 Subject: [PATCH 015/163] perf: lazyload feature preview modal (#21744) --- apps/studio/pages/_app.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/studio/pages/_app.tsx b/apps/studio/pages/_app.tsx index ed5273a01f7..205530c14af 100644 --- a/apps/studio/pages/_app.tsx +++ b/apps/studio/pages/_app.tsx @@ -54,13 +54,25 @@ import { RootStore } from 'stores' import type { AppPropsWithLayout } from 'types' import { Toaster } from 'ui' import { FeaturePreviewContextProvider } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' -import FeaturePreviewModal from 'components/interfaces/App/FeaturePreview/FeaturePreviewModal' +import dynamic from 'next/dynamic' dayjs.extend(customParseFormat) dayjs.extend(utc) dayjs.extend(timezone) dayjs.extend(relativeTime) +/** + * FeaturePreviewModal is quite heavy with react-markdown and other dependencies, not needed on initial load, + * so we will load it lazily. + */ +const LazyFeaturePreviewModal = dynamic( + () => + import('components/interfaces/App/FeaturePreview/FeaturePreviewModal').then( + (mod) => mod.default + ), + { ssr: false } +) + loader.config({ // [Joshen] Attempt for offline support/bypass ISP issues is to store the assets required for monaco // locally. We're however, only storing the assets which we need (based on what the network tab loads @@ -166,7 +178,7 @@ function CustomApp({ Component, pageProps }: AppPropsWithLayout) { {getLayout()} - + From f16810af06fd42c613d5d93bd314e23b10c0ebd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Tue, 5 Mar 2024 12:52:39 +0800 Subject: [PATCH 016/163] perf: load hcaptcha on demand (#21745) --- .../Payment/AddNewPaymentMethodModal.tsx | 4 +-- apps/studio/pages/new/index.tsx | 17 ++++++---- apps/studio/stores/hcaptcha-loaded-store.tsx | 31 ------------------- 3 files changed, 13 insertions(+), 39 deletions(-) delete mode 100644 apps/studio/stores/hcaptcha-loaded-store.tsx diff --git a/apps/studio/components/interfaces/Billing/Payment/AddNewPaymentMethodModal.tsx b/apps/studio/components/interfaces/Billing/Payment/AddNewPaymentMethodModal.tsx index 0041cbb6207..f822b55b0b5 100644 --- a/apps/studio/components/interfaces/Billing/Payment/AddNewPaymentMethodModal.tsx +++ b/apps/studio/components/interfaces/Billing/Payment/AddNewPaymentMethodModal.tsx @@ -8,7 +8,6 @@ import { Modal } from 'ui' import { useOrganizationPaymentMethodSetupIntent } from 'data/organizations/organization-payment-method-setup-intent-mutation' import { useSelectedOrganization, useStore } from 'hooks' import { STRIPE_PUBLIC_KEY } from 'lib/constants' -import { useIsHCaptchaLoaded } from 'stores/hcaptcha-loaded-store' import AddPaymentMethodForm from './AddPaymentMethodForm' interface AddNewPaymentMethodModalProps { @@ -31,7 +30,7 @@ const AddNewPaymentMethodModal = ({ const [intent, setIntent] = useState() const selectedOrganization = useSelectedOrganization() - const captchaLoaded = useIsHCaptchaLoaded() + const [captchaLoaded, setHCaptchaLoaded] = useState(false) const [captchaToken, setCaptchaToken] = useState(null) const [captchaRef, setCaptchaRef] = useState(null) @@ -126,6 +125,7 @@ const AddNewPaymentMethodModal = ({ onExpire={() => { setCaptchaToken(null) }} + onLoad={() => setHCaptchaLoaded(true)} /> { const { resolvedTheme } = useTheme() const [intent, setIntent] = useState() - const captchaLoaded = useIsHCaptchaLoaded() + const [captchaLoaded, setHCaptchaLoaded] = useState(false) const [captchaToken, setCaptchaToken] = useState(null) const [captchaRef, setCaptchaRef] = useState(null) @@ -86,13 +85,19 @@ const Wizard: NextPageWithLayout = () => { ref={captchaRefCallback} sitekey={process.env.NEXT_PUBLIC_HCAPTCHA_SITE_KEY!} size="invisible" + onOpen={() => { + // [Joshen] This is to ensure that hCaptcha popup remains clickable + if (document !== undefined) document.body.classList.add('!pointer-events-auto') + }} + onClose={() => { + onLocalCancel() + if (document !== undefined) document.body.classList.remove('!pointer-events-auto') + }} onVerify={(token) => { setCaptchaToken(token) + if (document !== undefined) document.body.classList.remove('!pointer-events-auto') }} - onClose={onLocalCancel} - onExpire={() => { - setCaptchaToken(null) - }} + onLoad={() => setHCaptchaLoaded(true)} /> {intent && ( diff --git a/apps/studio/stores/hcaptcha-loaded-store.tsx b/apps/studio/stores/hcaptcha-loaded-store.tsx deleted file mode 100644 index 008053d20b0..00000000000 --- a/apps/studio/stores/hcaptcha-loaded-store.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import HCaptcha from '@hcaptcha/react-hcaptcha' -import { proxy, useSnapshot } from 'valtio' - -const hCaptchaLoadedStoreState = proxy({ - loaded: false, - setLoaded() { - hCaptchaLoadedStoreState.loaded = true - }, -}) - -export const useIsHCaptchaLoaded = () => { - const snap = useSnapshot(hCaptchaLoadedStoreState) - - return snap.loaded -} - -const HCaptchaLoadedStore = () => { - const onLoad = () => { - hCaptchaLoadedStoreState.setLoaded() - } - - return ( - - ) -} - -export default HCaptchaLoadedStore From c390068102091b76b4fd0d6c3e22d25f55e4c114 Mon Sep 17 00:00:00 2001 From: Beng Eu Date: Tue, 5 Mar 2024 13:14:43 +0800 Subject: [PATCH 017/163] fix: handle new size for connection pooling settings (#21700) --- .../ConnectionPooling.constants.ts | 8 ++++++ .../ConnectionPooling/ConnectionPooling.tsx | 26 +++++++++++-------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.constants.ts b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.constants.ts index facaaac1308..3d7f7ea2653 100644 --- a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.constants.ts +++ b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.constants.ts @@ -2,6 +2,14 @@ // https://github.com/supabase/infrastructure/blob/develop/worker/src/lib/constants.ts#L544-L596 export const POOLING_OPTIMIZATIONS = { + ci_nano: { + maxClientConn: 100, + poolSize: 10, + }, + ci_micro: { + maxClientConn: 200, + poolSize: 15, + }, ci_small: { maxClientConn: 200, poolSize: 15, diff --git a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx index a0902130f68..8b218e9602f 100644 --- a/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx +++ b/apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx @@ -1,6 +1,7 @@ import { zodResolver } from '@hookform/resolvers/zod' import { PermissionAction } from '@supabase/shared-types/out/constants' import { useParams } from 'common' +import { capitalize } from 'lodash' import { Fragment, useEffect } from 'react' import { SubmitHandler, useForm } from 'react-hook-form' import { @@ -68,14 +69,17 @@ export const ConnectionPooling = () => { const { data: addons } = useProjectAddonsQuery({ projectRef }) const computeInstance = addons?.selected_addons.find((addon) => addon.type === 'compute_instance') - const defaultPoolSize = - POOLING_OPTIMIZATIONS?.[ - computeInstance?.variant.identifier as keyof typeof POOLING_OPTIMIZATIONS - ]?.poolSize ?? 15 // [TODO] 15 is for micro, need to change to 10 for nano - const defaultMaxClientConn = - POOLING_OPTIMIZATIONS?.[ - computeInstance?.variant.identifier as keyof typeof POOLING_OPTIMIZATIONS - ]?.maxClientConn ?? 200 + const poolingOptimizations = + POOLING_OPTIMIZATIONS[ + (computeInstance?.variant.identifier as keyof typeof POOLING_OPTIMIZATIONS) ?? + project?.infra_compute_size === 'nano' + ? 'ci_nano' + : 'ci_micro' + ] + const defaultPoolSize = poolingOptimizations.poolSize ?? 15 + const defaultMaxClientConn = poolingOptimizations.maxClientConn ?? 200 + const computeSize = + computeInstance?.variant.name ?? capitalize(project?.infra_compute_size) ?? 'Micro' const { data: poolingInfo, @@ -317,7 +321,7 @@ export const ConnectionPooling = () => { The maximum number of connections made to the underlying Postgres cluster, per user+db combination. Pool size has a default of {defaultPoolSize} based - on your compute size of {computeInstance?.variant.name ?? 'Micro'}. + on your compute size of {computeSize}. Please refer to our{' '} @@ -354,8 +358,8 @@ export const ConnectionPooling = () => { The maximum number of concurrent client connections allowed. This value is - fixed at {defaultMaxClientConn} based on your compute size of{' '} - {computeInstance?.variant.name ?? 'Micro'} and cannot be changed. + fixed at {defaultMaxClientConn} based on your compute size of {computeSize}{' '} + and cannot be changed. Please refer to our{' '} From 5b9630ecfc61af015b53ecdd05bbf7f6569d0b92 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Tue, 5 Mar 2024 13:44:44 +0800 Subject: [PATCH 018/163] Chore/upgrade sb (#21726) * remove un-needed stuff * Update preview.js * Update preview.js * upgrade sb * Update preview.js * Update main.js --- apps/storybook/.storybook/main.js | 5 +- apps/storybook/.storybook/preview.js | 15 - apps/storybook/package.json | 24 +- package-lock.json | 3245 +++++++++++++++++++++++--- 4 files changed, 2883 insertions(+), 406 deletions(-) diff --git a/apps/storybook/.storybook/main.js b/apps/storybook/.storybook/main.js index cdbe12a8b27..210cbfea196 100644 --- a/apps/storybook/.storybook/main.js +++ b/apps/storybook/.storybook/main.js @@ -26,8 +26,9 @@ const config = { getAbsolutePath('@storybook/addon-onboarding'), getAbsolutePath('@storybook/addon-interactions'), getAbsolutePath('@storybook/addon-mdx-gfm'), - '@storybook/addon-styling-webpack', - '@storybook/addon-themes', + getAbsolutePath('@storybook/addon-styling-webpack'), + getAbsolutePath('@storybook/addon-themes'), + getAbsolutePath('@storybook/addon-mdx-gfm'), ], framework: { name: getAbsolutePath('@storybook/nextjs'), diff --git a/apps/storybook/.storybook/preview.js b/apps/storybook/.storybook/preview.js index b627b087019..2075734049b 100644 --- a/apps/storybook/.storybook/preview.js +++ b/apps/storybook/.storybook/preview.js @@ -1,19 +1,6 @@ import { withThemeByClassName } from '@storybook/addon-themes' import './preview.css' -/** @type { import('@storybook/react').Preview } */ -const preview = { - parameters: { - actions: { argTypesRegex: '^on[A-Z].*' }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/i, - }, - }, - }, -} - export const decorators = [ withThemeByClassName({ themes: { @@ -24,5 +11,3 @@ export const decorators = [ defaultTheme: 'dark', }), ] - -export default preview diff --git a/apps/storybook/package.json b/apps/storybook/package.json index dfc418104c0..9fedddb1606 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -11,18 +11,22 @@ "author": "", "license": "ISC", "devDependencies": { - "@storybook/addon-essentials": "^7.6.17", - "@storybook/addon-interactions": "^7.6.17", - "@storybook/addon-links": "^7.6.17", - "@storybook/addon-onboarding": "^1.0.11", + "@storybook/addon-essentials": "^8.0.0-rc.1", + "@storybook/addon-interactions": "^8.0.0-rc.1", + "@storybook/addon-links": "^8.0.0-rc.1", + "@storybook/addon-mdx-gfm": "^8.0.0-rc.1", + "@storybook/addon-onboarding": "^8.0.0-rc.1", "@storybook/addon-styling-webpack": "^0.0.6", - "@storybook/addon-themes": "^7.6.17", - "@storybook/blocks": "^7.6.17", - "@storybook/nextjs": "^7.6.17", - "@storybook/react": "^7.6.17", - "@storybook/test": "^7.6.17", + "@storybook/addon-themes": "^8.0.0-rc.1", + "@storybook/blocks": "^8.0.0-rc.1", + "@storybook/nextjs": "^8.0.0-rc.1", + "@storybook/react": "^8.0.0-rc.1", + "@storybook/test": "^8.0.0-rc.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "storybook": "^7.0.0" + "storybook": "^8.0.0-rc.1" + }, + "dependencies": { + "@storybook/node-logger": "^8.0.0-rc.1" } } diff --git a/package-lock.json b/package-lock.json index 34fa14583c0..a4d8b2e5139 100644 --- a/package-lock.json +++ b/package-lock.json @@ -760,30 +760,366 @@ "apps/storybook": { "version": "1.0.0", "license": "ISC", + "dependencies": { + "@storybook/node-logger": "^8.0.0-rc.1" + }, "devDependencies": { - "@storybook/addon-essentials": "^7.6.17", - "@storybook/addon-interactions": "^7.6.17", - "@storybook/addon-links": "^7.6.17", - "@storybook/addon-onboarding": "^1.0.11", + "@storybook/addon-essentials": "^8.0.0-rc.1", + "@storybook/addon-interactions": "^8.0.0-rc.1", + "@storybook/addon-links": "^8.0.0-rc.1", + "@storybook/addon-mdx-gfm": "^8.0.0-rc.1", + "@storybook/addon-onboarding": "^8.0.0-rc.1", "@storybook/addon-styling-webpack": "^0.0.6", - "@storybook/addon-themes": "^7.6.17", - "@storybook/blocks": "^7.6.17", - "@storybook/nextjs": "^7.6.17", - "@storybook/react": "^7.6.17", - "@storybook/test": "^7.6.17", + "@storybook/addon-themes": "^8.0.0-rc.1", + "@storybook/blocks": "^8.0.0-rc.1", + "@storybook/nextjs": "^8.0.0-rc.1", + "@storybook/react": "^8.0.0-rc.1", + "@storybook/test": "^8.0.0-rc.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "storybook": "^7.0.0" + "storybook": "^8.0.0-rc.1" + } + }, + "apps/storybook/node_modules/@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "apps/storybook/node_modules/@mdx-js/react": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.0.1.tgz", + "integrity": "sha512-9ZrPIU4MGf6et1m1ov3zKf+q9+deetI51zprKB1D/z3NOb+rUxxtEl3mCjW5wTGh6VhRdwPueh1oRzi6ezkA8A==", + "dev": true, + "dependencies": { + "@types/mdx": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=16", + "react": ">=16" + } + }, + "apps/storybook/node_modules/@storybook/addon-actions": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-8.0.0-rc.1.tgz", + "integrity": "sha512-Xl8RA2obW0MJ6Y8hQxx8LmwoNt0gKT20UADYp+QusaV4prGw9XVf43eJWq704LO4dq7HFTah3hkDLwGhTsJ5hw==", + "dev": true, + "dependencies": { + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/global": "^5.0.0", + "@types/uuid": "^9.0.1", + "dequal": "^2.0.2", + "polished": "^4.2.2", + "uuid": "^9.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-backgrounds": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-backgrounds/-/addon-backgrounds-8.0.0-rc.1.tgz", + "integrity": "sha512-29E8XT0IJnwe2N0SyQpMZgOCKoPz/zjzOyucQj0vyG+ZXUXugiyVMI6jWitkUxYydwJWvsuaem+/OGfC5SdaWg==", + "dev": true, + "dependencies": { + "@storybook/global": "^5.0.0", + "memoizerific": "^1.11.3", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-controls": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-controls/-/addon-controls-8.0.0-rc.1.tgz", + "integrity": "sha512-Yat3OuFbhxD2vjEhT1NxiiKNuGxPUKvlSRgBxlD++8XuWKm6HFeGh2R3OwIndaYvsbpzrV8F4GKM4NYrCaONfQ==", + "dev": true, + "dependencies": { + "@storybook/blocks": "8.0.0-rc.1", + "lodash": "^4.17.21", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-docs": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-docs/-/addon-docs-8.0.0-rc.1.tgz", + "integrity": "sha512-oDktwaXuDUV+laLg6BB4mEXdncAHyHeePO9eE0t0lqxU50qkqxQ1OJqafyM1Cbrt/8SNVFlvd+XYKaZCLPyW5w==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@mdx-js/react": "^3.0.0", + "@storybook/blocks": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/components": "8.0.0-rc.1", + "@storybook/csf-plugin": "8.0.0-rc.1", + "@storybook/csf-tools": "8.0.0-rc.1", + "@storybook/global": "^5.0.0", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", + "@storybook/react-dom-shim": "8.0.0-rc.1", + "@storybook/theming": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "fs-extra": "^11.1.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", + "rehype-external-links": "^3.0.0", + "rehype-slug": "^6.0.0", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-essentials": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-essentials/-/addon-essentials-8.0.0-rc.1.tgz", + "integrity": "sha512-HgzsK9TRncn7MJ6QZBJGWyhcpyll3UEMknSenX9e5HYSd4npMFyqi6EAFPYQTBtjqEHsjdeRzGiuSX64a9UBLQ==", + "dev": true, + "dependencies": { + "@storybook/addon-actions": "8.0.0-rc.1", + "@storybook/addon-backgrounds": "8.0.0-rc.1", + "@storybook/addon-controls": "8.0.0-rc.1", + "@storybook/addon-docs": "8.0.0-rc.1", + "@storybook/addon-highlight": "8.0.0-rc.1", + "@storybook/addon-measure": "8.0.0-rc.1", + "@storybook/addon-outline": "8.0.0-rc.1", + "@storybook/addon-toolbars": "8.0.0-rc.1", + "@storybook/addon-viewport": "8.0.0-rc.1", + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/manager-api": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-highlight": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-highlight/-/addon-highlight-8.0.0-rc.1.tgz", + "integrity": "sha512-RKqSfHJhZPDh2BXOZ4sYwfvUKZguUmEPqk+dpWixMk56aOPoVp8VN0KR2lHAYauGs4DuvuvrlHMgERYpQdXebw==", + "dev": true, + "dependencies": { + "@storybook/global": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-interactions": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-interactions/-/addon-interactions-8.0.0-rc.1.tgz", + "integrity": "sha512-IRoA3UpkK67YpWWnfDZ6QGvWlv36WsRLtyy3QyxfKyJXMVirXz6hvIE3KKWRTpPASjNIhI/z1hkVg3RGDCMkQA==", + "dev": true, + "dependencies": { + "@storybook/global": "^5.0.0", + "@storybook/types": "8.0.0-rc.1", + "jest-mock": "^27.0.6", + "polished": "^4.2.2", + "ts-dedent": "^2.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-links": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-links/-/addon-links-8.0.0-rc.1.tgz", + "integrity": "sha512-BP2l4E47ZwvzGrzK1LaivpjA0nZ1STgT8JN2aC7NP9hLgQ/7B5sgTkBCrNl0eSfmgPqkQnHxr1iSB4e0FDOThA==", + "dev": true, + "dependencies": { + "@storybook/csf": "^0.1.2", + "@storybook/global": "^5.0.0", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "apps/storybook/node_modules/@storybook/addon-mdx-gfm": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-mdx-gfm/-/addon-mdx-gfm-8.0.0-rc.1.tgz", + "integrity": "sha512-PTM7pHShv3574Xln8d2dTy39yoq0VBeaFRfOmb88WAMfb4DU4Vrb9TWa+/vsYs0Ajp4lfxeBuxIbNTjXDCQpSQ==", + "dev": true, + "dependencies": { + "@storybook/node-logger": "8.0.0-rc.1", + "remark-gfm": "^4.0.0", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-measure": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-measure/-/addon-measure-8.0.0-rc.1.tgz", + "integrity": "sha512-fqv2DKAikZZjQ2RjQzVoUXyWh/JP9cp9HKaJXMvw0jRXjpi2aI02bjn8aCr/NUuiOKGJp/Fcf8LNXJlYYPYfZQ==", + "dev": true, + "dependencies": { + "@storybook/global": "^5.0.0", + "tiny-invariant": "^1.3.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-outline": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-outline/-/addon-outline-8.0.0-rc.1.tgz", + "integrity": "sha512-8E6s6DuRopjq0NIt6SuM7tgt1FXaMvinuIqlodd6LXr0hW4Z3c0dnO78AQ0CeJcSKvaQkhEyGHGsV5ULmgVUSQ==", + "dev": true, + "dependencies": { + "@storybook/global": "^5.0.0", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-toolbars": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-toolbars/-/addon-toolbars-8.0.0-rc.1.tgz", + "integrity": "sha512-05Od+T4xaxjPExVAO67wa1B47psETRX7Yon7lWQsGChe62bGa4LZLRJ0pzU8a+9ocCA3r+gANYzhcRcrQ4NYKQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/addon-viewport": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-viewport/-/addon-viewport-8.0.0-rc.1.tgz", + "integrity": "sha512-bVQH/apQ4rj/yLDjF/pweB0kb7arYP4CftJ9Adln2ampXq7pGUWttWv0+5R+aNzJYbK5n3BwqaldmquJAR/C6g==", + "dev": true, + "dependencies": { + "memoizerific": "^1.11.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/blocks": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/blocks/-/blocks-8.0.0-rc.1.tgz", + "integrity": "sha512-AkFJPxetXgcVWyv2KyNud/za8p+UnHdMSnDXeEl9TEnh13A3pxby0ogOghIbtb28pW4yagc9rigpAeR71lQJMA==", + "dev": true, + "dependencies": { + "@storybook/channels": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/components": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/csf": "^0.1.2", + "@storybook/docs-tools": "8.0.0-rc.1", + "@storybook/global": "^5.0.0", + "@storybook/icons": "^1.2.5", + "@storybook/manager-api": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", + "@storybook/theming": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "@types/lodash": "^4.14.167", + "color-convert": "^2.0.1", + "dequal": "^2.0.2", + "lodash": "^4.17.21", + "markdown-to-jsx": "7.3.2", + "memoizerific": "^1.11.3", + "polished": "^4.2.2", + "react-colorful": "^5.1.2", + "telejson": "^7.2.0", + "tocbot": "^4.20.1", + "ts-dedent": "^2.0.0", + "util-deprecate": "^1.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "apps/storybook/node_modules/@storybook/builder-manager": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/builder-manager/-/builder-manager-8.0.0-rc.1.tgz", + "integrity": "sha512-kOsNHnDx2l9ZnOPxBcnmGUM3wJtCPKOuHfppUC9dqWNqvc7uhuQt0tR96nhpim7fqADbr9VwM54bR5jjipKvxQ==", + "dev": true, + "dependencies": { + "@fal-works/esbuild-plugin-global-externals": "^2.1.2", + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/manager": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@types/ejs": "^3.1.1", + "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10", + "browser-assert": "^1.2.1", + "ejs": "^3.1.8", + "esbuild": "^0.18.0", + "esbuild-plugin-alias": "^0.2.1", + "express": "^4.17.3", + "fs-extra": "^11.1.0", + "process": "^0.11.10", + "util": "^0.12.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" } }, "apps/storybook/node_modules/@storybook/channels": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-7.6.17.tgz", - "integrity": "sha512-GFG40pzaSxk1hUr/J/TMqW5AFDDPUSu+HkeE/oqSWJbOodBOLJzHN6CReJS6y1DjYSZLNFt1jftPWZZInG/XUA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-8.0.0-rc.1.tgz", + "integrity": "sha512-RKAIVK7A1CgBAIALg3zp6KvVLwSv9FaCu2EWNH47krBD4gsaalzDcVa6PJrxqjRuPqmQLv1bkugOBhBKs1ZRyg==", "dev": true, "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/global": "^5.0.0", "qs": "^6.10.0", "telejson": "^7.2.0", @@ -794,10 +1130,62 @@ "url": "https://opencollective.com/storybook" } }, + "apps/storybook/node_modules/@storybook/cli": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/cli/-/cli-8.0.0-rc.1.tgz", + "integrity": "sha512-B7XebUK63lhScJO+U9XNA3y98MYR4K98zkijYkH3xe5eKjd17aa4hr1VszmKJbsgs8dzP0ZZpcp5MlKrCKZR+w==", + "dev": true, + "dependencies": { + "@babel/core": "^7.23.0", + "@babel/types": "^7.23.0", + "@ndelangen/get-tarball": "^3.0.7", + "@storybook/codemod": "8.0.0-rc.1", + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/core-server": "8.0.0-rc.1", + "@storybook/csf-tools": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/telemetry": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "@types/semver": "^7.3.4", + "@yarnpkg/fslib": "2.10.3", + "@yarnpkg/libzip": "2.3.0", + "chalk": "^4.1.0", + "commander": "^6.2.1", + "cross-spawn": "^7.0.3", + "detect-indent": "^6.1.0", + "envinfo": "^7.7.3", + "execa": "^5.0.0", + "find-up": "^5.0.0", + "fs-extra": "^11.1.0", + "get-npm-tarball-url": "^2.0.3", + "giget": "^1.0.0", + "globby": "^11.0.2", + "jscodeshift": "^0.15.1", + "leven": "^3.1.0", + "ora": "^5.4.1", + "prettier": "^3.1.1", + "prompts": "^2.4.0", + "read-pkg-up": "^7.0.1", + "semver": "^7.3.7", + "strip-json-comments": "^3.0.1", + "tempy": "^1.0.1", + "tiny-invariant": "^1.3.1", + "ts-dedent": "^2.0.0" + }, + "bin": { + "getstorybook": "bin/index.js", + "sb": "bin/index.js" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, "apps/storybook/node_modules/@storybook/client-logger": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-7.6.17.tgz", - "integrity": "sha512-6WBYqixAXNAXlSaBWwgljWpAu10tPRBJrcFvx2gPUne58EeMM20Gi/iHYBz2kMCY+JLAgeIH7ZxInqwO8vDwiQ==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-8.0.0-rc.1.tgz", + "integrity": "sha512-YZ3F1LS8GVkdoE4HWIxtR854bR2gc45Qz30gNNwRAaiWmPEnPbcv2v8gCDIfvhn+dEiO0sBq6pO4rCS3ZgWW2w==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0" @@ -807,36 +1195,75 @@ "url": "https://opencollective.com/storybook" } }, - "apps/storybook/node_modules/@storybook/core-client": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-client/-/core-client-7.6.17.tgz", - "integrity": "sha512-LuDbADK+DPNAOOCXOlvY09hdGVueXlDetsdOJ/DgYnSa9QSWv9Uv+F8QcEgR3QckZJbPlztKJIVLgP2n/Xkijw==", + "apps/storybook/node_modules/@storybook/codemod": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/codemod/-/codemod-8.0.0-rc.1.tgz", + "integrity": "sha512-5GDCci06/lddHZo9Bxq488p0BuQpu6IFQ1J1/QRgbrNMJcPFv+D7B9nwtgQ+cdi3XNzc7RuMJLjMyyCf2entGw==", "dev": true, "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/preview-api": "7.6.17" + "@babel/core": "^7.23.2", + "@babel/preset-env": "^7.23.2", + "@babel/types": "^7.23.0", + "@storybook/csf": "^0.1.2", + "@storybook/csf-tools": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "@types/cross-spawn": "^6.0.2", + "cross-spawn": "^7.0.3", + "globby": "^11.0.2", + "jscodeshift": "^0.15.1", + "lodash": "^4.17.21", + "prettier": "^3.1.1", + "recast": "^0.23.1", + "tiny-invariant": "^1.3.1" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/storybook" } }, - "apps/storybook/node_modules/@storybook/core-common": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-common/-/core-common-7.6.17.tgz", - "integrity": "sha512-me2TP3Q9/qzqCLoDHUSsUF+VS1MHxfHbTVF6vAz0D/COTxzsxLpu9TxTbzJoBCxse6XRb6wWI1RgF1mIcjic7g==", + "apps/storybook/node_modules/@storybook/components": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/components/-/components-8.0.0-rc.1.tgz", + "integrity": "sha512-yOL/m3s/uhjhMgy0FdjQZFDn3FOcbx9R0SA0ba07RLJ9qKQU6Ece5yg25Xp+kvAz643EwNr0HcpyfIvCMj0U7w==", "dev": true, "dependencies": { - "@storybook/core-events": "7.6.17", - "@storybook/node-logger": "7.6.17", - "@storybook/types": "7.6.17", - "@types/find-cache-dir": "^3.2.1", - "@types/node": "^18.0.0", - "@types/node-fetch": "^2.6.4", - "@types/pretty-hrtime": "^1.0.0", + "@radix-ui/react-slot": "^1.0.2", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/csf": "^0.1.2", + "@storybook/global": "^5.0.0", + "@storybook/icons": "^1.2.5", + "@storybook/theming": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "memoizerific": "^1.11.3", + "util-deprecate": "^1.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "apps/storybook/node_modules/@storybook/core-common": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/core-common/-/core-common-8.0.0-rc.1.tgz", + "integrity": "sha512-hRMOZ0HIYtM2WQx+kJPR4s2pZULMvla7xCHlczuy6/mtsDVd62H8IA7syvtrk/Tj2SxlrLO7l4JN5QdVhLryMg==", + "dev": true, + "dependencies": { + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/csf-tools": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "@yarnpkg/fslib": "2.10.3", + "@yarnpkg/libzip": "2.3.0", "chalk": "^4.1.0", + "cross-spawn": "^7.0.3", "esbuild": "^0.18.0", "esbuild-register": "^3.5.0", + "execa": "^5.0.0", "file-system-cache": "2.3.0", "find-cache-dir": "^3.0.0", "find-up": "^5.0.0", @@ -849,7 +1276,11 @@ "pkg-dir": "^5.0.0", "pretty-hrtime": "^1.0.3", "resolve-from": "^5.0.0", - "ts-dedent": "^2.0.0" + "semver": "^7.3.7", + "tempy": "^1.0.1", + "tiny-invariant": "^1.3.1", + "ts-dedent": "^2.0.0", + "util": "^0.12.4" }, "funding": { "type": "opencollective", @@ -857,9 +1288,9 @@ } }, "apps/storybook/node_modules/@storybook/core-events": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-7.6.17.tgz", - "integrity": "sha512-AriWMCm/k1cxlv10f+jZ1wavThTRpLaN3kY019kHWbYT9XgaSuLU67G7GPr3cGnJ6HuA6uhbzu8qtqVCd6OfXA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-8.0.0-rc.1.tgz", + "integrity": "sha512-IOgwjetxT+6YCze5ZWnXuR1uDuJOq54RfhHSXBgO8RFPM9eZ2NTggAEaFcge8gL01CfOusWEeF2Ebl2buwuTbQ==", "dev": true, "dependencies": { "ts-dedent": "^2.0.0" @@ -869,15 +1300,111 @@ "url": "https://opencollective.com/storybook" } }, - "apps/storybook/node_modules/@storybook/docs-tools": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/docs-tools/-/docs-tools-7.6.17.tgz", - "integrity": "sha512-bYrLoj06adqklyLkEwD32C0Ww6t+9ZVvrJHiVT42bIhTRpFiFPAetl1a9KPHtFLnfduh4n2IxIr1jv32ThPDTA==", + "apps/storybook/node_modules/@storybook/core-server": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/core-server/-/core-server-8.0.0-rc.1.tgz", + "integrity": "sha512-q5wgVPJS7i+lN0lpDvxrzICkw1ewGYgbpWlvp9bShObHctH2oPjjAAEB1DdyFLCPDmkokyygpM/iBBWW3oP3Pw==", "dev": true, "dependencies": { - "@storybook/core-common": "7.6.17", - "@storybook/preview-api": "7.6.17", - "@storybook/types": "7.6.17", + "@aw-web-design/x-default-browser": "1.4.126", + "@babel/core": "^7.23.9", + "@discoveryjs/json-ext": "^0.5.3", + "@storybook/builder-manager": "8.0.0-rc.1", + "@storybook/channels": "8.0.0-rc.1", + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/csf": "^0.1.2", + "@storybook/csf-tools": "8.0.0-rc.1", + "@storybook/docs-mdx": "3.0.0", + "@storybook/global": "^5.0.0", + "@storybook/manager": "8.0.0-rc.1", + "@storybook/manager-api": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", + "@storybook/telemetry": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "@types/detect-port": "^1.3.0", + "@types/node": "^18.0.0", + "@types/pretty-hrtime": "^1.0.0", + "@types/semver": "^7.3.4", + "better-opn": "^3.0.2", + "chalk": "^4.1.0", + "cli-table3": "^0.6.1", + "compression": "^1.7.4", + "detect-port": "^1.3.0", + "express": "^4.17.3", + "fs-extra": "^11.1.0", + "globby": "^11.0.2", + "ip": "^2.0.1", + "lodash": "^4.17.21", + "open": "^8.4.0", + "pretty-hrtime": "^1.0.3", + "prompts": "^2.4.0", + "read-pkg-up": "^7.0.1", + "semver": "^7.3.7", + "telejson": "^7.2.0", + "tiny-invariant": "^1.3.1", + "ts-dedent": "^2.0.0", + "util": "^0.12.4", + "util-deprecate": "^1.0.2", + "watchpack": "^2.2.0", + "ws": "^8.2.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/csf-plugin": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/csf-plugin/-/csf-plugin-8.0.0-rc.1.tgz", + "integrity": "sha512-s1RJQwF+shalDESPzVMi2lw19sbs3VwHY8hjK1QYmjq6J7KzUOxN6MuOocWYJl0i35crSeZ99pB+EP6sWKElmA==", + "dev": true, + "dependencies": { + "@storybook/csf-tools": "8.0.0-rc.1", + "unplugin": "^1.3.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/csf-tools": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/csf-tools/-/csf-tools-8.0.0-rc.1.tgz", + "integrity": "sha512-WsrztCyi3Ij3oA00OGJslKGgev2Cyuh//+n2IKRGJVbjNO2xHKDFTYa4MEonUw376g3JUy1U6OavSVqbJsgVKg==", + "dev": true, + "dependencies": { + "@babel/generator": "^7.23.0", + "@babel/parser": "^7.23.0", + "@babel/traverse": "^7.23.2", + "@babel/types": "^7.23.0", + "@storybook/csf": "^0.1.2", + "@storybook/types": "8.0.0-rc.1", + "fs-extra": "^11.1.0", + "recast": "^0.23.1", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/docs-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@storybook/docs-mdx/-/docs-mdx-3.0.0.tgz", + "integrity": "sha512-NmiGXl2HU33zpwTv1XORe9XG9H+dRUC1Jl11u92L4xr062pZtrShLmD4VKIsOQujxhhOrbxpwhNOt+6TdhyIdQ==", + "dev": true + }, + "apps/storybook/node_modules/@storybook/docs-tools": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/docs-tools/-/docs-tools-8.0.0-rc.1.tgz", + "integrity": "sha512-KmXVzD32fQ7wRfktTHobnczv/NreNFtHg2fKj6HZqrmL/TluDkIfF5MQMz7+u+gVz0OKV6REcwqLIVB5VKxEqg==", + "dev": true, + "dependencies": { + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", "@types/doctrine": "^0.0.3", "assert": "^2.1.0", "doctrine": "^3.0.0", @@ -888,34 +1415,69 @@ "url": "https://opencollective.com/storybook" } }, - "apps/storybook/node_modules/@storybook/node-logger": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/node-logger/-/node-logger-7.6.17.tgz", - "integrity": "sha512-w59MQuXhhUNrUVmVkXhMwIg2nvFWjdDczLTwYLorhfsE36CWeUOY5QCZWQy0Qf/h+jz8Uo7Evy64qn18v9C4wA==", + "apps/storybook/node_modules/@storybook/manager": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/manager/-/manager-8.0.0-rc.1.tgz", + "integrity": "sha512-+WnIRLyqNGOnQ/taUautCLfwtXt6EWK/X+ocyq9uycNL5QozBEDFBis8Opk3BQ+gYUyajbIvFoeuwEpMLQk1yg==", "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/storybook" } }, - "apps/storybook/node_modules/@storybook/preview-api": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-7.6.17.tgz", - "integrity": "sha512-wLfDdI9RWo1f2zzFe54yRhg+2YWyxLZvqdZnSQ45mTs4/7xXV5Wfbv3QNTtcdw8tT3U5KRTrN1mTfTCiRJc0Kw==", + "apps/storybook/node_modules/@storybook/manager-api": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/manager-api/-/manager-api-8.0.0-rc.1.tgz", + "integrity": "sha512-LEwuiCqQLycehYI+J58Q7RoOLeVWjUuX0skXbJnFPGs5AP3CpnKR9nJn1JzzY9Yojbn0snShbmCHPzdFrT/VMw==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/channels": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/csf": "^0.1.2", "@storybook/global": "^5.0.0", - "@storybook/types": "7.6.17", + "@storybook/router": "8.0.0-rc.1", + "@storybook/theming": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "dequal": "^2.0.2", + "lodash": "^4.17.21", + "memoizerific": "^1.11.3", + "store2": "^2.14.2", + "telejson": "^7.2.0", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/node-logger": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/node-logger/-/node-logger-8.0.0-rc.1.tgz", + "integrity": "sha512-WFIK9NRclmSepPsTmVOcxzVGv/yyjAckiL3Z/iV2idwP4Qj/TT/FGFGAPs7oGSiQfgP80FMifDFN6tcZ0awpYQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/preview-api": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-8.0.0-rc.1.tgz", + "integrity": "sha512-1qR5PdEzVwrNDqh0NAQFeCaYhygMGSSkHYwZVIBfXzwB5196zQ7miPR6mQ/6oqa0LdRESSVS5GbfbovmvzwPQQ==", + "dev": true, + "dependencies": { + "@storybook/channels": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/csf": "^0.1.2", + "@storybook/global": "^5.0.0", + "@storybook/types": "8.0.0-rc.1", "@types/qs": "^6.9.5", "dequal": "^2.0.2", "lodash": "^4.17.21", "memoizerific": "^1.11.3", "qs": "^6.10.0", - "synchronous-promise": "^2.0.15", + "tiny-invariant": "^1.3.1", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2" }, @@ -925,18 +1487,17 @@ } }, "apps/storybook/node_modules/@storybook/react": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/react/-/react-7.6.17.tgz", - "integrity": "sha512-lVqzQSU03rRJWYW+gK2gq6mSo3/qtnVICY8B8oP7gc36jVu4ksDIu45bTfukM618ODkUZy0vZe6T4engK3azjA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/react/-/react-8.0.0-rc.1.tgz", + "integrity": "sha512-0Aqzv46KiIJzAn48ON8sCDz02uQE0UxYWqrYV4I/QDGomcCArJUSHzw/umOIzJIidHhOwaijhlsAi7FHhmeiWA==", "dev": true, "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/core-client": "7.6.17", - "@storybook/docs-tools": "7.6.17", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/docs-tools": "8.0.0-rc.1", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.6.17", - "@storybook/react-dom-shim": "7.6.17", - "@storybook/types": "7.6.17", + "@storybook/preview-api": "8.0.0-rc.1", + "@storybook/react-dom-shim": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", "@types/escodegen": "^0.0.6", "@types/estree": "^0.0.51", "@types/node": "^18.0.0", @@ -948,12 +1509,13 @@ "lodash": "^4.17.21", "prop-types": "^15.7.2", "react-element-to-jsx-string": "^15.0.0", + "semver": "^7.3.7", "ts-dedent": "^2.0.0", "type-fest": "~2.19", "util-deprecate": "^1.0.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "funding": { "type": "opencollective", @@ -962,7 +1524,7 @@ "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", - "typescript": "*" + "typescript": ">= 4.2.x" }, "peerDependenciesMeta": { "typescript": { @@ -971,9 +1533,9 @@ } }, "apps/storybook/node_modules/@storybook/react-dom-shim": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-7.6.17.tgz", - "integrity": "sha512-32Sa/G+WnvaPiQ1Wvjjw5UM9rr2c4GDohwCcWVv3/LJuiFPqNS6zglAtmnsrlIBnUwRBMLMh/ekCTdqMiUmfDw==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-8.0.0-rc.1.tgz", + "integrity": "sha512-TQK0Tn5R77+yp4BJSrStPOr81sKjHIGKv1LmxP6Ja3by2dC0jyepv4ydMXyaEJPFeMEwq5P1iXOpJLG3dAkBYw==", "dev": true, "funding": { "type": "opencollective", @@ -984,14 +1546,76 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, - "apps/storybook/node_modules/@storybook/types": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/types/-/types-7.6.17.tgz", - "integrity": "sha512-GRY0xEJQ0PrL7DY2qCNUdIfUOE0Gsue6N+GBJw9ku1IUDFLJRDOF+4Dx2BvYcVCPI5XPqdWKlEyZdMdKjiQN7Q==", + "apps/storybook/node_modules/@storybook/router": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/router/-/router-8.0.0-rc.1.tgz", + "integrity": "sha512-kB3oqbCcYlKSaA7WF2SLFU6QdJeOvezmsfJFXVMNONbjy2vYHlLq7SGv0b1sHF0hJ4NkGdRtPes+cJkJvl3Hhg==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@types/babel__core": "^7.0.0", + "@storybook/client-logger": "8.0.0-rc.1", + "memoizerific": "^1.11.3", + "qs": "^6.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/telemetry": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/telemetry/-/telemetry-8.0.0-rc.1.tgz", + "integrity": "sha512-tFohcpWoC/BIM9Km2EhyoPp4K2+uWisDicvE0aPVZQTNFDxdPswyhkkhKFR38/WfzUptnSV6kmMVTyq2u7h44Q==", + "dev": true, + "dependencies": { + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/csf-tools": "8.0.0-rc.1", + "chalk": "^4.1.0", + "detect-package-manager": "^2.0.1", + "fetch-retry": "^5.0.2", + "fs-extra": "^11.1.0", + "read-pkg-up": "^7.0.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "apps/storybook/node_modules/@storybook/theming": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/theming/-/theming-8.0.0-rc.1.tgz", + "integrity": "sha512-IpgvelBRetiZJ4wuof2I4vrUnDPDO9YV+N2+1kofsGUkS/hdXaznwwMotJOkN4olh9zVFSzWUfZxZcqeOhDbUA==", + "dev": true, + "dependencies": { + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/global": "^5.0.0", + "memoizerific": "^1.11.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "apps/storybook/node_modules/@storybook/types": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/types/-/types-8.0.0-rc.1.tgz", + "integrity": "sha512-Sebh9Ju3UDSXFuk9gOZH22AP6gbs2Tk+fdjhx8GFhUWNJkvG2qY7Sgk51z9tDpMSnkoKLC/QXg0NXJUIPCgoEg==", + "dev": true, + "dependencies": { + "@storybook/channels": "8.0.0-rc.1", "@types/express": "^4.7.0", "file-system-cache": "2.3.0" }, @@ -1006,15 +1630,45 @@ "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", "dev": true }, + "apps/storybook/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, "apps/storybook/node_modules/@types/node": { - "version": "18.19.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.20.tgz", - "integrity": "sha512-SKXZvI375jkpvAj8o+5U2518XQv76mAsixqfXiVyWyXZbVWQK25RurFovYpVIxVzul0rZoH58V/3SkEnm7s3qA==", + "version": "18.19.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.21.tgz", + "integrity": "sha512-2Q2NeB6BmiTFQi4DHBzncSoq/cJMLDdhPaAoJFnFCyD9a8VPZRf7a1GAwp1Edb7ROaZc5Jz/tnZyL6EsWMRaqw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" } }, + "apps/storybook/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "apps/storybook/node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", + "dev": true + }, + "apps/storybook/node_modules/@types/yargs": { + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, "apps/storybook/node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -1067,6 +1721,15 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "apps/storybook/node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "apps/storybook/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1076,13 +1739,145 @@ "node": ">=8" } }, - "apps/storybook/node_modules/storybook": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/storybook/-/storybook-7.6.17.tgz", - "integrity": "sha512-8+EIo91bwmeFWPg1eysrxXlhIYv3OsXrznTr4+4Eq0NikqAoq6oBhtlN5K2RGS2lBVF537eN+9jTCNbR+WrzDA==", + "apps/storybook/node_modules/hast-util-heading-rank": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-heading-rank/-/hast-util-heading-rank-3.0.0.tgz", + "integrity": "sha512-EJKb8oMUXVHcWZTDepnr+WNbfnXKFNf9duMesmr4S8SXTJBJ9M4Yok08pu9vxdJwdlGRhVumk9mEhkEvKGifwA==", "dev": true, "dependencies": { - "@storybook/cli": "7.6.17" + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/hast-util-to-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.0.tgz", + "integrity": "sha512-OGkAxX1Ua3cbcW6EJ5pT/tslVb90uViVkcJ4ZZIMW/R33DX/AkcJcRrPebPwJkHYwlDHXz4aIwvAAaAdtrACFA==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/jest-mock": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.5.1.tgz", + "integrity": "sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==", + "dev": true, + "dependencies": { + "@jest/types": "^27.5.1", + "@types/node": "*" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "apps/storybook/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "apps/storybook/node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "apps/storybook/node_modules/rehype-slug": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/rehype-slug/-/rehype-slug-6.0.0.tgz", + "integrity": "sha512-lWyvf/jwu+oS5+hL5eClVd3hNdmwM1kAC0BUvEGD19pajQMIzcNUd/k9GsfQ+FfECvX+JE+e9/btsKH0EjJT6A==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "github-slugger": "^2.0.0", + "hast-util-heading-rank": "^3.0.0", + "hast-util-to-string": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/remark-gfm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", + "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "apps/storybook/node_modules/storybook": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/storybook/-/storybook-8.0.0-rc.1.tgz", + "integrity": "sha512-xDP+liIHa77bksUNLOpFCii8396lbZVamoZZBDRMKaFGABTswhF5VtirlQY32qfPo2z94WdbMhj55O+STpPqQg==", + "dev": true, + "dependencies": { + "@storybook/cli": "8.0.0-rc.1" }, "bin": { "sb": "index.js", @@ -1105,6 +1900,74 @@ "node": ">=8" } }, + "apps/storybook/node_modules/unified": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.4.tgz", + "integrity": "sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/vfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", + "integrity": "sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "apps/storybook/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "apps/studio": { "version": "0.0.9", "dependencies": { @@ -2324,9 +3187,9 @@ } }, "node_modules/@babel/core": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.6.tgz", - "integrity": "sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz", + "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", @@ -2334,11 +3197,11 @@ "@babel/generator": "^7.23.6", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.6", - "@babel/parser": "^7.23.6", - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.6", - "@babel/types": "^7.23.6", + "@babel/helpers": "^7.24.0", + "@babel/parser": "^7.24.0", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -2661,14 +3524,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.6.tgz", - "integrity": "sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz", + "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==", "dev": true, "dependencies": { - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.6", - "@babel/types": "^7.23.6" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -2689,9 +3552,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", - "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", + "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", "bin": { "parser": "bin/babel-parser.js" }, @@ -4276,22 +5139,23 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz", - "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", + "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.23.5", @@ -4300,8 +5164,8 @@ "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.6", - "@babel/types": "^7.23.6", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -4310,9 +5174,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", - "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.23.4", @@ -10191,17 +11055,13 @@ } }, "node_modules/@storybook/addon-onboarding": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@storybook/addon-onboarding/-/addon-onboarding-1.0.11.tgz", - "integrity": "sha512-0Sa7PJDsM6AANOWZX7vq3kgCbS9AZFjr3tfr3bLGfXviwIBKjoZDDdIErJkS3D4mNcDa78lYQvp3PTCKwLIJ9A==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-onboarding/-/addon-onboarding-8.0.0-rc.1.tgz", + "integrity": "sha512-Nl12TaDUg0+KtH6c1WQ2ziUm2DAcHJ5h8I//N5/LcvItkvKhiqCcmfexOIxcaTkAxN8gM4vNPfNnCjccV9CEtA==", "dev": true, - "dependencies": { - "@storybook/telemetry": "^7.1.0", - "react-confetti": "^6.1.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" } }, "node_modules/@storybook/addon-outline": { @@ -10231,9 +11091,9 @@ } }, "node_modules/@storybook/addon-themes": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/addon-themes/-/addon-themes-7.6.17.tgz", - "integrity": "sha512-i/dI3GKlJmQv0Di9HM3fKJvFIab55kvva0vXCGBkqSw3wYoZuq++npkWeDnjjZUvggV12H2RTdGqYwMCXB/GHg==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-themes/-/addon-themes-8.0.0-rc.1.tgz", + "integrity": "sha512-v8Qu1pxlksL5ucl+/fkBfs796eqoi7hCdR8wDCGHxY+z9ihWsyKCs9DMoOV4MpKgtGdzbAdejC72OpRXCBrd+g==", "dev": true, "dependencies": { "ts-dedent": "^2.0.0" @@ -11978,17 +12838,30 @@ "dev": true, "license": "MIT" }, + "node_modules/@storybook/icons": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@storybook/icons/-/icons-1.2.5.tgz", + "integrity": "sha512-m3jnuE+zmkZy6K+cdUDzAoUuCJyl0fWCAXPCji7VZCH1TzFohyvnPqhc9JMkQpanej2TOW3wWXaplPzHghcBSg==", + "dev": true, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/@storybook/instrumenter": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/instrumenter/-/instrumenter-7.6.17.tgz", - "integrity": "sha512-zTLIPTt1fvlWgkIVUyQpF327iVE+EiPdpM0Or0aARaNfIikPRBTcjU+6cK96E+Ust2E1qKajEjIuv4i4lLQPng==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/instrumenter/-/instrumenter-8.0.0-rc.1.tgz", + "integrity": "sha512-YxB7UlU+s7D4Qjc2jor+pEBzGHFKCHgqaw15DoU1g2e6bSrzavg9NvcOkduqMUEh3hmuw0PXnLzHIC7epul1oQ==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/channels": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.6.17", + "@storybook/preview-api": "8.0.0-rc.1", "@vitest/utils": "^0.34.6", "util": "^0.12.4" }, @@ -11998,13 +12871,13 @@ } }, "node_modules/@storybook/instrumenter/node_modules/@storybook/channels": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-7.6.17.tgz", - "integrity": "sha512-GFG40pzaSxk1hUr/J/TMqW5AFDDPUSu+HkeE/oqSWJbOodBOLJzHN6CReJS6y1DjYSZLNFt1jftPWZZInG/XUA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-8.0.0-rc.1.tgz", + "integrity": "sha512-RKAIVK7A1CgBAIALg3zp6KvVLwSv9FaCu2EWNH47krBD4gsaalzDcVa6PJrxqjRuPqmQLv1bkugOBhBKs1ZRyg==", "dev": true, "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/global": "^5.0.0", "qs": "^6.10.0", "telejson": "^7.2.0", @@ -12016,9 +12889,9 @@ } }, "node_modules/@storybook/instrumenter/node_modules/@storybook/client-logger": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-7.6.17.tgz", - "integrity": "sha512-6WBYqixAXNAXlSaBWwgljWpAu10tPRBJrcFvx2gPUne58EeMM20Gi/iHYBz2kMCY+JLAgeIH7ZxInqwO8vDwiQ==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-8.0.0-rc.1.tgz", + "integrity": "sha512-YZ3F1LS8GVkdoE4HWIxtR854bR2gc45Qz30gNNwRAaiWmPEnPbcv2v8gCDIfvhn+dEiO0sBq6pO4rCS3ZgWW2w==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0" @@ -12029,9 +12902,9 @@ } }, "node_modules/@storybook/instrumenter/node_modules/@storybook/core-events": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-7.6.17.tgz", - "integrity": "sha512-AriWMCm/k1cxlv10f+jZ1wavThTRpLaN3kY019kHWbYT9XgaSuLU67G7GPr3cGnJ6HuA6uhbzu8qtqVCd6OfXA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-8.0.0-rc.1.tgz", + "integrity": "sha512-IOgwjetxT+6YCze5ZWnXuR1uDuJOq54RfhHSXBgO8RFPM9eZ2NTggAEaFcge8gL01CfOusWEeF2Ebl2buwuTbQ==", "dev": true, "dependencies": { "ts-dedent": "^2.0.0" @@ -12042,23 +12915,23 @@ } }, "node_modules/@storybook/instrumenter/node_modules/@storybook/preview-api": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-7.6.17.tgz", - "integrity": "sha512-wLfDdI9RWo1f2zzFe54yRhg+2YWyxLZvqdZnSQ45mTs4/7xXV5Wfbv3QNTtcdw8tT3U5KRTrN1mTfTCiRJc0Kw==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-8.0.0-rc.1.tgz", + "integrity": "sha512-1qR5PdEzVwrNDqh0NAQFeCaYhygMGSSkHYwZVIBfXzwB5196zQ7miPR6mQ/6oqa0LdRESSVS5GbfbovmvzwPQQ==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/channels": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/csf": "^0.1.2", "@storybook/global": "^5.0.0", - "@storybook/types": "7.6.17", + "@storybook/types": "8.0.0-rc.1", "@types/qs": "^6.9.5", "dequal": "^2.0.2", "lodash": "^4.17.21", "memoizerific": "^1.11.3", "qs": "^6.10.0", - "synchronous-promise": "^2.0.15", + "tiny-invariant": "^1.3.1", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2" }, @@ -12068,13 +12941,12 @@ } }, "node_modules/@storybook/instrumenter/node_modules/@storybook/types": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/types/-/types-7.6.17.tgz", - "integrity": "sha512-GRY0xEJQ0PrL7DY2qCNUdIfUOE0Gsue6N+GBJw9ku1IUDFLJRDOF+4Dx2BvYcVCPI5XPqdWKlEyZdMdKjiQN7Q==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/types/-/types-8.0.0-rc.1.tgz", + "integrity": "sha512-Sebh9Ju3UDSXFuk9gOZH22AP6gbs2Tk+fdjhx8GFhUWNJkvG2qY7Sgk51z9tDpMSnkoKLC/QXg0NXJUIPCgoEg==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@types/babel__core": "^7.0.0", + "@storybook/channels": "8.0.0-rc.1", "@types/express": "^4.7.0", "file-system-cache": "2.3.0" }, @@ -12159,9 +13031,9 @@ "license": "MIT" }, "node_modules/@storybook/nextjs": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/nextjs/-/nextjs-7.6.17.tgz", - "integrity": "sha512-bD9x6HzH/fxiFnghOQfDM60tNUNxFNVVCZi6OvTRxVVz/5xdqbVnYVOuaJeUSLuUnGs7ALYfx8+2OTJQ9NrwRA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/nextjs/-/nextjs-8.0.0-rc.1.tgz", + "integrity": "sha512-98Npq+eKTK7jCcQ7A3ACcyD/4QX8Rg9J1nh5BlWFrfb3v9lGrUtd3ewrMyffz5uHtJ5Oyenqc15pgb6dinDGJQ==", "dev": true, "dependencies": { "@babel/core": "^7.23.2", @@ -12177,16 +13049,19 @@ "@babel/preset-react": "^7.22.15", "@babel/preset-typescript": "^7.23.2", "@babel/runtime": "^7.23.2", - "@storybook/addon-actions": "7.6.17", - "@storybook/builder-webpack5": "7.6.17", - "@storybook/core-common": "7.6.17", - "@storybook/core-events": "7.6.17", - "@storybook/node-logger": "7.6.17", - "@storybook/preset-react-webpack": "7.6.17", - "@storybook/preview-api": "7.6.17", - "@storybook/react": "7.6.17", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", + "@storybook/addon-actions": "8.0.0-rc.1", + "@storybook/builder-webpack5": "8.0.0-rc.1", + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/preset-react-webpack": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", + "@storybook/react": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", "@types/node": "^18.0.0", "@types/semver": "^7.3.4", + "babel-loader": "^9.1.3", "css-loader": "^6.7.3", "find-up": "^5.0.0", "fs-extra": "^11.1.0", @@ -12196,6 +13071,7 @@ "pnp-webpack-plugin": "^1.7.0", "postcss": "^8.4.21", "postcss-loader": "^7.0.2", + "react-refresh": "^0.14.0", "resolve-url-loader": "^5.0.0", "sass-loader": "^12.4.0", "semver": "^7.3.5", @@ -12207,23 +13083,19 @@ "tsconfig-paths-webpack-plugin": "^4.0.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "@next/font": "^13.0.0|| ^14.0.0", - "next": "^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0", + "next": "^13.5.0 || ^14.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "webpack": "^5.0.0" }, "peerDependenciesMeta": { - "@next/font": { - "optional": true - }, "typescript": { "optional": true }, @@ -12232,25 +13104,40 @@ } } }, - "node_modules/@storybook/nextjs/node_modules/@storybook/builder-webpack5": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/builder-webpack5/-/builder-webpack5-7.6.17.tgz", - "integrity": "sha512-GMaBd8/RzivuAmWrYSt9Rga3j8WLcu5LCMYiPVs+XKXsKAC8lTkV0WRWh8Nk6wTmfzsRQ2acwFjSG5oE4ClZKA==", + "node_modules/@storybook/nextjs/node_modules/@storybook/addon-actions": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-8.0.0-rc.1.tgz", + "integrity": "sha512-Xl8RA2obW0MJ6Y8hQxx8LmwoNt0gKT20UADYp+QusaV4prGw9XVf43eJWq704LO4dq7HFTah3hkDLwGhTsJ5hw==", "dev": true, "dependencies": { - "@babel/core": "^7.23.2", - "@storybook/channels": "7.6.17", - "@storybook/client-logger": "7.6.17", - "@storybook/core-common": "7.6.17", - "@storybook/core-events": "7.6.17", - "@storybook/core-webpack": "7.6.17", - "@storybook/node-logger": "7.6.17", - "@storybook/preview": "7.6.17", - "@storybook/preview-api": "7.6.17", - "@swc/core": "^1.3.82", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/global": "^5.0.0", + "@types/uuid": "^9.0.1", + "dequal": "^2.0.2", + "polished": "^4.2.2", + "uuid": "^9.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "node_modules/@storybook/nextjs/node_modules/@storybook/builder-webpack5": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/builder-webpack5/-/builder-webpack5-8.0.0-rc.1.tgz", + "integrity": "sha512-TyYc+Phb+92l5V+rjD3kx2RjWFE9tmQaX6okiOBHlmpgBeyDkTWZXhLAbOcTaEZs0kZ7V+OCpWbXxfTteD/fXg==", + "dev": true, + "dependencies": { + "@storybook/channels": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/core-webpack": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/preview": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", "@types/node": "^18.0.0", "@types/semver": "^7.3.4", - "babel-loader": "^9.0.0", "browser-assert": "^1.2.1", "case-sensitive-paths-webpack-plugin": "^2.4.0", "cjs-module-lexer": "^1.2.3", @@ -12266,7 +13153,6 @@ "process": "^0.11.10", "semver": "^7.3.7", "style-loader": "^3.3.1", - "swc-loader": "^0.2.3", "terser-webpack-plugin": "^5.3.1", "ts-dedent": "^2.0.0", "url": "^0.11.0", @@ -12288,13 +13174,13 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/channels": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-7.6.17.tgz", - "integrity": "sha512-GFG40pzaSxk1hUr/J/TMqW5AFDDPUSu+HkeE/oqSWJbOodBOLJzHN6CReJS6y1DjYSZLNFt1jftPWZZInG/XUA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-8.0.0-rc.1.tgz", + "integrity": "sha512-RKAIVK7A1CgBAIALg3zp6KvVLwSv9FaCu2EWNH47krBD4gsaalzDcVa6PJrxqjRuPqmQLv1bkugOBhBKs1ZRyg==", "dev": true, "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/global": "^5.0.0", "qs": "^6.10.0", "telejson": "^7.2.0", @@ -12306,9 +13192,9 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/client-logger": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-7.6.17.tgz", - "integrity": "sha512-6WBYqixAXNAXlSaBWwgljWpAu10tPRBJrcFvx2gPUne58EeMM20Gi/iHYBz2kMCY+JLAgeIH7ZxInqwO8vDwiQ==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-8.0.0-rc.1.tgz", + "integrity": "sha512-YZ3F1LS8GVkdoE4HWIxtR854bR2gc45Qz30gNNwRAaiWmPEnPbcv2v8gCDIfvhn+dEiO0sBq6pO4rCS3ZgWW2w==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0" @@ -12318,36 +13204,23 @@ "url": "https://opencollective.com/storybook" } }, - "node_modules/@storybook/nextjs/node_modules/@storybook/core-client": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-client/-/core-client-7.6.17.tgz", - "integrity": "sha512-LuDbADK+DPNAOOCXOlvY09hdGVueXlDetsdOJ/DgYnSa9QSWv9Uv+F8QcEgR3QckZJbPlztKJIVLgP2n/Xkijw==", - "dev": true, - "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/preview-api": "7.6.17" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/storybook" - } - }, "node_modules/@storybook/nextjs/node_modules/@storybook/core-common": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-common/-/core-common-7.6.17.tgz", - "integrity": "sha512-me2TP3Q9/qzqCLoDHUSsUF+VS1MHxfHbTVF6vAz0D/COTxzsxLpu9TxTbzJoBCxse6XRb6wWI1RgF1mIcjic7g==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/core-common/-/core-common-8.0.0-rc.1.tgz", + "integrity": "sha512-hRMOZ0HIYtM2WQx+kJPR4s2pZULMvla7xCHlczuy6/mtsDVd62H8IA7syvtrk/Tj2SxlrLO7l4JN5QdVhLryMg==", "dev": true, "dependencies": { - "@storybook/core-events": "7.6.17", - "@storybook/node-logger": "7.6.17", - "@storybook/types": "7.6.17", - "@types/find-cache-dir": "^3.2.1", - "@types/node": "^18.0.0", - "@types/node-fetch": "^2.6.4", - "@types/pretty-hrtime": "^1.0.0", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/csf-tools": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", + "@yarnpkg/fslib": "2.10.3", + "@yarnpkg/libzip": "2.3.0", "chalk": "^4.1.0", + "cross-spawn": "^7.0.3", "esbuild": "^0.18.0", "esbuild-register": "^3.5.0", + "execa": "^5.0.0", "file-system-cache": "2.3.0", "find-cache-dir": "^3.0.0", "find-up": "^5.0.0", @@ -12360,7 +13233,11 @@ "pkg-dir": "^5.0.0", "pretty-hrtime": "^1.0.3", "resolve-from": "^5.0.0", - "ts-dedent": "^2.0.0" + "semver": "^7.3.7", + "tempy": "^1.0.1", + "tiny-invariant": "^1.3.1", + "ts-dedent": "^2.0.0", + "util": "^0.12.4" }, "funding": { "type": "opencollective", @@ -12368,9 +13245,9 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/core-events": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-7.6.17.tgz", - "integrity": "sha512-AriWMCm/k1cxlv10f+jZ1wavThTRpLaN3kY019kHWbYT9XgaSuLU67G7GPr3cGnJ6HuA6uhbzu8qtqVCd6OfXA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-8.0.0-rc.1.tgz", + "integrity": "sha512-IOgwjetxT+6YCze5ZWnXuR1uDuJOq54RfhHSXBgO8RFPM9eZ2NTggAEaFcge8gL01CfOusWEeF2Ebl2buwuTbQ==", "dev": true, "dependencies": { "ts-dedent": "^2.0.0" @@ -12381,14 +13258,14 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/core-webpack": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-webpack/-/core-webpack-7.6.17.tgz", - "integrity": "sha512-PyGrFhRM8sTONGwwLWLqBQ1HO+LBnVZ+5TOQO7ejQfdV2FWyNOzjBXm2e5jL/C6XlqiEhmL5pyHEyDBaQJQ3KA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/core-webpack/-/core-webpack-8.0.0-rc.1.tgz", + "integrity": "sha512-s57kgVhU56C7E5oU7JtV5jsIfjSX3qSBn2Aqao58HhCMpQHPYy+Ez8VuuS5o3WM654yImAPq/4gD3slTQqrfiA==", "dev": true, "dependencies": { - "@storybook/core-common": "7.6.17", - "@storybook/node-logger": "7.6.17", - "@storybook/types": "7.6.17", + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", "@types/node": "^18.0.0", "ts-dedent": "^2.0.0" }, @@ -12397,15 +13274,36 @@ "url": "https://opencollective.com/storybook" } }, - "node_modules/@storybook/nextjs/node_modules/@storybook/docs-tools": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/docs-tools/-/docs-tools-7.6.17.tgz", - "integrity": "sha512-bYrLoj06adqklyLkEwD32C0Ww6t+9ZVvrJHiVT42bIhTRpFiFPAetl1a9KPHtFLnfduh4n2IxIr1jv32ThPDTA==", + "node_modules/@storybook/nextjs/node_modules/@storybook/csf-tools": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/csf-tools/-/csf-tools-8.0.0-rc.1.tgz", + "integrity": "sha512-WsrztCyi3Ij3oA00OGJslKGgev2Cyuh//+n2IKRGJVbjNO2xHKDFTYa4MEonUw376g3JUy1U6OavSVqbJsgVKg==", "dev": true, "dependencies": { - "@storybook/core-common": "7.6.17", - "@storybook/preview-api": "7.6.17", - "@storybook/types": "7.6.17", + "@babel/generator": "^7.23.0", + "@babel/parser": "^7.23.0", + "@babel/traverse": "^7.23.2", + "@babel/types": "^7.23.0", + "@storybook/csf": "^0.1.2", + "@storybook/types": "8.0.0-rc.1", + "fs-extra": "^11.1.0", + "recast": "^0.23.1", + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + } + }, + "node_modules/@storybook/nextjs/node_modules/@storybook/docs-tools": { + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/docs-tools/-/docs-tools-8.0.0-rc.1.tgz", + "integrity": "sha512-KmXVzD32fQ7wRfktTHobnczv/NreNFtHg2fKj6HZqrmL/TluDkIfF5MQMz7+u+gVz0OKV6REcwqLIVB5VKxEqg==", + "dev": true, + "dependencies": { + "@storybook/core-common": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", "@types/doctrine": "^0.0.3", "assert": "^2.1.0", "doctrine": "^3.0.0", @@ -12417,9 +13315,9 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/node-logger": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/node-logger/-/node-logger-7.6.17.tgz", - "integrity": "sha512-w59MQuXhhUNrUVmVkXhMwIg2nvFWjdDczLTwYLorhfsE36CWeUOY5QCZWQy0Qf/h+jz8Uo7Evy64qn18v9C4wA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/node-logger/-/node-logger-8.0.0-rc.1.tgz", + "integrity": "sha512-WFIK9NRclmSepPsTmVOcxzVGv/yyjAckiL3Z/iV2idwP4Qj/TT/FGFGAPs7oGSiQfgP80FMifDFN6tcZ0awpYQ==", "dev": true, "funding": { "type": "opencollective", @@ -12427,54 +13325,46 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/preset-react-webpack": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/preset-react-webpack/-/preset-react-webpack-7.6.17.tgz", - "integrity": "sha512-gn/LvIbll9loOkzwbFlxzOZGmJ6t1vF2/gfi+p/N/AifDYe8+LVM1QV4KRVKt6UEJwsQd79lKf7vPH92AQaKKQ==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/preset-react-webpack/-/preset-react-webpack-8.0.0-rc.1.tgz", + "integrity": "sha512-LbxngVsSAAKjMd4AtYROiLyaJ8tk22EuOIEPQ5r+dpcv92nTWLc7NHe83LrWAvxKizb0G1+T5QLLK7ZOjSKvKA==", "dev": true, "dependencies": { - "@babel/preset-flow": "^7.22.15", - "@babel/preset-react": "^7.22.15", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", - "@storybook/core-webpack": "7.6.17", - "@storybook/docs-tools": "7.6.17", - "@storybook/node-logger": "7.6.17", - "@storybook/react": "7.6.17", + "@storybook/core-webpack": "8.0.0-rc.1", + "@storybook/docs-tools": "8.0.0-rc.1", + "@storybook/node-logger": "8.0.0-rc.1", + "@storybook/react": "8.0.0-rc.1", "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0", "@types/node": "^18.0.0", "@types/semver": "^7.3.4", - "babel-plugin-add-react-displayname": "^0.0.5", "fs-extra": "^11.1.0", "magic-string": "^0.30.5", "react-docgen": "^7.0.0", - "react-refresh": "^0.14.0", + "resolve": "^1.22.8", "semver": "^7.3.7", "webpack": "5" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "@babel/core": "^7.22.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, "typescript": { "optional": true } } }, "node_modules/@storybook/nextjs/node_modules/@storybook/preview": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/preview/-/preview-7.6.17.tgz", - "integrity": "sha512-LvkMYK/y6alGjwRVNDIKL1lFlbyZ0H0c8iAbcQkiMoaFiujMQyVswMDKlWcj42Upfr/B1igydiruomc+eUt0mw==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/preview/-/preview-8.0.0-rc.1.tgz", + "integrity": "sha512-n860bAvJDsTdLmfACra9Z0ZZSOgL9krrc6R4ocxO0qWSq6JnjWy8s5JrlXqm4i9tcB+821QcspHlSngMtSajzw==", "dev": true, "funding": { "type": "opencollective", @@ -12482,23 +13372,23 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/preview-api": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-7.6.17.tgz", - "integrity": "sha512-wLfDdI9RWo1f2zzFe54yRhg+2YWyxLZvqdZnSQ45mTs4/7xXV5Wfbv3QNTtcdw8tT3U5KRTrN1mTfTCiRJc0Kw==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-8.0.0-rc.1.tgz", + "integrity": "sha512-1qR5PdEzVwrNDqh0NAQFeCaYhygMGSSkHYwZVIBfXzwB5196zQ7miPR6mQ/6oqa0LdRESSVS5GbfbovmvzwPQQ==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/channels": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/csf": "^0.1.2", "@storybook/global": "^5.0.0", - "@storybook/types": "7.6.17", + "@storybook/types": "8.0.0-rc.1", "@types/qs": "^6.9.5", "dequal": "^2.0.2", "lodash": "^4.17.21", "memoizerific": "^1.11.3", "qs": "^6.10.0", - "synchronous-promise": "^2.0.15", + "tiny-invariant": "^1.3.1", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2" }, @@ -12508,18 +13398,17 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/react": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/react/-/react-7.6.17.tgz", - "integrity": "sha512-lVqzQSU03rRJWYW+gK2gq6mSo3/qtnVICY8B8oP7gc36jVu4ksDIu45bTfukM618ODkUZy0vZe6T4engK3azjA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/react/-/react-8.0.0-rc.1.tgz", + "integrity": "sha512-0Aqzv46KiIJzAn48ON8sCDz02uQE0UxYWqrYV4I/QDGomcCArJUSHzw/umOIzJIidHhOwaijhlsAi7FHhmeiWA==", "dev": true, "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/core-client": "7.6.17", - "@storybook/docs-tools": "7.6.17", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/docs-tools": "8.0.0-rc.1", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.6.17", - "@storybook/react-dom-shim": "7.6.17", - "@storybook/types": "7.6.17", + "@storybook/preview-api": "8.0.0-rc.1", + "@storybook/react-dom-shim": "8.0.0-rc.1", + "@storybook/types": "8.0.0-rc.1", "@types/escodegen": "^0.0.6", "@types/estree": "^0.0.51", "@types/node": "^18.0.0", @@ -12531,12 +13420,13 @@ "lodash": "^4.17.21", "prop-types": "^15.7.2", "react-element-to-jsx-string": "^15.0.0", + "semver": "^7.3.7", "ts-dedent": "^2.0.0", "type-fest": "~2.19", "util-deprecate": "^1.0.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "funding": { "type": "opencollective", @@ -12545,7 +13435,7 @@ "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", - "typescript": "*" + "typescript": ">= 4.2.x" }, "peerDependenciesMeta": { "typescript": { @@ -12554,9 +13444,9 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/react-dom-shim": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-7.6.17.tgz", - "integrity": "sha512-32Sa/G+WnvaPiQ1Wvjjw5UM9rr2c4GDohwCcWVv3/LJuiFPqNS6zglAtmnsrlIBnUwRBMLMh/ekCTdqMiUmfDw==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-8.0.0-rc.1.tgz", + "integrity": "sha512-TQK0Tn5R77+yp4BJSrStPOr81sKjHIGKv1LmxP6Ja3by2dC0jyepv4ydMXyaEJPFeMEwq5P1iXOpJLG3dAkBYw==", "dev": true, "funding": { "type": "opencollective", @@ -12568,13 +13458,12 @@ } }, "node_modules/@storybook/nextjs/node_modules/@storybook/types": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/types/-/types-7.6.17.tgz", - "integrity": "sha512-GRY0xEJQ0PrL7DY2qCNUdIfUOE0Gsue6N+GBJw9ku1IUDFLJRDOF+4Dx2BvYcVCPI5XPqdWKlEyZdMdKjiQN7Q==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/types/-/types-8.0.0-rc.1.tgz", + "integrity": "sha512-Sebh9Ju3UDSXFuk9gOZH22AP6gbs2Tk+fdjhx8GFhUWNJkvG2qY7Sgk51z9tDpMSnkoKLC/QXg0NXJUIPCgoEg==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@types/babel__core": "^7.0.0", + "@storybook/channels": "8.0.0-rc.1", "@types/express": "^4.7.0", "file-system-cache": "2.3.0" }, @@ -12590,14 +13479,20 @@ "dev": true }, "node_modules/@storybook/nextjs/node_modules/@types/node": { - "version": "18.19.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.20.tgz", - "integrity": "sha512-SKXZvI375jkpvAj8o+5U2518XQv76mAsixqfXiVyWyXZbVWQK25RurFovYpVIxVzul0rZoH58V/3SkEnm7s3qA==", + "version": "18.19.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.21.tgz", + "integrity": "sha512-2Q2NeB6BmiTFQi4DHBzncSoq/cJMLDdhPaAoJFnFCyD9a8VPZRf7a1GAwp1Edb7ROaZc5Jz/tnZyL6EsWMRaqw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" } }, + "node_modules/@storybook/nextjs/node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", + "dev": true + }, "node_modules/@storybook/nextjs/node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -12681,9 +13576,9 @@ } }, "node_modules/@storybook/nextjs/node_modules/magic-string": { - "version": "0.30.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", - "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -13286,21 +14181,20 @@ } }, "node_modules/@storybook/test": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/test/-/test-7.6.17.tgz", - "integrity": "sha512-WGrmUUtKiuq3bzDsN4MUvluGcX120jwczMik1GDTyxS+JBoe7P0t2Y8dDuVs/l3nZd1J7qY4z0RGxMDYqONIOw==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/test/-/test-8.0.0-rc.1.tgz", + "integrity": "sha512-yojmb5MBHSgIRuFQacNVTosyryfbsUBeM3YGHllOwOl7O2A72nwjyP5Zs73QmmZ9Z5zOENPRh/oDGlbinvdRIQ==", "dev": true, "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", - "@storybook/instrumenter": "7.6.17", - "@storybook/preview-api": "7.6.17", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", + "@storybook/instrumenter": "8.0.0-rc.1", + "@storybook/preview-api": "8.0.0-rc.1", "@testing-library/dom": "^9.3.1", - "@testing-library/jest-dom": "^6.1.3", - "@testing-library/user-event": "14.3.0", - "@types/chai": "^4", - "@vitest/expect": "^0.34.2", - "@vitest/spy": "^0.34.1", + "@testing-library/jest-dom": "^6.4.0", + "@testing-library/user-event": "^14.5.2", + "@vitest/expect": "1.1.3", + "@vitest/spy": "^1.1.3", "chai": "^4.3.7", "util": "^0.12.4" }, @@ -13310,13 +14204,13 @@ } }, "node_modules/@storybook/test/node_modules/@storybook/channels": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-7.6.17.tgz", - "integrity": "sha512-GFG40pzaSxk1hUr/J/TMqW5AFDDPUSu+HkeE/oqSWJbOodBOLJzHN6CReJS6y1DjYSZLNFt1jftPWZZInG/XUA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-8.0.0-rc.1.tgz", + "integrity": "sha512-RKAIVK7A1CgBAIALg3zp6KvVLwSv9FaCu2EWNH47krBD4gsaalzDcVa6PJrxqjRuPqmQLv1bkugOBhBKs1ZRyg==", "dev": true, "dependencies": { - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/global": "^5.0.0", "qs": "^6.10.0", "telejson": "^7.2.0", @@ -13328,9 +14222,9 @@ } }, "node_modules/@storybook/test/node_modules/@storybook/client-logger": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-7.6.17.tgz", - "integrity": "sha512-6WBYqixAXNAXlSaBWwgljWpAu10tPRBJrcFvx2gPUne58EeMM20Gi/iHYBz2kMCY+JLAgeIH7ZxInqwO8vDwiQ==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-8.0.0-rc.1.tgz", + "integrity": "sha512-YZ3F1LS8GVkdoE4HWIxtR854bR2gc45Qz30gNNwRAaiWmPEnPbcv2v8gCDIfvhn+dEiO0sBq6pO4rCS3ZgWW2w==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0" @@ -13341,9 +14235,9 @@ } }, "node_modules/@storybook/test/node_modules/@storybook/core-events": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-7.6.17.tgz", - "integrity": "sha512-AriWMCm/k1cxlv10f+jZ1wavThTRpLaN3kY019kHWbYT9XgaSuLU67G7GPr3cGnJ6HuA6uhbzu8qtqVCd6OfXA==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-8.0.0-rc.1.tgz", + "integrity": "sha512-IOgwjetxT+6YCze5ZWnXuR1uDuJOq54RfhHSXBgO8RFPM9eZ2NTggAEaFcge8gL01CfOusWEeF2Ebl2buwuTbQ==", "dev": true, "dependencies": { "ts-dedent": "^2.0.0" @@ -13354,23 +14248,23 @@ } }, "node_modules/@storybook/test/node_modules/@storybook/preview-api": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-7.6.17.tgz", - "integrity": "sha512-wLfDdI9RWo1f2zzFe54yRhg+2YWyxLZvqdZnSQ45mTs4/7xXV5Wfbv3QNTtcdw8tT3U5KRTrN1mTfTCiRJc0Kw==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-8.0.0-rc.1.tgz", + "integrity": "sha512-1qR5PdEzVwrNDqh0NAQFeCaYhygMGSSkHYwZVIBfXzwB5196zQ7miPR6mQ/6oqa0LdRESSVS5GbfbovmvzwPQQ==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@storybook/client-logger": "7.6.17", - "@storybook/core-events": "7.6.17", + "@storybook/channels": "8.0.0-rc.1", + "@storybook/client-logger": "8.0.0-rc.1", + "@storybook/core-events": "8.0.0-rc.1", "@storybook/csf": "^0.1.2", "@storybook/global": "^5.0.0", - "@storybook/types": "7.6.17", + "@storybook/types": "8.0.0-rc.1", "@types/qs": "^6.9.5", "dequal": "^2.0.2", "lodash": "^4.17.21", "memoizerific": "^1.11.3", "qs": "^6.10.0", - "synchronous-promise": "^2.0.15", + "tiny-invariant": "^1.3.1", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2" }, @@ -13380,13 +14274,12 @@ } }, "node_modules/@storybook/test/node_modules/@storybook/types": { - "version": "7.6.17", - "resolved": "https://registry.npmjs.org/@storybook/types/-/types-7.6.17.tgz", - "integrity": "sha512-GRY0xEJQ0PrL7DY2qCNUdIfUOE0Gsue6N+GBJw9ku1IUDFLJRDOF+4Dx2BvYcVCPI5XPqdWKlEyZdMdKjiQN7Q==", + "version": "8.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@storybook/types/-/types-8.0.0-rc.1.tgz", + "integrity": "sha512-Sebh9Ju3UDSXFuk9gOZH22AP6gbs2Tk+fdjhx8GFhUWNJkvG2qY7Sgk51z9tDpMSnkoKLC/QXg0NXJUIPCgoEg==", "dev": true, "dependencies": { - "@storybook/channels": "7.6.17", - "@types/babel__core": "^7.0.0", + "@storybook/channels": "8.0.0-rc.1", "@types/express": "^4.7.0", "file-system-cache": "2.3.0" }, @@ -13396,9 +14289,9 @@ } }, "node_modules/@storybook/test/node_modules/@testing-library/user-event": { - "version": "14.3.0", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.3.0.tgz", - "integrity": "sha512-P02xtBBa8yMaLhK8CzJCIns8rqwnF6FxhR9zs810flHOBXUYCFjLd8Io1rQrAkQRWEmW2PGdZIEdMxf/KLsqFA==", + "version": "14.5.2", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.2.tgz", + "integrity": "sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==", "dev": true, "engines": { "node": ">=12", @@ -13885,16 +14778,17 @@ } }, "node_modules/@testing-library/jest-dom": { - "version": "6.1.3", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.4.2.tgz", + "integrity": "sha512-CzqH0AFymEMG48CpzXFriYYkOjk6ZGPCLMhW9e9jg3KMCn5OfJecF8GtGW7yGfR/IgCe3SX8BSwjdzI6BBbZLw==", "dev": true, - "license": "MIT", "dependencies": { - "@adobe/css-tools": "^4.3.0", + "@adobe/css-tools": "^4.3.2", "@babel/runtime": "^7.9.2", "aria-query": "^5.0.0", "chalk": "^3.0.0", "css.escape": "^1.5.1", - "dom-accessibility-api": "^0.5.6", + "dom-accessibility-api": "^0.6.3", "lodash": "^4.17.15", "redent": "^3.0.0" }, @@ -13905,6 +14799,7 @@ }, "peerDependencies": { "@jest/globals": ">= 28", + "@types/bun": "latest", "@types/jest": ">= 28", "jest": ">= 28", "vitest": ">= 0.32" @@ -13913,6 +14808,9 @@ "@jest/globals": { "optional": true }, + "@types/bun": { + "optional": true + }, "@types/jest": { "optional": true }, @@ -13950,6 +14848,12 @@ "node": ">=8" } }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true + }, "node_modules/@testing-library/jest-dom/node_modules/has-flag": { "version": "4.0.0", "dev": true, @@ -14128,12 +15032,6 @@ "resolved": "https://registry.npmjs.org/@types/btoa-lite/-/btoa-lite-1.0.2.tgz", "integrity": "sha512-ZYbcE2x7yrvNFJiU7xJGrpF/ihpkM7zKgw8bha3LNJSesvTtUNxbpzaT7WXBIryf6jovisrxTBvymxMeLLj1Mg==" }, - "node_modules/@types/chai": { - "version": "4.3.12", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.12.tgz", - "integrity": "sha512-zNKDHG/1yxm8Il6uCCVsm+dRdEsJlFoDu73X17y09bId6UwoYww+vFBsAcRzl8knM1sab3Dp1VRikFQwDOtDDw==", - "dev": true - }, "node_modules/@types/classnames": { "version": "2.3.1", "dev": true, @@ -15157,26 +16055,85 @@ "license": "ISC" }, "node_modules/@vitest/expect": { - "version": "0.34.7", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.7.tgz", - "integrity": "sha512-G9iEtwrD6ZQ4MVHZufif9Iqz3eLtuwBBNx971fNAGPaugM7ftAWjQN+ob2zWhtzURp8RK3zGXOxVb01mFo3zAQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.1.3.tgz", + "integrity": "sha512-MnJqsKc1Ko04lksF9XoRJza0bGGwTtqfbyrsYv5on4rcEkdo+QgUdITenBQBUltKzdxW7K3rWh+nXRULwsdaVg==", "dev": true, "dependencies": { - "@vitest/spy": "0.34.7", - "@vitest/utils": "0.34.7", + "@vitest/spy": "1.1.3", + "@vitest/utils": "1.1.3", "chai": "^4.3.10" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/spy": { - "version": "0.34.7", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.7.tgz", - "integrity": "sha512-NMMSzOY2d8L0mcOt4XcliDOS1ISyGlAXuQtERWVOoVHnKwmG+kKhinAiGw3dTtMQWybfa89FG8Ucg9tiC/FhTQ==", + "node_modules/@vitest/expect/node_modules/@vitest/spy": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.1.3.tgz", + "integrity": "sha512-Ec0qWyGS5LhATFQtldvChPTAHv08yHIOZfiNcjwRQbFPHpkih0md9KAbs7TfeIfL7OFKoe7B/6ukBTqByubXkQ==", "dev": true, "dependencies": { - "tinyspy": "^2.1.1" + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/expect/node_modules/@vitest/utils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.1.3.tgz", + "integrity": "sha512-Dyt3UMcdElTll2H75vhxfpZu03uFpXRCHxWnzcrFjZxT1kTbq8ALUYIeBgGolo1gldVdI0YSlQRacsqxTwNqwg==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/expect/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@vitest/expect/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@vitest/expect/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/@vitest/spy": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", + "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" }, "funding": { "url": "https://opencollective.com/vitest" @@ -23404,6 +24361,28 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-is-element": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz", + "integrity": "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-is-element/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/hast-util-parse-selector": { "version": "2.2.5", "license": "MIT", @@ -27947,6 +28926,34 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-find-and-replace": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", + "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mdast-util-from-markdown": { "version": "2.0.0", "license": "MIT", @@ -28363,6 +29370,761 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", + "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", + "dev": true, + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote/node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-footnote/node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-footnote/node_modules/micromark-util-normalize-identifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-footnote/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/mdast-util-gfm-footnote/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough/node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-strikethrough/node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-strikethrough/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/mdast-util-gfm-strikethrough/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/mdast-util-gfm-table/node_modules/markdown-table": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", + "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-gfm-table/node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table/node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-table/node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-table/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/mdast-util-gfm-table/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item/node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-task-list-item/node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm-task-list-item/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/mdast-util-gfm-task-list-item/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/mdast-util-gfm/node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm/node_modules/mdast-util-to-markdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.0.tgz", + "integrity": "sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm/node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "dev": true, + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm/node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.1.tgz", + "integrity": "sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm/node_modules/micromark-util-decode-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.0.tgz", + "integrity": "sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/mdast-util-gfm/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/mdast-util-gfm/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-mdx": { "version": "2.0.1", "license": "MIT", @@ -28977,6 +30739,692 @@ ], "license": "MIT" }, + "node_modules/micromark-extension-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", + "dev": true, + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.0.0.tgz", + "integrity": "sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==", + "dev": true, + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-extension-gfm-footnote": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==", + "dev": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-core-commonmark": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz", + "integrity": "sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-factory-destination": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.0.tgz", + "integrity": "sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-factory-label": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.0.tgz", + "integrity": "sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-factory-space": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-factory-title": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.0.tgz", + "integrity": "sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-factory-whitespace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.0.tgz", + "integrity": "sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-chunked": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-classify-character": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-html-tag-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.0.tgz", + "integrity": "sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-normalize-identifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.0.tgz", + "integrity": "sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-resolve-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-subtokenize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz", + "integrity": "sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-footnote/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==", + "dev": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough/node_modules/micromark-util-chunked": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-strikethrough/node_modules/micromark-util-classify-character": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.0.tgz", + "integrity": "sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-strikethrough/node_modules/micromark-util-resolve-all": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.0.tgz", + "integrity": "sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-strikethrough/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-extension-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.0.0.tgz", + "integrity": "sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==", + "dev": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table/node_modules/micromark-factory-space": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-table/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", + "dev": true, + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.0.1.tgz", + "integrity": "sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==", + "dev": true, + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-factory-space": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.0.tgz", + "integrity": "sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm-task-list-item/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-extension-gfm/node_modules/micromark-util-chunked": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.0.tgz", + "integrity": "sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm/node_modules/micromark-util-combine-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.0.tgz", + "integrity": "sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-gfm/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, "node_modules/micromark-extension-mdx-expression": { "version": "1.0.8", "funding": [ @@ -33764,21 +36212,6 @@ "react-dom": ">=16.8.0" } }, - "node_modules/react-confetti": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/react-confetti/-/react-confetti-6.1.0.tgz", - "integrity": "sha512-7Ypx4vz0+g8ECVxr88W9zhcQpbeujJAVqL14ZnXJ3I23mOI9/oBVTQ3dkJhUmB0D6XOtCZEM6N0Gm9PMngkORw==", - "dev": true, - "dependencies": { - "tween-functions": "^1.2.0" - }, - "engines": { - "node": ">=10.18" - }, - "peerDependencies": { - "react": "^16.3.0 || ^17.0.1 || ^18.0.0" - } - }, "node_modules/react-contexify": { "version": "5.0.0", "license": "MIT", @@ -35045,6 +37478,66 @@ "jsesc": "bin/jsesc" } }, + "node_modules/rehype-external-links": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rehype-external-links/-/rehype-external-links-3.0.0.tgz", + "integrity": "sha512-yp+e5N9V3C6bwBeAC4n796kc86M4gJCdlVhiMTxIrJG5UHDMh+PJANf9heqORJbt1nrCbDwIlAZKjANIaVBbvw==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "hast-util-is-element": "^3.0.0", + "is-absolute-url": "^4.0.0", + "space-separated-tokens": "^2.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-external-links/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/rehype-external-links/node_modules/@types/unist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", + "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "dev": true + }, + "node_modules/rehype-external-links/node_modules/is-absolute-url": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-4.0.1.tgz", + "integrity": "sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rehype-external-links/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dev": true, + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/rehype-slug": { "version": "5.1.0", "license": "MIT", @@ -39738,12 +42231,6 @@ "win32" ] }, - "node_modules/tween-functions": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tween-functions/-/tween-functions-1.2.0.tgz", - "integrity": "sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "license": "MIT", From e9763360a145d50f77ffe54ee4dd5f3af21fdd41 Mon Sep 17 00:00:00 2001 From: hallidayo <22655069+Hallidayo@users.noreply.github.com> Date: Tue, 5 Mar 2024 05:49:38 +0000 Subject: [PATCH 019/163] docs: nextjs missing createClient example code (#21532) added createClient function example Co-authored-by: Chris Gwilliams <517923+encima@users.noreply.github.com> --- .../getting-started/quickstarts/nextjs.mdx | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx index 0568426c37e..65ab0d417e3 100644 --- a/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx +++ b/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx @@ -92,6 +92,8 @@ hideToc: true + + ```ts app/notes/page.tsx import { createClient } from '@/utils/supabase/server'; @@ -103,6 +105,47 @@ hideToc: true } ``` + ```ts utils/supabase/server.ts + import { createServerClient, type CookieOptions } from '@supabase/ssr' + import { cookies } from 'next/headers' + + export function createClient() { + const cookieStore = cookies() + + return createServerClient( + process.env.NEXT_PUBLIC_SUPABASE_URL!, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, + { + cookies: { + get(name: string) { + return cookieStore.get(name)?.value + }, + set(name: string, value: string, options: CookieOptions) { + try { + cookieStore.set({ name, value, ...options }) + } catch (error) { + // The `set` method was called from a Server Component. + // This can be ignored if you have middleware refreshing + // user sessions. + } + }, + remove(name: string, options: CookieOptions) { + try { + cookieStore.set({ name, value: '', ...options }) + } catch (error) { + // The `delete` method was called from a Server Component. + // This can be ignored if you have middleware refreshing + // user sessions. + } + }, + }, + } + ) + } + ``` + + + From 4f7874edfe5c2d52c9efd7d8ef43889f3a05af9f Mon Sep 17 00:00:00 2001 From: Menushka Weeratunga <5711536+menushka@users.noreply.github.com> Date: Tue, 5 Mar 2024 01:04:26 -0500 Subject: [PATCH 020/163] docs: Add missing import (#21767) Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/content/guides/auth/server-side/nextjs.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/docs/content/guides/auth/server-side/nextjs.mdx b/apps/docs/content/guides/auth/server-side/nextjs.mdx index 080dadd151e..71f357f53c1 100644 --- a/apps/docs/content/guides/auth/server-side/nextjs.mdx +++ b/apps/docs/content/guides/auth/server-side/nextjs.mdx @@ -204,6 +204,7 @@ It's safe to trust `getUser()` because it sends a request to the Supabase Auth s ```ts middleware.ts import { updateSession } from '@/utils/supabase/middleware' +import { type NextRequest } from 'next/server' export async function middleware(request: NextRequest) { return await updateSession(request) From fb9e6aa9b1c90282a252dc41c52667c30ec92723 Mon Sep 17 00:00:00 2001 From: Minh Au Date: Mon, 4 Mar 2024 22:04:48 -0800 Subject: [PATCH 021/163] Sync NextJs Quick Start and Web App Tutorials (#21718) * rename 'web app tutorials' to 'web app demos' * replace auth helper with server-side auth * add more descriptive instructions * fix small typos * create a section on supabase utitlies * update middleware section to include utilities * update supabase auth ui to include the utilities * add a login/signup form * replace supabase auth ui section with a note * update PCKE section to use /auth/confirm route instead of /auth/callback * update Account Page section to use utilities and switch locations * update Sign out section to use utilities * update bonus section to include utilities * minor fixes * Apply suggestions from code review * format * format * fix js examples --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../NavigationMenu.constants.ts | 2 +- apps/docs/content/guides/getting-started.mdx | 2 +- .../getting-started/tutorials/with-nextjs.mdx | 1095 ++++++++++++----- 3 files changed, 792 insertions(+), 307 deletions(-) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 8fca482d4a6..c96b1d55091 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -264,7 +264,7 @@ export const gettingstarted: NavMenuConstant = { ], }, { - name: 'Web app tutorials', + name: 'Web app demos', items: [ { name: 'Next.js', diff --git a/apps/docs/content/guides/getting-started.mdx b/apps/docs/content/guides/getting-started.mdx index 5265ed88ec6..5d59dbce971 100644 --- a/apps/docs/content/guides/getting-started.mdx +++ b/apps/docs/content/guides/getting-started.mdx @@ -183,7 +183,7 @@ hideToc: true })}
    -### Web app tutorials +### Web app demos
    { diff --git a/apps/docs/content/guides/getting-started/tutorials/with-nextjs.mdx b/apps/docs/content/guides/getting-started/tutorials/with-nextjs.mdx index 9c409a64564..39d061a003e 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-nextjs.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-nextjs.mdx @@ -55,7 +55,7 @@ npm install @supabase/supabase-js ``` And finally we want to save the environment variables in a `.env.local`. -All we need are the API URL and the `anon` key that you copied [earlier](#get-the-api-keys). +Create a `.env.local` file at the root of the project, and paste the API URL and the `anon` key that you copied [earlier](#get-the-api-keys). ```bash .env.local NEXT_PUBLIC_SUPABASE_URL=YOUR_SUPABASE_URL @@ -67,280 +67,613 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY An optional step is to update the CSS file `app/globals.css` to make the app look nice. You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/nextjs-user-management/app/globals.css). -### Supabase Auth Helpers +### Supabase Server-Side Auth Next.js is a highly versatile framework offering pre-rendering at build time (SSG), server-side rendering at request time (SSR), API routes, and middleware edge-functions. -It can be challenging to authenticate your users in all these different environments, that's why we've created the [Supabase Auth Helpers](/docs/guides/auth/auth-helpers/nextjs) to make user management and data fetching within Next.js as easy as possible. +To better integrate with the framework, we've created the `@supabase/ssr` package for Server-Side Auth. It has all the functionalities to quickly configure your Supabase project to use cookies for storing user sessions. See the [Next.js Server-Side Auth guide](/docs/guides/auth/server-side/nextjs) for more information. -Install the auth helpers for Next.js +Install the package for Next.js. ```bash -npm install @supabase/auth-helpers-nextjs @supabase/supabase-js +npm install @supabase/ssr ``` +### Supabase utilities + +There are two different types of clients in Supabase: + +1. **Client Component client** - To access Supabase from Client Components, which run in the browser. +2. **Server Component client** - To access Supabase from Server Components, Server Actions, and Route Handlers, which run only on the server. + +It is recommended to create the following essential utilities files for creating clients, and organize them within `utils/supabase` at the root of the project. + + + + + +Create a `client.js` and a `server.js` with the following functionalities for client-side Supabase and server-side Supabase, respectively. + + + +```jsx utils/supabase/client.js +import { createBrowserClient } from '@supabase/ssr' + +export function createClient() { + // Create a supabase client on the browser with project's credentials + return createBrowserClient( + process.env.NEXT_PUBLIC_SUPABASE_URL!, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY! + ) +} +``` + +```jsx utils/supabase/server.js +import { createServerClient } from '@supabase/ssr' +import { cookies } from 'next/headers' + +export function createClient() { + const cookieStore = cookies() + + // Create a server's supabase client with newly configured cookie, + // which could be used to maintain user's session + return createServerClient( + process.env.NEXT_PUBLIC_SUPABASE_URL!, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, + { + cookies: { + get(name: string) { + return cookieStore.get(name)?.value + }, + set(name, value, options) { + try { + cookieStore.set({ name, value, ...options }) + } catch (error) { + // The `set` method was called from a Server Component. + // This can be ignored if you have middleware refreshing + // user sessions. + } + }, + remove(name, options) { + try { + cookieStore.set({ name, value: '', ...options }) + } catch (error) { + // The `delete` method was called from a Server Component. + // This can be ignored if you have middleware refreshing + // user sessions. + } + }, + }, + } + ) +} +``` + + + + + + + + + +```tsx utils/supabase/client.ts +import { createBrowserClient } from '@supabase/ssr' + +export function createClient() { + // Create a supabase client on the browser with project's credentials + return createBrowserClient( + process.env.NEXT_PUBLIC_SUPABASE_URL!, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY! + ) +} +``` + +```tsx utils/supabase/server.ts +import { createServerClient, type CookieOptions } from '@supabase/ssr' +import { cookies } from 'next/headers' + +export function createClient() { + const cookieStore = cookies() + + // Create a server's supabase client with newly configured cookie, + // which could be used to maintain user's session + return createServerClient( + process.env.NEXT_PUBLIC_SUPABASE_URL!, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, + { + cookies: { + get(name: string) { + return cookieStore.get(name)?.value + }, + set(name: string, value: string, options: CookieOptions) { + try { + cookieStore.set({ name, value, ...options }) + } catch (error) { + // The `set` method was called from a Server Component. + // This can be ignored if you have middleware refreshing + // user sessions. + } + }, + remove(name: string, options: CookieOptions) { + try { + cookieStore.set({ name, value: '', ...options }) + } catch (error) { + // The `delete` method was called from a Server Component. + // This can be ignored if you have middleware refreshing + // user sessions. + } + }, + }, + } + ) +} +``` + + + + + + + ### Next.js middleware - - +Since Server Components can't write cookies, you need middleware to refresh expired Auth tokens and store them. This is accomplished by: -Create a `middleware.js` file and include the following content to: +- Refreshing the Auth token with the call to `supabase.auth.getUser`. +- Passing the refreshed Auth token to Server Components through `request.cookies.set`, so they don't attempt to refresh the same token themselves. +- Passing the refreshed Auth token to the browser, so it replaces the old token. This is done with `response.cookies.set`. -- Verify if there is an authenticated Supabase user -- Validate if the user is authenticated and currently on the sign-in page, redirecting them to the `account` page -- Verify if the user is not authenticated and currently on the account page, redirecting them to the `sign-in` page. +You could also add a matcher, so that the middleware only runs on route that access Supabase. For more information, check out this [documentation](https://nextjs.org/docs/app/building-your-application/routing/middleware#matching-paths). -```tsx middleware.js -import { createMiddlewareClient } from '@supabase/auth-helpers-nextjs' -import { NextResponse } from 'next/server' + -export async function middleware(req) { - const res = NextResponse.next() - const supabase = createMiddlewareClient({ req, res }) +Be careful when protecting pages. The server gets the user session from the cookies, which can be spoofed by anyone. - const { - data: { user }, - } = await supabase.auth.getUser() +Always use `supabase.auth.getUser()` to protect pages and user data. - // if user is signed in and the current path is / redirect the user to /account - if (user && req.nextUrl.pathname === '/') { - return NextResponse.redirect(new URL('/account', req.url)) - } +_Never_ trust `supabase.auth.getSession()` inside server code such as middleware. It isn't guaranteed to revalidate the Auth token. - // if user is not signed in and the current path is not / redirect the user to / - if (!user && req.nextUrl.pathname !== '/') { - return NextResponse.redirect(new URL('/', req.url)) - } - - return res -} - -export const config = { - matcher: ['/', '/account'], -} -``` - - - - -Create a `middleware.ts` file and include the following content to: - -- Verify if there is an authenticated Supabase user -- Validate if the user is authenticated and currently on the sign-in page, redirecting them to the `account` page -- Verify if the user is not authenticated and currently on the account page, redirecting them to the `sign-in` page. - -```tsx middleware.ts -import { createMiddlewareClient } from '@supabase/auth-helpers-nextjs' -import { NextResponse } from 'next/server' - -import type { NextRequest } from 'next/server' - -export async function middleware(req: NextRequest) { - const res = NextResponse.next() - const supabase = createMiddlewareClient({ req, res }) - - const { - data: { user }, - } = await supabase.auth.getUser() - - // if user is signed in and the current path is / redirect the user to /account - if (user && req.nextUrl.pathname === '/') { - return NextResponse.redirect(new URL('/account', req.url)) - } - - // if user is not signed in and the current path is not / redirect the user to / - if (!user && req.nextUrl.pathname !== '/') { - return NextResponse.redirect(new URL('/', req.url)) - } - - return res -} - -export const config = { - matcher: ['/', '/account'], -} -``` - - - - -### Set up a login component - -#### Supabase Auth UI - -We can use the [Supabase Auth UI](/docs/guides/auth/auth-helpers/auth-ui) a pre-built React component for authenticating users via OAuth, email, and magic links. - -Install the Supabase Auth UI for React - -```bash -npm install @supabase/auth-ui-react @supabase/auth-ui-shared -``` - -Create an `AuthForm` client side component with the `Auth` component rendered within it: - - - - -```jsx app/auth-form.jsx -'use client' -import { Auth } from '@supabase/auth-ui-react' -import { ThemeSupa } from '@supabase/auth-ui-shared' -import { createClientComponentClient } from '@supabase/auth-helpers-nextjs' - -export default function AuthForm() { - const supabase = createClientComponentClient() - - return ( - - ) -} -``` - - - - -```jsx app/auth-form.tsx -'use client' -import { Auth } from '@supabase/auth-ui-react' -import { ThemeSupa } from '@supabase/auth-ui-shared' -import { createClientComponentClient } from '@supabase/auth-helpers-nextjs' -import { Database } from './database.types' - -export default function AuthForm() { - const supabase = createClientComponentClient() - - return ( - - ) -} -``` - - - - - - -If you are using TypeScript for this project, see [generating types](/docs/guides/api/rest/generating-types) to automatically generate types from your database tables. +It's safe to trust `getUser()` because it sends a request to the Supabase Auth server every time to revalidate the Auth token. -Add the `AuthForm` component to your home page + -```jsx app/page.js -import AuthForm from './auth-form' + -export default function Home() { +Create a `middleware.js` file at the project root and another one within the `utils/supabase` folder. The `utils/supabase` file contains the logic for updating the session. This is used by the `middleware.js` file, which is a Next.js convention. + + + +```jsx middleware.js +import { updateSession } from '@/utils/supabase/middleware' + +export async function middleware(request) { + // update user's auth session + return await updateSession(request) +} + +export const config = { + matcher: [ + /* + * Match all request paths except for the ones starting with: + * - _next/static (static files) + * - _next/image (image optimization files) + * - favicon.ico (favicon file) + * Feel free to modify this pattern to include more paths. + */ + '/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)', + ], +} +``` + +```jsx utils/supabase/middleware.js +import { createServerClient } from '@supabase/ssr' +import { NextResponse } from 'next/server' + +export async function updateSession(request) { + let response = NextResponse.next({ + request: { + headers: request.headers, + }, + }) + + const supabase = createServerClient( + process.env.NEXT_PUBLIC_SUPABASE_URL, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY, + { + cookies: { + get(name) { + return request.cookies.get(name)?.value + }, + set(name, value, options) { + request.cookies.set({ + name, + value, + ...options, + }) + response = NextResponse.next({ + request: { + headers: request.headers, + }, + }) + response.cookies.set({ + name, + value, + ...options, + }) + }, + remove(name, options) { + request.cookies.set({ + name, + value: '', + ...options, + }) + response = NextResponse.next({ + request: { + headers: request.headers, + }, + }) + response.cookies.set({ + name, + value: '', + ...options, + }) + }, + }, + } + ) + + // refreshing the auth token + await supabase.auth.getUser() + + return response +} +``` + + + + + + + +Create a `middleware.ts` file at the project root and another one within the `util/ssupbase` folder. The `utils/supabase` file contains the logic for updating the session. This is used by the `middleware.js` file, which is a Next.js convention. + + + +```tsx middleware.ts +import { type NextRequest } from 'next/server' +import { updateSession } from '@/utils/supabase/middleware' + +export async function middleware(request: NextRequest) { + // update user's auth session + return await updateSession(request) +} + +export const config = { + matcher: [ + /* + * Match all request paths except for the ones starting with: + * - _next/static (static files) + * - _next/image (image optimization files) + * - favicon.ico (favicon file) + * Feel free to modify this pattern to include more paths. + */ + '/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)', + ], +} +``` + +```tsx utils/supabase/middleware.ts +import { createServerClient, type CookieOptions } from '@supabase/ssr' +import { NextResponse, type NextRequest } from 'next/server' + +export async function updateSession(request: NextRequest) { + let response = NextResponse.next({ + request: { + headers: request.headers, + }, + }) + + const supabase = createServerClient( + process.env.NEXT_PUBLIC_SUPABASE_URL!, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, + { + cookies: { + get(name: string) { + return request.cookies.get(name)?.value + }, + set(name: string, value: string, options: CookieOptions) { + request.cookies.set({ + name, + value, + ...options, + }) + response = NextResponse.next({ + request: { + headers: request.headers, + }, + }) + response.cookies.set({ + name, + value, + ...options, + }) + }, + remove(name: string, options: CookieOptions) { + request.cookies.set({ + name, + value: '', + ...options, + }) + response = NextResponse.next({ + request: { + headers: request.headers, + }, + }) + response.cookies.set({ + name, + value: '', + ...options, + }) + }, + }, + } + ) + + // refreshing the auth token + await supabase.auth.getUser() + + return response +} +``` + + + + + + + +## Set up a login page + +### Login and Signup form + +Create a login/signup page for your application: + + + + + +Create a new folder named `login`, containing a `page.jsx` file with a login/signup form. + +```jsx app/login/page.jsx +import { login, signup } from './actions' + +export default function LoginPage() { return ( -
    -
    -

    Supabase Auth + Storage

    -

    - Experience our Auth and Storage through a simple profile management example. Create a user - profile and upload an avatar image. Fast, simple, secure. -

    -
    -
    - -
    -
    + + + + + + + + ) } ``` +
    + + + +Create a new folder named `login`, containing a `page.jsx` file with a login/signup form. + +```tsx app/login/page.tsx +import { login, signup } from './actions' + +export default function LoginPage() { + return ( +
    + + + + + + +
    + ) +} +``` + +
    + +
    + +Navigate to `http://localhost:3000/login`. You should see your login form, but it's not yet hooked up to the actual login function. Next, you need to create the login/signup actions. They will: + +- Retrieve the user's information. +- Send that information to Supabase as a signup request, which in turns will send a confirmation email. +- Handle any error that arises. + + + +Note that cookies is called before any calls to Supabase, which opts fetch calls out of Next.js's caching. This is important for authenticated data fetches, to ensure that users get access only to their own data. + +See the Next.js docs to learn more about [opting out of data caching](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#opting-out-of-data-caching). + + + + + + + + + +```js app/login/action.js +'use server' + +import { revalidatePath } from 'next/cache' +import { redirect } from 'next/navigation' + +import { createClient } from '@/utils/supabase/server' + +export async function login(formData) { + const supabase = createClient() + + // type-casting here for convenience + // in practice, you should validate your inputs + const data = { + email: formData.get('email'), + password: formData.get('password'), + } + + const { error } = await supabase.auth.signInWithPassword(data) + + if (error) { + redirect('/error') + } + + revalidatePath('/', 'layout') + redirect('/account') +} + +export async function signup(formData) { + const supabase = createClient() + + const data = { + email: formData.get('email'), + password: formData.get('password'), + } + + const { error } = await supabase.auth.signUp(data) + + if (error) { + redirect('/error') + } + + revalidatePath('/', 'layout') + redirect('/account') +} +``` + +```jsx app/error/page.jsx +export default function ErrorPage() { + return

    Sorry, something went wrong

    +} +``` + +
    + +
    + + + + + +```ts app/login/action.ts +'use server' + +import { revalidatePath } from 'next/cache' +import { redirect } from 'next/navigation' + +import { createClient } from '@/utils/supabase/server' + +export async function login(formData: FormData) { + const supabase = createClient() + + // type-casting here for convenience + // in practice, you should validate your inputs + const data = { + email: formData.get('email') as string, + password: formData.get('password') as string, + } + + const { error } = await supabase.auth.signInWithPassword(data) + + if (error) { + redirect('/error') + } + + revalidatePath('/', 'layout') + redirect('/account') +} + +export async function signup(formData: FormData) { + const supabase = createClient() + + // type-casting here for convenience + // in practice, you should validate your inputs + const data = { + email: formData.get('email') as string, + password: formData.get('password') as string, + } + + const { error } = await supabase.auth.signUp(data) + + if (error) { + redirect('/error') + } + + revalidatePath('/', 'layout') + redirect('/account') +} +``` + +```tsx app/error/page.tsx +export default function ErrorPage() { + return

    Sorry, something went wrong

    +} +``` + +
    + +
    + +When you enter your email and password, you will receive an email with the title **Confirm Your Signup**. Congrats 🎉!!! + +
    + ### Proof Key for Code Exchange (PKCE) -As we are employing Proof Key for Code Exchange (PKCE) in our authentication flow, it is necessary to create a route handler responsible for exchanging the code for a session. +Upon sign up, an email will be sent to the user with a unique hash code. This key can then be sent back to the application for verification, thus authenticating the user. The method is referred to as Proof Key for Code Exchange (PKCE). As we are employing PKCE in our authentication flow, it is necessary to create a route handler responsible for exchanging the code for a session. In the following code snippet, we perform the following steps: -- Retrieve the code sent back from the Supabase Auth server using the `code` query parameter. +- Retrieve the code sent back from the Supabase Auth server using the `token_hash` query parameter. - Exchange this code for a session, which we store in our chosen storage mechanism (in this case, cookies). - Finally, we redirect the user to the `account` page. - - + -```js app/auth/callback/route.js -import { createRouteHandlerClient } from '@supabase/auth-helpers-nextjs' -import { cookies } from 'next/headers' -import { NextResponse } from 'next/server' +Did you know? You could also customize emails sent out to new users, including the email's looks, content, and query parameters. Check out the [settings of your project](/dashboard/project/_/auth/templates). -export async function GET(req) { - const cookieStore = cookies() - const supabase = createRouteHandlerClient({ cookies: () => cookieStore }) - const { searchParams } = new URL(req.url) - const code = searchParams.get('code') - - if (code) { - await supabase.auth.exchangeCodeForSession(code) - } - - return NextResponse.redirect(new URL('/account', req.url)) -} -``` - - - - -```ts app/auth/callback/route.ts -import { createRouteHandlerClient } from '@supabase/auth-helpers-nextjs' -import { cookies } from 'next/headers' -import { NextRequest, NextResponse } from 'next/server' - -export async function GET(req: NextRequest) { - const cookieStore = cookies() - const supabase = createRouteHandlerClient({ cookies: () => cookieStore }) - const { searchParams } = new URL(req.url) - const code = searchParams.get('code') - - if (code) { - await supabase.auth.exchangeCodeForSession(code) - } - - return NextResponse.redirect(new URL('/account', req.url)) -} -``` - - - - -### Sign out - -Let's create a route handler to handle the signout from the server side. + + -```js app/auth/signout/route.js -import { createRouteHandlerClient } from '@supabase/auth-helpers-nextjs' -import { cookies } from 'next/headers' -import { NextResponse } from 'next/server' - -export async function POST(req) { - const cookieStore = cookies() - const supabase = createRouteHandlerClient({ cookies: () => cookieStore }) - - // Check if we have a session - const { - data: { user }, - } = await supabase.auth.getUser() - - if (user) { - await supabase.auth.signOut() - } - - return NextResponse.redirect(new URL('/', req.url), { - status: 302, - }) -} -``` - - - - -```ts app/auth/signout/route.ts -import { createRouteHandlerClient } from '@supabase/auth-helpers-nextjs' -import { cookies } from 'next/headers' +```js app/auth/confirm/route.js import { type NextRequest, NextResponse } from 'next/server' -export async function POST(req: NextRequest) { - const cookieStore = cookies() - const supabase = createRouteHandlerClient({ cookies: () => cookieStore }) +import { createClient } from '@/utils/supabase/server' - // Check if we have a session - const { - data: { session }, - } = await supabase.auth.getSession() +// Creating a handler to a GET request to route /auth/confirm +export async function GET(request) { + const { searchParams } = new URL(request.url) + const token_hash = searchParams.get('token_hash') + const type = searchParams.get('type') + const next = '/account' - if (session) { - await supabase.auth.signOut() + // Create redirect link without the secret token + const redirectTo = request.nextUrl.clone() + redirectTo.pathname = next + redirectTo.searchParams.delete('token_hash') + redirectTo.searchParams.delete('type') + + if (token_hash && type) { + const supabase = createClient() + + const { error } = await supabase.auth.verifyOtp({ + type, + token_hash, + }) + if (!error) { + redirectTo.searchParams.delete('next') + return NextResponse.redirect(redirectTo) + } } - return NextResponse.redirect(new URL('/', req.url), { - status: 302, - }) + // return the user to an error page with some instructions + redirectTo.pathname = '/error' + return NextResponse.redirect(redirectTo) } ``` + + + +```ts app/auth/confirm/route.ts +import { type EmailOtpType } from '@supabase/supabase-js' +import { type NextRequest, NextResponse } from 'next/server' + +import { createClient } from '@/utils/supabase/server' + +// Creating a handler to a GET request to route /auth/confirm +export async function GET(request: NextRequest) { + const { searchParams } = new URL(request.url) + const token_hash = searchParams.get('token_hash') + const type = searchParams.get('type') as EmailOtpType | null + const next = '/account' + + // Create redirect link without the secret token + const redirectTo = request.nextUrl.clone() + redirectTo.pathname = next + redirectTo.searchParams.delete('token_hash') + redirectTo.searchParams.delete('type') + + if (token_hash && type) { + const supabase = createClient() + + const { error } = await supabase.auth.verifyOtp({ + type, + token_hash, + }) + if (!error) { + redirectTo.searchParams.delete('next') + return NextResponse.redirect(redirectTo) + } + } + + // return the user to an error page with some instructions + redirectTo.pathname = '/error' + return NextResponse.redirect(redirectTo) +} +``` + + + ### Account page @@ -418,15 +781,18 @@ Let's create a new component for that called `AccountForm` within the `app/accou defaultActiveId="js" queryGroup="language" > + + + ```jsx app/account/account-form.jsx 'use client' import { useCallback, useEffect, useState } from 'react' -import { createClientComponentClient } from '@supabase/auth-helpers-nextjs' +import { createClient } from '@/utils/supabase/client' export default function AccountForm({ user }) { - const supabase = createClientComponentClient() + const supabase = createClient() const [loading, setLoading] = useState(true) const [fullname, setFullname] = useState(null) const [username, setUsername] = useState(null) @@ -541,17 +907,22 @@ export default function AccountForm({ user }) { } ``` + + + + + ```tsx app/account/account-form.tsx 'use client' import { useCallback, useEffect, useState } from 'react' -import { Database } from '../database.types' -import { User, createClientComponentClient } from '@supabase/auth-helpers-nextjs' +import { createClient } from '@/utils/supabase/client' +import { type User } from '@supabase/supabase-js' export default function AccountForm({ user }: { user: User | null }) { - const supabase = createClientComponentClient() + const supabase = createClient() const [loading, setLoading] = useState(true) const [fullname, setFullname] = useState(null) const [username, setUsername] = useState(null) @@ -569,6 +940,7 @@ export default function AccountForm({ user }: { user: User | null }) { .single() if (error && status !== 406) { + console.log(error) throw error } @@ -675,7 +1047,10 @@ export default function AccountForm({ user }: { user: User | null }) { } ``` + + + Create an account page for the `AccountForm` component we just created @@ -687,16 +1062,15 @@ Create an account page for the `AccountForm` component we just created defaultActiveId="js" queryGroup="language" > + ```jsx app/account/page.jsx -import { createServerComponentClient } from '@supabase/auth-helpers-nextjs' -import { cookies } from 'next/headers' import AccountForm from './account-form' +import { createClient } from '@/utils/supabase/server' export default async function Account() { - const cookieStore = cookies() - const supabase = createServerComponentClient({ cookies: () => cookieStore }) + const supabase = createClient() const { data: { user }, @@ -707,16 +1081,15 @@ export default async function Account() { ``` + ```tsx app/account/page.tsx -import { createServerComponentClient } from '@supabase/auth-helpers-nextjs' -import { cookies } from 'next/headers' -import { Database } from '../database.types' import AccountForm from './account-form' +import { createClient } from '@/utils/supabase/server' export default async function Account() { - const supabase = createServerComponentClient({ cookies }) + const supabase = createClient() const { data: { user }, @@ -729,6 +1102,76 @@ export default async function Account() { +### Sign out + +Let's create a route handler to handle the signout from the server side. Make sure to check if the user is logged in first! + + + + + +```js app/auth/signout/route.js +import { createClient } from '@/utils/supabase/server' +import { revalidatePath } from 'next/cache' +import { NextResponse } from 'next/server' + +export async function POST(req) { + const supabase = createClient() + + // Check if a user's logged in + const { + data: { user }, + } = await supabase.auth.getUser() + + if (user) { + await supabase.auth.signOut() + } + + revalidatePath('/', 'layout') + return NextResponse.redirect(new URL('/login', req.url), { + status: 302, + }) +} +``` + + + + + +```ts app/auth/signout/route.ts +import { createClient } from '@/utils/supabase/server' +import { revalidatePath } from 'next/cache' +import { type NextRequest, NextResponse } from 'next/server' + +export async function POST(req: NextRequest) { + const supabase = createClient() + + // Check if a user's logged in + const { + data: { user }, + } = await supabase.auth.getUser() + + if (user) { + await supabase.auth.signOut() + } + + revalidatePath('/', 'layout') + return NextResponse.redirect(new URL('/login', req.url), { + status: 302, + }) +} +``` + + + + + ### Launch! Now that we have all the pages, route handlers and components in place, let's run this in a terminal window: @@ -755,17 +1198,18 @@ Let's create an avatar widget for the user so that they can upload a profile pho defaultActiveId="js" queryGroup="language" > + ```jsx app/account/avatar.jsx 'use client' import React, { useEffect, useState } from 'react' -import { createClientComponentClient } from '@supabase/auth-helpers-nextjs' +import { createClient } from '@/utils/supabase/client' import Image from 'next/image' export default function Avatar({ uid, url, size, onUpload }) { - const supabase = createClientComponentClient() - const [avatarUrl, setAvatarUrl] = useState(null) + const supabase = createClient() + const [avatarUrl, setAvatarUrl] = useState(url) const [uploading, setUploading] = useState(false) useEffect(() => { @@ -848,15 +1292,14 @@ export default function Avatar({ uid, url, size, onUpload }) { ``` + ```tsx app/account/avatar.tsx 'use client' import React, { useEffect, useState } from 'react' -import { Database } from '../database.types' -import { createClientComponentClient } from '@supabase/auth-helpers-nextjs' +import { createClient } from '@/utils/supabase/client' import Image from 'next/image' -type Profiles = Database['public']['Tables']['profiles']['Row'] export default function Avatar({ uid, @@ -864,13 +1307,13 @@ export default function Avatar({ size, onUpload, }: { - uid: string - url: Profiles['avatar_url'] + uid: string | null + url: string | null size: number onUpload: (url: string) => void }) { - const supabase = createClientComponentClient() - const [avatarUrl, setAvatarUrl] = useState(url) + const supabase = createClient() + const [avatarUrl, setAvatarUrl] = useState(url) const [uploading, setUploading] = useState(false) useEffect(() => { @@ -953,13 +1396,24 @@ export default function Avatar({ ``` + ### Add the new widget And then we can add the widget to the `AccountForm` component: -```jsx app/account/account-form.js + + + + +```jsx app/account/account-form.jsx // Import the new component import Avatar from './avatar' @@ -969,7 +1423,7 @@ return (
    {/* Add to the body */} { @@ -982,6 +1436,37 @@ return ( ) ``` + + + + +```tsx app/account/account-form.tsx +// Import the new component +import Avatar from './avatar' + +// ... + +return ( +
    + {/* Add to the body */} + { + setAvatarUrl(url) + updateProfile({ fullname, username, website, avatar_url: url }) + }} + /> + {/* ... */} +
    +) +``` + +
    + + + ### Storage management From 64863f407f9026bf520164f875dffd164b7cef01 Mon Sep 17 00:00:00 2001 From: Tyler Date: Tue, 5 Mar 2024 15:06:07 +0900 Subject: [PATCH 022/163] docs: Add `params` option to reference docs so that non-js client libs can add parameters (#21708) * Adds params option for reference docs * move params below description * Apply suggestions from code review * Update apps/docs/spec/supabase_dart_v2.yml --- .../reference/RefFunctionSection.tsx | 4 +- apps/docs/spec/supabase_dart_v2.yml | 38 +++++++++++++++++-- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/apps/docs/components/reference/RefFunctionSection.tsx b/apps/docs/components/reference/RefFunctionSection.tsx index 19d14023f54..983594113ad 100644 --- a/apps/docs/components/reference/RefFunctionSection.tsx +++ b/apps/docs/components/reference/RefFunctionSection.tsx @@ -22,7 +22,7 @@ const RefFunctionSection: React.FC = (props) => { const tsDefinition = hasTsRef && props.typeSpec ? extractTsDocNode(hasTsRef, props.typeSpec) : null - const parameters = hasTsRef && tsDefinition ? generateParameters(tsDefinition) : '' + const parameters = hasTsRef && tsDefinition ? generateParameters(tsDefinition) : item.params const shortText = hasTsRef && tsDefinition ? tsDefinition.signatures[0].comment.shortText : '' return ( @@ -51,7 +51,7 @@ const RefFunctionSection: React.FC = (props) => {
    )} - {/* // parameters */} + {/* parameters */} {parameters && (
    Parameters
    diff --git a/apps/docs/spec/supabase_dart_v2.yml b/apps/docs/spec/supabase_dart_v2.yml index 3657561a065..c10621ba3da 100644 --- a/apps/docs/spec/supabase_dart_v2.yml +++ b/apps/docs/spec/supabase_dart_v2.yml @@ -6,8 +6,6 @@ info: description: | Supabase Dart. - - definition: spec/enrichments/tsdoc_v2/combined.json slugPrefix: '/' specUrl: https://github.com/supabase/supabase/edit/master/apps/docs/spec/supabase_dart_v2.yml libraries: @@ -23,7 +21,41 @@ functions: The Supabase client is your entrypoint to the rest of the Supabase functionality and is the easiest way to interact with everything we offer within the Supabase ecosystem. - + params: + - name: url + isOptional: false + type: string + description: The unique Supabase URL which is supplied when you create a new project in your project dashboard. + - name: anonKey + isOptional: false + type: string + description: The unique Supabase Key which is supplied when you create a new project in your project dashboard. + - name: authOptions + isOptional: true + type: FlutterAuthClientOptions + description: Options to change the Auth behaviors. + subContent: + - name: authFlowType + isOptional: true + type: AuthFlowType + description: Whether to use the `pkce` flow or the `implicit` flow. Defaults to `pkce`. + - name: localStorage + isOptional: true + type: LocalStorage + description: Parameter to override the local storage to store auth tokens. + - name: autoRefreshToken + isOptional: true + type: boolean + description: Whether to automatically refresh the token when it expires. Defaults to `true`. + - name: realtimeClientOptions + isOptional: true + type: RealtimeClientOptions + description: Options to change the Realtime behaviors. + subContent: + - name: logLevel + isOptional: true + type: RealtimeLogLevel + description: Level of realtime server logs to to be logged. examples: - id: flutter-initialize name: For Flutter From 4d829bfb93f5b7a58c8034bb6edab244a1a56efa Mon Sep 17 00:00:00 2001 From: Leo <45669613+Hahlh@users.noreply.github.com> Date: Tue, 5 Mar 2024 07:27:20 +0100 Subject: [PATCH 023/163] Add missing import to nextjs.mdx (#21527) * Add missing import to nextjs.mdx * Update apps/docs/content/guides/auth/server-side/nextjs.mdx --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/content/guides/auth/server-side/nextjs.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/docs/content/guides/auth/server-side/nextjs.mdx b/apps/docs/content/guides/auth/server-side/nextjs.mdx index 71f357f53c1..fc5e8e8aced 100644 --- a/apps/docs/content/guides/auth/server-side/nextjs.mdx +++ b/apps/docs/content/guides/auth/server-side/nextjs.mdx @@ -203,6 +203,7 @@ It's safe to trust `getUser()` because it sends a request to the Supabase Auth s ```ts middleware.ts +import { type NextRequest } from 'next/server' import { updateSession } from '@/utils/supabase/middleware' import { type NextRequest } from 'next/server' From c7650b100ed11db0a2216d8c72a4ecbe0b312f46 Mon Sep 17 00:00:00 2001 From: Ryan Halliday Date: Tue, 5 Mar 2024 19:33:22 +1300 Subject: [PATCH 024/163] Update next.js setup docs email template (#21466) * Update next.js setup docs email template The email templates need to have the type parameter. The wording here is a bit clumsy but it's hard to convey succinctly. A variable for the email type would be kinda cool. I was getting 401 `AuthApiError: Email link is invalid or has expired` until I changed this for my `magiclink` * Update apps/docs/content/guides/auth/server-side/nextjs.mdx --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/content/guides/auth/server-side/nextjs.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/content/guides/auth/server-side/nextjs.mdx b/apps/docs/content/guides/auth/server-side/nextjs.mdx index fc5e8e8aced..633ffaaeb66 100644 --- a/apps/docs/content/guides/auth/server-side/nextjs.mdx +++ b/apps/docs/content/guides/auth/server-side/nextjs.mdx @@ -402,7 +402,7 @@ If you have email confirmation turned on (the default), a new user will receive Change the email template to support a server-side authentication flow. -Go to the [Auth templates](https://supabase.com/dashboard/project/_/auth/templates) page in your dashboard. In each email template, change `{{ .ConfirmationURL }}` to `{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=signup`. +Go to the [Auth templates](https://supabase.com/dashboard/project/_/auth/templates) page in your dashboard. In the `Confirm signup` template, change `{{ .ConfirmationURL }}` to `{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=signup`. From 9a68e5a377eaed06e57355936e2063974253c078 Mon Sep 17 00:00:00 2001 From: Nick James <142161096+kitchenchem224@users.noreply.github.com> Date: Mon, 4 Mar 2024 22:38:20 -0800 Subject: [PATCH 025/163] Update with-svelte.mdx (#21432) ### Account page fixed sign out function --- .../content/guides/getting-started/tutorials/with-svelte.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/docs/content/guides/getting-started/tutorials/with-svelte.mdx b/apps/docs/content/guides/getting-started/tutorials/with-svelte.mdx index e95078cce5f..b85eb77996c 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-svelte.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-svelte.mdx @@ -117,7 +117,7 @@ Let's set up a Svelte component to manage logins and sign ups. We'll use Magic L After a user is signed in we can allow them to edit their profile details and manage their account. Let's create a new component for that called `Account.svelte`. -```html src/lib/Account.svelte +```tsx src/lib/Account.svelte ``` -### Storage management - - - At this stage you have a fully functional application! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-nextjs.mdx b/apps/docs/content/guides/getting-started/tutorials/with-nextjs.mdx index cf66bff382b..d44da1bbb07 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-nextjs.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-nextjs.mdx @@ -1467,10 +1467,6 @@ return ( -### Storage management - - - At this stage you have a fully functional application! ## See also diff --git a/apps/docs/content/guides/getting-started/tutorials/with-nuxt-3.mdx b/apps/docs/content/guides/getting-started/tutorials/with-nuxt-3.mdx index 70f9d7e5485..ef3180c37b0 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-nuxt-3.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-nuxt-3.mdx @@ -434,8 +434,4 @@ async function signOut() { ``` -### Storage management - - - That is it! You should now be able to upload a profile photo to Supabase Storage and you have a fully functional application. diff --git a/apps/docs/content/guides/getting-started/tutorials/with-react.mdx b/apps/docs/content/guides/getting-started/tutorials/with-react.mdx index 5f0307fdb24..8ca9181db0d 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-react.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-react.mdx @@ -396,8 +396,4 @@ return ( ) ``` -### Storage management - - - At this stage you have a fully functional application! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx b/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx index 58300bd88f3..75e51643f4c 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx @@ -603,10 +603,6 @@ return ( ) ``` -### Storage management - - - At this stage you have a fully functional application! ## See also diff --git a/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx b/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx index 502e4d6cd3a..0192a305f14 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx @@ -626,8 +626,4 @@ return ( ) ``` -### Storage management - - - At this stage, you have a fully functional application! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-solidjs.mdx b/apps/docs/content/guides/getting-started/tutorials/with-solidjs.mdx index 80d4dba6167..92544c54791 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-solidjs.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-solidjs.mdx @@ -415,8 +415,4 @@ return ( ) ``` -### Storage management - - - At this stage you have a fully functional application! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-svelte.mdx b/apps/docs/content/guides/getting-started/tutorials/with-svelte.mdx index b85eb77996c..85a9f223967 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-svelte.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-svelte.mdx @@ -367,8 +367,4 @@ And then we can add the widget to the Account page: ``` -### Storage management - - - At this stage you have a fully functional application! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx b/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx index edd59df53e3..5b5172b6c37 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx @@ -610,8 +610,4 @@ And then we can add the widget to the Account page:
    ``` -### Storage management - - - At this stage you have a fully functional application! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-swift.mdx b/apps/docs/content/guides/getting-started/tutorials/with-swift.mdx index 369748f09e5..6c110b51b6e 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-swift.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-swift.mdx @@ -514,8 +514,4 @@ struct Profile: Codable { You no longer need the `UpdateProfileParams` struct, as you can now reuse the `Profile` struct for both request and response calls. -### Storage management - - - At this stage you have a fully functional application! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-vue-3.mdx b/apps/docs/content/guides/getting-started/tutorials/with-vue-3.mdx index 10bf93c4c6e..27778b2a6b2 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-vue-3.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-vue-3.mdx @@ -377,8 +377,4 @@ import Avatar from './Avatar.vue' ``` -### Storage management - - - At this stage you have a fully functional application! From e4f25c46940958e942f2d0d1e4abfa0bf067e4b2 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 18 Mar 2024 12:48:11 +0700 Subject: [PATCH 133/163] Remove using statement for one of the RLS policy templates that's an INSERT command (#22080) * Remove using statement for one of the RLS policy templates that's an INSERT command * Fix --- .../PolicyEditorModal/PolicyEditorModal.constants.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModal.constants.ts b/apps/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModal.constants.ts index 5ac030e534a..e55f8381737 100644 --- a/apps/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModal.constants.ts +++ b/apps/studio/components/interfaces/Auth/Policies/PolicyEditorModal/PolicyEditorModal.constants.ts @@ -94,13 +94,11 @@ for delete using ( statement: ` create policy "Enable insert for users based on user_id" on ${schema}.${table} -for insert using ( - auth.uid() = user_id -) with check ( +for insert with check ( auth.uid() = user_id );`.trim(), name: 'Enable insert for users based on user_id', - definition: 'auth.uid() = user_id', + definition: '', check: 'auth.uid() = user_id', command: 'INSERT', roles: [], From 36afa653b3ab4ed502f2e55bd2e49db312369b09 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Mon, 18 Mar 2024 01:48:32 -0400 Subject: [PATCH 134/163] chore: temporarily turn off docs feedback comments (#22049) --- apps/docs/components/Feedback/Feedback.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/docs/components/Feedback/Feedback.tsx b/apps/docs/components/Feedback/Feedback.tsx index 2d656947d23..96137bfd4a1 100644 --- a/apps/docs/components/Feedback/Feedback.tsx +++ b/apps/docs/components/Feedback/Feedback.tsx @@ -178,12 +178,14 @@ function Feedback() { )} > Thanks for your feedback! + {/** setModalOpen(true)} isYes={isYes} visible={!unanswered} /> + */}
    Date: Mon, 18 Mar 2024 10:53:15 +0500 Subject: [PATCH 135/163] docs: :memo: Upload/Replace file documentation #19992 (#19995) Co-authored-by: ahmad_chand Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com> --- apps/docs/spec/supabase_swift_v1.yml | 6 ++++-- apps/docs/spec/supabase_swift_v2.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/docs/spec/supabase_swift_v1.yml b/apps/docs/spec/supabase_swift_v1.yml index 5e76cc23425..6a2365822d7 100644 --- a/apps/docs/spec/supabase_swift_v1.yml +++ b/apps/docs/spec/supabase_swift_v1.yml @@ -3183,8 +3183,9 @@ functions: .upload( path: "public/\(fileName)", file: fileData, - fileOptions: FileOptions( + options: FileOptions( cacheControl: "3600", + contentType: "image/png", upsert: false ) ) @@ -3210,8 +3211,9 @@ functions: .update( path: "public/\(fileName)", file: fileData, - fileOptions: FileOptions( + options: FileOptions( cacheControl: "3600", + contentType: "image/png", upsert: true ) ) diff --git a/apps/docs/spec/supabase_swift_v2.yml b/apps/docs/spec/supabase_swift_v2.yml index 4e1413ba8ff..79c29e8f6ca 100644 --- a/apps/docs/spec/supabase_swift_v2.yml +++ b/apps/docs/spec/supabase_swift_v2.yml @@ -3247,8 +3247,9 @@ functions: .upload( path: "public/\(fileName)", file: fileData, - fileOptions: FileOptions( + options: FileOptions( cacheControl: "3600", + contentType: "image/png", upsert: false ) ) @@ -3274,8 +3275,9 @@ functions: .update( path: "public/\(fileName)", file: fileData, - fileOptions: FileOptions( + options: FileOptions( cacheControl: "3600", + contentType: "image/png", upsert: true ) ) From b88b3d38c7ef6c18039f1a0fcfad0679edf50c67 Mon Sep 17 00:00:00 2001 From: Hieu Date: Mon, 18 Mar 2024 12:53:50 +0700 Subject: [PATCH 136/163] feat: update mgmt api rate limit details (#21657) --- apps/docs/docs/ref/api/api.mdx | 6 +++++- apps/docs/docs/ref/api/introduction.mdx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/docs/docs/ref/api/api.mdx b/apps/docs/docs/ref/api/api.mdx index 70bb75ee9f6..d543ed53351 100644 --- a/apps/docs/docs/ref/api/api.mdx +++ b/apps/docs/docs/ref/api/api.mdx @@ -27,7 +27,11 @@ All API requests must be authenticated and made over HTTPS. ## Rate limits -The API is currently subject to our fair-use policy. In the future, are likely to introduce rate limits. +The rate limit for Management API is 60 requests per one minute per user, and applies cumulatively across all requests made with your personal access tokens. + +If you exceed this limit, all Management API calls for the next minute will be blocked, resulting in a HTTP 429 response. + +The Management API is subject to our fair-use policy. All resources created via the API are subject to the pricing detailed on our [Pricing](https://supabase.com/pricing) pages. ## Additional links diff --git a/apps/docs/docs/ref/api/introduction.mdx b/apps/docs/docs/ref/api/introduction.mdx index 025f209d040..be07aed5833 100644 --- a/apps/docs/docs/ref/api/introduction.mdx +++ b/apps/docs/docs/ref/api/introduction.mdx @@ -35,7 +35,11 @@ hideTitle: true ## Rate limits - The API is currently subject to our fair-use policy. In the future, are likely to introduce rate limits. + The rate limit for Management API is 60 requests per one minute per user, and applies cumulatively across all requests made with your personal access tokens. + + If you exceed this limit, all Management API calls for the next minute will be blocked, resulting in a HTTP 429 response. + + The Management API is subject to our fair-use policy. All resources created via the API are subject to the pricing detailed on our [Pricing](https://supabase.com/pricing) pages. From 138adb2e1106a2d0e1f32093144b51568ee84ab2 Mon Sep 17 00:00:00 2001 From: Alaister Young Date: Mon, 18 Mar 2024 13:03:06 +0700 Subject: [PATCH 137/163] fix: auth provider callback url for staging (#22082) --- .../interfaces/Auth/AuthProvidersForm/ProviderForm.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx index 7b17e20e230..9679aa0a811 100644 --- a/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx +++ b/apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx @@ -4,13 +4,14 @@ import { useParams } from 'common' import { useState } from 'react' import toast from 'react-hot-toast' import ReactMarkdown from 'react-markdown' -import { Alert, Button, Collapsible, Form, IconCheck, IconChevronUp, Input } from 'ui' import type { components } from 'data/api' import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation' +import { useProjectApiQuery } from 'data/config/project-api-query' import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query' import { useCheckPermissions } from 'hooks' import { BASE_PATH } from 'lib/constants' +import { Alert, Button, Collapsible, Form, IconCheck, IconChevronUp, Input } from 'ui' import { ProviderCollapsibleClasses } from './AuthProvidersForm.constants' import type { Provider } from './AuthProvidersForm.types' import FormField from './FormField' @@ -28,7 +29,11 @@ const ProviderForm = ({ config, provider }: ProviderFormProps) => { const doubleNegativeKeys = ['MAILER_AUTOCONFIRM', 'SMS_AUTOCONFIRM'] const canUpdateConfig = useCheckPermissions(PermissionAction.UPDATE, 'custom_config_gotrue') + const { data: settings } = useProjectApiQuery({ projectRef }) + const apiUrl = `${settings?.autoApiService.protocol}://${settings?.autoApiService.endpoint}` + const { data: customDomainData } = useCustomDomainsQuery({ projectRef }) + const generateInitialValues = () => { const initialValues: { [x: string]: string | boolean } = {} @@ -176,7 +181,7 @@ const ProviderForm = ({ config, provider }: ProviderFormProps) => { value={ customDomainData?.customDomain?.status === 'active' ? `https://${customDomainData.customDomain?.hostname}/auth/v1/callback` - : `https://${projectRef}.supabase.co/auth/v1/callback` + : `${apiUrl}/auth/v1/callback` } descriptionText={ From d7c2dc0a33126601fc6545e8311651d38301fed0 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Tue, 19 Mar 2024 09:18:43 +0700 Subject: [PATCH 138/163] docs: add error handling to redirect urls section (#22081) * docs: add error handling to redirect urls section * docs: remove user deleted event --- .../content/guides/auth/concepts/redirect-urls.mdx | 13 +++++++++++++ .../content/guides/auth/server-side-rendering.mdx | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/docs/content/guides/auth/concepts/redirect-urls.mdx b/apps/docs/content/guides/auth/concepts/redirect-urls.mdx index 2fcd240acd8..e1d7f014bad 100644 --- a/apps/docs/content/guides/auth/concepts/redirect-urls.mdx +++ b/apps/docs/content/guides/auth/concepts/redirect-urls.mdx @@ -81,3 +81,16 @@ const { data, error } = await supabase.auth.signInWithOAuth({ For mobile applications you can use deep linking URIs. For example, for your `SITE_URL` you can specify something like `com.supabase://login-callback/` and for additional redirect URLs something like `com.supabase.staging://login-callback/` if needed. Read more about deep linking and find code examples for different frameworks [here](/docs/guides/auth/native-mobile-deep-linking). + +## Error Handling + +When authentication fails, the user will still be redirected to the redirect URL provided. However, the error details will be returned as query fragments in the URL. You can parse these query fragments and show a custom error message to the user. For example: + +```js +const params = new URLSearchParams(window.location.hash.slice()) + +if (params.get('error_code').startsWith('4')) { + // show error message if error is a 4xx error + window.alert(params.get('error_description')) +} +``` diff --git a/apps/docs/content/guides/auth/server-side-rendering.mdx b/apps/docs/content/guides/auth/server-side-rendering.mdx index 78e0d7e31c4..ad5473b285d 100644 --- a/apps/docs/content/guides/auth/server-side-rendering.mdx +++ b/apps/docs/content/guides/auth/server-side-rendering.mdx @@ -153,7 +153,7 @@ This is traditionally done by setting cookies. Here's an example you can add to ```typescript supabase.auth.onAuthStateChange((event, session) => { - if (event === 'SIGNED_OUT' || event === 'USER_DELETED') { + if (event === 'SIGNED_OUT') { // delete cookies on sign out const expires = new Date(0).toUTCString() document.cookie = `my-access-token=; path=/; expires=${expires}; SameSite=Lax; secure` From d3efa2113b70861e1819379d60fd67511012b214 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Tue, 19 Mar 2024 05:31:22 +0100 Subject: [PATCH 139/163] chore: update self-hosted image versions (#22101) chore: update image versions for docker/docker-compose.yml --- docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 3104983c9f7..5e60188a24e 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -256,7 +256,7 @@ services: meta: container_name: supabase-meta - image: supabase/postgres-meta:v0.79.0 + image: supabase/postgres-meta:v0.79.5 depends_on: db: # Disable this if you are using an external Postgres database From 2b215b697ef02366fa42ab13ac0a7997e5c7fe42 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Tue, 19 Mar 2024 05:31:58 +0100 Subject: [PATCH 140/163] chore: update cli reference doc (#22102) * chore: update cli reference doc * chore: update cli reference doc --- apps/docs/spec/cli_v1_commands.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/docs/spec/cli_v1_commands.yaml b/apps/docs/spec/cli_v1_commands.yaml index fff89d8dfde..d9e3d73df62 100644 --- a/apps/docs/spec/cli_v1_commands.yaml +++ b/apps/docs/spec/cli_v1_commands.yaml @@ -1,7 +1,7 @@ clispec: '001' info: id: cli - version: 1.148.6 + version: 1.150.0 title: Supabase CLI language: sh source: https://github.com/supabase/cli @@ -2324,6 +2324,10 @@ commands: name: --use-orioledb description: Use OrioleDB storage engine for Postgres default_value: 'false' + - id: with-intellij-settings + name: --with-intellij-settings + description: Generate IntelliJ IDEA settings for Deno. + default_value: 'false' - id: with-vscode-settings name: --with-vscode-settings description: Generate VS Code settings for Deno. From c8fd53a58e6da3ed12bc506d86c88b874671d3ed Mon Sep 17 00:00:00 2001 From: Nicolas Robinson <67024254+narobinson1@users.noreply.github.com> Date: Tue, 19 Mar 2024 06:35:13 +0100 Subject: [PATCH 141/163] docs: update sveltekit tutorial with new @supabase/ssr package (#22087) * docs: update sveltekit tutorial with new @supabase/ssr package Related to issue #21851: Sveltekit guide still uses the old packages * fix comment --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../tutorials/with-sveltekit.mdx | 55 +++++++++++++------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx b/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx index 5b5172b6c37..b6e24481a01 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx @@ -45,31 +45,43 @@ PUBLIC_SUPABASE_ANON_KEY="YOUR_SUPABASE_KEY" Optionally, add `src/styles.css` with the [CSS from the example](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/sveltekit-user-management/src/styles.css). -### Supabase Auth Helpers +### Creating a Supabase client for SSR: -SvelteKit is a highly versatile framework offering pre-rendering at build time (SSG), server-side rendering at request time (SSR), API routes, and more. +The ssr package configures Supabase to use Cookies, which is required for server-side languages and frameworks. -It can be challenging to authenticate your users in all these different environments, that's why we've created the Supabase Auth Helpers to make user management and data fetching within SvelteKit as easy as possible. - -Install the auth helpers for SvelteKit: +Install the Supabase packages: ```bash -npm install @supabase/auth-helpers-sveltekit @supabase/supabase-js +npm install @supabase/ssr @supabase/supabase-js ``` +Creating a Supabase client with the ssr package automatically configures it to use Cookies. This means your user's session is available throughout the entire SvelteKit stack - page, layout, server, hooks. + Add the code below to your `src/hooks.server.ts` to initialize the client on the server: ```ts src/hooks.server.ts // src/hooks.server.ts import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY } from '$env/static/public' -import { createSupabaseServerClient } from '@supabase/auth-helpers-sveltekit' +import { createServerClient } from '@supabase/ssr' import type { Handle } from '@sveltejs/kit' export const handle: Handle = async ({ event, resolve }) => { - event.locals.supabase = createSupabaseServerClient({ - supabaseUrl: PUBLIC_SUPABASE_URL, - supabaseKey: PUBLIC_SUPABASE_ANON_KEY, - event, + event.locals.supabase = createServerClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY, { + cookies: { + get: (key) => event.cookies.get(key), + /** + * Note: You have to add the `path` variable to the + * set and remove method due to sveltekit's cookie API + * requiring this to be set, setting the path to `/` + * will replicate previous/standard behaviour (https://kit.svelte.dev/docs/types#public-types-cookies) + */ + set: (key, value, options) => { + event.cookies.set(key, value, { ...options, path: '/' }) + }, + remove: (key, options) => { + event.cookies.delete(key, { ...options, path: '/' }) + }, + }, }) /** @@ -136,17 +148,26 @@ Create a new `src/routes/+layout.ts` file to handle the session and the supabase ```ts src/routes/+layout.ts // src/routes/+layout.ts import { PUBLIC_SUPABASE_ANON_KEY, PUBLIC_SUPABASE_URL } from '$env/static/public' -import { createSupabaseLoadClient } from '@supabase/auth-helpers-sveltekit' import type { LayoutLoad } from './$types' +import { createBrowserClient, isBrowser, parse } from '@supabase/ssr' export const load: LayoutLoad = async ({ fetch, data, depends }) => { depends('supabase:auth') - const supabase = createSupabaseLoadClient({ - supabaseUrl: PUBLIC_SUPABASE_URL, - supabaseKey: PUBLIC_SUPABASE_ANON_KEY, - event: { fetch }, - serverSession: data.session, + const supabase = createBrowserClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY, { + global: { + fetch, + }, + cookies: { + get(key) { + if (!isBrowser()) { + return JSON.stringify(data.session) + } + + const cookie = parse(document.cookie) + return cookie[key] + }, + }, }) const { From 419b5379df7e54fc572abd2bb74ed435913cce71 Mon Sep 17 00:00:00 2001 From: Jordi Enric <37541088+jordienr@users.noreply.github.com> Date: Tue, 19 Mar 2024 06:52:05 +0100 Subject: [PATCH 142/163] fix notification button (#22060) * fix spacing in notifications btn * restore spacing, make it stay on top with relative * no need for z-20 actually --- .../NotificationsPopoverV2/NotificationsPopover.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationsPopover.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationsPopover.tsx index e055d2b2620..533d082aa95 100644 --- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationsPopover.tsx +++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationsPopover.tsx @@ -3,8 +3,6 @@ import { useMemo, useRef, useState } from 'react' import toast from 'react-hot-toast' import { Button, - IconArchive, - IconInbox, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_, Popover_Shadcn_, @@ -26,6 +24,7 @@ import { useProjectsQuery } from 'data/projects/projects-query' import { useNotificationsStateSnapshot } from 'state/notifications' import NotificationRow from './NotificationRow' import { NotificationsFilter } from './NotificationsFilter' +import { ArchiveIcon, InboxIcon } from 'lucide-react' const NotificationsPopoverV2 = () => { const [open, setOpen] = useState(false) @@ -108,9 +107,9 @@ const NotificationsPopoverV2 = () => { )} icon={ hasCritical ? ( - + ) : hasWarning ? ( - + ) : hasNewNotifications ? (
    { ) : null } iconRight={ - { /> ) : (
    - +

    {activeTab === 'archived' @@ -260,7 +259,7 @@ const NotificationsPopoverV2 = () => { disabled={isArchiving} loading={isArchiving} type="text" - icon={} + icon={} onClick={() => archiveAllNotifications()} > Archive all From 3d629e9e7237e6baf0854e2ce7beea3874f67e69 Mon Sep 17 00:00:00 2001 From: Andy Truong Date: Tue, 19 Mar 2024 01:55:43 -0400 Subject: [PATCH 143/163] (docs): fix return type error for futureBuilder (#22033) Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../docs/content/guides/getting-started/quickstarts/flutter.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx b/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx index 3affe423ce2..dd94b5b841c 100644 --- a/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx +++ b/apps/docs/content/guides/getting-started/quickstarts/flutter.mdx @@ -143,7 +143,7 @@ hideToc: true @override Widget build(BuildContext context) { return Scaffold( - body: FutureBuilder>>( + body: FutureBuilder( future: _future, builder: (context, snapshot) { if (!snapshot.hasData) { From a6a7e8d327f923d74ca317dc5e0107935374af55 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 19 Mar 2024 12:59:09 +0700 Subject: [PATCH 144/163] Chore/fix database tables add foreign key not working (#22104) * Shift database tables to id route and fix add foreign key CTA not working * Clean up unused imports * Fix * Update apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx Co-authored-by: Alaister Young --------- Co-authored-by: Alaister Young --- .../interfaces/Database/Tables/ColumnList.tsx | 31 ++++---- .../interfaces/Database/Tables/TableList.tsx | 17 +++-- .../DeleteConfirmationDialogs.tsx | 7 +- .../pages/project/[ref]/database/tables.tsx | 72 ------------------- .../project/[ref]/database/tables/[id].tsx | 40 +++++++++++ .../project/[ref]/database/tables/index.tsx | 45 ++++++++++++ .../pages/project/[ref]/editor/[id].tsx | 1 - 7 files changed, 115 insertions(+), 98 deletions(-) delete mode 100644 apps/studio/pages/project/[ref]/database/tables.tsx create mode 100644 apps/studio/pages/project/[ref]/database/tables/[id].tsx create mode 100644 apps/studio/pages/project/[ref]/database/tables/index.tsx diff --git a/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx b/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx index 233c86b56c0..ef4a2db6432 100644 --- a/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx +++ b/apps/studio/components/interfaces/Database/Tables/ColumnList.tsx @@ -1,7 +1,7 @@ import * as Tooltip from '@radix-ui/react-tooltip' -import type { PostgresTable } from '@supabase/postgres-meta' import { PermissionAction } from '@supabase/shared-types/out/constants' import { noop } from 'lodash' +import Link from 'next/link' import { useState } from 'react' import { Button, @@ -19,6 +19,7 @@ import { Input, } from 'ui' +import { useParams } from 'common' import NoSearchResults from 'components/to-be-cleaned/NoSearchResults' import Table from 'components/to-be-cleaned/Table' import AlertError from 'components/ui/AlertError' @@ -26,52 +27,56 @@ import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useCheckPermissions } from 'hooks' import useTable from 'hooks/misc/useTable' import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas' +import ShimmeringLoader from 'ui-patterns/ShimmeringLoader' import ProtectedSchemaWarning from '../ProtectedSchemaWarning' interface ColumnListProps { - table: PostgresTable - onSelectBack: () => void onAddColumn: () => void onEditColumn: (column: any) => void onDeleteColumn: (column: any) => void } const ColumnList = ({ - table, - onSelectBack = noop, onAddColumn = noop, onEditColumn = noop, onDeleteColumn = noop, }: ColumnListProps) => { + const { id, ref } = useParams() const [filterString, setFilterString] = useState('') - const { data: selectedTable, error, isError, isLoading, isSuccess } = useTable(table.id) + const { data: selectedTable, error, isError, isLoading, isSuccess } = useTable(Number(id)) const columns = (filterString.length === 0 ? selectedTable?.columns ?? [] : selectedTable?.columns?.filter((column: any) => column.name.includes(filterString))) ?? [] - const isLocked = EXCLUDED_SCHEMAS.includes(table.schema ?? '') + const isLocked = EXCLUDED_SCHEMAS.includes(selectedTable?.schema ?? '') const canUpdateColumns = useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_WRITE, 'columns') return (

    -

    Database Tables

    +

    Database Tables

    -

    {table.name}

    + {isLoading ? ( + + ) : ( +

    {selectedTable?.name}

    + )}
    - {isLocked && } + {isLocked && } {isLoading && } {isError && ( )} diff --git a/apps/studio/components/interfaces/Database/Tables/TableList.tsx b/apps/studio/components/interfaces/Database/Tables/TableList.tsx index 4d14ce53614..2657508f44e 100644 --- a/apps/studio/components/interfaces/Database/Tables/TableList.tsx +++ b/apps/studio/components/interfaces/Database/Tables/TableList.tsx @@ -1,9 +1,12 @@ import * as Tooltip from '@radix-ui/react-tooltip' import { PermissionAction } from '@supabase/shared-types/out/constants' import { noop, partition } from 'lodash' +import { Columns } from 'lucide-react' +import Link from 'next/link' import { useRouter } from 'next/router' import { useState } from 'react' +import { useParams } from 'common' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import Table from 'components/to-be-cleaned/Table' import AlertError from 'components/ui/AlertError' @@ -22,7 +25,6 @@ import { DropdownMenuItem, DropdownMenuTrigger, IconCheck, - IconColumns, IconEdit, IconEye, IconMoreVertical, @@ -38,16 +40,15 @@ interface TableListProps { onAddTable: () => void onEditTable: (table: any) => void onDeleteTable: (table: any) => void - onOpenTable: (table: any) => void } const TableList = ({ onAddTable = noop, onEditTable = noop, onDeleteTable = noop, - onOpenTable = noop, }: TableListProps) => { const router = useRouter() + const { ref } = useParams() const { project } = useProjectContext() const snap = useTableEditorStateSnapshot() @@ -98,7 +99,7 @@ const TableList = ({ return (
    -

    Database Tables

    +

    Database Tables

    @@ -260,13 +261,15 @@ const TableList = ({
    {!isLocked && ( diff --git a/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx b/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx index 1fae2696aaf..fcd9ba50561 100644 --- a/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/DeleteConfirmationDialogs.tsx @@ -19,16 +19,12 @@ import { useGetImpersonatedRole } from 'state/role-impersonation-state' import { useTableEditorStateSnapshot } from 'state/table-editor' export type DeleteConfirmationDialogsProps = { - projectRef?: string selectedTable?: TableLike - includeColumns?: boolean onAfterDeleteTable?: (tables: TableLike[]) => void } const DeleteConfirmationDialogs = ({ - projectRef, selectedTable, - includeColumns = false, onAfterDeleteTable = noop, }: DeleteConfirmationDialogsProps) => { const { project } = useProjectContext() @@ -152,6 +148,7 @@ const DeleteConfirmationDialogs = ({ const onConfirmDeleteColumn = async () => { if (!(snap.confirmationDialog?.type === 'column')) return + if (project === undefined) return const selectedColumnToDelete = snap.confirmationDialog.column if (selectedColumnToDelete === undefined) return @@ -159,7 +156,7 @@ const DeleteConfirmationDialogs = ({ deleteColumn({ id: selectedColumnToDelete.id, cascade: isDeleteWithCascade, - projectRef: projectRef!, + projectRef: project.ref, connectionString: project?.connectionString, table: selectedTable, }) diff --git a/apps/studio/pages/project/[ref]/database/tables.tsx b/apps/studio/pages/project/[ref]/database/tables.tsx deleted file mode 100644 index 96804803cd2..00000000000 --- a/apps/studio/pages/project/[ref]/database/tables.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { useParams } from 'common' -import { useState } from 'react' -import type { PostgresTable } from '@supabase/postgres-meta' - -import { ColumnList, TableList } from 'components/interfaces/Database' -import { SidePanelEditor } from 'components/interfaces/TableGridEditor' -import DeleteConfirmationDialogs from 'components/interfaces/TableGridEditor/DeleteConfirmationDialogs' -import { DatabaseLayout } from 'components/layouts' -import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' -import type { Table } from 'data/tables/table-query' -import { useTableEditorStateSnapshot } from 'state/table-editor' -import type { NextPageWithLayout } from 'types' -import useTable from 'hooks/misc/useTable' - -const DatabaseTables: NextPageWithLayout = () => { - const { ref: projectRef } = useParams() - - const snap = useTableEditorStateSnapshot() - const [selectedTable, setSelectedTable] = useState() - const { data: selectedTableData } = useTable(selectedTable?.id) - - // [Joshen] Separate state required to handle edit/delete table - // since selectedTable above handles the state for ColumnList - const [selectedTableToEdit, setSelectedTableToEdit] = useState
    () - - return ( - <> - - -
    - {selectedTable === undefined ? ( - { - setSelectedTableToEdit(table) - snap.onEditTable() - }} - onDeleteTable={(table) => { - setSelectedTableToEdit(table) - snap.onDeleteTable() - }} - onOpenTable={setSelectedTable} - /> - ) : ( - setSelectedTable(undefined)} - /> - )} -
    -
    -
    - - - - - ) -} - -DatabaseTables.getLayout = (page) => {page} - -export default DatabaseTables diff --git a/apps/studio/pages/project/[ref]/database/tables/[id].tsx b/apps/studio/pages/project/[ref]/database/tables/[id].tsx new file mode 100644 index 00000000000..4dc8106eb50 --- /dev/null +++ b/apps/studio/pages/project/[ref]/database/tables/[id].tsx @@ -0,0 +1,40 @@ +import type { PostgresTable } from '@supabase/postgres-meta' + +import { useParams } from 'common' +import { ColumnList } from 'components/interfaces/Database' +import { SidePanelEditor } from 'components/interfaces/TableGridEditor' +import DeleteConfirmationDialogs from 'components/interfaces/TableGridEditor/DeleteConfirmationDialogs' +import { DatabaseLayout } from 'components/layouts' +import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' +import useTable from 'hooks/misc/useTable' +import { useTableEditorStateSnapshot } from 'state/table-editor' +import type { NextPageWithLayout } from 'types' + +const DatabaseTables: NextPageWithLayout = () => { + const { id } = useParams() + const snap = useTableEditorStateSnapshot() + const { data: selectedTable } = useTable(Number(id)) + + return ( + <> + + +
    + +
    +
    +
    + + + + + ) +} + +DatabaseTables.getLayout = (page) => {page} + +export default DatabaseTables diff --git a/apps/studio/pages/project/[ref]/database/tables/index.tsx b/apps/studio/pages/project/[ref]/database/tables/index.tsx new file mode 100644 index 00000000000..02906ad3f6b --- /dev/null +++ b/apps/studio/pages/project/[ref]/database/tables/index.tsx @@ -0,0 +1,45 @@ +import { useState } from 'react' + +import { useParams } from 'common' +import { TableList } from 'components/interfaces/Database' +import { SidePanelEditor } from 'components/interfaces/TableGridEditor' +import DeleteConfirmationDialogs from 'components/interfaces/TableGridEditor/DeleteConfirmationDialogs' +import { DatabaseLayout } from 'components/layouts' +import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' +import type { Table } from 'data/tables/table-query' +import { useTableEditorStateSnapshot } from 'state/table-editor' +import type { NextPageWithLayout } from 'types' + +const DatabaseTables: NextPageWithLayout = () => { + const snap = useTableEditorStateSnapshot() + const [selectedTableToEdit, setSelectedTableToEdit] = useState
    () + + return ( + <> + + +
    + { + setSelectedTableToEdit(table) + snap.onEditTable() + }} + onDeleteTable={(table) => { + setSelectedTableToEdit(table) + snap.onDeleteTable() + }} + /> +
    +
    +
    + + + + + ) +} + +DatabaseTables.getLayout = (page) => {page} + +export default DatabaseTables diff --git a/apps/studio/pages/project/[ref]/editor/[id].tsx b/apps/studio/pages/project/[ref]/editor/[id].tsx index f392a1f4e77..0e861f5c716 100644 --- a/apps/studio/pages/project/[ref]/editor/[id].tsx +++ b/apps/studio/pages/project/[ref]/editor/[id].tsx @@ -24,7 +24,6 @@ const TableEditorPage: NextPageWithLayout = () => { theme={resolvedTheme?.includes('dark') ? 'dark' : 'light'} /> { // For simplicity for now, we just open the first table within the same schema From a7c6f3ec9a7bd7333e90614d49a5d2050d766af3 Mon Sep 17 00:00:00 2001 From: hallidayo <22655069+Hallidayo@users.noreply.github.com> Date: Tue, 19 Mar 2024 07:45:37 +0000 Subject: [PATCH 145/163] fix: edge functions removed port 465 (#22071) removed port 465 Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/content/guides/functions/debugging.mdx | 2 +- .../edge-functions/supabase/functions/send-email-smtp/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/docs/content/guides/functions/debugging.mdx b/apps/docs/content/guides/functions/debugging.mdx index 4ac083221b9..ce5d0fd1488 100644 --- a/apps/docs/content/guides/functions/debugging.mdx +++ b/apps/docs/content/guides/functions/debugging.mdx @@ -174,7 +174,7 @@ import { Sheets } from 'npm:@googleapis/sheets' ## Limitations -- Outgoing connections to ports `25`, `465`, and `587` are not allowed. +- Outgoing connections to ports `25` and `587` are not allowed. - Serving of HTML content is not supported (`GET` requests that return `text/html` will be rewritten to `text/plain`). - Deno and Node file system APIs are not available. - Memory limit for the function: 150 MB (heap) + 150 MB (external - array buffers/ WASM) diff --git a/examples/edge-functions/supabase/functions/send-email-smtp/README.md b/examples/edge-functions/supabase/functions/send-email-smtp/README.md index 68b7dbad82b..e9a496bcde8 100644 --- a/examples/edge-functions/supabase/functions/send-email-smtp/README.md +++ b/examples/edge-functions/supabase/functions/send-email-smtp/README.md @@ -8,7 +8,7 @@ supabase secrets set SMTP_HOSTNAME="your.hostname.com" SMTP_PORT="2587" SMTP_USE supabase functions deploy send-email-smtp ``` -Note: `SMTP_PORT` must be a port other than `25`, `465`, and `587` as Deno Deploy does not support outgoing connections to ports. AWS SES (port 2587) is recommended. +Note: `SMTP_PORT` must be a port other than `25` and `587` as Deno Deploy does not support outgoing connections to ports. AWS SES (port 2587) is recommended. ## Test locally From a32fe646cacde10dbd99c4a4760f92a06c9118f3 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Tue, 19 Mar 2024 14:56:46 +0700 Subject: [PATCH 146/163] chore: add more opengraph to docs (#22103) Co-authored-by: Alaister Young Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com> --- apps/docs/layouts/guides/index.tsx | 25 +++++++++++++++++-------- apps/docs/lib/constants.ts | 3 ++- apps/docs/pages/_app.tsx | 8 ++++++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx index 4232a61503d..3200de40047 100644 --- a/apps/docs/layouts/guides/index.tsx +++ b/apps/docs/layouts/guides/index.tsx @@ -1,6 +1,5 @@ import { MDXProvider } from '@mdx-js/react' import { NextSeo } from 'next-seo' -import Head from 'next/head' import { usePathname } from 'next/navigation' import { useRouter } from 'next/router' import { FC, useEffect, useRef, useState } from 'react' @@ -89,18 +88,23 @@ const Layout: FC = (props) => { return ( <> - - {`${props.meta?.title} | Supabase Docs`} - - - - - = (props) => { authors: ['Supabase'], }, }} + twitter={{ + cardType: 'summary_large_image', + site: '@supabase', + handle: '@supabase', + }} /> diff --git a/apps/docs/lib/constants.ts b/apps/docs/lib/constants.ts index 813e45149b6..2e032c0bc8b 100644 --- a/apps/docs/lib/constants.ts +++ b/apps/docs/lib/constants.ts @@ -1,5 +1,6 @@ +export const BUILD_PREVIEW_HTML = process.env.NEXT_PUBLIC_BUILD_PREVIEW_HTML === 'true' export const IS_PLATFORM = process.env.NEXT_PUBLIC_IS_PLATFORM === 'true' -export const IS_PREVIEW = process.env.VERCEL_ENV === 'preview' +export const IS_PREVIEW = process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview' export const LOCAL_SUPABASE = process.env.NEXT_PUBLIC_LOCAL_SUPABASE === 'true' export const API_URL = ( process.env.NODE_ENV === 'development' diff --git a/apps/docs/pages/_app.tsx b/apps/docs/pages/_app.tsx index 3da019613df..b0beb5781f2 100644 --- a/apps/docs/pages/_app.tsx +++ b/apps/docs/pages/_app.tsx @@ -8,6 +8,7 @@ import { SessionContextProvider } from '@supabase/auth-helpers-react' import { createClient } from '@supabase/supabase-js' import { QueryClientProvider, useQueryClient } from '@tanstack/react-query' import { AuthProvider, ThemeProvider, useTelemetryProps, useThemeSandbox } from 'common' +import Head from 'next/head' import { useRouter } from 'next/router' import { useCallback, useEffect, useState, type PropsWithChildren } from 'react' import { PortalToast, TabsProvider } from 'ui' @@ -16,7 +17,7 @@ import { useConsent } from 'ui-patterns/ConsentToast' import Favicons from '~/components/Favicons' import SiteLayout from '~/layouts/SiteLayout' -import { IS_PLATFORM, IS_PREVIEW } from '~/lib/constants' +import { BUILD_PREVIEW_HTML, IS_PLATFORM, IS_PREVIEW } from '~/lib/constants' import { unauthedAllowedPost } from '~/lib/fetch/fetchWrappers' import { useRootQueryClient } from '~/lib/fetch/queryClient' import { LOCAL_STORAGE_KEYS, remove } from '~/lib/storage' @@ -33,7 +34,7 @@ import { AppPropsWithLayout } from '~/types' * you within a single build. */ function ShortcutPreviewBuild({ children }: PropsWithChildren) { - if (IS_PREVIEW) { + if (IS_PREVIEW && !BUILD_PREVIEW_HTML) { // eslint-disable-next-line react-hooks/rules-of-hooks const [isMounted, setIsMounted] = useState(false) @@ -217,6 +218,9 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) { + + + From 684c4789019d45dd7477c5dca50a84ae886cb822 Mon Sep 17 00:00:00 2001 From: hawkcookie <29660904+hawkcookie@users.noreply.github.com> Date: Tue, 19 Mar 2024 17:09:41 +0900 Subject: [PATCH 147/163] docs: Fix broken SITE_URL link (#21896) Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/content/guides/auth/concepts/redirect-urls.mdx | 2 +- apps/docs/spec/examples/examples.yml | 6 +++--- apps/docs/spec/supabase_csharp_v0.yml | 4 ++-- apps/docs/spec/supabase_dart_v1.yml | 4 ++-- apps/docs/spec/supabase_dart_v2.yml | 4 ++-- apps/docs/spec/supabase_js_v2.yml | 6 +++--- apps/docs/spec/supabase_kt_v1.yml | 6 +++--- apps/docs/spec/supabase_kt_v2.yml | 6 +++--- apps/docs/spec/supabase_py_v2.yml | 6 +++--- apps/docs/spec/supabase_swift_v1.yml | 6 +++--- apps/docs/spec/supabase_swift_v2.yml | 6 +++--- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/apps/docs/content/guides/auth/concepts/redirect-urls.mdx b/apps/docs/content/guides/auth/concepts/redirect-urls.mdx index e1d7f014bad..3f9f3aab8ad 100644 --- a/apps/docs/content/guides/auth/concepts/redirect-urls.mdx +++ b/apps/docs/content/guides/auth/concepts/redirect-urls.mdx @@ -7,7 +7,7 @@ subtitle: 'Set up redirect urls with Supabase Auth.' ## Overview -When using [passwordless sign-ins](/docs/reference/javascript/auth-signinwithotp) or [third-party providers](/docs/reference/javascript/auth-signinwithoauth#sign-in-using-a-third-party-provider-with-redirect), the Supabase client library methods provide a `redirectTo` parameter to specify where to redirect the user to after authentication. By default, the user will be redirected to the [`SITE_URL`](/docs/reference/auth/config#site_url) but you can modify the `SITE_URL` or add additional redirect URLs to the [allow list](https://supabase.com/dashboard/project/_/auth/url-configuration). Once you've added necessary URLs to the allow list, you can specify the URL you want the user to be redirected to in the `redirectTo` parameter. +When using [passwordless sign-ins](/docs/reference/javascript/auth-signinwithotp) or [third-party providers](/docs/reference/javascript/auth-signinwithoauth#sign-in-using-a-third-party-provider-with-redirect), the Supabase client library methods provide a `redirectTo` parameter to specify where to redirect the user to after authentication. By default, the user will be redirected to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls) but you can modify the `SITE_URL` or add additional redirect URLs to the [allow list](https://supabase.com/dashboard/project/_/auth/url-configuration). Once you've added necessary URLs to the allow list, you can specify the URL you want the user to be redirected to in the `redirectTo` parameter. ## Use wildcards in redirect URLs diff --git a/apps/docs/spec/examples/examples.yml b/apps/docs/spec/examples/examples.yml index 064e259a03e..60d35abbfaa 100644 --- a/apps/docs/spec/examples/examples.yml +++ b/apps/docs/spec/examples/examples.yml @@ -119,7 +119,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, a `user` is returned but `session` is null. - If **Confirm email** is disabled, both a `user` and a `session` are returned. - - By default, when the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url). You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - By default, when the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls). You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). - If signUp() is called for an existing confirmed user: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned. @@ -193,7 +193,7 @@ functions: - This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url). You can modify the `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - The magic link's destination URL is determined by the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls). You can modify the `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). examples: - id: sign-in-with-email. name: Sign in with email. @@ -236,7 +236,7 @@ functions: name: Sign in using a third-party provider with redirect isSpotlight: false description: | - When the third-party provider successfully authenticates the user, the provider will redirect the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url). It does not redirect the user immediately after invoking this method. + When the third-party provider successfully authenticates the user, the provider will redirect the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls). It does not redirect the user immediately after invoking this method. You can modify the `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). js: | ```js diff --git a/apps/docs/spec/supabase_csharp_v0.yml b/apps/docs/spec/supabase_csharp_v0.yml index ba906a6bda2..e09549dafbb 100644 --- a/apps/docs/spec/supabase_csharp_v0.yml +++ b/apps/docs/spec/supabase_csharp_v0.yml @@ -123,7 +123,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, a `user` is returned but `session` is null. - If **Confirm email** is disabled, both a `user` and a `session` are returned. - - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). - If SignUp() is called for an existing confirmed user: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned. @@ -162,7 +162,7 @@ functions: - This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url). You can modify the `SITE_URL` or add additional redirect urls in [your project](https://supabase.com/dashboard/project/_/auth/settings). + - The magic link's destination URL is determined by the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls). You can modify the `SITE_URL` or add additional redirect urls in [your project](https://supabase.com/dashboard/project/_/auth/settings). examples: - id: sign-in-with-email name: Send Magic Link. diff --git a/apps/docs/spec/supabase_dart_v1.yml b/apps/docs/spec/supabase_dart_v1.yml index 718dc716054..18a9ed5a224 100644 --- a/apps/docs/spec/supabase_dart_v1.yml +++ b/apps/docs/spec/supabase_dart_v1.yml @@ -60,7 +60,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, a `user` is returned but `session` is null. - If **Confirm email** is disabled, both a `user` and a `session` are returned. - - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). - If signUp() is called for an existing confirmed user: - If **Confirm email** is enabled in [your project](https://supabase.com/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - If **Confirm email** is disabled, the error message, `User already registered` is returned. @@ -141,7 +141,7 @@ functions: - This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url). You can modify the `SITE_URL` or add additional redirect urls in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - The magic link's destination URL is determined by the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls). You can modify the `SITE_URL` or add additional redirect urls in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). examples: - id: sign-in-with-email name: Sign in with email. diff --git a/apps/docs/spec/supabase_dart_v2.yml b/apps/docs/spec/supabase_dart_v2.yml index 2b5492ccf20..9d08e002e61 100644 --- a/apps/docs/spec/supabase_dart_v2.yml +++ b/apps/docs/spec/supabase_dart_v2.yml @@ -117,7 +117,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, a `user` is returned but `session` is null. - If **Confirm email** is disabled, both a `user` and a `session` are returned. - - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). - If signUp() is called for an existing confirmed user: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned. @@ -244,7 +244,7 @@ functions: - This method is used for passwordless sign-ins where an OTP is sent to the user's email or phone number. - If you're using an email, you can configure whether you want the user to receive a magiclink or an OTP. - If you're using phone, you can configure whether you want the user to receive an OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url). You can modify the `SITE_URL` or add additional redirect urls in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - The magic link's destination URL is determined by the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls). You can modify the `SITE_URL` or add additional redirect urls in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). params: - name: email isOptional: true diff --git a/apps/docs/spec/supabase_js_v2.yml b/apps/docs/spec/supabase_js_v2.yml index 66ba85c94bc..5adb923e3ce 100644 --- a/apps/docs/spec/supabase_js_v2.yml +++ b/apps/docs/spec/supabase_js_v2.yml @@ -232,7 +232,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, a `user` is returned but `session` is null. - If **Confirm email** is disabled, both a `user` and a `session` are returned. - - When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/reference/auth/config#site_url) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration). + - When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration). - If signUp() is called for an existing confirmed user: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned. @@ -541,7 +541,7 @@ functions: - If the user doesn't exist, `signInWithOtp()` will signup the user instead. To restrict this behaviour, you can set `shouldCreateUser` in `SignInWithPasswordlessCredentials.options` to `false`. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](/docs/reference/auth/config#site_url). + - The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). - See [redirect URLs and wildcards](/docs/guides/auth#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`. - See our [Twilio Phone Auth Guide](/docs/guides/auth/phone-login/twilio) for details about configuring WhatsApp sign in. @@ -602,7 +602,7 @@ functions: name: Sign in using a third-party provider with redirect isSpotlight: false description: | - - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). It does not redirect the user immediately after invoking this method. + - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). It does not redirect the user immediately after invoking this method. - See [redirect URLs and wildcards](/docs/guides/auth#redirect-urls-and-wildcards) to add additional redirect URLs to your project. code: | ```js diff --git a/apps/docs/spec/supabase_kt_v1.yml b/apps/docs/spec/supabase_kt_v1.yml index 58eed518bca..114da14f8cd 100644 --- a/apps/docs/spec/supabase_kt_v1.yml +++ b/apps/docs/spec/supabase_kt_v1.yml @@ -2098,7 +2098,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, the return value is the user and you won't be logged in automatically. - If **Confirm email** is disabled, the return value is null and you will be logged in instead. - - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). - To learn how to handle OTP links & OAuth refer to [initializing](/docs/reference/kotlin/initializing) - If signUpWith() is called for an existing confirmed user: - If **Confirm email** is enabled in [your project](https://supabase.com/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. @@ -2202,7 +2202,7 @@ functions: - If the user doesn't exist, `sendOtpTo()` will signup the user instead. To restrict this behavior, you can set `createUser` to `false`. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](/docs/reference/auth/config#site_url). + - The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - To learn how to handle OTP links & OAuth refer to [initializing](/docs/reference/kotlin/initializing) - Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](https://supabase.com/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`. @@ -2256,7 +2256,7 @@ functions: name: Create a custom url isSpotlight: false description: | - - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectUrl` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). It does not redirect the user immediately after invoking this method. + - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectUrl` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). It does not redirect the user immediately after invoking this method. - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - oAuthUrl() provides the URL which needs to be opened in a browser. - The redirectTo URL needs to be setup correctly in your project under Authentication -> URL Configuration -> Redirect URLs. diff --git a/apps/docs/spec/supabase_kt_v2.yml b/apps/docs/spec/supabase_kt_v2.yml index c7880a741e0..950fcdfdc6f 100644 --- a/apps/docs/spec/supabase_kt_v2.yml +++ b/apps/docs/spec/supabase_kt_v2.yml @@ -2426,7 +2426,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, the return value is the user and you won't be logged in automatically. - If **Confirm email** is disabled, the return value is null and you will be logged in instead. - - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - When the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). - To learn how to handle OTP links & OAuth refer to [initializing](/docs/reference/kotlin/initializing) - If signUpWith() is called for an existing confirmed user: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. @@ -2531,7 +2531,7 @@ functions: - The method `signUpWith(OTP)` does the exact same thing as `signInWith(OTP)`, so it doesn't matter which one you use. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](/docs/reference/auth/config#site_url). + - The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - To learn how to handle OTP links & OAuth refer to [initializing](/docs/reference/kotlin/initializing) - Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](https://supabase.com/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`. @@ -2585,7 +2585,7 @@ functions: name: Create a custom url isSpotlight: false description: | - - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectUrl` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). It does not redirect the user immediately after invoking this method. + - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectUrl` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). It does not redirect the user immediately after invoking this method. - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - getOAuthUrl() provides the URL which needs to be opened in a browser. - The redirectTo URL needs to be setup correctly in your project under Authentication -> URL Configuration -> Redirect URLs. diff --git a/apps/docs/spec/supabase_py_v2.yml b/apps/docs/spec/supabase_py_v2.yml index 1b9bb492e5f..71fa8c45df9 100644 --- a/apps/docs/spec/supabase_py_v2.yml +++ b/apps/docs/spec/supabase_py_v2.yml @@ -58,7 +58,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, a `user` is returned but `session` is null. - If **Confirm email** is disabled, both a `user` and a `session` are returned. - - By default, when the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/reference/auth/config#site_url). You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). + - By default, when the user confirms their email address, they are redirected to the [`SITE_URL`](https://supabase.com/docs/guides/auth/concepts/redirect-urls). You can modify your `SITE_URL` or add additional redirect URLs in [your project](https://supabase.com/dashboard/project/_/auth/url-configuration). - If sign_up() is called for an existing confirmed user: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned. @@ -120,7 +120,7 @@ functions: - If the user doesn't exist, `sign_in_with_otp()` will signup the user instead. To restrict this behavior, you can set `should_create_user` in `SignInWithPasswordlessCredentials.options` to `false`. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](/docs/reference/auth/config#site_url). + - The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](https://supabase.com/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`. examples: @@ -166,7 +166,7 @@ functions: name: Sign in using a third-party provider with redirect isSpotlight: false description: | - - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). It does not redirect the user immediately after invoking this method. + - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). It does not redirect the user immediately after invoking this method. - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. code: | ``` diff --git a/apps/docs/spec/supabase_swift_v1.yml b/apps/docs/spec/supabase_swift_v1.yml index 6a2365822d7..fbfcbff9555 100644 --- a/apps/docs/spec/supabase_swift_v1.yml +++ b/apps/docs/spec/supabase_swift_v1.yml @@ -85,7 +85,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, a `user` is returned but `session` is null. - If **Confirm email** is disabled, both a `user` and a `session` are returned. - - When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/reference/auth/config#site_url) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration). + - When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration). - If signUp() is called for an existing confirmed user: - If **Confirm email** is enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - If **Confirm email** is disabled, the error message, `User already registered` is returned. @@ -168,7 +168,7 @@ functions: - If the user doesn't exist, `signInWithOTP()` will signup the user instead. To restrict this behavior, you can set `shouldCreateUser` to `false`. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](/docs/reference/auth/config#site_url). + - The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). - See [redirect URLs and wildcards](/docs/guides/auth#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`. - When using magic links, specify a `redirectTo` that matches a configured url scheme in your iOS app, so Supabase can correctly redirect back to your app. @@ -227,7 +227,7 @@ functions: name: Sign in using a third-party provider with redirect isSpotlight: false description: | - - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). It does not redirect the user immediately after invoking this method. + - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). It does not redirect the user immediately after invoking this method. - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - getOAuthSignInURL() provides the URL which needs to be opened in a SFSafariViewController instance. - The redirectTo URL needs to be setup correctly in your project under Authentication -> URL Configuration -> Redirect URLs. diff --git a/apps/docs/spec/supabase_swift_v2.yml b/apps/docs/spec/supabase_swift_v2.yml index 79c29e8f6ca..204905ad3e3 100644 --- a/apps/docs/spec/supabase_swift_v2.yml +++ b/apps/docs/spec/supabase_swift_v2.yml @@ -85,7 +85,7 @@ functions: - **Confirm email** determines if users need to confirm their email address after signing up. - If **Confirm email** is enabled, a `user` is returned but `session` is null. - If **Confirm email** is disabled, both a `user` and a `session` are returned. - - When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/reference/auth/config#site_url) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration). + - When the user confirms their email address, they are redirected to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls) by default. You can modify your `SITE_URL` or add additional redirect URLs in [your project](/dashboard/project/_/auth/url-configuration). - If signUp() is called for an existing confirmed user: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned. @@ -168,7 +168,7 @@ functions: - If the user doesn't exist, `signInWithOTP()` will signup the user instead. To restrict this behavior, you can set `shouldCreateUser` to `false`. - If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP. - If you're using phone, you can configure whether you want the user to receive a OTP. - - The magic link's destination URL is determined by the [`SITE_URL`](/docs/reference/auth/config#site_url). + - The magic link's destination URL is determined by the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). - See [redirect URLs and wildcards](/docs/guides/auth#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`. - When using magic links, specify a `redirectTo` that matches a configured url scheme in your iOS app, so Supabase can correctly redirect back to your app. @@ -227,7 +227,7 @@ functions: name: Sign in using a third-party provider with redirect isSpotlight: false description: | - - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/reference/auth/config#site_url). It does not redirect the user immediately after invoking this method. + - When the third-party provider successfully authenticates the user, the provider redirects the user to the URL specified in the `redirectTo` parameter. This parameter defaults to the [`SITE_URL`](/docs/guides/auth/concepts/redirect-urls). It does not redirect the user immediately after invoking this method. - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - getOAuthSignInURL() provides the URL which needs to be opened in a SFSafariViewController instance. - The redirectTo URL needs to be setup correctly in your project under Authentication -> URL Configuration -> Redirect URLs. From 69cf45d72ecea2f348c269f2bbb2ed9c8fa0cf9e Mon Sep 17 00:00:00 2001 From: Jacob Bowdoin <7559478+jacob-8@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:12:50 +0800 Subject: [PATCH 148/163] docs: clarify strictNullChecks required for MergeDeep usage (#22012) Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/content/guides/api/rest/generating-types.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/docs/content/guides/api/rest/generating-types.mdx b/apps/docs/content/guides/api/rest/generating-types.mdx index 624749a1d17..45d9c77ce18 100644 --- a/apps/docs/content/guides/api/rest/generating-types.mdx +++ b/apps/docs/content/guides/api/rest/generating-types.mdx @@ -125,6 +125,12 @@ export type Database = MergeDeep< > ``` + + +To use `MergeDeep`, set `compilerOptions.strictNullChecks` to `true` in your `tsconfig.json`. + + + You can also override the type of an individual successful response if needed: ```ts From 9f2c7c85712bb4968f3899251c32d000c5051911 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 19 Mar 2024 15:23:04 +0700 Subject: [PATCH 149/163] Chore/fix connect UI pooler mode link (#22105) * Fix connect ui pooler mode link * Fix apdding --- .../Settings/Database/PoolingModesModal.tsx | 61 ++++++++++--------- .../Settings/Database/UsePoolerCheckbox.tsx | 45 +++++++++----- 2 files changed, 61 insertions(+), 45 deletions(-) diff --git a/apps/studio/components/interfaces/Settings/Database/PoolingModesModal.tsx b/apps/studio/components/interfaces/Settings/Database/PoolingModesModal.tsx index 8490ed6827b..3572341876b 100644 --- a/apps/studio/components/interfaces/Settings/Database/PoolingModesModal.tsx +++ b/apps/studio/components/interfaces/Settings/Database/PoolingModesModal.tsx @@ -13,6 +13,7 @@ import { DialogTitle, Dialog, IconExternalLink, + DialogSectionSeparator, } from 'ui' import { Markdown } from 'components/interfaces/Markdown' @@ -40,9 +41,9 @@ export const PoolingModesModal = () => { return ( - - - + + +

    Which pooling mode should I use?

    - -

    - A connection pooler is a system (external to Postgres) which manages Postgres - connections by allocating connections whenever clients make requests. -

    + + A connection pooler is a system (external to Postgres) which manages Postgres + connections by allocating connections whenever clients make requests.
    + {primaryConfig?.pool_mode === 'session' && ( - - - - Pooling mode is currently configured to use session mode - - - To use transaction mode concurrently with session mode, change the pooling mode to - transaction first in the{' '} - { - snap.setShowPoolingModeHelper(false) - navigateToPoolerSettings() - }} - > - connection pooling settings - - . After this, you can use transaction mode on port 6543 and session mode on port 5432. - - +
    + + + + Pooling mode is currently configured to use session mode + + + To use transaction mode concurrently with session mode, change the pooling mode to + transaction first in the{' '} + { + snap.setShowPoolingModeHelper(false) + navigateToPoolerSettings() + }} + > + connection pooling settings + + . After this, you can use transaction mode on port 6543 and session mode on port + 5432. + + +
    )} snap.setShowPoolingModeHelper(false)}> diff --git a/apps/studio/components/interfaces/Settings/Database/UsePoolerCheckbox.tsx b/apps/studio/components/interfaces/Settings/Database/UsePoolerCheckbox.tsx index 3249b13db58..163231b6902 100644 --- a/apps/studio/components/interfaces/Settings/Database/UsePoolerCheckbox.tsx +++ b/apps/studio/components/interfaces/Settings/Database/UsePoolerCheckbox.tsx @@ -1,4 +1,5 @@ import { useParams } from 'common' +import { useRouter } from 'next/router' import { useState } from 'react' import { Badge, @@ -20,6 +21,7 @@ import { useProjectSettingsQuery } from 'data/config/project-settings-query' import { usePoolingConfigurationQuery } from 'data/database/pooling-configuration-query' import { useDatabaseSelectorStateSnapshot } from 'state/database-selector' import { useDatabaseSettingsStateSnapshot } from 'state/database-settings' +import Link from 'next/link' interface UsePoolerCheckboxInterface { id: string @@ -36,6 +38,7 @@ export const UsePoolerCheckbox = ({ onCheckedChange, onSelectPoolingMode, }: UsePoolerCheckboxInterface) => { + const router = useRouter() const [open, setOpen] = useState(false) const { ref: projectRef } = useParams() const { project } = useProjectContext() @@ -46,6 +49,7 @@ export const UsePoolerCheckbox = ({ const { data: settings, isSuccess: isSuccessSettings } = useProjectSettingsQuery({ projectRef }) const { data: pgBouncerStatus } = usePgBouncerStatus({ projectRef: projectRef }) + const isDatabaseSettingsPage = router.pathname.endsWith('/settings/database') const readReplicasEnabled = project?.is_read_replicas_enabled const poolingConfiguration = readReplicasEnabled ? data?.find((x) => x.identifier === state.selectedDatabaseId) @@ -116,22 +120,31 @@ export const UsePoolerCheckbox = ({

    To use transaction mode, change the pool mode in the{' '} - { - const el = document.getElementById('connection-pooler') - if (el) { - setOpen(false) - el.scrollIntoView({ - behavior: 'smooth', - block: 'center', - }) - } - }} - > - pooling configuration settings - {' '} + {isDatabaseSettingsPage ? ( + { + const el = document.getElementById('connection-pooler') + if (el) { + setOpen(false) + el.scrollIntoView({ + behavior: 'smooth', + block: 'center', + }) + } + }} + > + pooling configuration settings + + ) : ( + + pooling configuration settings + + )}{' '} to use transaction mode first.

    From f95b35bf2ac1330c7250abc0f0d62a075022c48e Mon Sep 17 00:00:00 2001 From: David Date: Tue, 19 Mar 2024 04:27:25 -0400 Subject: [PATCH 150/163] Added info about signInWithOauth redirect (#22088) Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com> --- .../oauth-with-pkce-flow-for-ssr.mdx | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/apps/docs/content/guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx b/apps/docs/content/guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx index 9ff80b227e0..bc69e411514 100644 --- a/apps/docs/content/guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx +++ b/apps/docs/content/guides/auth/server-side/oauth-with-pkce-flow-for-ssr.mdx @@ -207,6 +207,17 @@ app.get("/auth/callback", async function (req, res) { Let's point our `.signInWithOAuth` method's redirect to the callback route we create above: + + + +In the browser, `signInWithOAuth` automatically redirects to the SSO provider's authentication endpoint, which then redirects to your endpoint. + ```js await supabase.auth.signInWithOAuth({ provider, @@ -215,3 +226,26 @@ await supabase.auth.signInWithOAuth({ }, }) ``` + + + + + +In the server, you need to handle the redirect to the SSO provider's authentication endpoint. The `signInWithOAuth` method returns the endpoint URL, which you can redirect to. + +```js +const { data, error } = await supabase.auth.signInWithOAuth({ + provider, + options: { + redirectTo: '/auth/callback', + }, +}) + +if (data.url) { + redirect(data.url) // use the redirect API for your server framework +} +``` + + + + From c71ab9e4f8efd60d021207e232a28068790d7c3c Mon Sep 17 00:00:00 2001 From: Jan Tennert Date: Tue, 19 Mar 2024 09:42:12 +0100 Subject: [PATCH 151/163] docs: Add parameters to Kotlin reference docs (#21887) Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- apps/docs/spec/supabase_kt_v2.yml | 1094 ++++++++++++++++++++++++++++- 1 file changed, 1072 insertions(+), 22 deletions(-) diff --git a/apps/docs/spec/supabase_kt_v2.yml b/apps/docs/spec/supabase_kt_v2.yml index 950fcdfdc6f..7215af5f062 100644 --- a/apps/docs/spec/supabase_kt_v2.yml +++ b/apps/docs/spec/supabase_kt_v2.yml @@ -80,6 +80,45 @@ functions: } ``` That's it! If you already implemented deeplinks to handle OTPs and OAuth you don't have to change anything! + params: + - name: supabaseUrl + isOptional: false + type: String + description: The unique Supabase URL which is supplied when you create a new project in your project dashboard. + - name: supabaseKey + isOptional: false + type: String + description: The unique Supabase Key which is supplied when you create a new project in your project dashboard. + - name: builder + isOptional: true + type: SupabaseClientBuilder.() -> Unit + description: Apply additional configuration and install plugins. + subContent: + - name: useHTTPS + isOptional: true + type: Boolean + description: Whether to use HTTPS for network requests. Will be set automatically depending on your Supabase url, but can be changed manually. + - name: httpEngine + isOptional: true + type: HttpClientEngine? + description: Custom Ktor Client engine. Shouldn't be set manually as Ktor uses an engine from your dependencies, but can be set to a MockEngine for tests. + - name: ignoreModulesInUrl + isOptional: true + type: Boolean + description: Whether to ignore if [supabaseUrl] contains modules like 'realtime' or 'auth'. If false, an exception will be thrown. Defaults to false. + - name: requestTimeout + isOptional: true + type: Duration + description: Timeout after network requests throw a `HttpRequestTimeoutException`. Defaults to 10 seconds. + - name: defaultLogLevel + isOptional: true + type: LogLevel + description: The default log level used for plugins. Can be overridden per plugin. Defaults to `LogLevel.INFO`. + - name: defaultSerializer + isOptional: true + type: SupabaseSerializer + description: The default serializer used to serialize and deserialize custom data types. Defaults to `KotlinXSerializer`. + examples: - id: initialize-client name: Initialize Client @@ -275,6 +314,19 @@ functions: - When calling a `decode` method, you have to provide a [serializable class](/docs/reference/kotlin/installing#serialization) as the type parameter. - You can provide a `Columns` object to select specific columns. - You can provide a [filter](/docs/reference/kotlin/using-filters) block to filter the results + params: + - name: columns + isOptional: true + type: Columns + description: The columns to retrieve, defaults to `Columns.ALL`. You can also use `Columns.list`, `Columns.type` or `Columns.raw` to specify the columns. + - name: head + isOptional: true + type: Boolean + description: If true, select will delete the selected data. + - name: request + isOptional: true + type: PostgrestRequestBuilder.() -> Unit + description: Additional configuration & filtering for the request. examples: - id: getting-your-data name: Getting your data @@ -340,10 +392,10 @@ functions: code: | ```kotlin val count = supabase.from("countries") - .select(head = true) { - count(Count.EXACT) - } - .count()!! + .select { + count(Count.EXACT) + } + .count()!! ``` - id: querying-json-data name: Querying JSON data @@ -371,6 +423,16 @@ functions: - When calling an `insert` method, you have to provide a [serializable value](/docs/reference/kotlin/installing#serialization). - By default, every time you run `insert()`, the client library will make a `select` to return the full record. This is convenient, but it can also cause problems if your policies are not configured to allow the `select` operation. + params: + - name: value # This function has two signatures: "value: T" and "values: List" + isOptional: false + type: T or List + description: The value(s) you want to insert. `T` can be any serializable type. + - name: request + isOptional: true + type: PostgrestRequestBuilder.() -> Unit + description: Additional configuration & filtering for the request. + examples: - id: create-a-record name: Create a record @@ -407,6 +469,15 @@ functions: notes: | - `update()` should always be combined with a [filter](/docs/reference/kotlin/using-filters) block to avoid updating all records. - When calling `insert` or `update`, you have to provide a [serializable value](/docs/reference/kotlin/installing#serialization) in the function parameter. + params: + - name: value + type: T or PostgrestUpdate.() -> Unit = {} + isOptional: false + description: The new value, can be either a serializable value or PostgrestUpdate DSL where you can set new values per column. + - name: request + isOptional: true + type: PostgrestRequestBuilder.() -> Unit + description: Additional configuration & filtering for the request. examples: - id: updating-your-data name: Updating your data @@ -500,6 +571,27 @@ functions: - Primary keys must be natural, not surrogate. There are however, [workarounds](https://github.com/PostgREST/postgrest/issues/1118) for surrogate primary keys. - If you need to insert new data and update existing data at the same time, use [Postgres triggers](https://github.com/supabase/postgrest-js/issues/173#issuecomment-825124550). - When calling `insert` or `update`, you have to provide a [serializable value](/docs/reference/kotlin/installing#serialization) in the function parameter. + params: + - name: value # This function has two signatures: "value: T" and "values: List" + isOptional: false + type: T or List + description: The value(s) you want to insert. `T` can be any serializable type. + - name: onConflict + isOptional: true + type: String? + description: Comma-separated UNIQUE column(s) to specify how duplicate rows are determined. Two rows are duplicates if all the `onConflict` columns are equal. + - name: defaultToNull + isOptional: true + type: Boolean + description: Make missing fields default to `null`. Otherwise, use the default value for the column. This only applies when inserting new rows, not when merging with existing rows under + - name: ignoreDuplicates + isOptional: true + type: Boolean + description: If `true`, duplicate rows are ignored. If `false`, duplicate rows are merged with existing rows. + - name: request + isOptional: true + type: PostgrestRequestBuilder.() -> Unit + description: Additional configuration & filtering for the request. examples: - id: upsert-your-data name: Upsert your data @@ -542,6 +634,11 @@ functions: rows visible through `SELECT` policies are deleted. Note that by default no rows are visible, so you need at least one `SELECT`/`ALL` policy that makes the rows visible. + params: + - name: request + isOptional: true + type: PostgrestRequestBuilder.() -> Unit + description: Additional configuration & filtering for the request. examples: - id: delete-records name: Delete records @@ -578,6 +675,23 @@ functions: It's especially useful when the logic rarely changes - like password resets and updates. - When calling `rpc` with parameters, you have to provide a [serializable value](/docs/reference/kotlin/installing#serialization) in the function parameter. + params: + - name: function + isOptional: false + type: String + description: The name of the function + - name: parameters + isOptional: true # Not directly `optional`, as there are two overloads one with and one without `parameters`. + type: T + description: Parameters to pass to the function. T can be any serializable type. + - name: head + isOptional: true + type: Boolean + description: If true, delete will delete the selected data. + - name: request + isOptional: true + type: PostgrestRequestBuilder.() -> Unit + description: Additional configuration & filtering for the request. examples: - id: call-a-stored-procedure name: Call a stored procedure @@ -758,7 +872,15 @@ functions: title: or() description: | Finds all rows satisfying at least one of the filters. - notes: | + params: + - name: negate + isOptional: true + type: Boolean + description: If true, negate the entire block. + - name: block + isOptional: false + type: PostgrestFilterBuilder.() -> Unit + description: The block to apply the `or` filter to. examples: - id: with-select name: With `select()` @@ -800,6 +922,19 @@ functions: Finds all rows that don't satisfy the filter. notes: | - `.filterNot()` expects you to use the raw [PostgREST syntax](https://postgrest.org/en/stable/api.html#horizontal-filtering-rows) for the filter names and values. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: operator + isOptional: false + type: FilterOperator + description: The operator to use for the filter. + - name: value + isOptional: false + type: Any + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -817,6 +952,15 @@ functions: title: eq() description: | Finds all rows whose value on the stated `column` exactly matches the specified `value`. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: value + isOptional: false + type: Any + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -873,6 +1017,15 @@ functions: title: neq() description: | Finds all rows whose value on the stated `column` doesn't match the specified `value`. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: value + isOptional: false + type: Any + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -927,6 +1080,15 @@ functions: title: gt() description: | Finds all rows whose value on the stated `column` is greater than the specified `value`. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: value + isOptional: false + type: Any + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -983,6 +1145,15 @@ functions: title: gte() description: | Finds all rows whose value on the stated `column` is greater than or equal to the specified `value`. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: value + isOptional: false + type: Any + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -1039,6 +1210,15 @@ functions: title: lt() description: | Finds all rows whose value on the stated `column` is less than the specified `value`. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: value + isOptional: false + type: Any + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -1095,6 +1275,15 @@ functions: title: lte() description: | Finds all rows whose value on the stated `column` is less than or equal to the specified `value`. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: value + isOptional: false + type: Any + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -1151,6 +1340,15 @@ functions: title: like() description: | Finds all rows whose value in the stated `column` matches the supplied `pattern` (case sensitive). + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: pattern + isOptional: false + type: String + description: The pattern to match with. examples: - id: with-select name: With `select()` @@ -1207,6 +1405,15 @@ functions: title: ilike() description: | Finds all rows whose value in the stated `column` matches the supplied `pattern` (case insensitive). + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: pattern + isOptional: false + type: String + description: The pattern to match with. examples: - id: with-select name: With `select()` @@ -1265,6 +1472,15 @@ functions: A check for exact equality (null, true, false), finds all rows whose value on the stated `column` exactly match the specified `value`. `is_` and `in_` filter methods are suffixed with `_` to avoid collisions with reserved keywords. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: value + isOptional: false + type: Boolean? + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -1321,6 +1537,15 @@ functions: title: in_() description: | Finds all rows whose value on the stated `column` is found on the specified `values`. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: values + isOptional: false + type: List + description: The values to filter with. examples: - id: with-select name: With `select()` @@ -1375,6 +1600,17 @@ functions: - id: contains title: contains() + description: | + Only relevant for jsonb, array, and range columns. Match only rows where `column` contains every element appearing in `value`. + params: + - name: column + isOptional: false + type: String + description: The jsonb, array, or range column to filter on + - name: value + isOptional: false + type: List + description: The jsonb, array, or range value to filter with examples: - id: with-select name: With `select()` @@ -1431,6 +1667,15 @@ functions: title: rangeLt() description: | Only relevant for range columns. Match only rows where every element in column is less than any element in range. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: values + isOptional: false + type: Pair + description: The values to filter with. examples: - id: with-select name: With `select()` @@ -1486,7 +1731,15 @@ functions: title: rangeGt() description: | Only relevant for range columns. Match only rows where every element in column is greater than any element in range. - + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: values + isOptional: false + type: Pair + description: The values to filter with. examples: - id: with-select name: With `select()` @@ -1542,6 +1795,15 @@ functions: title: rangeGte() description: | Only relevant for range columns. Match only rows where every element in column is either contained in range or greater than any element in range. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: values + isOptional: false + type: Pair + description: The values to filter with. examples: - id: with-select name: With `select()` @@ -1597,7 +1859,15 @@ functions: title: rangeLte() description: | Only relevant for range columns. Match only rows where every element in column is either contained in range or less than any element in range. - + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: values + isOptional: false + type: Pair + description: The values to filter with. $ref: '@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte' examples: - id: with-select @@ -1654,7 +1924,15 @@ functions: title: rangeAdjacent() description: | Only relevant for range columns. Match only rows where column is mutually exclusive to range and there can be no element between the two ranges. - + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: values + isOptional: false + type: Pair + description: The values to filter with. examples: - id: with-select name: With `select()` @@ -1707,7 +1985,15 @@ functions: $ref: '@supabase/postgrest-js.PostgrestFilterBuilder.overlaps' description: | Only relevant for array and range columns. Match only rows where column and value have an element in common. - + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: values + isOptional: false + type: List + description: The values to filter with. examples: - id: on-array-columns name: On array columns @@ -1806,6 +2092,23 @@ functions: Only relevant for text and tsvector columns. Match only rows where `column` matches the query string in `query`. For more information, see [Postgres full text search](https://supabase.com/docs/guides/database/full-text-search). + params: + - name: column + isOptional: false + type: String + description: The text or tsvector column to filter on + - name: query + isOptional: false + type: String + description: The query text to match with + - name: textSearchType + isOptional: true + type: TextSearchType + description: The type of text search to use. Defaults to `TextSearchType.NONE`. + - name: config + isOptional: true + type: String + description: The text search configuration to use. examples: - id: text-search name: Text search @@ -1878,6 +2181,19 @@ functions: $ref: '@supabase/postgrest-js.PostgrestFilterBuilder.filter' notes: | filter() expects you to use the raw PostgREST syntax for the filter values. + params: + - name: column + isOptional: false + type: String + description: The column to filter on. + - name: operator + isOptional: false + type: FilterOperator + description: The operator to use for the filter. + - name: value + isOptional: false + type: Any + description: The value to filter with. examples: - id: with-select name: With `select()` @@ -1990,6 +2306,11 @@ functions: - id: db-modifiers-select title: select() $ref: '@supabase/postgrest-js.PostgrestTransformBuilder.select' + params: + - name: columns + isOptional: true + type: Columns + description: The columns to select. examples: - id: with-upsert name: With `upsert()` @@ -2031,6 +2352,23 @@ functions: description: | Order the query result by column. $ref: '@supabase/postgrest-js.PostgrestTransformBuilder.order' + params: + - name: column + isOptional: false + type: String + description: The column to order by. + - name: order + isOptional: false + type: Order + description: The order to use. + - name: nullsFirst + isOptional: true + type: Boolean + description: Whether to order nulls first. + - name: referencedTable + isOptional: true + type: String + description: The foreign table to order by. examples: - id: with-select name: With `select()` @@ -2089,7 +2427,7 @@ functions: supabase.from("countries").select( columns = columns ) { - order(column = "id", order = Order.ASCENDING, foreignTable = "cities") + order(column = "id", order = Order.ASCENDING, referencedTable = "cities") } ``` data: @@ -2149,6 +2487,15 @@ functions: description: | Limit the query result by count. $ref: '@supabase/postgrest-js.PostgrestTransformBuilder.limit' + params: + - name: count + isOptional: false + type: Long + description: The number of rows to limit the result to. + - name: referencedTable + isOptional: true + type: String + description: The foreign table to limit by. examples: - id: with-select name: With `select()` @@ -2198,7 +2545,7 @@ functions: supabase.from("countries").select( columns = columns ) { - limit(count = 1, foreignTable = "cities") + limit(count = 1, referencedTable = "cities") } ``` data: @@ -2245,6 +2592,19 @@ functions: title: range() description: | Limit the query result by from and to inclusively. + params: + - name: from + isOptional: false + type: Long + description: The start of the range. + - name: to + isOptional: false + type: Long + description: The end of the range. + - name: referencedTable + isOptional: true + type: String + description: The foreign table to limit by. examples: - id: with-select name: With `select()` @@ -2372,6 +2732,31 @@ functions: It's best to only enable this for testing environments but if you wish to enable it for production you can provide additional protection by using a `pre-request` function. Follow the [Performance Debugging Guide](/docs/guides/api/rest/debugging-performance) to enable the functionality on your project. + params: + - name: analyze + isOptional: true + type: Boolean + description: If `true`, the query will be executed and the actual run time will be returned + - name: verbose + isOptional: true + type: Boolean + description: If `true`, the query identifier will be returned and `data` will include the output columns of the query + - name: settings + isOptional: true + type: Boolean + description: If `true`, include information on configuration parameters that affect query planning + - name: buffers + isOptional: true + type: Boolean + description: If `true`, include information on buffer usage + - name: wal + isOptional: true + type: Boolean + description: If `true`, include information on WAL record generation + - name: format + isOptional: true + type: String + description: The format of the output, can be `"text"` (default) or `"json"` examples: - id: get-execution-plan name: Get the execution plan @@ -2431,6 +2816,36 @@ functions: - If signUpWith() is called for an existing confirmed user: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned. + params: + - name: provider + isOptional: false + type: Email or Phone + description: The provider to use for the user's authentication. In this case `Email` or `Phone`. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: true + type: Email.Config.() -> Unit or Phone.Config.() -> Unit + description: The configuration for signing in with `Email` or `Phone`. + subContent: + - name: password + isOptional: false + type: String + description: The user's password + - name: email/phone + isOptional: false + type: String + description: The user's email or phone. + - name: captchaToken + isOptional: true + type: String? + description: The captcha token when having captcha enabled. + - name: data + isOptional: true + type: JsonObject? + description: Extra user data to pass in. examples: - id: sign-up-email name: Sign up with email @@ -2442,8 +2857,19 @@ functions: password = "example-password" } ``` - - id: sign-up-phone - name: Sign up with a phone number + - id: sign-up-phone-whatsapp + name: Sign up with a phone number and password (whatsapp) + isSpotlight: true + code: | + ```kotlin + val user = supabase.auth.signUpWith(Phone) { + phone = "+4912345679" + password = "example-password" + channel = Phone.Channel.WHATSAPP + } + ``` + - id: sign-up-phone-sms + name: Sign up with a phone number and password (sms) isSpotlight: true code: | ```kotlin @@ -2483,6 +2909,32 @@ functions: notes: | Logs in an existing user. - Requires either an email and password or a phone number and password. + params: + - name: provider + isOptional: false + type: Email or Phone + description: The provider to use for the user's authentication, in this case `Email` or `Phone`. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: true + type: Email.Config.() -> Unit or Phone.Config.() -> Unit + description: The configuration for signing in with `Email` or `Phone`. + subContent: + - name: password + isOptional: false + type: String + description: The user's password + - name: email/phone + isOptional: false + type: String + description: The user's email or phone. + - name: captchaToken + isOptional: true + type: String? + description: The captcha token when having captcha enabled. examples: - id: sign-in-with-email-and-password name: Sign in with email and password @@ -2504,9 +2956,46 @@ functions: password = "example-password" } ``` + - id: sign-in-with-id-token + title: 'signInWithIdToken' + params: + - name: provider + isOptional: false + type: IDToken + description: The provider to use for the user's authentication. For this method it will be `IDToken`. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: true + type: IDToken.Config.() -> Unit + description: The configuration for signing in with an id token. + subContent: + - name: idToken + isOptional: false + type: String + description: OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token. + - name: provider + isOptional: false + type: IDTokenProvider + description: The provider of the id token. Only `Apple`, `Google`, `Facebook` and `Azure` are supported. + - name: accessToken + isOptional: true + type: String? + description: If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token. + - name: nonce + isOptional: true + type: String? + description: If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token. + - name: captchaToken + isOptional: true + type: String? + description: The captcha token when having captcha enabled. + + examples: - id: sign-in-with-id-token - name: Sign in with id token - isSpotlight: false + name: 'Sign In using ID Token' code: | ```kotlin supabase.auth.signInWith(IDToken) { @@ -2519,7 +3008,6 @@ functions: } } ``` - - id: sign-in-with-otp title: 'signInWith(OTP)' $ref: '@supabase/gotrue-js.GoTrueClient.signInWithOtp' @@ -2535,6 +3023,28 @@ functions: - See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project. - To learn how to handle OTP links & OAuth refer to [initializing](/docs/reference/kotlin/initializing) - Magic links and OTPs share the same implementation. To send users a one-time code instead of a magic link, [modify the magic link email template](https://supabase.com/dashboard/project/_/auth/templates) to include `{{ .Token }}` instead of `{{ .ConfirmationURL }}`. + params: + - name: provider + isOptional: false + type: OTP + description: The provider to use for the user's authentication, in this case `OTP`. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: true + type: OTP.Config.() -> Unit + description: The configuration for signing in with `OTP`. + subContent: + - name: email/phone + isOptional: false + type: String + description: The user's email or phone. + - name: captchaToken + isOptional: true + type: String? + description: The captcha token when having captcha enabled. examples: - id: sign-in-with-email name: Sign in with email @@ -2563,6 +3073,28 @@ functions: - This method is used for signing in using a third-party provider. - Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers). - To learn how to handle OTP links & OAuth refer to [initializing](/docs/reference/kotlin/initializing) + params: + - name: provider + isOptional: false + type: OAuthProvider + description: The OAuth provider to use for the user's authentication, for example `Google` or `Github`. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: true + type: ExternalAuthConfig.() -> Unit + description: The configuration for signing in with an OAuth provider. + subContent: + - name: scopes + isOptional: true + type: MutableList + description: The scopes to request from the OAuth provider. + - name: queryParams + isOptional: true + type: MutableMap + description: Additional query parameters to use. examples: - id: sign-in-using-a-third-party-provider name: Sign in using a third-party provider @@ -2616,7 +3148,28 @@ functions: - Mapping specific user email addresses with an identity provider. - Using different hints to identity the identity provider to be used by the user, like a company-specific page, IP address or other tracking information. - To learn how to handle OTP links & OAuth refer to [initializing](/docs/reference/kotlin/initializing) - + params: + - name: provider + isOptional: false + type: SSO + description: The OAuth provider to use for the user's authentication, in this case `SSO`. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: true + type: ExternalAuthConfig.() -> Unit + description: The configuration for signing in with an OAuth provider. + subContent: + - name: providerId/domain + isOptional: false + type: String + description: The providerId or domain. + - name: captchaToken + isOptional: true + type: String? + description: The captcha token when having captcha enabled. examples: - id: sign-in-with-domain name: Sign in with email domain @@ -2640,7 +3193,7 @@ functions: // Useful when you need to map a user's sign in request according // to different rules that can't use email domains. - supabase.auth.signInWith(SSO){ + supabase.auth.signInWith(SSO) { providerId = "21648a9d-8d5a-4555-a9d1-d6375dc14e92" } @@ -2652,6 +3205,11 @@ functions: notes: | Logs out the current user. - In order to use the `signOut()` method, the user needs to be signed in first. + params: + - name: scope + isOptional: true + type: SignOutScope + description: The scope of the sign-out. examples: - id: sign-out name: Sign out @@ -2680,6 +3238,23 @@ functions: notes: | - Verifying an OTP is done through either `verifyPhoneOtp` or `verifyEmailOtp`. - The verification type used should be determined based on the corresponding auth method called before using `verifyPhoneOtp`/`verifyEmailOtp` to sign up / sign-in a user. + params: + - name: type + isOptional: false + type: OtpType.Email or OtpType.Phone + description: The OTP type. Depending on the type, an email or phone has to be specified as parameter. + - name: email/phone + isOptional: false + type: String + description: The email or phone number, depending on which type you specified. + - name: token + isOptional: false + type: String + description: The token to verify. + - name: captchaToken + isOptional: true + type: String? + description: The captcha token when having captcha enabled. examples: - id: verify-email-otp(otp) name: Verify an Email OTP @@ -2730,6 +3305,19 @@ functions: - Passwordless sign-ins can be resent by calling the `signInWith(OTP)` method again. - Password recovery emails can be resent by calling the `resetPasswordForEmail()` method again. - This method will only resend an email or phone OTP to the user if there was an initial signup, email change or phone change request being made. + params: + - name: type + isOptional: false + type: OtpType.Email or OtpType.Phone + description: The OTP type. Depending on the type, an email or phone has to be specified as parameter. + - name: email/phone + isOptional: false + type: String + description: The email or phone number, depending on which type you specified. + - name: captchaToken + isOptional: true + type: String? + description: The captcha token when having captcha enabled. examples: - id: resend-email-signup-confirmation name: Resend an email signup confirmation @@ -2780,6 +3368,11 @@ functions: - This method gets the user object from the current session. - Fetches the user object from the database instead of local session. - Should be used only when you require the most current user data. For faster results, `getCurrentSessionOrNull()?.user` is recommended. + params: + - name: jwt + isOptional: false + type: String + description: The JWT token. examples: - id: get-the-logged-in-user-with-the-current-existing-session name: Get the logged in user with the current session @@ -2805,6 +3398,39 @@ functions: - In order to use the `modifyUser()` method, the user needs to be signed in first. - By default, email updates sends a confirmation link to both the user's current and new email. To only send a confirmation link to the user's new email, disable **Secure email change** in your project's [email auth provider settings](https://supabase.com/dashboard/project/_/auth/providers). + params: + - name: updateCurrentUser + isOptional: true + type: Boolean + description: Whether to update the local session with the new user. Defaults to `true`. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: false + type: UserUpdateBuilder.() -> Unit + subContent: + - name: email + isOptional: true + type: String? + description: The new email. + - name: password + isOptional: true + type: String? + description: The new password. + - name: phone + isOptional: true + type: String? + description: The new phone number. + - name: nonce + isOptional: true + type: String? + description: The nonce sent for reauthentication if the user's password is to be updated. + - name: data + isOptional: true + type: JsonObject + description: The new user data. examples: - id: update-the-email-for-an-authenticated-user name: Update the email for an authenticated user @@ -2860,6 +3486,28 @@ functions: - The user needs to be signed in to call `linkIdentity()`. - If the candidate identity is already linked to the existing user or another user, `linkIdentity()` will fail. - This method works similarly to `signInWith()` using an OAuthProvider. To learn how to handle OTP links & OAuth refer to [initializing](/docs/reference/kotlin/initializing) + params: + - name: provider + isOptional: false + type: OAuthProvider + description: The OAuth provider you want to link the user with. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: true + type: ExternalAuthConfigDefaults.() -> Unit + description: Extra configuration. + subContent: + - name: scopes + isOptional: true + type: MutableList + description: The scopes to request from the OAuth provider. + - name: queryParams + isOptional: true + type: MutableMap + description: Additional query parameters to use. examples: - id: link-identity name: Link an identity to a user @@ -2879,6 +3527,15 @@ functions: - The user needs to be signed in to call `unlinkIdentity()`. - The user must have at least 2 identities in order to unlink an identity. - The identity to be unlinked must belong to the user. + params: + - name: identityId + isOptional: false + type: String + description: The id of the OAuth identity + - name: updateLocalUser + isOptional: true + type: Boolean + description: Whether to delete the identity from the local user or not. Defaults to `true`. examples: - id: unlink-identity name: Unlink an identity @@ -2902,6 +3559,11 @@ functions: - `importSession()` takes in a UserSession. - [Refresh token rotation](/docs/reference/auth/config#refresh_token_rotation_enabled) is enabled by default on all projects to guard against replay attacks. - You can configure the [`REFRESH_TOKEN_REUSE_INTERVAL`](https://supabase.com/docs/reference/auth/config#refresh_token_reuse_interval) which provides a short window in which the same refresh token can be used multiple times in the event of concurrency or offline issues. + params: + - name: session + isOptional: false + type: UserSession + description: The session to set. examples: - id: refresh-the-session name: Set local session @@ -2918,6 +3580,11 @@ functions: This method will refresh the session whether the current one is expired or not. - This is done automatically, but can be disabled in the Auth config. + params: + - name: refreshToken + isOptional: false + type: String + description: The refresh token to use. examples: - id: refresh-current-session name: Refresh current session @@ -2991,6 +3658,19 @@ functions: password = "1234567" } ``` + params: + - name: email + isOptional: false + type: String + description: The email to send the password reset email to. + - name: redirectUrl + isOptional: true + type: String? + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: captchaToken + isOptional: true + type: String? + description: The captcha token when having captcha enabled. examples: - id: send-password-reset-email name: Send password reset email @@ -3004,6 +3684,15 @@ functions: $ref: '@supabase/gotrue-js.GoTrueClient.exchangeCodeForSession' notes: | - Used when `flowType` is set to `FlowType.PKCE` in the Auth configuration. + params: + - name: code + isOptional: false + type: String + description: The code to exchange. + - name: saveSession + isOptional: true + type: Boolean + description: Whether to save the session. Defaults to true. examples: - id: exchange-auth-code name: Exchange Auth Code @@ -3029,6 +3718,19 @@ functions: - To create a challenge, see [`mfa.createChallenge()`](/docs/reference/kotlin/auth-mfa-challenge). - To verify a challenge, see [`mfa.verifyChallenge()`](/docs/reference/kotlin/auth-mfa-verify). - To create and verify a challenge in a single step, see [`mfa.createChallengeAndVerify()`](/docs/reference/kotlin/auth-mfa-challengeandverify). + params: + - name: factorType + isOptional: false + type: FactorType + description: The type of MFA factor to enroll. Currently only supports `FactorType.TOTP`. + - name: issuer + isOptional: true + type: String? + description: Domain which the user is enrolling with. + - name: friendlyName + isOptional: true + type: String? + description: Human readable name assigned to a device. examples: - id: enroll-totp-factor name: Enroll a time-based, one-time password (TOTP) factor @@ -3064,6 +3766,11 @@ functions: Creates a challenge for a factor. - An [enrolled factor](/docs/reference/kotlin/auth-mfa-enroll) is required before creating a challenge. - To verify a challenge, see [`mfa.verifyChallenge()`](/docs/reference/kotlin/auth-mfa-verify). + params: + - name: factorId + isOptional: false + type: String + description: The id of the MFA factor you want to create a challenge for. examples: - id: create-mfa-challenge name: Create a challenge for a factor @@ -3078,6 +3785,23 @@ functions: notes: | Verifies a challenge for a factor. - To verify a challenge, please [create a challenge](/docs/reference/kotlin/auth-mfa-challenge) first. + params: + - name: factorId + isOptional: false + type: String + description: The id of the MFA factor to verify. + - name: challengeId + isOptional: false + type: String + description: The id of the challenge to verify. + - name: code + isOptional: false + type: String + description: The code used to verify. + - name: saveSession + isOptional: true + type: Boolean + description: Whether to save the session. Defaults to true. examples: - id: verify-challenge name: Verify a challenge for a factor @@ -3098,6 +3822,19 @@ functions: Creates and verifies a challenge for a factor. - An [enrolled factor](/docs/reference/kotlin/auth-mfa-enroll) is required before invoking `createChallengeAndVerify()`. - Executes [`mfa.createChallenge()`](/docs/reference/kotlin/auth-mfa-challenge) and [`mfa.verifyChallenge()`](/docs/reference/kotlin/auth-mfa-verify) in a single step. + params: + - name: factorId + isOptional: false + type: String + description: The id of the MFA factor to verify. + - name: code + isOptional: false + type: String + description: The code used to verify. + - name: saveSession + isOptional: true + type: Boolean + description: Whether to save the session. Defaults to true. examples: - id: challenge-and-verify name: Create and verify a challenge for a factor @@ -3115,6 +3852,11 @@ functions: $ref: '@supabase/gotrue-js.GoTrueMFAApi.unenroll' notes: | Unenroll removes a MFA factor. A user has to have an `AAL2` authentication level in order to unenroll a verified factor. + params: + - name: factorId + isOptional: false + type: String + description: The id of the factor you want to unenroll. examples: - id: unenroll-a-factor name: Unenroll a factor @@ -3180,7 +3922,7 @@ functions: supabase.auth.importAuthToken("service_role") // Access auth admin api - val adminGoTrueClient = supabase.auth.admin + val adminAuthClient = supabase.auth.admin ``` - id: get-user-by-id @@ -3189,6 +3931,11 @@ functions: notes: | Fetches the user object from the database based on the user's id. - The `retrieveUserById()` method requires the user's id which maps to the `auth.users.id` column. + params: + - name: uid + isOptional: false + type: String + description: The id of the user you want to retrieve. examples: - id: fetch-the-user-object-using-the-access-token-jwt name: Fetch the user object using the access_token jwt @@ -3204,6 +3951,15 @@ functions: notes: | Retrieves a list of users. - Defaults to return 50 users per page. + params: + - name: page + isOptional: true + type: Int + description: The page number to retrieve. + - name: perPage + isOptional: true + type: Int + description: The number of users to retrieve per page. examples: - id: get-a-full-list-of-users name: Get a page of users @@ -3228,6 +3984,32 @@ functions: notes: | Creates a new user. - To confirm the user's email address or phone number, set `autoConfirm` to true. Both arguments default to false. + params: + - name: builder + isOptional: false + type: AdminUserBuilder.Email.() -> Unit or AdminUserBuilder.Phone.() -> Unit + description: The builder to create a new user. + subContent: + - name: email/phone + isOptional: true + type: String + description: The new user's email or phone. + - name: password + isOptional: false + type: String + description: The user's password. + - name: autoConfirm + isOptional: true + type: Boolean + description: Whether to auto-confirm the user's email or phone number. + - name: userMetadata + isOptional: true + type: JsonObject? + description: Custom user metadata. + - name: appMetadata + isOptional: true + type: JsonObject? + description: Custom app metadata. examples: - id: create-a-new-user-with-email-custom-user-metadata name: Create user with email @@ -3281,6 +4063,11 @@ functions: notes: | Deletes a user from the database. - The `deleteUser()` method requires the user's ID, which maps to the `auth.users.id` column. + params: + - name: uid + isOptional: false + type: String + description: The id of the user you want to delete. examples: - id: removes-a-user name: Removes a user @@ -3295,6 +4082,19 @@ functions: $ref: '@supabase/gotrue-js.GoTrueAdminApi.inviteUserByEmail' notes: | Sends an invite link to the user's email address. + params: + - name: email + isOptional: false + type: String + description: The email to send the invite to. + - name: redirectTo + isOptional: true + type: String + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: data + isOptional: true + type: JsonObject + description: Custom data to create the user with. examples: - id: invite-a-user name: Invite a user @@ -3316,6 +4116,19 @@ functions: $ref: '@supabase/gotrue-js.GoTrueAdminApi.generateLink' notes: | Generates email links and OTPs to be sent via a custom email provider. + params: + - name: type + isOptional: false + type: LinkType + description: The type of link to generate, e.g. `LinkType.Signup`. + - name: redirectTo + isOptional: true + type: String + description: The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android. + - name: config + isOptional: true + type: C.() -> Unit + description: The builder to create a new link. examples: - id: generate-a-signup-link name: Generate a signup link @@ -3377,6 +4190,52 @@ functions: $ref: '@supabase/gotrue-js.GoTrueAdminApi.updateUserById' notes: | Updates the user data. + params: + - name: uid + isOptional: false + type: String + description: The id of the user you want to update. + - name: builder + isOptional: false + type: AdminUserUpdateBuilder.() -> Unit + description: The builder to update the user. + subContent: + - name: email + isOptional: true + type: String + description: The new email. + - name: phone + isOptional: true + type: String + description: The new phone number. + - name: password + isOptional: true + type: String + description: The new password. + - name: userMetadata + isOptional: true + type: JsonObject? + description: Custom user metadata. + - name: appMetadata + isOptional: true + type: JsonObject? + description: Custom app metadata. + - name: emailConfirm + isOptional: true + type: Boolean + description: Whether to confirm the user's email. + - name: phoneConfirm + isOptional: true + type: Boolean + description: Whether to confirm the user's phone number. + - name: banDuration + isOptional: true + type: String + description: The format for the ban duration follows a strict sequence of decimal numbers with a unit suffix. Valid time units are "ns", "us" (or "Âĩs"), "ms", "s", "m", "h". + - name: role + isOptional: true + type: String + description: The `role` claim set in the user's access token JWT. When a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database. examples: - id: updates-a-users-email name: Updates a user's email @@ -3440,7 +4299,11 @@ functions: title: 'mfa.listFactors()' notes: | Lists all factors associated to a user. - $ref: '@supabase/gotrue-js.GoTrueAdminMFAApi.listFactors' + params: + - name: uid + isOptional: false + type: String + description: The id of the user you want to list factors for. examples: - id: list-factors name: List all factors for a user @@ -3451,9 +4314,17 @@ functions: ``` - id: mfa-delete-factor title: 'mfa.deleteFactor()' - $ref: '@supabase/gotrue-js.GoTrueAdminMFAApi.deleteFactor' notes: | Deletes a factor on a user. This will log the user out of all active sessions if the deleted factor was verified. + params: + - name: uid + isOptional: false + type: String + description: The id of the user you want to delete a factor for. + - name: factorId + isOptional: false + type: String + description: The id of the factor you want to delete. examples: - id: delete-factor name: Delete a factor for a user @@ -3469,6 +4340,19 @@ functions: - When invoking a function with parameters, you have to provide a [serializable value](/docs/reference/kotlin/installing#serialization) in the function parameter. notes: | - Requires an Authorization header. + params: + - name: function + isOptional: false + type: String + description: The name of the function to invoke. + - name: body + isOptional: true + type: T + description: The body to send with the request. T can be any serializable type. + - name: headers + isOptional: true + type: Headers + description: The headers to send with the request. examples: - id: basic-invocation name: Basic invocation @@ -3833,13 +4717,31 @@ functions: - `buckets` table permissions: `insert` - `objects` table permissions: none - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: id + isOptional: false + type: String + description: The id of the bucket you want to create. + - name: builder + isOptional: true + type: BucketBuilder.() -> Unit + description: The builder to create a new bucket. + subContent: + - name: public + isOptional: true + type: Boolean + description: Whether the bucket is public or not. + - name: fileSizeLimit + isOptional: true + type: FileSizeLimit + description: The maximum file size. examples: - id: create-bucket name: Create bucket isSpotlight: true code: | ```kotlin - supabase.storage.createBucket(name = "icons", id = "icons") { + supabase.storage.createBucket(id = "icons") { public = true fileSizeLimit = 5.megabytes } @@ -3852,6 +4754,24 @@ functions: - `buckets` table permissions: `select` and `update` - `objects` table permissions: none - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: id + isOptional: false + type: String + description: The id of the bucket you want to create. + - name: builder + isOptional: true + type: BucketBuilder.() -> Unit + description: The builder to create a new bucket. + subContent: + - name: public + isOptional: true + type: Boolean + description: Whether the bucket is public or not. + - name: fileSizeLimit + isOptional: true + type: FileSizeLimit + description: The maximum file size. examples: - id: update-bucket name: Update bucket @@ -3873,6 +4793,11 @@ functions: - `buckets` table permissions: `select` - `objects` table permissions: `select` and `delete` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: bucketId + isOptional: false + type: String + description: The id of the bucket you want to empty. examples: - id: empty-bucket name: Empty bucket @@ -3889,6 +4814,11 @@ functions: - `buckets` table permissions: `select` and `delete` - `objects` table permissions: none - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: bucketId + isOptional: false + type: String + description: The id of the bucket you want to delete. examples: - id: delete-bucket name: Delete bucket @@ -3907,6 +4837,19 @@ functions: - `objects` table permissions: `insert` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works - Resumable uploads use a `Disk` cache by default to store the upload urls. You can customize that in the Auth config by changing the `resumable.cache` property. + params: + - name: path + isOptional: false + type: String + description: The path of the file you want to upload. + - name: data + isOptional: false + type: ByteArray + description: The data of the file you want to upload. + - name: upsert + isOptional: true + type: Boolean + description: Whether to overwrite the file if it already exists. examples: - id: upload-file name: Upload file @@ -4011,6 +4954,19 @@ functions: - `buckets` table permissions: none - `objects` table permissions: `update` and `select` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: path + isOptional: false + type: String + description: The path of the file you want to upload. + - name: data + isOptional: false + type: ByteArray + description: The data of the file you want to upload. + - name: upsert + isOptional: true + type: Boolean + description: Whether to overwrite the file if it already exists. examples: - id: update-file name: Update file @@ -4031,6 +4987,15 @@ functions: - `buckets` table permissions: none - `objects` table permissions: `update` and `select` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: from + isOptional: false + type: String + description: The path of the file you want to move. + - name: to + isOptional: false + type: String + description: The new path of the file. examples: - id: move-file name: Move file @@ -4048,6 +5013,15 @@ functions: - `buckets` table permissions: none - `objects` table permissions: `insert` and `select` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: from + isOptional: false + type: String + description: The path of the file you want to copy. + - name: to + isOptional: false + type: String + description: The new path of the file. examples: - id: copy-file name: Copy file @@ -4064,6 +5038,40 @@ functions: - `buckets` table permissions: none - `objects` table permissions: `select` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: path + isOptional: false + type: String + description: The path of the file you want to create a signed url for. + - name: expiresIn + isOptional: false + type: Duration + description: The duration the signed url should be valid for. + - name: builder + isOptional: true + type: ImageTransformation.() -> Unit + description: The transformation to apply to the image. + subContent: + - name: width + isOptional: true + type: Int + description: The width of the image. + - name: height + isOptional: true + type: Int + description: The height of the image. + - name: resize + isOptional: true + type: Resize + description: The resize mode of the image. + - name: quality + isOptional: true + type: Int + description: The quality of the image. (Percentage 1-100, defaults to 80) + - name: format + isOptional: true + type: String + description: Specify in which format you want the image to receive. (Defaults to 'origin', which means the original format) examples: - id: create-signed-url name: Create Signed URL @@ -4091,6 +5099,15 @@ functions: - `buckets` table permissions: none - `objects` table permissions: `select` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: expiresIn + isOptional: false + type: Duration + description: The duration the signed url should be valid for. + - name: paths + isOptional: false + type: vararg String + description: The paths of the files you want to create signed urls for. examples: - id: create-signed-urls name: Create Signed URLs @@ -4107,6 +5124,11 @@ functions: - `buckets` table permissions: none - `objects` table permissions: `insert` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: path + isOptional: false + type: String + description: The path of the file you want to upload. examples: - id: create-signed-upload-url name: Create Signed Upload URL @@ -4123,6 +5145,19 @@ functions: - `buckets` table permissions: none - `objects` table permissions: none - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: path + isOptional: false + type: String + description: The path of the file you want to upload. + - name: token + isOptional: false + type: String + description: The token you received from `createSignedUploadUrl`. + - name: data + isOptional: true + type: ByteArray + description: The data of the file you want to upload. examples: - id: upload-to-signed-url name: Upload to a signed URL @@ -4142,6 +5177,11 @@ functions: - `buckets` table permissions: none - `objects` table permissions: none - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: path + isOptional: false + type: String + description: The path of the file you want to get the public url for. examples: - id: returns-the-url-for-an-asset-in-a-public-bucket name: Returns the URL for an asset in a public bucket @@ -4168,6 +5208,11 @@ functions: - `buckets` table permissions: none - `objects` table permissions: `select` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: path + isOptional: false + type: String + description: The path of the file you want to download. examples: - id: download-file-authenticated name: Download file from non-public bucket @@ -4235,6 +5280,11 @@ functions: - `buckets` table permissions: none - `objects` table permissions: `delete` and `select` - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works + params: + - name: paths + isOptional: false + type: vararg String + description: The paths of the files you want to remove. examples: - id: delete-file name: Delete file From fe1313c329cc89cf29b963c29e336e8ca908155a Mon Sep 17 00:00:00 2001 From: hallidayo <22655069+Hallidayo@users.noreply.github.com> Date: Tue, 19 Mar 2024 09:10:13 +0000 Subject: [PATCH 152/163] feat: archive badge added for examples (#21577) * archive badge added for examples * deleted out archived repo examples --- .../interfaces/Home/Home.constants.ts | 24 ----- apps/www/data/Examples.ts | 90 ------------------- 2 files changed, 114 deletions(-) diff --git a/apps/studio/components/interfaces/Home/Home.constants.ts b/apps/studio/components/interfaces/Home/Home.constants.ts index b80dd551fa2..7d6ba1254e4 100644 --- a/apps/studio/components/interfaces/Home/Home.constants.ts +++ b/apps/studio/components/interfaces/Home/Home.constants.ts @@ -81,40 +81,16 @@ export const EXAMPLE_PROJECTS = [ description: 'Example app of real-time chat using supabase realtime api', url: 'https://github.com/shwosner/realtime-chat-supabase-react', }, - { - framework: 'JavaScript', - title: 'Vanilla-js Auth app', - description: 'Example app of real-time chat using supabase realtime api', - url: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/auth/javascript-auth', - }, - { - framework: 'React', - title: 'React Native todo list app', - description: 'React Native Todo List example with Expo', - url: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/expo-todo-list', - }, { framework: 'nextjs', title: 'Next.js todo list app', description: 'Next.js todo list example', url: 'https://github.com/supabase/supabase/tree/master/examples/todo-list/nextjs-todo-list', }, - { - framework: 'React', - title: 'React todo List app', - description: 'React todo List example', - url: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/react-todo-list', - }, { framework: 'Svelte', title: 'Svelte todo list app', description: 'Sveltejs todo with TailwindCSS and Snowpack', url: 'https://github.com/supabase/supabase/tree/master/examples/todo-list/sveltejs-todo-list', }, - { - framework: 'VueJS', - title: 'Vue.js todo list app', - description: 'Vue.js todo app using TypeScript', - url: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/vue3-ts-todo-list', - }, ] diff --git a/apps/www/data/Examples.ts b/apps/www/data/Examples.ts index 98bdc333589..fb4e30c6342 100644 --- a/apps/www/data/Examples.ts +++ b/apps/www/data/Examples.ts @@ -183,66 +183,6 @@ export default [ vercel_deploy_url: '', demo_url: 'https://random-chat.netlify.app/', }, - { - type: 'example', - tags: ['Javascript'], - products: [PRODUCT_NAMES.DATABASE, PRODUCT_NAMES.AUTHENTICATION], - title: 'Vanilla-js Auth app', - description: - 'How to sign up and login using supabase and supabase-js using HTML and JavaScript only', - author: 'supabase', - author_url: 'https://github.com/supabase', - author_img: 'https://avatars.githubusercontent.com/u/54469796', - repo_name: 'javascript-auth', - repo_url: 'https://github.com/supabase/examples/tree/main/supabase-js-v1/auth/javascript-auth', - vercel_deploy_url: '', - demo_url: 'https://auth-vanilla-js.vercel.app/', - }, - { - type: 'example', - tags: ['React'], - products: [PRODUCT_NAMES.DATABASE], - title: 'React Native todo list app', - description: 'React Native Todo List example with Expo', - author: 'supabase', - author_url: 'https://github.com/supabase', - author_img: 'https://avatars.githubusercontent.com/u/54469796', - repo_name: 'expo-todo-list', - repo_url: - 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/react-native-ts-todo-list', - vercel_deploy_url: '', - demo_url: '', - }, - { - type: 'example', - tags: ['Next.js'], - products: [PRODUCT_NAMES.DATABASE], - title: 'Next.js todo list app', - description: 'Next.js todo list example', - author: 'supabase', - author_url: 'https://github.com/supabase', - author_img: 'https://avatars.githubusercontent.com/u/54469796', - repo_name: 'nextjs-todo-list', - repo_url: - 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/nextjs-todo-list', - vercel_deploy_url: '', - demo_url: 'https://supabase-nextjs-todo-list.vercel.app/', - }, - { - type: 'example', - tags: ['React'], - products: [PRODUCT_NAMES.DATABASE], - title: 'React todo list app', - description: 'React todo List example', - author: 'supabase', - author_url: 'https://github.com/supabase', - author_img: 'https://avatars.githubusercontent.com/u/54469796', - repo_name: 'react-todo-list', - repo_url: - 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/react-todo-list', - vercel_deploy_url: '', - demo_url: '', - }, { type: 'example', tags: ['Svelte'], @@ -258,34 +198,4 @@ export default [ vercel_deploy_url: '', demo_url: '', }, - { - type: 'example', - tags: ['Vue'], - products: [PRODUCT_NAMES.DATABASE], - title: 'Vue.js todo list app', - description: 'Vue.js todo app using TypeScript', - author: 'supabase', - author_url: 'https://github.com/supabase', - author_img: 'https://avatars.githubusercontent.com/u/54469796', - repo_name: 'vue3-ts-todo-list', - repo_url: - 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/vue3-ts-todo-list', - vercel_deploy_url: '', - demo_url: '', - }, - { - type: 'example', - tags: ['Angular'], - products: [PRODUCT_NAMES.DATABASE], - title: 'Angular todo list app', - description: 'Angular todo List example', - author: 'geromegrignon', - author_url: 'https://github.com/geromegrignon', - author_img: 'https://avatars.githubusercontent.com/u/32737308', - repo_name: 'angular-todo-list', - repo_url: - 'https://github.com/supabase/examples/tree/main/supabase-js-v1/todo-list/angular-todo-list', - vercel_deploy_url: '', - demo_url: '', - }, ] From 3750ad3f6994634aca9bff248c321ec3fc12a3f8 Mon Sep 17 00:00:00 2001 From: Alaister Young Date: Tue, 19 Mar 2024 16:27:47 +0700 Subject: [PATCH 153/163] feat: CONTRIBUTING.md (#22107) * feat: CONTRIBUTING.md * add full stop --- .github/pull_request_template.md | 19 ++++ CONTRIBUTING.md | 35 +++++++ .../contributing/contributing-checklists.md | 95 ------------------- 3 files changed, 54 insertions(+), 95 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 CONTRIBUTING.md delete mode 100644 apps/studio/contributing/contributing-checklists.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..c0d20008ea8 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,19 @@ +## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. + +YES/NO + +## What kind of change does this PR introduce? + +Bug fix, feature, docs update, ... + +## What is the current behavior? + +Please link any relevant issues here. + +## What is the new behavior? + +Feel free to include screenshots if it includes visual changes. + +## Additional context + +Add any other context or screenshots. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..fe66ea7fb32 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# CONTRIBUTING.md + +Thank you for contributing to Supabase! We’re a big, exciting open source project and we’d love to have you contribute! Here’s some resources and guidance to help you get started: + +[1. Getting Started](#getting-started) +[2. Issues](#issues) +[3. Pull Requests](#pull-requests) + +## Getting Started + +To ensure a positive and inclusive environment, please read our [code of conduct](https://github.com/supabase/.github/blob/main/CODE_OF_CONDUCT.md) before contributing. For help setting up the code in this repo, please follow our [DEVELOPERS.md](https://github.com/supabase/supabase/blob/master/DEVELOPERS.md) file. For the [docs](https://supabase.com/docs) site, follow this [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/apps/docs/CONTRIBUTING.md) guide. + +## Issues + +If you find a bug, please create an Issue and we’ll triage it. + +- Please search [existing Issues](https://github.com/supabase/supabase) before creating a new one. +- Please include a clear description of the problem along with steps to reproduce it. Exact steps with screenshots and urls really help here. + +## Pull Requests + +We actively welcome your Pull Requests! A couple of things to keep in mind before you submit: + +- If you’re fixing an Issue, make sure someone else hasn’t already created a PR fixing the same issue. Likewise, make sure to link your PR to the related Issue(s). +- We will always try to accept the first viable PR that resolves the Issue. +- If you're new, we encourage you to take a look at issues tagged with [good first issue](https://github.com/supabase/supabase/pulls?q=is%3Aopen+is%3Apr+label%3A%22good+first+issue%22). +- If you’re submitting a new feature, make sure you have opened a [Discussion](https://github.com/orgs/supabase/discussions/new/choose) to discuss the new feature before opening a PR. We’d love to accept your hard work, but unfortunately if a feature hasn’t gone through a proper design process, your PR will be closed. +- Please use the PR message template and provide detailed context for quicker review. PRs without clear problem statements will be closed. + +Prior to submitting your PR, please conduct the following pre-flight checks: + +- Run `npm run build` locally to ensure that your code builds successfully without having to wait on us to approve Vercel Preview deploys. +- Ensure that the Prettier tests run successfully on your PR. + +Running these before you create the PR will help reduce back and forth with the team. diff --git a/apps/studio/contributing/contributing-checklists.md b/apps/studio/contributing/contributing-checklists.md deleted file mode 100644 index 9e547cbe5e9..00000000000 --- a/apps/studio/contributing/contributing-checklists.md +++ /dev/null @@ -1,95 +0,0 @@ -# Checklists for contributing to the Supabase Dashboard - -First, we appreciate the time you've taken to contribute to Supabase! Thank you! - -The following is a set of checklists to help make sure the code we contribute to the Dashboard is well tested. If you've made changes to any specific tools, please take a couple of minutes and go through the relevant checklist below. - -You don't need to go through all of these for every PR you contribute. These checklists should help remind you of the important things to test after you've made changes to a feature. For example, if you make changes to the Table Editor, just run through that checklist below. - -**Note**: not all of these tools are available in the self-hosted Dashboard. If your PR is related to Storage, Edge Functions, Logs Explorer or Organization settings, just leave a comment on the PR and a Supabase team member will have a look for you. - -## Tools and features - -### Table Editor - -- [ ] Go to **Table Editor** - - [ ] Create a **new table** - - [ ] Add different fields and types: at least one nullable, one with default generated value (like `now()`), at least one date field - - [ ] Insert a few rows into the table - - [ ] Edit the row with the default spreadsheet view - - [ ] Edit the row with the Side Panel editor (the expand button to the left of the ID column for each row) - - [ ] Add a filter - - [ ] Sort the rows - - [ ] Create a new column and then add a new row - -### Authentication / User management - -- [ ] Go to **Authentication** - - [ ] Invite a new user - - [ ] Search the list of users - - [ ] Go to Policies and create a new policy for a table - - [ ] Check logs view - - [ ] Go to settings and check that any changes you make get saved - - [ ] General - - [ ] Add a redirect URL - - [ ] Enable a couple of Auth providers - -### Storage - -- [ ] Go to **Storage** - - [ ] Go to **Settings** and try to change the upload size limit (unless on Free plan) - - [ ] **Create a new bucket** - - [ ] Go to your new **bucket** (check if it is public or private) - - [ ] Upload a file - - [ ] Create a folder - - [ ] Upload a file to your new folder - - [ ] Download the file - - [ ] Copy URL for your file and open it in new incognito tab (check that it respects private/public setting) - - [ ] Go to **Policies**: add a policy for a bucket - - [ ] Change public/private status for your bucket - - [ ] Check if objects respect private/public setting - -### SQL Editor - -- [ ] Go to **SQL editor** - - [ ] Create **new query** - - [ ] Run a query (ex: `select * from extensions.pg_stat_statements`) and check that it returns results - - [ ] Download a csv of the results (via the Results dropdown above the preview table) - - [ ] Go to **Welcome** and choose and run a template (ex: "Create table") - - [ ] Switch between queries, rename one of your queries, refresh page, delete one of your queries - -### Edge Functions - -- [ ] Go to **Edge Functions** - - [ ] See that any functions you've created are listed - - [ ] Click a function and see that its **Metrics** are displaying - - [ ] Switch to **Details** - you should see the details of your function - - [ ] Switch to **Invocations** and **Logs** - to see logs of recent activity - -### Logs Explorer - -- [ ] Go to **Logs Explorer** - - [ ] Switch to **Templates** and select one - - [ ] Check that query results are displaying properly - - [ ] Make a change to the query from the template, save this query - - [ ] Switch to **Saved** - you should see your new query, run it and check the results - - [ ] Switch to **Recent** - you should be able to see recent queries you've run - -### Database settings - -- [ ] Go to **Database** - - [ ] You should see any tables you have created - - [ ] Click on a table column, try and edit it - - [ ] Go to **Roles** - check if roles are displayed - - [ ] Go to **Extensions** - filter the extensions, try enabling and disabling an extension - - [ ] Go to **Replication** — enable, disable few event types for `supabase_realtime` add some tables to replication - - [ ] Go to **API Logs**, **Postgres Logs**, **Realtime Logs** - - [ ] Check filtering: time range, product, status, method - -### Org settings - -- [ ] Go to **Organizations** and select your organization - - [ ] On **General** - you should be able to rename your organization - - [ ] On **Team** - you should be able to invite team members - - [ ] On **Billing** - you should be able to see your project details and change billing address and email - - [ ] On **Invoices** - you should be able to download recent invoices From a4a4a7e26da951d71cc019a88b8d3b7dd7508b0e Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Tue, 19 Mar 2024 16:33:12 +0700 Subject: [PATCH 154/163] Deprecate old Badge component (#22037) * Update Badge.tsx * refactor apps with new props * Update APIKeys.tsx * format * remove old code --- .../Navigation/NavigationMenu/HomeMenu.tsx | 6 +- .../Policies/AIPolicyEditorPanel/Message.tsx | 2 +- .../AIPolicyEditorPanel/PolicyTemplates.tsx | 12 +- .../PolicyTableRow/PolicyTableRowHeader.tsx | 4 +- .../interfaces/Auth/Users/UsersListItem.tsx | 2 +- .../interfaces/Billing/InvoiceStatusBadge.tsx | 18 +- .../BranchManagement/BranchPanels.tsx | 2 +- .../BranchManagement/BranchStatusBadge.tsx | 6 +- .../Database/Backups/BackupItem.tsx | 2 +- .../Database/Extensions/ExtensionCard.tsx | 2 +- .../Publications/PublicationsTableItem.tsx | 2 +- .../interfaces/Database/Roles/RolesList.tsx | 2 +- .../components/interfaces/Docs/Param.tsx | 4 +- .../interfaces/Home/ClientLibrary.tsx | 2 +- .../Integrations/IntegrationPanels.tsx | 4 +- .../Integrations/OrganizationPicker.tsx | 6 +- .../BillingSettings/CreditBalance.tsx | 2 +- .../PaymentMethods/PaymentMethods.tsx | 2 +- .../OAuthApps/PublishAppSidePanel/index.tsx | 2 +- .../Organization/TeamSettings/MembersView.tsx | 4 +- .../Organization/Usage/SectionContent.tsx | 2 +- .../ProjectAPIDocs/Content/Bucket.tsx | 2 +- .../interfaces/ProjectAPIDocs/Content/RPC.tsx | 2 +- .../Inspector/RealtimeFilterPopover/index.tsx | 2 +- .../components/interfaces/Reports/Reports.tsx | 2 +- .../SQLEditor/AiAssistantPanel/Message.tsx | 2 +- .../SQLEditor/UtilityPanel/ReadOnlyBadge.tsx | 2 +- .../Settings/Database/BannedIPs.tsx | 2 +- .../ConnectionPooling/ConnectionPooling.tsx | 2 +- .../NetworkRestrictions.tsx | 4 +- .../Settings/Database/UsePoolerCheckbox.tsx | 8 +- .../InstanceNode.tsx | 12 +- .../InfrastructureConfiguration/MapView.tsx | 6 +- .../Infrastructure/InfrastructureInfo.tsx | 2 +- .../Settings/Logs/LogsQueryPanel.tsx | 2 +- .../SpreadsheetImportPreview.tsx | 4 +- .../ForeignKeysManagement/ForeignKeyRow.tsx | 6 +- .../TableEditor/TableEditor.tsx | 2 +- .../layouts/AccountLayout/WithSidebar.tsx | 2 +- .../layouts/AppLayout/BranchDropdown.tsx | 4 +- .../BranchingWaitListPopover.tsx | 2 +- .../GithubRepositorySelection.tsx | 2 +- .../AppLayout/OrganizationDropdown.tsx | 2 +- .../layouts/ProjectLayout/BuildingState.tsx | 2 +- .../layouts/ProjectLayout/ConnectingState.tsx | 2 +- .../LayoutHeader/LayoutHeader.tsx | 2 +- .../layouts/ProjectLayout/PausingState.tsx | 2 +- .../layouts/StorageLayout/BucketRow.tsx | 2 +- .../StoragePoliciesBucketRow.tsx | 2 +- .../StoragePolicies/StoragePoliciesEditor.tsx | 2 +- .../components/ui/ProductMenu/ProductMenu.tsx | 2 +- .../ui/ProductMenu/ProductMenuItem.tsx | 2 +- apps/studio/pages/account/security.tsx | 2 +- apps/studio/pages/new/[slug].tsx | 2 +- apps/www/components/Announcement/Badge.tsx | 2 +- apps/www/components/Footer/index.tsx | 4 +- .../LaunchWeek/6/HackathonSection.tsx | 2 +- .../LaunchWeek/7/LaunchSection/index.tsx | 2 +- .../8/Ticket/TicketCustomizationForm.tsx | 2 +- .../components/MadeForDevelopers/index.tsx | 4 +- .../Pricing/ComputePricingCalculator.tsx | 4 +- apps/www/pages/database/Database.tsx | 12 +- .../pages/edge-functions/edge-functions.tsx | 8 +- packages/ui-patterns/Cmdk/APIKeys.tsx | 6 +- packages/ui-patterns/Cmdk/Command.Badges.tsx | 2 +- .../ui-patterns/Icons/StatusIcons.stories.tsx | 6 +- packages/ui-patterns/form/FormLayout.tsx | 6 +- packages/ui-patterns/form/FormLayout2.tsx | 6 +- packages/ui/index.tsx | 4 +- .../ui/src/components/Badge/Badge.module.css | 43 ----- .../ui/src/components/Badge/Badge.stories.tsx | 155 ------------------ .../ui/src/components/Badge/Badge.test.js | 55 ------- packages/ui/src/components/Badge/Badge.tsx | 43 ----- packages/ui/src/components/Badge/index.tsx | 1 - .../ui/src/components/Modal/Modal.stories.tsx | 4 +- .../ui/src/components/shadcn/ui/badge.tsx | 9 +- 76 files changed, 135 insertions(+), 429 deletions(-) delete mode 100644 packages/ui/src/components/Badge/Badge.module.css delete mode 100644 packages/ui/src/components/Badge/Badge.stories.tsx delete mode 100644 packages/ui/src/components/Badge/Badge.test.js delete mode 100644 packages/ui/src/components/Badge/Badge.tsx delete mode 100644 packages/ui/src/components/Badge/index.tsx diff --git a/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx index 924899c732d..944345923cf 100644 --- a/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx @@ -40,11 +40,7 @@ const NavigationMenuHome = () => { > {link?.icon && } {link.label} - {link.community && ( - - Community - - )} + {link.community && Community} ) diff --git a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/Message.tsx b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/Message.tsx index fbc544fe9c0..de1f663d796 100644 --- a/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/Message.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/AIPolicyEditorPanel/Message.tsx @@ -71,7 +71,7 @@ const Message = memo(function Message({ {createdAt && ( {dayjs(createdAt).fromNow()} )} - {isDebug && Debug request} + {isDebug && Debug request}

    {template.command} diff --git a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx index 46df0828dc0..a68d5325b60 100644 --- a/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx +++ b/apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/PolicyTableRowHeader.tsx @@ -36,13 +36,13 @@ const PolicyTableRowHeader = ({
    {isLocked && ( - + Locked )} - + {table.rls_enabled ? 'Row Level Security enabled' : 'Row Level Security disabled'}
    diff --git a/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx b/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx index dc2d8eb11ee..f815736197b 100644 --- a/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx +++ b/apps/studio/components/interfaces/Auth/Users/UsersListItem.tsx @@ -47,7 +47,7 @@ const UserListItem = ({ {!isUserConfirmed ? ( - Waiting for verification.. + Waiting for verification.. ) : user.last_sign_in_at ? ( lastSignedIn?.format('DD MMM, YYYY HH:mm') ) : ( diff --git a/apps/studio/components/interfaces/Billing/InvoiceStatusBadge.tsx b/apps/studio/components/interfaces/Billing/InvoiceStatusBadge.tsx index 4e5ca362712..5de180c7bcd 100644 --- a/apps/studio/components/interfaces/Billing/InvoiceStatusBadge.tsx +++ b/apps/studio/components/interfaces/Billing/InvoiceStatusBadge.tsx @@ -7,29 +7,32 @@ interface InvoiceStatusBadgeProps { status: InvoiceStatus } -const invoiceStatusMapping: Record = { +const invoiceStatusMapping: Record< + InvoiceStatus, + { label: string; badgeVariant: React.ComponentProps['variant'] } +> = { [InvoiceStatus.DRAFT]: { label: 'Upcoming', - badgeColor: 'yellow', + badgeVariant: 'warning', }, [InvoiceStatus.PAID]: { label: 'Paid', - badgeColor: 'green', + badgeVariant: 'brand', }, [InvoiceStatus.VOID]: { label: 'Forgiven', - badgeColor: 'green', + badgeVariant: 'brand', }, // We do not want to overcomplicate it for the user, so we'll treat uncollectible/open the same from a user perspective // it's an outstanding invoice [InvoiceStatus.UNCOLLECTIBLE]: { label: 'Outstanding', - badgeColor: 'red', + badgeVariant: 'destructive', }, [InvoiceStatus.OPEN]: { label: 'Outstanding', - badgeColor: 'red', + badgeVariant: 'destructive', }, } @@ -42,8 +45,7 @@ const InvoiceStatusBadge = ({ status }: InvoiceStatusBadgeProps) => { {statusMapping?.label || status} diff --git a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx index 8c573523dd2..2f8471df8b7 100644 --- a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx +++ b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx @@ -124,7 +124,7 @@ export const BranchRow = ({ {branch.name} - {isActive && Current} + {isActive && Current} { const isWaiting = WAITING_STATUSES.includes(status) return ( - + {(isUnhealthy || isWaiting) && ( )} {STATUS_TO_LABEL[status]} - +
    ) } diff --git a/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx b/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx index 007c84f945a..d9c8e3144c6 100644 --- a/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx +++ b/apps/studio/components/interfaces/Database/Backups/BackupItem.tsx @@ -57,7 +57,7 @@ const BackupItem = ({ index, isHealthy, backup, projectRef, onSelectBackup }: Ba )} ) - return Backup In Progress... + return Backup In Progress... } const generateBackupName = (backup: any) => { diff --git a/apps/studio/components/interfaces/Database/Extensions/ExtensionCard.tsx b/apps/studio/components/interfaces/Database/Extensions/ExtensionCard.tsx index d9911285bc5..2600bc9d264 100644 --- a/apps/studio/components/interfaces/Database/Extensions/ExtensionCard.tsx +++ b/apps/studio/components/interfaces/Database/Extensions/ExtensionCard.tsx @@ -125,7 +125,7 @@ const ExtensionCard = ({ extension }: ExtensionCardProps) => {
    Schema: - {`${extension.schema}`} + {`${extension.schema}`}
    )} diff --git a/apps/studio/components/interfaces/Database/Publications/PublicationsTableItem.tsx b/apps/studio/components/interfaces/Database/Publications/PublicationsTableItem.tsx index 08aa8acb6dc..d7d8deb5670 100644 --- a/apps/studio/components/interfaces/Database/Publications/PublicationsTableItem.tsx +++ b/apps/studio/components/interfaces/Database/Publications/PublicationsTableItem.tsx @@ -79,7 +79,7 @@ const PublicationsTableItem = ({ table, selectedPublication }: PublicationsTable
    {enabledForAllTables ? ( - + Enabled  for all tables diff --git a/apps/studio/components/interfaces/Database/Roles/RolesList.tsx b/apps/studio/components/interfaces/Database/Roles/RolesList.tsx index 9a3b5c0ae33..9fc98db4db5 100644 --- a/apps/studio/components/interfaces/Database/Roles/RolesList.tsx +++ b/apps/studio/components/interfaces/Database/Roles/RolesList.tsx @@ -191,7 +191,7 @@ const RolesList = () => {

    Roles managed by Supabase

    - Protected + Protected
    {isLoading diff --git a/apps/studio/components/interfaces/Docs/Param.tsx b/apps/studio/components/interfaces/Docs/Param.tsx index 4a97f170848..9f853e89c31 100644 --- a/apps/studio/components/interfaces/Docs/Param.tsx +++ b/apps/studio/components/interfaces/Docs/Param.tsx @@ -56,7 +56,9 @@ const Param = ({
    - {required ? 'Required' : 'Optional'} + + {required ? 'Required' : 'Optional'} + {format && (
    diff --git a/apps/studio/components/interfaces/Home/ClientLibrary.tsx b/apps/studio/components/interfaces/Home/ClientLibrary.tsx index 63996fe2d52..72c1f029b4c 100644 --- a/apps/studio/components/interfaces/Home/ClientLibrary.tsx +++ b/apps/studio/components/interfaces/Home/ClientLibrary.tsx @@ -29,7 +29,7 @@ const ClientLibrary = ({
    - {language} {!officialSupport && Community} + {language} {!officialSupport && Community}
    diff --git a/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx b/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx index baa2bbdcbf8..e8062bc61a8 100644 --- a/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx +++ b/apps/studio/components/interfaces/Integrations/IntegrationPanels.tsx @@ -103,9 +103,7 @@ const IntegrationInstallation = React.forwardRef - - {integration.metadata?.account.type} - + {integration.metadata?.account.type}
    diff --git a/apps/studio/components/interfaces/Integrations/OrganizationPicker.tsx b/apps/studio/components/interfaces/Integrations/OrganizationPicker.tsx index e4ca69f3e94..1953efb56ad 100644 --- a/apps/studio/components/interfaces/Integrations/OrganizationPicker.tsx +++ b/apps/studio/components/interfaces/Integrations/OrganizationPicker.tsx @@ -78,7 +78,7 @@ const OrganizationPicker = ({ {selectedOrg?.name ? selectedOrg?.name : 'Choose an organization'} {selectedOrg && configurationId && installed[selectedOrg.slug] && ( - Integration Installed + Integration Installed )}
    @@ -113,9 +113,7 @@ const OrganizationPicker = ({ > {org.name}{' '} {configurationId && installed[org.slug] && ( - - Integration Installed - + Integration Installed )} ) diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/CreditBalance.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/CreditBalance.tsx index 9c809c4aaa9..3c965b4c071 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/CreditBalance.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/CreditBalance.tsx @@ -30,7 +30,7 @@ const CreditBalance = () => {

    Credit balance

    {isCredit && You have credits available} - {isDebt && Outstanding payments} + {isDebt && Outstanding payments}

    Charges will be deducted from your balance first diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/PaymentMethods.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/PaymentMethods.tsx index 044cd902616..546052649a8 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/PaymentMethods.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/PaymentMethods/PaymentMethods.tsx @@ -168,7 +168,7 @@ const PaymentMethods = () => { {paymentMethod.card.exp_year}

    - {isActive && Active} + {isActive && Active} {canUpdatePaymentMethods && !isActive ? ( diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx index 780ce02d523..6b2d2adac67 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/index.tsx @@ -385,7 +385,7 @@ const PublishAppSidePanel = ({

    Authorize API access for {values.name}

    - Preview + Preview
    diff --git a/apps/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx b/apps/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx index 6f8723786c6..32f6dce0d4e 100644 --- a/apps/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx +++ b/apps/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx @@ -212,7 +212,9 @@ const MembersView = ({ searchString }: MembersViewProps) => { {x.invited_id && x.invited_at && ( - + {isInviteExpired(x.invited_at) ? 'Expired' : 'Invited'} )} diff --git a/apps/studio/components/interfaces/Organization/Usage/SectionContent.tsx b/apps/studio/components/interfaces/Organization/Usage/SectionContent.tsx index b17ef43462c..1e5b4c9d4d8 100644 --- a/apps/studio/components/interfaces/Organization/Usage/SectionContent.tsx +++ b/apps/studio/components/interfaces/Organization/Usage/SectionContent.tsx @@ -26,7 +26,7 @@ const SectionContent = ({

    {name}

    - {includedInPlan === false && Not included} + {includedInPlan === false && Not included}
    {description.split('\n').map((value, idx) => ( diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx index 22bf7499a4e..6b7e6e8e804 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx @@ -26,7 +26,7 @@ const Bucket = ({ language, apikey, endpoint }: ContentProps) => {

    {bucket.name}

    - + {bucket.public ? 'Public' : 'Private'}
    diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/RPC.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/RPC.tsx index 09cc8e1d785..a3b7410d771 100644 --- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/RPC.tsx +++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/RPC.tsx @@ -60,7 +60,7 @@ const RPC = ({ language }: ContentProps) => { {parameter.type} {parameter.required ? ( - Required + Required ) : (

    Optional

    )} diff --git a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx index b17fcd6aab9..f0d5a1accfc 100644 --- a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx +++ b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeFilterPopover/index.tsx @@ -60,7 +60,7 @@ export const RealtimeFilterPopover = ({ config, onChangeConfig }: RealtimeFilter {isFiltered ? ( <> Filtered by - table: {config.table} + table: {config.table} ) : ( Filter messages diff --git a/apps/studio/components/interfaces/Reports/Reports.tsx b/apps/studio/components/interfaces/Reports/Reports.tsx index 541acc09ae3..3ac92de5b59 100644 --- a/apps/studio/components/interfaces/Reports/Reports.tsx +++ b/apps/studio/components/interfaces/Reports/Reports.tsx @@ -351,7 +351,7 @@ const Reports = () => {
    {hasEdits && (
    - There are unsaved changes + There are unsaved changes
    )} {hasEdits && ( diff --git a/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/Message.tsx b/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/Message.tsx index efc128f7dad..edd29cd1987 100644 --- a/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/Message.tsx +++ b/apps/studio/components/interfaces/SQLEditor/AiAssistantPanel/Message.tsx @@ -67,7 +67,7 @@ const Message = memo(function Message({ {createdAt && ( {dayjs(createdAt).fromNow()} )} - {isDebug && Debug request} + {isDebug && Debug request}
    {' '} {action}
    diff --git a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/ReadOnlyBadge.tsx b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/ReadOnlyBadge.tsx index 0024fec9e56..1facb570ca6 100644 --- a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/ReadOnlyBadge.tsx +++ b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/ReadOnlyBadge.tsx @@ -10,7 +10,7 @@ const ReadOnlyBadge = ({ id }: ReadOnlyBadgeProps) => { const snippet = snap.snippets[id] const isSnippetOwner = user?.user_metadata?.user_name === snippet?.snippet?.owner?.username - return <>{isSnippetOwner ? null : Read-only} + return <>{isSnippetOwner ? null : Read-only} } export default ReadOnlyBadge diff --git a/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx b/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx index 57d11287a6d..3544e1ec3a5 100644 --- a/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx +++ b/apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx @@ -89,7 +89,7 @@ const BannedIPs = () => {

    {ip}

    - {ip === userIPAddress && Your IP address} + {ip === userIPAddress && Your IP address}
    - {isSuccess && checked && Supavisor} + {isSuccess && checked && Supavisor} {isSuccessSettings && ( - + {checked ? 'Resolves to IPv4' : resolvesToIpV6 @@ -184,7 +184,9 @@ export const UsePoolerCheckbox = ({ : 'Will resolve to IPv6'} )} - {pgBouncerStatus?.active && PgBouncer pending removal} + {pgBouncerStatus?.active && ( + PgBouncer pending removal + )}
    diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx index 2272b91597c..df440d33c96 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx @@ -195,12 +195,12 @@ export const ReplicaNode = ({ data }: NodeProps) => { Replica {id.length > 0 && `(ID: ${formatDatabaseID(id)})`}

    {status === REPLICA_STATUS.ACTIVE_HEALTHY ? ( - Healthy + Healthy ) : status === REPLICA_STATUS.INIT_READ_REPLICA ? ( - Initializing + Initializing ) : status === REPLICA_STATUS.INIT_READ_REPLICA_FAILED ? ( <> - Init failed + Init failed @@ -211,11 +211,11 @@ export const ReplicaNode = ({ data }: NodeProps) => { ) : status === REPLICA_STATUS.COMING_UP ? ( - Coming up + Coming up ) : status === REPLICA_STATUS.RESTORING ? ( - Restoring + Restoring ) : ( - Unhealthy + Unhealthy )}
    diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx index fb606996d5d..11c371bb4e1 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx @@ -258,11 +258,11 @@ const MapView = ({ onSelectDeployNewReplica, onSelectDropReplica }: MapViewProps `(ID: ${formatDatabaseID(database.identifier)})` }`} {database.status === PROJECT_STATUS.ACTIVE_HEALTHY ? ( - Healthy + Healthy ) : database.status === PROJECT_STATUS.COMING_UP ? ( - Coming up + Coming up ) : ( - Unhealthy + Unhealthy )}

    AWS â€ĸ {database.size}

    diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx index 4fe696a9d87..50218409f95 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureInfo.tsx @@ -174,7 +174,7 @@ const InfrastructureInfo = () => { isOnLatestVersion && ( - + Latest diff --git a/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx b/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx index 65bfeccae7d..b92e1a38652 100644 --- a/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx +++ b/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx @@ -149,7 +149,7 @@ const LogsQueryPanel = ({ } > - + {warnings.length} {warnings.length > 1 ? 'warnings' : 'warning'} diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx index e9c0c638637..e275feb3196 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx @@ -63,8 +63,8 @@ const SpreadsheetImportPreview = ({

    Preview data to be imported

    - {!isCompatible && Data incompatible} - {errors.length > 0 && {errors.length} issues found} + {!isCompatible && Data incompatible} + {errors.length > 0 && {errors.length} issues found}
    diff --git a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/BranchingWaitListPopover.tsx b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/BranchingWaitListPopover.tsx index c0b5387905b..1c906eecb1e 100644 --- a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/BranchingWaitListPopover.tsx +++ b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/BranchingWaitListPopover.tsx @@ -26,7 +26,7 @@ const BranchingWaitListPopover = ({ isNewNav = false }: BranchingWaitListPopover
    - Alpha Testing + Alpha Testing
    diff --git a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx index dfd40edd4f6..3f0172a0298 100644 --- a/apps/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx +++ b/apps/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx @@ -47,7 +47,7 @@ const GithubRepositorySelection = ({

    Git Connection

    - Required + Required

    {githubConnection !== undefined diff --git a/apps/studio/components/layouts/AppLayout/OrganizationDropdown.tsx b/apps/studio/components/layouts/AppLayout/OrganizationDropdown.tsx index beca9292de8..dfc69a46c47 100644 --- a/apps/studio/components/layouts/AppLayout/OrganizationDropdown.tsx +++ b/apps/studio/components/layouts/AppLayout/OrganizationDropdown.tsx @@ -60,7 +60,7 @@ const OrganizationDropdown = ({ isNewNav = false }: OrganizationDropdownProps) = >

    {orgName}

    - {isSuccess && {subscription?.plan.name}} + {isSuccess && {subscription?.plan.name}}
    diff --git a/apps/studio/components/layouts/ProjectLayout/BuildingState.tsx b/apps/studio/components/layouts/ProjectLayout/BuildingState.tsx index b139e9a5d34..d80e19dd831 100644 --- a/apps/studio/components/layouts/ProjectLayout/BuildingState.tsx +++ b/apps/studio/components/layouts/ProjectLayout/BuildingState.tsx @@ -54,7 +54,7 @@ const BuildingState = () => {

    {project?.name}

    - +
    diff --git a/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx b/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx index e6a81cbf9fa..66405e469eb 100644 --- a/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx +++ b/apps/studio/components/layouts/ProjectLayout/ConnectingState.tsx @@ -45,7 +45,7 @@ const ConnectingState = ({ project }: ConnectingStateProps) => {

    {project.name}

    - +
    Connecting to project diff --git a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx index 4b601acbf6a..78da718eb85 100644 --- a/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx +++ b/apps/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx @@ -77,7 +77,7 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder = {showOverUsageBadge && (
    - Exceeding usage limits + Exceeding usage limits
    )} diff --git a/apps/studio/components/layouts/ProjectLayout/PausingState.tsx b/apps/studio/components/layouts/ProjectLayout/PausingState.tsx index 5b371dab83d..71478e500b3 100644 --- a/apps/studio/components/layouts/ProjectLayout/PausingState.tsx +++ b/apps/studio/components/layouts/ProjectLayout/PausingState.tsx @@ -43,7 +43,7 @@ const PausingState = ({ project }: PausingStateProps) => {

    {project.name}

    - +
    Pausing project diff --git a/apps/studio/components/layouts/StorageLayout/BucketRow.tsx b/apps/studio/components/layouts/StorageLayout/BucketRow.tsx index 3d69401793b..aeae6163fa5 100644 --- a/apps/studio/components/layouts/StorageLayout/BucketRow.tsx +++ b/apps/studio/components/layouts/StorageLayout/BucketRow.tsx @@ -61,7 +61,7 @@ const BucketRow = ({ > {bucket.name}

    - {bucket.public && Public} + {bucket.public && Public}
    {/* [JOSHEN TODO] need to change this */} diff --git a/apps/studio/components/to-be-cleaned/Storage/StoragePolicies/StoragePoliciesBucketRow.tsx b/apps/studio/components/to-be-cleaned/Storage/StoragePolicies/StoragePoliciesBucketRow.tsx index d5e5a96c2be..14fbecab63f 100644 --- a/apps/studio/components/to-be-cleaned/Storage/StoragePolicies/StoragePoliciesBucketRow.tsx +++ b/apps/studio/components/to-be-cleaned/Storage/StoragePolicies/StoragePoliciesBucketRow.tsx @@ -95,7 +95,7 @@ const StoragePoliciesBucketRow = ({

    {label}

    - {bucket.public && Public} + {bucket.public && Public}
    diff --git a/apps/studio/pages/account/security.tsx b/apps/studio/pages/account/security.tsx index 4ca6e0ae9e4..a6772a7cce0 100644 --- a/apps/studio/pages/account/security.tsx +++ b/apps/studio/pages/account/security.tsx @@ -42,7 +42,7 @@ const Security: NextPageWithLayout = () => {
    {data ? ( - + {data.totp.length} app{data.totp.length === 1 ? '' : 's'} configured ) : null} diff --git a/apps/studio/pages/new/[slug].tsx b/apps/studio/pages/new/[slug].tsx index 6176128b3a3..a9ff8966559 100644 --- a/apps/studio/pages/new/[slug].tsx +++ b/apps/studio/pages/new/[slug].tsx @@ -514,7 +514,7 @@ const Wizard: NextPageWithLayout = () => {
    {instanceSizeSpecs[option].label} diff --git a/apps/www/components/Announcement/Badge.tsx b/apps/www/components/Announcement/Badge.tsx index 5c72f1b2256..a9c208c6164 100644 --- a/apps/www/components/Announcement/Badge.tsx +++ b/apps/www/components/Announcement/Badge.tsx @@ -54,7 +54,7 @@ const AnnouncementBadge = ({ )} > {badge && ( - + {badge} )} diff --git a/apps/www/components/Footer/index.tsx b/apps/www/components/Footer/index.tsx index cc3d28c87dd..f14c03d8f50 100644 --- a/apps/www/components/Footer/index.tsx +++ b/apps/www/components/Footer/index.tsx @@ -126,9 +126,7 @@ const Footer = (props: Props) => { {link.text} {!link.url && !Component && (
    - - Coming soon - + Coming soon
    )}
    diff --git a/apps/www/components/LaunchWeek/6/HackathonSection.tsx b/apps/www/components/LaunchWeek/6/HackathonSection.tsx index 78c4b80e0ae..2308f6addc1 100644 --- a/apps/www/components/LaunchWeek/6/HackathonSection.tsx +++ b/apps/www/components/LaunchWeek/6/HackathonSection.tsx @@ -11,7 +11,7 @@ export default function LaunchHero() {

    Launch Week Hackathon

    - Closed + Closed

    Submissions close Sunday 21st Aug 23:59 (PT). diff --git a/apps/www/components/LaunchWeek/7/LaunchSection/index.tsx b/apps/www/components/LaunchWeek/7/LaunchSection/index.tsx index 17042c750ca..2cbe5701976 100644 --- a/apps/www/components/LaunchWeek/7/LaunchSection/index.tsx +++ b/apps/www/components/LaunchWeek/7/LaunchSection/index.tsx @@ -41,7 +41,7 @@ export const LaunchSection = (props: WeekDayProps) => {

    ) : ( - Not shipped yet + Not shipped yet )}

    diff --git a/apps/www/components/LaunchWeek/8/Ticket/TicketCustomizationForm.tsx b/apps/www/components/LaunchWeek/8/Ticket/TicketCustomizationForm.tsx index 8d2d4ff64f3..1b5fd4ec2c3 100644 --- a/apps/www/components/LaunchWeek/8/Ticket/TicketCustomizationForm.tsx +++ b/apps/www/components/LaunchWeek/8/Ticket/TicketCustomizationForm.tsx @@ -60,7 +60,7 @@ const TicketCustomizationForm = ({ supabase, user }: Props) => { Something went wrong )} - @{user.username} + @{user.username}

    { {feature.badge && (
    - - {feature.badge} - + {feature.badge}
    )} {feature.badge ? ( diff --git a/apps/www/components/Pricing/ComputePricingCalculator.tsx b/apps/www/components/Pricing/ComputePricingCalculator.tsx index d3149d57e94..ef37ff2ecc0 100644 --- a/apps/www/components/Pricing/ComputePricingCalculator.tsx +++ b/apps/www/components/Pricing/ComputePricingCalculator.tsx @@ -238,10 +238,10 @@ const ComputePricingCalculator = () => {
    diff --git a/apps/www/pages/database/Database.tsx b/apps/www/pages/database/Database.tsx index f555fc61c41..820214f4662 100644 --- a/apps/www/pages/database/Database.tsx +++ b/apps/www/pages/database/Database.tsx @@ -248,22 +248,22 @@ function Database() {

    Available libraries:

    - Javascript + Javascript - Flutter + Flutter - Python + Python - C# + C# - Kotlin + Kotlin - Swift + Swift
    diff --git a/apps/www/pages/edge-functions/edge-functions.tsx b/apps/www/pages/edge-functions/edge-functions.tsx index 75da54a9bb6..53625ff61bc 100644 --- a/apps/www/pages/edge-functions/edge-functions.tsx +++ b/apps/www/pages/edge-functions/edge-functions.tsx @@ -263,10 +263,10 @@ serve(async (req) => {

    Libraries coming soon:

    - Python - Dart - C# - Kotlin + Python + Dart + C# + Kotlin
    { className="space-x-2" >

    Copy anonymous key

    - Public + Public )} {apiKeys?.service !== undefined && ( @@ -34,7 +34,7 @@ const APIKeys = ({ isSubItem = false }) => { className="space-x-2" >

    Copy service key

    - Secret + Secret )} {apiKeys?.anon === undefined && apiKeys?.service === undefined && ( diff --git a/packages/ui-patterns/Cmdk/Command.Badges.tsx b/packages/ui-patterns/Cmdk/Command.Badges.tsx index b78a1121a9d..fb1686e6def 100644 --- a/packages/ui-patterns/Cmdk/Command.Badges.tsx +++ b/packages/ui-patterns/Cmdk/Command.Badges.tsx @@ -3,7 +3,7 @@ import { Microscope } from 'lucide-react' export const BadgeExperimental = () => { return ( - + Experimental ) diff --git a/packages/ui-patterns/Icons/StatusIcons.stories.tsx b/packages/ui-patterns/Icons/StatusIcons.stories.tsx index 19e698b9f64..1e90154bbac 100644 --- a/packages/ui-patterns/Icons/StatusIcons.stories.tsx +++ b/packages/ui-patterns/Icons/StatusIcons.stories.tsx @@ -1,5 +1,5 @@ import { StoryObj } from '@storybook/react' -import { Badge_Shadcn_ } from 'ui' +import { Badge } from 'ui' import { StatusIcon } from './StatusIcons' // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export @@ -91,10 +91,10 @@ export const InsideBadge: Story = { */ render: function Render(args) { return ( - + Caution - + ) }, } diff --git a/packages/ui-patterns/form/FormLayout.tsx b/packages/ui-patterns/form/FormLayout.tsx index 7301a57a361..6d5c2e5e23b 100644 --- a/packages/ui-patterns/form/FormLayout.tsx +++ b/packages/ui-patterns/form/FormLayout.tsx @@ -2,7 +2,7 @@ import { zodResolver } from '@hookform/resolvers/zod' import { Box, FileWarning } from 'lucide-react' import { useForm } from 'react-hook-form' import { - Badge_Shadcn_, + Badge, Button, Checkbox_Shadcn_, Form_Shadcn_, @@ -231,10 +231,10 @@ export const Page = () => { render={({ field }) => ( + Danger zone! - + } label="Use consistent settings" description="This is your public display name." diff --git a/packages/ui-patterns/form/FormLayout2.tsx b/packages/ui-patterns/form/FormLayout2.tsx index 22df7d26056..13f0736d189 100644 --- a/packages/ui-patterns/form/FormLayout2.tsx +++ b/packages/ui-patterns/form/FormLayout2.tsx @@ -2,7 +2,7 @@ import { zodResolver } from '@hookform/resolvers/zod' import { Box, FileWarning } from 'lucide-react' import { useForm } from 'react-hook-form' import { - Badge_Shadcn_, + Badge, Button, Checkbox_Shadcn_, Form_Shadcn_, @@ -296,10 +296,10 @@ export const Page = () => { render={({ field }) => ( + Danger zone! - + } label="Use consistent settings" description="This is your public display name." diff --git a/packages/ui/index.tsx b/packages/ui/index.tsx index c9937e3cba4..92d6c1eb9f1 100644 --- a/packages/ui/index.tsx +++ b/packages/ui/index.tsx @@ -17,7 +17,6 @@ export * from './src/components/Icon/IconBackground' // DISPLAYS export * from './src/components/Card' -export * from './src/components/Badge' export * from './src/components/Tabs' export * from './src/components/Alert' export * from './src/components/Accordion' @@ -82,10 +81,9 @@ export * from './src/components/shadcn/ui/use-toast' export * from './src/components/shadcn/ui/toast' export * from './src/components/shadcn/ui/toaster' -export { Badge as Badge_Shadcn_ } from './src/components/shadcn/ui/badge' - export * from './src/components/shadcn/ui/separator' export * from './src/components/shadcn/ui/sheet' +export * from './src/components/shadcn/ui/badge' export { Command as Command_Shadcn_, diff --git a/packages/ui/src/components/Badge/Badge.module.css b/packages/ui/src/components/Badge/Badge.module.css deleted file mode 100644 index 79fbcf8ac93..00000000000 --- a/packages/ui/src/components/Badge/Badge.module.css +++ /dev/null @@ -1,43 +0,0 @@ -/* .sbui-badge { - @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-500 bg-opacity-10 text-brand-300; -} - -.sbui-badge--large { - @apply px-3 py-0.5 rounded-full text-sm; -} - -.sbui-badge-dot { - @apply -ml-0.5 mr-1.5 h-2 w-2; -} - -.sbui-badge--gray { - @apply bg-gray-600 bg-opacity-10 text-gray-500; -} - -.sbui-badge--red { - @apply bg-red-600 bg-opacity-10 text-red-500; -} - -.sbui-badge--yellow { - @apply bg-yellow-600 bg-opacity-10 text-yellow-500; -} - -.sbui-badge--green { - @apply bg-green-600 bg-opacity-10 text-green-500; -} - -.sbui-badge--blue { - @apply bg-blue-600 bg-opacity-10 text-blue-500; -} - -.sbui-badge--indigo { - @apply bg-indigo-600 bg-opacity-10 text-indigo-500; -} - -.sbui-badge--purple { - @apply bg-purple-600 bg-opacity-10 text-purple-500; -} - -.sbui-badge--pink { - @apply bg-pink-600 bg-opacity-10 text-pink-500; -} */ diff --git a/packages/ui/src/components/Badge/Badge.stories.tsx b/packages/ui/src/components/Badge/Badge.stories.tsx deleted file mode 100644 index 5567cb06464..00000000000 --- a/packages/ui/src/components/Badge/Badge.stories.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react' -import { Badge, BadgeProps } from './Badge' - -const meta: Meta = { - /* 👇 The title prop is optional. - * See https://storybook.js.org/docs/react/configure/overview#configure-story-loading - * to learn how to generate automatic titles - */ - title: 'General/Badge', - component: Badge, -} - -export default meta - -type Story = StoryObj - -export const Outline = { - args: { - variant: 'outline', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Brand = { - args: { - variant: 'brand', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Scale = { - args: { - variant: 'scale', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Tomato = { - args: { - variant: 'tomato', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Red = { - args: { - variant: 'red', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Crimson = { - args: { - variant: 'crimson', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Pink = { - args: { - variant: 'pink', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Purple = { - args: { - variant: 'purple', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Violet = { - args: { - variant: 'violet', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Indigo = { - args: { - variant: 'indigo', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Blue = { - args: { - variant: 'blue', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Green = { - args: { - variant: 'green', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Grass = { - args: { - variant: 'grass', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Orange = { - args: { - variant: 'orange', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Yellow = { - args: { - variant: 'yellow', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Amber = { - args: { - variant: 'amber', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Gold = { - args: { - variant: 'gold', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Gray = { - args: { - variant: 'gray', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Slate = { - args: { - variant: 'slate', - }, - render: ({ variant }: BadgeProps) => Hello World, -} - -export const Large = { - args: { - size: 'large', - }, - render: ({ size }: BadgeProps) => Hello World, -} diff --git a/packages/ui/src/components/Badge/Badge.test.js b/packages/ui/src/components/Badge/Badge.test.js deleted file mode 100644 index 9877cee4f60..00000000000 --- a/packages/ui/src/components/Badge/Badge.test.js +++ /dev/null @@ -1,55 +0,0 @@ -import React from 'react' -import { render, screen } from '@testing-library/react' -import Badge from './Badge' - -const SIZES = ['small', 'large'] -const COLORS = [ - 'gray', - 'red', - 'yellow', - 'green', - 'blue', - 'indigo', - 'purple', - 'pink' -] - -describe('#Badge', () => { - it('should render component correctly', () => { - const wrapper = render(Badge) - expect(screen.getByText('Badge')).toBeInTheDocument() - expect(() => wrapper.unmount()).not.toThrow() - }) - - it('should render different text', () => { - const wrapper = render(Badge) - expect(screen.getByText('Badge')).toBeInTheDocument() - wrapper.rerender(åžŊįĢ ) - expect(screen.getByText('åžŊįĢ ')).toBeInTheDocument() - }) - - it('should render with dot', () => { - const wrapper = render(Badge) - expect(screen.getByText('Badge')).toBeInTheDocument() - expect(() => wrapper.unmount()).not.toThrow() - }) - - it.each(COLORS)('should have %s color', (color) => { - render({color}) - expect(screen.getByText(color)).toHaveClass( - `sbui-badge sbui-badge--${color}` - ) - }) - - it.each(SIZES)('should render with %s size', (size) => { - render({size}) - expect(screen.getByText(size)).toHaveClass( - `sbui-badge ${size === 'large' ? 'sbui-badge--large' : ''}` - ) - }) - - it('should render with Classes',()=>{ - render(Badge) - expect(screen.getByText('Badge')).toHaveClass('border-2') - }) -}) diff --git a/packages/ui/src/components/Badge/Badge.tsx b/packages/ui/src/components/Badge/Badge.tsx deleted file mode 100644 index 8b36ec177ea..00000000000 --- a/packages/ui/src/components/Badge/Badge.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { AvailableColors } from '../../lib/constants' -import styleHandler from '../../lib/theme/styleHandler' -import { cn } from '../../lib/utils' - -interface Props { - color?: AvailableColors - children: string | React.ReactNode - size?: 'large' | 'small' - dot?: boolean - className?: string -} - -function Badge({ color = 'brand', children, size, dot, className }: Props) { - const __styles = styleHandler('badge') - - let classes = [__styles.base] - if (color) { - classes.push(__styles.color[color]) - } - if (size === 'large') { - classes.push(__styles.size.large) - } - if (className) { - classes.push(className) - } - - return ( - - {dot && ( - - - - )} - - {children} - - ) -} -export default Badge diff --git a/packages/ui/src/components/Badge/index.tsx b/packages/ui/src/components/Badge/index.tsx deleted file mode 100644 index e69f9906a73..00000000000 --- a/packages/ui/src/components/Badge/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export { default as Badge } from './Badge' diff --git a/packages/ui/src/components/Modal/Modal.stories.tsx b/packages/ui/src/components/Modal/Modal.stories.tsx index 4c69fffc138..7b41495a6be 100644 --- a/packages/ui/src/components/Modal/Modal.stories.tsx +++ b/packages/ui/src/components/Modal/Modal.stories.tsx @@ -4,7 +4,7 @@ import { action } from '@storybook/addon-actions' import { Modal } from '.' import Typography from '../Typography' -import { Badge } from '../Badge' +import { Badge } from '../shadcn/ui/Badge' import { Form } from '../Form' import { Button } from '../Button' import { Space } from '../Space' @@ -531,7 +531,7 @@ customFooter.args = { customFooter: [
    - + Proceed with caution
    diff --git a/packages/ui/src/components/shadcn/ui/badge.tsx b/packages/ui/src/components/shadcn/ui/badge.tsx index 84d5568b71a..3e68a1b8574 100644 --- a/packages/ui/src/components/shadcn/ui/badge.tsx +++ b/packages/ui/src/components/shadcn/ui/badge.tsx @@ -36,7 +36,14 @@ export interface BadgeProps extends React.HTMLAttributes, VariantProps {} -function Badge({ className, variant, size, dot, children, ...props }: BadgeProps) { +function Badge({ + className, + variant = 'default', + size, + dot = false, + children, + ...props +}: BadgeProps) { return (
    {dot && ( From fbe6d15b53a389007f0aa583d48dc94f5dda7fb4 Mon Sep 17 00:00:00 2001 From: Jordi Enric <37541088+jordienr@users.noreply.github.com> Date: Tue, 19 Mar 2024 10:36:12 +0100 Subject: [PATCH 155/163] chore: rm feature flag in sql editor charts (#22093) rm feature flag in sql editor charts --- .../SQLEditor/UtilityPanel/UtilityPanel.tsx | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityPanel.tsx b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityPanel.tsx index 7077a5ff1d1..ae96a7e4f5d 100644 --- a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityPanel.tsx +++ b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityPanel.tsx @@ -28,8 +28,6 @@ const UtilityPanel = ({ const snap = useSqlEditorStateSnapshot() const result = snap.results[id]?.[0] - const showCharts = useFlag('showSQLEditorCharts') - const [config, setConfig] = useState({ type: 'bar', cumulative: false, @@ -47,11 +45,10 @@ const UtilityPanel = ({ (result?.rows ?? []).length > 0 && `(${result.rows.length.toLocaleString()})`} - {showCharts && ( - - Chart - - )} + + + Chart +
    {result && result.rows && } @@ -68,11 +65,10 @@ const UtilityPanel = ({ - {showCharts && ( - - - - )} + + + + ) } From 02b0ebc70e024a8549b8b27ac4307583ee537c80 Mon Sep 17 00:00:00 2001 From: Joel Lee Date: Tue, 19 Mar 2024 16:36:22 +0700 Subject: [PATCH 156/163] fix: update rate limit from 4 to 3 (#21658) * fix: update rate limit from 4 to 3 * Update apps/docs/content/guides/platform/going-into-prod.mdx Co-authored-by: Wen Bo Xie <5532241+w3b6x9@users.noreply.github.com> * fix: run prettier --------- Co-authored-by: Wen Bo Xie <5532241+w3b6x9@users.noreply.github.com> Co-authored-by: joel --- .../guides/platform/going-into-prod.mdx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/docs/content/guides/platform/going-into-prod.mdx b/apps/docs/content/guides/platform/going-into-prod.mdx index 6fab64d5ac1..c100db955e9 100644 --- a/apps/docs/content/guides/platform/going-into-prod.mdx +++ b/apps/docs/content/guides/platform/going-into-prod.mdx @@ -60,16 +60,16 @@ After developing your project and deciding it's Production Ready, you should run - The table below shows the rate limit quotas on the following authentication endpoints. You can configure the auth rate limits for your project [here](/dashboard/project/_/auth/rate-limits). -| Endpoint | Path | Limited By | Rate Limit | -| ------------------------------------------------ | -------------------------------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| All endpoints that send emails | `/auth/v1/signup` `/auth/v1/recover` `/auth/v1/user`[^1] | Sum of combined requests | Defaults to 30 emails per hour. As of 14th July 2023, this has been updated to 4 emails per hour. Is customizable with custom SMTP set up. | -| All endpoints that send One-Time-Passwords (OTP) | `/auth/v1/otp` | Sum of combined requests | Defaults to 30 OTPs per hour. Is customizable. | -| Send OTPs or magiclinks | `/auth/v1/otp` | Last request | Defaults to 60 seconds window before a new request is allowed. Is customizable. | -| Signup confirmation request | `/auth/v1/signup` | Last request | Defaults to 60 seconds window before a new request is allowed. Is customizable. | -| Password Reset Request | `/auth/v1/recover` | Last request | Defaults to 60 seconds window before a new request is allowed. Is customizable. | -| Verification requests | `/auth/v1/verify` | IP Address | 360 requests per hour (with bursts up to 30 requests) | -| Token refresh requests | `/auth/v1/token` | IP Address | 1800 requests per hour (with bursts up to 30 requests) | -| Create or Verify an MFA challenge | `/auth/v1/factors/:id/challenge` `/auth/v1/factors/:id/verify` | IP Address | 15 requests per minute (with bursts up to 30 requests) | +| Endpoint | Path | Limited By | Rate Limit | +| ------------------------------------------------ | -------------------------------------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| All endpoints that send emails | `/auth/v1/signup` `/auth/v1/recover` `/auth/v1/user`[^1] | Sum of combined requests | Defaults to 30 emails per hour. As of 14th July 2023, this has been updated to 4 emails per hour. As of 21 Oct 2023, this has been updated to 3 emails per hour. You can only change this with your own custom SMTP setup. | +| All endpoints that send One-Time-Passwords (OTP) | `/auth/v1/otp` | Sum of combined requests | Defaults to 30 OTPs per hour. Is customizable. | +| Send OTPs or magiclinks | `/auth/v1/otp` | Last request | Defaults to 60 seconds window before a new request is allowed. Is customizable. | +| Signup confirmation request | `/auth/v1/signup` | Last request | Defaults to 60 seconds window before a new request is allowed. Is customizable. | +| Password Reset Request | `/auth/v1/recover` | Last request | Defaults to 60 seconds window before a new request is allowed. Is customizable. | +| Verification requests | `/auth/v1/verify` | IP Address | 360 requests per hour (with bursts up to 30 requests) | +| Token refresh requests | `/auth/v1/token` | IP Address | 1800 requests per hour (with bursts up to 30 requests) | +| Create or Verify an MFA challenge | `/auth/v1/factors/:id/challenge` `/auth/v1/factors/:id/verify` | IP Address | 15 requests per minute (with bursts up to 30 requests) | ### Realtime quotas From cc9ed7174f450183c36faaf0e58dcf77a5b90028 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Tue, 19 Mar 2024 16:45:25 +0700 Subject: [PATCH 157/163] feat: limit sign-in password length to 72 (#20571) * feat: limit sign-in password length to 72 * limit password length on signup * Update apps/studio/lib/schemas.ts Co-authored-by: Joshen Lim * Update apps/studio/components/interfaces/SignIn/SignInForm.tsx Co-authored-by: Joshen Lim * don't limit password length on sign in --------- Co-authored-by: Alaister Young Co-authored-by: Alaister Young Co-authored-by: Joshen Lim --- .../interfaces/SignIn/PasswordConditionsHelper.tsx | 3 ++- apps/studio/lib/schemas.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/studio/components/interfaces/SignIn/PasswordConditionsHelper.tsx b/apps/studio/components/interfaces/SignIn/PasswordConditionsHelper.tsx index 00d6402a817..8e0c4cfbf86 100644 --- a/apps/studio/components/interfaces/SignIn/PasswordConditionsHelper.tsx +++ b/apps/studio/components/interfaces/SignIn/PasswordConditionsHelper.tsx @@ -15,7 +15,8 @@ const PasswordConditionsHelper = ({ password }: PasswordConditionsHelperProps) = - + + {password.length > 72 && }
    ) } diff --git a/apps/studio/lib/schemas.ts b/apps/studio/lib/schemas.ts index 16cdc6231d4..97dedc72055 100644 --- a/apps/studio/lib/schemas.ts +++ b/apps/studio/lib/schemas.ts @@ -5,5 +5,10 @@ import YupPassword from 'yup-password' YupPassword(yup) export const passwordSchema = yup.object({ - password: yup.string().password().required().label('Password'), + password: yup + .string() + .password() + .required() + .max(72, 'Password cannot exceed 72 characters') + .label('Password'), }) From 035ec0d76ac64174fd12c405ee36f3fb23434021 Mon Sep 17 00:00:00 2001 From: NxPKG <116948796+NxPKG@users.noreply.github.com> Date: Tue, 19 Mar 2024 15:52:21 +0600 Subject: [PATCH 158/163] Update README.bn.md (#21604) * Update README.bn.md * Lint --------- Co-authored-by: Joshen Lim --- i18n/README.bn.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/README.bn.md b/i18n/README.bn.md index 648ccb9c133..0980cd6fcb8 100644 --- a/i18n/README.bn.md +++ b/i18n/README.bn.md @@ -7,7 +7,7 @@ # Supabase -[Supabase](https://supabase.com) āĻāĻ•āϟāĻŋ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āĻĢāĻžāϝāĻŧāĻžāϰāĻŦ⧇āϏ āĻŦāĻŋāĻ•āĻ˛ā§āĻĒāĨ¤ āφāĻŽāϰāĻž āĻāĻ¨ā§āϟāĻžāϰāĻĒā§āϰāĻžāχāϜ-āĻ—ā§āϰ⧇āĻĄ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āϟ⧁āϞ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ Firebase-āĻāϰ āĻŦ⧈āĻļāĻŋāĻˇā§āĻŸā§āϝ āϤ⧈āϰāĻŋ āĻ•āϰāĻ›āĻŋāĨ¤ +[Supabase](https://supabase.com) āĻāĻ•āϟāĻŋ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āĻĢāĻžāϝāĻŧāĻžāϰāĻŦ⧇āϏ āĻŦāĻŋāĻ•āĻ˛ā§āĻĒāĨ¤ āφāĻŽāϰāĻž āĻāĻ¨ā§āϟāĻžāϰāĻĒā§āϰāĻžāχāϜ-āĻ—ā§āϰ⧇āĻĄ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āϏāϰāĻžā§āϜāĻžāĻŽ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻĢāĻžāϝāĻŧāĻžāϰāĻŦ⧇āϏ⧇āϰ āĻŦ⧈āĻļāĻŋāĻˇā§āĻŸā§āϝāϗ⧁āϞāĻŋ āϤ⧈āϰāĻŋ āĻ•āϰāĻ›āĻŋāĨ¤ - [x] āĻšā§‹āĻ¸ā§āϟ āĻ•āϰāĻž āĻĒā§‹āĻ¸ā§āϟāĻ—ā§āϰ⧇āϏ āĻĄāĻžāϟāĻžāĻŦ⧇āϏ. [āĻĄāĻ•ā§āϏ](https://supabase.com/docs/guides/database) - [x] āĻ…āĻĨ⧇āύāϟāĻŋāϕ⧇āĻļāύ āĻāĻŦāĻ‚ āĻ…āĻĨāϰāĻžāχāϜāĻĄ . [āĻĄāĻ•ā§āϏ](https://supabase.com/docs/guides/auth) @@ -43,7 +43,7 @@ - [x] āĻĒāĻžāĻŦāϞāĻŋāĻ• āĻŦ⧇āϟāĻž: āĻŦ⧇āĻļāĻŋāϰāĻ­āĻžāĻ— āύāύ-āĻāĻ¨ā§āϟāĻžāϰāĻĒā§āϰāĻžāχāϜ āĻŦā§āϝāĻŦāĻšāĻžāϰ⧇āϰ āĻ•ā§āώ⧇āĻ¤ā§āϰ⧇ āϝāĻĨ⧇āĻˇā§āϟ āĻ¸ā§āĻĨāĻŋāϤāĻŋāĻļā§€āϞ - [ ] āĻĒāĻžāĻŦāϞāĻŋāĻ•: āĻĒā§āϰ⧋āĻĄāĻžāĻ•āĻļāύ āϰ⧇āĻĄāĻŋ -āφāĻŽāϰāĻž āĻŦāĻ°ā§āϤāĻŽāĻžāύ⧇ āĻĒāĻžāĻŦāϞāĻŋāĻ• āĻŦāĻŋāϟāĻžāϤ⧇ āφāĻ›āĻŋāĨ¤ āĻŦāĻĄāĻŧ āφāĻĒāĻĄā§‡āĻŸā§‡āϰ āĻŦāĻŋāĻœā§āĻžāĻĒā§āϤāĻŋ āĻĒ⧇āϤ⧇ āĻāχ āϰ⧇āĻĒā§‹āϰ "āϰāĻŋāϞāĻŋāϜ" āĻĻ⧇āϖ⧁āύāĨ¤ +āφāĻŽāϰāĻž āĻŦāĻ°ā§āϤāĻŽāĻžāύ⧇ āĻĒāĻžāĻŦāϞāĻŋāĻ• āĻŦāĻŋāϟāĻžāϤ⧇ āφāĻ›āĻŋāĨ¤ āĻĒā§āϰāϧāĻžāύ āφāĻĒāĻĄā§‡āĻŸā§‡āϰ āĻŦāĻŋāώāϝāĻŧ⧇ āĻ…āĻŦāĻšāĻŋāϤ āĻšāĻ“āϝāĻŧāĻžāϰ āϜāĻ¨ā§āϝ āĻāχ āϰ⧇āĻĒā§‹āϰ "āϰāĻŋāϞāĻŋāϜ" āĻĻ⧇āϖ⧁āύāĨ¤ āĻāχ āϰāĻŋāĻĒ⧁ āĻĻ⧇āϖ⧁āύ @@ -51,7 +51,7 @@ ## āĻ•āĻŋāĻ­āĻžāĻŦ⧇ āĻāϟāĻž āĻ•āĻžāϜ āĻ•āϰ⧇ -Supabase āĻšāϞ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āϟ⧁āϞ⧇āϰ āϏāĻ‚āĻŽāĻŋāĻļā§āϰāĻŖāĨ¤ āφāĻŽāϰāĻž āĻāĻ¨ā§āϟāĻžāϰāĻĒā§āϰāĻžāχāϜ-āĻ—ā§āϰ⧇āĻĄ, āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āĻĒāĻŖā§āϝ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ Firebase-āĻāϰ āĻĢāĻŋāϚāĻžāϰāϏāĻŽā§āĻš āϤ⧈āϰāĻŋ āĻ•āϰāĻ›āĻŋāĨ¤ āϝāĻĻāĻŋ MIT, Apache 2, āĻŦāĻž āϏāĻŽāϤ⧁āĻ˛ā§āϝ āĻ“āĻĒ⧇āύ āϞāĻžāχāϏ⧇āĻ¨ā§āϏ āϏāĻš āϟ⧁āϞ āĻāĻŦāĻ‚ āϏāĻŽā§āĻĒā§āϰāĻĻāĻžāϝāĻŧāϗ⧁āϞāĻŋ āĻŦāĻŋāĻĻā§āϝāĻŽāĻžāύ āĻĨāĻžāϕ⧇, āφāĻŽāϰāĻž āϏ⧇āχ āϟ⧁āϞāϟāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻŦ āĻāĻŦāĻ‚ āϏāĻŽāĻ°ā§āĻĨāύ āĻ•āϰāĻŦāĨ¤ āϝāĻĻāĻŋ āϟ⧁āϞāϟāĻŋ āĻŦāĻŋāĻĻā§āϝāĻŽāĻžāύ āύāĻž āĻĨāĻžāϕ⧇, āϤāĻžāĻšāϞ⧇ āφāĻŽāϰāĻž āύāĻŋāĻœā§‡āϰāĻžāχ āĻāϟāĻŋ āϤ⧈āϰāĻŋ āĻāĻŦāĻ‚ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āĻ•āϰāĻŋāĨ¤ Supabase Firebase-āĻāϰ 1-āĻĨ⧇āϕ⧇-1 āĻŽā§āϝāĻžāĻĒāĻŋāĻ‚ āύāϝāĻŧāĨ¤ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āϟ⧁āϞ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻĄā§‡āϭ⧇āϞāĻĒāĻžāϰāĻĻ⧇āϰ āĻĢāĻžāϝāĻŧāĻžāϰāĻŦ⧇āϏ⧇āϰ āĻŽāϤ⧋ āĻĄā§‡āϭ⧇āϞāĻĒāĻžāϰ āĻ…āĻ­āĻŋāĻœā§āĻžāϤāĻž āĻĻ⧇āĻ“āϝāĻŧāĻžāχ āφāĻŽāĻžāĻĻ⧇āϰ āϞāĻ•ā§āĻˇā§āϝāĨ¤ +Supabase āĻšāϞ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āϟ⧁āϞ⧇āϰ āϏāĻ‚āĻŽāĻŋāĻļā§āϰāĻŖāĨ¤ āφāĻŽāϰāĻž āĻāĻ¨ā§āϟāĻžāϰāĻĒā§āϰāĻžāχāϜ-āĻ—ā§āϰ⧇āĻĄ, āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āĻĒāĻŖā§āϝ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻĢāĻžāϝāĻŧāĻžāϰāĻŦ⧇āϏ⧇āϰ āĻŦ⧈āĻļāĻŋāĻˇā§āĻŸā§āϝāϗ⧁āϞāĻŋ āϤ⧈āϰāĻŋ āĻ•āϰāĻ›āĻŋāĨ¤ āϝāĻĻāĻŋ āϏāϰāĻžā§āϜāĻžāĻŽ āĻāĻŦāĻ‚ āϏāĻŽā§āĻĒā§āϰāĻĻāĻžāϝāĻŧāϗ⧁āϞāĻŋ āĻŦāĻŋāĻĻā§āϝāĻŽāĻžāύ āĻšāϝāĻŧ, MIT, Apache 2, āĻŦāĻž āϏāĻŽāϤ⧁āĻ˛ā§āϝ āĻ“āĻĒ⧇āύ āϏ⧋āĻ°ā§āϏ āϞāĻžāχāϏ⧇āĻ¨ā§āϏ⧇āϰ āϏāĻžāĻĨ⧇, āφāĻŽāϰāĻž āϏ⧇āχ āϏāϰāĻžā§āϜāĻžāĻŽāϟāĻŋ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻŦ āĻāĻŦāĻ‚ āϏāĻŽāĻ°ā§āĻĨāύ āĻ•āϰāĻŦāĨ¤ āϝāĻĻāĻŋ āϏāϰāĻžā§āϜāĻžāĻŽāϟāĻŋ āĻŦāĻŋāĻĻā§āϝāĻŽāĻžāύ āύāĻž āĻšāϝāĻŧ, āφāĻŽāϰāĻž āĻāϟāĻŋ āύāĻŋāĻœā§‡āϰāĻžāχ āϤ⧈āϰāĻŋ āĻ•āϰāĻŦā§‹āĨ¤ **āĻ¸ā§āĻĨāĻžāĻĒāĻ¤ā§āϝ** From d4d75608df6cbc63e9bc2585cb0acf7ac11ff2ea Mon Sep 17 00:00:00 2001 From: TheOtherBrian1 <91111415+TheOtherBrian1@users.noreply.github.com> Date: Tue, 19 Mar 2024 18:00:30 +0700 Subject: [PATCH 159/163] Update pgaudit.mdx (#21832) * Update pgaudit.mdx Rewrote pgaudit to include more hands-on examples * made SQL capitals consistent * fixed typo * ran through prettier * capitalization * small typo * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Inian * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Inian * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Inian * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Inian * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Inian * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Inian * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Oliver Rice * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Ziinc * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update apps/docs/content/guides/database/extensions/pgaudit.mdx Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update pgaudit.mdx --------- Co-authored-by: Inian Co-authored-by: Ziinc Co-authored-by: Oliver Rice Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../guides/database/extensions/pgaudit.mdx | 370 ++++++++++++++++-- 1 file changed, 332 insertions(+), 38 deletions(-) diff --git a/apps/docs/content/guides/database/extensions/pgaudit.mdx b/apps/docs/content/guides/database/extensions/pgaudit.mdx index 65d8717c67e..2d9f5a2afc9 100644 --- a/apps/docs/content/guides/database/extensions/pgaudit.mdx +++ b/apps/docs/content/guides/database/extensions/pgaudit.mdx @@ -4,11 +4,15 @@ title: 'PGAudit: Postgres Auditing' description: 'Session and object auditing via PostgreSQL standard logging' --- -[PGAudit](https://www.pgaudit.org) is a PostgreSQL extension for logging session and object auditing over the standard PostgreSQL logging utility. +[PGAudit](https://www.pgaudit.org) is a PostgreSQL extension that extends PostgreSQL's built-in logging abilities. It can be used to selectively track activities within your database. -PGAudit grants fine grain control over which statements and objects are emitted to logs. +This helps you with: -## Enable the extension +- **Compliance**: Meeting audit requirements for regulations +- **Security**: Detecting suspicious database activity +- **Troubleshooting**: Identifying and fixing database issues + +## Enable the Extension -## Settings +## Configure the Extension -The `pgaudit.log` setting controls which statements to log. Available values include: +PGAudit can be configured with multiple different levels of precision. -- `read`: `SELECT` and `COPY` when the source is a relation or a query. -- `write`: `INSERT`, `UPDATE`, `DELETE`, `TRUNCATE`, and `COPY` when the destination is a relation. -- `function`: Function calls and `DO` blocks. -- `role`: Statements related to roles and privileges: `GRANT`, `REVOKE`, `CREATE/ALTER/DROP ROLE`. -- `ddl`: All `DDL` that is not included in the `ROLE` class. -- `misc`: Miscellaneous commands, for example, `DISCARD`, `FETCH`, `CHECKPOINT`, `VACUUM`, `SET`. -- `misc_set`: Miscellaneous `SET` commands, for example, `SET ROLE`. +**PGAudit Logging Precision:** -- **all**: Include all of the above. +- **[Session](#session-logging):** Logs activity within a connection, such as a [PSQL](https://supabase.com/docs/guides/database/connecting-to-postgres#connecting-with-psql) connection. +- **[User](#user-logging):** Logs activity by a particular database user (e.g., anon or postgres). +- **[Global](#global-logging):** Logs activity across the entire database. +- **[Object](#object-mode-settings):** Logs events related to specific database objects (for example, the auth.users table). -For a full list of available settings see [settings docs](https://github.com/pgaudit/pgaudit/blob/master/README.md#settings). Be aware that the `all` setting will generate a very large volume of logs. +Although Session, User, and Global modes differ in their precision, they are all considered variants of **Session Mode** and are configured with the same input categories. + +### Session Mode Categories + +These modes can monitor predefined categories of database operations: + +| Category | What it Logs | Description | +| -------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| read | Data retrieval (SELECT, COPY) | Tracks what data is being accessed. | +| write | Data modification (INSERT, DELETE, UPDATE, TRUNCATE, COPY) | Tracks changes made to your database. | +| function | FUNCTION, PROCEDURE, and DO/END block executions | Tracks routine/function executions | +| role | User management actions (CREATE, DROP, ALTER on users and privileges) | Tracks changes to user permissions and access. | +| ddl | Schema changes (CREATE, DROP, ALTER statements) | Monitors modifications to your database structure (tables, indexes, etc.). | +| misc | Less common commands (FETCH, CHECKPOINT) | Captures obscure actions for deeper analysis if needed. | +| all | Everything above | Comprehensive logging for complete audit trails. | + +Below is a limited example of how to assign pgaudit to monitor specific categories. + +```sql +-- log all CREATE, ALTER, and DROP events +... pgaudit.log = 'ddl'; + +-- log all CREATE, ALTER, DROP, and SELECT events +... pgaudit.log = 'read, ddl'; + +-- log nothing +... pgaudit.log = 'none'; +``` + +### Session Logging + +When you are connecting in a session environment, such as a PSQL connection, you can configure pgaudit to record events initiated within the session. -We don't currently support configuring `pgaudit.log_parameter` because it may log secrets in encrypted columns if you are using [`pgsodium`](/docs/guides/database/extensions/pgsodium) or [Vault](/docs/guides/database/vault). - -You can upvote this [feature request](https://github.com/orgs/supabase/discussions/20183) if you'd like this restriction lifted. +The [Dashboard](https://supabase.com/dashboard/project/_) is a transactional environment and will not sustain a session. -## Example +Inside a session, by default, pgaudit will log nothing: -Given a `pgaudit` setting - -{/* prettier-ignore */} ```sql -set pgaudit.log = 'read, ddl'; +-- returns 'none' +show pgaudit.log; ``` -The following create table, insert and select statements +In the session, you can `SET` the `pgaudit.log` variable to record events: + +```sql +-- log CREATE, ALTER, and DROP events +set pgaudit.log = 'ddl'; + +-- log all CREATE, ALTER, DROP, and SELECT events +set pgaudit.log = 'read, ddl'; + +-- log nothing +set pgaudit.log = 'none'; +``` + +### User Logging + +There are some cases where you may want to monitor a database user's actions. For instance, let's say you connected your database to [Zapier](https://supabase.com/partners/integrations/zapier) and created a custom role for it to use: + +```sql +create user "zapier" with password ''; +``` + +You may want to log all actions initiated by `zapier`, which can be done with the following command: + +```sql +alter role "zapier" set pgaudit.log to 'all'; +``` + +To remove the settings, execute the following code: + +```sql +-- disables role's log +alter role "zapier" set pgaudit.log TO 'none'; + +-- check to make sure the changes are finalized: +select rolname, + rolconfig +from pg_roles +where rolname = 'zapier'; +-- should return a rolconfig path with "pgaudit.log=none" present +``` + +### Global Logging + + + +Use global logging sparingly as it can generate many logs and make it difficult to find important events. Consider limiting the scope of what is logged by using user or object logging where possible. + + + +The below SQL configures pgaudit to record all events associated with the "postgres" role. Since postgres has extensive privileges, this effectively monitors all database activity. + +```sql +alter role "postgres" set pgaudit.log to 'all'; +``` + +To check if the postgres role is auditing, execute the following command: + +```sql +select + rolname, + rolconfig +from pg_roles +where rolname = 'postgres'; +-- should return a rolconfig path with "pgaudit.log=all" present +``` + +To remove the settings, execute the following code: + +```sql +alter role "postgres" set pgaudit.log to 'none'; +``` + +## Object Mode Settings + +Assigning a role to pgaudit will result in the logging of **any actions** that role is **capable** of performing, _regardless of who or what actually initiated the event_. + +### Object Logging + +To fine-tune what pgaudit will record, you must create a custom database role with limited permissions: + +```sql +create role "some_audit_role" noinherit; +``` + +No other Postgres user can assume or login via this role. It solely exists to securely define what pgaudit will record. + +Once the role is created, you can direct pgaudit to log by assigning it to the `pgaudit.role` variable: + +```sql +alter role "postgres" set pgaudit.role to 'some_audit_role'; +``` + +You can then assign the role to monitor only approved events, such as `select` statements that include a specific table: + +```sql +grant select on random_table to "some_audit_role"; +``` + +With this privilege granted, pgaudit will record all select statements against the `random_table`. Note, that this does include joins that feature the table, too. All assignignable priveleges can be viewed in the [PostgreSQL documentation](https://www.postgresql.org/docs/current/ddl-priv.html). + +If you would no longer like to use object logging, you will need to unnasign the `pgaudit.role` variable: + +```sql +-- change pgaudit.role to no longer reference some_audit_role +alter role "postgres" set pgaudit.role to ''; + +-- view if pgaudit.role changed with the following command: +select + rolname, + rolconfig +from pg_roles +where rolname = 'postgres'; +-- should return a rolconfig path with "pgaudit.role=" +``` + +If you are no longer using a `ROLE`, it is best to `DROP`it: + +```sql +drop role "some_audit_role"; +``` + +## Interpreting Audit Logs + +pgaudit was designed for storing logs as CSV files with the following headers: + +> Referenced from the [pgaudit official docs](https://github.com/pgaudit/pgaudit/blob/master/README.md#format) + +| header | Description | +| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| AUDIT_TYPE | SESSION or OBJECT | +| STATEMENT_ID | Unique statement ID for this session. Sequential even if some statements are not logged. | +| SUBSTATEMENT_ID | Sequential ID for each sub-statement within the main statement. Continuous even if some are not logged. | +| CLASS | e.g., READ, ROLE (see pgaudit.log). | +| COMMAND | e.g., ALTER TABLE, SELECT. | +| OBJECT_TYPE | TABLE, INDEX, VIEW, etc. Available for SELECT, DML, and most DDL statements. | +| OBJECT_NAME | The fully qualified object name (e.g., public.account). Available for SELECT, DML, and most DDL. | +| STATEMENT | Statement executed on the backend. | +| PARAMETER | If pgaudit.log_parameter is set, this field contains the statement parameters as quoted CSV, or \. Otherwise, it's \. | + +A log made from the following create statement: -{/* prettier-ignore */} ```sql create table account ( id int primary key, name text, description text ); - -insert into account (id, name, description) -values (1, 'Foo Barsworth', 'Customer account'); - -select * from account; ``` -Results in the log output +Generates the following log in the [Dashboard's Postgres Logs](https://supabase.com/dashboard/project/_/logs/postgres-logs): -```text -AUDIT: SESSION,1,1,DDL,CREATE TABLE,TABLE,public.account,create table account( +``` + AUDIT: SESSION,1,1,DDL,CREATE TABLE,TABLE,public.account,create table account( id int, name text, description text -);, -AUDIT: SESSION,2,1,READ,SELECT,,,select * from account,, +); ``` -Note that the insert statement is not logged because we did not include the `write` option for `pgaudit.log`. +## Finding and Filtering Audit Logs + +Logs generated by pgaudit can be found in [Postgres Logs](https://supabase.com/dashboard/project/_/logs/postgres-logs?s=AUDIT). To find a specific log, you can use the log explorer. Below is a basic example to extract logs referencing `CREATE TABLE` events + +```sql +select + cast(t.timestamp as datetime) as timestamp, + event_message +from + postgres_logs as t + cross join unnest(metadata) as m + cross join unnest(m.parsed) as p +where event_message like 'AUDIT%CREATE TABLE%' +order by timestamp desc +limit 100; +``` + +## Practical Examples + +### Monitoring API events + + + +API requests are already recorded in the [API Edge Network](https://supabase.com/dashboard/project/_/logs/edge-logs) logs. + + + +To monitor all writes initiated by the Postgrest API roles: + +```sql +alter role "authenticator" set pgaudit.log to 'write'; + +-- the above is the practical equivalent to: +-- alter role "anon" set pgaudit.log TO 'write'; +-- alter role "authenticated" set pgaudit.log TO 'write'; +-- alter role "service_role" set pgaudit.log TO 'write'; +``` + +### Monitoring the `auth.users` Table + +In the worst case scenario, where a privileged roles' password is exposed, you can use pgaudit to monitor if the `auth.users` table was targeted. It should be stated that API requests are already monitored in the [API Edge Network](https://supabase.com/dashboard/project/_/logs/edge-logs) and this is more about providing greater clarity about what is happening at the database level. + +Logging `auth.user` should be done in Object Mode and requires a custom role: + +```sql +-- create logging role +create role "auth_auditor" noinherit; + +-- give role permission to observe relevant table events +grant select on auth.users to "auth_auditor"; +grant delete on auth.users to "auth_auditor"; + +-- assign auth_auditor to pgaudit.role +alter role "postgres" set pgaudit.role to 'auth_auditor'; + +``` + +With the above code, any query involving reading or deleting the auth.users email column will be logged. + +## Best Practices + +### Over-logging: Help! Too many logs! + +pgaudit, if not configured mindfully, can log all database events, including background tasks. This can generate an undesirablely large amount of logs in a few hours. + +The first step to solve this problem is to identify which database users pgaudit is observing: + +```sql +-- find all users monitored by pgaudit +select + rolname, + rolconfig +from pg_roles +where + exists ( + select + 1 + from UNNEST(rolconfig) as c + where c like '%pgaudit.role%' or c like '%pgaudit.log%' + ); +``` + +To prevent pgaudit from monitoring the problematic roles, you'll want to change their `pgaudit.log` values to `none` and `pgaudit.role` values to `empty quotes ''` + +```sql + -- Use to disable object level logging + alter role "" set pgaudit.role to ''; + + -- Use to disable global and user level logging + alter role "" set pgaudit.log to 'none'; +``` + +## FAQ + +#### How can I use pgaudit to debug database functions? + +Technically yes, but it is not the best approach. It is better to check out our [function debugging guide](https://supabase.com/docs/guides/database/functions#general-logging) instead. + +#### How can I download database logs? + +In the [Logs Dashboard](https://supabase.com/dashboard/project/_/logs/postgres-logs) you can download logs as CSVs. + +#### Can I log observed table rows? + +By default, pgaudit records queries, but not the returned rows. You can modify this behavior with the `pgaudit.log_rows` variable: + +```sql +--enable +alter role "postgres" set pgaudit.log_rows to 'on'; + +-- disable +alter role "postgres" set pgaudit.log_rows to 'off'; +``` + +You should not do this unless you are _absolutely_ certain it is necessary for your use case. It can expose sensitive values to your logs that ideally should not be preserved. Furthermore, if done in excess, it can noticably reduce database performance. + +#### Can I log function parameters? + +We don't currently support configuring pgaudit.log_parameter because it may log secrets in encrypted columns if you are using [pgsodium](https://supabase.com/docs/guides/database/extensions/pgsodium) or[Vault](https://supabase.com/docs/guides/database/vault). + +You can upvote this [feature request](https://github.com/orgs/supabase/discussions/20183) with your use-case if you'd like this restriction lifted. + +#### Why do the official pgaudit docs differ from the Supabase one? + +pgaudit allows settings to be applied at 3 different database scopes: + +| Scope | Definition | Configuration File/Command | +| -------- | ------------------ | -------------------------- | +| System | Entire server | ALTER SYSTEM commands | +| Database | Specific database | ALTER DATABASE commands | +| Role | Specific user/role | ALTER ROLE commands | + +Supabase limits full privileges for file system and database variables, meaning pgaudit modifications can only occur at the ROLE level. Assigning pgaudit to the 'postgres' role provides it with the role's database visibility, allowing `ROLE` level adjustments a practical alternative to DATABASE/SYSTEM level configurations. + +pgaudit's [official documentation](https://www.pgaudit.org) focuses on system and database level configs, but its docs officially supports `ROLE` level configs, too: ## Resources - Official [`PGAudit` documentation](https://www.pgaudit.org) +- [Database Function Logging](https://supabase.com/docs/guides/database/functions#general-logging) +- [Supabase Logging](https://supabase.com/docs/guides/platform/logs) +- [Self-Hosting Logs](https://supabase.com/docs/reference/self-hosting-analytics/introduction) From dd0f647327afb731ee47d6e6e76765cf054b8e6f Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 19 Mar 2024 18:45:12 +0700 Subject: [PATCH 160/163] chore: add note about DNS records for custom domains (#22084) --- apps/docs/content/guides/platform/custom-domains.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/docs/content/guides/platform/custom-domains.mdx b/apps/docs/content/guides/platform/custom-domains.mdx index a1933986517..c8736977997 100644 --- a/apps/docs/content/guides/platform/custom-domains.mdx +++ b/apps/docs/content/guides/platform/custom-domains.mdx @@ -79,6 +79,8 @@ Required outstanding validation records: Add the records to your domains' DNS settings. Make sure to trim surrounding whitespace. Use a low TTL value so you can quickly change the records if you make a mistake. +Some DNS registrars automatically append your domain name to the DNS entries being created. As such, creating a DNS record for `api.example.com` might instead create a record for `api.example.com.example.com`. In such cases, please remove the domain name from the records you're creating; as an example, you would create a TXT record for `api`, instead of `api.example.com`. + ### Verify your domain Make sure you've configured all required DNS settings: From ac45e6d1293a20c664e54399e91c2f15946af2c8 Mon Sep 17 00:00:00 2001 From: Beng Eu Date: Wed, 20 Mar 2024 10:55:18 +0800 Subject: [PATCH 161/163] docs: update size-related info (#21699) --- apps/docs/content/guides/platform/compute-add-ons.mdx | 2 +- apps/docs/content/guides/platform/org-based-billing.mdx | 2 +- apps/docs/content/guides/platform/performance.mdx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/docs/content/guides/platform/compute-add-ons.mdx b/apps/docs/content/guides/platform/compute-add-ons.mdx index edb2412de2c..b9b31c5e3af 100644 --- a/apps/docs/content/guides/platform/compute-add-ons.mdx +++ b/apps/docs/content/guides/platform/compute-add-ons.mdx @@ -62,7 +62,7 @@ SSD Disks are attached to your servers and the disk performance depends on the c ### Bursting and disk IO budget -Smaller compute instances can burst up to their largest throughput and IOPS for 30 minutes in a day. Beyond that, the performance reverts to the baseline. For example, the free tier can burst up to 2,085 Mbps for 30 minutes a day and reverts to the baseline performance of 87 Mbps. Your disk IO budget gets replenished throughout the day. +Smaller compute instances can burst up to their largest throughput and IOPS for 30 minutes in a day. Beyond that, the performance reverts to the baseline. For example, the Micro plan can burst up to 2,085 Mbps for 30 minutes a day and reverts to the baseline performance of 87 Mbps. Your disk IO budget gets replenished throughout the day. If you need consistent disk performance, choose the 4XL or larger compute add-on which has the same baseline and maximum disk throughput and IOPS. diff --git a/apps/docs/content/guides/platform/org-based-billing.mdx b/apps/docs/content/guides/platform/org-based-billing.mdx index b6caf671fa3..fd036a364a4 100644 --- a/apps/docs/content/guides/platform/org-based-billing.mdx +++ b/apps/docs/content/guides/platform/org-based-billing.mdx @@ -78,7 +78,7 @@ We only count compute hours for instances that are active. Paused projects do no ### Free plan -Supabase provides two "Free organizations". Each organization can run a `Micro` instance for free. This is a great way to get started with Supabase and try out the platform. +Supabase provides two "Free organizations". Each organization can run a `Nano` instance for free. This is a great way to get started with Supabase and try out the platform. ### Compute credits diff --git a/apps/docs/content/guides/platform/performance.mdx b/apps/docs/content/guides/platform/performance.mdx index 47562326a5c..ff9846a0f60 100644 --- a/apps/docs/content/guides/platform/performance.mdx +++ b/apps/docs/content/guides/platform/performance.mdx @@ -179,7 +179,8 @@ By default, the number of connections allowed to Postgres and Supavisor is confi | Compute Add-on | Postgresql connections | Supavisor connections | | -------------- | ---------------------- | --------------------- | -| None | 60 | 200 | +| - (Free plan) | 30 | 200 | +| Micro | 60 | 200 | | Small | 90 | 200 | | Medium | 120 | 200 | | Large | 160 | 300 | From f3708451a6a0aa5462aad398023ead20b486a596 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Wed, 20 Mar 2024 13:41:47 +0700 Subject: [PATCH 162/163] Fix consistency for RLS in table editor (#22119) fix consistency for RLS in table editor --- .../TableGridEditor/GridHeaderActions.tsx | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx b/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx index c7bbabce030..363bd9a890e 100644 --- a/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx @@ -18,6 +18,7 @@ import { useDatabasePublicationUpdateMutation } from 'data/database-publications import { useTableUpdateMutation } from 'data/tables/table-update-mutation' import { useCheckPermissions, useIsFeatureEnabled } from 'hooks' import { RoleImpersonationPopover } from '../RoleImpersonationSelector' +import { EXCLUDED_SCHEMAS } from 'lib/constants/schemas' export interface GridHeaderActionsProps { table: PostgresTable @@ -30,6 +31,7 @@ const GridHeaderActions = ({ table, isViewSelected, isTableSelected }: GridHeade const { ref } = useParams() const { project } = useProjectContext() const realtimeEnabled = useIsFeatureEnabled('realtime:all') + const isLocked = EXCLUDED_SCHEMAS.includes(table.schema) const { mutate: updateTable } = useTableUpdateMutation({ onError: (error) => { @@ -149,7 +151,7 @@ const GridHeaderActions = ({ table, isViewSelected, isTableSelected }: GridHeade {isTableSelected ? ( table.rls_enabled ? ( <> - {policies.length < 1 ? ( + {policies.length < 1 && !isLocked ? ( -
    + {!isLocked && ( +
    + +
    + )}
    From 67210c20c18670dead39276c4f624517d1480f5e Mon Sep 17 00:00:00 2001 From: Ryan McCahan Date: Tue, 19 Mar 2024 21:19:12 -1000 Subject: [PATCH 163/163] Docs: Twilio Phone Login Doc Typos (#22128) Typo edits --- apps/docs/content/guides/auth/phone-login/twilio.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/docs/content/guides/auth/phone-login/twilio.mdx b/apps/docs/content/guides/auth/phone-login/twilio.mdx index 86bbd8bae8b..179002d8ae4 100644 --- a/apps/docs/content/guides/auth/phone-login/twilio.mdx +++ b/apps/docs/content/guides/auth/phone-login/twilio.mdx @@ -11,7 +11,7 @@ Authenticating users via SMS can become expensive. Adjust your project's rate li -## Preqrequisites +## Prerequisites You'll need: @@ -32,7 +32,7 @@ To set up Twilio Verify, you will need to: When using Twilio Verify, OTPs are generated by Twilio. This means that: - Unlike other providers, the OTP expiry duration and message content fields are not configurable via the Supabase dashboard. Please head to Twilio Verify to configure these settings. -- The token remains the same during its validity period until the verification is successful. This means if your user make another request within that period, they will receive the same token. +- The token remains the same during its validity period until the verification is successful. This means if your user makes another request within that period, they will receive the same token. - Twilio Verify has a separate set of rate limits that apply. Visit Twilio's [Rate Limit and Timeouts page](https://www.twilio.com/docs/verify/api/rate-limits-and-timeouts) to find out more.