@agenticmail/core 0.9.3 → 0.9.4
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 +7 -1
- package/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -964,7 +964,13 @@ var MailReceiver = class {
|
|
|
964
964
|
async fetchMessage(uid, mailbox = "INBOX") {
|
|
965
965
|
const lock = await this.client.getMailboxLock(mailbox);
|
|
966
966
|
try {
|
|
967
|
-
const
|
|
967
|
+
const result = await this.client.download(String(uid), void 0, { uid: true });
|
|
968
|
+
const content = result?.content;
|
|
969
|
+
if (!content) {
|
|
970
|
+
const err = new Error(`Message UID ${uid} not found in mailbox "${mailbox}"`);
|
|
971
|
+
err.code = "MESSAGE_NOT_FOUND";
|
|
972
|
+
throw err;
|
|
973
|
+
}
|
|
968
974
|
const chunks = [];
|
|
969
975
|
for await (const chunk of content) {
|
|
970
976
|
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
package/dist/index.js
CHANGED
|
@@ -205,7 +205,13 @@ var MailReceiver = class {
|
|
|
205
205
|
async fetchMessage(uid, mailbox = "INBOX") {
|
|
206
206
|
const lock = await this.client.getMailboxLock(mailbox);
|
|
207
207
|
try {
|
|
208
|
-
const
|
|
208
|
+
const result = await this.client.download(String(uid), void 0, { uid: true });
|
|
209
|
+
const content = result?.content;
|
|
210
|
+
if (!content) {
|
|
211
|
+
const err = new Error(`Message UID ${uid} not found in mailbox "${mailbox}"`);
|
|
212
|
+
err.code = "MESSAGE_NOT_FOUND";
|
|
213
|
+
throw err;
|
|
214
|
+
}
|
|
209
215
|
const chunks = [];
|
|
210
216
|
for await (const chunk of content) {
|
|
211
217
|
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|