integrations/email/gmail/dist¶
Classes¶
ProviderApiError¶
Extends¶
Error
Constructors¶
Constructor¶
Parameters¶
| Parameter | Type |
|---|---|
input |
ProviderApiErrorInput |
Returns¶
Overrides¶
Properties¶
body¶
code?¶
provider¶
response¶
retryAfter?¶
status¶
Interfaces¶
GmailArchiveThreadInput¶
Extends¶
Properties¶
removeLabelIds?¶
signal?¶
Inherited from¶
GmailProviderRequestOptions.signal
threadId¶
GmailCreateDraftInput¶
Extends¶
Properties¶
bcc?¶
Inherited from¶
cc?¶
Inherited from¶
from?¶
Inherited from¶
inReplyTo?¶
Inherited from¶
GmailRawMessageInput.inReplyTo
messageId?¶
Inherited from¶
GmailRawMessageInput.messageId
raw?¶
Inherited from¶
references?¶
Inherited from¶
GmailRawMessageInput.references
replyTo?¶
Inherited from¶
signal?¶
Inherited from¶
subject?¶
Inherited from¶
text?¶
Inherited from¶
threadId?¶
to?¶
Inherited from¶
GmailCredentialStatusInput¶
Properties¶
accessToken?¶
auth?¶
expiresAt?¶
scopes?¶
GmailEmailAttachment¶
Properties¶
attachmentId?¶
filename?¶
mimeType?¶
partId?¶
size?¶
GmailEmailClient¶
Properties¶
handlers¶
rawClient¶
userId¶
Methods¶
archiveThread()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailArchiveThreadInput |
Returns¶
Promise\<GmailEmailThread>
createDraft()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailCreateDraftInput |
Returns¶
Promise\<GmailEmailDraft>
execute()¶
Type Parameters¶
| Type Parameter |
|---|
K extends | "email.receive" | "email.thread.read" | "email.reply.send" | "email.send" | "email.draft.create" | "email.draft.send" | "email.archive" | "mailbox.watch" | "gmail.history.list" | "gmail.attachment.get" | "gmail.labels.list" |
Parameters¶
| Parameter | Type |
|---|---|
alias |
K |
input |
GmailEmailOperationInputMap[K] |
Returns¶
Promise\<GmailEmailOperationOutputMap[K]>
getAttachment()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailGetAttachmentInput |
Returns¶
Promise\<Schema$MessagePartBody>
getProfile()¶
Parameters¶
| Parameter | Type |
|---|---|
input? |
GmailProviderRequestOptions |
Returns¶
Promise\<Schema$Profile>
listHistory()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailListHistoryInput |
Returns¶
Promise\<Schema$ListHistoryResponse>
listLabels()¶
Parameters¶
| Parameter | Type |
|---|---|
input? |
GmailProviderRequestOptions |
Returns¶
Promise\<Schema$ListLabelsResponse>
readThread()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailReadThreadInput |
Returns¶
Promise\<GmailEmailThread>
sendDraft()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailSendDraftInput |
Returns¶
Promise\<GmailEmailMessage>
sendEmail()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailSendEmailInput |
Returns¶
Promise\<GmailEmailMessage>
sendReply()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailReplySendInput |
Returns¶
Promise\<GmailEmailMessage>
watchMailbox()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailWatchInput |
Returns¶
Promise\<Schema$WatchResponse>
GmailEmailClientOptions¶
Extends¶
Properties¶
accessToken?¶
auth?¶
rawClient?¶
rootUrl?¶
signal?¶
Inherited from¶
GmailProviderRequestOptions.signal
userId?¶
GmailEmailDraft¶
Properties¶
id?¶
message?¶
provider¶
raw¶
GmailEmailMessage¶
Properties¶
attachments¶
bcc?¶
cc?¶
from?¶
headers¶
historyId?¶
id?¶
inReplyTo?¶
internalDate?¶
labelIds¶
messageId?¶
provider¶
raw¶
references?¶
replyTo?¶
snippet?¶
subject?¶
threadId?¶
to?¶
GmailEmailOperationInputMap¶
Properties¶
email.archive¶
email.draft.create¶
email.draft.send¶
email.receive¶
email.reply.send¶
email.send¶
email.thread.read¶
gmail.attachment.get¶
gmail.history.list¶
gmail.labels.list¶
mailbox.watch¶
GmailEmailOperationOutputMap¶
Properties¶
email.archive¶
email.draft.create¶
email.draft.send¶
email.receive¶
email.reply.send¶
email.send¶
email.thread.read¶
gmail.attachment.get¶
gmail.history.list¶
gmail.labels.list¶
mailbox.watch¶
GmailEmailThread¶
Properties¶
historyId?¶
id?¶
messages¶
provider¶
raw¶
GmailGetAttachmentInput¶
Extends¶
Properties¶
attachmentId¶
messageId¶
signal?¶
Inherited from¶
GmailProviderRequestOptions.signal
GmailJsonObject¶
Indexable¶
GmailListHistoryInput¶
Extends¶
Properties¶
historyTypes?¶
labelId?¶
maxResults?¶
pageToken?¶
signal?¶
Inherited from¶
GmailProviderRequestOptions.signal
startHistoryId¶
GmailProviderRequestOptions¶
Extended by¶
GmailArchiveThreadInputGmailEmailClientOptionsGmailGetAttachmentInputGmailListHistoryInputGmailReadThreadInputGmailSendDraftInputGmailWatchInput
Properties¶
signal?¶
GmailPubSubNotification¶
Properties¶
attributes?¶
emailAddress¶
historyId¶
messageId?¶
publishTime?¶
rawPayload¶
subscription?¶
GmailPubSubNotificationEnvelope¶
Properties¶
message?¶
optional message?: {
attributes?: Record<string, string>;
data?: string;
message_id?: string;
messageId?: string;
publish_time?: string;
publishTime?: string;
};
attributes?¶
data?¶
message_id?¶
messageId?¶
publish_time?¶
publishTime?¶
subscription?¶
GmailRawMessageInput¶
Properties¶
bcc?¶
cc?¶
from¶
inReplyTo?¶
messageId?¶
references?¶
replyTo?¶
subject¶
text¶
to¶
GmailReadThreadInput¶
Extends¶
Properties¶
format?¶
metadataHeaders?¶
signal?¶
Inherited from¶
GmailProviderRequestOptions.signal
threadId¶
GmailReplySendInput¶
Extends¶
Properties¶
bcc?¶
Inherited from¶
cc?¶
Inherited from¶
from?¶
Inherited from¶
inReplyTo?¶
Inherited from¶
GmailRawMessageInput.inReplyTo
messageId?¶
Inherited from¶
GmailRawMessageInput.messageId
raw?¶
Inherited from¶
references?¶
Inherited from¶
GmailRawMessageInput.references
replyTo?¶
Inherited from¶
signal?¶
Inherited from¶
subject?¶
Inherited from¶
text?¶
Inherited from¶
threadId¶
to?¶
Inherited from¶
GmailSendDraftInput¶
Extends¶
Properties¶
draftId¶
signal?¶
Inherited from¶
GmailProviderRequestOptions.signal
GmailSendEmailInput¶
Extends¶
Properties¶
bcc?¶
Inherited from¶
cc?¶
Inherited from¶
from?¶
Inherited from¶
inReplyTo?¶
Inherited from¶
GmailRawMessageInput.inReplyTo
messageId?¶
Inherited from¶
GmailRawMessageInput.messageId
raw?¶
Inherited from¶
references?¶
Inherited from¶
GmailRawMessageInput.references
replyTo?¶
Inherited from¶
signal?¶
Inherited from¶
subject?¶
Inherited from¶
text?¶
Inherited from¶
threadId?¶
to?¶
Inherited from¶
GmailWatchInput¶
Extends¶
Properties¶
labelFilterBehavior?¶
labelIds?¶
signal?¶
Inherited from¶
GmailProviderRequestOptions.signal
topicName¶
ProviderApiErrorInput¶
Properties¶
body?¶
code?¶
message¶
provider¶
response¶
retryAfter?¶
status¶
ProviderApiErrorResponseMetadata¶
Properties¶
headers¶
requestId?¶
statusText¶
url?¶
Type Aliases¶
GmailAttachmentBody¶
GmailComposedMessageInput¶
type GmailComposedMessageInput = GmailProviderRequestOptions & Partial<GmailRawMessageInput> & {
raw?: string;
};
Type Declaration¶
| Name | Type |
|---|---|
raw? |
string |
GmailEmailOperationAlias¶
GmailEmailOperationHandler¶
Type Parameters¶
| Type Parameter |
|---|
K extends GmailEmailOperationAlias |
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailEmailOperationInputMap[K] |
Returns¶
Promise\<GmailEmailOperationOutputMap[K]>
GmailEmailOperationHandlers¶
type GmailEmailOperationHandlers = { [K in GmailEmailOperationAlias]: GmailEmailOperationHandler<K> };
GmailHistoryListResponse¶
GmailHistoryType¶
GmailJsonPrimitive¶
GmailJsonValue¶
GmailLabelListResponse¶
GmailLiveCheckOptions¶
type GmailLiveCheckOptions = GmailEmailClientOptions & {
client?: Pick<GmailEmailClient, "getProfile">;
};
Type Declaration¶
| Name | Type |
|---|---|
client? |
Pick\<GmailEmailClient, "getProfile"> |
GmailOfficialAuth¶
GmailOfficialAuthClient¶
GmailOfficialClient¶
GmailOfficialMethodOptions¶
GmailProfileResource¶
GmailWatchResponse¶
Variables¶
GMAIL_EMAIL_OPERATION_ALIASES¶
const GMAIL_EMAIL_OPERATION_ALIASES: readonly ["email.receive", "email.thread.read", "email.reply.send", "email.send", "email.draft.create", "email.draft.send", "email.archive", "mailbox.watch", "gmail.history.list", "gmail.attachment.get", "gmail.labels.list"];
gmailEmailProviderOperations¶
Functions¶
createGmailEmailClient()¶
Parameters¶
| Parameter | Type |
|---|---|
options |
GmailEmailClientOptions |
Returns¶
createGmailEmailIntegration()¶
function createGmailEmailIntegration(options): DefinedIntegration<{
capabilities: {
audiences?: ("customer-facing" | "internal-support" | "mixed")[];
capability: string;
changesWorkflow?: boolean;
description?: string;
exposesSensitiveData?: boolean;
extension?: boolean;
label?: string;
metadata?: Record<string, unknown>;
providerObjects?: {
description?: string;
kind: string;
label?: string;
metadata?: Record<string, unknown>;
schemaName?: string;
}[];
requiresCredential?: boolean;
sideEffect?: boolean;
}[];
category: string;
channelAudiences: ("customer-facing" | "internal-support" | "mixed")[];
coverage: {
evidence: {
label: string;
url?: string;
}[];
notes: string[];
scope: | "support-workflow-subset"
| "provider-api-subset"
| "connector-required"
| "local-protocol"
| "full-provider-api";
};
credentialRequirements: {
description?: string;
id: string;
label?: string;
metadata?: Record<string, unknown>;
required: boolean;
scopes: string[];
}[];
directions: (
| "receive-only"
| "send-only"
| "inbound-only"
| "outbound-only"
| "bidirectional")[];
id: string;
limitations: string[];
maintainers: {
name: string;
type: "community" | "official" | "unknown" | "partner";
url?: string;
}[];
metadata?: Record<string, unknown>;
name: string;
operations: {
alias: string;
audience?: "customer-facing" | "internal-support" | "mixed";
audiences?: ("customer-facing" | "internal-support" | "mixed")[];
capability: string;
changesWorkflow?: boolean;
description?: string;
exposesSensitiveData?: boolean;
extension: boolean;
externallyVisible?: boolean;
inputSchema?: unknown;
inputSchemaName?: string;
inputSchemaRef?: string;
label?: string;
metadata?: Record<string, unknown>;
outputSchema?: unknown;
outputSchemaName?: string;
outputSchemaRef?: string;
providerObject?: string;
providerObjects?: {
description?: string;
kind: string;
label?: string;
metadata?: Record<string, unknown>;
schemaName?: string;
}[];
providerOperation?: string;
requiredPolicyIds?: string[];
requiresApproval?: boolean;
requiresCredential?: boolean;
sideEffect?: boolean;
}[];
packageName: string;
privacyNotes: string[];
provider: string;
trustLevel: "community" | "official" | "verified" | "experimental";
} & {
capabilities: readonly [{
audiences: readonly ["customer-facing", "internal-support", "mixed"];
capability: "receive";
description: "Parses Gmail Pub/Sub notifications and reads Gmail watch/history cursors.";
exposesSensitiveData: true;
label: "Receive Gmail mailbox changes";
providerObjects: readonly [{
kind: "mailbox";
label: "Gmail Mailbox";
}, {
kind: "gmailHistory";
label: "Gmail History";
}];
requiresCredential: true;
}, {
audiences: readonly ["customer-facing", "internal-support", "mixed"];
capability: "read-provider-object";
description: "Reads Gmail threads, messages, labels, and attachment bodies through the official SDK.";
exposesSensitiveData: true;
label: "Read Gmail threads and attachments";
providerObjects: readonly [{
kind: "emailThread";
label: "Email Thread";
}, {
kind: "emailMessage";
label: "Email Message";
}, {
kind: "attachment";
label: "Attachment";
}, {
kind: "mailLabel";
label: "Mail Label";
}];
requiresCredential: true;
}, {
audiences: readonly ["customer-facing", "internal-support", "mixed"];
capability: "draft";
description: "Creates Gmail draft messages for SDK-user-configured approval workflows.";
exposesSensitiveData: true;
label: "Create Gmail drafts";
providerObjects: readonly [{
kind: "emailDraft";
label: "Email Draft";
}];
requiresCredential: true;
sideEffect: true;
}, {
audiences: readonly ["customer-facing", "mixed"];
capability: "send";
description: "Sends Gmail replies, new messages, or existing drafts when SDK-user policy permits outbound contact.";
exposesSensitiveData: true;
label: "Send Gmail messages";
providerObjects: readonly [{
kind: "emailMessage";
label: "Email Message";
}, {
kind: "emailDraft";
label: "Email Draft";
}];
requiresCredential: true;
sideEffect: true;
}, {
audiences: readonly ["internal-support", "mixed"];
capability: "update-provider-object";
changesWorkflow: true;
description: "Removes active inbox labels from Gmail threads when SDK-user policy permits mutation.";
exposesSensitiveData: true;
label: "Archive Gmail threads";
providerObjects: readonly [{
kind: "emailThread";
label: "Email Thread";
}];
requiresCredential: true;
sideEffect: true;
}];
category: "email";
channelAudiences: readonly ["customer-facing", "internal-support", "mixed"];
coverage: {
evidence: readonly [{
label: "@googleapis/gmail package";
url: "https://www.npmjs.com/package/@googleapis/gmail";
}, {
label: "Gmail API Node.js quickstart";
url: "https://developers.google.com/workspace/gmail/api/quickstart/nodejs";
}, {
label: "Gmail users.threads.get";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/get";
}, {
label: "Gmail users.messages.send";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/send";
}, {
label: "Gmail users.drafts.create";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.drafts/create";
}, {
label: "Gmail users.threads.modify";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/modify";
}, {
label: "Gmail users.watch";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users/watch";
}, {
label: "Gmail push notifications";
url: "https://developers.google.com/workspace/gmail/api/guides/push";
}];
notes: readonly ["Coverage is intentionally scoped to normalized Cognidesk email support workflows implemented by typed handlers.", "Implementation uses the official service-specific @googleapis/gmail SDK. Broader Gmail methods remain accessible through GmailEmailClient.rawClient instead of generated Cognidesk-owned full API functions.", "Operation handlers are bound through @cognidesk/integration-kit so manifest operations and executable handlers must stay in exact parity.", "Receive coverage is Gmail watch/history foundation plus Google Cloud Pub/Sub push notification parsing; Pub/Sub topic/subscription hosting, authentication, retry, and history synchronization policy are SDK-user responsibilities."];
scope: "support-workflow-subset";
};
credentialRequirements: readonly [{
description: "Server-side OAuth access token or injected official Gmail SDK auth client.";
id: "google-oauth-access-token";
label: "Google OAuth access token";
metadata: {
scopeKind: "provider-oauth-scopes";
};
required: true;
scopes: readonly ["https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/gmail.send", "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.metadata"];
}];
directions: readonly ["receive-only", "send-only", "bidirectional"];
id: "email.gmail";
limitations: readonly ["Available operations depend on OAuth scopes, Google Workspace policy, delegated user, and mailbox state configured by the SDK user.", "Gmail watch notifications require an SDK-user-managed Google Cloud Pub/Sub topic, subscription, webhook/worker, and history synchronization strategy.", "Draft approval, auto-send, retention, redaction, and outbound-contact policy are SDK-user configuration.", "This package does not claim full Gmail API coverage; use rawClient for advanced official SDK methods."];
maintainers: readonly [{
name: "Cognidesk";
type: "official";
}];
metadata: {
channelCoverage: {
broaderGmailApi: "provider-supported-raw-client";
gmailAttachments: "typed-read-body";
gmailDrafts: "typed-create-and-send";
gmailLabels: "typed-list";
gmailMessages: "typed-send-and-reply";
gmailThreads: "typed-read-and-archive";
gmailWatchHistory: "typed-watch-history-foundation";
pubSubPushDelivery: "typed-parse-only-sdk-owned-hosting";
};
implementation: {
integrationKitStatus: "implemented";
manifestImport: "no-sdk-client-initialization";
rawClientEscapeHatch: "GmailEmailClient.rawClient";
sdkPackage: "@googleapis/gmail";
sdkVersionRange: "^17.0.0";
strategy: "official-sdk";
};
scopeAlternatives: {
metadataOnlyCaveat: "Gmail metadata-only scopes support profile/watch/read metadata surfaces, but SDK users must avoid query-dependent listing where the Gmail API disallows q with gmail.metadata.";
profile: readonly ["https://mail.google.com/", "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.metadata"];
send: readonly ["https://mail.google.com/", "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/gmail.send"];
watch: readonly ["https://mail.google.com/", "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.metadata"];
};
};
name: "Gmail";
operations: {
alias: string;
audience?: "customer-facing" | "internal-support" | "mixed";
audiences?: ("customer-facing" | "internal-support" | "mixed")[];
capability: string;
changesWorkflow?: boolean;
description?: string;
exposesSensitiveData?: boolean;
extension?: boolean;
externallyVisible?: boolean;
inputSchema?: unknown;
inputSchemaName?: string;
inputSchemaRef?: string;
label?: string;
metadata?: Record<string, unknown>;
outputSchema?: unknown;
outputSchemaName?: string;
outputSchemaRef?: string;
providerObject?: string;
providerObjects?: {
description?: string;
kind: string;
label?: string;
metadata?: Record<string, unknown>;
schemaName?: string;
}[];
providerOperation?: string;
requiredPolicyIds?: string[];
requiresApproval?: boolean;
requiresCredential?: boolean;
sideEffect?: boolean;
}[];
packageName: "@cognidesk/integration-email-gmail";
privacyNotes: readonly ["Gmail messages can contain customer content, attachments, addresses, labels, and thread history.", "OAuth tokens stay server-side and are represented in Studio only as credential readiness."];
provider: "gmail";
trustLevel: "official";
}, unknown, IntegrationOperationHandlers>;
Parameters¶
| Parameter | Type |
|---|---|
options |
GmailEmailClientOptions |
Returns¶
DefinedIntegration\<{
capabilities: {
audiences?: ("customer-facing" | "internal-support" | "mixed")[];
capability: string;
changesWorkflow?: boolean;
description?: string;
exposesSensitiveData?: boolean;
extension?: boolean;
label?: string;
metadata?: Record\<string, unknown>;
providerObjects?: {
description?: string;
kind: string;
label?: string;
metadata?: Record\<string, unknown>;
schemaName?: string;
}[];
requiresCredential?: boolean;
sideEffect?: boolean;
}[];
category: string;
channelAudiences: ("customer-facing" | "internal-support" | "mixed")[];
coverage: {
evidence: {
label: string;
url?: string;
}[];
notes: string[];
scope: | "support-workflow-subset"
| "provider-api-subset"
| "connector-required"
| "local-protocol"
| "full-provider-api";
};
credentialRequirements: {
description?: string;
id: string;
label?: string;
metadata?: Record\<string, unknown>;
required: boolean;
scopes: string[];
}[];
directions: (
| "receive-only"
| "send-only"
| "inbound-only"
| "outbound-only"
| "bidirectional")[];
id: string;
limitations: string[];
maintainers: {
name: string;
type: "community" | "official" | "unknown" | "partner";
url?: string;
}[];
metadata?: Record\<string, unknown>;
name: string;
operations: {
alias: string;
audience?: "customer-facing" | "internal-support" | "mixed";
audiences?: ("customer-facing" | "internal-support" | "mixed")[];
capability: string;
changesWorkflow?: boolean;
description?: string;
exposesSensitiveData?: boolean;
extension: boolean;
externallyVisible?: boolean;
inputSchema?: unknown;
inputSchemaName?: string;
inputSchemaRef?: string;
label?: string;
metadata?: Record\<string, unknown>;
outputSchema?: unknown;
outputSchemaName?: string;
outputSchemaRef?: string;
providerObject?: string;
providerObjects?: {
description?: string;
kind: string;
label?: string;
metadata?: Record\<string, unknown>;
schemaName?: string;
}[];
providerOperation?: string;
requiredPolicyIds?: string[];
requiresApproval?: boolean;
requiresCredential?: boolean;
sideEffect?: boolean;
}[];
packageName: string;
privacyNotes: string[];
provider: string;
trustLevel: "community" | "official" | "verified" | "experimental";
} & {
capabilities: readonly [{
audiences: readonly ["customer-facing", "internal-support", "mixed"];
capability: "receive";
description: "Parses Gmail Pub/Sub notifications and reads Gmail watch/history cursors.";
exposesSensitiveData: true;
label: "Receive Gmail mailbox changes";
providerObjects: readonly [{
kind: "mailbox";
label: "Gmail Mailbox";
}, {
kind: "gmailHistory";
label: "Gmail History";
}];
requiresCredential: true;
}, {
audiences: readonly ["customer-facing", "internal-support", "mixed"];
capability: "read-provider-object";
description: "Reads Gmail threads, messages, labels, and attachment bodies through the official SDK.";
exposesSensitiveData: true;
label: "Read Gmail threads and attachments";
providerObjects: readonly [{
kind: "emailThread";
label: "Email Thread";
}, {
kind: "emailMessage";
label: "Email Message";
}, {
kind: "attachment";
label: "Attachment";
}, {
kind: "mailLabel";
label: "Mail Label";
}];
requiresCredential: true;
}, {
audiences: readonly ["customer-facing", "internal-support", "mixed"];
capability: "draft";
description: "Creates Gmail draft messages for SDK-user-configured approval workflows.";
exposesSensitiveData: true;
label: "Create Gmail drafts";
providerObjects: readonly [{
kind: "emailDraft";
label: "Email Draft";
}];
requiresCredential: true;
sideEffect: true;
}, {
audiences: readonly ["customer-facing", "mixed"];
capability: "send";
description: "Sends Gmail replies, new messages, or existing drafts when SDK-user policy permits outbound contact.";
exposesSensitiveData: true;
label: "Send Gmail messages";
providerObjects: readonly [{
kind: "emailMessage";
label: "Email Message";
}, {
kind: "emailDraft";
label: "Email Draft";
}];
requiresCredential: true;
sideEffect: true;
}, {
audiences: readonly ["internal-support", "mixed"];
capability: "update-provider-object";
changesWorkflow: true;
description: "Removes active inbox labels from Gmail threads when SDK-user policy permits mutation.";
exposesSensitiveData: true;
label: "Archive Gmail threads";
providerObjects: readonly [{
kind: "emailThread";
label: "Email Thread";
}];
requiresCredential: true;
sideEffect: true;
}];
category: "email";
channelAudiences: readonly ["customer-facing", "internal-support", "mixed"];
coverage: {
evidence: readonly [{
label: "@googleapis/gmail package";
url: "https://www.npmjs.com/package/@googleapis/gmail";
}, {
label: "Gmail API Node.js quickstart";
url: "https://developers.google.com/workspace/gmail/api/quickstart/nodejs";
}, {
label: "Gmail users.threads.get";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/get";
}, {
label: "Gmail users.messages.send";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/send";
}, {
label: "Gmail users.drafts.create";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.drafts/create";
}, {
label: "Gmail users.threads.modify";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/modify";
}, {
label: "Gmail users.watch";
url: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users/watch";
}, {
label: "Gmail push notifications";
url: "https://developers.google.com/workspace/gmail/api/guides/push";
}];
notes: readonly ["Coverage is intentionally scoped to normalized Cognidesk email support workflows implemented by typed handlers.", "Implementation uses the official service-specific @googleapis/gmail SDK. Broader Gmail methods remain accessible through GmailEmailClient.rawClient instead of generated Cognidesk-owned full API functions.", "Operation handlers are bound through @cognidesk/integration-kit so manifest operations and executable handlers must stay in exact parity.", "Receive coverage is Gmail watch/history foundation plus Google Cloud Pub/Sub push notification parsing; Pub/Sub topic/subscription hosting, authentication, retry, and history synchronization policy are SDK-user responsibilities."];
scope: "support-workflow-subset";
};
credentialRequirements: readonly [{
description: "Server-side OAuth access token or injected official Gmail SDK auth client.";
id: "google-oauth-access-token";
label: "Google OAuth access token";
metadata: {
scopeKind: "provider-oauth-scopes";
};
required: true;
scopes: readonly ["https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/gmail.send", "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.metadata"];
}];
directions: readonly ["receive-only", "send-only", "bidirectional"];
id: "email.gmail";
limitations: readonly ["Available operations depend on OAuth scopes, Google Workspace policy, delegated user, and mailbox state configured by the SDK user.", "Gmail watch notifications require an SDK-user-managed Google Cloud Pub/Sub topic, subscription, webhook/worker, and history synchronization strategy.", "Draft approval, auto-send, retention, redaction, and outbound-contact policy are SDK-user configuration.", "This package does not claim full Gmail API coverage; use rawClient for advanced official SDK methods."];
maintainers: readonly [{
name: "Cognidesk";
type: "official";
}];
metadata: {
channelCoverage: {
broaderGmailApi: "provider-supported-raw-client";
gmailAttachments: "typed-read-body";
gmailDrafts: "typed-create-and-send";
gmailLabels: "typed-list";
gmailMessages: "typed-send-and-reply";
gmailThreads: "typed-read-and-archive";
gmailWatchHistory: "typed-watch-history-foundation";
pubSubPushDelivery: "typed-parse-only-sdk-owned-hosting";
};
implementation: {
integrationKitStatus: "implemented";
manifestImport: "no-sdk-client-initialization";
rawClientEscapeHatch: "GmailEmailClient.rawClient";
sdkPackage: "@googleapis/gmail";
sdkVersionRange: "^17.0.0";
strategy: "official-sdk";
};
scopeAlternatives: {
metadataOnlyCaveat: "Gmail metadata-only scopes support profile/watch/read metadata surfaces, but SDK users must avoid query-dependent listing where the Gmail API disallows q with gmail.metadata.";
profile: readonly ["https://mail.google.com/", "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.metadata"];
send: readonly ["https://mail.google.com/", "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/gmail.send"];
watch: readonly ["https://mail.google.com/", "https://www.googleapis.com/auth/gmail.modify", "https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.metadata"];
};
};
name: "Gmail";
operations: {
alias: string;
audience?: "customer-facing" | "internal-support" | "mixed";
audiences?: ("customer-facing" | "internal-support" | "mixed")[];
capability: string;
changesWorkflow?: boolean;
description?: string;
exposesSensitiveData?: boolean;
extension?: boolean;
externallyVisible?: boolean;
inputSchema?: unknown;
inputSchemaName?: string;
inputSchemaRef?: string;
label?: string;
metadata?: Record\<string, unknown>;
outputSchema?: unknown;
outputSchemaName?: string;
outputSchemaRef?: string;
providerObject?: string;
providerObjects?: {
description?: string;
kind: string;
label?: string;
metadata?: Record\<string, unknown>;
schemaName?: string;
}[];
providerOperation?: string;
requiredPolicyIds?: string[];
requiresApproval?: boolean;
requiresCredential?: boolean;
sideEffect?: boolean;
}[];
packageName: "@cognidesk/integration-email-gmail";
privacyNotes: readonly ["Gmail messages can contain customer content, attachments, addresses, labels, and thread history.", "OAuth tokens stay server-side and are represented in Studio only as credential readiness."];
provider: "gmail";
trustLevel: "official";
}, unknown, IntegrationOperationHandlers>
createGmailEmailLiveChecks()¶
function createGmailEmailLiveChecks(options): {
description: string;
id: string;
requiredCredentialIds: string[];
run: Promise<{
details: {
emailAddress: string;
messagesTotal: number;
};
}>;
}[];
Parameters¶
| Parameter | Type |
|---|---|
options |
GmailLiveCheckOptions |
Returns¶
{
description: string;
id: string;
requiredCredentialIds: string[];
run: Promise\<{
details: {
emailAddress: string;
messagesTotal: number;
};
}>;
}[]
createGmailRawMessage()¶
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailRawMessageInput |
Returns¶
string
gmailEmailCredentialStatuses()¶
function gmailEmailCredentialStatuses(input): {
expiresAt?: string;
message?: string;
providerPackageId?: string;
requirementId: string;
scopes?: string[];
state: | "required"
| "configured"
| "permission-blocked"
| "not-required"
| "missing"
| "expired"
| "insufficient-scope"
| "unavailable";
}[];
Parameters¶
| Parameter | Type |
|---|---|
input |
GmailCredentialStatusInput |
Returns¶
{
expiresAt?: string;
message?: string;
providerPackageId?: string;
requirementId: string;
scopes?: string[];
state: | "required"
| "configured"
| "permission-blocked"
| "not-required"
| "missing"
| "expired"
| "insufficient-scope"
| "unavailable";
}[]
normalizeGmailDraft()¶
Parameters¶
| Parameter | Type |
|---|---|
draft |
Schema$Draft |
Returns¶
normalizeGmailMessage()¶
Parameters¶
| Parameter | Type |
|---|---|
message |
Schema$Message |
Returns¶
normalizeGmailThread()¶
Parameters¶
| Parameter | Type |
|---|---|
thread |
Schema$Thread |
Returns¶
parseGmailPubSubNotification()¶
Parameters¶
| Parameter | Type |
|---|---|
requestOrEnvelope |
| Request | GmailPubSubNotificationEnvelope |
Returns¶
Promise\<GmailPubSubNotification>
References¶
gmailEmailProviderManifest¶
Re-exports gmailEmailProviderManifest