@openrails/contentkit-ui 0.68.1 → 0.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +17 -13
  2. package/dist/client/content/comments.js +3 -3
  3. package/dist/client/content/comments.js.map +1 -1
  4. package/dist/client/content/posts.d.ts +16 -8
  5. package/dist/client/content/posts.js +5 -13
  6. package/dist/client/content/posts.js.map +1 -1
  7. package/dist/client/content/reactions.js +4 -4
  8. package/dist/client/content/reactions.js.map +1 -1
  9. package/dist/client/content/types.d.ts +2 -2
  10. package/dist/client/content/types.js +1 -1
  11. package/dist/client/content/types.js.map +1 -1
  12. package/dist/client/generated/error-codes.d.ts +1 -1
  13. package/dist/client/generated/error-codes.js +4 -0
  14. package/dist/client/generated/error-codes.js.map +1 -1
  15. package/dist/client/generated/routes.d.ts +2 -54
  16. package/dist/client/generated/routes.js +2 -74
  17. package/dist/client/generated/routes.js.map +1 -1
  18. package/dist/client/generated/wire.d.ts +5 -1
  19. package/dist/client/generated/wire.js.map +1 -1
  20. package/dist/client/index.d.ts +1 -1
  21. package/dist/client/media/client.d.ts +7 -5
  22. package/dist/client/media/client.js +1 -1
  23. package/dist/client/media/client.js.map +1 -1
  24. package/dist/client/media/rules.d.ts +2 -2
  25. package/dist/client/media/rules.js +1 -5
  26. package/dist/client/media/rules.js.map +1 -1
  27. package/dist/client.js +5 -5
  28. package/dist/locales/de.js +1 -0
  29. package/dist/locales/de.js.map +1 -1
  30. package/dist/locales/en.d.ts +1 -0
  31. package/dist/locales/en.js +1 -0
  32. package/dist/locales/en.js.map +1 -1
  33. package/dist/locales/es.js +1 -0
  34. package/dist/locales/es.js.map +1 -1
  35. package/dist/locales/ja.js +1 -0
  36. package/dist/locales/ja.js.map +1 -1
  37. package/dist/locales/ko.js +1 -0
  38. package/dist/locales/ko.js.map +1 -1
  39. package/dist/locales/zh.js +1 -0
  40. package/dist/locales/zh.js.map +1 -1
  41. package/dist/react/posts.d.ts +9 -7
  42. package/dist/react/posts.js +132 -99
  43. package/dist/react/posts.js.map +1 -1
  44. package/dist/react/public.d.ts +2 -2
  45. package/dist/react/public.js +7 -4
  46. package/dist/react/public.js.map +1 -1
  47. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","names":[],"sources":["../../../src/client/generated/routes.ts"],"sourcesContent":["// Generated by `go generate ./internal/contract` from ContentKit's route catalog. Do not edit.\n\nexport type ContentKitModule = \"content\" | \"upload\" | \"media\" | \"codes\" | \"taxonomy\";\n\n// Each module's sub-path under the one mount (contentkit.Runtime.Handler).\nexport const CONTENTKIT_MODULES: Readonly<Record<ContentKitModule, string>> = {\n content: \"\",\n upload: \"/media/upload\",\n media: \"/media\",\n codes: \"/codes\",\n taxonomy: \"/taxonomy\",\n};\n\nexport type ContentKitRoute = {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n module: ContentKitModule;\n // The path from the module's mount: CONTENTKIT_MODULES[module] + path under the one mount.\n path: string;\n // public: the actor is optional; user: a signed-in actor; staff: the host permission.\n auth: \"public\" | \"user\" | \"staff\";\n // A staff route's content.Perms field.\n permission: string | null;\n query: readonly string[];\n // wire.ts type names (or a content type): the JSON body, and each success by status.\n request: string | null;\n responses: Readonly<Record<number, string | null>>;\n // The route's own codes, and the shared sets (CONTENTKIT_ERROR_SETS) it also answers.\n errors: readonly string[];\n errorSets: readonly string[];\n};\n\nexport const CONTENTKIT_ROUTES = [\n { method: \"GET\", module: \"content\", path: \"/config\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Config\" }, errors: [], errorSets: [\"module:content\"] },\n { method: \"GET\", module: \"content\", path: \"/posts\", auth: \"public\", permission: null, query: [\"language\", \"sort\", \"limit\", \"offset\"], request: null, responses: { 200: \"Post[]\" }, errors: [], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/posts/admin\", auth: \"staff\", permission: \"PostWrite\", query: [\"language\", \"draft\", \"deleted\", \"q\", \"limit\", \"offset\"], request: null, responses: { 200: \"Post[]\" }, errors: [], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/posts/{id}\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Post\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts\", auth: \"staff\", permission: \"PostWrite\", query: [], request: \"PostInput\", responses: { 201: \"Post\", 202: \"Post\" }, errors: [\"conflict\", \"forbidden\", \"moderation_rejected\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PATCH\", module: \"content\", path: \"/posts/{id}\", auth: \"staff\", permission: \"PostWrite\", query: [], request: \"PostInput\", responses: { 200: \"Post\", 202: \"Post\" }, errors: [\"conflict\", \"forbidden\", \"moderation_rejected\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/posts/{id}\", auth: \"staff\", permission: \"PostWrite\", query: [], request: null, responses: { 204: null }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts/{id}/restore\", auth: \"staff\", permission: \"PostWrite\", query: [], request: null, responses: { 200: \"Post\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts/{id}/like\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Post\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts/{id}/dislike\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Post\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts/{id}/neutral\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Post\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/posts/{id}/cover\", auth: \"staff\", permission: \"PostWrite\", query: [], request: \"ImageInput\", responses: { 200: \"PostCover\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts/{id}/images\", auth: \"staff\", permission: \"PostWrite\", query: [], request: \"ImageInput\", responses: { 200: \"InlineImage\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/{kind}/{id}/comments\", auth: \"public\", permission: null, query: [\"sort\", \"limit\", \"offset\"], request: null, responses: { 200: \"Comment[]\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/comments\", auth: \"public\", permission: null, query: [], request: \"CommentInput\", responses: { 201: \"Comment\", 202: \"Comment\" }, errors: [\"comment_banned\", \"comment_too_long\", \"forbidden\", \"moderation_rejected\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/comments/latest\", auth: \"public\", permission: null, query: [\"limit\", \"offset\"], request: null, responses: { 200: \"FeedItem[]\" }, errors: [], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/comments/admin\", auth: \"staff\", permission: \"CommentModerate\", query: [\"content_kind\", \"limit\", \"offset\"], request: null, responses: { 200: \"AdminComment[]\" }, errors: [], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/comments/{cid}/restore\", auth: \"staff\", permission: \"CommentModerate\", query: [], request: null, responses: { 200: \"Restored\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/comments/{cid}/replies\", auth: \"public\", permission: null, query: [\"limit\", \"offset\"], request: null, responses: { 200: \"Comment[]\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"PATCH\", module: \"content\", path: \"/comments/{cid}\", auth: \"public\", permission: null, query: [], request: \"CommentEdit\", responses: { 200: \"Comment\", 202: \"Comment\" }, errors: [\"comment_banned\", \"comment_too_long\", \"conflict\", \"forbidden\", \"moderation_rejected\", \"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/comments/{cid}\", auth: \"public\", permission: null, query: [], request: null, responses: { 204: null }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/comments/{cid}/like\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/comments/{cid}/dislike\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/comments/{cid}/neutral\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/like\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/dislike\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/neutral\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/{kind}/{id}/reaction\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/{kind}/{id}/reaction\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/favorites\", auth: \"user\", permission: null, query: [\"limit\", \"offset\"], request: null, responses: { 200: \"FavoriteItem[]\" }, errors: [], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/favorite\", auth: \"user\", permission: null, query: [], request: null, responses: { 200: \"FavoriteState\" }, errors: [\"forbidden\", \"not_found\", \"rate_limited\"], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/{kind}/{id}/favorite\", auth: \"user\", permission: null, query: [], request: null, responses: { 200: \"FavoriteState\" }, errors: [\"forbidden\", \"invalid_request\", \"rate_limited\"], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/{kind}/{id}/favorite\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"FavoriteState\" }, errors: [\"invalid_request\", \"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/polls\", auth: \"public\", permission: null, query: [\"language\", \"month\", \"date\", \"limit\", \"offset\"], request: null, responses: { 200: \"Poll[]\" }, errors: [], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/polls/admin\", auth: \"staff\", permission: \"PollWrite\", query: [\"language\", \"month\", \"date\", \"limit\", \"offset\"], request: null, responses: { 200: \"Poll[]\" }, errors: [], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/polls/{id}\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Poll\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/polls\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"PollInput\", responses: { 201: \"Poll\" }, errors: [\"not_configured\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PATCH\", module: \"content\", path: \"/polls/{id}\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"PollUpdate\", responses: { 200: \"Poll\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/polls/{id}\", auth: \"staff\", permission: \"PollWrite\", query: [], request: null, responses: { 204: null }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/polls/{id}/vote\", auth: \"public\", permission: null, query: [], request: \"PollVote\", responses: { 200: \"Poll\" }, errors: [\"forbidden\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/polls/{id}/answer\", auth: \"user\", permission: null, query: [], request: \"PollAnswerInput\", responses: { 200: \"Poll\" }, errors: [\"forbidden\", \"not_found\", \"rate_limited\"], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/polls/{id}/image\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"ImageInput\", responses: { 200: \"PollImage\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/polls/{id}/options\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"PollOptionPatch\", responses: { 201: \"PollOption\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PATCH\", module: \"content\", path: \"/polls/{id}/options/{oid}\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"PollOptionPatch\", responses: { 200: \"PollOption\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/polls/{id}/options/{oid}\", auth: \"staff\", permission: \"PollWrite\", query: [], request: null, responses: { 204: null }, errors: [\"invalid_request\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/polls/{id}/options/{oid}/image\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"ImageInput\", responses: { 200: \"PollImage\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/comment-bans\", auth: \"user\", permission: null, query: [\"limit\", \"offset\"], request: null, responses: { 200: \"CommentBan[]\" }, errors: [], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/comment-bans/{user}\", auth: \"user\", permission: null, query: [], request: \"BanInput\", responses: { 200: \"CommentBan\" }, errors: [], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/comment-bans/{user}\", auth: \"user\", permission: null, query: [], request: null, responses: { 204: null }, errors: [], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/global-comment-bans\", auth: \"staff\", permission: \"CommentBan\", query: [\"limit\", \"offset\"], request: null, responses: { 200: \"CommentBan[]\" }, errors: [\"unauthorized\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/global-comment-bans/{user}\", auth: \"staff\", permission: \"CommentBan\", query: [], request: \"BanInput\", responses: { 200: \"CommentBan\" }, errors: [\"unauthorized\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/global-comment-bans/{user}\", auth: \"staff\", permission: \"CommentBan\", query: [], request: null, responses: { 204: null }, errors: [\"unauthorized\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/{kind}/{id}/can-comment\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"CommentStanding\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/moderation/held\", auth: \"staff\", permission: \"ModerationReview\", query: [\"kind\", \"cursor\", \"limit\"], request: null, responses: { 200: \"HeldPage\" }, errors: [], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/moderation/{kind}/{id}/resolve\", auth: \"staff\", permission: \"ModerationReview\", query: [], request: \"ResolveInput\", responses: { 200: \"ReviewOutcome\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/presign\", auth: \"user\", permission: null, query: [], request: \"PresignBody\", responses: { 200: \"PresignReply\" }, errors: [\"conflict\", \"forbidden\", \"not_found\", \"quota_exceeded\", \"rate_limited\", \"too_large\", \"too_many_files\", \"type_not_allowed\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/parts\", auth: \"user\", permission: null, query: [], request: \"PartsBody\", responses: { 200: \"PartsReply\" }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/parts/list\", auth: \"user\", permission: null, query: [], request: \"TicketBody\", responses: { 200: \"PartsReply\" }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/complete\", auth: \"user\", permission: null, query: [], request: \"TicketBody\", responses: { 200: \"CompleteReply\" }, errors: [\"checksum_mismatch\", \"forbidden\", \"incomplete\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/abort\", auth: \"user\", permission: null, query: [], request: \"TicketBody\", responses: { 204: null }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/commit\", auth: \"user\", permission: null, query: [], request: \"CommitBody\", responses: { 200: \"CommitReply\" }, errors: [\"conflict\", \"forbidden\", \"image_too_small\", \"not_found\", \"not_uploaded\", \"quota_exceeded\", \"rate_limited\", \"too_large\", \"too_many_files\", \"type_not_allowed\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"GET\", module: \"upload\", path: \"/frame\", auth: \"user\", permission: null, query: [\"kind\", \"id\", \"path\", \"t\", \"w\"], request: null, responses: { 200: \"image/jpeg\" }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"GET\", module: \"media\", path: \"/presets\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"PresetRule[]\" }, errors: [], errorSets: [\"module:media\"] },\n { method: \"GET\", module: \"media\", path: \"/{kind}/{id}\", auth: \"public\", permission: null, query: [\"prefix\", \"offset\", \"limit\", \"download\", \"editor\"], request: null, responses: { 200: \"ReadResult\" }, errors: [], errorSets: [\"module:media\", \"request\"] },\n { method: \"GET\", module: \"media\", path: \"/{kind}/{id}/hls/{path...}\", auth: \"public\", permission: null, query: [\"audio\", \"subs\"], request: null, responses: { 200: \"application/vnd.apple.mpegurl\" }, errors: [], errorSets: [\"module:media\", \"request\"] },\n { method: \"GET\", module: \"codes\", path: \"/{code}\", auth: \"public\", permission: null, query: [\"lang\"], request: null, responses: { 200: \"Resolved\" }, errors: [\"gone\", \"not_found\"], errorSets: [\"module:codes\", \"request\"] },\n { method: \"GET\", module: \"taxonomy\", path: \"/nodes\", auth: \"staff\", permission: \"Taxonomy\", query: [\"kind\", \"state\", \"id\", \"slug\", \"language\", \"language_mode\", \"name_prefix\", \"q\", \"content_kind\", \"min_count\", \"sort\", \"cursor\", \"offset\", \"limit\"], request: null, responses: { 200: \"NodePage\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/nodes\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"NodeInput[]\", responses: { 201: \"Node[]\" }, errors: [\"conflict\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"taxonomy\", path: \"/nodes/{id}\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: null, responses: { 200: \"NodeDetail\" }, errors: [\"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"PATCH\", module: \"taxonomy\", path: \"/nodes/{id}\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"NodeUpdate\", responses: { 200: \"Node\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"taxonomy\", path: \"/nodes/{id}\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: null, responses: { 200: \"Node\" }, errors: [\"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"PUT\", module: \"taxonomy\", path: \"/nodes/{id}/names\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Name[]\", responses: { 200: \"NodeDetail\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/nodes/{id}/names\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Name[]\", responses: { 200: \"NodeDetail\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"taxonomy\", path: \"/nodes/{id}/names\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Name[]\", responses: { 200: \"NodeDetail\" }, errors: [\"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/nodes/{id}/merge\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"MergeInput\", responses: { 200: \"MergeReport\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/edges\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Edge[]\", responses: { 200: \"EdgesWritten\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"taxonomy\", path: \"/edges\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Edge[]\", responses: { 200: \"EdgesWritten\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/assignments\", auth: \"staff\", permission: \"Taxonomy\", query: [\"suppress_counts\"], request: \"Assignment[]\", responses: { 200: \"AssignmentsWritten\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"taxonomy\", path: \"/assignments\", auth: \"staff\", permission: \"Taxonomy\", query: [\"suppress_counts\"], request: \"Assignment[]\", responses: { 200: \"AssignmentsWritten\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/effective\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"ContentRef[]\", responses: { 200: \"EffectiveTagsOf[]\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"taxonomy\", path: \"/counts\", auth: \"staff\", permission: \"Taxonomy\", query: [\"taxonomy_id\"], request: null, responses: { 200: \"Record<string, Count[]>\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/counts/rebuild\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: null, responses: { 200: \"CountsRebuilt\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\"] },\n] as const satisfies readonly ContentKitRoute[];\n\n// The codes every route of a kind answers, by set name.\nexport const CONTENTKIT_ERROR_SETS: Readonly<Record<string, readonly string[]>> = {\n \"module:codes\": [\"internal_error\"],\n \"module:content\": [\"internal_error\", \"tenant_mismatch\"],\n \"module:media\": [\"internal_error\", \"not_found\", \"rate_limited\", \"unavailable\"],\n \"module:taxonomy\": [\"internal_error\"],\n \"module:upload\": [\"internal_error\", \"unavailable\"],\n \"request\": [\"invalid_request\"],\n \"tier:staff\": [\"forbidden\"],\n \"tier:user\": [\"unauthorized\"],\n};\n"],"mappings":";AA+BA,IAAa,IAAoB;CAC/B;EAAE,QAAQ;EAAO,QAAQ;EAAW,MAAM;EAAW,MAAM;EAAU,YAAY;EAAM,OAAO,CAAC;EAAG,SAAS;EAAM,WAAW,EAAE,KAAK,SAAS;EAAG,QAAQ,CAAC;EAAG,WAAW,CAAC,gBAAgB;CAAE;CACzL;EAAE,QAAQ;EAAO,QAAQ;EAAW,MAAM;EAAU,MAAM;EAAU,YAAY;EAAM,OAAO;GAAC;GAAY;GAAQ;GAAS;EAAQ;EAAG,SAAS;EAAM,WAAW,EAAE,KAAK,SAAS;EAAG,QAAQ,CAAC;EAAG,WAAW,CAAC,kBAAkB,SAAS;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AAY,OAAO,CAAC,iBAAiB;EAAG,SAAS;EAAgB,WAAW,EAAE,KAAK,qBAAqB;EAAG,QAAQ,CAAC,YAAY,WAAW;EAAG,WAAW;GAAC;GAAmB;GAAc;EAAS;CAAE;CAC7R;EAAE,QAAQ;EAAU,QAAQ;EAAY,MAAM;EAAgB,MAAM;EAAS,YAAY;EAAY,OAAO,CAAC,iBAAiB;EAAG,SAAS;EAAgB,WAAW,EAAE,KAAK,qBAAqB;EAAG,QAAQ,CAAC;EAAG,WAAW;GAAC;GAAmB;GAAc;EAAS;CAAE;CACxQ;EAAE,QAAQ;EAAQ,QAAQ;EAAY,MAAM;EAAc,MAAM;EAAS,YAAY;EAAY,OAAO,CAAC;EAAG,SAAS;EAAgB,WAAW,EAAE,KAAK,oBAAoB;EAAG,QAAQ,CAAC;EAAG,WAAW;GAAC;GAAmB;GAAc;EAAS;CAAE;CAClP;EAAE,QAAQ;EAAO,QAAQ;EAAY,MAAM;EAAW,MAAM;EAAS,YAAY;EAAY,OAAO,CAAC,aAAa;EAAG,SAAS;EAAM,WAAW,EAAE,KAAK,0BAA0B;EAAG,QAAQ,CAAC;EAAG,WAAW;GAAC;GAAmB;GAAc;EAAS;CAAE;CACvP;EAAE,QAAQ;EAAQ,QAAQ;EAAY,MAAM;EAAmB,MAAM;EAAS,YAAY;EAAY,OAAO,CAAC;EAAG,SAAS;EAAM,WAAW,EAAE,KAAK,gBAAgB;EAAG,QAAQ,CAAC;EAAG,WAAW,CAAC,mBAAmB,YAAY;CAAE;AAChO"}
