Skip to content

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

Update

Joshen Lime33ad322b353
diff --git a/studio/data/api.d.ts b/studio/data/api.d.ts
index 835dda10d13..0ee3535b234 100644
--- a/studio/data/api.d.ts
+++ b/studio/data/api.d.ts
@@ -225,6 +225,14 @@ export interface paths {
/** Gets the upcoming invoice */
get: operations["OrgInvoicesController_getUpcomingInvoice"];
};
+ "/platform/pg-meta/{ref}/column-privileges": {
+ /** Retrieve column privileges */
+ get: operations["ColumnPrivilegesController_getColumnPrivileges"];
+ /** Grant column privileges */
+ post: operations["ColumnPrivilegesController_grantColumnPrivileges"];
+ /** Revoke column privileges */
+ delete: operations["ColumnPrivilegesController_revokeColumnPrivileges"];
+ };
"/platform/pg-meta/{ref}/columns": {
/** Gets project pg.columns */
get: operations["ColumnsController_getColumns"];
@@ -321,6 +329,14 @@ export interface paths {
/** Searches project pg.columns. Return maximum 50 results. */
post: operations["SearchController_searchColumns"];
};
+ "/platform/pg-meta/{ref}/table-privileges": {
+ /** Retrieve table privileges */
+ get: operations["TablePrivilegesController_getTablePrivileges"];
+ /** Grant table privileges */
+ post: operations["TablePrivilegesController_grantTablePrivileges"];
+ /** Revoke table privileges */
+ delete: operations["TablePrivilegesController_revokeTablePrivileges"];
+ };
"/platform/pg-meta/{ref}/tables": {
/** Gets project pg.tables or pg.table with the given ID */
get: operations["TablesController_getTables"];
@@ -961,6 +977,14 @@ export interface paths {
/** Updates organization member */
patch: operations["MembersController_updateMember"];
};
+ "/v0/pg-meta/{ref}/column-privileges": {
+ /** Retrieve column privileges */
+ get: operations["ColumnPrivilegesController_getColumnPrivileges"];
+ /** Grant column privileges */
+ post: operations["ColumnPrivilegesController_grantColumnPrivileges"];
+ /** Revoke column privileges */
+ delete: operations["ColumnPrivilegesController_revokeColumnPrivileges"];
+ };
"/v0/pg-meta/{ref}/columns": {
/** Gets project pg.columns */
get: operations["ColumnsController_getColumns"];
@@ -1057,6 +1081,14 @@ export interface paths {
/** Searches project pg.columns. Return maximum 50 results. */
post: operations["SearchController_searchColumns"];
};
+ "/v0/pg-meta/{ref}/table-privileges": {
+ /** Retrieve table privileges */
+ get: operations["TablePrivilegesController_getTablePrivileges"];
+ /** Grant table privileges */
+ post: operations["TablePrivilegesController_grantTablePrivileges"];
+ /** Revoke table privileges */
+ delete: operations["TablePrivilegesController_revokeTablePrivileges"];
+ };
"/v0/pg-meta/{ref}/tables": {
/** Gets project pg.tables or pg.table with the given ID */
get: operations["TablesController_getTables"];
@@ -1539,22 +1571,6 @@ export interface paths {
/** Create an organization */
post: operations["OrganizationsController_createOrganization"];
};
- "/v1/organizations/{slug}/oauth/apps": {
- /** List published or authorized oauth apps */
- get: operations["OAuthAppsController_listOAuthApps"];
- /** Create an oauth app */
- post: operations["OAuthAppsController_createOAuthApp"];
- };
- "/v1/organizations/{slug}/oauth/apps/{id}": {
- /** Update an oauth app */
- put: operations["OAuthAppsController_updateOAuthApp"];
- /** Remove a published oauth app */
- delete: operations["OAuthAppsController_removeOAuthApp"];
- };
- "/v1/organizations/{slug}/oauth/apps/{id}/revoke": {
- /** Revoke an authorized oauth app */
- post: operations["OAuthAppsController_revokeAuthorizedOAuthApp"];
- };
"/v1/oauth/authorize": {
/** Authorize user through oauth */
get: operations["OAuthController_authorize"];
@@ -1563,13 +1579,6 @@ export interface paths {
/** Exchange auth code for user's access and refresh token */
post: operations["OAuthController_token"];
};
- "/v1/oauth/authorizations/{id}": {
- get: operations["AuthorizationsController_getAuthorizationRequest"];
- /** Approve oauth app authorization request */
- post: operations["AuthorizationsController_approveAuthorizationRequest"];
- /** Decline oauth app authorization request */
- delete: operations["AuthorizationsController_declineAuthorizationRequest"];
- };
}
export type webhooks = Record<string, never>;
@@ -2536,6 +2545,33 @@ export interface components {
/** @enum {string} */
tier: "tier_payg" | "tier_pro" | "tier_free" | "tier_team" | "tier_enterprise";
};
+ ColumnPrivilege: {
+ grantor: string;
+ grantee: string;
+ /** @enum {string} */
+ privilege_type: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "REFERENCES";
+ is_grantable: boolean;
+ };
+ PostgresColumnPrivileges: {
+ column_id: string;
+ relation_schema: string;
+ relation_name: string;
+ column_name: string;
+ privileges: (components["schemas"]["ColumnPrivilege"])[];
+ };
+ GrantColumnPrivilegesBody: {
+ is_grantable?: boolean;
+ column_id: string;
+ grantee: string;
+ /** @enum {string} */
+ privilege_type: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "REFERENCES";
+ };
+ RevokeColumnPrivilegesBody: {
+ column_id: string;
+ grantee: string;
+ /** @enum {string} */
+ privilege_type: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "REFERENCES";
+ };
PostgresColumn: {
table_id: number;
schema: string;
@@ -2796,6 +2832,32 @@ export interface components {
table_id: number;
table: string;
};
+ TablePrivilege: {
+ grantor: string;
+ grantee: string;
+ /** @enum {string} */
+ privilege_type: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "TRUNCATE" | "REFERENCES" | "TRIGGER";
+ is_grantable: boolean;
+ };
+ PostgresTablePrivileges: {
+ schema: string;
+ name: string;
+ kind: string;
+ privileges: (components["schemas"]["TablePrivilege"])[];
+ };
+ GrantTablePrivilegesBody: {
+ is_grantable?: boolean;
+ relation_id: number;
+ grantee: string;
+ /** @enum {string} */
+ privilege_type: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "TRUNCATE" | "REFERENCES" | "TRIGGER";
+ };
+ RevokeTablePrivilegesBody: {
+ relation_id: number;
+ grantee: string;
+ /** @enum {string} */
+ privilege_type: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "TRUNCATE" | "REFERENCES" | "TRIGGER";
+ };
PrimaryKey: {
schema: string;
table_name: string;
@@ -4214,55 +4276,6 @@ export interface components {
entrypoint_path?: string;
import_map_path?: string;
};
- OAuthAppResponse: {
- id: string;
- name: string;
- website: string;
- icon?: string;
- authorized_at?: string;
- created_at?: string;
- client_id?: string;
- client_secret_alias?: string;
- redirect_uris?: (string)[];
- };
- CreateOAuthAppBody: {
- name: string;
- website: string;
- icon?: string;
- redirect_uris: (string)[];
- };
- CreateOAuthAppResponse: {
- id: string;
- client_id: string;
- client_secret: string;
- };
- PutOAuthAppResponse: {
- id: string;
- client_id: string;
- client_secret_alias: string;
- created_at: string;
- name: string;
- website: string;
- icon?: string;
- redirect_uris: (string)[];
- };
- RevokeAuthorizedOAuthAppResponse: {
- id: string;
- name: string;
- website: string;
- icon?: string;
- authorized_at: string;
- };
- DeleteOAuthAppResponse: {
- id: string;
- name: string;
- website: string;
- icon?: string;
- created_at: string;
- client_id: string;
- client_secret_alias: string;
- redirect_uris: (string)[];
- };
OAuthTokenBody: {
/** @enum {string} */
grant_type: "authorization_code" | "refresh_token";
@@ -4280,24 +4293,6 @@ export interface components {
refresh_token: string;
expires_in: number;
};
- GetAuthorizationResponse: {
- name: string;
- website: string;
- icon?: string;
- domain: string;
- expires_at: string;
- approved_at?: string;
- approved_organization_slug?: string;
- };
- AuthorizationsApproveBody: {
- organization_id: string;
- };
- ApproveAuthorizationResponse: {
- url: string;
- };
- DeclineAuthorizationResponse: {
- id: string;
- };
};
responses: never;
parameters: never;
@@ -5499,6 +5494,82 @@ export interface operations {
500: never;
};
};
+ /** Retrieve column privileges */
+ ColumnPrivilegesController_getColumnPrivileges: {
+ parameters: {
+ header: {
+ "x-connection-encrypted": string;
+ };
+ path: {
+ /** @description Project ref */
+ ref: string;
+ };
+ };
+ responses: {
+ 200: {
+ content: {
+ "application/json": (components["schemas"]["PostgresColumnPrivileges"])[];
+ };
+ };
+ 403: never;
+ /** @description Failed to retrieve column privileges */
+ 500: never;
+ };
+ };
+ /** Grant column privileges */
+ ColumnPrivilegesController_grantColumnPrivileges: {
+ parameters: {
+ header: {
+ "x-connection-encrypted": string;
+ };
+ path: {
+ /** @description Project ref */
+ ref: string;
+ };
+ };
+ requestBody: {
+ content: {
+ "application/json": (components["schemas"]["GrantColumnPrivilegesBody"])[];
+ };
+ };
+ responses: {
+ 201: {
+ content: {
+ "application/json": (components["schemas"]["PostgresColumnPrivileges"])[];
+ };
+ };
+ 403: never;
+ /** @description Failed to grant column privileges */
+ 500: never;
+ };
+ };
+ /** Revoke column privileges */
+ ColumnPrivilegesController_revokeColumnPrivileges: {
+ parameters: {
+ header: {
+ "x-connection-encrypted": string;
+ };
+ path: {
+ /** @description Project ref */
+ ref: string;
+ };
+ };
+ requestBody: {
+ content: {
+ "application/json": (components["schemas"]["RevokeColumnPrivilegesBody"])[];
+ };
+ };
+ responses: {
+ 200: {
+ content: {
+ "application/json": (components["schemas"]["PostgresColumnPrivileges"])[];
+ };
+ };
+ 403: never;
+ /** @description Failed to revoke column privileges */
+ 500: never;
+ };
+ };
/** Gets project pg.columns */
ColumnsController_getColumns: {
parameters: {
@@ -6413,6 +6484,82 @@ export interface operations {
500: never;
};
};
+ /** Retrieve table privileges */
+ TablePrivilegesController_getTablePrivileges: {
+ parameters: {
+ header: {
+ "x-connection-encrypted": string;
+ };
+ path: {
+ /** @description Project ref */
+ ref: string;
+ };
+ };
+ responses: {
+ 200: {
+ content: {
+ "application/json": (components["schemas"]["PostgresTablePrivileges"])[];
+ };
+ };
+ 403: never;
+ /** @description Failed to retrieve table privileges */
+ 500: never;
+ };
+ };
+ /** Grant table privileges */
+ TablePrivilegesController_grantTablePrivileges: {
+ parameters: {
+ header: {
+ "x-connection-encrypted": string;
+ };
+ path: {
+ /** @description Project ref */
+ ref: string;
+ };
+ };
+ requestBody: {
+ content: {
+ "application/json": (components["schemas"]["GrantTablePrivilegesBody"])[];
+ };
+ };
+ responses: {
+ 201: {
+ content: {
+ "application/json": (components["schemas"]["PostgresTablePrivileges"])[];
+ };
+ };
+ 403: never;
+ /** @description Failed to grant table privileges */
+ 500: never;
+ };
+ };
+ /** Revoke table privileges */
+ TablePrivilegesController_revokeTablePrivileges: {
+ parameters: {
+ header: {
+ "x-connection-encrypted": string;
+ };
+ path: {
+ /** @description Project ref */
+ ref: string;
+ };
+ };
+ requestBody: {
+ content: {
+ "application/json": (components["schemas"]["RevokeTablePrivilegesBody"])[];
+ };
+ };
+ responses: {
+ 200: {
+ content: {
+ "application/json": (components["schemas"]["PostgresTablePrivileges"])[];
+ };
+ };
+ 403: never;
+ /** @description Failed to revoke table privileges */
+ 500: never;
+ };
+ };
/** Gets project pg.tables or pg.table with the given ID */
TablesController_getTables: {
parameters: {
@@ -8458,7 +8605,7 @@ export interface operations {
"application/json": components["schemas"]["CreateVercelConnectionResponse"];
};
};
- /** @description Failed to create project connections */
+ /** @description Failed to create project connection */
500: never;
};
};
@@ -10142,97 +10289,6 @@ export interface operations {
500: never;
};
};
- /** List published or authorized oauth apps */
- OAuthAppsController_listOAuthApps: {
- parameters: {
- query: {
- type: "published" | "authorized";
- };
- path: {
- slug: string;
- };
- };
- responses: {
- 200: {
- content: {
- "application/json": (components["schemas"]["OAuthAppResponse"])[];
- };
- };
- };
- };
- /** Create an oauth app */
- OAuthAppsController_createOAuthApp: {
- parameters: {
- path: {
- slug: string;
- };
- };
- requestBody: {
- content: {
- "application/json": components["schemas"]["CreateOAuthAppBody"];
- };
- };
- responses: {
- 201: {
- content: {
- "application/json": components["schemas"]["CreateOAuthAppResponse"];
- };
- };
- };
- };
- /** Update an oauth app */
- OAuthAppsController_updateOAuthApp: {
- parameters: {
- path: {
- slug: string;
- id: string;
- };
- };
- requestBody: {
- content: {
- "application/json": components["schemas"]["CreateOAuthAppBody"];
- };
- };
- responses: {
- 200: {
- content: {
- "application/json": components["schemas"]["PutOAuthAppResponse"];
- };
- };
- };
- };
- /** Remove a published oauth app */
- OAuthAppsController_removeOAuthApp: {
- parameters: {
- path: {
- slug: string;
- id: string;
- };
- };
- responses: {
- 200: {
- content: {
- "application/json": components["schemas"]["DeleteOAuthAppResponse"];
- };
- };
- };
- };
- /** Revoke an authorized oauth app */
- OAuthAppsController_revokeAuthorizedOAuthApp: {
- parameters: {
- path: {
- slug: string;
- id: string;
- };
- };
- responses: {
- 201: {
- content: {
- "application/json": components["schemas"]["RevokeAuthorizedOAuthAppResponse"];
- };
- };
- };
- };
/** Authorize user through oauth */
OAuthController_authorize: {
parameters: {
@@ -10266,53 +10322,4 @@ export interface operations {
};
};
};
- AuthorizationsController_getAuthorizationRequest: {
- parameters: {
- path: {
- id: string;
- };
- };
- responses: {
- 200: {
- content: {
- "application/json": components["schemas"]["GetAuthorizationResponse"];
- };
- };
- };
- };
- /** Approve oauth app authorization request */
- AuthorizationsController_approveAuthorizationRequest: {
- parameters: {
- path: {
- id: string;
- };
- };
- requestBody: {
- content: {
- "application/json": components["schemas"]["AuthorizationsApproveBody"];
- };
- };
- responses: {
- 201: {
- content: {
- "application/json": components["schemas"]["ApproveAuthorizationResponse"];
- };
- };
- };
- };
- /** Decline oauth app authorization request */
- AuthorizationsController_declineAuthorizationRequest: {
- parameters: {
- path: {
- id: string;
- };
- };
- responses: {
- 200: {
- content: {
- "application/json": components["schemas"]["DeclineAuthorizationResponse"];
- };
- };
- };
- };
}
diff --git a/studio/data/invoices/invoices-query.ts b/studio/data/invoices/invoices-query.ts
index 1031d9650d9..1c63e92b39a 100644
--- a/studio/data/invoices/invoices-query.ts
+++ b/studio/data/invoices/invoices-query.ts
@@ -19,6 +19,7 @@ export async function getInvoices(
const { data, error } = await get(`/platform/stripe/invoices`, {
params: {
+ // @ts-ignore: [Joshen] Might be API spec wrong
query: { offset: offset.toString(), limit: limit.toString(), customer: customerId, slug },
},
signal,