MailSlurp JS

Globals / WaitForControllerApi

Class: WaitForControllerApi

WaitForControllerApi - object-oriented interface

export

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Inherited from BaseAPI.constructor

Defined in src/generated/api.ts:57

Parameters:

NameTypeDefault value
configuration?Configuration-
basePathstringBASE_PATH
fetchFetchAPIportableFetch

Returns: WaitForControllerApi

Properties

basePath

Protected basePath: string

Inherited from BaseAPI.basePath

Defined in src/generated/api.ts:61


configuration

Protected configuration: Configuration

Inherited from BaseAPI.configuration

Defined in src/generated/api.ts:57


fetch

Protected fetch: FetchAPI

Inherited from BaseAPI.fetch

Defined in src/generated/api.ts:62

Methods

waitFor

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

Defined in src/generated/api.ts:21549

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

summary Wait for an email to match the provided filter conditions such as subject contains keyword.

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

NameType
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:21567

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. Hold connection until inbox count matches expected or timeout occurs

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

NameType
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:21593

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:

NameType
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:21619

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:

NameTypeDescription
matchOptionsMatchOptionsmatchOptions
count?number-
inboxId?string-
timeout?number-
unreadOnly?boolean-
options?any-

Returns: Promise<EmailPreview[]>


waitForMatchingFirstEmail

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

Defined in src/generated/api.ts:21648

Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is 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 for or return the first email that matches provided MatchOptions array

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

NameTypeDescription
matchOptionsMatchOptionsmatchOptions
inboxId?string-
timeout?number-
unreadOnly?boolean-
options?any-

Returns: Promise<Email>


waitForNthEmail

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

Defined in src/generated/api.ts:21677

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 in the inbox specified. IF indx doesn’t exist waits for it to exist or timeout to occur.

throws {RequiredError}

memberof WaitForControllerApi

Parameters:

NameType
inboxId?string
?number
timeout?number
unreadOnly?boolean
options?any

Returns: Promise<Email>