Comparing version 1.0.1 to 1.0.2
# CHANGELOG | ||
- v1.0.2 - 2020-01-24 | ||
- Allow using emailId and threadId as search parameters | ||
- v1.0.1 - 2020-01-14 | ||
- Initial version. Had to use v1.0.1 as v1.0.0 was already taken by template repository. |
@@ -89,3 +89,3 @@ 'use strict'; | ||
// always ask for modseq if possible | ||
if (connection.enabled.has('CONDSTORE') && !query.modseq) { | ||
if (connection.enabled.has('CONDSTORE')) { | ||
queryStructure.push({ type: 'ATOM', value: 'MODSEQ' }); | ||
@@ -92,0 +92,0 @@ } |
@@ -22,3 +22,3 @@ 'use strict'; | ||
// normal query | ||
attributes = searchCompiler(connection.mailbox, query); | ||
attributes = searchCompiler(connection, query); | ||
} else { | ||
@@ -25,0 +25,0 @@ return false; |
@@ -40,6 +40,8 @@ 'use strict'; | ||
module.exports.searchCompiler = (mailbox, query) => { | ||
let attributes = []; | ||
module.exports.searchCompiler = (connection, query) => { | ||
const attributes = []; | ||
let walk = params => { | ||
const mailbox = connection.mailbox; | ||
const walk = params => { | ||
Object.keys(params || {}).forEach(term => { | ||
@@ -98,2 +100,17 @@ switch (term.toUpperCase()) { | ||
case 'EMAILID': | ||
if (connection.capabilities.has('OBJECTID')) { | ||
setOpt(attributes, 'EMAILID', params[term]); | ||
} else if (connection.capabilities.has('X-GM-EXT-1')) { | ||
setOpt(attributes, 'X-GM-MSGID', params[term]); | ||
} | ||
break; | ||
case 'THREADID': | ||
if (connection.capabilities.has('OBJECTID')) { | ||
setOpt(attributes, 'THREADID', params[term]); | ||
} else if (connection.capabilities.has('X-GM-EXT-1')) { | ||
setOpt(attributes, 'X-GM-THRID', params[term]); | ||
} | ||
break; | ||
case 'BEFORE': | ||
@@ -100,0 +117,0 @@ case 'ON': |
{ | ||
"name": "imapflow", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "IMAP Client for Node", | ||
@@ -42,7 +42,7 @@ "main": "./lib/imap-flow.js", | ||
"encoding-japanese": "1.0.30", | ||
"iconv-lite": "0.5.0", | ||
"iconv-lite": "0.5.1", | ||
"libbase64": "1.2.1", | ||
"libmime": "4.2.1", | ||
"libqp": "1.1.0", | ||
"mailsplit": "4.6.3", | ||
"mailsplit": "4.6.4", | ||
"pino": "5.16.0", | ||
@@ -49,0 +49,0 @@ "utf7": "1.0.2" |
@@ -46,2 +46,8 @@ # ImapFlow | ||
// list subjects for all messages | ||
// uid value is always included in FETCH response, envelope strings are in unicode. | ||
for await (let message of client.fetch('1:*', { envelope: true })) { | ||
console.log(`${message.uid}: ${message.envelope.subject}`); | ||
} | ||
// log out and close connection | ||
@@ -48,0 +54,0 @@ await client.logout(); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
394458
9534
70
2
+ Addediconv-lite@0.5.1(transitive)
+ Addedmailsplit@4.6.4(transitive)
- Removedmailsplit@4.6.3(transitive)
Updatediconv-lite@0.5.1
Updatedmailsplit@4.6.4