1
+ {"version":3,"file":"routes.js","names":[],"sources":["../../../src/client/generated/routes.ts"],"sourcesContent":["// Generated by `go generate ./internal/contract` from ContentKit's route catalog. Do not edit.\n\nexport type ContentKitModule = \"content\" | \"upload\" | \"media\" | \"codes\" | \"taxonomy\";\n\n// Each module's sub-path under the one mount (contentkit.Runtime.Handler).\nexport const CONTENTKIT_MODULES: Readonly<Record<ContentKitModule, string>> = {\n content: \"\",\n upload: \"/media/upload\",\n media: \"/media\",\n codes: \"/codes\",\n taxonomy: \"/taxonomy\",\n};\n\nexport type ContentKitRoute = {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n module: ContentKitModule;\n // The path from the module's mount: CONTENTKIT_MODULES[module] + path under the one mount.\n path: string;\n // public: the actor is optional; user: a signed-in actor; staff: the host permission.\n auth: \"public\" | \"user\" | \"staff\";\n // A staff route's content.Perms field.\n permission: string | null;\n query: readonly string[];\n // wire.ts type names (or a content type): the JSON body, and each success by status.\n request: string | null;\n responses: Readonly<Record<number, string | null>>;\n // The route's own codes, and the shared sets (CONTENTKIT_ERROR_SETS) it also answers.\n errors: readonly string[];\n errorSets: readonly string[];\n};\n\nexport const CONTENTKIT_ROUTES = [\n { method: \"GET\", module: \"content\", path: \"/config\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Config\" }, errors: [], errorSets: [\"module:content\"] },\n { method: \"GET\", module: \"content\", path: \"/posts\", auth: \"public\", permission: null, query: [\"language\", \"sort\", \"limit\", \"offset\"], request: null, responses: { 200: \"Post[]\" }, errors: [], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/posts/admin\", auth: \"staff\", permission: \"PostWrite\", query: [\"language\", \"draft\", \"deleted\", \"q\", \"limit\", \"offset\"], request: null, responses: { 200: \"Post[]\" }, errors: [], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/posts/{id}\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Post\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts\", auth: \"staff\", permission: \"PostWrite\", query: [], request: \"PostInput\", responses: { 201: \"Post\", 202: \"Post\" }, errors: [\"conflict\", \"forbidden\", \"moderation_rejected\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PATCH\", module: \"content\", path: \"/posts/{id}\", auth: \"staff\", permission: \"PostWrite\", query: [], request: \"PostInput\", responses: { 200: \"Post\", 202: \"Post\" }, errors: [\"conflict\", \"forbidden\", \"moderation_rejected\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/posts/{id}\", auth: \"staff\", permission: \"PostWrite\", query: [], request: null, responses: { 204: null }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts/{id}/restore\", auth: \"staff\", permission: \"PostWrite\", query: [], request: null, responses: { 200: \"Post\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/posts/{id}/cover\", auth: \"staff\", permission: \"PostWrite\", query: [], request: \"ImageInput\", responses: { 200: \"PostCover\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/posts/{id}/images\", auth: \"staff\", permission: \"PostWrite\", query: [], request: \"ImageInput\", responses: { 200: \"InlineImage\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/{kind}/{id}/comments\", auth: \"public\", permission: null, query: [\"sort\", \"limit\", \"offset\"], request: null, responses: { 200: \"Comment[]\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/comments\", auth: \"public\", permission: null, query: [], request: \"CommentInput\", responses: { 201: \"Comment\", 202: \"Comment\" }, errors: [\"comment_banned\", \"comment_too_long\", \"forbidden\", \"moderation_rejected\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/comments/latest\", auth: \"public\", permission: null, query: [\"limit\", \"offset\"], request: null, responses: { 200: \"FeedItem[]\" }, errors: [], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/comments/admin\", auth: \"staff\", permission: \"CommentModerate\", query: [\"content_kind\", \"limit\", \"offset\"], request: null, responses: { 200: \"AdminComment[]\" }, errors: [], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/comments/{cid}/restore\", auth: \"staff\", permission: \"CommentModerate\", query: [], request: null, responses: { 200: \"Restored\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/comments/{cid}/replies\", auth: \"public\", permission: null, query: [\"limit\", \"offset\"], request: null, responses: { 200: \"Comment[]\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"PATCH\", module: \"content\", path: \"/comments/{cid}\", auth: \"public\", permission: null, query: [], request: \"CommentEdit\", responses: { 200: \"Comment\", 202: \"Comment\" }, errors: [\"comment_banned\", \"comment_too_long\", \"conflict\", \"forbidden\", \"moderation_rejected\", \"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/comments/{cid}\", auth: \"public\", permission: null, query: [], request: null, responses: { 204: null }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/comments/{cid}/like\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/comments/{cid}/dislike\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/comments/{cid}/reaction\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/like\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/dislike\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/{kind}/{id}/reaction\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"forbidden\", \"invalid_request\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/{kind}/{id}/reaction\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"ReactionCounts\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/favorites\", auth: \"user\", permission: null, query: [\"limit\", \"offset\"], request: null, responses: { 200: \"FavoriteItem[]\" }, errors: [], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/{kind}/{id}/favorite\", auth: \"user\", permission: null, query: [], request: null, responses: { 200: \"FavoriteState\" }, errors: [\"forbidden\", \"not_found\", \"rate_limited\"], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/{kind}/{id}/favorite\", auth: \"user\", permission: null, query: [], request: null, responses: { 200: \"FavoriteState\" }, errors: [\"forbidden\", \"invalid_request\", \"rate_limited\"], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/{kind}/{id}/favorite\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"FavoriteState\" }, errors: [\"invalid_request\", \"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/polls\", auth: \"public\", permission: null, query: [\"language\", \"month\", \"date\", \"limit\", \"offset\"], request: null, responses: { 200: \"Poll[]\" }, errors: [], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/polls/admin\", auth: \"staff\", permission: \"PollWrite\", query: [\"language\", \"month\", \"date\", \"limit\", \"offset\"], request: null, responses: { 200: \"Poll[]\" }, errors: [], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/polls/{id}\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"Poll\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/polls\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"PollInput\", responses: { 201: \"Poll\" }, errors: [\"not_configured\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PATCH\", module: \"content\", path: \"/polls/{id}\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"PollUpdate\", responses: { 200: \"Poll\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/polls/{id}\", auth: \"staff\", permission: \"PollWrite\", query: [], request: null, responses: { 204: null }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/polls/{id}/vote\", auth: \"public\", permission: null, query: [], request: \"PollVote\", responses: { 200: \"Poll\" }, errors: [\"forbidden\", \"not_found\", \"rate_limited\", \"unauthorized\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/polls/{id}/answer\", auth: \"user\", permission: null, query: [], request: \"PollAnswerInput\", responses: { 200: \"Poll\" }, errors: [\"forbidden\", \"not_found\", \"rate_limited\"], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/polls/{id}/image\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"ImageInput\", responses: { 200: \"PollImage\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/polls/{id}/options\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"PollOptionPatch\", responses: { 201: \"PollOption\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PATCH\", module: \"content\", path: \"/polls/{id}/options/{oid}\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"PollOptionPatch\", responses: { 200: \"PollOption\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/polls/{id}/options/{oid}\", auth: \"staff\", permission: \"PollWrite\", query: [], request: null, responses: { 204: null }, errors: [\"invalid_request\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/polls/{id}/options/{oid}/image\", auth: \"staff\", permission: \"PollWrite\", query: [], request: \"ImageInput\", responses: { 200: \"PollImage\" }, errors: [\"not_configured\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/comment-bans\", auth: \"user\", permission: null, query: [\"limit\", \"offset\"], request: null, responses: { 200: \"CommentBan[]\" }, errors: [], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/comment-bans/{user}\", auth: \"user\", permission: null, query: [], request: \"BanInput\", responses: { 200: \"CommentBan\" }, errors: [], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/comment-bans/{user}\", auth: \"user\", permission: null, query: [], request: null, responses: { 204: null }, errors: [], errorSets: [\"module:content\", \"tier:user\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/global-comment-bans\", auth: \"staff\", permission: \"CommentBan\", query: [\"limit\", \"offset\"], request: null, responses: { 200: \"CommentBan[]\" }, errors: [\"unauthorized\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"PUT\", module: \"content\", path: \"/global-comment-bans/{user}\", auth: \"staff\", permission: \"CommentBan\", query: [], request: \"BanInput\", responses: { 200: \"CommentBan\" }, errors: [\"unauthorized\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"content\", path: \"/global-comment-bans/{user}\", auth: \"staff\", permission: \"CommentBan\", query: [], request: null, responses: { 204: null }, errors: [\"unauthorized\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/{kind}/{id}/can-comment\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"CommentStanding\" }, errors: [\"not_found\"], errorSets: [\"module:content\", \"request\"] },\n { method: \"GET\", module: \"content\", path: \"/moderation/held\", auth: \"staff\", permission: \"ModerationReview\", query: [\"kind\", \"cursor\", \"limit\"], request: null, responses: { 200: \"HeldPage\" }, errors: [], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"content\", path: \"/moderation/{kind}/{id}/resolve\", auth: \"staff\", permission: \"ModerationReview\", query: [], request: \"ResolveInput\", responses: { 200: \"ReviewOutcome\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:content\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/presign\", auth: \"user\", permission: null, query: [], request: \"PresignBody\", responses: { 200: \"PresignReply\" }, errors: [\"conflict\", \"forbidden\", \"not_found\", \"quota_exceeded\", \"rate_limited\", \"too_large\", \"too_many_files\", \"type_not_allowed\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/parts\", auth: \"user\", permission: null, query: [], request: \"PartsBody\", responses: { 200: \"PartsReply\" }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/parts/list\", auth: \"user\", permission: null, query: [], request: \"TicketBody\", responses: { 200: \"PartsReply\" }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/complete\", auth: \"user\", permission: null, query: [], request: \"TicketBody\", responses: { 200: \"CompleteReply\" }, errors: [\"checksum_mismatch\", \"forbidden\", \"incomplete\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/abort\", auth: \"user\", permission: null, query: [], request: \"TicketBody\", responses: { 204: null }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"POST\", module: \"upload\", path: \"/commit\", auth: \"user\", permission: null, query: [], request: \"CommitBody\", responses: { 200: \"CommitReply\" }, errors: [\"conflict\", \"forbidden\", \"image_too_small\", \"not_found\", \"not_uploaded\", \"quota_exceeded\", \"rate_limited\", \"too_large\", \"too_many_files\", \"type_not_allowed\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"GET\", module: \"upload\", path: \"/frame\", auth: \"user\", permission: null, query: [\"kind\", \"id\", \"path\", \"t\", \"w\"], request: null, responses: { 200: \"image/jpeg\" }, errors: [\"forbidden\", \"not_found\"], errorSets: [\"module:upload\", \"tier:user\", \"request\"] },\n { method: \"GET\", module: \"media\", path: \"/presets\", auth: \"public\", permission: null, query: [], request: null, responses: { 200: \"PresetRule[]\" }, errors: [], errorSets: [\"module:media\"] },\n { method: \"GET\", module: \"media\", path: \"/{kind}/{id}\", auth: \"public\", permission: null, query: [\"prefix\", \"offset\", \"limit\", \"download\", \"editor\"], request: null, responses: { 200: \"ReadResult\" }, errors: [], errorSets: [\"module:media\", \"request\"] },\n { method: \"GET\", module: \"media\", path: \"/{kind}/{id}/hls/{path...}\", auth: \"public\", permission: null, query: [\"audio\", \"subs\"], request: null, responses: { 200: \"application/vnd.apple.mpegurl\" }, errors: [], errorSets: [\"module:media\", \"request\"] },\n { method: \"GET\", module: \"codes\", path: \"/{code}\", auth: \"public\", permission: null, query: [\"lang\"], request: null, responses: { 200: \"Resolved\" }, errors: [\"gone\", \"not_found\"], errorSets: [\"module:codes\", \"request\"] },\n { method: \"GET\", module: \"taxonomy\", path: \"/nodes\", auth: \"staff\", permission: \"Taxonomy\", query: [\"kind\", \"state\", \"id\", \"slug\", \"language\", \"language_mode\", \"name_prefix\", \"q\", \"content_kind\", \"min_count\", \"sort\", \"cursor\", \"offset\", \"limit\"], request: null, responses: { 200: \"NodePage\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/nodes\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"NodeInput[]\", responses: { 201: \"Node[]\" }, errors: [\"conflict\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"taxonomy\", path: \"/nodes/{id}\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: null, responses: { 200: \"NodeDetail\" }, errors: [\"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"PATCH\", module: \"taxonomy\", path: \"/nodes/{id}\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"NodeUpdate\", responses: { 200: \"Node\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"taxonomy\", path: \"/nodes/{id}\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: null, responses: { 200: \"Node\" }, errors: [\"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"PUT\", module: \"taxonomy\", path: \"/nodes/{id}/names\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Name[]\", responses: { 200: \"NodeDetail\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/nodes/{id}/names\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Name[]\", responses: { 200: \"NodeDetail\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"taxonomy\", path: \"/nodes/{id}/names\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Name[]\", responses: { 200: \"NodeDetail\" }, errors: [\"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/nodes/{id}/merge\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"MergeInput\", responses: { 200: \"MergeReport\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/edges\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Edge[]\", responses: { 200: \"EdgesWritten\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"taxonomy\", path: \"/edges\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"Edge[]\", responses: { 200: \"EdgesWritten\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/assignments\", auth: \"staff\", permission: \"Taxonomy\", query: [\"suppress_counts\"], request: \"Assignment[]\", responses: { 200: \"AssignmentsWritten\" }, errors: [\"conflict\", \"not_found\"], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"DELETE\", module: \"taxonomy\", path: \"/assignments\", auth: \"staff\", permission: \"Taxonomy\", query: [\"suppress_counts\"], request: \"Assignment[]\", responses: { 200: \"AssignmentsWritten\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/effective\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: \"ContentRef[]\", responses: { 200: \"EffectiveTagsOf[]\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"GET\", module: \"taxonomy\", path: \"/counts\", auth: \"staff\", permission: \"Taxonomy\", query: [\"taxonomy_id\"], request: null, responses: { 200: \"Record<string, Count[]>\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\", \"request\"] },\n { method: \"POST\", module: \"taxonomy\", path: \"/counts/rebuild\", auth: \"staff\", permission: \"Taxonomy\", query: [], request: null, responses: { 200: \"CountsRebuilt\" }, errors: [], errorSets: [\"module:taxonomy\", \"tier:staff\"] },\n] as const satisfies readonly ContentKitRoute[];\n\n// The codes every route of a kind answers, by set name.\nexport const CONTENTKIT_ERROR_SETS: Readonly<Record<string, readonly string[]>> = {\n \"module:codes\": [\"internal_error\"],\n \"module:content\": [\"internal_error\", \"tenant_mismatch\"],\n \"module:media\": [\"internal_error\", \"not_found\", \"rate_limited\", \"unavailable\", \"upgrade_required\"],\n \"module:taxonomy\": [\"internal_error\"],\n \"module:upload\": [\"internal_error\", \"unavailable\", \"upgrade_required\"],\n \"request\": [\"invalid_request\"],\n \"tier:staff\": [\"forbidden\"],\n \"tier:user\": [\"unauthorized\"],\n};\n"],"mappings":";AA+BA,IAAa,IAAoB;CAC/B;EAAE,QAAQ;EAAO,QAAQ;EAAW,MAAM;EAAW,MAAM;EAAU,YAAY;EAAM,OAAO,CAAC;EAAG,SAAS;EAAM,WAAW,EAAE,KAAK,SAAS;EAAG,QAAQ,CAAC;EAAG,WAAW,CAAC,gBAAgB;CAAE;CACzL;EAAE,QAAQ;EAAO,QAAQ;EAAW,MAAM;EAAU,MAAM;EAAU,YAAY;EAAM,OAA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AAQ;EAAQ,QAAQ;EAAY,MAAM;EAAmB,MAAM;EAAS,YAAY;EAAY,OAAO,CAAC;EAAG,SAAS;EAAM,WAAW,EAAE,KAAK,gBAAgB;EAAG,QAAQ,CAAC;EAAG,WAAW,CAAC,mBAAmB,YAAY;CAAE;AAChO"}
@@ -302,7 +302,8 @@ export interface ImageInput {
302
302
  image?: string;
303
303
  }
