@arbidocs/sdk 0.5.97 → 0.5.98

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/index.cjs CHANGED
@@ -10656,12 +10656,16 @@ __export(mail_exports, {
10656
10656
  downloadAttachment: () => downloadAttachment,
10657
10657
  getMailPolicy: () => getMailPolicy,
10658
10658
  getMessage: () => getMessage2,
10659
+ getNativeThreadSecret: () => getNativeThreadSecret,
10660
+ getThread: () => getThread,
10661
+ listConversations: () => listConversations2,
10659
10662
  listFolders: () => listFolders,
10660
10663
  listMailAccounts: () => listMailAccounts,
10661
10664
  listMessages: () => listMessages,
10662
10665
  openDraftEditor: () => openDraftEditor,
10663
10666
  saveDraft: () => saveDraft,
10664
10667
  sendMessage: () => sendMessage,
10668
+ submitNativeThreadKeys: () => submitNativeThreadKeys,
10665
10669
  unlockMailCredentials: () => unlockMailCredentials,
10666
10670
  unlockNativeMail: () => unlockNativeMail,
10667
10671
  updateMessage: () => updateMessage
@@ -10705,6 +10709,27 @@ function listMessages(mail, options) {
10705
10709
  if (options.limit) params.set("limit", String(options.limit));
10706
10710
  return json(mail(`${accountPath(options.accountId ?? NATIVE_ACCOUNT)}/messages?${params}`));
10707
10711
  }
10712
+ function listConversations2(mail, options) {
10713
+ const params = new URLSearchParams({ folder_id: options.folderId });
10714
+ if (options.query) params.set("q", options.query);
10715
+ if (options.cursor) params.set("cursor", options.cursor);
10716
+ if (options.limit) params.set("limit", String(options.limit));
10717
+ return json(mail(`${accountPath(options.accountId ?? NATIVE_ACCOUNT)}/conversations?${params}`));
10718
+ }
10719
+ function getThread(mail, threadId, options = {}) {
10720
+ const params = new URLSearchParams({ thread_id: threadId, folder_id: options.folderId ?? "" });
10721
+ return json(mail(`${accountPath(options.accountId ?? NATIVE_ACCOUNT)}/thread?${params}`));
10722
+ }
10723
+ async function getNativeThreadSecret(mail) {
10724
+ const { secret } = await json(mail("/native/thread-secret"));
10725
+ return Uint8Array.from(atob(secret), (c2) => c2.charCodeAt(0));
10726
+ }
10727
+ async function submitNativeThreadKeys(mail, keys) {
10728
+ const { updated } = await json(
10729
+ mail("/native/thread-keys", { method: "POST", body: JSON.stringify({ keys }) })
10730
+ );
10731
+ return updated;
10732
+ }
10708
10733
  function getMessage2(mail, messageId2, accountId = NATIVE_ACCOUNT) {
10709
10734
  return json(mail(`${accountPath(accountId)}/messages/${encodeURIComponent(messageId2)}`));
10710
10735
  }