{"version":3,"file":"deploy-function.cjs","names":["z","action"],"sources":["../../src/actions/deploy-function.ts"],"sourcesContent":["import type { AppAction } from \"@keystrokehq/keystroke/app\";\nimport { z } from \"zod\";\n\nimport { action } from \"../action\";\nimport { supabase } from \"../app\";\n\nexport const SupabaseDeployFunctionInput = z.object({\n  ref: z.string().describe(\"Supabase project reference ID (e.g. `qftqfrxipqlzcmjcatfc`).\"),\n  file: z.object({\n  name: z.string().describe(\"The filename that will be used when uploading the file to the destination service\"),\n  s3key: z.string().describe(\"The S3 key of a publicly accessible file, typically returned from a previous download action that stored the file in S3. This key references an existing file that can be uploaded to another service.\"),\n  mimetype: z.string().describe(\"The MIME type of the file\"),\n}).describe(\"File uploaded to Composio (via SDK/MCP). Supports both single TypeScript/JavaScript files and pre-built .zip archives. Use this for large files, binary content, or complex multi-file functions. NOTE: Provide ONLY ONE of file_content, file_url, or file - not multiple.\").optional(),\n  slug: z.string().describe(\"Slug of the function to deploy.\").optional(),\n  file_url: z.string().describe(\"Public URL to download the function code from. Supports GitHub raw URLs and other publicly accessible file URLs. NOTE: Provide ONLY ONE of file_content, file_url, or file - not multiple.\").optional(),\n  bundleOnly: z.boolean().describe(\"If true, only bundle the function without publishing it.\").optional(),\n  file_content: z.string().describe(\"Raw TypeScript/JavaScript source code as a string. Ideal for simple functions or when code is generated dynamically. NOTE: Provide ONLY ONE of file_content, file_url, or file - not multiple.\").optional(),\n}).describe(\"Request schema for deploying an Edge Function to Supabase.\");\nexport const SupabaseDeployFunctionOutput = z.object({\n  id: z.string().describe(\"Unique identifier of the Edge Function.\").nullable(),\n  name: z.string().describe(\"Human-readable name of the function.\").nullable(),\n  slug: z.string().describe(\"Function slug (URL-friendly identifier) used to address the function.\").nullable(),\n  status: z.string().describe(\"Deployment status of the function (for example, ACTIVE).\").nullable(),\n  version: z.number().int().describe(\"Monotonically increasing version number of the function.\").nullable(),\n  created_at: z.number().describe(\"Creation timestamp of the function (numeric timestamp as returned by the API).\").nullable(),\n  import_map: z.boolean().describe(\"Indicates whether an import map is used by this function.\").nullable(),\n  updated_at: z.number().describe(\"Last update timestamp of the function (numeric timestamp as returned by the API).\").nullable(),\n  verify_jwt: z.boolean().describe(\"Whether the function requires a valid JWT for invocation.\").nullable(),\n  ezbr_sha256: z.string().describe(\"SHA-256 hash of the deployed bundle (present in some responses).\").nullable().optional(),\n  entrypoint_path: z.string().describe(\"Path to the function entrypoint file in the deployed bundle.\").nullable(),\n  import_map_path: z.string().describe(\"Path to the import map file in the deployed bundle, if used.\").nullable().optional(),\n}).passthrough().describe(\"Supabase Management API - Deploy a function (Response 201)\\n\\nReturns details of the Edge Function that was created or updated.\\n\\nSource: Supabase Management API docs - POST /v1/projects/{ref}/functions/deploy\");\n\nexport const supabaseDeployFunction: AppAction<\n  typeof SupabaseDeployFunctionInput,\n  typeof SupabaseDeployFunctionOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_DEPLOY_FUNCTION\", {\n  slug: \"supabase-deploy-function\",\n  name: \"Deploy function\",\n  description: \"Deploys Edge Functions to a Supabase project using multipart upload.\",\n  input: SupabaseDeployFunctionInput,\n  output: SupabaseDeployFunctionOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,8BAA8BA,IAAAA,EAAE,OAAO;CAClD,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,8DAA8D;CACvF,MAAMA,IAAAA,EAAE,OAAO;EACf,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mFAAmF;EAC7G,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,wMAAwM;EACnO,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,2BAA2B;CAC3D,CAAC,CAAC,CAAC,SAAS,6QAA6Q,CAAC,CAAC,SAAS;CAClS,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,iCAAiC,CAAC,CAAC,SAAS;CACtE,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4LAA4L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