304
304
  export interface InlineImage {
305
- url: string;
305
+ ref: string;
306
+ url: string | null;
306
307
  }
307
308
  export interface MergeInput {
308
309
  into_taxonomy_id: string;
@@ -485,7 +486,9 @@ export interface Post {
485
486
  slug?: string;
486
487
  body: string;
487
488
  excerpt?: string;
489
+ cover?: string;
488
490
  cover_url?: string;
491
+ images?: Record<string, string>;
489
492
  language: string;
490
493
  is_draft: boolean;
491
494
  live_at?: string;
@@ -523,6 +526,7 @@ export interface PresetRule {
523
526
  aspect?: string;
524
527
  min_width?: number;
525
528
  first?: number;
529
+ default: boolean;
526
530
  }
527
531
  export interface PresignBody {
528
532
  ref: RefBody;
@@ -1 +1 @@
1
- {"version":3,"file":"wire.js","names":[],"sources":["../../../src/client/generated/wire.ts"],"sourcesContent":["// Generated by `go generate ./internal/contract` from ContentKit's route catalog. Do not edit.\n\nimport type { ErrorCode } from \"./error-codes.js\";\n\nexport type { ErrorCode };\n\n// Upload sizes: one PUT up to MAX_SINGLE_PUT bytes, else multipart parts.\nexport const MAX_SINGLE_PUT = 67108864;\nexport const MIN_PART_SIZE = 8388608;\nexport const MAX_PART_SIZE = 16777216;\n\nexport type OpName = \"put\" | \"edit\" | \"move\" | \"rename\" | \"remove\" | \"attach\" | \"copy\" | \"frame\" | \"meta\" | \"regenerate\";\nexport type Access = \"full\" | \"none\";\nexport type ItemState = \"ready\" | \"processing\" | \"failed\";\nexport type EncodePhase = \"queued\" | \"downloading\" | \"probing\" | \"encoding\" | \"muxing\" | \"uploading\" | \"publishing\" | \"images\";\nexport type PollKind = \"multiple_choice\" | \"free_text\";\nexport type ModerationState = \"approved\" | \"held\" | \"rejected\";\n\nexport interface AdminComment {\n id: string;\n reply_to_id?: string;\n user_id?: string;\n anon_name?: string;\n body: string;\n deleted: boolean;\n likes: number;\n dislikes: number;\n mine: number;\n reply_count: number;\n author?: PublicUser;\n moderation?: ModerationState;\n moderation_reason?: string;\n created_at: string;\n updated_at: string;\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n deleted_at?: string;\n}\n\nexport interface Anonymous {\n comments: boolean;\n reactions: boolean;\n votes: boolean;\n}\n\nexport interface Assignment {\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n taxonomy_id: string;\n relation: string;\n state?: \"active\" | \"proposed\";\n source_revision: number;\n}\n\nexport interface AssignmentsWritten {\n assignments: number;\n}\n\nexport interface BanInput {\n reason?: string;\n until?: string;\n}\n\nexport interface BanNotice {\n scope: string;\n reason?: string;\n until?: string;\n}\n\nexport interface Comment {\n id: string;\n reply_to_id?: string;\n user_id?: string;\n anon_name?: string;\n body: string;\n deleted: boolean;\n likes: number;\n dislikes: number;\n mine: number;\n reply_count: number;\n author?: PublicUser;\n moderation?: ModerationState;\n moderation_reason?: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface CommentBan {\n user_id: string;\n user?: PublicUser;\n scope: string;\n reason?: string;\n until?: string;\n banned_by: string;\n banned_at: string;\n expired: boolean;\n}\n\nexport interface CommentEdit {\n body: string;\n}\n\nexport interface CommentInput {\n body: string;\n reply_to_id?: string;\n anon_name?: string;\n}\n\nexport interface CommentStanding {\n can_comment: boolean;\n ban?: BanNotice;\n anonymous: boolean;\n max_length: number;\n user_id?: string;\n moderate: boolean;\n ban_scopes: (\"global\" | \"owner\")[];\n}\n\nexport interface CommitBody {\n ref: RefBody;\n operation_id: string;\n ops: Op[];\n}\n\nexport interface CommitReply {\n files: FileInfo[];\n}\n\nexport interface CompleteReply {\n blob: string;\n type: string;\n size: number;\n}\n\nexport interface Config {\n anonymous: Anonymous;\n comment_max_length: number;\n}\n\nexport interface ContentRef {\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n}\n\nexport interface CopyFrom {\n id: string;\n path: string;\n}\n\nexport interface Count {\n content_kind: string;\n language: string;\n count: number;\n}\n\nexport interface CountsRebuilt {\n nodes: number;\n}\n\nexport interface Crop {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\nexport interface Edge {\n from_taxonomy_id: string;\n relation: \"alias_of\" | \"artist_of\" | \"child\" | \"member_of\" | \"parent\" | \"synonym\" | \"voice_of\";\n to_taxonomy_id: string;\n source_revision: number;\n}\n\nexport interface EdgesWritten {\n edges: number;\n}\n\nexport interface Edit {\n crop?: Crop;\n rotate?: number;\n}\n\nexport interface EffectiveTag {\n taxonomy_id: string;\n kind: string;\n slug: string;\n relation: string;\n scope: \"content\" | \"version\";\n}\n\nexport interface EffectiveTagsOf {\n content: ContentRef;\n tags: EffectiveTag[];\n}\n\nexport interface EncodeProgress {\n phase: EncodePhase;\n queue_position?: number;\n segments_done?: number;\n segments_total?: number;\n percent: number;\n speed?: number;\n eta?: number;\n at: number;\n stalled?: boolean;\n stage?: number;\n stages?: number;\n}\n\nexport interface ErrorDetails {\n width?: number;\n height?: number;\n min_width?: number;\n max_pixels?: number;\n type?: string;\n allowed?: string[];\n size?: number;\n max_bytes?: number;\n frames?: number;\n max_frames?: number;\n seconds?: number;\n max_seconds?: number;\n min_aspect?: number;\n max_aspect?: number;\n max?: number;\n}\n\nexport interface ErrorReply {\n error: string;\n code: ErrorCode;\n retry_after?: number;\n action?: \"comment\" | \"comment_reaction\" | \"favorite\" | \"poll_vote\" | \"post_reaction\" | \"reaction\";\n ban?: BanNotice;\n blobs?: string[];\n details?: ErrorDetails;\n}\n\nexport interface Failure {\n of: string;\n message: string;\n code?: ErrorCode;\n details?: ErrorDetails;\n}\n\nexport interface FavoriteItem {\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n created_at: string;\n}\n\nexport interface FavoriteState {\n favorited: boolean;\n count: number;\n}\n\nexport interface FeedItem {\n id: string;\n reply_to_id?: string;\n user_id?: string;\n anon_name?: string;\n body: string;\n deleted: boolean;\n likes: number;\n dislikes: number;\n mine: number;\n reply_count: number;\n author?: PublicUser;\n moderation?: ModerationState;\n moderation_reason?: string;\n created_at: string;\n updated_at: string;\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n}\n\nexport interface FileInfo {\n path: string;\n type: string;\n size?: number;\n w?: number;\n h?: number;\n dur?: number;\n download?: string;\n url?: string;\n locked?: boolean;\n upload?: boolean;\n staged?: boolean;\n from?: string;\n edit?: Edit;\n frame?: Frame;\n meta?: Record<string, unknown>;\n unattached?: boolean;\n pending?: string[];\n failed?: Failure;\n editor_url?: string;\n progress?: EncodeProgress;\n}\n\nexport interface Frame {\n t?: number;\n auto?: boolean;\n of?: string;\n}\n\nexport interface Group {\n id: string;\n label: string;\n count: number;\n}\n\nexport interface HeldItem {\n kind: string;\n revision: number;\n id: string;\n ref: ContentRef;\n author_id?: string;\n author?: PublicUser;\n anon_name?: string;\n title?: string;\n body: string;\n reason: string;\n model?: string;\n prompt_version?: string;\n confidence?: number;\n error?: string;\n held_at: string;\n created_at: string;\n}\n\nexport interface HeldPage {\n items: HeldItem[];\n next?: string;\n}\n\nexport interface ImageInput {\n image?: string;\n}\n\nexport interface InlineImage {\n url: string;\n}\n\nexport interface MergeInput {\n into_taxonomy_id: string;\n}\n\nexport interface MergeReport {\n from_taxonomy_id: string;\n into_taxonomy_id: string;\n assignments_moved: number;\n names_moved: number;\n edges_rewritten: number;\n assignments_merged: number;\n}\n\nexport interface MultipartReply {\n ticket: string;\n min_part_size: number;\n max_part_size: number;\n max_parts: number;\n}\n\nexport interface Name {\n language: string;\n kind: \"alias\" | \"name\";\n name: string;\n normalized?: string;\n source_revision: number;\n}\n\nexport interface Node {\n taxonomy_id: string;\n tenant_id: string;\n kind: string;\n slug: string;\n state: \"active\" | \"deleted\" | \"merged\";\n source_revision: number;\n created_at: string;\n updated_at: string;\n}\n\nexport interface NodeDetail {\n taxonomy_id: string;\n tenant_id: string;\n kind: string;\n slug: string;\n state: \"active\" | \"deleted\" | \"merged\";\n source_revision: number;\n created_at: string;\n updated_at: string;\n names: Name[];\n edges: Edge[];\n counts: Count[];\n}\n\nexport interface NodeInput {\n taxonomy_id?: string;\n kind: string;\n slug: string;\n names?: Name[];\n source_revision: number;\n}\n\nexport interface NodePage {\n nodes: NodeRow[];\n next_cursor?: string;\n total: number;\n}\n\nexport interface NodeRow {\n taxonomy_id: string;\n tenant_id: string;\n kind: string;\n slug: string;\n state: \"active\" | \"deleted\" | \"merged\";\n source_revision: number;\n created_at: string;\n updated_at: string;\n name?: string;\n name_language?: string;\n count: number;\n}\n\nexport interface NodeUpdate {\n slug?: string;\n state?: \"active\" | \"deleted\" | \"merged\";\n source_revision?: number;\n}\n\nexport interface Op {\n op: OpName;\n path?: string;\n blob?: string;\n create_id?: string;\n index?: number;\n meta?: Record<string, unknown>;\n edit?: Edit;\n unattached?: boolean;\n to?: string;\n from?: CopyFrom;\n t?: number;\n auto?: boolean;\n preset?: string;\n force?: boolean;\n takedown?: boolean;\n}\n\nexport interface PartBody {\n number: number;\n size: number;\n sha256: string;\n}\n\nexport interface PartReply {\n number: number;\n size?: number;\n sha256?: string;\n request?: RequestReply;\n}\n\nexport interface PartsBody {\n ticket: string;\n parts: PartBody[];\n}\n\nexport interface PartsReply {\n parts: PartReply[];\n}\n\nexport interface Poll {\n id: string;\n kind: PollKind;\n question: string;\n language: string;\n is_active: boolean;\n image_url?: string;\n live_at: string;\n closes_at?: string;\n closed: boolean;\n total_votes: number;\n options: PollOption[];\n voted: boolean;\n my_option?: string;\n answer_count?: number;\n groups?: Group[];\n my_answer?: PollAnswer;\n}\n\nexport interface PollAnswer {\n id: string;\n text: string;\n classified: boolean;\n updated_at: string;\n}\n\nexport interface PollAnswerInput {\n text: string;\n}\n\nexport interface PollImage {\n image_url: string | null;\n}\n\nexport interface PollInput {\n kind?: PollKind;\n question: string;\n language: string;\n live_at?: string;\n closes_at?: string;\n options?: PollOptionInput[];\n}\n\nexport interface PollOption {\n id: string;\n label: string;\n image_url?: string;\n position: number;\n vote_count: number;\n}\n\nexport interface PollOptionInput {\n label: string;\n position: number;\n}\n\nexport interface PollOptionPatch {\n label?: string;\n position?: number;\n}\n\nexport interface PollUpdate {\n question?: string;\n is_active?: boolean;\n live_at?: string;\n closes_at?: string | null;\n}\n\nexport interface PollVote {\n option_id: string;\n}\n\nexport interface Post {\n id: string;\n author_id: string;\n title: string;\n slug?: string;\n body: string;\n excerpt?: string;\n cover_url?: string;\n language: string;\n is_draft: boolean;\n live_at?: string;\n total_likes: number;\n total_dislikes: number;\n comment_count: number;\n moderation?: ModerationState;\n moderation_reason?: string;\n code: string;\n url_slug: string;\n created_at: string;\n updated_at: string;\n deleted_at?: string;\n}\n\nexport interface PostCover {\n cover_url: string | null;\n}\n\nexport interface PostInput {\n title?: string;\n body?: string;\n excerpt?: string;\n language?: string;\n slug?: string;\n is_draft?: boolean;\n live_at?: string;\n}\n\nexport interface PresetRule {\n kind: string;\n name: string;\n from: string;\n base: string;\n namespace: string;\n to: string;\n widths: number[];\n aspect?: string;\n min_width?: number;\n first?: number;\n}\n\nexport interface PresignBody {\n ref: RefBody;\n path: string;\n type: string;\n size: number;\n sha256: string;\n}\n\nexport interface PresignReply {\n path: string;\n blob: string;\n exists?: boolean;\n put?: RequestReply;\n multipart?: MultipartReply;\n process_on_upload?: boolean;\n}\n\nexport interface PublicImage {\n from: string;\n preset: string;\n renditions: PublicRendition[];\n}\n\nexport interface PublicRendition {\n url: string;\n w: number;\n h: number;\n}\n\nexport interface PublicUser {\n id: string;\n username: string;\n avatar?: string;\n avatar_srcset?: string;\n}\n\nexport interface ReactionCounts {\n likes: number;\n dislikes: number;\n mine: number;\n}\n\nexport interface ReadResult {\n access: Access;\n expires: number;\n meta?: Record<string, unknown>;\n previews?: string[];\n public?: PublicImage[];\n total: number;\n offset: number;\n limit: number;\n hls?: string[];\n state?: ItemState;\n full?: boolean;\n uploads?: UploadRule[];\n files: FileInfo[];\n}\n\nexport interface RefBody {\n kind: string;\n id: string;\n}\n\nexport interface RequestReply {\n method: string;\n url: string;\n headers: Record<string, string>;\n expires: string;\n}\n\nexport interface ResolveInput {\n decision: \"approve\" | \"reject\" | \"review\";\n revision: number;\n reason?: string;\n}\n\nexport interface Resolved {\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n code: string;\n slug: string;\n slugs?: Record<string, string>;\n path: string;\n}\n\nexport interface Restored {\n restored: boolean;\n}\n\nexport interface ReviewOutcome {\n decision: \"approve\" | \"reject\" | \"review\";\n}\n\nexport interface TicketBody {\n ticket: string;\n}\n\nexport interface UploadRule {\n path: string;\n types: string[];\n max_bytes: number;\n max?: number;\n named?: boolean;\n frames?: string;\n aspect?: string;\n min_width?: number;\n video?: VideoLimits;\n min_aspect?: number;\n max_aspect?: number;\n}\n\nexport interface VideoLimits {\n max_seconds?: number;\n max_fps?: number;\n max_pixels?: number;\n max_work?: number;\n}\n"],"mappings":";AAOA,IAAa,IAAiB,UACjB,IAAgB,SAChB,IAAgB"}
1
+ {"version":3,"file":"wire.js","names":[],"sources":["../../../src/client/generated/wire.ts"],"sourcesContent":["// Generated by `go generate ./internal/contract` from ContentKit's route catalog. Do not edit.\n\nimport type { ErrorCode } from \"./error-codes.js\";\n\nexport type { ErrorCode };\n\n// Upload sizes: one PUT up to MAX_SINGLE_PUT bytes, else multipart parts.\nexport const MAX_SINGLE_PUT = 67108864;\nexport const MIN_PART_SIZE = 8388608;\nexport const MAX_PART_SIZE = 16777216;\n\nexport type OpName = \"put\" | \"edit\" | \"move\" | \"rename\" | \"remove\" | \"attach\" | \"copy\" | \"frame\" | \"meta\" | \"regenerate\";\nexport type Access = \"full\" | \"none\";\nexport type ItemState = \"ready\" | \"processing\" | \"failed\";\nexport type EncodePhase = \"queued\" | \"downloading\" | \"probing\" | \"encoding\" | \"muxing\" | \"uploading\" | \"publishing\" | \"images\";\nexport type PollKind = \"multiple_choice\" | \"free_text\";\nexport type ModerationState = \"approved\" | \"held\" | \"rejected\";\n\nexport interface AdminComment {\n id: string;\n reply_to_id?: string;\n user_id?: string;\n anon_name?: string;\n body: string;\n deleted: boolean;\n likes: number;\n dislikes: number;\n mine: number;\n reply_count: number;\n author?: PublicUser;\n moderation?: ModerationState;\n moderation_reason?: string;\n created_at: string;\n updated_at: string;\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n deleted_at?: string;\n}\n\nexport interface Anonymous {\n comments: boolean;\n reactions: boolean;\n votes: boolean;\n}\n\nexport interface Assignment {\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n taxonomy_id: string;\n relation: string;\n state?: \"active\" | \"proposed\";\n source_revision: number;\n}\n\nexport interface AssignmentsWritten {\n assignments: number;\n}\n\nexport interface BanInput {\n reason?: string;\n until?: string;\n}\n\nexport interface BanNotice {\n scope: string;\n reason?: string;\n until?: string;\n}\n\nexport interface Comment {\n id: string;\n reply_to_id?: string;\n user_id?: string;\n anon_name?: string;\n body: string;\n deleted: boolean;\n likes: number;\n dislikes: number;\n mine: number;\n reply_count: number;\n author?: PublicUser;\n moderation?: ModerationState;\n moderation_reason?: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface CommentBan {\n user_id: string;\n user?: PublicUser;\n scope: string;\n reason?: string;\n until?: string;\n banned_by: string;\n banned_at: string;\n expired: boolean;\n}\n\nexport interface CommentEdit {\n body: string;\n}\n\nexport interface CommentInput {\n body: string;\n reply_to_id?: string;\n anon_name?: string;\n}\n\nexport interface CommentStanding {\n can_comment: boolean;\n ban?: BanNotice;\n anonymous: boolean;\n max_length: number;\n user_id?: string;\n moderate: boolean;\n ban_scopes: (\"global\" | \"owner\")[];\n}\n\nexport interface CommitBody {\n ref: RefBody;\n operation_id: string;\n ops: Op[];\n}\n\nexport interface CommitReply {\n files: FileInfo[];\n}\n\nexport interface CompleteReply {\n blob: string;\n type: string;\n size: number;\n}\n\nexport interface Config {\n anonymous: Anonymous;\n comment_max_length: number;\n}\n\nexport interface ContentRef {\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n}\n\nexport interface CopyFrom {\n id: string;\n path: string;\n}\n\nexport interface Count {\n content_kind: string;\n language: string;\n count: number;\n}\n\nexport interface CountsRebuilt {\n nodes: number;\n}\n\nexport interface Crop {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\nexport interface Edge {\n from_taxonomy_id: string;\n relation: \"alias_of\" | \"artist_of\" | \"child\" | \"member_of\" | \"parent\" | \"synonym\" | \"voice_of\";\n to_taxonomy_id: string;\n source_revision: number;\n}\n\nexport interface EdgesWritten {\n edges: number;\n}\n\nexport interface Edit {\n crop?: Crop;\n rotate?: number;\n}\n\nexport interface EffectiveTag {\n taxonomy_id: string;\n kind: string;\n slug: string;\n relation: string;\n scope: \"content\" | \"version\";\n}\n\nexport interface EffectiveTagsOf {\n content: ContentRef;\n tags: EffectiveTag[];\n}\n\nexport interface EncodeProgress {\n phase: EncodePhase;\n queue_position?: number;\n segments_done?: number;\n segments_total?: number;\n percent: number;\n speed?: number;\n eta?: number;\n at: number;\n stalled?: boolean;\n stage?: number;\n stages?: number;\n}\n\nexport interface ErrorDetails {\n width?: number;\n height?: number;\n min_width?: number;\n max_pixels?: number;\n type?: string;\n allowed?: string[];\n size?: number;\n max_bytes?: number;\n frames?: number;\n max_frames?: number;\n seconds?: number;\n max_seconds?: number;\n min_aspect?: number;\n max_aspect?: number;\n max?: number;\n}\n\nexport interface ErrorReply {\n error: string;\n code: ErrorCode;\n retry_after?: number;\n action?: \"comment\" | \"comment_reaction\" | \"favorite\" | \"poll_vote\" | \"post_reaction\" | \"reaction\";\n ban?: BanNotice;\n blobs?: string[];\n details?: ErrorDetails;\n}\n\nexport interface Failure {\n of: string;\n message: string;\n code?: ErrorCode;\n details?: ErrorDetails;\n}\n\nexport interface FavoriteItem {\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n created_at: string;\n}\n\nexport interface FavoriteState {\n favorited: boolean;\n count: number;\n}\n\nexport interface FeedItem {\n id: string;\n reply_to_id?: string;\n user_id?: string;\n anon_name?: string;\n body: string;\n deleted: boolean;\n likes: number;\n dislikes: number;\n mine: number;\n reply_count: number;\n author?: PublicUser;\n moderation?: ModerationState;\n moderation_reason?: string;\n created_at: string;\n updated_at: string;\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n}\n\nexport interface FileInfo {\n path: string;\n type: string;\n size?: number;\n w?: number;\n h?: number;\n dur?: number;\n download?: string;\n url?: string;\n locked?: boolean;\n upload?: boolean;\n staged?: boolean;\n from?: string;\n edit?: Edit;\n frame?: Frame;\n meta?: Record<string, unknown>;\n unattached?: boolean;\n pending?: string[];\n failed?: Failure;\n editor_url?: string;\n progress?: EncodeProgress;\n}\n\nexport interface Frame {\n t?: number;\n auto?: boolean;\n of?: string;\n}\n\nexport interface Group {\n id: string;\n label: string;\n count: number;\n}\n\nexport interface HeldItem {\n kind: string;\n revision: number;\n id: string;\n ref: ContentRef;\n author_id?: string;\n author?: PublicUser;\n anon_name?: string;\n title?: string;\n body: string;\n reason: string;\n model?: string;\n prompt_version?: string;\n confidence?: number;\n error?: string;\n held_at: string;\n created_at: string;\n}\n\nexport interface HeldPage {\n items: HeldItem[];\n next?: string;\n}\n\nexport interface ImageInput {\n image?: string;\n}\n\nexport interface InlineImage {\n ref: string;\n url: string | null;\n}\n\nexport interface MergeInput {\n into_taxonomy_id: string;\n}\n\nexport interface MergeReport {\n from_taxonomy_id: string;\n into_taxonomy_id: string;\n assignments_moved: number;\n names_moved: number;\n edges_rewritten: number;\n assignments_merged: number;\n}\n\nexport interface MultipartReply {\n ticket: string;\n min_part_size: number;\n max_part_size: number;\n max_parts: number;\n}\n\nexport interface Name {\n language: string;\n kind: \"alias\" | \"name\";\n name: string;\n normalized?: string;\n source_revision: number;\n}\n\nexport interface Node {\n taxonomy_id: string;\n tenant_id: string;\n kind: string;\n slug: string;\n state: \"active\" | \"deleted\" | \"merged\";\n source_revision: number;\n created_at: string;\n updated_at: string;\n}\n\nexport interface NodeDetail {\n taxonomy_id: string;\n tenant_id: string;\n kind: string;\n slug: string;\n state: \"active\" | \"deleted\" | \"merged\";\n source_revision: number;\n created_at: string;\n updated_at: string;\n names: Name[];\n edges: Edge[];\n counts: Count[];\n}\n\nexport interface NodeInput {\n taxonomy_id?: string;\n kind: string;\n slug: string;\n names?: Name[];\n source_revision: number;\n}\n\nexport interface NodePage {\n nodes: NodeRow[];\n next_cursor?: string;\n total: number;\n}\n\nexport interface NodeRow {\n taxonomy_id: string;\n tenant_id: string;\n kind: string;\n slug: string;\n state: \"active\" | \"deleted\" | \"merged\";\n source_revision: number;\n created_at: string;\n updated_at: string;\n name?: string;\n name_language?: string;\n count: number;\n}\n\nexport interface NodeUpdate {\n slug?: string;\n state?: \"active\" | \"deleted\" | \"merged\";\n source_revision?: number;\n}\n\nexport interface Op {\n op: OpName;\n path?: string;\n blob?: string;\n create_id?: string;\n index?: number;\n meta?: Record<string, unknown>;\n edit?: Edit;\n unattached?: boolean;\n to?: string;\n from?: CopyFrom;\n t?: number;\n auto?: boolean;\n preset?: string;\n force?: boolean;\n takedown?: boolean;\n}\n\nexport interface PartBody {\n number: number;\n size: number;\n sha256: string;\n}\n\nexport interface PartReply {\n number: number;\n size?: number;\n sha256?: string;\n request?: RequestReply;\n}\n\nexport interface PartsBody {\n ticket: string;\n parts: PartBody[];\n}\n\nexport interface PartsReply {\n parts: PartReply[];\n}\n\nexport interface Poll {\n id: string;\n kind: PollKind;\n question: string;\n language: string;\n is_active: boolean;\n image_url?: string;\n live_at: string;\n closes_at?: string;\n closed: boolean;\n total_votes: number;\n options: PollOption[];\n voted: boolean;\n my_option?: string;\n answer_count?: number;\n groups?: Group[];\n my_answer?: PollAnswer;\n}\n\nexport interface PollAnswer {\n id: string;\n text: string;\n classified: boolean;\n updated_at: string;\n}\n\nexport interface PollAnswerInput {\n text: string;\n}\n\nexport interface PollImage {\n image_url: string | null;\n}\n\nexport interface PollInput {\n kind?: PollKind;\n question: string;\n language: string;\n live_at?: string;\n closes_at?: string;\n options?: PollOptionInput[];\n}\n\nexport interface PollOption {\n id: string;\n label: string;\n image_url?: string;\n position: number;\n vote_count: number;\n}\n\nexport interface PollOptionInput {\n label: string;\n position: number;\n}\n\nexport interface PollOptionPatch {\n label?: string;\n position?: number;\n}\n\nexport interface PollUpdate {\n question?: string;\n is_active?: boolean;\n live_at?: string;\n closes_at?: string | null;\n}\n\nexport interface PollVote {\n option_id: string;\n}\n\nexport interface Post {\n id: string;\n author_id: string;\n title: string;\n slug?: string;\n body: string;\n excerpt?: string;\n cover?: string;\n cover_url?: string;\n images?: Record<string, string>;\n language: string;\n is_draft: boolean;\n live_at?: string;\n total_likes: number;\n total_dislikes: number;\n comment_count: number;\n moderation?: ModerationState;\n moderation_reason?: string;\n code: string;\n url_slug: string;\n created_at: string;\n updated_at: string;\n deleted_at?: string;\n}\n\nexport interface PostCover {\n cover_url: string | null;\n}\n\nexport interface PostInput {\n title?: string;\n body?: string;\n excerpt?: string;\n language?: string;\n slug?: string;\n is_draft?: boolean;\n live_at?: string;\n}\n\nexport interface PresetRule {\n kind: string;\n name: string;\n from: string;\n base: string;\n namespace: string;\n to: string;\n widths: number[];\n aspect?: string;\n min_width?: number;\n first?: number;\n default: boolean;\n}\n\nexport interface PresignBody {\n ref: RefBody;\n path: string;\n type: string;\n size: number;\n sha256: string;\n}\n\nexport interface PresignReply {\n path: string;\n blob: string;\n exists?: boolean;\n put?: RequestReply;\n multipart?: MultipartReply;\n process_on_upload?: boolean;\n}\n\nexport interface PublicImage {\n from: string;\n preset: string;\n renditions: PublicRendition[];\n}\n\nexport interface PublicRendition {\n url: string;\n w: number;\n h: number;\n}\n\nexport interface PublicUser {\n id: string;\n username: string;\n avatar?: string;\n avatar_srcset?: string;\n}\n\nexport interface ReactionCounts {\n likes: number;\n dislikes: number;\n mine: number;\n}\n\nexport interface ReadResult {\n access: Access;\n expires: number;\n meta?: Record<string, unknown>;\n previews?: string[];\n public?: PublicImage[];\n total: number;\n offset: number;\n limit: number;\n hls?: string[];\n state?: ItemState;\n full?: boolean;\n uploads?: UploadRule[];\n files: FileInfo[];\n}\n\nexport interface RefBody {\n kind: string;\n id: string;\n}\n\nexport interface RequestReply {\n method: string;\n url: string;\n headers: Record<string, string>;\n expires: string;\n}\n\nexport interface ResolveInput {\n decision: \"approve\" | \"reject\" | \"review\";\n revision: number;\n reason?: string;\n}\n\nexport interface Resolved {\n tenant_id: string;\n content_kind: string;\n content_id: string;\n content_version_id?: string;\n code: string;\n slug: string;\n slugs?: Record<string, string>;\n path: string;\n}\n\nexport interface Restored {\n restored: boolean;\n}\n\nexport interface ReviewOutcome {\n decision: \"approve\" | \"reject\" | \"review\";\n}\n\nexport interface TicketBody {\n ticket: string;\n}\n\nexport interface UploadRule {\n path: string;\n types: string[];\n max_bytes: number;\n max?: number;\n named?: boolean;\n frames?: string;\n aspect?: string;\n min_width?: number;\n video?: VideoLimits;\n min_aspect?: number;\n max_aspect?: number;\n}\n\nexport interface VideoLimits {\n max_seconds?: number;\n max_fps?: number;\n max_pixels?: number;\n max_work?: number;\n}\n"],"mappings":";AAOA,IAAa,IAAiB,UACjB,IAAgB,SAChB,IAAgB"}
@@ -1,7 +1,7 @@
1
1
  export { createContentKitClient, type ContentKitClient, type ContentKitClientOptions } from './client.js';
2
2
  export type { ContentKitChange, ContentKitModule, ContentKitMounts, Mount, TokenSource } from './http.js';
3
3
  export { CLIENT_ERROR_CODES, ContentKitError, ERROR_CODES, failureError, isContentKitError, readContentKitError, toContentKitError, type ContentKitErrorCode, type ContentKitErrorInit, } from './errors.js';
4
- export { PostsClient, type PostAdminQuery, type PostQuery } from './content/posts.js';
4
+ export { IMAGE_SCHEME, imageRef, imageRefs, PostsClient, type PostAdminQuery, type PostQuery } from './content/posts.js';
5
5
  export { CommentsClient, type AdminCommentQuery, type CommentQuery } from './content/comments.js';
6
6
  export { ReactionsClient } from './content/reactions.js';
7
7
  export { FavoritesClient } from './content/favorites.js';
@@ -1,4 +1,4 @@
1
- import { CommitBody, Edit, FileInfo, Op, PresetRule, ReadResult, RefBody } from '../generated/wire.js';
1
+ import { CommitBody, Edit, FileInfo, InlineImage, Op, PresetRule, ReadResult, RefBody } from '../generated/wire.js';
2
2
  import { Http } from '../http.js';
3
3
  import { MediaApi, ReadOptions } from './api.js';
4
4
  import { Transport } from './transport.js';
@@ -226,10 +226,12 @@ export declare class MediaClient {
226
226
  * routes take: a poll or option image, a post cover.
227
227
  */
228
228
  uploadNamed(ref: RefBody, file: Uploadable, o?: NamedOptions): Promise<NamedUpload>;
229
- /** An image for a post's rich-text body: uploaded to the post's folder; resolves with the URL to place in the body. */
230
- uploadInline(post: string, file: Uploadable, o?: NamedOptions): Promise<NamedUpload & {
231
- url: string;
232
- }>;
229
+ /**
230
+ * An image for a post's rich-text body, uploaded to the post's folder;
231
+ * resolves with its reference to store in the body (`ref`) and a URL that
232
+ * shows it to the editor now (`url`, null while none exists).
233
+ */
234
+ uploadInline(post: string, file: Uploadable, o?: NamedOptions): Promise<NamedUpload & InlineImage>;
233
235
  /** The media folder of a post. */
234
236
  postRef(id: string): RefBody;
235
237
  /** The media folder of a poll. */
@@ -237,7 +237,7 @@ var u = /^i-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, d =
237
237
  });
238
238
  return {
239
239
  ...r,
240
- url: i.url
240
+ ...i
241
241
  };
242
242
  }
243
243
  postRef(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":[],"sources":["../../../src/client/media/client.ts"],"sourcesContent":["import { ContentKitError, aborted, failureError, throwIfAborted, toContentKitError } from \"../errors.js\";\nimport type { CommitBody, Edit, FileInfo, InlineImage, Op, PresetRule, PresignReply, ReadResult, RefBody, RequestReply } from \"../generated/wire.js\";\nimport type { Http } from \"../http.js\";\nimport { call } from \"../route.js\";\nimport { MediaApi, type ReadOptions } from \"./api.js\";\nimport { sha256Hex } from \"./hash.js\";\nimport { Pacer } from \"./pacer.js\";\nimport { defaultTransport, type Transport } from \"./transport.js\";\n\n/** Upload tuning for the media module. */\nexport interface MediaOptions {\n /** Sends presigned PUTs. Default XMLHttpRequest (upload progress), else fetch. */\n transport?: Transport;\n /** Parallel parts per multipart upload (the pacer may run fewer). Default 4. */\n concurrency?: number;\n /** Retries per part and per idempotent API call. Default 5. */\n retries?: number;\n /** Delay before retry attempt (0-based); retryAfter is the server's hint in seconds. */\n retryDelay?: (attempt: number, retryAfter?: number) => number;\n /** Seconds one part should take. Default 30. */\n targetPartSeconds?: number;\n}\n\nexport interface Progress {\n /** processing: committed, waiting for the worker (put). */\n phase: \"hashing\" | \"uploading\" | \"completing\" | \"processing\";\n loaded: number;\n total: number;\n}\n\nexport interface UploadOptions {\n ref: RefBody;\n /** The upload path: a literal (\"cover\") or under a pattern (\"originals/001.png\"); the server cleans it and adds the extension. */\n path: string;\n /** Content type; default the file's. */\n type?: string;\n /** Aborting pauses: a multipart upload stays resumable from the last state. */\n signal?: AbortSignal;\n onProgress?: (p: Progress) => void;\n /** State saved from onState, to resume a multipart upload of the same file. */\n resume?: UploadState;\n /** Resumable state after every change; null once the upload completed. Persist it to survive a reload. */\n onState?: (s: UploadState | null) => void;\n}\n\n/** An upload, ready for a put op. */\nexport interface UploadedFile {\n /** The path to commit: cleaned, with an extension, named by the server for a Named upload. */\n path: string;\n /**\n * The name to commit: the folder's identical blob (\"sha256-{hex}-{uuid}\") when\n * exists, else the staged upload (\"u-{uuid}\") the worker hashes and places\n * after the commit.\n */\n blob: string;\n type: string;\n size: number;\n /** The identical file was already in the item's folder; nothing was sent. */\n exists: boolean;\n /** The host processes files on upload: commit it unattached now (the queue does). */\n processOnUpload?: boolean;\n}\n\n/** The put op's fields besides path and blob. */\nexport interface PutOptions {\n /** Refuse to replace an existing upload. Default false. */\n createOnly?: boolean;\n edit?: Edit | null;\n meta?: Record<string, unknown>;\n index?: number;\n /** Wait until the worker processed the upload (waitFor). Default true. */\n wait?: boolean;\n /** How long to wait, ms. */\n timeout?: number;\n /** The upload, before the commit. */\n onUploaded?: (up: UploadedFile) => void;\n}\n\nexport interface WaitOptions {\n signal?: AbortSignal;\n /** Poll interval, ms. Default 1000. */\n interval?: number;\n /** ms; then render_timeout. Default 120000. */\n timeout?: number;\n}\n\nexport interface PlannedPart {\n number: number;\n offset: number;\n size: number;\n sha256?: string;\n}\n\n/** A multipart upload in flight; JSON-serializable. */\nexport interface UploadState {\n ticket: string;\n path: string;\n /** The staged upload (\"u-{uuid}\") the parts write. */\n blob: string;\n type: string;\n size: number;\n ref: RefBody;\n file: { name?: string; lastModified?: number; size: number };\n limits: { minPartSize: number; maxPartSize: number; maxParts: number };\n parts: PlannedPart[];\n processOnUpload?: boolean;\n}\n\n/** An upload to a server-named (Named) path: a post's or poll's image. */\nexport interface NamedOptions {\n /** The requested path; the server names the file. Default the file's name. */\n path?: string;\n signal?: AbortSignal;\n onProgress?: (p: Progress) => void;\n /** Wait until the worker processed it. Default true. */\n wait?: boolean;\n /** How long to wait, ms. */\n timeout?: number;\n}\n\n/** An upload to a Named path, committed. */\nexport interface NamedUpload {\n /** The server's name for it (\"i-{uuid}\"), which content routes take. */\n name: string;\n path: string;\n file: FileInfo;\n}\n\n/** The media kinds of post and poll folders (content.Media.PostKind and PollKind). */\nexport interface ContentFolders {\n /** Default \"post\". */\n post?: string;\n /** Default \"poll\". */\n poll?: string;\n}\n\nconst named = /^i-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\n/** A file to upload again when its blob is gone at commit; type defaults to the file's. */\nexport type CommitSource = Blob | { file: Blob; type?: string };\n\nexport interface CommitOptions {\n signal?: AbortSignal;\n /** UUID for this complete batch. Keep it with unchanged ops for a later retry; default a new UUID. */\n operationID?: string;\n /** Persist the active batch before sending it, including any replacement after re-upload. Resume with its ops and operation_id. */\n onState?: (batch: CommitBody) => void;\n /** Blob (\"sha256-…\") → the file it was uploaded from. */\n sources?: Record<string, CommitSource>;\n}\n\ntype Uploadable = Blob & { name?: string; lastModified?: number };\n\n/** A path names a file by its full path or, for an upload, its stem (\"cover\" for \"cover.png\"). */\nexport const samePath = (file: string, path: string) => file === path || stem(file) === path;\n\n/** The path without its extension. */\nexport const stem = (path: string) => {\n const i = path.lastIndexOf(\".\");\n return i > path.lastIndexOf(\"/\") + 1 ? path.slice(0, i) : path;\n};\n\n/** The media module: uploads, commits, reads, frames and HLS. */\nexport class MediaClient {\n readonly api: MediaApi;\n private readonly transport: Transport;\n private readonly concurrency: number;\n private readonly retries: number;\n private readonly delay: (attempt: number, retryAfter?: number) => number;\n private readonly targetSeconds: number;\n private presetList?: Promise<PresetRule[]>;\n\n private readonly folders: Required<ContentFolders>;\n\n constructor(\n private readonly http: Http,\n o: MediaOptions = {},\n folders: ContentFolders = {},\n ) {\n this.folders = { post: folders.post ?? \"post\", poll: folders.poll ?? \"poll\" };\n this.api = new MediaApi(http);\n this.transport = o.transport ?? defaultTransport;\n this.concurrency = o.concurrency ?? 4;\n this.retries = o.retries ?? 5;\n this.delay = o.retryDelay ?? backoff;\n this.targetSeconds = o.targetPartSeconds ?? 30;\n }\n\n /**\n * Uploads file to the item's folder: it hashes the whole file (off the\n * main thread) and presigns {path, type, size, sha256}, then sends nothing\n * (the folder holds the identical blob), or stages it: one checksum-bound\n * PUT up to 64 MiB, resumable multipart above. A refused presign throws\n * before any bytes move. Commit the result with a put op (or use put());\n * the worker then places a staged upload at the hash of its bytes.\n */\n async upload(file: Uploadable, o: UploadOptions): Promise<UploadedFile> {\n const type = o.type || file.type;\n if (!type) throw new ContentKitError(\"invalid_request\", \"the file has no content type\");\n throwIfAborted(o.signal);\n if (o.resume) return this.resumeMultipart(file, o.resume, o);\n const total = file.size;\n const sha256 = await sha256Hex(file, { signal: o.signal, onProgress: (loaded) => o.onProgress?.({ phase: \"hashing\", loaded, total }) });\n const presign = () => this.api.presign({ ref: o.ref, path: o.path, type, size: total, sha256 }, o.signal);\n let p = await presign();\n const out = (p: PresignReply): UploadedFile => ({ path: p.path, blob: p.blob, type, size: total, exists: !!p.exists, processOnUpload: !!p.process_on_upload });\n if (p.exists) return out(p);\n if (p.multipart) {\n const m = p.multipart;\n const state: UploadState = {\n ticket: m.ticket,\n path: p.path,\n blob: p.blob,\n type,\n size: total,\n ref: o.ref,\n file: fingerprint(file),\n limits: { minPartSize: m.min_part_size, maxPartSize: m.max_part_size, maxParts: m.max_parts },\n parts: [],\n processOnUpload: !!p.process_on_upload,\n };\n return this.multipart(file, state, new Set(), o);\n }\n await this.retry(\n async () => {\n if (p.exists) return;\n await this.transport(p.put!, file, { signal: o.signal, onProgress: (loaded) => o.onProgress?.({ phase: \"uploading\", loaded, total }) });\n },\n o.signal,\n async (err) => {\n // An expired URL: presign again (a Named upload gets a new name).\n if (err.code === \"storage\" && err.status === 403) p = await presign();\n },\n );\n return out(p);\n }\n\n /**\n * Uploads file and commits it as a put to its path (with edit, meta and\n * index), then by default waits until the worker processed it; resolves\n * with the upload as an editor reads it.\n */\n async put(file: Uploadable, o: UploadOptions & PutOptions): Promise<FileInfo> {\n const up = await this.upload(file, o);\n o.onUploaded?.(up);\n const op: Op = { op: \"put\", path: up.path, blob: up.blob };\n if (o.createOnly) op.create_id = crypto.randomUUID();\n if (o.edit) op.edit = o.edit;\n if (o.meta) op.meta = o.meta;\n if (o.index !== undefined) op.index = o.index;\n const files = await this.commit(o.ref, [op], { signal: o.signal, sources: { [up.blob]: { file, type: up.type } } });\n if (o.wait === false) return files.find((f) => f.path === up.path) ?? { path: up.path, type: up.type };\n o.onProgress?.({ phase: \"processing\", loaded: up.size, total: up.size });\n return this.waitFor(o.ref, up.path, { signal: o.signal, timeout: o.timeout });\n }\n\n /**\n * Applies ops to the item in one conditional write; returns its uploads as\n * an editor reads them. With sources (blob → the file uploaded as it), a\n * not_uploaded refusal (the blob expired or is due for cleanup) uploads\n * the affected files again and retries the commit once.\n */\n async commit(ref: RefBody, ops: Op[], o: CommitOptions = {}): Promise<FileInfo[]> {\n const emit = this.http.captureChanges();\n // Snapshot the batch once: retries must not pick up edits to the caller's\n // ops while the first request or its response is still in flight.\n const body: CommitBody = structuredClone({ ref, ops, operation_id: o.operationID ?? crypto.randomUUID() });\n o.onState?.(structuredClone(body));\n let files: FileInfo[];\n try {\n files = (await this.retry(() => this.api.commit(body, o.signal), o.signal)).files;\n } catch (e) {\n if (!(e instanceof ContentKitError) || e.code !== \"not_uploaded\") throw e;\n const sources = o.sources ?? {};\n const puts = body.ops.filter((op) => op.op === \"put\" && op.blob && op.blob in sources);\n const stale = [...new Set(puts.map((op) => op.blob!))].filter((b) => !e.blobs || e.blobs.includes(b));\n if (stale.length === 0) throw e;\n const renamed = new Map<string, string>();\n for (const blob of stale) {\n const src = sources[blob]!;\n const file = src instanceof Blob ? src : src.file;\n const type = src instanceof Blob ? undefined : src.type;\n const op = puts.find((p) => p.blob === blob)!;\n renamed.set(blob, (await this.upload(file, { ref: body.ref, path: op.path!, type, signal: o.signal })).blob);\n }\n const retried = body.ops.map((op) => (op.blob && renamed.has(op.blob) ? { ...op, blob: renamed.get(op.blob) } : op));\n // Re-uploading changes the inputs. This is a new batch, not a retry\n // under the old ID; transport retries retain its new identity.\n const replacement = { ref: body.ref, ops: retried, operation_id: crypto.randomUUID() };\n o.onState?.(structuredClone(replacement));\n files = (await this.retry(() => this.api.commit(replacement, o.signal), o.signal)).files;\n }\n emit({ type: \"media.committed\", ref: { kind: ref.kind, id: ref.id }, files });\n return files;\n }\n\n /** The read API: the item's files under prefix in manifest order, with signed URLs for what this viewer may have. */\n async read(ref: RefBody, o: ReadOptions & { signal?: AbortSignal } = {}): Promise<ReadResult> {\n this.api.itemURL(ref); // a bad ref fails at once\n return this.retry(() => this.api.read(ref, o, o.signal), o.signal);\n }\n\n /**\n * Polls an editor read until the upload at path (or with that stem) is\n * processed: placed (not staged), nothing pending and its blob present (a\n * frame grabbed).\n * Rejects with its failure, not_found once it is gone, too_large while the\n * item is full (nothing is processed until uploads are removed),\n * render_timeout after the timeout.\n */\n async waitFor(ref: RefBody, path: string, o: WaitOptions = {}): Promise<FileInfo> {\n const emit = this.http.captureChanges();\n const until = Date.now() + (o.timeout ?? 120_000);\n for (;;) {\n const r = await this.read(ref, { editor: true, prefix: stem(path), signal: o.signal });\n const f = r.files.find((x) => x.upload && samePath(x.path, path));\n if (!f) throw new ContentKitError(\"not_found\", `no upload ${path}`, { status: 404 });\n if (f.failed) throw failureError(f.failed);\n if (!f.pending?.length && !f.staged && (f.size ?? 0) > 0) {\n emit({ type: \"media.processed\", ref: { kind: ref.kind, id: ref.id }, file: f });\n return f;\n }\n if (r.full) throw new ContentKitError(\"too_large\", `${path} waits: the item is full; remove uploads to process more`, { status: 413 });\n if (Date.now() >= until) throw new ContentKitError(\"render_timeout\", `${path} is still processing`);\n await sleep(o.interval ?? 1000, o.signal);\n }\n }\n\n /**\n * The upload's editor view, for re-cropping: its URL and the upload's\n * oriented size. Waits while it renders (an editor read asks for it);\n * not_found when the path has no upload, render_timeout after the timeout\n * (default 30 s).\n */\n async editorView(ref: RefBody, path: string, o: WaitOptions = {}): Promise<{ url: string; width: number; height: number; edit?: Edit }> {\n const until = Date.now() + (o.timeout ?? 30_000);\n for (;;) {\n const r = await this.read(ref, { editor: true, prefix: stem(path), signal: o.signal });\n const f = r.files.find((x) => x.upload && samePath(x.path, path));\n if (!f) throw new ContentKitError(\"not_found\", `no upload ${path}`, { status: 404 });\n if (f.editor_url && f.w && f.h) return { url: f.editor_url, width: f.w, height: f.h, ...(f.edit ? { edit: f.edit } : {}) };\n if (f.failed) throw failureError(f.failed);\n if (Date.now() >= until) throw new ContentKitError(\"render_timeout\", `the editor view of ${path} is still rendering`);\n await sleep(o.interval ?? 1000, o.signal);\n }\n }\n\n /**\n * Every kind's public presets, fetched once per client: crop bounds,\n * widths and default images. An item's current image is in its read's\n * `public`, never built from a preset. Shared by every caller, so it takes\n * no signal; a failed fetch is retried on the next call.\n */\n presets(): Promise<PresetRule[]> {\n this.presetList ??= this.retry(() => this.api.presets()).catch((e: unknown) => {\n this.presetList = undefined;\n throw e;\n });\n return this.presetList;\n }\n\n /** A JPEG still of the video upload at path, t seconds in, w pixels wide (default the frame's). */\n getFrame(ref: RefBody, path: string, t: number, w?: number, signal?: AbortSignal): Promise<Blob> {\n return this.retry(() => this.api.frame(ref, path, t, w, signal), signal);\n }\n\n /** The folder of an HLS ladder from a read's `hls`: `{media}/{kind}/{id}/hls/{dir}`; master.m3u8 and sprite.vtt resolve under it. */\n hlsBase(ref: RefBody, dir: string): string {\n return `${this.api.itemURL(ref)}/hls/${dir}`;\n }\n\n /** hls.js `xhrSetup` for playlists on the API (the client's token and credentials); pass it to players as is. */\n get xhrSetup(): (xhr: XMLHttpRequest, url: string) => Promise<void> {\n return this.http.xhrSetup;\n }\n\n /**\n * Uploads an image to the item's server-named upload path and commits it\n * (by default waiting until it is processed); resolves with the name content\n * routes take: a poll or option image, a post cover.\n */\n async uploadNamed(ref: RefBody, file: Uploadable, o: NamedOptions = {}): Promise<NamedUpload> {\n const f = await this.put(file, { ref, path: o.path ?? (file.name || \"image\"), signal: o.signal, onProgress: o.onProgress, wait: o.wait, timeout: o.timeout });\n const name = stem(f.path.slice(f.path.lastIndexOf(\"/\") + 1));\n if (!named.test(name)) throw new ContentKitError(\"invalid_request\", `${f.path} is not a server-named upload path of ${ref.kind}`);\n return { name, path: f.path, file: f };\n }\n\n /** An image for a post's rich-text body: uploaded to the post's folder; resolves with the URL to place in the body. */\n async uploadInline(post: string, file: Uploadable, o: NamedOptions = {}): Promise<NamedUpload & { url: string }> {\n const up = await this.uploadNamed(this.postRef(post), file, o);\n const r: InlineImage = await call(this.http, \"POST\", \"/posts/{id}/images\", { params: { id: post }, body: { image: up.name }, signal: o.signal });\n return { ...up, url: r.url };\n }\n\n /** The media folder of a post. */\n postRef(id: string): RefBody {\n return { kind: this.folders.post, id };\n }\n\n /** The media folder of a poll. */\n pollRef(id: string): RefBody {\n return { kind: this.folders.poll, id };\n }\n\n /** Discards a paused multipart upload. */\n async discard(state: UploadState): Promise<void> {\n await this.api.abort(state.ref, { ticket: state.ticket });\n }\n\n private async resumeMultipart(file: Uploadable, state: UploadState, o: UploadOptions): Promise<UploadedFile> {\n const fp = fingerprint(file);\n if (fp.size !== state.size || fp.name !== state.file.name || fp.lastModified !== state.file.lastModified) {\n throw new ContentKitError(\"resume_mismatch\", \"the saved upload is for a different file\");\n }\n let listed;\n try {\n listed = await this.retry(() => this.api.listParts(state.ref, { ticket: state.ticket }, o.signal), o.signal);\n } catch (err) {\n // Gone: already completed (Complete is idempotent) or expired.\n if (err instanceof ContentKitError && err.code === \"not_found\") return this.complete(state, o);\n throw err;\n }\n const landed = new Set<number>();\n for (const l of listed.parts) {\n const plan = state.parts.find((p) => p.number === l.number);\n if (!plan || plan.size !== l.size || (l.sha256 && plan.sha256 !== l.sha256)) {\n // Parts this state does not describe: the upload cannot be finished consistently.\n await this.discard(state).catch(() => {});\n o.onState?.(null);\n return this.upload(file, { ...o, resume: undefined });\n }\n landed.add(l.number);\n }\n return this.multipart(file, structuredClone(state), landed, o);\n }\n\n private async multipart(file: Uploadable, state: UploadState, landed: Set<number>, o: UploadOptions): Promise<UploadedFile> {\n const pacer = new Pacer({ ...state.limits, maxConcurrency: this.concurrency, targetSeconds: this.targetSeconds });\n const emitState = () => o.onState?.(structuredClone(state));\n const sending = new Map<number, number>();\n let sent = state.parts.filter((p) => landed.has(p.number)).reduce((n, p) => n + p.size, 0);\n const emitProgress = () => {\n let loaded = sent;\n for (const n of sending.values()) loaded += n;\n o.onProgress?.({ phase: \"uploading\", loaded, total: state.size });\n };\n const pending = state.parts.filter((p) => !landed.has(p.number));\n let offset = state.parts.reduce((end, p) => Math.max(end, p.offset + p.size), 0);\n const next = (): PlannedPart | undefined => {\n const p = pending.shift();\n if (p || offset >= state.size) return p;\n const part: PlannedPart = {\n number: state.parts.length + 1,\n offset,\n size: Math.min(pacer.partSize(), state.size - offset),\n };\n offset += part.size;\n state.parts.push(part);\n return part;\n };\n\n const stop = new AbortController();\n const signal = o.signal ? AbortSignal.any([o.signal, stop.signal]) : stop.signal;\n // Parts hash and presign ahead of the PUT slots, so a freed slot starts\n // its next PUT at once; pacer.concurrency bounds only the PUTs.\n let putting = 0;\n const waiting: (() => void)[] = [];\n const acquire = () =>\n new Promise<void>((resolve, reject) => {\n const take = () => {\n signal.removeEventListener(\"abort\", drop);\n putting++;\n resolve();\n };\n const drop = () => {\n waiting.splice(waiting.indexOf(take) >>> 0, 1);\n reject(aborted(signal));\n };\n if (putting < pacer.concurrency) return take();\n if (signal.aborted) return reject(aborted(signal));\n signal.addEventListener(\"abort\", drop, { once: true });\n waiting.push(take);\n });\n const release = () => {\n putting--;\n while (putting < pacer.concurrency && waiting.length) waiting.shift()!();\n };\n const run = async (part: PlannedPart) => {\n const body = file.slice(part.offset, part.offset + part.size);\n await this.retry(async () => {\n if (!part.sha256) {\n part.sha256 = await sha256Hex(body, { signal });\n emitState();\n }\n const { parts } = await this.api.parts(\n state.ref,\n { ticket: state.ticket, parts: [{ number: part.number, size: part.size, sha256: part.sha256 }] },\n signal,\n );\n const req = parts[0]?.request as RequestReply;\n await acquire();\n const began = performance.now();\n const alongside = putting;\n try {\n await this.transport(req, body, {\n signal,\n onProgress: (n) => {\n sending.set(part.number, n);\n emitProgress();\n },\n });\n } finally {\n sending.delete(part.number);\n release();\n }\n pacer.record(part.size, performance.now() - began, alongside);\n sent += part.size;\n emitProgress();\n }, signal);\n };\n\n emitState();\n emitProgress();\n const inFlight = new Set<Promise<void>>();\n let failure: unknown;\n for (;;) {\n let part: PlannedPart | undefined;\n while (failure === undefined && inFlight.size < pacer.concurrency + 2 && (part = next())) {\n emitState();\n const job: Promise<void> = run(part).then(\n () => void inFlight.delete(job),\n (err) => {\n inFlight.delete(job);\n if (failure === undefined) {\n failure = err;\n stop.abort();\n }\n },\n );\n inFlight.add(job);\n }\n if (inFlight.size === 0) break;\n await Promise.race(inFlight);\n }\n if (failure !== undefined) {\n throw o.signal?.aborted ? aborted(o.signal) : failure;\n }\n return this.complete(state, o);\n }\n\n private async complete(state: UploadState, o: UploadOptions): Promise<UploadedFile> {\n o.onProgress?.({ phase: \"completing\", loaded: state.size, total: state.size });\n const c = await this.retry(() => this.api.complete(state.ref, { ticket: state.ticket }, o.signal), o.signal);\n o.onState?.(null);\n return { path: state.path, blob: c.blob, type: c.type, size: c.size, exists: false, processOnUpload: state.processOnUpload };\n }\n\n private async retry<T>(fn: () => Promise<T>, signal?: AbortSignal, before?: (err: ContentKitError) => Promise<void>): Promise<T> {\n for (let attempt = 0; ; attempt++) {\n try {\n return await fn();\n } catch (e) {\n const err = toContentKitError(e);\n if (signal?.aborted) throw aborted(signal);\n if (!err.transient || attempt >= this.retries) throw err;\n await sleep(this.delay(attempt, err.retryAfter), signal);\n await before?.(err);\n }\n }\n }\n}\n\nfunction fingerprint(f: Uploadable): UploadState[\"file\"] {\n return { name: f.name, lastModified: f.lastModified, size: f.size };\n}\n\n/** Exponential backoff from 1 s to 30 s with jitter, or the server's Retry-After. */\nexport function backoff(attempt: number, retryAfter?: number): number {\n if (retryAfter) return retryAfter * 1000;\n const base = Math.min(30_000, 1000 * 2 ** attempt);\n return base * (0.75 + Math.random() * 0.5);\n}\n\nexport function sleep(ms: number, signal?: AbortSignal): Promise<void> {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) return reject(aborted(signal));\n const t = setTimeout(() => {\n signal?.removeEventListener(\"abort\", onAbort);\n resolve();\n }, ms);\n const onAbort = () => {\n clearTimeout(t);\n reject(aborted(signal));\n };\n signal?.addEventListener(\"abort\", onAbort, { once: true });\n });\n}\n"],"mappings":";;;;;;;AAwIA,IAAM,IAAQ,oEAkBD,KAAY,GAAc,MAAiB,MAAS,KAAQ,EAAK,CAAI,MAAM,GAG3E,KAAQ,MAAiB;CACpC,IAAM,IAAI,EAAK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AAG;EACpB;CAEJ;AACF;AAEA,SAAS,EAAY,GAAoC;CACvD,OAAO;EAAE,MAAM,EAAE;EAAM,cAAc,EAAE;EAAc,MAAM,EAAE;CAAK;AACpE;AAGA,SAAgB,EAAQ,GAAiB,GAA6B;CAGpE,OAFI,IAAmB,IAAa,MACvB,KAAK,IAAI,KAAQ,MAAO,KAAK,CACnC,KAAQ,MAAO,KAAK,OAAO,IAAI;AACxC;AAEA,SAAgB,EAAM,GAAY,GAAqC;CACrE,OAAO,IAAI,SAAS,GAAS,MAAW;EACtC,IAAI,GAAQ,SAAS,OAAO,EAAO,EAAQ,CAAM,CAAC;EAClD,IAAM,IAAI,iBAAiB;GAEzB,AADA,GAAQ,oBAAoB,SAAS,CAAO,GAC5C,EAAQ;EACV,GAAG,CAAE,GACC,UAAgB;GAEpB,AADA,aAAa,CAAC,GACd,EAAO,EAAQ,CAAM,CAAC;EACxB;EACA,GAAQ,iBAAiB,SAAS,GAAS,EAAE,MAAM,GAAK,CAAC;CAC3D,CAAC;AACH"}
