interface SudoEmailClient {
    blockEmailAddresses(input): Promise<BatchOperationResult<string, string>>;
    checkEmailAddressAvailability(input): Promise<string[]>;
    createCustomEmailFolder(input): Promise<EmailFolder>;
    createDraftEmailMessage(input): Promise<DraftEmailMessageMetadata>;
    deleteCustomEmailFolder(input): Promise<undefined | EmailFolder>;
    deleteDraftEmailMessages(input): Promise<BatchOperationResult<DeleteEmailMessageSuccessResult, EmailMessageOperationFailureResult>>;
    deleteEmailMessage(id): Promise<undefined | DeleteEmailMessageSuccessResult>;
    deleteEmailMessages(ids): Promise<BatchOperationResult<DeleteEmailMessageSuccessResult, EmailMessageOperationFailureResult>>;
    deprovisionEmailAddress(id): Promise<EmailAddress>;
    exportKeys(): Promise<ArrayBuffer>;
    getConfigurationData(): Promise<ConfigurationData>;
    getConfiguredEmailDomains(cachePolicy?): Promise<string[]>;
    getDraftEmailMessage(input): Promise<undefined | DraftEmailMessage>;
    getEmailAddress(input): Promise<undefined | EmailAddress>;
    getEmailAddressBlocklist(): Promise<UnsealedBlockedAddress[]>;
    getEmailMessage(input): Promise<undefined | EmailMessage>;
    getEmailMessageRfc822Data(input): Promise<undefined | EmailMessageRfc822Data>;
    getEmailMessageWithBody(input): Promise<undefined | EmailMessageWithBody>;
    getSupportedEmailDomains(cachePolicy?): Promise<string[]>;
    importKeys(archiveData): Promise<void>;
    listDraftEmailMessageMetadata(): Promise<DraftEmailMessageMetadata[]>;
    listDraftEmailMessageMetadataForEmailAddressId(emailAddressId): Promise<DraftEmailMessageMetadata[]>;
    listDraftEmailMessages(): Promise<DraftEmailMessage[]>;
    listDraftEmailMessagesForEmailAddressId(emailAddressId): Promise<DraftEmailMessage[]>;
    listEmailAddresses(input?): Promise<ListEmailAddressesResult>;
    listEmailAddressesForSudoId(input): Promise<ListEmailAddressesResult>;
    listEmailFoldersForEmailAddressId(input): Promise<ListOutput<EmailFolder>>;
    listEmailMessages(input): Promise<ListEmailMessagesResult>;
    listEmailMessagesForEmailAddressId(input): Promise<ListEmailMessagesResult>;
    listEmailMessagesForEmailFolderId(input): Promise<ListEmailMessagesResult>;
    lookupEmailAddressesPublicInfo(input): Promise<EmailAddressPublicInfo[]>;
    provisionEmailAddress(input): Promise<EmailAddress>;
    reset(): Promise<void>;
    sendEmailMessage(input): Promise<SendEmailMessageResult>;
    subscribeToEmailMessages(subscriptionId, subscriber): Promise<void>;
    unblockEmailAddresses(input): Promise<BatchOperationResult<string, string>>;
    unblockEmailAddressesByHashedValue(input): Promise<BatchOperationResult<string, string>>;
    unsubscribeFromEmailMessages(subscriptionId): void;
    updateCustomEmailFolder(input): Promise<EmailFolder>;
    updateDraftEmailMessage(input): Promise<DraftEmailMessageMetadata>;
    updateEmailAddressMetadata(input): Promise<string>;
    updateEmailMessages(input): Promise<BatchOperationResult<UpdatedEmailMessageSuccess, EmailMessageOperationFailureResult>>;
}

Implemented by

