import { ExchangeTokenRequest } from '../../api/nebius/iam/v1/index.js'; import { type AuthMetricsInput } from '../metrics.js'; import { Bearer, Receiver } from '../token.js'; import { custom, customJson, Logger } from '../util/logging.js'; import type { SDKInterface } from '../../sdk.js'; /** Reports an unsupported token-exchange response. */ export declare class UnsupportedResponseError extends Error { /** Creates a new unsupported response error. */ constructor(expected: string, got: unknown); } /** Reports an unsupported token type. */ export declare class UnsupportedTokenTypeError extends Error { /** Creates a new unsupported token type error. */ constructor(tokenType: string); } /** * Exchanges an assertion or external credential for a Nebius access token. * * The requester builds the exchange request. The SDK supplies the generated * token-exchange client. This low-level bearer does not cache or renew access * tokens; high-level bearers such as * {@link https://nebius.github.io/js-sdk/classes/runtime_token_service_account.ServiceAccountBearer.html | ServiceAccountBearer} * wrap it in a * {@link https://nebius.github.io/js-sdk/classes/runtime_token_renewable.RenewableBearer.html | RenewableBearer}. */ export declare class ExchangeableBearer extends Bearer { [custom]: () => string; private readonly requester; private readonly maxRetries; private readonly logger?; /** Contains the fully qualified runtime type name. */ readonly $type = "nebius.sdk.ExchangeableBearer"; private svc; private readonly metrics; /** * Creates an exchange bearer. * * `sdk` can be set later with {@link ExchangeableBearer.setSDK}. Calling * {@link ExchangeableBearer.receiver} before an SDK is set throws. */ constructor(requester: TokenRequester, sdk: SDKInterface | Promise | null, maxRetries?: number, logger?: Logger | undefined, metrics?: AuthMetricsInput); /** Sets the metrics. */ setMetrics(metrics: AuthMetricsInput): void; /** Returns a JSON-safe value for logs. */ [customJson](): unknown; /** * Sets or clears the SDK used for token exchange. * * A promise delays client creation until the SDK is ready. Passing `null` * disables receiver creation. */ setSDK(sdk: SDKInterface | Promise | null): void; /** Creates a token receiver. */ receiver(): Receiver; } /** * Builds a fresh token-exchange request. * * Implementations can sign an assertion or read a rotating external * credential. The returned request can contain secrets and must not be logged. */ export interface TokenRequester { /** Returns the exchange token request. */ getExchangeTokenRequest(): ExchangeTokenRequest; } //# sourceMappingURL=exchangeable.d.ts.map