@openrails/contentkit-ui 0.91.0 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +8 -6
  2. package/dist/client/client.d.ts +2 -2
  3. package/dist/client/client.js +2 -2
  4. package/dist/client/client.js.map +1 -1
  5. package/dist/client/content/comments.js +3 -3
  6. package/dist/client/content/comments.js.map +1 -1
  7. package/dist/client/content/favorites.d.ts +2 -2
  8. package/dist/client/content/favorites.js +2 -2
  9. package/dist/client/content/favorites.js.map +1 -1
  10. package/dist/client/content/reactions.js +2 -2
  11. package/dist/client/content/reactions.js.map +1 -1
  12. package/dist/client/content/types.d.ts +2 -2
  13. package/dist/client/content/types.js.map +1 -1
  14. package/dist/client/contents.d.ts +4 -2
  15. package/dist/client/contents.js +7 -2
  16. package/dist/client/contents.js.map +1 -1
  17. package/dist/client/discovery.d.ts +2 -2
  18. package/dist/client/discovery.js +2 -2
  19. package/dist/client/discovery.js.map +1 -1
  20. package/dist/client/{groups.d.ts → entities.d.ts} +14 -14
  21. package/dist/client/{groups.js → entities.js} +19 -19
  22. package/dist/client/entities.js.map +1 -0
  23. package/dist/client/generated/error-codes.d.ts +1 -1
  24. package/dist/client/generated/error-codes.js +28 -0
  25. package/dist/client/generated/error-codes.js.map +1 -1
  26. package/dist/client/generated/routes.d.ts +158 -106
  27. package/dist/client/generated/routes.js +190 -106
  28. package/dist/client/generated/routes.js.map +1 -1
  29. package/dist/client/generated/wire.d.ts +75 -12
  30. package/dist/client/generated/wire.js.map +1 -1
  31. package/dist/client/http.d.ts +4 -2
  32. package/dist/client/http.js.map +1 -1
  33. package/dist/client/index.d.ts +1 -1
  34. package/dist/client/offers.js +4 -4
  35. package/dist/client/offers.js.map +1 -1
  36. package/dist/client.js +2 -2
  37. package/dist/components/admin/content-admin.js +1 -1
  38. package/dist/components/admin/content-admin.js.map +1 -1
  39. package/dist/components/admin/group-manager.js +2 -2
  40. package/dist/components/admin/group-manager.js.map +1 -1
  41. package/dist/components/content/card.js +3 -3
  42. package/dist/components/content/card.js.map +1 -1
  43. package/dist/components/content/editors.js +2 -2
  44. package/dist/components/content/editors.js.map +1 -1
  45. package/dist/components/content/filters.js +6 -6
  46. package/dist/components/content/filters.js.map +1 -1
  47. package/dist/components/content/search.js +3 -3
  48. package/dist/components/content/search.js.map +1 -1
  49. package/dist/components/groups/banner.d.ts +2 -2
  50. package/dist/components/groups/banner.js.map +1 -1
  51. package/dist/components/groups/editor.js +2 -2
  52. package/dist/components/groups/editor.js.map +1 -1
  53. package/dist/components/groups/header.js +1 -1
  54. package/dist/components/groups/header.js.map +1 -1
  55. package/dist/components/groups/memberships.js +6 -6
  56. package/dist/components/groups/memberships.js.map +1 -1
  57. package/dist/components/groups/parts.js +4 -4
  58. package/dist/components/groups/parts.js.map +1 -1
  59. package/dist/locales/de.js +7 -0
  60. package/dist/locales/de.js.map +1 -1
  61. package/dist/locales/en.d.ts +7 -0
  62. package/dist/locales/en.js +7 -0
  63. package/dist/locales/en.js.map +1 -1
  64. package/dist/locales/es.js +7 -0
  65. package/dist/locales/es.js.map +1 -1
  66. package/dist/locales/ja.js +7 -0
  67. package/dist/locales/ja.js.map +1 -1
  68. package/dist/locales/ko.js +7 -0
  69. package/dist/locales/ko.js.map +1 -1
  70. package/dist/locales/zh.js +7 -0
  71. package/dist/locales/zh.js.map +1 -1
  72. package/dist/react/admin.js +1 -1
  73. package/dist/react/admin.js.map +1 -1
  74. package/dist/react/discovery.d.ts +1 -1
  75. package/dist/react/discovery.js +5 -5
  76. package/dist/react/discovery.js.map +1 -1
  77. package/dist/react/groups.d.ts +5 -5
  78. package/dist/react/groups.js +21 -21
  79. package/dist/react/groups.js.map +1 -1
  80. package/dist/react/resources.js +1 -1
  81. package/dist/react/resources.js.map +1 -1
  82. package/package.json +2 -2
  83. package/dist/client/groups.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { call as e } from "./route.js";