1
+ {"version":3,"file":"client.js","names":[],"sources":["../../../src/client/media/client.ts"],"sourcesContent":["import { ContentKitError, aborted, failureError, throwIfAborted, toContentKitError } from \"../errors.js\";\nimport type { CommitBody, Edit, FileInfo, InlineImage, Op, PresetRule, PresignReply, ReadResult, RefBody, RequestReply } from \"../generated/wire.js\";\nimport type { Http } from \"../http.js\";\nimport { call } from \"../route.js\";\nimport { MediaApi, type ReadOptions } from \"./api.js\";\nimport { sha256Hex } from \"./hash.js\";\nimport { Pacer } from \"./pacer.js\";\nimport { defaultTransport, type Transport } from \"./transport.js\";\n\n/** Upload tuning for the media module. */\nexport interface MediaOptions {\n /** Sends presigned PUTs. Default XMLHttpRequest (upload progress), else fetch. */\n transport?: Transport;\n /** Parallel parts per multipart upload (the pacer may run fewer). Default 4. */\n concurrency?: number;\n /** Retries per part and per idempotent API call. Default 5. */\n retries?: number;\n /** Delay before retry attempt (0-based); retryAfter is the server's hint in seconds. */\n retryDelay?: (attempt: number, retryAfter?: number) => number;\n /** Seconds one part should take. Default 30. */\n targetPartSeconds?: number;\n}\n\nexport interface Progress {\n /** processing: committed, waiting for the worker (put). */\n phase: \"hashing\" | \"uploading\" | \"completing\" | \"processing\";\n loaded: number;\n total: number;\n}\n\nexport interface UploadOptions {\n ref: RefBody;\n /** The upload path: a literal (\"cover\") or under a pattern (\"originals/001.png\"); the server cleans it and adds the extension. */\n path: string;\n /** Content type; default the file's. */\n type?: string;\n /** Aborting pauses: a multipart upload stays resumable from the last state. */\n signal?: AbortSignal;\n onProgress?: (p: Progress) => void;\n /** State saved from onState, to resume a multipart upload of the same file. */\n resume?: UploadState;\n /** Resumable state after every change; null once the upload completed. Persist it to survive a reload. */\n onState?: (s: UploadState | null) => void;\n}\n\n/** An upload, ready for a put op. */\nexport interface UploadedFile {\n /** The path to commit: cleaned, with an extension, named by the server for a Named upload. */\n path: string;\n /**\n * The name to commit: the folder's identical blob (\"sha256-{hex}-{uuid}\") when\n * exists, else the staged upload (\"u-{uuid}\") the worker hashes and places\n * after the commit.\n */\n blob: string;\n type: string;\n size: number;\n /** The identical file was already in the item's folder; nothing was sent. */\n exists: boolean;\n /** The host processes files on upload: commit it unattached now (the queue does). */\n processOnUpload?: boolean;\n}\n\n/** The put op's fields besides path and blob. */\nexport interface PutOptions {\n /** Refuse to replace an existing upload. Default false. */\n createOnly?: boolean;\n edit?: Edit | null;\n meta?: Record<string, unknown>;\n index?: number;\n /** Wait until the worker processed the upload (waitFor). Default true. */\n wait?: boolean;\n /** How long to wait, ms. */\n timeout?: number;\n /** The upload, before the commit. */\n onUploaded?: (up: UploadedFile) => void;\n}\n\nexport interface WaitOptions {\n signal?: AbortSignal;\n /** Poll interval, ms. Default 1000. */\n interval?: number;\n /** ms; then render_timeout. Default 120000. */\n timeout?: number;\n}\n\nexport interface PlannedPart {\n number: number;\n offset: number;\n size: number;\n sha256?: string;\n}\n\n/** A multipart upload in flight; JSON-serializable. */\nexport interface UploadState {\n ticket: string;\n path: string;\n /** The staged upload (\"u-{uuid}\") the parts write. */\n blob: string;\n type: string;\n size: number;\n ref: RefBody;\n file: { name?: string; lastModified?: number; size: number };\n limits: { minPartSize: number; maxPartSize: number; maxParts: number };\n parts: PlannedPart[];\n processOnUpload?: boolean;\n}\n\n/** An upload to a server-named (Named) path: a post's or poll's image. */\nexport interface NamedOptions {\n /** The requested path; the server names the file. Default the file's name. */\n path?: string;\n signal?: AbortSignal;\n onProgress?: (p: Progress) => void;\n /** Wait until the worker processed it. Default true. */\n wait?: boolean;\n /** How long to wait, ms. */\n timeout?: number;\n}\n\n/** An upload to a Named path, committed. */\nexport interface NamedUpload {\n /** The server's name for it (\"i-{uuid}\"), which content routes take. */\n name: string;\n path: string;\n file: FileInfo;\n}\n\n/** The media kinds of post and poll folders (content.Media.PostKind and PollKind). */\nexport interface ContentFolders {\n /** Default \"post\". */\n post?: string;\n /** Default \"poll\". */\n poll?: string;\n}\n\nconst named = /^i-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\n/** A file to upload again when its blob is gone at commit; type defaults to the file's. */\nexport type CommitSource = Blob | { file: Blob; type?: string };\n\nexport interface CommitOptions {\n signal?: AbortSignal;\n /** UUID for this complete batch. Keep it with unchanged ops for a later retry; default a new UUID. */\n operationID?: string;\n /** Persist the active batch before sending it, including any replacement after re-upload. Resume with its ops and operation_id. */\n onState?: (batch: CommitBody) => void;\n /** Blob (\"sha256-…\") → the file it was uploaded from. */\n sources?: Record<string, CommitSource>;\n}\n\ntype Uploadable = Blob & { name?: string; lastModified?: number };\n\n/** A path names a file by its full path or, for an upload, its stem (\"cover\" for \"cover.png\"). */\nexport const samePath = (file: string, path: string) => file === path || stem(file) === path;\n\n/** The path without its extension. */\nexport const stem = (path: string) => {\n const i = path.lastIndexOf(\".\");\n return i > path.lastIndexOf(\"/\") + 1 ? path.slice(0, i) : path;\n};\n\n/** The media module: uploads, commits, reads, frames and HLS. */\nexport class MediaClient {\n readonly api: MediaApi;\n private readonly transport: Transport;\n private readonly concurrency: number;\n private readonly retries: number;\n private readonly delay: (attempt: number, retryAfter?: number) => number;\n private readonly targetSeconds: number;\n private presetList?: Promise<PresetRule[]>;\n\n private readonly folders: Required<ContentFolders>;\n\n constructor(\n private readonly http: Http,\n o: MediaOptions = {},\n folders: ContentFolders = {},\n ) {\n this.folders = { post: folders.post ?? \"post\", poll: folders.poll ?? \"poll\" };\n this.api = new MediaApi(http);\n this.transport = o.transport ?? defaultTransport;\n this.concurrency = o.concurrency ?? 4;\n this.retries = o.retries ?? 5;\n this.delay = o.retryDelay ?? backoff;\n this.targetSeconds = o.targetPartSeconds ?? 30;\n }\n\n /**\n * Uploads file to the item's folder: it hashes the whole file (off the\n * main thread) and presigns {path, type, size, sha256}, then sends nothing\n * (the folder holds the identical blob), or stages it: one checksum-bound\n * PUT up to 64 MiB, resumable multipart above. A refused presign throws\n * before any bytes move. Commit the result with a put op (or use put());\n * the worker then places a staged upload at the hash of its bytes.\n */\n async upload(file: Uploadable, o: UploadOptions): Promise<UploadedFile> {\n const type = o.type || file.type;\n if (!type) throw new ContentKitError(\"invalid_request\", \"the file has no content type\");\n throwIfAborted(o.signal);\n if (o.resume) return this.resumeMultipart(file, o.resume, o);\n const total = file.size;\n const sha256 = await sha256Hex(file, { signal: o.signal, onProgress: (loaded) => o.onProgress?.({ phase: \"hashing\", loaded, total }) });\n const presign = () => this.api.presign({ ref: o.ref, path: o.path, type, size: total, sha256 }, o.signal);\n let p = await presign();\n const out = (p: PresignReply): UploadedFile => ({ path: p.path, blob: p.blob, type, size: total, exists: !!p.exists, processOnUpload: !!p.process_on_upload });\n if (p.exists) return out(p);\n if (p.multipart) {\n const m = p.multipart;\n const state: UploadState = {\n ticket: m.ticket,\n path: p.path,\n blob: p.blob,\n type,\n size: total,\n ref: o.ref,\n file: fingerprint(file),\n limits: { minPartSize: m.min_part_size, maxPartSize: m.max_part_size, maxParts: m.max_parts },\n parts: [],\n processOnUpload: !!p.process_on_upload,\n };\n return this.multipart(file, state, new Set(), o);\n }\n await this.retry(\n async () => {\n if (p.exists) return;\n await this.transport(p.put!, file, { signal: o.signal, onProgress: (loaded) => o.onProgress?.({ phase: \"uploading\", loaded, total }) });\n },\n o.signal,\n async (err) => {\n // An expired URL: presign again (a Named upload gets a new name).\n if (err.code === \"storage\" && err.status === 403) p = await presign();\n },\n );\n return out(p);\n }\n\n /**\n * Uploads file and commits it as a put to its path (with edit, meta and\n * index), then by default waits until the worker processed it; resolves\n * with the upload as an editor reads it.\n */\n async put(file: Uploadable, o: UploadOptions & PutOptions): Promise<FileInfo> {\n const up = await this.upload(file, o);\n o.onUploaded?.(up);\n const op: Op = { op: \"put\", path: up.path, blob: up.blob };\n if (o.createOnly) op.create_id = crypto.randomUUID();\n if (o.edit) op.edit = o.edit;\n if (o.meta) op.meta = o.meta;\n if (o.index !== undefined) op.index = o.index;\n const files = await this.commit(o.ref, [op], { signal: o.signal, sources: { [up.blob]: { file, type: up.type } } });\n if (o.wait === false) return files.find((f) => f.path === up.path) ?? { path: up.path, type: up.type };\n o.onProgress?.({ phase: \"processing\", loaded: up.size, total: up.size });\n return this.waitFor(o.ref, up.path, { signal: o.signal, timeout: o.timeout });\n }\n\n /**\n * Applies ops to the item in one conditional write; returns its uploads as\n * an editor reads them. With sources (blob → the file uploaded as it), a\n * not_uploaded refusal (the blob expired or is due for cleanup) uploads\n * the affected files again and retries the commit once.\n */\n async commit(ref: RefBody, ops: Op[], o: CommitOptions = {}): Promise<FileInfo[]> {\n const emit = this.http.captureChanges();\n // Snapshot the batch once: retries must not pick up edits to the caller's\n // ops while the first request or its response is still in flight.\n const body: CommitBody = structuredClone({ ref, ops, operation_id: o.operationID ?? crypto.randomUUID() });\n o.onState?.(structuredClone(body));\n let files: FileInfo[];\n try {\n files = (await this.retry(() => this.api.commit(body, o.signal), o.signal)).files;\n } catch (e) {\n if (!(e instanceof ContentKitError) || e.code !== \"not_uploaded\") throw e;\n const sources = o.sources ?? {};\n const puts = body.ops.filter((op) => op.op === \"put\" && op.blob && op.blob in sources);\n const stale = [...new Set(puts.map((op) => op.blob!))].filter((b) => !e.blobs || e.blobs.includes(b));\n if (stale.length === 0) throw e;\n const renamed = new Map<string, string>();\n for (const blob of stale) {\n const src = sources[blob]!;\n const file = src instanceof Blob ? src : src.file;\n const type = src instanceof Blob ? undefined : src.type;\n const op = puts.find((p) => p.blob === blob)!;\n renamed.set(blob, (await this.upload(file, { ref: body.ref, path: op.path!, type, signal: o.signal })).blob);\n }\n const retried = body.ops.map((op) => (op.blob && renamed.has(op.blob) ? { ...op, blob: renamed.get(op.blob) } : op));\n // Re-uploading changes the inputs. This is a new batch, not a retry\n // under the old ID; transport retries retain its new identity.\n const replacement = { ref: body.ref, ops: retried, operation_id: crypto.randomUUID() };\n o.onState?.(structuredClone(replacement));\n files = (await this.retry(() => this.api.commit(replacement, o.signal), o.signal)).files;\n }\n emit({ type: \"media.committed\", ref: { kind: ref.kind, id: ref.id }, files });\n return files;\n }\n\n /** The read API: the item's files under prefix in manifest order, with signed URLs for what this viewer may have. */\n async read(ref: RefBody, o: ReadOptions & { signal?: AbortSignal } = {}): Promise<ReadResult> {\n this.api.itemURL(ref); // a bad ref fails at once\n return this.retry(() => this.api.read(ref, o, o.signal), o.signal);\n }\n\n /**\n * Polls an editor read until the upload at path (or with that stem) is\n * processed: placed (not staged), nothing pending and its blob present (a\n * frame grabbed).\n * Rejects with its failure, not_found once it is gone, too_large while the\n * item is full (nothing is processed until uploads are removed),\n * render_timeout after the timeout.\n */\n async waitFor(ref: RefBody, path: string, o: WaitOptions = {}): Promise<FileInfo> {\n const emit = this.http.captureChanges();\n const until = Date.now() + (o.timeout ?? 120_000);\n for (;;) {\n const r = await this.read(ref, { editor: true, prefix: stem(path), signal: o.signal });\n const f = r.files.find((x) => x.upload && samePath(x.path, path));\n if (!f) throw new ContentKitError(\"not_found\", `no upload ${path}`, { status: 404 });\n if (f.failed) throw failureError(f.failed);\n if (!f.pending?.length && !f.staged && (f.size ?? 0) > 0) {\n emit({ type: \"media.processed\", ref: { kind: ref.kind, id: ref.id }, file: f });\n return f;\n }\n if (r.full) throw new ContentKitError(\"too_large\", `${path} waits: the item is full; remove uploads to process more`, { status: 413 });\n if (Date.now() >= until) throw new ContentKitError(\"render_timeout\", `${path} is still processing`);\n await sleep(o.interval ?? 1000, o.signal);\n }\n }\n\n /**\n * The upload's editor view, for re-cropping: its URL and the upload's\n * oriented size. Waits while it renders (an editor read asks for it);\n * not_found when the path has no upload, render_timeout after the timeout\n * (default 30 s).\n */\n async editorView(ref: RefBody, path: string, o: WaitOptions = {}): Promise<{ url: string; width: number; height: number; edit?: Edit }> {\n const until = Date.now() + (o.timeout ?? 30_000);\n for (;;) {\n const r = await this.read(ref, { editor: true, prefix: stem(path), signal: o.signal });\n const f = r.files.find((x) => x.upload && samePath(x.path, path));\n if (!f) throw new ContentKitError(\"not_found\", `no upload ${path}`, { status: 404 });\n if (f.editor_url && f.w && f.h) return { url: f.editor_url, width: f.w, height: f.h, ...(f.edit ? { edit: f.edit } : {}) };\n if (f.failed) throw failureError(f.failed);\n if (Date.now() >= until) throw new ContentKitError(\"render_timeout\", `the editor view of ${path} is still rendering`);\n await sleep(o.interval ?? 1000, o.signal);\n }\n }\n\n /**\n * Every kind's public presets, fetched once per client: crop bounds,\n * widths and default images. An item's current image is in its read's\n * `public`, never built from a preset. Shared by every caller, so it takes\n * no signal; a failed fetch is retried on the next call.\n */\n presets(): Promise<PresetRule[]> {\n this.presetList ??= this.retry(() => this.api.presets()).catch((e: unknown) => {\n this.presetList = undefined;\n throw e;\n });\n return this.presetList;\n }\n\n /** A JPEG still of the video upload at path, t seconds in, w pixels wide (default the frame's). */\n getFrame(ref: RefBody, path: string, t: number, w?: number, signal?: AbortSignal): Promise<Blob> {\n return this.retry(() => this.api.frame(ref, path, t, w, signal), signal);\n }\n\n /** The folder of an HLS ladder from a read's `hls`: `{media}/{kind}/{id}/hls/{dir}`; master.m3u8 and sprite.vtt resolve under it. */\n hlsBase(ref: RefBody, dir: string): string {\n return `${this.api.itemURL(ref)}/hls/${dir}`;\n }\n\n /** hls.js `xhrSetup` for playlists on the API (the client's token and credentials); pass it to players as is. */\n get xhrSetup(): (xhr: XMLHttpRequest, url: string) => Promise<void> {\n return this.http.xhrSetup;\n }\n\n /**\n * Uploads an image to the item's server-named upload path and commits it\n * (by default waiting until it is processed); resolves with the name content\n * routes take: a poll or option image, a post cover.\n */\n async uploadNamed(ref: RefBody, file: Uploadable, o: NamedOptions = {}): Promise<NamedUpload> {\n const f = await this.put(file, { ref, path: o.path ?? (file.name || \"image\"), signal: o.signal, onProgress: o.onProgress, wait: o.wait, timeout: o.timeout });\n const name = stem(f.path.slice(f.path.lastIndexOf(\"/\") + 1));\n if (!named.test(name)) throw new ContentKitError(\"invalid_request\", `${f.path} is not a server-named upload path of ${ref.kind}`);\n return { name, path: f.path, file: f };\n }\n\n /**\n * An image for a post's rich-text body, uploaded to the post's folder;\n * resolves with its reference to store in the body (`ref`) and a URL that\n * shows it to the editor now (`url`, null while none exists).\n */\n async uploadInline(post: string, file: Uploadable, o: NamedOptions = {}): Promise<NamedUpload & InlineImage> {\n const up = await this.uploadNamed(this.postRef(post), file, o);\n const r: InlineImage = await call(this.http, \"POST\", \"/posts/{id}/images\", { params: { id: post }, body: { image: up.name }, signal: o.signal });\n return { ...up, ...r };\n }\n\n /** The media folder of a post. */\n postRef(id: string): RefBody {\n return { kind: this.folders.post, id };\n }\n\n /** The media folder of a poll. */\n pollRef(id: string): RefBody {\n return { kind: this.folders.poll, id };\n }\n\n /** Discards a paused multipart upload. */\n async discard(state: UploadState): Promise<void> {\n await this.api.abort(state.ref, { ticket: state.ticket });\n }\n\n private async resumeMultipart(file: Uploadable, state: UploadState, o: UploadOptions): Promise<UploadedFile> {\n const fp = fingerprint(file);\n if (fp.size !== state.size || fp.name !== state.file.name || fp.lastModified !== state.file.lastModified) {\n throw new ContentKitError(\"resume_mismatch\", \"the saved upload is for a different file\");\n }\n let listed;\n try {\n listed = await this.retry(() => this.api.listParts(state.ref, { ticket: state.ticket }, o.signal), o.signal);\n } catch (err) {\n // Gone: already completed (Complete is idempotent) or expired.\n if (err instanceof ContentKitError && err.code === \"not_found\") return this.complete(state, o);\n throw err;\n }\n const landed = new Set<number>();\n for (const l of listed.parts) {\n const plan = state.parts.find((p) => p.number === l.number);\n if (!plan || plan.size !== l.size || (l.sha256 && plan.sha256 !== l.sha256)) {\n // Parts this state does not describe: the upload cannot be finished consistently.\n await this.discard(state).catch(() => {});\n o.onState?.(null);\n return this.upload(file, { ...o, resume: undefined });\n }\n landed.add(l.number);\n }\n return this.multipart(file, structuredClone(state), landed, o);\n }\n\n private async multipart(file: Uploadable, state: UploadState, landed: Set<number>, o: UploadOptions): Promise<UploadedFile> {\n const pacer = new Pacer({ ...state.limits, maxConcurrency: this.concurrency, targetSeconds: this.targetSeconds });\n const emitState = () => o.onState?.(structuredClone(state));\n const sending = new Map<number, number>();\n let sent = state.parts.filter((p) => landed.has(p.number)).reduce((n, p) => n + p.size, 0);\n const emitProgress = () => {\n let loaded = sent;\n for (const n of sending.values()) loaded += n;\n o.onProgress?.({ phase: \"uploading\", loaded, total: state.size });\n };\n const pending = state.parts.filter((p) => !landed.has(p.number));\n let offset = state.parts.reduce((end, p) => Math.max(end, p.offset + p.size), 0);\n const next = (): PlannedPart | undefined => {\n const p = pending.shift();\n if (p || offset >= state.size) return p;\n const part: PlannedPart = {\n number: state.parts.length + 1,\n offset,\n size: Math.min(pacer.partSize(), state.size - offset),\n };\n offset += part.size;\n state.parts.push(part);\n return part;\n };\n\n const stop = new AbortController();\n const signal = o.signal ? AbortSignal.any([o.signal, stop.signal]) : stop.signal;\n // Parts hash and presign ahead of the PUT slots, so a freed slot starts\n // its next PUT at once; pacer.concurrency bounds only the PUTs.\n let putting = 0;\n const waiting: (() => void)[] = [];\n const acquire = () =>\n new Promise<void>((resolve, reject) => {\n const take = () => {\n signal.removeEventListener(\"abort\", drop);\n putting++;\n resolve();\n };\n const drop = () => {\n waiting.splice(waiting.indexOf(take) >>> 0, 1);\n reject(aborted(signal));\n };\n if (putting < pacer.concurrency) return take();\n if (signal.aborted) return reject(aborted(signal));\n signal.addEventListener(\"abort\", drop, { once: true });\n waiting.push(take);\n });\n const release = () => {\n putting--;\n while (putting < pacer.concurrency && waiting.length) waiting.shift()!();\n };\n const run = async (part: PlannedPart) => {\n const body = file.slice(part.offset, part.offset + part.size);\n await this.retry(async () => {\n if (!part.sha256) {\n part.sha256 = await sha256Hex(body, { signal });\n emitState();\n }\n const { parts } = await this.api.parts(\n state.ref,\n { ticket: state.ticket, parts: [{ number: part.number, size: part.size, sha256: part.sha256 }] },\n signal,\n );\n const req = parts[0]?.request as RequestReply;\n await acquire();\n const began = performance.now();\n const alongside = putting;\n try {\n await this.transport(req, body, {\n signal,\n onProgress: (n) => {\n sending.set(part.number, n);\n emitProgress();\n },\n });\n } finally {\n sending.delete(part.number);\n release();\n }\n pacer.record(part.size, performance.now() - began, alongside);\n sent += part.size;\n emitProgress();\n }, signal);\n };\n\n emitState();\n emitProgress();\n const inFlight = new Set<Promise<void>>();\n let failure: unknown;\n for (;;) {\n let part: PlannedPart | undefined;\n while (failure === undefined && inFlight.size < pacer.concurrency + 2 && (part = next())) {\n emitState();\n const job: Promise<void> = run(part).then(\n () => void inFlight.delete(job),\n (err) => {\n inFlight.delete(job);\n if (failure === undefined) {\n failure = err;\n stop.abort();\n }\n },\n );\n inFlight.add(job);\n }\n if (inFlight.size === 0) break;\n await Promise.race(inFlight);\n }\n if (failure !== undefined) {\n throw o.signal?.aborted ? aborted(o.signal) : failure;\n }\n return this.complete(state, o);\n }\n\n private async complete(state: UploadState, o: UploadOptions): Promise<UploadedFile> {\n o.onProgress?.({ phase: \"completing\", loaded: state.size, total: state.size });\n const c = await this.retry(() => this.api.complete(state.ref, { ticket: state.ticket }, o.signal), o.signal);\n o.onState?.(null);\n return { path: state.path, blob: c.blob, type: c.type, size: c.size, exists: false, processOnUpload: state.processOnUpload };\n }\n\n private async retry<T>(fn: () => Promise<T>, signal?: AbortSignal, before?: (err: ContentKitError) => Promise<void>): Promise<T> {\n for (let attempt = 0; ; attempt++) {\n try {\n return await fn();\n } catch (e) {\n const err = toContentKitError(e);\n if (signal?.aborted) throw aborted(signal);\n if (!err.transient || attempt >= this.retries) throw err;\n await sleep(this.delay(attempt, err.retryAfter), signal);\n await before?.(err);\n }\n }\n }\n}\n\nfunction fingerprint(f: Uploadable): UploadState[\"file\"] {\n return { name: f.name, lastModified: f.lastModified, size: f.size };\n}\n\n/** Exponential backoff from 1 s to 30 s with jitter, or the server's Retry-After. */\nexport function backoff(attempt: number, retryAfter?: number): number {\n if (retryAfter) return retryAfter * 1000;\n const base = Math.min(30_000, 1000 * 2 ** attempt);\n return base * (0.75 + Math.random() * 0.5);\n}\n\nexport function sleep(ms: number, signal?: AbortSignal): Promise<void> {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) return reject(aborted(signal));\n const t = setTimeout(() => {\n signal?.removeEventListener(\"abort\", onAbort);\n resolve();\n }, ms);\n const onAbort = () => {\n clearTimeout(t);\n reject(aborted(signal));\n };\n signal?.addEventListener(\"abort\", onAbort, { once: true });\n });\n}\n"],"mappings":";;;;;;;AAwIA,IAAM,IAAQ,oEAkBD,KAAY,GAAc,MAAiB,MAAS,KAAQ,EAAK,CAAI,MAAM,GAG3E,KAAQ,MAAiB;CACpC,IAAM,IAAI,EAAK,YAAY,GAAG;CAC9B,OAAO,IAAI,EAAK,YAAY,GAAG,IAAI,IAAI,EAAK,MAAM,GAAG,CAAC,IAAI;AAC5D,GAGa,IAAb,MAAyB;CAYJ;CAXnB;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CAEA,YACE,GACA,IAAkB,CAAC,GACnB,IAA0B,CAAC,GAC3B;EAOA,AAViB,KAAA,OAAA,GAIjB,KAAK,UAAU;GAAE,MAAM,EAAQ,QAAQ;GAAQ,MAAM,EAAQ,QAAQ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AS,MAAW;EACtC,IAAI,GAAQ,SAAS,OAAO,EAAO,EAAQ,CAAM,CAAC;EAClD,IAAM,IAAI,iBAAiB;GAEzB,AADA,GAAQ,oBAAoB,SAAS,CAAO,GAC5C,EAAQ;EACV,GAAG,CAAE,GACC,UAAgB;GAEpB,AADA,aAAa,CAAC,GACd,EAAO,EAAQ,CAAM,CAAC;EACxB;EACA,GAAQ,iBAAiB,SAAS,GAAS,EAAE,MAAM,GAAK,CAAC;CAC3D,CAAC;AACH"}
@@ -49,6 +49,6 @@ export declare function presetFor(presets: readonly PresetRule[], kind: string,
49
49
  /**
50
50
  * The kind's default image for a preset, at every width: what the gateway
51
51
  * serves for an item without its own (a URL from the template never names a
52
- * current file). Empty for a preview preset.
52
+ * current file). null when the preset has no default (`rule.default`).
53
53
  */
54
- export declare function defaultImage(rule: PresetRule, id: string): PublicPreset;
54
+ export declare function defaultImage(rule: PresetRule, id: string): PublicPreset | null;
@@ -123,11 +123,7 @@ function _(e, t, n, r) {
123
123
  }
124
124
  function v(e, i) {
125
125
  let a = r(e.aspect);
126
- return e.first || e.to.includes(o) ? {
127
- preset: e.name,
128
- aspect: e.aspect,
129
- renditions: []
130
- } : {
126
+ return !e.default || e.first || e.to.includes(o) ? null : {
131
127
  preset: e.name,
132
128
  aspect: e.aspect,
133
129
  renditions: e.widths.map((r) => ({