@internxt/sdk 1.17.0 → 1.17.2

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.
@@ -233,15 +233,6 @@ export declare class Share {
233
233
  validateInviteExpiration(invitationId: string): Promise<{
234
234
  uuid: string;
235
235
  }>;
236
- /**
237
- * Share a private folder with a user.
238
- * @param {string} invitationId - The id of the invitation.
239
- * @param {ShareFolderWithUserPayload} options - The options for sharing the private folder with a user.
240
- * @param {string} options.encryptionKey - The encryption key (just in case the invitation is a request).
241
- * @param {string} options.itemType - The encryption algorithm (just in case the invitation is a request).
242
-
243
- * @returns {Promise<void>} A promise that resolves when the folder is shared with the user.
244
- */
245
236
  acceptSharedFolderInvite({ invitationId, acceptInvite, token, }: {
246
237
  invitationId: string;
247
238
  acceptInvite?: AcceptInvitationToSharedFolderPayload;
@@ -358,19 +358,10 @@ class Share {
358
358
  validateInviteExpiration(invitationId) {
359
359
  return this.client.get(`sharings/invites/${invitationId}/validate`, this.headers());
360
360
  }
361
- /**
362
- * Share a private folder with a user.
363
- * @param {string} invitationId - The id of the invitation.
364
- * @param {ShareFolderWithUserPayload} options - The options for sharing the private folder with a user.
365
- * @param {string} options.encryptionKey - The encryption key (just in case the invitation is a request).
366
- * @param {string} options.itemType - The encryption algorithm (just in case the invitation is a request).
367
-
368
- * @returns {Promise<void>} A promise that resolves when the folder is shared with the user.
369
- */
370
361
  acceptSharedFolderInvite({ invitationId, acceptInvite, token, }) {
371
362
  const headers = this.getRequestHeaders(token);
372
363
  return this.client.post(`sharings/invites/${invitationId}/accept`, {
373
- acceptInvite,
364
+ ...acceptInvite,
374
365
  }, headers);
375
366
  }
376
367
  /**
@@ -213,6 +213,7 @@ export type PublicSharedItemInfo = {
213
213
  export type AcceptInvitationToSharedFolderPayload = {
214
214
  encryptionKey: string;
215
215
  encryptionAlgorithm: string;
216
+ roleId?: string;
216
217
  };
217
218
  export type PrivateSharingRole = {
218
219
  id: string;
@@ -356,6 +357,13 @@ export type SharingInvite = {
356
357
  roleId: string;
357
358
  createdAt: Date;
358
359
  updatedAt: Date;
360
+ invited: {
361
+ avatar: string | null;
362
+ email: string;
363
+ lastname?: string;
364
+ name: string;
365
+ uuid: string;
366
+ };
359
367
  };
360
368
  export type SharingMeta = {
361
369
  id: string;
@@ -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, MailAccountResponse, EncryptedKeystore, KeystoreType, RecipientWithPublicKey, HybridEncryptedEmail, EmailPublicParameters, PwdProtectedEmail } from './types';
2
+ import { MailboxResponse, EmailListResponse, EmailResponse, EmailCreatedResponse, SendEmailRequest, DraftEmailRequest, UpdateEmailRequest, ListEmailsQuery, EmailDomainsResponse, SetupMailAccountPayload, SearchFiltersQuery, MailAccountKeysResponse, MailAccountResponse, LookupRecipientKeysResponse, EncryptedKeystore, KeystoreType, RecipientWithPublicKey, HybridEncryptedEmail, EmailPublicParameters, PwdProtectedEmail } from './types';
3
3
  export declare class MailApi {
4
4
  private readonly client;
5
5
  private readonly appDetails;
@@ -87,6 +87,15 @@ export declare class MailApi {
87
87
  * @returns The created email
88
88
  */
89
89
  sendEmail(body: SendEmailRequest): Promise<EmailCreatedResponse>;
90
+ /**
91
+ * Looks up the public encryption keys for one or more recipient addresses.
92
+ * For each address, returns the public key if it belongs to an active
93
+ * Internxt domain, or `null` for external or unknown addresses.
94
+ *
95
+ * @param addresses - 1-50 email addresses to look up
96
+ * @returns Recipients with their public keys (or null)
97
+ */
98
+ lookupRecipientKeys(addresses: string[]): Promise<LookupRecipientKeysResponse>;
90
99
  /**
91
100
  * Saves a draft email
92
101
  *
@@ -120,6 +120,17 @@ class MailApi {
120
120
  sendEmail(body) {
121
121
  return this.client.post('/email/send', body, this.headers());
122
122
  }
123
+ /**
124
+ * Looks up the public encryption keys for one or more recipient addresses.
125
+ * For each address, returns the public key if it belongs to an active
126
+ * Internxt domain, or `null` for external or unknown addresses.
127
+ *
128
+ * @param addresses - 1-50 email addresses to look up
129
+ * @returns Recipients with their public keys (or null)
130
+ */
131
+ lookupRecipientKeys(addresses) {
132
+ return this.client.post('/email/keys/lookup', { addresses }, this.headers());
133
+ }
123
134
  /**
124
135
  * Saves a draft email
125
136
  *
@@ -127,6 +127,26 @@ export interface paths {
127
127
  patch: operations['EmailController_update'];
128
128
  trace?: never;
129
129
  };
130
+ '/email/keys/lookup': {
131
+ parameters: {
132
+ query?: never;
133
+ header?: never;
134
+ path?: never;
135
+ cookie?: never;
136
+ };
137
+ get?: never;
138
+ put?: never;
139
+ /**
140
+ * Look up recipient public keys
141
+ * @description Returns the public encryption key for each address if it belongs to an active Internxt domain. Returns null for external or unknown addresses.
142
+ */
143
+ post: operations['EmailController_lookupRecipientKeys'];
144
+ delete?: never;
145
+ options?: never;
146
+ head?: never;
147
+ patch?: never;
148
+ trace?: never;
149
+ };
130
150
  '/email/send': {
131
151
  parameters: {
132
152
  query?: never;
@@ -167,32 +187,73 @@ export interface paths {
167
187
  patch?: never;
168
188
  trace?: never;
169
189
  };
170
- '/gateway/accounts': {
190
+ '/users/me/mail-account': {
171
191
  parameters: {
172
192
  query?: never;
173
193
  header?: never;
174
194
  path?: never;
175
195
  cookie?: never;
176
196
  };
177
- get?: never;
197
+ /**
198
+ * Get the caller`s mail account status
199
+ * @description Returns the account status. When suspended, includes `suspendedAt` and the scheduled `deletionAt`.
200
+ */
201
+ get: operations['UserController_getMailAccount'];
202
+ put?: never;
203
+ /** Provision the caller`s mail account */
204
+ post: operations['UserController_createMailAccount'];
205
+ delete?: never;
206
+ options?: never;
207
+ head?: never;
208
+ patch?: never;
209
+ trace?: never;
210
+ };
211
+ '/users/me/mail-account/keys': {
212
+ parameters: {
213
+ query?: never;
214
+ header?: never;
215
+ path?: never;
216
+ cookie?: never;
217
+ };
218
+ /**
219
+ * Get encryption keys and salt for one of the caller`s addresses
220
+ * @description If `address` is omitted, returns keys for the caller`s primary address.
221
+ */
222
+ get: operations['UserController_getMailAccountKeys'];
223
+ put?: never;
224
+ post?: never;
225
+ delete?: never;
226
+ options?: never;
227
+ head?: never;
228
+ patch?: never;
229
+ trace?: never;
230
+ };
231
+ '/addresses/availability': {
232
+ parameters: {
233
+ query?: never;
234
+ header?: never;
235
+ path?: never;
236
+ cookie?: never;
237
+ };
238
+ /** Check address availability (called by the auth service) */
239
+ get: operations['AddressesController_checkAvailability'];
178
240
  put?: never;
179
- /** Provision a new mail account (called by the auth service) */
180
- post: operations['GatewayController_provisionAccount'];
241
+ post?: never;
181
242
  delete?: never;
182
243
  options?: never;
183
244
  head?: never;
184
245
  patch?: never;
185
246
  trace?: never;
186
247
  };
187
- '/gateway/domains': {
248
+ '/gateway/addresses/{address}': {
188
249
  parameters: {
189
250
  query?: never;
190
251
  header?: never;
191
252
  path?: never;
192
253
  cookie?: never;
193
254
  };
194
- /** List available mail domains (called by the auth service) */
195
- get: operations['GatewayController_listDomains'];
255
+ /** Get a mail address resource (used to resolve drive user id) */
256
+ get: operations['GatewayController_getAddress'];
196
257
  put?: never;
197
258
  post?: never;
198
259
  delete?: never;
@@ -274,6 +335,18 @@ export interface components {
274
335
  /** @example alice@internxt.me */
275
336
  email: string;
276
337
  };
338
+ EncryptedWrappedKeyDto: {
339
+ /** @description Hybrid ciphertext (base64) */
340
+ hybridCiphertext: string;
341
+ /** @description Encrypted symmetric key (base64) */
342
+ encryptedKey: string;
343
+ };
344
+ EncryptedSummaryDto: {
345
+ /** @description Encrypted preview snippet (base64) */
346
+ encryptedPreview: string;
347
+ /** @description De-identified wrapped keys; the client trial-decrypts to read */
348
+ wrappedKeys: components['schemas']['EncryptedWrappedKeyDto'][];
349
+ };
277
350
  EmailSummaryResponseDto: {
278
351
  /** @example Ma1f09b… */
279
352
  id: string;
@@ -305,6 +378,8 @@ export interface components {
305
378
  * @example 4096
306
379
  */
307
380
  size: number;
381
+ /** @description Present only for encrypted emails. Carries the encrypted preview and the de-identified wrapped keys for inline client-side decryption. */
382
+ encryption?: components['schemas']['EncryptedSummaryDto'] | null;
308
383
  };
309
384
  EmailListResponseDto: {
310
385
  emails: components['schemas']['EmailSummaryResponseDto'][];
@@ -384,6 +459,8 @@ export interface components {
384
459
  * @example 4096
385
460
  */
386
461
  size: number;
462
+ /** @description Present only for encrypted emails. Carries the encrypted preview and the de-identified wrapped keys for inline client-side decryption. */
463
+ encryption?: components['schemas']['EncryptedSummaryDto'] | null;
387
464
  cc: components['schemas']['EmailAddressDto'][];
388
465
  bcc: components['schemas']['EmailAddressDto'][];
389
466
  replyTo: components['schemas']['EmailAddressDto'][];
@@ -394,6 +471,35 @@ export interface components {
394
471
  /** @example <p>Hi team, here are the notes…</p> */
395
472
  htmlBody: string | null;
396
473
  };
474
+ LookupRecipientKeysRequestDto: {
475
+ /**
476
+ * @description 1-50 email addresses to look up
477
+ * @example [
478
+ * "alice@internxt.me",
479
+ * "bob@internxt.com"
480
+ * ]
481
+ */
482
+ addresses: string[];
483
+ };
484
+ RecipientKeyDto: {
485
+ /** @example alice@internxt.me */
486
+ address: string;
487
+ /** @example base64encodedpublickey== */
488
+ publicKey: string | null;
489
+ };
490
+ LookupRecipientKeysResponseDto: {
491
+ recipients: components['schemas']['RecipientKeyDto'][];
492
+ };
493
+ EncryptionBlockDto: {
494
+ /** @example v1 */
495
+ version: string;
496
+ /** @description Encrypted preview snippet (base64), ~256 chars plaintext */
497
+ encryptedPreview: string;
498
+ /** @description Encrypted text body (base64) */
499
+ encryptedText: string;
500
+ /** @description De-identified wrapped keys, one per recipient */
501
+ wrappedKeys: components['schemas']['EncryptedWrappedKeyDto'][];
502
+ };
397
503
  SendEmailRequestDto: {
398
504
  /** @description Primary recipients (at least one required) */
399
505
  to: components['schemas']['EmailAddressDto'][];
@@ -411,6 +517,7 @@ export interface components {
411
517
  * @example <p>Hi team, here are the notes from today…</p>
412
518
  */
413
519
  htmlBody?: string;
520
+ encryption?: components['schemas']['EncryptionBlockDto'];
414
521
  };
415
522
  EmailCreatedResponseDto: {
416
523
  /**
@@ -448,27 +555,63 @@ export interface components {
448
555
  */
449
556
  isFlagged?: boolean;
450
557
  };
451
- ProvisionAccountRequestDto: {
558
+ /** @enum {string} */
559
+ MailAccountState: 'active' | 'suspended';
560
+ MailAccountStatusResponseDto: {
561
+ /** @example f3a1b2c4-1234-4abc-9def-0123456789ab */
562
+ id: string;
452
563
  /**
453
- * @description User id
454
- * @example d7ffe6b1-434d-4eae-86a5-029f76d1aa80
564
+ * @description Default address of the account, null if none is set
565
+ * @example alice@inxt.eu
455
566
  */
456
- userId: string;
567
+ defaultAddress?: string | null;
568
+ /** @example active */
569
+ status: components['schemas']['MailAccountState'];
457
570
  /**
458
- * @description Full email address
459
- * @example alice@internxt.com
571
+ * @description When the account was suspended; null when active
572
+ * @example 2026-05-01T10:29:55.000Z
460
573
  */
461
- address: string;
574
+ suspendedAt?: string | null;
462
575
  /**
463
- * @description Email domain
464
- * @example internxt.com
576
+ * @description Scheduled deletion date for suspended accounts; null when active
577
+ * @example 2026-05-31T10:29:55.000Z
465
578
  */
579
+ deletionAt?: string | null;
580
+ };
581
+ MailAddressKeyBundleDto: {
582
+ /** @description Hybrid (X25519 + ML-KEM-768) public key, base64-encoded */
583
+ publicKey: string;
584
+ /** @description Private key encrypted with the encryption keystore key (base64) */
585
+ encryptionPrivateKey: string;
586
+ /** @description Private key encrypted with the recovery keystore key (base64) */
587
+ recoveryPrivateKey: string;
588
+ };
589
+ CreateMailAccountDto: {
590
+ /** @example alice */
591
+ address: string;
592
+ /** @example inxt.eu */
466
593
  domain: string;
467
- /**
468
- * @description User display name
469
- * @example Alice Smith
470
- */
594
+ /** @example Alice Smith */
471
595
  displayName: string;
596
+ keys: components['schemas']['MailAddressKeyBundleDto'];
597
+ };
598
+ CreateMailAccountResponseDto: {
599
+ /** @example f3a1b2c4-1234-4abc-9def-0123456789ab */
600
+ id: string;
601
+ /** @example alice@inxt.eu */
602
+ address: string;
603
+ /** @example inxt.eu */
604
+ domain: string;
605
+ };
606
+ MailAccountKeysResponseDto: {
607
+ /** @example alice@inxt.eu */
608
+ address: string;
609
+ /** @description Hybrid (X25519 + ML-KEM-768) public key, base64-encoded */
610
+ publicKey: string;
611
+ /** @description Private key encrypted with the encryption keystore key (base64) */
612
+ encryptionPrivateKey: string;
613
+ /** @description Private key encrypted with the recovery keystore key (base64) */
614
+ recoveryPrivateKey: string;
472
615
  };
473
616
  };
474
617
  responses: never;
@@ -676,6 +819,36 @@ export interface operations {
676
819
  };
677
820
  };
678
821
  };
822
+ EmailController_lookupRecipientKeys: {
823
+ parameters: {
824
+ query?: never;
825
+ header?: never;
826
+ path?: never;
827
+ cookie?: never;
828
+ };
829
+ requestBody: {
830
+ content: {
831
+ 'application/json': components['schemas']['LookupRecipientKeysRequestDto'];
832
+ };
833
+ };
834
+ responses: {
835
+ 200: {
836
+ headers: {
837
+ [name: string]: unknown;
838
+ };
839
+ content: {
840
+ 'application/json': components['schemas']['LookupRecipientKeysResponseDto'];
841
+ };
842
+ };
843
+ /** @description Invalid request: 1-50 valid emails required */
844
+ 400: {
845
+ headers: {
846
+ [name: string]: unknown;
847
+ };
848
+ content?: never;
849
+ };
850
+ };
851
+ };
679
852
  EmailController_send: {
680
853
  parameters: {
681
854
  query?: never;
@@ -724,7 +897,33 @@ export interface operations {
724
897
  };
725
898
  };
726
899
  };
727
- GatewayController_provisionAccount: {
900
+ UserController_getMailAccount: {
901
+ parameters: {
902
+ query?: never;
903
+ header?: never;
904
+ path?: never;
905
+ cookie?: never;
906
+ };
907
+ requestBody?: never;
908
+ responses: {
909
+ 200: {
910
+ headers: {
911
+ [name: string]: unknown;
912
+ };
913
+ content: {
914
+ 'application/json': components['schemas']['MailAccountStatusResponseDto'];
915
+ };
916
+ };
917
+ /** @description No mail account exists for the caller */
918
+ 404: {
919
+ headers: {
920
+ [name: string]: unknown;
921
+ };
922
+ content?: never;
923
+ };
924
+ };
925
+ };
926
+ UserController_createMailAccount: {
728
927
  parameters: {
729
928
  query?: never;
730
929
  header?: never;
@@ -733,11 +932,34 @@ export interface operations {
733
932
  };
734
933
  requestBody: {
735
934
  content: {
736
- 'application/json': components['schemas']['ProvisionAccountRequestDto'];
935
+ 'application/json': components['schemas']['CreateMailAccountDto'];
737
936
  };
738
937
  };
739
938
  responses: {
740
939
  201: {
940
+ headers: {
941
+ [name: string]: unknown;
942
+ };
943
+ content: {
944
+ 'application/json': components['schemas']['CreateMailAccountResponseDto'];
945
+ };
946
+ };
947
+ /** @description Caller`s tier does not include mail access */
948
+ 403: {
949
+ headers: {
950
+ [name: string]: unknown;
951
+ };
952
+ content?: never;
953
+ };
954
+ /** @description Requested domain does not exist */
955
+ 404: {
956
+ headers: {
957
+ [name: string]: unknown;
958
+ };
959
+ content?: never;
960
+ };
961
+ /** @description Caller already has an account, or the address is taken */
962
+ 409: {
741
963
  headers: {
742
964
  [name: string]: unknown;
743
965
  };
@@ -745,9 +967,43 @@ export interface operations {
745
967
  };
746
968
  };
747
969
  };
748
- GatewayController_listDomains: {
970
+ UserController_getMailAccountKeys: {
749
971
  parameters: {
750
- query?: never;
972
+ query?: {
973
+ /** @description Address whose keys to fetch. Defaults to the caller`s primary address. */
974
+ address?: string;
975
+ };
976
+ header?: never;
977
+ path?: never;
978
+ cookie?: never;
979
+ };
980
+ requestBody?: never;
981
+ responses: {
982
+ 200: {
983
+ headers: {
984
+ [name: string]: unknown;
985
+ };
986
+ content: {
987
+ 'application/json': components['schemas']['MailAccountKeysResponseDto'];
988
+ };
989
+ };
990
+ /** @description Address not found on this account, or keys not set */
991
+ 404: {
992
+ headers: {
993
+ [name: string]: unknown;
994
+ };
995
+ content?: never;
996
+ };
997
+ };
998
+ };
999
+ AddressesController_checkAvailability: {
1000
+ parameters: {
1001
+ query: {
1002
+ /** @description Local part of the email address (before the @) */
1003
+ username: string;
1004
+ /** @description Email domain */
1005
+ domain: string;
1006
+ };
751
1007
  header?: never;
752
1008
  path?: never;
753
1009
  cookie?: never;
@@ -762,6 +1018,25 @@ export interface operations {
762
1018
  };
763
1019
  };
764
1020
  };
1021
+ GatewayController_getAddress: {
1022
+ parameters: {
1023
+ query?: never;
1024
+ header?: never;
1025
+ path: {
1026
+ address: string;
1027
+ };
1028
+ cookie?: never;
1029
+ };
1030
+ requestBody?: never;
1031
+ responses: {
1032
+ 200: {
1033
+ headers: {
1034
+ [name: string]: unknown;
1035
+ };
1036
+ content?: never;
1037
+ };
1038
+ };
1039
+ };
765
1040
  GatewayController_suspendAccount: {
766
1041
  parameters: {
767
1042
  query?: never;
@@ -5,6 +5,11 @@ export type EmailListResponse = components['schemas']['EmailListResponseDto'];
5
5
  export type EmailResponse = components['schemas']['EmailResponseDto'];
6
6
  export type EmailCreatedResponse = components['schemas']['EmailCreatedResponseDto'];
7
7
  export type SendEmailRequest = components['schemas']['SendEmailRequestDto'];
8
+ export type EncryptionBlock = components['schemas']['EncryptionBlockDto'];
9
+ export type EncryptedWrappedKey = components['schemas']['EncryptedWrappedKeyDto'];
10
+ export type LookupRecipientKeysRequest = components['schemas']['LookupRecipientKeysRequestDto'];
11
+ export type LookupRecipientKeysResponse = components['schemas']['LookupRecipientKeysResponseDto'];
12
+ export type RecipientKey = components['schemas']['RecipientKeyDto'];
8
13
  export type DraftEmailRequest = components['schemas']['DraftEmailRequestDto'];
9
14
  export type UpdateEmailRequest = components['schemas']['UpdateEmailRequestDto'];
10
15
  export type EmailAddress = components['schemas']['EmailAddressDto'];
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.17.0",
4
+ "version": "1.17.2",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "lint": "eslint ./src",
27
27
  "format": "prettier --write **/*.{js,jsx,tsx,ts}",
28
28
  "swagger": "openapi-typescript && yarn format",
29
- "swagger:mail": "openapi-typescript http://localhost:3100/api-json -o ./src/mail/schema.ts && yarn format"
29
+ "swagger:mail": "openapi-typescript --redocly redocly.mail.yaml && yarn format"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@internxt/eslint-config-internxt": "^2.1.0",