{"version":3,"file":"get-project-upgrade-eligibility.cjs","names":["z","action"],"sources":["../../src/actions/get-project-upgrade-eligibility.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 SupabaseGetProjectUpgradeEligibilityInput = z.object({\n  ref: z.string().describe(\"Unique identifier of the Supabase project (e.g., 'opntiysxcrktmaarzjhz'). Can be obtained from the Supabase dashboard URL or by listing all projects.\"),\n}).describe(\"Request schema for `GetProjectUpgradeEligibility`\");\nconst SupabaseGetProjectUpgradeEligibility_ValidationErrorSchema = z.object({\n  type: z.string().describe(\"The type of validation error (e.g., 'unsupported_extension', 'legacy_auth_issue').\").nullable(),\n  extension_name: z.string().describe(\"The name of the unsupported extension, if applicable.\").nullable().optional(),\n}).passthrough().describe(\"Represents a validation error that prevents or affects the upgrade eligibility.\");\nconst SupabaseGetProjectUpgradeEligibility_TargetUpgradeVersionSchema = z.object({\n  app_version: z.string().describe(\"The full application version string (e.g., 'supabase-postgres-17.6.1.063').\").nullable(),\n  release_channel: z.string().describe(\"The release channel (e.g., 'ga', 'beta', 'alpha').\").nullable(),\n  postgres_version: z.string().describe(\"The PostgreSQL version number (e.g., '15', '16', '17').\").nullable(),\n}).passthrough().describe(\"Represents a possible target version for upgrading the project.\");\nexport const SupabaseGetProjectUpgradeEligibilityOutput = z.object({\n  eligible: z.boolean().describe(\"Whether the project is eligible for an upgrade.\").nullable(),\n  validation_errors: z.array(SupabaseGetProjectUpgradeEligibility_ValidationErrorSchema).describe(\"List of validation errors explaining why the project may not be eligible for upgrade.\").nullable().optional(),\n  latest_app_version: z.string().describe(\"The latest available application version relevant to this project.\").nullable(),\n  current_app_version: z.string().describe(\"The current application version running for the project.\").nullable(),\n  objects_to_be_dropped: z.array(z.string()).describe(\"List of database objects that would need to be dropped as part of the upgrade process.\"),\n  unsupported_extensions: z.array(z.string()).describe(\"List of installed Postgres extensions that are not supported on the target upgrade version(s).\"),\n  duration_estimate_hours: z.number().int().describe(\"Estimated duration of the upgrade in hours.\").nullable(),\n  target_upgrade_versions: z.array(SupabaseGetProjectUpgradeEligibility_TargetUpgradeVersionSchema).describe(\"Possible target versions for upgrading the project.\"),\n  legacy_auth_custom_roles: z.array(z.string()).describe(\"List of custom roles in legacy Auth that may affect upgrade eligibility or require attention.\"),\n  current_app_version_release_channel: z.string().describe(\"Release channel of the current application version (for example, internal/beta/stable as used by Supabase release channels).\").nullable(),\n  user_defined_objects_in_internal_schemas: z.array(z.string()).describe(\"List of user-defined objects found in Supabase internal schemas that could block or complicate the upgrade.\"),\n}).passthrough().describe(\"Supabase Management API: Get project upgrade eligibility response\");\n\nexport const supabaseGetProjectUpgradeEligibility: AppAction<\n  typeof SupabaseGetProjectUpgradeEligibilityInput,\n  typeof SupabaseGetProjectUpgradeEligibilityOutput,\n  typeof supabase.credential\n> = action(\"SUPABASE_GET_PROJECT_UPGRADE_ELIGIBILITY\", {\n  slug: \"supabase-get-project-upgrade-eligibility\",\n  name: \"Get Project Upgrade Eligibility\",\n  description: \"Checks a Supabase project's eligibility for an upgrade, verifying compatibility and identifying potential issues; this action does not perform the actual upgrade.\",\n  input: SupabaseGetProjectUpgradeEligibilityInput,\n  output: SupabaseGetProjectUpgradeEligibilityOutput,\n});\n"],"mappings":";;;;AAMA,MAAa,4CAA4CA,IAAAA,EAAE,OAAO,EAChE,KAAKA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uJAAuJ,EAClL,CAAC,CAAC,CAAC,SAAS,mDAAmD;AAC/D,MAAM,6DAA6DA,IAAAA,EAAE,OAAO;CAC1E,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,oFAAoF,CAAC,CAAC,SAAS;CACzH,gBAAgBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uDAAuD,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACnH,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SA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