mcp-google-multi 5.1.0-alpha.5 → 5.1.0-beta.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/dist/tools/drive.js +12 -2
- package/package.json +1 -1
package/dist/tools/drive.js
CHANGED
|
@@ -1275,18 +1275,28 @@ function transferResult(data, strategy, from, to, flags) {
|
|
|
1275
1275
|
};
|
|
1276
1276
|
}
|
|
1277
1277
|
async function shareAndCopy(sourceDrive, targetDrive, fileId, targetEmail, intendedName, parentFolderId) {
|
|
1278
|
-
const
|
|
1278
|
+
const share = (expiration) => sourceDrive.permissions.create({
|
|
1279
1279
|
fileId,
|
|
1280
1280
|
requestBody: {
|
|
1281
1281
|
type: 'user',
|
|
1282
1282
|
role: 'reader',
|
|
1283
1283
|
emailAddress: targetEmail,
|
|
1284
|
-
expirationTime: new Date(Date.now() + 60 * 60 * 1000).toISOString(),
|
|
1284
|
+
...(expiration ? { expirationTime: new Date(Date.now() + 60 * 60 * 1000).toISOString() } : {}),
|
|
1285
1285
|
},
|
|
1286
1286
|
sendNotificationEmail: false,
|
|
1287
1287
|
supportsAllDrives: true,
|
|
1288
1288
|
fields: 'id',
|
|
1289
1289
|
});
|
|
1290
|
+
let perm;
|
|
1291
|
+
try {
|
|
1292
|
+
perm = await share(true);
|
|
1293
|
+
}
|
|
1294
|
+
catch (err) {
|
|
1295
|
+
// consumer Gmail rejects expirationTime; the finally-revoke still cleans up
|
|
1296
|
+
if (!/expiration/i.test(err.message ?? ''))
|
|
1297
|
+
throw err;
|
|
1298
|
+
perm = await share(false);
|
|
1299
|
+
}
|
|
1290
1300
|
let cleanupFailed = false;
|
|
1291
1301
|
let renameFailed = false;
|
|
1292
1302
|
let data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-multi",
|
|
3
|
-
"version": "5.1.0-
|
|
3
|
+
"version": "5.1.0-beta.1",
|
|
4
4
|
"description": "Local MCP server for Google Workspace (Gmail, Drive, Calendar, Sheets, Docs, Contacts, Tasks, Meet, Search Console, +Forms/Chat/Admin) across multiple accounts — OAuth-only, encrypted token storage, deny-by-default writes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|