Capability first · transport second

MailTransport.mjs

Sends one complete mail report to a normalized HTTP(S) endpoint with timeout and complete response handling.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Sends one complete mail report to a normalized HTTP(S) endpoint with timeout and complete response handling.

  • Artifact
    MailTransport.mjs · esm
  • Classification
    public first party
  • Availability
    Browser/server with fetch + cloud
  • Normalization
    Endpoint, timeout, cancellation, network, HTTP, and response-contract errors are normalized.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/MailTransport.mjs';

normalizeMailEndpoint() is pure. sendMailReport() performs one HTTP(S) POST with same-origin credentials, no-referrer, redirect rejection, idempotency/app headers, an explicit caller timeout when supplied, and reads the complete response.

Application-facing behavior: MailTransportError, normalizeMailEndpoint(), serializeMailReport(), and sendMailReport().

Protocol and host implementation

HTTP(S) fetch + AbortController This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
MailTransportErrorclassclass MailTransportError extends Error
normalizeMailEndpointfunctionfunction normalizeMailEndpoint(endpoint,base=globalThis.location?.href)endpoint,base=globalThis.location?.href
serializeMailReportfunctionfunction serializeMailReport(report)report
sendMailReportfunctionasync function sendMailReport({ appKey, appName, endpoint, fetchImpl=globalThis.fetch, report, reportKey, requestTimeout=null, serializedReport, signal, }){ appKey, appName, endpoint, fetchImpl=globalThis.fetch, report, reportKey, requestTimeout=null, serializedReport, signal, }
CallableKindExact public signatureParameter syntax
normalizeMailEndpointexported-functionfunction normalizeMailEndpoint(endpoint,base=globalThis.location?.href)endpoint,base=globalThis.location?.href
sendMailReportexported-functionasync function sendMailReport({ appKey, appName, endpoint, fetchImpl=globalThis.fetch, report, reportKey, requestTimeout=null, serializedReport, signal, }){ appKey, appName, endpoint, fetchImpl=globalThis.fetch, report, reportKey, requestTimeout=null, serializedReport, signal, }
MemberKindExact public declarationParameter syntax
MailTransportError.constructorconstructorconstructor(message,{cause,code='MAIL_TRANSPORT_ERROR',details=null,retryable=false, retryAfterMs=0,statusCode=0,uncertain=false}={})message,{cause,code='MAIL_TRANSPORT_ERROR',details=null,retryable=false, retryAfterMs=0,statusCode=0,uncertain=false}={}

Parameter meanings and results

normalizeMailEndpoint(endpoint,base?) returns an absolute HTTPS or loopback-HTTP URL without credentials/query/fragment. sendMailReport({appKey?,appName,endpoint,fetchImpl?,report,reportKey,requestTimeout=null,serializedReport?,signal?}) resolves the complete provider response plus normalized requestId, sent, partial, uncertain, status, statusCode, optional providerId, and retryAfterMs for the exact 202/207 response contract.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

This artifact has no additional documented lifecycle event flow.

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

  • MailTransportError extends Error

Documented failure behavior

  • Uncoded Error for invalid endpoint, identity, key, timeout, report, timeout/network/HTTP failure, or an unreadable/invalid success response.

Availability and capabilities

Browser/server with fetch + cloud. Endpoint, timeout, cancellation, network, HTTP, and response-contract errors are normalized.

None; this is direct fetch transport. Core mail.send remains separate.

Contract example

JavaScript
import {normalizeMailEndpoint} from '/arcane/modules/MailTransport.mjs';

console.log(normalizeMailEndpoint('/v1/mail', 'https://mail.example.com/'));

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.