@withbuddi/buddi 0.1.0-pre.52 → 0.1.0-pre.54
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/extension/background.js +38 -7
- package/extension/manifest.json +2 -2
- package/extension/popup.html +2 -2
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/dashboard-cmd.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/dashboard-cmd.js +6 -3
- package/node_modules/@buddi/cli/dist/dashboard-cmd.js.map +1 -1
- package/node_modules/@buddi/cli/dist/main.js +2 -2
- package/node_modules/@buddi/cli/dist/main.js.map +1 -1
- package/node_modules/@buddi/cli/dist/status.d.ts +16 -2
- package/node_modules/@buddi/cli/dist/status.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/status.js +42 -2
- package/node_modules/@buddi/cli/dist/status.js.map +1 -1
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.d.ts +6 -0
- package/node_modules/@buddi/core/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.js +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/core/dist/backup/archive.d.ts +6 -0
- package/node_modules/@buddi/core/dist/backup/archive.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/backup/archive.js +19 -6
- package/node_modules/@buddi/core/dist/backup/archive.js.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/binaries.d.ts +21 -1
- package/node_modules/@buddi/core/dist/postgres/binaries.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/binaries.js +72 -10
- package/node_modules/@buddi/core/dist/postgres/binaries.js.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/cluster.d.ts +8 -0
- package/node_modules/@buddi/core/dist/postgres/cluster.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/cluster.js +119 -17
- package/node_modules/@buddi/core/dist/postgres/cluster.js.map +1 -1
- package/node_modules/@buddi/core/dist/postgres/windows-guard.d.ts +20 -0
- package/node_modules/@buddi/core/dist/postgres/windows-guard.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/postgres/windows-guard.js +140 -0
- package/node_modules/@buddi/core/dist/postgres/windows-guard.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.js +3 -2
- package/node_modules/@buddi/gateway/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.d.ts +2 -2
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.js +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.d.ts +6 -6
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.js +5 -5
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/browser-host.js +1 -1
- package/node_modules/@buddi/gateway/dist/browser-host.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.d.ts +10 -10
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.js +20 -20
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +2 -2
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js +11 -11
- package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/reminders.d.ts +2 -2
- package/node_modules/@buddi/gateway/dist/missions/reminders.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/reminders.js +5 -5
- package/node_modules/@buddi/gateway/dist/missions/reminders.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.js +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/npm.d.ts +9 -2
- package/node_modules/@buddi/gateway/dist/plugins/npm.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/npm.js +29 -6
- package/node_modules/@buddi/gateway/dist/plugins/npm.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/stage.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/plugins/stage.js +2 -2
- package/node_modules/@buddi/gateway/dist/plugins/stage.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/browser-cards.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/browser-cards.js +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.d.ts +11 -0
- package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.js +42 -1
- package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.js +6 -6
- package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/approval-ask.js +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.js +22 -11
- package/node_modules/@buddi/gateway/dist/web/extension.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.js +4 -4
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/service.d.ts +6 -1
- package/node_modules/@buddi/gateway/dist/web/service.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/service.js +10 -1
- package/node_modules/@buddi/gateway/dist/web/service.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/skills.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/skills.js +2 -1
- package/node_modules/@buddi/gateway/dist/web/skills.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/write.d.ts +1 -1
- package/node_modules/@buddi/gateway/dist/web/write.js +1 -1
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/install/dist/app-layout.d.ts +53 -0
- package/node_modules/@buddi/install/dist/app-layout.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/app-layout.js +123 -10
- package/node_modules/@buddi/install/dist/app-layout.js.map +1 -1
- package/node_modules/@buddi/install/dist/cloudflared.js +2 -2
- package/node_modules/@buddi/install/dist/cloudflared.js.map +1 -1
- package/node_modules/@buddi/install/dist/environment.d.ts +40 -1
- package/node_modules/@buddi/install/dist/environment.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/environment.js +158 -12
- package/node_modules/@buddi/install/dist/environment.js.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.js +340 -54
- package/node_modules/@buddi/install/dist/launcher.js.map +1 -1
- package/node_modules/@buddi/install/dist/linux-install.d.ts +41 -0
- package/node_modules/@buddi/install/dist/linux-install.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/linux-install.js +86 -0
- package/node_modules/@buddi/install/dist/linux-install.js.map +1 -0
- package/node_modules/@buddi/install/dist/postgres-check.js +1 -1
- package/node_modules/@buddi/install/dist/postgres-check.js.map +1 -1
- package/node_modules/@buddi/install/dist/product-uninstall.d.ts +14 -0
- package/node_modules/@buddi/install/dist/product-uninstall.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/product-uninstall.js +10 -0
- package/node_modules/@buddi/install/dist/product-uninstall.js.map +1 -1
- package/node_modules/@buddi/install/dist/runtime-info.d.ts +23 -0
- package/node_modules/@buddi/install/dist/runtime-info.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/runtime-info.js +72 -0
- package/node_modules/@buddi/install/dist/runtime-info.js.map +1 -0
- package/node_modules/@buddi/install/dist/supervisor.d.ts +60 -3
- package/node_modules/@buddi/install/dist/supervisor.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/supervisor.js +175 -17
- package/node_modules/@buddi/install/dist/supervisor.js.map +1 -1
- package/node_modules/@buddi/install/dist/uninstall.d.ts +49 -3
- package/node_modules/@buddi/install/dist/uninstall.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/uninstall.js +184 -27
- package/node_modules/@buddi/install/dist/uninstall.js.map +1 -1
- package/node_modules/@buddi/install/dist/upgrade.d.ts +20 -5
- package/node_modules/@buddi/install/dist/upgrade.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/upgrade.js +125 -62
- package/node_modules/@buddi/install/dist/upgrade.js.map +1 -1
- package/node_modules/@buddi/install/dist/windows-install.d.ts +102 -0
- package/node_modules/@buddi/install/dist/windows-install.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/windows-install.js +223 -0
- package/node_modules/@buddi/install/dist/windows-install.js.map +1 -0
- package/node_modules/@buddi/install/dist/windows-setup.d.ts +107 -0
- package/node_modules/@buddi/install/dist/windows-setup.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/windows-setup.js +700 -0
- package/node_modules/@buddi/install/dist/windows-setup.js.map +1 -0
- package/node_modules/@buddi/install/dist/windows-task.d.ts +49 -0
- package/node_modules/@buddi/install/dist/windows-task.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/windows-task.js +167 -0
- package/node_modules/@buddi/install/dist/windows-task.js.map +1 -0
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/codex-direct.d.ts +1 -1
- package/node_modules/@buddi/runtime/dist/codex-direct.js +1 -1
- package/node_modules/@buddi/runtime/dist/openai.d.ts +11 -0
- package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/openai.js +36 -3
- package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/tools/write.js +3 -3
- package/node_modules/@buddi/tool-artifacts/dist/tools/write.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/availability.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/availability.js +1 -0
- package/node_modules/@buddi/tool-browser/dist/availability.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/brand.d.ts +19 -0
- package/node_modules/@buddi/tool-browser/dist/brand.d.ts.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/brand.js +31 -0
- package/node_modules/@buddi/tool-browser/dist/brand.js.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts +2 -2
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +16 -7
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/downloads.js +1 -1
- package/node_modules/@buddi/tool-browser/dist/downloads.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/extension.d.ts +3 -1
- package/node_modules/@buddi/tool-browser/dist/extension.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/extension.js +4 -4
- package/node_modules/@buddi/tool-browser/dist/extension.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts +3 -2
- package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js +7 -6
- package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts +12 -1
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.js +31 -14
- package/node_modules/@buddi/tool-browser/dist/routes.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts +2 -0
- package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.js +6 -6
- package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/telemetry.d.ts +2 -2
- package/node_modules/@buddi/tool-browser/dist/telemetry.js +2 -2
- package/node_modules/@buddi/tool-browser/dist/telemetry.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-host/dist/index.d.ts +2 -1
- package/node_modules/@buddi/tool-host/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/index.js +11 -2
- package/node_modules/@buddi/tool-host/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/process.d.ts +58 -1
- package/node_modules/@buddi/tool-host/dist/process.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/process.js +229 -15
- package/node_modules/@buddi/tool-host/dist/process.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/service.d.ts +2 -0
- package/node_modules/@buddi/tool-host/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/service.js +8 -6
- package/node_modules/@buddi/tool-host/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-host/dist/skill-run.d.ts +10 -0
- package/node_modules/@buddi/tool-host/dist/skill-run.d.ts.map +1 -1
- package/node_modules/@buddi/tool-host/dist/skill-run.js +14 -0
- package/node_modules/@buddi/tool-host/dist/skill-run.js.map +1 -1
- package/node_modules/@hono/node-server/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/content-disposition/README.md +105 -35
- package/node_modules/content-disposition/dist/index.d.ts +72 -0
- package/node_modules/content-disposition/dist/index.js +388 -0
- package/node_modules/content-disposition/dist/index.js.map +1 -0
- package/node_modules/content-disposition/package.json +31 -19
- package/node_modules/docx/dist/index.cjs +182 -80
- package/node_modules/docx/dist/index.d.cts +63 -6
- package/node_modules/docx/dist/index.d.ts +63 -6
- package/node_modules/docx/dist/index.iife.js +182 -80
- package/node_modules/docx/dist/index.mjs +182 -80
- package/node_modules/docx/dist/index.umd.cjs +182 -80
- package/node_modules/docx/dist/layout.cjs +1 -6
- package/node_modules/docx/dist/layout.iife.js +1 -6
- package/node_modules/docx/dist/layout.mjs +1 -6
- package/node_modules/docx/dist/layout.umd.cjs +1 -6
- package/node_modules/docx/package.json +4 -3
- package/node_modules/express/Readme.md +15 -9
- package/node_modules/express/lib/application.js +2 -2
- package/node_modules/express/lib/request.js +32 -19
- package/node_modules/express/lib/response.js +27 -30
- package/node_modules/express/node_modules/content-type/LICENSE +22 -0
- package/node_modules/express/node_modules/content-type/README.md +71 -0
- package/node_modules/express/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/express/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/express/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/express/node_modules/content-type/package.json +52 -0
- package/node_modules/express/package.json +10 -10
- package/node_modules/imapflow/CHANGELOG.md +33 -0
- package/node_modules/imapflow/dist/cjs/commands/append.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/commands/append.js +15 -4
- package/node_modules/imapflow/dist/cjs/commands/compress.js +2 -2
- package/node_modules/imapflow/dist/cjs/commands/id.js +5 -3
- package/node_modules/imapflow/dist/cjs/commands/idle.js +9 -9
- package/node_modules/imapflow/dist/cjs/commands/list.js +2 -2
- package/node_modules/imapflow/dist/cjs/commands/namespace.js +18 -14
- package/node_modules/imapflow/dist/cjs/commands/quota.js +2 -3
- package/node_modules/imapflow/dist/cjs/commands/status.js +2 -4
- package/node_modules/imapflow/dist/cjs/connection-deadline.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/connection-deadline.js +2 -4
- package/node_modules/imapflow/dist/cjs/download.js +66 -35
- package/node_modules/imapflow/dist/cjs/errors.d.ts +15 -0
- package/node_modules/imapflow/dist/cjs/errors.js +22 -0
- package/node_modules/imapflow/dist/cjs/handler/imap-compiler.d.ts +4 -4
- package/node_modules/imapflow/dist/cjs/handler/imap-compiler.js +18 -18
- package/node_modules/imapflow/dist/cjs/handler/imap-parser.js +28 -3
- package/node_modules/imapflow/dist/cjs/handler/imap-stream.js +9 -8
- package/node_modules/imapflow/dist/cjs/handler/limits.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/handler/limits.js +5 -7
- package/node_modules/imapflow/dist/cjs/handler/parser-instance.js +23 -38
- package/node_modules/imapflow/dist/cjs/handler/token-parser.d.ts +12 -0
- package/node_modules/imapflow/dist/cjs/handler/token-parser.js +44 -104
- package/node_modules/imapflow/dist/cjs/imap-flow.d.ts +4 -3
- package/node_modules/imapflow/dist/cjs/imap-flow.js +98 -72
- package/node_modules/imapflow/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.js +1 -1
- package/node_modules/imapflow/dist/cjs/proxy-connection.js +2 -5
- package/node_modules/imapflow/dist/cjs/search-compiler.js +2 -3
- package/node_modules/imapflow/dist/cjs/tools.d.ts +14 -3
- package/node_modules/imapflow/dist/cjs/tools.js +30 -18
- package/node_modules/imapflow/dist/cjs/types.d.ts +11 -0
- package/node_modules/imapflow/dist/esm/commands/append.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/commands/append.js +15 -4
- package/node_modules/imapflow/dist/esm/commands/compress.js +2 -2
- package/node_modules/imapflow/dist/esm/commands/id.js +6 -4
- package/node_modules/imapflow/dist/esm/commands/idle.js +9 -9
- package/node_modules/imapflow/dist/esm/commands/list.js +3 -3
- package/node_modules/imapflow/dist/esm/commands/namespace.js +19 -15
- package/node_modules/imapflow/dist/esm/commands/quota.js +3 -4
- package/node_modules/imapflow/dist/esm/commands/status.js +2 -4
- package/node_modules/imapflow/dist/esm/connection-deadline.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/connection-deadline.js +2 -4
- package/node_modules/imapflow/dist/esm/download.js +66 -35
- package/node_modules/imapflow/dist/esm/errors.d.ts +15 -0
- package/node_modules/imapflow/dist/esm/errors.js +21 -0
- package/node_modules/imapflow/dist/esm/handler/imap-compiler.d.ts +4 -4
- package/node_modules/imapflow/dist/esm/handler/imap-compiler.js +18 -18
- package/node_modules/imapflow/dist/esm/handler/imap-parser.js +28 -3
- package/node_modules/imapflow/dist/esm/handler/imap-stream.js +9 -8
- package/node_modules/imapflow/dist/esm/handler/limits.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/handler/limits.js +5 -7
- package/node_modules/imapflow/dist/esm/handler/parser-instance.js +23 -38
- package/node_modules/imapflow/dist/esm/handler/token-parser.d.ts +12 -0
- package/node_modules/imapflow/dist/esm/handler/token-parser.js +44 -104
- package/node_modules/imapflow/dist/esm/imap-flow.d.ts +4 -3
- package/node_modules/imapflow/dist/esm/imap-flow.js +99 -73
- package/node_modules/imapflow/dist/esm/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/package-info.js +1 -1
- package/node_modules/imapflow/dist/esm/proxy-connection.js +2 -5
- package/node_modules/imapflow/dist/esm/search-compiler.js +2 -3
- package/node_modules/imapflow/dist/esm/tools.d.ts +14 -3
- package/node_modules/imapflow/dist/esm/tools.js +30 -19
- package/node_modules/imapflow/dist/esm/types.d.ts +11 -0
- package/node_modules/imapflow/package.json +6 -3
- package/node_modules/ip-address/README.md +70 -70
- package/node_modules/ip-address/dist/ipv6.js +7 -4
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
- package/node_modules/ip-address/dist/v6/constants.js +3 -0
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +2 -1
- package/node_modules/marked/bin/main.js +1 -1
- package/node_modules/marked/lib/marked.d.ts +6 -3
- package/node_modules/marked/lib/marked.esm.js +48 -50
- package/node_modules/marked/lib/marked.esm.js.map +3 -3
- package/node_modules/marked/lib/marked.umd.js +45 -47
- package/node_modules/marked/lib/marked.umd.js.map +3 -3
- package/node_modules/marked/man/marked.1 +1 -1
- package/node_modules/marked/package.json +1 -1
- package/node_modules/process-warning/.github/workflows/ci.yml +1 -1
- package/node_modules/process-warning/.github/workflows/lock-threads.yml +1 -1
- package/node_modules/process-warning/.github/workflows/release.yml +24 -0
- package/node_modules/process-warning/README.md +46 -46
- package/node_modules/process-warning/package.json +1 -1
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/dashboard-cmd.d.ts.map +1 -1
- package/packages/cli/dist/dashboard-cmd.js +6 -3
- package/packages/cli/dist/dashboard-cmd.js.map +1 -1
- package/packages/cli/dist/main.js +2 -2
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/status.d.ts +16 -2
- package/packages/cli/dist/status.d.ts.map +1 -1
- package/packages/cli/dist/status.js +42 -2
- package/packages/cli/dist/status.js.map +1 -1
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/agents/catalog.d.ts +6 -0
- package/packages/core/dist/agents/catalog.d.ts.map +1 -1
- package/packages/core/dist/agents/catalog.js +1 -1
- package/packages/core/dist/agents/catalog.js.map +1 -1
- package/packages/core/dist/backup/archive.d.ts +6 -0
- package/packages/core/dist/backup/archive.d.ts.map +1 -1
- package/packages/core/dist/backup/archive.js +19 -6
- package/packages/core/dist/backup/archive.js.map +1 -1
- package/packages/core/dist/postgres/binaries.d.ts +21 -1
- package/packages/core/dist/postgres/binaries.d.ts.map +1 -1
- package/packages/core/dist/postgres/binaries.js +72 -10
- package/packages/core/dist/postgres/binaries.js.map +1 -1
- package/packages/core/dist/postgres/cluster.d.ts +8 -0
- package/packages/core/dist/postgres/cluster.d.ts.map +1 -1
- package/packages/core/dist/postgres/cluster.js +119 -17
- package/packages/core/dist/postgres/cluster.js.map +1 -1
- package/packages/core/dist/postgres/windows-guard.d.ts +20 -0
- package/packages/core/dist/postgres/windows-guard.d.ts.map +1 -0
- package/packages/core/dist/postgres/windows-guard.js +140 -0
- package/packages/core/dist/postgres/windows-guard.js.map +1 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalog.js +3 -2
- package/packages/gateway/dist/agents/catalog.js.map +1 -1
- package/packages/gateway/dist/agents/catalogue-package.d.ts +2 -2
- package/packages/gateway/dist/agents/catalogue-package.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalogue-package.js +1 -1
- package/packages/gateway/dist/agents/catalogue-package.js.map +1 -1
- package/packages/gateway/dist/agents/platform-catalogue.d.ts +6 -6
- package/packages/gateway/dist/agents/platform-catalogue.d.ts.map +1 -1
- package/packages/gateway/dist/agents/platform-catalogue.js +5 -5
- package/packages/gateway/dist/agents/platform-catalogue.js.map +1 -1
- package/packages/gateway/dist/browser-host.js +1 -1
- package/packages/gateway/dist/browser-host.js.map +1 -1
- package/packages/gateway/dist/missions/chrome-scope.d.ts +10 -10
- package/packages/gateway/dist/missions/chrome-scope.d.ts.map +1 -1
- package/packages/gateway/dist/missions/chrome-scope.js +20 -20
- package/packages/gateway/dist/missions/chrome-scope.js.map +1 -1
- package/packages/gateway/dist/missions/execute.d.ts +2 -2
- package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
- package/packages/gateway/dist/missions/execute.js +11 -11
- package/packages/gateway/dist/missions/execute.js.map +1 -1
- package/packages/gateway/dist/missions/reminders.d.ts +2 -2
- package/packages/gateway/dist/missions/reminders.d.ts.map +1 -1
- package/packages/gateway/dist/missions/reminders.js +5 -5
- package/packages/gateway/dist/missions/reminders.js.map +1 -1
- package/packages/gateway/dist/owner-notify.js +1 -1
- package/packages/gateway/dist/owner-notify.js.map +1 -1
- package/packages/gateway/dist/plugins/npm.d.ts +9 -2
- package/packages/gateway/dist/plugins/npm.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/npm.js +29 -6
- package/packages/gateway/dist/plugins/npm.js.map +1 -1
- package/packages/gateway/dist/plugins/stage.d.ts.map +1 -1
- package/packages/gateway/dist/plugins/stage.js +2 -2
- package/packages/gateway/dist/plugins/stage.js.map +1 -1
- package/packages/gateway/dist/serve.js +1 -1
- package/packages/gateway/dist/serve.js.map +1 -1
- package/packages/gateway/dist/surfaces/browser-cards.d.ts +1 -1
- package/packages/gateway/dist/surfaces/browser-cards.js +1 -1
- package/packages/gateway/dist/system-context.d.ts +11 -0
- package/packages/gateway/dist/system-context.d.ts.map +1 -1
- package/packages/gateway/dist/system-context.js +42 -1
- package/packages/gateway/dist/system-context.js.map +1 -1
- package/packages/gateway/dist/telegram/approvals.js +1 -1
- package/packages/gateway/dist/telegram/approvals.js.map +1 -1
- package/packages/gateway/dist/telegram/browser-view.js +1 -1
- package/packages/gateway/dist/telegram/browser-view.js.map +1 -1
- package/packages/gateway/dist/web/api-routes.js +6 -6
- package/packages/gateway/dist/web/api-routes.js.map +1 -1
- package/packages/gateway/dist/web/approval-ask.js +1 -1
- package/packages/gateway/dist/web/extension.d.ts +6 -0
- package/packages/gateway/dist/web/extension.d.ts.map +1 -1
- package/packages/gateway/dist/web/extension.js +22 -11
- package/packages/gateway/dist/web/extension.js.map +1 -1
- package/packages/gateway/dist/web/read.d.ts +1 -1
- package/packages/gateway/dist/web/read.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +4 -4
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/service.d.ts +6 -1
- package/packages/gateway/dist/web/service.d.ts.map +1 -1
- package/packages/gateway/dist/web/service.js +10 -1
- package/packages/gateway/dist/web/service.js.map +1 -1
- package/packages/gateway/dist/web/skills.d.ts.map +1 -1
- package/packages/gateway/dist/web/skills.js +2 -1
- package/packages/gateway/dist/web/skills.js.map +1 -1
- package/packages/gateway/dist/web/write.d.ts +1 -1
- package/packages/gateway/dist/web/write.js +1 -1
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/install/dist/app-layout.d.ts +53 -0
- package/packages/install/dist/app-layout.d.ts.map +1 -1
- package/packages/install/dist/app-layout.js +123 -10
- package/packages/install/dist/app-layout.js.map +1 -1
- package/packages/install/dist/cloudflared.js +2 -2
- package/packages/install/dist/cloudflared.js.map +1 -1
- package/packages/install/dist/environment.d.ts +40 -1
- package/packages/install/dist/environment.d.ts.map +1 -1
- package/packages/install/dist/environment.js +158 -12
- package/packages/install/dist/environment.js.map +1 -1
- package/packages/install/dist/launcher.d.ts.map +1 -1
- package/packages/install/dist/launcher.js +340 -54
- package/packages/install/dist/launcher.js.map +1 -1
- package/packages/install/dist/linux-install.d.ts +41 -0
- package/packages/install/dist/linux-install.d.ts.map +1 -0
- package/packages/install/dist/linux-install.js +86 -0
- package/packages/install/dist/linux-install.js.map +1 -0
- package/packages/install/dist/postgres-check.js +1 -1
- package/packages/install/dist/postgres-check.js.map +1 -1
- package/packages/install/dist/product-uninstall.d.ts +14 -0
- package/packages/install/dist/product-uninstall.d.ts.map +1 -1
- package/packages/install/dist/product-uninstall.js +10 -0
- package/packages/install/dist/product-uninstall.js.map +1 -1
- package/packages/install/dist/runtime-info.d.ts +23 -0
- package/packages/install/dist/runtime-info.d.ts.map +1 -0
- package/packages/install/dist/runtime-info.js +72 -0
- package/packages/install/dist/runtime-info.js.map +1 -0
- package/packages/install/dist/supervisor.d.ts +60 -3
- package/packages/install/dist/supervisor.d.ts.map +1 -1
- package/packages/install/dist/supervisor.js +175 -17
- package/packages/install/dist/supervisor.js.map +1 -1
- package/packages/install/dist/uninstall.d.ts +49 -3
- package/packages/install/dist/uninstall.d.ts.map +1 -1
- package/packages/install/dist/uninstall.js +184 -27
- package/packages/install/dist/uninstall.js.map +1 -1
- package/packages/install/dist/upgrade.d.ts +20 -5
- package/packages/install/dist/upgrade.d.ts.map +1 -1
- package/packages/install/dist/upgrade.js +125 -62
- package/packages/install/dist/upgrade.js.map +1 -1
- package/packages/install/dist/windows-install.d.ts +102 -0
- package/packages/install/dist/windows-install.d.ts.map +1 -0
- package/packages/install/dist/windows-install.js +223 -0
- package/packages/install/dist/windows-install.js.map +1 -0
- package/packages/install/dist/windows-setup.d.ts +107 -0
- package/packages/install/dist/windows-setup.d.ts.map +1 -0
- package/packages/install/dist/windows-setup.js +700 -0
- package/packages/install/dist/windows-setup.js.map +1 -0
- package/packages/install/dist/windows-task.d.ts +49 -0
- package/packages/install/dist/windows-task.d.ts.map +1 -0
- package/packages/install/dist/windows-task.js +167 -0
- package/packages/install/dist/windows-task.js.map +1 -0
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/codex-direct.d.ts +1 -1
- package/packages/runtime/dist/codex-direct.js +1 -1
- package/packages/runtime/dist/openai.d.ts +11 -0
- package/packages/runtime/dist/openai.d.ts.map +1 -1
- package/packages/runtime/dist/openai.js +36 -3
- package/packages/runtime/dist/openai.js.map +1 -1
- package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
- package/packages/tools/artifacts/dist/tools/write.js +3 -3
- package/packages/tools/artifacts/dist/tools/write.js.map +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/availability.d.ts.map +1 -1
- package/packages/tools/browser/dist/availability.js +1 -0
- package/packages/tools/browser/dist/availability.js.map +1 -1
- package/packages/tools/browser/dist/brand.d.ts +19 -0
- package/packages/tools/browser/dist/brand.d.ts.map +1 -0
- package/packages/tools/browser/dist/brand.js +31 -0
- package/packages/tools/browser/dist/brand.js.map +1 -0
- package/packages/tools/browser/dist/controller.d.ts +2 -2
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +16 -7
- package/packages/tools/browser/dist/controller.js.map +1 -1
- package/packages/tools/browser/dist/downloads.js +1 -1
- package/packages/tools/browser/dist/downloads.js.map +1 -1
- package/packages/tools/browser/dist/extension.d.ts +3 -1
- package/packages/tools/browser/dist/extension.d.ts.map +1 -1
- package/packages/tools/browser/dist/extension.js +4 -4
- package/packages/tools/browser/dist/extension.js.map +1 -1
- package/packages/tools/browser/dist/index.d.ts +3 -2
- package/packages/tools/browser/dist/index.d.ts.map +1 -1
- package/packages/tools/browser/dist/index.js +7 -6
- package/packages/tools/browser/dist/index.js.map +1 -1
- package/packages/tools/browser/dist/routes.d.ts +12 -1
- package/packages/tools/browser/dist/routes.d.ts.map +1 -1
- package/packages/tools/browser/dist/routes.js +31 -14
- package/packages/tools/browser/dist/routes.js.map +1 -1
- package/packages/tools/browser/dist/service.d.ts +2 -0
- package/packages/tools/browser/dist/service.d.ts.map +1 -1
- package/packages/tools/browser/dist/service.js +6 -6
- package/packages/tools/browser/dist/service.js.map +1 -1
- package/packages/tools/browser/dist/telemetry.d.ts +2 -2
- package/packages/tools/browser/dist/telemetry.js +2 -2
- package/packages/tools/browser/dist/telemetry.js.map +1 -1
- package/packages/tools/browser/dist/types.js +1 -1
- package/packages/tools/browser/dist/types.js.map +1 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/host/dist/index.d.ts +2 -1
- package/packages/tools/host/dist/index.d.ts.map +1 -1
- package/packages/tools/host/dist/index.js +11 -2
- package/packages/tools/host/dist/index.js.map +1 -1
- package/packages/tools/host/dist/process.d.ts +58 -1
- package/packages/tools/host/dist/process.d.ts.map +1 -1
- package/packages/tools/host/dist/process.js +229 -15
- package/packages/tools/host/dist/process.js.map +1 -1
- package/packages/tools/host/dist/service.d.ts +2 -0
- package/packages/tools/host/dist/service.d.ts.map +1 -1
- package/packages/tools/host/dist/service.js +8 -6
- package/packages/tools/host/dist/service.js.map +1 -1
- package/packages/tools/host/dist/skill-run.d.ts +10 -0
- package/packages/tools/host/dist/skill-run.d.ts.map +1 -1
- package/packages/tools/host/dist/skill-run.js +14 -0
- package/packages/tools/host/dist/skill-run.js.map +1 -1
- package/packages/web/dist/assets/index-DnZhfnM7.js +155 -0
- package/packages/web/dist/assets/{lottie_light-DROBTM6Y.js → lottie_light-CGUtDt_b.js} +1 -1
- package/packages/web/dist/build.json +1 -1
- package/packages/web/dist/index.html +1 -1
- package/packages/web/dist/precache.json +3 -3
- package/node_modules/content-disposition/index.js +0 -536
- package/packages/web/dist/assets/index-oxmxR39o.js +0 -155
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { formatFlag, canUseFlag, formatDateTime, normalizePath, encodePath, comparePaths, parseBigIntValue, parseUintValue, MAX_UINT32_DIGITS, getSelectedMailbox, emitSafe, isAuthenticatedState, reportCommandError, logConnectionError } from '../tools.js';
|
|
2
|
+
import { createImapError } from '../errors.js';
|
|
2
3
|
/**
|
|
3
4
|
* Appends a message to a mailbox.
|
|
4
5
|
*
|
|
@@ -15,14 +16,24 @@ export default async function append(connection, destination, content, flags, id
|
|
|
15
16
|
// nothing to do here
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
19
|
+
// The literal size marker is announced from these bytes, so anything that is not
|
|
20
|
+
// bytes (a Readable, a plain object) is refused here instead of desyncing the session
|
|
21
|
+
let message;
|
|
18
22
|
if (typeof content === 'string') {
|
|
19
|
-
|
|
23
|
+
message = Buffer.from(content);
|
|
24
|
+
}
|
|
25
|
+
else if (content instanceof Uint8Array) {
|
|
26
|
+
// a Buffer as is, any other Uint8Array as a view over the same memory, not a copy
|
|
27
|
+
message = Buffer.isBuffer(content) ? content : Buffer.from(content.buffer, content.byteOffset, content.byteLength);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
throw createImapError('Message content must be a Buffer, Uint8Array or string', 'InvalidMessageContent');
|
|
20
31
|
}
|
|
21
32
|
// APPENDLIMIT capability (RFC 7889): server may advertise the maximum message
|
|
22
33
|
// size it accepts. Check before sending to avoid a wasted round-trip.
|
|
23
34
|
if (connection.capabilities.has('APPENDLIMIT')) {
|
|
24
35
|
let appendLimit = connection.capabilities.get('APPENDLIMIT');
|
|
25
|
-
if (typeof appendLimit === 'number' && appendLimit <
|
|
36
|
+
if (typeof appendLimit === 'number' && appendLimit < message.length) {
|
|
26
37
|
let err = new Error('Message content too big for APPENDLIMIT=' + appendLimit);
|
|
27
38
|
err.serverResponseCode = 'APPENDLIMIT';
|
|
28
39
|
throw err;
|
|
@@ -79,9 +90,9 @@ export default async function append(connection, destination, content, flags, id
|
|
|
79
90
|
// Regular literals cannot contain NUL bytes per the IMAP grammar.
|
|
80
91
|
let isLiteral8 = false;
|
|
81
92
|
if (connection.capabilities.has('BINARY') && !connection.disableBinary) {
|
|
82
|
-
isLiteral8 =
|
|
93
|
+
isLiteral8 = message.indexOf(0) >= 0;
|
|
83
94
|
}
|
|
84
|
-
attributes.push({ type: 'LITERAL', value:
|
|
95
|
+
attributes.push({ type: 'LITERAL', value: message, isLiteral8 });
|
|
85
96
|
let map = { destination };
|
|
86
97
|
if (connection.mailbox && connection.mailbox.path) {
|
|
87
98
|
map.path = connection.mailbox.path;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createImapError } from '../errors.js';
|
|
1
2
|
/**
|
|
2
3
|
* Requests DEFLATE compression from the server.
|
|
3
4
|
*
|
|
@@ -33,8 +34,7 @@ export default async function compress(connection) {
|
|
|
33
34
|
// back its unconsumed tail on unpipe so the transport can feed it into the
|
|
34
35
|
// inflater - not something a command module can reach from here.
|
|
35
36
|
if (response.hasTrailingData) {
|
|
36
|
-
let error =
|
|
37
|
-
error.code = 'COMPRESS_TRAILING_DATA';
|
|
37
|
+
let error = createImapError('Server sent data between the COMPRESS response and the compression layer switch', 'COMPRESS_TRAILING_DATA');
|
|
38
38
|
connection.log.error({ err: error, cid: connection.id });
|
|
39
39
|
// Schedule the close before releasing parser backpressure, so the buffered
|
|
40
40
|
// deflate-framed bytes cannot settle anything before teardown begins. This is
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatDateTime, isUnsafeKey } from '../tools.js';
|
|
1
|
+
import { formatDateTime, isUnsafeKey, getStringValue } from '../tools.js';
|
|
2
2
|
/**
|
|
3
3
|
* Sends ID info to the server and updates server info data based on the response.
|
|
4
4
|
*
|
|
@@ -36,17 +36,19 @@ export default async function id(connection, clientInfo) {
|
|
|
36
36
|
let params = untagged.attributes && untagged.attributes[0];
|
|
37
37
|
let key;
|
|
38
38
|
(Array.isArray(params) ? params : [].concat(params || [])).forEach((val, i) => {
|
|
39
|
+
// keys are strings and values nstrings, either may come as a literal
|
|
40
|
+
let value = getStringValue(val);
|
|
39
41
|
if (i % 2 === 0) {
|
|
40
|
-
key =
|
|
42
|
+
key = value;
|
|
41
43
|
}
|
|
42
|
-
else if (
|
|
44
|
+
else if (key !== undefined && value !== undefined) {
|
|
43
45
|
// The server picks the keys of this object, which the caller reads
|
|
44
46
|
// back as serverInfo: a prototype-chain name is skipped as it is for
|
|
45
47
|
// every other server-named key, so it can neither be shadowed nor
|
|
46
48
|
// written through
|
|
47
49
|
let name = key.toLowerCase().trim();
|
|
48
50
|
if (!isUnsafeKey(name)) {
|
|
49
|
-
map[name] =
|
|
51
|
+
map[name] = value;
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { guardedPromise, hasCapability, isServerRefusal, logConnectionError, restampConnectionError, unrefTimer, clearTimer, getSelectedMailbox } from '../tools.js';
|
|
2
|
+
import { createImapError } from '../errors.js';
|
|
2
3
|
const NOOP_INTERVAL = 2 * 60 * 1000;
|
|
3
4
|
/**
|
|
4
5
|
* Marks the connection as idling on behalf of one session and returns a release function.
|
|
@@ -124,14 +125,15 @@ async function runIdle(connection) {
|
|
|
124
125
|
}
|
|
125
126
|
catch (err) {
|
|
126
127
|
logConnectionError(connection, 'IDLE session failed', err);
|
|
127
|
-
// A tagged NO or BAD only means the server
|
|
128
|
-
// so the waiters are released by the finally block below and their own commands
|
|
129
|
-
// Anything else (close, lost socket, parser failure) fails the waiters too.
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
// A tagged NO or BAD only means the server did not run IDLE; the connection is still
|
|
129
|
+
// usable, so the waiters are released by the finally block below and their own commands
|
|
130
|
+
// run. Anything else (close, lost socket, parser failure) fails the waiters too. Only a
|
|
131
|
+
// refusal turns IDLE off for the session, a throttled IDLE is tried again later.
|
|
132
|
+
let answeredByServer = err.responseStatus === 'NO' || err.responseStatus === 'BAD';
|
|
133
|
+
if (isServerRefusal(err)) {
|
|
132
134
|
connection.skipIdle = true;
|
|
133
135
|
}
|
|
134
|
-
if (preCheckWaitQueue.length && !
|
|
136
|
+
if (preCheckWaitQueue.length && !answeredByServer) {
|
|
135
137
|
// One error for the whole queue: every waiter failed at the same site, for the same
|
|
136
138
|
// reason. Built inside the guard so a teardown with nothing queued - the common case -
|
|
137
139
|
// does not pay for an Error and its stack capture.
|
|
@@ -188,9 +190,7 @@ async function pollOnce(connection, session) {
|
|
|
188
190
|
highestModseq: true
|
|
189
191
|
});
|
|
190
192
|
if (!status) {
|
|
191
|
-
|
|
192
|
-
err.code = 'PollFailed';
|
|
193
|
-
throw err;
|
|
193
|
+
throw createImapError('STATUS poll failed', 'PollFailed');
|
|
194
194
|
}
|
|
195
195
|
break;
|
|
196
196
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { decodePath, encodePath, normalizePath, enhanceCommandError, hasCapability, isRev2Active, buildStatusQueryAttributes, getStringList } from '../tools.js';
|
|
1
|
+
import { decodePath, encodePath, normalizePath, enhanceCommandError, hasCapability, isRev2Active, buildStatusQueryAttributes, getStringList, getStringValue } from '../tools.js';
|
|
2
2
|
import { parseStatusList } from './status-fields.js';
|
|
3
3
|
import { specialUse } from '../special-use.js';
|
|
4
4
|
/**
|
|
@@ -155,7 +155,7 @@ export default async function list(connection, reference, mailbox, options) {
|
|
|
155
155
|
path: normalizePath(connection, decodePath(connection, rawPath)),
|
|
156
156
|
pathAsListed: rawPath,
|
|
157
157
|
flags: new Set(getStringList(untagged.attributes[0])),
|
|
158
|
-
delimiter: (untagged.attributes[1]
|
|
158
|
+
delimiter: getStringValue(untagged.attributes[1]),
|
|
159
159
|
listed: true
|
|
160
160
|
};
|
|
161
161
|
normalizeFlags(entry);
|
|
@@ -396,7 +396,7 @@ export default async function list(connection, reference, mailbox, options) {
|
|
|
396
396
|
path: normalizePath(connection, decodePath(connection, rawPath)),
|
|
397
397
|
pathAsListed: rawPath,
|
|
398
398
|
flags: new Set(getStringList(untagged.attributes[0])),
|
|
399
|
-
delimiter: (untagged.attributes[1]
|
|
399
|
+
delimiter: getStringValue(untagged.attributes[1]),
|
|
400
400
|
subscribed: true
|
|
401
401
|
};
|
|
402
402
|
if (entry.path.toUpperCase() === 'INBOX') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasCapability, getStringList, isAuthenticatedState } from '../tools.js';
|
|
1
|
+
import { hasCapability, getStringList, getStringValue, isAuthenticatedState } from '../tools.js';
|
|
2
2
|
/**
|
|
3
3
|
* Requests NAMESPACE info from the server.
|
|
4
4
|
*
|
|
@@ -91,8 +91,9 @@ async function getListPrefix(connection) {
|
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
map.flags = new Set(getStringList(untagged.attributes[0]));
|
|
94
|
-
|
|
95
|
-
map.
|
|
94
|
+
// the name may be a literal, which arrives as a Buffer
|
|
95
|
+
map.delimiter = getStringValue(untagged.attributes[1]) || null;
|
|
96
|
+
map.prefix = getStringValue(untagged.attributes[2]) || '';
|
|
96
97
|
if (map.delimiter && map.prefix.charAt(0) === map.delimiter) {
|
|
97
98
|
map.prefix = map.prefix.slice(1);
|
|
98
99
|
}
|
|
@@ -117,22 +118,25 @@ function getNamsepaceInfo(attribute) {
|
|
|
117
118
|
if (!attribute || !Array.isArray(attribute) || !attribute.length) {
|
|
118
119
|
return false;
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return pair.length >= 2 && pair[0] && typeof pair[0].value === 'string' && (pair[1] === null || (pair[1] && typeof pair[1].value === 'string'));
|
|
126
|
-
})
|
|
127
|
-
.map(entry => {
|
|
121
|
+
let entries = [];
|
|
122
|
+
for (let entry of attribute) {
|
|
123
|
+
if (!Array.isArray(entry)) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
128
126
|
let pair = entry;
|
|
129
|
-
let prefix = pair[0]
|
|
130
|
-
|
|
127
|
+
let prefix = getStringValue(pair[0]);
|
|
128
|
+
// RFC 2342 section 5 allows the delimiter to be NIL when the namespace has no hierarchy.
|
|
129
|
+
// The token parser emits a literal `null` for NIL.
|
|
130
|
+
let delimiter = pair[1] === null ? null : getStringValue(pair[1]);
|
|
131
|
+
if (pair.length < 2 || prefix === undefined || delimiter === undefined) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
131
134
|
// Append the delimiter to the prefix if it doesn't already end with one,
|
|
132
135
|
// so callers can construct full paths by simply concatenating prefix + name.
|
|
133
136
|
if (delimiter && prefix && prefix.charAt(prefix.length - 1) !== delimiter) {
|
|
134
137
|
prefix += delimiter;
|
|
135
138
|
}
|
|
136
|
-
|
|
137
|
-
}
|
|
139
|
+
entries.push({ prefix, delimiter });
|
|
140
|
+
}
|
|
141
|
+
return entries;
|
|
138
142
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { encodePath, normalizePath, parseUintValue, isUnsafeKey, isAuthenticatedState, reportCommandError } from '../tools.js';
|
|
1
|
+
import { encodePath, normalizePath, parseUintValue, isUnsafeKey, isAuthenticatedState, reportCommandError, getStringValue } from '../tools.js';
|
|
2
2
|
/**
|
|
3
3
|
* Requests quota information for a mailbox.
|
|
4
4
|
*
|
|
@@ -79,9 +79,8 @@ export default async function quota(connection, path) {
|
|
|
79
79
|
// QUOTAROOT response tells us which quota root applies to this mailbox.
|
|
80
80
|
// A mailbox may have zero or one quota root.
|
|
81
81
|
QUOTAROOT: async (untagged) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
: false;
|
|
82
|
+
// the root name is an astring, which may come as a literal
|
|
83
|
+
let quotaRoot = getStringValue(untagged.attributes && untagged.attributes[1]);
|
|
85
84
|
if (quotaRoot) {
|
|
86
85
|
map.quotaRoot = quotaRoot;
|
|
87
86
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { encodePath, normalizePath, buildStatusQueryAttributes, isRev2Active, isAuthenticatedState, emitSafe, getSelectedMailbox, logConnectionError } from '../tools.js';
|
|
2
2
|
import { parseStatusList } from './status-fields.js';
|
|
3
|
+
import { createImapError } from '../errors.js';
|
|
3
4
|
// STATUS fields that also refresh the live mailbox state when the queried mailbox is the
|
|
4
5
|
// currently selected one. Keyed by the output property name parseStatusList() reports.
|
|
5
6
|
const MAILBOX_UPDATERS = {
|
|
@@ -96,10 +97,7 @@ export default async function status(connection, path, query) {
|
|
|
96
97
|
return false;
|
|
97
98
|
});
|
|
98
99
|
if (folders && !folders.length) {
|
|
99
|
-
|
|
100
|
-
error.code = 'NotFound';
|
|
101
|
-
error.response = err;
|
|
102
|
-
throw error;
|
|
100
|
+
throw createImapError(`Mailbox doesn't exist: ${path}`, 'NotFound', { response: err });
|
|
103
101
|
}
|
|
104
102
|
}
|
|
105
103
|
connection.log.warn({ err, cid: connection.id });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { clearTimer } from './tools.js';
|
|
2
|
+
import { createImapError } from './errors.js';
|
|
2
3
|
// Default upper bound for establishing a usable transport, including DNS and proxy negotiation.
|
|
3
4
|
export const CONNECT_TIMEOUT = 90 * 1000;
|
|
4
5
|
/**
|
|
@@ -28,10 +29,7 @@ export class ConnectionDeadline {
|
|
|
28
29
|
* @returns The shared `CONNECT_TIMEOUT` error.
|
|
29
30
|
*/
|
|
30
31
|
error() {
|
|
31
|
-
|
|
32
|
-
err.code = 'CONNECT_TIMEOUT';
|
|
33
|
-
err.details = { connectionTimeout: this.timeout };
|
|
34
|
-
return err;
|
|
32
|
+
return createImapError('Failed to establish connection in required time', 'CONNECT_TIMEOUT', { details: { connectionTimeout: this.timeout } });
|
|
35
33
|
}
|
|
36
34
|
/**
|
|
37
35
|
* Maps a dependency's own expiry onto the shared `CONNECT_TIMEOUT` shape, so callers see one
|
|
@@ -11,6 +11,7 @@ import { LimitedPassthrough, normalizeByteLimit } from './limited-passthrough.js
|
|
|
11
11
|
// What a wait on the head stream listens for: it can take more input, it failed, or it went
|
|
12
12
|
// away (a consumer destroying it closes it without a 'drain')
|
|
13
13
|
const DRAIN_WAIT_EVENTS = ['drain', 'error', 'close'];
|
|
14
|
+
import { createImapError } from './errors.js';
|
|
14
15
|
import { getDecoder, isUnsafeKey } from './tools.js';
|
|
15
16
|
const isEmptySection = (value) => !value?.length;
|
|
16
17
|
/**
|
|
@@ -33,8 +34,9 @@ const partialStarts = (requests) => {
|
|
|
33
34
|
}
|
|
34
35
|
return starts;
|
|
35
36
|
};
|
|
36
|
-
//
|
|
37
|
-
|
|
37
|
+
// Attempts per request when the answer belongs to another request or, for a message known to
|
|
38
|
+
// exist, is empty
|
|
39
|
+
const MAX_FETCH_ATTEMPTS = 3;
|
|
38
40
|
const requestedUid = (range, options) => options.uid && /^\d+$/.test(String(range)) ? Number(range) : undefined;
|
|
39
41
|
const isForeignAnswer = (response, expected) => {
|
|
40
42
|
if (expected.uid && response.uid && response.uid !== expected.uid) {
|
|
@@ -56,11 +58,19 @@ const isForeignAnswer = (response, expected) => {
|
|
|
56
58
|
* within the answer to the next one. Taken at face value it would be the data of that next
|
|
57
59
|
* request, and a download would end without an error but with misplaced bytes. An answer for
|
|
58
60
|
* another UID, or with a partial section that starts at another offset than asked, is dropped
|
|
59
|
-
* and the request repeated.
|
|
61
|
+
* and the request repeated. An empty answer is repeated too while `expected.retryEmpty()` says
|
|
62
|
+
* the message exists, as the data of a late answer arrives with the repeated request.
|
|
60
63
|
*/
|
|
61
64
|
async function fetchExpected(client, range, query, options, expected) {
|
|
62
65
|
for (let attempt = 1;; attempt++) {
|
|
63
66
|
let response = await client.fetchOne(range, query, options);
|
|
67
|
+
if (response === false && expected.retryEmpty && expected.retryEmpty() && attempt < MAX_FETCH_ATTEMPTS) {
|
|
68
|
+
// The answer may come late instead (after the tagged OK, with the next answer), then
|
|
69
|
+
// it shows up in the answer to the repeated request. A message that is really gone
|
|
70
|
+
// answers empty every time, and the caller reports it.
|
|
71
|
+
client.log.warn({ msg: 'Server answered a request for an existing message with no data, asking again', attempt, cid: client.id });
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
64
74
|
if (!response || !isForeignAnswer(response, expected)) {
|
|
65
75
|
return response;
|
|
66
76
|
}
|
|
@@ -71,11 +81,8 @@ async function fetchExpected(client, range, query, options, expected) {
|
|
|
71
81
|
attempt,
|
|
72
82
|
cid: client.id
|
|
73
83
|
});
|
|
74
|
-
if (attempt >=
|
|
75
|
-
|
|
76
|
-
err.code = 'DownloadIncomplete';
|
|
77
|
-
err.cid = client.id;
|
|
78
|
-
throw err;
|
|
84
|
+
if (attempt >= MAX_FETCH_ATTEMPTS) {
|
|
85
|
+
throw createImapError('Server kept answering with data of another request', 'DownloadIncomplete', { cid: client.id });
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
}
|
|
@@ -101,7 +108,8 @@ async function refetchDroppedSections(client, response, range, options, sections
|
|
|
101
108
|
let uid = response.uid;
|
|
102
109
|
let retry = await fetchExpected(client, uid || range, { uid: true, bodyParts: sections }, uid ? { ...options, uid: true } : options, {
|
|
103
110
|
uid,
|
|
104
|
-
origins: partialStarts(sections)
|
|
111
|
+
origins: partialStarts(sections),
|
|
112
|
+
retryEmpty: () => true
|
|
105
113
|
});
|
|
106
114
|
if (!retry) {
|
|
107
115
|
return;
|
|
@@ -147,7 +155,13 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
147
155
|
// Special handling for part "1": in single-node emails (no childNodes),
|
|
148
156
|
// the body is accessed via "TEXT" rather than "1", and headers via
|
|
149
157
|
// "HEADER" instead of "1.MIME". Check bodyStructure to detect this.
|
|
150
|
-
let
|
|
158
|
+
let expectedUid = requestedUid(range, downloadOptions);
|
|
159
|
+
let response = await fetchExpected(client, range, { uid: true, bodyStructure: true }, downloadOptions, {
|
|
160
|
+
uid: expectedUid,
|
|
161
|
+
origins: new Map(),
|
|
162
|
+
// a message addressed by UID is taken to exist, see getNextPart() below
|
|
163
|
+
retryEmpty: expectedUid ? () => true : undefined
|
|
164
|
+
});
|
|
151
165
|
if (!response) {
|
|
152
166
|
return {};
|
|
153
167
|
}
|
|
@@ -163,6 +177,14 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
163
177
|
part = 'TEXT';
|
|
164
178
|
}
|
|
165
179
|
}
|
|
180
|
+
// The decoder pipeline, built once the head chunk told what the part is (see below)
|
|
181
|
+
let stream;
|
|
182
|
+
let output;
|
|
183
|
+
let fetchAborted = false;
|
|
184
|
+
// A consumer that gave up: its 'close' may still be a tick away from setting fetchAborted,
|
|
185
|
+
// so the stream's own flag is checked as well
|
|
186
|
+
// `output` is unset until the head chunk is in, and the head chunk's retry asks already
|
|
187
|
+
let downloadAborted = () => fetchAborted || !!output?.destroyed;
|
|
166
188
|
let getNextPart = async (query) => {
|
|
167
189
|
query = query || {};
|
|
168
190
|
let mimeKey;
|
|
@@ -196,12 +218,23 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
196
218
|
};
|
|
197
219
|
query.bodyParts.push(contentRequest);
|
|
198
220
|
}
|
|
221
|
+
let expectedUid = uid || requestedUid(range, downloadOptions);
|
|
199
222
|
let expected = {
|
|
200
|
-
uid:
|
|
201
|
-
origins: new Map([[part || '', processed]])
|
|
223
|
+
uid: expectedUid,
|
|
224
|
+
origins: new Map([[part || '', processed]]),
|
|
225
|
+
// Every chunk after the first is of a message that was there a moment ago, and a
|
|
226
|
+
// message the caller addresses by UID is taken to exist: an empty answer may be a
|
|
227
|
+
// late one (Apache James), a message that is really gone costs two more requests
|
|
228
|
+
retryEmpty: processed > 0 || expectedUid ? () => !downloadAborted() : undefined
|
|
202
229
|
};
|
|
203
230
|
let response = await fetchExpected(client, range, query, downloadOptions, expected);
|
|
204
231
|
if (!response) {
|
|
232
|
+
// An empty answer also comes from a connection that closed while the consumer was
|
|
233
|
+
// paused between chunks (fetchOne() finds no mailbox then), and that is not a
|
|
234
|
+
// missing message: a caller that retries would skip it
|
|
235
|
+
if (!client.usable) {
|
|
236
|
+
throw client.createNoConnectionError(false, { rejectedFrom: 'download' });
|
|
237
|
+
}
|
|
205
238
|
return { response: false, chunk: false };
|
|
206
239
|
}
|
|
207
240
|
if (!uid && response.uid) {
|
|
@@ -309,9 +342,6 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
309
342
|
meta.filename = filename;
|
|
310
343
|
}
|
|
311
344
|
}
|
|
312
|
-
let stream;
|
|
313
|
-
let output;
|
|
314
|
-
let fetchAborted = false;
|
|
315
345
|
// Build a decoder pipeline that progressively transforms the raw FETCH data:
|
|
316
346
|
// 1. Transfer-encoding decoder (base64 or quoted-printable -> binary)
|
|
317
347
|
// 2. Format decoder (format=flowed -> plain text, if applicable)
|
|
@@ -341,13 +371,19 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
341
371
|
// would still pull the entire part off the wire.
|
|
342
372
|
let limiters = [];
|
|
343
373
|
let isLimited = () => limiters.some(entry => entry.limited);
|
|
374
|
+
// Every stage after the head, so a download that ends early can release all of them
|
|
375
|
+
let stages = [];
|
|
344
376
|
// Appending a stage means forwarding the current tail's errors to it before piping, so a
|
|
345
|
-
// failure anywhere reaches the stream the caller is reading
|
|
377
|
+
// failure anywhere reaches the stream the caller is reading. The stage is destroyed with
|
|
378
|
+
// the error rather than only emitting it: pipe() does not end its destination on a source
|
|
379
|
+
// error, so a consumer that only listens for 'finish' or 'close' (a plain .pipe() into a
|
|
380
|
+
// file) would otherwise wait forever.
|
|
346
381
|
let pipeStage = (stage) => {
|
|
347
382
|
output.on('error', err => {
|
|
348
|
-
stage.
|
|
383
|
+
stage.destroy(err);
|
|
349
384
|
});
|
|
350
385
|
output = output.pipe(stage);
|
|
386
|
+
stages.push(stage);
|
|
351
387
|
return stage;
|
|
352
388
|
};
|
|
353
389
|
let isTextNode = ['text/html', 'text/plain', 'text/x-amp-html'].includes(meta.contentType) || (part === '1' && !meta.contentType);
|
|
@@ -392,8 +428,8 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
392
428
|
// Cleanup function
|
|
393
429
|
const cleanup = () => {
|
|
394
430
|
fetchAborted = true;
|
|
395
|
-
|
|
396
|
-
|
|
431
|
+
for (let entry of [stream, ...stages]) {
|
|
432
|
+
entry.destroy();
|
|
397
433
|
}
|
|
398
434
|
};
|
|
399
435
|
// Listen for stream destruction
|
|
@@ -466,26 +502,18 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
466
502
|
// Loud on purpose. Everything written downstream by this point holds
|
|
467
503
|
// duplicated content, and a quiet stop is indistinguishable from a clean EOF,
|
|
468
504
|
// so the consumer would store a corrupt body believing it intact.
|
|
469
|
-
|
|
470
|
-
err.code = 'DownloadOverflow';
|
|
471
|
-
err.maxSize = maxTotalBytes;
|
|
472
|
-
err.cid = client.id;
|
|
473
|
-
throw err;
|
|
505
|
+
throw createImapError('Download exceeded the expected message size', 'DownloadOverflow', { maxSize: maxTotalBytes, cid: client.id });
|
|
474
506
|
}
|
|
475
507
|
let { response, chunk } = await getNextPart();
|
|
476
|
-
// A consumer that gave up while the chunk was in flight
|
|
477
|
-
|
|
478
|
-
if (fetchAborted || output.destroyed) {
|
|
508
|
+
// A consumer that gave up while the chunk was in flight
|
|
509
|
+
if (downloadAborted()) {
|
|
479
510
|
break;
|
|
480
511
|
}
|
|
481
512
|
if (response === false) {
|
|
482
513
|
// The message is gone mid-download (expunged by another client, or the
|
|
483
514
|
// mailbox was closed). Ending the stream here would pass the truncated body
|
|
484
515
|
// off as complete, so the consumer is told the same way as for an overflow.
|
|
485
|
-
|
|
486
|
-
err.code = 'DownloadIncomplete';
|
|
487
|
-
err.cid = client.id;
|
|
488
|
-
throw err;
|
|
516
|
+
throw createImapError('Message disappeared before the download completed', 'DownloadIncomplete', { cid: client.id });
|
|
489
517
|
}
|
|
490
518
|
if (!chunk) {
|
|
491
519
|
break;
|
|
@@ -515,7 +543,7 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
515
543
|
fetchAllParts(head)
|
|
516
544
|
.catch(err => {
|
|
517
545
|
if (!fetchAborted && stream && !stream.destroyed) {
|
|
518
|
-
stream.
|
|
546
|
+
stream.destroy(err);
|
|
519
547
|
/* c8 ignore start */ // the else logs when a fetch error arrives after the stream was already torn down (timing-dependent)
|
|
520
548
|
}
|
|
521
549
|
else {
|
|
@@ -540,7 +568,7 @@ export async function downloadMessage(client, range, part, options) {
|
|
|
540
568
|
// above rejects a promise nobody holds and takes the process down on
|
|
541
569
|
// unhandledRejection. Reaching it always means an invariant broke - the head
|
|
542
570
|
// stream kept pipeStage()'s error forwarder for the life of the download, so
|
|
543
|
-
//
|
|
571
|
+
// destroy(err) above has somewhere to go - which is why it logs at error even
|
|
544
572
|
// for a routine-looking connection code.
|
|
545
573
|
.catch(err => client.log.error({ msg: 'Failed to fail the download stream', err, cid: client.id }));
|
|
546
574
|
};
|
|
@@ -579,9 +607,12 @@ export async function downloadMessageParts(client, range, parts, options) {
|
|
|
579
607
|
contentRequests.set(part, contentRequest);
|
|
580
608
|
query.bodyParts.push(contentRequest);
|
|
581
609
|
}
|
|
610
|
+
let expectedUid = requestedUid(range, downloadOptions);
|
|
582
611
|
let response = await fetchExpected(client, range, query, downloadOptions, {
|
|
583
|
-
uid:
|
|
584
|
-
origins: partialStarts(query.bodyParts)
|
|
612
|
+
uid: expectedUid,
|
|
613
|
+
origins: partialStarts(query.bodyParts),
|
|
614
|
+
// a message addressed by UID is taken to exist, as for download()
|
|
615
|
+
retryEmpty: expectedUid ? () => true : undefined
|
|
585
616
|
});
|
|
586
617
|
if (!response || !response.bodyParts) {
|
|
587
618
|
return {};
|
|
@@ -29,6 +29,7 @@ export declare const ImapFlowErrorCode: {
|
|
|
29
29
|
readonly MissingServerExtension: "MissingServerExtension";
|
|
30
30
|
readonly ParserError: "ParserError";
|
|
31
31
|
readonly ParserErrorExchange: "ParserErrorExchange";
|
|
32
|
+
readonly ParserErrorInternal: "ParserErrorInternal";
|
|
32
33
|
readonly MAX_IMAP_NESTING_REACHED: "MAX_IMAP_NESTING_REACHED";
|
|
33
34
|
readonly LineTooLarge: "LineTooLarge";
|
|
34
35
|
readonly LiteralTooLarge: "LiteralTooLarge";
|
|
@@ -38,6 +39,7 @@ export declare const ImapFlowErrorCode: {
|
|
|
38
39
|
readonly InvalidTextValue: "InvalidTextValue";
|
|
39
40
|
readonly InvalidSequenceSet: "InvalidSequenceSet";
|
|
40
41
|
readonly InvalidSearchQuery: "InvalidSearchQuery";
|
|
42
|
+
readonly InvalidMessageContent: "InvalidMessageContent";
|
|
41
43
|
readonly DownloadOverflow: "DownloadOverflow";
|
|
42
44
|
readonly DownloadIncomplete: "DownloadIncomplete";
|
|
43
45
|
readonly ProxyError: "ProxyError";
|
|
@@ -48,6 +50,8 @@ export declare const ImapFlowErrorCode: {
|
|
|
48
50
|
};
|
|
49
51
|
/** One of the {@link ImapFlowErrorCode} values */
|
|
50
52
|
export type ImapFlowErrorCode = (typeof ImapFlowErrorCode)[keyof typeof ImapFlowErrorCode];
|
|
53
|
+
/** A numbered parser error code, `ParserError1` and up */
|
|
54
|
+
export type ParserErrorCode = `ParserError${number}`;
|
|
51
55
|
/**
|
|
52
56
|
* An Error raised by ImapFlow, with the extra properties the library attaches to describe
|
|
53
57
|
* the failure. Every property is optional: which ones are present depends on where the
|
|
@@ -132,3 +136,14 @@ export declare class AuthenticationFailure extends Error implements ImapFlowErro
|
|
|
132
136
|
response?: string | undefined;
|
|
133
137
|
oauthError?: any;
|
|
134
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Creates an {@link ImapFlowError} with a code and optional extra properties. The code is
|
|
141
|
+
* checked by the compiler against {@link ImapFlowErrorCode}, so a typo or an undeclared
|
|
142
|
+
* code fails the build instead of reaching consumers.
|
|
143
|
+
*
|
|
144
|
+
* @param message - The error message
|
|
145
|
+
* @param code - The error code
|
|
146
|
+
* @param props - Extra properties to set on the error
|
|
147
|
+
* @returns The error, ready to throw or reject with
|
|
148
|
+
*/
|
|
149
|
+
export declare function createImapError(message: string, code: ImapFlowErrorCode | ParserErrorCode, props?: Omit<ImapFlowError, 'name' | 'message' | 'stack' | 'code'> | undefined): ImapFlowError;
|
|
@@ -32,6 +32,8 @@ export const ImapFlowErrorCode = {
|
|
|
32
32
|
// response parsing and size limits
|
|
33
33
|
ParserError: 'ParserError',
|
|
34
34
|
ParserErrorExchange: 'ParserErrorExchange',
|
|
35
|
+
// an unexpected exception inside the parser, re-raised with a code; a parser bug
|
|
36
|
+
ParserErrorInternal: 'ParserErrorInternal',
|
|
35
37
|
MAX_IMAP_NESTING_REACHED: 'MAX_IMAP_NESTING_REACHED',
|
|
36
38
|
LineTooLarge: 'LineTooLarge',
|
|
37
39
|
LiteralTooLarge: 'LiteralTooLarge',
|
|
@@ -42,6 +44,7 @@ export const ImapFlowErrorCode = {
|
|
|
42
44
|
InvalidTextValue: 'InvalidTextValue',
|
|
43
45
|
InvalidSequenceSet: 'InvalidSequenceSet',
|
|
44
46
|
InvalidSearchQuery: 'InvalidSearchQuery',
|
|
47
|
+
InvalidMessageContent: 'InvalidMessageContent',
|
|
45
48
|
// download()
|
|
46
49
|
DownloadOverflow: 'DownloadOverflow',
|
|
47
50
|
DownloadIncomplete: 'DownloadIncomplete',
|
|
@@ -62,3 +65,21 @@ export class AuthenticationFailure extends Error {
|
|
|
62
65
|
this.authenticationFailed = true;
|
|
63
66
|
}
|
|
64
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates an {@link ImapFlowError} with a code and optional extra properties. The code is
|
|
70
|
+
* checked by the compiler against {@link ImapFlowErrorCode}, so a typo or an undeclared
|
|
71
|
+
* code fails the build instead of reaching consumers.
|
|
72
|
+
*
|
|
73
|
+
* @param message - The error message
|
|
74
|
+
* @param code - The error code
|
|
75
|
+
* @param props - Extra properties to set on the error
|
|
76
|
+
* @returns The error, ready to throw or reject with
|
|
77
|
+
*/
|
|
78
|
+
export function createImapError(message, code, props) {
|
|
79
|
+
const error = new Error(message);
|
|
80
|
+
error.code = code;
|
|
81
|
+
if (props) {
|
|
82
|
+
Object.assign(error, props);
|
|
83
|
+
}
|
|
84
|
+
return error;
|
|
85
|
+
}
|
|
@@ -12,13 +12,13 @@ import type { CompilerOptions, ImapCompileInput } from './types.js';
|
|
|
12
12
|
* @param options.isLogging - If true, redacts sensitive values and truncates long strings/literals for logging purposes.
|
|
13
13
|
* @param options.literalPlus - If true, uses the LITERAL+ extension (appends "+" to literal length markers).
|
|
14
14
|
* @param options.literalMinus - If true, uses the LITERAL- extension for literals up to 4096 bytes.
|
|
15
|
-
* @returns
|
|
15
|
+
* @returns An array of Buffers (if asArray is true) or a single concatenated Buffer.
|
|
16
16
|
*/
|
|
17
17
|
declare function compiler(response: ImapCompileInput, options: CompilerOptions & {
|
|
18
18
|
asArray: true;
|
|
19
|
-
}):
|
|
19
|
+
}): Buffer[];
|
|
20
20
|
declare function compiler(response: ImapCompileInput, options?: (CompilerOptions & {
|
|
21
21
|
asArray?: false | undefined;
|
|
22
|
-
}) | undefined):
|
|
23
|
-
declare function compiler(response: ImapCompileInput, options?: CompilerOptions | undefined):
|
|
22
|
+
}) | undefined): Buffer;
|
|
23
|
+
declare function compiler(response: ImapCompileInput, options?: CompilerOptions | undefined): Buffer | Buffer[];
|
|
24
24
|
export default compiler;
|