Skip to content

Commit acfa755

Browse files
committed
refactor: rename storage bucket/config types
1 parent 9e48258 commit acfa755

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

packages/mcp-server-supabase/src/platform/api-platform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import {
2929
type ExecuteSqlOptions,
3030
type GetLogsOptions,
3131
type ResetBranchOptions,
32+
type StorageConfig,
3233
type SupabasePlatform,
33-
type StorageConfigUpdate,
3434
} from './index.js';
3535

3636
const { version } = packageJson;
@@ -637,7 +637,7 @@ export function createSupabaseApiPlatform(
637637
return response.data;
638638
},
639639

640-
async updateStorageConfig(projectId: string, config: StorageConfigUpdate) {
640+
async updateStorageConfig(projectId: string, config: StorageConfig) {
641641
const response = await managementApiClient.PATCH(
642642
'/v1/projects/{ref}/config/storage',
643643
{

packages/mcp-server-supabase/src/platform/types.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { InitData } from '@supabase/mcp-utils';
22
import { z } from 'zod';
33
import { AWS_REGION_CODES } from '../regions.js';
44

5-
export const v1StorageBucketResponseSchema = z.object({
5+
export const storageBucketSchema = z.object({
66
id: z.string(),
77
name: z.string(),
88
owner: z.string(),
@@ -11,7 +11,7 @@ export const v1StorageBucketResponseSchema = z.object({
1111
public: z.boolean(),
1212
});
1313

14-
export const storageConfigResponseSchema = z.object({
14+
export const storageConfigSchema = z.object({
1515
fileSizeLimit: z.number(),
1616
features: z.object({
1717
imageTransformation: z.object({ enabled: z.boolean() }),
@@ -152,11 +152,8 @@ export type GenerateTypescriptTypesResult = z.infer<
152152
typeof generateTypescriptTypesResultSchema
153153
>;
154154

155-
export type StorageConfigResponse = z.infer<typeof storageConfigResponseSchema>;
156-
export type StorageConfigUpdate = z.infer<typeof storageConfigResponseSchema>;
157-
export type StorageBucketResponse = z.infer<
158-
typeof v1StorageBucketResponseSchema
159-
>;
155+
export type StorageConfig = z.infer<typeof storageConfigSchema>;
156+
export type StorageBucket = z.infer<typeof storageBucketSchema>;
160157

161158
export type SupabasePlatform = {
162159
init?(info: InitData): Promise<void>;
@@ -213,10 +210,7 @@ export type SupabasePlatform = {
213210
rebaseBranch(branchId: string): Promise<void>;
214211

215212
// Storage
216-
getStorageConfig(projectId: string): Promise<StorageConfigResponse>;
217-
updateStorageConfig(
218-
projectId: string,
219-
config: StorageConfigUpdate
220-
): Promise<void>;
221-
listAllBuckets(projectId: string): Promise<StorageBucketResponse[]>;
213+
getStorageConfig(projectId: string): Promise<StorageConfig>;
214+
updateStorageConfig(projectId: string, config: StorageConfig): Promise<void>;
215+
listAllBuckets(projectId: string): Promise<StorageBucket[]>;
222216
};

0 commit comments

Comments
 (0)