import { BaseConnector } from '../../base/base.connector'; import type { IEmailOptions, IEmailProvider, ISendMessageSuccessResponse, WithPassthrough, EmailSendInput, EmailSendResult, IEmailConnector } from '../../types'; import { ChannelTypeEnum } from '../../types'; import type { SendgridConfig } from './sendgrid.config'; export declare class SendgridEmailConnector extends BaseConnector implements IEmailProvider, IEmailConnector { private config; readonly id = "sendgrid"; readonly channelType: ChannelTypeEnum.EMAIL; constructor(config: SendgridConfig, fetchImpl?: typeof fetch); /** * Thinwrap-native send. Implements `IEmailConnector`. * Builds the SendGrid v3 `mail/send` JSON body in snake_case wire shape and * POSTs to `https://api.sendgrid.com/v3/mail/send` with `Authorization: Bearer * `. SendGrid is the canonical example: the connector explicitly * invokes `transformKeys(_passthrough.body, CasingEnum.SNAKE_CASE)` before * `mergePassthrough` so consumer-supplied camelCase keys (e.g., * `dynamicTemplateData`) land as snake_case (`dynamic_template_data`) in the * wire body. Headers and query are HTTP-/URL-level and pass through verbatim. */ send(input: EmailSendInput): Promise; /** * Build the SendGrid v3 `mail/send` wire body from Thinwrap's `EmailSendInput`. * Hand-mapped in snake_case (locality) — the hand-building IS the * casing transform for the connector-built portion of the body. */ private buildSendgridBody; /** * Map SendGrid error responses to canonical `ConnectorError` with the 6-value * `ProviderCode` union. Parses `Retry-After`: * parsed seconds embedded in `providerMessage` text; raw header value on * `cause.retryAfter`. No structured `retryAfterSeconds` field per * Retry is consumer policy (no retryAfterSeconds field). */ private mapVendorError; sendMessage(options: IEmailOptions, bridgeProviderData?: WithPassthrough>): Promise; }