import { BaseConnector } from '../../base/base.connector'; import type { EmailSendInput, EmailSendResult, IEmailConnector } from '../../types'; import { ChannelTypeEnum } from '../../types'; import type { ScalewayConfig } from './scaleway.config'; export declare class ScalewayEmailConnector extends BaseConnector implements IEmailConnector { private config; readonly id = "scaleway"; readonly channelType: ChannelTypeEnum.EMAIL; constructor(config: ScalewayConfig, fetchImpl?: typeof fetch); /** * Thinwrap-native send. Implements `IEmailConnector`. * Builds Scaleway TEM's snake_case JSON body (nested `from`/`to` address * objects + mandatory `project_id`) and POSTs to the region-scoped path * `…/regions/{region}/emails` with `X-Auth-Token` auth. * * Scaleway is structurally close to SparkPost (region + nested address * objects + snake_case wire) but differs in three ways handled here: * 1. **Region is part of the URL path**, not a host swap (see * `resolveEndpoint()`). * 2. **Auth is `X-Auth-Token: `** — not `Authorization`. * 3. **`project_id` is mandatory** and comes from config. * * There is NO Novu-compatible `sendMessage()` surface here: Novu has no Scaleway * provider, so there is no shape to be compatible with. * * Graceful degradation where Scaleway falls below the >=90% baseline: * - `tags` — Scaleway has no tags field at v1.0; silently dropped. * - attachment `contentId` — no inline-image field at v1.0; silently dropped. * - `replyTo` — Scaleway has no `reply_to` field; emitted as a * `Reply-To` entry in `additional_headers`. */ send(input: EmailSendInput): Promise; /** * Resolve the region-scoped Scaleway endpoint. The region (default `fr-par`) * is interpolated into the PATH — Scaleway uses one host for every region. */ private resolveEndpoint; /** * Hand-build Scaleway's snake_case wire body from Thinwrap's `EmailSendInput`. * (locality) the structural wire translation is local to * this connector — `additional_headers` Record→array adapter and the nested * address-object shaping live here, not in shared middleware. */ private buildScalewayBody; /** * Map Scaleway 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 top-level `retryAfterSeconds` field per * Retry is consumer policy (no retryAfterSeconds field). */ private mapVendorError; }