Skip to content

effaced-resend

effaced-resend — the first-party Resend resolver for effaced.

class ResendResolver:
def __init__(api_key: str, *, base_url: str = _DEFAULT_BASE_URL, transport: httpx.BaseTransport | None = None, timeout: float = _DEFAULT_TIMEOUT) -> None

Exports and erases a subject’s Resend contact record.

Expects refs of kind "resend" (refs are routed to the resolver whose name equals their kind — ADR 0008) whose value is the contact’s email address as stored in Resend. Resend’s global-contacts API addresses contacts by email directly, so one call reaches the contact across every segment — no enumeration, no audience configuration.

Idempotency: a contact Resend no longer knows yields already_absent=True — success, never an error.

Deleting the contact does not touch Resend’s send history (which has no deletion API) and removes the contact’s unsubscribed preference with it — both are the controller’s data-map concern, not this resolver’s.

Error taxonomy (see effaced_resend.errors): 4xx responses other than 404 and 429 raise ResolverError; rate limits, 5xx, and connection faults propagate so the saga runner retries. A fresh httpx client is built per call — nothing loop- or connection-bound is cached on the instance (ADR 0006).

Fields:

  • covered_surface (CoveredSurface): The Resend contact PII this resolver claims to reach (AttestingResolver). Returns: RESEND_COVERED_SURFACE, built from the exporter’s field tuple so it cannot drift.
  • name (str): Stable resolver name recorded in manifests and audits.
async def erase_subject(ref: SubjectRef) -> ResolverErasure

Hard-delete the contact in Resend (Art. 17).

Args:

  • ref (SubjectRef): kind="resend", value=<contact email>.

Returns:

  • ResolverErasure — The outcome; already_absent=True if Resend already had
  • ResolverErasure — no such contact.

Raises:

  • ResolverError — The key is invalid or restricted, or the request was malformed — retrying cannot succeed.
async def export_subject(ref: SubjectRef) -> ResolverExport

Collect the contact’s Resend-held fields (Art. 15).

Args:

  • ref (SubjectRef): kind="resend", value=<contact email>.

Returns:

  • ResolverExport — The contact’s email, name fields, and unsubscribed
  • ResolverExport — flag when populated (the field set lives in
  • ResolverExport — mod:effaced_resend.export_records); empty when Resend
  • ResolverExport — holds no such contact.

Raises:

  • ResolverError — The key is invalid or restricted, or the request was malformed — retrying cannot succeed.