{"version":3,"file":"patch-migration.mjs","names":[],"sources":["../../src/actions/patch-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 SupabasePatchMigrationInput = z.object({\n  ref: z.string().describe(\"The unique reference ID of the Supabase project (used in the URL path). Must be exactly 20 lowercase letters (a-z).\"),\n  name: z.string().describe(\"New name for the migration entry. Updates the display name in migration history.\").optional(),\n  version: z.string().describe(\"The version identifier of the migration to patch (typically a timestamp like '20260216042751'). This is found in the migration history.\"),\n  rollback: z.string().describe(\"SQL rollback script for the migration. Defines how to revert the migration changes.\").optional(),\n}).describe(\"Request schema for patching an existing migration history entry.\");\nexport const SupabasePatchMigrationOutput = z.object({\n  name: z.string().describe(\"The updated name of the migration.\").nullable().optional(),\n  version: z.string().describe(\"The version identifier of the patched migration.\").nullable(),\n  rollback: z.string().describe(\"The rollback script for the migration.\").nullable().optional(),\n}).passthrough().describe(\"Response from patching a migration history entry.\\n\\nReturns the updated migration entry details after successful patch operation.\");\n\nexport const supabasePatchMigration: AppAction<\n  typeof SupabasePatchMigrationInput,\n  typeof SupabasePatchMigrationOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_PATCH_MIGRATION\", {\n  slug: \"supabase-patch-migration\",\n  name: \"Patch a migration\",\n  description: \"[Beta] Patches an existing entry in the project's migration history, updating the name or rollback script. Use this to correct migration metadata after the migration has been created.\",\n  input: SupabasePatchMigrationInput,\n  output: SupabasePatchMigrationOutput,\n});\n"],"mappings":";;;AAkBA,MAAa,yBAIT,OAAO,4BAA4B;CACrC,MAAM;CACN,MAAM;CACN,aAAa;CACb,OApByC,EAAE,OAAO;EAClD,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,qHAAqH;EAC9I,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,kFAAkF,CAAC,CAAC,SAAS;EACvH,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,yIAAyI;EACtK,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,qFAAqF,CAAC,CAAC,SAAS;CAChI,CAAC,CAAC,CAAC,SAAS,kEAeH;CACP,QAf0C,EAAE,OAAO;EACnD,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EACpF,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,kDAAkD,CAAC,CAAC,SAAS;EAC1F,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,wCAAwC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC9F,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,oIAWhB;AACV,CAAC"}