Methods

  • Block email address(es) for the given owner

    Parameters

    Returns Promise<BatchOperationResult<string, string>>

    The results of the operation

  • Create a custom email folder for the email address identified by emailAddressId.

    Parameters

    Returns Promise<EmailFolder>

    The created custom email folder.

  • Delete a custom email folder for the email address identified by emailAddressId. When a custom folder is deleted, any messages in the folder will be moved to TRASH.

    Parameters

    Returns Promise<undefined | EmailFolder>

    The deleted folder, or undefined if folder was not found.

  • Delete a single email message identified by id.

    Parameters

    • id: string

      The identifier of the email message to be deleted.

    Returns Promise<undefined | DeleteEmailMessageSuccessResult>

    Result object containing the identifier of the email message that was deleted, or undefined if the email message could not be deleted.

    Throws

    NotRegisteredError

    Throws

    LimitExceededError

    Throws

    ServiceError

  • Delete the email messages identified by the list of ids.

    Email messages can only be deleted in batches of 100. Anything greater will throw a LimitExceededError.

    Parameters

    • ids: string[]

      A list of one or more identifiers of the email messages to be deleted. There is a limit of 100 email message ids per API request. Exceeding this will cause an error to be thrown.

    Returns Promise<BatchOperationResult<DeleteEmailMessageSuccessResult, EmailMessageOperationFailureResult>>

    The status of the delete: Success - All email messages succeeded to delete. Partial - Only a partial amount of messages succeeded to delete. Includes a list of the identifiers of the email messages that failed and succeeded to delete. Failure - All email messages failed to delete.

    Throws

    NotRegisteredError

    Throws

    InvalidArgumentError

    Throws

    LimitExceededError

    Throws

    ServiceError

  • Deprovision an email address.

    Parameters

    • id: string

      The identifier of the email address to deprovision.

    Returns Promise<EmailAddress>

    The deprovisioned email address.

    Throws

    AddressNotFoundError

    Throws

    NotRegisteredError

  • Export the cryptographic keys to a key archive.

    Returns Promise<ArrayBuffer>

    Key archive data.

  • Get the configuration data for the email service.

    Returns Promise<ConfigurationData>

    The configuration data for the email service.

  • Get a list of all of the email domains for which end-to-end encryption is supported.

    Parameters

    • Optional cachePolicy: CachePolicy

      Determines how the configured email domains will be fetched. Default usage is remoteOnly.

    Returns Promise<string[]>

    A list of all configured domains.

    Throws

    NotRegisteredError

    Throws

    ServiceError

  • Get a draft email message that has been previously saved.

    Parameters

    Returns Promise<undefined | DraftEmailMessage>

    The draft email message identified by id or undefined if not found.

  • Get an email address identified by id.

    Parameters

    Returns Promise<undefined | EmailAddress>

    The email address identified by id or undefined if the email address cannot be found.

  • Get email address blocklist for logged in user

    Returns Promise<UnsealedBlockedAddress[]>

    The list of unsealed blocked addresses

  • Get an email message identified by id.

    Parameters

    Returns Promise<undefined | EmailMessage>

    The email message identified by id or undefined if the email message cannot be found.

  • Parameters

    Returns Promise<undefined | EmailMessageRfc822Data>

    The data associated with the email message or undefined if the email message cannot be found.

    Deprecated

    Use getEmailMessageWithBody instead to retrieve the body and attachment data.

    Get the RFC 6854 (supersedes RFC 822) data of the email message.

  • Get the body and attachment data of an EmailMessage

    Parameters

    Returns Promise<undefined | EmailMessageWithBody>

    The data associated with the email message or undefined if not found

  • Get a list of all of the email domains on which emails may be provisioned.

    Parameters

    • Optional cachePolicy: CachePolicy

      Determines how the supported email domains will be fetched. Default usage is remoteOnly.

    Returns Promise<string[]>

    A list of supported domains.

    Throws

    NotRegisteredError

    Throws

    ServiceError

  • Imports cryptographic keys from a key archive.

    Parameters

    • archiveData: ArrayBuffer

      Key archive data to import the keys from.

    Returns Promise<void>

  • Lists the metadata of all draft email messages for the user.

    Returns Promise<DraftEmailMessageMetadata[]>

    An array of draft email message metadata or an empty array if no matching draft email messages can be found.

  • Lists the metadata of all draft email messages for the specified email address identifier.

    Parameters

    • emailAddressId: string

      The identifier of the email address associated with the draft email messages.

    Returns Promise<DraftEmailMessageMetadata[]>

    An array of draft email message metadata or an empty array if no matching draft email messages can be found.

  • Lists the metadata and content of all draft email messages for the user.

    Returns Promise<DraftEmailMessage[]>

    An array of draft email messages or an empty array if no matching draft email messages can be found.

  • Lists the metadata and content of all draft messages for the specified email address identifier.

    Parameters

    • emailAddressId: string

      The identifier of the email address associated with the draft email messages.

    Returns Promise<DraftEmailMessage[]>

    An array of draft email messages or an empty array if no matching draft email messages can be found.

  • Get a list of all provisioned email addresses for the signed in user.

    Parameters

    Returns Promise<ListEmailAddressesResult>

    List operation result.

  • Get a list of email folders associated with the email address identified by emailAddressId.

    Parameters

    Returns Promise<ListOutput<EmailFolder>>

    An array of email folders or an empty array if no matching email folders can be found.

  • Get a list of public information objects associated with the provided email addresses.

    Results can only be retrieved in batches of 50. Anything greater will throw a LimitExceededError.

    Parameters

    Returns Promise<EmailAddressPublicInfo[]>

    An array of public info objects, or an empty array if email addresses or their public keys cannot be found.

    Throws

    LimitExceededError

  • Provision an email address.

    Parameters

    • input: ProvisionEmailAddressInput

      Parameters used to provision an email address. Email addresses must meet the following criteria:

      • Total length (including both local part and domain) must not exceed 256 characters.
      • Local part must not exceed more than 64 characters.
      • Input domain parts (domain separated by .) must not exceed 63 characters.
      • Address must match standard email address pattern: ^[a-zA-Z0-9](\.?[-_a-zA-Z0-9])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$.
      • Domain must be a registered domain retrieved from SudoEmailClient.getSupportedEmailDomains.

    Returns Promise<EmailAddress>

    The provisioned email address.

    Throws

    InvalidAddressError

    Throws

    InvalidKeyRingIdError

    Throws

    AddressUnavailableError

    Throws

    NotRegisteredError

    Throws

    InvalidTokenError

    Throws

    InsufficientEntitlementsError

    Throws

    ServiceError

  • Removes any cached data maintained by this client.

    Returns Promise<void>

  • Subscribe to email message events.

    Parameters

    • subscriptionId: string

      unique identifier to differentiate subscriptions; note that specifying a duplicate subscription id will replace the previous subscription.

    • subscriber: EmailMessageSubscriber

      implementation of callback to be invoked when email message event occurs

    Returns Promise<void>

  • Unsubscribe from email message events.

    Parameters

    • subscriptionId: string

      unique identifier to differentiate subscription

    Returns void

  • Update the custom email folder identified by emailFolderId

    Parameters

    Returns Promise<EmailFolder>

    The updated email folder.

  • Update the metadata of an email address.

    Parameters

    Returns Promise<string>

    The id of the updated email address.

    Throws

    NotRegisteredError

    Throws

    ServiceError