Skip to content

feat(v1): wrap the /api/v1 surface with RFC 9457 errors and cursor auto-pagination - #3

Merged
BSalaeddin merged 4 commits into
mainfrom
feat/v1-surface
Aug 18, 2026
Merged

BSalaeddin merged 4 commits into
mainfrom
feat/v1-surface

Conversation

@BSalaeddin

Copy link
Copy Markdown
Contributor

Extends the SDK to Sendly's new `/api/v1` surface (33 operations) plus the two legacy list-subscription ops that landed in the released spec. Additive only — zero breaking changes; version 0.1.0 → 0.2.0.

What's new

  • Resources: `campaigns` (10 ops incl. send/cancel/pause/resume/stats), `segments` (6), `workflows` (9, incl. executions), `analytics` (3), `usage` (1), v1 methods on `events` (`list`/`record`/`list_names`/`stats` — legacy `track` untouched), and legacy `lists.subscribe`/`lists.unsubscribe`.
  • RFC 9457 errors: `/api/v1/*` failures are `application/problem+json`; they map onto the same `SendlyError` subclasses as the legacy envelope, with additive `request_id` and `field_errors` attributes. Detection trusts content-type and falls back to document shape.
  • Cursor auto-pagination: `iter_*` generators on the 6 cursor-enveloped list ops (`{data, has_more, next_cursor}`), holding filters fixed per the API's cursor-fingerprint contract.
  • Idempotency: `idempotency_key` on exactly the two spec-declared ops — `campaigns.create` and `campaigns.send` (the spec deliberately omits it elsewhere).
  • v1 deletes return the real `{id, deleted}` body; `campaigns.send` accepts the optional `{scheduled_for}` body.

Verification

165 tests pass (84 new) · `ruff check` + `ruff format --check` clean · `mypy src` strict clean · contract test green with an empty not-implemented set (all 72 spec ops wrapped) · `python -m build` produces the 0.2.0 sdist+wheel. Webhook verifier untouched (zero diff). Release path: tag `v0.2.0` after merge — the tag workflow re-runs the full gate and publishes via OIDC trusted publishing.

Mirrors DevinoSolutions/sendly-js (same surface contract, reviewed for cross-language parity).

🤖 Generated with Claude Code

@BSalaeddin
BSalaeddin merged commit 263211f into main Aug 18, 2026
2 checks passed
@BSalaeddin
BSalaeddin deleted the feat/v1-surface branch August 18, 2026 19:34
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