shikimori-api 1.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 (90) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +20 -0
  3. data/lib/shikimori/api/client.rb +34 -0
  4. data/lib/shikimori/api/errors.rb +21 -0
  5. data/lib/shikimori/api/rest.rb +115 -0
  6. data/lib/shikimori/api/uri.rb +18 -0
  7. data/lib/shikimori/api/v1/achievements.rb +32 -0
  8. data/lib/shikimori/api/v1/animes.rb +252 -0
  9. data/lib/shikimori/api/v1/appear.rb +40 -0
  10. data/lib/shikimori/api/v1/bans.rb +31 -0
  11. data/lib/shikimori/api/v1/calendars.rb +32 -0
  12. data/lib/shikimori/api/v1/characters.rb +52 -0
  13. data/lib/shikimori/api/v1/clubs.rb +329 -0
  14. data/lib/shikimori/api/v1/comments.rb +161 -0
  15. data/lib/shikimori/api/v1/constants.rb +107 -0
  16. data/lib/shikimori/api/v1/dialogs.rb +78 -0
  17. data/lib/shikimori/api/v1/favorites.rb +148 -0
  18. data/lib/shikimori/api/v1/forums.rb +31 -0
  19. data/lib/shikimori/api/v1/friends.rb +57 -0
  20. data/lib/shikimori/api/v1/genres.rb +31 -0
  21. data/lib/shikimori/api/v1/ignores.rb +62 -0
  22. data/lib/shikimori/api/v1/mangas.rb +211 -0
  23. data/lib/shikimori/api/v1/messages.rb +168 -0
  24. data/lib/shikimori/api/v1/people.rb +53 -0
  25. data/lib/shikimori/api/v1/publishers.rb +31 -0
  26. data/lib/shikimori/api/v1/ranobe.rb +206 -0
  27. data/lib/shikimori/api/v1/reviews.rb +89 -0
  28. data/lib/shikimori/api/v1/stats.rb +31 -0
  29. data/lib/shikimori/api/v1/studios.rb +31 -0
  30. data/lib/shikimori/api/v1/styles.rb +112 -0
  31. data/lib/shikimori/api/v1/topic_ignores.rb +63 -0
  32. data/lib/shikimori/api/v1/topics.rb +237 -0
  33. data/lib/shikimori/api/v1/user_images.rb +36 -0
  34. data/lib/shikimori/api/v1/user_rates.rb +194 -0
  35. data/lib/shikimori/api/v1/users.rb +310 -0
  36. data/lib/shikimori/api/v1/videos.rb +85 -0
  37. data/lib/shikimori/api/v1.rb +77 -0
  38. data/lib/shikimori/api/v2/abuse_requests.rb +103 -0
  39. data/lib/shikimori/api/v2/episode_notifications.rb +54 -0
  40. data/lib/shikimori/api/v2/topic_ignore.rb +54 -0
  41. data/lib/shikimori/api/v2/user_ignore.rb +54 -0
  42. data/lib/shikimori/api/v2/user_rates.rb +171 -0
  43. data/lib/shikimori/api/v2.rb +27 -0
  44. data/lib/shikimori/api/version.rb +8 -0
  45. data/lib/shikimori/api.rb +14 -0
  46. data/lib/shikimori-api.rb +3 -0
  47. data/shikimori-api.gemspec +40 -0
  48. data/sig/shikimori/api/client.rbs +12 -0
  49. data/sig/shikimori/api/rest.rbs +30 -0
  50. data/sig/shikimori/api/uri.rbs +10 -0
  51. data/sig/shikimori/api/v1/achievements.rbs +15 -0
  52. data/sig/shikimori/api/v1/animes.rbs +23 -0
  53. data/sig/shikimori/api/v1/appear.rbs +15 -0
  54. data/sig/shikimori/api/v1/bans.rbs +15 -0
  55. data/sig/shikimori/api/v1/calendars.rbs +15 -0
  56. data/sig/shikimori/api/v1/characters.rbs +16 -0
  57. data/sig/shikimori/api/v1/clubs.rbs +29 -0
  58. data/sig/shikimori/api/v1/comments.rbs +19 -0
  59. data/sig/shikimori/api/v1/constants.rbs +19 -0
  60. data/sig/shikimori/api/v1/dialogs.rbs +17 -0
  61. data/sig/shikimori/api/v1/favorites.rbs +23 -0
  62. data/sig/shikimori/api/v1/forums.rbs +15 -0
  63. data/sig/shikimori/api/v1/friends.rbs +16 -0
  64. data/sig/shikimori/api/v1/genres.rbs +15 -0
  65. data/sig/shikimori/api/v1/ignores.rbs +16 -0
  66. data/sig/shikimori/api/v1/mangas.rbs +23 -0
  67. data/sig/shikimori/api/v1/messages.rbs +20 -0
  68. data/sig/shikimori/api/v1/people.rbs +16 -0
  69. data/sig/shikimori/api/v1/publishers.rbs +15 -0
  70. data/sig/shikimori/api/v1/ranobe.rbs +23 -0
  71. data/sig/shikimori/api/v1/reviews.rbs +19 -0
  72. data/sig/shikimori/api/v1/stats.rbs +15 -0
  73. data/sig/shikimori/api/v1/studios.rbs +15 -0
  74. data/sig/shikimori/api/v1/styles.rbs +18 -0
  75. data/sig/shikimori/api/v1/topic_ignores.rbs +16 -0
  76. data/sig/shikimori/api/v1/topics.rbs +40 -0
  77. data/sig/shikimori/api/v1/user_images.rbs +15 -0
  78. data/sig/shikimori/api/v1/user_rates.rbs +44 -0
  79. data/sig/shikimori/api/v1/users.rbs +28 -0
  80. data/sig/shikimori/api/v1/videos.rbs +23 -0
  81. data/sig/shikimori/api/v1.rbs +41 -0
  82. data/sig/shikimori/api/v2/abuse_requests.rbs +18 -0
  83. data/sig/shikimori/api/v2/episode_notifications.rbs +25 -0
  84. data/sig/shikimori/api/v2/topic_ignore.rbs +16 -0
  85. data/sig/shikimori/api/v2/user_ignore.rbs +16 -0
  86. data/sig/shikimori/api/v2/user_rates.rbs +43 -0
  87. data/sig/shikimori/api/v2.rbs +16 -0
  88. data/sig/shikimori/api/version.rbs +5 -0
  89. data/sig/shikimori/api.rbs +18 -0
  90. metadata +137 -0
