///
import type { IRushPlugin } from '@rushstack/rush-sdk';
import { ITerminal } from '@rushstack/terminal';
import type { RushConfiguration } from '@rushstack/rush-sdk';
import type { RushSession } from '@rushstack/rush-sdk';
import { WebClient } from '@rushstack/rush-sdk/lib/utilities/WebClient';
/**
* A helper for reading and updating objects on Amazon S3
*
* @public
*/
export declare class AmazonS3Client {
private readonly _credentials;
private readonly _s3Endpoint;
private readonly _s3Region;
private readonly _webClient;
private readonly _terminal;
constructor(credentials: IAmazonS3Credentials | undefined, options: IAmazonS3BuildCacheProviderOptionsAdvanced, webClient: WebClient, terminal: ITerminal);
static UriEncode(input: string): string;
static tryDeserializeCredentials(credentialString: string | undefined): IAmazonS3Credentials | undefined;
getObjectAsync(objectName: string): Promise;
uploadObjectAsync(objectName: string, objectBuffer: Buffer): Promise;
private _writeDebugLine;
private _writeWarningLine;
private _makeRequestAsync;
_getSha256Hmac(key: string | Buffer, data: string): Buffer;
_getSha256Hmac(key: string | Buffer, data: string, encoding: 'hex'): string;
private _getSha256;
private _getIsoDateString;
private _safeReadResponseTextAsync;
private _getS3ErrorAsync;
/**
* Validates a S3 endpoint which is http(s):// + hostname + port. Hostname validated according to RFC 1123
* {@link https://docs.aws.amazon.com/general/latest/gr/s3.html}
*/
private _validateEndpoint;
private _sendCacheRequestWithRetriesAsync;
}
/**
* Advanced options where user has the specify the full http endpoint
* @public
*/
export declare interface IAmazonS3BuildCacheProviderOptionsAdvanced extends IAmazonS3BuildCacheProviderOptionsBase {
s3Endpoint: string;
}
/**
* @public
*/
export declare interface IAmazonS3BuildCacheProviderOptionsBase {
s3Region: string;
s3Prefix: string | undefined;
isCacheWriteAllowed: boolean;
}
/**
* Simple options where user only provides the bucket and the endpoint is automatically built
* @public
*/
export declare interface IAmazonS3BuildCacheProviderOptionsSimple extends IAmazonS3BuildCacheProviderOptionsBase {
s3Bucket: string;
}
/**
* Credentials for authorizing and signing requests to an Amazon S3 endpoint.
*
* @public
*/
export declare interface IAmazonS3Credentials {
accessKeyId: string;
secretAccessKey: string;
sessionToken: string | undefined;
}
/**
* @public
*/
declare class RushAmazonS3BuildCachePlugin implements IRushPlugin {
pluginName: string;
apply(rushSession: RushSession, rushConfig: RushConfiguration): void;
}
export default RushAmazonS3BuildCachePlugin;
export { }