Draft
Conversation
Implements the /rest/v1.1/sites/{site_id}/stats/emails/summary endpoint
with params (period, quantity, sort_field, sort_order), response types,
unit tests, JSON fixtures, and e2e integration tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements the /rest/v1.1/sites/{site_id}/stats/subscribers endpoint
with params (unit, quantity, date, stat_fields), response types with
helper methods for extracting subscribers and paid subscribers data,
unit tests, JSON fixtures for day/week/month/year/empty responses,
and e2e integration tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds the /wpcom/v2/sites/{site_id}/subscribers_by_user_type endpoint
to the existing subscribers module. Includes params (per_page, page,
user_type, sort), reuses the existing ListSubscribersResponse type,
unit tests, and JSON test fixtures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The API can return invalid dates like "-001-11-30T00:00:00+00:00" for some subscribers. Change date_subscribed to Option<WpGmtDateTime> with a lenient deserializer that returns None for unparseable dates instead of failing the entire response. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add three new WP.com API endpoints to support the Subscribers tab feature:
/rest/v1.1/sites/{site_id}/stats/emails/summary/rest/v1.1/sites/{site_id}/stats/subscribers/wpcom/v2/sites/{site_id}/subscribers_by_user_typeChanges
Stats emails summary
StatsEmailsSummaryParamswithperiod,quantity,sort_field, andsort_orderparametersStatsEmailsSummaryResponseandStatsEmailsSummaryPostresponse typesWpDerivedRequestmacro withWpComNamespace::RestV1_1WpComApiRequestBuilderandWpComApiClientStats subscribers
StatsSubscribersParamswithunit,quantity, andstat_fields(comma-joined) parametersStatsSubscribersResponsereusingStatsVisitsDataValuefor the fields+data array patternsubscribers_data()andsubscribers_paid_data()with#[uniffi::export]WpComNamespace::RestV1_1WpComApiRequestBuilderandWpComApiClientSubscribers by user type
SubscribersByUserTypeParamswithuser_type,per_page,page, andsortparametersSubscribersByUserTypeUserTypeandSubscribersByUserTypeSortFieldenumsListSubscribersResponsetypeListSubscribersByUserTypevariant toSubscribersRequestwithWpComNamespace::V2Test plan
cargo buildsucceedscargo test --lib -p wp_api— all new unit tests passcargo fmtclean🤖 Generated with Claude Code