Skip to content

feat(inboxes): accept path attachments on drafts - #1172

Merged
dielduarte merged 2 commits into
canaryfrom
feature/dev-2419-node-sdk-internal
Oct 30, 2026
Merged

dielduarte merged 2 commits into
canaryfrom
feature/dev-2419-node-sdk-internal

Conversation

@dielduarte

@dielduarte dielduarte commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

resend.inboxes.drafts.create() and .update() now accept path attachments. The API change is live (resend/resend-monorepo#13475), and the spec is in resend/resend-openapi#141.

Changes

InboxDraftAttachmentOptions is now a union, so invalid shapes don't compile:

| { content: string | Buffer; path?: never; filename: string; contentType: string }
| { path: string; content?: never; filename: string; contentType?: string } // contentType defaults to the downloaded file's type

parseAttachments already maps path, so no runtime change was needed. The create/update doc comments now describe the path rules.

The exported name is unchanged, but it's now a type alias instead of an interface. Code that does interface X extends InboxDraftAttachmentOptions would stop compiling. I don't expect anyone to do that with a request options type.

Version: 6.35.0 → 6.36.0 (minor). The CLI and OSS MCP will pin 6.36.0.

Verification

  • pnpm lint, pnpm typecheck, pnpm test and pnpm build all pass.
  • New tests: create and update send path without content. A compile-time test rejects an attachment with no source, with both sources, or with content and no contentType.
  • Live against api.resend.com, using the built dist:
    • create with path stores invoice.pdf (application/pdf, 80893 bytes)
    • update with path + content stores both
    • an ftp:// path returns 422
    • send succeeds

Linear: DEV-2419


Summary by cubic

resend.inboxes.drafts.create() and .update() now accept path attachments, so drafts can reference a URL that the API downloads and stores instead of requiring inline content. This unlocks path attachment support for the CLI and MCP.

InboxDraftAttachmentOptions is now a union, so invalid shapes fail at compile time: each attachment needs either content with a contentType, or a path URL. The exported name is unchanged, but the type is now a type alias instead of an interface, which would break code that extends it. Version bumped to 6.36.0.

Written for commit 96713f7. Summary will update on new commits.

View guided diff

@pkg-pr-new

pkg-pr-new Bot commented Oct 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/resend@1172

commit: 96713f7

@klotty klotty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Adds path-attachment support to inbox draft create/update, with tests for pass-through and compile-time exclusivity. Bounded and clearly beneficial because the API feature is already live and the change is confined to SDK typing, docs, and versioning.

View guided diff | Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants