@diskd-ai/email-client-mcp 0.1.20 → 0.1.21
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.
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* (e.g. a different mailbox-id scheme) only edits one file.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Map an account id to the Exchange-owned Drive mailbox id namespace.
|
|
8
|
+
* Lowercase, replace anything else with `-`, collapse runs, trim
|
|
9
|
+
* leading/trailing dashes, then prefix with `exchange-`.
|
|
10
|
+
* Empty input -> `exchange-default`.
|
|
10
11
|
*/
|
|
11
12
|
export declare const sanitizeMailboxId: (raw: string) => string;
|
|
12
13
|
/**
|
|
@@ -4,19 +4,24 @@
|
|
|
4
4
|
* (e.g. a different mailbox-id scheme) only edits one file.
|
|
5
5
|
*/
|
|
6
6
|
const MAILBOX_ID_RE = /^[a-z0-9-]{1,64}$/;
|
|
7
|
+
const EXCHANGE_MAILBOX_PREFIX = "exchange-";
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Map an account id to the Exchange-owned Drive mailbox id namespace.
|
|
10
|
+
* Lowercase, replace anything else with `-`, collapse runs, trim
|
|
11
|
+
* leading/trailing dashes, then prefix with `exchange-`.
|
|
12
|
+
* Empty input -> `exchange-default`.
|
|
11
13
|
*/
|
|
12
14
|
export const sanitizeMailboxId = (raw) => {
|
|
13
|
-
const
|
|
15
|
+
const slug = raw
|
|
14
16
|
.toLowerCase()
|
|
15
17
|
.replace(/[^a-z0-9-]+/g, "-")
|
|
16
18
|
.replace(/-+/g, "-")
|
|
17
19
|
.replace(/^-|-$/g, "");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
if (slug.startsWith(EXCHANGE_MAILBOX_PREFIX))
|
|
21
|
+
return slug.slice(0, 64);
|
|
22
|
+
const maxSlugLength = 64 - EXCHANGE_MAILBOX_PREFIX.length;
|
|
23
|
+
const truncated = slug.slice(0, maxSlugLength);
|
|
24
|
+
return `${EXCHANGE_MAILBOX_PREFIX}${truncated.length === 0 ? "default" : truncated}`;
|
|
20
25
|
};
|
|
21
26
|
/**
|
|
22
27
|
* Caller-supplied folderId for a given IMAP mailbox path. We keep the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/store/conventions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,aAAa,GAAG,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"conventions.js","sourceRoot":"","sources":["../../src/store/conventions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAC1C,MAAM,uBAAuB,GAAG,WAAW,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAU,EAAE;IACvD,MAAM,IAAI,GAAG,GAAG;SACb,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACzB,IAAI,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvE,MAAM,aAAa,GAAG,EAAE,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;IAC/C,OAAO,GAAG,uBAAuB,GAAG,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACvF,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CA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