From a09820ecede6739bf86492ea454143da35ed7857 Mon Sep 17 00:00:00 2001 From: Jon M Date: Wed, 5 Feb 2025 09:51:24 +0000 Subject: [PATCH] Fix invalid types for errorOnTimeout functionality --- lib/models/index.d.ts | 92 ++++++++++++------------------------- lib/models/searchOptions.js | 2 +- lib/operations/index.d.ts | 35 ++++++-------- 3 files changed, 46 insertions(+), 83 deletions(-) diff --git a/lib/models/index.d.ts b/lib/models/index.d.ts index a5996b9..77c914c 100644 --- a/lib/models/index.d.ts +++ b/lib/models/index.d.ts @@ -152,7 +152,6 @@ export interface Metadata { * https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.3 */ rcptTo?: MessageAddress[]; - } /** @@ -166,7 +165,7 @@ export interface Message { /** * The type of message. */ - type: 'Email' | 'SMS'; + type: "Email" | "SMS"; /** * The sender of the message. */ @@ -226,7 +225,7 @@ export interface MessageSummary { /** * The type of message. */ - type: 'Email' | 'SMS'; + type: "Email" | "SMS"; /** * The sender of the message. */ @@ -311,27 +310,27 @@ export interface SearchOptions { /** * Specify how long to wait for a matching result (in milliseconds, default value is 10 seconds). */ - timeout?: number, + timeout?: number; /** * Limits results to only messages received after this date/time (default 1 hour ago). */ - receivedAfter?: Date, + receivedAfter?: Date; /** * Used alongside `itemsPerPage` to paginate through results. This is zero-based, meaning `0` is the first page of results. */ - page?: number, + page?: number; /** * A limit on the number of results to be returned. This can be set between `1` and `1000`, with the default being `50`. */ - itemsPerPage?: number, + itemsPerPage?: number; /** * When using the 'get' method, this option can be used to prevent an error being thrown if no matching message is found in time. */ - suppressError?: boolean + errorOnTimeout?: boolean; /** * Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`. */ - dir?: string + dir?: string; } /** @@ -341,19 +340,19 @@ export interface MessageListOptions { /** * Limits results to only messages received after this date/time (default 1 hour ago). */ - receivedAfter?: Date, + receivedAfter?: Date; /** * Used alongside `itemsPerPage` to paginate through results. This is zero-based, meaning `0` is the first page of results. */ - page?: number, + page?: number; /** * A limit on the number of results to be returned. This can be set between `1` and `1000`, with the default being `50`. */ - itemsPerPage?: number + itemsPerPage?: number; /** * Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`. */ - dir?: string + dir?: string; } /** @@ -482,36 +481,6 @@ export interface ServerListResult { items?: Server[]; } -/** - * Search options - */ -export interface SearchOptions { - /** - * Specify how long to wait for a matching result (in milliseconds, default value is 10 seconds). - */ - timeout?: number, - /** - * Limits results to only messages received after this date/time (default 1 hour ago). - */ - receivedAfter?: Date, - /** - * Used alongside `itemsPerPage` to paginate through results. This is zero-based, meaning `0` is the first page of results. - */ - page?: number, - /** - * A limit on the number of results to be returned. This can be set between `1` and `1000`, with the default being `50`. - */ - itemsPerPage?: number, - /** - * When using the 'get' method, this option can be used to prevent an error being thrown if no matching message is found in time. - */ - suppressError?: boolean - /** - * Optionally limits results based on the direction (`Sent` or `Received`), with the default being `Received`. - */ - dir?: string -} - /** * The result of an individual Spam Assassin rule */ @@ -554,7 +523,6 @@ export interface SpamAnalysisResult { score?: number; } - /** * The results of deliverability report performed by Mailosaur. */ @@ -584,14 +552,14 @@ export interface DeliverabilityReport { */ dnsRecords?: DnsRecords; /** - * The result of spam analysis performed by Mailosaur + * The result of spam analysis performed by Mailosaur */ spamAssassin?: SpamAssassinResult; } /** -* The result of an email domain check -*/ + * The result of an email domain check + */ export interface EmailAuthenticationResult { /** * The result of the check @@ -605,16 +573,16 @@ export interface EmailAuthenticationResult { * The raw values returned from the check */ rawValue: string; - /** + /** * The seperated tags returned from the check - */ - tags: { [key: string]: string}; + */ + tags: { [key: string]: string }; } /** -* The result of an domain check against a blocklist checker -*/ -export interface BlockListResult{ + * The result of an domain check against a blocklist checker + */ +export interface BlockListResult { /** * The identifier of the blocklist */ @@ -630,9 +598,9 @@ export interface BlockListResult{ } /** -* The results of email content analysis -*/ -export interface Content{ + * The results of email content analysis + */ +export interface Content { /** * The content contained embed tags */ @@ -672,9 +640,9 @@ export interface Content{ } /** -* The records found when checking DNS records of an email sender's domain -*/ -export interface DnsRecords{ + * The records found when checking DNS records of an email sender's domain + */ +export interface DnsRecords { /** * The A Records of the sender's domain */ @@ -690,9 +658,9 @@ export interface DnsRecords{ } /** -* The results of spam assassin check performed by Mailosaur. -*/ -export interface SpamAssassinResult{ + * The results of spam assassin check performed by Mailosaur. + */ +export interface SpamAssassinResult { /** * Overall Mailosaur spam score. */ diff --git a/lib/models/searchOptions.js b/lib/models/searchOptions.js index 43906c1..460ee84 100644 --- a/lib/models/searchOptions.js +++ b/lib/models/searchOptions.js @@ -4,7 +4,7 @@ class SearchOptions { this.receivedAfter = data.receivedAfter; this.page = data.page; this.itemsPerPage = data.itemsPerPage; - this.suppressError = data.suppressError; + this.errorOnTimeout = data.errorOnTimeout; this.dir = data.dir; } } diff --git a/lib/operations/index.d.ts b/lib/operations/index.d.ts index 9c7f866..080ef6b 100644 --- a/lib/operations/index.d.ts +++ b/lib/operations/index.d.ts @@ -1,5 +1,5 @@ -import * as stream from 'stream'; -import * as models from '../models'; +import * as stream from "stream"; +import * as models from "../models"; /** * Message analysis operations. @@ -15,15 +15,15 @@ export interface Analysis { messageId: string ): Promise; - /** + /** * Perform a deliverability report of an email. */ - deliverability( - /** - * The identifier of the message to be analyzed. - */ - messageId: string - ): Promise; + deliverability( + /** + * The identifier of the message to be analyzed. + */ + messageId: string + ): Promise; } /** @@ -79,7 +79,7 @@ export interface Messages { /** * Search options */ - options?: models.SearchOptions + options?: Omit ): Promise; /** @@ -205,8 +205,7 @@ export interface Servers { /** * Returns a list of your virtual servers. Servers are returned sorted in alphabetical order. */ - list( - ): Promise; + list(): Promise; /** * Creates a new virtual server. @@ -279,23 +278,20 @@ export interface Usage { * Retrieve account usage limits. Details the current limits and usage for your account. * This endpoint requires authentication with an account-level API key. */ - limits( - ): Promise; + limits(): Promise; /** * Retrieves the last 31 days of transactional usage. * This endpoint requires authentication with an account-level API key. */ - transactions( - ): Promise; + transactions(): Promise; } export interface Devices { /** * Returns a list of your virtual security devices. */ - list( - ): Promise; + list(): Promise; /** * Creates a new virtual security device. @@ -332,6 +328,5 @@ export interface Previews { /** * List all email clients that can be used to generate email previews. */ - listEmailClients( - ): Promise; + listEmailClients(): Promise; }