Conversation
src/mail/api.ts
Outdated
| return this.client.post(`${this.apiUrl}/emails`, { email, params }, this.headers()); | ||
| } | ||
|
|
||
| async getE2EEmails(): Promise<Email[]> { |
There was a problem hiding this comment.
Email? Shouldn't it be HybridEncryptedEmail? and different methods like for send
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
This EP will be used to mark an email as read/flagged.
src/mail/index.ts
Outdated
| } | ||
|
|
||
| async saveDraft(body: DraftEmailRequest): Promise<EmailCreatedResponse> { | ||
| return this.api.saveDraft(body); |
There was a problem hiding this comment.
Should we encrypt it first? With a user mnemonic, for example, just for storing on the server?
There was a problem hiding this comment.
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" | |||
| * @param params - The public parameters of the email | ||
| * @returns Server response | ||
| */ | ||
| async sendE2EEmails(emails: HybridEncryptedEmail[], params: EmailPublicParameters): Promise<void> { |
There was a problem hiding this comment.
@xabg2 It should be just sendEmail, no? Then we can add other functions that will send encrypted or password-protected emails
There was a problem hiding this comment.
I updated the name to differentiate it from the other EPs that do not have the crypto layer )and they are not used rn in mail web). But we can change it in this PR if you want.
There was a problem hiding this comment.
It's ok, I've just thought that the next PR will add all crypto in the email, including new send methods. But at the end it will be the same
Adding Mail's basic EPs, which are already available in our Mail API.