UNPKG

cumulocity-cypress

Version:
55 lines (54 loc) 2.32 kB
import { C8yAuthOptions, C8yPactAuthObject } from "../auth"; import { C8yClient, C8yClientOptions } from "../c8yclient"; import { C8yPactRecord, C8yPactRequest, C8yPactResponse, C8yPactID } from "./c8ypact"; /** * Constructor parameters for C8yDefaultPactRecord */ export interface C8yDefaultPactRecordInit { request: C8yPactRequest; response: C8yPactResponse<any>; options?: C8yClientOptions; auth?: C8yPactAuthObject; createdObject?: string; modifiedResponse?: C8yPactResponse<any>; id?: C8yPactID; } /** * Default implementation of C8yPactRecord. Use C8yDefaultPactRecord.from to create * a C8yPactRecord from a Cypress.Response object or an C8yPactRecord object. */ export declare class C8yDefaultPactRecord implements C8yPactRecord { id?: C8yPactID; request: C8yPactRequest; response: C8yPactResponse<any>; options?: C8yClientOptions; auth?: C8yPactAuthObject; createdObject?: string; modifiedResponse?: C8yPactResponse<any>; constructor(request: C8yPactRequest, response: C8yPactResponse<any>, options?: C8yClientOptions, auth?: C8yPactAuthObject, createdObject?: string, modifiedResponse?: C8yPactResponse<any>, id?: C8yPactID); constructor(params: C8yDefaultPactRecordInit); /** * Creates a C8yPactRecord from a Cypress.Response or an C8yPactRecord object. * @param obj The Cypress.Response<any> or C8yPactRecord object. * @param auth The auth information to use. * @param client The C8yClient for options and auth information. * @param id The optional ID for the pact record. */ static from(obj: Cypress.Response<any> | C8yPactRecord | Partial<Cypress.Response<any>>, auth?: C8yAuthOptions, client?: C8yClient, id?: C8yPactID): C8yPactRecord; /** * Returns the date of the response. */ date(): Date | null; /** * Converts the C8yPactRecord to a Cypress.Response object. */ toCypressResponse<T>(): Cypress.Response<T>; hasRequestHeader(key: string): boolean; authType(): "BearerAuth" | "CookieAuth" | "BasicAuth" | undefined; } export declare function createPactRecord(response: Partial<Cypress.Response<any>>, client?: C8yClient, options?: { loggedInUser?: string; loggedInUserAlias?: string; authType?: string; id?: C8yPactID; }): C8yPactRecord;