@@ -0,0 +1,23 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Mangas
5
+ attr_reader rest: REST
6
+
7
+ def mangas: (?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def manga: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
9
+ def manga_roles: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
10
+ def manga_similar: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
11
+ def manga_related: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
12
+ def manga_screenshots: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
13
+ def manga_franchise: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
14
+ def manga_external_links: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
15
+ def manga_topics: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
16
+
17
+ private
18
+
19
+ def base_url: -> ::Shikimori::API::URI
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Messages
5
+ attr_reader rest: REST
6
+
7
+ def message: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def create_message: ({ body: String, from_id: Integer, to_id: Integer, kind: 'Private' | nil }, ?frontend: 'false' | 'true' | 1 | 0 | nil, ?headers: Hash[String, String] | nil, **untyped) -> untyped
9
+ def update_message: (_ToS, { body: String }, ?headers: Hash[String, String] | nil, **untyped) -> untyped
10
+ def delete_message: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
11
+ def read_all_messages: (type: 'news' | 'notifications', ?frontend: 'false' | 'true' | 1 | 0 | nil, ?headers: Hash[String, String] | nil, **untyped) -> untyped
12
+ def delete_all_messages: (type: 'news' | 'notifications', ?frontend: 'false' | 'true' | 1 | 0 | nil, ?headers: Hash[String, String] | nil, **untyped) -> untyped
13
+
14
+ private
15
+
16
+ def base_url: -> ::Shikimori::API::URI
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module People
5
+ attr_reader rest: REST
6
+
7
+ def people: (?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def person: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
9
+
10
+ private
11
+
12
+ def base_url: -> ::Shikimori::API::URI
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Publishers
5
+ attr_reader rest: REST
6
+
7
+ def publishers: (?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+
9
+ private
10
+
11
+ def base_url: -> ::Shikimori::API::URI
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Ranobe
5
+ attr_reader rest: REST
6
+
7
+ def ranobes: (?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def ranobe: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
9
+ def ranobe_roles: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
10
+ def ranobe_similar: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
11
+ def ranobe_related: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
12
+ def ranobe_screenshots: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
13
+ def ranobe_franchise: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
14
+ def ranobe_external_links: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
15
+ def ranobe_topics: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
16
+
17
+ private
18
+
19
+ def base_url: -> ::Shikimori::API::URI
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Reviews
5
+ attr_reader rest: REST
6
+
7
+ type opinions = 'positive' | 'neutral' | 'negative'
8
+
9
+ def create_review: ({ body: String, anime_id: Integer, opinion: opinions }, ?frontend: 'true' | 'false' | 0 | 1 | nil, ?headers: Hash[String, String] | nil, **untyped) -> untyped
10
+ def update_review: (_ToS, { body: String, opinion: opinions }, ?frontend: 'true' | 'false' | 0 | 1 | nil, ?headers: Hash[String, String] | nil, **untyped) -> untyped
11
+ def delete_review: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
12
+
13
+ private
14
+
15
+ def base_url: -> ::Shikimori::API::URI
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Stats
5
+ attr_reader rest: REST
6
+
7
+ def active_users: (?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+
9
+ private
10
+
11
+ def base_url: -> ::Shikimori::API::URI
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Studios
5
+ attr_reader rest: REST
6
+
7
+ def studios: (?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+
9
+ private
10
+
11
+ def base_url: -> ::Shikimori::API::URI
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Styles
5
+ attr_reader rest: REST
6
+
7
+ def style: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def create_style: ({ css: String, name: String, owner_id: Integer, owner_type: 'User' | 'Club' }, ?headers: Hash[String, String] | nil, **untyped) -> untyped
9
+ def update_style: (_ToS, { css: String, name: String }, ?headers: Hash[String, String] | nil, **untyped) -> untyped
10
+ def preview_style: ({ css: String }, ?headers: Hash[String, String] | nil, **untyped) -> untyped
11
+
12
+ private
13
+
14
+ def base_url: -> ::Shikimori::API::URI
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module TopicIgnores
5
+ attr_reader rest: REST
6
+
7
+ def create_topic_ignore: (topic_id: _ToS, user_id: _ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def delete_topic_ignore: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
9
+
10
+ private
11
+
12
+ def base_url: -> ::Shikimori::API::URI
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,40 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Topics
5
+ attr_reader rest: REST
6
+
7
+ TOPIC_TYPES_MAP: Hash[String, String]
8
+
9
+ type creation_topic = {
10
+ title: String,
11
+ body: String,
12
+ linked_id: Integer,
13
+ linked_type: 'Anime' | 'Manga' | 'Ranobe' | 'Character' | 'Person' | 'Club' | 'ClubPage' | 'Critique' | 'Review' | 'Contest' | 'CosplayGallery' | 'Collection' | 'Article',
14
+ type: 'Topic',
15
+ forum_id: Integer,
16
+ user_id: Integer
17
+ }
18
+
19
+ type updation_topic = {
20
+ title: String,
21
+ body: String,
22
+ linked_id: Integer,
23
+ linked_type: 'Anime' | 'Manga' | 'Ranobe' | 'Character' | 'Person' | 'Club' | 'ClubPage' | 'Critique' | 'Review' | 'Contest' | 'CosplayGallery' | 'Collection' | 'Article',
24
+ }
25
+
26
+ def topics: (?type: String | nil, ?headers: Hash[String, String] | nil, **untyped) -> untyped
27
+ def topic: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
28
+ def create_topic: (creation_topic, ?headers: Hash[String, String] | nil, **untyped) -> untyped
29
+ def update_topic: (_ToS, updation_topic, ?headers: Hash[String, String] | nil, **untyped) -> untyped
30
+ def delete_topic: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
31
+ def topics_updates: (?headers: Hash[String, String] | nil, **untyped) -> untyped
32
+ def hot_topics: (?headers: Hash[String, String] | nil, **untyped) -> untyped
33
+
34
+ private
35
+
36
+ def base_url: -> ::Shikimori::API::URI
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,15 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module UserImages
5
+ attr_reader rest: REST
6
+
7
+ def create_user_image: (File, ?linked_type: 'Comment' | nil, ?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+
9
+ private
10
+
11
+ def base_url: -> ::Shikimori::API::URI
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,44 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module UserRates
5
+ attr_reader rest: REST
6
+
7
+ type user_rate_creation = {
8
+ user_id: Integer,
9
+ target_id: Integer,
10
+ target_type: 'Anime' | 'Manga',
11
+ status: String,
12
+ score: Numeric,
13
+ chapters: Numeric,
14
+ episodes: Numeric,
15
+ volumes: Numeric,
16
+ rewatches: Numeric,
17
+ text: String
18
+ }
19
+
20
+ type user_rate_updation = {
21
+ status: String,
22
+ score: Numeric,
23
+ chapters: Numeric,
24
+ episodes: Numeric,
25
+ volumes: Numeric,
26
+ rewatches: Numeric,
27
+ text: String
28
+ }
29
+
30
+ def user_rate: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
31
+ def create_user_rate: (user_rate_creation, ?headers: Hash[String, String] | nil, **untyped) -> untyped
32
+ def update_user_rate: (_ToS, user_rate_updation, ?headers: Hash[String, String] | nil, **untyped) -> untyped
33
+ def delete_user_rate: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
34
+ def increment_user_rate: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
35
+ def cleanup_user_rates: ('anime' | 'manga', ?headers: Hash[String, String] | nil, **untyped) -> bool
36
+ def reset_user_rates: ('anime' | 'manga', ?headers: Hash[String, String] | nil, **untyped) -> bool
37
+
38
+ private
39
+
40
+ def base_url: -> ::Shikimori::API::URI
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,28 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Users
5
+ attr_reader rest: REST
6
+
7
+ def users: (?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def user: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
9
+ def user_info: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
10
+ def whoami: (?headers: Hash[String, String] | nil, **untyped) -> untyped
11
+ def sign_out: (?headers: Hash[String, String] | nil, **untyped) -> untyped
12
+ def user_friends: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
13
+ def user_clubs: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
14
+ def user_anime_rates: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
15
+ def user_manga_rates: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
16
+ def user_favorites: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
17
+ def user_messages: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
18
+ def user_unread_messages: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
19
+ def user_history: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
20
+ def user_bans: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
21
+
22
+ private
23
+
24
+ def base_url: -> ::Shikimori::API::URI
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,23 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ module Videos
5
+ attr_reader rest: REST
6
+
7
+ type creation_video = {
8
+ name: String,
9
+ kind: 'pv' | 'character_trailer' | 'cm' | 'op' | 'ed' | 'op_ed_clip' | 'clip' | 'other' | 'episode_preview',
10
+ url: String,
11
+ }
12
+
13
+ def anime_videos: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
14
+ def create_anime_video: (_ToS, creation_video, ?headers: Hash[String, String] | nil, **untyped) -> untyped
15
+ def delete_anime_video: (anime_id: _ToS, video_id: _ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
16
+
17
+ private
18
+
19
+ def base_url: -> ::Shikimori::API::URI
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,41 @@
1
+ module Shikimori
2
+ module API
3
+ class V1
4
+ include Videos
5
+ include Users
6
+ include UserRates
7
+ include UserImages
8
+ include Topics
9
+ include TopicIgnores
10
+ include Styles
11
+ include Studios
12
+ include Stats
13
+ include Reviews
14
+ include Ranobe
15
+ include Publishers
16
+ include People
17
+ include Messages
18
+ include Mangas
19
+ include Ignores
20
+ include Genres
21
+ include Friends
22
+ include Forums
23
+ include Favorites
24
+ include Dialogs
25
+ include Constants
26
+ include Comments
27
+ include Clubs
28
+ include Characters
29
+ include Calendars
30
+ include Bans
31
+ include Appear
32
+ include Animes
33
+ include Achievements
34
+
35
+ attr_reader rest: REST
36
+ attr_reader base_url: ::Shikimori::API::URI
37
+
38
+ def initialize: (base_url: ::Shikimori::API::URI, rest: REST) -> void
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,18 @@
1
+ module Shikimori
2
+ module API
3
+ class V2
4
+ module AbuseRequests
5
+ attr_reader rest: REST
6
+
7
+ def abuse_offtopic_request: ({comment_id: Integer }, ?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def abuse_review_request: ({comment_id: Integer, topic_id: Integer }, ?headers: Hash[String, String] | nil, **untyped) -> untyped
9
+ def abuse_request: ({comment_id: Integer, topic_id: Integer, reason: String}, ?headers: Hash[String, String] | nil, **untyped) -> untyped
10
+ def abuse_spoiler_request: ({comment_id: Integer, topic_id: Integer, reason: String}, ?headers: Hash[String, String] | nil, **untyped) -> untyped
11
+
12
+ private
13
+
14
+ def base_url: -> ::Shikimori::API::URI
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,25 @@
1
+ module Shikimori
2
+ module API
3
+ class V2
4
+ module EpisodeNotifications
5
+ attr_reader rest: REST
6
+
7
+ type notification_creation = {
8
+ anime_id: Integer,
9
+ episode: Integer,
10
+ aired_at: String | DateTime,
11
+ is_fandub: 'true' | 'false' | 1 | 0,
12
+ is_raw: 'true' | 'false' | 1 | 0,
13
+ is_subtitles: 'true' | 'false' | 1 | 0,
14
+ is_anime365: 'true' | 'false' | 1 | 0,
15
+ }
16
+
17
+ def create_episode_notification: (notification_creation, token: String, ?headers: Hash[String, String] | nil, **untyped) -> untyped
18
+
19
+ private
20
+
21
+ def base_url: -> ::Shikimori::API::URI
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,16 @@
1
+ module Shikimori
2
+ module API
3
+ class V2
4
+ module TopicIgnore
5
+ attr_reader rest: REST
6
+
7
+ def create_topic_ignore: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def delete_topic_ignore: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
9
+
10
+ private
11
+
12
+ def base_url: -> ::Shikimori::API::URI
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Shikimori
2
+ module API
3
+ class V2
4
+ module UserIgnore
5
+ attr_reader rest: REST
6
+
7
+ def create_user_ignore: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
8
+ def delete_user_ignore: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
9
+
10
+ private
11
+
12
+ def base_url: -> ::Shikimori::API::URI
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,43 @@
1
+ module Shikimori
2
+ module API
3
+ class V2
4
+ module UserRates
5
+ attr_reader rest: REST
6
+
7
+ type user_rate_creation = {
8
+ user_id: Integer,
9
+ target_id: Integer,
10
+ target_type: 'Anime' | 'Manga',
11
+ status: String,
12
+ score: Numeric,
13
+ chapters: Numeric,
14
+ episodes: Numeric,
15
+ volumes: Numeric,
16
+ rewatches: Numeric,
17
+ text: String
18
+ }
19
+
20
+ type user_rate_updation = {
21
+ status: String,
22
+ score: Numeric,
23
+ chapters: Numeric,
24
+ episodes: Numeric,
25
+ volumes: Numeric,
26
+ rewatches: Numeric,
27
+ text: String
28
+ }
29
+
30
+ def user_rates: (?headers: Hash[String, String] | nil, **untyped) -> untyped
31
+ def user_rate: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
32
+ def create_user_rate: (user_rate_creation, ?headers: Hash[String, String] | nil, **untyped) -> untyped
33
+ def update_user_rate: (_ToS, user_rate_updation, ?headers: Hash[String, String] | nil, **untyped) -> untyped
34
+ def delete_user_rate: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
35
+ def increment_user_rate: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
36
+
37
+ private
38
+
39
+ def base_url: -> ::Shikimori::API::URI
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,16 @@
1
+ module Shikimori
2
+ module API
3
+ class V2
4
+ include AbuseRequests
5
+ include EpisodeNotifications
6
+ include TopicIgnore
7
+ include UserIgnore
8
+ include UserRates
9
+
10
+ attr_reader rest: REST
11
+ attr_reader base_url: ::Shikimori::API::URI
12
+
13
+ def initialize: (base_url: ::Shikimori::API::URI, rest: REST) -> void
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Shikimori
2
+ module API
3
+ VERSION: String
4
+ end
5
+ end
@@ -0,0 +1,18 @@
1
+ module Shikimori
2
+ module API
3
+ class RequestError < StandardError
4
+ end
5
+
6
+ class NotFoundError < RequestError
7
+ end
8
+
9
+ class ForbiddenError < RequestError
10
+ end
11
+
12
+ class BadRequestError < RequestError
13
+ attr_reader errors: Array[String]
14
+
15
+ def initialize: (Array[String] | { "errors" => Array[String] }) -> void
16
+ end
17
+ end
18
+ end