@supabase/mcp-server-supabase 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3U2UNU3O.cjs +17 -0
- package/dist/chunk-3U2UNU3O.cjs.map +1 -0
- package/dist/chunk-A3TWEVBP.cjs +280 -0
- package/dist/chunk-A3TWEVBP.cjs.map +1 -0
- package/dist/chunk-BMLW4U6Y.cjs +2 -0
- package/dist/chunk-BMLW4U6Y.cjs.map +1 -0
- package/dist/chunk-I7QY5ONI.cjs +50 -0
- package/dist/chunk-I7QY5ONI.cjs.map +1 -0
- package/dist/chunk-QSCBBEAT.js +280 -0
- package/dist/chunk-QSCBBEAT.js.map +1 -0
- package/dist/chunk-SBJ5JXIL.js +2 -0
- package/dist/chunk-SBJ5JXIL.js.map +1 -0
- package/dist/chunk-XE4XPC4G.js +17 -0
- package/dist/chunk-XE4XPC4G.js.map +1 -0
- package/dist/chunk-Y5HKS7Z3.js +50 -0
- package/dist/chunk-Y5HKS7Z3.js.map +1 -0
- package/dist/cli.cjs +3 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +281 -36
- package/dist/index.d.ts +281 -36
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/platform/api-platform.cjs +1 -1
- package/dist/platform/api-platform.js +1 -1
- package/dist/platform/index.cjs +1 -1
- package/dist/platform/index.cjs.map +1 -1
- package/dist/platform/index.d.cts +205 -7
- package/dist/platform/index.d.ts +205 -7
- package/dist/platform/index.js +1 -1
- package/package.json +4 -3
- package/dist/chunk-GUZGRQIX.cjs +0 -50
- package/dist/chunk-GUZGRQIX.cjs.map +0 -1
- package/dist/chunk-GZNCDKYI.js +0 -17
- package/dist/chunk-GZNCDKYI.js.map +0 -1
- package/dist/chunk-KKEOJLGM.js +0 -50
- package/dist/chunk-KKEOJLGM.js.map +0 -1
- package/dist/chunk-OZNSUBGX.cjs +0 -276
- package/dist/chunk-OZNSUBGX.cjs.map +0 -1
- package/dist/chunk-Q7RZ5JID.js +0 -2
- package/dist/chunk-Q7RZ5JID.js.map +0 -1
- package/dist/chunk-TJWN2AAW.cjs +0 -2
- package/dist/chunk-TJWN2AAW.cjs.map +0 -1
- package/dist/chunk-UXVELPWK.js +0 -276
- package/dist/chunk-UXVELPWK.js.map +0 -1
- package/dist/chunk-WXQAW6FS.cjs +0 -17
- package/dist/chunk-WXQAW6FS.cjs.map +0 -1
- package/dist/transports/stdio.cjs +0 -3
- package/dist/transports/stdio.cjs.map +0 -1
- package/dist/transports/stdio.js +0 -3
- package/dist/transports/stdio.js.map +0 -1
- /package/dist/{transports/stdio.d.cts → cli.d.cts} +0 -0
- /package/dist/{transports/stdio.d.ts → cli.d.ts} +0 -0
|
@@ -144,25 +144,25 @@ declare const migrationSchema: z.ZodObject<{
|
|
|
144
144
|
name: z.ZodOptional<z.ZodString>;
|
|
145
145
|
}, z.core.$strip>;
|
|
146
146
|
declare const logsServiceSchema: z.ZodEnum<{
|
|
147
|
+
auth: "auth";
|
|
148
|
+
realtime: "realtime";
|
|
149
|
+
storage: "storage";
|
|
147
150
|
api: "api";
|
|
148
151
|
"branch-action": "branch-action";
|
|
149
152
|
postgres: "postgres";
|
|
150
153
|
"edge-function": "edge-function";
|
|
151
154
|
"edge-function-runtime": "edge-function-runtime";
|
|
152
|
-
auth: "auth";
|
|
153
|
-
storage: "storage";
|
|
154
|
-
realtime: "realtime";
|
|
155
155
|
}>;
|
|
156
156
|
declare const getLogsOptionsSchema: z.ZodObject<{
|
|
157
157
|
service: z.ZodEnum<{
|
|
158
|
+
auth: "auth";
|
|
159
|
+
realtime: "realtime";
|
|
160
|
+
storage: "storage";
|
|
158
161
|
api: "api";
|
|
159
162
|
"branch-action": "branch-action";
|
|
160
163
|
postgres: "postgres";
|
|
161
164
|
"edge-function": "edge-function";
|
|
162
165
|
"edge-function-runtime": "edge-function-runtime";
|
|
163
|
-
auth: "auth";
|
|
164
|
-
storage: "storage";
|
|
165
|
-
realtime: "realtime";
|
|
166
166
|
}>;
|
|
167
167
|
iso_timestamp_start: z.ZodOptional<z.ZodString>;
|
|
168
168
|
iso_timestamp_end: z.ZodOptional<z.ZodString>;
|
|
@@ -175,6 +175,187 @@ declare const queryLogsOptionsSchema: z.ZodObject<{
|
|
|
175
175
|
declare const generateTypescriptTypesResultSchema: z.ZodObject<{
|
|
176
176
|
types: z.ZodString;
|
|
177
177
|
}, z.core.$strip>;
|
|
178
|
+
declare const notebookCellSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
type: z.ZodLiteral<"markdown">;
|
|
181
|
+
text: z.ZodString;
|
|
182
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
183
|
+
id: z.ZodString;
|
|
184
|
+
type: z.ZodLiteral<"database">;
|
|
185
|
+
sql: z.ZodString;
|
|
186
|
+
row_limit: z.ZodNumber;
|
|
187
|
+
database_identifier: z.ZodOptional<z.ZodString>;
|
|
188
|
+
title: z.ZodOptional<z.ZodString>;
|
|
189
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
190
|
+
table: "table";
|
|
191
|
+
chart: "chart";
|
|
192
|
+
}>>;
|
|
193
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
type: z.ZodEnum<{
|
|
195
|
+
bar: "bar";
|
|
196
|
+
line: "line";
|
|
197
|
+
}>;
|
|
198
|
+
x_column: z.ZodString;
|
|
199
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
200
|
+
column: z.ZodString;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
scale: z.ZodEnum<{
|
|
203
|
+
linear: "linear";
|
|
204
|
+
log: "log";
|
|
205
|
+
}>;
|
|
206
|
+
cumulative: z.ZodBoolean;
|
|
207
|
+
show_labels: z.ZodBoolean;
|
|
208
|
+
}, z.core.$strip>>;
|
|
209
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
type: z.ZodLiteral<"log">;
|
|
212
|
+
sql: z.ZodString;
|
|
213
|
+
time_range: z.ZodUnion<readonly [z.ZodObject<{
|
|
214
|
+
type: z.ZodLiteral<"absolute">;
|
|
215
|
+
start: z.ZodString;
|
|
216
|
+
end: z.ZodString;
|
|
217
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
218
|
+
type: z.ZodLiteral<"relative">;
|
|
219
|
+
unit: z.ZodEnum<{
|
|
220
|
+
minute: "minute";
|
|
221
|
+
hour: "hour";
|
|
222
|
+
day: "day";
|
|
223
|
+
week: "week";
|
|
224
|
+
month: "month";
|
|
225
|
+
year: "year";
|
|
226
|
+
}>;
|
|
227
|
+
amount: z.ZodNumber;
|
|
228
|
+
}, z.core.$strip>]>;
|
|
229
|
+
title: z.ZodOptional<z.ZodString>;
|
|
230
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
231
|
+
table: "table";
|
|
232
|
+
chart: "chart";
|
|
233
|
+
}>>;
|
|
234
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
type: z.ZodEnum<{
|
|
236
|
+
bar: "bar";
|
|
237
|
+
line: "line";
|
|
238
|
+
}>;
|
|
239
|
+
x_column: z.ZodString;
|
|
240
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
241
|
+
column: z.ZodString;
|
|
242
|
+
}, z.core.$strip>>;
|
|
243
|
+
scale: z.ZodEnum<{
|
|
244
|
+
linear: "linear";
|
|
245
|
+
log: "log";
|
|
246
|
+
}>;
|
|
247
|
+
cumulative: z.ZodBoolean;
|
|
248
|
+
show_labels: z.ZodBoolean;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
}, z.core.$strip>], "type">;
|
|
251
|
+
declare const notebookSchema: z.ZodObject<{
|
|
252
|
+
id: z.ZodString;
|
|
253
|
+
name: z.ZodString;
|
|
254
|
+
description: z.ZodNullable<z.ZodString>;
|
|
255
|
+
favorite: z.ZodBoolean;
|
|
256
|
+
inserted_at: z.ZodString;
|
|
257
|
+
updated_at: z.ZodString;
|
|
258
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
259
|
+
id: z.ZodNumber;
|
|
260
|
+
username: z.ZodString;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
updated_by: z.ZodNullable<z.ZodObject<{
|
|
263
|
+
id: z.ZodNumber;
|
|
264
|
+
username: z.ZodString;
|
|
265
|
+
}, z.core.$strip>>;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
declare const notebookWithContentSchema: z.ZodObject<{
|
|
268
|
+
id: z.ZodString;
|
|
269
|
+
name: z.ZodString;
|
|
270
|
+
description: z.ZodNullable<z.ZodString>;
|
|
271
|
+
favorite: z.ZodBoolean;
|
|
272
|
+
inserted_at: z.ZodString;
|
|
273
|
+
updated_at: z.ZodString;
|
|
274
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
275
|
+
id: z.ZodNumber;
|
|
276
|
+
username: z.ZodString;
|
|
277
|
+
}, z.core.$strip>>;
|
|
278
|
+
updated_by: z.ZodNullable<z.ZodObject<{
|
|
279
|
+
id: z.ZodNumber;
|
|
280
|
+
username: z.ZodString;
|
|
281
|
+
}, z.core.$strip>>;
|
|
282
|
+
content: z.ZodObject<{
|
|
283
|
+
schema_version: z.ZodNumber;
|
|
284
|
+
cells: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
285
|
+
id: z.ZodString;
|
|
286
|
+
type: z.ZodLiteral<"markdown">;
|
|
287
|
+
text: z.ZodString;
|
|
288
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
+
id: z.ZodString;
|
|
290
|
+
type: z.ZodLiteral<"database">;
|
|
291
|
+
sql: z.ZodString;
|
|
292
|
+
row_limit: z.ZodNumber;
|
|
293
|
+
database_identifier: z.ZodOptional<z.ZodString>;
|
|
294
|
+
title: z.ZodOptional<z.ZodString>;
|
|
295
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
296
|
+
table: "table";
|
|
297
|
+
chart: "chart";
|
|
298
|
+
}>>;
|
|
299
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
300
|
+
type: z.ZodEnum<{
|
|
301
|
+
bar: "bar";
|
|
302
|
+
line: "line";
|
|
303
|
+
}>;
|
|
304
|
+
x_column: z.ZodString;
|
|
305
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
306
|
+
column: z.ZodString;
|
|
307
|
+
}, z.core.$strip>>;
|
|
308
|
+
scale: z.ZodEnum<{
|
|
309
|
+
linear: "linear";
|
|
310
|
+
log: "log";
|
|
311
|
+
}>;
|
|
312
|
+
cumulative: z.ZodBoolean;
|
|
313
|
+
show_labels: z.ZodBoolean;
|
|
314
|
+
}, z.core.$strip>>;
|
|
315
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
316
|
+
id: z.ZodString;
|
|
317
|
+
type: z.ZodLiteral<"log">;
|
|
318
|
+
sql: z.ZodString;
|
|
319
|
+
time_range: z.ZodUnion<readonly [z.ZodObject<{
|
|
320
|
+
type: z.ZodLiteral<"absolute">;
|
|
321
|
+
start: z.ZodString;
|
|
322
|
+
end: z.ZodString;
|
|
323
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
324
|
+
type: z.ZodLiteral<"relative">;
|
|
325
|
+
unit: z.ZodEnum<{
|
|
326
|
+
minute: "minute";
|
|
327
|
+
hour: "hour";
|
|
328
|
+
day: "day";
|
|
329
|
+
week: "week";
|
|
330
|
+
month: "month";
|
|
331
|
+
year: "year";
|
|
332
|
+
}>;
|
|
333
|
+
amount: z.ZodNumber;
|
|
334
|
+
}, z.core.$strip>]>;
|
|
335
|
+
title: z.ZodOptional<z.ZodString>;
|
|
336
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
337
|
+
table: "table";
|
|
338
|
+
chart: "chart";
|
|
339
|
+
}>>;
|
|
340
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
341
|
+
type: z.ZodEnum<{
|
|
342
|
+
bar: "bar";
|
|
343
|
+
line: "line";
|
|
344
|
+
}>;
|
|
345
|
+
x_column: z.ZodString;
|
|
346
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
347
|
+
column: z.ZodString;
|
|
348
|
+
}, z.core.$strip>>;
|
|
349
|
+
scale: z.ZodEnum<{
|
|
350
|
+
linear: "linear";
|
|
351
|
+
log: "log";
|
|
352
|
+
}>;
|
|
353
|
+
cumulative: z.ZodBoolean;
|
|
354
|
+
show_labels: z.ZodBoolean;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
}, z.core.$strip>], "type">>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
}, z.core.$strip>;
|
|
178
359
|
type Organization = z.infer<typeof organizationSchema>;
|
|
179
360
|
type Project = z.infer<typeof projectSchema>;
|
|
180
361
|
type Branch = z.infer<typeof branchSchema>;
|
|
@@ -194,6 +375,9 @@ type QueryLogsOptions = z.infer<typeof queryLogsOptionsSchema>;
|
|
|
194
375
|
type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
|
|
195
376
|
type StorageConfig = z.infer<typeof storageConfigSchema>;
|
|
196
377
|
type StorageBucket = z.infer<typeof storageBucketSchema>;
|
|
378
|
+
type NotebookCell = z.infer<typeof notebookCellSchema>;
|
|
379
|
+
type Notebook = z.infer<typeof notebookSchema>;
|
|
380
|
+
type NotebookWithContent = z.infer<typeof notebookWithContentSchema>;
|
|
197
381
|
type DatabaseOperations = {
|
|
198
382
|
executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;
|
|
199
383
|
listMigrations(projectId: string): Promise<Migration[]>;
|
|
@@ -234,6 +418,7 @@ type DebuggingOperations = {
|
|
|
234
418
|
queryLogs?(projectId: string, options: QueryLogsOptions): Promise<unknown>;
|
|
235
419
|
getSecurityAdvisors(projectId: string): Promise<unknown>;
|
|
236
420
|
getPerformanceAdvisors(projectId: string): Promise<unknown>;
|
|
421
|
+
getHealthAdvisors?(projectId: string): Promise<unknown>;
|
|
237
422
|
};
|
|
238
423
|
declare const apiKeyTypeSchema: z.ZodEnum<{
|
|
239
424
|
legacy: "legacy";
|
|
@@ -266,6 +451,17 @@ type BranchingOperations = {
|
|
|
266
451
|
resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;
|
|
267
452
|
rebaseBranch(branchId: string): Promise<void>;
|
|
268
453
|
};
|
|
454
|
+
/**
|
|
455
|
+
* Returns only the `updated_at` timestamp of the named secret, never its
|
|
456
|
+
* value or digest.
|
|
457
|
+
*/
|
|
458
|
+
type SecretOperations = {
|
|
459
|
+
getUpdatedAt(projectId: string, name: string): Promise<Date | undefined>;
|
|
460
|
+
};
|
|
461
|
+
type NotebookOperations = {
|
|
462
|
+
listNotebooks(projectId: string): Promise<Notebook[]>;
|
|
463
|
+
getNotebook(projectId: string, notebookId: string): Promise<NotebookWithContent>;
|
|
464
|
+
};
|
|
269
465
|
type SupabasePlatform = {
|
|
270
466
|
init?(info: InitData): Promise<void>;
|
|
271
467
|
account?: AccountOperations;
|
|
@@ -275,6 +471,8 @@ type SupabasePlatform = {
|
|
|
275
471
|
development?: DevelopmentOperations;
|
|
276
472
|
storage?: StorageOperations;
|
|
277
473
|
branching?: BranchingOperations;
|
|
474
|
+
secrets?: SecretOperations;
|
|
475
|
+
notebooks?: NotebookOperations;
|
|
278
476
|
};
|
|
279
477
|
|
|
280
|
-
export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsDialect, type LogsService, type Migration, type Organization, type Project, type QueryLogsOptions, type ResetBranchOptions, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, type SupabasePlatform, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, organizationSchema, projectSchema, queryLogsOptionsSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
|
|
478
|
+
export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsDialect, type LogsService, type Migration, type Notebook, type NotebookCell, type NotebookOperations, type NotebookWithContent, type Organization, type Project, type QueryLogsOptions, type ResetBranchOptions, type SecretOperations, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, type SupabasePlatform, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, notebookCellSchema, notebookSchema, notebookWithContentSchema, organizationSchema, projectSchema, queryLogsOptionsSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -144,25 +144,25 @@ declare const migrationSchema: z.ZodObject<{
|
|
|
144
144
|
name: z.ZodOptional<z.ZodString>;
|
|
145
145
|
}, z.core.$strip>;
|
|
146
146
|
declare const logsServiceSchema: z.ZodEnum<{
|
|
147
|
+
auth: "auth";
|
|
148
|
+
realtime: "realtime";
|
|
149
|
+
storage: "storage";
|
|
147
150
|
api: "api";
|
|
148
151
|
"branch-action": "branch-action";
|
|
149
152
|
postgres: "postgres";
|
|
150
153
|
"edge-function": "edge-function";
|
|
151
154
|
"edge-function-runtime": "edge-function-runtime";
|
|
152
|
-
auth: "auth";
|
|
153
|
-
storage: "storage";
|
|
154
|
-
realtime: "realtime";
|
|
155
155
|
}>;
|
|
156
156
|
declare const getLogsOptionsSchema: z.ZodObject<{
|
|
157
157
|
service: z.ZodEnum<{
|
|
158
|
+
auth: "auth";
|
|
159
|
+
realtime: "realtime";
|
|
160
|
+
storage: "storage";
|
|
158
161
|
api: "api";
|
|
159
162
|
"branch-action": "branch-action";
|
|
160
163
|
postgres: "postgres";
|
|
161
164
|
"edge-function": "edge-function";
|
|
162
165
|
"edge-function-runtime": "edge-function-runtime";
|
|
163
|
-
auth: "auth";
|
|
164
|
-
storage: "storage";
|
|
165
|
-
realtime: "realtime";
|
|
166
166
|
}>;
|
|
167
167
|
iso_timestamp_start: z.ZodOptional<z.ZodString>;
|
|
168
168
|
iso_timestamp_end: z.ZodOptional<z.ZodString>;
|
|
@@ -175,6 +175,187 @@ declare const queryLogsOptionsSchema: z.ZodObject<{
|
|
|
175
175
|
declare const generateTypescriptTypesResultSchema: z.ZodObject<{
|
|
176
176
|
types: z.ZodString;
|
|
177
177
|
}, z.core.$strip>;
|
|
178
|
+
declare const notebookCellSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
type: z.ZodLiteral<"markdown">;
|
|
181
|
+
text: z.ZodString;
|
|
182
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
183
|
+
id: z.ZodString;
|
|
184
|
+
type: z.ZodLiteral<"database">;
|
|
185
|
+
sql: z.ZodString;
|
|
186
|
+
row_limit: z.ZodNumber;
|
|
187
|
+
database_identifier: z.ZodOptional<z.ZodString>;
|
|
188
|
+
title: z.ZodOptional<z.ZodString>;
|
|
189
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
190
|
+
table: "table";
|
|
191
|
+
chart: "chart";
|
|
192
|
+
}>>;
|
|
193
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
type: z.ZodEnum<{
|
|
195
|
+
bar: "bar";
|
|
196
|
+
line: "line";
|
|
197
|
+
}>;
|
|
198
|
+
x_column: z.ZodString;
|
|
199
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
200
|
+
column: z.ZodString;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
scale: z.ZodEnum<{
|
|
203
|
+
linear: "linear";
|
|
204
|
+
log: "log";
|
|
205
|
+
}>;
|
|
206
|
+
cumulative: z.ZodBoolean;
|
|
207
|
+
show_labels: z.ZodBoolean;
|
|
208
|
+
}, z.core.$strip>>;
|
|
209
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
type: z.ZodLiteral<"log">;
|
|
212
|
+
sql: z.ZodString;
|
|
213
|
+
time_range: z.ZodUnion<readonly [z.ZodObject<{
|
|
214
|
+
type: z.ZodLiteral<"absolute">;
|
|
215
|
+
start: z.ZodString;
|
|
216
|
+
end: z.ZodString;
|
|
217
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
218
|
+
type: z.ZodLiteral<"relative">;
|
|
219
|
+
unit: z.ZodEnum<{
|
|
220
|
+
minute: "minute";
|
|
221
|
+
hour: "hour";
|
|
222
|
+
day: "day";
|
|
223
|
+
week: "week";
|
|
224
|
+
month: "month";
|
|
225
|
+
year: "year";
|
|
226
|
+
}>;
|
|
227
|
+
amount: z.ZodNumber;
|
|
228
|
+
}, z.core.$strip>]>;
|
|
229
|
+
title: z.ZodOptional<z.ZodString>;
|
|
230
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
231
|
+
table: "table";
|
|
232
|
+
chart: "chart";
|
|
233
|
+
}>>;
|
|
234
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
type: z.ZodEnum<{
|
|
236
|
+
bar: "bar";
|
|
237
|
+
line: "line";
|
|
238
|
+
}>;
|
|
239
|
+
x_column: z.ZodString;
|
|
240
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
241
|
+
column: z.ZodString;
|
|
242
|
+
}, z.core.$strip>>;
|
|
243
|
+
scale: z.ZodEnum<{
|
|
244
|
+
linear: "linear";
|
|
245
|
+
log: "log";
|
|
246
|
+
}>;
|
|
247
|
+
cumulative: z.ZodBoolean;
|
|
248
|
+
show_labels: z.ZodBoolean;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
}, z.core.$strip>], "type">;
|
|
251
|
+
declare const notebookSchema: z.ZodObject<{
|
|
252
|
+
id: z.ZodString;
|
|
253
|
+
name: z.ZodString;
|
|
254
|
+
description: z.ZodNullable<z.ZodString>;
|
|
255
|
+
favorite: z.ZodBoolean;
|
|
256
|
+
inserted_at: z.ZodString;
|
|
257
|
+
updated_at: z.ZodString;
|
|
258
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
259
|
+
id: z.ZodNumber;
|
|
260
|
+
username: z.ZodString;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
updated_by: z.ZodNullable<z.ZodObject<{
|
|
263
|
+
id: z.ZodNumber;
|
|
264
|
+
username: z.ZodString;
|
|
265
|
+
}, z.core.$strip>>;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
declare const notebookWithContentSchema: z.ZodObject<{
|
|
268
|
+
id: z.ZodString;
|
|
269
|
+
name: z.ZodString;
|
|
270
|
+
description: z.ZodNullable<z.ZodString>;
|
|
271
|
+
favorite: z.ZodBoolean;
|
|
272
|
+
inserted_at: z.ZodString;
|
|
273
|
+
updated_at: z.ZodString;
|
|
274
|
+
owner: z.ZodNullable<z.ZodObject<{
|
|
275
|
+
id: z.ZodNumber;
|
|
276
|
+
username: z.ZodString;
|
|
277
|
+
}, z.core.$strip>>;
|
|
278
|
+
updated_by: z.ZodNullable<z.ZodObject<{
|
|
279
|
+
id: z.ZodNumber;
|
|
280
|
+
username: z.ZodString;
|
|
281
|
+
}, z.core.$strip>>;
|
|
282
|
+
content: z.ZodObject<{
|
|
283
|
+
schema_version: z.ZodNumber;
|
|
284
|
+
cells: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
285
|
+
id: z.ZodString;
|
|
286
|
+
type: z.ZodLiteral<"markdown">;
|
|
287
|
+
text: z.ZodString;
|
|
288
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
+
id: z.ZodString;
|
|
290
|
+
type: z.ZodLiteral<"database">;
|
|
291
|
+
sql: z.ZodString;
|
|
292
|
+
row_limit: z.ZodNumber;
|
|
293
|
+
database_identifier: z.ZodOptional<z.ZodString>;
|
|
294
|
+
title: z.ZodOptional<z.ZodString>;
|
|
295
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
296
|
+
table: "table";
|
|
297
|
+
chart: "chart";
|
|
298
|
+
}>>;
|
|
299
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
300
|
+
type: z.ZodEnum<{
|
|
301
|
+
bar: "bar";
|
|
302
|
+
line: "line";
|
|
303
|
+
}>;
|
|
304
|
+
x_column: z.ZodString;
|
|
305
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
306
|
+
column: z.ZodString;
|
|
307
|
+
}, z.core.$strip>>;
|
|
308
|
+
scale: z.ZodEnum<{
|
|
309
|
+
linear: "linear";
|
|
310
|
+
log: "log";
|
|
311
|
+
}>;
|
|
312
|
+
cumulative: z.ZodBoolean;
|
|
313
|
+
show_labels: z.ZodBoolean;
|
|
314
|
+
}, z.core.$strip>>;
|
|
315
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
316
|
+
id: z.ZodString;
|
|
317
|
+
type: z.ZodLiteral<"log">;
|
|
318
|
+
sql: z.ZodString;
|
|
319
|
+
time_range: z.ZodUnion<readonly [z.ZodObject<{
|
|
320
|
+
type: z.ZodLiteral<"absolute">;
|
|
321
|
+
start: z.ZodString;
|
|
322
|
+
end: z.ZodString;
|
|
323
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
324
|
+
type: z.ZodLiteral<"relative">;
|
|
325
|
+
unit: z.ZodEnum<{
|
|
326
|
+
minute: "minute";
|
|
327
|
+
hour: "hour";
|
|
328
|
+
day: "day";
|
|
329
|
+
week: "week";
|
|
330
|
+
month: "month";
|
|
331
|
+
year: "year";
|
|
332
|
+
}>;
|
|
333
|
+
amount: z.ZodNumber;
|
|
334
|
+
}, z.core.$strip>]>;
|
|
335
|
+
title: z.ZodOptional<z.ZodString>;
|
|
336
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
337
|
+
table: "table";
|
|
338
|
+
chart: "chart";
|
|
339
|
+
}>>;
|
|
340
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
341
|
+
type: z.ZodEnum<{
|
|
342
|
+
bar: "bar";
|
|
343
|
+
line: "line";
|
|
344
|
+
}>;
|
|
345
|
+
x_column: z.ZodString;
|
|
346
|
+
y_series: z.ZodArray<z.ZodObject<{
|
|
347
|
+
column: z.ZodString;
|
|
348
|
+
}, z.core.$strip>>;
|
|
349
|
+
scale: z.ZodEnum<{
|
|
350
|
+
linear: "linear";
|
|
351
|
+
log: "log";
|
|
352
|
+
}>;
|
|
353
|
+
cumulative: z.ZodBoolean;
|
|
354
|
+
show_labels: z.ZodBoolean;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
}, z.core.$strip>], "type">>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
}, z.core.$strip>;
|
|
178
359
|
type Organization = z.infer<typeof organizationSchema>;
|
|
179
360
|
type Project = z.infer<typeof projectSchema>;
|
|
180
361
|
type Branch = z.infer<typeof branchSchema>;
|
|
@@ -194,6 +375,9 @@ type QueryLogsOptions = z.infer<typeof queryLogsOptionsSchema>;
|
|
|
194
375
|
type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
|
|
195
376
|
type StorageConfig = z.infer<typeof storageConfigSchema>;
|
|
196
377
|
type StorageBucket = z.infer<typeof storageBucketSchema>;
|
|
378
|
+
type NotebookCell = z.infer<typeof notebookCellSchema>;
|
|
379
|
+
type Notebook = z.infer<typeof notebookSchema>;
|
|
380
|
+
type NotebookWithContent = z.infer<typeof notebookWithContentSchema>;
|
|
197
381
|
type DatabaseOperations = {
|
|
198
382
|
executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;
|
|
199
383
|
listMigrations(projectId: string): Promise<Migration[]>;
|
|
@@ -234,6 +418,7 @@ type DebuggingOperations = {
|
|
|
234
418
|
queryLogs?(projectId: string, options: QueryLogsOptions): Promise<unknown>;
|
|
235
419
|
getSecurityAdvisors(projectId: string): Promise<unknown>;
|
|
236
420
|
getPerformanceAdvisors(projectId: string): Promise<unknown>;
|
|
421
|
+
getHealthAdvisors?(projectId: string): Promise<unknown>;
|
|
237
422
|
};
|
|
238
423
|
declare const apiKeyTypeSchema: z.ZodEnum<{
|
|
239
424
|
legacy: "legacy";
|
|
@@ -266,6 +451,17 @@ type BranchingOperations = {
|
|
|
266
451
|
resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;
|
|
267
452
|
rebaseBranch(branchId: string): Promise<void>;
|
|
268
453
|
};
|
|
454
|
+
/**
|
|
455
|
+
* Returns only the `updated_at` timestamp of the named secret, never its
|
|
456
|
+
* value or digest.
|
|
457
|
+
*/
|
|
458
|
+
type SecretOperations = {
|
|
459
|
+
getUpdatedAt(projectId: string, name: string): Promise<Date | undefined>;
|
|
460
|
+
};
|
|
461
|
+
type NotebookOperations = {
|
|
462
|
+
listNotebooks(projectId: string): Promise<Notebook[]>;
|
|
463
|
+
getNotebook(projectId: string, notebookId: string): Promise<NotebookWithContent>;
|
|
464
|
+
};
|
|
269
465
|
type SupabasePlatform = {
|
|
270
466
|
init?(info: InitData): Promise<void>;
|
|
271
467
|
account?: AccountOperations;
|
|
@@ -275,6 +471,8 @@ type SupabasePlatform = {
|
|
|
275
471
|
development?: DevelopmentOperations;
|
|
276
472
|
storage?: StorageOperations;
|
|
277
473
|
branching?: BranchingOperations;
|
|
474
|
+
secrets?: SecretOperations;
|
|
475
|
+
notebooks?: NotebookOperations;
|
|
278
476
|
};
|
|
279
477
|
|
|
280
|
-
export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsDialect, type LogsService, type Migration, type Organization, type Project, type QueryLogsOptions, type ResetBranchOptions, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, type SupabasePlatform, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, organizationSchema, projectSchema, queryLogsOptionsSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
|
|
478
|
+
export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsDialect, type LogsService, type Migration, type Notebook, type NotebookCell, type NotebookOperations, type NotebookWithContent, type Organization, type Project, type QueryLogsOptions, type ResetBranchOptions, type SecretOperations, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, type SupabasePlatform, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, notebookCellSchema, notebookSchema, notebookWithContentSchema, organizationSchema, projectSchema, queryLogsOptionsSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
|
package/dist/platform/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-LU6L7C36.js";import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s}from"../chunk-
|
|
1
|
+
import"../chunk-LU6L7C36.js";import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v}from"../chunk-SBJ5JXIL.js";export{v as apiKeyTypeSchema,m as applyMigrationOptionsSchema,e as branchSchema,i as createBranchOptionsSchema,h as createProjectOptionsSchema,k as deployEdgeFunctionOptionsSchema,f as edgeFunctionSchema,g as edgeFunctionWithBodySchema,l as executeSqlOptionsSchema,r as generateTypescriptTypesResultSchema,p as getLogsOptionsSchema,o as logsServiceSchema,n as migrationSchema,s as notebookCellSchema,t as notebookSchema,u as notebookWithContentSchema,c as organizationSchema,d as projectSchema,q as queryLogsOptionsSchema,j as resetBranchOptionsSchema,a as storageBucketSchema,b as storageConfigSchema};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supabase/mcp-server-supabase",
|
|
3
3
|
"mcpName": "com.supabase/mcp",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0",
|
|
5
5
|
"description": "MCP server for interacting with Supabase",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dist/**/*"
|
|
17
17
|
],
|
|
18
18
|
"bin": {
|
|
19
|
-
"mcp-server-supabase": "./dist/
|
|
19
|
+
"mcp-server-supabase": "./dist/cli.js"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@mjackson/multipart-parser": "^0.10.1",
|
|
40
|
+
"@modelcontextprotocol/node": "^2.0.0",
|
|
40
41
|
"common-tags": "^1.8.2",
|
|
41
42
|
"gqlmin": "^0.3.1",
|
|
42
43
|
"graphql": "^16.11.0",
|
|
43
44
|
"openapi-fetch": "^0.13.5",
|
|
44
|
-
"@supabase/mcp-utils": "^0.
|
|
45
|
+
"@supabase/mcp-utils": "^0.9.0"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"@modelcontextprotocol/server": "^2.0.0",
|
package/dist/chunk-GUZGRQIX.cjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkWXQAW6FScjs = require('./chunk-WXQAW6FS.cjs');var _chunkTJWN2AAWcjs = require('./chunk-TJWN2AAW.cjs');var _multipartparser = require('@mjackson/multipart-parser');var _url = require('url');var _commontags = require('common-tags');function z(i,p=100){switch(i){case"api":return _commontags.stripIndent`
|
|
2
|
-
select id, log_attributes['identifier'] as identifier, timestamp, event_message, log_attributes['request.method'] as method, log_attributes['request.path'] as path, log_attributes['response.status_code'] as status_code
|
|
3
|
-
from logs
|
|
4
|
-
where source = 'edge_logs'
|
|
5
|
-
order by timestamp desc
|
|
6
|
-
limit ${p}
|
|
7
|
-
`;case"branch-action":return _commontags.stripIndent`
|
|
8
|
-
select log_attributes['workflow_run'] as workflow_run, timestamp, id, event_message
|
|
9
|
-
from logs
|
|
10
|
-
where source = 'workflow_run_logs'
|
|
11
|
-
order by timestamp desc
|
|
12
|
-
limit ${p}
|
|
13
|
-
`;case"postgres":return _commontags.stripIndent`
|
|
14
|
-
select log_attributes['identifier'] as identifier, timestamp, id, event_message, log_attributes['parsed.error_severity'] as error_severity
|
|
15
|
-
from logs
|
|
16
|
-
where source = 'postgres_logs'
|
|
17
|
-
order by timestamp desc
|
|
18
|
-
limit ${p}
|
|
19
|
-
`;case"edge-function":return _commontags.stripIndent`
|
|
20
|
-
select id, timestamp, event_message, log_attributes['response.status_code'] as status_code, log_attributes['request.method'] as method, log_attributes['function_id'] as function_id, log_attributes['execution_time_ms'] as execution_time_ms, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version
|
|
21
|
-
from logs
|
|
22
|
-
where source = 'function_edge_logs'
|
|
23
|
-
order by timestamp desc
|
|
24
|
-
limit ${p}
|
|
25
|
-
`;case"edge-function-runtime":return _commontags.stripIndent`
|
|
26
|
-
select id, timestamp, event_message, severity_text, log_attributes['level'] as level, log_attributes['event_type'] as event_type, log_attributes['function_id'] as function_id, log_attributes['execution_id'] as execution_id, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version
|
|
27
|
-
from logs
|
|
28
|
-
where source = 'function_logs'
|
|
29
|
-
order by timestamp desc
|
|
30
|
-
limit ${p}
|
|
31
|
-
`;case"auth":return _commontags.stripIndent`
|
|
32
|
-
select id, timestamp, event_message, log_attributes['level'] as level, log_attributes['status'] as status, log_attributes['path'] as path, log_attributes['msg'] as msg, log_attributes['error'] as error
|
|
33
|
-
from logs
|
|
34
|
-
where source = 'auth_logs'
|
|
35
|
-
order by timestamp desc
|
|
36
|
-
limit ${p}
|
|
37
|
-
`;case"storage":return _commontags.stripIndent`
|
|
38
|
-
select id, timestamp, event_message
|
|
39
|
-
from logs
|
|
40
|
-
where source = 'storage_logs'
|
|
41
|
-
order by timestamp desc
|
|
42
|
-
limit ${p}
|
|
43
|
-
`;case"realtime":return _commontags.stripIndent`
|
|
44
|
-
select id, timestamp, event_message
|
|
45
|
-
from logs
|
|
46
|
-
where source = 'realtime_logs'
|
|
47
|
-
order by timestamp desc
|
|
48
|
-
limit ${p}
|
|
49
|
-
`;default:throw new Error(`unsupported log service type: ${i}`)}}var _openapifetch = require('openapi-fetch'); var _openapifetch2 = _interopRequireDefault(_openapifetch);var _v4 = require('zod/v4');function A(i,p,d={}){return _openapifetch2.default.call(void 0, {baseUrl:i,headers:{Authorization:`Bearer ${p}`,...d}})}var U=_v4.z.object({message:_v4.z.string()});function n(i,p){if("error"in i){if(i.response.status===401)throw new Error("Unauthorized. Please provide a valid access token to the MCP server via the --access-token flag or SUPABASE_ACCESS_TOKEN.");let{data:d}=U.safeParse(i.error);throw d?new Error(d.message):new Error(p)}}function P(i,p,d){if("error"in i&&i.response.status===403){let{data:g}=U.safeParse(i.error),a=(_nullishCoalesce(_optionalChain([g, 'optionalAccess', _2 => _2.message]), () => (p))).replace(/\.$/,"");throw new Error(`${a}. Access to project '${d}' was denied. If this project exists, your access token may be scoped to a different organization: re-authenticate with the MCP server and select the organization that owns this project.`)}n(i,p)}var W="ABCDEFGHIJKLMNOPQRSTUVWXYZ",I="abcdefghijklmnopqrstuvwxyz",J="0123456789",V="!@#$%^&*()_+~`|}{[]:;?><,./-=",K=({length:i=10,numbers:p=!1,symbols:d=!1,uppercase:g=!0,lowercase:a=!0}={})=>{let l="";if(g&&(l+=W),a&&(l+=I),p&&(l+=J),d&&(l+=V),l.length===0)throw new Error("at least one character set must be selected");let O=new Uint32Array(i);crypto.getRandomValues(O);let E="";for(let w=0;w<i;w++){let T=O[w]%l.length;E+=l.charAt(T)}return E};var{version:Z}=_chunkWXQAW6FScjs.a;function _e(i){let{accessToken:p,apiUrl:d}=i,g=_nullishCoalesce(d, () => ("https://api.supabase.com")),a=A(g,p),l={async listOrganizations(){let t=await a.GET("/v1/organizations");return n(t,"Failed to fetch organizations"),t.data},async getOrganization(t){let e=await a.GET("/v1/organizations/{slug}",{params:{path:{slug:t}}});return n(e,"Failed to fetch organization"),e.data},async listProjects(){let t=await a.GET("/v1/projects");return n(t,"Failed to fetch projects"),t.data},async getProject(t){let e=await a.GET("/v1/projects/{ref}",{params:{path:{ref:t}}});return n(e,"Failed to fetch project"),e.data},async createProject(t){let{name:e,organization_id:s,region:o,db_pass:r}=_chunkTJWN2AAWcjs.i.parse(t),c=await a.POST("/v1/projects",{body:{name:e,region:o,organization_slug:s,db_pass:_nullishCoalesce(r, () => (K({length:16,numbers:!0,uppercase:!0,lowercase:!0})))}});return n(c,"Failed to create project"),c.data},async pauseProject(t){let e=await a.POST("/v1/projects/{ref}/pause",{params:{path:{ref:t}}});n(e,"Failed to pause project")},async restoreProject(t){let e=await a.POST("/v1/projects/{ref}/restore",{params:{path:{ref:t}}});n(e,"Failed to restore project")}},O={async executeSql(t,e){let{query:s,parameters:o,read_only:r}=_chunkTJWN2AAWcjs.m.parse(e),c=await a.POST("/v1/projects/{ref}/database/query",{params:{path:{ref:t}},body:{query:s,parameters:o,read_only:r}});return P(c,"Failed to execute SQL query",t),c.data},async listMigrations(t){let e=await a.GET("/v1/projects/{ref}/database/migrations",{params:{path:{ref:t}}});return P(e,"Failed to fetch migrations",t),e.data},async applyMigration(t,e){let{name:s,query:o}=_chunkTJWN2AAWcjs.n.parse(e),r=await a.POST("/v1/projects/{ref}/database/migrations",{params:{path:{ref:t}},body:{name:s,query:o}});P(r,"Failed to apply migration",t)}},E={logsDialect:"clickhouse",async getLogs(t,e){let{service:s,iso_timestamp_start:o,iso_timestamp_end:r}=_chunkTJWN2AAWcjs.q.parse(e),c=z(s),f=await a.GET("/v1/projects/{ref}/analytics/endpoints/logs",{params:{path:{ref:t},query:{sql:c,iso_timestamp_start:o,iso_timestamp_end:r}}});return n(f,"Failed to fetch logs"),f.data},async queryLogs(t,e){let{sql:s,iso_timestamp_start:o,iso_timestamp_end:r}=_chunkTJWN2AAWcjs.r.parse(e),c=await a.GET("/v1/projects/{ref}/analytics/endpoints/logs",{params:{path:{ref:t},query:{sql:s,iso_timestamp_start:o,iso_timestamp_end:r}}});return n(c,"Failed to query logs"),c.data},async getSecurityAdvisors(t){let e=await a.GET("/v1/projects/{ref}/advisors/security",{params:{path:{ref:t}}});return n(e,"Failed to fetch security advisors"),e.data},async getPerformanceAdvisors(t){let e=await a.GET("/v1/projects/{ref}/advisors/performance",{params:{path:{ref:t}}});return n(e,"Failed to fetch performance advisors"),e.data}},w={async getProjectUrl(t){let e=new URL(g);return`https://${t}.${ee(e.hostname)}`},async getPublishableKeys(t){let e=await a.GET("/v1/projects/{ref}/api-keys",{params:{path:{ref:t},query:{reveal:"false"}}});n(e,"Failed to fetch API keys");let s;try{let r=await a.GET("/v1/projects/{ref}/api-keys/legacy",{params:{path:{ref:t}}});r.response.ok&&(s=_nullishCoalesce(_optionalChain([r, 'access', _3 => _3.data, 'optionalAccess', _4 => _4.enabled]), () => (!0)))}catch (e2){s=void 0}let o=_nullishCoalesce(_optionalChain([e, 'access', _5 => _5.data, 'optionalAccess', _6 => _6.filter, 'call', _7 => _7(r=>r.name==="anon"||r.type==="publishable")]), () => ([]));if(o.length===0)throw new Error("No client-safe API keys (anon or publishable) found. Please create a publishable key in your project settings.");return o.map(r=>({api_key:r.api_key,name:r.name,type:r.type==="publishable"?"publishable":"legacy",...s!==void 0&&{disabled:r.type==="legacy"&&!s},description:_nullishCoalesce(r.description, () => (void 0)),id:_nullishCoalesce(r.id, () => (void 0))}))},async generateTypescriptTypes(t){let e=await a.GET("/v1/projects/{ref}/types/typescript",{params:{path:{ref:t}}});return n(e,"Failed to fetch TypeScript types"),e.data}},T={async listEdgeFunctions(t){let e=await a.GET("/v1/projects/{ref}/functions",{params:{path:{ref:t}}});return n(e,"Failed to fetch Edge Functions"),e.data.map(s=>{let o=_chunkWXQAW6FScjs.b.call(void 0, t,s.id,s.version),r=s.entrypoint_path?_chunkWXQAW6FScjs.c.call(void 0, {deploymentId:o,filename:_url.fileURLToPath.call(void 0, s.entrypoint_path,{windows:!1})}):void 0,c=s.import_map_path?_chunkWXQAW6FScjs.c.call(void 0, {deploymentId:o,filename:_url.fileURLToPath.call(void 0, s.import_map_path,{windows:!1})}):void 0;return{...s,entrypoint_path:r,import_map_path:c}})},async getEdgeFunction(t,e){let s=await a.GET("/v1/projects/{ref}/functions/{function_slug}",{params:{path:{ref:t,function_slug:e}}});if(s.error)throw s.error;n(s,"Failed to fetch Edge Function");let o=s.data,r=_chunkWXQAW6FScjs.b.call(void 0, t,o.id,o.version),c=o.entrypoint_path?_chunkWXQAW6FScjs.c.call(void 0, {deploymentId:r,filename:_url.fileURLToPath.call(void 0, o.entrypoint_path,{windows:!1})}):void 0,f=o.import_map_path?_chunkWXQAW6FScjs.c.call(void 0, {deploymentId:r,filename:_url.fileURLToPath.call(void 0, o.import_map_path,{windows:!1})}):void 0,y=await a.GET("/v1/projects/{ref}/functions/{function_slug}/body",{params:{path:{ref:t,function_slug:e}},headers:{Accept:"multipart/form-data"},parseAs:"stream"});n(y,"Failed to fetch Edge Function files");let h=y.response.headers.get("content-type");if(!h||!h.startsWith("multipart/form-data"))throw new Error(`Unexpected content type: ${h}. Expected multipart/form-data.`);let v=_multipartparser.getMultipartBoundary.call(void 0, h);if(!v)throw new Error("No multipart boundary found in response headers");if(!y.data)throw new Error("No data received from Edge Function body");let u=[],S=_multipartparser.parseMultipartStream.call(void 0, y.data,{boundary:v});for await(let _ of S)_.isFile&&_.filename&&u.push({name:_chunkWXQAW6FScjs.c.call(void 0, {deploymentId:r,filename:_.filename}),content:_.text});return{...o,entrypoint_path:c,import_map_path:f,files:u}},async deployEdgeFunction(t,e){let{name:s,entrypoint_path:o,import_map_path:r,verify_jwt:c,files:f}=_chunkTJWN2AAWcjs.l.parse(e),y;try{y=await T.getEdgeFunction(t,s)}catch (e3){}let h=f.find(u=>["deno.json","import_map.json"].includes(u.name));r??=_nullishCoalesce(_optionalChain([y, 'optionalAccess', _8 => _8.import_map_path]), () => (_optionalChain([h, 'optionalAccess', _9 => _9.name])));let v=await a.POST("/v1/projects/{ref}/functions/deploy",{params:{path:{ref:t},query:{slug:s}},body:{metadata:{name:s,entrypoint_path:o,import_map_path:r,verify_jwt:c},file:f},bodySerializer(u){let S=new FormData,_=new Blob([JSON.stringify(u.metadata)],{type:"application/json"});return S.append("metadata",_),_optionalChain([u, 'access', _10 => _10.file, 'optionalAccess', _11 => _11.forEach, 'call', _12 => _12(H=>{let R=H,N=new Blob([R.content],{type:"application/typescript"});S.append("file",N,R.name)})]),S}});return n(v,"Failed to deploy Edge Function"),v.data}};return{async init(t){let{clientInfo:e}=t;if(!e)throw new Error("Client info is required");a=A(g,p,{"User-Agent":`supabase-mcp/${Z} (${e.name}/${e.version})`})},account:l,database:O,debugging:E,development:w,functions:T,branching:{async listBranches(t){let e=await a.GET("/v1/projects/{ref}/branches",{params:{path:{ref:t}}});return e.response.status===422?[]:(n(e,"Failed to list branches"),e.data)},async createBranch(t,e){let{name:s}=_chunkTJWN2AAWcjs.j.parse(e),o=await a.POST("/v1/projects/{ref}/branches",{params:{path:{ref:t}},body:{branch_name:s}});return n(o,"Failed to create branch"),o.data},async deleteBranch(t){let e=await a.DELETE("/v1/branches/{branch_id_or_ref}",{params:{path:{branch_id_or_ref:t}}});n(e,"Failed to delete branch")},async mergeBranch(t){let e=await a.POST("/v1/branches/{branch_id_or_ref}/merge",{params:{path:{branch_id_or_ref:t}},body:{}});n(e,"Failed to merge branch")},async resetBranch(t,e){let{migration_version:s}=_chunkTJWN2AAWcjs.k.parse(e),o=await a.POST("/v1/branches/{branch_id_or_ref}/reset",{params:{path:{branch_id_or_ref:t}},body:{migration_version:s}});n(o,"Failed to reset branch")},async rebaseBranch(t){let e=await a.POST("/v1/branches/{branch_id_or_ref}/push",{params:{path:{branch_id_or_ref:t}},body:{}});n(e,"Failed to rebase branch")}},storage:{async listAllBuckets(t){let e=await a.GET("/v1/projects/{ref}/storage/buckets",{params:{path:{ref:t}}});return n(e,"Failed to list storage buckets"),e.data},async getStorageConfig(t){let e=await a.GET("/v1/projects/{ref}/config/storage",{params:{path:{ref:t}}});return n(e,"Failed to get storage config"),e.data},async updateStorageConfig(t,e){let s=await a.PATCH("/v1/projects/{ref}/config/storage",{params:{path:{ref:t}},body:{fileSizeLimit:e.fileSizeLimit,features:{imageTransformation:{enabled:e.features.imageTransformation.enabled},s3Protocol:{enabled:e.features.s3Protocol.enabled}}}});n(s,"Failed to update storage config")}}}}function ee(i){switch(i){case"api.supabase.com":return"supabase.co";case"api.supabase.green":return"supabase.green";default:return"supabase.red"}}exports.a = _e;
|
|
50
|
-
//# sourceMappingURL=chunk-GUZGRQIX.cjs.map
|