{"version":3,"file":"get-project-upgrade-eligibility.mjs","names":[],"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,4CAA4C,EAAE,OAAO,EAChE,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,uJAAuJ,EAClL,CAAC,CAAC,CAAC,SAAS,mDAAmD;AAC/D,MAAM,6DAA6D,EAAE,OAAO;CAC1E,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,oFAAoF,CAAC,CAAC,SAAS;CACzH,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS,uDAAuD,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACnH,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,iFAAiF;AAC3G,MAAM,kEAAkE,EAAE,OAAO;C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