Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@internxt/sdk",
"author": "Internxt <hello@internxt.com>",
"version": "1.17.1",
"version": "1.17.2",
"description": "An sdk for interacting with Internxt's services",
"repository": {
"type": "git",
Expand All @@ -26,7 +26,7 @@
"lint": "eslint ./src",
"format": "prettier --write **/*.{js,jsx,tsx,ts}",
"swagger": "openapi-typescript && yarn format",
"swagger:mail": "openapi-typescript http://localhost:3100/api-json -o ./src/mail/schema.ts && yarn format"
"swagger:mail": "openapi-typescript --redocly redocly.mail.yaml && yarn format"
},
"devDependencies": {
"@internxt/eslint-config-internxt": "^2.1.0",
Expand Down
5 changes: 5 additions & 0 deletions redocly.mail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apis:
mail:
root: http://localhost:3100/docs-json
x-openapi-ts:
output: ./src/mail/schema.ts
13 changes: 13 additions & 0 deletions src/mail/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
SearchFiltersQuery,
MailAccountKeysResponse,
MailAccountResponse,
LookupRecipientKeysResponse,
EncryptedKeystore,
KeystoreType,
RecipientWithPublicKey,
Expand Down Expand Up @@ -155,6 +156,18 @@ export class MailApi {
return this.client.post('/email/send', body, this.headers());
}

/**
* Looks up the public encryption keys for one or more recipient addresses.
* For each address, returns the public key if it belongs to an active
* Internxt domain, or `null` for external or unknown addresses.
*
* @param addresses - 1-50 email addresses to look up
* @returns Recipients with their public keys (or null)
*/
lookupRecipientKeys(addresses: string[]): Promise<LookupRecipientKeysResponse> {
return this.client.post('/email/keys/lookup', { addresses }, this.headers());
}

/**
* Saves a draft email
*
Expand Down
Loading
Loading