cumulocity-cypress
Version:
Cypress commands for Cumulocity IoT
38 lines (37 loc) • 1.75 kB
TypeScript
import { C8yAuthOptions, C8yPactAuthObject } from "../auth";
import { C8yClient, C8yClientOptions } from "../c8yclient";
import { C8yPactRecord, C8yPactRequest, C8yPactResponse } from "./c8ypact";
/**
* 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 {
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>);
/**
* Creates a C8yPactRecord from a Cypress.Response or an C8yPactRecord object.
* @param obj The Cypress.Response<any> or C8yPactRecord object.
* @param client The C8yClient for options and auth information.
*/
static from(obj: Cypress.Response<any> | C8yPactRecord | Partial<Cypress.Response<any>>, auth?: C8yAuthOptions, client?: C8yClient): 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(): "BasicAuth" | "CookieAuth" | undefined;
}
export declare function createPactRecord(response: Partial<Cypress.Response<any>>, client?: C8yClient, options?: {
loggedInUser?: string;
loggedInUserAlias?: string;
authType?: string;
}): C8yPactRecord;