proton-mail-bridge-client 2.8.1 → 2.8.3
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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -9
- package/dist/index.js.map +1 -1
- package/dist/utils/ical-reply.d.ts.map +1 -1
- package/dist/utils/ical-reply.js +19 -7
- package/dist/utils/ical-reply.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -723,6 +723,8 @@ See [CHANGELOG.md](CHANGELOG.md) for release history.
|
|
|
723
723
|
|
|
724
724
|
Bug reports and pull requests welcome: [github.com/googlarz/proton-mail-bridge-client/issues](https://github.com/googlarz/proton-mail-bridge-client/issues)
|
|
725
725
|
|
|
726
|
+
Testers wanted: some things (answering invitations from Outlook, Proton Calendar and Apple Calendar, Windows and Linux with a real Bridge, `brew install`) could not be verified by the maintainer. See [issue #32](https://github.com/googlarz/proton-mail-bridge-client/issues/32).
|
|
727
|
+
|
|
726
728
|
## License
|
|
727
729
|
|
|
728
730
|
MIT
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAuD,MAAM,mCAAmC,CAAC;AAC3H,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAA2H,iBAAiB,EAA+B,MAAM,mCAAmC,CAAC;AAC5N,OAAO,EAAmC,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,KAAK,EAMV,mBAAmB,EACnB,cAAc,EACd,WAAW,EAIX,WAAW,EAIX,gBAAgB,EAEhB,cAAc,EAGf,MAAM,kBAAkB,CA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,mBAAmB,CAQ3G;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,mBAAmB,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,EAAE,CAK/G;AAID,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,mBAAmB,CASpF;AAsQD,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,cAGC;CACF;AAED,wBAAgB,kBAAkB,IAAI,gBAAgB,CAkGrD;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE;IACP,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA63JP;AAOD,wBAAsB,eAAe,CACnC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,uBAAuB,GAAG,sBAAsB,GAAG,eAAe,GAAG,aAAa,GAAG,aAAa,GAAG,mBAAmB,CAAC,CAAC,EAC7J,SAAS,SAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,eAAO,MAAM,sBAAsB,QAGiG,CAAC;AAIrI,wBAAgB,wBAAwB,IAAI,MAAM,CAQjD;AAaD,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAyE1C"}
|
package/dist/index.js
CHANGED
|
@@ -712,6 +712,7 @@ const TOOLS = [
|
|
|
712
712
|
type: "string",
|
|
713
713
|
description: "Full mailbox path. In Proton Bridge, user folders live under 'Folders/' and labels under 'Labels/'.",
|
|
714
714
|
},
|
|
715
|
+
account: { type: "string", description: "Account address or slug to act on. A '<slug>::' prefix on the path (as get_folders shows it) does the same. Defaults to the primary account." },
|
|
715
716
|
},
|
|
716
717
|
required: ["path"],
|
|
717
718
|
},
|
|
@@ -725,6 +726,7 @@ const TOOLS = [
|
|
|
725
726
|
properties: {
|
|
726
727
|
path: { type: "string", description: "Existing folder path." },
|
|
727
728
|
newPath: { type: "string", description: "New folder path." },
|
|
729
|
+
account: { type: "string", description: "Account address or slug to act on. A '<slug>::' prefix on the path (as get_folders shows it) does the same. Defaults to the primary account." },
|
|
728
730
|
},
|
|
729
731
|
required: ["path", "newPath"],
|
|
730
732
|
},
|
|
@@ -737,6 +739,7 @@ const TOOLS = [
|
|
|
737
739
|
type: "object",
|
|
738
740
|
properties: {
|
|
739
741
|
path: { type: "string", description: "Folder path to delete." },
|
|
742
|
+
account: { type: "string", description: "Account address or slug to act on. A '<slug>::' prefix on the path (as get_folders shows it) does the same. Defaults to the primary account." },
|
|
740
743
|
confirmed: { type: "boolean", description: "Pass true to confirm permanent deletion of the folder and all its messages. Required when PROTONMAIL_CONFIRM_DESTRUCTIVE is enabled." },
|
|
741
744
|
},
|
|
742
745
|
required: ["path"],
|
|
@@ -1019,6 +1022,7 @@ const TOOLS = [
|
|
|
1019
1022
|
type: "object",
|
|
1020
1023
|
properties: {
|
|
1021
1024
|
folder: { type: "string", description: "Folder path to empty (e.g. 'Trash', 'Spam')." },
|
|
1025
|
+
account: { type: "string", description: "Account address or slug to act on. A '<slug>::' prefix on the path (as get_folders shows it) does the same. Defaults to the primary account." },
|
|
1022
1026
|
confirmed: { type: "boolean", description: "Must be true to execute. Call with confirmed:false first to see a preview of what would be deleted." },
|
|
1023
1027
|
},
|
|
1024
1028
|
required: ["folder"],
|
|
@@ -3862,6 +3866,24 @@ export function createServer(config, options = {}) {
|
|
|
3862
3866
|
}
|
|
3863
3867
|
return found;
|
|
3864
3868
|
}
|
|
3869
|
+
// The account a folder tool acts on, and its paths without the account prefix. A path may carry the "<slug>::"
|
|
3870
|
+
// prefix get_folders puts on non-primary folders, or the `account` argument names it; with neither it is the
|
|
3871
|
+
// primary account. Two different accounts in one call (a prefix against `account`, or two prefixes) are refused.
|
|
3872
|
+
function resolveFolderTarget(args, ...paths) {
|
|
3873
|
+
let bundle = resolveAccountArg(args);
|
|
3874
|
+
const rests = paths.map((path) => {
|
|
3875
|
+
const { accountSlug, rest } = splitAccountPrefix(path, accountManager.additionalSlugs());
|
|
3876
|
+
if (accountSlug) {
|
|
3877
|
+
const named = accountManager.bySlugOrPrimary(accountSlug);
|
|
3878
|
+
if (bundle && bundle !== named) {
|
|
3879
|
+
throw new McpError(ErrorCode.InvalidParams, "The folder paths and the account argument name different accounts.");
|
|
3880
|
+
}
|
|
3881
|
+
bundle = named;
|
|
3882
|
+
}
|
|
3883
|
+
return rest;
|
|
3884
|
+
});
|
|
3885
|
+
return { bundle: bundle ?? primaryBundle, paths: rests };
|
|
3886
|
+
}
|
|
3865
3887
|
// The accounts a triage or statistics tool covers: the one named by `account`, else all of them.
|
|
3866
3888
|
function selectedBundles(args) {
|
|
3867
3889
|
const one = resolveAccountArg(args);
|
|
@@ -5897,11 +5919,11 @@ export function createServer(config, options = {}) {
|
|
|
5897
5919
|
throw new McpError(ErrorCode.InvalidParams, "empty_folder is disabled. Set PROTONMAIL_ALLOW_EMPTY_FOLDER=true to enable.");
|
|
5898
5920
|
}
|
|
5899
5921
|
ensureEmailActionAllowed(config.runtime, "delete");
|
|
5900
|
-
const folder = requireString(args, "folder");
|
|
5922
|
+
const { bundle: emptyBundle, paths: [folder] } = resolveFolderTarget(args, requireString(args, "folder"));
|
|
5901
5923
|
const confirmed = normalizeBoolean(args.confirmed, false);
|
|
5902
5924
|
if (!confirmed) {
|
|
5903
5925
|
ensureDestructiveConfirmed(config.runtime, confirmed, "Delete all messages in folder " + folder);
|
|
5904
|
-
const stats = await imapService.getFolderStats(folder);
|
|
5926
|
+
const stats = await emptyBundle.imapService.getFolderStats(folder);
|
|
5905
5927
|
return createTextResult({
|
|
5906
5928
|
preview: true,
|
|
5907
5929
|
folder,
|
|
@@ -5910,7 +5932,7 @@ export function createServer(config, options = {}) {
|
|
|
5910
5932
|
});
|
|
5911
5933
|
}
|
|
5912
5934
|
ensureDestructiveConfirmed(config.runtime, confirmed, "Delete all messages in folder " + folder);
|
|
5913
|
-
const result = await withAudit(auditService, name, args, async () => imapService.emptyFolder(folder));
|
|
5935
|
+
const result = await withAudit(emptyBundle.auditService, name, args, async () => emptyBundle.imapService.emptyFolder(folder));
|
|
5914
5936
|
return createTextResult(result);
|
|
5915
5937
|
}
|
|
5916
5938
|
case "bulk_move": {
|
|
@@ -6346,16 +6368,22 @@ export function createServer(config, options = {}) {
|
|
|
6346
6368
|
}
|
|
6347
6369
|
case "sync_folders":
|
|
6348
6370
|
return createTextResult(await (resolveAccountArg(args) ?? primaryBundle).imapService.syncFolders());
|
|
6349
|
-
case "create_folder":
|
|
6371
|
+
case "create_folder": {
|
|
6350
6372
|
ensureMailboxWriteAllowed(config.runtime);
|
|
6351
|
-
|
|
6352
|
-
|
|
6373
|
+
const { bundle: folderBundle, paths: [folderPath] } = resolveFolderTarget(args, requireString(args, "path"));
|
|
6374
|
+
return createTextResult(await withAudit(folderBundle.auditService, name, args, async () => folderBundle.imapService.createFolder(folderPath)));
|
|
6375
|
+
}
|
|
6376
|
+
case "rename_folder": {
|
|
6353
6377
|
ensureMailboxWriteAllowed(config.runtime);
|
|
6354
|
-
|
|
6355
|
-
|
|
6378
|
+
const { bundle: folderBundle, paths: [fromPath, toPath] } = resolveFolderTarget(args, requireString(args, "path"), requireString(args, "newPath"));
|
|
6379
|
+
return createTextResult(await withAudit(folderBundle.auditService, name, args, async () => folderBundle.imapService.renameFolder(fromPath, toPath)));
|
|
6380
|
+
}
|
|
6381
|
+
case "delete_folder": {
|
|
6356
6382
|
ensureEmailActionAllowed(config.runtime, "delete");
|
|
6383
|
+
const { bundle: folderBundle, paths: [folderPath] } = resolveFolderTarget(args, requireString(args, "path"));
|
|
6357
6384
|
ensureDestructiveConfirmed(config.runtime, normalizeBoolean(args?.confirmed, false), "Permanently delete folder and all messages in it: " + requireString(args, "path"));
|
|
6358
|
-
return createTextResult(await withAudit(auditService, name, args, async () => imapService.deleteFolder(
|
|
6385
|
+
return createTextResult(await withAudit(folderBundle.auditService, name, args, async () => folderBundle.imapService.deleteFolder(folderPath)));
|
|
6386
|
+
}
|
|
6359
6387
|
case "mark_email_read": {
|
|
6360
6388
|
ensureEmailActionAllowed(config.runtime, normalizeBoolean(args.isRead, true) ? "mark_read" : "mark_unread");
|
|
6361
6389
|
const rawEmailId = requireString(args, "emailId");
|