esi-sdk 1.1.2 → 2.1.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/.github/workflows/cicd.yml +17 -2
- data/.gitignore +2 -0
- data/CHANGELOG.md +38 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +21 -40
- data/README.md +2 -0
- data/Rakefile +75 -37
- data/bin/console +1 -1
- data/esi-sdk.gemspec +2 -3
- data/lib/esi/client/alliance.rb +103 -10
- data/lib/esi/client/assets.rb +193 -18
- data/lib/esi/client/bookmarks.rb +130 -12
- data/lib/esi/client/calendar.rb +144 -16
- data/lib/esi/client/character.rb +414 -42
- data/lib/esi/client/clones.rb +65 -6
- data/lib/esi/client/contacts.rb +294 -30
- data/lib/esi/client/contracts.rb +294 -31
- data/lib/esi/client/corporation.rb +755 -152
- data/lib/esi/client/dogma.rb +118 -12
- data/lib/esi/client/faction_warfare.rb +198 -14
- data/lib/esi/client/fittings.rb +94 -10
- data/lib/esi/client/fleets.rb +469 -49
- data/lib/esi/client/incursions.rb +23 -1
- data/lib/esi/client/industry.rb +250 -23
- data/lib/esi/client/insurance.rb +23 -1
- data/lib/esi/client/killmails.rb +95 -10
- data/lib/esi/client/location.rb +98 -9
- data/lib/esi/client/loyalty.rb +57 -6
- data/lib/esi/client/mail.rb +262 -28
- data/lib/esi/client/market.rb +322 -34
- data/lib/esi/client/opportunities.rb +124 -13
- data/lib/esi/client/planetary_interaction.rb +124 -13
- data/lib/esi/client/routes.rb +34 -6
- data/lib/esi/client/search.rb +64 -7
- data/lib/esi/client/skills.rb +95 -9
- data/lib/esi/client/sovereignty.rb +69 -3
- data/lib/esi/client/status.rb +24 -1
- data/lib/esi/client/universe.rb +817 -194
- data/lib/esi/client/user_interface.rb +157 -14
- data/lib/esi/client/wallet.rb +199 -22
- data/lib/esi/client/wars.rb +81 -9
- data/lib/esi/client.rb +74 -82
- data/lib/esi/errors.rb +12 -1
- data/lib/esi/version.rb +1 -1
- data/package.json +19 -0
- data/release.config.js +2 -2
- data/yarn.lock +3695 -0
- metadata +10 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0792d0a5356452963fc5a91496c0344add3d4cc9efa29debc185713bd294cb70'
|
4
|
+
data.tar.gz: a13e39a46b2d958c4fc9bb4dfe4c73f42d3e8fb070592a980e9b1b1f510bdfa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44468ca22260a2c6cb6a13f5d10021448e9e01a03de1216c2a50122b138fa24992bae8775f5b8afda41d7de701aca2417ef3a3cd24f8bfabb70f787f3293021d
|
7
|
+
data.tar.gz: 889a62e3d428345ca4378acaacb2aeb8c4b32e0a503f7ad02b6d08af5ebfbf01fb6fb3341c619f8ebe8cd999fecd0db729141657ccb30fa430777d7e106aac51
|
data/.github/workflows/cicd.yml
CHANGED
@@ -168,6 +168,22 @@ jobs:
|
|
168
168
|
with:
|
169
169
|
node-version: '16'
|
170
170
|
|
171
|
+
- name: Find yarn cache location
|
172
|
+
id: yarn-cache
|
173
|
+
run: echo "::set-output name=dir::$(yarn cache dir)"
|
174
|
+
|
175
|
+
- name: Yarn package cache
|
176
|
+
uses: actions/cache@v2
|
177
|
+
with:
|
178
|
+
path: ${{ steps.yarn-cache.outputs.dir }}
|
179
|
+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
180
|
+
restore-keys: |
|
181
|
+
${{ runner.os }}-yarn-
|
182
|
+
|
183
|
+
- name: Install yarn packages
|
184
|
+
run: |
|
185
|
+
yarn install --pure-lockfile
|
186
|
+
|
171
187
|
- name: Release
|
172
188
|
env:
|
173
189
|
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
@@ -177,5 +193,4 @@ jobs:
|
|
177
193
|
GIT_COMMITTER_EMAIL: "shahni@bokobo.space"
|
178
194
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
179
195
|
run: |
|
180
|
-
|
181
|
-
npx semantic-release ${{ github.event_name == 'pull_request' && '--dry-run' || ' ' }}
|
196
|
+
yarn release ${{ github.event_name == 'pull_request' && '--dry-run' || ' ' }}
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,43 @@
|
|
1
1
|
# ESI SDK Changelog
|
2
2
|
|
3
|
+
# [2.1.0](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v2.0.0...v2.1.0) (2021-10-09)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* add methods to return raw responses ([93dc308](https://github.com/bokoboshahni/esi-sdk-ruby/commit/93dc3082cf06b0b4e42e17e3de77c9e05e3345b5))
|
9
|
+
|
10
|
+
# [2.0.0](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v1.2.0...v2.0.0) (2021-10-08)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* require name from esi/sdk to esi-sdk ([2e5e996](https://github.com/bokoboshahni/esi-sdk-ruby/commit/2e5e9966343baef91bd037579607bb562edce301))
|
16
|
+
|
17
|
+
|
18
|
+
### Features
|
19
|
+
|
20
|
+
* migrate to httpx ([fd6ec0d](https://github.com/bokoboshahni/esi-sdk-ruby/commit/fd6ec0d6910805215efceb80a5361dc4d72b9599))
|
21
|
+
|
22
|
+
|
23
|
+
### BREAKING CHANGES
|
24
|
+
|
25
|
+
* use httpx instead of faraday for http calls
|
26
|
+
|
27
|
+
# [1.2.0](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v1.1.3...v1.2.0) (2021-07-20)
|
28
|
+
|
29
|
+
|
30
|
+
### Features
|
31
|
+
|
32
|
+
* Client improvements ([bad70ae](https://github.com/bokoboshahni/esi-sdk-ruby/commit/bad70ae4d97b8b0f93019b5b4dac73f97aad7dc0))
|
33
|
+
|
34
|
+
## [1.1.3](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v1.1.2...v1.1.3) (2021-07-19)
|
35
|
+
|
36
|
+
|
37
|
+
### Bug Fixes
|
38
|
+
|
39
|
+
* Use double splat for cache options ([db32f35](https://github.com/bokoboshahni/esi-sdk-ruby/commit/db32f35fe1737af8a856720366829d2da8a036de))
|
40
|
+
|
3
41
|
## [1.1.2](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v1.1.1...v1.1.2) (2021-07-19)
|
4
42
|
|
5
43
|
## [1.1.1](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v1.1.0...v1.1.1) (2021-07-19)
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
esi-sdk (
|
5
|
-
|
6
|
-
|
7
|
-
faraday_middleware (~> 1.0)
|
4
|
+
esi-sdk (2.1.0)
|
5
|
+
httpx (~> 0.18)
|
6
|
+
retriable (~> 3.1)
|
8
7
|
|
9
8
|
GEM
|
10
9
|
remote: https://rubygems.org/
|
11
10
|
specs:
|
12
|
-
activesupport (6.1.4)
|
11
|
+
activesupport (6.1.4.1)
|
13
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
13
|
i18n (>= 1.6, < 2)
|
15
14
|
minitest (>= 5.1)
|
@@ -18,33 +17,16 @@ GEM
|
|
18
17
|
addressable (2.8.0)
|
19
18
|
public_suffix (>= 2.0.2, < 5.0)
|
20
19
|
ast (2.4.2)
|
20
|
+
awesome_print (1.9.2)
|
21
21
|
concurrent-ruby (1.1.9)
|
22
22
|
crack (0.4.5)
|
23
23
|
rexml
|
24
24
|
diff-lcs (1.4.4)
|
25
25
|
docile (1.4.0)
|
26
|
-
faraday (1.5.1)
|
27
|
-
faraday-em_http (~> 1.0)
|
28
|
-
faraday-em_synchrony (~> 1.0)
|
29
|
-
faraday-excon (~> 1.1)
|
30
|
-
faraday-httpclient (~> 1.0.1)
|
31
|
-
faraday-net_http (~> 1.0)
|
32
|
-
faraday-net_http_persistent (~> 1.1)
|
33
|
-
faraday-patron (~> 1.0)
|
34
|
-
multipart-post (>= 1.2, < 3)
|
35
|
-
ruby2_keywords (>= 0.0.4)
|
36
|
-
faraday-em_http (1.0.0)
|
37
|
-
faraday-em_synchrony (1.0.0)
|
38
|
-
faraday-excon (1.1.0)
|
39
|
-
faraday-http-cache (2.2.0)
|
40
|
-
faraday (>= 0.8)
|
41
|
-
faraday-httpclient (1.0.1)
|
42
|
-
faraday-net_http (1.0.1)
|
43
|
-
faraday-net_http_persistent (1.2.0)
|
44
|
-
faraday-patron (1.0.0)
|
45
|
-
faraday_middleware (1.0.0)
|
46
|
-
faraday (~> 1.0)
|
47
26
|
hashdiff (1.0.1)
|
27
|
+
http-2-next (0.5.0)
|
28
|
+
httpx (0.18.0)
|
29
|
+
http-2-next (>= 0.4.1)
|
48
30
|
i18n (1.8.10)
|
49
31
|
concurrent-ruby (~> 1.0)
|
50
32
|
kramdown (2.3.1)
|
@@ -52,16 +34,16 @@ GEM
|
|
52
34
|
kramdown-parser-gfm (1.1.0)
|
53
35
|
kramdown (~> 2.0)
|
54
36
|
minitest (5.14.4)
|
55
|
-
|
56
|
-
parallel (1.20.1)
|
37
|
+
parallel (1.21.0)
|
57
38
|
parser (3.0.2.0)
|
58
39
|
ast (~> 2.4.1)
|
59
40
|
public_suffix (4.0.6)
|
60
41
|
rainbow (3.0.0)
|
61
42
|
rake (13.0.6)
|
62
43
|
regexp_parser (2.1.1)
|
44
|
+
retriable (3.1.2)
|
63
45
|
rexml (3.2.5)
|
64
|
-
rouge (3.26.
|
46
|
+
rouge (3.26.1)
|
65
47
|
rspec (3.10.0)
|
66
48
|
rspec-core (~> 3.10.0)
|
67
49
|
rspec-expectations (~> 3.10.0)
|
@@ -75,27 +57,25 @@ GEM
|
|
75
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
76
58
|
rspec-support (~> 3.10.0)
|
77
59
|
rspec-support (3.10.2)
|
78
|
-
rubocop (1.
|
60
|
+
rubocop (1.22.1)
|
79
61
|
parallel (~> 1.10)
|
80
62
|
parser (>= 3.0.0.0)
|
81
63
|
rainbow (>= 2.2.2, < 4.0)
|
82
64
|
regexp_parser (>= 1.8, < 3.0)
|
83
65
|
rexml
|
84
|
-
rubocop-ast (>= 1.
|
66
|
+
rubocop-ast (>= 1.12.0, < 2.0)
|
85
67
|
ruby-progressbar (~> 1.7)
|
86
68
|
unicode-display_width (>= 1.4.0, < 3.0)
|
87
|
-
rubocop-ast (1.
|
69
|
+
rubocop-ast (1.12.0)
|
88
70
|
parser (>= 3.0.1.1)
|
89
|
-
rubocop-performance (1.11.
|
71
|
+
rubocop-performance (1.11.5)
|
90
72
|
rubocop (>= 1.7.0, < 2.0)
|
91
73
|
rubocop-ast (>= 0.4.0)
|
92
74
|
rubocop-rake (0.6.0)
|
93
75
|
rubocop (~> 1.0)
|
94
|
-
rubocop-rspec (2.
|
95
|
-
rubocop (~> 1.
|
96
|
-
rubocop-ast (>= 1.1.0)
|
76
|
+
rubocop-rspec (2.5.0)
|
77
|
+
rubocop (~> 1.19)
|
97
78
|
ruby-progressbar (1.11.0)
|
98
|
-
ruby2_keywords (0.0.5)
|
99
79
|
simplecov (0.21.2)
|
100
80
|
docile (~> 1.1)
|
101
81
|
simplecov-html (~> 0.11)
|
@@ -104,10 +84,10 @@ GEM
|
|
104
84
|
simplecov_json_formatter (0.1.3)
|
105
85
|
tzinfo (2.0.4)
|
106
86
|
concurrent-ruby (~> 1.0)
|
107
|
-
unicode-display_width (2.
|
87
|
+
unicode-display_width (2.1.0)
|
108
88
|
vcr (6.0.0)
|
109
|
-
webmock (3.
|
110
|
-
addressable (>= 2.
|
89
|
+
webmock (3.14.0)
|
90
|
+
addressable (>= 2.8.0)
|
111
91
|
crack (>= 0.3.2)
|
112
92
|
hashdiff (>= 0.4.0, < 2.0.0)
|
113
93
|
yard (0.9.26)
|
@@ -119,6 +99,7 @@ PLATFORMS
|
|
119
99
|
|
120
100
|
DEPENDENCIES
|
121
101
|
activesupport (~> 6.1)
|
102
|
+
awesome_print (~> 1.9)
|
122
103
|
esi-sdk!
|
123
104
|
kramdown-parser-gfm (~> 1.1)
|
124
105
|
rake (~> 13.0)
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -120,6 +120,7 @@ task :generate do
|
|
120
120
|
module_name = tag.gsub(/ /, "_").classify
|
121
121
|
method_definitions = operations.sort_by { |(k, _v)| k }.each_with_object([]) do |(method_name, operation), a|
|
122
122
|
signature_params = operation[:params].map { |p| "#{p["name"]}:" }
|
123
|
+
raw_call_params = operation[:params].map { |p| "#{p["name"]}: #{p["name"]}" }
|
123
124
|
|
124
125
|
description = "# #{operation[:description]}"
|
125
126
|
description = "#{description}." unless description.end_with?(".")
|
@@ -142,7 +143,7 @@ task :generate do
|
|
142
143
|
end
|
143
144
|
|
144
145
|
param_tags = operation[:params].map do |p|
|
145
|
-
"# @param #{p["name"]} [
|
146
|
+
"# @param #{p["name"]} [#{p["type"].capitalize}] #{p["description"]}"
|
146
147
|
end
|
147
148
|
|
148
149
|
if operation[:body]
|
@@ -157,18 +158,35 @@ task :generate do
|
|
157
158
|
end
|
158
159
|
|
159
160
|
signature_params << "#{body_name}:"
|
161
|
+
raw_call_params << "#{body_name}: #{body_name}"
|
160
162
|
param_tags += ["# @param #{body_name} [#{body_type}] #{body_param["description"]}"]
|
161
163
|
end
|
162
164
|
|
163
165
|
operation[:query]&.each do |p|
|
164
|
-
|
165
|
-
|
166
|
+
p_tag = "# @param #{p["name"]} [#{p["type"].capitalize}] "
|
167
|
+
p_tag += (p["description"]).to_s
|
168
|
+
p_tag += ". Must be one of: #{p["enum"].map { |e| "`#{e}`" }.join(", ")}" if p["enum"]
|
169
|
+
p_str = if p["default"] && p["type"] == "integer"
|
170
|
+
"#{p["name"]}: #{p["default"]}"
|
171
|
+
elsif p["default"] && p["type"] == "string"
|
172
|
+
"#{p["name"]}: \"#{p["default"]}\""
|
173
|
+
elsif !p["required"]
|
174
|
+
"#{p["name"]}: nil"
|
175
|
+
else
|
176
|
+
"#{p["name"]}:"
|
177
|
+
end
|
178
|
+
signature_params << p_str
|
179
|
+
raw_call_params << "#{p["name"]}: #{p["name"]}"
|
180
|
+
param_tags << p_tag
|
166
181
|
end
|
167
182
|
|
168
|
-
|
169
|
-
|
170
|
-
|
183
|
+
signature_params += %w[headers params].map do |p|
|
184
|
+
"#{p}: {}"
|
185
|
+
end
|
186
|
+
raw_call_params += %w[headers params].map do |p|
|
187
|
+
"#{p}: #{p}"
|
171
188
|
end
|
189
|
+
param_tags << "# @param params [Hash] Additional query string parameters"
|
172
190
|
|
173
191
|
param_tags += [
|
174
192
|
"# @param headers [Hash] Additional headers"
|
@@ -188,10 +206,8 @@ task :generate do
|
|
188
206
|
description += "# @see https://esi.evetech.net/ui/#/#{operation[:tag]}/#{operation[:name]}"
|
189
207
|
description.gsub!(/^$\n/m, "")
|
190
208
|
|
191
|
-
signature_params += %w[headers].map do |p|
|
192
|
-
"#{p}: {}"
|
193
|
-
end
|
194
209
|
signature = "(#{signature_params.join(", ")})"
|
210
|
+
raw_call = "(#{raw_call_params.join(", ")})"
|
195
211
|
path_parts = operation[:path].split("/")
|
196
212
|
path_parts.map! do |p|
|
197
213
|
if p =~ /\{\w+\}/
|
@@ -202,19 +218,16 @@ task :generate do
|
|
202
218
|
end
|
203
219
|
path = "#{path_parts.join("/")}/"
|
204
220
|
|
205
|
-
http_call_params = %w[headers].map { |p| "#{p}: #{p}" }
|
206
|
-
http_call_params <<
|
207
|
-
"params: params"
|
208
|
-
elsif operation[:body]
|
209
|
-
"payload: #{body_param["name"]}"
|
210
|
-
end
|
221
|
+
http_call_params = %w[headers params].map { |p| "#{p}: #{p}" }
|
222
|
+
http_call_params << ("payload: #{body_param["name"]}" if operation[:body])
|
211
223
|
|
212
|
-
if operation[:query].any?
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
224
|
+
params_merge = if operation[:query].any?
|
225
|
+
"params.merge!(#{operation[:query].map { |q| "'#{q["name"]}' => #{q["name"]}" }.join(", ")})"
|
226
|
+
else
|
227
|
+
""
|
228
|
+
end
|
229
|
+
|
230
|
+
http_call = "#{operation[:method]}(\"#{path}\", #{http_call_params.join(", ")})"
|
218
231
|
|
219
232
|
alias_methods = if method_aliases[method_name]
|
220
233
|
Array(method_aliases[method_name]).sort.map do |alias_name|
|
@@ -226,13 +239,37 @@ task :generate do
|
|
226
239
|
alias_methods << "alias_method :#{operation[:name]}, :#{method_name}" unless operation[:name] == method_name
|
227
240
|
alias_methods = alias_methods.join("\n")
|
228
241
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
#{
|
233
|
-
|
234
|
-
|
235
|
-
|
242
|
+
if operation[:responses]["200"] && operation[:responses]["200"]["headers"] && operation[:responses]["200"]["headers"].key?("X-Pages")
|
243
|
+
a << <<~METHOD_DEFINITION
|
244
|
+
#{description}
|
245
|
+
def #{method_name}#{signature}
|
246
|
+
#{params_merge}
|
247
|
+
responses = #{method_name}_raw#{raw_call}
|
248
|
+
responses.map(&:json).reduce([], :concat)
|
249
|
+
end
|
250
|
+
#{alias_methods}
|
251
|
+
|
252
|
+
#{description}
|
253
|
+
def #{method_name}_raw#{signature}
|
254
|
+
#{params_merge}
|
255
|
+
#{http_call}
|
256
|
+
end
|
257
|
+
METHOD_DEFINITION
|
258
|
+
else
|
259
|
+
a << <<~METHOD_DEFINITION
|
260
|
+
#{description}
|
261
|
+
def #{method_name}#{signature}
|
262
|
+
#{method_name}_raw#{raw_call}.json
|
263
|
+
end
|
264
|
+
#{alias_methods}
|
265
|
+
|
266
|
+
#{description}
|
267
|
+
def #{method_name}_raw#{signature}
|
268
|
+
#{params_merge}
|
269
|
+
#{http_call}
|
270
|
+
end
|
271
|
+
METHOD_DEFINITION
|
272
|
+
end
|
236
273
|
end
|
237
274
|
|
238
275
|
lib_content = <<~MODULE_DEFINITION
|
@@ -269,11 +306,6 @@ task :generate do
|
|
269
306
|
success_params = operation[:params].map { |p| "#{p["name"]}: \"1234567890\"" }
|
270
307
|
success_params += operation[:query].map { |p| "#{p["name"]}: \"1234567890\"" }
|
271
308
|
|
272
|
-
if operation[:query].any?
|
273
|
-
query = URI.encode_www_form(operation[:query].map { |q| [q["name"], "1234567890"] })
|
274
|
-
success_path = "#{success_path}?#{query}"
|
275
|
-
end
|
276
|
-
|
277
309
|
if operation[:body]
|
278
310
|
body_param = operation[:body]
|
279
311
|
body_name = body_param["name"]
|
@@ -287,12 +319,16 @@ task :generate do
|
|
287
319
|
success_params << "#{body_name}: #{body_value}"
|
288
320
|
end
|
289
321
|
|
322
|
+
with_query = operation[:query].any? ? ".with(query: { #{operation[:query].map { |p| "#{p["name"]}: \"1234567890\"" }.join(", ")} })" : ""
|
323
|
+
|
324
|
+
extra_headers = success_desc["headers"] && success_desc["headers"]["X-Pages"] ? ", 'X-Pages': '1'" : ""
|
325
|
+
|
290
326
|
describe = " describe \"##{method_name}\" do\n"
|
291
327
|
describe += " context \"when the response is #{success_code}\" do\n"
|
292
328
|
describe += " let(:response) { #{success_response_body} }\n"
|
293
329
|
describe += "\n"
|
294
330
|
describe += " before do\n"
|
295
|
-
describe += " stub_request(:#{operation[:method]}, \"https://esi.evetech.net/latest#{success_path}\").to_return(body: response.to_json)\n"
|
331
|
+
describe += " stub_request(:#{operation[:method]}, \"https://esi.evetech.net/latest#{success_path}\")#{with_query}.to_return(body: response.to_json, headers: { 'Content-Type': 'application/json'#{extra_headers} })\n"
|
296
332
|
describe += " end\n"
|
297
333
|
describe += "\n"
|
298
334
|
describe += " it \"returns the response\" do\n"
|
@@ -303,13 +339,15 @@ task :generate do
|
|
303
339
|
describe += "\n"
|
304
340
|
|
305
341
|
error_contexts = operation[:errors].map do |(code, error)|
|
342
|
+
next if %w[502 503 504].include?(code)
|
343
|
+
|
306
344
|
error_response_body = error["examples"]["application/json"].inspect
|
307
345
|
|
308
346
|
context = " context \"when the response is #{code}\" do\n"
|
309
347
|
context += " let(:response) { #{error_response_body} }\n"
|
310
348
|
context += "\n"
|
311
349
|
context += " before do\n"
|
312
|
-
context += " stub_request(:#{operation[:method]}, \"https://esi.evetech.net/latest#{success_path}\").to_return(body: response.to_json, status: #{code})\n"
|
350
|
+
context += " stub_request(:#{operation[:method]}, \"https://esi.evetech.net/latest#{success_path}\")#{with_query}.to_return(body: response.to_json, status: #{code}, headers: { 'Content-Type': 'application/json' })\n"
|
313
351
|
context += " end\n"
|
314
352
|
context += "\n"
|
315
353
|
context += " it \"raises a #{error_mapping[code.to_i]} error\" do\n"
|
@@ -327,8 +365,8 @@ task :generate do
|
|
327
365
|
spec_content = <<~SPEC_FILE
|
328
366
|
# frozen_string_literal: true
|
329
367
|
|
330
|
-
RSpec.describe ESI::Client::#{module_name} do
|
331
|
-
subject(:client) { ESI::Client.new(user_agent: \"
|
368
|
+
RSpec.describe ESI::Client::#{module_name}, type: :stub do
|
369
|
+
subject(:client) { ESI::Client.new(user_agent: \"esi-sdk-ruby Tests/1.0; +(https://github.com/bokoboshahni/esi-sdk-ruby)\") }
|
332
370
|
|
333
371
|
#{describe_blocks.join("\n\n")}
|
334
372
|
end
|
data/bin/console
CHANGED
data/esi-sdk.gemspec
CHANGED
@@ -26,7 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
|
29
|
-
spec.add_dependency "
|
30
|
-
spec.add_dependency "
|
31
|
-
spec.add_dependency "faraday_middleware", "~> 1.0"
|
29
|
+
spec.add_dependency "httpx", "~> 0.18"
|
30
|
+
spec.add_dependency "retriable", "~> 3.1"
|
32
31
|
end
|
data/lib/esi/client/alliance.rb
CHANGED
@@ -13,7 +13,7 @@ module ESI
|
|
13
13
|
# @esi_version v3
|
14
14
|
# @esi_version v4
|
15
15
|
#
|
16
|
-
# @param alliance_id [Integer
|
16
|
+
# @param alliance_id [Integer] An EVE alliance ID
|
17
17
|
# @param params [Hash] Additional query string parameters
|
18
18
|
# @param headers [Hash] Additional headers
|
19
19
|
#
|
@@ -25,11 +25,36 @@ module ESI
|
|
25
25
|
# @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
|
26
26
|
#
|
27
27
|
# @see https://esi.evetech.net/ui/#/Alliance/get_alliances_alliance_id
|
28
|
-
def get_alliance(alliance_id:,
|
29
|
-
|
28
|
+
def get_alliance(alliance_id:, headers: {}, params: {})
|
29
|
+
get_alliance_raw(alliance_id: alliance_id, headers: headers, params: params).json
|
30
30
|
end
|
31
31
|
alias get_alliances_alliance_id get_alliance
|
32
32
|
|
33
|
+
# Public information about an alliance.
|
34
|
+
#
|
35
|
+
# This endpoint is cached for up to 3600 seconds.
|
36
|
+
#
|
37
|
+
# @esi_version dev
|
38
|
+
# @esi_version legacy
|
39
|
+
# @esi_version v3
|
40
|
+
# @esi_version v4
|
41
|
+
#
|
42
|
+
# @param alliance_id [Integer] An EVE alliance ID
|
43
|
+
# @param params [Hash] Additional query string parameters
|
44
|
+
# @param headers [Hash] Additional headers
|
45
|
+
#
|
46
|
+
# @raise [ESI::Errors::BadRequestError] Bad request
|
47
|
+
# @raise [ESI::Errors::NotFoundError] Alliance not found
|
48
|
+
# @raise [ESI::Errors::ErrorLimitedError] Error limited
|
49
|
+
# @raise [ESI::Errors::InternalServerError] Internal server error
|
50
|
+
# @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
|
51
|
+
# @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
|
52
|
+
#
|
53
|
+
# @see https://esi.evetech.net/ui/#/Alliance/get_alliances_alliance_id
|
54
|
+
def get_alliance_raw(alliance_id:, headers: {}, params: {})
|
55
|
+
get("/alliances/#{alliance_id}/", headers: headers, params: params)
|
56
|
+
end
|
57
|
+
|
33
58
|
# List all current member corporations of an alliance.
|
34
59
|
#
|
35
60
|
# This endpoint is cached for up to 3600 seconds.
|
@@ -39,7 +64,7 @@ module ESI
|
|
39
64
|
# @esi_version v1
|
40
65
|
# @esi_version v2
|
41
66
|
#
|
42
|
-
# @param alliance_id [Integer
|
67
|
+
# @param alliance_id [Integer] An EVE alliance ID
|
43
68
|
# @param params [Hash] Additional query string parameters
|
44
69
|
# @param headers [Hash] Additional headers
|
45
70
|
#
|
@@ -50,17 +75,41 @@ module ESI
|
|
50
75
|
# @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
|
51
76
|
#
|
52
77
|
# @see https://esi.evetech.net/ui/#/Alliance/get_alliances_alliance_id_corporations
|
53
|
-
def get_alliance_corporations(alliance_id:,
|
54
|
-
|
78
|
+
def get_alliance_corporations(alliance_id:, headers: {}, params: {})
|
79
|
+
get_alliance_corporations_raw(alliance_id: alliance_id, headers: headers, params: params).json
|
55
80
|
end
|
56
81
|
alias get_alliances_alliance_id_corporations get_alliance_corporations
|
57
82
|
|
83
|
+
# List all current member corporations of an alliance.
|
84
|
+
#
|
85
|
+
# This endpoint is cached for up to 3600 seconds.
|
86
|
+
#
|
87
|
+
# @esi_version dev
|
88
|
+
# @esi_version legacy
|
89
|
+
# @esi_version v1
|
90
|
+
# @esi_version v2
|
91
|
+
#
|
92
|
+
# @param alliance_id [Integer] An EVE alliance ID
|
93
|
+
# @param params [Hash] Additional query string parameters
|
94
|
+
# @param headers [Hash] Additional headers
|
95
|
+
#
|
96
|
+
# @raise [ESI::Errors::BadRequestError] Bad request
|
97
|
+
# @raise [ESI::Errors::ErrorLimitedError] Error limited
|
98
|
+
# @raise [ESI::Errors::InternalServerError] Internal server error
|
99
|
+
# @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
|
100
|
+
# @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
|
101
|
+
#
|
102
|
+
# @see https://esi.evetech.net/ui/#/Alliance/get_alliances_alliance_id_corporations
|
103
|
+
def get_alliance_corporations_raw(alliance_id:, headers: {}, params: {})
|
104
|
+
get("/alliances/#{alliance_id}/corporations/", headers: headers, params: params)
|
105
|
+
end
|
106
|
+
|
58
107
|
# Get the icon urls for a alliance.
|
59
108
|
#
|
60
109
|
# @esi_version legacy
|
61
110
|
# @esi_version v1
|
62
111
|
#
|
63
|
-
# @param alliance_id [Integer
|
112
|
+
# @param alliance_id [Integer] An EVE alliance ID
|
64
113
|
# @param params [Hash] Additional query string parameters
|
65
114
|
# @param headers [Hash] Additional headers
|
66
115
|
#
|
@@ -72,11 +121,55 @@ module ESI
|
|
72
121
|
# @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
|
73
122
|
#
|
74
123
|
# @see https://esi.evetech.net/ui/#/Alliance/get_alliances_alliance_id_icons
|
75
|
-
def get_alliance_icons(alliance_id:,
|
76
|
-
|
124
|
+
def get_alliance_icons(alliance_id:, headers: {}, params: {})
|
125
|
+
get_alliance_icons_raw(alliance_id: alliance_id, headers: headers, params: params).json
|
77
126
|
end
|
78
127
|
alias get_alliances_alliance_id_icons get_alliance_icons
|
79
128
|
|
129
|
+
# Get the icon urls for a alliance.
|
130
|
+
#
|
131
|
+
# @esi_version legacy
|
132
|
+
# @esi_version v1
|
133
|
+
#
|
134
|
+
# @param alliance_id [Integer] An EVE alliance ID
|
135
|
+
# @param params [Hash] Additional query string parameters
|
136
|
+
# @param headers [Hash] Additional headers
|
137
|
+
#
|
138
|
+
# @raise [ESI::Errors::BadRequestError] Bad request
|
139
|
+
# @raise [ESI::Errors::NotFoundError] No image server for this datasource
|
140
|
+
# @raise [ESI::Errors::ErrorLimitedError] Error limited
|
141
|
+
# @raise [ESI::Errors::InternalServerError] Internal server error
|
142
|
+
# @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
|
143
|
+
# @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
|
144
|
+
#
|
145
|
+
# @see https://esi.evetech.net/ui/#/Alliance/get_alliances_alliance_id_icons
|
146
|
+
def get_alliance_icons_raw(alliance_id:, headers: {}, params: {})
|
147
|
+
get("/alliances/#{alliance_id}/icons/", headers: headers, params: params)
|
148
|
+
end
|
149
|
+
|
150
|
+
# List all active player alliances.
|
151
|
+
#
|
152
|
+
# This endpoint is cached for up to 3600 seconds.
|
153
|
+
#
|
154
|
+
# @esi_version dev
|
155
|
+
# @esi_version legacy
|
156
|
+
# @esi_version v1
|
157
|
+
# @esi_version v2
|
158
|
+
#
|
159
|
+
# @param params [Hash] Additional query string parameters
|
160
|
+
# @param headers [Hash] Additional headers
|
161
|
+
#
|
162
|
+
# @raise [ESI::Errors::BadRequestError] Bad request
|
163
|
+
# @raise [ESI::Errors::ErrorLimitedError] Error limited
|
164
|
+
# @raise [ESI::Errors::InternalServerError] Internal server error
|
165
|
+
# @raise [ESI::Errors::ServiceUnavailableError] Service unavailable
|
166
|
+
# @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
|
167
|
+
#
|
168
|
+
# @see https://esi.evetech.net/ui/#/Alliance/get_alliances
|
169
|
+
def get_alliances(headers: {}, params: {})
|
170
|
+
get_alliances_raw(headers: headers, params: params).json
|
171
|
+
end
|
172
|
+
|
80
173
|
# List all active player alliances.
|
81
174
|
#
|
82
175
|
# This endpoint is cached for up to 3600 seconds.
|
@@ -96,7 +189,7 @@ module ESI
|
|
96
189
|
# @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
|
97
190
|
#
|
98
191
|
# @see https://esi.evetech.net/ui/#/Alliance/get_alliances
|
99
|
-
def
|
192
|
+
def get_alliances_raw(headers: {}, params: {})
|
100
193
|
get("/alliances/", headers: headers, params: params)
|
101
194
|
end
|
102
195
|
end
|