@openrails/contentkit-ui 0.86.0 → 0.87.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.
- package/README.md +39 -14
- package/dist/client/beacons.js +5 -1
- package/dist/client/beacons.js.map +1 -1
- package/dist/client/content/types.d.ts +4 -2
- package/dist/client/content/types.js.map +1 -1
- package/dist/client/contents.d.ts +8 -6
- package/dist/client/contents.js +10 -7
- package/dist/client/contents.js.map +1 -1
- package/dist/client/discovery.js +3 -0
- package/dist/client/discovery.js.map +1 -1
- package/dist/client/errors.d.ts +21 -3
- package/dist/client/errors.js +44 -14
- package/dist/client/errors.js.map +1 -1
- package/dist/client/gallery.d.ts +3 -5
- package/dist/client/gallery.js +16 -20
- package/dist/client/gallery.js.map +1 -1
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/error-codes.js +8 -0
- package/dist/client/generated/error-codes.js.map +1 -1
- package/dist/client/generated/routes.d.ts +16 -3
- package/dist/client/generated/routes.js +28 -3
- package/dist/client/generated/routes.js.map +1 -1
- package/dist/client/generated/wire.d.ts +43 -14
- package/dist/client/generated/wire.js.map +1 -1
- package/dist/client/http.js +27 -27
- package/dist/client/http.js.map +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/media/client.d.ts +10 -4
- package/dist/client/media/client.js +33 -7
- package/dist/client/media/client.js.map +1 -1
- package/dist/client/media/rules.d.ts +1 -1
- package/dist/client/media/rules.js +6 -6
- package/dist/client/media/rules.js.map +1 -1
- package/dist/client/media/transport.d.ts +1 -1
- package/dist/client/media/transport.js +16 -16
- package/dist/client/media/transport.js.map +1 -1
- package/dist/client/media/windows.js +1 -1
- package/dist/client/media/windows.js.map +1 -1
- package/dist/client/public.d.ts +2 -2
- package/dist/client/public.js +2 -2
- package/dist/client/public.js.map +1 -1
- package/dist/client/versions.d.ts +6 -4
- package/dist/client/versions.js +24 -26
- package/dist/client/versions.js.map +1 -1
- package/dist/client.js +25 -25
- package/dist/components/admin/content-manager.js +233 -232
- package/dist/components/admin/content-manager.js.map +1 -1
- package/dist/components/content/card.d.ts +5 -3
- package/dist/components/content/card.js +131 -109
- package/dist/components/content/card.js.map +1 -1
- package/dist/components/content/download-button.d.ts +26 -0
- package/dist/components/content/download-button.js +51 -0
- package/dist/components/content/download-button.js.map +1 -0
- package/dist/components/content/editors.d.ts +8 -0
- package/dist/components/content/editors.js +299 -229
- package/dist/components/content/editors.js.map +1 -1
- package/dist/components/content/grid.d.ts +8 -1
- package/dist/components/content/grid.js +125 -76
- package/dist/components/content/grid.js.map +1 -1
- package/dist/components/content/index.d.ts +3 -2
- package/dist/components/content/listing.d.ts +3 -1
- package/dist/components/content/listing.js.map +1 -1
- package/dist/components/content/paywall.js +61 -61
- package/dist/components/content/paywall.js.map +1 -1
- package/dist/components/media-gallery.d.ts +1 -4
- package/dist/components/media-gallery.js +19 -34
- package/dist/components/media-gallery.js.map +1 -1
- package/dist/components/social/comments.js +1 -1
- package/dist/components/social/comments.js.map +1 -1
- package/dist/components/social/engagement.d.ts +2 -1
- package/dist/components/social/engagement.js +5 -3
- package/dist/components/social/engagement.js.map +1 -1
- package/dist/i18n/messages.js +49 -46
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.js +12 -11
- package/dist/locales/de.js +15 -3
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/discovery/de.js +3 -0
- package/dist/locales/discovery/de.js.map +1 -1
- package/dist/locales/discovery/en.d.ts +3 -0
- package/dist/locales/discovery/en.js +3 -0
- package/dist/locales/discovery/en.js.map +1 -1
- package/dist/locales/discovery/es.js +3 -0
- package/dist/locales/discovery/es.js.map +1 -1
- package/dist/locales/discovery/ja.js +3 -0
- package/dist/locales/discovery/ja.js.map +1 -1
- package/dist/locales/discovery/ko.js +3 -0
- package/dist/locales/discovery/ko.js.map +1 -1
- package/dist/locales/discovery/zh.js +3 -0
- package/dist/locales/discovery/zh.js.map +1 -1
- package/dist/locales/en.d.ts +17 -2
- package/dist/locales/en.js +15 -3
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +15 -3
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +15 -3
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +15 -3
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +15 -3
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/comments.d.ts +1 -1
- package/dist/react/comments.js +3 -2
- package/dist/react/comments.js.map +1 -1
- package/dist/react/contents.d.ts +13 -5
- package/dist/react/contents.js +163 -149
- package/dist/react/contents.js.map +1 -1
- package/dist/react/context.d.ts +1 -1
- package/dist/react/context.js.map +1 -1
- package/dist/react/detail.d.ts +7 -1
- package/dist/react/detail.js +9 -6
- package/dist/react/detail.js.map +1 -1
- package/dist/react/discovery.d.ts +11 -0
- package/dist/react/discovery.js +49 -30
- package/dist/react/discovery.js.map +1 -1
- package/dist/react/engagement.d.ts +6 -2
- package/dist/react/engagement.js +2 -6
- package/dist/react/engagement.js.map +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/public.js +17 -16
- package/dist/react/public.js.map +1 -1
- package/dist/react/versions.d.ts +25 -5
- package/dist/react/versions.js +58 -37
- package/dist/react/versions.js.map +1 -1
- package/dist/react.js +9 -9
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/client/gallery.d.ts
CHANGED
|
@@ -10,12 +10,10 @@ export interface GalleryMediaItem {
|
|
|
10
10
|
/** Width / height from the read API; a default when unknown. */
|
|
11
11
|
aspect: number;
|
|
12
12
|
}
|
|
13
|
-
/** What a viewer without access is missing; `backdrop` is the public preview drawn behind it. */
|
|
13
|
+
/** What a viewer without access is missing, uncounted; `backdrop` is the public preview drawn behind it. */
|
|
14
14
|
export interface GalleryLockedItem {
|
|
15
15
|
kind: "locked";
|
|
16
16
|
key: string;
|
|
17
|
-
count: number;
|
|
18
|
-
videos: number;
|
|
19
17
|
backdrop?: string;
|
|
20
18
|
aspect: number;
|
|
21
19
|
}
|
|
@@ -31,8 +29,8 @@ export declare const isSubtitleType: (type?: string) => boolean;
|
|
|
31
29
|
* The read result as gallery items in manifest order. With access: each
|
|
32
30
|
* image, each playable HLS ladder (a folder in `hls`: a video, or an
|
|
33
31
|
* audio-only one) and each other audio file. Without: the item's public
|
|
34
|
-
* previews (the read's `previews`), then one locked item
|
|
35
|
-
*
|
|
32
|
+
* previews (the read's `previews`), then one locked item when the read says
|
|
33
|
+
* it holds locked files; a locked read lists none, so nothing counts them.
|
|
36
34
|
* Other files (plain videos, subtitles, zips) are not items; scope the read
|
|
37
35
|
* with a prefix to choose.
|
|
38
36
|
*/
|
package/dist/client/gallery.js
CHANGED
|
@@ -8,10 +8,9 @@ var e = (e) => !!e?.startsWith("video/"), t = (e) => !!e?.startsWith("audio/"),
|
|
|
8
8
|
function i(e, t) {
|
|
9
9
|
return e?.w && e.h ? e.w / e.h : t;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
function o(r) {
|
|
11
|
+
function a(r) {
|
|
13
12
|
if (!r) return [];
|
|
14
|
-
let
|
|
13
|
+
let a = r.access === "full", o = r.hls ?? [], s = (e) => o.find((t) => e.path.startsWith(t)), c = a ? [] : r.previews ?? [], l = c.map((e, t) => ({
|
|
15
14
|
kind: "image",
|
|
16
15
|
key: `preview/${t + 1}`,
|
|
17
16
|
file: {
|
|
@@ -20,17 +19,16 @@ function o(r) {
|
|
|
20
19
|
url: e
|
|
21
20
|
},
|
|
22
21
|
aspect: 1
|
|
23
|
-
})),
|
|
22
|
+
})), u = /* @__PURE__ */ new Set();
|
|
24
23
|
for (let a of r.files) {
|
|
25
|
-
|
|
26
|
-
let o = c(a);
|
|
24
|
+
let o = s(a);
|
|
27
25
|
if (o) {
|
|
28
|
-
if (
|
|
29
|
-
|
|
26
|
+
if (u.has(o)) continue;
|
|
27
|
+
u.add(o);
|
|
30
28
|
let n = r.files.filter((e) => e.path.startsWith(o)), a = n.filter((t) => e(t.type)).reduce((e, t) => (t.w ?? 0) > (e?.w ?? -1) ? t : e, void 0);
|
|
31
29
|
if (a) {
|
|
32
30
|
let e = a.dur ?? n.find((e) => e.dur)?.dur;
|
|
33
|
-
|
|
31
|
+
l.push({
|
|
34
32
|
kind: "video",
|
|
35
33
|
key: o,
|
|
36
34
|
dir: o,
|
|
@@ -42,7 +40,7 @@ function o(r) {
|
|
|
42
40
|
});
|
|
43
41
|
} else {
|
|
44
42
|
let e = n.find((e) => e.path.endsWith(".m4a")) ?? n.find((e) => t(e.type));
|
|
45
|
-
e &&
|
|
43
|
+
e && l.push({
|
|
46
44
|
kind: "audio",
|
|
47
45
|
key: o,
|
|
48
46
|
dir: o,
|
|
@@ -52,35 +50,33 @@ function o(r) {
|
|
|
52
50
|
}
|
|
53
51
|
continue;
|
|
54
52
|
}
|
|
55
|
-
n(a.type) ?
|
|
53
|
+
n(a.type) ? l.push({
|
|
56
54
|
kind: "image",
|
|
57
55
|
key: a.path,
|
|
58
56
|
file: a,
|
|
59
57
|
aspect: i(a, 1)
|
|
60
|
-
}) : t(a.type) &&
|
|
58
|
+
}) : t(a.type) && l.push({
|
|
61
59
|
kind: "audio",
|
|
62
60
|
key: a.path,
|
|
63
61
|
file: a,
|
|
64
62
|
aspect: 3
|
|
65
63
|
});
|
|
66
64
|
}
|
|
67
|
-
return
|
|
65
|
+
return !a && r.locked && l.push({
|
|
68
66
|
kind: "locked",
|
|
69
67
|
key: "locked",
|
|
70
|
-
|
|
71
|
-
videos: p,
|
|
72
|
-
backdrop: m.at(-1),
|
|
68
|
+
backdrop: c.at(-1),
|
|
73
69
|
aspect: 1
|
|
74
|
-
}),
|
|
70
|
+
}), l;
|
|
75
71
|
}
|
|
76
|
-
function
|
|
72
|
+
function o(e, t = 0) {
|
|
77
73
|
return e[t]?.aspect ?? 1;
|
|
78
74
|
}
|
|
79
|
-
function
|
|
75
|
+
function s(e) {
|
|
80
76
|
let t = Math.max(0, Math.round(e)), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = String(t % 60).padStart(2, "0");
|
|
81
77
|
return n ? `${n}:${String(r).padStart(2, "0")}:${i}` : `${r}:${i}`;
|
|
82
78
|
}
|
|
83
79
|
//#endregion
|
|
84
|
-
export {
|
|
80
|
+
export { s as formatDuration, a as galleryItems, t as isAudioType, n as isImageType, r as isSubtitleType, e as isVideoType, o as stageAspect };
|
|
85
81
|
|
|
86
82
|
//# sourceMappingURL=gallery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","names":[],"sources":["../../src/client/gallery.ts"],"sourcesContent":["import type { FileInfo, ReadResult } from \"./generated/wire.js\";\n\nexport type GalleryView = \"carousel\" | \"grid\";\n\nexport interface GalleryMediaItem {\n kind: \"image\" | \"video\" | \"audio\";\n key: string;\n /** An image; a ladder's widest video track (its size and duration) or its audio file. */\n file: FileInfo;\n /** A video or audio ladder's HLS folder from the read's `hls`, e.g. \"hls/\". */\n dir?: string;\n /** Width / height from the read API; a default when unknown. */\n aspect: number;\n}\n\n/** What a viewer without access is missing; `backdrop` is the public preview drawn behind it. */\nexport interface GalleryLockedItem {\n kind: \"locked\";\n key: string;\n
|
|
1
|
+
{"version":3,"file":"gallery.js","names":[],"sources":["../../src/client/gallery.ts"],"sourcesContent":["import type { FileInfo, ReadResult } from \"./generated/wire.js\";\n\nexport type GalleryView = \"carousel\" | \"grid\";\n\nexport interface GalleryMediaItem {\n kind: \"image\" | \"video\" | \"audio\";\n key: string;\n /** An image; a ladder's widest video track (its size and duration) or its audio file. */\n file: FileInfo;\n /** A video or audio ladder's HLS folder from the read's `hls`, e.g. \"hls/\". */\n dir?: string;\n /** Width / height from the read API; a default when unknown. */\n aspect: number;\n}\n\n/** What a viewer without access is missing, uncounted; `backdrop` is the public preview drawn behind it. */\nexport interface GalleryLockedItem {\n kind: \"locked\";\n key: string;\n backdrop?: string;\n aspect: number;\n}\n\nexport type GalleryItem = GalleryMediaItem | GalleryLockedItem;\n\nexport const isVideoType = (type?: string) => !!type?.startsWith(\"video/\");\nexport const isAudioType = (type?: string) => !!type?.startsWith(\"audio/\");\nexport const isImageType = (type?: string) => !!type?.startsWith(\"image/\");\n\n/** The stage aspect of an audio slide. */\nexport const AUDIO_ASPECT = 3;\n\n/** Subtitle files are a video's text tracks, not gallery items. */\nexport const isSubtitleType = (type?: string) =>\n [\"text/vtt\", \"application/x-subrip\", \"text/x-ssa\", \"text/x-ass\"].includes(type ?? \"\");\n\nfunction aspectOf(f: FileInfo | undefined, fallback: number) {\n return f?.w && f.h ? f.w / f.h : fallback;\n}\n\n/**\n * The read result as gallery items in manifest order. With access: each\n * image, each playable HLS ladder (a folder in `hls`: a video, or an\n * audio-only one) and each other audio file. Without: the item's public\n * previews (the read's `previews`), then one locked item when the read says\n * it holds locked files; a locked read lists none, so nothing counts them.\n * Other files (plain videos, subtitles, zips) are not items; scope the read\n * with a prefix to choose.\n */\nexport function galleryItems(read: ReadResult | null | undefined): GalleryItem[] {\n if (!read) return [];\n const full = read.access === \"full\";\n const dirs = read.hls ?? [];\n const dirOf = (f: FileInfo) => dirs.find((d) => f.path.startsWith(d));\n const previews = full ? [] : (read.previews ?? []);\n const items: GalleryItem[] = previews.map((url, i) => ({ kind: \"image\", key: `preview/${i + 1}`, file: { path: `preview/${i + 1}`, type: \"image/webp\", url }, aspect: 1 }));\n const seen = new Set<string>();\n for (const f of read.files) {\n const dir = dirOf(f);\n if (dir) {\n if (seen.has(dir)) continue;\n seen.add(dir);\n const files = read.files.filter((x) => x.path.startsWith(dir));\n const video = files.filter((x) => isVideoType(x.type)).reduce<FileInfo | undefined>((a, x) => ((x.w ?? 0) > (a?.w ?? -1) ? x : a), undefined);\n if (video) {\n const dur = video.dur ?? files.find((x) => x.dur)?.dur;\n items.push({ kind: \"video\", key: dir, dir, file: { ...video, dur }, aspect: aspectOf(video, 16 / 9) });\n } else {\n const audio = files.find((x) => x.path.endsWith(\".m4a\")) ?? files.find((x) => isAudioType(x.type));\n if (audio) items.push({ kind: \"audio\", key: dir, dir, file: audio, aspect: AUDIO_ASPECT });\n }\n continue;\n }\n if (isImageType(f.type)) items.push({ kind: \"image\", key: f.path, file: f, aspect: aspectOf(f, 1) });\n else if (isAudioType(f.type)) items.push({ kind: \"audio\", key: f.path, file: f, aspect: AUDIO_ASPECT });\n }\n if (!full && read.locked) items.push({ kind: \"locked\", key: \"locked\", backdrop: previews.at(-1), aspect: 1 });\n return items;\n}\n\n/** The carousel stage's width / height: the current item's native aspect. */\nexport function stageAspect(items: readonly GalleryItem[], index = 0): number {\n return items[index]?.aspect ?? 1;\n}\n\n/** \"0:42\", \"12:05\", \"1:02:09\". */\nexport function formatDuration(seconds: number): string {\n const s = Math.max(0, Math.round(seconds));\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const ss = String(s % 60).padStart(2, \"0\");\n return h ? `${h}:${String(m).padStart(2, \"0\")}:${ss}` : `${m}:${ss}`;\n}\n"],"mappings":";AAyBA,IAAa,KAAe,MAAkB,CAAC,CAAC,GAAM,WAAW,QAAQ,GAC5D,KAAe,MAAkB,CAAC,CAAC,GAAM,WAAW,QAAQ,GAC5D,KAAe,MAAkB,CAAC,CAAC,GAAM,WAAW,QAAQ,GAM5D,KAAkB,MAC7B;CAAC;CAAY;CAAwB;CAAc;AAAY,CAAC,CAAC,SAAS,KAAQ,EAAE;AAEtF,SAAS,EAAS,GAAyB,GAAkB;CAC3D,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;AACnC;AAWA,SAAgB,EAAa,GAAoD;CAC/E,IAAI,CAAC,GAAM,OAAO,CAAC;CACnB,IAAM,IAAO,EAAK,WAAW,QACvB,IAAO,EAAK,OAAO,CAAC,GACpB,KAAS,MAAgB,EAAK,MAAM,MAAM,EAAE,KAAK,WAAW,CAAC,CAAC,GAC9D,IAAW,IAAO,CAAC,IAAK,EAAK,YAAY,CAAC,GAC1C,IAAuB,EAAS,KAAK,GAAK,OAAO;EAAE,MAAM;EAAS,KAAK,WAAW,IAAI;E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AM,KAAK;EAAE,MAAM;EAAU,KAAK;EAAU,UAAU,EAAS,GAAG,EAAE;EAAG,QAAQ;CAAE,CAAC,GACrG;AACT;AAGA,SAAgB,EAAY,GAA+B,IAAQ,GAAW;CAC5E,OAAO,EAAM,EAAM,EAAE,UAAU;AACjC;AAGA,SAAgB,EAAe,GAAyB;CACtD,IAAM,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,CAAO,CAAC,GACnC,IAAI,KAAK,MAAM,IAAI,IAAI,GACvB,IAAI,KAAK,MAAO,IAAI,OAAQ,EAAE,GAC9B,IAAK,OAAO,IAAI,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;CACzC,OAAO,IAAI,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,MAAO,GAAG,EAAE,GAAG;AAClE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ErrorCode = "animation_not_allowed" | "animation_too_long" | "animation_unsupported" | "checksum_mismatch" | "comment_banned" | "comment_too_long" | "comments_closed" | "comments_locked" | "conflict" | "forbidden" | "gone" | "image_too_large" | "image_too_small" | "image_unreadable" | "incomplete" | "internal_error" | "invalid_request" | "limit_reached" | "moderation_rejected" | "not_configured" | "not_found" | "not_joinable" | "not_uploaded" | "quota_exceeded" | "rate_limited" | "tenant_mismatch" | "too_large" | "too_many_files" | "type_not_allowed" | "unauthorized" | "unavailable" | "upgrade_required" | "video_aspect_unsupported" | "video_over_budget" | "video_too_large" | "video_too_long";
|
|
1
|
+
export type ErrorCode = "animation_not_allowed" | "animation_too_long" | "animation_unsupported" | "checksum_mismatch" | "comment_banned" | "comment_too_long" | "comments_closed" | "comments_locked" | "conflict" | "download_unavailable" | "forbidden" | "gone" | "image_too_large" | "image_too_small" | "image_unreadable" | "incomplete" | "internal_error" | "invalid_request" | "limit_reached" | "moderation_rejected" | "no_download" | "not_configured" | "not_found" | "not_joinable" | "not_uploaded" | "quota_exceeded" | "rate_limited" | "tenant_mismatch" | "too_large" | "too_many_files" | "type_not_allowed" | "unauthorized" | "unavailable" | "upgrade_required" | "video_aspect_unsupported" | "video_over_budget" | "video_too_large" | "video_too_long";
|
|
2
2
|
export declare const CONTENTKIT_ERROR_CODES: Readonly<Record<ErrorCode, {
|
|
3
3
|
status: number;
|
|
4
4
|
meaning: string;
|
|
@@ -36,6 +36,10 @@ var e = {
|
|
|
36
36
|
status: 409,
|
|
37
37
|
meaning: "A concurrent change, a path or slug already taken, or an operation id already used for another commit."
|
|
38
38
|
},
|
|
39
|
+
download_unavailable: {
|
|
40
|
+
status: 403,
|
|
41
|
+
meaning: "The host's download policy refuses this download now: `reason` is its code, `available_at` when it opens if a matter of time. Nothing was charged."
|
|
42
|
+
},
|
|
39
43
|
forbidden: {
|
|
40
44
|
status: 403,
|
|
41
45
|
meaning: "The actor may not do this."
|
|
@@ -76,6 +80,10 @@ var e = {
|
|
|
76
80
|
status: 422,
|
|
77
81
|
meaning: "The moderator refused the text; `error` says why."
|
|
78
82
|
},
|
|
83
|
+
no_download: {
|
|
84
|
+
status: 409,
|
|
85
|
+
meaning: "The version has no file its kind's download serves: nothing uploaded, or its upload failed or was dropped."
|
|
86
|
+
},
|
|
79
87
|
not_configured: {
|
|
80
88
|
status: 501,
|
|
81
89
|
meaning: "The capability needs a port the host did not configure; retrying does not help."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.js","names":[],"sources":["../../../src/client/generated/error-codes.ts"],"sourcesContent":["// Generated by `go generate ./internal/contract` from ContentKit's error-code registry. Do not edit.\n\nexport type ErrorCode =\n | \"animation_not_allowed\"\n | \"animation_too_long\"\n | \"animation_unsupported\"\n | \"checksum_mismatch\"\n | \"comment_banned\"\n | \"comment_too_long\"\n | \"comments_closed\"\n | \"comments_locked\"\n | \"conflict\"\n | \"forbidden\"\n | \"gone\"\n | \"image_too_large\"\n | \"image_too_small\"\n | \"image_unreadable\"\n | \"incomplete\"\n | \"internal_error\"\n | \"invalid_request\"\n | \"limit_reached\"\n | \"moderation_rejected\"\n | \"not_configured\"\n | \"not_found\"\n | \"not_joinable\"\n | \"not_uploaded\"\n | \"quota_exceeded\"\n | \"rate_limited\"\n | \"tenant_mismatch\"\n | \"too_large\"\n | \"too_many_files\"\n | \"type_not_allowed\"\n | \"unauthorized\"\n | \"unavailable\"\n | \"upgrade_required\"\n | \"video_aspect_unsupported\"\n | \"video_over_budget\"\n | \"video_too_large\"\n | \"video_too_long\"\n;\n\n// Each code's HTTP status and meaning. A message on the wire is for people;\n// classify by code.\nexport const CONTENTKIT_ERROR_CODES: Readonly<Record<ErrorCode, { status: number; meaning: string }>> = {\n animation_not_allowed: { status: 422, meaning: \"An animated image where the upload path refuses animation.\" },\n animation_too_long: { status: 422, meaning: \"The animation has more frames or seconds than the processor allows.\" },\n animation_unsupported: { status: 415, meaning: \"An AVIF or HEIF image sequence, which is decoded as one frame.\" },\n checksum_mismatch: { status: 422, meaning: \"The stored bytes differ from the declared SHA-256.\" },\n comment_banned: { status: 403, meaning: \"The actor is banned from commenting on this target; `ban` says the scope, the reason and when it ends.\" },\n comment_too_long: { status: 422, meaning: \"The comment is longer than the site allows; `details.max` is the limit in characters.\" },\n comments_closed: { status: 403, meaning: \"The target's comments are closed or hidden: existing ones may show, new ones and edits are refused.\" },\n comments_locked: { status: 403, meaning: \"The actor can't open the content (or the comment's version), so its comments take no writes from them; reads withhold them.\" },\n conflict: { status: 409, meaning: \"A concurrent change, a path or slug already taken, or an operation id already used for another commit.\" },\n forbidden: { status: 403, meaning: \"The actor may not do this.\" },\n gone: { status: 410, meaning: \"The content was removed.\" },\n image_too_large: { status: 413, meaning: \"The image has more pixels or frames than the processor decodes.\" },\n image_too_small: { status: 422, meaning: \"The edited image is narrower than its public preset's minimum width.\" },\n image_unreadable: { status: 422, meaning: \"The file is not a decodable image of its declared type.\" },\n incomplete: { status: 409, meaning: \"A multipart upload is missing parts.\" },\n internal_error: { status: 500, meaning: \"A server fault; the cause is in the server log.\" },\n invalid_request: { status: 400, meaning: \"The request is malformed: its body, a query parameter or a path value.\" },\n limit_reached: { status: 409, meaning: \"The owner already has as many groups of the kind as the site allows (max_per_owner).\" },\n moderation_rejected: { status: 422, meaning: \"The moderator refused the text; `error` says why.\" },\n not_configured: { status: 501, meaning: \"The capability needs a port the host did not configure; retrying does not help.\" },\n not_found: { status: 404, meaning: \"Nothing by that name, or nothing the actor may see.\" },\n not_joinable: { status: 409, meaning: \"The group has no free offer to join: it sells its membership, or nothing.\" },\n not_uploaded: { status: 409, meaning: \"A commit names an upload that has not landed; `blobs` lists the ones to upload again.\" },\n quota_exceeded: { status: 413, meaning: \"The uploader's storage quota is used up.\" },\n rate_limited: { status: 429, meaning: \"Too many requests; retry after `retry_after` seconds (also the Retry-After header).\" },\n tenant_mismatch: { status: 500, meaning: \"A host port answered with another tenant's data: a configuration fault.\" },\n too_large: { status: 413, meaning: \"The file is larger than its upload path allows; `details` has `size` and `max_bytes`.\" },\n too_many_files: { status: 409, meaning: \"The commit would put more files in an upload path, or the item, than allowed; `details.max` is the limit.\" },\n type_not_allowed: { status: 415, meaning: \"The file type is not allowed in the upload path; `details.allowed` lists the types.\" },\n unauthorized: { status: 401, meaning: \"The request needs a valid credential: it has none where the route needs one, or one that is expired, revoked or invalid. WWW-Authenticate says which.\" },\n unavailable: { status: 503, meaning: \"The host's auth, media storage or signal plane cannot be reached, or a commit's recovery is pending; retry.\" },\n upgrade_required: { status: 503, meaning: \"The media item was stored before v0.68 and is served once the host's media upgrade (contentkit_media_upgrade) has converted it.\" },\n video_aspect_unsupported: { status: 422, meaning: \"The video's display aspect is outside what its upload path accepts; `details` has `min_aspect` and `max_aspect` (width/height).\" },\n video_over_budget: { status: 422, meaning: \"The planned encode costs more than its upload path allows, or the source averages under a frame a second.\" },\n video_too_large: { status: 422, meaning: \"The video's frames are larger than its upload path allows.\" },\n video_too_long: { status: 422, meaning: \"The video or audio runs longer than its upload path allows.\" },\n};\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"error-codes.js","names":[],"sources":["../../../src/client/generated/error-codes.ts"],"sourcesContent":["// Generated by `go generate ./internal/contract` from ContentKit's error-code registry. Do not edit.\n\nexport type ErrorCode =\n | \"animation_not_allowed\"\n | \"animation_too_long\"\n | \"animation_unsupported\"\n | \"checksum_mismatch\"\n | \"comment_banned\"\n | \"comment_too_long\"\n | \"comments_closed\"\n | \"comments_locked\"\n | \"conflict\"\n | \"download_unavailable\"\n | \"forbidden\"\n | \"gone\"\n | \"image_too_large\"\n | \"image_too_small\"\n | \"image_unreadable\"\n | \"incomplete\"\n | \"internal_error\"\n | \"invalid_request\"\n | \"limit_reached\"\n | \"moderation_rejected\"\n | \"no_download\"\n | \"not_configured\"\n | \"not_found\"\n | \"not_joinable\"\n | \"not_uploaded\"\n | \"quota_exceeded\"\n | \"rate_limited\"\n | \"tenant_mismatch\"\n | \"too_large\"\n | \"too_many_files\"\n | \"type_not_allowed\"\n | \"unauthorized\"\n | \"unavailable\"\n | \"upgrade_required\"\n | \"video_aspect_unsupported\"\n | \"video_over_budget\"\n | \"video_too_large\"\n | \"video_too_long\"\n;\n\n// Each code's HTTP status and meaning. A message on the wire is for people;\n// classify by code.\nexport const CONTENTKIT_ERROR_CODES: Readonly<Record<ErrorCode, { status: number; meaning: string }>> = {\n animation_not_allowed: { status: 422, meaning: \"An animated image where the upload path refuses animation.\" },\n animation_too_long: { status: 422, meaning: \"The animation has more frames or seconds than the processor allows.\" },\n animation_unsupported: { status: 415, meaning: \"An AVIF or HEIF image sequence, which is decoded as one frame.\" },\n checksum_mismatch: { status: 422, meaning: \"The stored bytes differ from the declared SHA-256.\" },\n comment_banned: { status: 403, meaning: \"The actor is banned from commenting on this target; `ban` says the scope, the reason and when it ends.\" },\n comment_too_long: { status: 422, meaning: \"The comment is longer than the site allows; `details.max` is the limit in characters.\" },\n comments_closed: { status: 403, meaning: \"The target's comments are closed or hidden: existing ones may show, new ones and edits are refused.\" },\n comments_locked: { status: 403, meaning: \"The actor can't open the content (or the comment's version), so its comments take no writes from them; reads withhold them.\" },\n conflict: { status: 409, meaning: \"A concurrent change, a path or slug already taken, or an operation id already used for another commit.\" },\n download_unavailable: { status: 403, meaning: \"The host's download policy refuses this download now: `reason` is its code, `available_at` when it opens if a matter of time. Nothing was charged.\" },\n forbidden: { status: 403, meaning: \"The actor may not do this.\" },\n gone: { status: 410, meaning: \"The content was removed.\" },\n image_too_large: { status: 413, meaning: \"The image has more pixels or frames than the processor decodes.\" },\n image_too_small: { status: 422, meaning: \"The edited image is narrower than its public preset's minimum width.\" },\n image_unreadable: { status: 422, meaning: \"The file is not a decodable image of its declared type.\" },\n incomplete: { status: 409, meaning: \"A multipart upload is missing parts.\" },\n internal_error: { status: 500, meaning: \"A server fault; the cause is in the server log.\" },\n invalid_request: { status: 400, meaning: \"The request is malformed: its body, a query parameter or a path value.\" },\n limit_reached: { status: 409, meaning: \"The owner already has as many groups of the kind as the site allows (max_per_owner).\" },\n moderation_rejected: { status: 422, meaning: \"The moderator refused the text; `error` says why.\" },\n no_download: { status: 409, meaning: \"The version has no file its kind's download serves: nothing uploaded, or its upload failed or was dropped.\" },\n not_configured: { status: 501, meaning: \"The capability needs a port the host did not configure; retrying does not help.\" },\n not_found: { status: 404, meaning: \"Nothing by that name, or nothing the actor may see.\" },\n not_joinable: { status: 409, meaning: \"The group has no free offer to join: it sells its membership, or nothing.\" },\n not_uploaded: { status: 409, meaning: \"A commit names an upload that has not landed; `blobs` lists the ones to upload again.\" },\n quota_exceeded: { status: 413, meaning: \"The uploader's storage quota is used up.\" },\n rate_limited: { status: 429, meaning: \"Too many requests; retry after `retry_after` seconds (also the Retry-After header).\" },\n tenant_mismatch: { status: 500, meaning: \"A host port answered with another tenant's data: a configuration fault.\" },\n too_large: { status: 413, meaning: \"The file is larger than its upload path allows; `details` has `size` and `max_bytes`.\" },\n too_many_files: { status: 409, meaning: \"The commit would put more files in an upload path, or the item, than allowed; `details.max` is the limit.\" },\n type_not_allowed: { status: 415, meaning: \"The file type is not allowed in the upload path; `details.allowed` lists the types.\" },\n unauthorized: { status: 401, meaning: \"The request needs a valid credential: it has none where the route needs one, or one that is expired, revoked or invalid. WWW-Authenticate says which.\" },\n unavailable: { status: 503, meaning: \"The host's auth, media storage or signal plane cannot be reached, or a commit's recovery is pending; retry.\" },\n upgrade_required: { status: 503, meaning: \"The media item was stored before v0.68 and is served once the host's media upgrade (contentkit_media_upgrade) has converted it.\" },\n video_aspect_unsupported: { status: 422, meaning: \"The video's display aspect is outside what its upload path accepts; `details` has `min_aspect` and `max_aspect` (width/height).\" },\n video_over_budget: { status: 422, meaning: \"The planned encode costs more than its upload path allows, or the source averages under a frame a second.\" },\n video_too_large: { status: 422, meaning: \"The video's frames are larger than its upload path allows.\" },\n video_too_long: { status: 422, meaning: \"The video or audio runs longer than its upload path allows.\" },\n};\n"],"mappings":";AA6CA,IAAa,IAA2F;CACtG,uBAAuB;EAAE,QAAQ;EAAK,SAAS;CAA6D;CAC5G,oBAAoB;EAAE,QAAQ;EAAK,SAAS;CAAsE;CAClH,uBAAuB;EAAE,QAAQ;EAAK,SAAS;CAAiE;CAChH,mBAAmB;EAAE,QAAQ;EAAK,SAAS;CAAqD;CAChG,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAAyG;CACjJ,kBAAkB;EAAE,QAAQ;EAAK,SAAS;CAAwF;CAClI,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAAsG;CAC/I,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAA8H;CACvK,UAAU;EAAE,QAAQ;EAAK,SAAS;CAAyG;CAC3I,sBAAsB;EAAE,QAAQ;EAAK,SAAS;CAAqJ;CACnM,WAAW;EAAE,QAAQ;EAAK,SAAS;CAA6B;CAChE,MAAM;EAAE,QAAQ;EAAK,SAAS;CAA2B;CACzD,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAAkE;CAC3G,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAAuE;CAChH,kBAAkB;EAAE,QAA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query: readonly [];
|
|
1041
|
-
readonly request: "
|
|
1041
|
+
readonly request: "BodyImageInput";
|
|
1042
1042
|
readonly responses: {
|
|
1043
1043
|
readonly 200: "InlineImage";
|
|
1044
1044
|
};
|
|
@@ -1665,10 +1665,23 @@ export declare const CONTENTKIT_ROUTES: readonly [{
|
|
|
1665
1665
|
readonly query: readonly [];
|
|
1666
1666
|
readonly request: null;
|
|
1667
1667
|
readonly responses: {
|
|
1668
|
-
readonly 200: "
|
|
1668
|
+
readonly 200: "FileDownload";
|
|
1669
1669
|
readonly 202: "Pending";
|
|
1670
1670
|
};
|
|
1671
|
-
readonly errors: readonly ["forbidden", "rate_limited"];
|
|
1671
|
+
readonly errors: readonly ["forbidden", "download_unavailable", "rate_limited", "no_download"];
|
|
1672
|
+
readonly errorSets: readonly ["module:versions", "auth", "request"];
|
|
1673
|
+
}, {
|
|
1674
|
+
readonly method: "GET";
|
|
1675
|
+
readonly module: "versions";
|
|
1676
|
+
readonly path: "/contents/{id}/versions/{version}/archive";
|
|
1677
|
+
readonly auth: "public";
|
|
1678
|
+
readonly permission: null;
|
|
1679
|
+
readonly query: readonly ["for", "mark", "ticket"];
|
|
1680
|
+
readonly request: null;
|
|
1681
|
+
readonly responses: {
|
|
1682
|
+
readonly 200: "application/zip";
|
|
1683
|
+
};
|
|
1684
|
+
readonly errors: readonly [];
|
|
1672
1685
|
readonly errorSets: readonly ["module:versions", "auth", "request"];
|
|
1673
1686
|
}, {
|
|
1674
1687
|
readonly method: "PUT";
|
|
@@ -1451,7 +1451,7 @@ var e = {
|
|
|
1451
1451
|
auth: "public",
|
|
1452
1452
|
permission: null,
|
|
1453
1453
|
query: [],
|
|
1454
|
-
request: "
|
|
1454
|
+
request: "BodyImageInput",
|
|
1455
1455
|
responses: { 200: "InlineImage" },
|
|
1456
1456
|
errors: [
|
|
1457
1457
|
"forbidden",
|
|
@@ -2301,10 +2301,35 @@ var e = {
|
|
|
2301
2301
|
query: [],
|
|
2302
2302
|
request: null,
|
|
2303
2303
|
responses: {
|
|
2304
|
-
200: "
|
|
2304
|
+
200: "FileDownload",
|
|
2305
2305
|
202: "Pending"
|
|
2306
2306
|
},
|
|
2307
|
-
errors: [
|
|
2307
|
+
errors: [
|
|
2308
|
+
"forbidden",
|
|
2309
|
+
"download_unavailable",
|
|
2310
|
+
"rate_limited",
|
|
2311
|
+
"no_download"
|
|
2312
|
+
],
|
|
2313
|
+
errorSets: [
|
|
2314
|
+
"module:versions",
|
|
2315
|
+
"auth",
|
|
2316
|
+
"request"
|
|
2317
|
+
]
|
|
2318
|
+
},
|
|
2319
|
+
{
|
|
2320
|
+
method: "GET",
|
|
2321
|
+
module: "versions",
|
|
2322
|
+
path: "/contents/{id}/versions/{version}/archive",
|
|
2323
|
+
auth: "public",
|
|
2324
|
+
permission: null,
|
|
2325
|
+
query: [
|
|
2326
|
+
"for",
|
|
2327
|
+
"mark",
|
|
2328
|
+
"ticket"
|
|
2329
|
+
],
|
|
2330
|
+
request: null,
|
|
2331
|
+
responses: { 200: "application/zip" },
|
|
2332
|
+
errors: [],
|
|
2308
2333
|
errorSets: [
|
|
2309
2334
|
"module:versions",
|
|
2310
2335
|
"auth",
|