UNPKG

@rushstack/rush-http-build-cache-plugin

Version:

Rush plugin for generic HTTP cloud build cache

51 lines 2 kB
import type { ITerminal } from '@rushstack/terminal'; import { type ICloudBuildCacheProvider, type RushSession } from '@rushstack/rush-sdk'; export interface IHttpBuildCacheTokenHandler { exec: string; args?: string[]; } /** * @public */ export type UploadMethod = 'PUT' | 'POST' | 'PATCH'; /** * @public */ export interface IHttpBuildCacheProviderOptions { url: string; tokenHandler?: IHttpBuildCacheTokenHandler; uploadMethod?: UploadMethod; minHttpRetryDelayMs?: number; headers?: Record<string, string>; cacheKeyPrefix?: string; isCacheWriteAllowed: boolean; pluginName: string; rushJsonFolder: string; } export declare class HttpBuildCacheProvider implements ICloudBuildCacheProvider { private readonly _pluginName; private readonly _rushProjectRoot; private readonly _environmentCredential; private readonly _isCacheWriteAllowedByConfiguration; private readonly _url; private readonly _uploadMethod; private readonly _headers; private readonly _cacheKeyPrefix; private readonly _tokenHandler; private readonly _minHttpRetryDelayMs; private __credentialCacheId; get isCacheWriteAllowed(): boolean; constructor(options: IHttpBuildCacheProviderOptions, rushSession: RushSession); tryGetCacheEntryBufferByIdAsync(terminal: ITerminal, cacheId: string): Promise<Buffer | undefined>; trySetCacheEntryBufferAsync(terminal: ITerminal, cacheId: string, objectBuffer: Buffer): Promise<boolean>; updateCachedCredentialAsync(terminal: ITerminal, credential: string): Promise<void>; updateCachedCredentialInteractiveAsync(terminal: ITerminal): Promise<void>; deleteCachedCredentialsAsync(terminal: ITerminal): Promise<void>; private get _credentialCacheId(); private _makeHttpRequestAsync; private _tryGetCredentialsAsync; private _tryGetCredentialsFromCacheAsync; private _getFailureType; private _reportFailure; } //# sourceMappingURL=HttpBuildCacheProvider.d.ts.map