import type { AddOn } from '@heroku/types/3.sdk'; import { PostgresCredentialInfoResult as AdvancedCredentialInfo } from '@heroku/types/data'; import type { ResourceCtx } from '../../../core/extend-resource.js'; import type { ResolvedAddOnAttachment } from '../../platform/add-on-attachment/resolve.js'; import { CredentialInfo as NonAdvancedCredentialInfo } from '../postgres-database/credentials.js'; /** * The add-on shapes the Postgres tier predicates accept: either a full * platform `AddOn` or the lighter add-on carried on a resolved attachment. * Both expose the `plan.name` these checks read, so they're interchangeable * here. */ export type PostgresAddonLike = AddOn | ResolvedAddOnAttachment['addon']; /** * Thrown when an add-on is not an Advanced-tier database. Carries the add-on * so callers that need its identity don't need a second resolve call. */ export declare class NotAdvancedDatabaseError extends Error { readonly addon: PostgresAddonLike; readonly id = "not_advanced_database"; constructor(addon: PostgresAddonLike, message: string); get body(): { id: string; message: string; }; } /** * Thrown when an operation isn't supported on Essential-tier databases. * Carries the add-on so callers can name it without a second resolve call. */ export declare class EssentialDatabaseNotSupportedError extends Error { readonly addon: PostgresAddonLike; readonly id = "essential_database_not_supported"; constructor(addon: PostgresAddonLike, message: string); get body(): { id: string; message: string; }; } /** * Returns the first legacy database add-on on the app. */ export declare function findLegacyDatabase(ctx: Pick, appIdentity: string): Promise; export declare function isAdvancedCredential(credential: AdvancedCredentialInfo | NonAdvancedCredentialInfo): credential is AdvancedCredentialInfo; export declare const getPostgresServiceName: () => string; export declare const isPostgresAddon: (addon: PostgresAddonLike) => boolean; export declare const isAdvancedDatabase: (addon: PostgresAddonLike) => boolean; export declare const isLegacyDatabase: (addon: PostgresAddonLike) => boolean; export declare const isLegacyEssentialDatabase: (addon: PostgresAddonLike) => boolean; export declare const isEssentialDatabase: (addon: PostgresAddonLike) => boolean; export declare const isEssentialTier: (addon: PostgresAddonLike) => boolean;