{"version":3,"file":"update-database-branch-config.mjs","names":[],"sources":["../../src/actions/update-database-branch-config.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 SupabaseUpdateDatabaseBranchConfigInput = z.object({\n  status: z.enum([\"CREATING_PROJECT\", \"FUNCTIONS_DEPLOYED\", \"FUNCTIONS_FAILED\", \"MIGRATIONS_FAILED\", \"MIGRATIONS_PASSED\", \"RUNNING_MIGRATIONS\"]).describe(\"Status values that can be set when updating a branch.\").optional(),\n  branch_id: z.string().describe(\"Unique identifier of the database branch to update. Must be exactly 20 lowercase alphabetic characters.\"),\n  git_branch: z.string().describe(\"Name of the Git branch to associate with this database branch. If not provided, the association remains unchanged.\").optional(),\n  persistent: z.boolean().describe(\"If true, the database branch is persistent; non-persistent branches may be auto-cleaned. If not provided, this setting remains unchanged.\").optional(),\n  branch_name: z.string().describe(\"New name for the database branch. If not provided, the name remains unchanged.\").optional(),\n  reset_on_push: z.boolean().describe(\"If true, resets the database branch on new push to the linked Git branch. If not provided, this setting remains unchanged.\").optional(),\n}).describe(\"Request schema for `UpdateDatabaseBranchConfig`\");\nexport const SupabaseUpdateDatabaseBranchConfigOutput = z.object({\n  id: z.string().describe(\"Unique identifier of the database branch.\").nullable(),\n  name: z.string().describe(\"Name of the database branch.\").nullable(),\n  status: z.string().describe(\"Current status of the database branch (e.g., CREATING_PROJECT, MIGRATIONS_PASSED).\").nullable(),\n  pr_number: z.number().int().describe(\"Associated pull request number, if applicable.\").nullable().optional(),\n  with_data: z.boolean().describe(\"Indicates whether the branch was created with a copy of production data.\").nullable().optional(),\n  created_at: z.string().describe(\"Creation timestamp (ISO 8601).\").nullable(),\n  git_branch: z.string().describe(\"Associated Git branch, if any.\").nullable().optional(),\n  is_default: z.boolean().describe(\"Indicates if this is the default branch for the project.\").nullable(),\n  persistent: z.boolean().describe(\"Indicates if the branch is persistent.\").nullable(),\n  updated_at: z.string().describe(\"Last update timestamp (ISO 8601).\").nullable(),\n  project_ref: z.string().describe(\"Reference ID of the Supabase project this branch belongs to.\").nullable(),\n  reset_on_push: z.boolean().describe(\"Indicates if the branch resets on push to the linked Git branch.\").nullable().optional(),\n  parent_project_ref: z.string().describe(\"Reference ID of the parent Supabase project, if applicable (e.g., for forked projects).\").nullable(),\n  latest_check_run_id: z.number().int().describe(\"ID of the latest check run, often related to CI/CD.\").nullable().optional(),\n  review_requested_at: z.string().describe(\"Timestamp when a review was requested for this branch (ISO 8601).\").nullable().optional(),\n}).passthrough().describe(\"Response schema for `UpdateDatabaseBranchConfig` - returns branch object directly.\");\n\nexport const supabaseUpdateDatabaseBranchConfig: AppAction<\n  typeof SupabaseUpdateDatabaseBranchConfigInput,\n  typeof SupabaseUpdateDatabaseBranchConfigOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_UPDATE_DATABASE_BRANCH_CONFIG\", {\n  slug: \"supabase-update-database-branch-config\",\n  name: \"Update database branch config\",\n  description: \"Updates the configuration of a Supabase database branch, allowing modification of its name, associated Git branch, reset-on-push behavior, persistence, and status. Note: Database branching requires a paid Supabase plan (Pro or higher). This action requires a valid branch_id which must be exactly 20 lowercase alphabetic characters. Authentication: - Requires a valid Bearer token in the Authorization header. - Token format: 'Bearer <access_token>' Required Scope: - Environment:Write\",\n  input: SupabaseUpdateDatabaseBranchConfigInput,\n  output: SupabaseUpdateDatabaseBranchConfigOutput,\n});\n"],"mappings":";;;AAgCA,MAAa,qCAIT,OAAO,0CAA0C;CACnD,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAlCqD,EAAE,OAAO;EAC9D,QAAQ,EAAE,KAAK;GAAC;GAAoB;GAAsB;GAAoB;GAAqB;GAAqB;EAAoB,CAAC,CAAC,CAAC,SAAS,uDAAuD,CAAC,CAAC,SAAS;EAC1N,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS,yGAAyG;EACxI,YAAY,EAAE,OAAO,CAAC,CAAC,SA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