Summary
Extends the existing Gmail piece with the missing actions and triggers requested in #8072:
New Actions (6)
- Add Label to Email — Attach a label to an individual email message
- Remove Label from Email — Remove a specific label from an email message
- Create Label — Create a new user label in Gmail (with visibility options)
- Archive Email — Archive an email by removing the INBOX label
- Delete Email — Move an email to Trash
- Remove Label from Thread — Strip a label from all emails in a thread
New Trigger (1)
- New Starred Email — Fires when an email is starred, using Gmail History API with
labelAdded for STARRED
Registered Existing Components
- New Conversation trigger (file existed but was not registered in index.ts)
- Get Thread action (file existed but was not registered in index.ts)
OAuth Scope Changes
Added gmail.modify and gmail.labels scopes required for label management and message modification operations.
Implementation Details
- All new actions follow the existing piece patterns using
googleapis OAuth2Client
- Label actions use
gmail.users.messages.modify / gmail.users.threads.modify API
- Archive uses
removeLabelIds: ['INBOX'], Delete uses gmail.users.messages.trash
- Starred trigger uses History API (
labelAdded with STARRED label ID) for real-time detection
- Test mode for starred trigger fetches starred emails from the last 2 days
- Version bumped from 0.11.4 to 0.12.0
Test Plan
- Verify Add Label to Email adds specified label to a message
- Verify Remove Label from Email removes specified label from a message
- Verify Create Label creates a new user label with correct visibility settings
- Verify Archive Email removes INBOX label (email moves to All Mail)
- Verify Delete Email moves message to Trash
- Verify Remove Label from Thread strips label from all messages in thread
- Verify New Starred Email trigger fires when an email is starred
- Verify New Conversation trigger detects new thread creation
- Verify Get Thread action returns thread data by ID
- Verify existing actions/triggers still work correctly after scope changes
Fixes #8072
/claim #8072