Comparing version 1.0.39 to 1.0.40
@@ -5,3 +5,5 @@ module.exports = { | ||
singleQuote: true, | ||
endOfLine: 'lf' | ||
endOfLine: 'lf', | ||
trailingComma: 'none', | ||
arrowParens: 'avoid' | ||
}; |
# CHANGELOG | ||
- 1.0.40 - 2020-04-06 | ||
- Added option `useLabels` for message flag update methods to modify Gmail labels instead of message flags | ||
- 1.0.36 - 2020-03-26 | ||
@@ -4,0 +8,0 @@ |
@@ -7,5 +7,5 @@ 'use strict'; | ||
module.exports = async (connection, range, flags, options) => { | ||
if (connection.state !== connection.states.SELECTED || !range) { | ||
if (connection.state !== connection.states.SELECTED || !range || (options.useLabels && !connection.capabilities.has('X-GM-EXT-1'))) { | ||
// nothing to do here | ||
return; | ||
return false; | ||
} | ||
@@ -16,12 +16,20 @@ | ||
operation = 'FLAGS'; | ||
if (options.useLabels) { | ||
operation = 'X-GM-LABELS'; | ||
} else if (options.silent) { | ||
operation = `${operation}.SILENT`; | ||
} | ||
switch ((options.operation || '').toLowerCase()) { | ||
case 'set': | ||
operation = 'FLAGS'; | ||
// do nothing, keep operation value as is | ||
break; | ||
case 'remove': | ||
operation = '-FLAGS'; | ||
operation = `-${operation}`; | ||
break; | ||
case 'add': | ||
default: | ||
operation = '+FLAGS'; | ||
operation = `+${operation}`; | ||
break; | ||
@@ -48,6 +56,2 @@ } | ||
if (options.silent) { | ||
operation += '.SILENT'; | ||
} | ||
let attributes = [{ type: 'SEQUENCE', value: range }, { type: 'ATOM', value: operation }, flags.map(flag => ({ type: 'ATOM', value: flag }))]; | ||
@@ -54,0 +58,0 @@ |
@@ -313,2 +313,3 @@ /// <reference types="node" /> | ||
* @param {BigInt} [options.unchangedSince] If set then only messages with a lower or equal `modseq` value are updated. Ignored if server does not support `CONDSTORE` extension. | ||
* @param {Boolean} [options.useLabels=false] If true then update Gmail labels instead of message flags | ||
* @returns {Promise<Boolean>} Did the operation succeed or not | ||
@@ -324,2 +325,3 @@ * | ||
unchangedSince?: bigint; | ||
useLabels?: boolean; | ||
}): Promise<Boolean>; | ||
@@ -334,2 +336,3 @@ /** | ||
* @param {BigInt} [options.unchangedSince] If set then only messages with a lower or equal `modseq` value are updated. Ignored if server does not support `CONDSTORE` extension. | ||
* @param {Boolean} [options.useLabels=false] If true then update Gmail labels instead of message flags | ||
* @returns {Promise<Boolean>} Did the operation succeed or not | ||
@@ -345,2 +348,3 @@ * | ||
unchangedSince?: bigint; | ||
useLabels?: boolean; | ||
}): Promise<Boolean>; | ||
@@ -355,2 +359,3 @@ /** | ||
* @param {BigInt} [options.unchangedSince] If set then only messages with a lower or equal `modseq` value are updated. Ignored if server does not support `CONDSTORE` extension. | ||
* @param {Boolean} [options.useLabels=false] If true then update Gmail labels instead of message flags | ||
* @returns {Promise<Boolean>} Did the operation succeed or not | ||
@@ -366,2 +371,3 @@ * | ||
unchangedSince?: bigint; | ||
useLabels?: boolean; | ||
}): Promise<Boolean>; | ||
@@ -368,0 +374,0 @@ /** |
{ | ||
"name": "imapflow", | ||
"version": "1.0.39", | ||
"version": "1.0.40", | ||
"description": "IMAP Client for Node", | ||
@@ -41,3 +41,3 @@ "main": "./lib/imap-flow.js", | ||
"dependencies": { | ||
"@types/node": "13.9.8", | ||
"@types/node": "13.11.0", | ||
"encoding-japanese": "1.0.30", | ||
@@ -49,5 +49,5 @@ "iconv-lite": "0.5.1", | ||
"mailsplit": "4.6.4", | ||
"pino": "6.0.0", | ||
"pino": "6.1.1", | ||
"utf7": "1.0.2" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
521609
10951
+ Added@types/node@13.11.0(transitive)
+ Addedpino@6.1.1(transitive)
- Removed@types/node@13.9.8(transitive)
- Removedpino@6.0.0(transitive)
Updated@types/node@13.11.0
Updatedpino@6.1.1