/** * Copyright © 2026 Anonyome Labs, Inc. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 */ import { ListOutput } from '@sudoplatform/sudo-common'; import { SudoPlatformSignInCallback } from '@sudoplatform/sudo-user'; import { BlockEmailAddressesInput, UnblockEmailAddressesByHashedValueInput } from './inputs/blockedAddresses'; import { FlushMessageBodyCacheInput } from './inputs/flushMessageBodyCache'; import { CancelScheduledDraftMessageInput, CreateDraftEmailMessageInput, DeleteDraftEmailMessagesInput, GetDraftEmailMessageInput, ListDraftEmailMessageMetadataForEmailAddressIdInput, ListDraftEmailMessagesForEmailAddressIdInput, ListScheduledDraftMessagesForEmailAddressIdInput, ScheduleSendDraftMessageInput, UpdateDraftEmailMessageInput } from './inputs/draftEmailMessage'; import { CheckEmailAddressAvailabilityInput, GetEmailAddressInput, ListEmailAddressesForSudoIdInput, ListEmailAddressesInput, LookupEmailAddressesPublicInfoInput, ProvisionEmailAddressInput, UpdateEmailAddressMetadataInput } from './inputs/emailAddress'; import { CreateCustomEmailFolderInput, DeleteCustomEmailFolderInput, DeleteMessagesForFolderIdInput, ListEmailFoldersForEmailAddressIdInput, UpdateCustomEmailFolderInput } from './inputs/emailFolder'; import { DeprovisionEmailAliasInput, DisableEmailAliasInput, EnableEmailAliasInput, GetEmailAliasByIdInput, ListEmailAliasesForOwnerInput, ListEmailAliasesInput, ProvisionEmailAliasInput, UpdateEmailAliasInput } from './inputs/emailAlias'; import { GetEmailMessageInput, GetEmailMessageWithBodyInput, ListEmailMessagesForEmailAddressIdInput, ListEmailMessagesForEmailFolderIdInput, ListEmailMessagesInput, SendEmailMessageInput, SendEmailMessageViaAliasInput, UpdateEmailMessagesInput } from './inputs/emailMessage'; import { SudoEmailClient, SudoEmailClientOptions } from './sudoEmailClient'; import { CreateSingletonKeysIfAbsentResult } from './typings/createSingletonKeysIfAbsentResult'; import { ScheduledDraftMessage, UpdatedEmailMessageSuccess } from './typings'; import { BatchOperationResult, EmailMessageOperationFailureResult } from './typings/batchOperationResult'; import { UnsealedBlockedAddress } from './typings/blockedAddresses'; import { ConfigurationData } from './typings/configurationData'; import { DeleteEmailMessageSuccessResult } from './typings/deleteEmailMessageSuccessResult'; import { DraftEmailMessage } from './typings/draftEmailMessage'; import { DraftEmailMessageMetadata } from './typings/draftEmailMessageMetadata'; import { EmailAddress } from './typings/emailAddress'; import { EmailAddressPublicInfo } from './typings/emailAddressPublicInfo'; import { EmailFolder } from './typings/emailFolder'; import { EmailDomain } from './typings/emailDomain'; import { EmailAlias, EmailAliasListItem } from './typings/emailAlias'; import { EmailMessage, EmailMessageSubscriber, SendEmailMessageResult } from './typings/emailMessage'; import { EmailMessageWithBody } from './typings/emailMessageWithBody'; import { ListEmailAddressesResult, ListEmailMessagesResult } from './typings/listOperationResult'; import { VerifyExternalEmailAddressInput, VerifyExternalEmailAddressResult } from './typings/verifyExternalEmailAddress'; /** * Key namespace of the `WebSudoCryptoProvider` the client creates when no * `sudoCryptoProvider` or `sudoKeyManager` is supplied. Every platform's email * SDK uses this namespace, which key archives need in order to import across * platforms. * * Keys stored by earlier versions of this SDK are under the namespace * `'SudoEmailClient'`, so they aren't found under this one. To keep using * them, supply a `WebSudoCryptoProvider` created with that namespace as the * `sudoCryptoProvider`, or migrate the keys with `exportKeys` on the old * client and `importKeys` on the new one. */ export declare const DEFAULT_KEY_NAMESPACE = "sudo-email"; export declare class DefaultSudoEmailClient implements SudoEmailClient { private readonly apiClient; private readonly userClient; private readonly configurationDataService; private readonly emailAccountService; private readonly emailDomainService; private readonly emailFolderService; private readonly emailMessageService; private readonly emailAddressBlocklistService; private readonly emailAliasService; private readonly emailCryptoService; private readonly sudoCryptoProvider; private readonly keyManager; private readonly identityServiceConfig; private readonly emailServiceConfig; private readonly signInGuard; private readonly emailMessageBodyCache; private readonly log; private readonly mutex; private readonly deviceKeyWorker; private readonly enforceSingletonPublicKey; constructor(opts: SudoEmailClientOptions); setSignInCallback(callback?: SudoPlatformSignInCallback): void; getConfigurationData(): Promise; provisionEmailAddress({ emailAddress, ownershipProofToken, displayName, allowSymmetricKeyGeneration, keyId, }: ProvisionEmailAddressInput): Promise; deprovisionEmailAddress(id: string): Promise; updateEmailAddressMetadata({ id, values, }: UpdateEmailAddressMetadataInput): Promise; sendEmailMessage({ senderEmailAddressId, emailMessageHeader, body, attachments, inlineAttachments, replyingMessageId, forwardingMessageId, }: SendEmailMessageInput): Promise; sendEmailMessageViaAlias({ senderEmailAliasId, emailMessageHeader, body, attachments, inlineAttachments, replyingMessageId, forwardingMessageId, }: SendEmailMessageViaAliasInput): Promise; updateEmailMessages({ ids, values, }: UpdateEmailMessagesInput): Promise>; deleteEmailMessage(id: string): Promise; deleteMessagesForFolderId(input: DeleteMessagesForFolderIdInput): Promise; deleteEmailMessages(ids: string[]): Promise>; getConfiguredEmailDomains(): Promise; listEmailDomains(): Promise; checkEmailAddressAvailability({ localParts, domains, }: CheckEmailAddressAvailabilityInput): Promise; getEmailAddress({ id, }: GetEmailAddressInput): Promise; listEmailAddresses(input?: ListEmailAddressesInput): Promise; listEmailAddressesForSudoId({ sudoId, limit, nextToken, }: ListEmailAddressesForSudoIdInput): Promise; lookupEmailAddressesPublicInfo({ emailAddresses, }: LookupEmailAddressesPublicInfoInput): Promise; listEmailFoldersForEmailAddressId({ emailAddressId, limit, nextToken, }: ListEmailFoldersForEmailAddressIdInput): Promise>; createCustomEmailFolder({ emailAddressId, customFolderName, allowSymmetricKeyGeneration, }: CreateCustomEmailFolderInput): Promise; deleteCustomEmailFolder({ emailFolderId, emailAddressId, }: DeleteCustomEmailFolderInput): Promise; updateCustomEmailFolder({ emailAddressId, emailFolderId, values, allowSymmetricKeyGeneration, }: UpdateCustomEmailFolderInput): Promise; blockEmailAddresses(input: BlockEmailAddressesInput): Promise>; unblockEmailAddressesByHashedValue(input: UnblockEmailAddressesByHashedValueInput): Promise>; getEmailAddressBlocklist(): Promise; createDraftEmailMessage({ rfc822Data, senderEmailAddressId, emailAliasId, }: CreateDraftEmailMessageInput): Promise; updateDraftEmailMessage({ id, rfc822Data, senderEmailAddressId, emailAliasId, }: UpdateDraftEmailMessageInput): Promise; deleteDraftEmailMessages({ ids, emailAddressId, emailAliasId, }: DeleteDraftEmailMessagesInput): Promise>; getDraftEmailMessage({ id, emailAddressId, emailAliasId, }: GetDraftEmailMessageInput): Promise; listDraftEmailMessagesForEmailAddressId({ emailAddressId, limit, nextToken, }: ListDraftEmailMessagesForEmailAddressIdInput): Promise>; listDraftEmailMessageMetadataForEmailAddressId({ emailAddressId, limit, nextToken, }: ListDraftEmailMessageMetadataForEmailAddressIdInput): Promise>; scheduleSendDraftMessage({ id, emailAddressId, emailAliasId, sendAt, }: ScheduleSendDraftMessageInput): Promise; cancelScheduledDraftMessage({ id, emailAddressId, emailAliasId, }: CancelScheduledDraftMessageInput): Promise; listScheduledDraftMessagesForEmailAddressId({ emailAddressId, filter, limit, nextToken, }: ListScheduledDraftMessagesForEmailAddressIdInput): Promise>; getEmailMessage({ id, }: GetEmailMessageInput): Promise; getEmailMessageWithBody({ id, emailAddressId, }: GetEmailMessageWithBodyInput): Promise; listEmailMessages({ dateRange, limit, sortOrder, nextToken, includeDeletedMessages, }: ListEmailMessagesInput): Promise; listEmailMessagesForEmailAddressId({ emailAddressId, dateRange, limit, sortOrder, nextToken, includeDeletedMessages, }: ListEmailMessagesForEmailAddressIdInput): Promise; listEmailMessagesForEmailFolderId({ filter, folderId, dateRange, limit, sortOrder, nextToken, includeDeletedMessages, }: ListEmailMessagesForEmailFolderIdInput): Promise; provisionEmailAlias({ aliasAddress, realAddress, ownershipProofToken, expiresAt, metadata, keyId, }: ProvisionEmailAliasInput): Promise; deprovisionEmailAlias(input: DeprovisionEmailAliasInput): Promise; updateEmailAlias(input: UpdateEmailAliasInput): Promise; enableEmailAlias(input: EnableEmailAliasInput): Promise; disableEmailAlias(input: DisableEmailAliasInput): Promise; listEmailAliasesForOwner(input?: ListEmailAliasesForOwnerInput): Promise>; listEmailAliases(input?: ListEmailAliasesInput): Promise>; getEmailAliasById(input: GetEmailAliasByIdInput): Promise; verifyExternalEmailAddress(input: VerifyExternalEmailAddressInput): Promise; subscribeToEmailMessages(subscriptionId: string, subscriber: EmailMessageSubscriber): Promise; unsubscribeFromEmailMessages(subscriptionId: string): void; exportKeys(): Promise; importKeys(archiveData: ArrayBuffer): Promise; createSingletonKeysIfAbsent(): Promise; /** * The keys of an unarchived key archive. `DefaultSudoKeyArchive` doesn't * expose them, so read its (decoded and validated) key map. */ private archiveKeys; /** * Throws `KeyArchiveNotImportableError` if the key archive would skip any of * `keys`. * * `DefaultSudoKeyArchive.saveKeys` skips, without an error, any key that * isn't in this client's key namespace, and fails part way through on a key * of a type it doesn't know. Either would happen after the existing keys * were removed, so such an archive is refused before that. */ private checkEveryKeyIsImportable; reset(): Promise; flushMessageBodyCache(input: FlushMessageBodyCacheInput): Promise; setCacheSizeLimit(bytes: number): Promise; /** * Checks if user is signed in and invokes callback if needed. * Only performs check if callback is configured. * * Throws: Any error thrown by the sign-in callback */ private ensureSignedIn; }