@openrails/contentkit-ui 0.68.0 → 0.69.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 +55 -10
- package/dist/client/client.d.ts +4 -2
- package/dist/client/client.js +1 -0
- package/dist/client/client.js.map +1 -1
- package/dist/client/content/bans.js +7 -7
- package/dist/client/content/bans.js.map +1 -1
- package/dist/client/content/comments.js +16 -14
- package/dist/client/content/comments.js.map +1 -1
- package/dist/client/content/favorites.js +5 -5
- package/dist/client/content/favorites.js.map +1 -1
- package/dist/client/content/moderation.js +5 -5
- package/dist/client/content/moderation.js.map +1 -1
- package/dist/client/content/polls.js +34 -31
- package/dist/client/content/polls.js.map +1 -1
- package/dist/client/content/posts.js +21 -20
- package/dist/client/content/posts.js.map +1 -1
- package/dist/client/content/reactions.js +4 -4
- package/dist/client/content/reactions.js.map +1 -1
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/error-codes.js +4 -0
- package/dist/client/generated/error-codes.js.map +1 -1
- package/dist/client/generated/routes.js.map +1 -1
- package/dist/client/http.d.ts +6 -2
- package/dist/client/http.js +11 -3
- package/dist/client/http.js.map +1 -1
- package/dist/client/media/client.js +24 -24
- package/dist/client/media/client.js.map +1 -1
- package/dist/client/media/rules.d.ts +2 -0
- package/dist/client/media/rules.js +6 -2
- package/dist/client/media/rules.js.map +1 -1
- package/dist/client/taxonomy.js +2 -2
- package/dist/client/taxonomy.js.map +1 -1
- package/dist/components/media-folder-editor.d.ts +17 -3
- package/dist/components/media-folder-editor.js +146 -99
- package/dist/components/media-folder-editor.js.map +1 -1
- package/dist/components/slot-upload.js +102 -100
- package/dist/components/slot-upload.js.map +1 -1
- package/dist/locales/de.js +1 -0
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts +1 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +1 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +1 -0
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +1 -0
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/canonical.d.ts +2 -2
- package/dist/react/canonical.js +2 -12
- package/dist/react/canonical.js.map +1 -1
- package/dist/react/comments.js +35 -27
- package/dist/react/comments.js.map +1 -1
- package/dist/react/context.d.ts +7 -0
- package/dist/react/context.js +20 -15
- package/dist/react/context.js.map +1 -1
- package/dist/react/engagement.js +2 -2
- package/dist/react/engagement.js.map +1 -1
- package/dist/react/folder.d.ts +29 -9
- package/dist/react/folder.js +170 -113
- package/dist/react/folder.js.map +1 -1
- package/dist/react/polls.js +3 -3
- package/dist/react/polls.js.map +1 -1
- package/dist/react/posts.js +2 -2
- package/dist/react/posts.js.map +1 -1
- package/dist/react/provider.d.ts +7 -3
- package/dist/react/provider.js +34 -20
- package/dist/react/provider.js.map +1 -1
- package/dist/react/public.js +11 -11
- package/dist/react/public.js.map +1 -1
- package/dist/react/read.js +93 -92
- package/dist/react/read.js.map +1 -1
- package/dist/react/resources.d.ts +6 -3
- package/dist/react/resources.js +40 -40
- package/dist/react/resources.js.map +1 -1
- package/dist/react/slot.d.ts +4 -2
- package/dist/react/slot.js +96 -92
- package/dist/react/slot.js.map +1 -1
- package/dist/react/store.d.ts +1 -1
- package/dist/react/store.js +21 -20
- package/dist/react/store.js.map +1 -1
- package/dist/react/upload.d.ts +3 -2
- package/dist/react/upload.js +20 -15
- package/dist/react/upload.js.map +1 -1
- package/dist/react/use-resource.d.ts +1 -0
- package/dist/react/use-resource.js +38 -30
- package/dist/react/use-resource.js.map +1 -1
- package/dist/react.js +15 -15
- package/package.json +7 -5
|
@@ -26,51 +26,52 @@ var n = class {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
async create(t) {
|
|
29
|
-
let n = await e(this.http, "POST", "/posts", { body: t });
|
|
30
|
-
return
|
|
29
|
+
let n = this.http.captureChanges(), r = await e(this.http, "POST", "/posts", { body: t });
|
|
30
|
+
return n({
|
|
31
31
|
type: "post.created",
|
|
32
|
-
post:
|
|
33
|
-
}),
|
|
32
|
+
post: r
|
|
33
|
+
}), r;
|
|
34
34
|
}
|
|
35
35
|
async update(t, n) {
|
|
36
|
-
let r = await e(this.http, "PATCH", "/posts/{id}", {
|
|
36
|
+
let r = this.http.captureChanges(), i = await e(this.http, "PATCH", "/posts/{id}", {
|
|
37
37
|
params: { id: t },
|
|
38
38
|
body: n
|
|
39
39
|
});
|
|
40
|
-
return
|
|
40
|
+
return r({
|
|
41
41
|
type: "post.updated",
|
|
42
|
-
post:
|
|
43
|
-
}),
|
|
42
|
+
post: i
|
|
43
|
+
}), i;
|
|
44
44
|
}
|
|
45
45
|
async delete(t) {
|
|
46
|
-
|
|
46
|
+
let n = this.http.captureChanges();
|
|
47
|
+
await e(this.http, "DELETE", "/posts/{id}", { params: { id: t } }), n({
|
|
47
48
|
type: "post.deleted",
|
|
48
49
|
id: t
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
async restore(t) {
|
|
52
|
-
let n = await e(this.http, "POST", "/posts/{id}/restore", { params: { id: t } });
|
|
53
|
-
return
|
|
53
|
+
let n = this.http.captureChanges(), r = await e(this.http, "POST", "/posts/{id}/restore", { params: { id: t } });
|
|
54
|
+
return n({
|
|
54
55
|
type: "post.restored",
|
|
55
|
-
post:
|
|
56
|
-
}),
|
|
56
|
+
post: r
|
|
57
|
+
}), r;
|
|
57
58
|
}
|
|
58
59
|
async react(n, r) {
|
|
59
|
-
let i = await e(this.http, "POST", `/posts/{id}/${t(r)}`, { params: { id: n } });
|
|
60
|
-
return
|
|
60
|
+
let i = this.http.captureChanges(), a = await e(this.http, "POST", `/posts/{id}/${t(r)}`, { params: { id: n } });
|
|
61
|
+
return i({
|
|
61
62
|
type: "post.updated",
|
|
62
|
-
post:
|
|
63
|
-
}),
|
|
63
|
+
post: a
|
|
64
|
+
}), a;
|
|
64
65
|
}
|
|
65
66
|
async setCover(t, n) {
|
|
66
|
-
let r = await e(this.http, "PUT", "/posts/{id}/cover", {
|
|
67
|
+
let r = this.http.captureChanges(), i = await e(this.http, "PUT", "/posts/{id}/cover", {
|
|
67
68
|
params: { id: t },
|
|
68
69
|
body: { image: n ?? "" }
|
|
69
70
|
});
|
|
70
|
-
return
|
|
71
|
+
return r({
|
|
71
72
|
type: "post.changed",
|
|
72
73
|
id: t
|
|
73
|
-
}),
|
|
74
|
+
}), i.cover_url;
|
|
74
75
|
}
|
|
75
76
|
async uploadCover(e, t, n) {
|
|
76
77
|
if (!t) return this.setCover(e, null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.js","names":[],"sources":["../../../src/client/content/posts.ts"],"sourcesContent":["import type { InlineImage, Post, PostCover, PostInput } from \"../generated/wire.js\";\nimport type { Http } from \"../http.js\";\nimport type { MediaClient, NamedOptions } from \"../media/client.js\";\nimport { call, type PageQuery } from \"../route.js\";\nimport { reactionVerb, type Reaction, type Sort } from \"./types.js\";\n\nexport interface PostQuery extends PageQuery {\n language?: string;\n sort?: Sort;\n}\n\nexport interface PostAdminQuery extends PageQuery {\n language?: string;\n /** true: only drafts; false: only posts that are not drafts. */\n draft?: boolean;\n /** true: only deleted posts (with deleted_at); otherwise only live ones. */\n deleted?: boolean;\n /** Only posts whose title, excerpt or body contains this text, ignoring case. */\n q?: string;\n}\n\n/** Posts: the published list, staff CRUD, search and restore, reactions, the cover and body images. */\nexport class PostsClient {\n constructor(\n private readonly http: Http,\n private readonly media: MediaClient,\n ) {}\n\n /** Published posts. */\n list(q: PostQuery = {}, signal?: AbortSignal): Promise<Post[]> {\n return call(this.http, \"GET\", \"/posts\", { query: q, signal });\n }\n /** Every post for staff: drafts, scheduled, held and rejected ones included; deleted ones on their own; q searches (PostWrite). */\n adminList(q: PostAdminQuery = {}, signal?: AbortSignal): Promise<Post[]> {\n return call(this.http, \"GET\", \"/posts/admin\", { query: q, signal });\n }\n get(id: string, signal?: AbortSignal): Promise<Post> {\n return call(this.http, \"GET\", \"/posts/{id}\", { params: { id }, signal });\n }\n /** Creates a post (PostWrite); moderation \"held\" when the moderator holds it. */\n async create(input: PostInput): Promise<Post> {\n const post: Post = await call(this.http, \"POST\", \"/posts\", { body: input });\n
|
|
1
|
+
{"version":3,"file":"posts.js","names":[],"sources":["../../../src/client/content/posts.ts"],"sourcesContent":["import type { InlineImage, Post, PostCover, PostInput } from \"../generated/wire.js\";\nimport type { Http } from \"../http.js\";\nimport type { MediaClient, NamedOptions } from \"../media/client.js\";\nimport { call, type PageQuery } from \"../route.js\";\nimport { reactionVerb, type Reaction, type Sort } from \"./types.js\";\n\nexport interface PostQuery extends PageQuery {\n language?: string;\n sort?: Sort;\n}\n\nexport interface PostAdminQuery extends PageQuery {\n language?: string;\n /** true: only drafts; false: only posts that are not drafts. */\n draft?: boolean;\n /** true: only deleted posts (with deleted_at); otherwise only live ones. */\n deleted?: boolean;\n /** Only posts whose title, excerpt or body contains this text, ignoring case. */\n q?: string;\n}\n\n/** Posts: the published list, staff CRUD, search and restore, reactions, the cover and body images. */\nexport class PostsClient {\n constructor(\n private readonly http: Http,\n private readonly media: MediaClient,\n ) {}\n\n /** Published posts. */\n list(q: PostQuery = {}, signal?: AbortSignal): Promise<Post[]> {\n return call(this.http, \"GET\", \"/posts\", { query: q, signal });\n }\n /** Every post for staff: drafts, scheduled, held and rejected ones included; deleted ones on their own; q searches (PostWrite). */\n adminList(q: PostAdminQuery = {}, signal?: AbortSignal): Promise<Post[]> {\n return call(this.http, \"GET\", \"/posts/admin\", { query: q, signal });\n }\n get(id: string, signal?: AbortSignal): Promise<Post> {\n return call(this.http, \"GET\", \"/posts/{id}\", { params: { id }, signal });\n }\n /** Creates a post (PostWrite); moderation \"held\" when the moderator holds it. */\n async create(input: PostInput): Promise<Post> {\n const emit = this.http.captureChanges();\n const post: Post = await call(this.http, \"POST\", \"/posts\", { body: input });\n emit({ type: \"post.created\", post });\n return post;\n }\n /** Updates the given fields (PostWrite). */\n async update(id: string, input: PostInput): Promise<Post> {\n const emit = this.http.captureChanges();\n const post: Post = await call(this.http, \"PATCH\", \"/posts/{id}\", { params: { id }, body: input });\n emit({ type: \"post.updated\", post });\n return post;\n }\n async delete(id: string): Promise<void> {\n const emit = this.http.captureChanges();\n await call(this.http, \"DELETE\", \"/posts/{id}\", { params: { id } });\n emit({ type: \"post.deleted\", id });\n }\n /** Restores a deleted post as it was (PostWrite); conflict when a live post took its slug. */\n async restore(id: string): Promise<Post> {\n const emit = this.http.captureChanges();\n const post: Post = await call(this.http, \"POST\", \"/posts/{id}/restore\", { params: { id } });\n emit({ type: \"post.restored\", post });\n return post;\n }\n /** Sets the caller's reaction to a published post; resolves with the post's new totals. */\n async react(id: string, value: Reaction): Promise<Post> {\n const emit = this.http.captureChanges();\n const post: Post = await call(this.http, \"POST\", `/posts/{id}/${reactionVerb(value)}` as const, { params: { id } });\n emit({ type: \"post.updated\", post });\n return post;\n }\n /** Sets the cover to an inline image name (\"i-{uuid}\") of the post's folder, or clears it; resolves with its URL. */\n async setCover(id: string, image: string | null): Promise<string | null> {\n const emit = this.http.captureChanges();\n const r: PostCover = await call(this.http, \"PUT\", \"/posts/{id}/cover\", { params: { id }, body: { image: image ?? \"\" } });\n emit({ type: \"post.changed\", id });\n return r.cover_url;\n }\n /** Uploads file to the post's folder and makes it the cover (null clears it); resolves with its URL. */\n async uploadCover(id: string, file: Blob | null, o?: NamedOptions): Promise<string | null> {\n if (!file) return this.setCover(id, null);\n const up = await this.media.uploadNamed(this.media.postRef(id), file, o);\n return this.setCover(id, up.name);\n }\n /** The public URL of an inline image of the post's folder, to place in its body. */\n async imageURL(id: string, image: string, signal?: AbortSignal): Promise<string> {\n const r: InlineImage = await call(this.http, \"POST\", \"/posts/{id}/images\", { params: { id }, body: { image }, signal });\n return r.url;\n }\n}\n"],"mappings":";;;AAsBA,IAAa,IAAb,MAAyB;CAEJ;CACA;CAFnB,YACE,GACA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ACT;CAEA,MAAM,MAAM,GAAY,GAAgC;EACtD,IAAM,IAAO,KAAK,KAAK,eAAe,GAChC,IAAa,MAAM,EAAK,KAAK,MAAM,QAAQ,eAAe,EAAa,CAAK,KAAc,EAAE,QAAQ,EAAE,MAAG,EAAE,CAAC;EAElH,OADA,EAAK;GAAE,MAAM;GAAgB;EAAK,CAAC,GAC5B;CACT;CAEA,MAAM,SAAS,GAAY,GAA8C;EACvE,IAAM,IAAO,KAAK,KAAK,eAAe,GAChC,IAAe,MAAM,EAAK,KAAK,MAAM,OAAO,qBAAqB;GAAE,QAAQ,EAAE,MAAG;GAAG,MAAM,EAAE,OAAO,KAAS,GAAG;EAAE,CAAC;EAEvH,OADA,EAAK;GAAE,MAAM;GAAgB;EAAG,CAAC,GAC1B,EAAE;CACX;CAEA,MAAM,YAAY,GAAY,GAAmB,GAA0C;EACzF,IAAI,CAAC,GAAM,OAAO,KAAK,SAAS,GAAI,IAAI;EACxC,IAAM,IAAK,MAAM,KAAK,MAAM,YAAY,KAAK,MAAM,QAAQ,CAAE,GAAG,GAAM,CAAC;EACvE,OAAO,KAAK,SAAS,GAAI,EAAG,IAAI;CAClC;CAEA,MAAM,SAAS,GAAY,GAAe,GAAuC;EAE/E,QAAO,MADsB,EAAK,KAAK,MAAM,QAAQ,sBAAsB;GAAE,QAAQ,EAAE,MAAG;GAAG,MAAM,EAAE,SAAM;GAAG;EAAO,CAAC,EAAA,CAC7G;CACX;AACF"}
|
|
@@ -16,18 +16,18 @@ var n = class {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
async set(n, r) {
|
|
19
|
-
let i = await e(this.http, "POST", `/{kind}/{id}/${t(r)}`, { params: {
|
|
19
|
+
let i = this.http.captureChanges(), a = await e(this.http, "POST", `/{kind}/{id}/${t(r)}`, { params: {
|
|
20
20
|
kind: n.kind,
|
|
21
21
|
id: n.id
|
|
22
22
|
} });
|
|
23
|
-
return
|
|
23
|
+
return i({
|
|
24
24
|
type: "reaction.changed",
|
|
25
25
|
ref: {
|
|
26
26
|
kind: n.kind,
|
|
27
27
|
id: n.id
|
|
28
28
|
},
|
|
29
|
-
counts:
|
|
30
|
-
}),
|
|
29
|
+
counts: a
|
|
30
|
+
}), a;
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactions.js","names":[],"sources":["../../../src/client/content/reactions.ts"],"sourcesContent":["import type { ReactionCounts, RefBody } from \"../generated/wire.js\";\nimport type { Http } from \"../http.js\";\nimport { call } from \"../route.js\";\nimport { reactionVerb, type Reaction } from \"./types.js\";\n\n/** Likes and dislikes of an item (a host kind, or \"post\"). */\nexport class ReactionsClient {\n constructor(private readonly http: Http) {}\n\n /** The item's counts and the caller's own reaction. */\n get(ref: RefBody, signal?: AbortSignal): Promise<ReactionCounts> {\n return call(this.http, \"GET\", \"/{kind}/{id}/reaction\", { params: { kind: ref.kind, id: ref.id }, signal });\n }\n /** Sets the caller's reaction (0 clears it); resolves with the new counts. */\n async set(ref: RefBody, value: Reaction): Promise<ReactionCounts> {\n const counts: ReactionCounts = await call(this.http, \"POST\", `/{kind}/{id}/${reactionVerb(value)}` as const, { params: { kind: ref.kind, id: ref.id } });\n
|
|
1
|
+
{"version":3,"file":"reactions.js","names":[],"sources":["../../../src/client/content/reactions.ts"],"sourcesContent":["import type { ReactionCounts, RefBody } from \"../generated/wire.js\";\nimport type { Http } from \"../http.js\";\nimport { call } from \"../route.js\";\nimport { reactionVerb, type Reaction } from \"./types.js\";\n\n/** Likes and dislikes of an item (a host kind, or \"post\"). */\nexport class ReactionsClient {\n constructor(private readonly http: Http) {}\n\n /** The item's counts and the caller's own reaction. */\n get(ref: RefBody, signal?: AbortSignal): Promise<ReactionCounts> {\n return call(this.http, \"GET\", \"/{kind}/{id}/reaction\", { params: { kind: ref.kind, id: ref.id }, signal });\n }\n /** Sets the caller's reaction (0 clears it); resolves with the new counts. */\n async set(ref: RefBody, value: Reaction): Promise<ReactionCounts> {\n const emit = this.http.captureChanges();\n const counts: ReactionCounts = await call(this.http, \"POST\", `/{kind}/{id}/${reactionVerb(value)}` as const, { params: { kind: ref.kind, id: ref.id } });\n emit({ type: \"reaction.changed\", ref: { kind: ref.kind, id: ref.id }, counts });\n return counts;\n }\n}\n"],"mappings":";;;AAMA,IAAa,IAAb,MAA6B;CACE;CAA7B,YAAY,GAA6B;EAAZ,KAAA,OAAA;CAAa;CAG1C,IAAI,GAAc,GAA+C;EAC/D,OAAO,EAAK,KAAK,MAAM,OAAO,yBAAyB;GAAE,QAAQ;IAAE,MAAM,EAAI;IAAM,IAAI,EAAI;GAAG;GAAG;EAAO,CAAC;CAC3G;CAEA,MAAM,IAAI,GAAc,GAA0C;EAChE,IAAM,IAAO,KAAK,KAAK,eAAe,GAChC,IAAyB,MAAM,EAAK,KAAK,MAAM,QAAQ,gBAAgB,EAAa,CAAK,KAAc,EAAE,QAAQ;GAAE,MAAM,EAAI;GAAM,IAAI,EAAI;EAAG,EAAE,CAAC;EAEvJ,OADA,EAAK;GAAE,MAAM;GAAoB,KAAK;IAAE,MAAM,EAAI;IAAM,IAAI,EAAI;GAAG;GAAG;EAAO,CAAC,GACvE;CACT;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ErrorCode = "animation_not_allowed" | "animation_too_long" | "animation_unsupported" | "checksum_mismatch" | "comment_banned" | "comment_too_long" | "conflict" | "forbidden" | "gone" | "image_too_large" | "image_too_small" | "image_unreadable" | "incomplete" | "internal_error" | "invalid_request" | "moderation_rejected" | "not_configured" | "not_found" | "not_uploaded" | "quota_exceeded" | "rate_limited" | "tenant_mismatch" | "too_large" | "too_many_files" | "type_not_allowed" | "unauthorized" | "unavailable" | "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" | "conflict" | "forbidden" | "gone" | "image_too_large" | "image_too_small" | "image_unreadable" | "incomplete" | "internal_error" | "invalid_request" | "moderation_rejected" | "not_configured" | "not_found" | "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;
|
|
@@ -108,6 +108,10 @@ var e = {
|
|
|
108
108
|
status: 503,
|
|
109
109
|
meaning: "Media storage cannot be reached, or a commit's recovery is pending; retry."
|
|
110
110
|
},
|
|
111
|
+
upgrade_required: {
|
|
112
|
+
status: 503,
|
|
113
|
+
meaning: "The media item was stored before v0.68 and is served once the host's media upgrade (contentkit_media_upgrade) has converted it."
|
|
114
|
+
},
|
|
111
115
|
video_aspect_unsupported: {
|
|
112
116
|
status: 422,
|
|
113
117
|
meaning: "The video's display aspect is outside what its upload path accepts; `details` has `min_aspect` and `max_aspect` (width/height)."
|
|
@@ -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 | \"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 | \"moderation_rejected\"\n | \"not_configured\"\n | \"not_found\"\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 | \"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 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 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_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 route needs a signed-in actor.\" },\n unavailable: { status: 503, meaning: \"Media storage cannot be reached, or a commit's recovery is pending; retry.\" },\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 | \"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 | \"moderation_rejected\"\n | \"not_configured\"\n | \"not_found\"\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 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 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_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 route needs a signed-in actor.\" },\n unavailable: { status: 503, meaning: \"Media storage 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":";AAuCA,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,UAAU;EAAE,QAAQ;EAAK,SAAS;CAAyG;CAC3I,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,QAAQ;EAAK,SAAS;CAA0D;CACpG,YAAY;EAAE,QAAQ;EAAK,SAAS;CAAuC;CAC3E,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAAkD;CAC1F,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAAyE;CAClH,qBAAqB;EAAE,QAAQ;EAAK,SAAS;CAAoD;CACjG,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAAkF;CAC1H,WAAW;EAAE,QAAQ;EAAK,SAAS;CAAsD;CACzF,cAAc;EAAE,QAAQ;EAAK,SAAS;CAAwF;CAC9H,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAA2C;CACnF,cAAc;EAAE,QAAQ;EAAK,SAAS;CAAsF;CAC5H,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAA0E;CACnH,WAAW;EAAE,QAAQ;EAAK,SAAS;CAAwF;CAC3H,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAA4G;CACpJ,kBAAkB;EAAE,QAAQ;EAAK,SAAS;CAAsF;CAChI,cAAc;EAAE,QAAQ;EAAK,SAAS;CAAqC;CAC3E,aAAa;EAAE,QAAQ;EAAK,SAAS;CAA6E;CAClH,kBAAkB;EAAE,QAAQ;EAAK,SAAS;CAAkI;CAC5K,0BAA0B;EAAE,QAAQ;EAAK,SAAS;CAAkI;CACpL,mBAAmB;EAAE,QAAQ;EAAK,SAAS;CAA4G;CACvJ,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAA6D;CACtG,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAA8D;AACxG"}
|
|
@@ -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;CAAE;CACxO;EAAE,QAAQ;EAAO,QAAQ;EAAW,MAAM;EAAgB,MAAM;EAAS,YAAY;EAAa,OAAO;GAAC;GAAY;GAAS;GAAW;GAAK;GAAS;EAAQ;EAAG,SAAS;EAAM,WAAW,EAAE,KAAK,SAAS;EAAG,QAAQ,CAAC;EAAG,WAAW;GAAC;GAAkB;GAAc;EAAS;CAAE;CACnR;EAAE,QAAQ;EAAO,QAAQ;EAAW,MAAM;EAAe,MAAM;EAAU,YAAY;EAAM,OAAO,CAAC;EAAG,SAAS;EAAM,WAAW,EAAE,KAAK,OAAO;EAAG,QAAQ,CAAC,WAAW;EAAG,WAAW,CAAC,kBAAkB,SAAS;CAAE;CACjN;EAA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C;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: \"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\", \"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;EA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,KAAK,gBAAgB;EAAG,QAAQ,CAAC;EAAG,WAAW,CAAC,mBAAmB,YAAY;CAAE;AAChO"}
|
package/dist/client/http.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export interface RequestOptions {
|
|
|
63
63
|
export declare class Http {
|
|
64
64
|
private readonly o;
|
|
65
65
|
private readonly listeners;
|
|
66
|
+
private readScope;
|
|
66
67
|
private readonly base;
|
|
67
68
|
constructor(o: HttpOptions);
|
|
68
69
|
/** The module's base URL, without a trailing slash. */
|
|
@@ -73,7 +74,10 @@ export declare class Http {
|
|
|
73
74
|
* "include", and adds the bearer only on the API's origin (never a media host).
|
|
74
75
|
*/
|
|
75
76
|
readonly xhrSetup: (xhr: XMLHttpRequest, url: string) => Promise<void>;
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
setReadScope(key: string): void;
|
|
78
|
+
/** Capture before awaiting a write; null tells caches to refetch after a scope change. */
|
|
79
|
+
captureChanges(): (change: ContentKitChange) => void;
|
|
80
|
+
subscribe(listener: (change: ContentKitChange, scope: string | null) => void): () => void;
|
|
81
|
+
private emit;
|
|
78
82
|
private onApiOrigin;
|
|
79
83
|
}
|
package/dist/client/http.js
CHANGED
|
@@ -3,6 +3,7 @@ import { ContentKitError as e, aborted as t, readContentKitError as n } from "./
|
|
|
3
3
|
var r = (e) => e.replace(/\/+$/, ""), i = class {
|
|
4
4
|
o;
|
|
5
5
|
listeners = /* @__PURE__ */ new Set();
|
|
6
|
+
readScope = { key: "{}" };
|
|
6
7
|
base;
|
|
7
8
|
constructor(e) {
|
|
8
9
|
if (this.o = e, typeof e.baseUrl != "string") throw Error("contentkit: createContentKitClient needs baseUrl");
|
|
@@ -49,12 +50,19 @@ var r = (e) => e.replace(/\/+$/, ""), i = class {
|
|
|
49
50
|
let n = await this.o.token?.();
|
|
50
51
|
n && e.setRequestHeader("Authorization", `Bearer ${n}`);
|
|
51
52
|
};
|
|
53
|
+
setReadScope(e) {
|
|
54
|
+
e !== this.readScope.key && (this.readScope = { key: e });
|
|
55
|
+
}
|
|
56
|
+
captureChanges() {
|
|
57
|
+
let e = this.readScope;
|
|
58
|
+
return (t) => this.emit(t, e === this.readScope ? e.key : null);
|
|
59
|
+
}
|
|
52
60
|
subscribe(e) {
|
|
53
61
|
return this.listeners.add(e), () => void this.listeners.delete(e);
|
|
54
62
|
}
|
|
55
|
-
emit(e) {
|
|
56
|
-
for (let
|
|
57
|
-
|
|
63
|
+
emit(e, t) {
|
|
64
|
+
for (let n of this.listeners) try {
|
|
65
|
+
n(e, t);
|
|
58
66
|
} catch (e) {
|
|
59
67
|
console.error("contentkit: change listener failed", e);
|
|
60
68
|
}
|
package/dist/client/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","names":[],"sources":["../../src/client/http.ts"],"sourcesContent":["import { ContentKitError, aborted, readContentKitError } from \"./errors.js\";\nimport type { ContentChange } from \"./content/types.js\";\nimport type { FileInfo, RefBody } from \"./generated/wire.js\";\n\n/** A module's base URL, or one per item (a host that splits uploads by kind). */\nexport type Mount = string | ((ref: RefBody) => string);\n\n/**\n * Where each module lives when the host does not serve them all under\n * baseUrl's fixed sub-paths.\n */\nexport interface ContentKitMounts {\n /** Posts, comments, reactions, favorites, polls, bans, moderation. Default baseUrl. */\n content?: string;\n /** Media reads and HLS playlists. Default `{baseUrl}/media`. */\n media?: Mount;\n /** Uploads and commits. Default `{baseUrl}/media/upload`. */\n upload?: Mount;\n /** Content-code lookup. Default `{baseUrl}/codes`. */\n codes?: string;\n /** Taxonomy. Default `{baseUrl}/taxonomy`. */\n taxonomy?: string;\n}\n\nexport type ContentKitModule = keyof ContentKitMounts;\n\n/** A mutation made through the client: the host's cache-invalidation hook gets each one. */\nexport type ContentKitChange =\n /** A commit applied; files are the item's uploads as an editor reads them, without URLs. */\n | { type: \"media.committed\"; ref: RefBody; files: FileInfo[] }\n /** An upload finished processing, as an editor read returns it. */\n | { type: \"media.processed\"; ref: RefBody; file: FileInfo }\n | ContentChange;\n\nexport type TokenSource = () => string | null | undefined | Promise<string | null | undefined>;\n\nexport interface HttpOptions {\n /** Where the host mounts ContentKit, e.g. \"/api/v1/contentkit\". */\n baseUrl: string;\n mounts?: ContentKitMounts;\n /** Transport for API calls; pass an authenticating fetch (auth-ui's authFetch). */\n fetch?: typeof fetch;\n /**\n * Bearer for API calls and for HLS playlists on the API origin (hls.js\n * loads them with XHR, not fetch). An authenticating fetch overrides it.\n */\n token?: TokenSource;\n /** Sent as Accept-Language. */\n language?: () => string | null | undefined;\n /** Extra headers per call (CSRF). */\n headers?: () => HeadersInit | Promise<HeadersInit>;\n /** Default \"same-origin\"; \"include\" also sends cookies with HLS requests. */\n credentials?: RequestCredentials;\n}\n\nexport interface RequestOptions {\n method?: string;\n body?: unknown;\n signal?: AbortSignal;\n /** Read the body as a Blob instead of JSON. */\n blob?: boolean;\n}\n\nconst trim = (u: string) => u.replace(/\\/+$/, \"\");\n\n/** The transport every module shares: mounts, auth, language, errors and change events. */\nexport class Http {\n private readonly listeners = new Set<(change: ContentKitChange) => void>();\n private readonly base: string;\n\n constructor(private readonly o: HttpOptions) {\n if (typeof o.baseUrl !== \"string\") throw new Error(\"contentkit: createContentKitClient needs baseUrl\");\n this.base = trim(o.baseUrl);\n }\n\n /** The module's base URL, without a trailing slash. */\n mount(module: ContentKitModule, ref?: RefBody): string {\n const m = this.o.mounts?.[module];\n if (typeof m === \"function\") {\n if (!ref) throw new Error(`contentkit: the ${module} mount is per item; pass a ref`);\n return trim(m(ref));\n }\n if (m !== undefined) return trim(m);\n switch (module) {\n case \"content\":\n return this.base;\n case \"media\":\n return `${this.base}/media`;\n case \"upload\":\n return `${this.base}/media/upload`;\n default:\n return `${this.base}/${module}`;\n }\n }\n\n async request<T>(url: string, { method, body, signal, blob }: RequestOptions = {}): Promise<T> {\n const f = this.o.fetch ?? fetch;\n const headers = new Headers(await this.o.headers?.());\n if (body !== undefined) headers.set(\"Content-Type\", \"application/json\");\n const token = await this.o.token?.();\n if (token && !headers.has(\"Authorization\")) headers.set(\"Authorization\", `Bearer ${token}`);\n const lang = this.o.language?.();\n if (lang) headers.set(\"Accept-Language\", lang);\n let res: Response;\n try {\n res = await f(url, {\n method: method ?? (body === undefined ? \"GET\" : \"POST\"),\n headers,\n body: body === undefined ? null : JSON.stringify(body),\n credentials: this.o.credentials ?? \"same-origin\",\n signal: signal ?? null,\n });\n } catch (err) {\n if (signal?.aborted) throw aborted(signal);\n throw new ContentKitError(\"network\", `ContentKit API ${new URL(url, \"http://x\").pathname} unreachable`, { cause: err });\n }\n if (!res.ok) throw await readContentKitError(res);\n if (blob) return (await res.blob()) as T;\n return (res.status === 204 ? undefined : await res.json()) as T;\n }\n\n /**\n * hls.js `xhrSetup`: opens the request, sends cookies when credentials is\n * \"include\", and adds the bearer only on the API's origin (never a media host).\n */\n readonly xhrSetup = async (xhr: XMLHttpRequest, url: string): Promise<void> => {\n if (!xhr.readyState) xhr.open(\"GET\", url, true);\n if (this.o.credentials === \"include\") xhr.withCredentials = true;\n if (!this.onApiOrigin(url)) return;\n const token = await this.o.token?.();\n if (token) xhr.setRequestHeader(\"Authorization\", `Bearer ${token}`);\n };\n\n subscribe(listener: (change: ContentKitChange) => void): () => void {\n this.listeners.add(listener);\n return () => void this.listeners.delete(listener);\n }\n\n emit(change: ContentKitChange): void {\n for (const l of this.listeners) {\n try {\n l(change);\n } catch (e) {\n // A host listener's fault must not fail the mutation that succeeded.\n console.error(\"contentkit: change listener failed\", e);\n }\n }\n }\n\n private onApiOrigin(url: string): boolean {\n const here = typeof location === \"undefined\" ? \"http://localhost\" : location.href;\n try {\n return new URL(url, here).origin === new URL(this.base || \"/\", here).origin;\n } catch {\n return false;\n }\n }\n}\n"],"mappings":";;AA+DA,IAAM,KAAQ,MAAc,EAAE,QAAQ,QAAQ,EAAE,GAGnC,IAAb,MAAkB;
|
|
1
|
+
{"version":3,"file":"http.js","names":[],"sources":["../../src/client/http.ts"],"sourcesContent":["import { ContentKitError, aborted, readContentKitError } from \"./errors.js\";\nimport type { ContentChange } from \"./content/types.js\";\nimport type { FileInfo, RefBody } from \"./generated/wire.js\";\n\n/** A module's base URL, or one per item (a host that splits uploads by kind). */\nexport type Mount = string | ((ref: RefBody) => string);\n\n/**\n * Where each module lives when the host does not serve them all under\n * baseUrl's fixed sub-paths.\n */\nexport interface ContentKitMounts {\n /** Posts, comments, reactions, favorites, polls, bans, moderation. Default baseUrl. */\n content?: string;\n /** Media reads and HLS playlists. Default `{baseUrl}/media`. */\n media?: Mount;\n /** Uploads and commits. Default `{baseUrl}/media/upload`. */\n upload?: Mount;\n /** Content-code lookup. Default `{baseUrl}/codes`. */\n codes?: string;\n /** Taxonomy. Default `{baseUrl}/taxonomy`. */\n taxonomy?: string;\n}\n\nexport type ContentKitModule = keyof ContentKitMounts;\n\n/** A mutation made through the client: the host's cache-invalidation hook gets each one. */\nexport type ContentKitChange =\n /** A commit applied; files are the item's uploads as an editor reads them, without URLs. */\n | { type: \"media.committed\"; ref: RefBody; files: FileInfo[] }\n /** An upload finished processing, as an editor read returns it. */\n | { type: \"media.processed\"; ref: RefBody; file: FileInfo }\n | ContentChange;\n\nexport type TokenSource = () => string | null | undefined | Promise<string | null | undefined>;\n\nexport interface HttpOptions {\n /** Where the host mounts ContentKit, e.g. \"/api/v1/contentkit\". */\n baseUrl: string;\n mounts?: ContentKitMounts;\n /** Transport for API calls; pass an authenticating fetch (auth-ui's authFetch). */\n fetch?: typeof fetch;\n /**\n * Bearer for API calls and for HLS playlists on the API origin (hls.js\n * loads them with XHR, not fetch). An authenticating fetch overrides it.\n */\n token?: TokenSource;\n /** Sent as Accept-Language. */\n language?: () => string | null | undefined;\n /** Extra headers per call (CSRF). */\n headers?: () => HeadersInit | Promise<HeadersInit>;\n /** Default \"same-origin\"; \"include\" also sends cookies with HLS requests. */\n credentials?: RequestCredentials;\n}\n\nexport interface RequestOptions {\n method?: string;\n body?: unknown;\n signal?: AbortSignal;\n /** Read the body as a Blob instead of JSON. */\n blob?: boolean;\n}\n\nconst trim = (u: string) => u.replace(/\\/+$/, \"\");\n\n/** The transport every module shares: mounts, auth, language, errors and change events. */\nexport class Http {\n private readonly listeners = new Set<(change: ContentKitChange, scope: string | null) => void>();\n private readScope = { key: \"{}\" };\n private readonly base: string;\n\n constructor(private readonly o: HttpOptions) {\n if (typeof o.baseUrl !== \"string\") throw new Error(\"contentkit: createContentKitClient needs baseUrl\");\n this.base = trim(o.baseUrl);\n }\n\n /** The module's base URL, without a trailing slash. */\n mount(module: ContentKitModule, ref?: RefBody): string {\n const m = this.o.mounts?.[module];\n if (typeof m === \"function\") {\n if (!ref) throw new Error(`contentkit: the ${module} mount is per item; pass a ref`);\n return trim(m(ref));\n }\n if (m !== undefined) return trim(m);\n switch (module) {\n case \"content\":\n return this.base;\n case \"media\":\n return `${this.base}/media`;\n case \"upload\":\n return `${this.base}/media/upload`;\n default:\n return `${this.base}/${module}`;\n }\n }\n\n async request<T>(url: string, { method, body, signal, blob }: RequestOptions = {}): Promise<T> {\n const f = this.o.fetch ?? fetch;\n const headers = new Headers(await this.o.headers?.());\n if (body !== undefined) headers.set(\"Content-Type\", \"application/json\");\n const token = await this.o.token?.();\n if (token && !headers.has(\"Authorization\")) headers.set(\"Authorization\", `Bearer ${token}`);\n const lang = this.o.language?.();\n if (lang) headers.set(\"Accept-Language\", lang);\n let res: Response;\n try {\n res = await f(url, {\n method: method ?? (body === undefined ? \"GET\" : \"POST\"),\n headers,\n body: body === undefined ? null : JSON.stringify(body),\n credentials: this.o.credentials ?? \"same-origin\",\n signal: signal ?? null,\n });\n } catch (err) {\n if (signal?.aborted) throw aborted(signal);\n throw new ContentKitError(\"network\", `ContentKit API ${new URL(url, \"http://x\").pathname} unreachable`, { cause: err });\n }\n if (!res.ok) throw await readContentKitError(res);\n if (blob) return (await res.blob()) as T;\n return (res.status === 204 ? undefined : await res.json()) as T;\n }\n\n /**\n * hls.js `xhrSetup`: opens the request, sends cookies when credentials is\n * \"include\", and adds the bearer only on the API's origin (never a media host).\n */\n readonly xhrSetup = async (xhr: XMLHttpRequest, url: string): Promise<void> => {\n if (!xhr.readyState) xhr.open(\"GET\", url, true);\n if (this.o.credentials === \"include\") xhr.withCredentials = true;\n if (!this.onApiOrigin(url)) return;\n const token = await this.o.token?.();\n if (token) xhr.setRequestHeader(\"Authorization\", `Bearer ${token}`);\n };\n\n setReadScope(key: string): void {\n if (key !== this.readScope.key) this.readScope = { key };\n }\n\n /** Capture before awaiting a write; null tells caches to refetch after a scope change. */\n captureChanges(): (change: ContentKitChange) => void {\n const scope = this.readScope;\n return (change) => this.emit(change, scope === this.readScope ? scope.key : null);\n }\n\n subscribe(listener: (change: ContentKitChange, scope: string | null) => void): () => void {\n this.listeners.add(listener);\n return () => void this.listeners.delete(listener);\n }\n\n private emit(change: ContentKitChange, scope: string | null): void {\n for (const l of this.listeners) {\n try {\n l(change, scope);\n } catch (e) {\n // A host listener's fault must not fail the mutation that succeeded.\n console.error(\"contentkit: change listener failed\", e);\n }\n }\n }\n\n private onApiOrigin(url: string): boolean {\n const here = typeof location === \"undefined\" ? \"http://localhost\" : location.href;\n try {\n return new URL(url, here).origin === new URL(this.base || \"/\", here).origin;\n } catch {\n return false;\n }\n }\n}\n"],"mappings":";;AA+DA,IAAM,KAAQ,MAAc,EAAE,QAAQ,QAAQ,EAAE,GAGnC,IAAb,MAAkB;CAKa;CAJ7B,4BAA6B,IAAI,IAA8D;CAC/F,YAAoB,EAAE,KAAK,KAAK;CAChC;CAEA,YAAY,GAAiC;EAC3C,IAD2B,KAAA,IAAA,GACvB,OAAO,EAAE,WAAY,UAAU,MAAU,MAAM,kDAAkD;EACrG,KAAK,OAAO,EAAK,EAAE,OAAO;CAC5B;CAGA,MAAM,GAA0B,GAAuB;EACrD,IAAM,IAAI,KAAK,EAAE,SAAS;EAC1B,IAAI,OAAO,KAAM,YAAY;GAC3B,IAAI,CAAC,GAAK,MAAU,MAAM,mBAAmB,EAAO,+BAA+B;GACnF,OAAO,EAAK,EAAE,CA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