imapflow 1.4.7 → 1.4.9

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.
Files changed (38) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/CLAUDE.md +10 -1
  4. package/Gruntfile.js +3 -1
  5. package/lib/commands/authenticate.js +13 -1
  6. package/lib/commands/enable.js +13 -4
  7. package/lib/commands/expunge.js +2 -2
  8. package/lib/commands/idle.js +6 -3
  9. package/lib/commands/list.js +237 -60
  10. package/lib/commands/move.js +2 -2
  11. package/lib/commands/namespace.js +3 -1
  12. package/lib/commands/search.js +88 -13
  13. package/lib/commands/status.js +13 -25
  14. package/lib/imap-flow.d.ts +5 -3
  15. package/lib/imap-flow.js +43 -9
  16. package/lib/search-compiler.js +15 -1
  17. package/lib/tools.js +141 -9
  18. package/package.json +7 -6
  19. package/test/commands-branches-test.js +11 -4
  20. package/test/commands-integration-test.js +1270 -124
  21. package/test/connection-edge-cases-test.js +2 -2
  22. package/test/connection-test.js +1 -1
  23. package/test/fixtures/test-tls.js +2 -2
  24. package/test/imap-flow-coverage-test.js +8 -1
  25. package/test/imap-flow-fetch-download-test.js +1 -4
  26. package/test/imap-flow-internals-test.js +2 -2
  27. package/test/imap-flow-methods-test.js +65 -6
  28. package/test/imap-parser-test.js +1 -2
  29. package/test/integration/README.md +40 -0
  30. package/test/integration/dovecot-test.conf +27 -0
  31. package/test/integration/rev2-live-test.js +242 -0
  32. package/test/integration/run-rev2-tests.sh +61 -0
  33. package/test/reliability-improvements-test.js +4 -1
  34. package/test/search-compiler-test.js +19 -0
  35. package/test/search-test.js +52 -54
  36. package/test/tools-test.js +134 -15
  37. package/.github/codeql/codeql-config.yml +0 -12
  38. package/.github/workflows/codeql.yml +0 -102
@@ -415,7 +415,7 @@ module.exports['Branches: search with undefined options uses {} fallback'] = asy
415
415
  // operand of the OR is evaluated and used to skip it.
416
416
  // ============================================================================
417
417
 
418
- module.exports['Branches: search ESEARCH without uid emits SEARCH and skips LIST-typed tag'] = async test => {
418
+ module.exports['Branches: search ESEARCH without uid emits SEARCH and skips the tag correlator'] = async test => {
419
419
  let execCmd = null;
420
420
  const connection = createMockConnection({
421
421
  state: 3,
@@ -423,10 +423,17 @@ module.exports['Branches: search ESEARCH without uid emits SEARCH and skips LIST
423
423
  exec: async (cmd, attrs, opts) => {
424
424
  execCmd = cmd;
425
425
  if (opts && opts.untagged && opts.untagged.ESEARCH) {
426
- // attrs[0] is a LIST-typed object (not a plain Array) -> exercises
427
- // the `attrs[start].type === 'LIST'` branch on line 150.
426
+ // attrs[0] is the (TAG "...") correlator group, represented by the
427
+ // parser as a plain Array - it must be skipped before the keywords
428
428
  await opts.untagged.ESEARCH({
429
- attributes: [{ type: 'LIST' }, { type: 'ATOM', value: 'COUNT' }, { type: 'ATOM', value: '7' }]
429
+ attributes: [
430
+ [
431
+ { type: 'ATOM', value: 'TAG' },
432
+ { type: 'STRING', value: 'A1' }
433
+ ],
434
+ { type: 'ATOM', value: 'COUNT' },
435
+ { type: 'ATOM', value: '7' }
436
+ ]
430
437
  });
431
438
  }
432
439
  return { next: () => {} };