e621 3.4.1 → 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.
- package/README.md +23 -0
- package/dist/browser/e621.js +919 -190
- package/dist/browser/e621.js.map +4 -4
- package/dist/lib/client.d.ts +61 -0
- package/dist/lib/client.js +37 -4
- package/dist/lib/errors.d.ts +13 -0
- package/dist/lib/errors.js +27 -1
- package/dist/lib/generated/schemas.d.ts +169 -8
- package/dist/lib/generated/schemas.js +215 -13
- package/dist/lib/generated/sdk.d.ts +77 -7
- package/dist/lib/generated/sdk.js +134 -9
- package/dist/lib/generated/types.d.ts +880 -245
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/models/Artist.d.ts +1 -0
- package/dist/lib/models/Artist.js +2 -1
- package/dist/lib/models/SavedSearch.d.ts +37 -0
- package/dist/lib/models/SavedSearch.js +55 -0
- package/dist/lib/models/TagSubscription.d.ts +25 -0
- package/dist/lib/models/TagSubscription.js +36 -0
- package/dist/lib/models/Takedown.d.ts +13 -2
- package/dist/lib/models/Takedown.js +21 -2
- package/dist/lib/models/User.d.ts +1 -1
- package/dist/lib/models/UserNameChangeRequest.d.ts +1 -1
- package/dist/lib/models/index.d.ts +2 -0
- package/dist/lib/models/index.js +3 -1
- package/dist/lib/models/posts/Actions.d.ts +6 -6
- package/dist/lib/modules/Artists.d.ts +2 -0
- package/dist/lib/modules/Artists.js +3 -1
- package/dist/lib/modules/Base.js +4 -2
- package/dist/lib/modules/DText.d.ts +2 -3
- package/dist/lib/modules/DText.js +5 -6
- package/dist/lib/modules/PostVersions.d.ts +2 -1
- package/dist/lib/modules/PostVersions.js +3 -2
- package/dist/lib/modules/Posts.d.ts +6 -6
- package/dist/lib/modules/Posts.js +8 -14
- package/dist/lib/modules/SavedSearches.d.ts +94 -0
- package/dist/lib/modules/SavedSearches.js +162 -0
- package/dist/lib/modules/SearchTrendBlacklists.js +1 -1
- package/dist/lib/modules/StaffUsers.d.ts +1 -1
- package/dist/lib/modules/StaffUsers.js +4 -2
- package/dist/lib/modules/TagAliases.d.ts +1 -1
- package/dist/lib/modules/TagAliases.js +3 -2
- package/dist/lib/modules/TagImplications.d.ts +1 -1
- package/dist/lib/modules/TagImplications.js +3 -2
- package/dist/lib/modules/TagSubscriptions.d.ts +49 -0
- package/dist/lib/modules/TagSubscriptions.js +82 -0
- package/dist/lib/modules/Takedowns.d.ts +16 -2
- package/dist/lib/modules/Takedowns.js +25 -3
- package/dist/lib/modules/Uploads.d.ts +29 -2
- package/dist/lib/modules/Uploads.js +47 -11
- package/dist/lib/modules/UserNameChangeRequests.d.ts +2 -2
- package/dist/lib/modules/UserNameChangeRequests.js +5 -3
- package/dist/lib/modules/index.d.ts +6 -0
- package/dist/lib/modules/index.js +5 -1
- package/dist/lib/standalone.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/package.json +1 -1
package/dist/browser/e621.js
CHANGED
|
@@ -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.
|
|
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("
|
|
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
|
-
|
|
836
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
8336
|
-
}).then((res) => this._handleResponse(res,
|
|
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,
|
|
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,
|
|
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\#
|
|
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\#
|
|
9918
|
+
* @see {@link https://e621.wiki/#operations-Takedowns-takedowns\#clear_posts Documentation} for more details.
|
|
9711
9919
|
*/
|
|
9712
|
-
async
|
|
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
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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),
|
|
@@ -14909,6 +15508,7 @@ function apply(e621, client2, defaultPostFormat = {}) {
|
|
|
14909
15508
|
tagImplications: new TagImplications(baseE621, client2),
|
|
14910
15509
|
tagTypeVersions: new TagTypeVersions(baseE621, client2),
|
|
14911
15510
|
tags: new Tags(baseE621, client2),
|
|
15511
|
+
tagSubscriptions: new TagSubscriptions(baseE621, client2),
|
|
14912
15512
|
takedowns: new Takedowns(baseE621, client2),
|
|
14913
15513
|
tickets: new Tickets(baseE621, client2),
|
|
14914
15514
|
uploadKarmaEvents: new UploadKarmaEvents(baseE621, client2),
|
|
@@ -14932,86 +15532,6 @@ APIKey = __decorate([
|
|
|
14932
15532
|
], APIKey);
|
|
14933
15533
|
var APIKey_default = APIKey;
|
|
14934
15534
|
|
|
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
|
-
}
|
|
14985
|
-
};
|
|
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;
|
|
15014
|
-
|
|
15015
15535
|
// dist/lib/generated.js
|
|
15016
15536
|
var generated_exports = {};
|
|
15017
15537
|
__export(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
|
};
|
|
@@ -19285,6 +19834,7 @@ var PostVersionSchema = {
|
|
|
19285
19834
|
"locked_tags",
|
|
19286
19835
|
"added_tags",
|
|
19287
19836
|
"removed_tags",
|
|
19837
|
+
"original_tags",
|
|
19288
19838
|
"added_locked_tags",
|
|
19289
19839
|
"removed_locked_tags",
|
|
19290
19840
|
"rating_changed",
|
|
@@ -19348,6 +19898,13 @@ var PostVersionSchema = {
|
|
|
19348
19898
|
type: "string"
|
|
19349
19899
|
}
|
|
19350
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
|
+
},
|
|
19351
19908
|
added_locked_tags: {
|
|
19352
19909
|
type: "array",
|
|
19353
19910
|
items: {
|
|
@@ -19725,6 +20282,61 @@ var RisingSearchTrendSchema = {
|
|
|
19725
20282
|
}
|
|
19726
20283
|
}
|
|
19727
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
|
+
};
|
|
19728
20340
|
var SearchTrendSchema = {
|
|
19729
20341
|
type: "object",
|
|
19730
20342
|
required: [
|
|
@@ -20592,6 +21204,34 @@ var TagPreviewSchema = {
|
|
|
20592
21204
|
}
|
|
20593
21205
|
}
|
|
20594
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
|
+
};
|
|
20595
21235
|
var TagTypeVersionSchema = {
|
|
20596
21236
|
type: "object",
|
|
20597
21237
|
required: [
|
|
@@ -20706,6 +21346,7 @@ var ThumbnailPostSchema = {
|
|
|
20706
21346
|
"width",
|
|
20707
21347
|
"height",
|
|
20708
21348
|
"size",
|
|
21349
|
+
"duration",
|
|
20709
21350
|
"preview_url",
|
|
20710
21351
|
"preview_webp",
|
|
20711
21352
|
"sample_url",
|
|
@@ -20748,6 +21389,10 @@ var ThumbnailPostSchema = {
|
|
|
20748
21389
|
type: "integer",
|
|
20749
21390
|
format: "int64"
|
|
20750
21391
|
},
|
|
21392
|
+
duration: {
|
|
21393
|
+
type: "number",
|
|
21394
|
+
nullable: true
|
|
21395
|
+
},
|
|
20751
21396
|
preview_url: {
|
|
20752
21397
|
type: "string",
|
|
20753
21398
|
format: "uri",
|
|
@@ -20901,9 +21546,7 @@ var UploadSchema = {
|
|
|
20901
21546
|
"uploader_id",
|
|
20902
21547
|
"tag_string",
|
|
20903
21548
|
"status",
|
|
20904
|
-
"backtrace",
|
|
20905
21549
|
"post_id",
|
|
20906
|
-
"md5_confirmation",
|
|
20907
21550
|
"created_at",
|
|
20908
21551
|
"updated_at",
|
|
20909
21552
|
"parent_id",
|
|
@@ -20913,7 +21556,21 @@ var UploadSchema = {
|
|
|
20913
21556
|
"image_width",
|
|
20914
21557
|
"image_height",
|
|
20915
21558
|
"description",
|
|
20916
|
-
"
|
|
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"
|
|
20917
21574
|
],
|
|
20918
21575
|
properties: {
|
|
20919
21576
|
id: {
|
|
@@ -20933,18 +21590,21 @@ var UploadSchema = {
|
|
|
20933
21590
|
},
|
|
20934
21591
|
status: {
|
|
20935
21592
|
type: "string",
|
|
20936
|
-
description:
|
|
21593
|
+
description: `Note: The "duplicate" status will be followed by the duplicate post's id, ex: "duplicate: 123"
|
|
21594
|
+
`,
|
|
20937
21595
|
enum: [
|
|
20938
21596
|
"completed",
|
|
20939
21597
|
"duplicate",
|
|
20940
|
-
"
|
|
21598
|
+
"failed",
|
|
20941
21599
|
"processing",
|
|
21600
|
+
"queued",
|
|
20942
21601
|
"pending"
|
|
20943
21602
|
]
|
|
20944
21603
|
},
|
|
20945
21604
|
backtrace: {
|
|
20946
21605
|
type: "string",
|
|
20947
|
-
nullable: true
|
|
21606
|
+
nullable: true,
|
|
21607
|
+
description: "Only visible to Staff+."
|
|
20948
21608
|
},
|
|
20949
21609
|
post_id: {
|
|
20950
21610
|
type: "integer",
|
|
@@ -20953,7 +21613,8 @@ var UploadSchema = {
|
|
|
20953
21613
|
md5_confirmation: {
|
|
20954
21614
|
type: "string",
|
|
20955
21615
|
nullable: true,
|
|
20956
|
-
deprecated: true
|
|
21616
|
+
deprecated: true,
|
|
21617
|
+
description: "Only visible to Staff+."
|
|
20957
21618
|
},
|
|
20958
21619
|
created_at: {
|
|
20959
21620
|
type: "string",
|
|
@@ -20990,8 +21651,73 @@ var UploadSchema = {
|
|
|
20990
21651
|
description: {
|
|
20991
21652
|
type: "string"
|
|
20992
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
|
+
},
|
|
20993
21715
|
uploader_name: {
|
|
20994
21716
|
type: "string"
|
|
21717
|
+
},
|
|
21718
|
+
duplicate_post_id: {
|
|
21719
|
+
type: "integer",
|
|
21720
|
+
nullable: true
|
|
20995
21721
|
}
|
|
20996
21722
|
}
|
|
20997
21723
|
};
|
|
@@ -21560,9 +22286,8 @@ var AccessDeniedResponseSchema = {
|
|
|
21560
22286
|
},
|
|
21561
22287
|
reason: {
|
|
21562
22288
|
type: "string",
|
|
21563
|
-
|
|
21564
|
-
|
|
21565
|
-
]
|
|
22289
|
+
description: "Usually `Access Denied`, but may include more detail, ex: `Access Denied: Must be logged in`.",
|
|
22290
|
+
example: "Access Denied"
|
|
21566
22291
|
}
|
|
21567
22292
|
}
|
|
21568
22293
|
};
|
|
@@ -21774,7 +22499,9 @@ export {
|
|
|
21774
22499
|
PostSet_default as PostSet,
|
|
21775
22500
|
PostVersion_default as PostVersion,
|
|
21776
22501
|
PostVote_default as PostVote,
|
|
22502
|
+
RatelimitError,
|
|
21777
22503
|
RisingSearchTrend_default as RisingSearchTrend,
|
|
22504
|
+
SavedSearch_default as SavedSearch,
|
|
21778
22505
|
SearchTrend_default as SearchTrend,
|
|
21779
22506
|
SearchTrendBlacklist_default as SearchTrendBlacklist,
|
|
21780
22507
|
SearchTrendHourly_default as SearchTrendHourly,
|
|
@@ -21787,6 +22514,7 @@ export {
|
|
|
21787
22514
|
TagCorrection_default as TagCorrection,
|
|
21788
22515
|
TagImplication_default as TagImplication,
|
|
21789
22516
|
TagPreview_default as TagPreview,
|
|
22517
|
+
TagSubscription_default as TagSubscription,
|
|
21790
22518
|
TagTypeVersion_default as TagTypeVersion,
|
|
21791
22519
|
Takedown_default as Takedown,
|
|
21792
22520
|
ThumbnailPost_default as ThumbnailPost,
|
|
@@ -21801,6 +22529,7 @@ export {
|
|
|
21801
22529
|
UserNameChangeRequest_default as UserNameChangeRequest,
|
|
21802
22530
|
WikiPage_default as WikiPage,
|
|
21803
22531
|
WikiPageVersion_default as WikiPageVersion,
|
|
21804
|
-
index_default as default
|
|
22532
|
+
index_default as default,
|
|
22533
|
+
parseRetryAfter
|
|
21805
22534
|
};
|
|
21806
22535
|
//# sourceMappingURL=e621.js.map
|