@supabase/mcp-server-supabase 0.16.1 → 0.18.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-AQJ4OQXH.js → chunk-BTGEP5EB.js} +4 -4
- package/dist/chunk-BTGEP5EB.js.map +1 -0
- package/dist/chunk-DIWVSO7X.cjs +2 -0
- package/dist/{chunk-2ELO73TX.cjs.map → chunk-DIWVSO7X.cjs.map} +1 -1
- package/dist/chunk-DP5DAOXI.cjs +295 -0
- package/dist/chunk-DP5DAOXI.cjs.map +1 -0
- package/dist/chunk-JIUJWRLL.js +2 -0
- package/dist/{chunk-SG7AFJOS.js.map → chunk-JIUJWRLL.js.map} +1 -1
- package/dist/{chunk-EM7YPWKE.cjs → chunk-TK2UZS5X.cjs} +4 -4
- package/dist/chunk-TK2UZS5X.cjs.map +1 -0
- package/dist/chunk-WOFMZZMH.js +295 -0
- package/dist/chunk-WOFMZZMH.js.map +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -37
- package/dist/index.d.ts +31 -37
- 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.d.cts +6 -6
- package/dist/platform/index.d.ts +6 -6
- package/package.json +5 -3
- package/dist/chunk-2ELO73TX.cjs +0 -2
- package/dist/chunk-7LBYXIBL.js +0 -294
- package/dist/chunk-7LBYXIBL.js.map +0 -1
- package/dist/chunk-AQJ4OQXH.js.map +0 -1
- package/dist/chunk-EM7YPWKE.cjs.map +0 -1
- package/dist/chunk-SG7AFJOS.js +0 -2
- package/dist/chunk-YF5MBEBT.cjs +0 -294
- package/dist/chunk-YF5MBEBT.cjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObservationContext as ObservationContext$1, RequestObservation as RequestObservation$1, RequestObserver as RequestObserver$1, ToolCallCallback } from '@supabase/mcp-utils';
|
|
2
|
-
export { ObservationEnd, ObservedMethod, ToolCallCallback } from '@supabase/mcp-utils';
|
|
2
|
+
export { ObservationEnd, ObservedMethod, ToolCallCallback, ToolCallerError, ToolCallerErrorKind, isToolCallerError } from '@supabase/mcp-utils';
|
|
3
3
|
import { z } from 'zod/v4';
|
|
4
4
|
import { FeedbackOperations, SupabasePlatform } from './platform/index.js';
|
|
5
5
|
import * as _modelcontextprotocol_server from '@modelcontextprotocol/server';
|
|
@@ -11,17 +11,17 @@ declare const CURRENT_FEATURE_GROUPS: readonly ["docs", "account", "database", "
|
|
|
11
11
|
declare const featureGroupSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
|
|
12
12
|
debug: "debug";
|
|
13
13
|
}>, z.ZodEnum<{
|
|
14
|
-
storage: "storage";
|
|
15
|
-
database: "database";
|
|
16
|
-
feedback: "feedback";
|
|
17
14
|
docs: "docs";
|
|
18
15
|
account: "account";
|
|
16
|
+
database: "database";
|
|
19
17
|
debugging: "debugging";
|
|
20
18
|
development: "development";
|
|
21
19
|
functions: "functions";
|
|
22
20
|
branching: "branching";
|
|
21
|
+
storage: "storage";
|
|
23
22
|
notebooks: "notebooks";
|
|
24
|
-
|
|
23
|
+
feedback: "feedback";
|
|
24
|
+
}>]>, z.ZodTransform<"docs" | "account" | "database" | "debugging" | "development" | "functions" | "branching" | "storage" | "notebooks" | "feedback", "debug" | "docs" | "account" | "database" | "debugging" | "development" | "functions" | "branching" | "storage" | "notebooks" | "feedback">>;
|
|
25
25
|
type FeatureGroup = z.infer<typeof featureGroupSchema>;
|
|
26
26
|
|
|
27
27
|
type ObservedTool = ElicitationToolName | 'other';
|
|
@@ -76,19 +76,6 @@ type ObservationContext = ObservationContext$1<ObservedTool>;
|
|
|
76
76
|
type RequestObservation = RequestObservation$1<ObservationFact>;
|
|
77
77
|
type RequestObserver = RequestObserver$1<ObservedTool, ObservationFact>;
|
|
78
78
|
|
|
79
|
-
declare const toolCallerErrorBrand: unique symbol;
|
|
80
|
-
/**
|
|
81
|
-
* A tool error caused by the caller's input, comparable to an HTTP 4xx.
|
|
82
|
-
*/
|
|
83
|
-
declare class ToolCallerError extends Error {
|
|
84
|
-
[toolCallerErrorBrand]: true;
|
|
85
|
-
constructor(message: string, options?: ErrorOptions);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Checks the global symbol brand so errors from another installed copy of this package still match.
|
|
89
|
-
*/
|
|
90
|
-
declare function isToolCallerError(error: unknown): error is ToolCallerError;
|
|
91
|
-
|
|
92
79
|
declare const FEEDBACK_ENVIRONMENTS: {
|
|
93
80
|
production: {
|
|
94
81
|
url: string;
|
|
@@ -129,6 +116,11 @@ type SupabaseMcpServerOptions = {
|
|
|
129
116
|
* Executes database queries in read-only mode if true.
|
|
130
117
|
*/
|
|
131
118
|
readOnly?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Enables MCP Apps: interactive views for supported tools. Experimental, off
|
|
121
|
+
* by default.
|
|
122
|
+
*/
|
|
123
|
+
experimentalApps?: boolean;
|
|
132
124
|
/**
|
|
133
125
|
* Features to enable.
|
|
134
126
|
* Options: 'account', 'branching', 'database', 'debugging', 'development', 'docs', 'feedback', 'functions', 'notebooks', 'storage'
|
|
@@ -157,8 +149,6 @@ type SupabaseMcpServerOptions = {
|
|
|
157
149
|
key: string | Uint8Array;
|
|
158
150
|
/** The authenticated principal `requestState` is bound to. */
|
|
159
151
|
principal: string;
|
|
160
|
-
/** How long a minted `requestState` stays valid, in seconds. */
|
|
161
|
-
ttlSeconds?: number;
|
|
162
152
|
};
|
|
163
153
|
/**
|
|
164
154
|
* Form confirmation for the listed cost, destructive SQL and notebook
|
|
@@ -170,6 +160,8 @@ type SupabaseMcpServerOptions = {
|
|
|
170
160
|
confirmation?: {
|
|
171
161
|
/** Tools that accept a confirmation elicitation. Empty disables all forms. */
|
|
172
162
|
enabledTools: readonly ElicitationToolName[];
|
|
163
|
+
/** How long a confirmation `requestState` stays valid, in seconds. Defaults to 600. */
|
|
164
|
+
ttlSeconds?: number;
|
|
173
165
|
};
|
|
174
166
|
/**
|
|
175
167
|
* URL-mode secret collection for `create_edge_function_secret`. Requires
|
|
@@ -184,6 +176,8 @@ type SupabaseMcpServerOptions = {
|
|
|
184
176
|
* Example: `https://supabase.com/dashboard/mcp/secrets?ref={ref}&name={name}`.
|
|
185
177
|
*/
|
|
186
178
|
connectUrlTemplate: string;
|
|
179
|
+
/** How long a secret-collection `requestState` stays valid, in seconds. Defaults to 600. */
|
|
180
|
+
ttlSeconds?: number;
|
|
187
181
|
};
|
|
188
182
|
};
|
|
189
183
|
};
|
|
@@ -257,7 +251,7 @@ declare const accountToolDefs: {
|
|
|
257
251
|
};
|
|
258
252
|
};
|
|
259
253
|
readonly get_project: {
|
|
260
|
-
readonly description: "Gets details for a Supabase project.";
|
|
254
|
+
readonly description: "Gets details for a Supabase project. `status` is `ACTIVE_HEALTHY` when the project is ready for database tools; other values such as `COMING_UP`, `RESTORING`, or `INACTIVE` (paused) mean database calls will fail or time out.";
|
|
261
255
|
readonly parameters: z.ZodObject<{
|
|
262
256
|
id: z.ZodString;
|
|
263
257
|
}, z.core.$strip>;
|
|
@@ -332,7 +326,7 @@ declare const accountToolDefs: {
|
|
|
332
326
|
};
|
|
333
327
|
};
|
|
334
328
|
readonly create_project: {
|
|
335
|
-
readonly description: "Creates a new Supabase project, which can add to the organization's bill. The user must agree to any nonzero quoted cost before the project is created. Unless `confirm_cost_id` is required, call this tool without it and without asking for cost confirmation in chat first. The server handles cost confirmation, or returns instructions for obtaining a confirmation ID. If it requests an ID, follow those instructions and retry with it. A project quoted at $0 may be created without a cost-confirmation form. Always ask the user which organization to create the project in. The project can take a few minutes to initialize
|
|
329
|
+
readonly description: "Creates a new Supabase project, which can add to the organization's bill. The user must agree to any nonzero quoted cost before the project is created. Unless `confirm_cost_id` is required, call this tool without it and without asking for cost confirmation in chat first. The server handles cost confirmation, or returns instructions for obtaining a confirmation ID. If it requests an ID, follow those instructions and retry with it. A project quoted at $0 may be created without a cost-confirmation form. Always ask the user which organization to create the project in. The project can take a few minutes to initialize. Call `get_project`, waiting a few seconds between checks, until `status` is `ACTIVE_HEALTHY` before running SQL, migrations, or other database tools against it. If `status` becomes `INIT_FAILED` or `REMOVED`, stop and tell the user.";
|
|
336
330
|
readonly parameters: z.ZodObject<{
|
|
337
331
|
name: z.ZodString;
|
|
338
332
|
region: z.ZodEnum<{
|
|
@@ -686,18 +680,18 @@ declare const databaseToolDefs: {
|
|
|
686
680
|
|
|
687
681
|
declare const debuggingToolDefs: {
|
|
688
682
|
readonly get_logs: {
|
|
689
|
-
readonly description: "Gets logs for a Supabase project by service type. When the user asks about a specific time range, always pass iso_timestamp_start and iso_timestamp_end to match it; otherwise each call defaults to the last 24 hours and will return logs from a wider window than intended. The window
|
|
683
|
+
readonly description: "Gets logs for a Supabase project by service type. When the user asks about a specific time range, always pass iso_timestamp_start and iso_timestamp_end to match it; otherwise each call defaults to the last 24 hours and will return logs from a wider window than intended. The window must be 24 hours or less and iso_timestamp_start must be before iso_timestamp_end; other windows are rejected. If you pass only iso_timestamp_start, the end defaults to now, so for a past time range pass both timestamps. For a longer range, make one call per 24-hour slice. Edge Function logs are split by kind: `edge-function` returns invocation/request logs, while `edge-function-runtime` returns console output from inside the function. Query one service first, then correlate with other services by timestamp or error anchors. Do not poll get_logs in a loop.";
|
|
690
684
|
readonly parameters: z.ZodObject<{
|
|
691
685
|
project_id: z.ZodString;
|
|
692
686
|
service: z.ZodEnum<{
|
|
693
|
-
auth: "auth";
|
|
694
|
-
realtime: "realtime";
|
|
695
687
|
storage: "storage";
|
|
696
688
|
api: "api";
|
|
697
689
|
"branch-action": "branch-action";
|
|
698
690
|
postgres: "postgres";
|
|
699
691
|
"edge-function": "edge-function";
|
|
700
692
|
"edge-function-runtime": "edge-function-runtime";
|
|
693
|
+
auth: "auth";
|
|
694
|
+
realtime: "realtime";
|
|
701
695
|
}>;
|
|
702
696
|
iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
|
|
703
697
|
iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
|
|
@@ -934,7 +928,7 @@ ${string}`;
|
|
|
934
928
|
|
|
935
929
|
declare const feedbackToolDefs: {
|
|
936
930
|
readonly submit_feedback: {
|
|
937
|
-
readonly description: "Sends feedback about Supabase tools to the Supabase team. Use it when the user asks, or when you hit a bug
|
|
931
|
+
readonly description: "Sends feedback about Supabase tools or documentation to the Supabase team. Use it when the user asks, or when you hit a bug, a missing capability, or a wrong docs page. Ask the user before sending feedback they didn't request. Never include secrets, personal data, or database contents. Keep it to 1000 characters or fewer. Show the user the returned delete token.";
|
|
938
932
|
readonly parameters: z.ZodObject<{
|
|
939
933
|
feedback: z.ZodString;
|
|
940
934
|
project_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -982,11 +976,11 @@ declare const notebookToolDefs: {
|
|
|
982
976
|
text: z.ZodString;
|
|
983
977
|
}, z.core.$strict>, z.ZodObject<{
|
|
984
978
|
type: z.ZodLiteral<"database">;
|
|
979
|
+
title: z.ZodOptional<z.ZodString>;
|
|
985
980
|
view: z.ZodOptional<z.ZodEnum<{
|
|
986
981
|
table: "table";
|
|
987
982
|
chart: "chart";
|
|
988
983
|
}>>;
|
|
989
|
-
title: z.ZodOptional<z.ZodString>;
|
|
990
984
|
sql: z.ZodString;
|
|
991
985
|
row_limit: z.ZodNumber;
|
|
992
986
|
database_identifier: z.ZodOptional<z.ZodString>;
|
|
@@ -1008,11 +1002,11 @@ declare const notebookToolDefs: {
|
|
|
1008
1002
|
}, z.core.$strict>>;
|
|
1009
1003
|
}, z.core.$strict>, z.ZodObject<{
|
|
1010
1004
|
type: z.ZodLiteral<"log">;
|
|
1005
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1011
1006
|
view: z.ZodOptional<z.ZodEnum<{
|
|
1012
1007
|
table: "table";
|
|
1013
1008
|
chart: "chart";
|
|
1014
1009
|
}>>;
|
|
1015
|
-
title: z.ZodOptional<z.ZodString>;
|
|
1016
1010
|
sql: z.ZodString;
|
|
1017
1011
|
time_range: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1018
1012
|
type: z.ZodLiteral<"absolute">;
|
|
@@ -1050,8 +1044,8 @@ declare const notebookToolDefs: {
|
|
|
1050
1044
|
}, z.core.$strip>;
|
|
1051
1045
|
}, z.core.$strip>;
|
|
1052
1046
|
readonly outputSchema: z.ZodObject<{
|
|
1053
|
-
name: z.ZodString;
|
|
1054
1047
|
id: z.ZodString;
|
|
1048
|
+
name: z.ZodString;
|
|
1055
1049
|
updated_at: z.ZodString;
|
|
1056
1050
|
url: z.ZodString;
|
|
1057
1051
|
}, z.core.$strip>;
|
|
@@ -1160,8 +1154,8 @@ declare const notebookToolDefs: {
|
|
|
1160
1154
|
notebook_id: z.ZodString;
|
|
1161
1155
|
}, z.core.$strip>;
|
|
1162
1156
|
readonly outputSchema: z.ZodObject<{
|
|
1163
|
-
name: z.ZodString;
|
|
1164
1157
|
id: z.ZodString;
|
|
1158
|
+
name: z.ZodString;
|
|
1165
1159
|
}, z.core.$strip>;
|
|
1166
1160
|
readonly annotations: {
|
|
1167
1161
|
readonly title: "Delete notebook";
|
|
@@ -1338,11 +1332,11 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1338
1332
|
text: z.ZodString;
|
|
1339
1333
|
}, z.core.$strict>, z.ZodObject<{
|
|
1340
1334
|
type: z.ZodLiteral<"database">;
|
|
1335
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1341
1336
|
view: z.ZodOptional<z.ZodEnum<{
|
|
1342
1337
|
table: "table";
|
|
1343
1338
|
chart: "chart";
|
|
1344
1339
|
}>>;
|
|
1345
|
-
title: z.ZodOptional<z.ZodString>;
|
|
1346
1340
|
sql: z.ZodString;
|
|
1347
1341
|
row_limit: z.ZodNumber;
|
|
1348
1342
|
database_identifier: z.ZodOptional<z.ZodString>;
|
|
@@ -1364,11 +1358,11 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1364
1358
|
}, z.core.$strict>>;
|
|
1365
1359
|
}, z.core.$strict>, z.ZodObject<{
|
|
1366
1360
|
type: z.ZodLiteral<"log">;
|
|
1361
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1367
1362
|
view: z.ZodOptional<z.ZodEnum<{
|
|
1368
1363
|
table: "table";
|
|
1369
1364
|
chart: "chart";
|
|
1370
1365
|
}>>;
|
|
1371
|
-
title: z.ZodOptional<z.ZodString>;
|
|
1372
1366
|
sql: z.ZodString;
|
|
1373
1367
|
time_range: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1374
1368
|
type: z.ZodLiteral<"absolute">;
|
|
@@ -1406,8 +1400,8 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1406
1400
|
}, z.core.$strip>;
|
|
1407
1401
|
}, z.core.$strip>;
|
|
1408
1402
|
outputSchema: z.ZodObject<{
|
|
1409
|
-
name: z.ZodString;
|
|
1410
1403
|
id: z.ZodString;
|
|
1404
|
+
name: z.ZodString;
|
|
1411
1405
|
updated_at: z.ZodString;
|
|
1412
1406
|
url: z.ZodString;
|
|
1413
1407
|
}, z.core.$strip>;
|
|
@@ -1519,8 +1513,8 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1519
1513
|
notebook_id: z.ZodString;
|
|
1520
1514
|
}, z.core.$strip>;
|
|
1521
1515
|
outputSchema: z.ZodObject<{
|
|
1522
|
-
name: z.ZodString;
|
|
1523
1516
|
id: z.ZodString;
|
|
1517
|
+
name: z.ZodString;
|
|
1524
1518
|
}, z.core.$strip>;
|
|
1525
1519
|
annotations: {
|
|
1526
1520
|
readonly title: "Delete notebook";
|
|
@@ -1809,14 +1803,14 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1809
1803
|
inputSchema: z.ZodObject<{
|
|
1810
1804
|
project_id: z.ZodString;
|
|
1811
1805
|
service: z.ZodEnum<{
|
|
1812
|
-
auth: "auth";
|
|
1813
|
-
realtime: "realtime";
|
|
1814
1806
|
storage: "storage";
|
|
1815
1807
|
api: "api";
|
|
1816
1808
|
"branch-action": "branch-action";
|
|
1817
1809
|
postgres: "postgres";
|
|
1818
1810
|
"edge-function": "edge-function";
|
|
1819
1811
|
"edge-function-runtime": "edge-function-runtime";
|
|
1812
|
+
auth: "auth";
|
|
1813
|
+
realtime: "realtime";
|
|
1820
1814
|
}>;
|
|
1821
1815
|
iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
|
|
1822
1816
|
iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
|
|
@@ -2464,4 +2458,4 @@ declare function createToolSchemas<const Features extends readonly FeatureGroup[
|
|
|
2464
2458
|
|
|
2465
2459
|
declare const version: string;
|
|
2466
2460
|
|
|
2467
|
-
export { CURRENT_ELICITATION_TOOLS, CURRENT_FEATURE_GROUPS, type ConfirmationFeature, type ElicitationToolName, type FeatureGroup, FeedbackOperations, type FeedbackOperationsOptions, type ObservationContext, type ObservationFact, type ObservedTool, type RequestObservation, type RequestObserver, type SupabaseMcpServerOptions, SupabasePlatform,
|
|
2461
|
+
export { CURRENT_ELICITATION_TOOLS, CURRENT_FEATURE_GROUPS, type ConfirmationFeature, type ElicitationToolName, type FeatureGroup, FeedbackOperations, type FeedbackOperationsOptions, type ObservationContext, type ObservationFact, type ObservedTool, type RequestObservation, type RequestObserver, type SupabaseMcpServerOptions, SupabasePlatform, createFeedbackOperations, createSupabaseMcpHandler, createSupabaseMcpServer, createToolSchemas, supabaseMcpToolSchemas, version };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b as p,f as s,g as c,h as e}from"./chunk-WOFMZZMH.js";import{a as r,h as t}from"./chunk-BTGEP5EB.js";import"./chunk-LL3YUIO5.js";import{isToolCallerError as v,ToolCallerError as T}from"@supabase/mcp-utils";import{createMcpHandler as n}from"@modelcontextprotocol/server";function i(o){return n(()=>e(o),{legacy:"reject"})}var O=r.version;export{a as CURRENT_ELICITATION_TOOLS,p as CURRENT_FEATURE_GROUPS,T as ToolCallerError,t as createFeedbackOperations,i as createSupabaseMcpHandler,e as createSupabaseMcpServer,c as createToolSchemas,v as isToolCallerError,s as supabaseMcpToolSchemas,O as version};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/transports/http.ts"],"sourcesContent":["import packageJson from '../package.json' with { type: 'json' };\n\nexport type {\n ObservationContext,\n ObservationEnd,\n ObservationFact,\n ObservedMethod,\n ObservedTool,\n ConfirmationFeature,\n RequestObservation,\n RequestObserver,\n} from './observation.js';\nexport {\n isToolCallerError,\n ToolCallerError,\n type ToolCallerErrorKind,\n} from '@supabase/mcp-utils';\nexport type { ToolCallCallback } from '@supabase/mcp-utils';\nexport {\n createFeedbackOperations,\n type FeedbackOperationsOptions,\n} from './platform/feedback.js';\nexport type { FeedbackOperations, SupabasePlatform } from './platform/index.js';\nexport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from './server.js';\nexport { createSupabaseMcpHandler } from './transports/http.js';\nexport {\n CURRENT_ELICITATION_TOOLS,\n CURRENT_FEATURE_GROUPS,\n type ElicitationToolName,\n type FeatureGroup,\n} from './types.js';\nexport const version = packageJson.version;\n\nexport {\n createToolSchemas,\n supabaseMcpToolSchemas,\n} from './tools/tool-schemas.js';\n","import { createMcpHandler } from '@modelcontextprotocol/server';\n\nimport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from '../server.js';\n\n// Modern protocol only: created with `legacy: 'reject'`, so a client that\n// speaks just the 2025-era protocol gets an HTTP 400 instead of being served.\nexport function createSupabaseMcpHandler(options: SupabaseMcpServerOptions) {\n return createMcpHandler(() => createSupabaseMcpServer(options), {\n legacy: 'reject',\n });\n}\n"],"mappings":"0IAYA,OACE,qBAAAA,EACA,mBAAAC,MAEK,sBChBP,OAAS,oBAAAC,MAAwB,+BAS1B,SAASC,EAAyBC,EAAmC,CAC1E,OAAOC,EAAiB,IAAMC,EAAwBF,CAAO,EAAG,CAC9D,OAAQ,QACV,CAAC,CACH,CDqBO,IAAMG,EAAUC,EAAY","names":["isToolCallerError","ToolCallerError","createMcpHandler","createSupabaseMcpHandler","options","createMcpHandler","createSupabaseMcpServer","version","package_default"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDIWVSO7Xcjs = require('../chunk-DIWVSO7X.cjs');require('../chunk-TK2UZS5X.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-6FWRABME.cjs');exports.createSupabaseApiPlatform = _chunkDIWVSO7Xcjs.a;
|
|
2
2
|
//# sourceMappingURL=api-platform.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-JIUJWRLL.js";import"../chunk-BTGEP5EB.js";import"../chunk-LU6L7C36.js";import"../chunk-LL3YUIO5.js";export{a as createSupabaseApiPlatform};
|
|
2
2
|
//# sourceMappingURL=api-platform.js.map
|
|
@@ -148,25 +148,25 @@ declare const migrationSchema: z.ZodObject<{
|
|
|
148
148
|
name: z.ZodOptional<z.ZodString>;
|
|
149
149
|
}, z.core.$strip>;
|
|
150
150
|
declare const logsServiceSchema: z.ZodEnum<{
|
|
151
|
-
auth: "auth";
|
|
152
|
-
realtime: "realtime";
|
|
153
151
|
storage: "storage";
|
|
154
152
|
api: "api";
|
|
155
153
|
"branch-action": "branch-action";
|
|
156
154
|
postgres: "postgres";
|
|
157
155
|
"edge-function": "edge-function";
|
|
158
156
|
"edge-function-runtime": "edge-function-runtime";
|
|
157
|
+
auth: "auth";
|
|
158
|
+
realtime: "realtime";
|
|
159
159
|
}>;
|
|
160
160
|
declare const getLogsOptionsSchema: z.ZodObject<{
|
|
161
161
|
service: z.ZodEnum<{
|
|
162
|
-
auth: "auth";
|
|
163
|
-
realtime: "realtime";
|
|
164
162
|
storage: "storage";
|
|
165
163
|
api: "api";
|
|
166
164
|
"branch-action": "branch-action";
|
|
167
165
|
postgres: "postgres";
|
|
168
166
|
"edge-function": "edge-function";
|
|
169
167
|
"edge-function-runtime": "edge-function-runtime";
|
|
168
|
+
auth: "auth";
|
|
169
|
+
realtime: "realtime";
|
|
170
170
|
}>;
|
|
171
171
|
iso_timestamp_start: z.ZodOptional<z.ZodString>;
|
|
172
172
|
iso_timestamp_end: z.ZodOptional<z.ZodString>;
|
|
@@ -262,11 +262,11 @@ declare const createNotebookOptionsSchema: z.ZodObject<{
|
|
|
262
262
|
text: z.ZodString;
|
|
263
263
|
}, z.core.$strict>, z.ZodObject<{
|
|
264
264
|
type: z.ZodLiteral<"database">;
|
|
265
|
+
title: z.ZodOptional<z.ZodString>;
|
|
265
266
|
view: z.ZodOptional<z.ZodEnum<{
|
|
266
267
|
table: "table";
|
|
267
268
|
chart: "chart";
|
|
268
269
|
}>>;
|
|
269
|
-
title: z.ZodOptional<z.ZodString>;
|
|
270
270
|
sql: z.ZodString;
|
|
271
271
|
row_limit: z.ZodNumber;
|
|
272
272
|
database_identifier: z.ZodOptional<z.ZodString>;
|
|
@@ -288,11 +288,11 @@ declare const createNotebookOptionsSchema: z.ZodObject<{
|
|
|
288
288
|
}, z.core.$strict>>;
|
|
289
289
|
}, z.core.$strict>, z.ZodObject<{
|
|
290
290
|
type: z.ZodLiteral<"log">;
|
|
291
|
+
title: z.ZodOptional<z.ZodString>;
|
|
291
292
|
view: z.ZodOptional<z.ZodEnum<{
|
|
292
293
|
table: "table";
|
|
293
294
|
chart: "chart";
|
|
294
295
|
}>>;
|
|
295
|
-
title: z.ZodOptional<z.ZodString>;
|
|
296
296
|
sql: z.ZodString;
|
|
297
297
|
time_range: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
298
298
|
type: z.ZodLiteral<"absolute">;
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -148,25 +148,25 @@ declare const migrationSchema: z.ZodObject<{
|
|
|
148
148
|
name: z.ZodOptional<z.ZodString>;
|
|
149
149
|
}, z.core.$strip>;
|
|
150
150
|
declare const logsServiceSchema: z.ZodEnum<{
|
|
151
|
-
auth: "auth";
|
|
152
|
-
realtime: "realtime";
|
|
153
151
|
storage: "storage";
|
|
154
152
|
api: "api";
|
|
155
153
|
"branch-action": "branch-action";
|
|
156
154
|
postgres: "postgres";
|
|
157
155
|
"edge-function": "edge-function";
|
|
158
156
|
"edge-function-runtime": "edge-function-runtime";
|
|
157
|
+
auth: "auth";
|
|
158
|
+
realtime: "realtime";
|
|
159
159
|
}>;
|
|
160
160
|
declare const getLogsOptionsSchema: z.ZodObject<{
|
|
161
161
|
service: z.ZodEnum<{
|
|
162
|
-
auth: "auth";
|
|
163
|
-
realtime: "realtime";
|
|
164
162
|
storage: "storage";
|
|
165
163
|
api: "api";
|
|
166
164
|
"branch-action": "branch-action";
|
|
167
165
|
postgres: "postgres";
|
|
168
166
|
"edge-function": "edge-function";
|
|
169
167
|
"edge-function-runtime": "edge-function-runtime";
|
|
168
|
+
auth: "auth";
|
|
169
|
+
realtime: "realtime";
|
|
170
170
|
}>;
|
|
171
171
|
iso_timestamp_start: z.ZodOptional<z.ZodString>;
|
|
172
172
|
iso_timestamp_end: z.ZodOptional<z.ZodString>;
|
|
@@ -262,11 +262,11 @@ declare const createNotebookOptionsSchema: z.ZodObject<{
|
|
|
262
262
|
text: z.ZodString;
|
|
263
263
|
}, z.core.$strict>, z.ZodObject<{
|
|
264
264
|
type: z.ZodLiteral<"database">;
|
|
265
|
+
title: z.ZodOptional<z.ZodString>;
|
|
265
266
|
view: z.ZodOptional<z.ZodEnum<{
|
|
266
267
|
table: "table";
|
|
267
268
|
chart: "chart";
|
|
268
269
|
}>>;
|
|
269
|
-
title: z.ZodOptional<z.ZodString>;
|
|
270
270
|
sql: z.ZodString;
|
|
271
271
|
row_limit: z.ZodNumber;
|
|
272
272
|
database_identifier: z.ZodOptional<z.ZodString>;
|
|
@@ -288,11 +288,11 @@ declare const createNotebookOptionsSchema: z.ZodObject<{
|
|
|
288
288
|
}, z.core.$strict>>;
|
|
289
289
|
}, z.core.$strict>, z.ZodObject<{
|
|
290
290
|
type: z.ZodLiteral<"log">;
|
|
291
|
+
title: z.ZodOptional<z.ZodString>;
|
|
291
292
|
view: z.ZodOptional<z.ZodEnum<{
|
|
292
293
|
table: "table";
|
|
293
294
|
chart: "chart";
|
|
294
295
|
}>>;
|
|
295
|
-
title: z.ZodOptional<z.ZodString>;
|
|
296
296
|
sql: z.ZodString;
|
|
297
297
|
time_range: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
298
298
|
type: z.ZodLiteral<"absolute">;
|
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.18.0",
|
|
5
5
|
"description": "MCP server for interacting with Supabase",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"gqlmin": "^0.3.1",
|
|
43
43
|
"graphql": "^16.11.0",
|
|
44
44
|
"openapi-fetch": "^0.13.5",
|
|
45
|
-
"@supabase/mcp-utils": "^0.
|
|
45
|
+
"@supabase/mcp-utils": "^0.11.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@ai-sdk/mcp": "^1.0.21",
|
|
54
54
|
"@electric-sql/pglite": "^0.2.17",
|
|
55
55
|
"@modelcontextprotocol/client": "^2.0.0",
|
|
56
|
+
"@modelcontextprotocol/ext-apps": "^2.0.4",
|
|
56
57
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
57
58
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
58
59
|
"@types/common-tags": "^1.8.4",
|
|
@@ -71,7 +72,8 @@
|
|
|
71
72
|
"typescript": "^5.6.3",
|
|
72
73
|
"vite": "^5.4.19",
|
|
73
74
|
"vitest": "^2.1.9",
|
|
74
|
-
"zod": "^3.25.0 || ^4.0.0"
|
|
75
|
+
"zod": "^3.25.0 || ^4.0.0",
|
|
76
|
+
"@supabase/mcp-ui": "0.0.0"
|
|
75
77
|
},
|
|
76
78
|
"scripts": {
|
|
77
79
|
"build": "tsup --clean",
|
package/dist/chunk-2ELO73TX.cjs
DELETED
|
@@ -1,2 +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(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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 _chunkEM7YPWKEcjs = require('./chunk-EM7YPWKE.cjs');var _chunk6FWRABMEcjs = require('./chunk-6FWRABME.cjs');var _multipartparser = require('@mjackson/multipart-parser');var _openapifetch = require('openapi-fetch'); var _openapifetch2 = _interopRequireDefault(_openapifetch);var _v4 = require('zod/v4');function F(i,c,d={}){return _openapifetch2.default.call(void 0, {baseUrl:i,headers:{Authorization:`Bearer ${c}`,...d}})}var Q=_v4.z.object({message:_v4.z.string()}),ee=/^ref: /;function o(i,c){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}=Q.safeParse(i.error);throw d?i.response.status===400&&ee.test(d.message)?new Error(`${d.message.replace(/\.$/,"")}. Copy the ref exactly as returned by list_projects (id) or list_branches (project_ref), depending on whether you're working with the main project or a branch; do not retype or shorten it.`):new Error(d.message):new Error(c)}}function j(i,c,d){if("error"in i&&i.response.status===403){let{data:l}=Q.safeParse(i.error),u=(_nullishCoalesce(_optionalChain([l, 'optionalAccess', _2 => _2.message]), () => (c))).replace(/\.$/,"");throw new Error(`${u}. 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.`)}o(i,c)}function C(i,c,d={}){return _openapifetch2.default.call(void 0, {baseUrl:i,headers:{Authorization:`Bearer ${c}`,...d}})}var se=_v4.z.object({error:_v4.z.object({message:_v4.z.string()})});function w(i,c){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}=se.safeParse(i.error);if(d){let{message:l}=d.error,{status:u}=i.response;throw u<500&&u!==429?new (0, _chunkEM7YPWKEcjs.h)(l):new Error(l)}throw new Error(c)}}var ae="ABCDEFGHIJKLMNOPQRSTUVWXYZ",re="abcdefghijklmnopqrstuvwxyz",ne="0123456789",oe="!@#$%^&*()_+~`|}{[]:;?><,./-=",W=({length:i=10,numbers:c=!1,symbols:d=!1,uppercase:l=!0,lowercase:u=!0}={})=>{let r="";if(l&&(r+=ae),u&&(r+=re),c&&(r+=ne),d&&(r+=oe),r.length===0)throw new Error("at least one character set must be selected");let m=new Uint32Array(i);crypto.getRandomValues(m);let T="";for(let S=0;S<i;S++){let P=m[S]%r.length;T+=r.charAt(P)}return T};var{version:ce}=_chunkEM7YPWKEcjs.a;var de=["log_data_api_error_rate_high","log_auth_error_rate_high","log_storage_error_rate_high","log_edge_function_error_rate_high"],le=new Set(["project_not_active","advisor_check_unavailable"]);function Ge(i){let{accessToken:c,apiUrl:d}=i,l=_nullishCoalesce(d, () => ("https://api.supabase.com")),u,r=F(l,c),m=C(l,c),T={async listOrganizations(){let t=await r.GET("/v1/organizations");return o(t,"Failed to fetch organizations"),t.data},async getOrganization(t){let e=await r.GET("/v1/organizations/{slug}",{params:{path:{slug:t}}});return o(e,"Failed to fetch organization"),e.data},async listProjects(){let t=await r.GET("/v1/projects");return o(t,"Failed to fetch projects"),t.data},async getProject(t){let e=await r.GET("/v1/projects/{ref}",{params:{path:{ref:t}}});return o(e,"Failed to fetch project"),e.data},async createProject(t){let{name:e,organization_id:s,region:a,db_pass:n}=_chunk6FWRABMEcjs.i.parse(t),p=await r.POST("/v1/projects",{body:{name:e,region:a,organization_slug:s,db_pass:_nullishCoalesce(n, () => (W({length:16,numbers:!0,uppercase:!0,lowercase:!0})))}});return o(p,"Failed to create project"),p.data},async pauseProject(t){let e=await r.POST("/v1/projects/{ref}/pause",{params:{path:{ref:t}}});o(e,"Failed to pause project")},async restoreProject(t){let e=await r.POST("/v1/projects/{ref}/restore",{params:{path:{ref:t}}});o(e,"Failed to restore project")}},S={async executeSql(t,e){let{query:s,parameters:a,read_only:n}=_chunk6FWRABMEcjs.n.parse(e),p=await r.POST("/v1/projects/{ref}/database/query",{params:{path:{ref:t}},body:{query:s,parameters:a,read_only:n}});return j(p,"Failed to execute SQL query",t),p.data},async listMigrations(t){let e=await r.GET("/v1/projects/{ref}/database/migrations",{params:{path:{ref:t}}});return j(e,"Failed to fetch migrations",t),e.data},async applyMigration(t,e){let{name:s,query:a}=_chunk6FWRABMEcjs.o.parse(e),n=await r.POST("/v1/projects/{ref}/database/migrations",{params:{path:{ref:t}},body:{name:s,query:a}});j(n,"Failed to apply migration",t)}},P={logsDialect:"clickhouse",async getLogs(t,e){let{service:s,iso_timestamp_start:a,iso_timestamp_end:n}=_chunk6FWRABMEcjs.r.parse(e),p=_chunkEM7YPWKEcjs.f.call(void 0, s),f=await r.GET("/v1/projects/{ref}/analytics/endpoints/logs",{params:{path:{ref:t},query:{sql:p,iso_timestamp_start:a,iso_timestamp_end:n}}});return o(f,"Failed to fetch logs"),f.data},async queryLogs(t,e){let{sql:s,iso_timestamp_start:a,iso_timestamp_end:n}=_chunk6FWRABMEcjs.s.parse(e),p=await r.GET("/v1/projects/{ref}/analytics/endpoints/logs",{params:{path:{ref:t},query:{sql:s,iso_timestamp_start:a,iso_timestamp_end:n}}});return o(p,"Failed to query logs"),p.data},async getSecurityAdvisors(t){let e=await r.GET("/v1/projects/{ref}/advisors/security",{params:{path:{ref:t}}});return o(e,"Failed to fetch security advisors"),e.data},async getPerformanceAdvisors(t){let e=await r.GET("/v1/projects/{ref}/advisors/performance",{params:{path:{ref:t}}});return o(e,"Failed to fetch performance advisors"),e.data},async getHealthAdvisors(t){let e=await m.POST("/v2/projects/{ref}/advisors/run",{params:{path:{ref:t}},body:{data:{type:"project_advisors",attributes:{lints:de.map(a=>({name:a}))}}}});w(e,"Failed to fetch health advisors");let s=e.data.data.attributes;return{...s,lints:s.lints.filter(({name:a})=>!le.has(a))}}},J={async getProjectUrl(t){let e=new URL(l);return`https://${t}.${me(e.hostname)}`},async getPublishableKeys(t){let e=await r.GET("/v1/projects/{ref}/api-keys",{params:{path:{ref:t},query:{reveal:"false"}}});o(e,"Failed to fetch API keys");let s;try{let n=await r.GET("/v1/projects/{ref}/api-keys/legacy",{params:{path:{ref:t}}});n.response.ok&&(s=_nullishCoalesce(_optionalChain([n, 'access', _3 => _3.data, 'optionalAccess', _4 => _4.enabled]), () => (!0)))}catch (e2){s=void 0}let a=_nullishCoalesce(_optionalChain([e, 'access', _5 => _5.data, 'optionalAccess', _6 => _6.filter, 'call', _7 => _7(n=>n.name==="anon"||n.type==="publishable")]), () => ([]));if(a.length===0)throw new Error("No client-safe API keys (anon or publishable) found. Please create a publishable key in your project settings.");return a.map(n=>({api_key:n.api_key,name:n.name,type:n.type==="publishable"?"publishable":"legacy",...s!==void 0&&{disabled:n.type==="legacy"&&!s},description:_nullishCoalesce(n.description, () => (void 0)),id:_nullishCoalesce(n.id, () => (void 0))}))},async generateTypescriptTypes(t){let e=await r.GET("/v1/projects/{ref}/types/typescript",{params:{path:{ref:t}}});return o(e,"Failed to fetch TypeScript types"),e.data}},M={async listEdgeFunctions(t){let e=await r.GET("/v1/projects/{ref}/functions",{params:{path:{ref:t}}});return o(e,"Failed to fetch Edge Functions"),e.data.map(s=>{let a=_chunkEM7YPWKEcjs.b.call(void 0, t,s.id,s.version),n=s.entrypoint_path?_chunkEM7YPWKEcjs.d.call(void 0, {deploymentId:a,filename:_chunkEM7YPWKEcjs.c.call(void 0, s.entrypoint_path)}):void 0,p=s.import_map_path?_chunkEM7YPWKEcjs.d.call(void 0, {deploymentId:a,filename:_chunkEM7YPWKEcjs.c.call(void 0, s.import_map_path)}):void 0;return{...s,entrypoint_path:n,import_map_path:p}})},async getEdgeFunction(t,e){let s=await r.GET("/v1/projects/{ref}/functions/{function_slug}",{params:{path:{ref:t,function_slug:e}}});if(s.error)throw s.error;o(s,"Failed to fetch Edge Function");let a=s.data,n=_chunkEM7YPWKEcjs.b.call(void 0, t,a.id,a.version),p=a.entrypoint_path?_chunkEM7YPWKEcjs.d.call(void 0, {deploymentId:n,filename:_chunkEM7YPWKEcjs.c.call(void 0, a.entrypoint_path)}):void 0,f=a.import_map_path?_chunkEM7YPWKEcjs.d.call(void 0, {deploymentId:n,filename:_chunkEM7YPWKEcjs.c.call(void 0, a.import_map_path)}):void 0,h=await r.GET("/v1/projects/{ref}/functions/{function_slug}/body",{params:{path:{ref:t,function_slug:e}},headers:{Accept:"multipart/form-data"},parseAs:"stream"});o(h,"Failed to fetch Edge Function files");let y=h.response.headers.get("content-type");if(!y||!y.startsWith("multipart/form-data"))throw new Error(`Unexpected content type: ${y}. Expected multipart/form-data.`);let O=_multipartparser.getMultipartBoundary.call(void 0, y);if(!O)throw new Error("No multipart boundary found in response headers");if(!h.data)throw new Error("No data received from Edge Function body");let g=[],v=_multipartparser.parseMultipartStream.call(void 0, h.data,{boundary:O});for await(let b of v)b.isFile&&b.filename&&g.push({name:_chunkEM7YPWKEcjs.d.call(void 0, {deploymentId:n,filename:b.filename}),content:b.text});return{...a,entrypoint_path:p,import_map_path:f,files:g}},async deployEdgeFunction(t,e){let{name:s,entrypoint_path:a,import_map_path:n,verify_jwt:p,files:f}=_chunk6FWRABMEcjs.l.parse(e),h;try{h=await M.getEdgeFunction(t,s)}catch (e3){}let y=f.find(g=>["deno.json","import_map.json"].includes(g.name));n??=_nullishCoalesce(_optionalChain([h, 'optionalAccess', _8 => _8.import_map_path]), () => (_optionalChain([y, 'optionalAccess', _9 => _9.name])));let O=await r.POST("/v1/projects/{ref}/functions/deploy",{params:{path:{ref:t},query:{slug:s}},body:{metadata:{name:s,entrypoint_path:a,import_map_path:n,verify_jwt:p},file:f},bodySerializer(g){let v=new FormData,b=new Blob([JSON.stringify(g.metadata)],{type:"application/json"});return v.append("metadata",b),_optionalChain([g, 'access', _10 => _10.file, 'optionalAccess', _11 => _11.forEach, 'call', _12 => _12(X=>{let k=X,Y=new Blob([k.content],{type:"application/typescript"});v.append("file",Y,k.name)})]),v}});return o(O,"Failed to deploy Edge Function"),O.data}};return{async init(t){let{clientInfo:e}=t;if(!e)throw new Error("Client info is required");let s={"User-Agent":`supabase-mcp/${ce} (${e.name}/${e.version})`};r=F(l,c,s),m=C(l,c,s)},account:T,database:S,debugging:P,development:J,functions:M,branching:{async listBranches(t){let e=await r.GET("/v1/projects/{ref}/branches",{params:{path:{ref:t}}});return e.response.status===422?[]:(o(e,"Failed to list branches"),e.data)},async createBranch(t,e){let{name:s}=_chunk6FWRABMEcjs.j.parse(e),a=await r.POST("/v1/projects/{ref}/branches",{params:{path:{ref:t}},body:{branch_name:s}});return o(a,"Failed to create branch"),a.data},async deleteBranch(t){let e=await r.DELETE("/v1/branches/{branch_id_or_ref}",{params:{path:{branch_id_or_ref:t}}});o(e,"Failed to delete branch")},async mergeBranch(t){let e=await r.POST("/v1/branches/{branch_id_or_ref}/merge",{params:{path:{branch_id_or_ref:t}},body:{}});o(e,"Failed to merge branch")},async resetBranch(t,e){let{migration_version:s}=_chunk6FWRABMEcjs.k.parse(e),a=await r.POST("/v1/branches/{branch_id_or_ref}/reset",{params:{path:{branch_id_or_ref:t}},body:{migration_version:s}});o(a,"Failed to reset branch")},async rebaseBranch(t){let e=await r.POST("/v1/branches/{branch_id_or_ref}/push",{params:{path:{branch_id_or_ref:t}},body:{}});o(e,"Failed to rebase branch")}},storage:{async listAllBuckets(t){let e=await r.GET("/v1/projects/{ref}/storage/buckets",{params:{path:{ref:t}}});return o(e,"Failed to list storage buckets"),e.data},async getStorageConfig(t){let e=await r.GET("/v1/projects/{ref}/config/storage",{params:{path:{ref:t}}});return o(e,"Failed to get storage config"),e.data},async updateStorageConfig(t,e){let s=await r.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}}}});o(s,"Failed to update storage config")}},secrets:{async getUpdatedAt(t,e){let s=await r.GET("/v1/projects/{ref}/secrets",{params:{path:{ref:t}}});o(s,"Failed to fetch secrets");let a=s.data.find(n=>n.name===e);if(!(!a||!a.updated_at))return new Date(a.updated_at)}},notebooks:{async createNotebook(t,e){let s=_chunk6FWRABMEcjs.v.parse(e),a=await m.POST("/v2/projects/{ref}/notebooks",{params:{path:{ref:t}},body:{data:{type:"notebook",attributes:s}}});w(a,"Failed to create notebook");let{id:n,attributes:p}=a.data.data;return{id:n,...p}},async listNotebooks(t){let e=[],s;do{let a=await m.GET("/v2/projects/{ref}/notebooks",{params:{path:{ref:t},query:s?{page:{after:s}}:void 0}});w(a,"Failed to retrieve project's notebooks"),e.push(...a.data.data.map(({id:n,attributes:p})=>({id:n,...p}))),s=ue(a.data.links.next)}while(s);return e},async getNotebook(t,e){let s=await m.GET("/v2/projects/{ref}/notebooks/{id}",{params:{path:{ref:t,id:e}}});w(s,"Failed to retrieve notebook");let{id:a,attributes:n}=s.data.data;return{id:a,...n}},async deleteNotebook(t,e){let s=await m.DELETE("/v2/projects/{ref}/notebooks/{id}",{params:{path:{ref:t,id:e}}});w(s,"Failed to delete notebook")}},feedback:_chunkEM7YPWKEcjs.j.call(void 0, {environment:new URL(l).origin==="https://api.supabase.com"?"production":"staging",async getUserId(){return u??=await _asyncNullishCoalesce((await r.GET("/v1/profile",{signal:AbortSignal.timeout(5e3)})).response.headers.get("X-Gotrue-Id"), async () => (void 0)),u}})}}function ue(i){return i?_nullishCoalesce(new URL(i,"https://supabase.com").searchParams.get("page[after]"), () => (void 0)):void 0}function me(i){switch(i){case"api.supabase.com":return"supabase.co";case"api.supabase.green":return"supabase.green";default:return"supabase.red"}}exports.a = Ge;
|
|
2
|
-
//# sourceMappingURL=chunk-2ELO73TX.cjs.map
|