{"version":3,"file":"update-branch.mjs","names":[],"sources":["../../src/actions/update-branch.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 SupabaseUpdateBranchInput = z.object({\n  status: z.enum([\"CREATING_PROJECT\", \"RUNNING_MIGRATIONS\", \"MIGRATIONS_PASSED\", \"MIGRATIONS_FAILED\", \"FUNCTIONS_DEPLOYED\", \"FUNCTIONS_FAILED\"]).describe(\"Status values that can be set when updating a branch.\").optional(),\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  notify_url: z.string().describe(\"HTTP endpoint to receive branch status updates. Must be a valid URI.\").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(\"This field is deprecated and will be ignored. Use v1-reset-a-branch endpoint directly instead.\").optional(),\n  request_review: z.boolean().describe(\"If true, requests a review for this branch. If not provided, this setting remains unchanged.\").optional(),\n  branch_id_or_ref: z.string().describe(\"Unique identifier or reference of the database branch to update.\"),\n}).describe(\"Request schema for updating a database branch configuration.\");\nconst SupabaseUpdateBranch_PreviewProjectStatusSchema = z.enum([\"INACTIVE\", \"ACTIVE_HEALTHY\", \"ACTIVE_UNHEALTHY\", \"COMING_UP\", \"UNKNOWN\", \"GOING_DOWN\", \"INIT_FAILED\", \"REMOVED\", \"RESTORING\", \"UPGRADING\", \"PAUSING\", \"RESTORE_FAILED\", \"RESTARTING\", \"PAUSE_FAILED\", \"RESIZING\"]).describe(\"Status of the preview project associated with the branch.\");\nexport const SupabaseUpdateBranchOutput = z.object({\n  id: z.string().describe(\"Unique identifier (UUID format) 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.\").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(),\n  created_at: z.string().describe(\"Creation timestamp in ISO 8601 format.\").nullable(),\n  git_branch: z.string().describe(\"Associated Git branch name, if any.\").nullable().optional(),\n  is_default: z.boolean().describe(\"Indicates if this is the default branch for the project.\").nullable(),\n  notify_url: z.string().describe(\"HTTP endpoint for branch status updates, if configured.\").nullable().optional(),\n  persistent: z.boolean().describe(\"Indicates if the branch is persistent.\").nullable(),\n  updated_at: z.string().describe(\"Last update timestamp in ISO 8601 format.\").nullable(),\n  project_ref: z.string().describe(\"Reference ID of the Supabase project this branch belongs to.\").nullable(),\n  parent_project_ref: z.string().describe(\"Reference ID of the parent Supabase project.\").nullable(),\n  latest_check_run_id: z.number().describe(\"This field is deprecated and will not be populated.\").nullable().optional(),\n  review_requested_at: z.string().describe(\"Timestamp when a review was requested for this branch (ISO 8601 format).\").nullable().optional(),\n  deletion_scheduled_at: z.string().describe(\"Timestamp when the branch is scheduled for deletion (ISO 8601 format).\").nullable().optional(),\n  preview_project_status: SupabaseUpdateBranch_PreviewProjectStatusSchema.nullable().optional(),\n}).passthrough().describe(\"Response schema for updating a database branch - returns the updated branch object.\");\n\nexport const supabaseUpdateBranch: AppAction<\n  typeof SupabaseUpdateBranchInput,\n  typeof SupabaseUpdateBranchOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_UPDATE_BRANCH\", {\n  slug: \"supabase-update-branch\",\n  name: \"Update branch configuration\",\n  description: \"Updates the configuration of a Supabase database branch, allowing modification of its name, associated Git branch, notification URL, persistence settings, and status. Use this action when you need to modify branch settings after creation, such as linking to a different Git branch, changing the branch name, or updating persistence behavior. Note: Database branching requires a paid Supabase plan (Pro or higher).\",\n  input: SupabaseUpdateBranchInput,\n  output: SupabaseUpdateBranchOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,4BAA4B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