diff --git a/sim/app/blocks/blocks/gmail.ts b/sim/app/blocks/blocks/gmail.ts index e66cb53f75..6d61dcc344 100644 --- a/sim/app/blocks/blocks/gmail.ts +++ b/sim/app/blocks/blocks/gmail.ts @@ -5,9 +5,9 @@ import { BlockConfig } from '../types' export const GmailBlock: BlockConfig = { type: 'gmail', name: 'Gmail', - description: 'Send, read, and search Gmail', + description: 'Send Gmail', longDescription: - 'Integrate Gmail functionality to send, read, and search email messages within your workflow. Automate email communications and process email content using OAuth authentication.', + 'Integrate Gmail functionality to send email messages within your workflow. Automate email communications and process email content using OAuth authentication.', category: 'tools', bgColor: '#E0E0E0', icon: GmailIcon, @@ -20,8 +20,8 @@ export const GmailBlock: BlockConfig = { layout: 'full', options: [ { label: 'Send Email', id: 'send_gmail' }, - { label: 'Read Email', id: 'read_gmail' }, - { label: 'Search Emails', id: 'search_gmail' }, + // { label: 'Read Email', id: 'read_gmail' }, + // { label: 'Search Emails', id: 'search_gmail' }, ], }, // Gmail Credentials @@ -34,7 +34,7 @@ export const GmailBlock: BlockConfig = { serviceId: 'gmail', requiredScopes: [ 'https://www.googleapis.com/auth/gmail.send', - 'https://www.googleapis.com/auth/gmail.readonly', + // 'https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.labels', ], placeholder: 'Select Gmail account', @@ -65,64 +65,67 @@ export const GmailBlock: BlockConfig = { condition: { field: 'operation', value: 'send_gmail' }, }, // Read Email Fields - Add folder selector - { - id: 'folder', - title: 'Label', - type: 'folder-selector', - layout: 'full', - provider: 'google-email', - serviceId: 'gmail', - requiredScopes: ['https://www.googleapis.com/auth/gmail.readonly'], - placeholder: 'Select Gmail label/folder', - condition: { field: 'operation', value: 'read_gmail' }, - }, - { - id: 'unreadOnly', - title: 'Unread Only', - type: 'switch', - layout: 'full', - condition: { field: 'operation', value: 'read_gmail' }, - }, - { - id: 'maxResults', - title: 'Number of Emails', - type: 'short-input', - layout: 'full', - placeholder: 'Number of emails to retrieve (default: 1, max: 10)', - condition: { field: 'operation', value: 'read_gmail' }, - }, - { - id: 'messageId', - title: 'Message ID', - type: 'short-input', - layout: 'full', - placeholder: 'Enter message ID to read (optional)', - condition: { - field: 'operation', - value: 'read_gmail', - and: { - field: 'folder', - value: '', - }, - }, - }, - // Search Fields - { - id: 'query', - title: 'Search Query', - type: 'short-input', - layout: 'full', - placeholder: 'Enter search terms', - condition: { field: 'operation', value: 'search_gmail' }, - }, - { - id: 'maxResults', - title: 'Max Results', - type: 'short-input', - layout: 'full', - placeholder: 'Maximum number of results (default: 10)', - condition: { field: 'operation', value: 'search_gmail' }, - }, + // { + // id: 'folder', + // title: 'Label', + // type: 'folder-selector', + // layout: 'full', + // provider: 'google-email', + // serviceId: 'gmail', + // requiredScopes: [ + // // 'https://www.googleapis.com/auth/gmail.readonly', + // 'https://www.googleapis.com/auth/gmail.labels', + // ], + // placeholder: 'Select Gmail label/folder', + // condition: { field: 'operation', value: 'read_gmail' }, + // }, + // { + // id: 'unreadOnly', + // title: 'Unread Only', + // type: 'switch', + // layout: 'full', + // condition: { field: 'operation', value: 'read_gmail' }, + // }, + // { + // id: 'maxResults', + // title: 'Number of Emails', + // type: 'short-input', + // layout: 'full', + // placeholder: 'Number of emails to retrieve (default: 1, max: 10)', + // condition: { field: 'operation', value: 'read_gmail' }, + // }, + // { + // id: 'messageId', + // title: 'Message ID', + // type: 'short-input', + // layout: 'full', + // placeholder: 'Enter message ID to read (optional)', + // condition: { + // field: 'operation', + // value: 'read_gmail', + // and: { + // field: 'folder', + // value: '', + // }, + // }, + // }, + // // Search Fields + // { + // id: 'query', + // title: 'Search Query', + // type: 'short-input', + // layout: 'full', + // placeholder: 'Enter search terms', + // condition: { field: 'operation', value: 'search_gmail' }, + // }, + // { + // id: 'maxResults', + // title: 'Max Results', + // type: 'short-input', + // layout: 'full', + // placeholder: 'Maximum number of results (default: 10)', + // condition: { field: 'operation', value: 'search_gmail' }, + // }, ], tools: { access: ['gmail_send', 'gmail_read', 'gmail_search'], diff --git a/sim/app/lib/auth.ts b/sim/app/lib/auth.ts index f2f4bf02b7..cea4037cef 100644 --- a/sim/app/lib/auth.ts +++ b/sim/app/lib/auth.ts @@ -176,7 +176,7 @@ export const auth = betterAuth({ 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/gmail.send', - 'https://www.googleapis.com/auth/gmail.readonly', + // 'https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.labels', ], prompt: 'consent', diff --git a/sim/app/lib/oauth.ts b/sim/app/lib/oauth.ts index 9c932a571a..bd9b6e2629 100644 --- a/sim/app/lib/oauth.ts +++ b/sim/app/lib/oauth.ts @@ -62,7 +62,7 @@ export const OAUTH_PROVIDERS: Record = { baseProviderIcon: (props) => GoogleIcon(props), scopes: [ 'https://www.googleapis.com/auth/gmail.send', - 'https://www.googleapis.com/auth/gmail.readonly', + // 'https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.labels', ], }, diff --git a/sim/app/tools/gmail/read.ts b/sim/app/tools/gmail/read.ts index c74d3cedeb..a0f8ac9b6b 100644 --- a/sim/app/tools/gmail/read.ts +++ b/sim/app/tools/gmail/read.ts @@ -13,7 +13,7 @@ export const gmailReadTool: ToolConfig = { required: true, provider: 'google-email', additionalScopes: [ - 'https://www.googleapis.com/auth/gmail.readonly', + // 'https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.labels', ], }, diff --git a/sim/app/tools/gmail/search.ts b/sim/app/tools/gmail/search.ts index f6bfaf385a..0a41788d71 100644 --- a/sim/app/tools/gmail/search.ts +++ b/sim/app/tools/gmail/search.ts @@ -12,7 +12,10 @@ export const gmailSearchTool: ToolConfig = oauth: { required: true, provider: 'google-email', - additionalScopes: ['https://www.googleapis.com/auth/gmail.readonly'], + additionalScopes: [ + // 'https://www.googleapis.com/auth/gmail.readonly', + 'https://www.googleapis.com/auth/gmail.labels', + ], }, params: { diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx index 0a81d82f05..303f95d2bf 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx @@ -35,7 +35,7 @@ export interface OAuthRequiredModalProps { // Map of OAuth scopes to user-friendly descriptions const SCOPE_DESCRIPTIONS: Record = { 'https://www.googleapis.com/auth/gmail.send': 'Send emails on your behalf', - 'https://www.googleapis.com/auth/gmail.readonly': 'View and read your email messages', + // 'https://www.googleapis.com/auth/gmail.readonly': 'View and read your email messages', 'https://www.googleapis.com/auth/drive': 'View and manage your Google Drive files', 'https://www.googleapis.com/auth/drive.file': 'View and manage your Google Drive files', 'https://www.googleapis.com/auth/documents': 'View and manage your Google Docs',