imapflow 1.0.121 → 1.0.123

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ - 1.0.123 - 2023-03-22
4
+
5
+ - Do not throw if server responds with `tag BYE`
6
+
3
7
  - 1.0.118 - 2022-12-22
4
8
 
5
9
  - Refactored detecting special use folders
package/lib/imap-flow.js CHANGED
@@ -408,7 +408,9 @@ class ImapFlow extends EventEmitter {
408
408
 
409
409
  async exec(command, attributes, options) {
410
410
  if (this.socket.destroyed) {
411
- throw new Error('Connection closed');
411
+ let error = new Error('Connection closed');
412
+ error.code = 'EConnectionClosed';
413
+ throw error;
412
414
  }
413
415
 
414
416
  let tag = (++this.tagCounter).toString(16).toUpperCase();
@@ -536,6 +538,7 @@ class ImapFlow extends EventEmitter {
536
538
 
537
539
  switch (parsed.command.toUpperCase()) {
538
540
  case 'OK':
541
+ case 'BYE':
539
542
  await new Promise(resolve => request.resolve({ response: parsed, next: resolve }));
540
543
  break;
541
544
 
@@ -2165,6 +2168,12 @@ class ImapFlow extends EventEmitter {
2165
2168
 
2166
2169
  let res;
2167
2170
  while ((res = await getNext())) {
2171
+ if (this.isClosed || this.socket.destroyed) {
2172
+ let error = new Error('Connection closed');
2173
+ error.code = 'EConnectionClosed';
2174
+ throw error;
2175
+ }
2176
+
2168
2177
  if (res !== null) {
2169
2178
  yield res.response;
2170
2179
  res.next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.121",
3
+ "version": "1.0.123",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {
@@ -27,18 +27,18 @@
27
27
  },
28
28
  "homepage": "https://imapflow.com/",
29
29
  "devDependencies": {
30
- "@babel/eslint-parser": "7.19.1",
30
+ "@babel/eslint-parser": "7.21.3",
31
31
  "@babel/eslint-plugin": "7.19.1",
32
32
  "@babel/plugin-syntax-class-properties": "7.12.13",
33
33
  "@babel/preset-env": "7.20.2",
34
- "@types/node": "18.14.0",
34
+ "@types/node": "18.15.5",
35
35
  "braintree-jsdoc-template": "3.3.0",
36
- "eslint": "8.34.0",
36
+ "eslint": "8.36.0",
37
37
  "eslint-config-nodemailer": "1.2.0",
38
- "eslint-config-prettier": "8.6.0",
38
+ "eslint-config-prettier": "8.8.0",
39
39
  "grunt": "1.6.1",
40
40
  "grunt-cli": "1.4.3",
41
- "grunt-contrib-nodeunit": "4.0.0",
41
+ "grunt-contrib-nodeunit": "5.0.0",
42
42
  "grunt-eslint": "24.0.1",
43
43
  "jsdoc": "3.6.11",
44
44
  "st": "3.0.0",
@@ -52,7 +52,7 @@
52
52
  "libqp": "2.0.1",
53
53
  "mailsplit": "5.4.0",
54
54
  "nodemailer": "6.9.1",
55
- "pino": "8.10.0",
55
+ "pino": "8.11.0",
56
56
  "socks": "2.7.1"
57
57
  }
58
58
  }