Skip to content

Migrate to the restructured Extensions v2 API - #307

Merged
admdly merged 2 commits into
mainfrom
claude/extensions-v2-api-93c71c
Aug 8, 2026
Merged

Migrate to the restructured Extensions v2 API#307
admdly merged 2 commits into
mainfrom
claude/extensions-v2-api-93c71c

Conversation

@admdly

@admdly admdly commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Submissions are gone as a resource — an extension exists from creation, and review is a state of it rather than a parallel /submissions collection to reconcile. This updates the site for FOSSBilling/api#190's restructured contract.

Old New
POST /submissions POST /extensions → 201
POST /submissions (edit) PUT /extensions/{id} → 202
GET /submissions/mine GET /extensions/mine (one list, one cursor)
GET /extensions/mine/{id} (owner detail)
DELETE /extensions/{id} (withdraw, unpublished only)
GET /extensions/{id}/revisions (history)
GET /submissions/queue GET /moderation/extensions
POST /submissions/{id}/approve POST /extensions/{id}/revisions/{revisionId}/approve
POST /submissions/{id}/reject POST /extensions/{id}/revisions/{revisionId}/reject

Changes

  • openapi/extensions-v2.json + src/lib/api/generated/: regenerated against Lock file maintenance #190's branch preview (npm run api:update).
  • src/lib/api/client.ts: create/update/withdraw an extension, list/read owner extensions, list revision history, and moderate by extension id + revision id — replacing the submissions endpoints.
  • src/lib/extensions-data.ts: new getOwnedExtension adapter splits the owner detail response into published/pendingRevision/lastReview, matching the three independent state fields described in the API's README, rather than collapsing them into a single derived status.
  • src/lib/extension-form.ts (renamed from submission-form.ts): payloads no longer carry a developer object — the server derives it. A release is required whenever there's nothing already published to carry through (a brand new extension, or one being edited after rejection with nothing ever published).
  • src/components/ExtensionForm.astro (renamed from ExtensionSubmissionForm.astro).
  • Account pages: /account reads /extensions/mine directly and shows pending/rejected state inline per extension, instead of merging a separate submissions list. The edit page shows a banner and withholds the form while a revision is awaiting review, matching the API's one-pending-revision-at-a-time rule.
  • Moderation: routes move from account/moderate/[id]/ to account/moderate/[id]/[revisionId]/, since revisions are now addressed by extension id + revision id rather than a submission id.
  • Tests: rewritten for the new contract, plus new coverage for the endpoints that didn't exist before (update, withdraw, revision history, approve/reject by revision).

Submissions are no longer a separate resource — an extension exists from
creation and review is a state of it, not a parallel record to reconcile.
Regenerates the API client against FOSSBilling/api#190's branch preview and
updates every caller:

- api/client.ts: create/update/withdraw an extension, list/read owner
  extensions (published + pending_revision + last_review), list revision
  history, and moderate by extension id + revision id, replacing the
  submissions endpoints.
- extensions-data.ts: new getOwnedExtension adapter splits the owner detail
  response into published/pendingRevision/lastReview per the API's state
  table instead of collapsing them into a derived status.
- extension-form.ts (renamed from submission-form.ts): payloads no longer
  carry a developer object; a release is required whenever there's nothing
  already published to carry through (new extension, or edited after
  rejection with nothing ever published).
- Account pages: /account no longer merges a separate submissions list: one
  list from /extensions/mine with inline pending/rejected state. The edit
  page blocks with a banner while a revision is awaiting review, matching
  the api's one-pending-revision-at-a-time rule.
- Moderation: routes move from account/moderate/[id]/ to
  account/moderate/[id]/[revisionId]/, since revisions are now addressed by
  extension id + revision id, not a submission id.

npm run check, npm run test, and npm run format:check are all clean.
npm run api:check currently shows a diff since this was generated from
#190's branch preview, not production — re-run it once #190 merges and
deploys.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 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
extensions 07a1cbd Commit Preview URL

Branch Preview URL
Aug 08 2026, 02:03 PM

@admdly admdly self-assigned this Aug 8, 2026

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

Copy link
Copy Markdown

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 21 files

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

Re-trigger cubic

Comment thread src/lib/extension-form.ts
Comment thread src/pages/account/developer/index.astro
Comment thread src/lib/extension-form.ts
Comment thread src/pages/account/index.astro Outdated
- extension-form.ts: reject a new release when it duplicates an existing
  tag (would silently duplicate the entry on approval, since the api
  replaces the whole releases array verbatim) or when the extension is
  already at the api's 100-release cap, instead of submitting a payload
  the api would either mangle or 422 on.
- ConfirmDeleteDialog: add an optional formAction so a confirmation dialog
  can post somewhere other than the current page.
- New /account/extensions/[id]/withdraw.ts route + a "Withdraw Extension"
  danger-zone control on the edit page for extensions that have never been
  published. Previously withdrawExtension existed on the api client but
  had no UI control, so a developer whose only extension was pending or
  rejected-with-nothing-published had no way to clear it and delete their
  developer profile or account.
- account/index.astro: a rejected edit no longer shows a destructive
  "Rejected" badge when the extension is still live under its previous
  published content — that only reflects the latest edit attempt, not the
  extension itself. Live extensions with a rejected edit now show a
  neutral "Edit rejected" badge instead.

npm run check, npm run test (83 passing), and npm run format:check are
all clean.

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

Copy link
Copy Markdown

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: Migrates frontend to the restructured Extensions v2 API: endpoint renames, schema changes, new endpoints (withdraw, revision history). No new behavioral tradeoffs; the diff shows a systematic, test-covered migration.

Re-trigger cubic

@admdly
admdly merged commit ac6ff9c into main Aug 8, 2026
9 checks passed
@admdly
admdly deleted the claude/extensions-v2-api-93c71c branch August 8, 2026 14:46
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