Comparing version 1.0.125 to 1.0.126
@@ -42,5 +42,14 @@ 'use strict'; | ||
let isUnicodeString = str => { | ||
if (!str || typeof str !== 'string') { | ||
return false; | ||
} | ||
return Buffer.byteLength(str) !== str.length; | ||
}; | ||
module.exports.searchCompiler = (connection, query) => { | ||
const attributes = []; | ||
let hasUnicode = false; | ||
const mailbox = connection.mailbox; | ||
@@ -86,2 +95,10 @@ | ||
case 'LARGER': | ||
case 'SMALLER': | ||
case 'MODSEQ': | ||
if (params[term]) { | ||
setOpt(attributes, term, params[term]); | ||
} | ||
break; | ||
case 'BCC': | ||
@@ -91,8 +108,8 @@ case 'BODY': | ||
case 'FROM': | ||
case 'LARGER': | ||
case 'SMALLER': | ||
case 'SUBJECT': | ||
case 'TEXT': | ||
case 'TO': | ||
case 'MODSEQ': | ||
if (isUnicodeString(params[term])) { | ||
hasUnicode = true; | ||
} | ||
if (params[term]) { | ||
@@ -116,2 +133,3 @@ setOpt(attributes, term, params[term]); | ||
break; | ||
case 'THREADID': | ||
@@ -124,5 +142,9 @@ if (connection.capabilities.has('OBJECTID')) { | ||
break; | ||
case 'GMRAW': | ||
case 'GMAILRAW': // alias for GMRAW | ||
if (connection.capabilities.has('X-GM-EXT-1')) { | ||
if (isUnicodeString(params[term])) { | ||
hasUnicode = true; | ||
} | ||
setOpt(attributes, 'X-GM-RAW', params[term]); | ||
@@ -167,2 +189,6 @@ } else { | ||
if (isUnicodeString(value)) { | ||
hasUnicode = true; | ||
} | ||
setOpt(attributes, term, [header.toUpperCase().trim(), value]); | ||
@@ -242,3 +268,8 @@ }); | ||
if (hasUnicode) { | ||
attributes.unshift({ type: 'ATOM', value: 'UTF-8' }); | ||
attributes.unshift({ type: 'ATOM', value: 'CHARSET' }); | ||
} | ||
return attributes; | ||
}; |
@@ -464,3 +464,3 @@ /// <reference types="node" /> | ||
* let mailbox = await client.mailboxOpen('INBOX'); | ||
* // fetch UID for all messages in a mailbox | ||
* // fetch UID for the last email in the selected mailbox | ||
* let lastMsg = await client.fetchOne('*', {uid: true}) | ||
@@ -503,3 +503,3 @@ * console.log(lastMsg.uid); | ||
* let mailbox = await client.mailboxOpen('INBOX'); | ||
* // download body part nr '1.2' from latest message | ||
* // download body parts '2', and '3' from all messages in the selected mailbox | ||
* let response = await client.downloadMany('*', ['2', '3]); | ||
@@ -506,0 +506,0 @@ * process.stdout.write(response[2].content) |
{ | ||
"name": "imapflow", | ||
"version": "1.0.125", | ||
"version": "1.0.126", | ||
"description": "IMAP Client for Node", | ||
@@ -33,6 +33,6 @@ "main": "./lib/imap-flow.js", | ||
"@babel/plugin-syntax-class-properties": "7.12.13", | ||
"@babel/preset-env": "7.20.2", | ||
"@types/node": "18.15.10", | ||
"@babel/preset-env": "7.21.4", | ||
"@types/node": "18.15.11", | ||
"braintree-jsdoc-template": "3.3.0", | ||
"eslint": "8.36.0", | ||
"eslint": "8.37.0", | ||
"eslint-config-nodemailer": "1.2.0", | ||
@@ -39,0 +39,0 @@ "eslint-config-prettier": "8.8.0", |
@@ -13,3 +13,3 @@ # ImapFlow | ||
IMAP extensions are handled in the background, so, for example, you can always request `labels` value from a {@link FetchQueryObject|fetch()} call, but if the IMAP server does not support `X-GM-EXT1` extension, then `labels` value is not included in the response. | ||
IMAP extensions are handled in the background, so, for example, you can always request `labels` value from a {@link FetchQueryObject|fetch()} call, but if the IMAP server does not support `X-GM-EXT-1` extension, then `labels` value is not included in the response. | ||
@@ -16,0 +16,0 @@ ## Source |
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
551411
12266