e621 3.4.0 → 3.5.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 (62) hide show
  1. package/README.md +23 -0
  2. package/dist/browser/e621.js +1006 -223
  3. package/dist/browser/e621.js.map +4 -4
  4. package/dist/lib/client.d.ts +61 -0
  5. package/dist/lib/client.js +37 -4
  6. package/dist/lib/errors.d.ts +13 -0
  7. package/dist/lib/errors.js +27 -1
  8. package/dist/lib/generated/schemas.d.ts +218 -9
  9. package/dist/lib/generated/schemas.js +272 -16
  10. package/dist/lib/generated/sdk.d.ts +77 -7
  11. package/dist/lib/generated/sdk.js +134 -9
  12. package/dist/lib/generated/types.d.ts +907 -255
  13. package/dist/lib/index.d.ts +1 -1
  14. package/dist/lib/models/Artist.d.ts +1 -0
  15. package/dist/lib/models/Artist.js +2 -1
  16. package/dist/lib/models/PostFlag.d.ts +2 -1
  17. package/dist/lib/models/PostFlag.js +1 -1
  18. package/dist/lib/models/SavedSearch.d.ts +37 -0
  19. package/dist/lib/models/SavedSearch.js +55 -0
  20. package/dist/lib/models/TagSubscription.d.ts +25 -0
  21. package/dist/lib/models/TagSubscription.js +36 -0
  22. package/dist/lib/models/Takedown.d.ts +13 -2
  23. package/dist/lib/models/Takedown.js +21 -2
  24. package/dist/lib/models/User.d.ts +1 -1
  25. package/dist/lib/models/UserNameChangeRequest.d.ts +1 -1
  26. package/dist/lib/models/index.d.ts +2 -0
  27. package/dist/lib/models/index.js +3 -1
  28. package/dist/lib/models/posts/Actions.d.ts +6 -6
  29. package/dist/lib/modules/Artists.d.ts +2 -0
  30. package/dist/lib/modules/Artists.js +3 -1
  31. package/dist/lib/modules/Base.js +4 -2
  32. package/dist/lib/modules/DText.d.ts +2 -3
  33. package/dist/lib/modules/DText.js +5 -6
  34. package/dist/lib/modules/PostFlags.d.ts +6 -3
  35. package/dist/lib/modules/PostFlags.js +2 -2
  36. package/dist/lib/modules/PostVersions.d.ts +2 -1
  37. package/dist/lib/modules/PostVersions.js +3 -2
  38. package/dist/lib/modules/Posts.d.ts +6 -6
  39. package/dist/lib/modules/Posts.js +8 -14
  40. package/dist/lib/modules/SavedSearches.d.ts +94 -0
  41. package/dist/lib/modules/SavedSearches.js +162 -0
  42. package/dist/lib/modules/SearchTrendBlacklists.js +1 -1
  43. package/dist/lib/modules/StaffUsers.d.ts +1 -1
  44. package/dist/lib/modules/StaffUsers.js +4 -2
  45. package/dist/lib/modules/TagAliases.d.ts +1 -1
  46. package/dist/lib/modules/TagAliases.js +3 -2
  47. package/dist/lib/modules/TagImplications.d.ts +1 -1
  48. package/dist/lib/modules/TagImplications.js +3 -2
  49. package/dist/lib/modules/TagSubscriptions.d.ts +49 -0
  50. package/dist/lib/modules/TagSubscriptions.js +82 -0
  51. package/dist/lib/modules/Takedowns.d.ts +16 -2
  52. package/dist/lib/modules/Takedowns.js +25 -3
  53. package/dist/lib/modules/Uploads.d.ts +29 -2
  54. package/dist/lib/modules/Uploads.js +47 -11
  55. package/dist/lib/modules/UserNameChangeRequests.d.ts +2 -2
  56. package/dist/lib/modules/UserNameChangeRequests.js +5 -3
  57. package/dist/lib/modules/index.d.ts +6 -0
  58. package/dist/lib/modules/index.js +5 -1
  59. package/dist/lib/standalone.d.ts +1 -1
  60. package/dist/lib/version.d.ts +1 -1
  61. package/dist/lib/version.js +1 -1
  62. package/package.json +1 -1
