Skip to content

Add public read endpoints to the extensions v2 API - #157

Merged
admdly merged 2 commits into
mainfrom
feat/extensions-v2-public-read
Jul 26, 2026
Merged

Add public read endpoints to the extensions v2 API#157
admdly merged 2 commits into
mainfrom
feat/extensions-v2-public-read

Conversation

@admdly

@admdly admdly commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds GET /extensions/v2/extensions (list, filterable by type and developer_id), GET /extensions/v2/extensions/{id}, and GET /extensions/v2/developers/{id} — all public/unauthenticated, closing the gap that previously forced callers who wanted browsing/read access to keep using v1.
  • Designed for v2 rather than mirrored from v1: extensions embed the full public developer profile (bio, avatar_url, URL, approved) inline instead of v1's stripped-down author shape, avoiding an N+1 fetch for marketplace-style UIs.
  • contact_email is deliberately excluded from every public response via a dedicated PublicDeveloperSchema / toPublicDeveloper() — not just an OpenAPI-doc distinction, actually stripped at the response boundary.
  • v1's badge/version endpoints are intentionally not replicated — they're display utilities with external README links, unrelated to the author→developer shape gap this PR closes.
  • No schema/migration changes needed; these are read-only queries against tables that already exist.

v2 previously only covered submission/moderation/ownership; browsing
extensions and developers still meant using v1's API and shape. Adds
GET /extensions (list, filterable by type/developer_id), GET
/extensions/{id}, and GET /developers/{id}, all public/unauthenticated
to match v1's open CORS policy.

Designed for v2 rather than mirroring v1: extensions embed the full
public developer profile (bio/avatar_url/URL/approved) inline instead
of v1's stripped-down author shape, and contact_email is explicitly
excluded from every public response via a dedicated PublicDeveloper
type. v1's badge/version endpoints aren't replicated here since
they're display utilities with external README links, unrelated to the
author/developer shape gap this closes.

Claude-Session: https://claude.ai/code/session_01Co1bu2gU5kEHN65KooNUHN
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
api 0aa3386 Commit Preview URL

Branch Preview URL
Jul 26 2026, 07:08 PM

@admdly admdly self-assigned this Jul 26, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/services/extensions/v2/extensions-database.ts Outdated
Comment thread src/services/extensions/v2/index.ts
Comment thread src/services/extensions/v2/interfaces.ts Outdated
Comment thread src/services/extensions/v2/interfaces.ts Outdated
…liding ids, dedupe release sorting

- extensions-database.ts: COALESCE(d.id, e.author_id) so a missing
  developer row (author_id isn't a hard FK) can never surface a null
  developer.id, which would violate the Extension schema's contract.
- interfaces.ts: reject "claims"/"unapproved" as developer ids — those
  are the only single-segment GET /developers/* static routes, and
  since GET /developers/{id} is registered after them, a developer
  literally named one of those words would always be shadowed by the
  moderation-only route instead of getting a usable public profile.
- Extract sortReleasesDescending into lib/releases.ts, shared by v1 and
  v2 instead of duplicated, and fix it to partition out non-semver tags
  before sorting rather than comparing them inline — the old try/catch
  comparator could report a tag as "equal" to two neighbors that
  weren't equal to each other, which breaks Array#sort's assumption of
  a total order and can leave later valid releases out of place.

Claude-Session: https://claude.ai/code/session_01Co1bu2gU5kEHN65KooNUHN

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 6 files (changes from recent commits).

Auto-approved: Adds public read endpoints matching v1 exposure, with a fix to release sorting; all read-only, no schema changes, and contact_email stripped. Implementation reviewed.

Re-trigger cubic

@admdly
admdly merged commit d9c27ba into main Jul 26, 2026
9 checks passed
@admdly
admdly deleted the feat/extensions-v2-public-read branch July 26, 2026 19:17
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