feat: include stats in package detail API response#1479
feat: include stats in package detail API response#1479saurabhjain1592 wants to merge 2 commits intoopenclaw:mainfrom
Conversation
The toPublicPackage() function maps all package fields to the public response except stats. The schema has packageStatsValidator (downloads, installs, stars, versions) and the list endpoint already includes it via toPublicPackageListItem, but the detail endpoint does not. Add stats to toPublicPackage() return value and the corresponding PublicPackageDocLike type in the HTTP API layer. Fixes openclaw#1478
|
@saurabhjain1592 is attempting to deploy a commit to the Amantus Machina Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR adds
Confidence Score: 1/5Not safe to merge — the missing The intent of the PR is correct and the HTTP layer change is fine, but the
|
The previous commit added stats to the toPublicPackage return value but missed the PublicPackageDoc type definition, causing a TypeScript type mismatch.
Problem
GET /api/v1/packages/{name}returns package metadata but omits thestatsfield (downloads, installs, stars, versions), even though:packagestable schema includesstats: packageStatsValidatortoPublicPackageListItem/api/v1/skills/{slug}) returns stats for skillsThis means package/plugin authors have no way to see install or download counts for their packages through the API.
Fix
Two changes:
convex/packages.ts— addstats: pkg.statsto thetoPublicPackage()return value (the detail-view mapper that was missing it)convex/httpApiV1/packagesV1.ts— addstatsto thePublicPackageDocLiketype so the HTTP layer passes it throughThe list endpoint already includes stats, so this brings the detail endpoint to parity.
Before / After
Fixes #1478