anilibria-api-ruby 1.0.4.1 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba50d51a867a98e0bac039f02675eaf35c92d8fca7ca09d75a956907166c5911
4
- data.tar.gz: fb9ca7bf541d71e4de811d47f14006dc06ee42d732e8cca79885f29dd2d42af2
3
+ metadata.gz: b3e1395dc7fa5e9867cf3b9419eb0692a8e09a82b024bf4b35208acd132daab1
4
+ data.tar.gz: 99193ab067172c7bd3ac16f90aa12887ebfafc9c655eddf60b5dde4411e99f0d
5
5
  SHA512:
6
- metadata.gz: e1772aff9a59d15b457683f252217abc50a2bd94fa290d40c07629541ddcff62a41235c2ddcd3019bbdbf2f65a8c131837816bc54464ef70d2a60922a452eeec
7
- data.tar.gz: cd96a4a22c0b71298a5775af3005b376e47c8e2048c52b831b6a61b6b9b8210a94f248b7f864160211fc6faae4e8cf1beb50629014933f84cd72b8df0756b92a
6
+ metadata.gz: 67e552501fcd5d2a5603cb8ce10d562028f33e70172e480315db9343cf26c5e9c7a591ec162f90d3eb9d95c3cc2ba24756159bb809ee9872c673a65de27cadeb
7
+ data.tar.gz: 02db06b36eebbdf244a556ca0823d795574f511a925af9947302205611838a9190b9ab2331031ad9d3bf963f25bfd10bbb6dd1088c8c761e0dbc33cbdb8cbd23
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- anilibria-api-ruby (1.0.4.1)
4
+ anilibria-api-ruby (1.0.5)
5
5
  dry-struct (~> 1.4)
6
6
  faraday (~> 2)
7
7
 
@@ -10,19 +10,19 @@ module Anilibria
10
10
  api_method :get_random_title, returns: Types::Title
11
11
  api_method :get_youtube, 'getYouTube', returns: DryTypes::Array.of(Types::YouTube)
12
12
  api_method :get_feed, returns: Types::Feed
13
- api_method :get_years, returns: DryTypes::Array.of(DryTypes::Strict::Integer)
14
- api_method :get_genres, returns: DryTypes::Array.of(DryTypes::Strict::String)
15
- api_method :get_caching_nodes, returns: DryTypes::Array.of(DryTypes::Strict::String)
13
+ api_method :get_years, returns: DryTypes::Array.of(DryTypes::Integer)
14
+ api_method :get_genres, returns: DryTypes::Array.of(DryTypes::String)
15
+ api_method :get_caching_nodes, returns: DryTypes::Array.of(DryTypes::String)
16
16
  api_method :get_team, returns: DryTypes.Constructor(Types::Team) { |team| team[:team] }
17
- api_method :get_rss, 'getRSS', returns: DryTypes::Strict::String | DryTypes::Strict::Hash
17
+ api_method :get_rss, 'getRSS', returns: DryTypes::String | DryTypes::Hash
18
18
  api_method :get_seed_stats, returns: DryTypes::Array.of(Types::SeedStats)
19
19
  api_method :search_titles, returns: DryTypes::Array.of(Types::Title)
20
20
  api_method :advanced_search, returns: DryTypes::Array.of(Types::Title)
21
21
 
22
22
  # Methods that require authorization
23
23
  api_method :get_favorites, returns: DryTypes::Array.of(Types::Title)
24
- api_method :add_favorite, http_method: :put, returns: DryTypes::Success
25
- api_method :del_favorite, http_method: :delete, returns: DryTypes::Success
24
+ api_method :add_favorite, http_method: :put, returns: Types::T::Success
25
+ api_method :del_favorite, http_method: :delete, returns: Types::T::Success
26
26
  end
27
27
  end
28
28
  end
@@ -2,7 +2,6 @@ module Anilibria
2
2
  module Api
3
3
  module Types
4
4
  class Base < Dry::Struct
5
- # schema schema.strict
6
5
  end