2
- //#region src/client/groups.ts
2
+ //#region src/client/entities.ts
3
3
  var t = class {
4
4
  http;
5
5
  media;
@@ -7,39 +7,39 @@ var t = class {
7
7
  this.http = e, this.media = t;
8
8
  }
9
9
  list(t = {}, n) {
10
- return e(this.http, "GET", "/groups", {
10
+ return e(this.http, "GET", "/entities", {
11
11
  query: t,
12
12
  signal: n
13
13
  });
14
14
  }
15
15
  get(t, n, r) {
16
- return e(this.http, "GET", "/groups/{id}", {
16
+ return e(this.http, "GET", "/entities/{id}", {
17
17
  params: { id: t },
18
18
  query: { language: n },
19
19
  signal: r
20
20
  });
21
21
  }
22
22
  create(t) {
23
- return this.write(e(this.http, "POST", "/groups", { body: t }));
23
+ return this.write(e(this.http, "POST", "/entities", { body: t }));
24
24
  }
25
25
  update(t, n) {
26
- return this.write(e(this.http, "PATCH", "/groups/{id}", {
26
+ return this.write(e(this.http, "PATCH", "/entities/{id}", {
27
27
  params: { id: t },
28
28
  body: n
29
29
  }));
30
30
  }
31
31
  remove(t) {
32
- return this.write(e(this.http, "DELETE", "/groups/{id}", { params: { id: t } }));
32
+ return this.write(e(this.http, "DELETE", "/entities/{id}", { params: { id: t } }));
33
33
  }
34
34
  names(t, n, r) {
35
35
  let i = n === "set" ? "PUT" : n === "add" ? "POST" : "DELETE";
36
- return this.write(e(this.http, i, "/groups/{id}/names", {
36
+ return this.write(e(this.http, i, "/entities/{id}/names", {
37
37
  params: { id: t },
38
38
  body: r
39
39
  }));
40
40
  }
41
41
  edges(t, n, r) {
42
- return this.write(e(this.http, n === "add" ? "POST" : "DELETE", "/groups/{id}/edges", {
42
+ return this.write(e(this.http, n === "add" ? "POST" : "DELETE", "/entities/{id}/edges", {
43
43
  params: { id: t },
44
44
  body: r
45
45
  }));
@@ -58,51 +58,51 @@ var t = class {
58
58
  return this.update(e.id, { [t]: { image: i.name } });
59
59
  }
60
60
  mine(t = {}, n) {
61
- return e(this.http, "GET", "/me/groups", {
61
+ return e(this.http, "GET", "/me/entities", {
62
62
  query: t,
63
63
  signal: n
64
64
  });
65
65
  }
66
66
  merge(t, n) {
67
- return this.write(e(this.http, "POST", "/groups/{id}/merge", {
67
+ return this.write(e(this.http, "POST", "/entities/{id}/merge", {
68
68
  params: { id: t },
69
69
  body: { into: n }
70
70
  }));
71
71
  }
72
72
  members(t, n = {}, r) {
73
- return e(this.http, "GET", "/groups/{id}/members", {
73
+ return e(this.http, "GET", "/entities/{id}/members", {
74
74
  params: { id: t },
75
75
  query: n,
76
76
  signal: r
77
77
  });
78
78
  }
79
79
  addMembers(t, n) {
80
- return this.write(e(this.http, "POST", "/groups/{id}/members", {
80
+ return this.write(e(this.http, "POST", "/entities/{id}/members", {
81
81
  params: { id: t },
82
82
  body: n
83
83
  }));
84
84
  }
85
85
  removeMembers(t, n) {
86
- return this.write(e(this.http, "DELETE", "/groups/{id}/members", {
86
+ return this.write(e(this.http, "DELETE", "/entities/{id}/members", {
87
87
  params: { id: t },
88
88
  body: n
89
89
  }));
90
90
  }
91
91
  reorder(t, n) {
92
- return this.write(e(this.http, "PUT", "/groups/{id}/members/order", {
92
+ return this.write(e(this.http, "PUT", "/entities/{id}/members/order", {
93
93
  params: { id: t },
94
94
  body: { members: n }
95
95
  }));
96
96
  }
97
97
  ofContent(t, n, r) {
98
- return e(this.http, "GET", "/contents/{id}/groups", {
98
+ return e(this.http, "GET", "/contents/{id}/entities", {
99
99
  params: { id: t },
100
100
  query: { language: n },
101
101
  signal: r
102
102
  });
103
103
  }
104
104
  setOfContent(t, n, r) {
105
- return this.write(e(this.http, "PUT", "/contents/{id}/groups", {
105
+ return this.write(e(this.http, "PUT", "/contents/{id}/entities", {
106
106
  params: { id: t },
107
107
  query: { language: r },
108
108
  body: n
@@ -110,10 +110,10 @@ var t = class {
110
110
  }
111
111
  async write(e) {
112
112
  let t = this.http.captureChanges(), n = await e;
113
- return t({ type: "groups.changed" }), n;
113
+ return t({ type: "entities.changed" }), n;
114
114
  }
115
115
  };
116
116
  //#endregion
117
- export { t as GroupsClient };
117
+ export { t as EntitiesClient };
118
118
 
119
- //# sourceMappingURL=groups.js.map
119
+ //# sourceMappingURL=entities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.js","names":[],"sources":["../../src/client/entities.ts"],"sourcesContent":["import type {\n ContentGroups,\n ContentMemberships,\n Edge,\n EdgeInput,\n Group,\n GroupDetail,\n GroupInput,\n GroupPage,\n GroupUpdate,\n MemberPage,\n MemberRef,\n Membership,\n MergeReport,\n MyGroupPage,\n Name,\n RefBody,\n Written,\n} from \"./generated/wire.js\";\nimport type { Http } from \"./http.js\";\nimport type { MediaClient, NamedOptions } from \"./media/client.js\";\nimport { call, type RouteQuery } from \"./route.js\";\n\n/** GET /entities filters, as the route names them. */\nexport type EntityQuery = RouteQuery<\"GET\", \"/entities\">;\n/** GET /me/entities filters. */\nexport type MyEntityQuery = RouteQuery<\"GET\", \"/me/entities\">;\n/** An entity's image slots: every kind's cover, a user-owned kind's avatar. */\nexport type EntityImageSlot = \"cover\" | \"avatar\";\n/** GET /entities/{id}/members paging. */\nexport type MemberQuery = RouteQuery<\"GET\", \"/entities/{id}/members\">;\n\n/** Entities: public listings and pages; writes for staff (root:groups:write). */\nexport class EntitiesClient {\n constructor(\n private readonly http: Http,\n private readonly media: MediaClient,\n ) {}\n\n list(q: EntityQuery = {}, signal?: AbortSignal): Promise<GroupPage> {\n return call(this.http, \"GET\", \"/entities\", { query: q, signal });\n }\n /** A merged group answers with its survivor. */\n get(id: string, language?: string, signal?: AbortSignal): Promise<GroupDetail> {\n return call(this.http, \"GET\", \"/entities/{id}\", { params: { id }, query: { language }, signal });\n }\n create(groups: GroupInput[]): Promise<Group[]> {\n return this.write(call(this.http, \"POST\", \"/entities\", { body: groups }));\n }\n update(id: string, patch: GroupUpdate): Promise<Group> {\n return this.write(call(this.http, \"PATCH\", \"/entities/{id}\", { params: { id }, body: patch }));\n }\n /** Marks the group deleted. */\n remove(id: string): Promise<Group> {\n return this.write(call(this.http, \"DELETE\", \"/entities/{id}\", { params: { id } }));\n }\n /** Replaces, adds or removes names and aliases; resolves with the group's names. */\n names(id: string, op: \"set\" | \"add\" | \"remove\", names: Name[]): Promise<Name[]> {\n const method = op === \"set\" ? \"PUT\" : op === \"add\" ? \"POST\" : \"DELETE\";\n return this.write(call(this.http, method, \"/entities/{id}/names\", { params: { id }, body: names }));\n }\n /** Adds or removes edges from the group; resolves with every edge touching it. */\n edges(id: string, op: \"add\" | \"remove\", edges: EdgeInput[]): Promise<Edge[]> {\n return this.write(call(this.http, op === \"add\" ? \"POST\" : \"DELETE\", \"/entities/{id}/edges\", { params: { id }, body: edges }));\n }\n /** The group's media folder: the media kind named after its group kind. */\n folder(group: { kind: string; id: string }): RefBody {\n return { kind: group.kind, id: group.id };\n }\n /**\n * Uploads an image to the folder's server-named `{slot}/{name}` and\n * selects it as the group's cover or avatar (a user-owned kind's).\n */\n async uploadImage(group: { kind: string; id: string }, slot: EntityImageSlot, file: Blob & { name?: string }, o: Omit<NamedOptions, \"path\"> = {}): Promise<Group> {\n const up = await this.media.uploadNamed(this.folder(group), file, { ...o, path: `${slot}/${file.name || slot}` });\n return this.update(group.id, { [slot]: { image: up.name } });\n }\n /** Entities the signed-in person owns, edits or belongs to. */\n mine(q: MyEntityQuery = {}, signal?: AbortSignal): Promise<MyGroupPage> {\n return call(this.http, \"GET\", \"/me/entities\", { query: q, signal });\n }\n merge(id: string, into: string): Promise<MergeReport> {\n return this.write(call(this.http, \"POST\", \"/entities/{id}/merge\", { params: { id }, body: { into } }));\n }\n /** The group's memberships in member order, a cursor page at a time. */\n members(id: string, q: MemberQuery = {}, signal?: AbortSignal): Promise<MemberPage> {\n return call(this.http, \"GET\", \"/entities/{id}/members\", { params: { id }, query: q, signal });\n }\n addMembers(id: string, members: Membership[]): Promise<Written> {\n return this.write(call(this.http, \"POST\", \"/entities/{id}/members\", { params: { id }, body: members }));\n }\n removeMembers(id: string, members: Membership[]): Promise<Written> {\n return this.write(call(this.http, \"DELETE\", \"/entities/{id}/members\", { params: { id }, body: members }));\n }\n /** Orders an ordered group: the listed members first, in list order. */\n reorder(id: string, members: MemberRef[]): Promise<Written> {\n return this.write(call(this.http, \"PUT\", \"/entities/{id}/members/order\", { params: { id }, body: { members } }));\n }\n /** A content's memberships, its versions' included, with their groups. */\n ofContent(contentId: string, language?: string, signal?: AbortSignal): Promise<ContentMemberships> {\n return call(this.http, \"GET\", \"/contents/{id}/entities\", { params: { id: contentId }, query: { language }, signal });\n }\n /** Replaces a content's memberships in the kinds named (every kind its kind joins by default). */\n setOfContent(contentId: string, set: ContentGroups, language?: string): Promise<ContentMemberships> {\n return this.write(call(this.http, \"PUT\", \"/contents/{id}/entities\", { params: { id: contentId }, query: { language }, body: set }));\n }\n\n private async write<T>(p: Promise<T>): Promise<T> {\n const emit = this.http.captureChanges();\n const out = await p;\n emit({ type: \"entities.changed\" });\n return out;\n }\n}\n"],"mappings":";;AAiCA,IAAa,IAAb,MAA4B;CAEP;CACA;CAFnB,YACE,GACA,GACA;EADiB,AADA,KAAA,OAAA,GACA,KAAA,QAAA;CAChB;CAEH,KAAK,IAAiB,CAAC,GAAG,GAA0C;EAClE,OAAO,EAAK,KAAK,MAAM,OAAO,aAAa;GAAE,OAAO;GAAG;EAAO,CAAC;CACjE;CAEA,IAAI,GAAY,GAAmB,GAA4C;EAC7E,OAAO,EAAK,KAAK,MAAM,OAAO,kBAAkB;GAAE,QAAQ,EAAE,MAAG;GAAG,OAAO,EAAE,YAAS;GAAG;EAAO,CAAC;CACjG;CACA,OAAO,GAAwC;EAC7C,OAAO,KAAK,MAAM,EAAK,KAAK,MAAM,QAAQ,aAAa,EAAE,MAAM,EAAO,CAAC,CAAC;CAC1E;CACA,OAAO,GAAY,GAAoC;EACrD,OAAO,KAAK,MAAM,EAAK,KAAK,MAAM,SAAS,kBAAkB;GAAE,QAAQ,EAAE,MAAG;GAAG,MAAM;EAAM,CAAC,CAAC;CAC/F;CAEA,OAAO,GAA4B;EACjC,OAAO,KAAK,MAAM,EAAK,KAAK,MA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AAO,CAAC;CAC9F;CACA,WAAW,GAAY,GAAyC;EAC9D,OAAO,KAAK,MAAM,EAAK,KAAK,MAAM,QAAQ,0BAA0B;GAAE,QAAQ,EAAE,MAAG;GAAG,MAAM;EAAQ,CAAC,CAAC;CACxG;CACA,cAAc,GAAY,GAAyC;EACjE,OAAO,KAAK,MAAM,EAAK,KAAK,MAAM,UAAU,0BAA0B;GAAE,QAAQ,EAAE,MAAG;GAAG,MAAM;EAAQ,CAAC,CAAC;CAC1G;CAEA,QAAQ,GAAY,GAAwC;EAC1D,OAAO,KAAK,MAAM,EAAK,KAAK,MAAM,OAAO,gCAAgC;GAAE,QAAQ,EAAE,MAAG;GAAG,MAAM,EAAE,WAAQ;EAAE,CAAC,CAAC;CACjH;CAEA,UAAU,GAAmB,GAAmB,GAAmD;EACjG,OAAO,EAAK,KAAK,MAAM,OAAO,2BAA2B;GAAE,QAAQ,EAAE,IAAI,EAAU;GAAG,OAAO,EAAE,YAAS;GAAG;EAAO,CAAC;CACrH;CAEA,aAAa,GAAmB,GAAoB,GAAgD;EAClG,OAAO,KAAK,MAAM,EAAK,KAAK,MAAM,OAAO,2BAA2B;GAAE,QAAQ,EAAE,IAAI,EAAU;GAAG,OAAO,EAAE,YAAS;GAAG,MAAM;EAAI,CAAC,CAAC;CACpI;CAEA,MAAc,MAAS,GAA2B;EAChD,IAAM,IAAO,KAAK,KAAK,eAAe,GAChC,IAAM,MAAM;EAElB,OADA,EAAK,EAAE,MAAM,mBAAmB,CAAC,GAC1B;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" | "comments_closed" | "comments_locked" | "conflict" | "download_unavailable" | "forbidden" | "gone" | "image_too_large" | "image_too_small" | "image_unreadable" | "incomplete" | "internal_error" | "invalid_request" | "limit_reached" | "moderation_rejected" | "no_download" | "not_configured" | "not_found" | "not_joinable" | "not_uploaded" | "quota_exceeded" | "rate_limited" | "tenant_mismatch" | "too_large" | "too_many_files" | "type_not_allowed" | "unauthorized" | "unavailable" | "upgrade_required" | "video_aspect_unsupported" | "video_over_budget" | "video_too_large" | "video_too_long";
1
+ export type ErrorCode = "ambiguous_entity" | "animation_not_allowed" | "animation_too_long" | "animation_unsupported" | "checksum_mismatch" | "comment_banned" | "comment_too_long" | "comments_closed" | "comments_locked" | "conflict" | "content_changed" | "download_unavailable" | "forbidden" | "gone" | "image_too_large" | "image_too_small" | "image_unreadable" | "incomplete" | "internal_error" | "invalid_archive" | "invalid_request" | "limit_reached" | "moderation_rejected" | "no_download" | "not_configured" | "not_found" | "not_joinable" | "not_uploaded" | "operation_busy" | "operation_conflict" | "quota_exceeded" | "rate_limited" | "source_conflict" | "tenant_mismatch" | "too_large" | "too_many_files" | "type_not_allowed" | "unauthorized" | "unavailable" | "unknown_entity" | "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;
@@ -1,5 +1,9 @@
1
1
  //#region src/client/generated/error-codes.ts
2
2
  var e = {
3
+ ambiguous_entity: {
4
+ status: 409,
5
+ meaning: "More than one entity matches the localized name or alias and scope; supply its ID."
6
+ },
3
7
  animation_not_allowed: {
4
8
  status: 422,
5
9
  meaning: "An animated image where the upload path refuses animation."
@@ -36,6 +40,10 @@ var e = {
36
40
  status: 409,
37
41
  meaning: "A concurrent change, a path or slug already taken, or an operation id already used for another commit."
38
42
  },
43
+ content_changed: {
44
+ status: 409,
45
+ meaning: "A publishing operation's content or version was edited after submission."
46
+ },
39
47
  download_unavailable: {
40
48
  status: 403,
41
49
  meaning: "The host's download policy refuses this download now: `reason` is its code, `available_at` when it opens if a matter of time. Nothing was charged."
@@ -68,6 +76,10 @@ var e = {
68
76
  status: 500,
69
77
  meaning: "A server fault; the cause is in the server log."
70
78
  },
79
+ invalid_archive: {
80
+ status: 422,
81
+ meaning: "The publishing archive cannot produce the required supported pages."
82
+ },
71
83
  invalid_request: {
72
84
  status: 400,
73
85
  meaning: "The request is malformed: its body, a query parameter or a path value."
@@ -100,6 +112,14 @@ var e = {
100
112
  status: 409,
101
113
  meaning: "A commit names an upload that has not landed; `blobs` lists the ones to upload again."
102
114
  },
115
+ operation_busy: {
116
+ status: 409,
117
+ meaning: "The publishing operation is preparing an upload or completing another request; retry."
118
+ },
119
+ operation_conflict: {
120
+ status: 409,
121
+ meaning: "A publishing operation ID already names different immutable input."
122
+ },
103
123
  quota_exceeded: {
104
124
  status: 413,
105
125
  meaning: "The uploader's storage quota is used up."
@@ -108,6 +128,10 @@ var e = {
108
128
  status: 429,
109
129
  meaning: "Too many requests; retry after `retry_after` seconds (also the Retry-After header)."
110
130
  },
131
+ source_conflict: {
132
+ status: 409,
133
+ meaning: "The external source already belongs to another publishing operation in this app."
134
+ },
111
135
  tenant_mismatch: {
112
136
  status: 500,
113
137
  meaning: "A host port answered with another tenant's data: a configuration fault."
@@ -132,6 +156,10 @@ var e = {
132
156
  status: 503,
133
157
  meaning: "The host's auth, media storage or signal plane cannot be reached, or a commit's recovery is pending; retry."
134
158
  },
159
+ unknown_entity: {
160
+ status: 400,
161
+ meaning: "A publishing entity reference does not resolve in this app and entity creation is disabled."
162
+ },
135
163
  upgrade_required: {
136
164
  status: 503,
137
165
  meaning: "The media item was stored before v0.68 and is served once the host's media upgrade (contentkit_media_upgrade) has converted it."
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.js","names":[],"sources":["../../../src/client/generated/error-codes.ts"],"sourcesContent":["// Generated by `go generate ./internal/contract` from ContentKit's error-code registry. Do not edit.\n\nexport type ErrorCode =\n | \"animation_not_allowed\"\n | \"animation_too_long\"\n | \"animation_unsupported\"\n | \"checksum_mismatch\"\n | \"comment_banned\"\n | \"comment_too_long\"\n | \"comments_closed\"\n | \"comments_locked\"\n | \"conflict\"\n | \"download_unavailable\"\n | \"forbidden\"\n | \"gone\"\n | \"image_too_large\"\n | \"image_too_small\"\n | \"image_unreadable\"\n | \"incomplete\"\n | \"internal_error\"\n | \"invalid_request\"\n | \"limit_reached\"\n | \"moderation_rejected\"\n | \"no_download\"\n | \"not_configured\"\n | \"not_found\"\n | \"not_joinable\"\n | \"not_uploaded\"\n | \"quota_exceeded\"\n | \"rate_limited\"\n | \"tenant_mismatch\"\n | \"too_large\"\n | \"too_many_files\"\n | \"type_not_allowed\"\n | \"unauthorized\"\n | \"unavailable\"\n | \"upgrade_required\"\n | \"video_aspect_unsupported\"\n | \"video_over_budget\"\n | \"video_too_large\"\n | \"video_too_long\"\n;\n\n// Each code's HTTP status and meaning. A message on the wire is for people;\n// classify by code.\nexport const CONTENTKIT_ERROR_CODES: Readonly<Record<ErrorCode, { status: number; meaning: string }>> = {\n animation_not_allowed: { status: 422, meaning: \"An animated image where the upload path refuses animation.\" },\n animation_too_long: { status: 422, meaning: \"The animation has more frames or seconds than the processor allows.\" },\n animation_unsupported: { status: 415, meaning: \"An AVIF or HEIF image sequence, which is decoded as one frame.\" },\n checksum_mismatch: { status: 422, meaning: \"The stored bytes differ from the declared SHA-256.\" },\n comment_banned: { status: 403, meaning: \"The actor is banned from commenting on this target; `ban` says the scope, the reason and when it ends.\" },\n comment_too_long: { status: 422, meaning: \"The comment is longer than the site allows; `details.max` is the limit in characters.\" },\n comments_closed: { status: 403, meaning: \"The target's comments are closed or hidden: existing ones may show, new ones and edits are refused.\" },\n comments_locked: { status: 403, meaning: \"The actor can't open the content (or the comment's version), so its comments take no writes from them; reads withhold them.\" },\n conflict: { status: 409, meaning: \"A concurrent change, a path or slug already taken, or an operation id already used for another commit.\" },\n download_unavailable: { status: 403, meaning: \"The host's download policy refuses this download now: `reason` is its code, `available_at` when it opens if a matter of time. Nothing was charged.\" },\n forbidden: { status: 403, meaning: \"The actor may not do this.\" },\n gone: { status: 410, meaning: \"The content was removed.\" },\n image_too_large: { status: 413, meaning: \"The image has more pixels or frames than the processor decodes.\" },\n image_too_small: { status: 422, meaning: \"The edited image is narrower than its public preset's minimum width.\" },\n image_unreadable: { status: 422, meaning: \"The file is not a decodable image of its declared type.\" },\n incomplete: { status: 409, meaning: \"A multipart upload is missing parts.\" },\n internal_error: { status: 500, meaning: \"A server fault; the cause is in the server log.\" },\n invalid_request: { status: 400, meaning: \"The request is malformed: its body, a query parameter or a path value.\" },\n limit_reached: { status: 409, meaning: \"The owner already has as many groups of the kind as the site allows (max_per_owner).\" },\n moderation_rejected: { status: 422, meaning: \"The moderator refused the text; `error` says why.\" },\n no_download: { status: 409, meaning: \"The version has no file its kind's download serves: nothing uploaded, or its upload failed or was dropped.\" },\n not_configured: { status: 501, meaning: \"The capability needs a port the host did not configure; retrying does not help.\" },\n not_found: { status: 404, meaning: \"Nothing by that name, or nothing the actor may see.\" },\n not_joinable: { status: 409, meaning: \"The group has no free offer to join: it sells its membership, or nothing.\" },\n not_uploaded: { status: 409, meaning: \"A commit names an upload that has not landed; `blobs` lists the ones to upload again.\" },\n quota_exceeded: { status: 413, meaning: \"The uploader's storage quota is used up.\" },\n rate_limited: { status: 429, meaning: \"Too many requests; retry after `retry_after` seconds (also the Retry-After header).\" },\n tenant_mismatch: { status: 500, meaning: \"A host port answered with another tenant's data: a configuration fault.\" },\n too_large: { status: 413, meaning: \"The file is larger than its upload path allows; `details` has `size` and `max_bytes`.\" },\n too_many_files: { status: 409, meaning: \"The commit would put more files in an upload path, or the item, than allowed; `details.max` is the limit.\" },\n type_not_allowed: { status: 415, meaning: \"The file type is not allowed in the upload path; `details.allowed` lists the types.\" },\n unauthorized: { status: 401, meaning: \"The request needs a valid credential: it has none where the route needs one, or one that is expired, revoked or invalid. WWW-Authenticate says which.\" },\n unavailable: { status: 503, meaning: \"The host's auth, media storage or signal plane cannot be reached, or a commit's recovery is pending; retry.\" },\n upgrade_required: { status: 503, meaning: \"The media item was stored before v0.68 and is served once the host's media upgrade (contentkit_media_upgrade) has converted it.\" },\n video_aspect_unsupported: { status: 422, meaning: \"The video's display aspect is outside what its upload path accepts; `details` has `min_aspect` and `max_aspect` (width/height).\" },\n video_over_budget: { status: 422, meaning: \"The planned encode costs more than its upload path allows, or the source averages under a frame a second.\" },\n video_too_large: { status: 422, meaning: \"The video's frames are larger than its upload path allows.\" },\n video_too_long: { status: 422, meaning: \"The video or audio runs longer than its upload path allows.\" },\n};\n"],"mappings":";AA6CA,IAAa,IAA2F;CACtG,uBAAuB;EAAE,QAAQ;EAAK,SAAS;CAA6D;CAC5G,oBAAoB;EAAE,QAAQ;EAAK,SAAS;CAAsE;CAClH,uBAAuB;EAAE,QAAQ;EAAK,SAAS;CAAiE;CAChH,mBAAmB;EAAE,QAAQ;EAAK,SAAS;CAAqD;CAChG,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAAyG;CACjJ,kBAAkB;EAAE,QAAQ;EAAK,SAAS;CAAwF;CAClI,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAAsG;CAC/I,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAA8H;CACvK,UAAU;EAAE,QAAQ;EAAK,SAAS;CAAyG;CAC3I,sBAAsB;EAAE,QAAQ;EAAK,SAAS;CAAqJ;CACnM,WAAW;EAAE,QAAQ;EAAK,SAAS;CAA6B;CAChE,MAAM;EAAE,QAAQ;EAAK,SAAS;CAA2B;CACzD,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAAkE;CAC3G,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAAuE;CAChH,kBAAkB;EAAE,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,eAAe;EAAE,QAAQ;EAAK,SAAS;CAAuF;CAC9H,qBAAqB;EAAE,QAAQ;EAAK,SAAS;CAAoD;CACjG,aAAa;EAAE,QAAQ;EAAK,SAAS;CAA6G;CAClJ,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAAkF;CAC1H,WAAW;EAAE,QAAQ;EAAK,SAAS;CAAsD;CACzF,cAAc;EAAE,QAAQ;EAAK,SAAS;CAA4E;CAClH,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;CAAwJ;CAC9L,aAAa;EAAE,QAAQ;EAAK,SAAS;CAA8G;CACnJ,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
+ {"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 | \"ambiguous_entity\"\n | \"animation_not_allowed\"\n | \"animation_too_long\"\n | \"animation_unsupported\"\n | \"checksum_mismatch\"\n | \"comment_banned\"\n | \"comment_too_long\"\n | \"comments_closed\"\n | \"comments_locked\"\n | \"conflict\"\n | \"content_changed\"\n | \"download_unavailable\"\n | \"forbidden\"\n | \"gone\"\n | \"image_too_large\"\n | \"image_too_small\"\n | \"image_unreadable\"\n | \"incomplete\"\n | \"internal_error\"\n | \"invalid_archive\"\n | \"invalid_request\"\n | \"limit_reached\"\n | \"moderation_rejected\"\n | \"no_download\"\n | \"not_configured\"\n | \"not_found\"\n | \"not_joinable\"\n | \"not_uploaded\"\n | \"operation_busy\"\n | \"operation_conflict\"\n | \"quota_exceeded\"\n | \"rate_limited\"\n | \"source_conflict\"\n | \"tenant_mismatch\"\n | \"too_large\"\n | \"too_many_files\"\n | \"type_not_allowed\"\n | \"unauthorized\"\n | \"unavailable\"\n | \"unknown_entity\"\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 ambiguous_entity: { status: 409, meaning: \"More than one entity matches the localized name or alias and scope; supply its ID.\" },\n animation_not_allowed: { status: 422, meaning: \"An animated image where the upload path refuses animation.\" },\n animation_too_long: { status: 422, meaning: \"The animation has more frames or seconds than the processor allows.\" },\n animation_unsupported: { status: 415, meaning: \"An AVIF or HEIF image sequence, which is decoded as one frame.\" },\n checksum_mismatch: { status: 422, meaning: \"The stored bytes differ from the declared SHA-256.\" },\n comment_banned: { status: 403, meaning: \"The actor is banned from commenting on this target; `ban` says the scope, the reason and when it ends.\" },\n comment_too_long: { status: 422, meaning: \"The comment is longer than the site allows; `details.max` is the limit in characters.\" },\n comments_closed: { status: 403, meaning: \"The target's comments are closed or hidden: existing ones may show, new ones and edits are refused.\" },\n comments_locked: { status: 403, meaning: \"The actor can't open the content (or the comment's version), so its comments take no writes from them; reads withhold them.\" },\n conflict: { status: 409, meaning: \"A concurrent change, a path or slug already taken, or an operation id already used for another commit.\" },\n content_changed: { status: 409, meaning: \"A publishing operation's content or version was edited after submission.\" },\n download_unavailable: { status: 403, meaning: \"The host's download policy refuses this download now: `reason` is its code, `available_at` when it opens if a matter of time. Nothing was charged.\" },\n forbidden: { status: 403, meaning: \"The actor may not do this.\" },\n gone: { status: 410, meaning: \"The content was removed.\" },\n image_too_large: { status: 413, meaning: \"The image has more pixels or frames than the processor decodes.\" },\n image_too_small: { status: 422, meaning: \"The edited image is narrower than its public preset's minimum width.\" },\n image_unreadable: { status: 422, meaning: \"The file is not a decodable image of its declared type.\" },\n incomplete: { status: 409, meaning: \"A multipart upload is missing parts.\" },\n internal_error: { status: 500, meaning: \"A server fault; the cause is in the server log.\" },\n invalid_archive: { status: 422, meaning: \"The publishing archive cannot produce the required supported pages.\" },\n invalid_request: { status: 400, meaning: \"The request is malformed: its body, a query parameter or a path value.\" },\n limit_reached: { status: 409, meaning: \"The owner already has as many groups of the kind as the site allows (max_per_owner).\" },\n moderation_rejected: { status: 422, meaning: \"The moderator refused the text; `error` says why.\" },\n no_download: { status: 409, meaning: \"The version has no file its kind's download serves: nothing uploaded, or its upload failed or was dropped.\" },\n not_configured: { status: 501, meaning: \"The capability needs a port the host did not configure; retrying does not help.\" },\n not_found: { status: 404, meaning: \"Nothing by that name, or nothing the actor may see.\" },\n not_joinable: { status: 409, meaning: \"The group has no free offer to join: it sells its membership, or nothing.\" },\n not_uploaded: { status: 409, meaning: \"A commit names an upload that has not landed; `blobs` lists the ones to upload again.\" },\n operation_busy: { status: 409, meaning: \"The publishing operation is preparing an upload or completing another request; retry.\" },\n operation_conflict: { status: 409, meaning: \"A publishing operation ID already names different immutable input.\" },\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 source_conflict: { status: 409, meaning: \"The external source already belongs to another publishing operation in this app.\" },\n tenant_mismatch: { status: 500, meaning: \"A host port answered with another tenant's data: a configuration fault.\" },\n too_large: { status: 413, meaning: \"The file is larger than its upload path allows; `details` has `size` and `max_bytes`.\" },\n too_many_files: { status: 409, meaning: \"The commit would put more files in an upload path, or the item, than allowed; `details.max` is the limit.\" },\n type_not_allowed: { status: 415, meaning: \"The file type is not allowed in the upload path; `details.allowed` lists the types.\" },\n unauthorized: { status: 401, meaning: \"The request needs a valid credential: it has none where the route needs one, or one that is expired, revoked or invalid. WWW-Authenticate says which.\" },\n unavailable: { status: 503, meaning: \"The host's auth, media storage or signal plane cannot be reached, or a commit's recovery is pending; retry.\" },\n unknown_entity: { status: 400, meaning: \"A publishing entity reference does not resolve in this app and entity creation is disabled.\" },\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":";AAoDA,IAAa,IAA2F;CACtG,kBAAkB;EAAE,QAAQ;EAAK,SAAS;CAAqF;CAC/H,uBAAuB;EAAE,QAAQ;EAAK,SAAS;CAA6D;CAC5G,oBAAoB;EAAE,QAAQ;EAAK,SAAS;CAAsE;CAClH,uBAAuB;EAAE,QAAQ;EAAK,SAAS;CAAiE;CAChH,mBAAmB;EAAE,QAAQ;EAAK,SAAS;CAAqD;CAChG,gBAAgB;EAAE,QAAQ;EAAK,SAAS;CAAyG;CACjJ,kBAAkB;EAAE,QAAQ;EAAK,SAAS;CAAwF;CAClI,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAAsG;CAC/I,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAA8H;CACvK,UAAU;EAAE,QAAQ;EAAK,SAAS;CAAyG;CAC3I,iBAAiB;EAAE,QAAQ;EAAK,SAAS;CAA2E;CACpH,sBAAsB;EAAE,QAAQ;EAAK,SAAS;CAAqJ;CACnM,WAAW;EAAE,QAAQ;EAAK,SAAS;CAA6B;CAChE,MAAM;EA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