Skip to content

[_]: feature/mail EPs#380

Draft
xabg2 wants to merge 3 commits intomasterfrom
feature/mail
Draft

[_]: feature/mail EPs#380
xabg2 wants to merge 3 commits intomasterfrom
feature/mail

Conversation

@xabg2
Copy link
Contributor

@xabg2 xabg2 commented Mar 25, 2026

Adding Mail's basic EPs, which are already available in our Mail API.

@xabg2 xabg2 requested a review from TamaraFinogina March 25, 2026 16:30
@xabg2 xabg2 self-assigned this Mar 25, 2026
@xabg2 xabg2 added the enhancement New feature or request label Mar 25, 2026
@xabg2 xabg2 marked this pull request as draft March 25, 2026 16:30
src/mail/api.ts Outdated
return this.client.post(`${this.apiUrl}/emails`, { email, params }, this.headers());
}

async getE2EEmails(): Promise<Email[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Email? Shouldn't it be HybridEncryptedEmail? and different methods like for send

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function goes out. The types are the types the Mail API are returning. We can add the encryptedKey, but the types from crypto are not valid.

return this.client.delete(`${this.apiUrl}/email/${id}`, this.headers());
}

async updateEmail(id: string, body: UpdateEmailRequest): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This EP will be used to mark an email as read/flagged.

}

async saveDraft(body: DraftEmailRequest): Promise<EmailCreatedResponse> {
return this.api.saveDraft(body);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we encrypt it first? With a user mnemonic, for example, just for storing on the server?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we should encrypt the messages here.

yarn.lock Outdated
@@ -13,12 +13,12 @@

"@babel/compat-data@^7.28.6":
version "7.29.0"
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.29.0.tgz#00d03e8c0ac24dd9be942c5370990cbe1f17d88d"
resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npmjs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants