import '@testing-library/cypress/add-commands' import './commands.custom' export type WebhookSiteToken = Readonly<{ uuid: string redirect: boolean alias: string | null actions: boolean cors: boolean expiry: boolean timeout: number premium: boolean user_id: string | null password: boolean ip: string user_agent: string default_content: string default_status: number default_content_type: string premium_expires_at: string description: null created_at: string // "2023-04-19 20:53:03" updated_at: string // "2023-04-19 20:53:03" // computed email: string }> export type WebhookSiteTokenRequest = Readonly<{ uuid: string type: "email" | string hostname: string token_id: string sender: string message_id: string "destinations": ReadonlyArray checks: { spam: boolean virus: boolean spf: boolean dkim: boolean dmarc: boolean }, headers: { "authentication-results": ReadonlyArray "content-type": ReadonlyArray date: ReadonlyArray "dkim-signature": ReadonlyArray from: ReadonlyArray "list-unsubscribe": ReadonlyArray "message-id": ReadonlyArray "mime-version": ReadonlyArray received: ReadonlyArray "received-spf": ReadonlyArray "reply-to": ReadonlyArray "return-path": ReadonlyArray sender: ReadonlyArray subject: ReadonlyArray to: ReadonlyArray "x-msg-eid": ReadonlyArray "x-please-report-any-spam": ReadonlyArray }, content: string text_content: string email_truncated: boolean size: number files: ReadonlyArray created_at: string // "2023-04-19 20:53:03" updated_at: string // "2023-04-19 20:53:03" sorting: number }> export type WebhookSiteTokenRequests = ReadonlyArray export type GetWebhookSiteTokenRequestsResponse = Readonly<{ data: WebhookSiteTokenRequests, total: number per_page: number, current_page: number, is_last_page: true, from: number, to: number }> declare global { namespace Cypress { interface Chainable { /** * @description creates new webhook site token object * @link https://docs.webhook.site/api/about.html#create-new-urlemail-address * @param {string} apiKey * @returns {Cypress.Chainable} */ readonly getWebHookSiteToken(apiKey?: string): Chainable /** * @description get list of latest captured requests * @link https://docs.webhook.site/api/tokens.html#capture-request * @param {string} token * @param {string} apiKey * @param {number} timeout * @returns {Cypress.Chainable} */ readonly getWebHookSiteTokenRequests(token: string, apiKey?: string, timeout?: number): Chainable /** * @description remove webhookSite token * @link https://docs.webhook.site/api/tokens.html#delete-token * @param {string} token * @param {string} apiKey * @returns {Cypress.Chainable} */ readonly deleteWebHookSiteToken(token: string, apiKey?: string): Chainable } } }