@volter/twin-sendgrid
v0.1.37
Published
Local SendGrid twin — the vendor's complete 391-operation v3 surface compiled from its first-party OpenAPI set (twilio/sendgrid-oai), served with honest loud gaps; mail-send modeled and verified against the real @sendgrid/mail SDK. Built on @volter/world-
Readme
@volter/twin-sendgrid
Legacy connector helpers: this package still has callable helpers using the retired v1
syncPullAPI. Those paths require migration before use on the current kernel; older helper descriptions below do not establish current compatibility. Check the generated index for protocol standing and use the shared model for current state semantics.
Local SendGrid twin — the vendor's complete 391-operation v3 surface, compiled from
SendGrid's first-party OpenAPI set (twilio/sendgrid-oai,
all 46 tsg_*_v3.json files) by the assembly line's S2 station (scripts/spec-compile.ts),
plus 8 SDK-only legacy operations grounded by path literals in the shipped
@sendgrid/client|mail@8 JS that the published spec set never declares (legacy
mail_settings bcc/plain_content/spam_check, partner_settings/new_relic, the
scopes/requests approval flow, subusers/{name}/monitor) — recorded per the
SDK-beats-spec precedent.
This pack is assembly-line article #1 (var/line/sendgrid, scripts/line.ts): the
surface table, router data, and all-todo manifest inventory are generated; semantics are
hand-authored per demanded operation and flipped done only with a real verify().
Coverage
Honest and low by construction: mail send is modeled and verified against the real,
unmodified @sendgrid/mail SDK (202 + x-message-id + empty body, message folded into
kernel state, SendGrid's {errors:[{message,field,help}]} envelope on rejection); every
other spec-declared operation answers a loud vendor-shaped 404 naming the gap — never a
fake success. See sendgrid-capabilities.ts for the full Done/todo ledger and
spec-sources.json for grounding provenance.
- Done:
POST /v3/mail/send(validation per the spec's required fields plus the vendor's from/personalizations rules), fail-loudly conformance, vendor-shaped 404s. - Planned (tier-ranked todos): suppressions family + send-time enforcement, deterministic delivery lifecycle + ECDSA-signed event webhook, templates + versions, api keys, scheduled sends, stats; activity/outbox mirror (postmark/resend precedent); connector pull beyond the four suppression surfaces.
- Every gap above is a todo; nothing is excluded.
Hosts
api.sendgrid.com, api.eu.sendgrid.com (setDataResidency('eu')), and
email.twilio.com (setTwilioEmailAuth) — all three ship as literals in the SDK and are
claimed by the injector.
The store door
SendGrid's v3 mail send is fire-and-forget: nothing in the vendor's surface lists what was sent.
The twin's outbox is therefore read through its own named projection, GET /twin/store/outbox —
the read-only door the programming model gives a twin whose vendor has no listing endpoint (the
mailgun precedent). It is deliberately out of the capability manifest: counting scaffolding
the vendor does not have would pad the denominator. GET /twin names it under stores.
Run
world-sendgrid serve --port 47391 # or: bun packages/twin/sendgrid/src/cli.ts serve
world-sendgrid conformance
world-sendgrid ops # print all 399 routed operations