Skip to content

feat(revenue): replace RapidAPI live queries with manual snapshots - #42

Merged
mlava merged 2 commits into
mainfrom
feat/rapidapi-manual-snapshots
Aug 3, 2026
Merged

feat(revenue): replace RapidAPI live queries with manual snapshots#42
mlava merged 2 commits into
mainfrom
feat/rapidapi-manual-snapshots

Conversation

@mlava

@mlava mlava commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

RapidAPI support gave a definitive answer (2026-08-04): no platform APIs exist for public-marketplace Hub data — the subscriptions query is Enterprise Hub / Environment Admin only, and the accidentally-public test endpoint the integration was verified against has been retired to private. Subscriber data for public listings lives solely in Studio Analytics dashboards, so the live integration can never work and would only ever have shown the caller's own subscriptions.

This converts the RapidAPI panel to manual snapshots (option chosen by the maintainer):

  • New rapidapi_snapshots table — date + active subscribers + optional paying count, one row per project per day (re-logging a day replaces it). rapidapi_connections is dropped. Migrations: d1 0046 (drop) + 0047 (create), pg 0023 + 0024.
  • Revenue page panel: latest-numbers tiles with the change since the previous snapshot, a quick log form (defaults to today), and a history table with per-row delete.
  • MCP: get_rapidapi_subscriptionsget_rapidapi_snapshots (latest + deltas + history; read-only).
  • Removed: the GraphQL Platform API client, the connection card and its settings section, and the RAPIDAPI_KEY / RAPIDAPI_GRAPHQL_URL env vars everywhere (.env.example, env.d.ts, alchemy). Spec 0014 records the whole story under "Why RapidAPI is manual".
  • RevenuePage.tsx shared tiles moved to revenueParts.tsx (file exceeded the 400-line lint budget); dashboard RevenueCard import updated.

Includes a standalone first commit fixing a test broken on main: tool-text-output.test.ts's cloudflare:workers mock lacked the waitUntil that get_backlinks_overview's snapshot sync (7857308) now calls.

Testing

  • Full suite: 1184 tests pass (new buildSnapshotReport unit tests; the previously-failing backlinks tool test now passes); tsc, oxlint, Prettier clean.
  • Stripe panel untouched.

🤖 Generated with Claude Code

mlava and others added 2 commits August 4, 2026 02:37
get_backlinks_overview started calling waitUntil for its snapshot sync
(7857308) but the tool-text-output mock only exported env, failing the
suite on main.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RapidAPI support confirmed (2026-08-04) there are no platform APIs for
public-marketplace Hub data — the subscriptions query is Enterprise Hub
only, and the accidentally-public test endpoint we had verified against
was retired to private. Subscriber numbers exist solely in Studio
Analytics dashboards.

The panel becomes manual snapshots: a rapidapi_snapshots table (one row
per project per day, re-logging replaces), a log form + latest-vs-
previous tiles + history on the Revenue page, and a get_rapidapi_snapshots
MCP tool. The GraphQL client, connection card/settings section, and
RAPIDAPI_* env vars are removed; rapidapi_connections is dropped.
RevenuePage's shared tiles move to revenueParts.tsx to stay under the
file-size lint budget.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mlava
mlava merged commit e0688ba into main Aug 3, 2026
@mlava
mlava deleted the feat/rapidapi-manual-snapshots branch August 3, 2026 16:37
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