diff --git a/components/imap/package.json b/components/imap/package.json index 5d547ddb71e17..32393fa12fa8b 100644 --- a/components/imap/package.json +++ b/components/imap/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/imap", - "version": "0.0.5", + "version": "0.0.6", "description": "Pipedream IMAP Components", "main": "imap.app.mjs", "keywords": [ @@ -13,7 +13,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.2.0", + "@pipedream/platform": "^3.1.0", "imap": "^0.8.19", "mailparser": "^3.5.0", "stream": "^0.0.2", diff --git a/components/imap/sources/new-email/new-email.mjs b/components/imap/sources/new-email/new-email.mjs index 01db0aee81074..7e18db1c9d34a 100644 --- a/components/imap/sources/new-email/new-email.mjs +++ b/components/imap/sources/new-email/new-email.mjs @@ -9,7 +9,7 @@ export default { key: "imap-new-email", name: "New Email", description: "Emit new event for each new email in a mailbox", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", props: { @@ -50,7 +50,7 @@ export default { }, hasNewMessages(box) { const lastUid = this._getLastUid(box.name); - return !lastUid || box.uidnext > lastUid + 1; + return box.messages.total && (!lastUid || box.uidnext > lastUid + 1); }, generateMeta(message) { const date = message.attributes?.date ?? new Date(); @@ -76,13 +76,15 @@ export default { const connection = await this.imap.getConnection(); try { const box = await this.imap.openMailbox(connection, mailbox); - const startSeqno = box.messages.total > 25 - ? box.messages.total - 24 - : 1; - const messageStream = this.imap.fetchMessages(connection, { - startSeqno, - }); - await this.processMessageStream(messageStream); + if (box.messages.total) { + const startSeqno = box.messages.total > 25 + ? box.messages.total - 24 + : 1; + const messageStream = this.imap.fetchMessages(connection, { + startSeqno, + }); + await this.processMessageStream(messageStream); + } } finally { await this.imap.closeConnection(connection); } diff --git a/components/kudosity/kudosity.app.mjs b/components/kudosity/kudosity.app.mjs index f1b3b32fda74a..177b74d46541a 100644 --- a/components/kudosity/kudosity.app.mjs +++ b/components/kudosity/kudosity.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/components/stackby/stackby.app.mjs b/components/stackby/stackby.app.mjs index e2a8ce9b52e29..854b3d640cc73 100644 --- a/components/stackby/stackby.app.mjs +++ b/components/stackby/stackby.app.mjs @@ -8,4 +8,4 @@ export default { console.log(Object.keys(this.$auth)); }, }, -}; \ No newline at end of file +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 72160319fc5bf..0260efbaa83ba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6989,8 +6989,8 @@ importers: components/imap: dependencies: '@pipedream/platform': - specifier: ^1.2.0 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 imap: specifier: ^0.8.19 version: 0.8.19 @@ -31372,22 +31372,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net supports-color@10.0.0: resolution: {integrity: sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ==}