Skip to content

feat: Add publisher domain metrics - #100

Open
emmy-devop wants to merge 1 commit into
mainfrom
em/domain-metrics
Open

feat: Add publisher domain metrics#100
emmy-devop wants to merge 1 commit into
mainfrom
em/domain-metrics

Conversation

@emmy-devop

@emmy-devop emmy-devop commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Requested by @wagnercosta

What

  • Synced the hand-written Python SDK against the API gateway DEV OpenAPI contract fetched from https://api.asknews.dev/openapi.json on 2026-08-04.
  • Added sync and async distribution methods for publisher metric totals and daily timeseries.
  • Added the three matching response DTOs and focused request/serialization tests.

Contract delta

  • OpenAPI version: 0.29.2 -> 0.29.2 (DEV currently has 58 operations and 278 schemas).
  • Added operations: GET /v1/distribution/stats/metrics, GET /v1/distribution/stats/metrics_timeseries.
  • Removed operations: none.
  • Added SDK schemas: DomainMetricsResponse, DomainMetricsDayItem, DomainMetricsTimeWindowResponse.
  • Existing SDK-supported operation signatures are unchanged; DEV's remaining differences are distribution-only or error-schema reference renumbering.

Version

The source package remains 0.13.56; versions and CHANGELOG.md are release-managed. This feat: commit is expected to produce 0.14.0 when merged.

How I tested

  • uv run --frozen pytest tests/api/test_distribution.py -q (6 passed)
  • uv run --frozen pytest -q (74 passed)
  • ruff check asknews_sdk
  • ruff format --check on all changed Python files
  • mypy asknews_sdk/api/distribution.py asknews_sdk/dto/distribution.py
  • git diff --check

Full-repository mypy was also inspected and still reports three pre-existing errors in unrelated dto/chat.py and api/wiki.py code.

Risk / rollback

Merging to main triggers release automation and publishes a new asknews release to PyPI. These two operations are present in DEV but not yet in the production gateway contract, so merge timing should be coordinated with the API rollout. OAuth callers must request the existing distribution scope explicitly; default scopes were intentionally left unchanged for compatibility. Roll back by reverting this commit.

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