e621 2.0.2 → 2.1.2

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 (71) hide show
  1. package/.mocharc.json +6 -0
  2. package/.ncurc.json +3 -0
  3. package/Features/Artists.md +32 -0
  4. package/Features/FuturePlans.md +21 -0
  5. package/Features/Pools.md +32 -0
  6. package/Features/PostSets.md +31 -0
  7. package/Features/Posts.md +38 -0
  8. package/Features/README.md +11 -0
  9. package/Features/Tags.md +27 -0
  10. package/Features/UserFeedback.md +27 -0
  11. package/Features/Users.md +31 -0
  12. package/Features/WikiPages.md +30 -0
  13. package/README.md +1 -86
  14. package/build/package.json +12 -4
  15. package/build/src/index.d.ts +13 -4
  16. package/build/src/index.js +19 -5
  17. package/build/src/modules/Artists.d.ts +108 -0
  18. package/build/src/modules/Artists.js +242 -0
  19. package/build/src/modules/Pools.d.ts +3 -1
  20. package/build/src/modules/Pools.js +4 -2
  21. package/build/src/modules/PostSets.d.ts +15 -1
  22. package/build/src/modules/PostSets.js +31 -5
  23. package/build/src/modules/Posts.d.ts +3 -1
  24. package/build/src/modules/Posts.js +8 -3
  25. package/build/src/modules/Tags.d.ts +63 -0
  26. package/build/src/modules/Tags.js +147 -0
  27. package/build/src/modules/UserFeedback.d.ts +1 -1
  28. package/build/src/modules/UserFeedback.js +1 -1
  29. package/build/src/modules/Users.d.ts +9 -2
  30. package/build/src/modules/Users.js +16 -4
  31. package/build/src/modules/WikiPages.d.ts +1 -1
  32. package/build/src/modules/WikiPages.js +3 -3
  33. package/build/src/structures/Artist.d.ts +36 -0
  34. package/build/src/structures/Artist.js +51 -0
  35. package/build/src/structures/ArtistHistory.d.ts +39 -0
  36. package/build/src/structures/ArtistHistory.js +50 -0
  37. package/build/src/structures/AuthenticatedUser.js +4 -4
  38. package/build/src/structures/Pool.d.ts +1 -1
  39. package/build/src/structures/Pool.js +11 -9
  40. package/build/src/structures/PoolHistory.d.ts +4 -3
  41. package/build/src/structures/PoolHistory.js +5 -4
  42. package/build/src/structures/Post.d.ts +0 -6
  43. package/build/src/structures/Post.js +11 -18
  44. package/build/src/structures/PostHistory.d.ts +5 -5
  45. package/build/src/structures/PostHistory.js +5 -5
  46. package/build/src/structures/PostSet.js +9 -7
  47. package/build/src/structures/Tag.d.ts +60 -0
  48. package/build/src/structures/Tag.js +87 -0
  49. package/build/src/structures/TagHistory.d.ts +27 -0
  50. package/build/src/structures/TagHistory.js +36 -0
  51. package/build/src/structures/User.js +5 -5
  52. package/build/src/structures/WikiPage.d.ts +2 -1
  53. package/build/src/structures/WikiPage.js +4 -3
  54. package/build/src/structures/WikiPageHistory.d.ts +2 -1
  55. package/build/src/structures/WikiPageHistory.js +4 -4
  56. package/build/src/types/artists.d.ts +75 -0
  57. package/build/src/types/index.d.ts +2 -0
  58. package/build/src/types/pools.d.ts +7 -6
  59. package/build/src/types/post_sets.d.ts +2 -2
  60. package/build/src/types/posts.d.ts +8 -7
  61. package/build/src/types/tags.d.ts +47 -0
  62. package/build/src/types/users.d.ts +3 -3
  63. package/build/src/types/wiki_pages.d.ts +3 -3
  64. package/build/src/util/Debug.d.ts +1 -0
  65. package/build/src/util/Debug.js +11 -0
  66. package/build/src/util/FormHelper.js +2 -2
  67. package/build/src/util/RequestHandler.d.ts +3 -2
  68. package/build/src/util/RequestHandler.js +26 -3
  69. package/build/src/util/Timer.d.ts +6 -0
  70. package/build/src/util/Timer.js +71 -0
  71. package/package.json +12 -4
