tdpw
Version:
CLI tool for uploading Playwright test reports to TestDino platform with Azure storage support
59 lines • 1.64 kB
TypeScript
import type { Config } from '../config';
/**
* Response structure for SAS token request (based on actual API response)
*/
export interface SasTokenResponse {
tokenId: string;
sasToken: string;
containerUrl: string;
blobPath: string;
uniqueId: string;
expiresAt: string;
maxSize: number;
permissions: string[];
uploadInstructions: {
baseUrl: string;
pathPrefix: string;
allowedFileTypes: string[];
maxFileSize: number;
exampleUpload: {
method: string;
url: string;
headers: Record<string, string>;
};
};
}
/**
* Service to request and manage Azure SAS tokens from TestDino API
*/
export declare class SasTokenService {
private readonly config;
private readonly baseUrl;
private readonly apiKey;
constructor(config: Config);
/**
* Headers to include on every SAS token request
*/
private getHeaders;
/**
* Request a SAS token from TestDino API using POST method
*/
requestSasToken(): Promise<SasTokenResponse>;
/**
* Handle HTTP error responses with detailed error messages
*/
private handleSasError;
/**
* Validate and parse the SAS token response (updated for actual API format)
*/
private validateSasResponse;
/**
* Check if SAS token is expired (updated for actual API format)
*/
isTokenExpired(sasResponse: SasTokenResponse): boolean;
/**
* Get time until SAS token expires (in minutes)
*/
getTimeUntilExpiry(sasResponse: SasTokenResponse): number;
}
//# sourceMappingURL=sas.d.ts.map