feat(inboxes): accept path attachments on drafts
Ā
DI
11h ago+25+25+01234567890123456789-5-5-0123456789
Resend::Inboxes::Drafts.create and .update now document path attachments. The API accepts them (resend/resend-monorepo#13475, live). Spec: resend/resend-openapi#141. Node reference: resend/resend-node#1172 (released in 6.36.0).
Changes
- Drafts pass
attachmentsto the API unchanged, so no code change was needed. Thecreatedoc comment now says each attachment needs afilenameand eithercontent+content_typeor apathURL. Apathfile is downloaded when the request is made, andcontent_typedefaults to the downloaded file's type.updaterefers tocreate. - Specs for a
pathattachment on create and update. - Version 1.18.0 ā 1.19.0 (minor), in its own commit together with Gemfile.lock.
Verification
bundle exec rubocopfinds no offenses.bundle exec rake specruns 480 examples with 0 failures.- Live against api.resend.com through the SDK:
- create with
pathstoredinvoice.pdf(application/pdf, 80893 bytes) - update with
path+contentstored both files - an
ftp://path raisesInvalidRequestError(422)
- create with
Linear: DEV-2422
Summary by cubic
Documents path attachments for Resend::Inboxes::Drafts.create and .update. Attachments already pass through to the API unchanged, so this PR only updates the docs, adds specs, and bumps the version to 1.19.0.
- The
createdoc comment now says each attachment needs afilenameand eithercontentwithcontent_type, or apathURL that is downloaded when the request is made;content_typedefaults to the downloaded file's type, and an undownloadablepathreturns a 422. - Adds
pathattachment specs forcreateandupdate, using a placeholder URL.