@devicecloud.dev/dcd
Version:
Better cloud maestro testing
91 lines (90 loc) • 3.67 kB
TypeScript
import { TAppMetadata } from '../types';
export declare const ApiGateway: {
/**
* Enhances generic "fetch failed" errors with more specific diagnostic information
* @param error - The original TypeError from fetch
* @param url - The URL that was being fetched
* @returns Enhanced error with diagnostic information
*/
enhanceFetchError(error: TypeError, url: string): Error;
/**
* Standardized error handling for API responses
* @param res - The fetch response object
* @param operation - Description of the operation that failed
* @returns Never returns, always throws
*/
handleApiError(res: Response, operation: string): Promise<never>;
checkForExistingUpload(baseUrl: string, apiKey: string, sha: string): Promise<{
appBinaryId: string;
exists: boolean;
}>;
downloadArtifactsZip(baseUrl: string, apiKey: string, uploadId: string, results: "ALL" | "FAILED", artifactsPath?: string): Promise<void>;
finaliseUpload(config: {
apiKey: string;
backblazeSuccess: boolean;
baseUrl: string;
id: string;
metadata: TAppMetadata;
path: string;
sha: string;
supabaseSuccess: boolean;
}): Promise<Record<string, never>>;
getBinaryUploadUrl(baseUrl: string, apiKey: string, platform: "android" | "ios", fileSize: number): Promise<{
path: string;
tempPath: string;
finalPath: string;
id: string;
b2?: import("../types/generated/schema.types").components["schemas"]["B2UploadStrategy"];
}>;
finishLargeFile(baseUrl: string, apiKey: string, fileId: string, partSha1Array: string[]): Promise<any>;
getResultsForUpload(baseUrl: string, apiKey: string, uploadId: string): Promise<{
statusCode?: number;
results?: import("../types/generated/schema.types").components["schemas"]["TResultResponse"][];
}>;
getUploadStatus(baseUrl: string, apiKey: string, options: {
name?: string;
uploadId?: string;
}): Promise<{
createdAt?: string;
name?: string;
status: "CANCELLED" | "FAILED" | "PASSED" | "PENDING";
tests: Array<{
createdAt?: string;
durationSeconds?: number;
failReason?: string;
name: string;
status: "CANCELLED" | "FAILED" | "PASSED" | "PENDING";
}>;
}>;
listUploads(baseUrl: string, apiKey: string, options?: {
from?: string;
limit?: number;
name?: string;
offset?: number;
to?: string;
}): Promise<{
limit: number;
offset: number;
total: number;
uploads: Array<{
consoleUrl: string;
created_at: string;
id: string;
name: null | string;
}>;
}>;
uploadFlow(baseUrl: string, apiKey: string, testFormData: FormData): Promise<{
message?: string;
results?: import("../types/generated/schema.types").components["schemas"]["IDBResult"][];
}>;
/**
* Generic report download method that handles both junit and allure reports
* @param baseUrl - API base URL
* @param apiKey - API key for authentication
* @param uploadId - Upload ID to download report for
* @param reportType - Type of report to download ('junit' or 'allure')
* @param reportPath - Optional custom path for the downloaded report
* @returns Promise that resolves when download is complete
*/
downloadReportGeneric(baseUrl: string, apiKey: string, uploadId: string, reportType: "allure" | "html" | "junit", reportPath?: string): Promise<void>;
};