MailSlurp JS

Globals / WaitForControllerApi

# Class: WaitForControllerApi

WaitForControllerApi - object-oriented interface

export

# Hierarchy

# Index

# Constructors

# Properties

# Methods

# Constructors

# constructor

+ new WaitForControllerApi(configuration?: Configuration, basePath?: string, fetch?: FetchAPI): WaitForControllerApi

Inherited from BaseAPI.constructor

Defined in src/generated/api.ts:57 (opens new window)

# Parameters:

Name Type Default value
configuration? Configuration -
basePath string BASE_PATH
fetch FetchAPI portableFetch

Returns: WaitForControllerApi

# Properties

# basePath

Protected basePath: string

Inherited from BaseAPI.basePath

Defined in src/generated/api.ts:61 (opens new window)


# configuration

Protected configuration: Configuration

Inherited from BaseAPI.configuration

Defined in src/generated/api.ts:57 (opens new window)


# fetch

Protected fetch: FetchAPI

Inherited from BaseAPI.fetch

Defined in src/generated/api.ts:62 (opens new window)

# Methods

# waitFor

waitFor(waitForConditions?: WaitForConditions, options?: any): Promise<EmailPreview[]>

Defined in src/generated/api.ts:13898 (opens new window)

Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met

summary Wait for conditions to be met

throws {RequiredError}

memberof WaitForControllerApi

# Parameters:

Name Type
waitForConditions? WaitForConditions
options? any

Returns: Promise<EmailPreview[]>


# waitForEmailCount

waitForEmailCount(count?: number, inboxId?: string, timeout?: number, unreadOnly?: boolean, options?: any): Promise<EmailPreview[]>

Defined in src/generated/api.ts:13916 (opens new window)

If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded.

summary Wait for and return count number of emails

throws {RequiredError}

memberof WaitForControllerApi

# Parameters:

Name Type
count? number
inboxId? string
timeout? number
unreadOnly? boolean
options? any

Returns: Promise<EmailPreview[]>


# waitForLatestEmail

waitForLatestEmail(inboxId?: string, timeout?: number, unreadOnly?: boolean, options?: any): Promise<Email>

Defined in src/generated/api.ts:13942 (opens new window)

Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox set unreadOnly=true or see the other receive methods such as waitForNthEmail or waitForEmailCount.

summary Fetch inbox's latest email or if empty wait for an email to arrive

throws {RequiredError}

memberof WaitForControllerApi

# Parameters:

Name Type
inboxId? string
timeout? number
unreadOnly? boolean
options? any

Returns: Promise<Email>


# waitForMatchingEmail

waitForMatchingEmail(matchOptions: MatchOptions, count?: number, inboxId?: string, timeout?: number, unreadOnly?: boolean, options?: any): Promise<EmailPreview[]>

Defined in src/generated/api.ts:13968 (opens new window)

Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the MatchOptions object for options. An example payload is { matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController getEmailContentMatch method.

summary Wait or return list of emails that match simple matching patterns

throws {RequiredError}

memberof WaitForControllerApi

# Parameters:

Name Type Description
matchOptions MatchOptions matchOptions
count? number -
inboxId? string -
timeout? number -
unreadOnly? boolean -
options? any -

Returns: Promise<EmailPreview[]>


# waitForNthEmail

waitForNthEmail(inboxId?: string, index?: number, timeout?: number, unreadOnly?: boolean, options?: any): Promise<Email>

Defined in src/generated/api.ts:13997 (opens new window)

If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.

summary Wait for or fetch the email with a given index in the inbox specified

throws {RequiredError}

memberof WaitForControllerApi

# Parameters:

Name Type
inboxId? string
index? number
timeout? number
unreadOnly? boolean
options? any

Returns: Promise<Email>