e621 3.2.0 → 3.2.1

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 (45) hide show
  1. package/README.md +18 -2
  2. package/dist/browser/e621.js +168 -111
  3. package/dist/browser/e621.js.map +3 -3
  4. package/dist/lib/client.d.ts +11 -2
  5. package/dist/lib/client.js +1 -1
  6. package/dist/lib/generated/schemas.d.ts +7 -2
  7. package/dist/lib/generated/schemas.js +17 -10
  8. package/dist/lib/generated/types.d.ts +53 -57
  9. package/dist/lib/index.d.ts +4 -3
  10. package/dist/lib/index.js +2 -2
  11. package/dist/lib/models/Base.browser.d.ts +4 -3
  12. package/dist/lib/models/Base.browser.js +1 -1
  13. package/dist/lib/models/Base.d.ts +4 -3
  14. package/dist/lib/models/Base.js +1 -1
  15. package/dist/lib/models/BasicPost.d.ts +2 -1
  16. package/dist/lib/models/BasicPost.js +1 -1
  17. package/dist/lib/models/ExtendedPost.d.ts +2 -1
  18. package/dist/lib/models/ExtendedPost.js +1 -1
  19. package/dist/lib/models/Post.d.ts +2 -1
  20. package/dist/lib/models/Post.js +1 -1
  21. package/dist/lib/models/ThumbnailPost.d.ts +2 -1
  22. package/dist/lib/models/ThumbnailPost.js +1 -1
  23. package/dist/lib/models/posts/Actions.d.ts +11 -11
  24. package/dist/lib/models/posts/Actions.js +1 -1
  25. package/dist/lib/modules/Base.d.ts +4 -3
  26. package/dist/lib/modules/Base.js +6 -3
  27. package/dist/lib/modules/Favorites.d.ts +8 -3
  28. package/dist/lib/modules/Favorites.js +12 -4
  29. package/dist/lib/modules/IqdbQueries.d.ts +11 -6
  30. package/dist/lib/modules/IqdbQueries.js +12 -4
  31. package/dist/lib/modules/Popular.d.ts +8 -3
  32. package/dist/lib/modules/Popular.js +12 -4
  33. package/dist/lib/modules/Posts.d.ts +27 -18
  34. package/dist/lib/modules/Posts.js +46 -22
  35. package/dist/lib/modules/Uploads.d.ts +3 -3
  36. package/dist/lib/modules/Uploads.js +1 -1
  37. package/dist/lib/modules/index.d.ts +8 -7
  38. package/dist/lib/modules/index.js +72 -69
  39. package/dist/lib/modules/posts/Format.d.ts +15 -5
  40. package/dist/lib/modules/posts/Format.js +1 -1
  41. package/dist/lib/standalone.d.ts +8 -2
  42. package/dist/lib/standalone.js +10 -1
  43. package/dist/lib/version.d.ts +1 -1
  44. package/dist/lib/version.js +1 -1
  45. package/package.json +11 -5
package/README.md CHANGED
@@ -37,6 +37,21 @@ const e621 = new E621({
37
37
  // e.g. use e621.posts.METHOD(), e621.users.METHOD()
38
38
  ```
39
39
 
40
+ ### Default Post Format
41
+
42
+ Post-returning methods (`posts.get()`, `posts.search()`, `favorites.search()`, `popular.get()`, `iqdbQueries.get()`/`.post()`, and convenience methods on returned post models like `post.update()`) accept per-call `v2`/`mode` options and default to the legacy format when omitted. Set `defaultPostFormat` once to change that default everywhere instead of repeating the same options on every call:
43
+ ```typescript
44
+ const e621 = new E621({
45
+ defaultPostFormat: { v2: true, mode: "extended" }
46
+ });
47
+
48
+ const post = await e621.posts.get(123); // ExtendedPost, typed accurately - no cast needed
49
+ await post?.update({ tags: "foo" }); // also resolves to ExtendedPost
50
+
51
+ // a per-call option still overrides the default for that one call
52
+ const legacy = await e621.posts.get(123, { v2: false });
53
+ ```
54
+
40
55
  ## Browser Usage
41
56
 
42
57
  A pre-bundled, browser-only build (no Node built-ins) is published at `e621/browser`, for use with a plain `<script type="module">` or a CDN like jsDelivr/unpkg:
@@ -62,7 +77,7 @@ import Favorites from "e621/modules/Favorites";
62
77
  import { createE621Client, createStandalone } from "e621/standalone";
63
78
 
64
79
  // same Options as `new E621()`, handles auth headers/user agent/etc. for you
65
- const client = createE621Client({ authUser: "", authKey: "" }).client;
80
+ const client = createE621Client({ authUser: "", authKey: "" });
66
81
 
67
82
  // only the modules listed here (and their own dependencies) end up in your bundle;
68
83
  // property names are each module's own `moduleKey` (matching `new E621()`'s naming, e.g. `posts`, `favorites`)
@@ -83,7 +98,8 @@ npm test
83
98
  - `test/treeshaking.test.ts` - bundles a standalone client with esbuild and asserts unrelated modules are excluded and the result is meaningfully smaller than `new E621()`.
84
99
  - `test/standalone.test.ts` / `test/client.test.ts` - verify `createE621Client`/`createStandalone` wiring and the full `E621` client's module surface (no network calls).
85
100
  - `test/browser.test.ts` - loads the browser bundle in a real headless Chromium (via [Playwright](https://playwright.dev)) and checks it works with no Node built-ins.
86
- - `test/operationIds.test.ts` - scans `lib/` for every `@OperationID(...)`/`@Schema(...)` and asserts the value actually exists in the OpenAPI spec (these aren't validated at runtime anymore - see the note in `lib/util.ts` - so this plus the build-time check in `scripts/replace-openapi.ts` are what catch a typo'd one).
101
+ - `test/openapi.test.ts` - scans `lib/` for every `@OperationID(...)`/`@Schema(...)` and asserts the value actually exists in the OpenAPI spec (these aren't validated at runtime anymore - see the note in `lib/util.ts` - so this plus the build-time check in `scripts/replace-openapi.ts` are what catch a typo'd one).
102
+ - `test/defaultPostFormat.test.ts` - mocks `fetch` to verify `defaultPostFormat` actually reaches the outgoing request's query params, that the returned model matches, that a per-call option overrides it, and that it's picked up by model convenience methods too.
87
103
 
88
104
  CI (`.github/workflows/test.yml`) runs the same on every push/PR, and gates releases (`publish.yml`) on it passing.
89
105
 
@@ -787,7 +787,7 @@ var createClient = (config = {}) => {
787
787
  };
788
788
 
789
789
  // dist/lib/version.js
790
- var VERSION = "3.2.0";
790
+ var VERSION = "3.2.1";
791
791
 
792
792
  // dist/lib/client.js
793
793
  function createE621Client(options) {
@@ -3202,10 +3202,11 @@ var Base2 = class {
3202
3202
  throw new UnexpectedResponseError(res.request, res.response, res.error);
3203
3203
  } else {
3204
3204
  if (klass) {
3205
+ const e621 = this.e621;
3205
3206
  if (Array.isArray(res.data))
3206
- return res.data.map((item) => new klass(this.e621, item));
3207
+ return res.data.map((item) => new klass(e621, item));
3207
3208
  else
3208
- return new klass(this.e621, res.data);
3209
+ return new klass(e621, res.data);
3209
3210
  } else
3210
3211
  return res.data;
3211
3212
  }
@@ -5643,6 +5644,12 @@ function wrapPosts(e621, data, v2, mode) {
5643
5644
  var _a2;
5644
5645
  var Favorites = class extends Base2 {
5645
5646
  static moduleKey = "favorites";
5647
+ defaultFormat;
5648
+ /** @param defaultFormat - The v2/mode format to fall back to when `search()` is called without explicit v2/mode options. */
5649
+ constructor(e621, client2, defaultFormat = {}) {
5650
+ super(e621, client2);
5651
+ this.defaultFormat = defaultFormat;
5652
+ }
5646
5653
  /**
5647
5654
  *
5648
5655
  * @requiresApiKeyAuth
@@ -5678,13 +5685,15 @@ var Favorites = class extends Base2 {
5678
5685
  * @see {@link https://e621.wiki/#operations-Favorites-favorites\#index Documentation} for more details.
5679
5686
  */
5680
5687
  async search(options) {
5688
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
5689
+ const mode = options?.mode ?? this.defaultFormat.mode;
5681
5690
  return favorites_index({
5682
5691
  client: this.client,
5683
- query: options
5692
+ query: { ...options, v2, mode }
5684
5693
  }).then((res) => {
5685
5694
  const data = this._handleResponse(res, 200, true);
5686
- const raw = options?.v2 ? data : data.posts;
5687
- return wrapPosts(this.e621, raw, options?.v2, options?.mode);
5695
+ const raw = v2 ? data : data.posts;
5696
+ return wrapPosts(this.e621, raw, v2, mode);
5688
5697
  });
5689
5698
  }
5690
5699
  };
@@ -6664,6 +6673,12 @@ var _a3;
6664
6673
  var _b2;
6665
6674
  var IqdbQueries = class extends Base2 {
6666
6675
  static moduleKey = "iqdb";
6676
+ defaultFormat;
6677
+ /** @param defaultFormat - The v2 format to fall back to when `get()`/`post()` are called without an explicit `v2` option. `mode` is ignored - IQDB only ever returns the basic v2 format. */
6678
+ constructor(e621, client2, defaultFormat = {}) {
6679
+ super(e621, client2);
6680
+ this.defaultFormat = defaultFormat;
6681
+ }
6667
6682
  /**
6668
6683
  *
6669
6684
  * @operationId {@link https://e621.wiki/#operations-IQDB-iqdb_queries\#show iqdb_queries#show}
@@ -6671,14 +6686,15 @@ var IqdbQueries = class extends Base2 {
6671
6686
  * @see {@link https://e621.wiki/#operations-IQDB-iqdb_queries\#show Documentation} for more details.
6672
6687
  */
6673
6688
  async get(options) {
6689
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
6674
6690
  return iqdbQueries_show({
6675
6691
  client: this.client,
6676
- query: prefixKeys(options, "search", ["v2"])
6692
+ query: { ...prefixKeys(options, "search", ["v2"]) ?? {}, v2 }
6677
6693
  }).then((res) => {
6678
6694
  const data = this._handleResponse(res, 200, true);
6679
6695
  return data.map((d) => ({
6680
6696
  hash: d.hash,
6681
- post: options.v2 ? new BasicPost_default(this.e621, d.post) : new IqdbPost_default(this.e621, d.post.posts),
6697
+ post: v2 ? new BasicPost_default(this.e621, d.post) : new IqdbPost_default(this.e621, d.post.posts),
6682
6698
  post_id: d.post_id,
6683
6699
  score: d.score
6684
6700
  }));
@@ -6691,7 +6707,8 @@ var IqdbQueries = class extends Base2 {
6691
6707
  * @see {@link https://e621.wiki/#operations-IQDB-iqdb_queries\#show_post Documentation} for more details.
6692
6708
  */
6693
6709
  async post(options) {
6694
- const { v2, ...body } = options;
6710
+ const { v2: rawV2, ...body } = options ?? {};
6711
+ const v2 = rawV2 ?? this.defaultFormat.v2;
6695
6712
  return iqdbQueries_showPost({
6696
6713
  client: this.client,
6697
6714
  query: { v2 },
@@ -7624,6 +7641,16 @@ var _f;
7624
7641
  var _g;
7625
7642
  var Posts = class extends Base2 {
7626
7643
  static moduleKey = "posts";
7644
+ defaultFormat;
7645
+ /**
7646
+ * @param defaultFormat - The v2/mode format to fall back to for any method here (or any convenience
7647
+ * method on a returned post model) called without explicit v2/mode options. Defaults to the legacy
7648
+ * format, matching `new E621()`'s behavior when {@link Options.defaultPostFormat} isn't set.
7649
+ */
7650
+ constructor(e621, client2, defaultFormat = {}) {
7651
+ super(e621, client2);
7652
+ this.defaultFormat = defaultFormat;
7653
+ }
7627
7654
  /**
7628
7655
  *
7629
7656
  * You must be Janitor+.
@@ -7716,16 +7743,18 @@ var Posts = class extends Base2 {
7716
7743
  * @see {@link https://e621.wiki/#operations-Posts-posts\#show Documentation} for more details.
7717
7744
  */
7718
7745
  async get(id, options) {
7746
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
7747
+ const mode = options?.mode ?? this.defaultFormat.mode;
7719
7748
  return posts_show({
7720
7749
  client: this.client,
7721
7750
  path: { id },
7722
- query: options
7751
+ query: { ...options, v2, mode }
7723
7752
  }).then((res) => {
7724
7753
  const data = this._handleResponse(res, 200, false);
7725
7754
  if (data === null)
7726
7755
  return null;
7727
- const raw = options?.v2 ? data : data.post;
7728
- return wrapPost(this.e621, raw, options?.v2, options?.mode);
7756
+ const raw = v2 ? data : data.post;
7757
+ return wrapPost(this.e621, raw, v2, mode);
7729
7758
  });
7730
7759
  }
7731
7760
  /**
@@ -7739,14 +7768,16 @@ var Posts = class extends Base2 {
7739
7768
  * @see {@link https://e621.wiki/#operations-Posts-posts\#mark_as_translated Documentation} for more details.
7740
7769
  */
7741
7770
  async markTranslated(id, options) {
7771
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
7772
+ const mode = options?.mode ?? this.defaultFormat.mode;
7742
7773
  return posts_markAsTranslated({
7743
7774
  client: this.client,
7744
7775
  path: { id },
7745
- query: options
7776
+ query: { ...options, v2, mode }
7746
7777
  }).then((res) => {
7747
7778
  const data = this._handleResponse(res, 200, true);
7748
- const raw = options?.v2 ? data : data.post;
7749
- return wrapPost(this.e621, raw, options?.v2, options?.mode);
7779
+ const raw = v2 ? data : data.post;
7780
+ return wrapPost(this.e621, raw, v2, mode);
7750
7781
  });
7751
7782
  }
7752
7783
  /**
@@ -7789,13 +7820,15 @@ var Posts = class extends Base2 {
7789
7820
  * @see {@link https://e621.wiki/#operations-Posts-posts\#random Documentation} for more details.
7790
7821
  */
7791
7822
  async random(options) {
7823
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
7824
+ const mode = options?.mode ?? this.defaultFormat.mode;
7792
7825
  return posts_random({
7793
7826
  client: this.client,
7794
- query: options
7827
+ query: { ...options, v2, mode }
7795
7828
  }).then((res) => {
7796
7829
  const data = this._handleResponse(res, 200, true);
7797
- const raw = options?.v2 ? data : data.post;
7798
- return wrapPost(this.e621, raw, options?.v2, options?.mode);
7830
+ const raw = v2 ? data : data.post;
7831
+ return wrapPost(this.e621, raw, v2, mode);
7799
7832
  });
7800
7833
  }
7801
7834
  /**
@@ -7905,17 +7938,19 @@ var Posts = class extends Base2 {
7905
7938
  * @see {@link https://e621.wiki/#operations-Posts-posts\#index Documentation} for more details.
7906
7939
  */
7907
7940
  async search(options) {
7941
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
7942
+ const mode = options?.mode ?? this.defaultFormat.mode;
7908
7943
  return posts_index({
7909
7944
  client: this.client,
7910
- query: options
7945
+ query: { ...options, v2, mode }
7911
7946
  }).then((res) => {
7912
7947
  const data = this._handleResponse(res, 200, true);
7913
7948
  if (options?.md5) {
7914
- const raw2 = options.v2 ? data : data.post;
7915
- return wrapPost(this.e621, raw2, options.v2, options.mode);
7949
+ const raw2 = v2 ? data : data.post;
7950
+ return wrapPost(this.e621, raw2, v2, mode);
7916
7951
  }
7917
- const raw = options?.v2 ? data : data.posts;
7918
- return wrapPosts(this.e621, raw, options?.v2, options?.mode);
7952
+ const raw = v2 ? data : data.posts;
7953
+ return wrapPosts(this.e621, raw, v2, mode);
7919
7954
  });
7920
7955
  }
7921
7956
  /**
@@ -7925,14 +7960,16 @@ var Posts = class extends Base2 {
7925
7960
  * @see {@link https://e621.wiki/#operations-Posts-posts\#show_seq Documentation} for more details.
7926
7961
  */
7927
7962
  async sequence(id, options) {
7963
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
7964
+ const mode = options?.mode ?? this.defaultFormat.mode;
7928
7965
  return posts_showSeq({
7929
7966
  client: this.client,
7930
7967
  path: { id },
7931
- query: options
7968
+ query: { ...options, v2, mode }
7932
7969
  }).then((res) => {
7933
7970
  const data = this._handleResponse(res, 200, true);
7934
- const raw = options?.v2 ? data : data.post;
7935
- return wrapPost(this.e621, raw, options?.v2, options?.mode);
7971
+ const raw = v2 ? data : data.post;
7972
+ return wrapPost(this.e621, raw, v2, mode);
7936
7973
  });
7937
7974
  }
7938
7975
  /**
@@ -7965,7 +8002,9 @@ var Posts = class extends Base2 {
7965
8002
  * @see {@link https://e621.wiki/#operations-Posts-posts\#update Documentation} for more details.
7966
8003
  */
7967
8004
  async update(id, options) {
7968
- const { v2, mode, ...body } = options ?? {};
8005
+ const { v2: rawV2, mode: rawMode, ...body } = options ?? {};
8006
+ const v2 = rawV2 ?? this.defaultFormat.v2;
8007
+ const mode = rawMode ?? this.defaultFormat.mode;
7969
8008
  return posts_update({
7970
8009
  client: this.client,
7971
8010
  path: { id },
@@ -7988,14 +8027,16 @@ var Posts = class extends Base2 {
7988
8027
  * @see {@link https://e621.wiki/#operations-Posts-posts\#update_iqdb Documentation} for more details.
7989
8028
  */
7990
8029
  async updateIqdb(id, options) {
8030
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
8031
+ const mode = options?.mode ?? this.defaultFormat.mode;
7991
8032
  return posts_updateIqdb({
7992
8033
  client: this.client,
7993
8034
  path: { id },
7994
- query: options
8035
+ query: { ...options, v2, mode }
7995
8036
  }).then((res) => {
7996
8037
  const data = this._handleResponse(res, 200, true);
7997
- const raw = options?.v2 ? data : data.post;
7998
- return wrapPost(this.e621, raw, options?.v2, options?.mode);
8038
+ const raw = v2 ? data : data.post;
8039
+ return wrapPost(this.e621, raw, v2, mode);
7999
8040
  });
8000
8041
  }
8001
8042
  };
@@ -11217,6 +11258,12 @@ __decorate([
11217
11258
  var _a5;
11218
11259
  var Popular = class extends Base2 {
11219
11260
  static moduleKey = "popular";
11261
+ defaultFormat;
11262
+ /** @param defaultFormat - The v2/mode format to fall back to when `get()` is called without explicit v2/mode options. */
11263
+ constructor(e621, client2, defaultFormat = {}) {
11264
+ super(e621, client2);
11265
+ this.defaultFormat = defaultFormat;
11266
+ }
11220
11267
  /**
11221
11268
  *
11222
11269
  * @operationId {@link https://e621.wiki/#operations-Popular-popular\#index popular#index}
@@ -11224,13 +11271,15 @@ var Popular = class extends Base2 {
11224
11271
  * @see {@link https://e621.wiki/#operations-Popular-popular\#index Documentation} for more details.
11225
11272
  */
11226
11273
  async get(options) {
11274
+ const v2 = options?.v2 ?? this.defaultFormat.v2;
11275
+ const mode = options?.mode ?? this.defaultFormat.mode;
11227
11276
  return popular_index({
11228
11277
  client: this.client,
11229
- query: options
11278
+ query: { ...options, v2, mode }
11230
11279
  }).then((res) => {
11231
11280
  const data = this._handleResponse(res, 200, true);
11232
- const raw = options?.v2 ? data : data.posts;
11233
- return wrapPosts(this.e621, raw, options?.v2, options?.mode);
11281
+ const raw = v2 ? data : data.posts;
11282
+ return wrapPosts(this.e621, raw, v2, mode);
11234
11283
  });
11235
11284
  }
11236
11285
  };
@@ -13503,76 +13552,77 @@ __decorate([
13503
13552
  ], StaffWikiVersions.prototype, "search", null);
13504
13553
 
13505
13554
  // dist/lib/modules/index.js
13506
- function apply(e621, client2) {
13555
+ function apply(e621, client2, defaultPostFormat = {}) {
13556
+ const baseE621 = e621;
13507
13557
  const modules = {
13508
- appeals: new Appeals(e621, client2),
13509
- artistUrls: new ArtistUrls(e621, client2),
13510
- artistVersions: new ArtistVersions(e621, client2),
13511
- artists: new Artists(e621, client2),
13512
- avoidPostingVersions: new AvoidPostingVersions(e621, client2),
13513
- avoidPostings: new AvoidPostings(e621, client2),
13514
- bans: new Bans(e621, client2),
13515
- blips: new Blips(e621, client2),
13516
- bulkUpdateRequests: new BulkUpdateRequests(e621, client2),
13517
- commentVotes: new CommentVotes(e621, client2),
13518
- comments: new Comments(e621, client2),
13519
- dbExports: new DBExports(e621, client2),
13520
- dmails: new DMails(e621, client2),
13521
- dtext: new DText(e621, client2),
13522
- editHistories: new EditHistories(e621, client2),
13523
- emailBlacklists: new EmailBlacklists(e621, client2),
13524
- favorites: new Favorites(e621, client2),
13525
- forumPosts: new ForumPosts(e621, client2),
13526
- forumPostVotes: new ForumPostVotes(e621, client2),
13527
- forumTopics: new ForumTopics(e621, client2),
13528
- health: new Health(e621, client2),
13529
- helpPages: new HelpPages(e621, client2),
13530
- ipBans: new IpBans(e621, client2),
13531
- iqdb: new IqdbQueries(e621, client2),
13532
- mascots: new Mascots(e621, client2),
13533
- modActions: new ModActions(e621, client2),
13534
- newsUpdates: new NewsUpdates(e621, client2),
13535
- notes: new Notes(e621, client2),
13536
- noteVersions: new NoteVersions(e621, client2),
13537
- pools: new Pools(e621, client2),
13538
- popular: new Popular(e621, client2),
13539
- postApprovals: new PostApprovals(e621, client2),
13540
- postDisapprovals: new PostDisapprovals(e621, client2),
13541
- postEvents: new PostEvents(e621, client2),
13542
- postFlags: new PostFlags(e621, client2),
13543
- postReplacements: new PostReplacements(e621, client2),
13544
- poolVersions: new PoolVersions(e621, client2),
13545
- postSets: new PostSets(e621, client2),
13546
- postVersions: new PostVersions(e621, client2),
13547
- postVotes: new PostVotes(e621, client2),
13548
- posts: new Posts(e621, client2),
13549
- relatedTags: new RelatedTags(e621, client2),
13550
- searchTrendBlacklists: new SearchTrendBlacklists(e621, client2),
13551
- searchTrends: new SearchTrends(e621, client2),
13552
- staffAutomodDMails: new StaffAutomodDMails(e621, client2),
13553
- staffDmails: new StaffDMails(e621, client2),
13554
- staffExceptionLogs: new StaffExceptionLogs(e621, client2),
13555
- staffFiles: new StaffFiles(e621, client2),
13556
- staffNotes: new StaffNotes(e621, client2),
13557
- staffUserCleanups: new StaffUserCleanups(e621, client2),
13558
- staffUsers: new StaffUsers(e621, client2),
13559
- staffVoteTrends: new StaffVoteTrends(e621, client2),
13560
- staffWikis: new StaffWikis(e621, client2),
13561
- staffWikiVersions: new StaffWikiVersions(e621, client2),
13562
- tagAliases: new TagAliases(e621, client2),
13563
- tagCorrections: new TagCorrections(e621, client2),
13564
- tagImplications: new TagImplications(e621, client2),
13565
- tagTypeVersions: new TagTypeVersions(e621, client2),
13566
- tags: new Tags(e621, client2),
13567
- takedowns: new Takedowns(e621, client2),
13568
- tickets: new Tickets(e621, client2),
13558
+ appeals: new Appeals(baseE621, client2),
13559
+ artistUrls: new ArtistUrls(baseE621, client2),
13560
+ artistVersions: new ArtistVersions(baseE621, client2),
13561
+ artists: new Artists(baseE621, client2),
13562
+ avoidPostingVersions: new AvoidPostingVersions(baseE621, client2),
13563
+ avoidPostings: new AvoidPostings(baseE621, client2),
13564
+ bans: new Bans(baseE621, client2),
13565
+ blips: new Blips(baseE621, client2),
13566
+ bulkUpdateRequests: new BulkUpdateRequests(baseE621, client2),
13567
+ commentVotes: new CommentVotes(baseE621, client2),
13568
+ comments: new Comments(baseE621, client2),
13569
+ dbExports: new DBExports(baseE621, client2),
13570
+ dmails: new DMails(baseE621, client2),
13571
+ dtext: new DText(baseE621, client2),
13572
+ editHistories: new EditHistories(baseE621, client2),
13573
+ emailBlacklists: new EmailBlacklists(baseE621, client2),
13574
+ favorites: new Favorites(e621, client2, defaultPostFormat),
13575
+ forumPosts: new ForumPosts(baseE621, client2),
13576
+ forumPostVotes: new ForumPostVotes(baseE621, client2),
13577
+ forumTopics: new ForumTopics(baseE621, client2),
13578
+ health: new Health(baseE621, client2),
13579
+ helpPages: new HelpPages(baseE621, client2),
13580
+ ipBans: new IpBans(baseE621, client2),
13581
+ iqdb: new IqdbQueries(e621, client2, defaultPostFormat),
13582
+ mascots: new Mascots(baseE621, client2),
13583
+ modActions: new ModActions(baseE621, client2),
13584
+ newsUpdates: new NewsUpdates(baseE621, client2),
13585
+ notes: new Notes(baseE621, client2),
13586
+ noteVersions: new NoteVersions(baseE621, client2),
13587
+ pools: new Pools(baseE621, client2),
13588
+ popular: new Popular(e621, client2, defaultPostFormat),
13589
+ postApprovals: new PostApprovals(baseE621, client2),
13590
+ postDisapprovals: new PostDisapprovals(baseE621, client2),
13591
+ postEvents: new PostEvents(baseE621, client2),
13592
+ postFlags: new PostFlags(baseE621, client2),
13593
+ postReplacements: new PostReplacements(baseE621, client2),
13594
+ poolVersions: new PoolVersions(baseE621, client2),
13595
+ postSets: new PostSets(baseE621, client2),
13596
+ postVersions: new PostVersions(baseE621, client2),
13597
+ postVotes: new PostVotes(baseE621, client2),
13598
+ posts: new Posts(e621, client2, defaultPostFormat),
13599
+ relatedTags: new RelatedTags(baseE621, client2),
13600
+ searchTrendBlacklists: new SearchTrendBlacklists(baseE621, client2),
13601
+ searchTrends: new SearchTrends(baseE621, client2),
13602
+ staffAutomodDMails: new StaffAutomodDMails(baseE621, client2),
13603
+ staffDmails: new StaffDMails(baseE621, client2),
13604
+ staffExceptionLogs: new StaffExceptionLogs(baseE621, client2),
13605
+ staffFiles: new StaffFiles(baseE621, client2),
13606
+ staffNotes: new StaffNotes(baseE621, client2),
13607
+ staffUserCleanups: new StaffUserCleanups(baseE621, client2),
13608
+ staffUsers: new StaffUsers(baseE621, client2),
13609
+ staffVoteTrends: new StaffVoteTrends(baseE621, client2),
13610
+ staffWikis: new StaffWikis(baseE621, client2),
13611
+ staffWikiVersions: new StaffWikiVersions(baseE621, client2),
13612
+ tagAliases: new TagAliases(baseE621, client2),
13613
+ tagCorrections: new TagCorrections(baseE621, client2),
13614
+ tagImplications: new TagImplications(baseE621, client2),
13615
+ tagTypeVersions: new TagTypeVersions(baseE621, client2),
13616
+ tags: new Tags(baseE621, client2),
13617
+ takedowns: new Takedowns(baseE621, client2),
13618
+ tickets: new Tickets(baseE621, client2),
13569
13619
  uploads: new Uploads(e621, client2),
13570
- uploadWhitelists: new UploadWhitelists(e621, client2),
13571
- users: new Users(e621, client2),
13572
- userFeedbacks: new UserFeedbacks(e621, client2),
13573
- userNameChangeRequests: new UserNameChangeRequests(e621, client2),
13574
- wikiPages: new WikiPages(e621, client2),
13575
- wikiPageVersions: new WikiPageVersions(e621, client2)
13620
+ uploadWhitelists: new UploadWhitelists(baseE621, client2),
13621
+ users: new Users(baseE621, client2),
13622
+ userFeedbacks: new UserFeedbacks(baseE621, client2),
13623
+ userNameChangeRequests: new UserNameChangeRequests(baseE621, client2),
13624
+ wikiPages: new WikiPages(baseE621, client2),
13625
+ wikiPageVersions: new WikiPageVersions(baseE621, client2)
13576
13626
  };
13577
13627
  Object.assign(e621, modules);
13578
13628
  }
@@ -14024,15 +14074,22 @@ var FeedbackCategoriesSchema = {
14024
14074
  ]
14025
14075
  };
14026
14076
  var TagRequestStatusesSchema = {
14027
- type: "string",
14028
- enum: [
14029
- "active",
14030
- "deleted",
14031
- "processing",
14032
- "queued",
14033
- "retired",
14034
- "error",
14035
- "pending"
14077
+ oneOf: [
14078
+ {
14079
+ type: "string",
14080
+ enum: [
14081
+ "active",
14082
+ "deleted",
14083
+ "processing",
14084
+ "queued",
14085
+ "retired",
14086
+ "pending"
14087
+ ]
14088
+ },
14089
+ {
14090
+ type: "string",
14091
+ pattern: "^error: .*$"
14092
+ }
14036
14093
  ]
14037
14094
  };
14038
14095
  var WarningTypesSchema = {
@@ -19209,7 +19266,7 @@ var E621 = class {
19209
19266
  const { client: client2, options: resolved } = createE621Client(options);
19210
19267
  this.client = client2;
19211
19268
  this.options = resolved;
19212
- apply(this, this.client);
19269
+ apply(this, this.client, options?.defaultPostFormat ?? {});
19213
19270
  }
19214
19271
  };
19215
19272
  var index_default = E621;