@internxt/sdk 1.16.1 → 1.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mail/index.d.ts +12 -4
- package/dist/mail/index.js +14 -3
- package/dist/mail/types.d.ts +7 -0
- package/package.json +2 -2
package/dist/mail/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
|
|
2
|
-
import { MailboxResponse, EmailListResponse, EmailResponse, EmailCreatedResponse, SendEmailRequest, DraftEmailRequest, UpdateEmailRequest, ListEmailsQuery, EmailDomainsResponse, SetupMailAccountPayload, SearchFiltersQuery, MailAccountKeysResponse, EncryptedKeystore, KeystoreType, RecipientWithPublicKey, HybridEncryptedEmail, EmailPublicParameters, PwdProtectedEmail } from './types';
|
|
2
|
+
import { MailboxResponse, EmailListResponse, EmailResponse, EmailCreatedResponse, SendEmailRequest, DraftEmailRequest, UpdateEmailRequest, ListEmailsQuery, EmailDomainsResponse, SetupMailAccountPayload, SearchFiltersQuery, MailAccountKeysResponse, MailAccountResponse, EncryptedKeystore, KeystoreType, RecipientWithPublicKey, HybridEncryptedEmail, EmailPublicParameters, PwdProtectedEmail } from './types';
|
|
3
3
|
export declare class MailApi {
|
|
4
4
|
private readonly client;
|
|
5
5
|
private readonly appDetails;
|
|
@@ -100,6 +100,13 @@ export declare class MailApi {
|
|
|
100
100
|
* @returns The list of active domains - `ActiveDomainsResponse`
|
|
101
101
|
*/
|
|
102
102
|
getActiveDomains(): Promise<EmailDomainsResponse>;
|
|
103
|
+
/**
|
|
104
|
+
* Returns the current mail account for the authenticated user, including its
|
|
105
|
+
* state, default address, and (when suspended) the scheduled deletion time.
|
|
106
|
+
*
|
|
107
|
+
* @returns The mail account details — `MailAccountResponse`
|
|
108
|
+
*/
|
|
109
|
+
getMailAccount(): Promise<MailAccountResponse>;
|
|
103
110
|
/**
|
|
104
111
|
* Sets up a mail account for the user
|
|
105
112
|
*
|
|
@@ -110,12 +117,13 @@ export declare class MailApi {
|
|
|
110
117
|
address: string;
|
|
111
118
|
}>;
|
|
112
119
|
/**
|
|
113
|
-
* Gets the mail account keys for the given address
|
|
120
|
+
* Gets the mail account keys for the given address. When omitted, the
|
|
121
|
+
* backend returns the keys for the caller's default address.
|
|
114
122
|
*
|
|
115
|
-
* @param address - The mail address whose keys should be retrieved
|
|
123
|
+
* @param address - Optional. The mail address whose keys should be retrieved
|
|
116
124
|
* @returns The public, encrypted private and recovery keys plus the salt
|
|
117
125
|
*/
|
|
118
|
-
getMailAccountKeys(address
|
|
126
|
+
getMailAccountKeys(address?: string): Promise<MailAccountKeysResponse>;
|
|
119
127
|
/**
|
|
120
128
|
* Returns the needed headers for the module requests
|
|
121
129
|
* @private
|
package/dist/mail/index.js
CHANGED
|
@@ -137,6 +137,15 @@ class MailApi {
|
|
|
137
137
|
getActiveDomains() {
|
|
138
138
|
return this.client.get('/email/domains', this.headers());
|
|
139
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Returns the current mail account for the authenticated user, including its
|
|
142
|
+
* state, default address, and (when suspended) the scheduled deletion time.
|
|
143
|
+
*
|
|
144
|
+
* @returns The mail account details — `MailAccountResponse`
|
|
145
|
+
*/
|
|
146
|
+
getMailAccount() {
|
|
147
|
+
return this.client.get('/users/me/mail-account', this.headers());
|
|
148
|
+
}
|
|
140
149
|
/**
|
|
141
150
|
* Sets up a mail account for the user
|
|
142
151
|
*
|
|
@@ -147,13 +156,15 @@ class MailApi {
|
|
|
147
156
|
return this.client.post('/users/me/mail-account', payload, this.headers());
|
|
148
157
|
}
|
|
149
158
|
/**
|
|
150
|
-
* Gets the mail account keys for the given address
|
|
159
|
+
* Gets the mail account keys for the given address. When omitted, the
|
|
160
|
+
* backend returns the keys for the caller's default address.
|
|
151
161
|
*
|
|
152
|
-
* @param address - The mail address whose keys should be retrieved
|
|
162
|
+
* @param address - Optional. The mail address whose keys should be retrieved
|
|
153
163
|
* @returns The public, encrypted private and recovery keys plus the salt
|
|
154
164
|
*/
|
|
155
165
|
getMailAccountKeys(address) {
|
|
156
|
-
|
|
166
|
+
const params = address ? { address } : {};
|
|
167
|
+
return this.client.getWithParams('/users/me/mail-account/keys', params, this.headers());
|
|
157
168
|
}
|
|
158
169
|
/**
|
|
159
170
|
* Returns the needed headers for the module requests
|
package/dist/mail/types.d.ts
CHANGED
|
@@ -28,6 +28,13 @@ export type MailAccountKeysResponse = {
|
|
|
28
28
|
encryptionPrivateKey: string;
|
|
29
29
|
recoveryPrivateKey: string;
|
|
30
30
|
};
|
|
31
|
+
export type MailAccountResponse = {
|
|
32
|
+
id: string;
|
|
33
|
+
defaultAddress: string;
|
|
34
|
+
status: 'active' | 'suspended';
|
|
35
|
+
suspendedAt?: string;
|
|
36
|
+
deletionAt?: string;
|
|
37
|
+
};
|
|
31
38
|
export type EncryptedKeystore = {
|
|
32
39
|
userEmail: string;
|
|
33
40
|
type: KeystoreType;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@internxt/sdk",
|
|
3
3
|
"author": "Internxt <hello@internxt.com>",
|
|
4
|
-
"version": "1.16.
|
|
4
|
+
"version": "1.16.3",
|
|
5
5
|
"description": "An sdk for interacting with Internxt's services",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -50,4 +50,4 @@
|
|
|
50
50
|
"prettier --write"
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|