7
6
  end
8
7
  end
@@ -3,9 +3,6 @@ module Anilibria
3
3
  module Types
4
4
  module DryTypes
5
5
  include Dry.Types()
6
-
7
- Timestamp = Constructor(::Time, ::Time.method(:at))
8
- Success = Constructor(Bool) { |value| value[:success] }
9
6
  end
10
7
  end
11
8
  end
@@ -2,7 +2,7 @@ module Anilibria
2
2
  module Api
3
3
  module Types
4
4
  class Schedule < Base
5
- attribute :day, DryTypes::Strict::Integer
5
+ attribute :day, T::Integer
6
6
  attribute :list, DryTypes::Array.of(Title)
7
7
  end
8
8
  end
@@ -2,9 +2,9 @@ module Anilibria
2
2
  module Api
3
3
  module Types
4
4
  class SeedStats < Base
5
- attribute? :downloaded, DryTypes::Strict::Integer
6
- attribute? :uploaded, DryTypes::Strict::Integer
7
- attribute? :user, DryTypes::Strict::String
5
+ attribute? :downloaded, T::Integer
6
+ attribute? :uploaded, T::Integer
7
+ attribute? :user, T::String
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,15 @@
1
+ module Anilibria
2
+ module Api
3
+ module Types
4
+ module T
5
+ String = DryTypes::String.optional
6
+ Integer = DryTypes::Integer.optional
7
+ Bool = DryTypes::Bool.optional
8
+ Nil = DryTypes::Nil.optional
9
+
10
+ Timestamp = DryTypes.Constructor(Time, Time.method(:at)).optional
11
+ Success = DryTypes.Constructor(Bool) { |value| value[:success] }
12
+ end
13
+ end
14
+ end
15
+ end
@@ -3,7 +3,7 @@ module Anilibria
3
3
  module Types
4
4
  class Team < Base
5
5
  %i[voice translator editing decor timing].each do |t|
6
- attribute? t, DryTypes::Array.of(DryTypes::Strict::String)
6
+ attribute? t, DryTypes::Array.of(DryTypes::String)
7
7
  end
8
8
  end
9
9
  end
@@ -3,15 +3,15 @@ module Anilibria
3
3
  module Types
4
4
  class Title < Base
5
5
  class Series < Base
6
- attribute? :first, DryTypes::Integer.optional
7
- attribute? :last, DryTypes::Integer.optional
8
- attribute? :string, DryTypes::String.optional
6
+ attribute? :first, T::Integer
7
+ attribute? :last, T::Integer
8
+ attribute? :string, T::String
9
9
  end
10
10
 
11
11
  class Posters < Base
12
12
  class Poster < Base
13
- attribute? :url, DryTypes::String.optional
14
- attribute? :raw_base64_file, DryTypes::String.optional
13
+ attribute? :url, T::String
14
+ attribute? :raw_base64_file, T::String
15
15
  end
16
16
 
17
17
  %i[small medium original].each do |size|
@@ -21,18 +21,18 @@ module Anilibria
21
21
 
22
22
  class Player < Base
23
23
  class Playlist < Base
24
- attribute? :serie, DryTypes::Strict::Integer
25
- attribute? :created_timestamp, DryTypes::Timestamp
24
+ attribute? :serie, T::Integer
25
+ attribute? :created_timestamp, T::Timestamp
26
26
 
27
27
  attribute? :hls, Base do
28
- attribute? :fhd, DryTypes::String.optional
29
- attribute? :hd, DryTypes::String.optional
30
- attribute? :sd, DryTypes::String.optional
28
+ attribute? :fhd, T::String
29
+ attribute? :hd, T::String
30
+ attribute? :sd, T::String
31
31
  end
32
32
  end
33
33
 
34
- attribute? :alternative_player, DryTypes::String.optional
35
- attribute? :host, DryTypes::String.optional
34
+ attribute? :alternative_player, T::String
35
+ attribute? :host, T::String
36
36
  attribute? :series, Title::Series
