{"version":3,"file":"apply-a-migration.cjs","names":["z","action"],"sources":["../../src/actions/apply-a-migration.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 SupabaseApplyAMigrationInput = z.object({\n  ref: z.string().describe(\"The unique reference ID of the Supabase project (e.g., 'pamqaklsszmjzugtywow'). Found in Project Settings > General > Reference ID.\"),\n  name: z.string().describe(\"A unique name for the migration to track it in the migration history. If not provided, a default name will be assigned.\").optional(),\n  query: z.string().describe(\"The SQL migration query to execute against the project's database. Must be at least 1 character long.\"),\n  rollback: z.string().describe(\"Optional SQL query to rollback/undo this migration if needed.\").optional(),\n  idempotency_key: z.string().describe(\"A unique key to ensure the same migration is tracked only once. If provided, prevents duplicate migrations with the same key from being applied.\").optional(),\n}).describe(\"Request schema for applying a database migration to a Supabase project.\");\nexport const SupabaseApplyAMigrationOutput = z.object({\n  message: z.string().describe(\"Success message or additional details about the migration execution.\").nullable().optional(),\n  success: z.boolean().describe(\"Indicates whether the migration was successfully applied.\").nullable(),\n}).passthrough().describe(\"Response from Supabase Management API - Apply a Database Migration.\\n\\nReturns confirmation that the migration was successfully applied.\");\n\nexport const supabaseApplyAMigration: AppAction<\n  typeof SupabaseApplyAMigrationInput,\n  typeof SupabaseApplyAMigrationOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_APPLY_A_MIGRATION\", {\n  slug: \"supabase-apply-a-migration\",\n  name: \"Apply a database migration\",\n  description: \"Tool to apply database migrations to a Supabase project. Use when you need to execute SQL schema changes, create tables, alter columns, or run other DDL/DML operations as part of a tracked migration. This is a Beta feature in the Supabase Management API.\",\n  input: SupabaseApplyAMigrationInput,\n  output: SupabaseApplyAMigrationOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,+BAA+BA,IAAAA,EAAE,OAAO;CACnD,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qIAAqI;CAC9J,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yHAAyH,CAAC,CAAC,SAAS;CAC9J,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uGAAuG;CAClI,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,+DAA+D,CAAC,CAAC,SAAS;CACxG,iBAAiBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,kJAAkJ,CAAC,CAAC,SAAS;AACpM,CAAC,CAAC,CAAC,SAAS,yEAAyE;AACrF,MAAa,gCAAgCA,IAAAA,EAAE,OAAO;CACpD,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,sEAAsE,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACzH,SAASA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,2DAA2D,CAAC,CAAC,SAAS;AACtG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,0IAA0I;AAEpK,MAAa,0BAITC,eAAAA,OAAO,8BAA8B;CACvC,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}