import { RequestConfig, Client as Client$1, ClientOptions } from '@microsoft/teams.common'; type SchemaVersion = 'beta' | 'v1.0'; /** * Configuration options for the `call` method * @see {@link Client.call} */ type CallOptions = { /** HTTP request configuration */ requestConfig?: RequestConfig; }; type ParamDefs = Partial>; type EndpointRequest = { ver?: SchemaVersion; method: 'get' | 'post' | 'patch' | 'delete' | 'put'; path: string; paramDefs?: ParamDefs; params?: Record; body?: any; config?: RequestConfig; responseType?: TResponse; }; /** * Error thrown when a Graph API request fails. * Surfaces the response body from the Graph API for easier debugging. */ declare class GraphError extends Error { /** HTTP status code */ readonly statusCode: number; /** Graph API error code (e.g. "Authorization_RequestDenied") */ readonly code?: string; /** The full response body from the Graph API */ readonly body: unknown; /** The underlying error that caused this GraphError (e.g. the Axios error) */ readonly source?: unknown; constructor(statusCode: number, body: unknown, method: string, url: string, source?: unknown); } type Options = (Client$1 | ClientOptions) & { /** Graph service root. By default, the global commercial URL "https://graph.microsoft.com" is used, * but certain tenants may wish to override this to direct Graph API calls to a different cloud instance. */ baseUrlRoot?: string; }; /** Graph-specific client options. */ type GraphOptions = { /** Graph service root override for routing Graph calls to sovereign cloud. */ baseUrlRoot?: string; }; /** * / * Provides an entry point for invoking Microsoft Graph APIs. */ declare class Client { protected baseUrlRoot: string; protected _http: Client$1; protected betaHttp?: Client$1; /** * The underlying HTTP client, pre-configured with Graph base URL and headers. * Use for raw Graph API requests not covered by endpoint functions. */ get http(): Client$1; /** * Creates a Graph client. * * @param options - The HTTP client to use; an existing {@link HttpClient} will be cloned, * or an {@link HttpClientOptions} bag will be used to build a new one. * HTTP-level settings like headers, interceptors, and timeouts belong here. * @param graphOptions - Graph-specific options. Takes precedence over `options.baseUrlRoot` * when both are set. * * @example * // Public cloud (default) * new Client({ token }); * * @example * // Sovereign cloud (GCCH) * new Client(httpClient, { baseUrlRoot: 'https://graph.microsoft.us' }); */ constructor(options?: Options, graphOptions?: GraphOptions); /** * Executes a Graph API endpoint function with optional HTTP configuration * * @param func - The endpoint function to execute * @param args - Arguments for the endpoint function, optionally followed by {@link CallConfig} * @returns Promise resolving to the endpoint's response data * * @example * ```typescript * // Simple call * const user = await client.call(endpoints.users.get, 'user-id'); * * // With HTTP configuration * const user = await client.call(endpoints.users.get, 'user-id', { * requestConfig: { * timeout: 5000 * } * }); * ``` */ call EndpointRequest, R = ReturnType extends EndpointRequest ? T : never>(func: F, ...args: [...Parameters, CallOptions?]): Promise; private getHttpClient; } export { type CallOptions, Client, type EndpointRequest, GraphError, type SchemaVersion };