proton-mail-bridge-client 2.0.0 → 2.0.1

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/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  [![npm version](https://img.shields.io/npm/v/proton-mail-bridge-client?color=%236d4aff&label=npm)](https://www.npmjs.com/package/proton-mail-bridge-client)
13
13
  [![CI](https://github.com/googlarz/proton-mail-bridge-client/actions/workflows/ci.yml/badge.svg)](https://github.com/googlarz/proton-mail-bridge-client/actions/workflows/ci.yml)
14
14
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
15
- [![Node.js 18+](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
15
+ [![Node.js 20+](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](https://nodejs.org)
16
16
  [![TypeScript](https://img.shields.io/badge/TypeScript-5-3178c6?logo=typescript&logoColor=white)](https://www.typescriptlang.org)
17
17
  [![MCP](https://img.shields.io/badge/MCP-compatible-blueviolet)](https://modelcontextprotocol.io)
18
18
  [![GitHub stars](https://img.shields.io/github/stars/googlarz/proton-mail-bridge-client?style=social)](https://github.com/googlarz/proton-mail-bridge-client)
@@ -55,7 +55,7 @@ Download: [proton.me/mail/bridge](https://proton.me/mail/bridge)
55
55
 
56
56
  > **Bridge password vs Proton password:** Proton Bridge generates a separate local password that is *not* your Proton account password. Find it inside the Bridge app under **Account → Copy password** (or similar — exact label varies by Bridge version). You'll need this for setup.
57
57
 
58
- **2. Node.js 18 or later** — `node --version` to check.
58
+ **2. Node.js 20 or later** — `node --version` to check.
59
59
 
60
60
  **3. Your Bridge credentials** — from the Bridge app:
61
61
  - IMAP host/port (default: `127.0.0.1:1143`)
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,EAA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4002,7 +4002,7 @@ export function createServer(config, options = {}) {
4002
4002
  return createTextResult(result);
4003
4003
  }
4004
4004
  case "bulk_move": {
4005
- ensureMailboxWriteAllowed(config.runtime);
4005
+ ensureEmailActionAllowed(config.runtime, "move");
4006
4006
  const emailIds = Array.isArray(args.emailIds)
4007
4007
  ? args.emailIds.map(String) : undefined;
4008
4008
  const match = args.match && typeof args.match === "object"
@@ -4230,7 +4230,7 @@ export function createServer(config, options = {}) {
4230
4230
  return createTextResult(await withAudit(auditService, name, args, async () => imapService.starEmail(requireString(args, "emailId"), normalizeBoolean(args.isStarred, true))));
4231
4231
  case "move_email":
4232
4232
  {
4233
- ensureMailboxWriteAllowed(config.runtime);
4233
+ ensureEmailActionAllowed(config.runtime, "move");
4234
4234
  const emailId = requireString(args, "emailId");
4235
4235
  const targetFolder = requireString(args, "targetFolder");
4236
4236
  const result = await withAudit(auditService, name, args, async () => {
@@ -4379,6 +4379,9 @@ export function createServer(config, options = {}) {
4379
4379
  }
4380
4380
  const action = requireEmailAction(args);
4381
4381
  ensureEmailActionAllowed(config.runtime, action);
4382
+ if (action === "delete") {
4383
+ ensureDestructiveConfirmed(config.runtime, normalizeBoolean(args.confirmed, false), `Permanently delete ${emailIds.length} email(s) (cannot be recovered)`);
4384
+ }
4382
4385
  const result = await withAudit(auditService, name, args, async () => applyBatchEmailAction(imapService, [], {
4383
4386
  emailIds,
4384
4387
  action,
@@ -4956,6 +4959,9 @@ export function createServer(config, options = {}) {
4956
4959
  const emailIds = [...new Set(thread.messages
4957
4960
  .filter((message) => !unreadOnly || !message.isRead)
4958
4961
  .map((message) => message.primaryEmailId))];
4962
+ if (action === "delete") {
4963
+ ensureDestructiveConfirmed(config.runtime, normalizeBoolean(args.confirmed, false), `Permanently delete ${emailIds.length} email(s) in thread (cannot be recovered)`);
4964
+ }
4959
4965
  const result = await withAudit(auditService, name, args, async () => applyBatchEmailAction(imapService, [], {
4960
4966
  emailIds,
4961
4967
  action,