import { type ServiceScope } from '@microsoft/sp-core-library'; import type { IFetchProvider } from '../httpClient/FetchProvider'; import type IDigestCache from './IDigestCache'; import type SPHttpClientCommonConfiguration from './SPHttpClientCommonConfiguration'; import type { ISPHttpClientOptions } from './SPHttpClient'; import ODataVersion from './ODataVersion'; import type SPHttpClientConfiguration from './SPHttpClientConfiguration'; import SPHttpClientResponse from './SPHttpClientResponse'; import type ISPCookieRefresher from './ISPCookieRefresher'; /** * Private - this class contains some internal code shared between SPHttpClient * and SPHttpClientBatch. * * @internal */ export default class SPHttpClientHelper { static cloneHeaders(options: RequestInit): Headers; static applyDefaultHeaders(headers: Headers, configuration: SPHttpClientCommonConfiguration, options: ISPHttpClientOptions, oDataVersion: ODataVersion | undefined, originalCorrelationId?: string): void; /** * Use a heuristic to infer the base URL for authentication. * * @remarks * Attempts to infer the SPWeb URL associated with the provided REST URL, by looking * for common SharePoint path components such as "_api", "_layouts", or "_vit_bin". * This is necessary for operations such as the X-RequestDigest * and ODATA batching, which require POSTing to a separate REST endpoint * in order to complete a request. * * For example, if the requestUrl is "/sites/site/web/_api/service", * the returned URL would be "/sites/site/web". Or if the requestUrl * is "http://example.com/_layouts/service", the returned URL would be * "http://example.com". * * If the URL cannot be determined, an exception is thrown. * * @param requestUrl - The URL for a SharePoint REST service * @returns the inferred SPWeb URL */ static getWebUrlFromRequestUrl(requestUrl: string): string; /** * All network requests are routed through this method, which calls the * underlying IFetchProvider.fetch(). */ static fetchCore(url: string, configuration: SPHttpClientConfiguration, options: ISPHttpClientOptions, serviceScope: ServiceScope, digestCache: IDigestCache, fetchProvider: IFetchProvider, cookieRefresher: ISPCookieRefresher, logSourceId: string, originalCorrelationId?: string): Promise; /** * For both SPHttpClient and SPHttpClientBatch, we fetch a digest and then use it to * to make a REST call. If the REST fails in a way that the digest is invalid, * we need to discard the bad digest. This function is the common implementation * of that logic, in case we need to add special cases in the future. * * @param promise - the promise returned by IFetchProvider.fetch() * @param webUrl - the cache key to clear * @param digestCache - the cache * @returns - the promise after this logic is applied */ static handleAuthenticationErrors(promise: Promise, webUrl: string, digestCache: IDigestCache): Promise; static overrideHttpMethod(options: ISPHttpClientOptions | undefined, httpRequestMethod: string): ISPHttpClientOptions; private static _fetchWithInstrumentation; private static _isFluid; private static _handleFluidEnvironment; } //# sourceMappingURL=SPHttpClientHelper.d.ts.map