import type { AddOnAttachment } from '@heroku/types/3.sdk'; import type { ResourceCtx } from '../../../core/extend-resource.js'; export declare class AddonAttachmentNotFoundError extends Error { readonly resource: string; readonly id = "not_found"; readonly statusCode = 404; constructor(resource?: string); get body(): { id: string; message: string; resource: string; }; } export declare class AddonAttachmentAmbiguousError extends Error { readonly matches: AddOnAttachmentWithInclusions[]; readonly id = "multiple_matches"; readonly statusCode = 422; constructor(matches: AddOnAttachmentWithInclusions[]); get body(): { id: string; message: string; }; } /** * `Accept-Inclusion: addon:plan,config_vars` requests the add-on's plan and * the attachment's config var names, but @heroku/types doesn't model either * inclusion. Extend locally rather than casting through `any`. */ export type AddOnAttachmentWithInclusions = AddOnAttachment & { addon: AddOnAttachment['addon'] & { plan: { id?: string; name: string; }; }; config_vars: string[]; }; /** * An attachment that has passed through `singularize`: its add-on `id`/ * `app.id` are guaranteed non-null at runtime. At the currently installed * `@heroku/types` schema, `AddOnAttachment` already types these as * required, so this doesn't narrow anything today — it exists to give the * SDK a stable name decoupled from the generated type (insurance against * that schema loosening these back to optional) and to document, by name, * that a value carrying this type has actually been through resolution. */ export type ResolvedAddOnAttachment = AddOnAttachmentWithInclusions & { addon: NonNullable & { app: { id: string; }; id: string; }; }; export type ResolveAddonAttachmentOptions = { /** * Restrict matches to attachments whose add-on plan belongs to this * add-on service (e.g. `heroku-postgresql`), filtered client-side. */ addonService?: string; signal?: AbortSignal; }; /** * Resolve a Platform add-on *attachment* by identity. * * The add-on attachment identity may be: * - an attachment UUID (`d5e3f2a4-...`) * - an attachment name (`DATABASE`) * - a config var (`DATABASE_URL`) * - an app-scoped attachment name or config var (`my-app::DATABASE`, * `my-app::DATABASE_URL`) * - a globally-unique add-on name (`postgres-curved-12345`) * * To resolve just the add-on the attachment points to, use `resolveAddon`. * * Always sends `Accept-Inclusion: addon:plan,config_vars` on the resolve * request so matches come back with their add-on's plan (needed to filter * by `addonService`) and their own config var names. */ export declare function resolveAddonAttachment(ctx: Pick, appIdentity: string | undefined, attachmentName: string, options?: ResolveAddonAttachmentOptions): Promise;