package/.mocharc.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "bail": true,
3
+ "require": "ts-node/register",
4
+ "timeout": 20000,
5
+ "spec": "test/**/*.ts"
6
+ }
package/.ncurc.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "upgrade": true
3
+ }
@@ -0,0 +1,32 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - [Future Plans](FuturePlans.md)
4
+ - **Artists**
5
+ - [Pools](Pools.md)
6
+ - [Posts](Posts.md)
7
+ - [Post Sets](PostSets.md)
8
+ - [Tags](Tags.md)
9
+ - [User Feedback](UserFeedback.md)
10
+ - [Users](Users.md)
11
+ - [Wiki Pages](WikiPages.md)
12
+
13
+ <hr>
14
+
15
+ | Feature | Implemented | Method |
16
+ |:------------------:|:-----------:|:-----------------------:|
17
+ | Get By ID | ✔️ | `artists.get` |
18
+ | Get By Name | ✔️ | `artists.getByName` |
19
+ | Search | ✔️ | `artists.search` |
20
+ | Create[^1] | ✔️ | `artists.create` |
21
+ | Modify[^1] | ✔️ | `artists.modify` |
22
+ | Delete[^1][^3] | ✔️ | `artists.delete` |
23
+ | Ban[^1][^5] | ✖️ | N/A |
24
+ | Unban[^1][^5] | ✖️ | N/A |
25
+ | Revert[^1] | ✔️ | `artists.revert` |
26
+ | Search History[^1] | ✔️ | `artists.searchHistory` |
27
+
28
+ [^1]: Requires Authentication
29
+ [^2]: Requires Privileged
30
+ [^3]: Requires Janitor
31
+ [^4]: Requires Moderator
32
+ [^5]: Requires Admin
@@ -0,0 +1,21 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - **Future Plans**
4
+ - [Artists](Artists.md)
5
+ - [Pools](Pools.md)
6
+ - [Posts](Posts.md)
7
+ - [Post Sets](PostSets.md)
8
+ - [Tags](Tags.md)
9
+ - [User Feedback](UserFeedback.md)
10
+ - [Users](Users.md)
11
+ - [Wiki Pages](WikiPages.md)
12
+
13
+ <hr>
14
+
15
+ | Feature | Planned |
16
+ |:--------------------------:|:-------:|
17
+ | Post Flags | ✔️ |
18
+ | General Moderative Actions | ✔️ |
19
+ | Dmails[^1] | ✖️ |
20
+
21
+ [^1]: E621 does not expose a json api for dmails, and I currently do not plan on scraping the html for them, as this will add tremendous bloat to the library.
@@ -0,0 +1,32 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - [Future Plans](FuturePlans.md)
4
+ - [Artists](Artists.md)
5
+ - **Pools**
6
+ - [Posts](Posts.md)
7
+ - [Post Sets](PostSets.md)
8
+ - [Tags](Tags.md)
9
+ - [User Feedback](UserFeedback.md)
10
+ - [Users](Users.md)
11
+ - [Wiki Pages](WikiPages.md)
12
+
13
+ <hr>
14
+
15
+ | Feature | Implemented | Method |
16
+ |:------------------:|:-----------:|:---------------------:|
17
+ | Get By ID | ✔️ | `pools.get` |
18
+ | Get By Name | ✔️ | `pools.getByName` |
19
+ | Search | ✔️ | `pools.search` |
20
+ | Create[^1] | ✔️ | `pools.create` |
21
+ | Modify[^1] | ✔️ | `pools.modify` |
22
+ | Delete[^1][^3] | ✔️ | `pools.delete` |
23
+ | Revert[^1] | ✔️ | `pools.revert` |
24
+ | Search History[^1] | ✔️ | `pools.searchHistory` |
25
+ | Add Post[^1] | ✔️ | `pools.addPost` |
26
+ | Remove Post[^1] | ✔️ | `pools.removePost` |
27
+
28
+ [^1]: Requires Authentication
29
+ [^2]: Requires Privileged
30
+ [^3]: Requires Janitor
31
+ [^4]: Requires Moderator
32
+ [^5]: Requires Admin
@@ -0,0 +1,31 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - [Future Plans](FuturePlans.md)
4
+ - [Artists](Artists.md)
5
+ - [Pools](Pools.md)
6
+ - [Posts](Posts.md)
7
+ - **Post Sets**
8
+ - [Tags](Tags.md)
9
+ - [User Feedback](UserFeedback.md)
10
+ - [Users](Users.md)
11
+ - [Wiki Pages](WikiPages.md)
12
+
13
+ <hr>
14
+
15
+ | Feature | Implemented | Method |
16
+ |:-----------------:|:-----------:|:-------------------------:|
17
+ | Get By ID | ✔️ | `postSets.get` |
18
+ | Get By Name | ✔️ | `postSets.getByName` |
19
+ | Get By Short Name | ✔️ | `postSets.getByShortName` |
20
+ | Search | ✔️ | `postSets.search` |
21
+ | Create[^1] | ✔️ | `postSets.create` |
22
+ | Modify[^1] | ✔️ | `postSets.modify` |
23
+ | Delete[^1] | ✔️ | `postSets.delete` |
24
+ | Add Post[^1] | ✔️ | `postSets.addPost` |
25
+ | Remove Post[^1] | ✔️ | `postSets.removePost` |
26
+
27
+ [^1]: Requires Authentication
28
+ [^2]: Requires Privileged
29
+ [^3]: Requires Janitor
30
+ [^4]: Requires Moderator
31
+ [^5]: Requires Admin
@@ -0,0 +1,38 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - [Future Plans](FuturePlans.md)
4
+ - [Artists](Artists.md)
5
+ - [Pools](Pools.md)
6
+ - **Posts**
7
+ - [Post Sets](PostSets.md)
8
+ - [Tags](Tags.md)
9
+ - [User Feedback](UserFeedback.md)
10
+ - [Users](Users.md)
11
+ - [Wiki Pages](WikiPages.md)
12
+
13
+ <hr>
14
+
15
+ | Feature | Implemented | Method |
16
+ |:-----------------------------:|:-----------:|:----------------------:|
17
+ | Get By ID | ✔️ | `posts.get` |
18
+ | Get By Name | ✔️ | `posts.getByName` |
19
+ | Search | ✔️ | `posts.search` |
20
+ | Create[^1] | ✔️ | `posts.create` |
21
+ | Modify[^1] | ✔️ | `posts.modify` |
22
+ | Delete[^1][^3] | ✖️ | N/A |
23
+ | Approve[^1][^3] | ✖️ | N/A |
24
+ | Unapprove[^1][^3] | ✖️ | N/A |
25
+ | Destroy[^1][^5] | ✖️ | N/A |
26
+ | Regenerate Thumbnails[^1][^3] | ✖️ | N/A |
27
+ | Regenerate Videos[^1][^3] | ✖️ | N/A |
28
+ | Revert[^1] | ✔️ | `posts.revert` |
29
+ | Search History[^1] | ✔️ | `posts.searchHistory` |
30
+ | Vote[^1] | ✔️ | `posts.vote` |
31
+ | Add Favorite[^1] | ✔️ | `users.addFavorite` |
32
+ | Remove Favorite[^1] | ✔️ | `users.removeFavorite` |
33
+
34
+ [^1]: Requires Authentication
35
+ [^2]: Requires Privileged
36
+ [^3]: Requires Janitor
37
+ [^4]: Requires Moderator
38
+ [^5]: Requires Admin
@@ -0,0 +1,11 @@
1
+ ## Table Of Contents
2
+ - **Index**
3
+ - [Future Plans](FuturePlans.md)
4
+ - [Artists](Artists.md)
5
+ - [Pools](Pools.md)
6
+ - [Posts](Posts.md)
7
+ - [Post Sets](PostSets.md)
8
+ - [Tags](Tags.md)
9
+ - [User Feedback](UserFeedback.md)
10
+ - [Users](Users.md)
11
+ - [Wiki Pages](WikiPages.md)
@@ -0,0 +1,27 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - [Future Plans](FuturePlans.md)
4
+ - [Artists](Artists.md)
5
+ - [Pools](Pools.md)
6
+ - [Posts](Posts.md)
7
+ - [Post Sets](PostSets.md)
8
+ - **Tags**
9
+ - [User Feedback](UserFeedback.md)
10
+ - [Users](Users.md)
11
+ - [Wiki Pages](WikiPages.md)
12
+
13
+ <hr>
14
+
15
+ | Feature | Implemented | Method |
16
+ |:--------------:|:-----------:|:--------------------:|
17
+ | Get By ID | ✔️ | `tags.get` |
18
+ | Get By Name | ✔️ | `tags.getByName` |
19
+ | Search | ✔️ | `tags.search` |
20
+ | Modify[^1] | ✔️ | `tags.modify` |
21
+ | Search History | ✔️ | `tags.searchHistory` |
22
+
23
+ [^1]: Requires Authentication
24
+ [^2]: Requires Privileged
25
+ [^3]: Requires Janitor
26
+ [^4]: Requires Moderator
27
+ [^5]: Requires Admin
@@ -0,0 +1,27 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - [Future Plans](FuturePlans.md)
4
+ - [Artists](Artists.md)
5
+ - [Pools](Pools.md)
6
+ - [Posts](Posts.md)
7
+ - [Post Sets](PostSets.md)
8
+ - [Tags](Tags.md)
9
+ - **User Feedback**
10
+ - [Users](Users.md)
11
+ - [Wiki Pages](WikiPages.md)
12
+
13
+ <hr>
14
+
15
+ | Feature | Implemented | Method |
16
+ |:--------------:|:-----------:|:---------------------:|
17
+ | Get By ID | ✔️ | `userFeedback.get` |
18
+ | Search | ✔️ | `userFeedback.search` |
19
+ | Create[^1][^4] | ✔️ | `userFeedback.create` |
20
+ | Modify[^1][^4] | ✔️ | `userFeedback.modify` |
21
+ | Delete[^1][^4] | ✔️ | `userFeedback.delete` |
22
+
23
+ [^1]: Requires Authentication
24
+ [^2]: Requires Privileged
25
+ [^3]: Requires Janitor
26
+ [^4]: Requires Moderator
27
+ [^5]: Requires Admin
@@ -0,0 +1,31 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - [Future Plans](FuturePlans.md)
4
+ - [Artists](Artists.md)
5
+ - [Pools](Pools.md)
6
+ - [Posts](Posts.md)
7
+ - [Post Sets](PostSets.md)
8
+ - [Tags](Tags.md)
9
+ - [User Feedback](UserFeedback.md)
10
+ - **Users**
11
+ - [Wiki Pages](WikiPages.md)
12
+
13
+ <hr>
14
+
15
+ | Feature | Implemented | Method |
16
+ |:---------------------------:|:-----------:|:----------------------:|
17
+ | Get By ID | ✔️ | `users.get` |
18
+ | Get By Name | ✔️ | `users.getByName` |
19
+ | Search | ✔️ | `users.search` |
20
+ | Get Authenticated User[^1] | ✔️ | `users.getSelf` |
21
+ | Edit Authenticated User[^1] | ✔️ | `users.editSelf` |
22
+ | Get Upload Limit[^1] | ✔️ | `users.getUploadLimit` |
23
+ | Get Favorites[^1] | ✔️ | `users.getFavorites` |
24
+ | Add Favorite[^1] | ✔️ | `users.addFavorite` |
25
+ | Remove Favorite[^1] | ✔️ | `users.removeFavorite` |
26
+
27
+ [^1]: Requires Authentication
28
+ [^2]: Requires Privileged
29
+ [^3]: Requires Janitor
30
+ [^4]: Requires Moderator
31
+ [^5]: Requires Admin
@@ -0,0 +1,30 @@
1
+ ## Table Of Contents
2
+ - [Index](README.md)
3
+ - [Future Plans](FuturePlans.md)
4
+ - [Artists](Artists.md)
5
+ - [Pools](Pools.md)
6
+ - [Posts](Posts.md)
7
+ - [Post Sets](PostSets.md)
8
+ - [Tags](Tags.md)
9
+ - [User Feedback](UserFeedback.md)
10
+ - [Users](Users.md)
11
+ - **Wiki Pages**
12
+
13
+ <hr>
14
+
15
+ | Feature | Implemented | Method |
16
+ |:--------------:|:-----------:|:-------------------------:|
17
+ | Get By ID | ✔️ | `wikiPages.get` |
18
+ | Get By Title | ✔️ | `wikiPages.getByTitle` |
19
+ | Search | ✔️ | `wikiPages.search` |
20
+ | Create[^1] | ✔️ | `wikiPages.create` |
21
+ | Modify[^1] | ✔️ | `wikiPages.modify` |
22
+ | Delete[^1][^3] | ✔️ | `wikiPages.delete` |
23
+ | Revert[^1] | ✔️ | `wikiPages.revert` |
24
+ | Search History | ✔️ | `wikiPages.searchHistory` |
25
+
26
+ [^1]: Requires Authentication
27
+ [^2]: Requires Privileged
28
+ [^3]: Requires Janitor
29
+ [^4]: Requires Moderator
30
+ [^5]: Requires Admin
package/README.md CHANGED
@@ -4,25 +4,7 @@ The most comprehensive wrapper for e621 you'll ever find.
4
4
 
