twitchrb 1.6.0 → 1.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7327c8f6f44058116d61066e6d7eee668c60850de7772b56c041d6fb03d2272
4
- data.tar.gz: abac199ef5acc9ab8717f1438d9d883c5c24c7858194b88c2692a2ed625b61e0
3
+ metadata.gz: 93a284aec069a77415cce52d24805ffc047595a7f71641cbeec979444fa12f31
4
+ data.tar.gz: efe09b14f083a1e67f8d8b616d4aa792f79861b409b965ceac87baf942b7f30c
5
5
  SHA512:
6
- metadata.gz: 83fb8d523ae645817738457fd9377c56d9f6d022dec7e64df8c454177485649964715bb924b12525022a99ca9ca3552d34b5e6becfb1b1c3c0811a7818eefe0f
7
- data.tar.gz: 82752078c2845fb4eeabbd5cff02d393ae693997d25ef454455fbe2371e5259c962b93d9779b4dddd70b3e0d4225d9a0b63a93156e75ac1dadbedb8958b78a94
6
+ metadata.gz: c6229b6097c07070413291d07c3cee543d48c765e1c801047cfd1c10abd2898b976d0d194c133aaddb58fe1d3aad40a4ce24f83674ef8fd7ca35a0cd64951dd0
7
+ data.tar.gz: 974fb68d3276cd8536d55a62666ae65957c0f67ab4b421085fd66fca36401e1c7fd659561263baf6d8b2827bb58db5855589b4b635e5ab1ef9a7dcea4ea8a530
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twitchrb (1.6.0)
4
+ twitchrb (1.7.0)
5
5
  faraday (~> 2.11)
6
6
  ostruct (~> 0.6.0)
7
7
 
@@ -23,12 +23,12 @@ GEM
23
23
  ast (2.4.3)
24
24
  base64 (0.3.0)
25
25
  benchmark (0.4.1)
26
- bigdecimal (3.2.3)
26
+ bigdecimal (3.3.1)
27
27
  concurrent-ruby (1.3.5)
28
28
  connection_pool (2.5.4)
29
29
  dotenv (3.1.8)
30
30
  drb (2.2.3)
31
- faraday (2.13.4)
31
+ faraday (2.14.0)
32
32
  faraday-net_http (>= 2.0, < 3.5)
33
33
  json
34
34
  logger
@@ -36,11 +36,11 @@ GEM
36
36
  net-http (>= 0.5.0)
37
37
  i18n (1.14.7)
38
38
  concurrent-ruby (~> 1.0)
39
- json (2.13.2)
39
+ json (2.15.1)
40
40
  language_server-protocol (3.17.0.5)
41
41
  lint_roller (1.1.0)
42
42
  logger (1.7.0)
43
- minitest (5.25.5)
43
+ minitest (5.26.0)
44
44
  net-http (0.6.0)
45
45
  uri
46
46
  ostruct (0.6.3)
@@ -48,13 +48,13 @@ GEM
48
48
  parser (3.3.9.0)
49
49
  ast (~> 2.4.1)
50
50
  racc
51
- prism (1.5.0)
51
+ prism (1.6.0)
52
52
  racc (1.8.1)
53
- rack (3.2.1)
53
+ rack (3.2.3)
54
54
  rainbow (3.1.1)
55
55
  rake (12.3.3)
56
- regexp_parser (2.11.2)
57
- rubocop (1.80.2)
56
+ regexp_parser (2.11.3)
57
+ rubocop (1.81.1)
58
58
  json (~> 2.3)
59
59
  language_server-protocol (~> 3.17.0.2)
60
60
  lint_roller (~> 1.1.0)
@@ -62,17 +62,17 @@ GEM
62
62
  parser (>= 3.3.0.2)
63
63
  rainbow (>= 2.2.2, < 4.0)
64
64
  regexp_parser (>= 2.9.3, < 3.0)
65
- rubocop-ast (>= 1.46.0, < 2.0)
65
+ rubocop-ast (>= 1.47.1, < 2.0)
66
66
  ruby-progressbar (~> 1.7)
67
67
  unicode-display_width (>= 2.4.0, < 4.0)
