Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix finding github connection if there are multiple integrations

Joshen Lim21443fba657d
diff --git a/studio/components/interfaces/BranchManagement/BranchManagement.tsx b/studio/components/interfaces/BranchManagement/BranchManagement.tsx
index e7c892dd3d6..2c7cfe58bb8 100644
--- a/studio/components/interfaces/BranchManagement/BranchManagement.tsx
+++ b/studio/components/interfaces/BranchManagement/BranchManagement.tsx
@@ -43,7 +43,7 @@ const BranchManagement = () => {
const isBranchingAllowed = true
const isBranch = projectDetails?.parent_project_ref !== undefined
- const hasBranchEnabled = projectDetails?.has_branch_enabled
+ const hasBranchEnabled = projectDetails?.is_branch_enabled
const projectRef =
projectDetails !== undefined ? (isBranch ? projectDetails.parent_project_ref : ref) : undefined
@@ -55,12 +55,10 @@ const BranchManagement = () => {
const { data: integrations, isLoading: isLoadingIntegrations } = useOrgIntegrationsQuery({
orgSlug: selectedOrg?.slug,
})
- const githubIntegration = integrations?.find(
- (integration) =>
- integration.integration.name === 'GitHub' &&
- integration.organization.slug === selectedOrg?.slug
- )
- const githubConnection = githubIntegration?.connections.find(
+ const githubConnections = integrations
+ ?.filter((integration) => integration.integration.name === 'GitHub')
+ .flatMap((integration) => integration.connections)
+ const githubConnection = githubConnections?.find(
(connection) => connection.supabase_project_ref === ref
)
diff --git a/studio/components/interfaces/BranchManagement/CreateBranchSidePanel.tsx b/studio/components/interfaces/BranchManagement/CreateBranchSidePanel.tsx
index 057b95a2600..7cc6ada19ac 100644
--- a/studio/components/interfaces/BranchManagement/CreateBranchSidePanel.tsx
+++ b/studio/components/interfaces/BranchManagement/CreateBranchSidePanel.tsx
@@ -61,13 +61,13 @@ const CreateBranchSidePanel = ({ visible, onClose }: CreateBranchSidePanelProps)
const githubIntegration = integrations?.find(
(integration) =>
integration.integration.name === 'GitHub' &&
- integration.organization.slug === selectedOrg?.slug
+ integration.connections.some((connection) => connection.supabase_project_ref === ref)
)
- const repositoryMeta = githubIntegration?.connections?.find(
+ const githubConnection = githubIntegration?.connections?.find(
(connection) => connection.supabase_project_ref === ref
)
- const [repoOwner, repoName] = repositoryMeta?.metadata.name.split('/') || []
+ const [repoOwner, repoName] = githubConnection?.metadata.name.split('/') || []
const {
data: githubBranches,
error: githubBranchesError,
@@ -115,7 +115,7 @@ const CreateBranchSidePanel = ({ visible, onClose }: CreateBranchSidePanelProps)
Your project is currently connected to the repository:
</p>
<div className="flex items-center space-x-2">
- <p>{repositoryMeta?.metadata.name}</p>
+ <p>{githubConnection?.metadata.name}</p>
<Link passHref href={`https://github.com/${repoOwner}/${repoName}`}>
<a target="_blank" rel="noreferrer">
<IconExternalLink size={14} strokeWidth={1.5} />
diff --git a/studio/components/layouts/AppLayout/AppHeader.tsx b/studio/components/layouts/AppLayout/AppHeader.tsx
index b0c582465fb..dfa8b1950f1 100644
--- a/studio/components/layouts/AppLayout/AppHeader.tsx
+++ b/studio/components/layouts/AppLayout/AppHeader.tsx
@@ -22,7 +22,7 @@ const AppHeader = () => {
const isBranchingAllowed = project?.cloud_provider === 'FLY'
const isBranchingEnabled =
- project?.has_branch_enabled === true || project?.parent_project_ref !== undefined
+ project?.is_branch_enabled === true || project?.parent_project_ref !== undefined
return (
<div className="flex items-center justify-between px-4 py-1 bg-scale-200 border-b">
diff --git a/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx b/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
index f86e96b19b1..3b5cc536aa6 100644
--- a/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
+++ b/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
@@ -49,7 +49,7 @@ const EnableBranchingButton = () => {
const githubIntegration = integrations?.find(
(integration) =>
integration.integration.name === 'GitHub' &&
- integration.organization.slug === selectedOrg?.slug
+ integration.connections.some((connection) => connection.supabase_project_ref === ref)
)
// [Joshen] Leaving this out first as not clear yet branching x vercel implementation
diff --git a/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx b/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
index ac7f4060509..31ff143f088 100644
--- a/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
+++ b/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
@@ -47,10 +47,10 @@ const GithubRepositorySelection = ({
const [open, setOpen] = useState(false)
const comboBoxRef = useRef<HTMLButtonElement>(null)
- const githubProjectIntegration = integration?.connections.find(
+ const githubConnection = integration?.connections.find(
(connection) => connection.supabase_project_ref === ref
)
- const [repoOwner, repoName] = githubProjectIntegration?.metadata.name.split('/') ?? []
+ const [repoOwner, repoName] = githubConnection?.metadata.name.split('/') ?? []
const {
data: githubBranches,
@@ -75,7 +75,7 @@ const GithubRepositorySelection = ({
<Badge color="amber">Required</Badge>
</div>
<p className="text-sm text-light !mb-4">
- {githubProjectIntegration !== undefined
+ {githubConnection !== undefined
? 'Your database preview branches will be based on the branches in the following repository that your project is connected with:'
: 'Your database preview branches will be based on the branches in the Git repository that your project is connected with.'}
</p>
@@ -88,15 +88,15 @@ const GithubRepositorySelection = ({
</a>
</Link>
)}
- {integration && !githubProjectIntegration && (
+ {integration && !githubConnection && (
<EmptyIntegrationConnection showNode={false} onClick={() => onSelectConnectRepo()} />
)}
- {integration && githubProjectIntegration && (
+ {integration && githubConnection && (
<>
<ul className="mb-3">
<IntegrationConnection
type={'GitHub'}
- connection={githubProjectIntegration}
+ connection={githubConnection}
showNode={false}
actions={
<Button type="default" onClick={() => onSelectConnectRepo()}>
diff --git a/studio/data/api.d.ts b/studio/data/api.d.ts
index 1fce7b8a7a6..1e14ad03105 100644
--- a/studio/data/api.d.ts
+++ b/studio/data/api.d.ts
@@ -42,6 +42,13 @@ export interface paths {
/** Get infrastructure status */
get: operations["StatusController_getStatus"];
};
+ "/platform/projects-resource-warnings": {
+ /**
+ * Gets resource warnings for all projects accessible by the user
+ * @description Only returns the minimal project info
+ */
+ get: operations["ProjectsResourceWarningsController_getProjectsResourceWarnings"];
+ };
"/platform/auth/{ref}/config": {
/** Gets GoTrue config */
get: operations["GoTrueConfigController_getGoTrueConfig"];
@@ -99,7 +106,7 @@ export interface paths {
get: operations["HooksController_getHookLogs"];
};
"/platform/database/{ref}/hook-enable": {
- /** Enables hooks on the project */
+ /** Enables Database Webhooks on the project */
post: operations["HooksController_enableHooks"];
};
"/platform/database/{ref}/owner-reassign": {
@@ -713,6 +720,8 @@ export interface paths {
"/platform/integrations/vercel/connections/{connection_id}": {
/** Deletes vercel project connection */
delete: operations["VercelConnectionsController_deleteVercelConnection"];
+ /** Updates a Vercel connection for a supabase project */
+ patch: operations["VercelConnectionsController_updateVercelConnection"];
};
"/platform/integrations/github": {
/** Create github integration */
@@ -729,6 +738,8 @@ export interface paths {
"/platform/integrations/github/connections/{connection_id}": {
/** Deletes github project connection */
delete: operations["GitHubConnectionsController_deleteGitHubConnection"];
+ /** Updates a GitHub connection for a supabase project */
+ patch: operations["GitHubConnectionsController_updateGitHubConnection"];
};
"/platform/integrations/github/repos/{organization_integration_id}": {
/** Gets github repos for the given organization */
@@ -738,6 +749,10 @@ export interface paths {
/** Gets github branches for a given repo */
get: operations["GitHubBranchController_getBranches"];
};
+ "/platform/integrations/github/pull-requests/{organization_integration_id}/{repo_owner}/{repo_name}/{target}": {
+ /** Gets github pull requests for a given repo */
+ get: operations["GitHubPullRequestController_getPullRequests"];
+ };
"/system/auth/{ref}/templates/{template}": {
/** Gets GoTrue template */
get: operations["AuthTemplateController_getTemplate"];
@@ -814,6 +829,10 @@ export interface paths {
/** Previews the migration of the organization to the new org level billing. */
post: operations["BillingMigrationController_preview"];
};
+ "/system/projects/{ref}/config/update-jwt/complete": {
+ /** Handle update project jwt on completion */
+ post: operations["ProjectUpdateJwtController_completeUpdateJwt"];
+ };
"/system/integrations/vercel/webhooks": {
/** Processes Vercel event */
post: operations["VercelWebhooksController_processEvent"];
@@ -899,7 +918,7 @@ export interface paths {
get: operations["HooksController_getHookLogs"];
};
"/v0/database/{ref}/hook-enable": {
- /** Enables hooks on the project */
+ /** Enables Database Webhooks on the project */
post: operations["HooksController_enableHooks"];
};
"/v0/organizations": {
@@ -1371,10 +1390,6 @@ export interface paths {
/** Updates project's postgrest config */
patch: operations["PostgrestConfigController_updatePostgRESTConfig"];
};
- "/v1/projects/{ref}/database/query": {
- /** Run sql query */
- post: operations["QueryController_runQuery"];
- };
"/v1/projects/{ref}/secrets": {
/**
* List all secrets
@@ -1457,6 +1472,28 @@ export interface paths {
/** Updates a project's auth config */
patch: operations["V1AuthConfigController_updateV1AuthConfig"];
};
+ "/v1/projects/{ref}/config/auth/sso/providers": {
+ /** Lists all SSO providers */
+ get: operations["ProvidersController_listAllProviders"];
+ /** Creates a new SSO provider */
+ post: operations["ProvidersController_createProviderForProject"];
+ };
+ "/v1/projects/{ref}/config/auth/sso/providers/{provider_id}": {
+ /** Gets a SSO provider by its UUID */
+ get: operations["ProvidersController_getProviderById"];
+ /** Updates a SSO provider by its UUID */
+ put: operations["ProvidersController_updateProviderById"];
+ /** Removes a SSO provider by its UUID */
+ delete: operations["ProvidersController_removeProviderById"];
+ };
+ "/v1/projects/{ref}/database/query": {
+ /** Run sql query */
+ post: operations["V1QueryController_v1RunQuery"];
+ };
+ "/v1/projects/{ref}/database/webhooks/enable": {
+ /** Enables Database Webhooks on the project */
+ post: operations["V1DatabaseWebhooksController_v1EnableDatabaseWebhooks"];
+ };
"/v1/projects/{ref}/functions": {
/**
* List all functions
@@ -1493,20 +1530,6 @@ export interface paths {
*/
get: operations["FunctionSlugController_getFunctionBody"];
};
- "/v1/projects/{ref}/config/auth/sso/providers": {
- /** Lists all SSO providers */
- get: operations["ProvidersController_listAllProviders"];
- /** Creates a new SSO provider */
- post: operations["ProvidersController_createProviderForProject"];
- };
- "/v1/projects/{ref}/config/auth/sso/providers/{provider_id}": {
- /** Gets a SSO provider by its UUID */
- get: operations["ProvidersController_getProviderById"];
- /** Updates a SSO provider by its UUID */
- put: operations["ProvidersController_updateProviderById"];
- /** Removes a SSO provider by its UUID */
- delete: operations["ProvidersController_removeProviderById"];
- };
"/v1/organizations": {
/**
* List all organizations
@@ -1612,6 +1635,14 @@ export interface components {
password: string;
redirectTo?: string;
};
+ ProjectResourceWarningsResponse: {
+ project: string;
+ is_readonly_mode_enabled: boolean;
+ is_disk_io_budget_below_threshold: boolean;
+ is_disk_space_usage_beyond_threshold: boolean;
+ is_cpu_load_beyond_threshold: boolean;
+ is_memory_and_swap_usage_beyond_threshold: boolean;
+ };
GetGoTrueConfigResponse: {
SITE_URL: string;
DISABLE_SIGNUP: boolean;
@@ -2227,7 +2258,7 @@ export interface components {
unlimited: boolean;
capped: boolean;
/** @enum {string} */
- metric: "EGRESS" | "DATABASE_EGRESS" | "DATABASE_SIZE" | "STORAGE_EGRESS" | "STORAGE_SIZE" | "MONTHLY_ACTIVE_USERS" | "MONTHLY_ACTIVE_SSO_USERS" | "FUNCTION_INVOCATIONS" | "FUNCTION_COUNT" | "STORAGE_IMAGES_TRANSFORMED" | "REALTIME_MESSAGE_COUNT" | "REALTIME_PEAK_CONNECTIONS" | "COMPUTE_HOURS_XS" | "COMPUTE_HOURS_SM" | "COMPUTE_HOURS_MD" | "COMPUTE_HOURS_L" | "COMPUTE_HOURS_XL" | "COMPUTE_HOURS_2XL" | "COMPUTE_HOURS_4XL" | "COMPUTE_HOURS_8XL" | "COMPUTE_HOURS_12XL" | "COMPUTE_HOURS_16XL";
+ metric: "EGRESS" | "DATABASE_EGRESS" | "DATABASE_SIZE" | "STORAGE_EGRESS" | "STORAGE_SIZE" | "MONTHLY_ACTIVE_USERS" | "MONTHLY_ACTIVE_SSO_USERS" | "FUNCTION_INVOCATIONS" | "FUNCTION_COUNT" | "STORAGE_IMAGES_TRANSFORMED" | "REALTIME_MESSAGE_COUNT" | "REALTIME_PEAK_CONNECTIONS" | "COMPUTE_HOURS_BRANCH" | "COMPUTE_HOURS_XS" | "COMPUTE_HOURS_SM" | "COMPUTE_HOURS_MD" | "COMPUTE_HOURS_L" | "COMPUTE_HOURS_XL" | "COMPUTE_HOURS_2XL" | "COMPUTE_HOURS_4XL" | "COMPUTE_HOURS_8XL" | "COMPUTE_HOURS_12XL" | "COMPUTE_HOURS_16XL";
/** @enum {string} */
pricing_strategy: "UNIT" | "PACKAGE" | "NONE";
pricing_free_units?: number;
@@ -2473,7 +2504,7 @@ export interface components {
};
BillingUsageBasedPrice: {
/** @enum {string} */
- metric: "EGRESS" | "DATABASE_EGRESS" | "DATABASE_SIZE" | "STORAGE_EGRESS" | "STORAGE_SIZE" | "MONTHLY_ACTIVE_USERS" | "MONTHLY_ACTIVE_SSO_USERS" | "FUNCTION_INVOCATIONS" | "FUNCTION_COUNT" | "STORAGE_IMAGES_TRANSFORMED" | "REALTIME_MESSAGE_COUNT" | "REALTIME_PEAK_CONNECTIONS" | "COMPUTE_HOURS_XS" | "COMPUTE_HOURS_SM" | "COMPUTE_HOURS_MD" | "COMPUTE_HOURS_L" | "COMPUTE_HOURS_XL" | "COMPUTE_HOURS_2XL" | "COMPUTE_HOURS_4XL" | "COMPUTE_HOURS_8XL" | "COMPUTE_HOURS_12XL" | "COMPUTE_HOURS_16XL";
+ metric: "EGRESS" | "DATABASE_EGRESS" | "DATABASE_SIZE" | "STORAGE_EGRESS" | "STORAGE_SIZE" | "MONTHLY_ACTIVE_USERS" | "MONTHLY_ACTIVE_SSO_USERS" | "FUNCTION_INVOCATIONS" | "FUNCTION_COUNT" | "STORAGE_IMAGES_TRANSFORMED" | "REALTIME_MESSAGE_COUNT" | "REALTIME_PEAK_CONNECTIONS" | "COMPUTE_HOURS_BRANCH" | "COMPUTE_HOURS_XS" | "COMPUTE_HOURS_SM" | "COMPUTE_HOURS_MD" | "COMPUTE_HOURS_L" | "COMPUTE_HOURS_XL" | "COMPUTE_HOURS_2XL" | "COMPUTE_HOURS_4XL" | "COMPUTE_HOURS_8XL" | "COMPUTE_HOURS_12XL" | "COMPUTE_HOURS_16XL";
/** @enum {string} */
pricingStrategy: "UNIT" | "PACKAGE" | "NONE";
pricingOptions: components["schemas"]["BillingPricingOptionsUnit"] | components["schemas"]["BillingPricingOptionsPackage"] | components["schemas"]["BillingPricingOptionsNone"];
@@ -2968,7 +2999,7 @@ export interface components {
status: string;
subscription_id: string;
is_readonly_mode_enabled?: boolean;
- is_branch_enabled?: boolean;
+ is_branch_enabled: boolean;
preview_branch_refs: (string)[];
};
AmiSearchOptions: {
@@ -3009,7 +3040,7 @@ export interface components {
status: string;
subscription_id: string;
is_readonly_mode_enabled?: boolean;
- is_branch_enabled?: boolean;
+ is_branch_enabled: boolean;
preview_branch_refs: (string)[];
endpoint: string;
anon_key: string;
@@ -3096,16 +3127,6 @@ export interface components {
postgrest: string;
"supabase-postgres": string;
};
- BranchResponse: {
- id: string;
- name: string;
- project_ref: string;
- parent_project_ref: string;
- is_default: boolean;
- git_branch: string;
- created_at: string;
- updated_at: string;
- };
ProjectDetailResponse: {
cloud_provider: string;
db_host: string;
@@ -3126,9 +3147,8 @@ export interface components {
volumeSizeGb?: number;
maxDatabasePreprovisionGb?: number;
lastDatabaseResizeAt?: string;
- preview_branches: (components["schemas"]["BranchResponse"])[];
+ is_branch_enabled: boolean;
parent_project_ref?: string;
- has_branch_enabled?: boolean;
};
ProjectRefResponse: {
id: number;
@@ -3824,6 +3844,9 @@ export interface components {
CreateVercelConnectionResponse: {
id: string;
};
+ UpdateVercelConnectionsBody: {
+ metadata: Record<string, never>;
+ };
DeleteVercelConnectionResponse: {
id: string;
};
@@ -3848,6 +3871,9 @@ export interface components {
organization_integration_id: string;
connection: components["schemas"]["IntegrationConnection"];
};
+ UpdateGitHubConnectionsBody: {
+ metadata: Record<string, never>;
+ };
GetGithubRepo: {
id: number;
full_name: string;
@@ -3855,6 +3881,14 @@ export interface components {
GetGithubBranch: {
name: string;
};
+ GetGithubPullRequest: {
+ id: number;
+ url: string;
+ title: string;
+ branch: string;
+ created_at: string;
+ created_by?: string;
+ };
FunctionResponse: {
id: string;
slug: string;
@@ -3945,6 +3979,16 @@ export interface components {
branch_name?: string;
git_branch?: string;
};
+ BranchResponse: {
+ id: string;
+ name: string;
+ project_ref: string;
+ parent_project_ref: string;
+ is_default: boolean;
+ git_branch: string;
+ created_at: string;
+ updated_at: string;
+ };
DatabaseResponse: {
/** @description Database host */
host: string;
@@ -4078,20 +4122,6 @@ export interface components {
smtp_sender_name?: string;
rate_limit_email_sent?: number;
};
- FunctionSlugResponse: {
- id: string;
- slug: string;
- name: string;
- /** @enum {string} */
- status: "ACTIVE" | "REMOVED" | "THROTTLED";
- version: number;
- created_at: number;
- updated_at: number;
- verify_jwt?: boolean;
- import_map?: boolean;
- entrypoint_path?: string;
- import_map_path?: string;
- };
AttributeValue: {
default?: Record<string, never> | number | string | boolean;
name?: string;
@@ -4170,6 +4200,20 @@ export interface components {
created_at?: string;
updated_at?: string;
};
+ FunctionSlugResponse: {
+ id: string;
+ slug: string;
+ name: string;
+ /** @enum {string} */
+ status: "ACTIVE" | "REMOVED" | "THROTTLED";
+ version: number;
+ created_at: number;
+ updated_at: number;
+ verify_jwt?: boolean;
+ import_map?: boolean;
+ entrypoint_path?: string;
+ import_map_path?: string;
+ };
OAuthAppResponse: {
id: string;
name: string;
@@ -4395,6 +4439,19 @@ export interface operations {
500: never;
};
};
+ /**
+ * Gets resource warnings for all projects accessible by the user
+ * @description Only returns the minimal project info
+ */
+ ProjectsResourceWarningsController_getProjectsResourceWarnings: {
+ responses: {
+ 200: {
+ content: {
+ "application/json": (components["schemas"]["ProjectResourceWarningsResponse"])[];
+ };
+ };
+ };
+ };
/** Gets GoTrue config */
GoTrueConfigController_getGoTrueConfig: {
parameters: {
@@ -4733,25 +4790,18 @@ export interface operations {
500: never;
};
};
- /** Enables hooks on the project */
+ /** Enables Database Webhooks on the project */
HooksController_enableHooks: {
parameters: {
- header: {
- "x-connection-encrypted": string;
- };
path: {
/** @description Project ref */
ref: string;
};
};
responses: {
- 201: {
- content: {
- "application/json": Record<string, never>;
- };
- };
+ 201: never;
403: never;
- /** @description Failed to enable hooks on the project */
+ /** @description Failed to enable Database Webhooks on the project */
500: never;
};
};
@@ -5048,7 +5098,7 @@ export interface operations {
OrgDailyStatsController_getDailyStats: {
parameters: {
query: {
- metric: "EGRESS" | "DATABASE_EGRESS" | "DATABASE_SIZE" | "STORAGE_EGRESS" | "STORAGE_SIZE" | "MONTHLY_ACTIVE_USERS" | "MONTHLY_ACTIVE_SSO_USERS" | "FUNCTION_INVOCATIONS" | "FUNCTION_COUNT" | "STORAGE_IMAGES_TRANSFORMED" | "REALTIME_MESSAGE_COUNT" | "REALTIME_PEAK_CONNECTIONS" | "COMPUTE_HOURS_XS" | "COMPUTE_HOURS_SM" | "COMPUTE_HOURS_MD" | "COMPUTE_HOURS_L" | "COMPUTE_HOURS_XL" | "COMPUTE_HOURS_2XL" | "COMPUTE_HOURS_4XL" | "COMPUTE_HOURS_8XL" | "COMPUTE_HOURS_12XL" | "COMPUTE_HOURS_16XL";
+ metric: "EGRESS" | "DATABASE_EGRESS" | "DATABASE_SIZE" | "STORAGE_EGRESS" | "STORAGE_SIZE" | "MONTHLY_ACTIVE_USERS" | "MONTHLY_ACTIVE_SSO_USERS" | "FUNCTION_INVOCATIONS" | "FUNCTION_COUNT" | "STORAGE_IMAGES_TRANSFORMED" | "REALTIME_MESSAGE_COUNT" | "REALTIME_PEAK_CONNECTIONS" | "COMPUTE_HOURS_BRANCH" | "COMPUTE_HOURS_XS" | "COMPUTE_HOURS_SM" | "COMPUTE_HOURS_MD" | "COMPUTE_HOURS_L" | "COMPUTE_HOURS_XL" | "COMPUTE_HOURS_2XL" | "COMPUTE_HOURS_4XL" | "COMPUTE_HOURS_8XL" | "COMPUTE_HOURS_12XL" | "COMPUTE_HOURS_16XL";
interval: string;
endDate: string;
startDate: string;
@@ -6027,6 +6077,9 @@ export interface operations {
/** Run sql query */
QueryController_runQuery: {
parameters: {
+ header: {
+ "x-connection-encrypted": string;
+ };
path: {
/** @description Project ref */
ref: string;
@@ -8439,6 +8492,24 @@ export interface operations {
500: never;
};
};
+ /** Updates a Vercel connection for a supabase project */
+ VercelConnectionsController_updateVercelConnection: {
+ parameters: {
+ path: {
+ connection_id: string;
+ };
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["UpdateVercelConnectionsBody"];
+ };
+ };
+ responses: {
+ 200: never;
+ /** @description Failed to update Vercel connection */
+ 500: never;
+ };
+ };
/** Create github integration */
GitHubIntegrationController_createGitHubIntegration: {
requestBody: {
@@ -8499,6 +8570,24 @@ export interface operations {
500: never;
};
};
+ /** Updates a GitHub connection for a supabase project */
+ GitHubConnectionsController_updateGitHubConnection: {
+ parameters: {
+ path: {
+ connection_id: string;
+ };
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["UpdateGitHubConnectionsBody"];
+ };
+ };
+ responses: {
+ 200: never;
+ /** @description Failed to update GitHub connection */
+ 500: never;
+ };
+ };
/** Gets github repos for the given organization */
GitHubRepoController_getRepos: {
parameters: {
@@ -8535,6 +8624,26 @@ export interface operations {
500: never;
};
};
+ /** Gets github pull requests for a given repo */
+ GitHubPullRequestController_getPullRequests: {
+ parameters: {
+ path: {
+ organization_integration_id: string;
+ repo_owner: string;
+ repo_name: string;
+ target: string;
+ };
+ };
+ responses: {
+ 200: {
+ content: {
+ "application/json": (components["schemas"]["GetGithubPullRequest"])[];
+ };
+ };
+ /** @description Failed to get github pull requests for a given repo */
+ 500: never;
+ };
+ };
/** Gets GoTrue template */
AuthTemplateController_getTemplate: {
parameters: {
@@ -8878,6 +8987,18 @@ export interface operations {
500: never;
};
};
+ /** Handle update project jwt on completion */
+ ProjectUpdateJwtController_completeUpdateJwt: {
+ parameters: {
+ path: {
+ /** @description Project ref */
+ ref: string;
+ };
+ };
+ responses: {
+ 201: never;
+ };
+ };
/** Processes Vercel event */
VercelWebhooksController_processEvent: {
parameters: {
@@ -9755,129 +9876,116 @@ export interface operations {
500: never;
};
};
- /**
- * Retrieve a function
- * @description Retrieves a function with the specified slug and project.
- */
- FunctionSlugController_getFunction: {
+ /** Lists all SSO providers */
+ ProvidersController_listAllProviders: {
parameters: {
path: {
/** @description Project ref */
ref: string;
- /** @description Function slug */
- function_slug: string;
};
};
responses: {
200: {
content: {
- "application/json": components["schemas"]["FunctionSlugResponse"];
+ "application/json": components["schemas"]["ListProvidersResponse"];
};
};
403: never;
- /** @description Failed to retrieve function with given slug */
- 500: never;
+ /** @description SAML 2.0 support is not enabled for this project */
+ 404: never;
};
};
- /**
- * Delete a function
- * @description Deletes a function with the specified slug from the specified project.
- */
- FunctionSlugController_deleteFunction: {
+ /** Creates a new SSO provider */
+ ProvidersController_createProviderForProject: {
parameters: {
path: {
/** @description Project ref */
ref: string;
- /** @description Function slug */
- function_slug: string;
+ };
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["CreateProviderBody"];
};
};
responses: {
- 200: never;
+ 201: {
+ content: {
+ "application/json": components["schemas"]["CreateProviderResponse"];
+ };
+ };
403: never;
- /** @description Failed to delete function with given slug */
- 500: never;
+ /** @description SAML 2.0 support is not enabled for this project */
+ 404: never;
};
};
- /**
- * Update a function
- * @description Updates a function with the specified slug and project.
- */
- FunctionSlugController_updateFunction: {
+ /** Gets a SSO provider by its UUID */
+ ProvidersController_getProviderById: {
parameters: {
- query?: {
- slug?: string;
- name?: string;
- verify_jwt?: boolean;
- import_map?: boolean;
- entrypoint_path?: string;
- import_map_path?: string;
- };
path: {
/** @description Project ref */
ref: string;
- /** @description Function slug */
- function_slug: string;
- };
- };
- requestBody: {
- content: {
- "application/json": components["schemas"]["UpdateFunctionBody"];
- "application/vnd.denoland.eszip": components["schemas"]["UpdateFunctionBody"];
+ provider_id: string;
};
};
responses: {
200: {
content: {
- "application/json": components["schemas"]["FunctionResponse"];
+ "application/json": components["schemas"]["GetProviderResponse"];
};
};
403: never;
- /** @description Failed to update function with given slug */
- 500: never;
+ /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */
+ 404: never;
};
};
- /**
- * Retrieve a function body
- * @description Retrieves a function body for the specified slug and project.
- */
- FunctionSlugController_getFunctionBody: {
+ /** Updates a SSO provider by its UUID */
+ ProvidersController_updateProviderById: {
parameters: {
path: {
/** @description Project ref */
ref: string;
- /** @description Function slug */
- function_slug: string;
+ provider_id: string;
+ };
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["UpdateProviderBody"];
};
};
responses: {
- 200: never;
+ 200: {
+ content: {
+ "application/json": components["schemas"]["UpdateProviderResponse"];
+ };
+ };
403: never;
- /** @description Failed to retrieve function body with given slug */
- 500: never;
+ /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */
+ 404: never;
};
};
- /** Lists all SSO providers */
- ProvidersController_listAllProviders: {
+ /** Removes a SSO provider by its UUID */
+ ProvidersController_removeProviderById: {
parameters: {
path: {
/** @description Project ref */
ref: string;
+ provider_id: string;
};
};
responses: {
200: {
content: {
- "application/json": components["schemas"]["ListProvidersResponse"];
+ "application/json": components["schemas"]["DeleteProviderResponse"];
};
};
403: never;
- /** @description SAML 2.0 support is not enabled for this project */
+ /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */
404: never;
};
};
- /** Creates a new SSO provider */
- ProvidersController_createProviderForProject: {
+ /** Run sql query */
+ V1QueryController_v1RunQuery: {
parameters: {
path: {
/** @description Project ref */
@@ -9886,83 +9994,135 @@ export interface operations {
};
requestBody: {
content: {
- "application/json": components["schemas"]["CreateProviderBody"];
+ "application/json": components["schemas"]["RunQueryBody"];
};
};
responses: {
201: {
content: {
- "application/json": components["schemas"]["CreateProviderResponse"];
+ "application/json": Record<string, never>;
};
};
403: never;
- /** @description SAML 2.0 support is not enabled for this project */
- 404: never;
+ /** @description Failed to run sql query */
+ 500: never;
};
};
- /** Gets a SSO provider by its UUID */
- ProvidersController_getProviderById: {
+ /** Enables Database Webhooks on the project */
+ V1DatabaseWebhooksController_v1EnableDatabaseWebhooks: {
parameters: {
path: {
/** @description Project ref */
ref: string;
- provider_id: string;
+ };
+ };
+ responses: {
+ 201: never;
+ 403: never;
+ /** @description Failed to enable Database Webhooks on the project */
+ 500: never;
+ };
+ };
+ /**
+ * Retrieve a function
+ * @description Retrieves a function with the specified slug and project.
+ */
+ FunctionSlugController_getFunction: {
+ parameters: {
+ path: {
+ /** @description Project ref */
+ ref: string;
+ /** @description Function slug */
+ function_slug: string;
};
};
responses: {
200: {
content: {
- "application/json": components["schemas"]["GetProviderResponse"];
+ "application/json": components["schemas"]["FunctionSlugResponse"];
};
};
403: never;
- /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */
- 404: never;
+ /** @description Failed to retrieve function with given slug */
+ 500: never;
};
};
- /** Updates a SSO provider by its UUID */
- ProvidersController_updateProviderById: {
+ /**
+ * Delete a function
+ * @description Deletes a function with the specified slug from the specified project.
+ */
+ FunctionSlugController_deleteFunction: {
parameters: {
path: {
/** @description Project ref */
ref: string;
- provider_id: string;
+ /** @description Function slug */
+ function_slug: string;
+ };
+ };
+ responses: {
+ 200: never;
+ 403: never;
+ /** @description Failed to delete function with given slug */
+ 500: never;
+ };
+ };
+ /**
+ * Update a function
+ * @description Updates a function with the specified slug and project.
+ */
+ FunctionSlugController_updateFunction: {
+ parameters: {
+ query?: {
+ slug?: string;
+ name?: string;
+ verify_jwt?: boolean;
+ import_map?: boolean;
+ entrypoint_path?: string;
+ import_map_path?: string;
+ };
+ path: {
+ /** @description Project ref */
+ ref: string;
+ /** @description Function slug */
+ function_slug: string;
};
};
requestBody: {
content: {
- "application/json": components["schemas"]["UpdateProviderBody"];
+ "application/json": components["schemas"]["UpdateFunctionBody"];
+ "application/vnd.denoland.eszip": components["schemas"]["UpdateFunctionBody"];
};
};
responses: {
200: {
content: {
- "application/json": components["schemas"]["UpdateProviderResponse"];
+ "application/json": components["schemas"]["FunctionResponse"];
};
};
403: never;
- /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */
- 404: never;
+ /** @description Failed to update function with given slug */
+ 500: never;
};
};
- /** Removes a SSO provider by its UUID */
- ProvidersController_removeProviderById: {
+ /**
+ * Retrieve a function body
+ * @description Retrieves a function body for the specified slug and project.
+ */
+ FunctionSlugController_getFunctionBody: {
parameters: {
path: {
/** @description Project ref */
ref: string;
- provider_id: string;
+ /** @description Function slug */
+ function_slug: string;
};
};
responses: {
- 200: {
- content: {
- "application/json": components["schemas"]["DeleteProviderResponse"];
- };
- };
+ 200: never;
403: never;
- /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */
- 404: never;
+ /** @description Failed to retrieve function body with given slug */
+ 500: never;
};
};
/** Create an organization */
diff --git a/studio/pages/org/[slug]/index.tsx b/studio/pages/org/[slug]/index.tsx
index 75b39afef21..6e0a5e0ef6a 100644
--- a/studio/pages/org/[slug]/index.tsx
+++ b/studio/pages/org/[slug]/index.tsx
@@ -23,9 +23,9 @@ const ProjectsPage: NextPageWithLayout = () => {
const organization = useSelectedOrganization()
const projects = allProjects?.filter((project) => project.organization_id === organization?.id)
const { data: integrations } = useOrgIntegrationsQuery({ orgSlug: organization?.slug })
- const githubIntegrations = integrations?.find(
- (integration) => integration.integration.name === 'GitHub'
- )
+ const githubConnections = integrations
+ ?.filter((integration) => integration.integration.name === 'GitHub')
+ .flatMap((integration) => integration.connections)
return (
<ScaffoldContainer>
@@ -73,7 +73,7 @@ const ProjectsPage: NextPageWithLayout = () => {
<ProjectCard
key={project.ref}
project={project}
- githubIntegration={githubIntegrations?.connections.find(
+ githubIntegration={githubConnections?.find(
(connection) => connection.supabase_project_ref === project.ref
)}
/>
diff --git a/studio/types/base.ts b/studio/types/base.ts
index 93d9c2fe7c6..8c99c88ed41 100644
--- a/studio/types/base.ts
+++ b/studio/types/base.ts
@@ -34,7 +34,7 @@ export interface Project extends ProjectBase {
lastDatabaseResizeAt?: string | null
maxDatabasePreprovisionGb?: string | null
parent_project_ref?: string
- has_branch_enabled?: boolean
+ is_branch_enabled?: boolean
/**
* postgrestStatus is available on client side only.