imapflow 1.0.90 → 1.0.93

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.90",
3
+ "version": "1.0.93",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {
@@ -8,7 +8,8 @@
8
8
  "prepare": "npm run build",
9
9
  "docs": "rm -rf docs && mkdir -p docs && jsdoc lib/imap-flow.js -c jsdoc.json -R README.md --destination docs/ && cp assets/favicon.ico docs",
10
10
  "dst": "node types.js",
11
- "build": "npm run docs && npm run dst"
11
+ "build": "npm run docs && npm run dst",
12
+ "st": "npm run docs && st -d docs -i index.html"
12
13
  },
13
14
  "repository": {
14
15
  "type": "git",
@@ -29,28 +30,29 @@
29
30
  "@babel/eslint-parser": "7.17.0",
30
31
  "@babel/eslint-plugin": "7.17.7",
31
32
  "@babel/plugin-syntax-class-properties": "7.12.13",
32
- "@babel/preset-env": "7.16.11",
33
- "@types/node": "17.0.23",
33
+ "@babel/preset-env": "7.17.10",
34
+ "@types/node": "17.0.31",
34
35
  "braintree-jsdoc-template": "3.3.0",
35
- "eslint": "8.12.0",
36
+ "eslint": "8.14.0",
36
37
  "eslint-config-nodemailer": "1.2.0",
37
38
  "eslint-config-prettier": "8.5.0",
38
- "grunt": "1.4.1",
39
+ "grunt": "1.5.2",
39
40
  "grunt-cli": "1.4.3",
40
41
  "grunt-contrib-nodeunit": "4.0.0",
41
42
  "grunt-eslint": "24.0.0",
42
43
  "jsdoc": "3.6.10",
44
+ "st": "3.0.0",
43
45
  "tsd-jsdoc": "2.5.0"
44
46
  },
45
47
  "dependencies": {
46
48
  "encoding-japanese": "2.0.0",
47
49
  "iconv-lite": "0.6.3",
48
50
  "libbase64": "1.2.1",
49
- "libmime": "5.0.0",
51
+ "libmime": "5.1.0",
50
52
  "libqp": "1.1.0",
51
- "mailsplit": "5.3.1",
52
- "nodemailer": "6.7.3",
53
- "pino": "7.9.2",
53
+ "mailsplit": "5.3.2",
54
+ "nodemailer": "6.7.4",
55
+ "pino": "7.11.0",
54
56
  "socks": "2.6.2"
55
57
  }
56
58
  }
@@ -200,8 +200,7 @@ module.exports['IMAP Compiler: hide long strings'] = test =>
200
200
  attributes: [
201
201
  {
202
202
  type: 'String',
203
- value:
204
- 'Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere!'
203
+ value: 'Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere! Tere tere!'
205
204
  },
206
205
  'Vana kere'
207
206
  ]
@@ -248,6 +247,46 @@ module.exports['IMAP Compiler: LITERAL text'] = test =>
248
247
  )
249
248
  );
250
249
 
250
+ module.exports['IMAP Compiler: LITERAL literal'] = test =>
251
+ asyncWrapper(test, async test =>
252
+ test.equal(
253
+ await compiler({
254
+ tag: '*',
255
+ command: 'CMD',
256
+ attributes: [
257
+ // keep indentation
258
+ {
259
+ type: 'LITERAL',
260
+ value: 'Tere\x00 tere!',
261
+ isLiteral8: false
262
+ },
263
+ 'Vana kere'
264
+ ]
265
+ }),
266
+ '* CMD {11}\r\nTere\x00 tere! "Vana kere"'
267
+ )
268
+ );
269
+
270
+ module.exports['IMAP Compiler: LITERAL literal8'] = test =>
271
+ asyncWrapper(test, async test =>
272
+ test.equal(
273
+ await compiler({
274
+ tag: '*',
275
+ command: 'CMD',
276
+ attributes: [
277
+ // keep indentation
278
+ {
279
+ type: 'LITERAL',
280
+ value: 'Tere\x00 tere!',
281
+ isLiteral8: true
282
+ },
283
+ 'Vana kere'
284
+ ]
285
+ }),
286
+ '* CMD ~{11}\r\nTere\x00 tere! "Vana kere"'
287
+ )
288
+ );
289
+
251
290
  module.exports['IMAP Compiler: LITERAL array 1'] = test =>
252
291
  asyncWrapper(test, async test =>
253
292
  test.deepEqual(
@@ -309,6 +309,36 @@ module.exports['IMAP Parser: Literals: single literal'] = test =>
309
309
  ])
310
310
  );
311
311
 
312
+ module.exports['IMAP Parser: Literals: literal with NULL'] = test =>
313
+ asyncWrapper(test, async test =>
314
+ test.deepEqual((await parser('TAG1 CMD {4}\r\n', { literals: [Buffer.from('ab\x00d')] })).attributes, [
315
+ {
316
+ type: 'LITERAL',
317
+ value: Buffer.from('ab\x00d')
318
+ }
319
+ ])
320
+ );
321
+
322
+ module.exports['IMAP Parser: Literals: literal8'] = test =>
323
+ asyncWrapper(test, async test =>
324
+ test.deepEqual((await parser('TAG1 CMD ~{4}\r\n', { literals: [Buffer.from('ab\x00d')] })).attributes, [
325
+ {
326
+ type: 'LITERAL',
327
+ value: Buffer.from('ab\x00d')
328
+ }
329
+ ])
330
+ );
331
+
332
+ module.exports['IMAP Parser: Literals: unexpected literal8 prefix'] = test =>
333
+ asyncWrapper(test, async test => {
334
+ try {
335
+ await parser('TAG1 CMD ~\r\n');
336
+ test.ok(false, 'Must throw');
337
+ } catch (err) {
338
+ test.ok(err, 'Error must exist');
339
+ }
340
+ });
341
+
312
342
  module.exports['IMAP Parser: Literals: multiple literals'] = test =>
313
343
  asyncWrapper(test, async test =>
314
344
  test.deepEqual((await parser('TAG1 CMD {4}\r\n {4}\r\n', { literals: [Buffer.from('abcd'), Buffer.from('kere')] })).attributes, [