Skip to content

Document media upload flows - #2633

Merged
ascorbic merged 4 commits into
mainfrom
docs/media-upload-api
Aug 25, 2026
Merged

Document media upload flows#2633
ascorbic merged 4 commits into
mainfrom
docs/media-upload-api

Conversation

@khoinguyenpham04

Copy link
Copy Markdown
Collaborator

What does this PR do?

Corrects the public media upload documentation so it matches the current REST API and Media Library.

  • Documents the direct multipart upload path.
  • Documents the upload-target flow, including upload confirmation, responses, deduplication, and common errors.
  • Explains when an upload target is same-origin or a signed storage URL and prevents callers from sending EmDash credentials to another origin.
  • Updates the Media Library guide for the current multi-file upload UI, the 50 MB default limit, and the implemented search/type filters.
  • Replaces stale duplicate API examples with a link to the canonical REST reference.

This PR changes documentation only. It does not change runtime or admin behavior.

Related issue: None.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (not applicable: documentation-only change; existing focused tests pass)
  • User-visible strings in the admin UI are wrapped for translation (not applicable: no admin UI changes)
  • I have added and reviewed the user-facing changeset (not applicable: no published package changes)
  • New features link to an approved Discussion (not applicable: documentation correction, no new feature)

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: OpenAI Codex (GPT-5)

Screenshots / test output

  • pnpm typecheck
  • pnpm lint
  • pnpm format
  • pnpm --dir docs build
  • pnpm --dir packages/core exec vitest run tests/integration/astro/media-stream-upload.test.ts — 30 tests passed
  • pnpm --dir packages/core exec vitest run tests/unit/api/openapi.test.ts tests/unit/media/media-allowlist.test.ts — 30 tests passed

@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1085034

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://docs-media-upload-api.try.emdashcms.com, https://docs-media-upload-api-emdash-playground.emdash-cms.workers.dev (commit 1085034)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://1b09f0e7.try.emdashcms.com, https://1b09f0e7-emdash-playground.emdash-cms.workers.dev 1085034 2026-08-25T16:53:34.657Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9c2ebee5.try.emdashcms.com, https://9c2ebee5-emdash-playground.emdash-cms.workers.dev 941e194 2026-08-25T15:02:08.254Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://0744a698.try.emdashcms.com, https://0744a698-emdash-playground.emdash-cms.workers.dev 1ece852 2026-08-25T13:43:30.841Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://096497f5.try.emdashcms.com, https://096497f5-emdash-playground.emdash-cms.workers.dev 237fc44 2026-08-25T11:35:17.459Z Visit the dashboard ↗

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 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 Updated (UTC)
✅ Deployment successful!
View logs
docs 941e194 Aug 25 2026, 03:02 PM

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@2633

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@2633

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@2633

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@2633

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@2633

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@2633

emdash

npm i https://pkg.pr.new/emdash@2633

create-emdash

npm i https://pkg.pr.new/create-emdash@2633

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@2633

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@2633

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@2633

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@2633

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@2633

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@2633

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@2633

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@2633

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@2633

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@2633

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@2633

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@2633

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@2633

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@2633

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@2633

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@2633

commit: 1085034

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 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 Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-do 1085034 Aug 25 2026, 04:53 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 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 Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 1085034 Aug 25 2026, 04:53 PM

@khoinguyenpham04
khoinguyenpham04 marked this pull request as ready for review August 25, 2026 13:13

@emdashbot emdashbot 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.

This PR does the right thing: the existing public media upload docs were stale (JSON metadata endpoint, signed-URL-only narrative, 10 MB default), and the rewrite lines up with the current implementation. I checked the changed prose against the route handlers, storage adapters, schemas, authorization middleware, admin media UI, and the integration/openapi tests. The technical claims hold up: the 50 MB default, the two upload paths, the same-origin fallback for local/R2 storage, the media:write token scope, the optional multipart fields, the pending/ready lifecycle, the deduplication response, and the error statuses all match the code.

Only one small documentation issue surfaced: the new ### Create media heading is sentence case while every other media endpoint heading (List Media, Get Media, Update Media, Delete Media) is title case. That inconsistency makes the reference harder to scan. Fixing it keeps the page consistent without changing meaning.

No changeset is needed (docs-only change), and I saw no AGENTS.md convention violations.

Comment thread docs/src/content/docs/reference/rest-api.mdx Outdated
Co-authored-by: emdashbot[bot] <273199577+emdashbot[bot]@users.noreply.github.com>
@github-actions github-actions Bot added the review/needs-rereview Author pushed changes since the last review label Aug 25, 2026
@ascorbic
ascorbic enabled auto-merge (squash) August 25, 2026 15:58
@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-rereview Author pushed changes since the last review labels Aug 25, 2026
@ascorbic
ascorbic merged commit f7ee61d into main Aug 25, 2026
46 checks passed
@ascorbic
ascorbic deleted the docs/media-upload-api branch August 25, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants