e621 2.2.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +14 -41
  3. package/dist/lib/Debug.d.ts +1 -0
  4. package/dist/lib/Debug.js +16 -0
  5. package/dist/lib/errors.d.ts +8 -0
  6. package/dist/lib/errors.js +37 -0
  7. package/dist/lib/generated/client/client.d.ts +2 -0
  8. package/dist/lib/generated/client/client.js +236 -0
  9. package/dist/lib/generated/client/index.d.ts +8 -0
  10. package/dist/lib/generated/client/index.js +7 -0
  11. package/dist/lib/generated/client/types.d.ts +117 -0
  12. package/dist/lib/generated/client/types.js +3 -0
  13. package/dist/lib/generated/client/utils.d.ts +33 -0
  14. package/dist/lib/generated/client/utils.js +229 -0
  15. package/dist/lib/generated/client.d.ts +12 -0
  16. package/dist/lib/generated/client.js +4 -0
  17. package/dist/lib/generated/core/auth.d.ts +18 -0
  18. package/dist/lib/generated/core/auth.js +15 -0
  19. package/dist/lib/generated/core/bodySerializer.d.ts +25 -0
  20. package/dist/lib/generated/core/bodySerializer.js +58 -0
  21. package/dist/lib/generated/core/params.d.ts +43 -0
  22. package/dist/lib/generated/core/params.js +101 -0
  23. package/dist/lib/generated/core/pathSerializer.d.ts +33 -0
  24. package/dist/lib/generated/core/pathSerializer.js +107 -0
  25. package/dist/lib/generated/core/queryKeySerializer.d.ts +18 -0
  26. package/dist/lib/generated/core/queryKeySerializer.js +93 -0
  27. package/dist/lib/generated/core/serverSentEvents.d.ts +71 -0
  28. package/dist/lib/generated/core/serverSentEvents.js +134 -0
  29. package/dist/lib/generated/core/types.d.ts +78 -0
  30. package/dist/lib/generated/core/types.js +3 -0
  31. package/dist/lib/generated/core/utils.d.ts +19 -0
  32. package/dist/lib/generated/core/utils.js +88 -0
  33. package/dist/lib/generated/schemas.d.ts +2908 -0
  34. package/dist/lib/generated/schemas.js +3911 -0
  35. package/dist/lib/generated/sdk.d.ts +1373 -0
  36. package/dist/lib/generated/sdk.js +2557 -0
  37. package/dist/lib/generated/source.json +19299 -0
  38. package/dist/lib/generated/types.d.ts +9663 -0
  39. package/dist/lib/generated/types.js +3 -0
  40. package/dist/lib/generated.d.ts +4 -0
  41. package/dist/lib/generated.js +5 -0
  42. package/dist/lib/index.d.ts +58 -0
  43. package/dist/lib/index.js +74 -0
  44. package/dist/lib/models/ApiKey.d.ts +14 -0
  45. package/dist/lib/models/ApiKey.js +17 -0
  46. package/dist/lib/models/Artist.d.ts +61 -0
  47. package/dist/lib/models/Artist.js +86 -0
  48. package/dist/lib/models/ArtistUrl.d.ts +14 -0
  49. package/dist/lib/models/ArtistUrl.js +17 -0
  50. package/dist/lib/models/ArtistVersion.d.ts +14 -0
  51. package/dist/lib/models/ArtistVersion.js +17 -0
  52. package/dist/lib/models/AvoidPosting.d.ts +63 -0
  53. package/dist/lib/models/AvoidPosting.js +97 -0
  54. package/dist/lib/models/AvoidPostingVersion.d.ts +14 -0
  55. package/dist/lib/models/AvoidPostingVersion.js +17 -0
  56. package/dist/lib/models/Ban.d.ts +14 -0
  57. package/dist/lib/models/Ban.js +17 -0
  58. package/dist/lib/models/Base.d.ts +11 -0
  59. package/dist/lib/models/Base.js +39 -0
  60. package/dist/lib/models/Blip.d.ts +79 -0
  61. package/dist/lib/models/Blip.js +120 -0
  62. package/dist/lib/models/BulkUpdateRequest.d.ts +49 -0
  63. package/dist/lib/models/BulkUpdateRequest.js +75 -0
  64. package/dist/lib/models/Comment.d.ts +100 -0
  65. package/dist/lib/models/Comment.js +157 -0
  66. package/dist/lib/models/CurrentUser.d.ts +14 -0
  67. package/dist/lib/models/CurrentUser.js +17 -0
  68. package/dist/lib/models/DMail.d.ts +46 -0
  69. package/dist/lib/models/DMail.js +73 -0
  70. package/dist/lib/models/EditHistory.d.ts +14 -0
  71. package/dist/lib/models/EditHistory.js +17 -0
  72. package/dist/lib/models/EmailBlacklist.d.ts +26 -0
  73. package/dist/lib/models/EmailBlacklist.js +37 -0
  74. package/dist/lib/models/ForumPost.d.ts +97 -0
  75. package/dist/lib/models/ForumPost.js +154 -0
  76. package/dist/lib/models/ForumPostVote.d.ts +24 -0
  77. package/dist/lib/models/ForumPostVote.js +35 -0
  78. package/dist/lib/models/ForumTopic.d.ts +81 -0
  79. package/dist/lib/models/ForumTopic.js +131 -0
  80. package/dist/lib/models/FullCurrentUser.d.ts +14 -0
  81. package/dist/lib/models/FullCurrentUser.js +17 -0
  82. package/dist/lib/models/FullUser.d.ts +14 -0
  83. package/dist/lib/models/FullUser.js +17 -0
  84. package/dist/lib/models/Help.d.ts +39 -0
  85. package/dist/lib/models/Help.js +57 -0
  86. package/dist/lib/models/IpBan.d.ts +28 -0
  87. package/dist/lib/models/IpBan.js +39 -0
  88. package/dist/lib/models/IqdbPost.d.ts +14 -0
  89. package/dist/lib/models/IqdbPost.js +17 -0
  90. package/dist/lib/models/Mascot.d.ts +39 -0
  91. package/dist/lib/models/Mascot.js +57 -0
  92. package/dist/lib/models/ModAction.d.ts +14 -0
  93. package/dist/lib/models/ModAction.js +17 -0
  94. package/dist/lib/models/NewsUpdate.d.ts +39 -0
  95. package/dist/lib/models/NewsUpdate.js +57 -0
  96. package/dist/lib/models/Note.d.ts +45 -0
  97. package/dist/lib/models/Note.js +71 -0
  98. package/dist/lib/models/NoteVersion.d.ts +24 -0
  99. package/dist/lib/models/NoteVersion.js +35 -0
  100. package/dist/lib/models/Pool.d.ts +67 -0
  101. package/dist/lib/models/Pool.js +109 -0
  102. package/dist/lib/models/PoolVersion.d.ts +24 -0
  103. package/dist/lib/models/PoolVersion.js +35 -0
  104. package/dist/lib/models/Post.d.ts +174 -0
  105. package/dist/lib/models/Post.js +287 -0
  106. package/dist/lib/models/PostApproval.d.ts +26 -0
  107. package/dist/lib/models/PostApproval.js +37 -0
  108. package/dist/lib/models/PostDisapproval.d.ts +14 -0
  109. package/dist/lib/models/PostDisapproval.js +17 -0
  110. package/dist/lib/models/PostEvent.d.ts +14 -0
  111. package/dist/lib/models/PostEvent.js +17 -0
  112. package/dist/lib/models/PostFlag.d.ts +38 -0
  113. package/dist/lib/models/PostFlag.js +57 -0
  114. package/dist/lib/models/PostReplacement.d.ts +75 -0
  115. package/dist/lib/models/PostReplacement.js +117 -0
  116. package/dist/lib/models/PostSet.d.ts +75 -0
  117. package/dist/lib/models/PostSet.js +117 -0
  118. package/dist/lib/models/PostVersion.d.ts +58 -0
  119. package/dist/lib/models/PostVersion.js +93 -0
  120. package/dist/lib/models/StaffNote.d.ts +53 -0
  121. package/dist/lib/models/StaffNote.js +79 -0
  122. package/dist/lib/models/Tag.d.ts +59 -0
  123. package/dist/lib/models/Tag.js +91 -0
  124. package/dist/lib/models/TagAlias.d.ts +51 -0
  125. package/dist/lib/models/TagAlias.js +77 -0
  126. package/dist/lib/models/TagCorrection.d.ts +15 -0
  127. package/dist/lib/models/TagCorrection.js +20 -0
  128. package/dist/lib/models/TagImplication.d.ts +51 -0
  129. package/dist/lib/models/TagImplication.js +77 -0
  130. package/dist/lib/models/TagPreview.d.ts +14 -0
  131. package/dist/lib/models/TagPreview.js +17 -0
  132. package/dist/lib/models/TagTypeVersion.d.ts +14 -0
  133. package/dist/lib/models/TagTypeVersion.js +17 -0
  134. package/dist/lib/models/Takedown.d.ts +87 -0
  135. package/dist/lib/models/Takedown.js +137 -0
  136. package/dist/lib/models/Ticket.d.ts +51 -0
  137. package/dist/lib/models/Ticket.js +77 -0
  138. package/dist/lib/models/Upload.d.ts +14 -0
  139. package/dist/lib/models/Upload.js +17 -0
  140. package/dist/lib/models/UploadWhitelist.d.ts +37 -0
  141. package/dist/lib/models/UploadWhitelist.js +55 -0
  142. package/dist/lib/models/User.d.ts +97 -0
  143. package/dist/lib/models/User.js +160 -0
  144. package/dist/lib/models/UserFeedback.d.ts +63 -0
  145. package/dist/lib/models/UserFeedback.js +97 -0
  146. package/dist/lib/models/UserNameChangeRequest.d.ts +26 -0
  147. package/dist/lib/models/UserNameChangeRequest.js +37 -0
  148. package/dist/lib/models/WikiPage.d.ts +49 -0
  149. package/dist/lib/models/WikiPage.js +75 -0
  150. package/dist/lib/models/WikiPageVersion.d.ts +24 -0
  151. package/dist/lib/models/WikiPageVersion.js +35 -0
  152. package/dist/lib/models/index.d.ts +53 -0
  153. package/dist/lib/models/index.js +54 -0
  154. package/dist/lib/modules/ArtistUrls.d.ts +18 -0
  155. package/dist/lib/modules/ArtistUrls.js +28 -0
  156. package/dist/lib/modules/ArtistVersions.d.ts +18 -0
  157. package/dist/lib/modules/ArtistVersions.js +28 -0
  158. package/dist/lib/modules/Artists.d.ts +90 -0
  159. package/dist/lib/modules/Artists.js +151 -0
  160. package/dist/lib/modules/AvoidPostingVersions.d.ts +18 -0
  161. package/dist/lib/modules/AvoidPostingVersions.js +28 -0
  162. package/dist/lib/modules/AvoidPostings.d.ts +112 -0
  163. package/dist/lib/modules/AvoidPostings.js +181 -0
  164. package/dist/lib/modules/Bans.d.ts +26 -0
  165. package/dist/lib/modules/Bans.js +47 -0
  166. package/dist/lib/modules/Base.d.ts +20 -0
  167. package/dist/lib/modules/Base.js +39 -0
  168. package/dist/lib/modules/Blips.d.ts +105 -0
  169. package/dist/lib/modules/Blips.js +188 -0
  170. package/dist/lib/modules/BulkUpdateRequests.d.ts +76 -0
  171. package/dist/lib/modules/BulkUpdateRequests.js +136 -0
  172. package/dist/lib/modules/CommentVotes.d.ts +30 -0
  173. package/dist/lib/modules/CommentVotes.js +56 -0
  174. package/dist/lib/modules/Comments.d.ts +112 -0
  175. package/dist/lib/modules/Comments.js +195 -0
  176. package/dist/lib/modules/DMails.d.ts +70 -0
  177. package/dist/lib/modules/DMails.js +134 -0
  178. package/dist/lib/modules/DText.d.ts +18 -0
  179. package/dist/lib/modules/DText.js +32 -0
  180. package/dist/lib/modules/EditHistories.d.ts +34 -0
  181. package/dist/lib/modules/EditHistories.js +56 -0
  182. package/dist/lib/modules/EmailBlacklists.d.ts +45 -0
  183. package/dist/lib/modules/EmailBlacklists.js +74 -0
  184. package/dist/lib/modules/Favorites.d.ts +38 -0
  185. package/dist/lib/modules/Favorites.js +73 -0
  186. package/dist/lib/modules/ForumPosts.d.ts +107 -0
  187. package/dist/lib/modules/ForumPosts.js +190 -0
  188. package/dist/lib/modules/ForumTopics.d.ts +125 -0
  189. package/dist/lib/modules/ForumTopics.js +237 -0
  190. package/dist/lib/modules/HelpPages.d.ts +67 -0
  191. package/dist/lib/modules/HelpPages.js +118 -0
  192. package/dist/lib/modules/IpBans.d.ts +47 -0
  193. package/dist/lib/modules/IpBans.js +76 -0
  194. package/dist/lib/modules/IqdbQueries.d.ts +36 -0
  195. package/dist/lib/modules/IqdbQueries.js +63 -0
  196. package/dist/lib/modules/Mascots.d.ts +60 -0
  197. package/dist/lib/modules/Mascots.js +98 -0
  198. package/dist/lib/modules/ModActions.d.ts +34 -0
  199. package/dist/lib/modules/ModActions.js +55 -0
  200. package/dist/lib/modules/NewsUpdates.d.ts +60 -0
  201. package/dist/lib/modules/NewsUpdates.js +98 -0
  202. package/dist/lib/modules/NoteVersions.d.ts +18 -0
  203. package/dist/lib/modules/NoteVersions.js +28 -0
  204. package/dist/lib/modules/Notes.d.ts +72 -0
  205. package/dist/lib/modules/Notes.js +133 -0
  206. package/dist/lib/modules/PoolVersions.d.ts +18 -0
  207. package/dist/lib/modules/PoolVersions.js +28 -0
  208. package/dist/lib/modules/Pools.d.ts +104 -0
  209. package/dist/lib/modules/Pools.js +197 -0
  210. package/dist/lib/modules/Popular.d.ts +18 -0
  211. package/dist/lib/modules/Popular.js +31 -0
  212. package/dist/lib/modules/PostApprovals.d.ts +42 -0
  213. package/dist/lib/modules/PostApprovals.js +77 -0
  214. package/dist/lib/modules/PostDisapprovals.d.ts +37 -0
  215. package/dist/lib/modules/PostDisapprovals.js +55 -0
  216. package/dist/lib/modules/PostEvents.d.ts +20 -0
  217. package/dist/lib/modules/PostEvents.js +30 -0
  218. package/dist/lib/modules/PostFlags.d.ts +53 -0
  219. package/dist/lib/modules/PostFlags.js +93 -0
  220. package/dist/lib/modules/PostReplacements.d.ts +94 -0
  221. package/dist/lib/modules/PostReplacements.js +167 -0
  222. package/dist/lib/modules/PostSets.d.ts +116 -0
  223. package/dist/lib/modules/PostSets.js +211 -0
  224. package/dist/lib/modules/PostVersions.d.ts +51 -0
  225. package/dist/lib/modules/PostVersions.js +94 -0
  226. package/dist/lib/modules/PostVotes.d.ts +28 -0
  227. package/dist/lib/modules/PostVotes.js +54 -0
  228. package/dist/lib/modules/Posts.d.ts +193 -0
  229. package/dist/lib/modules/Posts.js +395 -0
  230. package/dist/lib/modules/RelatedTags.d.ts +19 -0
  231. package/dist/lib/modules/RelatedTags.js +29 -0
  232. package/dist/lib/modules/StaffNotes.d.ts +80 -0
  233. package/dist/lib/modules/StaffNotes.js +140 -0
  234. package/dist/lib/modules/TagAliases.d.ts +80 -0
  235. package/dist/lib/modules/TagAliases.js +140 -0
  236. package/dist/lib/modules/TagCorrections.d.ts +25 -0
  237. package/dist/lib/modules/TagCorrections.js +52 -0
  238. package/dist/lib/modules/TagImplications.d.ts +80 -0
  239. package/dist/lib/modules/TagImplications.js +140 -0
  240. package/dist/lib/modules/TagTypeVersions.d.ts +18 -0
  241. package/dist/lib/modules/TagTypeVersions.js +28 -0
  242. package/dist/lib/modules/Tags.d.ts +64 -0
  243. package/dist/lib/modules/Tags.js +116 -0
  244. package/dist/lib/modules/Takedowns.d.ts +114 -0
  245. package/dist/lib/modules/Takedowns.js +211 -0
  246. package/dist/lib/modules/Tickets.d.ts +71 -0
  247. package/dist/lib/modules/Tickets.js +123 -0
  248. package/dist/lib/modules/UploadWhitelists.d.ts +68 -0
  249. package/dist/lib/modules/UploadWhitelists.js +117 -0
  250. package/dist/lib/modules/Uploads.d.ts +42 -0
  251. package/dist/lib/modules/Uploads.js +78 -0
  252. package/dist/lib/modules/UserFeedbacks.d.ts +94 -0
  253. package/dist/lib/modules/UserFeedbacks.js +165 -0
  254. package/dist/lib/modules/UserNameChangeRequests.d.ts +59 -0
  255. package/dist/lib/modules/UserNameChangeRequests.js +99 -0
  256. package/dist/lib/modules/Users.d.ts +132 -0
  257. package/dist/lib/modules/Users.js +263 -0
  258. package/dist/lib/modules/WikiPageVersions.d.ts +26 -0
  259. package/dist/lib/modules/WikiPageVersions.js +47 -0
  260. package/dist/lib/modules/WikiPages.d.ts +76 -0
  261. package/dist/lib/modules/WikiPages.js +137 -0
  262. package/dist/lib/modules/admin/Users.d.ts +45 -0
  263. package/dist/lib/modules/admin/Users.js +77 -0
  264. package/dist/lib/modules/comments/Votes.d.ts +26 -0
  265. package/dist/lib/modules/comments/Votes.js +51 -0
  266. package/dist/lib/modules/forum_posts/Votes.d.ts +26 -0
  267. package/dist/lib/modules/forum_posts/Votes.js +51 -0
  268. package/dist/lib/modules/index.d.ts +172 -0
  269. package/dist/lib/modules/index.js +114 -0
  270. package/dist/lib/modules/posts/Flag.d.ts +16 -0
  271. package/dist/lib/modules/posts/Flag.js +31 -0
  272. package/dist/lib/modules/posts/Votes.d.ts +26 -0
  273. package/dist/lib/modules/posts/Votes.js +51 -0
  274. package/dist/lib/modules/users/DMails.d.ts +29 -0
  275. package/dist/lib/modules/users/DMails.js +55 -0
  276. package/dist/lib/util.d.ts +48 -0
  277. package/dist/lib/util.js +49 -0
  278. package/dist/package.json +73 -0
  279. package/package.json +46 -20
  280. package/tsconfig.json +54 -0
  281. package/.mocharc.json +0 -6
  282. package/.ncurc.json +0 -3
  283. package/.node-version +0 -1
  284. package/Features/Artists.md +0 -39
  285. package/Features/Blips.md +0 -33
  286. package/Features/E621SearchInconsistencies.md +0 -54
  287. package/Features/FuturePlans.md +0 -50
  288. package/Features/Notes.md +0 -34
  289. package/Features/Pools.md +0 -38
  290. package/Features/PostFlags.md +0 -31
  291. package/Features/PostSets.md +0 -36
  292. package/Features/Posts.md +0 -46
  293. package/Features/README.md +0 -15
  294. package/Features/Tags.md +0 -34
  295. package/Features/Takedowns.md +0 -32
  296. package/Features/UserFeedback.md +0 -32
  297. package/Features/Users.md +0 -36
  298. package/Features/WikiPages.md +0 -36
  299. package/build/package.json +0 -45
  300. package/build/src/index.d.ts +0 -68
  301. package/build/src/index.js +0 -194
  302. package/build/src/modules/Artists.d.ts +0 -128
  303. package/build/src/modules/Artists.js +0 -295
  304. package/build/src/modules/Blips.d.ts +0 -79
  305. package/build/src/modules/Blips.js +0 -157
  306. package/build/src/modules/Notes.d.ts +0 -88
  307. package/build/src/modules/Notes.js +0 -189
  308. package/build/src/modules/Pools.d.ts +0 -130
  309. package/build/src/modules/Pools.js +0 -261
  310. package/build/src/modules/PostFlags.d.ts +0 -55
  311. package/build/src/modules/PostFlags.js +0 -126
  312. package/build/src/modules/PostSets.d.ts +0 -102
  313. package/build/src/modules/PostSets.js +0 -208
  314. package/build/src/modules/Posts.d.ts +0 -154
  315. package/build/src/modules/Posts.js +0 -390
  316. package/build/src/modules/Tags.d.ts +0 -78
  317. package/build/src/modules/Tags.js +0 -174
  318. package/build/src/modules/Takedowns.d.ts +0 -81
  319. package/build/src/modules/Takedowns.js +0 -195
  320. package/build/src/modules/UserFeedback.d.ts +0 -66
  321. package/build/src/modules/UserFeedback.js +0 -136
  322. package/build/src/modules/Users.d.ts +0 -117
  323. package/build/src/modules/Users.js +0 -261
  324. package/build/src/modules/WikiPages.d.ts +0 -107
  325. package/build/src/modules/WikiPages.js +0 -220
  326. package/build/src/structures/Artist.d.ts +0 -36
  327. package/build/src/structures/Artist.js +0 -51
  328. package/build/src/structures/ArtistHistory.d.ts +0 -39
  329. package/build/src/structures/ArtistHistory.js +0 -50
  330. package/build/src/structures/AuthenticatedUser.d.ts +0 -109
  331. package/build/src/structures/AuthenticatedUser.js +0 -128
  332. package/build/src/structures/Blip.d.ts +0 -66
  333. package/build/src/structures/Blip.js +0 -85
  334. package/build/src/structures/Note.d.ts +0 -32
  335. package/build/src/structures/Note.js +0 -41
  336. package/build/src/structures/NoteHistory.d.ts +0 -38
  337. package/build/src/structures/NoteHistory.js +0 -47
  338. package/build/src/structures/Pool.d.ts +0 -85
  339. package/build/src/structures/Pool.js +0 -112
  340. package/build/src/structures/PoolHistory.d.ts +0 -43
  341. package/build/src/structures/PoolHistory.js +0 -54
  342. package/build/src/structures/Post.d.ts +0 -157
  343. package/build/src/structures/Post.js +0 -170
  344. package/build/src/structures/PostApproval.d.ts +0 -25
  345. package/build/src/structures/PostApproval.js +0 -33
  346. package/build/src/structures/PostFlag.d.ts +0 -38
  347. package/build/src/structures/PostFlag.js +0 -47
  348. package/build/src/structures/PostHistory.d.ts +0 -52
  349. package/build/src/structures/PostHistory.js +0 -93
  350. package/build/src/structures/PostSet.d.ts +0 -71
  351. package/build/src/structures/PostSet.js +0 -93
  352. package/build/src/structures/Tag.d.ts +0 -61
  353. package/build/src/structures/Tag.js +0 -87
  354. package/build/src/structures/TagHistory.d.ts +0 -28
  355. package/build/src/structures/TagHistory.js +0 -36
  356. package/build/src/structures/Takedown.d.ts +0 -49
  357. package/build/src/structures/Takedown.js +0 -64
  358. package/build/src/structures/User.d.ts +0 -62
  359. package/build/src/structures/User.js +0 -80
  360. package/build/src/structures/WikiPage.d.ts +0 -17
  361. package/build/src/structures/WikiPage.js +0 -27
  362. package/build/src/structures/WikiPageHistory.d.ts +0 -38
  363. package/build/src/structures/WikiPageHistory.js +0 -49
  364. package/build/src/types/artists.d.ts +0 -82
  365. package/build/src/types/blips.d.ts +0 -37
  366. package/build/src/types/index.d.ts +0 -96
  367. package/build/src/types/notes.d.ts +0 -64
  368. package/build/src/types/pools.d.ts +0 -62
  369. package/build/src/types/post_flags.d.ts +0 -36
  370. package/build/src/types/post_sets.d.ts +0 -33
  371. package/build/src/types/posts.d.ts +0 -181
  372. package/build/src/types/tags.d.ts +0 -56
  373. package/build/src/types/takedowns.d.ts +0 -62
  374. package/build/src/types/user_feedback.d.ts +0 -27
  375. package/build/src/types/users.d.ts +0 -277
  376. package/build/src/types/wiki_pages.d.ts +0 -66
  377. package/build/src/util/Debug.d.ts +0 -1
  378. package/build/src/util/Debug.js +0 -16
  379. package/build/src/util/FormHelper.d.ts +0 -9
  380. package/build/src/util/FormHelper.js +0 -15
  381. package/build/src/util/MultipartData.d.ts +0 -7
  382. package/build/src/util/MultipartData.js +0 -39
  383. package/build/src/util/RequestHandler.d.ts +0 -38
  384. package/build/src/util/RequestHandler.js +0 -343
  385. package/build/src/util/Timer.d.ts +0 -6
  386. package/build/src/util/Timer.js +0 -74
@@ -1,71 +0,0 @@
1
- import type Post from "./Post";
2
- import type User from "./User";
3
- import type { PostSetProperties, ModifyPostSetOptions } from "../types";
4
- import type E621 from "..";
5
- export default class PostSet implements PostSetProperties {
6
- private main;
7
- id: number;
8
- name: string;
9
- shortname: string;
10
- description: string;
11
- is_public: boolean;
12
- transfer_on_delete: boolean;
13
- creator_id: number;
14
- post_ids: Array<number>;
15
- post_count: number;
16
- created_at: string;
17
- updated_at: string;
18
- constructor(main: E621, info: PostSetProperties);
19
- /**
20
- * Get the post objects for the posts in this set
21
- *
22
- * @returns {Promise<Array<Post>>}
23
- */
24
- getPosts(): Promise<Post[]>;
25
- /**
26
- * Get the user object of the creator of this set
27
- *
28
- * @returns {Promise<User | null>}
29
- */
30
- getCreator(): Promise<User | null>;
31
- /**
32
- * Add a post to this set
33
- *
34
- * * Requires Authentication
35
- *
36
- * @param {number} id - the id of the post to add
37
- * @returns {Promise<PostSet>}
38
- */
39
- addPost(id: number): Promise<PostSet>;
40
- /**
41
- * Remove a post from this set
42
- *
43
- * * Requires Authentication
44
- *
45
- * @param {number} id - the id of the post to remove
46
- * @returns {Promise<PostSet>}
47
- */
48
- removePost(id: number): Promise<PostSet>;
49
- /**
50
- * modify this set
51
- *
52
- * * Requires Authentication
53
- *
54
- * @param {object} options
55
- * @param {string} [options.name] - the name of the set
56
- * @param {string} [options.shortname] - the short name of the set
57
- * @param {string} [options.escription] - the description of the set
58
- * @param {boolean} [options.active] - if the set is public
59
- * @param {boolean} [options.transfer_on_deletion] - if deleted posts should be replaced with parents
60
- * @returns {Promise<PostSet>}
61
- */
62
- modify(options: ModifyPostSetOptions): Promise<PostSet>;
63
- /**
64
- * Delete this set
65
- *
66
- * * Requires Authentication
67
- *
68
- * @returns {Promise<null>}
69
- */
70
- delete(): Promise<null>;
71
- }
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class PostSet {
4
- main;
5
- id;
6
- name;
7
- shortname;
8
- description;
9
- is_public;
10
- transfer_on_delete;
11
- creator_id;
12
- post_ids;
13
- post_count;
14
- created_at;
15
- updated_at;
16
- constructor(main, info) {
17
- Object.assign(this, info);
18
- Object.defineProperty(this, "main", {
19
- value: main,
20
- configurable: false,
21
- enumerable: false,
22
- writable: false
23
- });
24
- }
25
- /**
26
- * Get the post objects for the posts in this set
27
- *
28
- * @returns {Promise<Array<Post>>}
29
- */
30
- async getPosts() { return this.main.posts.search.call(this.main.posts, { tags: this.post_ids.map(p => `id:${p}`) }); }
31
- /**
32
- * Get the user object of the creator of this set
33
- *
34
- * @returns {Promise<User | null>}
35
- */
36
- async getCreator() { return this.main.users.get.call(this.main.users, this.creator_id); }
37
- /**
38
- * Add a post to this set
39
- *
40
- * * Requires Authentication
41
- *
42
- * @param {number} id - the id of the post to add
43
- * @returns {Promise<PostSet>}
44
- */
45
- async addPost(id) {
46
- this.main.request.authCheck("PostSet#addPost");
47
- return this.main.postSets.addPost.call(this.main.posts, this.id, id);
48
- }
49
- /**
50
- * Remove a post from this set
51
- *
52
- * * Requires Authentication
53
- *
54
- * @param {number} id - the id of the post to remove
55
- * @returns {Promise<PostSet>}
56
- */
57
- async removePost(id) {
58
- this.main.request.authCheck("PostSet#removePost");
59
- return this.main.postSets.removePost.call(this.main.postSets, this.id, id);
60
- }
61
- /**
62
- * modify this set
63
- *
64
- * * Requires Authentication
65
- *
66
- * @param {object} options
67
- * @param {string} [options.name] - the name of the set
68
- * @param {string} [options.shortname] - the short name of the set
69
- * @param {string} [options.escription] - the description of the set
70
- * @param {boolean} [options.active] - if the set is public
71
- * @param {boolean} [options.transfer_on_deletion] - if deleted posts should be replaced with parents
72
- * @returns {Promise<PostSet>}
73
- */
74
- async modify(options) {
75
- this.main.request.authCheck("PostSet#modify");
76
- if (!options)
77
- throw new Error("options is required in PostSet#modify");
78
- return this.main.postSets.modify.call(this.main.postSets, this.id, options);
79
- }
80
- /**
81
- * Delete this set
82
- *
83
- * * Requires Authentication
84
- *
85
- * @returns {Promise<null>}
86
- */
87
- async delete() {
88
- this.main.request.authCheck("PostSet#delete");
89
- return this.main.postSets.delete.call(this.main.postSets, this.id);
90
- }
91
- }
92
- exports.default = PostSet;
93
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUG9zdFNldC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdHJ1Y3R1cmVzL1Bvc3RTZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFLQSxNQUFxQixPQUFPO0lBQ25CLElBQUksQ0FBTztJQUNuQixFQUFFLENBQVM7SUFDWCxJQUFJLENBQVM7SUFDYixTQUFTLENBQVM7SUFDbEIsV0FBVyxDQUFTO0lBQ3BCLFNBQVMsQ0FBVTtJQUNuQixrQkFBa0IsQ0FBVTtJQUM1QixVQUFVLENBQVM7SUFDbkIsUUFBUSxDQUFnQjtJQUN4QixVQUFVLENBQVM7SUFDbkIsVUFBVSxDQUFTO0lBQ25CLFVBQVUsQ0FBUztJQUNuQixZQUFZLElBQVUsRUFBRSxJQUF1QjtRQUM5QyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztRQUMxQixNQUFNLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxNQUFNLEVBQUU7WUFDbkMsS0FBSyxFQUFTLElBQUk7WUFDbEIsWUFBWSxFQUFFLEtBQUs7WUFDbkIsVUFBVSxFQUFJLEtBQUs7WUFDbkIsUUFBUSxFQU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xJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUM7SUFDNUUsQ0FBQztJQUVEOzs7Ozs7Ozs7Ozs7T0FZRztJQUNILEtBQUssQ0FBQyxNQUFNLENBQUMsT0FBNkI7UUFDekMsSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLGdCQUFnQixDQUFDLENBQUM7UUFDOUMsSUFBSSxDQUFDLE9BQU87WUFBRSxNQUFNLElBQUksS0FBSyxDQUFDLHVDQUF1QyxDQUFDLENBQUM7UUFDdkUsT0FBTyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxFQUFFLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDN0UsQ0FBQztJQUVEOzs7Ozs7T0FNRztJQUNILEtBQUssQ0FBQyxNQUFNO1FBQ1gsSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLGdCQUFnQixDQUFDLENBQUM7UUFDOUMsT0FBTyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUNwRSxDQUFDO0NBQ0Q7QUE3RkQsMEJBNkZDIn0=
@@ -1,61 +0,0 @@
1
- import type Post from "./Post";
2
- import type TagHistory from "./TagHistory";
3
- import type { TagProperties, SearchPostsOptions, ModifyTagOptions, SearchTagHistoryOptions } from "../types";
4
- import type E621 from "..";
5
- export default class Tag implements TagProperties {
6
- private main;
7
- id: number;
8
- name: string;
9
- created_at: string;
10
- updated_at: string;
11
- creator_id: number;
12
- post_count: number;
13
- category: number;
14
- related_tags: string | null;
15
- related_tags_updated_at: string | null;
16
- is_locked: boolean;
17
- constructor(main: E621, info: TagProperties);
18
- /**
19
- * Get posts with this tag (and others, if specified)
20
- *
21
- * @param {object} [options]
22
- * @param {(Array<string> | string)} [options.tags] - narrow the search by specific tags
23
- * @param {(number |`${"" | "a" | "b"}${number}`)} [options.page] - number for exact page, a${number} posts after ${number}, b${number} posts before ${number}
24
- * @param {number} [options.limit] - limit the maximum amount of results returned
25
- *
26
- * @returns {Promise<Array<Post>>}
27
- */
28
- getPosts(options?: SearchPostsOptions): Promise<Post[]>;
29
- /**
30
- * Fetch all posts with this tag (and extras, if specified)
31
- *
32
- * @param {Array<string>} [extraTags] - the additional tags for searching
33
- * @param {number} [lastID] - internal use only
34
- * @param {Array<Post>} [lastPosts] - internal use only
35
- * @returns
36
- */
37
- getAllPosts(extraTags?: Array<string>, lastID?: number, lastPosts?: Array<Post>): Promise<Array<Post>>;
38
- /**
39
- * modify this tag
40
- *
41
- * * Requires Authentication
42
- *
43
- * @param {object} options
44
- * @param {number} [options.category] - the category of the tag
45
- * @param {string} [options.locked] - if the tag is locked (requires moderator)
46
- * @returns {Promise<Tag>}
47
- */
48
- modify(options: ModifyTagOptions): Promise<Tag>;
49
- /**
50
- * Search this tag's history
51
- *
52
- * @param {object} [options]
53
- * @param {number} [options.user] - page of results to get
54
- * @param {number} [options.user_id] - page of results to get
55
- * @param {number} [options.page] - page of results to get
56
- * @param {number} [options.limit] - limit the maximum amount of results returned
57
- * @param
58
- * @returns {Promise<Array<TagHistory>>}
59
- */
60
- getHistory(options?: Omit<SearchTagHistoryOptions, "tag" | "id">): Promise<TagHistory[]>;
61
- }
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class Tag {
4
- main;
5
- id;
6
- name;
7
- created_at;
8
- updated_at;
9
- creator_id;
10
- post_count;
11
- category;
12
- related_tags;
13
- related_tags_updated_at;
14
- is_locked;
15
- constructor(main, info) {
16
- Object.assign(this, info);
17
- Object.defineProperty(this, "main", {
18
- value: main,
19
- configurable: false,
20
- enumerable: false,
21
- writable: false
22
- });
23
- }
24
- /**
25
- * Get posts with this tag (and others, if specified)
26
- *
27
- * @param {object} [options]
28
- * @param {(Array<string> | string)} [options.tags] - narrow the search by specific tags
29
- * @param {(number |`${"" | "a" | "b"}${number}`)} [options.page] - number for exact page, a${number} posts after ${number}, b${number} posts before ${number}
30
- * @param {number} [options.limit] - limit the maximum amount of results returned
31
- *
32
- * @returns {Promise<Array<Post>>}
33
- */
34
- async getPosts(options) { return this.main.posts.search.call(this.main.posts, { ...(options ?? {}), tags: [this.name, ...(options?.tags ?? [])] }); }
35
- /**
36
- * Fetch all posts with this tag (and extras, if specified)
37
- *
38
- * @param {Array<string>} [extraTags] - the additional tags for searching
39
- * @param {number} [lastID] - internal use only
40
- * @param {Array<Post>} [lastPosts] - internal use only
41
- * @returns
42
- */
43
- async getAllPosts(extraTags, lastID, lastPosts = []) {
44
- const posts = await this.main.posts.search({
45
- tags: [this.name, ...(extraTags ?? [])],
46
- page: lastID === undefined ? undefined : `b${lastID}`,
47
- limit: this.main.POST_LIMIT_PER_REQUEST
48
- });
49
- lastPosts.push(...posts);
50
- if (posts.length === this.main.POST_LIMIT_PER_REQUEST)
51
- return this.getAllPosts(extraTags, lastID, lastPosts);
52
- else
53
- return lastPosts;
54
- }
55
- /**
56
- * modify this tag
57
- *
58
- * * Requires Authentication
59
- *
60
- * @param {object} options
61
- * @param {number} [options.category] - the category of the tag
62
- * @param {string} [options.locked] - if the tag is locked (requires moderator)
63
- * @returns {Promise<Tag>}
64
- */
65
- async modify(options) {
66
- this.main.request.authCheck("Pool#modify");
67
- if (!options)
68
- throw new Error("options is required in Tags#modify");
69
- return this.main.tags.modify.call(this.main.tags, this.id, options);
70
- }
71
- /**
72
- * Search this tag's history
73
- *
74
- * @param {object} [options]
75
- * @param {number} [options.user] - page of results to get
76
- * @param {number} [options.user_id] - page of results to get
77
- * @param {number} [options.page] - page of results to get
78
- * @param {number} [options.limit] - limit the maximum amount of results returned
79
- * @param
80
- * @returns {Promise<Array<TagHistory>>}
81
- */
82
- async getHistory(options) {
83
- return this.main.tags.searchHistory.call(this.main.tags, { id: this.id, ...options });
84
- }
85
- }
86
- exports.default = Tag;
87
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGFnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0cnVjdHVyZXMvVGFnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBS0EsTUFBcUIsR0FBRztJQUNmLElBQUksQ0FBTztJQUNuQixFQUFFLENBQVM7SUFDWCxJQUFJLENBQVM7SUFDYixVQUFVLENBQVM7SUFDbkIsVUFBVSxDQUFTO0lBQ25CLFVBQVUsQ0FBUztJQUNuQixVQUFVLENBQVM7SUFDbkIsUUFBUSxDQUFTO0lBQ2pCLFlBQVksQ0FBZ0I7SUFDNUIsdUJBQXVCLENBQWdCO0lBQ3ZDLFNBQVMsQ0FBVTtJQUNuQixZQUFZLElBQVUsRUFBRSxJQUFtQjtRQUMxQyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztRQUMxQixNQUFNLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxNQUFNLEVBQUU7WUFDbkMsS0FBSyxFQUFTLElBQUk7WUFDbEIsWUFBWSxFQUFFLEtBQUs7WUFDbkIsVUFBVSxFQUFJLEtBQUs7WUFDbkIsUUFBUSxFQUFNLEtBQUs7U0FDbkIsQ0FBQyxDQUFDO0lBQ0osQ0FBQztJQUVEOzs7Ozs7Ozs7T0FTRztJQUNILEtBQUssQ0FBQyxRQUFRLENBQUMsT0FBNEIsSUFBSSxPQUFPLEl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ozs7Ozs7O09BU0c7SUFDSCxLQUFLLENBQUMsTUFBTSxDQUFDLE9BQXlCO1FBQ3JDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxhQUFhLENBQUMsQ0FBQztRQUMzQyxJQUFJLENBQUMsT0FBTztZQUFFLE1BQU0sSUFBSSxLQUFLLENBQUMsb0NBQW9DLENBQUMsQ0FBQztRQUNwRSxPQUFPLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLEVBQUUsRUFBRSxPQUFPLENBQUMsQ0FBQztJQUNyRSxDQUFDO0lBRUQ7Ozs7Ozs7Ozs7T0FVRztJQUNILEtBQUssQ0FBQyxVQUFVLENBQUMsT0FBcUQ7UUFDckUsT0FBTyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLEVBQUUsRUFBRSxFQUFFLElBQUksQ0FBQyxFQUFFLEVBQUUsR0FBRyxPQUFPLEVBQUUsQ0FBQyxDQUFDO0lBQ3ZGLENBQUM7Q0FDRDtBQWxGRCxzQkFrRkMifQ==
@@ -1,28 +0,0 @@
1
- import type User from "./User";
2
- import Tag from "./Tag";
3
- import type { TagHistoryProperties } from "../types";
4
- import type E621 from "..";
5
- export default class TagHistory implements TagHistoryProperties {
6
- private main;
7
- id: number;
8
- created_at: string;
9
- updated_at: string;
10
- old_type: number;
11
- new_type: number;
12
- is_locked: boolean;
13
- tag_id: number;
14
- creator_id: number;
15
- constructor(main: E621, info: TagHistoryProperties);
16
- /**
17
- * Get the creator of this history
18
- *
19
- * @returns {Promise<User | null>}
20
- */
21
- getCreator(): Promise<User | null>;
22
- /**
23
- * Get the tag object for this history
24
- *
25
- * @returns {Promise<Tag | null>}
26
- */
27
- getTag(): Promise<Tag | null>;
28
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class TagHistory {
4
- main;
5
- id;
6
- created_at;
7
- updated_at;
8
- old_type;
9
- new_type;
10
- is_locked;
11
- tag_id;
12
- creator_id;
13
- constructor(main, info) {
14
- Object.assign(this, info);
15
- Object.defineProperty(this, "main", {
16
- value: main,
17
- configurable: false,
18
- enumerable: false,
19
- writable: false
20
- });
21
- }
22
- /**
23
- * Get the creator of this history
24
- *
25
- * @returns {Promise<User | null>}
26
- */
27
- async getCreator() { return this.main.users.get.call(this.main.users, this.creator_id); }
28
- /**
29
- * Get the tag object for this history
30
- *
31
- * @returns {Promise<Tag | null>}
32
- */
33
- async getTag() { return this.main.tags.get.call(this.main.tags, this.tag_id); }
34
- }
35
- exports.default = TagHistory;
36
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGFnSGlzdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdHJ1Y3R1cmVzL1RhZ0hpc3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFLQSxNQUFxQixVQUFVO0lBQ3RCLElBQUksQ0FBTztJQUNuQixFQUFFLENBQVM7SUFDWCxVQUFVLENBQVM7SUFDbkIsVUFBVSxDQUFTO0lBQ25CLFFBQVEsQ0FBUztJQUNqQixRQUFRLENBQVM7SUFDakIsU0FBUyxDQUFVO0lBQ25CLE1BQU0sQ0FBUztJQUNmLFVBQVUsQ0FBUztJQUNuQixZQUFZLElBQVUsRUFBRSxJQUEwQjtRQUNqRCxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztRQUMxQixNQUFNLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxNQUFNLEVBQUU7WUFDbkMsS0FBSyxFQUFTLElBQUk7WUFDbEIsWUFBWSxFQUFFLEtBQUs7WUFDbkIsVUFBVSxFQUFJLEtBQUs7WUFDbkIsUUFBUSxFQUFNLEtBQUs7U0FDbkIsQ0FBQyxDQUFDO0lBQ0osQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxLQUFLLENBQUMsVUFBVSxLQUFLLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRXpGOzs7O09BSUc7SUFDSCxLQUFLLENBQUMsTUFBTSxLQUFLLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO0NBQy9FO0FBakNELDZCQWlDQyJ9
@@ -1,49 +0,0 @@
1
- import type E621 from "..";
2
- import { User } from "..";
3
- import type { ModifyTakedownOptions, TakedownProperties, TakedownStatus } from "../types";
4
- export default class Takedown implements TakedownProperties {
5
- private main;
6
- id: number;
7
- status: TakedownStatus;
8
- approver_id: number | null;
9
- reason_hidden: boolean;
10
- created_at: string;
11
- updated_at: string;
12
- post_count: number;
13
- constructor(main: E621, info: TakedownProperties);
14
- /**
15
- * Get the approver of this takedown
16
- *
17
- * @returns {Promise<User | null>}
18
- */
19
- getApprover(): Promise<User | null>;
20
- /**
21
- * modify this takedown
22
- *
23
- * * Requires Authentication
24
- *
25
- * * Requires Admin
26
- *
27
- * @param {object} options
28
- * @param {boolean} [options.process_takedown] - if the takedown should be processed
29
- * @param {string} [options.delete_reason] - the reason to add to posts that are deleted
30
- * @param {Record<string | number, boolean>} [options.takedown_posts] - object of id-boolean values, false = keep, true = delete
31
- * @param {string | Array<string>} [options.takedown_add_posts_tags] - list of tags to match and add to the takedown
32
- * @param {number | Array<number>} [options.takedown_add_posts_ids] - list of posts to add to the takedown
33
- * @param {("pending" | "inactive")} [options.status] - mark the takedown inactive or not
34
- * @param {string} [options.notes] - admin notes
35
- * @param {boolean} [options.reason_hidden] - if the reason should be hidden
36
- * @returns {Promise<Takedown>}
37
- */
38
- modify(options: ModifyTakedownOptions): Promise<Takedown>;
39
- /**
40
- * Delete this takedown
41
- *
42
- * * Requires Authentication
43
- *
44
- * * Requires Admin
45
- *
46
- * @returns {Promise<null>}
47
- */
48
- delete(): Promise<null>;
49
- }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class Takedown {
4
- main;
5
- id;
6
- status;
7
- approver_id;
8
- reason_hidden;
9
- created_at;
10
- updated_at;
11
- post_count;
12
- constructor(main, info) {
13
- Object.assign(this, info);
14
- Object.defineProperty(this, "main", {
15
- value: main,
16
- configurable: false,
17
- enumerable: false,
18
- writable: false
19
- });
20
- }
21
- /**
22
- * Get the approver of this takedown
23
- *
24
- * @returns {Promise<User | null>}
25
- */
26
- async getApprover() { return this.approver_id === null ? null : this.main.users.get.call(this.main.users, this.approver_id); }
27
- /**
28
- * modify this takedown
29
- *
30
- * * Requires Authentication
31
- *
32
- * * Requires Admin
33
- *
34
- * @param {object} options
35
- * @param {boolean} [options.process_takedown] - if the takedown should be processed
36
- * @param {string} [options.delete_reason] - the reason to add to posts that are deleted
37
- * @param {Record<string | number, boolean>} [options.takedown_posts] - object of id-boolean values, false = keep, true = delete
38
- * @param {string | Array<string>} [options.takedown_add_posts_tags] - list of tags to match and add to the takedown
39
- * @param {number | Array<number>} [options.takedown_add_posts_ids] - list of posts to add to the takedown
40
- * @param {("pending" | "inactive")} [options.status] - mark the takedown inactive or not
41
- * @param {string} [options.notes] - admin notes
42
- * @param {boolean} [options.reason_hidden] - if the reason should be hidden
43
- * @returns {Promise<Takedown>}
44
- */
45
- async modify(options) {
46
- this.main.request.authCheck.call(this, "Takedown#modify");
47
- return this.main.takedowns.modify.call(this.main.takedowns, this.id, options);
48
- }
49
- /**
50
- * Delete this takedown
51
- *
52
- * * Requires Authentication
53
- *
54
- * * Requires Admin
55
- *
56
- * @returns {Promise<null>}
57
- */
58
- async delete() {
59
- this.main.request.authCheck.call(this, "Takedown#delete");
60
- return this.main.takedowns.delete.call(this.main.takedowns, this.id);
61
- }
62
- }
63
- exports.default = Takedown;
64
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGFrZWRvd24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RydWN0dXJlcy9UYWtlZG93bi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUlBLE1BQXFCLFFBQVE7SUFDcEIsSUFBSSxDQUFPO0lBQ25CLEVBQUUsQ0FBUztJQUNYLE1BQU0sQ0FBaUI7SUFDdkIsV0FBVyxDQUFnQjtJQUMzQixhQUFhLENBQVU7SUFDdkIsVUFBVSxDQUFTO0lBQ25CLFVBQVUsQ0FBUztJQUNuQixVQUFVLENBQVM7SUFDbkIsWUFBWSxJQUFVLEVBQUUsSUFBd0I7UUFDL0MsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7UUFDMUIsTUFBTSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsTUFBTSxFQUFFO1lBQ25DLEtBQUssRUFBUyxJQUFJO1lBQ2xCLFlBQVksRUFBRSxLQUFLO1lBQ25CLFVBQVUsRUFBSSxLQUFLO1lBQ25CLFFBQVEsRUFBTSxLQUFLO1NBQ25CLENBQUMsQ0FBQztJQUNKLENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsS0FBSyxDQUFDLFdBQVcsS0FBSyxPQUFPLElBQUksQ0FBQyxXQUFXLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBRSxJQUFJLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUUvSDs7Ozs7Ozs7Ozs7Ozs7Ozs7T0FpQkc7SUFDSCxLQUFLLENBQUMsTUFBTSxDQUFDLE9BQThCO1FBQzFDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLGlCQUFpQixDQUFDLENBQUM7UUFDMUQsT0FBTyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLElBQUksQ0FBQyxFQUFFLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDL0UsQ0FBQztJQUVEOzs7Ozs7OztPQVFHO0lBQ0gsS0FBSyxDQUFDLE1BQU07UUFDWCxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxpQkFBaUIsQ0FBQyxDQUFDO1FBQzFELE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDdEUsQ0FBQztDQUNEO0FBOURELDJCQThEQyJ9
@@ -1,62 +0,0 @@
1
- import type Post from "./Post";
2
- import type E621 from "..";
3
- import type { UserProperties, SearchUserFeedbackOptions, CreateUserFeedbackOptions, UserFeedbackProperties } from "../types";
4
- export default class User implements UserProperties {
5
- protected readonly main: E621;
6
- wiki_page_version_count: number;
7
- artist_version_count: number;
8
- pool_version_count: number;
9
- forum_post_count: number;
10
- comment_count: number;
11
- appeal_count: number;
12
- flag_count: number;
13
- positive_feedback_count: number;
14
- neutral_feedback_count: number;
15
- negative_feedback_count: number;
16
- upload_limit: number;
17
- id: number;
18
- created_at: string;
19
- name: string;
20
- level: number;
21
- base_upload_limit: number;
22
- post_upload_count: number;
23
- post_update_count: number;
24
- note_update_count: number;
25
- is_banned: boolean;
26
- can_approve_posts: boolean;
27
- can_upload_free: boolean;
28
- level_string: string;
29
- avatar_id: number | null;
30
- constructor(main: E621, info: UserProperties);
31
- /**
32
- * Get the feedback associated with this user
33
- *
34
- * @param {object} [options] - Options for narrowing the search
35
- * @param {string} [options.creator] - the creator of the feedback
36
- * @param {string} [options.body] - the body of the feedback
37
- * @param {FeedbackCategories} [options.category] - the type of feedback
38
- * @param {number} [options.limit] - the maximum amount of feedback to fetch
39
- * @returns {Array<UserFeedbackProperties>}
40
- */
41
- getFeedback(options: Omit<SearchUserFeedbackOptions, "username">): Promise<UserFeedbackProperties[]>;
42
- /**
43
- * Create a feedback for this user
44
- *
45
- * * Requires Authentication
46
- *
47
- * * Requires Moderator
48
- *
49
- * @param {object} options
50
- * @param {FeedbackCategories} options.category - the type of feedback
51
- * @param {string} options.body - the body of the feedback
52
- * @returns
53
- */
54
- createFeedback(options: Omit<CreateUserFeedbackOptions, "username">): Promise<UserFeedbackProperties>;
55
- /**
56
- * Get this users favorites
57
- *
58
- * @returns {Promise<Array<Post>>}
59
- */
60
- getFavorites(): Promise<Post[]>;
61
- asAuthenticatedUser(): Promise<import("./AuthenticatedUser").default>;
62
- }
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class User {
4
- main;
5
- wiki_page_version_count;
6
- artist_version_count;
7
- pool_version_count;
8
- forum_post_count;
9
- comment_count;
10
- appeal_count;
11
- flag_count;
12
- positive_feedback_count;
13
- neutral_feedback_count;
14
- negative_feedback_count;
15
- upload_limit;
16
- id;
17
- created_at;
18
- name;
19
- level;
20
- base_upload_limit;
21
- post_upload_count;
22
- post_update_count;
23
- note_update_count;
24
- is_banned;
25
- can_approve_posts;
26
- can_upload_free;
27
- level_string;
28
- avatar_id;
29
- constructor(main, info) {
30
- Object.assign(this, info);
31
- Object.defineProperty(this, "main", {
32
- value: main,
33
- configurable: false,
34
- enumerable: false,
35
- writable: false
36
- });
37
- }
38
- /**
39
- * Get the feedback associated with this user
40
- *
41
- * @param {object} [options] - Options for narrowing the search
42
- * @param {string} [options.creator] - the creator of the feedback
43
- * @param {string} [options.body] - the body of the feedback
44
- * @param {FeedbackCategories} [options.category] - the type of feedback
45
- * @param {number} [options.limit] - the maximum amount of feedback to fetch
46
- * @returns {Array<UserFeedbackProperties>}
47
- */
48
- async getFeedback(options) { return this.main.userFeedback.search.call(this.main.userFeedback, { username: this.name, ...options }); }
49
- /**
50
- * Create a feedback for this user
51
- *
52
- * * Requires Authentication
53
- *
54
- * * Requires Moderator
55
- *
56
- * @param {object} options
57
- * @param {FeedbackCategories} options.category - the type of feedback
58
- * @param {string} options.body - the body of the feedback
59
- * @returns
60
- */
61
- async createFeedback(options) {
62
- this.main.request.authCheck.call(this, "User#createFeedback");
63
- return this.main.userFeedback.create.call(this.main.userFeedback, { username: this.name, ...options });
64
- }
65
- /**
66
- * Get this users favorites
67
- *
68
- * @returns {Promise<Array<Post>>}
69
- */
70
- async getFavorites() { return this.main.users.getFavorites(this.id); }
71
- async asAuthenticatedUser() {
72
- this.main.request.authCheck("User#asAuthenticatedUser");
73
- const info = await this.main.users.getSelf.call(this.main.users);
74
- if (info.id !== this.id)
75
- throw new Error("User#asAuthenticatedUser called on a different user");
76
- return info;
77
- }
78
- }
79
- exports.default = User;
80
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpb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DLEVBQUUsS0FBSyxJQUFJLENBQUMsRUFBRTtZQUFFLE1BQU0sSUFBSSxLQUFLLENBQUMscURBQXFELENBQUMsQ0FBQztRQUNoRyxPQUFPLElBQUksQ0FBQztJQUNiLENBQUM7Q0FDRDtBQTlFRCx1QkE4RUMifQ==
@@ -1,17 +0,0 @@
1
- import type { WikiPageProperties } from "../types";
2
- import type E621 from "..";
3
- export default class WikiPage implements WikiPageProperties {
4
- private main;
5
- id: number;
6
- creator_id: number;
7
- creator_name: string;
8
- category_name: number;
9
- body: string;
10
- is_locked: boolean;
11
- created_at: string;
12
- updated_at: string;
13
- updater_id: number;
14
- other_names: Array<string>;
15
- is_deleted: boolean;
16
- constructor(main: E621, info: WikiPageProperties);
17
- }