octokit 9.2.0 → 10.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 +4 -4
- data/README.md +1 -1
- data/lib/octokit/client/apps.rb +21 -69
- data/lib/octokit/client/reactions.rb +16 -0
- data/lib/octokit/error.rb +2 -0
- data/lib/octokit/version.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f38242e8e316fd62d03bc00b2d912f10dee6d88f7ccaa27d5b80af886c53d55
|
4
|
+
data.tar.gz: ea7d9c47a13fe18e8f54a7f9ed3db6e7b776eb91a0ebe7ceb91eab5f7742faa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b74062227c7bfc90d1efc64cbfddf6cf3eb5cc0d4d3c765d5500f0ace01e588f11b635e860536582dbae1734c57c780562a761eec3cfad7cd0b4dfc6b44240f8
|
7
|
+
data.tar.gz: 61fb7f011f61d853e1511384644cd36c6c3ddafb7ca38ad554f688ea321da3182748b9c065a6b8b7af46364ba361342c447c07ff9927d71788bde8b93a57dd6d
|
data/README.md
CHANGED
@@ -597,7 +597,7 @@ traffic:
|
|
597
597
|
|
598
598
|
```ruby
|
599
599
|
stack = Faraday::RackBuilder.new do |builder|
|
600
|
-
builder.use Faraday::Retry::Middleware, exceptions: Faraday::
|
600
|
+
builder.use Faraday::Retry::Middleware, exceptions: Faraday::Retry::Middleware::DEFAULT_EXCEPTIONS + [Octokit::ServerError] # or Faraday::Request::Retry for Faraday < 2.0
|
601
601
|
builder.use Octokit::Middleware::FollowRedirects
|
602
602
|
builder.use Octokit::Response::RaiseError
|
603
603
|
builder.use Octokit::Response::FeedParser
|
data/lib/octokit/client/apps.rb
CHANGED
@@ -8,53 +8,45 @@ module Octokit
|
|
8
8
|
#
|
9
9
|
# @param options [Hash] A customizable set of options
|
10
10
|
#
|
11
|
-
# @see https://
|
11
|
+
# @see https://docs.github.com/en/rest/apps/apps#get-the-authenticated-app
|
12
12
|
#
|
13
13
|
# @return [Sawyer::Resource] App information
|
14
14
|
def app(options = {})
|
15
15
|
get 'app', options
|
16
16
|
end
|
17
17
|
|
18
|
-
#
|
18
|
+
# List all installations that belong to an App
|
19
19
|
#
|
20
20
|
# @param options [Hash] A customizable set of options
|
21
21
|
#
|
22
|
-
# @see https://
|
22
|
+
# @see https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app
|
23
23
|
#
|
24
24
|
# @return [Array<Sawyer::Resource>] the total_count and an array of installations
|
25
|
-
def
|
25
|
+
def list_app_installations(options = {})
|
26
26
|
paginate 'app/installations', options
|
27
27
|
end
|
28
|
-
alias find_installations
|
28
|
+
alias find_installations list_app_installations
|
29
|
+
alias find_app_installations list_app_installations
|
29
30
|
|
30
|
-
|
31
|
-
octokit_warn(
|
32
|
-
'Deprecated: Octokit::Client::Apps#find_integration_installations ' \
|
33
|
-
'method is deprecated. Please update your call to use ' \
|
34
|
-
'Octokit::Client::Apps#find_app_installations before the next major ' \
|
35
|
-
'Octokit version update.'
|
36
|
-
)
|
37
|
-
find_app_installations(options)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Find all installations that are accessible to the authenticated user
|
31
|
+
# List all installations that are accessible to the authenticated user
|
41
32
|
#
|
42
33
|
# @param options [Hash] A customizable set of options
|
43
34
|
#
|
44
|
-
# @see https://
|
35
|
+
# @see https://docs.github.com/en/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token
|
45
36
|
#
|
46
37
|
# @return [Sawyer::Resource] the total_count and an array of installations
|
47
|
-
def
|
38
|
+
def list_user_installations(options = {})
|
48
39
|
paginate('user/installations', options) do |data, last_response|
|
49
40
|
data.installations.concat last_response.data.installations
|
50
41
|
end
|
51
42
|
end
|
43
|
+
alias find_user_installations list_user_installations
|
52
44
|
|
53
45
|
# Get a single installation
|
54
46
|
#
|
55
47
|
# @param id [Integer] Installation id
|
56
48
|
#
|
57
|
-
# @see https://
|
49
|
+
# @see https://docs.github.com/en/rest/apps/apps#get-an-installation-for-the-authenticated-app
|
58
50
|
#
|
59
51
|
# @return [Sawyer::Resource] Installation information
|
60
52
|
def installation(id, options = {})
|
@@ -66,7 +58,7 @@ module Octokit
|
|
66
58
|
# @param installation [Integer] The id of a GitHub App Installation
|
67
59
|
# @param options [Hash] A customizable set of options
|
68
60
|
#
|
69
|
-
# @see https://
|
61
|
+
# @see https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app
|
70
62
|
#
|
71
63
|
# @return [<Sawyer::Resource>] An installation token
|
72
64
|
def create_app_installation_access_token(installation, options = {})
|
@@ -74,22 +66,12 @@ module Octokit
|
|
74
66
|
end
|
75
67
|
alias create_installation_access_token create_app_installation_access_token
|
76
68
|
|
77
|
-
def create_integration_installation_access_token(installation, options = {})
|
78
|
-
octokit_warn(
|
79
|
-
'Deprecated: Octokit::Client::Apps#create_integration_installation_access_token ' \
|
80
|
-
'method is deprecated. Please update your call to use ' \
|
81
|
-
'Octokit::Client::Apps#create_app_installation_access_token before the next major ' \
|
82
|
-
'Octokit version update.'
|
83
|
-
)
|
84
|
-
create_app_installation_access_token(installation, options)
|
85
|
-
end
|
86
|
-
|
87
69
|
# Enables an app to find the organization's installation information.
|
88
70
|
#
|
89
71
|
# @param organization [String] Organization GitHub login
|
90
72
|
# @param options [Hash] A customizable set of options
|
91
73
|
#
|
92
|
-
# @see https://
|
74
|
+
# @see https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app
|
93
75
|
#
|
94
76
|
# @return [Sawyer::Resource] Installation information
|
95
77
|
def find_organization_installation(organization, options = {})
|
@@ -101,7 +83,7 @@ module Octokit
|
|
101
83
|
# @param repo [String] A GitHub repository
|
102
84
|
# @param options [Hash] A customizable set of options
|
103
85
|
#
|
104
|
-
# @see https://
|
86
|
+
# @see https://docs.github.com/en/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app
|
105
87
|
#
|
106
88
|
# @return [Sawyer::Resource] Installation information
|
107
89
|
def find_repository_installation(repo, options = {})
|
@@ -113,7 +95,7 @@ module Octokit
|
|
113
95
|
# @param user [String] GitHub user login
|
114
96
|
# @param options [Hash] A customizable set of options
|
115
97
|
#
|
116
|
-
# @see https://
|
98
|
+
# @see https://docs.github.com/en/rest/apps/apps#get-a-user-installation-for-the-authenticated-app
|
117
99
|
#
|
118
100
|
# @return [Sawyer::Resource] Installation information
|
119
101
|
def find_user_installation(user, options = {})
|
@@ -124,7 +106,7 @@ module Octokit
|
|
124
106
|
#
|
125
107
|
# @param options [Hash] A customizable set of options
|
126
108
|
#
|
127
|
-
# @see https://
|
109
|
+
# @see https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-app-installation
|
128
110
|
#
|
129
111
|
# @return [Sawyer::Resource] the total_count and an array of repositories
|
130
112
|
def list_app_installation_repositories(options = {})
|
@@ -134,23 +116,13 @@ module Octokit
|
|
134
116
|
end
|
135
117
|
alias list_installation_repos list_app_installation_repositories
|
136
118
|
|
137
|
-
def list_integration_installation_repositories(options = {})
|
138
|
-
octokit_warn(
|
139
|
-
'Deprecated: Octokit::Client::Apps#list_integration_installation_repositories ' \
|
140
|
-
'method is deprecated. Please update your call to use ' \
|
141
|
-
'Octokit::Client::Apps#list_app_installation_repositories before the next major ' \
|
142
|
-
'Octokit version update.'
|
143
|
-
)
|
144
|
-
list_app_installation_repositories(options)
|
145
|
-
end
|
146
|
-
|
147
119
|
# Add a single repository to an installation
|
148
120
|
#
|
149
121
|
# @param installation [Integer] The id of a GitHub App Installation
|
150
122
|
# @param repo [Integer] The id of the GitHub repository
|
151
123
|
# @param options [Hash] A customizable set of options
|
152
124
|
#
|
153
|
-
# @see https://
|
125
|
+
# @see https://docs.github.com/en/rest/apps/installations#add-a-repository-to-an-app-installation
|
154
126
|
#
|
155
127
|
# @return [Boolean] Success
|
156
128
|
def add_repository_to_app_installation(installation, repo, options = {})
|
@@ -158,23 +130,13 @@ module Octokit
|
|
158
130
|
end
|
159
131
|
alias add_repo_to_installation add_repository_to_app_installation
|
160
132
|
|
161
|
-
def add_repository_to_integration_installation(installation, repo, options = {})
|
162
|
-
octokit_warn(
|
163
|
-
'Deprecated: Octokit::Client::Apps#add_repository_to_integration_installation ' \
|
164
|
-
'method is deprecated. Please update your call to use ' \
|
165
|
-
'Octokit::Client::Apps#add_repository_to_app_installation before the next major ' \
|
166
|
-
'Octokit version update.'
|
167
|
-
)
|
168
|
-
add_repository_to_app_installation(installation, repo, options)
|
169
|
-
end
|
170
|
-
|
171
133
|
# Remove a single repository to an installation
|
172
134
|
#
|
173
135
|
# @param installation [Integer] The id of a GitHub App Installation
|
174
136
|
# @param repo [Integer] The id of the GitHub repository
|
175
137
|
# @param options [Hash] A customizable set of options
|
176
138
|
#
|
177
|
-
# @see https://
|
139
|
+
# @see https://docs.github.com/en/rest/apps/installations#remove-a-repository-from-an-app-installation
|
178
140
|
#
|
179
141
|
# @return [Boolean] Success
|
180
142
|
def remove_repository_from_app_installation(installation, repo, options = {})
|
@@ -182,22 +144,12 @@ module Octokit
|
|
182
144
|
end
|
183
145
|
alias remove_repo_from_installation remove_repository_from_app_installation
|
184
146
|
|
185
|
-
def remove_repository_from_integration_installation(installation, repo, options = {})
|
186
|
-
octokit_warn(
|
187
|
-
'Deprecated: Octokit::Client::Apps#remove_repository_from_integration_installation ' \
|
188
|
-
'method is deprecated. Please update your call to use ' \
|
189
|
-
'Octokit::Client::Apps#remove_repository_from_app_installation before the next major ' \
|
190
|
-
'Octokit version update.'
|
191
|
-
)
|
192
|
-
remove_repository_from_app_installation(installation, repo, options)
|
193
|
-
end
|
194
|
-
|
195
147
|
# List repositories accessible to the user for an installation
|
196
148
|
#
|
197
149
|
# @param installation [Integer] The id of a GitHub App Installation
|
198
150
|
# @param options [Hash] A customizable set of options
|
199
151
|
#
|
200
|
-
# @see https://
|
152
|
+
# @see https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-user-access-token
|
201
153
|
#
|
202
154
|
# @return [Sawyer::Resource] the total_count and an array of repositories
|
203
155
|
def find_installation_repositories_for_user(installation, options = {})
|
@@ -211,7 +163,7 @@ module Octokit
|
|
211
163
|
# @param installation [Integer] The id of a GitHub App Installation
|
212
164
|
# @param options [Hash] A customizable set of options
|
213
165
|
#
|
214
|
-
# @see https://
|
166
|
+
# @see https://docs.github.com/en/rest/apps/apps#delete-an-installation-for-the-authenticated-app
|
215
167
|
#
|
216
168
|
# @return [Boolean] Success
|
217
169
|
def delete_installation(installation, options = {})
|
@@ -248,7 +200,7 @@ module Octokit
|
|
248
200
|
# @param delivery_id [Integer] The id of a GitHub App Hook Delivery
|
249
201
|
# @param options [Hash] A customizable set of options
|
250
202
|
#
|
251
|
-
# @see https://
|
203
|
+
# @see https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook
|
252
204
|
#
|
253
205
|
# @return [Boolean] Success
|
254
206
|
def deliver_app_hook(delivery_id, options = {})
|
@@ -102,6 +102,22 @@ module Octokit
|
|
102
102
|
post "#{Repository.path repo}/issues/comments/#{id}/reactions", options
|
103
103
|
end
|
104
104
|
|
105
|
+
# Delete a reaction from an issue comment
|
106
|
+
#
|
107
|
+
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
108
|
+
# @param comment_id [Integer] The Issue comment id
|
109
|
+
# @param reaction_id [Integer] The Reaction id
|
110
|
+
#
|
111
|
+
# @see https://docs.github.com/en/rest/reactions/reactions#delete-an-issue-comment-reaction
|
112
|
+
#
|
113
|
+
# @example
|
114
|
+
# @client.delete_issue_comment_reaction("octokit/octokit.rb", 1, 2)
|
115
|
+
#
|
116
|
+
# @return [Boolean] Return true if reaction was deleted, false otherwise.
|
117
|
+
def delete_issue_comment_reaction(repo, comment_id, reaction_id, options = {})
|
118
|
+
boolean_from_response :delete, "#{Repository.path repo}/issues/comments/#{comment_id}/reactions/#{reaction_id}", options
|
119
|
+
end
|
120
|
+
|
105
121
|
# List reactions for a pull request review comment
|
106
122
|
#
|
107
123
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
data/lib/octokit/error.rb
CHANGED
@@ -191,6 +191,8 @@ module Octokit
|
|
191
191
|
return nil unless data.is_a?(Hash) && !Array(data[:errors]).empty?
|
192
192
|
|
193
193
|
summary = +"\nError summary:\n"
|
194
|
+
return summary << data[:errors] if data[:errors].is_a?(String)
|
195
|
+
|
194
196
|
summary << data[:errors].map do |error|
|
195
197
|
if error.is_a? Hash
|
196
198
|
error.map { |k, v| " #{k}: #{v}" }
|
data/lib/octokit/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octokit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 10.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wynn Netherland
|
8
8
|
- Erik Michaels-Ober
|
9
9
|
- Clint Shryock
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2025-04-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -153,7 +153,7 @@ licenses:
|
|
153
153
|
- MIT
|
154
154
|
metadata:
|
155
155
|
rubygems_mfa_required: 'true'
|
156
|
-
post_install_message:
|
156
|
+
post_install_message:
|
157
157
|
rdoc_options: []
|
158
158
|
require_paths:
|
159
159
|
- lib
|
@@ -168,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: 1.3.5
|
170
170
|
requirements: []
|
171
|
-
rubygems_version: 3.0.
|
172
|
-
signing_key:
|
171
|
+
rubygems_version: 3.4.0.dev
|
172
|
+
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: Ruby toolkit for working with the GitHub API
|
175
175
|
test_files: []
|