37
37
 
38
38
  attribute?(
@@ -47,92 +47,92 @@ module Anilibria
47
47
  class Torrent < Base
48
48
  class Metadata < Base
49
49
  class FilesList < Base
50
- attribute? :file, DryTypes::Strict::String
51
- attribute? :size, DryTypes::Strict::Integer
52
- attribute? :offset, DryTypes::Strict::Integer
50
+ attribute? :file, T::String
51
+ attribute? :size, T::Integer
52
+ attribute? :offset, T::Integer
53
53
  end
54
54
 
55
55
  undef hash
56
56
 
57
- attribute? :hash, DryTypes::Strict::String
58
- attribute? :name, DryTypes::Strict::String
59
- attribute? :announce, DryTypes::Array.of(DryTypes::Strict::String)
60
- attribute? :created_timestamp, DryTypes::Timestamp
57
+ attribute? :hash, T::String
58
+ attribute? :name, T::String
59
+ attribute? :announce, DryTypes::Array.of(T::String)
60
+ attribute? :created_timestamp, T::Timestamp
61
61
  attribute? :files_list, DryTypes::Array.of(FilesList)
62
62
  end
63
63
 
64
64
  undef hash
65
65
 
66
- attribute? :torrent_id, DryTypes::Strict::Integer
66
+ attribute? :torrent_id, T::Integer
67
67
  attribute? :series, Title::Series
68
68
 
69
69
  attribute? :quality, Base do
70
- attribute? :string, DryTypes::Strict::String
71
- attribute? :type, DryTypes::Strict::String
72
- attribute? :resolution, DryTypes::Strict::Integer
73
- attribute? :encoder, DryTypes::Strict::String
74
- attribute? :lq_audio, DryTypes::Strict::Bool
70
+ attribute? :string, T::String
71
+ attribute? :type, T::String
72
+ attribute? :resolution, T::Integer
73
+ attribute? :encoder, T::String
74
+ attribute? :lq_audio, T::Bool
75
75
  end
76
76
 
77
77
  %i[leechers seeders downloads total_size].each do |i|
78
- attribute? i, DryTypes::Strict::Integer
78
+ attribute? i, T::Integer
79
79
  end
80
80
 
81
- attribute? :url, DryTypes::Strict::String
82
- attribute? :uploaded_timestamp, DryTypes::Timestamp
83
- attribute? :hash, DryTypes::Strict::String
84
- attribute? :metadata, DryTypes::Strict::Nil | Metadata
85
- attribute? :raw_base64_file, DryTypes::String.optional
81
+ attribute? :url, T::String
82
+ attribute? :uploaded_timestamp, T::Timestamp
83
+ attribute? :hash, T::String
84
+ attribute? :metadata, Metadata.optional
85
+ attribute? :raw_base64_file, T::String
86
86
  end
87
87
 
88
88
  attribute? :series, Title::Series
89
89
  attribute? :list, DryTypes::Array.of(Torrent)
90
90
  end
91
91
 
92
- attribute? :id, DryTypes::Strict::Integer
93
- attribute? :code, DryTypes::Strict::String
92
+ attribute? :id, T::Integer
93
+ attribute? :code, T::String
94
94
 
95
95
  attribute? :names, Base do
96
- attribute? :ru, DryTypes::String.optional
97
- attribute? :en, DryTypes::String.optional
98
- attribute? :alternative, DryTypes::String.optional
96
+ attribute? :ru, T::String
97
+ attribute? :en, T::String
98
+ attribute? :alternative, T::String
99
99
  end
100
100
 
101
- attribute? :announce, DryTypes::String.optional
101
+ attribute? :announce, T::String
102
102
 
103
103
  attribute? :status, Base do
104
- attribute? :string, DryTypes::Strict::String
105
- attribute? :code, DryTypes::Strict::Integer
104
+ attribute? :string, T::String
105
+ attribute? :code, T::Integer
106
106
  end
107
107
 
108
108
  attribute? :posters, Posters
109
- attribute? :updated, DryTypes::Timestamp.optional
110
- attribute? :last_change, DryTypes::Timestamp.optional
109
+ attribute? :updated, T::Timestamp
110
+ attribute? :last_change, T::Timestamp
111
111
 
112
112
  attribute? :type, Base do
113
- attribute? :full_string, DryTypes::String.optional
114
- attribute? :string, DryTypes::String.optional
115
- attribute? :length, DryTypes::Integer.optional
116
- attribute? :series, DryTypes::Integer.optional
117
- attribute? :code, DryTypes::Integer.optional
113
+ attribute? :full_string, T::String
114
+ attribute? :string, T::String
115
+ attribute? :length, T::Integer
116
+ attribute? :series, T::Integer
117
+ attribute? :code, T::Integer
118
118
  end
119
119
 
120
- attribute? :genres, DryTypes::Array.of(DryTypes::Strict::String)
120
+ attribute? :genres, DryTypes::Array.of(T::String)
121
121
  attribute? :team, Types::Team
122
122
 
123
123
  attribute? :season, Base do
124
- attribute? :string, DryTypes::String.optional
125
- attribute? :code, DryTypes::Integer.optional
126
- attribute? :year, DryTypes::Integer.optional
127
- attribute? :week_day, DryTypes::Integer.optional
124
+ attribute? :string, T::String
125
+ attribute? :code, T::Integer
126
+ attribute? :year, T::Integer
127
+ attribute? :week_day, T::Integer
128
128
  end
129
129
 
130
- attribute? :description, DryTypes::String.optional
131
- attribute? :in_favorites, DryTypes::Integer.optional
130
+ attribute? :description, T::String
131
+ attribute? :in_favorites, T::Integer
132
132
 
133
133
  attribute? :blocked, Base do
134
- attribute? :blocked, DryTypes::Strict::Bool
135
- attribute? :bakanim, DryTypes::Strict::Bool
134
+ attribute? :blocked, T::Bool
135
+ attribute? :bakanim, T::Bool
136
136
  end
137
137
 
138
138
  attribute? :player, Player
@@ -2,12 +2,12 @@ module Anilibria
2
2
  module Api
3
3
  module Types
4
4
  class YouTube < Base
5
- attribute? :id, DryTypes::Strict::Integer
6
- attribute? :image, DryTypes::Strict::String
7
- attribute? :youtube_id, DryTypes::Strict::String
8
- attribute? :comments, DryTypes::Strict::Integer
9
- attribute? :views, DryTypes::Strict::Integer
10
- attribute? :timestamp, DryTypes::Timestamp
5
+ attribute? :id, T::Integer
6
+ attribute? :image, T::String
7
+ attribute? :youtube_id, T::String
8
+ attribute? :comments, T::Integer
9
+ attribute? :views, T::Integer
10
+ attribute? :timestamp, T::Timestamp
11
11
  end
12
12
  end
13
13
  end
@@ -1,4 +1,5 @@
1
1
  require 'anilibria/api/types/dry_types'
2
+ require 'anilibria/api/types/t'
2
3
  require 'anilibria/api/types/base'
3
4
  require 'anilibria/api/types/team'
4
5
  require 'anilibria/api/types/title'
@@ -1,6 +1,6 @@
1
1
  module Anilibria
2
2
  module Api
3
- VERSION = '1.0.4.1'.freeze
3
+ VERSION = '1.0.5'.freeze
4
4
  public_constant :VERSION
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anilibria-api-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4.1
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Kozachenko
@@ -67,6 +67,7 @@ files:
67
67
  - lib/anilibria/api/types/feed.rb
68
68
  - lib/anilibria/api/types/schedule.rb
69
69
  - lib/anilibria/api/types/seed_stats.rb
70
+ - lib/anilibria/api/types/t.rb
70
71
  - lib/anilibria/api/types/team.rb
71
72
  - lib/anilibria/api/types/title.rb
72
73
  - lib/anilibria/api/types/youtube.rb