{"version":3,"file":"apply-a-migration.mjs","names":[],"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":";;;AAkBA,MAAa,0BAIT,OAAO,8BAA8B;CACvC,MAAM;CACN,MAAM;CACN,aAAa;CACb,OApB0C,EAAE,OAAO;EACnD,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,qIAAqI;EAC9J,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,yHAAyH,CAAC,CAAC,SAAS;EAC9J,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,uGAAuG;EAClI,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,+DAA+D,CAAC,CAAC,SAAS;EACxG,iBAAiB,EAAE,OAAO,CAAC,CAAC,SAAS,kJAAkJ,CAAC,CAAC,SAAS;CACpM,CAAC,CAAC,CAAC,SAAS,yEAcH;CACP,QAd2C,EAAE,OAAO;EACpD,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,sEAAsE,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EACzH,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,2DAA2D,CAAC,CAAC,SAAS;CACtG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,0IAWhB;AACV,CAAC"}