/// /// import * as helpers from './helpers'; import type { AgentParams, Attachment, ClientResponse } from './models/common'; import type { ReportPortalConfig } from './models/config'; import type { FinishLaunchOptions, FinishTestItemOptions, FinishTestItemRQ, LogOptions, MergeLaunchesOptions, StartLaunchOptions, StartTestItemOptions, UpdateLaunchOptions } from './models/requests'; import type { FinishLaunchResponse, FinishTestItemResponse, PageLaunchResource, ServerInfoResponse, StartLaunchResponse, StartTestItemResponse, UpdateLaunchResponse } from './models/responses'; type PromiseExecutor = (resolve: (value: T) => void, reject: (reason?: Error) => void) => void; interface ItemObj { promiseStart: Promise; realId: string; children: string[]; finishSend: boolean; promiseFinish: Promise; resolveFinish: (value: T) => void; rejectFinish: (reason?: Error) => void; } type RequestPromiseFunc = (itemUuid: string, launchUuid: string) => Promise; declare class RPClient { private config; private debug?; private isLaunchMergeRequired; private apiKey; private token; private map; private baseURL; private headers; helpers: typeof helpers; private restClient; private statistics; private launchUuid; private itemRetriesChainMap; private itemRetriesChainKeyMapByTempId; /** * Create a client for RP. */ constructor(options: ReportPortalConfig, agentParams?: AgentParams); logDebug(msg: unknown, dataMsg?: unknown): void; calculateItemRetriesChainMapKey(launchId: string, parentId: string | undefined, name: string, itemId?: string): string; cleanItemRetriesChain(tempIds: string[]): void; getUniqId(): string; getRejectAnswer(tempId: string, error: Error): ClientResponse; getNewItemObj(startPromiseFunc: PromiseExecutor): ItemObj; cleanMap(ids: string[]): void; checkConnect(): Promise; getServerInfoUrl(): string; fetchServerInfo(): Promise; triggerStatisticsEvent(): Promise; /** * Start launch and report it. */ startLaunch(launchDataRQ: StartLaunchOptions): ClientResponse; /** * Finish launch. */ finishLaunch(launchTempId: string, finishExecutionRQ?: FinishLaunchOptions): ClientResponse; getMergeLaunchesRequest(launchIds: Array, mergeOptions?: MergeLaunchesOptions): { extendSuitesDescription: boolean; description: string; mergeType: string; name: string; launches: (string | number)[]; mode: string; attributes: import("./models/common").Attribute[] | undefined; endTime: number; }; /** * This method is used for merge launches in ReportPortal. * Please, keep in mind that this method work only in case the option isLaunchMergeRequired is true. */ mergeLaunches(mergeOptions?: MergeLaunchesOptions): Promise | undefined; getPromiseFinishAllItems(launchTempId: string): Promise; /** * Update launch. */ updateLaunch(launchTempId: string, launchData: UpdateLaunchOptions): ClientResponse; /** * If there is no parentItemId starts Suite, else starts test or item. */ startTestItem(testItemDataRQ: StartTestItemOptions, launchTempId: string, parentTempId?: string): ClientResponse; /** * Finish Suite or Step level. */ finishTestItem(itemTempId: string, finishTestItemRQ?: FinishTestItemOptions): ClientResponse; saveLog(itemObj: ItemObj, requestPromiseFunc: RequestPromiseFunc): ClientResponse; sendLog(itemTempId: string, saveLogRQ: LogOptions, fileObj?: Attachment): ClientResponse; /** * Send log of test results. */ sendLogWithoutFile(itemTempId: string, saveLogRQ: LogOptions): ClientResponse; /** * Send log of test results with file. */ sendLogWithFile(itemTempId: string, saveLogRQ: LogOptions, fileObj: Attachment): ClientResponse; getRequestLogWithFile(saveLogRQ: LogOptions, fileObj: Attachment): Promise; buildMultiPartStream(jsonPart: unknown[], filePart: Attachment, boundary: string): Buffer; finishTestItemPromiseStart(itemObj: ItemObj, itemTempId: string, finishTestItemData: FinishTestItemRQ): void; } export = RPClient;