68
- rubocop-ast (1.46.0)
68
+ rubocop-ast (1.47.1)
69
69
  parser (>= 3.3.7.2)
70
70
  prism (~> 1.4)
71
- rubocop-performance (1.26.0)
71
+ rubocop-performance (1.26.1)
72
72
  lint_roller (~> 1.1)
73
73
  rubocop (>= 1.75.0, < 2.0)
74
- rubocop-ast (>= 1.44.0, < 2.0)
75
- rubocop-rails (2.33.3)
74
+ rubocop-ast (>= 1.47.1, < 2.0)
75
+ rubocop-rails (2.33.4)
76
76
  activesupport (>= 4.2.0)
77
77
  lint_roller (~> 1.1)
78
78
  rack (>= 1.1)
@@ -89,7 +89,7 @@ GEM
89
89
  unicode-display_width (3.2.0)
90
90
  unicode-emoji (~> 4.1)
91
91
  unicode-emoji (4.1.0)
92
- uri (1.0.3)
92
+ uri (1.0.4)
93
93
  vcr (6.3.1)
94
94
  base64
95
95
 
data/README.md CHANGED
@@ -149,6 +149,13 @@ This library includes the ability to create, refresh and revoke OAuth tokens.
149
149
  @client.users.emotes(user_id: 123)
150
150
  @client.users.emotes(user_id: 123, broadcaster_id: 321)
151
151
  @client.users.emotes(user_id: 123, after: "abc123")
152
+
153
+ # Gets the authorization scopes that the specified user(s) have granted the application. Takes a single User ID or multiple as an array.
154
+ # Requires an App Access Token
155
+ # Returns a collection of Twitch::UserAuthorization's
156
+ # #<Twitch::UserAuthorization user_id="72938118", user_name="deanpcmad", user_login="deanpcmad", scopes=["user:read:email"], has_authorized=true>
157
+ @client.users.authorization(id: 123)
158
+ @client.users.authorization(ids: [123, 321])
152
159
  ```
153
160
 
154
161
  ### Channels
@@ -0,0 +1,4 @@
1
+ module Twitch
2
+ class UserAuthorization < Object
3
+ end
4
+ end
@@ -93,5 +93,17 @@ module Twitch
93
93
  response = get_request("chat/emotes/user", params: attrs.merge(params))
94
94
  Collection.from_response(response, type: Emote)
95
95
  end
96
+
97
+ def authorization(id: nil, ids: nil)
98
+ raise "Either id or ids is required" unless !id.nil? || !ids.nil?
99
+
100
+ if id
101
+ response = get_request("authorization/users", params: { user_id: id })
102
+ elsif ids
103
+ response = get_request("authorization/users", params: { user_id: ids })
104
+ end
105
+
106
+ Collection.from_response(response, type: UserAuthorization)
107
+ end
96
108
  end
97
109
  end
@@ -1,3 +1,3 @@
1
1
  module Twitch
2
- VERSION = "1.6.0"
2
+ VERSION = "1.7.0"
3
3
  end
data/lib/twitch.rb CHANGED
@@ -99,4 +99,5 @@ module Twitch
99
99
  autoload :ChatMessage, "twitch/objects/chat_message"
100
100
  autoload :UnbanRequest, "twitch/objects/unban_request"
101
101
  autoload :Warning, "twitch/objects/warning"
102
+ autoload :UserAuthorization, "twitch/objects/user_authorization"
102
103
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitchrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
@@ -101,6 +101,7 @@ files:
101
101
  - lib/twitch/objects/tag.rb
102
102
  - lib/twitch/objects/unban_request.rb
103
103
  - lib/twitch/objects/user.rb
104
+ - lib/twitch/objects/user_authorization.rb
104
105
  - lib/twitch/objects/user_color.rb
105
106
  - lib/twitch/objects/video.rb
106
107
  - lib/twitch/objects/vip.rb
@@ -167,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  - !ruby/object:Gem::Version
168
169
  version: '0'
169
170
  requirements: []
170
- rubygems_version: 3.6.7
171
+ rubygems_version: 3.7.2
171
172
  specification_version: 4
172
173
  summary: A Ruby library for interacting with the Twitch Helix API
173
174
  test_files: []