5
5
  We support almost anything normal users can do, with plans to bring everything else in, and more later in development.
6
6
 
7
- ### Features:
8
- - [x] Creating Posts (Buffer & URL)
9
- - [x] Listing/Creating/Editing/Voting On/Favoriting Posts
10
- - [x] Listing/Creating/Editing/Deleting/Modifying/Adding To/Removing From Post Sets
11
- - [x] Listing/Creating/Editing/Deleting/Modifying/Adding To/Removing From Pools
12
- - [x] Listing/Creating/Deleting/Editing User Feedback
13
- - [x] Reverting Pool Changes
14
- - [x] Listing Post History
15
- - [x] Editing The Authenticated User (all properties minus password and email)
16
- - [ ] Deleting/Approving/Unapproving/Destroying Posts
17
- - [ ] Creating/Solving/Deleting Post Flags
18
- - [ ] Listing/Creating/Editing/Deleting/Modifying Wiki Pages
19
- - [ ] Listing/Creating/Editing/Deleting/Modifying Artists
20
- - [ ] Listing/Editing/Deleting/Modifying Tags
21
- - [ ] General Janitorial/Moderative/Admninistrative Actions
22
- - [ ] More Planned!
23
-
24
- ### Not Planned:
25
- - Dmails (routes do not support json, and I'm not scraping html)
7
+ See the [Features List](Features/README.md) for all of the things this module supports, and what is planned.
26
8
 
27
9
  <hr>
28
10
 
@@ -55,70 +37,3 @@ Most of these options shouldn't be used unless you know what you're doing (you p
55
37
  | `instanceSSL` | Boolean | true | [See Code](https://github.com/DonovanDMC/E621/blob/89d662f19dc76c77e28f40b18a96f9043c4e2a3a/src/types/index.d.ts#L03) |
56
38
  | `instancePort` | Number | 443 | [See Code](https://github.com/DonovanDMC/E621/blob/89d662f19dc76c77e28f40b18a96f9043c4e2a3a/src/types/index.d.ts#L9) |
57
39
  | `instanceHost` | String | e621.net | [See Code](https://github.com/DonovanDMC/E621/blob/89d662f19dc76c77e28f40b18a96f9043c4e2a3a/src/types/index.d.ts#L15) |
58
-
59
- A map of features we support to their methods is listed below.
60
-
61
- ## Methods
62
- The legend for the symbols can be found after the table.
63
- | Section | Description | Location |
64
- |:---:|:---:|:---:|
65
- | Pools | Get Pool | `pools.get` |
66
- | Pools | Get Pool By Name | `pools.getByName` |
67
- | Pools | Search Pools | `pools.search` |
68
- | Pools | Create Pool* | `pools.create` |
69
- | Pools | Modify Pool* | `pools.modify` |
70
- | Pools | Delete Pool^ | `pools.delete` |
71
- | Pools | Revert Pool* | `pools.revert` |
72
- | Pools | Search Pool History | `pools.searchHistory` |
73
- | Pools | Add Post To Pool | `pools.addPost` |
74
- | Pools | Remove Post From Pool | `pools.removePost` |
75
- | Type | Description | Location |
76
- | Posts | Get Post By ID | `posts.get` |
77
- | Posts | Get Post By MD5 | `posts.getByMD5` |
78
- | Posts | Search Posts | `posts.search` |
79
- | Posts | Create Post* | `posts.create` |
80
- | Posts | Modify Post* | `posts.modify` |
81
- | Posts | Vote On Post* | `posts.vote` |
82
- | Posts | Revert Post* | `posts.revert` |
83
- | Posts | Search Post History | `posts.searchHistory` |
84
- | Type | Description | Location |
85
- | Post Sets | Get Post Set | `postSets.get` |
86
- | Post Sets | Search Sets | `postSets.search` |
87
- | Post Sets | Create Post Set* | `postSets.create` |
88
- | Post Sets | Modify Post Set* | `postSets.modify` |
89
- | Post Sets | Delete Post Set* | `postSets.delete` |
90
- | Post Sets | Add Post To Set* | `postSets.addPost` |
91
- | Post Sets | Remove Post From Set* | `postSets.removePost` |
92
- | Type | Description | Location |
93
- | User Feedback | Get Feedback | `userFeedback.get` |
94
- | User Feedback | Search Feedback | `userFeedback.search` |
95
- | User Feedback | Create Feedback# | `userFeedback.create` |
96
- | User Feedback | Modify Feedback# | `userFeedback.modify` |
97
- | User Feedback | Delete Feedback# | `userFeedback.delete` |
98
- | Type | Description | Location |
99
- | Users | Get User (ID/Name) | `users.get` |
100
- | Users | Search Users | `users.search` |
101
- | Users | Get Authenticated User* | `users.getSelf` |
102
- | Users | Edit Authenticated User* | `users.editSelf` |
103
- | Users | Get Upload Limit* | `users.getUploadLimit` |
104
- | Users | Get Favorites | `users.getFavorites` |
105
- | Users | Add Favorite* | `users.addFavorite` |
106
- | Users | Remove Favorite* | `users.removeFavorite` |
107
- | Type | Description | Location |
108
- | Wiki Page | Get Wiki Page | `wikiPages.get` |
109
- | Wiki Page | Get Wiki Page (By Name) | `wikiPages.getByName` |
110
- | Wiki Page | Search Wiki Pages | `wikiPages.search` |
111
- | Wiki Page | Create Wiki Page* | `wikiPages.create` |
112
- | Wiki Page | Modify Wiki Page* | `wikiPages.modify` |
113
- | Wiki Page | Delete Wiki Page^ | `wikiPages.delete` |
114
- | Wiki Page | Revert Wiki Page* | `wikiPages.revert` |
115
- | Wiki Page | Search Wiki Page History | `wikiPages.searchHistory` |
116
-
117
- #### Method Symbol Legend
118
- | Symbol | Meaning |
119
- |:------:|:-----------------------:|
120
- | * | Requires Authentication |
121
- | $ | Requires Privileged |
122
- | ^ | Requires Janitor |
123
- | # | Requires Moderator |
124
- | & | Requires Admin |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "e621",
3
- "version": "2.0.2",
3
+ "version": "2.1.2",
4
4
  "description": "A module for interfacing with e621.",
5
5
  "main": "build/src/index.js",
6
6
  "scripts": {
@@ -28,9 +28,17 @@
28
28
  },
29
29
  "homepage": "https://github.com/DonovanDMC/E621#readme",
30
30
  "devDependencies": {
31
- "@uwu-codes/eslint-config": "^1.0.25",
31
+ "@types/chai": "^4.3.0",
32
+ "@types/debug": "^4.1.7",
33
+ "@types/mocha": "^9.0.0",
34
+ "@uwu-codes/eslint-config": "^1.0.31",
32
35
  "@uwu-codes/tsconfig": "^1.0.1",
33
- "ts-node": "^10.3.0",
34
- "typescript": "^4.4.4"
36
+ "chai": "^4.3.4",
37
+ "mocha": "^9.1.3",
38
+ "ts-node": "^10.4.0",
39
+ "typescript": "^4.5.4"
40
+ },
41
+ "dependencies": {
42
+ "debug": "^4.3.3"
35
43
  }
36
44
  }
@@ -1,25 +1,34 @@
1
1
  import type { Options, InstanceOptions } from "./types";
2
2
  import RequestHandler from "./util/RequestHandler";
3
+ import Artists from "./modules/Artists";
4
+ import Pools from "./modules/Pools";
3
5
  import Posts from "./modules/Posts";
6
+ import PostSets from "./modules/PostSets";
7
+ import Tags from "./modules/Tags";
4
8
  import UserFeedback from "./modules/UserFeedback";
5
9
  import Users from "./modules/Users";
6
- import PostSets from "./modules/PostSets";
7
- import Pools from "./modules/Pools";
8
10
  import WikiPages from "./modules/WikiPages";
11
+ import Artist from "./structures/Artist";
12
+ import ArtistHistory from "./structures/ArtistHistory";
9
13
  import AuthenticatedUser from "./structures/AuthenticatedUser";
10
14
  import Pool from "./structures/Pool";
11
15
  import PoolHistory from "./structures/PoolHistory";
12
16
  import Post from "./structures/Post";
13
17
  import PostHistory from "./structures/PostHistory";
14
18
  import PostSet from "./structures/PostSet";
19
+ import Tag from "./structures/Tag";
20
+ import TagHistory from "./structures/TagHistory";
15
21
  import User from "./structures/User";
16
22
  import WikiPage from "./structures/WikiPage";
17
23
  import WikiPageHistory from "./structures/WikiPageHistory";
18
24
  export default class E621 {
25
+ POST_LIMIT_PER_REQUEST: number;
19
26
  request: RequestHandler;
20
- postSets: PostSets;
27
+ artists: Artists;
21
28
  pools: Pools;
22
29
  posts: Posts;
30
+ postSets: PostSets;
31
+ tags: Tags;
23
32
  userFeedback: UserFeedback;
24
33
  users: Users;
25
34
  wikiPages: WikiPages;
@@ -29,4 +38,4 @@ export default class E621 {
29
38
  }
30
39
  export * from "./types";
31
40
  export { APIError } from "./util/RequestHandler";
32
- export { AuthenticatedUser, Pool, PoolHistory, Post, PostHistory, PostSet, User, WikiPage, WikiPageHistory };
41
+ export { Artist, ArtistHistory, AuthenticatedUser, Pool, PoolHistory, Post, PostHistory, PostSet, Tag, TagHistory, User, WikiPage, WikiPageHistory };
@@ -13,16 +13,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.WikiPageHistory = exports.WikiPage = exports.User = exports.PostSet = exports.PostHistory = exports.Post = exports.PoolHistory = exports.Pool = exports.AuthenticatedUser = exports.APIError = void 0;
16
+ exports.WikiPageHistory = exports.WikiPage = exports.User = exports.TagHistory = exports.Tag = exports.PostSet = exports.PostHistory = exports.Post = exports.PoolHistory = exports.Pool = exports.AuthenticatedUser = exports.ArtistHistory = exports.Artist = exports.APIError = void 0;
17
17
  const RequestHandler_1 = __importDefault(require("./util/RequestHandler"));
18
18
  // Modules
19
+ const Artists_1 = __importDefault(require("./modules/Artists"));
20
+ const Pools_1 = __importDefault(require("./modules/Pools"));
19
21
  const Posts_1 = __importDefault(require("./modules/Posts"));
22
+ const PostSets_1 = __importDefault(require("./modules/PostSets"));
23
+ const Tags_1 = __importDefault(require("./modules/Tags"));
20
24
  const UserFeedback_1 = __importDefault(require("./modules/UserFeedback"));
21
25
  const Users_1 = __importDefault(require("./modules/Users"));
22
- const PostSets_1 = __importDefault(require("./modules/PostSets"));
23
- const Pools_1 = __importDefault(require("./modules/Pools"));
24
26
  const WikiPages_1 = __importDefault(require("./modules/WikiPages"));
25
27
  // Structures
28
+ const Artist_1 = __importDefault(require("./structures/Artist"));
29
+ exports.Artist = Artist_1.default;
30
+ const ArtistHistory_1 = __importDefault(require("./structures/ArtistHistory"));
31
+ exports.ArtistHistory = ArtistHistory_1.default;
26
32
  const AuthenticatedUser_1 = __importDefault(require("./structures/AuthenticatedUser"));
27
33
  exports.AuthenticatedUser = AuthenticatedUser_1.default;
28
34
  const Pool_1 = __importDefault(require("./structures/Pool"));
@@ -35,6 +41,10 @@ const PostHistory_1 = __importDefault(require("./structures/PostHistory"));
35
41
  exports.PostHistory = PostHistory_1.default;
36
42
  const PostSet_1 = __importDefault(require("./structures/PostSet"));
37
43
  exports.PostSet = PostSet_1.default;
44
+ const Tag_1 = __importDefault(require("./structures/Tag"));
45
+ exports.Tag = Tag_1.default;
46
+ const TagHistory_1 = __importDefault(require("./structures/TagHistory"));
47
+ exports.TagHistory = TagHistory_1.default;
38
48
  const User_1 = __importDefault(require("./structures/User"));
39
49
  exports.User = User_1.default;
40
50
  const WikiPage_1 = __importDefault(require("./structures/WikiPage"));
@@ -45,10 +55,13 @@ const package_json_1 = __importDefault(require("../package.json"));
45
55
  // note for future reference (browser compatibility?)
46
56
  // POST with "_method=*" can be used in place of PUT/PATCH/DELETE
47
57
  class E621 {
58
+ POST_LIMIT_PER_REQUEST = 320;
48
59
  request = new RequestHandler_1.default(this);
49
- postSets = new PostSets_1.default(this);
60
+ artists = new Artists_1.default(this);
50
61
  pools = new Pools_1.default(this);
51
62
  posts = new Posts_1.default(this);
63
+ postSets = new PostSets_1.default(this);
64
+ tags = new Tags_1.default(this);
52
65
  userFeedback = new UserFeedback_1.default(this);
53
66
  users = new Users_1.default(this);
54
67
  wikiPages = new WikiPages_1.default(this);
@@ -71,6 +84,7 @@ class E621 {
71
84
  options.imageReconstructionType = "yiffy";
72
85
  break;
73
86
  case "e621.local":
87
+ case "localhost":
74
88
  options.imageReconstructionType = "dev";
75
89
  break;
76
90
  default: {
@@ -110,4 +124,4 @@ class E621 {
110
124
  exports.default = E621;
111
125
  var RequestHandler_2 = require("./util/RequestHandler");
112
126
  Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return RequestHandler_2.APIError; } });
113
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcm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Cx1QkFBdUIsRUFBRSxPQUFPLENBQUMsdUJBQXVCLElBQUksV0FBVztvQkFDdkUsU0FBUyxFQUFFLE9BQU8sQ0FBQyxTQUFTLElBQUksUUFBUSxzQkFBRyxDQUFDLE9BQU8sdUNBQXVDLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxNQUFNLE9BQU8sQ0FBQyxRQUFRLEdBQUcsR0FBRztvQkFDL0ksY0FBYyxFQUFFLE9BQU8sQ0FBQyxjQUFjLElBQUksRUFBRTtpQkFDNUM7Z0JBQ0QsWUFBWSxFQUFFLEtBQUs7Z0JBQ25CLFVBQVUsRUFBRSxLQUFLO2dCQUNqQixRQUFRLEVBQUUsS0FBSzthQUNmO1NBQ0QsQ0FBQyxDQUFDO0lBQ0osQ0FBQztDQUNEO0FBekRELHVCQXlEQztBQUNELDBDQUF3QjtBQUN4Qix3REFBaUQ7QUFBeEMsMEdBQUEsUUFBUSxPQUFBIn0=
@@ -0,0 +1,108 @@
1
+ import type E621 from "..";
2
+ import Artist from "../structures/Artist";
3
+ import type { SearchArtistsOptions, CreateArtistOptions, ModifyArtistOptions, SearchArtistHistoryOptions } from "../types";
4
+ import ArtistHistory from "../structures/ArtistHistory";
5
+ export default class Artists {
6
+ private readonly auth;
7
+ private readonly main;
8
+ constructor(main: E621);
9
+ /**
10
+ * Get an artist by their id
11
+ *
12
+ * @param {number} id - The id of the artist to get
13
+ * @returns {Promise<(Artist | null)>}
14
+ */
15
+ get(id: number): Promise<Artist | null>;
16
+ /**
17
+ * Get an artist by their name
18
+ *
19
+ * @param {string} name - The name of the artist to get
20
+ * @returns {Promise<(Artist | null)>}
21
+ */
22
+ getByName(name: string): Promise<Artist | null>;
23
+ /**
24
+ * Search for artists
25
+ *
26
+ * @param {object} [options]
27
+ * @param {string} [options.name] - narrow the results by the name of the artist
28
+ * @param {string} [options.url] - narrow the results by urls of the artist
29
+ * @param {string} [options.creator] - narrow the results by the (name of the) creator of the artist page
30
+ * @param {boolean} [options.active] - narrow the results by the artist being active
31
+ * @param {boolean} [options.banned] - narrow the results by the artist being banned
32
+ * @param {boolean} [options.has_tag] - narrow the results by the artist having a matching tag
33
+ * @param {SearchArtistsOrder} [options.order] - the order of the results
34
+ * @param {(number |`${"" | "a" | "b"}${number}`)} [options.page] - page of results to get
35
+ * @param {number} [options.limit] - limit the maximum amount of results returned
36
+ * @returns {Promise<Array<ArtistProperties>>}
37
+ */
38
+ search(options?: SearchArtistsOptions): Promise<Artist[]>;
39
+ /**
40
+ * Create an artist
41
+ *
42
+ * * Requires Authentication
43
+ *
44
+ * @param {object} options
45
+ * @param {string} options.name - the name of artist
46
+ * @param {number} [options.linkedUserID] - the id of the user associated with this artist (requires janitor)
47
+ * @param {boolean} [options.locked] - if the artist should be locked (requires janitor)
48
+ * @param {(Array<string> | string)} [options.otherNames] - the other names for this artist
49
+ * @param {string} [options.groupName] - the group name of this artist
50
+ * @param {(Array<string> | string)} [options.urls] - the urls associated with this artist
51
+ * @param {string} [options.notes] - notes for this artist
52
+ * @returns {Promise<Artist>}
53
+ */
54
+ create(options: CreateArtistOptions): Promise<Artist>;
55
+ /**
56
+ * modify an artist
57
+ *
58
+ * * Requires Authentication
59
+ *
60
+ * @param {number} id - the id of the artists to edit
61
+ * @param {object} options
62
+ * @param {string} [options.name] - the name of artist (requires janitor)
63
+ * @param {number} [options.linkedUserID] - the id of the user associated with this artist (requires janitor)
64
+ * @param {boolean} [options.locked] - if the artist should be locked (requires janitor)
65
+ * @param {(Array<string> | string)} [options.otherNames] - the other names for this artist
66
+ * @param {string} [options.groupName] - the group name of this artist
67
+ * @param {(Array<string> | string)} [options.urls] - the urls associated with this artist
68
+ * @param {string} [options.notes] - notes for this artist
69
+ * @returns {Promise<Artist>}
70
+ */
71
+ modify(id: number, options: ModifyArtistOptions): Promise<Artist>;
72
+ /**
73
+ * Delete an artist
74
+ *
75
+ * * Requires Authentication
76
+ *
77
+ * * Requires Janitor
78
+ *
79
+ * @param {number} id - the id of the artist to delete
80
+ * @returns {Promise<null>}
81
+ */
82
+ delete(id: number): Promise<null>;
83
+ /**
84
+ * Revert an artist to a previous version
85
+ *
86
+ * * Requires Authentication
87
+ *
88
+ * @param {number} id - the id of the artist to revert
89
+ * @param {number} versionID - the version id to revert to (see history)
90
+ */
91
+ revert(id: number, versionID: number): Promise<null>;
92
+ /**
93
+ * Search the artist history
94
+ *
95
+ * * Requires Authentication
96
+ *
97
+ * @param {object} [options]
98
+ * @param {number} [options.artistID] - narrow the results by artist id
99
+ * @param {string} [options.artistName] - narrow the results by artist name
100
+ * @param {number} [options.updaterID] - narrow the results by updater id
101
+ * @param {string} [options.updaterName] - narrow the results by updater name
102
+ * @param {(number |`${"" | "a" | "b"}${number}`)} [options.page] - page of results to get
103
+ * @param {number} [options.limit] - limit the maximum amount of results returned
104
+ * @param
105
+ * @returns {Promise<Array<ArtistHistory>>}
106
+ */
107
+ searchHistory(options?: SearchArtistHistoryOptions): Promise<ArtistHistory[]>;
108
+ }