@plosson/agentio 0.2.2 → 0.2.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/package.json +1 -1
- package/src/commands/gmail.ts +14 -10
package/package.json
CHANGED
package/src/commands/gmail.ts
CHANGED
|
@@ -275,26 +275,28 @@ Query Syntax Examples:
|
|
|
275
275
|
});
|
|
276
276
|
|
|
277
277
|
gmail
|
|
278
|
-
.command('archive <message-id
|
|
279
|
-
.description('Archive
|
|
278
|
+
.command('archive <message-id...>')
|
|
279
|
+
.description('Archive one or more messages')
|
|
280
280
|
.option('--profile <name>', 'Profile name')
|
|
281
|
-
.action(async (
|
|
281
|
+
.action(async (messageIds: string[], options) => {
|
|
282
282
|
try {
|
|
283
283
|
const { client } = await getGmailClient(options.profile);
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
for (const messageId of messageIds) {
|
|
285
|
+
await client.archive(messageId);
|
|
286
|
+
printArchived(messageId);
|
|
287
|
+
}
|
|
286
288
|
} catch (error) {
|
|
287
289
|
handleError(error);
|
|
288
290
|
}
|
|
289
291
|
});
|
|
290
292
|
|
|
291
293
|
gmail
|
|
292
|
-
.command('mark <message-id
|
|
293
|
-
.description('Mark
|
|
294
|
+
.command('mark <message-id...>')
|
|
295
|
+
.description('Mark one or more messages as read or unread')
|
|
294
296
|
.option('--profile <name>', 'Profile name')
|
|
295
297
|
.option('--read', 'Mark as read')
|
|
296
298
|
.option('--unread', 'Mark as unread')
|
|
297
|
-
.action(async (
|
|
299
|
+
.action(async (messageIds: string[], options) => {
|
|
298
300
|
try {
|
|
299
301
|
if (!options.read && !options.unread) {
|
|
300
302
|
throw new CliError('INVALID_PARAMS', 'Specify --read or --unread');
|
|
@@ -304,8 +306,10 @@ Query Syntax Examples:
|
|
|
304
306
|
}
|
|
305
307
|
|
|
306
308
|
const { client } = await getGmailClient(options.profile);
|
|
307
|
-
|
|
308
|
-
|
|
309
|
+
for (const messageId of messageIds) {
|
|
310
|
+
await client.mark(messageId, options.read);
|
|
311
|
+
printMarked(messageId, options.read);
|
|
312
|
+
}
|
|
309
313
|
} catch (error) {
|
|
310
314
|
handleError(error);
|
|
311
315
|
}
|