UNPKG

cumulocity-cypress

Version:
30 lines (29 loc) 1.35 kB
import { C8yBaseUrl, C8yTenant } from "../types"; import { C8yPactRecord } from "./c8ypact"; export declare function isURL(obj: any): obj is URL; export declare function relativeURL(url: URL | string): string | undefined; export declare function removeBaseUrlFromString(url: string, baseUrl?: C8yBaseUrl): string; export declare function removeBaseUrlFromRequestUrl(record: C8yPactRecord, baseUrl?: C8yBaseUrl): void; export declare function normalizeUrl(url: string): string; export declare function tenantUrl(baseUrl?: C8yBaseUrl, tenant?: C8yTenant): string | undefined; export declare function updateURLs(value: string, from: { baseUrl: C8yBaseUrl; tenant?: C8yTenant; }, to: { baseUrl: C8yBaseUrl; tenant?: C8yTenant; }): string; /** * Checks if the given URL is an absolute URL. * @param url The URL to check. * @returns True if the URL is an absolute URL, false otherwise. */ export declare function isAbsoluteURL(url: string): boolean; /** * Validates the base URL and throws an error if the base URL is not an absolute URL. This * is required as commands expect an absolute URL as baseUrl. Will not fail for undefined values. * `Cypress.config().baseUrl` is validated by Cypress itself and throw an error. * * @param baseUrl The url to validate. */ export declare function validateBaseUrl(baseUrl?: C8yBaseUrl): void;