Skip to content

refactor(types): align attachment types with monorepo public-api#855

Merged
gabrielmfern merged 1 commit intocanaryfrom
refactor/align-attachment-types
Feb 27, 2026
Merged

refactor(types): align attachment types with monorepo public-api#855
gabrielmfern merged 1 commit intocanaryfrom
refactor/align-attachment-types

Conversation

@lucasfcosta
Copy link
Contributor

@lucasfcosta lucasfcosta commented Feb 25, 2026

This PR mostly refactors the types for the Node SDK so they align more closely with the API and so that there's less repetition:

  • Rename Attachment → AttachmentData and add JSDoc with correct endpoint paths
  • Remove redundant ListAttachmentsApiResponse (duplicate of ListAttachmentsResponseSuccess)
  • Extract InboundAttachment interface for raw DB metadata in GET /inbounds/{id}
  • Fix GetReceivingEmailResponseSuccess: headers is nullable, raw is optional

My request for reviewers: can you double check if I missed anything comparing this to the API? I compared myself and it looks correct, but given we're iterating on this it would be worth a second pass.

Important note: the types are indeed not equal. That's because inbound attachments that appear on the list don't get a download URL (that's intended) and we cannot make both the inbound and outbound type 100% equal due to breaking changes that would be needed.


Summary by cubic

Refactors attachment types to match the public API and clearly separate signed-URL attachments from inbound metadata. This reduces duplication and fixes mismatches in the receiving email response.

  • Refactors
    • Renamed Attachment to AttachmentData with JSDoc for signed-URL endpoints.
    • Removed ListAttachmentsApiResponse; use ListAttachmentsResponseSuccess for sending and receiving lists.
    • Added InboundAttachment for GET /inbounds/{id} (raw DB metadata, nullable fields).
    • Fixed GetReceivingEmailResponseSuccess: headers can be null; raw is optional and can be null.
    • Updated list/get attachment types, exports, and tests.

Written for commit d695be8. Summary will update on new commits.

@lucasfcosta lucasfcosta requested a review from a team as a code owner February 25, 2026 11:52
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 10 files

Confidence score: 5/5

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

- Rename Attachment → AttachmentData and add JSDoc with correct endpoint paths
- Remove redundant ListAttachmentsApiResponse (duplicate of ListAttachmentsResponseSuccess)
- Extract InboundAttachment interface for raw DB metadata in GET /inbounds/{id}
- Fix GetReceivingEmailResponseSuccess: headers is nullable, raw is optional
@gabrielmfern gabrielmfern force-pushed the refactor/align-attachment-types branch from b43d63f to d695be8 Compare February 27, 2026 19:03
@gabrielmfern gabrielmfern merged commit af22de3 into canary Feb 27, 2026
9 of 11 checks passed
@gabrielmfern gabrielmfern deleted the refactor/align-attachment-types branch February 27, 2026 19:07
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