@@ -8,6 +8,70 @@ var __export = (target, all) => {
8
8
  function Debug(_namespace, _formatter, ..._args) {
9
9
  }
10
10
 
11
+ // dist/lib/errors.js
12
+ function parseRetryAfter(response) {
13
+ const header = response?.headers.get("Retry-After");
14
+ if (!header)
15
+ return null;
16
+ const seconds = Number(header);
17
+ if (!Number.isNaN(seconds))
18
+ return Math.max(0, seconds);
19
+ const timestamp = Date.parse(header);
20
+ return Number.isNaN(timestamp) ? null : Math.max(0, Math.round((timestamp - Date.now()) / 1e3));
21
+ }
22
+ var UnexpectedResponseError = class extends Error {
23
+ error;
24
+ name = "UnexpectedResponseError";
25
+ request;
26
+ response;
27
+ constructor(request, response, error) {
28
+ let message = response ? `Unexpected ${response.status} ${response.statusText} on ${request?.method ?? "?"} ${request?.url ?? response.url}` : request ? `Network error on ${request.method} ${request.url}` : "Network error while building the request";
29
+ if (error) {
30
+ if (typeof error === "string")
31
+ message += `
32
+ ${error}`;
33
+ else if (error instanceof Error)
34
+ message += `
35
+ ${error.message}`;
36
+ else if (typeof error === "object" && error !== null) {
37
+ if ("message" in error && typeof error.message === "string")
38
+ message += `
39
+ ${error.message}`;
40
+ else if ("error" in error && typeof error.error === "string")
41
+ message += `
42
+ ${error.error}`;
43
+ else if ("errors" in error && typeof error.errors === "object" && error.errors !== null) {
44
+ for (const [key, value] of Object.entries(error.errors)) {
45
+ if (typeof value === "string")
46
+ message += `
47
+ ${key}: ${value}`;
48
+ else if (Array.isArray(value))
49
+ message += `
50
+ ${key}: ${value.join(", ")}`;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ super(message);
56
+ Object.defineProperties(this, {
57
+ request: { value: request, enumerable: false },
58
+ response: { value: response, enumerable: false },
59
+ error: { value: error, enumerable: false }
60
+ });
61
+ }
62
+ };
63
+ var RatelimitError = class extends UnexpectedResponseError {
64
+ name = "RatelimitError";
65
+ /** Seconds to wait before retrying, parsed from the response's `Retry-After` header - `null` if it was missing or unparsable. */
66
+ retryAfter;
67
+ constructor(request, response, error) {
68
+ super(request, response, error);
69
+ this.retryAfter = parseRetryAfter(response);
70
+ this.message = this.message.replace("Unexpected", "Ratelimited") + (this.retryAfter === null ? "" : `
71
+ Retry after ${this.retryAfter}s`);
72
+ }
73
+ };
74
+
11
75
  // dist/lib/generated/core/serverSentEvents.js
12
76
  function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
13
77
  let lastEventId;
@@ -787,7 +851,7 @@ var createClient = (config = {}) => {
787
851
  };
788
852
 
789
853
  // dist/lib/version.js
790
- var VERSION = "3.4.0";
854
+ var VERSION = "3.5.0";
791
855
 
792
856
  // dist/lib/client.js
793
857
  function createE621Client(options) {
@@ -795,6 +859,13 @@ function createE621Client(options) {
795
859
  authKey: options?.authKey ?? null,
796
860
  authUser: options?.authUser ?? null,
797
861
  baseURL: options?.baseURL ?? "https://e621.net",
862
+ ratelimit: {
863
+ maxRetries: options?.ratelimit?.maxRetries ?? 3,
864
+ maxRetryDelay: options?.ratelimit?.maxRetryDelay ?? 60,
865
+ onRatelimit: options?.ratelimit?.onRatelimit,
866
+ retry: options?.ratelimit?.retry ?? true,
867
+ retryDelay: options?.ratelimit?.retryDelay ?? 1
868
+ },
798
869
  requestTimeout: options?.requestTimeout ?? 30,
799
870
  statusCheckURL: options?.statusCheckURL ?? "https://status.e621.church/json",
800
871
  userAgent: options?.userAgent ?? `E621/${VERSION} (https://github.com/DonovanDMC/E621${options?.authUser ? `; "${options.authUser}"` : ""})`,
@@ -811,7 +882,7 @@ function createE621Client(options) {
811
882
  if (input instanceof Request) {
812
883
  url = input.url;
813
884
  method = input.method.toLowerCase();
814
- if (!input.headers.has("Auithorization") && resolved.authKey && resolved.authUser) {
885
+ if (!input.headers.has("Authorization") && resolved.authKey && resolved.authUser) {
815
886
  input.headers.set("Authorization", `Basic ${btoa(`${resolved.authUser}:${resolved.authKey}`)}`);
816
887
  }
817
888
  } else if (init) {
@@ -832,8 +903,31 @@ function createE621Client(options) {
832
903
  url = requestURL.toString();
833
904
  }
834
905
  Debug(`request:${method}`, `-> ${url}`);
835
- const res = await fetch(input, init);
836
- Debug(`response:${method}`, `<- ${url} ${res.status} ${res.statusText}`);
906
+ let attempt = 0, res;
907
+ for (; ; ) {
908
+ res = await fetch(input instanceof Request ? input.clone() : input, init);
909
+ Debug(`response:${method}`, `<- ${url} ${res.status} ${res.statusText}`);
910
+ if (res.status !== 429)
911
+ break;
912
+ const retryAfter = parseRetryAfter(res);
913
+ const willRetry = resolved.ratelimit.retry && attempt < resolved.ratelimit.maxRetries;
914
+ resolved.ratelimit.onRatelimit?.({
915
+ attempt: attempt + 1,
916
+ maxRetries: resolved.ratelimit.maxRetries,
917
+ request: input instanceof Request ? input : new Request(url, init),
918
+ response: res,
919
+ retryAfter,
920
+ willRetry
921
+ });
922
+ if (!willRetry)
923
+ break;
924
+ const delay = Math.min(retryAfter ?? resolved.ratelimit.retryDelay * 2 ** attempt, resolved.ratelimit.maxRetryDelay);
925
+ Debug(`response:${method}`, `<- ${url} ratelimited, retrying in ${delay}s (attempt ${attempt + 1}/${resolved.ratelimit.maxRetries})`);
926
+ await res.body?.cancel().catch(() => {
927
+ });
928
+ await new Promise((resolve) => setTimeout(resolve, delay * 1e3));
929
+ attempt++;
930
+ }
837
931
  return res;
838
932
  }
839
933
  };
@@ -1058,6 +1152,13 @@ __export(sdk_exports, {
1058
1152
  posts_updateIqdb: () => posts_updateIqdb,
1059
1153
  railsHealth_show: () => railsHealth_show,
1060
1154
  relatedTags_bulk: () => relatedTags_bulk,
1155
+ savedSearches_badge: () => savedSearches_badge,
1156
+ savedSearches_create: () => savedSearches_create,
1157
+ savedSearches_destroy: () => savedSearches_destroy,
1158
+ savedSearches_index: () => savedSearches_index,
1159
+ savedSearches_markAllSeen: () => savedSearches_markAllSeen,
1160
+ savedSearches_show: () => savedSearches_show,
1161
+ savedSearches_update: () => savedSearches_update,
1061
1162
  searchTrendBlacklists_create: () => searchTrendBlacklists_create,
1062
1163
  searchTrendBlacklists_destroy: () => searchTrendBlacklists_destroy,
1063
1164
  searchTrendBlacklists_index: () => searchTrendBlacklists_index,
@@ -1150,6 +1251,9 @@ __export(sdk_exports, {
1150
1251
  tagImplications_show: () => tagImplications_show,
1151
1252
  tagImplications_undo: () => tagImplications_undo,
1152
1253
  tagImplications_update: () => tagImplications_update,
1254
+ tagSubscriptions_create: () => tagSubscriptions_create,
1255
+ tagSubscriptions_destroy: () => tagSubscriptions_destroy,
1256
+ tagSubscriptions_index: () => tagSubscriptions_index,
1153
1257
  tagTypeVersions_index: () => tagTypeVersions_index,
1154
1258
  tags_destroy: () => tags_destroy,
1155
1259
  tags_index: () => tags_index,
@@ -1158,6 +1262,7 @@ __export(sdk_exports, {
1158
1262
  tags_update: () => tags_update,
1159
1263
  takedowns_addByIds: () => takedowns_addByIds,
1160
1264
  takedowns_addByTags: () => takedowns_addByTags,
1265
+ takedowns_clearPosts: () => takedowns_clearPosts,
1161
1266
  takedowns_countMatchingPosts: () => takedowns_countMatchingPosts,
1162
1267
  takedowns_create: () => takedowns_create,
1163
1268
  takedowns_destroy: () => takedowns_destroy,
@@ -1793,11 +1898,7 @@ var dmails_markAllAsRead = (options) => (options?.client ?? client).put({
1793
1898
  });
1794
1899
  var dtextPreviews_create = (options) => (options?.client ?? client).post({
1795
1900
  ...urlSearchParamsBodySerializer,
1796
- security: [{ scheme: "basic", type: "http" }, {
1797
- in: "query",
1798
- name: "authenticity_token",
1799
- type: "apiKey"
1800
- }],
1901
+ security: [{ scheme: "basic", type: "http" }],
1801
1902
  url: "/dtext_preview.json",
1802
1903
  ...options,
1803
1904
  headers: {
@@ -2411,6 +2512,51 @@ var postVotes_delete = (options) => (options.client ?? client).post({
2411
2512
  url: "/post_votes/delete.json",
2412
2513
  ...options
2413
2514
  });
2515
+ var savedSearches_index = (options) => (options?.client ?? client).get({
2516
+ security: [{ scheme: "basic", type: "http" }],
2517
+ url: "/saved_searches.json",
2518
+ ...options
2519
+ });
2520
+ var savedSearches_create = (options) => (options?.client ?? client).post({
2521
+ ...urlSearchParamsBodySerializer,
2522
+ security: [{ scheme: "basic", type: "http" }],
2523
+ url: "/saved_searches.json",
2524
+ ...options,
2525
+ headers: {
2526
+ "Content-Type": "application/x-www-form-urlencoded",
2527
+ ...options?.headers
2528
+ }
2529
+ });
2530
+ var savedSearches_destroy = (options) => (options.client ?? client).delete({
2531
+ security: [{ scheme: "basic", type: "http" }],
2532
+ url: "/saved_searches/{id}.json",
2533
+ ...options
2534
+ });
2535
+ var savedSearches_show = (options) => (options.client ?? client).get({
2536
+ security: [{ scheme: "basic", type: "http" }],
2537
+ url: "/saved_searches/{id}.json",
2538
+ ...options
2539
+ });
2540
+ var savedSearches_update = (options) => (options.client ?? client).patch({
2541
+ ...urlSearchParamsBodySerializer,
2542
+ security: [{ scheme: "basic", type: "http" }],
2543
+ url: "/saved_searches/{id}.json",
2544
+ ...options,
2545
+ headers: {
2546
+ "Content-Type": "application/x-www-form-urlencoded",
2547
+ ...options.headers
2548
+ }
2549
+ });
2550
+ var savedSearches_markAllSeen = (options) => (options?.client ?? client).post({
2551
+ security: [{ scheme: "basic", type: "http" }],
2552
+ url: "/saved_searches/mark_all_seen.json",
2553
+ ...options
2554
+ });
2555
+ var savedSearches_badge = (options) => (options?.client ?? client).get({
2556
+ security: [{ scheme: "basic", type: "http" }],
2557
+ url: "/saved_searches/badge.json",
2558
+ ...options
2559
+ });
2414
2560
  var tags_index = (options) => (options?.client ?? client).get({ url: "/tags.json", ...options });
2415
2561
  var tags_destroy = (options) => (options.client ?? client).delete({
2416
2562
  security: [{ scheme: "basic", type: "http" }],
@@ -2524,6 +2670,26 @@ var tagImplicationRequests_create = (options) => (options?.client ?? client).pos
2524
2670
  ...options?.headers
2525
2671
  }
2526
2672
  });
2673
+ var tagSubscriptions_index = (options) => (options?.client ?? client).get({
2674
+ security: [{ scheme: "basic", type: "http" }],
2675
+ url: "/tag_subscriptions.json",
2676
+ ...options
2677
+ });
2678
+ var tagSubscriptions_create = (options) => (options?.client ?? client).post({
2679
+ ...urlSearchParamsBodySerializer,
2680
+ security: [{ scheme: "basic", type: "http" }],
2681
+ url: "/tag_subscriptions.json",
2682
+ ...options,
2683
+ headers: {
2684
+ "Content-Type": "application/x-www-form-urlencoded",
2685
+ ...options?.headers
2686
+ }
2687
+ });
2688
+ var tagSubscriptions_destroy = (options) => (options.client ?? client).delete({
2689
+ security: [{ scheme: "basic", type: "http" }],
2690
+ url: "/tag_subscriptions/{id}.json",
2691
+ ...options
2692
+ });
2527
2693
  var relatedTags_bulk = (options) => (options?.client ?? client).post({
2528
2694
  ...urlSearchParamsBodySerializer,
2529
2695
  security: [{ scheme: "basic", type: "http" }],
@@ -2733,6 +2899,11 @@ var takedowns_removeByIds = (options) => (options.client ?? client).post({
2733
2899
  ...options.headers
2734
2900
  }
2735
2901
  });
2902
+ var takedowns_clearPosts = (options) => (options.client ?? client).post({
2903
+ security: [{ scheme: "basic", type: "http" }],
2904
+ url: "/takedowns/{id}/clear_posts.json",
2905
+ ...options
2906
+ });
2736
2907
  var tickets_index = (options) => (options?.client ?? client).get({ url: "/tickets.json", ...options });
2737
2908
  var tickets_show = (options) => (options.client ?? client).get({
2738
2909
  security: [{ scheme: "basic", type: "http" }],
@@ -3487,49 +3658,6 @@ Appeal = __decorate([
3487
3658
  ], Appeal);
3488
3659
  var Appeal_default = Appeal;
3489
3660
 
3490
- // dist/lib/errors.js
3491
- var UnexpectedResponseError = class extends Error {
3492
- error;
3493
- name = "UnexpectedResponseError";
3494
- request;
3495
- response;
3496
- constructor(request, response, error) {
3497
- let message = response ? `Unexpected ${response.status} ${response.statusText} on ${request?.method ?? "?"} ${request?.url ?? response.url}` : request ? `Network error on ${request.method} ${request.url}` : "Network error while building the request";
3498
- if (error) {
3499
- if (typeof error === "string")
3500
- message += `
3501
- ${error}`;
3502
- else if (error instanceof Error)
3503
- message += `
3504
- ${error.message}`;
3505
- else if (typeof error === "object" && error !== null) {
3506
- if ("message" in error && typeof error.message === "string")
3507
- message += `
3508
- ${error.message}`;
3509
- else if ("error" in error && typeof error.error === "string")
3510
- message += `
3511
- ${error.error}`;
3512
- else if ("errors" in error && typeof error.errors === "object" && error.errors !== null) {
3513
- for (const [key, value] of Object.entries(error.errors)) {
3514
- if (typeof value === "string")
3515
- message += `
3516
- ${key}: ${value}`;
3517
- else if (Array.isArray(value))
3518
- message += `
3519
- ${key}: ${value.join(", ")}`;
3520
- }
3521
- }
3522
- }
3523
- }
3524
- super(message);
3525
- Object.defineProperties(this, {
3526
- request: { value: request, enumerable: false },
3527
- response: { value: response, enumerable: false },
3528
- error: { value: error, enumerable: false }
3529
- });
3530
- }
3531
- };
3532
-
3533
3661
  // dist/lib/modules/Base.js
3534
3662
  var Base2 = class {
3535
3663
  client;
@@ -3566,6 +3694,8 @@ var Base2 = class {
3566
3694
  }
3567
3695
  } else if (res.response?.status === 404 && !throwOnNotFound)
3568
3696
  return null;
3697
+ else if (res.response?.status === 429)
3698
+ throw new RatelimitError(res.request, res.response, res.error);
3569
3699
  else
3570
3700
  throw new UnexpectedResponseError(res.request, res.response, res.error);
3571
3701
  }
@@ -3728,6 +3858,7 @@ var Artist = class Artist2 extends Base {
3728
3858
  `other_names` & `urls` are silently truncated to 25 entries.
3729
3859
  `notes` is silently truncated to the wiki page limit (250,000).
3730
3860
  Individual `other_names` are silently truncated to 100 characters.
3861
+ Individual `urls` cannot be longer than 512 characters.
3731
3862
  If an artist is on the avoid posting list, you must have the bd staff user flag to edit name, other_names, or group_name.
3732
3863
 
3733
3864
  *
@@ -3772,6 +3903,7 @@ var Artists = class extends Base2 {
3772
3903
  * `other_names` & `urls` are silently truncated to 25 entries.
3773
3904
  `notes` is silently truncated to the wiki page limit (250,000).
3774
3905
  Individual `other_names` are silently truncated to 100 characters.
3906
+ Individual `urls` cannot be longer than 512 characters.
3775
3907
 
3776
3908
  *
3777
3909
  * @requiresApiKeyAuth
@@ -3851,6 +3983,7 @@ var Artists = class extends Base2 {
3851
3983
  `other_names` & `urls` are silently truncated to 25 entries.
3852
3984
  `notes` is silently truncated to the wiki page limit (250,000).
3853
3985
  Individual `other_names` are silently truncated to 100 characters.
3986
+ Individual `urls` cannot be longer than 512 characters.
3854
3987
  If an artist is on the avoid posting list, you must have the bd staff user flag to edit name, other_names, or group_name.
3855
3988
 
3856
3989
  *
@@ -8118,7 +8251,7 @@ var Posts = class extends Base2 {
8118
8251
  client: this.client,
8119
8252
  path: { id },
8120
8253
  body: options
8121
- }).then((res) => this._handleResponse(res, 200, true));
8254
+ }).then((res) => this._handleResponse(res, 201, true));
8122
8255
  }
8123
8256
  /**
8124
8257
  *
@@ -8135,10 +8268,7 @@ var Posts = class extends Base2 {
8135
8268
  client: this.client,
8136
8269
  path: { id },
8137
8270
  body: { reason }
8138
- }).then((res) => {
8139
- const data = this._handleResponse(res, 201, true);
8140
- return new Post_default(this.e621, data.post);
8141
- });
8271
+ }).then((res) => this._handleResponse(res, 201, true));
8142
8272
  }
8143
8273
  /**
8144
8274
  *
@@ -8213,8 +8343,9 @@ var Posts = class extends Base2 {
8213
8343
  return staffPostPosts_moveFavorites({
8214
8344
  client: this.client,
8215
8345
  path: { id },
8216
- body: options
8217
- }).then((res) => this._handleResponse(res, 200, true));
8346
+ body: options,
8347
+ redirect: "manual"
8348
+ }).then((res) => this._handleResponse(res, 302, true));
8218
8349
  }
8219
8350
  /**
8220
8351
  *
@@ -8331,9 +8462,9 @@ var Posts = class extends Base2 {
8331
8462
  return staffPostPosts_reowner({
8332
8463
  client: this.client,
8333
8464
  path: { id },
8334
- body: prefixKeys(options, "reowner"),
8335
- redirect: "manual"
8336
- }).then((res) => this._handleResponse(res, 302, true));
8465
+ body: prefixKeys(options, "reowner")
8466
+ // 204 means the post already belonged to the new owner
8467
+ }).then((res) => res.response?.status === 204 ? null : this._handleResponse(res, 201, true));
8337
8468
  }
8338
8469
  /**
8339
8470
  *
@@ -8405,10 +8536,7 @@ var Posts = class extends Base2 {
8405
8536
  return staffPostPosts_undelete({
8406
8537
  client: this.client,
8407
8538
  path: { id }
8408
- }).then((res) => {
8409
- const data = this._handleResponse(res, 201, true);
8410
- return new Post_default(this.e621, data.post);
8411
- });
8539
+ }).then((res) => this._handleResponse(res, 201, true));
8412
8540
  }
8413
8541
  /**
8414
8542
  *
@@ -8916,6 +9044,86 @@ __decorate([
8916
9044
  __metadata("design:returntype", Promise)
8917
9045
  ], PostSets.prototype, "updatePosts", null);
8918
9046
 
9047
+ // dist/lib/models/PostVersion.js
9048
+ var PostVersion = class PostVersion2 extends Base {
9049
+ /**
9050
+ *
9051
+ * You must be Admin+.
9052
+ *
9053
+ * @requiresApiKeyAuth
9054
+ *
9055
+ * @operationId {@link https://e621.wiki/#operations-Post_Versions-post_versions\#hide post_versions#hide}
9056
+ *
9057
+ * @see {@link https://e621.wiki/#operations-Post_Versions-post_versions\#hide Documentation} for more details.
9058
+ */
9059
+ async hide() {
9060
+ return this.e621.postVersions.hide(this.id);
9061
+ }
9062
+ /**
9063
+ *
9064
+ * @requiresApiKeyAuth
9065
+ *
9066
+ * @operationId {@link https://e621.wiki/#operations-Posts-posts\#revert posts#revert}
9067
+ *
9068
+ * @see {@link https://e621.wiki/#operations-Posts-posts\#revert Documentation} for more details.
9069
+ */
9070
+ async revertTo() {
9071
+ return this.e621.posts.revert(this.post_id, this.id);
9072
+ }
9073
+ /**
9074
+ *
9075
+ * @requiresApiKeyAuth
9076
+ *
9077
+ * @operationId {@link https://e621.wiki/#operations-Post_Versions-post_versions\#undo post_versions#undo}
9078
+ *
9079
+ * @see {@link https://e621.wiki/#operations-Post_Versions-post_versions\#undo Documentation} for more details.
9080
+ */
9081
+ async undo() {
9082
+ return this.e621.postVersions.undo(this.id);
9083
+ }
9084
+ /**
9085
+ *
9086
+ * You must be Admin+.
9087
+ *
9088
+ * @requiresApiKeyAuth
9089
+ *
9090
+ * @operationId {@link https://e621.wiki/#operations-Post_Versions-post_versions\#unhide post_versions#unhide}
9091
+ *
9092
+ * @see {@link https://e621.wiki/#operations-Post_Versions-post_versions\#unhide Documentation} for more details.
9093
+ */
9094
+ async unhide() {
9095
+ return this.e621.postVersions.unhide(this.id);
9096
+ }
9097
+ };
9098
+ __decorate([
9099
+ OperationID("post_versions#hide"),
9100
+ __metadata("design:type", Function),
9101
+ __metadata("design:paramtypes", []),
9102
+ __metadata("design:returntype", Promise)
9103
+ ], PostVersion.prototype, "hide", null);
9104
+ __decorate([
9105
+ OperationID("posts#revert"),
9106
+ __metadata("design:type", Function),
9107
+ __metadata("design:paramtypes", []),
9108
+ __metadata("design:returntype", Promise)
9109
+ ], PostVersion.prototype, "revertTo", null);
9110
+ __decorate([
9111
+ OperationID("post_versions#undo"),
9112
+ __metadata("design:type", Function),
9113
+ __metadata("design:paramtypes", []),
9114
+ __metadata("design:returntype", Promise)
9115
+ ], PostVersion.prototype, "undo", null);
9116
+ __decorate([
9117
+ OperationID("post_versions#unhide"),
9118
+ __metadata("design:type", Function),
9119
+ __metadata("design:paramtypes", []),
9120
+ __metadata("design:returntype", Promise)
9121
+ ], PostVersion.prototype, "unhide", null);
9122
+ PostVersion = __decorate([
9123
+ Schema("PostVersion")
9124
+ ], PostVersion);
9125
+ var PostVersion_default = PostVersion;
9126
+
8919
9127
  // dist/lib/modules/PostVersions.js
8920
9128
  var PostVersions = class extends Base2 {
8921
9129
  static moduleKey = "postVersions";
@@ -8945,7 +9153,7 @@ var PostVersions = class extends Base2 {
8945
9153
  return postVersions_index({
8946
9154
  client: this.client,
8947
9155
  query: prefixKeys(options, "search", ["limit", "page"])
8948
- }).then((res) => this._handleResponse(res, 204, true));
9156
+ }).then((res) => this._handleResponse(res, 200, true, PostVersion_default));
8949
9157
  }
8950
9158
  /**
8951
9159
  *
@@ -9066,7 +9274,7 @@ var SearchTrendBlacklists = class extends Base2 {
9066
9274
  return searchTrendBlacklists_create({
9067
9275
  client: this.client,
9068
9276
  body: prefixKeys(options, "search_trend_blacklist")
9069
- }).then((res) => this._handleResponse(res, 200, true, SearchTrendBlacklist_default));
9277
+ }).then((res) => this._handleResponse(res, 201, true, SearchTrendBlacklist_default));
9070
9278
  }
9071
9279
  /**
9072
9280
  *
@@ -9701,15 +9909,28 @@ var Takedown = class Takedown2 extends Base {
9701
9909
  }
9702
9910
  /**
9703
9911
  *
9704
- * You must have the bd staff user flag.
9912
+ * You must have the bd staff user flag. Removes all posts from the takedown.
9705
9913
  *
9706
9914
  * @requiresApiKeyAuth
9707
9915
  *
9708
- * @operationId {@link https://e621.wiki/#operations-Takedowns-takedowns\#count_matching_posts takedowns#count_matching_posts}
9916
+ * @operationId {@link https://e621.wiki/#operations-Takedowns-takedowns\#clear_posts takedowns#clear_posts}
9709
9917
  *
9710
- * @see {@link https://e621.wiki/#operations-Takedowns-takedowns\#count_matching_posts Documentation} for more details.
9918
+ * @see {@link https://e621.wiki/#operations-Takedowns-takedowns\#clear_posts Documentation} for more details.
9711
9919
  */
9712
- async countMatchingPosts(tags) {
9920
+ async clearPosts() {
9921
+ return this.e621.takedowns.clearPosts(this.id);
9922
+ }
9923
+ /**
9924
+ *
9925
+ * You must have the bd staff user flag. Deleted posts are not counted.
9926
+ *
9927
+ * @requiresApiKeyAuth
9928
+ *
9929
+ * @operationId {@link https://e621.wiki/#operations-Takedowns-takedowns\#count_matching_posts takedowns#count_matching_posts}
9930
+ *
9931
+ * @see {@link https://e621.wiki/#operations-Takedowns-takedowns\#count_matching_posts Documentation} for more details.
9932
+ */
9933
+ async countMatchingPosts(tags) {
9713
9934
  return this.e621.takedowns.countMatchingPosts(this.id, tags);
9714
9935
  }
9715
9936
  /**
@@ -9764,6 +9985,12 @@ __decorate([
9764
9985
  __metadata("design:paramtypes", [Array]),
9765
9986
  __metadata("design:returntype", Promise)
9766
9987
  ], Takedown.prototype, "addByTags", null);
9988
+ __decorate([
9989
+ OperationID("takedowns#clear_posts"),
9990
+ __metadata("design:type", Function),
9991
+ __metadata("design:paramtypes", []),
9992
+ __metadata("design:returntype", Promise)
9993
+ ], Takedown.prototype, "clearPosts", null);
9767
9994
  __decorate([
9768
9995
  OperationID("takedowns#count_matching_posts"),
9769
9996
  __metadata("design:type", Function),
@@ -9832,7 +10059,23 @@ var Takedowns = class extends Base2 {
9832
10059
  }
9833
10060
  /**
9834
10061
  *
9835
- * You must have the bd staff user flag.
10062
+ * You must have the bd staff user flag. Removes all posts from the takedown.
10063
+ *
10064
+ * @requiresApiKeyAuth
10065
+ *
10066
+ * @operationId {@link https://e621.wiki/#operations-Takedowns-takedowns\#clear_posts takedowns#clear_posts}
10067
+ *
10068
+ * @see {@link https://e621.wiki/#operations-Takedowns-takedowns\#clear_posts Documentation} for more details.
10069
+ */
10070
+ async clearPosts(id) {
10071
+ return takedowns_clearPosts({
10072
+ client: this.client,
10073
+ path: { id }
10074
+ }).then((res) => this._handleResponse(res, 200, true));
10075
+ }
10076
+ /**
10077
+ *
10078
+ * You must have the bd staff user flag. Deleted posts are not counted.
9836
10079
  *
9837
10080
  * @requiresApiKeyAuth
9838
10081
  *
@@ -9948,6 +10191,12 @@ __decorate([
9948
10191
  __metadata("design:paramtypes", [Number, Array]),
9949
10192
  __metadata("design:returntype", Promise)
9950
10193
  ], Takedowns.prototype, "addByTags", null);
10194
+ __decorate([
10195
+ OperationID("takedowns#clear_posts"),
10196
+ __metadata("design:type", Function),
10197
+ __metadata("design:paramtypes", [Number]),
10198
+ __metadata("design:returntype", Promise)
10199
+ ], Takedowns.prototype, "clearPosts", null);
9951
10200
  __decorate([
9952
10201
  OperationID("takedowns#count_matching_posts"),
9953
10202
  __metadata("design:type", Function),
@@ -10210,6 +10459,8 @@ var Upload_default = Upload;
10210
10459
  var Uploads = class extends Base2 {
10211
10460
  static moduleKey = "uploads";
10212
10461
  /**
10462
+ *
10463
+ * Uploads are processed asynchronously, if the upload isn't finished right away this waits for it (see {@link Uploads.wait}).
10213
10464
  *
10214
10465
  * @requiresApiKeyAuth
10215
10466
  *
@@ -10217,22 +10468,22 @@ var Uploads = class extends Base2 {
10217
10468
  *
10218
10469
  * @see {@link https://e621.wiki/#operations-Uploads-uploads\#create Documentation} for more details.
10219
10470
  */
10220
- async create(options) {
10471
+ async create(options, waitOptions) {
10221
10472
  return uploads_create({
10222
10473
  client: this.client,
10223
10474
  body: prefixKeys(options, "upload")
10224
- }).then((res) => {
10475
+ }).then(async (res) => {
10225
10476
  const data = this._handleResponse(res, 200, true);
10226
- return this.e621.posts.get(data.post_id).then((post) => {
10227
- if (post === null)
10228
- throw new Error(`Post not found after upload: ${data.post_id}`);
10229
- return post;
10230
- });
10477
+ const postID = data.post_id ?? (await this.wait(data.upload_id, waitOptions)).post_id;
10478
+ const post = await this.e621.posts.get(postID);
10479
+ if (post === null)
10480
+ throw new Error(`Post not found after upload: ${postID}`);
10481
+ return post;
10231
10482
  });
10232
10483
  }
10233
10484
  /**
10234
10485
  *
10235
- * You must be Staff+.
10486
+ * You must be the uploader, or Staff+. Can be polled while an upload is processing.
10236
10487
  *
10237
10488
  * @operationId {@link https://e621.wiki/#operations-Uploads-uploads\#show uploads#show}
10238
10489
  *
@@ -10256,11 +10507,40 @@ var Uploads = class extends Base2 {
10256
10507
  query: prefixKeys(options, "search", ["limit", "page"])
10257
10508
  }).then((res) => this._handleResponse(res, 200, true, Upload_default));
10258
10509
  }
10510
+ /**
10511
+ * Waits for an upload to finish processing. Throws if it fails, turns out to be a duplicate, or doesn't finish within the timeout.
10512
+ */
10513
+ /**
10514
+ *
10515
+ * You must be the uploader, or Staff+. Can be polled while an upload is processing.
10516
+ *
10517
+ * @operationId {@link https://e621.wiki/#operations-Uploads-uploads\#show uploads#show}
10518
+ *
10519
+ * @see {@link https://e621.wiki/#operations-Uploads-uploads\#show Documentation} for more details.
10520
+ */
10521
+ async wait(id, options) {
10522
+ const interval = (options?.interval ?? 2) * 1e3;
10523
+ const deadline = Date.now() + (options?.timeout ?? 300) * 1e3;
10524
+ for (; ; ) {
10525
+ const upload = await this.get(id);
10526
+ if (upload === null)
10527
+ throw new Error(`Upload not found: ${id}`);
10528
+ if (upload.status === "completed" && upload.post_id !== null)
10529
+ return upload;
10530
+ if (upload.status === "failed")
10531
+ throw new Error(`Upload ${id} failed: ${upload.error_message ?? "unknown error"}`);
10532
+ if (upload.status.startsWith("duplicate"))
10533
+ throw new Error(`Upload ${id} is a duplicate of post #${upload.duplicate_post_id}`);
10534
+ if (Date.now() + interval > deadline)
10535
+ throw new Error(`Upload ${id} did not finish processing in time (status: ${upload.status})`);
10536
+ await new Promise((resolve) => setTimeout(resolve, interval));
10537
+ }
10538
+ }
10259
10539
  };
10260
10540
  __decorate([
10261
10541
  OperationID("uploads#create"),
10262
10542
  __metadata("design:type", Function),
10263
- __metadata("design:paramtypes", [Object]),
10543
+ __metadata("design:paramtypes", [Object, Object]),
10264
10544
  __metadata("design:returntype", Promise)
10265
10545
  ], Uploads.prototype, "create", null);
10266
10546
  __decorate([
@@ -10275,6 +10555,12 @@ __decorate([
10275
10555
  __metadata("design:paramtypes", [Object]),
10276
10556
  __metadata("design:returntype", Promise)
10277
10557
  ], Uploads.prototype, "search", null);
10558
+ __decorate([
10559
+ OperationID("uploads#show"),
10560
+ __metadata("design:type", Function),
10561
+ __metadata("design:paramtypes", [Number, Object]),
10562
+ __metadata("design:returntype", Promise)
10563
+ ], Uploads.prototype, "wait", null);
10278
10564
 
10279
10565
  // dist/lib/models/UploadWhitelist.js
10280
10566
  var UploadWhitelist = class UploadWhitelist2 extends Base {
@@ -11317,8 +11603,9 @@ var UserNameChangeRequests = class extends Base2 {
11317
11603
  async create(options) {
11318
11604
  return userNameChangeRequests_create({
11319
11605
  client: this.client,
11320
- body: prefixKeys(options, "user_name_change_request")
11321
- }).then((res) => this._handleResponse(res, 200, true));
11606
+ body: prefixKeys(options, "user_name_change_request"),
11607
+ redirect: "manual"
11608
+ }).then((res) => this._handleResponse(res, 302, true));
11322
11609
  }
11323
11610
  /**
11324
11611
  *
@@ -11333,8 +11620,9 @@ var UserNameChangeRequests = class extends Base2 {
11333
11620
  async delete(id) {
11334
11621
  return userNameChangeRequests_destroy({
11335
11622
  client: this.client,
11336
- path: { id }
11337
- }).then((res) => this._handleResponse(res, 200, true));
11623
+ path: { id },
11624
+ redirect: "manual"
11625
+ }).then((res) => this._handleResponse(res, 302, true));
11338
11626
  }
11339
11627
  /**
11340
11628
  *
@@ -11834,26 +12122,25 @@ var DText = class extends Base2 {
11834
12122
  static moduleKey = "dtext";
11835
12123
  /**
11836
12124
  *
11837
- * Note while this route does not require auth, without auth it requires a CSRF token. For that reason it has been marked as requiring auth.
12125
+ * Limited to 20 requests per minute.
11838
12126
  *
11839
12127
  * @requiresApiKeyAuth
11840
- * @requiresCsrfToken
11841
12128
  *
11842
12129
  * @operationId {@link https://e621.wiki/#operations-DText-dtext_previews\#create dtext_previews#create}
11843
12130
  *
11844
12131
  * @see {@link https://e621.wiki/#operations-DText-dtext_previews\#create Documentation} for more details.
11845
12132
  */
11846
- async preview(body) {
12133
+ async preview(body, allow_color) {
11847
12134
  return dtextPreviews_create({
11848
12135
  client: this.client,
11849
- body: { body }
12136
+ body: { body, allow_color }
11850
12137
  }).then((res) => this._handleResponse(res, 200, true));
11851
12138
  }
11852
12139
  };
11853
12140
  __decorate([
11854
12141
  OperationID("dtext_previews#create"),
11855
12142
  __metadata("design:type", Function),
11856
- __metadata("design:paramtypes", [String]),
12143
+ __metadata("design:paramtypes", [String, Boolean]),
11857
12144
  __metadata("design:returntype", Promise)
11858
12145
  ], DText.prototype, "preview", null);
11859
12146
 
@@ -12191,7 +12478,7 @@ var PostFlags = class extends Base2 {
12191
12478
  return postFlags_destroy({
12192
12479
  client: this.client,
12193
12480
  path: { id: post_id }
12194
- }).then((res) => this._handleResponse(res, 204, true));
12481
+ }).then((res) => this._handleResponse(res, 200, true));
12195
12482
  }
12196
12483
  /**
12197
12484
  *
@@ -12643,8 +12930,9 @@ var TagAliases = class extends Base2 {
12643
12930
  async create(options) {
12644
12931
  return tagAliasRequests_create({
12645
12932
  client: this.client,
12646
- body: prefixKeys(options, "tag_alias_request")
12647
- }).then((res) => this._handleResponse(res, 200, true));
12933
+ body: prefixKeys(options, "tag_alias_request"),
12934
+ redirect: "manual"
12935
+ }).then((res) => this._handleResponse(res, 302, true));
12648
12936
  }
12649
12937
  /**
12650
12938
  *
@@ -12917,8 +13205,9 @@ var TagImplications = class extends Base2 {
12917
13205
  async create(options) {
12918
13206
  return tagImplicationRequests_create({
12919
13207
  client: this.client,
12920
- body: prefixKeys(options, "tag_implication_request")
12921
- }).then((res) => this._handleResponse(res, 200, true));
13208
+ body: prefixKeys(options, "tag_implication_request"),
13209
+ redirect: "manual"
13210
+ }).then((res) => this._handleResponse(res, 302, true));
12922
13211
  }
12923
13212
  /**
12924
13213
  *
@@ -13879,8 +14168,10 @@ var StaffUsers = class extends Base2 {
13879
14168
  return staffUsers_update({
13880
14169
  client: this.client,
13881
14170
  path: { id },
13882
- body: prefixKeys(options, "user")
13883
- }).then((res) => this._handleResponse(res, 204, true));
14171
+ body: prefixKeys(options, "user"),
14172
+ // the spec says 200, but that's only after following the redirect
14173
+ redirect: "manual"
14174
+ }).then((res) => this._handleResponse(res, 302, true));
13884
14175
  }
13885
14176
  /**
13886
14177
  *
@@ -14512,6 +14803,209 @@ __decorate([
14512
14803
  __metadata("design:returntype", Promise)
14513
14804
  ], SearchTrendHourlies.prototype, "search", null);
14514
14805
 
14806
+ // dist/lib/models/SavedSearch.js
14807
+ var SavedSearch = class SavedSearch2 extends Base {
14808
+ /**
14809
+ *
14810
+ * You must be the owner of the saved search.
14811
+ *
14812
+ * @requiresApiKeyAuth
14813
+ *
14814
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#destroy saved_searches#destroy}
14815
+ *
14816
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#destroy Documentation} for more details.
14817
+ */
14818
+ async delete() {
14819
+ return this.e621.savedSearches.delete(this.id);
14820
+ }
14821
+ /**
14822
+ *
14823
+ * You must be the owner of the saved search. The subscription search cannot be updated.
14824
+ *
14825
+ * @requiresApiKeyAuth
14826
+ *
14827
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#update saved_searches#update}
14828
+ *
14829
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#update Documentation} for more details.
14830
+ */
14831
+ async update(options) {
14832
+ return this.e621.savedSearches.update(this.id, options);
14833
+ }
14834
+ };
14835
+ __decorate([
14836
+ OperationID("saved_searches#destroy"),
14837
+ __metadata("design:type", Function),
14838
+ __metadata("design:paramtypes", []),
14839
+ __metadata("design:returntype", Promise)
14840
+ ], SavedSearch.prototype, "delete", null);
14841
+ __decorate([
14842
+ OperationID("saved_searches#update"),
14843
+ __metadata("design:type", Function),
14844
+ __metadata("design:paramtypes", [Object]),
14845
+ __metadata("design:returntype", Promise)
14846
+ ], SavedSearch.prototype, "update", null);
14847
+ SavedSearch = __decorate([
14848
+ Schema("SavedSearch")
14849
+ ], SavedSearch);
14850
+ var SavedSearch_default = SavedSearch;
14851
+
14852
+ // dist/lib/modules/SavedSearches.js
14853
+ var SavedSearches = class extends Base2 {
14854
+ static moduleKey = "savedSearches";
14855
+ /**
14856
+ *
14857
+ * Total new post count across the current user's tracked saved searches. Read from cache only.
14858
+ *
14859
+ * @requiresApiKeyAuth
14860
+ *
14861
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#badge saved_searches#badge}
14862
+ *
14863
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#badge Documentation} for more details.
14864
+ */
14865
+ async badge() {
14866
+ return savedSearches_badge({
14867
+ client: this.client
14868
+ }).then((res) => this._handleResponse(res, 200, true));
14869
+ }
14870
+ /**
14871
+ *
14872
+ * Users can have up to 250 saved searches, and track up to 50 of them.
14873
+ Saved search queries cannot contain wildcard tags or `search:` metatags.
14874
+
14875
+ *
14876
+ * @requiresApiKeyAuth
14877
+ *
14878
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#create saved_searches#create}
14879
+ *
14880
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#create Documentation} for more details.
14881
+ */
14882
+ async create(options) {
14883
+ return savedSearches_create({
14884
+ client: this.client,
14885
+ body: prefixKeys(options, "saved_search")
14886
+ }).then((res) => this._handleResponse(res, 200, true, SavedSearch_default));
14887
+ }
14888
+ /**
14889
+ *
14890
+ * You must be the owner of the saved search.
14891
+ *
14892
+ * @requiresApiKeyAuth
14893
+ *
14894
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#destroy saved_searches#destroy}
14895
+ *
14896
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#destroy Documentation} for more details.
14897
+ */
14898
+ async delete(id) {
14899
+ return savedSearches_destroy({
14900
+ client: this.client,
14901
+ path: { id }
14902
+ }).then((res) => this._handleResponse(res, 204, true));
14903
+ }
14904
+ /**
14905
+ *
14906
+ * You must be the owner of the saved search. `new_count` is read from cache and may be stale.
14907
+ *
14908
+ * @requiresApiKeyAuth
14909
+ *
14910
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#show saved_searches#show}
14911
+ *
14912
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#show Documentation} for more details.
14913
+ */
14914
+ async get(id) {
14915
+ return savedSearches_show({
14916
+ client: this.client,
14917
+ path: { id }
14918
+ }).then((res) => this._handleResponse(res, 200, false, SavedSearch_default));
14919
+ }
14920
+ /**
14921
+ *
14922
+ * Lists the current user's saved searches. New post counts are refreshed when this is called.
14923
+ *
14924
+ * @requiresApiKeyAuth
14925
+ *
14926
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#index saved_searches#index}
14927
+ *
14928
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#index Documentation} for more details.
14929
+ */
14930
+ async list() {
14931
+ return savedSearches_index({
14932
+ client: this.client
14933
+ }).then((res) => this._handleResponse(res, 200, true, SavedSearch_default));
14934
+ }
14935
+ /**
14936
+ *
14937
+ * @requiresApiKeyAuth
14938
+ *
14939
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#mark_all_seen saved_searches#mark_all_seen}
14940
+ *
14941
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#mark_all_seen Documentation} for more details.
14942
+ */
14943
+ async markAllSeen() {
14944
+ return savedSearches_markAllSeen({
14945
+ client: this.client
14946
+ }).then((res) => this._handleResponse(res, 204, true));
14947
+ }
14948
+ /**
14949
+ *
14950
+ * You must be the owner of the saved search. The subscription search cannot be updated.
14951
+ *
14952
+ * @requiresApiKeyAuth
14953
+ *
14954
+ * @operationId {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#update saved_searches#update}
14955
+ *
14956
+ * @see {@link https://e621.wiki/#operations-Saved_Searches-saved_searches\#update Documentation} for more details.
14957
+ */
14958
+ async update(id, options) {
14959
+ return savedSearches_update({
14960
+ client: this.client,
14961
+ path: { id },
14962
+ body: prefixKeys(options, "saved_search")
14963
+ }).then((res) => this._handleResponse(res, 200, true, SavedSearch_default));
14964
+ }
14965
+ };
14966
+ __decorate([
14967
+ OperationID("saved_searches#badge"),
14968
+ __metadata("design:type", Function),
14969
+ __metadata("design:paramtypes", []),
14970
+ __metadata("design:returntype", Promise)
14971
+ ], SavedSearches.prototype, "badge", null);
14972
+ __decorate([
14973
+ OperationID("saved_searches#create"),
14974
+ __metadata("design:type", Function),
14975
+ __metadata("design:paramtypes", [Object]),
14976
+ __metadata("design:returntype", Promise)
14977
+ ], SavedSearches.prototype, "create", null);
14978
+ __decorate([
14979
+ OperationID("saved_searches#destroy"),
14980
+ __metadata("design:type", Function),
14981
+ __metadata("design:paramtypes", [Number]),
14982
+ __metadata("design:returntype", Promise)
14983
+ ], SavedSearches.prototype, "delete", null);
14984
+ __decorate([
14985
+ OperationID("saved_searches#show"),
14986
+ __metadata("design:type", Function),
14987
+ __metadata("design:paramtypes", [Number]),
14988
+ __metadata("design:returntype", Promise)
14989
+ ], SavedSearches.prototype, "get", null);
14990
+ __decorate([
14991
+ OperationID("saved_searches#index"),
14992
+ __metadata("design:type", Function),
14993
+ __metadata("design:paramtypes", []),
14994
+ __metadata("design:returntype", Promise)
14995
+ ], SavedSearches.prototype, "list", null);
14996
+ __decorate([
14997
+ OperationID("saved_searches#mark_all_seen"),
14998
+ __metadata("design:type", Function),
14999
+ __metadata("design:paramtypes", []),
15000
+ __metadata("design:returntype", Promise)
15001
+ ], SavedSearches.prototype, "markAllSeen", null);
15002
+ __decorate([
15003
+ OperationID("saved_searches#update"),
15004
+ __metadata("design:type", Function),
15005
+ __metadata("design:paramtypes", [Number, Object]),
15006
+ __metadata("design:returntype", Promise)
15007
+ ], SavedSearches.prototype, "update", null);
15008
+
14515
15009
  // dist/lib/modules/Sessions.js
14516
15010
  var Sessions = class extends Base2 {
14517
15011
  static moduleKey = "sessions";
@@ -14577,6 +15071,110 @@ __decorate([
14577
15071
  __metadata("design:returntype", Promise)
14578
15072
  ], Sessions.prototype, "verifyTotp", null);
14579
15073
 
15074
+ // dist/lib/models/TagSubscription.js
15075
+ var TagSubscription = class TagSubscription2 extends Base {
15076
+ /**
15077
+ *
15078
+ * You must be the owner of the tag subscription.
15079
+ *
15080
+ * @requiresApiKeyAuth
15081
+ *
15082
+ * @operationId {@link https://e621.wiki/#operations-Tag_Subscriptions-tag_subscriptions\#destroy tag_subscriptions#destroy}
15083
+ *
15084
+ * @see {@link https://e621.wiki/#operations-Tag_Subscriptions-tag_subscriptions\#destroy Documentation} for more details.
15085
+ */
15086
+ async delete() {
15087
+ return this.e621.tagSubscriptions.delete(this.id);
15088
+ }
15089
+ };
15090
+ __decorate([
15091
+ OperationID("tag_subscriptions#destroy"),
15092
+ __metadata("design:type", Function),
15093
+ __metadata("design:paramtypes", []),
15094
+ __metadata("design:returntype", Promise)
15095
+ ], TagSubscription.prototype, "delete", null);
15096
+ TagSubscription = __decorate([
15097
+ Schema("TagSubscription")
15098
+ ], TagSubscription);
15099
+ var TagSubscription_default = TagSubscription;
15100
+
15101
+ // dist/lib/modules/TagSubscriptions.js
15102
+ var TagSubscriptions = class extends Base2 {
15103
+ static moduleKey = "tagSubscriptions";
15104
+ /**
15105
+ *
15106
+ * Subscribes to one or more tags, following aliases. Users can subscribe to up to 500 tags.
15107
+ Subscribed tags can be searched with the `search:subscriptions` metatag.
15108
+
15109
+ *
15110
+ * Subscribe to one or more tags. Tags that couldn't be subscribed to are listed in `skipped`.
15111
+ *
15112
+ * @requiresApiKeyAuth
15113
+ *
15114
+ * @operationId {@link https://e621.wiki/#operations-Tag_Subscriptions-tag_subscriptions\#create tag_subscriptions#create}
15115
+ *
15116
+ * @see {@link https://e621.wiki/#operations-Tag_Subscriptions-tag_subscriptions\#create Documentation} for more details.
15117
+ */
15118
+ async create(tags) {
15119
+ return tagSubscriptions_create({
15120
+ client: this.client,
15121
+ body: { tag_names: Array.isArray(tags) ? tags.join(" ") : tags }
15122
+ }).then((res) => {
15123
+ const data = this._handleResponse(res, 200, true);
15124
+ return { ...data, added: data.added.map((sub) => new TagSubscription_default(this.e621, sub)) };
15125
+ });
15126
+ }
15127
+ /**
15128
+ *
15129
+ * You must be the owner of the tag subscription.
15130
+ *
15131
+ * @requiresApiKeyAuth
15132
+ *
15133
+ * @operationId {@link https://e621.wiki/#operations-Tag_Subscriptions-tag_subscriptions\#destroy tag_subscriptions#destroy}
15134
+ *
15135
+ * @see {@link https://e621.wiki/#operations-Tag_Subscriptions-tag_subscriptions\#destroy Documentation} for more details.
15136
+ */
15137
+ async delete(id) {
15138
+ return tagSubscriptions_destroy({
15139
+ client: this.client,
15140
+ path: { id }
15141
+ }).then((res) => this._handleResponse(res, 204, true));
15142
+ }
15143
+ /**
15144
+ *
15145
+ * Lists the current user's tag subscriptions, ordered by tag name.
15146
+ *
15147
+ * @requiresApiKeyAuth
15148
+ *
15149
+ * @operationId {@link https://e621.wiki/#operations-Tag_Subscriptions-tag_subscriptions\#index tag_subscriptions#index}
15150
+ *
15151
+ * @see {@link https://e621.wiki/#operations-Tag_Subscriptions-tag_subscriptions\#index Documentation} for more details.
15152
+ */
15153
+ async list() {
15154
+ return tagSubscriptions_index({
15155
+ client: this.client
15156
+ }).then((res) => this._handleResponse(res, 200, true, TagSubscription_default));
15157
+ }
15158
+ };
15159
+ __decorate([
15160
+ OperationID("tag_subscriptions#create"),
15161
+ __metadata("design:type", Function),
15162
+ __metadata("design:paramtypes", [Object]),
15163
+ __metadata("design:returntype", Promise)
15164
+ ], TagSubscriptions.prototype, "create", null);
15165
+ __decorate([
15166
+ OperationID("tag_subscriptions#destroy"),
15167
+ __metadata("design:type", Function),
15168
+ __metadata("design:paramtypes", [Number]),
15169
+ __metadata("design:returntype", Promise)
15170
+ ], TagSubscriptions.prototype, "delete", null);
15171
+ __decorate([
15172
+ OperationID("tag_subscriptions#index"),
15173
+ __metadata("design:type", Function),
15174
+ __metadata("design:paramtypes", []),
15175
+ __metadata("design:returntype", Promise)
15176
+ ], TagSubscriptions.prototype, "list", null);
15177
+
14580
15178
  // dist/lib/modules/StaffIpAddrs.js
14581
15179
  var StaffIpAddrs = class extends Base2 {
14582
15180
  static moduleKey = "staffIpAddrs";
@@ -14884,6 +15482,7 @@ function apply(e621, client2, defaultPostFormat = {}) {
14884
15482
  posts: new Posts(e621, client2, defaultPostFormat),
14885
15483
  railsHealth: new RailsHealth(baseE621, client2),
14886
15484
  relatedTags: new RelatedTags(baseE621, client2),
15485
+ savedSearches: new SavedSearches(baseE621, client2),
14887
15486
  searchTrendBlacklists: new SearchTrendBlacklists(baseE621, client2),
14888
15487
  searchTrendHourlies: new SearchTrendHourlies(baseE621, client2),
14889
15488
  searchTrends: new SearchTrends(baseE621, client2),
@@ -14901,116 +15500,37 @@ function apply(e621, client2, defaultPostFormat = {}) {
14901
15500
  staffUsers: new StaffUsers(baseE621, client2),
14902
15501
  staffVoteTrends: new StaffVoteTrends(baseE621, client2),
14903
15502
  staffWikiRefs: new StaffWikiRefs(baseE621, client2),
14904
- staffWikis: new StaffWikis(baseE621, client2),
14905
- staffWikiVersions: new StaffWikiVersions(baseE621, client2),
14906
- stats: new Stats(baseE621, client2),
14907
- tagAliases: new TagAliases(baseE621, client2),
14908
- tagCorrections: new TagCorrections(baseE621, client2),
14909
- tagImplications: new TagImplications(baseE621, client2),
14910
- tagTypeVersions: new TagTypeVersions(baseE621, client2),
14911
- tags: new Tags(baseE621, client2),
14912
- takedowns: new Takedowns(baseE621, client2),
14913
- tickets: new Tickets(baseE621, client2),
14914
- uploadKarmaEvents: new UploadKarmaEvents(baseE621, client2),
14915
- uploads: new Uploads(e621, client2),
14916
- uploadWhitelists: new UploadWhitelists(baseE621, client2),
14917
- users: new Users(baseE621, client2),
14918
- userFeedbacks: new UserFeedbacks(baseE621, client2),
14919
- userNameChangeRequests: new UserNameChangeRequests(baseE621, client2),
14920
- userReverts: new UserReverts(baseE621, client2),
14921
- wikiPages: new WikiPages(baseE621, client2),
14922
- wikiPageVersions: new WikiPageVersions(baseE621, client2)
14923
- };
14924
- Object.assign(e621, modules);
14925
- }
14926
-
14927
- // dist/lib/models/APIKey.js
14928
- var APIKey = class APIKey2 extends Base {
14929
- };
14930
- APIKey = __decorate([
14931
- Schema("APIKey")
14932
- ], APIKey);
14933
- var APIKey_default = APIKey;
14934
-
14935
- // dist/lib/models/PostVersion.js
14936
- var PostVersion = class PostVersion2 extends Base {
14937
- /**
14938
- *
14939
- * You must be Admin+.
14940
- *
14941
- * @requiresApiKeyAuth
14942
- *
14943
- * @operationId {@link https://e621.wiki/#operations-Post_Versions-post_versions\#hide post_versions#hide}
14944
- *
14945
- * @see {@link https://e621.wiki/#operations-Post_Versions-post_versions\#hide Documentation} for more details.
14946
- */
14947
- async hide() {
14948
- return this.e621.postVersions.hide(this.id);
14949
- }
14950
- /**
14951
- *
14952
- * @requiresApiKeyAuth
14953
- *
14954
- * @operationId {@link https://e621.wiki/#operations-Posts-posts\#revert posts#revert}
14955
- *
14956
- * @see {@link https://e621.wiki/#operations-Posts-posts\#revert Documentation} for more details.
14957
- */
14958
- async revertTo() {
14959
- return this.e621.posts.revert(this.post_id, this.id);
14960
- }
14961
- /**
14962
- *
14963
- * @requiresApiKeyAuth
14964
- *
14965
- * @operationId {@link https://e621.wiki/#operations-Post_Versions-post_versions\#undo post_versions#undo}
14966
- *
14967
- * @see {@link https://e621.wiki/#operations-Post_Versions-post_versions\#undo Documentation} for more details.
14968
- */
14969
- async undo() {
14970
- return this.e621.postVersions.undo(this.id);
14971
- }
14972
- /**
14973
- *
14974
- * You must be Admin+.
14975
- *
14976
- * @requiresApiKeyAuth
14977
- *
14978
- * @operationId {@link https://e621.wiki/#operations-Post_Versions-post_versions\#unhide post_versions#unhide}
14979
- *
14980
- * @see {@link https://e621.wiki/#operations-Post_Versions-post_versions\#unhide Documentation} for more details.
14981
- */
14982
- async unhide() {
14983
- return this.e621.postVersions.unhide(this.id);
14984
- }
15503
+ staffWikis: new StaffWikis(baseE621, client2),
15504
+ staffWikiVersions: new StaffWikiVersions(baseE621, client2),
15505
+ stats: new Stats(baseE621, client2),
15506
+ tagAliases: new TagAliases(baseE621, client2),
15507
+ tagCorrections: new TagCorrections(baseE621, client2),
15508
+ tagImplications: new TagImplications(baseE621, client2),
15509
+ tagTypeVersions: new TagTypeVersions(baseE621, client2),
15510
+ tags: new Tags(baseE621, client2),
15511
+ tagSubscriptions: new TagSubscriptions(baseE621, client2),
15512
+ takedowns: new Takedowns(baseE621, client2),
15513
+ tickets: new Tickets(baseE621, client2),
15514
+ uploadKarmaEvents: new UploadKarmaEvents(baseE621, client2),
15515
+ uploads: new Uploads(e621, client2),
15516
+ uploadWhitelists: new UploadWhitelists(baseE621, client2),
15517
+ users: new Users(baseE621, client2),
15518
+ userFeedbacks: new UserFeedbacks(baseE621, client2),
15519
+ userNameChangeRequests: new UserNameChangeRequests(baseE621, client2),
15520
+ userReverts: new UserReverts(baseE621, client2),
15521
+ wikiPages: new WikiPages(baseE621, client2),
15522
+ wikiPageVersions: new WikiPageVersions(baseE621, client2)
15523
+ };
15524
+ Object.assign(e621, modules);
15525
+ }
15526
+
15527
+ // dist/lib/models/APIKey.js
15528
+ var APIKey = class APIKey2 extends Base {
14985
15529
  };
14986
- __decorate([
14987
- OperationID("post_versions#hide"),
14988
- __metadata("design:type", Function),
14989
- __metadata("design:paramtypes", []),
14990
- __metadata("design:returntype", Promise)
14991
- ], PostVersion.prototype, "hide", null);
14992
- __decorate([
14993
- OperationID("posts#revert"),
14994
- __metadata("design:type", Function),
14995
- __metadata("design:paramtypes", []),
14996
- __metadata("design:returntype", Promise)
14997
- ], PostVersion.prototype, "revertTo", null);
14998
- __decorate([
14999
- OperationID("post_versions#undo"),
15000
- __metadata("design:type", Function),
15001
- __metadata("design:paramtypes", []),
15002
- __metadata("design:returntype", Promise)
15003
- ], PostVersion.prototype, "undo", null);
15004
- __decorate([
15005
- OperationID("post_versions#unhide"),
15006
- __metadata("design:type", Function),
15007
- __metadata("design:paramtypes", []),
15008
- __metadata("design:returntype", Promise)
15009
- ], PostVersion.prototype, "unhide", null);
15010
- PostVersion = __decorate([
15011
- Schema("PostVersion")
15012
- ], PostVersion);
15013
- var PostVersion_default = PostVersion;
15530
+ APIKey = __decorate([
15531
+ Schema("APIKey")
15532
+ ], APIKey);
15533
+ var APIKey_default = APIKey;
15014
15534
 
15015
15535
  // dist/lib/generated.js
15016
15536
  var generated_exports = {};
@@ -15126,6 +15646,7 @@ __export(schemas_exports, {
15126
15646
  RawPostSchema: () => RawPostSchema,
15127
15647
  RecommendedPostsSchema: () => RecommendedPostsSchema,
15128
15648
  RisingSearchTrendSchema: () => RisingSearchTrendSchema,
15649
+ SavedSearchSchema: () => SavedSearchSchema,
15129
15650
  SearchTrendBlacklistSchema: () => SearchTrendBlacklistSchema,
15130
15651
  SearchTrendHourlySchema: () => SearchTrendHourlySchema,
15131
15652
  SearchTrendSchema: () => SearchTrendSchema,
@@ -15147,6 +15668,7 @@ __export(schemas_exports, {
15147
15668
  TagPreviewSchema: () => TagPreviewSchema,
15148
15669
  TagRequestStatusSchema: () => TagRequestStatusSchema,
15149
15670
  TagSchema: () => TagSchema,
15671
+ TagSubscriptionSchema: () => TagSubscriptionSchema,
15150
15672
  TagTypeVersionSchema: () => TagTypeVersionSchema,
15151
15673
  TagWithCountSchema: () => TagWithCountSchema,
15152
15674
  TakedownSchema: () => TakedownSchema,
@@ -16894,7 +17416,10 @@ var ForumPostSchema = {
16894
17416
  "created_at",
16895
17417
  "updated_at",
16896
17418
  "warning_type",
16897
- "warning_user_id"
17419
+ "warning_user_id",
17420
+ "vote_score",
17421
+ "creator_name",
17422
+ "updater_name"
16898
17423
  ],
16899
17424
  properties: {
16900
17425
  id: {
@@ -16929,6 +17454,17 @@ var ForumPostSchema = {
16929
17454
  warning_user_id: {
16930
17455
  type: "integer",
16931
17456
  nullable: true
17457
+ },
17458
+ vote_score: {
17459
+ type: "string",
17460
+ nullable: true,
17461
+ description: "Net votes divided by total votes, from -1 to 1. Null if the post has never been voted on."
17462
+ },
17463
+ creator_name: {
17464
+ type: "string"
17465
+ },
17466
+ updater_name: {
17467
+ type: "string"
16932
17468
  }
16933
17469
  }
16934
17470
  };
@@ -16982,7 +17518,10 @@ var ForumTopicSchema = {
16982
17518
  "is_hidden",
16983
17519
  "created_at",
16984
17520
  "updated_at",
16985
- "category_id"
17521
+ "category_id",
17522
+ "last_bumped_at",
17523
+ "creator_name",
17524
+ "updater_name"
16986
17525
  ],
16987
17526
  properties: {
16988
17527
  id: {
@@ -17019,6 +17558,16 @@ var ForumTopicSchema = {
17019
17558
  },
17020
17559
  category_id: {
17021
17560
  type: "integer"
17561
+ },
17562
+ last_bumped_at: {
17563
+ type: "string",
17564
+ format: "date-time"
17565
+ },
17566
+ creator_name: {
17567
+ type: "string"
17568
+ },
17569
+ updater_name: {
17570
+ type: "string"
17022
17571
  }
17023
17572
  }
17024
17573
  };
@@ -17564,6 +18113,10 @@ var LegacyPostSchema = {
17564
18113
  url: {
17565
18114
  type: "string",
17566
18115
  nullable: true
18116
+ },
18117
+ alt: {
18118
+ type: "string",
18119
+ nullable: true
17567
18120
  }
17568
18121
  }
17569
18122
  },
@@ -17592,6 +18145,10 @@ var LegacyPostSchema = {
17592
18145
  type: "string",
17593
18146
  nullable: true
17594
18147
  },
18148
+ alt: {
18149
+ type: "string",
18150
+ nullable: true
18151
+ },
17595
18152
  alternates: {
17596
18153
  type: "object",
17597
18154
  properties: {
@@ -18743,6 +19300,45 @@ var PostFilesSchema = {
18743
19300
  },
18744
19301
  sample: {
18745
19302
  $ref: "#/components/schemas/PostFilesSample"
19303
+ },
19304
+ video: {
19305
+ type: "object",
19306
+ required: [
19307
+ "has",
19308
+ "original",
19309
+ "variants",
19310
+ "samples"
19311
+ ],
19312
+ properties: {
19313
+ has: {
19314
+ type: "boolean"
19315
+ },
19316
+ original: {
19317
+ $ref: "#/components/schemas/PostSampleAlternate"
19318
+ },
19319
+ variants: {
19320
+ type: "object",
19321
+ properties: {
19322
+ webm: {
19323
+ $ref: "#/components/schemas/PostSampleAlternate"
19324
+ },
19325
+ mp4: {
19326
+ $ref: "#/components/schemas/PostSampleAlternate"
19327
+ }
19328
+ }
19329
+ },
19330
+ samples: {
19331
+ type: "object",
19332
+ properties: {
19333
+ "480p": {
19334
+ $ref: "#/components/schemas/PostSampleAlternate"
19335
+ },
19336
+ "720p": {
19337
+ $ref: "#/components/schemas/PostSampleAlternate"
19338
+ }
19339
+ }
19340
+ }
19341
+ }
18746
19342
  }
18747
19343
  }
18748
19344
  };
@@ -19095,7 +19691,8 @@ var PostSampleAlternateSchema = {
19095
19691
  format: "float"
19096
19692
  },
19097
19693
  codec: {
19098
- type: "string"
19694
+ type: "string",
19695
+ nullable: true
19099
19696
  },
19100
19697
  size: {
19101
19698
  type: "integer",
@@ -19109,7 +19706,8 @@ var PostSampleAlternateSchema = {
19109
19706
  },
19110
19707
  url: {
19111
19708
  type: "string",
19112
- format: "uri"
19709
+ format: "uri",
19710
+ nullable: true
19113
19711
  }
19114
19712
  }
19115
19713
  };
@@ -19176,7 +19774,8 @@ var PostStatsSchema = {
19176
19774
  "fav_count",
19177
19775
  "is_favorited",
19178
19776
  "vote",
19179
- "comment_count"
19777
+ "comment_count",
19778
+ "hotness"
19180
19779
  ],
19181
19780
  properties: {
19182
19781
  score: {
@@ -19193,6 +19792,10 @@ var PostStatsSchema = {
19193
19792
  },
19194
19793
  comment_count: {
19195
19794
  type: "integer"
19795
+ },
19796
+ hotness: {
19797
+ type: "number",
19798
+ format: "float"
19196
19799
  }
19197
19800
  }
19198
19801
  };
@@ -19231,6 +19834,7 @@ var PostVersionSchema = {
19231
19834
  "locked_tags",
19232
19835
  "added_tags",
19233
19836
  "removed_tags",
19837
+ "original_tags",
19234
19838
  "added_locked_tags",
19235
19839
  "removed_locked_tags",
19236
19840
  "rating_changed",
@@ -19294,6 +19898,13 @@ var PostVersionSchema = {
19294
19898
  type: "string"
19295
19899
  }
19296
19900
  },
19901
+ original_tags: {
19902
+ type: "array",
19903
+ description: "The tag changes as the user submitted them, before aliases, implications, and automatic tags. Removed tags are prefixed with `-`. May include metatags such as `rating:`, `pool:`, `parent:`, and `source:`.",
19904
+ items: {
19905
+ type: "string"
19906
+ }
19907
+ },
19297
19908
  added_locked_tags: {
19298
19909
  type: "array",
19299
19910
  items: {
@@ -19671,6 +20282,61 @@ var RisingSearchTrendSchema = {
19671
20282
  }
19672
20283
  }
19673
20284
  };
20285
+ var SavedSearchSchema = {
20286
+ type: "object",
20287
+ required: [
20288
+ "id",
20289
+ "query",
20290
+ "name",
20291
+ "is_tracked",
20292
+ "is_subscription",
20293
+ "last_seen_post_id",
20294
+ "created_at",
20295
+ "updated_at",
20296
+ "new_count"
20297
+ ],
20298
+ properties: {
20299
+ id: {
20300
+ type: "integer"
20301
+ },
20302
+ query: {
20303
+ type: "string",
20304
+ description: "Empty for the subscription search, its tags are managed through tag subscriptions."
20305
+ },
20306
+ name: {
20307
+ type: "string",
20308
+ nullable: true
20309
+ },
20310
+ is_tracked: {
20311
+ type: "boolean"
20312
+ },
20313
+ is_subscription: {
20314
+ type: "boolean",
20315
+ description: "True for the search that holds the user's tag subscriptions."
20316
+ },
20317
+ last_seen_post_id: {
20318
+ type: "integer",
20319
+ nullable: true
20320
+ },
20321
+ created_at: {
20322
+ type: "string",
20323
+ format: "date-time"
20324
+ },
20325
+ updated_at: {
20326
+ type: "string",
20327
+ format: "date-time"
20328
+ },
20329
+ tag_count: {
20330
+ type: "integer",
20331
+ description: "Only present on the subscription search."
20332
+ },
20333
+ new_count: {
20334
+ type: "integer",
20335
+ nullable: true,
20336
+ description: "New posts since the search was last seen, capped at 100. Null for untracked searches, when no counts are cached, or when the search could not be evaluated."
20337
+ }
20338
+ }
20339
+ };
19674
20340
  var SearchTrendSchema = {
19675
20341
  type: "object",
19676
20342
  required: [
@@ -20538,6 +21204,34 @@ var TagPreviewSchema = {
20538
21204
  }
20539
21205
  }
20540
21206
  };
21207
+ var TagSubscriptionSchema = {
21208
+ type: "object",
21209
+ required: [
21210
+ "id",
21211
+ "tag_id",
21212
+ "created_at",
21213
+ "tag_name",
21214
+ "category"
21215
+ ],
21216
+ properties: {
21217
+ id: {
21218
+ type: "integer"
21219
+ },
21220
+ tag_id: {
21221
+ type: "integer"
21222
+ },
21223
+ created_at: {
21224
+ type: "string",
21225
+ format: "date-time"
21226
+ },
21227
+ tag_name: {
21228
+ type: "string"
21229
+ },
21230
+ category: {
21231
+ $ref: "#/components/schemas/TagCategory"
21232
+ }
21233
+ }
21234
+ };
20541
21235
  var TagTypeVersionSchema = {
20542
21236
  type: "object",
20543
21237
  required: [
@@ -20652,6 +21346,7 @@ var ThumbnailPostSchema = {
20652
21346
  "width",
20653
21347
  "height",
20654
21348
  "size",
21349
+ "duration",
20655
21350
  "preview_url",
20656
21351
  "preview_webp",
20657
21352
  "sample_url",
@@ -20694,6 +21389,10 @@ var ThumbnailPostSchema = {
20694
21389
  type: "integer",
20695
21390
  format: "int64"
20696
21391
  },
21392
+ duration: {
21393
+ type: "number",
21394
+ nullable: true
21395
+ },
20697
21396
  preview_url: {
20698
21397
  type: "string",
20699
21398
  format: "uri",
@@ -20847,9 +21546,7 @@ var UploadSchema = {
20847
21546
  "uploader_id",
20848
21547
  "tag_string",
20849
21548
  "status",
20850
- "backtrace",
20851
21549
  "post_id",
20852
- "md5_confirmation",
20853
21550
  "created_at",
20854
21551
  "updated_at",
20855
21552
  "parent_id",
@@ -20859,7 +21556,21 @@ var UploadSchema = {
20859
21556
  "image_width",
20860
21557
  "image_height",
20861
21558
  "description",
20862
- "uploader_name"
21559
+ "processing_step",
21560
+ "error_message",
21561
+ "warning_messages",
21562
+ "is_animated",
21563
+ "duration",
21564
+ "has_sound",
21565
+ "locked_tags",
21566
+ "locked_rating",
21567
+ "as_pending",
21568
+ "submitted_tag_string",
21569
+ "processing_started_at",
21570
+ "processed_at",
21571
+ "requeued_at",
21572
+ "uploader_name",
21573
+ "duplicate_post_id"
20863
21574
  ],
20864
21575
  properties: {
20865
21576
  id: {
@@ -20879,18 +21590,21 @@ var UploadSchema = {
20879
21590
  },
20880
21591
  status: {
20881
21592
  type: "string",
20882
- description: 'Note: The "error" status will be proceeded by an error, ex: "error: RuntimeError - No file or source URL provided"\n',
21593
+ description: `Note: The "duplicate" status will be followed by the duplicate post's id, ex: "duplicate: 123"
21594
+ `,
20883
21595
  enum: [
20884
21596
  "completed",
20885
21597
  "duplicate",
20886
- "error",
21598
+ "failed",
20887
21599
  "processing",
21600
+ "queued",
20888
21601
  "pending"
20889
21602
  ]
20890
21603
  },
20891
21604
  backtrace: {
20892
21605
  type: "string",
20893
- nullable: true
21606
+ nullable: true,
21607
+ description: "Only visible to Staff+."
20894
21608
  },
20895
21609
  post_id: {
20896
21610
  type: "integer",
@@ -20899,7 +21613,8 @@ var UploadSchema = {
20899
21613
  md5_confirmation: {
20900
21614
  type: "string",
20901
21615
  nullable: true,
20902
- deprecated: true
21616
+ deprecated: true,
21617
+ description: "Only visible to Staff+."
20903
21618
  },
20904
21619
  created_at: {
20905
21620
  type: "string",
@@ -20936,8 +21651,73 @@ var UploadSchema = {
20936
21651
  description: {
20937
21652
  type: "string"
20938
21653
  },
21654
+ processing_step: {
21655
+ type: "string",
21656
+ nullable: true,
21657
+ description: "The step currently being processed.",
21658
+ enum: [
21659
+ "integrity",
21660
+ "thumbnail",
21661
+ "sound",
21662
+ "post",
21663
+ null
21664
+ ]
21665
+ },
21666
+ error_message: {
21667
+ type: "string",
21668
+ nullable: true
21669
+ },
21670
+ warning_messages: {
21671
+ type: "array",
21672
+ items: {
21673
+ type: "string"
21674
+ }
21675
+ },
21676
+ is_animated: {
21677
+ type: "boolean"
21678
+ },
21679
+ duration: {
21680
+ type: "string",
21681
+ nullable: true
21682
+ },
21683
+ has_sound: {
21684
+ type: "boolean"
21685
+ },
21686
+ locked_tags: {
21687
+ type: "string",
21688
+ nullable: true
21689
+ },
21690
+ locked_rating: {
21691
+ type: "boolean"
21692
+ },
21693
+ as_pending: {
21694
+ type: "boolean"
21695
+ },
21696
+ submitted_tag_string: {
21697
+ type: "string",
21698
+ nullable: true
21699
+ },
21700
+ processing_started_at: {
21701
+ type: "string",
21702
+ format: "date-time",
21703
+ nullable: true
21704
+ },
21705
+ processed_at: {
21706
+ type: "string",
21707
+ format: "date-time",
21708
+ nullable: true
21709
+ },
21710
+ requeued_at: {
21711
+ type: "string",
21712
+ format: "date-time",
21713
+ nullable: true
21714
+ },
20939
21715
  uploader_name: {
20940
21716
  type: "string"
21717
+ },
21718
+ duplicate_post_id: {
21719
+ type: "integer",
21720
+ nullable: true
20941
21721
  }
20942
21722
  }
20943
21723
  };
@@ -21506,9 +22286,8 @@ var AccessDeniedResponseSchema = {
21506
22286
  },
21507
22287
  reason: {
21508
22288
  type: "string",
21509
- enum: [
21510
- "Access Denied"
21511
- ]
22289
+ description: "Usually `Access Denied`, but may include more detail, ex: `Access Denied: Must be logged in`.",
22290
+ example: "Access Denied"
21512
22291
  }
21513
22292
  }
21514
22293
  };
@@ -21720,7 +22499,9 @@ export {
21720
22499
  PostSet_default as PostSet,
21721
22500
  PostVersion_default as PostVersion,
21722
22501
  PostVote_default as PostVote,
22502
+ RatelimitError,
21723
22503
  RisingSearchTrend_default as RisingSearchTrend,
22504
+ SavedSearch_default as SavedSearch,
21724
22505
  SearchTrend_default as SearchTrend,
21725
22506
  SearchTrendBlacklist_default as SearchTrendBlacklist,
21726
22507
  SearchTrendHourly_default as SearchTrendHourly,
@@ -21733,6 +22514,7 @@ export {
21733
22514
  TagCorrection_default as TagCorrection,
21734
22515
  TagImplication_default as TagImplication,
21735
22516
  TagPreview_default as TagPreview,
22517
+ TagSubscription_default as TagSubscription,
21736
22518
  TagTypeVersion_default as TagTypeVersion,
21737
22519
  Takedown_default as Takedown,
21738
22520
  ThumbnailPost_default as ThumbnailPost,
@@ -21747,6 +22529,7 @@ export {
21747
22529
  UserNameChangeRequest_default as UserNameChangeRequest,
21748
22530
  WikiPage_default as WikiPage,
21749
22531
  WikiPageVersion_default as WikiPageVersion,
21750
- index_default as default
22532
+ index_default as default,
22533
+ parseRetryAfter
21751
22534
  };
21752
22535
  //# sourceMappingURL=e621.js.map