import { type IAuthProviderCallGuard, type TelemetryData } from "@gooddata/sdk-backend-base"; import { type IAnalyticalBackend, type IAnalyticalBackendConfig, type IAnalyticalWorkspace, type IAuthenticatedPrincipal, type IAuthenticationProvider, type IBackendCapabilities, type IDataSourcesService, type IEntitlements, type IGeoService, type IOrganization, type IOrganizations, type IUserService, type IWorkspacesQueryFactory } from "@gooddata/sdk-backend-spi"; import { type DateFormatter, type DateNormalizer, type DateStringifier } from "../convertors/fromBackend/dateFormatting/types.js"; import { type TigerSpecificFunctions } from "./tigerSpecificFunctions.js"; /** * Client-specific configuration for the tiger backend allows to specify additional telemetry information. * * @public */ export type TigerBackendConfig = { /** * Name of frontend package, this will be recorded by backend as initiator of HTTP requests. */ packageName?: string; /** * Version of the frontend package, this will be recorded by backend as initiator of HTTP requests. */ packageVersion?: string; /** * Function used to format date values for a given granularity. It is given a parsed Date value and an appropriate granularity. * If not specified, a default date formatted will be used. */ dateFormatter?: DateFormatter; /** * Function used to stringify date values for a given granularity. It is given a parsed Date value and an appropriate granularity. * If not specified, a default date stringifier will be used. */ dateStringifier?: DateStringifier; /** * Function used to normalize date (ISO) values for a given granularity. It is given a parsed Date value and an appropriate granularity. * If not specified, a default date normalizer will be used. */ dateNormalizer?: DateNormalizer; }; /** * Provides a way for the TigerBackend to expose some of its backend specific functions. */ type TigerSpecificFunctionsSubscription = { /** * @deprecated - use internal_backendSpecificFunctions instead */ onTigerSpecificFunctionsReady?: (functions: TigerSpecificFunctions) => void; onContractExpired?: (tier: string) => void; }; /** * An implementation of analytical backend for GoodData CloudNative (codename tiger). */ export declare class TigerBackend implements IAnalyticalBackend { readonly capabilities: IBackendCapabilities; readonly config: IAnalyticalBackendConfig; readonly internal_backendSpecificFunctions?: unknown; private readonly telemetry; private readonly implConfig; private readonly client; private readonly authProvider; private readonly dateFormatter; private readonly dateStringifier; private readonly dateNormalizer; constructor(config?: IAnalyticalBackendConfig, implConfig?: TigerBackendConfig & TigerSpecificFunctionsSubscription, telemetry?: TelemetryData, authProvider?: IAuthProviderCallGuard); onHostname(hostname: string): IAnalyticalBackend; withTelemetry(componentName: string, props: object): IAnalyticalBackend; withCorrelation(correlationMetadata: Record): IAnalyticalBackend; withAuthentication(provider: IAuthenticationProvider): IAnalyticalBackend; deauthenticate(returnTo?: string): Promise; organization(organizationId: string): IOrganization; organizations(): IOrganizations; entitlements(): IEntitlements; dataSources(): IDataSourcesService; geo(): IGeoService; currentUser(): IUserService; workspace(id: string): IAnalyticalWorkspace; workspaces(): IWorkspacesQueryFactory; isAuthenticated: () => Promise; authenticate: (force: boolean) => Promise; /** * Perform API call that requires authentication. The call will be decorated with error handling * such that not authenticated errors will trigger authentication flow AND other errors will be * converted using the provided converter and throw. * * @param call - a call which requires an authenticated session * @param errorConverter - converter from rest client errors to analytical backend errors */ private authApiCall; /** * Triggers relevant handler if the provided error is an instance of * {@link @gooddata/sdk-backend-spi#NotAuthenticated} or {@link @gooddata/sdk-backend-spi#ContractExpired}. * * @param err - error to observe and trigger handler for * @returns the original error to facilitate re-throwing */ private handleAnalyticalBackendError; private getAuthenticationContext; private getAsyncCallContext; private triggerAuthentication; } export {}; //# sourceMappingURL=index.d.ts.map