@supabase/mcp-server-supabase 0.18.0 → 0.20.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.
Files changed (57) hide show
  1. package/dist/chunk-6CWFTRTZ.js +17 -0
  2. package/dist/chunk-6CWFTRTZ.js.map +1 -0
  3. package/dist/{chunk-TK2UZS5X.cjs → chunk-A5FTNCK3.cjs} +11 -26
  4. package/dist/chunk-A5FTNCK3.cjs.map +1 -0
  5. package/dist/chunk-A64X45AF.cjs +17 -0
  6. package/dist/chunk-A64X45AF.cjs.map +1 -0
  7. package/dist/chunk-FL2XNMHU.cjs +295 -0
  8. package/dist/chunk-FL2XNMHU.cjs.map +1 -0
  9. package/dist/chunk-HNZQTPXQ.cjs +2 -0
  10. package/dist/chunk-HNZQTPXQ.cjs.map +1 -0
  11. package/dist/chunk-JJFVFIBB.js +2 -0
  12. package/dist/chunk-JJFVFIBB.js.map +1 -0
  13. package/dist/chunk-JR6WQZBY.js +295 -0
  14. package/dist/chunk-JR6WQZBY.js.map +1 -0
  15. package/dist/chunk-SS4B4LYS.js +50 -0
  16. package/dist/chunk-SS4B4LYS.js.map +1 -0
  17. package/dist/chunk-VV4YSLRO.cjs +1 -0
  18. package/dist/{chunk-PHWSETKC.cjs.map → chunk-VV4YSLRO.cjs.map} +1 -1
  19. package/dist/chunk-W6H5VMAV.js +1 -0
  20. package/dist/cli.cjs +1 -1
  21. package/dist/cli.js +1 -1
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +177 -21
  25. package/dist/index.d.ts +177 -21
  26. package/dist/index.js +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/platform/api-platform.cjs +1 -1
  29. package/dist/platform/api-platform.d.cts +1 -1
  30. package/dist/platform/api-platform.d.ts +1 -1
  31. package/dist/platform/api-platform.js +1 -1
  32. package/dist/platform/index.cjs +1 -1
  33. package/dist/platform/index.cjs.map +1 -1
  34. package/dist/platform/index.d.cts +14 -576
  35. package/dist/platform/index.d.ts +14 -576
  36. package/dist/platform/index.js +1 -1
  37. package/dist/types-Ckih0oCv.d.cts +592 -0
  38. package/dist/types-Ckih0oCv.d.ts +592 -0
  39. package/package.json +4 -2
  40. package/dist/chunk-6FWRABME.cjs +0 -2
  41. package/dist/chunk-6FWRABME.cjs.map +0 -1
  42. package/dist/chunk-BTGEP5EB.js +0 -65
  43. package/dist/chunk-BTGEP5EB.js.map +0 -1
  44. package/dist/chunk-DIWVSO7X.cjs +0 -2
  45. package/dist/chunk-DIWVSO7X.cjs.map +0 -1
  46. package/dist/chunk-DP5DAOXI.cjs +0 -295
  47. package/dist/chunk-DP5DAOXI.cjs.map +0 -1
  48. package/dist/chunk-JIUJWRLL.js +0 -2
  49. package/dist/chunk-JIUJWRLL.js.map +0 -1
  50. package/dist/chunk-LL3YUIO5.js +0 -2
  51. package/dist/chunk-LL3YUIO5.js.map +0 -1
  52. package/dist/chunk-LU6L7C36.js +0 -1
  53. package/dist/chunk-PHWSETKC.cjs +0 -1
  54. package/dist/chunk-TK2UZS5X.cjs.map +0 -1
  55. package/dist/chunk-WOFMZZMH.js +0 -295
  56. package/dist/chunk-WOFMZZMH.js.map +0 -1
  57. /package/dist/{chunk-LU6L7C36.js.map → chunk-W6H5VMAV.js.map} +0 -0
