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.
- checksums.yaml +7 -0
- data/README.md +20 -0
- data/lib/shikimori/api/client.rb +34 -0
- data/lib/shikimori/api/errors.rb +21 -0
- data/lib/shikimori/api/rest.rb +115 -0
- data/lib/shikimori/api/uri.rb +18 -0
- data/lib/shikimori/api/v1/achievements.rb +32 -0
- data/lib/shikimori/api/v1/animes.rb +252 -0
- data/lib/shikimori/api/v1/appear.rb +40 -0
- data/lib/shikimori/api/v1/bans.rb +31 -0
- data/lib/shikimori/api/v1/calendars.rb +32 -0
- data/lib/shikimori/api/v1/characters.rb +52 -0
- data/lib/shikimori/api/v1/clubs.rb +329 -0
- data/lib/shikimori/api/v1/comments.rb +161 -0
- data/lib/shikimori/api/v1/constants.rb +107 -0
- data/lib/shikimori/api/v1/dialogs.rb +78 -0
- data/lib/shikimori/api/v1/favorites.rb +148 -0
- data/lib/shikimori/api/v1/forums.rb +31 -0
- data/lib/shikimori/api/v1/friends.rb +57 -0
- data/lib/shikimori/api/v1/genres.rb +31 -0
- data/lib/shikimori/api/v1/ignores.rb +62 -0
- data/lib/shikimori/api/v1/mangas.rb +211 -0
- data/lib/shikimori/api/v1/messages.rb +168 -0
- data/lib/shikimori/api/v1/people.rb +53 -0
- data/lib/shikimori/api/v1/publishers.rb +31 -0
- data/lib/shikimori/api/v1/ranobe.rb +206 -0
- data/lib/shikimori/api/v1/reviews.rb +89 -0
- data/lib/shikimori/api/v1/stats.rb +31 -0
- data/lib/shikimori/api/v1/studios.rb +31 -0
- data/lib/shikimori/api/v1/styles.rb +112 -0
- data/lib/shikimori/api/v1/topic_ignores.rb +63 -0
- data/lib/shikimori/api/v1/topics.rb +237 -0
- data/lib/shikimori/api/v1/user_images.rb +36 -0
- data/lib/shikimori/api/v1/user_rates.rb +194 -0
- data/lib/shikimori/api/v1/users.rb +310 -0
- data/lib/shikimori/api/v1/videos.rb +85 -0
- data/lib/shikimori/api/v1.rb +77 -0
- data/lib/shikimori/api/v2/abuse_requests.rb +103 -0
- data/lib/shikimori/api/v2/episode_notifications.rb +54 -0
- data/lib/shikimori/api/v2/topic_ignore.rb +54 -0
- data/lib/shikimori/api/v2/user_ignore.rb +54 -0
- data/lib/shikimori/api/v2/user_rates.rb +171 -0
- data/lib/shikimori/api/v2.rb +27 -0
- data/lib/shikimori/api/version.rb +8 -0
- data/lib/shikimori/api.rb +14 -0
- data/lib/shikimori-api.rb +3 -0
- data/shikimori-api.gemspec +40 -0
- data/sig/shikimori/api/client.rbs +12 -0
- data/sig/shikimori/api/rest.rbs +30 -0
- data/sig/shikimori/api/uri.rbs +10 -0
- data/sig/shikimori/api/v1/achievements.rbs +15 -0
- data/sig/shikimori/api/v1/animes.rbs +23 -0
- data/sig/shikimori/api/v1/appear.rbs +15 -0
- data/sig/shikimori/api/v1/bans.rbs +15 -0
- data/sig/shikimori/api/v1/calendars.rbs +15 -0
- data/sig/shikimori/api/v1/characters.rbs +16 -0
- data/sig/shikimori/api/v1/clubs.rbs +29 -0
- data/sig/shikimori/api/v1/comments.rbs +19 -0
- data/sig/shikimori/api/v1/constants.rbs +19 -0
- data/sig/shikimori/api/v1/dialogs.rbs +17 -0
- data/sig/shikimori/api/v1/favorites.rbs +23 -0
- data/sig/shikimori/api/v1/forums.rbs +15 -0
- data/sig/shikimori/api/v1/friends.rbs +16 -0
- data/sig/shikimori/api/v1/genres.rbs +15 -0
- data/sig/shikimori/api/v1/ignores.rbs +16 -0
- data/sig/shikimori/api/v1/mangas.rbs +23 -0
- data/sig/shikimori/api/v1/messages.rbs +20 -0
- data/sig/shikimori/api/v1/people.rbs +16 -0
- data/sig/shikimori/api/v1/publishers.rbs +15 -0
- data/sig/shikimori/api/v1/ranobe.rbs +23 -0
- data/sig/shikimori/api/v1/reviews.rbs +19 -0
- data/sig/shikimori/api/v1/stats.rbs +15 -0
- data/sig/shikimori/api/v1/studios.rbs +15 -0
- data/sig/shikimori/api/v1/styles.rbs +18 -0
- data/sig/shikimori/api/v1/topic_ignores.rbs +16 -0
- data/sig/shikimori/api/v1/topics.rbs +40 -0
- data/sig/shikimori/api/v1/user_images.rbs +15 -0
- data/sig/shikimori/api/v1/user_rates.rbs +44 -0
- data/sig/shikimori/api/v1/users.rbs +28 -0
- data/sig/shikimori/api/v1/videos.rbs +23 -0
- data/sig/shikimori/api/v1.rbs +41 -0
- data/sig/shikimori/api/v2/abuse_requests.rbs +18 -0
- data/sig/shikimori/api/v2/episode_notifications.rbs +25 -0
- data/sig/shikimori/api/v2/topic_ignore.rbs +16 -0
- data/sig/shikimori/api/v2/user_ignore.rbs +16 -0
- data/sig/shikimori/api/v2/user_rates.rbs +43 -0
- data/sig/shikimori/api/v2.rbs +16 -0
- data/sig/shikimori/api/version.rbs +5 -0
- data/sig/shikimori/api.rbs +18 -0
- metadata +137 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Shikimori
|
|
4
|
+
module API
|
|
5
|
+
class V2
|
|
6
|
+
# Methods for the User ignores API
|
|
7
|
+
#
|
|
8
|
+
# @see https://shikimori.one/api/doc/2.0/User%20Ignore Shikimori's API documentation
|
|
9
|
+
module UserIgnore
|
|
10
|
+
# Add user to ignore by id.
|
|
11
|
+
# Requires `ignores` oauth scope
|
|
12
|
+
#
|
|
13
|
+
# @param user_id [#to_s] User id
|
|
14
|
+
# @param headers [Hash] Request headers
|
|
15
|
+
# @param query [Hash] Query string parameters for request
|
|
16
|
+
#
|
|
17
|
+
# @return [Hash] Hash representing created user ignore
|
|
18
|
+
#
|
|
19
|
+
# @see https://shikimori.one/api/doc/2.0/User%20Ignore/create Shikimori's API documentation
|
|
20
|
+
# @example Add to ignore a user with id equal to 1
|
|
21
|
+
# client = Shikimori::API::Client.new(
|
|
22
|
+
# app_name: 'Api Test',
|
|
23
|
+
# aceess_token: '****',
|
|
24
|
+
# refresh_token: '****'
|
|
25
|
+
# )
|
|
26
|
+
# client.v2.create_user_ignore(1)
|
|
27
|
+
def create_user_ignore(user_id, headers: nil, **query)
|
|
28
|
+
rest.post base_url.join('users', user_id.to_s, 'ignore').url, {}, headers: headers, query: query
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Delete a user ignore by id.
|
|
32
|
+
# Requires `ignores` oauth scope
|
|
33
|
+
#
|
|
34
|
+
# @param user_id [#to_s] User id
|
|
35
|
+
# @param headers [Hash] Request headers
|
|
36
|
+
# @param query [Hash] Query string parameters for request
|
|
37
|
+
#
|
|
38
|
+
# @return [Boolean] True if deletion successful, false otherwise.
|
|
39
|
+
#
|
|
40
|
+
# @see https://shikimori.one/api/doc/2.0/User%20Ignore/destroy Shikimori's API documentation
|
|
41
|
+
# @example Delete a user ignore
|
|
42
|
+
# client = Shikimori::API::Client.new(
|
|
43
|
+
# app_name: 'Api Test',
|
|
44
|
+
# aceess_token: '****',
|
|
45
|
+
# refresh_token: '****'
|
|
46
|
+
# )
|
|
47
|
+
# client.v2.delete_user_ignore(1)
|
|
48
|
+
def delete_user_ignore(user_id, headers: nil, **query)
|
|
49
|
+
rest.delete base_url.join('users', user_id.to_s, 'ignore').url, headers: headers, query: query
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Shikimori
|
|
4
|
+
module API
|
|
5
|
+
class V2
|
|
6
|
+
# Methods for the User rates API
|
|
7
|
+
#
|
|
8
|
+
# @see https://shikimori.one/api/doc/2.0/user_rates
|
|
9
|
+
module UserRates
|
|
10
|
+
# Get list of user rates
|
|
11
|
+
#
|
|
12
|
+
# @param headers [Hash] Request headers
|
|
13
|
+
# @param query [Hash] Query string parameters for request
|
|
14
|
+
# @option query [Integer] :page Number of page. Must be between 1 and 100000
|
|
15
|
+
# @option query [Integer] :limit Number of titles per page. Must be a lower or equal that 50
|
|
16
|
+
# @option query [Integer] :user_id User ID
|
|
17
|
+
# @option query [Integer] :target_id Target ID
|
|
18
|
+
# @option query ['Anime', 'Manga'] :target_type Target ID
|
|
19
|
+
# @option query ['planned', 'watching', 'rewatching',
|
|
20
|
+
# 'completed', 'on_hold', 'dropped'] :status Watching/Reading status
|
|
21
|
+
#
|
|
22
|
+
# @return [Array<Hash>] Array of hashes representing user rates
|
|
23
|
+
#
|
|
24
|
+
# @see https://shikimori.one/api/doc/2.0/user_rates/index Shikimori's API documentation
|
|
25
|
+
# @example List of user rates
|
|
26
|
+
# client = Shikimori::API::Client.new(
|
|
27
|
+
# app_name: 'Api Test',
|
|
28
|
+
# aceess_token: '****',
|
|
29
|
+
# refresh_token: '****'
|
|
30
|
+
# )
|
|
31
|
+
# client.v2.user_rates(status: 'planned')
|
|
32
|
+
def user_rates(headers: nil, **query)
|
|
33
|
+
rest.get base_url.join('user_rates').url, headers: headers, query: query
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Get an user rate by id
|
|
37
|
+
#
|
|
38
|
+
# @param id [#to_s] user rate id
|
|
39
|
+
# @param headers [Hash] Request headers
|
|
40
|
+
# @param query [Hash] Query string parameters for request
|
|
41
|
+
#
|
|
42
|
+
# @return [Hash] Hash representing user rate
|
|
43
|
+
#
|
|
44
|
+
# @see https://shikimori.one/api/doc/2.0/user_rates/show Shikimori's API documentation
|
|
45
|
+
# @example Get user rate with id equal to 1
|
|
46
|
+
# client = Shikimori::API::Client.new(
|
|
47
|
+
# app_name: 'Api Test',
|
|
48
|
+
# aceess_token: '****',
|
|
49
|
+
# refresh_token: '****'
|
|
50
|
+
# )
|
|
51
|
+
# client.v2.user_rate(1) #=> { id: 1, ... }
|
|
52
|
+
def user_rate(id, headers: nil, **query)
|
|
53
|
+
rest.get base_url.join('user_rates', id.to_s).url, headers: headers, query: query
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Create a user rate.
|
|
57
|
+
# Requires `user_rates` oauth scope
|
|
58
|
+
#
|
|
59
|
+
# @param user_rate [Hash] User rate data for creating
|
|
60
|
+
# @option user_rate [Integer] :user_id User id
|
|
61
|
+
# @option user_rate [Integer] :target_id Target id
|
|
62
|
+
# @option user_rate ['Anime', 'Manga'] :target_type Target type
|
|
63
|
+
# @option user_rate ["planned", "watching", "rewatching",
|
|
64
|
+
# "completed", "on_hold", "dropped"] :status Watching status
|
|
65
|
+
# @option user_rate [Numeric] :score Score
|
|
66
|
+
# @option user_rate [Numeric] :chapters Current chapter number
|
|
67
|
+
# @option user_rate [Numeric] :episodes Current episode number
|
|
68
|
+
# @option user_rate [Numeric] :volumes Current volume number
|
|
69
|
+
# @option user_rate [Numeric] :rewatches Count of rewatching
|
|
70
|
+
# @option user_rate [String] :text Rate text
|
|
71
|
+
# @param headers [Hash] Request headers
|
|
72
|
+
# @param query [Hash] Query string parameters for request
|
|
73
|
+
#
|
|
74
|
+
# @return [Hash] Hash representing created user rate
|
|
75
|
+
#
|
|
76
|
+
# @see https://shikimori.one/api/doc/2.0/user_rates/create Shikimori's API documentation
|
|
77
|
+
# @example Create a user rate
|
|
78
|
+
# client = Shikimori::API::Client.new(
|
|
79
|
+
# app_name: 'Api Test',
|
|
80
|
+
# aceess_token: '****',
|
|
81
|
+
# refresh_token: '****'
|
|
82
|
+
# )
|
|
83
|
+
# user_rate = {
|
|
84
|
+
# text: "text",
|
|
85
|
+
# user_id: 1,
|
|
86
|
+
# target_id: "41",
|
|
87
|
+
# target_type: "Anime"
|
|
88
|
+
# }
|
|
89
|
+
# client.v2.create_user_rate(user_rate)
|
|
90
|
+
def create_user_rate(user_rate, headers: nil, **query)
|
|
91
|
+
rest.post base_url.join('user_rates').url, { user_rate: user_rate }, headers: headers, query: query
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Update a user rate.
|
|
95
|
+
# Requires `user_rates` oauth scope
|
|
96
|
+
#
|
|
97
|
+
# @param id [#to_s] User rate id
|
|
98
|
+
# @param user_rate [Hash] User rate data for creating
|
|
99
|
+
# @option user_rate ["planned", "watching", "rewatching",
|
|
100
|
+
# "completed", "on_hold", "dropped"] :status Watching status
|
|
101
|
+
# @option user_rate [Numeric] :score Score
|
|
102
|
+
# @option user_rate [Numeric] :chapters Current chapter number
|
|
103
|
+
# @option user_rate [Numeric] :episodes Current episode number
|
|
104
|
+
# @option user_rate [Numeric] :volumes Current volume number
|
|
105
|
+
# @option user_rate [Numeric] :rewatches Count of rewatching
|
|
106
|
+
# @option user_rate [String] :text Rate text
|
|
107
|
+
# @param headers [Hash] Request headers
|
|
108
|
+
# @param query [Hash] Query string parameters for request
|
|
109
|
+
#
|
|
110
|
+
# @return [Hash] Hash representing updated user rate
|
|
111
|
+
#
|
|
112
|
+
# @see https://shikimori.one/api/doc/2.0/user_rates/update Shikimori's API documentation
|
|
113
|
+
# @example Update a user rate text
|
|
114
|
+
# client = Shikimori::API::Client.new(
|
|
115
|
+
# app_name: 'Api Test',
|
|
116
|
+
# aceess_token: '****',
|
|
117
|
+
# refresh_token: '****'
|
|
118
|
+
# )
|
|
119
|
+
# user_rate = {
|
|
120
|
+
# text: "text"
|
|
121
|
+
# }
|
|
122
|
+
# client.v2.update_user_rate(1, user_rate)
|
|
123
|
+
def update_user_rate(id, user_rate, headers: nil, **query)
|
|
124
|
+
rest.put base_url.join('user_rates', id.to_s).url, { user_rate: user_rate }, headers: headers, query: query
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Delete user rate.
|
|
128
|
+
# Requires `user_rates` oauth scope
|
|
129
|
+
#
|
|
130
|
+
# @param id [#to_s] User rate id
|
|
131
|
+
# @param headers [Hash] Request headers
|
|
132
|
+
# @param query [Hash] Query string parameters for request
|
|
133
|
+
#
|
|
134
|
+
# @return [Boolean] True if deletion successful, false otherwise.
|
|
135
|
+
#
|
|
136
|
+
# @see https://shikimori.one/api/doc/2.0/user_rates/destroy Shikimori's API documentation
|
|
137
|
+
# @example Delete user rate
|
|
138
|
+
# client = Shikimori::API::Client.new(
|
|
139
|
+
# app_name: 'Api Test',
|
|
140
|
+
# aceess_token: '****',
|
|
141
|
+
# refresh_token: '****'
|
|
142
|
+
# )
|
|
143
|
+
# client.v2.delete_user_rate(1)
|
|
144
|
+
def delete_user_rate(id, headers: nil, **query)
|
|
145
|
+
rest.delete base_url.join('user_rates', id.to_s).url, headers: headers, query: query
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Increment episodes/chapters by 1
|
|
149
|
+
# Requires `user_rates` oauth scope
|
|
150
|
+
#
|
|
151
|
+
# @param id [#to_s] User rate ID
|
|
152
|
+
# @param headers [Hash] Request headers
|
|
153
|
+
# @param query [Hash] Query string parameters for request
|
|
154
|
+
#
|
|
155
|
+
# @return [Hash] Hash representing created user rate
|
|
156
|
+
#
|
|
157
|
+
# @see https://shikimori.one/api/doc/2.0/user_rates/increment Shikimori's API documentation
|
|
158
|
+
# @example Increment episodes/chapters by 1
|
|
159
|
+
# client = Shikimori::API::Client.new(
|
|
160
|
+
# app_name: 'Api Test',
|
|
161
|
+
# aceess_token: '****',
|
|
162
|
+
# refresh_token: '****'
|
|
163
|
+
# )
|
|
164
|
+
# client.v2.increment_user_rate(1)
|
|
165
|
+
def increment_user_rate(id, headers: nil, **query)
|
|
166
|
+
rest.post base_url.join('user_rates', id.to_s, 'increment').url, {}, headers: headers, query: query
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'v2/abuse_requests'
|
|
4
|
+
require_relative 'v2/episode_notifications'
|
|
5
|
+
require_relative 'v2/topic_ignore'
|
|
6
|
+
require_relative 'v2/user_ignore'
|
|
7
|
+
require_relative 'v2/user_rates'
|
|
8
|
+
|
|
9
|
+
module Shikimori
|
|
10
|
+
module API
|
|
11
|
+
# Methods for second version of shikimori's API
|
|
12
|
+
class V2
|
|
13
|
+
include AbuseRequests
|
|
14
|
+
include EpisodeNotifications
|
|
15
|
+
include TopicIgnore
|
|
16
|
+
include UserIgnore
|
|
17
|
+
include UserRates
|
|
18
|
+
|
|
19
|
+
attr_reader :rest, :base_url
|
|
20
|
+
|
|
21
|
+
def initialize(base_url:, rest:)
|
|
22
|
+
@rest = rest
|
|
23
|
+
@base_url = base_url
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'net/http'
|
|
4
|
+
require 'json'
|
|
5
|
+
|
|
6
|
+
require_relative 'api/version'
|
|
7
|
+
require_relative 'api/errors'
|
|
8
|
+
require_relative 'api/client'
|
|
9
|
+
|
|
10
|
+
module Shikimori
|
|
11
|
+
# Ruby toolkit for the Shikimori API
|
|
12
|
+
module API
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'lib/shikimori/api/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = 'shikimori-api'
|
|
7
|
+
spec.version = Shikimori::API::VERSION
|
|
8
|
+
spec.authors = ['Ivan Naumov']
|
|
9
|
+
spec.email = ['ivannaymov@gmail.com']
|
|
10
|
+
|
|
11
|
+
spec.summary = 'Simple wrapper for the Shikimori API'
|
|
12
|
+
spec.description = 'Ruby toolkit for working with the Shikimori API'
|
|
13
|
+
spec.homepage = 'https://github.com/iwdt/shikikit'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
spec.required_ruby_version = '>= 3.0'
|
|
16
|
+
|
|
17
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
18
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/iwdt/shikikit'
|
|
20
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/iwdt/shikikit/issues'
|
|
21
|
+
spec.metadata['changelog_uri'] = 'https://github.com/iwdt/shikikit/blob/main/CHANGELOG.md'
|
|
22
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
23
|
+
|
|
24
|
+
spec.files = Dir[
|
|
25
|
+
# Common files
|
|
26
|
+
'LICENSE',
|
|
27
|
+
'README.md',
|
|
28
|
+
'shikimori-api.gemspec',
|
|
29
|
+
# Code
|
|
30
|
+
'lib/shikimori-api.rb',
|
|
31
|
+
'lib/shikimori/api.rb',
|
|
32
|
+
'lib/shikimori/api/**/*',
|
|
33
|
+
# Signtures
|
|
34
|
+
'sig/shikimori/api.rbs',
|
|
35
|
+
'sig/shikimori/api/**/*'
|
|
36
|
+
]
|
|
37
|
+
spec.bindir = 'bin'
|
|
38
|
+
spec.executables = []
|
|
39
|
+
spec.require_paths = ['lib']
|
|
40
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class REST
|
|
4
|
+
type request_method = :delete | :get | :post | :put
|
|
5
|
+
type request = Net::HTTP::Delete | Net::HTTP::Get | Net::HTTP::Post | Net::HTTP::Put
|
|
6
|
+
type body = Hash[_ToS, Object] | nil
|
|
7
|
+
|
|
8
|
+
@app_name: String
|
|
9
|
+
@access_token: String
|
|
10
|
+
@refresh_token: String
|
|
11
|
+
|
|
12
|
+
def initialize: (app_name: String, access_token: String, refresh_token: String) -> void
|
|
13
|
+
|
|
14
|
+
def get: (::URI::Generic, **untyped) -> untyped
|
|
15
|
+
def post: (::URI::Generic, Hash[_ToS, untyped] data, **untyped) -> untyped
|
|
16
|
+
def put: (::URI::Generic, Hash[_ToS, Object] data, **untyped) -> untyped
|
|
17
|
+
def delete: (::URI::Generic, **untyped) -> bool
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def request: (request_method, ::URI::Generic, ?body, **untyped) -> [Net::HTTPResponse, (::Hash[_ToS, Object] | nil)]
|
|
22
|
+
def build_request: (request_method, ::URI::Generic, **untyped) -> request
|
|
23
|
+
def start_request: (::URI::Generic, request, ?body, **untyped) -> Net::HTTPResponse
|
|
24
|
+
def parse_response: (Net::HTTPResponse response) -> (::Hash[_ToS, untyped] | nil)
|
|
25
|
+
def json_parse_response_body: (String) -> (::Hash[_ToS, untyped] | nil)
|
|
26
|
+
def headers_from: (Hash[untyped, untyped]) -> Hash[String, String]
|
|
27
|
+
def query_params_from: (::URI::Generic, Hash[untyped, untyped]) -> untyped
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Achievements
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def achievements: (user_id: Integer, ?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 Animes
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def animes: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
8
|
+
def anime: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
9
|
+
def anime_roles: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
10
|
+
def anime_similar: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
11
|
+
def anime_related: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
12
|
+
def anime_screenshots: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
13
|
+
def anime_franchise: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
14
|
+
def anime_external_links: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
15
|
+
def anime_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,15 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Appear
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def create_appear: (?comment_ids: Array[_ToS], ?topic_ids: Array[_ToS], ?headers: Hash[String, String] | nil, **untyped) -> bool
|
|
8
|
+
|
|
9
|
+
private
|
|
10
|
+
|
|
11
|
+
def base_url: -> ::Shikimori::API::URI
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Characters
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def characters: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
8
|
+
def character: (_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,29 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Clubs
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
type club_model = { name: String, description: String, display_images: bool | 1 | 0, comment_policy: 'free' | 'members' | 'admins', topic_policy: 'members' | 'admins', image_upload_policy: 'members' | 'admins' }
|
|
8
|
+
|
|
9
|
+
def clubs: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
10
|
+
def club: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
11
|
+
def update_club: (_ToS, club_model, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
12
|
+
def club_animes: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
13
|
+
def club_mangas: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
14
|
+
def club_ranobe: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
15
|
+
def club_characters: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
16
|
+
def club_collections: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
17
|
+
def club_clubs: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
18
|
+
def club_members: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
19
|
+
def club_images: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
20
|
+
def club_join: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
|
|
21
|
+
def club_leave: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def base_url: -> ::Shikimori::API::URI
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Comments
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def comments: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
8
|
+
def comment: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
9
|
+
def create_comment: (Hash[_ToS, Object], ?broadcast: ('false' | 'true' | 1 | 0 | nil), ?frontend: ('false' | 'true' | 1 | 0 | nil), ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
10
|
+
def update_comment: (_ToS, Hash[_ToS, untyped], ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
11
|
+
def delete_comment: (_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,19 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Constants
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def anime_constants: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
8
|
+
def manga_constants: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
9
|
+
def user_rate_constants: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
10
|
+
def club_constants: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
11
|
+
def smileys_constants: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def base_url: -> ::Shikimori::API::URI
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Dialogs
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def dialogs: (?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
8
|
+
def dialog: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
9
|
+
def delete_dialog: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> bool
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def base_url: -> ::Shikimori::API::URI
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Favorites
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
type favoritable_type = 'person' | 'anime' | 'manga' | 'ranobe' | 'character'
|
|
8
|
+
type person_type = 'common' | 'seyu' | 'mangaka' | 'producer' | 'person'
|
|
9
|
+
|
|
10
|
+
def create_favorite: (_ToS, type: favoritable_type, ?person_type: person_type, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
11
|
+
def delete_favorite: (_ToS, type: favoritable_type, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
12
|
+
def reorder_favorite: (_ToS, position: Integer, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def creation_favorite_path_by: (String, String, ?String person_type) -> Array[String]
|
|
17
|
+
def deletion_favorite_path_by: (String, String) -> Array[String]
|
|
18
|
+
|
|
19
|
+
def base_url: -> ::Shikimori::API::URI
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Shikimori
|
|
2
|
+
module API
|
|
3
|
+
class V1
|
|
4
|
+
module Friends
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def create_friend: (Hash[_ToS, Object], ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
8
|
+
def delete_friend: (_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 V1
|
|
4
|
+
module Ignores
|
|
5
|
+
attr_reader rest: REST
|
|
6
|
+
|
|
7
|
+
def create_ignore: (_ToS, ?headers: Hash[String, String] | nil, **untyped) -> untyped
|
|
8
|
+
def delete_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
|