mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-22 21:38:05 -05:00
79 lines
1.5 KiB
TypeScript
79 lines
1.5 KiB
TypeScript
import { ToolResponse } from '../types'
|
|
|
|
// Base parameters shared by all operations
|
|
interface BaseGmailParams {
|
|
accessToken: string
|
|
}
|
|
|
|
// Send operation parameters
|
|
export interface GmailSendParams extends BaseGmailParams {
|
|
to: string
|
|
subject: string
|
|
body: string
|
|
}
|
|
|
|
// Read operation parameters
|
|
export interface GmailReadParams extends BaseGmailParams {
|
|
messageId: string
|
|
}
|
|
|
|
// Search operation parameters
|
|
export interface GmailSearchParams extends BaseGmailParams {
|
|
query: string
|
|
maxResults?: number
|
|
}
|
|
|
|
// Union type for all Gmail tool parameters
|
|
export type GmailToolParams = GmailSendParams | GmailReadParams | GmailSearchParams
|
|
|
|
// Response metadata
|
|
interface BaseGmailMetadata {
|
|
id?: string
|
|
threadId?: string
|
|
labelIds?: string[]
|
|
}
|
|
|
|
interface EmailMetadata extends BaseGmailMetadata {
|
|
from?: string
|
|
to?: string
|
|
subject?: string
|
|
}
|
|
|
|
interface SearchMetadata extends BaseGmailMetadata {
|
|
results: Array<{
|
|
id: string
|
|
threadId: string
|
|
}>
|
|
}
|
|
|
|
// Response format
|
|
export interface GmailToolResponse extends ToolResponse {
|
|
output: {
|
|
content: string
|
|
metadata: EmailMetadata | SearchMetadata
|
|
}
|
|
}
|
|
|
|
// Email Message Interface
|
|
export interface GmailMessage {
|
|
id: string
|
|
threadId: string
|
|
labelIds: string[]
|
|
snippet: string
|
|
payload: {
|
|
headers: Array<{
|
|
name: string
|
|
value: string
|
|
}>
|
|
body: {
|
|
data?: string
|
|
}
|
|
parts?: Array<{
|
|
mimeType: string
|
|
body: {
|
|
data?: string
|
|
}
|
|
}>
|
|
}
|
|
}
|