Repository navigation
feat(web): consume v2 API for the config-resource bundle - #228
Merged
Merged
Conversation
Migrate the dashboard off the v1 client (`MapleApiAtomClient`) onto the already-shipped v2 endpoints (`MapleApiV2AtomClient`) for the four config-resource groups whose v2 surface (#224) was built but still dark: - ingest_keys (get -> retrieve, reroll* -> roll*) - attribute_mappings (v1 ingestAttributeMappings) - scrape_targets - recommendations (v1 recommendationIssues) Reads stay refetch-based (no txid): manual useAtomRefresh for mappings/recommendations/ingest keys, reactivityKeys for scrape targets. Both clients share appRegistry, so the PlanetScale card's v1 integrations mutations still invalidate the migrated v2 scrape-target list. Notable deltas handled beyond mechanical snake_case/param renames: - v2 payload schemas are Schema.Struct -> pass plain snake_case objects (no `new V2…Params`). - Prefixed public IDs round-trip to raw internal IDs at the client boundary, so row ids and the /recommendations/$recommendationKey route param are unchanged. - v2 lists are cursor-paginated (default 20): attribute_mappings and recommendations page through all pages via a runtime.atom cursor loop; scrape_targets keeps .query(...) with limit:100 to preserve its reactivityKeys invalidation. Left as-is: alert_incidents and scrape_targets listChecks (Electric), and the integrations OAuth group in the catalog (v1). Deleting the now-unused v1 groups is a follow-up. Verified: apps/web typecheck clean; browser e2e for all four groups — reads + create/update/delete/probe/dismiss/reopen hit /v2/... with correct snake_case shapes and refetch reconciliation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Your Pullfrog Router balance is exhausted. You have a card on file but auto-reload is disabled, so runs paused once your balance went past the overdraft buffer. Top up balance → · Enable auto-reload →
|
This branch was previously deployed
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.

What
Migrates the dashboard off the v1 client (
MapleApiAtomClient) onto the already-shipped v2 endpoints (MapleApiV2AtomClient) for the four config-resource groups whose v2 surface landed in #224 but was never consumed by the UI:ingestKeys(get,reroll*)ingestKeys(retrieve,roll*)ingestAttributeMappingsattributeMappingsscrapeTargetsscrapeTargetsrecommendationIssuesrecommendationsWhy
The
#224config-resource bundle was built, tested, and documented, but the dashboard still called the v1 client for all of it — so the v2 write path was effectively dark. This wires the UI to it, matching the documented convention that each v1 group is deleted once nothing consumes it.Notable deltas (beyond mechanical snake_case / param renames)
Schema.Struct, so mutations pass plain snake_case objects (notnew V2…Params({...})).PublicIdcodec decodes responses back to raw UUIDs and re-encodes on request). Sorow.idand the/recommendations/$recommendationKeyroute param are unchanged from v1.attributeMappings+recommendationspage through all pages via aruntime.atomcursor loop (module singletons, souseAtomRefreshstill shares one fetch).scrapeTargetskeeps.query(...)withlimit: 100to preserve itsreactivityKeysinvalidation (aruntime.atomwould drop it).useAtomRefreshfor mappings/recommendations/ingest keys;reactivityKeysfor scrape targets. Both clients shareappRegistry, so the PlanetScale card's v1integrationsmutations still invalidate the migrated v2 scrape-target list.Out of scope (intentionally left)
alert_incidentsandscrapeTargets.listChecksstay on ElectricSQL shapes.integrationsOAuth group in the catalog (Cloudflare/PlanetScale/Hazel/GitHub status) stays v1.Verification
bun typecheck(apps/web): clean.attributeMappings.update(PATCH),recommendations.dismiss/reopen,scrapeTargets.create/probe/delete— all→ 200, hitting/v2/...with refetch reconciliation. ID round-trip verified (route links + Target ID show raw UUIDs; request paths showamap_/rec_/scrp_encodings).🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.