{"version":3,"file":"get-branch.cjs","names":["z","action"],"sources":["../../src/actions/get-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 SupabaseGetBranchInput = z.object({\n  ref: z.string().describe(\"The unique reference identifier (project ref) of the parent Supabase project. This ID can be found in your project's dashboard URL.\"),\n  name: z.string().describe(\"The unique name of the database branch to retrieve (e.g., 'test-branch-fix', 'staging', 'feature-x').\"),\n}).describe(\"Request schema for getting a specific database branch by project ref and branch name.\");\nconst SupabaseGetBranch_BranchStatusSchema = z.enum([\"CREATING_PROJECT\", \"RUNNING_MIGRATIONS\", \"MIGRATIONS_PASSED\", \"MIGRATIONS_FAILED\", \"FUNCTIONS_DEPLOYED\", \"FUNCTIONS_FAILED\"]).describe(\"Lifecycle status of the database branch.\");\nconst SupabaseGetBranch_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 SupabaseGetBranchOutput = z.object({\n  id: z.string().describe(\"Unique identifier (UUID) for the database branch.\").nullable(),\n  name: z.string().describe(\"Human-readable name of the branch.\").nullable(),\n  status: SupabaseGetBranch_BranchStatusSchema.nullable(),\n  pr_number: z.number().int().describe(\"Pull request number if the branch was created for a PR-based preview environment. May be null when not 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(\"Timestamp when the branch was created (ISO 8601 format, UTC).\").nullable(),\n  git_branch: z.string().describe(\"Associated Git branch name when the database branch is linked to a Git workflow. May be null if not linked.\").nullable().optional(),\n  is_default: z.boolean().describe(\"Indicates whether this branch is the project's default (main) branch.\").nullable(),\n  notify_url: z.string().describe(\"Webhook URL for notifications about branch status changes. May be null if not configured.\").nullable().optional(),\n  persistent: z.boolean().describe(\"Whether the branch is persistent (remains after related PR/workflow ends) instead of ephemeral.\").nullable(),\n  updated_at: z.string().describe(\"Timestamp when the branch was last updated (ISO 8601 format, UTC).\").nullable(),\n  project_ref: z.string().describe(\"Reference ID of the project this branch belongs to.\").nullable(),\n  parent_project_ref: z.string().describe(\"Reference ID of the parent (source) project from which this branch originated.\").nullable(),\n  latest_check_run_id: z.number().describe(\"This field is deprecated and will not be populated. Identifier of the most recent CI/check run.\").nullable().optional(),\n  review_requested_at: z.string().describe(\"Timestamp when a review was requested for this branch (ISO 8601 format). May be null if not applicable.\").nullable().optional(),\n  deletion_scheduled_at: z.string().describe(\"Timestamp when the branch is scheduled for deletion (ISO 8601 format). May be null if no deletion is scheduled.\").nullable().optional(),\n  preview_project_status: SupabaseGetBranch_PreviewProjectStatusSchema.nullable().optional(),\n}).passthrough().describe(\"Response schema containing detailed information about a specific database branch.\");\n\nexport const supabaseGetBranch: AppAction<\n  typeof SupabaseGetBranchInput,\n  typeof SupabaseGetBranchOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_GET_BRANCH\", {\n  slug: \"supabase-get-branch\",\n  name: \"Get a database branch\",\n  description: \"Retrieves detailed information about a specific database branch by its name and project reference. Use this to check branch status, configuration, and metadata before performing operations on the branch.\",\n  input: SupabaseGetBranchInput,\n  output: SupabaseGetBranchOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,yBAAyBA,IAAAA,EAAE,OAAO;CAC7C,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qIAAqI;CAC9J,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uGAAuG;AACnI,CAAC,CAAC,CAAC,SAAS,uFAAuF;AACnG,MAAM,uCAAuCA,IAAAA,EAAE,KAAK;CAAC;CAAo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