@@ -0,0 +1,17 @@
1
+ import{codeBlock as h}from"common-tags";import{normalize as f,resolve as S}from"path/posix";import{fileURLToPath as x}from"url";function w(t,o,n){return`${t}_${o}_${n}`}function j(t){return`/tmp/user_fn_${t}/`}function a(t,o){return t.startsWith(o)?t.slice(o.length):t}function E(t){try{return x(t,{windows:!1})}catch{return t}}function F({deploymentId:t,filename:o}){let n=j(t),r=S(n,o);return r=a(r,n),r=a(r,"source/"),r}var _=["deno.json","deno.jsonc","import_map.json"];function A(t){for(let o of _){let n=t.find(s=>f(s.name)===o);if(n)return n.name}}var B=h`
2
+ import "jsr:@supabase/functions-js/edge-runtime.d.ts";
3
+
4
+ Deno.serve(async (req: Request) => {
5
+ const data = {
6
+ message: "Hello there!"
7
+ };
8
+
9
+ return new Response(JSON.stringify(data), {
10
+ headers: {
11
+ 'Content-Type': 'application/json',
12
+ 'Connection': 'keep-alive'
13
+ }
14
+ });
15
+ });
16
+ `;import{z as e}from"zod/v4";var p=["us-west-1","us-east-1","us-east-2","ca-central-1","eu-west-1","eu-west-2","eu-west-3","eu-central-1","eu-central-2","eu-north-1","ap-south-1","ap-southeast-1","ap-northeast-1","ap-northeast-2","ap-southeast-2","sa-east-1"];var M=e.object({id:e.string(),name:e.string(),owner:e.string(),created_at:e.string(),updated_at:e.string(),public:e.boolean()}),U=e.object({fileSizeLimit:e.number().int().min(0).max(536870912e3),features:e.object({imageTransformation:e.object({enabled:e.boolean()}),s3Protocol:e.object({enabled:e.boolean()})})}),G=e.object({id:e.string(),name:e.string(),plan:e.string().optional(),allowed_release_channels:e.array(e.string()),opt_in_tags:e.array(e.string())}),W=e.object({id:e.string(),ref:e.string(),organization_id:e.string(),organization_slug:e.string(),name:e.string(),status:e.string(),created_at:e.string(),region:e.string()}),K=e.object({id:e.string(),name:e.string(),project_ref:e.string(),parent_project_ref:e.string(),is_default:e.boolean(),git_branch:e.string().optional(),pr_number:e.number().optional(),latest_check_run_id:e.number().optional(),persistent:e.boolean(),status:e.enum(["CREATING_PROJECT","RUNNING_MIGRATIONS","MIGRATIONS_PASSED","MIGRATIONS_FAILED","FUNCTIONS_DEPLOYED","FUNCTIONS_FAILED"]),created_at:e.string(),updated_at:e.string()}),O=e.object({id:e.string(),slug:e.string(),name:e.string(),status:e.string(),version:e.number(),created_at:e.number().optional(),updated_at:e.number().optional(),verify_jwt:e.boolean().optional(),import_map:e.boolean().optional(),import_map_path:e.string().optional(),entrypoint_path:e.string().optional()}),$=O.extend({files:e.array(e.object({name:e.string(),content:e.string()}))}),Q=e.object({name:e.string().min(1).max(256),organization_id:e.string(),region:e.enum(p),db_pass:e.string().optional()}),H=e.object({name:e.string().min(1)}),J=e.object({migration_version:e.string().optional()}),Z=e.object({name:e.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),entrypoint_path:e.string(),import_map_path:e.string().optional(),verify_jwt:e.boolean().optional(),files:e.array(e.object({name:e.string(),content:e.string()}))}),c=class extends Error{name="ResultTooLargeError"},Y=e.object({query:e.string().min(1),parameters:e.array(e.unknown()).optional(),read_only:e.boolean().optional(),max_result_bytes:e.number().int().nonnegative().optional()}),V=e.object({name:e.string().min(1),query:e.string().min(1)}),X=e.object({version:e.string(),name:e.string().optional()}),P=e.enum(["api","branch-action","postgres","edge-function","edge-function-runtime","auth","storage","realtime"]),ee=e.object({service:P,iso_timestamp_start:e.string().optional(),iso_timestamp_end:e.string().optional()}),te=e.object({sql:e.string().min(1),iso_timestamp_start:e.string().optional(),iso_timestamp_end:e.string().optional(),max_result_bytes:e.number().int().nonnegative().optional()}),oe=e.object({types:e.string()}),g=e.object({id:e.number(),username:e.string()}).nullable(),i=e.object({type:e.enum(["bar","line"]),x_column:e.string(),y_series:e.array(e.object({column:e.string()})),scale:e.enum(["linear","log"]),cumulative:e.boolean(),show_labels:e.boolean()}),d=e.object({id:e.string(),type:e.literal("markdown"),text:e.string()}),u=e.object({id:e.string(),type:e.literal("database"),sql:e.string(),row_limit:e.number(),database_identifier:e.string().optional(),title:e.string().optional(),view:e.enum(["table","chart"]).optional(),chart:i.optional()}),b=e.enum(["minute","hour","day","week","month","year"]),k=e.union([e.object({type:e.literal("absolute"),start:e.string(),end:e.string()}),e.object({type:e.literal("relative"),unit:b,amount:e.number()})]),y=e.object({id:e.string(),type:e.literal("log"),sql:e.string(),time_range:k,title:e.string().optional(),view:e.enum(["table","chart"]).optional(),chart:i.optional()}),I=e.discriminatedUnion("type",[d,u,y]),m=i.extend({y_series:e.array(i.shape.y_series.element.strict())}).strict(),l=e.string().trim().min(1,{message:"SQL must not be empty or only whitespace."}),v=e.discriminatedUnion("type",[d.omit({id:!0}).strict(),u.omit({id:!0}).extend({sql:l,row_limit:e.number().int().positive(),database_identifier:e.string().min(1).optional(),chart:m.optional()}).strict(),y.omit({id:!0}).extend({sql:l,time_range:e.discriminatedUnion("type",[e.object({type:e.literal("absolute"),start:e.iso.datetime({offset:!0}),end:e.iso.datetime({offset:!0})}).strict().refine(t=>Date.parse(t.end)>Date.parse(t.start),{message:"The end must be later than the start of the range.",path:["end"]}),e.object({type:e.literal("relative"),unit:b,amount:e.number().int().positive()}).strict()]),chart:m.optional()}).strict()]),ne=e.object({name:e.string().trim().min(1,{message:"Notebook name must not be empty or only whitespace."}),description:e.string().optional(),content:e.object({cells:e.array(v)})}),z=e.object({id:e.string(),name:e.string(),description:e.string().nullable(),favorite:e.boolean(),inserted_at:e.string(),updated_at:e.string(),owner:g,updated_by:g}),re=z.extend({content:e.object({schema_version:e.number(),cells:e.array(I)})}),ie=e.enum(["legacy","publishable"]);export{w as a,E as b,F as c,_ as d,A as e,B as f,p as g,M as h,U as i,G as j,W as k,K as l,O as m,$ as n,Q as o,H as p,J as q,Z as r,c as s,Y as t,V as u,X as v,P as w,ee as x,te as y,oe as z,I as A,ne as B,z as C,re as D,ie as E};
17
+ //# sourceMappingURL=chunk-6CWFTRTZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/edge-function.ts","../src/platform/types.ts","../src/regions.ts"],"sourcesContent":["import { codeBlock } from 'common-tags';\nimport { normalize, resolve } from 'node:path/posix';\nimport { fileURLToPath } from 'node:url';\n\n/**\n * Gets the deployment ID for an Edge Function.\n */\nexport function getDeploymentId(\n projectId: string,\n functionId: string,\n functionVersion: number\n): string {\n return `${projectId}_${functionId}_${functionVersion}`;\n}\n\n/**\n * Gets the path prefix applied to each file in an Edge Function.\n */\nexport function getPathPrefix(deploymentId: string) {\n return `/tmp/user_fn_${deploymentId}/`;\n}\n\n/**\n * Strips a prefix from a string.\n */\nfunction withoutPrefix(value: string, prefix: string) {\n return value.startsWith(prefix) ? value.slice(prefix.length) : value;\n}\n\n/**\n * Converts a `file://` URL to a path, passing through anything that isn't one.\n * Edge Function paths in metadata may sometimes be a path rather than a URL.\n */\nexport function getFilenameFromUrlOrPath(urlOrPath: string) {\n try {\n return fileURLToPath(urlOrPath, { windows: false });\n } catch {\n return urlOrPath;\n }\n}\n\n/**\n * Strips prefix from edge function file names, accounting for Deno 1 and 2.\n */\nexport function normalizeFilename({\n deploymentId,\n filename,\n}: { deploymentId: string; filename: string }) {\n const pathPrefix = getPathPrefix(deploymentId);\n\n // Deno 2 uses relative filenames, Deno 1 uses absolute. Resolve both to absolute first.\n // Resolve Deno paths the same way on Windows.\n const filenameAbsolute = resolve(pathPrefix, filename);\n\n // Strip prefix(es)\n let filenameWithoutPrefix = filenameAbsolute;\n filenameWithoutPrefix = withoutPrefix(filenameWithoutPrefix, pathPrefix);\n filenameWithoutPrefix = withoutPrefix(filenameWithoutPrefix, 'source/');\n\n return filenameWithoutPrefix;\n}\n\n/**\n * Import map file names detected in an Edge Function's root, in order of\n * precedence: `deno.json` before `deno.jsonc`, as the Supabase CLI does, then\n * the legacy `import_map.json`.\n */\nexport const DEFAULT_IMPORT_MAP_FILENAMES = [\n 'deno.json',\n 'deno.jsonc',\n 'import_map.json',\n] as const;\n\n/**\n * Picks the import map to deploy with when none was given or previously set,\n * independent of the order the files were passed in. Matches names with or\n * without a leading `./` and returns the name as given.\n */\nexport function getDefaultImportMapPath(files: { name: string }[]) {\n for (const filename of DEFAULT_IMPORT_MAP_FILENAMES) {\n const match = files.find((file) => normalize(file.name) === filename);\n if (match) {\n return match.name;\n }\n }\n}\n\nexport const edgeFunctionExample = codeBlock`\n import \"jsr:@supabase/functions-js/edge-runtime.d.ts\";\n\n Deno.serve(async (req: Request) => {\n const data = {\n message: \"Hello there!\"\n };\n \n return new Response(JSON.stringify(data), {\n headers: {\n 'Content-Type': 'application/json',\n 'Connection': 'keep-alive'\n }\n });\n });\n`;\n","import type { InitData } from '@supabase/mcp-utils';\nimport { z } from 'zod/v4';\nimport { AWS_REGION_CODES } from '../regions.js';\n\nexport type SuccessResponse = {\n success: true;\n};\n\nexport const storageBucketSchema = z.object({\n id: z.string(),\n name: z.string(),\n owner: z.string(),\n created_at: z.string(),\n updated_at: z.string(),\n public: z.boolean(),\n});\n\nexport const storageConfigSchema = z.object({\n fileSizeLimit: z.number().int().min(0).max(536_870_912_000), // 500GB\n features: z.object({\n imageTransformation: z.object({ enabled: z.boolean() }),\n s3Protocol: z.object({ enabled: z.boolean() }),\n }),\n});\n\nexport const organizationSchema = z.object({\n id: z.string(),\n name: z.string(),\n plan: z.string().optional(),\n allowed_release_channels: z.array(z.string()),\n opt_in_tags: z.array(z.string()),\n});\n\nexport const projectSchema = z.object({\n id: z.string(),\n ref: z.string(),\n organization_id: z.string(),\n organization_slug: z.string(),\n name: z.string(),\n status: z.string(),\n created_at: z.string(),\n region: z.string(),\n});\n\nexport const branchSchema = z.object({\n id: z.string(),\n name: z.string(),\n project_ref: z.string(),\n parent_project_ref: z.string(),\n is_default: z.boolean(),\n git_branch: z.string().optional(),\n pr_number: z.number().optional(),\n latest_check_run_id: z.number().optional(),\n persistent: z.boolean(),\n status: z.enum([\n 'CREATING_PROJECT',\n 'RUNNING_MIGRATIONS',\n 'MIGRATIONS_PASSED',\n 'MIGRATIONS_FAILED',\n 'FUNCTIONS_DEPLOYED',\n 'FUNCTIONS_FAILED',\n ]),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport const edgeFunctionSchema = z.object({\n id: z.string(),\n slug: z.string(),\n name: z.string(),\n status: z.string(),\n version: z.number(),\n created_at: z.number().optional(),\n updated_at: z.number().optional(),\n verify_jwt: z.boolean().optional(),\n import_map: z.boolean().optional(),\n import_map_path: z.string().optional(),\n entrypoint_path: z.string().optional(),\n});\n\nexport const edgeFunctionWithBodySchema = edgeFunctionSchema.extend({\n files: z.array(\n z.object({\n name: z.string(),\n content: z.string(),\n })\n ),\n});\n\nexport const createProjectOptionsSchema = z.object({\n name: z.string().min(1).max(256),\n organization_id: z.string(),\n region: z.enum(AWS_REGION_CODES),\n db_pass: z.string().optional(),\n});\n\nexport const createBranchOptionsSchema = z.object({\n name: z.string().min(1),\n});\n\nexport const resetBranchOptionsSchema = z.object({\n migration_version: z.string().optional(),\n});\n\nexport const deployEdgeFunctionOptionsSchema = z.object({\n name: z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),\n entrypoint_path: z.string(),\n import_map_path: z.string().optional(),\n verify_jwt: z.boolean().optional(),\n files: z.array(\n z.object({\n name: z.string(),\n content: z.string(),\n })\n ),\n});\n\nexport class ResultTooLargeError extends Error {\n override name = 'ResultTooLargeError';\n}\n\nexport const executeSqlOptionsSchema = z.object({\n query: z.string().min(1),\n parameters: z.array(z.unknown()).optional(),\n read_only: z.boolean().optional(),\n /**\n * Largest result, in bytes of JSON, the caller will use. Platforms that\n * buffer results in shared server memory should stop reading at this limit\n * and throw an error whose name is 'ResultTooLargeError'. Callers also check\n * the rows they get back.\n */\n max_result_bytes: z.number().int().nonnegative().optional(),\n});\n\nexport const applyMigrationOptionsSchema = z.object({\n name: z.string().min(1),\n query: z.string().min(1),\n});\n\nexport const migrationSchema = z.object({\n version: z.string(),\n name: z.string().optional(),\n});\n\nexport const logsServiceSchema = z.enum([\n 'api',\n 'branch-action',\n 'postgres',\n 'edge-function',\n 'edge-function-runtime',\n 'auth',\n 'storage',\n 'realtime',\n]);\n\nexport const getLogsOptionsSchema = z.object({\n service: logsServiceSchema,\n iso_timestamp_start: z.string().optional(),\n iso_timestamp_end: z.string().optional(),\n});\n\nexport const queryLogsOptionsSchema = z.object({\n sql: z.string().min(1),\n iso_timestamp_start: z.string().optional(),\n iso_timestamp_end: z.string().optional(),\n /**\n * Stop reading the response once it exceeds this many bytes and fail the\n * call with an error whose name is 'ResultTooLargeError'. Omitted means no\n * limit; callers still check the rows they get back.\n */\n max_result_bytes: z.number().int().nonnegative().optional(),\n});\n\nexport const generateTypescriptTypesResultSchema = z.object({\n types: z.string(),\n});\n\nconst notebookUserSchema = z\n .object({\n id: z.number(),\n username: z.string(),\n })\n .nullable();\n\nconst notebookChartConfigSchema = z.object({\n type: z.enum(['bar', 'line']),\n x_column: z.string(),\n y_series: z.array(z.object({ column: z.string() })),\n scale: z.enum(['linear', 'log']),\n cumulative: z.boolean(),\n show_labels: z.boolean(),\n});\n\nconst notebookMarkdownCellSchema = z.object({\n id: z.string(),\n type: z.literal('markdown'),\n text: z.string(),\n});\n\nconst notebookDatabaseCellSchema = z.object({\n id: z.string(),\n type: z.literal('database'),\n sql: z.string(),\n row_limit: z.number(),\n database_identifier: z.string().optional(),\n title: z.string().optional(),\n view: z.enum(['table', 'chart']).optional(),\n chart: notebookChartConfigSchema.optional(),\n});\n\nconst notebookLogTimeUnitSchema = z.enum([\n 'minute',\n 'hour',\n 'day',\n 'week',\n 'month',\n 'year',\n]);\n\nconst notebookLogTimeRangeSchema = z.union([\n z.object({\n type: z.literal('absolute'),\n start: z.string(),\n end: z.string(),\n }),\n z.object({\n type: z.literal('relative'),\n unit: notebookLogTimeUnitSchema,\n amount: z.number(),\n }),\n]);\n\nconst notebookLogCellSchema = z.object({\n id: z.string(),\n type: z.literal('log'),\n sql: z.string(),\n time_range: notebookLogTimeRangeSchema,\n title: z.string().optional(),\n view: z.enum(['table', 'chart']).optional(),\n chart: notebookChartConfigSchema.optional(),\n});\n\nexport const notebookCellSchema = z.discriminatedUnion('type', [\n notebookMarkdownCellSchema,\n notebookDatabaseCellSchema,\n notebookLogCellSchema,\n]);\n\n// Cell keys to create, without server-assigned ids. Stricter than the read\n// schemas above, so a misspelled cell key fails instead of being dropped.\nconst newNotebookChartConfigSchema = notebookChartConfigSchema\n .extend({\n y_series: z.array(\n notebookChartConfigSchema.shape.y_series.element.strict()\n ),\n })\n .strict();\n\n// Trimming runs before the length check, so a whitespace-only string fails\n// here even though it satisfies the advertised `minLength: 1`. Say so instead\n// of zod's default \"expected string to have >=1 characters\".\nconst newNotebookSqlSchema = z\n .string()\n .trim()\n .min(1, { message: 'SQL must not be empty or only whitespace.' });\n\nconst newNotebookCellSchema = z.discriminatedUnion('type', [\n notebookMarkdownCellSchema.omit({ id: true }).strict(),\n notebookDatabaseCellSchema\n .omit({ id: true })\n .extend({\n sql: newNotebookSqlSchema,\n row_limit: z.number().int().positive(),\n database_identifier: z.string().min(1).optional(),\n chart: newNotebookChartConfigSchema.optional(),\n })\n .strict(),\n notebookLogCellSchema\n .omit({ id: true })\n .extend({\n sql: newNotebookSqlSchema,\n time_range: z.discriminatedUnion('type', [\n z\n .object({\n type: z.literal('absolute'),\n start: z.iso.datetime({ offset: true }),\n end: z.iso.datetime({ offset: true }),\n })\n .strict()\n .refine((range) => Date.parse(range.end) > Date.parse(range.start), {\n message: 'The end must be later than the start of the range.',\n path: ['end'],\n }),\n z\n .object({\n type: z.literal('relative'),\n unit: notebookLogTimeUnitSchema,\n amount: z.number().int().positive(),\n })\n .strict(),\n ]),\n chart: newNotebookChartConfigSchema.optional(),\n })\n .strict(),\n]);\n\nexport const createNotebookOptionsSchema = z.object({\n name: z\n .string()\n .trim()\n .min(1, { message: 'Notebook name must not be empty or only whitespace.' }),\n description: z.string().optional(),\n content: z.object({\n cells: z.array(newNotebookCellSchema),\n }),\n});\n\nexport const notebookSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().nullable(),\n favorite: z.boolean(),\n inserted_at: z.string(),\n updated_at: z.string(),\n owner: notebookUserSchema,\n updated_by: notebookUserSchema,\n});\n\nexport const notebookWithContentSchema = notebookSchema.extend({\n content: z.object({\n schema_version: z.number(),\n cells: z.array(notebookCellSchema),\n }),\n});\n\nexport type Organization = z.infer<typeof organizationSchema>;\nexport type Project = z.infer<typeof projectSchema>;\nexport type Branch = z.infer<typeof branchSchema>;\nexport type EdgeFunction = z.infer<typeof edgeFunctionSchema>;\nexport type EdgeFunctionWithBody = z.infer<typeof edgeFunctionWithBodySchema>;\n\nexport type CreateProjectOptions = z.infer<typeof createProjectOptionsSchema>;\nexport type CreateBranchOptions = z.infer<typeof createBranchOptionsSchema>;\nexport type ResetBranchOptions = z.infer<typeof resetBranchOptionsSchema>;\nexport type DeployEdgeFunctionOptions = z.infer<\n typeof deployEdgeFunctionOptionsSchema\n>;\n\nexport type ExecuteSqlOptions = z.infer<typeof executeSqlOptionsSchema>;\nexport type ApplyMigrationOptions = z.infer<typeof applyMigrationOptionsSchema>;\nexport type Migration = z.infer<typeof migrationSchema>;\nexport type ListMigrationsResult = z.infer<typeof migrationSchema>;\n\nexport type LogsService = z.infer<typeof logsServiceSchema>;\nexport type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;\nexport type QueryLogsOptions = z.infer<typeof queryLogsOptionsSchema>;\nexport type GenerateTypescriptTypesResult = z.infer<\n typeof generateTypescriptTypesResultSchema\n>;\n\nexport type StorageConfig = z.infer<typeof storageConfigSchema>;\nexport type StorageBucket = z.infer<typeof storageBucketSchema>;\n\nexport type NotebookCell = z.infer<typeof notebookCellSchema>;\nexport type CreateNotebookOptions = z.infer<typeof createNotebookOptionsSchema>;\nexport type Notebook = z.infer<typeof notebookSchema>;\nexport type NotebookWithContent = z.infer<typeof notebookWithContentSchema>;\n\nexport type DatabaseOperations = {\n executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;\n listMigrations(projectId: string): Promise<Migration[]>;\n applyMigration(\n projectId: string,\n options: ApplyMigrationOptions\n ): Promise<void>;\n};\n\nexport type AccountOperations = {\n listOrganizations(): Promise<{ id: string; slug: string; name: string }[]>;\n getOrganization(organizationId: string): Promise<Organization>;\n listProjects(): Promise<Project[]>;\n getProject(projectId: string): Promise<Project>;\n createProject(options: CreateProjectOptions): Promise<Project>;\n pauseProject(projectId: string): Promise<void>;\n restoreProject(projectId: string): Promise<void>;\n};\n\nexport type EdgeFunctionsOperations = {\n listEdgeFunctions(projectId: string): Promise<EdgeFunction[]>;\n getEdgeFunction(\n projectId: string,\n functionSlug: string\n ): Promise<EdgeFunctionWithBody>;\n deployEdgeFunction(\n projectId: string,\n options: DeployEdgeFunctionOptions\n ): Promise<Omit<EdgeFunction, 'files'>>;\n};\n\n/**\n * SQL dialect that a platform's logs endpoint speaks. Selects the\n * dialect-appropriate `query_logs` description and `sql` parameter hint so a\n * single tool can roll out across environments that back logs with different\n * engines (hosted ClickHouse vs. self-hosted/CLI BigQuery).\n */\nexport type LogsDialect = 'clickhouse' | 'bigquery';\n\nexport type DebuggingOperations = {\n /**\n * SQL dialect accepted by `queryLogs`. Defaults to `'clickhouse'` when unset,\n * preserving the behavior of platforms that predate this field.\n */\n logsDialect?: LogsDialect;\n getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;\n queryLogs?(projectId: string, options: QueryLogsOptions): Promise<unknown>;\n getSecurityAdvisors(\n projectId: string,\n options?: { includeUnavailable?: boolean }\n ): Promise<unknown>;\n getPerformanceAdvisors(\n projectId: string,\n options?: { includeUnavailable?: boolean }\n ): Promise<unknown>;\n getHealthAdvisors?(\n projectId: string,\n options?: { includeUnavailable?: boolean }\n ): Promise<unknown>;\n};\n\nexport const apiKeyTypeSchema = z.enum(['legacy', 'publishable']);\nexport type ApiKeyType = z.infer<typeof apiKeyTypeSchema>;\n\nexport type ApiKey = {\n api_key: string;\n name: string;\n type: ApiKeyType;\n description?: string;\n id?: string;\n disabled?: boolean;\n};\n\nexport type GenerateTypescriptTypesOptions = {\n /** Schemas to generate types for. Omitted means the API default (`public`). */\n schemas?: string[];\n};\n\nexport type DevelopmentOperations = {\n getProjectUrl(projectId: string): Promise<string>;\n getPublishableKeys(projectId: string): Promise<ApiKey[]>;\n generateTypescriptTypes(\n projectId: string,\n options?: GenerateTypescriptTypesOptions\n ): Promise<GenerateTypescriptTypesResult>;\n};\n\nexport type StorageOperations = {\n getStorageConfig(projectId: string): Promise<StorageConfig>;\n updateStorageConfig(projectId: string, config: StorageConfig): Promise<void>;\n listAllBuckets(projectId: string): Promise<StorageBucket[]>;\n};\n\nexport type BranchingOperations = {\n listBranches(projectId: string): Promise<Branch[]>;\n createBranch(\n projectId: string,\n options: CreateBranchOptions\n ): Promise<Branch>;\n deleteBranch(branchId: string): Promise<void>;\n mergeBranch(branchId: string): Promise<void>;\n resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;\n rebaseBranch(branchId: string): Promise<void>;\n};\n\n/**\n * Returns only the `updated_at` timestamp of the named secret, never its\n * value or digest.\n */\nexport type SecretOperations = {\n getUpdatedAt(projectId: string, name: string): Promise<Date | undefined>;\n};\n\nexport type NotebookOperations = {\n /** Optional for platforms that only support reading notebooks. */\n createNotebook?(\n projectId: string,\n options: CreateNotebookOptions\n ): Promise<NotebookWithContent>;\n listNotebooks(projectId: string): Promise<Notebook[]>;\n getNotebook(\n projectId: string,\n notebookId: string\n ): Promise<NotebookWithContent>;\n deleteNotebook(projectId: string, notebookId: string): Promise<void>;\n};\n\nexport type FeedbackOperations = {\n submit(input: {\n feedback: string;\n projectId?: string;\n clientInfo?: { name: string; version: string };\n }): Promise<{ deleteToken: string }>;\n delete(input: {\n deleteToken: string;\n projectId?: string;\n }): Promise<{ deleted: boolean }>;\n};\n\nexport type SupabasePlatform = {\n init?(info: InitData): Promise<void>;\n account?: AccountOperations;\n database?: DatabaseOperations;\n functions?: EdgeFunctionsOperations;\n debugging?: DebuggingOperations;\n development?: DevelopmentOperations;\n storage?: StorageOperations;\n branching?: BranchingOperations;\n secrets?: SecretOperations;\n notebooks?: NotebookOperations;\n feedback?: FeedbackOperations;\n};\n","export const AWS_REGION_CODES = [\n 'us-west-1',\n 'us-east-1',\n 'us-east-2',\n 'ca-central-1',\n 'eu-west-1',\n 'eu-west-2',\n 'eu-west-3',\n 'eu-central-1',\n 'eu-central-2',\n 'eu-north-1',\n 'ap-south-1',\n 'ap-southeast-1',\n 'ap-northeast-1',\n 'ap-northeast-2',\n 'ap-southeast-2',\n 'sa-east-1',\n] as const;\n"],"mappings":"AAAA,OAAS,aAAAA,MAAiB,cAC1B,OAAS,aAAAC,EAAW,WAAAC,MAAe,aACnC,OAAS,iBAAAC,MAAqB,MAKvB,SAASC,EACdC,EACAC,EACAC,EACQ,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AI,EAAG,CAAE,QAAS,qDAAsD,CAAC,EAC5E,YAAaA,EAAE,OAAO,EAAE,SAAS,EACjC,QAASA,EAAE,OAAO,CAChB,MAAOA,EAAE,MAAM8B,CAAqB,CACtC,CAAC,CACH,CAAC,EAEYG,EAAiBjC,EAAE,OAAO,CACrC,GAAIA,EAAE,OAAO,EACb,KAAMA,EAAE,OAAO,EACf,YAAaA,EAAE,OAAO,EAAE,SAAS,EACjC,SAAUA,EAAE,QAAQ,EACpB,YAAaA,EAAE,OAAO,EACtB,WAAYA,EAAE,OAAO,EACrB,MAAOoB,EACP,WAAYA,CACd,CAAC,EAEYc,GAA4BD,EAAe,OAAO,CAC7D,QAASjC,EAAE,OAAO,CAChB,eAAgBA,EAAE,OAAO,EACzB,MAAOA,EAAE,MAAM2B,CAAkB,CACnC,CAAC,CACH,CAAC,EAgGYQ,GAAmBnC,EAAE,KAAK,CAAC,SAAU,aAAa,CAAC","names":["codeBlock","normalize","resolve","fileURLToPath","getDeploymentId","projectId","functionId","functionVersion","getPathPrefix","deploymentId","withoutPrefix","value","prefix","getFilenameFromUrlOrPath","urlOrPath","normalizeFilename","filename","pathPrefix","filenameWithoutPrefix","DEFAULT_IMPORT_MAP_FILENAMES","getDefaultImportMapPath","files","match","file","edgeFunctionExample","z","AWS_REGION_CODES","storageBucketSchema","z","storageConfigSchema","organizationSchema","projectSchema","branchSchema","edgeFunctionSchema","edgeFunctionWithBodySchema","createProjectOptionsSchema","AWS_REGION_CODES","createBranchOptionsSchema","resetBranchOptionsSchema","deployEdgeFunctionOptionsSchema","ResultTooLargeError","executeSqlOptionsSchema","applyMigrationOptionsSchema","migrationSchema","logsServiceSchema","getLogsOptionsSchema","queryLogsOptionsSchema","generateTypescriptTypesResultSchema","notebookUserSchema","notebookChartConfigSchema","notebookMarkdownCellSchema","notebookDatabaseCellSchema","notebookLogTimeUnitSchema","notebookLogTimeRangeSchema","notebookLogCellSchema","notebookCellSchema","newNotebookChartConfigSchema","newNotebookSqlSchema","newNotebookCellSchema","range","createNotebookOptionsSchema","notebookSchema","notebookWithContentSchema","apiKeyTypeSchema"]}
@@ -1,65 +1,50 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; } async function _asyncOptionalChain(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 = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var g={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.18.0",description:"MCP server for interacting with Supabase",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/supabase/mcp.git"},type:"module",main:"dist/index.cjs",types:"dist/index.d.ts",sideEffects:!1,scripts:{build:"tsup --clean",dev:"tsup --watch",typecheck:"tsc --noEmit",prebuild:"pnpm typecheck",prepublishOnly:"pnpm build","registry:update":"tsx scripts/registry/update-version.ts && biome format --write server.json","registry:login":"scripts/registry/login.sh","registry:publish":"mcp-publisher publish",test:"vitest","test:unit":"vitest --project unit","test:e2e":"vitest --project e2e","test:integration":"vitest --project integration","test:coverage":"vitest --coverage","generate:management-api-types":"node scripts/generate-management-api-types.mjs"},files:["dist/**/*"],bin:{"mcp-server-supabase":"./dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.cjs"},"./platform":{types:"./dist/platform/index.d.ts",import:"./dist/platform/index.js",default:"./dist/platform/index.cjs"},"./platform/api":{types:"./dist/platform/api-platform.d.ts",import:"./dist/platform/api-platform.js",default:"./dist/platform/api-platform.cjs"}},dependencies:{"@mjackson/multipart-parser":"^0.10.1","@modelcontextprotocol/node":"catalog:","@supabase/mcp-utils":"workspace:^","common-tags":"^1.8.2",gqlmin:"^0.3.1",graphql:"^16.11.0","openapi-fetch":"^0.13.5"},peerDependencies:{"@modelcontextprotocol/server":"catalog:",zod:"catalog:"},devDependencies:{"@ai-sdk/anthropic":"catalog:","@ai-sdk/mcp":"catalog:","@electric-sql/pglite":"^0.2.17","@modelcontextprotocol/client":"catalog:","@modelcontextprotocol/ext-apps":"^2.0.4","@modelcontextprotocol/server":"catalog:","@supabase/mcp-ui":"workspace:*","@total-typescript/tsconfig":"^1.0.4","@types/common-tags":"^1.8.4","@types/node":"^22.8.6","@vitest/coverage-v8":"^2.1.9",ai:"catalog:","date-fns":"^4.1.0",dotenv:"^16.5.0",msw:"^2.7.3",nanoid:"^5.1.5","openapi-typescript":"^7.5.0","openapi-typescript-helpers":"^0.0.15",prettier:"^3.3.3",tsup:"^8.3.5",tsx:"^4.19.2",typescript:"^5.6.3",vite:"^5.4.19",vitest:"^2.1.9",zod:"catalog:"}};var _commontags = require('common-tags');var _posix = require('path/posix');var _url = require('url');function D(e,t,s){return`${e}_${t}_${s}`}function x(e){return`/tmp/user_fn_${e}/`}function f(e,t){return e.startsWith(t)?e.slice(t.length):e}function I(e){try{return _url.fileURLToPath.call(void 0, e,{windows:!1})}catch (e2){return e}}function N({deploymentId:e,filename:t}){let s=x(e),a=_posix.resolve.call(void 0, s,t);return a=f(a,s),a=f(a,"source/"),a}var q=_commontags.codeBlock`
2
- import "jsr:@supabase/functions-js/edge-runtime.d.ts";
3
-
4
- Deno.serve(async (req: Request) => {
5
- const data = {
6
- message: "Hello there!"
7
- };
8
-
9
- return new Response(JSON.stringify(data), {
10
- headers: {
11
- 'Content-Type': 'application/json',
12
- 'Connection': 'keep-alive'
13
- }
14
- });
15
- });
16
- `;var _mcputils = require('@supabase/mcp-utils');function P(e,t=100){switch(e){case"api":return _commontags.stripIndent`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; } async function _asyncOptionalChain(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 = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var u={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.20.0",description:"MCP server for interacting with Supabase",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/supabase/mcp.git"},type:"module",main:"dist/index.cjs",types:"dist/index.d.ts",sideEffects:!1,scripts:{build:"tsup --clean",dev:"tsup --watch",typecheck:"tsc --noEmit",prebuild:"pnpm typecheck",prepublishOnly:"pnpm build","registry:update":"tsx scripts/registry/update-version.ts && biome format --write server.json","registry:login":"scripts/registry/login.sh","registry:publish":"mcp-publisher publish",test:"vitest","test:unit":"vitest --project unit","test:e2e":"vitest --project e2e","test:integration":"vitest --project integration","test:coverage":"vitest --coverage","mock-api":"tsx dev/mock-api.ts","typecheck:dev":"tsc --noEmit -p dev/tsconfig.json","generate:management-api-types":"node scripts/generate-management-api-types.mjs"},files:["dist/**/*"],bin:{"mcp-server-supabase":"./dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.cjs"},"./platform":{types:"./dist/platform/index.d.ts",import:"./dist/platform/index.js",default:"./dist/platform/index.cjs"},"./platform/api":{types:"./dist/platform/api-platform.d.ts",import:"./dist/platform/api-platform.js",default:"./dist/platform/api-platform.cjs"}},dependencies:{"@mjackson/multipart-parser":"^0.10.1","@modelcontextprotocol/node":"catalog:","@supabase/mcp-utils":"workspace:^","common-tags":"^1.8.2",gqlmin:"^0.3.1",graphql:"^16.11.0","openapi-fetch":"^0.13.5"},peerDependencies:{"@modelcontextprotocol/server":"catalog:",zod:"catalog:"},devDependencies:{"@ai-sdk/anthropic":"catalog:","@ai-sdk/mcp":"catalog:","@electric-sql/pglite":"^0.2.17","@modelcontextprotocol/client":"catalog:","@modelcontextprotocol/ext-apps":"^2.0.4","@modelcontextprotocol/server":"catalog:","@supabase/mcp-ui":"workspace:*","@total-typescript/tsconfig":"^1.0.4","@types/common-tags":"^1.8.4","@types/node":"^22.8.6","@vitest/coverage-v8":"^2.1.9",ai:"catalog:","date-fns":"^4.1.0",dotenv:"^16.5.0",msw:"^2.7.3",nanoid:"^5.1.5","openapi-typescript":"^7.5.0","openapi-typescript-helpers":"^0.0.15",prettier:"^3.3.3",tsup:"^8.3.5",tsx:"^4.19.2",typescript:"^5.6.3",vite:"^5.4.19",vitest:"^2.1.9",zod:"catalog:"}};var _commontags = require('common-tags');var _mcputils = require('@supabase/mcp-utils');function k(t,e=100){switch(t){case"api":return _commontags.stripIndent`
17
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
18
3
  from logs
19
4
  where source = 'edge_logs'
20
5
  order by timestamp desc
21
- limit ${t}
6
+ limit ${e}
22
7
  `;case"branch-action":return _commontags.stripIndent`
23
8
  select log_attributes['workflow_run'] as workflow_run, timestamp, id, event_message
24
9
  from logs
25
10
  where source = 'workflow_run_logs'
26
11
  order by timestamp desc
27
- limit ${t}
12
+ limit ${e}
28
13
  `;case"postgres":return _commontags.stripIndent`
29
14
  select log_attributes['identifier'] as identifier, timestamp, id, event_message, log_attributes['parsed.error_severity'] as error_severity
30
15
  from logs
31
16
  where source = 'postgres_logs'
32
17
  order by timestamp desc
33
- limit ${t}
18
+ limit ${e}
34
19
  `;case"edge-function":return _commontags.stripIndent`
35
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
36
21
  from logs
37
22
  where source = 'function_edge_logs'
38
23
  order by timestamp desc
39
- limit ${t}
24
+ limit ${e}
40
25
  `;case"edge-function-runtime":return _commontags.stripIndent`
41
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
42
27
  from logs
43
28
  where source = 'function_logs'
44
29
  order by timestamp desc
45
- limit ${t}
30
+ limit ${e}
46
31
  `;case"auth":return _commontags.stripIndent`
47
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
48
33
  from logs
49
34
  where source = 'auth_logs'
50
35
  order by timestamp desc
51
- limit ${t}
36
+ limit ${e}
52
37
  `;case"storage":return _commontags.stripIndent`
53
38
  select id, timestamp, event_message
54
39
  from logs
55
40
  where source = 'storage_logs'
56
41
  order by timestamp desc
57
- limit ${t}
42
+ limit ${e}
58
43
  `;case"realtime":return _commontags.stripIndent`
59
44
  select id, timestamp, event_message
60
45
  from logs
61
46
  where source = 'realtime_logs'
62
47
  order by timestamp desc
63
- limit ${t}
64
- `;default:throw new Error(`unsupported log service type: ${e}`)}}var _=1440*60*1e3;function R(e,t){let s=t?Date.parse(t):Date.now();if(Number.isNaN(s))throw new (0, _mcputils.ToolCallerError)(`Invalid iso_timestamp_end: "${t}". Expected an ISO 8601 timestamp.`);let i=e?Date.parse(e):s-_;if(Number.isNaN(i))throw new (0, _mcputils.ToolCallerError)(`Invalid iso_timestamp_start: "${e}". Expected an ISO 8601 timestamp.`);if(i>=s)throw new (0, _mcputils.ToolCallerError)("iso_timestamp_start must be before iso_timestamp_end.");if(s-i>_)throw new (0, _mcputils.ToolCallerError)("The log window can be at most 24 hours.");return{iso_timestamp_start:new Date(i).toISOString(),iso_timestamp_end:new Date(s).toISOString()}}var k={production:{url:"https://xguihxuzqibwxjnimxev.supabase.co",key:"sb_publishable__4DBgvrDe7ec234wnvCAog_LPzBtkQe"},staging:{url:"https://actixlblmrqglneypada.supabase.co",key:"sb_publishable_wLdx7w89KWFq-39s4emmnA__9XR9r-_"}},j=1e4;function M({environment:e="production",fetch:t=globalThis.fetch,getUserId:s}={}){let{url:i,key:a}=k[e];async function d(){try{return await _optionalChain([s, 'optionalCall', _2 => _2()])}catch (e3){return}}async function u(c,n,r){let p=await t(`${i}/rest/v1/${c}`,{...n,headers:{apikey:a,"Content-Type":"application/json",...n.headers},signal:AbortSignal.timeout(j)});if(!p.ok)throw new Error(`Failed to ${r}: ${p.status} ${await p.text()}`);return p}return{async submit({feedback:c,projectId:n,clientInfo:r}){let p=await d(),m=await(await u("rpc/submit_interfaces_feedback",{method:"POST",body:JSON.stringify({feedback:c,user_agent:`supabase-mcp/${g.version}`,user_id:p,project_ref:n,metadata:{source:"mcp",...r&&{client_name:r.name,client_version:r.version}}})},"submit feedback")).json();if(typeof m!="string"||m.length===0)throw new Error("Failed to submit feedback: no delete token returned");return{deleteToken:m}},async delete({deleteToken:c,projectId:n}){let r=await d();return{deleted:await _asyncOptionalChain([(await u(`interfaces_feedback?delete_token=eq.${encodeURIComponent(c)}`,{method:"DELETE",headers:{Prefer:"count=exact","x-feedback-token":c,...n&&{"x-feedback-project-ref":n},...r&&{"x-feedback-user-id":r}}},"delete feedback")), 'access', async _3 => _3.headers, 'access', async _4 => _4.get, 'call', async _5 => _5("Content-Range"), 'optionalAccess', async _6 => _6.split, 'call', async _7 => _7("/"), 'access', async _8 => _8[1]])==="1"}}}}exports.a = g; exports.b = D; exports.c = I; exports.d = N; exports.e = q; exports.f = P; exports.g = R; exports.h = M;
65
- //# sourceMappingURL=chunk-TK2UZS5X.cjs.map
48
+ limit ${e}
49
+ `;default:throw new Error(`unsupported log service type: ${t}`)}}var g=1440*60*1e3;function E(t,e){let o=e?Date.parse(e):Date.now();if(Number.isNaN(o))throw new (0, _mcputils.ToolCallerError)(`Invalid iso_timestamp_end: "${e}". Expected an ISO 8601 timestamp.`);let n=t?Date.parse(t):o-g;if(Number.isNaN(n))throw new (0, _mcputils.ToolCallerError)(`Invalid iso_timestamp_start: "${t}". Expected an ISO 8601 timestamp.`);if(n>=o)throw new (0, _mcputils.ToolCallerError)("iso_timestamp_start must be before iso_timestamp_end.");if(o-n>g)throw new (0, _mcputils.ToolCallerError)("The log window can be at most 24 hours.");return{iso_timestamp_start:new Date(n).toISOString(),iso_timestamp_end:new Date(o).toISOString()}}var y={production:{url:"https://xguihxuzqibwxjnimxev.supabase.co",key:"sb_publishable__4DBgvrDe7ec234wnvCAog_LPzBtkQe"},staging:{url:"https://actixlblmrqglneypada.supabase.co",key:"sb_publishable_wLdx7w89KWFq-39s4emmnA__9XR9r-_"}},h=1e4;function O({environment:t="production",fetch:e=globalThis.fetch,getUserId:o}={}){let{url:n,key:_}=y[t];async function l(){try{return await _optionalChain([o, 'optionalCall', _2 => _2()])}catch (e2){return}}async function m(p,i,s){let a=await e(`${n}/rest/v1/${p}`,{...i,headers:{apikey:_,"Content-Type":"application/json",...i.headers},signal:AbortSignal.timeout(h)});if(!a.ok)throw new Error(`Failed to ${s}: ${a.status} ${await a.text()}`);return a}return{async submit({feedback:p,projectId:i,clientInfo:s}){let a=await l(),d=await(await m("rpc/submit_interfaces_feedback",{method:"POST",body:JSON.stringify({feedback:p,user_agent:`supabase-mcp/${u.version}`,user_id:a,project_ref:i,metadata:{source:"mcp",...s&&{client_name:s.name,client_version:s.version}}})},"submit feedback")).json();if(typeof d!="string"||d.length===0)throw new Error("Failed to submit feedback: no delete token returned");return{deleteToken:d}},async delete({deleteToken:p,projectId:i}){let s=await l();return{deleted:await _asyncOptionalChain([(await m(`interfaces_feedback?delete_token=eq.${encodeURIComponent(p)}`,{method:"DELETE",headers:{Prefer:"count=exact","x-feedback-token":p,...i&&{"x-feedback-project-ref":i},...s&&{"x-feedback-user-id":s}}},"delete feedback")), 'access', async _3 => _3.headers, 'access', async _4 => _4.get, 'call', async _5 => _5("Content-Range"), 'optionalAccess', async _6 => _6.split, 'call', async _7 => _7("/"), 'access', async _8 => _8[1]])==="1"}}}}exports.a = u; exports.b = k; exports.c = E; exports.d = O;
50
+ //# sourceMappingURL=chunk-A5FTNCK3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../package.json","../src/logs.ts"],"names":["package_default","getClickHouseLogQuery","service","limit","stripIndent"],"mappings":"AAAA,4mCAAAA,CAAAA,CAAA,CACE,IAAA,CAAQ,+BAAA,CACR,OAAA,CAAW,kBAAA,CACX,OAAA,CAAW,QAAA,CACX,WAAA,CAAe,0CAAA,CACf,OAAA,CAAW,YAAA,CACX,UAAA,CAAc,CACZ,IAAA,CAAQ,KAAA,CACR,GAAA,CAAO,qCACT,CAAA,CACA,IAAA,CAAQ,QAAA,CACR,IAAA,CAAQ,gBAAA,CACR,KAAA,CAAS,iBAAA,CACT,WAAA,CAAe,CAAA,CAAA,CACf,OAAA,CAAW,CACT,KAAA,CAAS,cAAA,CACT,GAAA,CAAO,cAAA,CACP,SAAA,CAAa,cAAA,CACb,QAAA,CAAY,gBAAA,CACZ,cAAA,CAAkB,YAAA,CAClB,iBAAA,CAAmB,4EAAA,CACnB,gBAAA,CAAkB,2BAAA,CAClB,kBAAA,CAAoB,uBAAA,CACpB,IAAA,CAAQ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B,IAAK,UAAA,CACH,OAAOC,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,OAAA,CACE,MAAM,IAAI,KAAA,CAAM,CAAA,8BAAA,EAAiCD,CAAO,CAAA,CAAA","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/chunk-A5FTNCK3.cjs","sourcesContent":["{\n \"name\": \"@supabase/mcp-server-supabase\",\n \"mcpName\": \"com.supabase/mcp\",\n \"version\": \"0.20.0\",\n \"description\": \"MCP server for interacting with Supabase\",\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/supabase/mcp.git\"\n },\n \"type\": \"module\",\n \"main\": \"dist/index.cjs\",\n \"types\": \"dist/index.d.ts\",\n \"sideEffects\": false,\n \"scripts\": {\n \"build\": \"tsup --clean\",\n \"dev\": \"tsup --watch\",\n \"typecheck\": \"tsc --noEmit\",\n \"prebuild\": \"pnpm typecheck\",\n \"prepublishOnly\": \"pnpm build\",\n \"registry:update\": \"tsx scripts/registry/update-version.ts && biome format --write server.json\",\n \"registry:login\": \"scripts/registry/login.sh\",\n \"registry:publish\": \"mcp-publisher publish\",\n \"test\": \"vitest\",\n \"test:unit\": \"vitest --project unit\",\n \"test:e2e\": \"vitest --project e2e\",\n \"test:integration\": \"vitest --project integration\",\n \"test:coverage\": \"vitest --coverage\",\n \"mock-api\": \"tsx dev/mock-api.ts\",\n \"typecheck:dev\": \"tsc --noEmit -p dev/tsconfig.json\",\n \"generate:management-api-types\": \"node scripts/generate-management-api-types.mjs\"\n },\n \"files\": [\n \"dist/**/*\"\n ],\n \"bin\": {\n \"mcp-server-supabase\": \"./dist/cli.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.cjs\"\n },\n \"./platform\": {\n \"types\": \"./dist/platform/index.d.ts\",\n \"import\": \"./dist/platform/index.js\",\n \"default\": \"./dist/platform/index.cjs\"\n },\n \"./platform/api\": {\n \"types\": \"./dist/platform/api-platform.d.ts\",\n \"import\": \"./dist/platform/api-platform.js\",\n \"default\": \"./dist/platform/api-platform.cjs\"\n }\n },\n \"dependencies\": {\n \"@mjackson/multipart-parser\": \"^0.10.1\",\n \"@modelcontextprotocol/node\": \"catalog:\",\n \"@supabase/mcp-utils\": \"workspace:^\",\n \"common-tags\": \"^1.8.2\",\n \"gqlmin\": \"^0.3.1\",\n \"graphql\": \"^16.11.0\",\n \"openapi-fetch\": \"^0.13.5\"\n },\n \"peerDependencies\": {\n \"@modelcontextprotocol/server\": \"catalog:\",\n \"zod\": \"catalog:\"\n },\n \"devDependencies\": {\n \"@ai-sdk/anthropic\": \"catalog:\",\n \"@ai-sdk/mcp\": \"catalog:\",\n \"@electric-sql/pglite\": \"^0.2.17\",\n \"@modelcontextprotocol/client\": \"catalog:\",\n \"@modelcontextprotocol/ext-apps\": \"^2.0.4\",\n \"@modelcontextprotocol/server\": \"catalog:\",\n \"@supabase/mcp-ui\": \"workspace:*\",\n \"@total-typescript/tsconfig\": \"^1.0.4\",\n \"@types/common-tags\": \"^1.8.4\",\n \"@types/node\": \"^22.8.6\",\n \"@vitest/coverage-v8\": \"^2.1.9\",\n \"ai\": \"catalog:\",\n \"date-fns\": \"^4.1.0\",\n \"dotenv\": \"^16.5.0\",\n \"msw\": \"^2.7.3\",\n \"nanoid\": \"^5.1.5\",\n \"openapi-typescript\": \"^7.5.0\",\n \"openapi-typescript-helpers\": \"^0.0.15\",\n \"prettier\": \"^3.3.3\",\n \"tsup\": \"^8.3.5\",\n \"tsx\": \"^4.19.2\",\n \"typescript\": \"^5.6.3\",\n \"vite\": \"^5.4.19\",\n \"vitest\": \"^2.1.9\",\n \"zod\": \"catalog:\"\n }\n}\n","import { stripIndent } from 'common-tags';\nimport { ToolCallerError } from '@supabase/mcp-utils';\nimport type { LogsService } from './platform/types.js';\n\nexport function getClickHouseLogQuery(\n service: LogsService,\n limit: number = 100\n) {\n switch (service) {\n case 'api':\n return stripIndent`\n 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\n from logs\n where source = 'edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'branch-action':\n return stripIndent`\n select log_attributes['workflow_run'] as workflow_run, timestamp, id, event_message\n from logs\n where source = 'workflow_run_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'postgres':\n return stripIndent`\n select log_attributes['identifier'] as identifier, timestamp, id, event_message, log_attributes['parsed.error_severity'] as error_severity\n from logs\n where source = 'postgres_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function':\n return stripIndent`\n 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\n from logs\n where source = 'function_edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function-runtime':\n return stripIndent`\n 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\n from logs\n where source = 'function_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'auth':\n return stripIndent`\n 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\n from logs\n where source = 'auth_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'storage':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'storage_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'realtime':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'realtime_logs'\n order by timestamp desc\n limit ${limit}\n `;\n default:\n throw new Error(`unsupported log service type: ${service}`);\n }\n}\n\nexport const DAY_MS = 24 * 60 * 60 * 1000;\n\nexport function resolveLogWindow(\n iso_timestamp_start?: string,\n iso_timestamp_end?: string\n) {\n const endMs = iso_timestamp_end ? Date.parse(iso_timestamp_end) : Date.now();\n if (Number.isNaN(endMs)) {\n throw new ToolCallerError(\n `Invalid iso_timestamp_end: \"${iso_timestamp_end}\". Expected an ISO 8601 timestamp.`\n );\n }\n\n const startMs = iso_timestamp_start\n ? Date.parse(iso_timestamp_start)\n : endMs - DAY_MS;\n if (Number.isNaN(startMs)) {\n throw new ToolCallerError(\n `Invalid iso_timestamp_start: \"${iso_timestamp_start}\". Expected an ISO 8601 timestamp.`\n );\n }\n\n if (startMs >= endMs) {\n throw new ToolCallerError(\n 'iso_timestamp_start must be before iso_timestamp_end.'\n );\n }\n\n if (endMs - startMs > DAY_MS) {\n throw new ToolCallerError('The log window can be at most 24 hours.');\n }\n\n return {\n iso_timestamp_start: new Date(startMs).toISOString(),\n iso_timestamp_end: new Date(endMs).toISOString(),\n };\n}\n"]}
@@ -0,0 +1,17 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;var _commontags = require('common-tags');var _posix = require('path/posix');var _url = require('url');function w(t,o,n){return`${t}_${o}_${n}`}function j(t){return`/tmp/user_fn_${t}/`}function a(t,o){return t.startsWith(o)?t.slice(o.length):t}function E(t){try{return _url.fileURLToPath.call(void 0, t,{windows:!1})}catch (e2){return t}}function F({deploymentId:t,filename:o}){let n=j(t),r=_posix.resolve.call(void 0, n,o);return r=a(r,n),r=a(r,"source/"),r}var _=["deno.json","deno.jsonc","import_map.json"];function A(t){for(let o of _){let n=t.find(s=>_posix.normalize.call(void 0, s.name)===o);if(n)return n.name}}var B=_commontags.codeBlock`
2
+ import "jsr:@supabase/functions-js/edge-runtime.d.ts";
3
+
4
+ Deno.serve(async (req: Request) => {
5
+ const data = {
6
+ message: "Hello there!"
7
+ };
8
+
9
+ return new Response(JSON.stringify(data), {
10
+ headers: {
11
+ 'Content-Type': 'application/json',
12
+ 'Connection': 'keep-alive'
13
+ }
14
+ });
15
+ });
16
+ `;var _v4 = require('zod/v4');var p=["us-west-1","us-east-1","us-east-2","ca-central-1","eu-west-1","eu-west-2","eu-west-3","eu-central-1","eu-central-2","eu-north-1","ap-south-1","ap-southeast-1","ap-northeast-1","ap-northeast-2","ap-southeast-2","sa-east-1"];var M=_v4.z.object({id:_v4.z.string(),name:_v4.z.string(),owner:_v4.z.string(),created_at:_v4.z.string(),updated_at:_v4.z.string(),public:_v4.z.boolean()}),U= exports.i =_v4.z.object({fileSizeLimit:_v4.z.number().int().min(0).max(536870912e3),features:_v4.z.object({imageTransformation:_v4.z.object({enabled:_v4.z.boolean()}),s3Protocol:_v4.z.object({enabled:_v4.z.boolean()})})}),G= exports.j =_v4.z.object({id:_v4.z.string(),name:_v4.z.string(),plan:_v4.z.string().optional(),allowed_release_channels:_v4.z.array(_v4.z.string()),opt_in_tags:_v4.z.array(_v4.z.string())}),W= exports.k =_v4.z.object({id:_v4.z.string(),ref:_v4.z.string(),organization_id:_v4.z.string(),organization_slug:_v4.z.string(),name:_v4.z.string(),status:_v4.z.string(),created_at:_v4.z.string(),region:_v4.z.string()}),K= exports.l =_v4.z.object({id:_v4.z.string(),name:_v4.z.string(),project_ref:_v4.z.string(),parent_project_ref:_v4.z.string(),is_default:_v4.z.boolean(),git_branch:_v4.z.string().optional(),pr_number:_v4.z.number().optional(),latest_check_run_id:_v4.z.number().optional(),persistent:_v4.z.boolean(),status:_v4.z.enum(["CREATING_PROJECT","RUNNING_MIGRATIONS","MIGRATIONS_PASSED","MIGRATIONS_FAILED","FUNCTIONS_DEPLOYED","FUNCTIONS_FAILED"]),created_at:_v4.z.string(),updated_at:_v4.z.string()}),O= exports.m =_v4.z.object({id:_v4.z.string(),slug:_v4.z.string(),name:_v4.z.string(),status:_v4.z.string(),version:_v4.z.number(),created_at:_v4.z.number().optional(),updated_at:_v4.z.number().optional(),verify_jwt:_v4.z.boolean().optional(),import_map:_v4.z.boolean().optional(),import_map_path:_v4.z.string().optional(),entrypoint_path:_v4.z.string().optional()}),$= exports.n =O.extend({files:_v4.z.array(_v4.z.object({name:_v4.z.string(),content:_v4.z.string()}))}),Q= exports.o =_v4.z.object({name:_v4.z.string().min(1).max(256),organization_id:_v4.z.string(),region:_v4.z.enum(p),db_pass:_v4.z.string().optional()}),H= exports.p =_v4.z.object({name:_v4.z.string().min(1)}),J= exports.q =_v4.z.object({migration_version:_v4.z.string().optional()}),Z= exports.r =_v4.z.object({name:_v4.z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),entrypoint_path:_v4.z.string(),import_map_path:_v4.z.string().optional(),verify_jwt:_v4.z.boolean().optional(),files:_v4.z.array(_v4.z.object({name:_v4.z.string(),content:_v4.z.string()}))}),c= exports.s = (_class =class extends Error{constructor(...args) { super(...args); _class.prototype.__init.call(this); }__init() {this.name="ResultTooLargeError"}}, _class),Y= exports.t =_v4.z.object({query:_v4.z.string().min(1),parameters:_v4.z.array(_v4.z.unknown()).optional(),read_only:_v4.z.boolean().optional(),max_result_bytes:_v4.z.number().int().nonnegative().optional()}),V= exports.u =_v4.z.object({name:_v4.z.string().min(1),query:_v4.z.string().min(1)}),X= exports.v =_v4.z.object({version:_v4.z.string(),name:_v4.z.string().optional()}),P= exports.w =_v4.z.enum(["api","branch-action","postgres","edge-function","edge-function-runtime","auth","storage","realtime"]),ee= exports.x =_v4.z.object({service:P,iso_timestamp_start:_v4.z.string().optional(),iso_timestamp_end:_v4.z.string().optional()}),te= exports.y =_v4.z.object({sql:_v4.z.string().min(1),iso_timestamp_start:_v4.z.string().optional(),iso_timestamp_end:_v4.z.string().optional(),max_result_bytes:_v4.z.number().int().nonnegative().optional()}),oe= exports.z =_v4.z.object({types:_v4.z.string()}),g=_v4.z.object({id:_v4.z.number(),username:_v4.z.string()}).nullable(),i=_v4.z.object({type:_v4.z.enum(["bar","line"]),x_column:_v4.z.string(),y_series:_v4.z.array(_v4.z.object({column:_v4.z.string()})),scale:_v4.z.enum(["linear","log"]),cumulative:_v4.z.boolean(),show_labels:_v4.z.boolean()}),d=_v4.z.object({id:_v4.z.string(),type:_v4.z.literal("markdown"),text:_v4.z.string()}),u=_v4.z.object({id:_v4.z.string(),type:_v4.z.literal("database"),sql:_v4.z.string(),row_limit:_v4.z.number(),database_identifier:_v4.z.string().optional(),title:_v4.z.string().optional(),view:_v4.z.enum(["table","chart"]).optional(),chart:i.optional()}),b=_v4.z.enum(["minute","hour","day","week","month","year"]),k=_v4.z.union([_v4.z.object({type:_v4.z.literal("absolute"),start:_v4.z.string(),end:_v4.z.string()}),_v4.z.object({type:_v4.z.literal("relative"),unit:b,amount:_v4.z.number()})]),y=_v4.z.object({id:_v4.z.string(),type:_v4.z.literal("log"),sql:_v4.z.string(),time_range:k,title:_v4.z.string().optional(),view:_v4.z.enum(["table","chart"]).optional(),chart:i.optional()}),I= exports.A =_v4.z.discriminatedUnion("type",[d,u,y]),m=i.extend({y_series:_v4.z.array(i.shape.y_series.element.strict())}).strict(),l=_v4.z.string().trim().min(1,{message:"SQL must not be empty or only whitespace."}),v=_v4.z.discriminatedUnion("type",[d.omit({id:!0}).strict(),u.omit({id:!0}).extend({sql:l,row_limit:_v4.z.number().int().positive(),database_identifier:_v4.z.string().min(1).optional(),chart:m.optional()}).strict(),y.omit({id:!0}).extend({sql:l,time_range:_v4.z.discriminatedUnion("type",[_v4.z.object({type:_v4.z.literal("absolute"),start:_v4.z.iso.datetime({offset:!0}),end:_v4.z.iso.datetime({offset:!0})}).strict().refine(t=>Date.parse(t.end)>Date.parse(t.start),{message:"The end must be later than the start of the range.",path:["end"]}),_v4.z.object({type:_v4.z.literal("relative"),unit:b,amount:_v4.z.number().int().positive()}).strict()]),chart:m.optional()}).strict()]),ne= exports.B =_v4.z.object({name:_v4.z.string().trim().min(1,{message:"Notebook name must not be empty or only whitespace."}),description:_v4.z.string().optional(),content:_v4.z.object({cells:_v4.z.array(v)})}),z= exports.C =_v4.z.object({id:_v4.z.string(),name:_v4.z.string(),description:_v4.z.string().nullable(),favorite:_v4.z.boolean(),inserted_at:_v4.z.string(),updated_at:_v4.z.string(),owner:g,updated_by:g}),re= exports.D =z.extend({content:_v4.z.object({schema_version:_v4.z.number(),cells:_v4.z.array(I)})}),ie= exports.E =_v4.z.enum(["legacy","publishable"]);exports.a = w; exports.b = E; exports.c = F; exports.d = _; exports.e = A; exports.f = B; exports.g = p; exports.h = M; exports.i = U; exports.j = G; exports.k = W; exports.l = K; exports.m = O; exports.n = $; exports.o = Q; exports.p = H; exports.q = J; exports.r = Z; exports.s = c; exports.t = Y; exports.u = V; exports.v = X; exports.w = P; exports.x = ee; exports.y = te; exports.z = oe; exports.A = I; exports.B = ne; exports.C = z; exports.D = re; exports.E = ie;
17
+ //# sourceMappingURL=chunk-A64X45AF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/edge-function.ts","../src/regions.ts"],"names":["getDeploymentId","projectId","functionId","functionVersion"],"mappings":"AAAA,8HAA0B,mCACS,0BACL,SAKdA,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACQ,CACR,MAAO,CAAA,EAAA;AA2E0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AC7EjC","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/chunk-A64X45AF.cjs","sourcesContent":["import { codeBlock } from 'common-tags';\nimport { normalize, resolve } from 'node:path/posix';\nimport { fileURLToPath } from 'node:url';\n\n/**\n * Gets the deployment ID for an Edge Function.\n */\nexport function getDeploymentId(\n projectId: string,\n functionId: string,\n functionVersion: number\n): string {\n return `${projectId}_${functionId}_${functionVersion}`;\n}\n\n/**\n * Gets the path prefix applied to each file in an Edge Function.\n */\nexport function getPathPrefix(deploymentId: string) {\n return `/tmp/user_fn_${deploymentId}/`;\n}\n\n/**\n * Strips a prefix from a string.\n */\nfunction withoutPrefix(value: string, prefix: string) {\n return value.startsWith(prefix) ? value.slice(prefix.length) : value;\n}\n\n/**\n * Converts a `file://` URL to a path, passing through anything that isn't one.\n * Edge Function paths in metadata may sometimes be a path rather than a URL.\n */\nexport function getFilenameFromUrlOrPath(urlOrPath: string) {\n try {\n return fileURLToPath(urlOrPath, { windows: false });\n } catch {\n return urlOrPath;\n }\n}\n\n/**\n * Strips prefix from edge function file names, accounting for Deno 1 and 2.\n */\nexport function normalizeFilename({\n deploymentId,\n filename,\n}: { deploymentId: string; filename: string }) {\n const pathPrefix = getPathPrefix(deploymentId);\n\n // Deno 2 uses relative filenames, Deno 1 uses absolute. Resolve both to absolute first.\n // Resolve Deno paths the same way on Windows.\n const filenameAbsolute = resolve(pathPrefix, filename);\n\n // Strip prefix(es)\n let filenameWithoutPrefix = filenameAbsolute;\n filenameWithoutPrefix = withoutPrefix(filenameWithoutPrefix, pathPrefix);\n filenameWithoutPrefix = withoutPrefix(filenameWithoutPrefix, 'source/');\n\n return filenameWithoutPrefix;\n}\n\n/**\n * Import map file names detected in an Edge Function's root, in order of\n * precedence: `deno.json` before `deno.jsonc`, as the Supabase CLI does, then\n * the legacy `import_map.json`.\n */\nexport const DEFAULT_IMPORT_MAP_FILENAMES = [\n 'deno.json',\n 'deno.jsonc',\n 'import_map.json',\n] as const;\n\n/**\n * Picks the import map to deploy with when none was given or previously set,\n * independent of the order the files were passed in. Matches names with or\n * without a leading `./` and returns the name as given.\n */\nexport function getDefaultImportMapPath(files: { name: string }[]) {\n for (const filename of DEFAULT_IMPORT_MAP_FILENAMES) {\n const match = files.find((file) => normalize(file.name) === filename);\n if (match) {\n return match.name;\n }\n }\n}\n\nexport const edgeFunctionExample = codeBlock`\n import \"jsr:@supabase/functions-js/edge-runtime.d.ts\";\n\n Deno.serve(async (req: Request) => {\n const data = {\n message: \"Hello there!\"\n };\n \n return new Response(JSON.stringify(data), {\n headers: {\n 'Content-Type': 'application/json',\n 'Connection': 'keep-alive'\n }\n });\n });\n`;\n","export const AWS_REGION_CODES = [\n 'us-west-1',\n 'us-east-1',\n 'us-east-2',\n 'ca-central-1',\n 'eu-west-1',\n 'eu-west-2',\n 'eu-west-3',\n 'eu-central-1',\n 'eu-central-2',\n 'eu-north-1',\n 'ap-south-1',\n 'ap-southeast-1',\n 'ap-northeast-1',\n 'ap-northeast-2',\n 'ap-southeast-2',\n 'sa-east-1',\n] as const;\n"]}