feat(revenue): replace RapidAPI live queries with manual snapshots - #42
Merged
Conversation
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>
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.
Summary
RapidAPI support gave a definitive answer (2026-08-04): no platform APIs exist for public-marketplace Hub data — the
subscriptionsquery 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):
rapidapi_snapshotstable — date + active subscribers + optional paying count, one row per project per day (re-logging a day replaces it).rapidapi_connectionsis dropped. Migrations: d10046(drop) +0047(create), pg0023+0024.get_rapidapi_subscriptions→get_rapidapi_snapshots(latest + deltas + history; read-only).RAPIDAPI_KEY/RAPIDAPI_GRAPHQL_URLenv vars everywhere (.env.example, env.d.ts, alchemy). Spec 0014 records the whole story under "Why RapidAPI is manual".RevenuePage.tsxshared tiles moved torevenueParts.tsx(file exceeded the 400-line lint budget); dashboardRevenueCardimport updated.Includes a standalone first commit fixing a test broken on
main:tool-text-output.test.ts'scloudflare:workersmock lacked thewaitUntilthatget_backlinks_overview's snapshot sync (7857308) now calls.Testing
buildSnapshotReportunit tests; the previously-failing backlinks tool test now passes); tsc, oxlint, Prettier clean.🤖 Generated with Claude Code