Skip to content

fix: align models with Resend API, add email list/audience update, fix webhook signature#3

Merged
asielcabrera merged 2 commits into
mainfrom
migration/ios-macos-linux
May 30, 2026
Merged

fix: align models with Resend API, add email list/audience update, fix webhook signature#3
asielcabrera merged 2 commits into
mainfrom
migration/ios-macos-linux

Conversation

@asielcabrera
Copy link
Copy Markdown
Collaborator

Summary

Bug fixes and API alignment across models, clients, and example.

Changes

  • EmailAttachment: Removed disposition→path mapping (API path field is for URL attachments, not content-disposition). New model has optional content/filename/path/type.
  • ResendContact.email: Changed to String? — contact create response does not include email.
  • ResendRetrieveError.statusCode: Uses camelCase to match actual API response (API returns statusCode, not status_code).
  • WebhookSignature: Parser now supports v1, (legacy Resend), v1= (Svix), and mixed t=...,v1=sig token formats.
  • Sendable conformances: Added to all client protocols, HTTPRequest/HTTPResponse/HTTPMethod, and ResendClient.
  • EmailClient: Added list() and listAll() with cursor pagination.
  • AudienceClient: Added update(id:name:) via PATCH.
  • Package.swift: Added ResendVaporTests target.
  • Example: New project with RESEND_API_KEY/FROM_EMAIL/TO_EMAIL/DOMAIN env-var config, uses real email UUIDs.
  • Tests: Fixed test data to use statusCode, added client.webhooks access test, updated model tests for new attachment shape.

Verification

  • SDK validated against live Resend API with real API key
  • All 185 tests pass (34 suites, 0 failures)
  • SwiftLint clean (0 violations)
  • Send, attachment, tags, batch, list, listAll, webhook CRUD, webhook signature verification all confirmed working

…x webhook signature parser

- EmailAttachment: removed disposition->path mapping, added optional path/type fields
- ResendContact.email: changed to String? (create response omits email)
- ResendRetrieveError.statusCode: use camelCase (matches API response)
- WebhookSignature: support v1= (Svix), v1, (legacy), and mixed token formats
- Add Sendable conformances to all protocols, HTTPRequest/Response, HTTPMethod
- Add EmailClient.list() and listAll() with cursor pagination
- Add AudienceClient.update(id:name:) for PATCH audiences
- Add ResendVaporTests target to Package.swift
- Add example project with env-var config and real UUID usage
- Fix test data: use statusCode instead of status_code
- Add client.webhooks access test
@asielcabrera asielcabrera merged commit ddc7711 into main May 30, 2026
1 of 5 checks passed
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.

1 participant