{"version":3,"file":"list-backups.cjs","names":["z","action"],"sources":["../../src/actions/list-backups.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 SupabaseListBackupsInput = z.object({\n  ref: z.string().describe(\"The unique identifier (reference string) of the Supabase project.\"),\n}).describe(\"Request to list all backups for a Supabase project.\");\nconst SupabaseListBackups_StatusSchema = z.enum([\"COMPLETED\", \"FAILED\", \"PENDING\", \"REMOVED\", \"ARCHIVED\", \"CANCELLED\"]);\nconst SupabaseListBackups_BackupSchema = z.object({\n  status: SupabaseListBackups_StatusSchema.nullable(),\n  inserted_at: z.string().describe(\"Timestamp indicating when the backup was created (ISO 8601).\").nullable(),\n  is_physical_backup: z.boolean().describe(\"True if this entry represents a physical backup (created via WAL-G).\").nullable(),\n}).passthrough().describe(\"A single database backup instance with its status and metadata.\");\nconst SupabaseListBackups_PhysicalBackupRangeSchema = z.object({\n  latest_physical_backup_date_unix: z.number().int().describe(\"Latest available physical backup time as a Unix timestamp (seconds).\").nullable().optional(),\n  earliest_physical_backup_date_unix: z.number().int().describe(\"Earliest available physical backup time as a Unix timestamp (seconds).\").nullable().optional(),\n}).passthrough().describe(\"Metadata about the available range for physical backups.\\n\\nMatches the documented required fields when physical backup range data is present.\");\nexport const SupabaseListBackupsOutput = z.object({\n  region: z.string().describe(\"Cloud region where the project's database is hosted (for example, us-east-1 or ap-southeast-1).\").nullable(),\n  backups: z.array(SupabaseListBackups_BackupSchema).describe(\"List of available backups for the project. May be empty when no backups are available.\"),\n  pitr_enabled: z.boolean().describe(\"Indicates whether Point-in-Time Recovery (PITR) is enabled for the project/database.\").nullable(),\n  walg_enabled: z.boolean().describe(\"Indicates whether WAL-G based physical backups (Write-Ahead Log archiving) are enabled for the project.\").nullable(),\n  physical_backup_data: SupabaseListBackups_PhysicalBackupRangeSchema.nullable(),\n}).passthrough().describe(\"Response for Supabase Management API: Lists all backups for a project.\\n\\nNOTE: Flattened to match the API response directly (no `data` wrapper).\");\n\nexport const supabaseListBackups: AppAction<\n  typeof SupabaseListBackupsInput,\n  typeof SupabaseListBackupsOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_LIST_BACKUPS\", {\n  slug: \"supabase-list-backups\",\n  name: \"List project database backups\",\n  description: \"Lists all database backups for a Supabase project, providing details on existing backups but not creating new ones or performing restores; availability may depend on plan and configuration.\",\n  input: SupabaseListBackupsInput,\n  output: SupabaseListBackupsOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,2BAA2BA,IAAAA,EAAE,OAAO,EAC/C,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mEAAmE,EAC9F,CAAC,CAAC,CAAC,SAAS,qDAAqD;AACjE,MAAM,mCAAmCA,IAAAA,EAAE,KAAK;CAAC;CAAa;CAAU;CAAW;CAAW;CAAY;AAAW,CAAC;AACtH,MAAM,mCAAmCA,IAAAA,EAAE,OAAO;CAChD,QAAQ,iCAAiC,SAAS;CAClD,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,8DAA8D,CAAC,CAAC,SAAS;CAC1G,oBAAoBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,sEAAsE,CAAC,CAAC,SAAS;AAC5H,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,iEAAiE;AAC3F,MAAM,gDAAgDA,IAAAA,EAAE,OAAO;CAC7D,kCAAkCA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,sEAAsE,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACxJ,oCAAoCA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,wEAAwE,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AAC9J,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,gJAAgJ;AAC1K,MAAa,4BAA4BA,IAAAA,EAAE,OAAO;C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