{"version":3,"file":"list-backups.mjs","names":[],"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,2BAA2B,EAAE,OAAO,EAC/C,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,mEAAmE,EAC9F,CAAC,CAAC,CAAC,SAAS,qDAAqD;AACjE,MAAM,mCAAmC,EAAE,KAAK;CAAC;CAAa;CAAU;CAAW;CAAW;CAAY;AAAW,CAAC;AACtH,MAAM,mCAAmC,EAAE,OAAO;CAChD,QAAQ,iCAAiC,SAAS;CAClD,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,8DAA8D,CAAC,CAAC,SAAS;CAC1G,oBAAoB,EAAE,QAAQ,CAAC,CAAC,SAAS,sEAAsE,CAAC,CAAC,SAAS;AAC5H,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,iEAAiE;AAC3F,MAAM,gDAAgD,EAAE,OAAO;CAC7D,kCAAkC,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,sEAAsE,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACxJ,oCAAoC,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,wEAAwE,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AAC9J,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,gJAAgJ;AAS1K,MAAa,sBAIT,OAAO,yBAAyB;CAClC,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAjBuC,EAAE,OAAO;EAChD,QAAQ,EAAE,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