esi-sdk 1.1.3 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/cicd.yml +17 -2
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +33 -0
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +21 -40
  7. data/README.md +2 -0
  8. data/Rakefile +74 -37
  9. data/bin/console +1 -1
  10. data/esi-sdk.gemspec +2 -3
  11. data/lib/esi/client/alliance.rb +103 -10
  12. data/lib/esi/client/assets.rb +191 -18
  13. data/lib/esi/client/bookmarks.rb +126 -12
  14. data/lib/esi/client/calendar.rb +144 -16
  15. data/lib/esi/client/character.rb +413 -42
  16. data/lib/esi/client/clones.rb +65 -6
  17. data/lib/esi/client/contacts.rb +291 -30
  18. data/lib/esi/client/contracts.rb +288 -31
  19. data/lib/esi/client/corporation.rb +746 -152
  20. data/lib/esi/client/dogma.rb +118 -12
  21. data/lib/esi/client/faction_warfare.rb +198 -14
  22. data/lib/esi/client/fittings.rb +94 -10
  23. data/lib/esi/client/fleets.rb +469 -49
  24. data/lib/esi/client/incursions.rb +23 -1
  25. data/lib/esi/client/industry.rb +245 -23
  26. data/lib/esi/client/insurance.rb +23 -1
  27. data/lib/esi/client/killmails.rb +93 -10
  28. data/lib/esi/client/location.rb +98 -9
  29. data/lib/esi/client/loyalty.rb +57 -6
  30. data/lib/esi/client/mail.rb +262 -28
  31. data/lib/esi/client/market.rb +316 -34
  32. data/lib/esi/client/opportunities.rb +124 -13
  33. data/lib/esi/client/planetary_interaction.rb +123 -13
  34. data/lib/esi/client/routes.rb +34 -6
  35. data/lib/esi/client/search.rb +64 -7
  36. data/lib/esi/client/skills.rb +95 -9
  37. data/lib/esi/client/sovereignty.rb +69 -3
  38. data/lib/esi/client/status.rb +24 -1
  39. data/lib/esi/client/universe.rb +815 -194
  40. data/lib/esi/client/user_interface.rb +157 -14
  41. data/lib/esi/client/wallet.rb +197 -22
  42. data/lib/esi/client/wars.rb +80 -9
  43. data/lib/esi/client.rb +76 -80
  44. data/lib/esi/errors.rb +12 -1
  45. data/lib/esi/version.rb +1 -1
  46. data/package.json +19 -0
  47. data/yarn.lock +3695 -0
  48. metadata +10 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96bfde25cec60466f068690e618f8eb448f287686652529627d83e61bff6a27e
4
- data.tar.gz: 30a10c563775c08ce91e003fa97a34b72dc48db1b754b39a34d7b7b7398fc3d0
3
+ metadata.gz: 8602a9c524badb41010f8762e394df4bc923307acece2d53b64e91cdc7f934ae
4
+ data.tar.gz: 268036494ca33085700e903a266e4ca69f280637f6e53b46ebd33476b4c3db5a
5
5
  SHA512:
6
- metadata.gz: 4e3e48c1b7e9b03605e0a58a1b9cc7f7d47ae4180efbf0872aef6aec9b187c84febf354f86267694478802f001d2ab0dc5094091ba7789e3be00e16d2217a957
7
- data.tar.gz: 7f241d000d376edd19b72e743e5f7f5176ce75c32df0468f1544fac413eaa659e651113c4b1332dfecd19f626f8412d9615cd326e85a4d92410cbe5f6ed1682a
6
+ metadata.gz: 7f0c8d1c2052b7670cefa35bc0b98250bdac06e5cb1fa1c04be6c752f42beb2b859660ec9dd3450c10f018ff8015e0e896ff9fefb058996b6161bdee59b03fc2
7
+ data.tar.gz: 135710a1b828b631fcc0169e4c590c4a0ed968c818a0d93aaf397a399e14ad1d85b1a468c18922d9937eb5ea237df5aecd07b5311ca2e38336efd991015f9d8b
@@ -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
- npm install -g @semantic-release/changelog @semantic-release/exec @semantic-release/git conventional-changelog-angular
181
- npx semantic-release ${{ github.event_name == 'pull_request' && '--dry-run' || ' ' }}
196
+ yarn release ${{ github.event_name == 'pull_request' && '--dry-run' || ' ' }}
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ vendor/bundle
13
+ node_modules/
data/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # ESI SDK Changelog
2
2
 
3
+ ## [2.1.1](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v2.1.0...v2.1.1) (2021-10-09)
4
+
5
+ # [2.1.0](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v2.0.0...v2.1.0) (2021-10-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * add methods to return raw responses ([93dc308](https://github.com/bokoboshahni/esi-sdk-ruby/commit/93dc3082cf06b0b4e42e17e3de77c9e05e3345b5))
11
+
12
+ # [2.0.0](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v1.2.0...v2.0.0) (2021-10-08)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * require name from esi/sdk to esi-sdk ([2e5e996](https://github.com/bokoboshahni/esi-sdk-ruby/commit/2e5e9966343baef91bd037579607bb562edce301))
18
+
19
+
20
+ ### Features
21
+
22
+ * migrate to httpx ([fd6ec0d](https://github.com/bokoboshahni/esi-sdk-ruby/commit/fd6ec0d6910805215efceb80a5361dc4d72b9599))
23
+
24
+
25
+ ### BREAKING CHANGES
26
+
27
+ * use httpx instead of faraday for http calls
28
+
29
+ # [1.2.0](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v1.1.3...v1.2.0) (2021-07-20)
30
+
31
+
32
+ ### Features
33
+
34
+ * Client improvements ([bad70ae](https://github.com/bokoboshahni/esi-sdk-ruby/commit/bad70ae4d97b8b0f93019b5b4dac73f97aad7dc0))
35
+
3
36
  ## [1.1.3](https://github.com/bokoboshahni/esi-sdk-ruby/compare/v1.1.2...v1.1.3) (2021-07-19)
4
37
 
5
38
 
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ ruby "3.0.2"
7
7
  gemspec
8
8
 
9
9
  gem "activesupport", "~> 6.1"
10
+ gem "awesome_print", "~> 1.9"
10
11
  gem "rake", "~> 13.0"
11
12
  gem "rspec", "~> 3.10"
12
13
  gem "rubocop", "~> 1.18"
data/Gemfile.lock CHANGED
@@ -1,15 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- esi-sdk (1.1.3)
5
- faraday (~> 1.5)
6
- faraday-http-cache (~> 2.2)
7
- faraday_middleware (~> 1.0)
4
+ esi-sdk (2.1.1)
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
- multipart-post (2.1.1)
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.0)
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.18.3)
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.7.0, < 2.0)
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.8.0)
69
+ rubocop-ast (1.12.0)
88
70
  parser (>= 3.0.1.1)
89
- rubocop-performance (1.11.4)
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.4.0)
95
- rubocop (~> 1.0)
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.0.0)
87
+ unicode-display_width (2.1.0)
108
88
  vcr (6.0.0)
109
- webmock (3.13.0)
110
- addressable (>= 2.3.6)
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
@@ -1,3 +1,5 @@
1
+ ![Build images](https://github.com/bokoboshahni/esi-sdk-ruby/workflows/CICD/badge.svg)
2
+
1
3
  # EVE Swagger Interface (ESI) SDK
2
4
 
3
5
  ESI SDK is a Ruby API client for the EVE Swagger Interface (ESI), the official API for the [EVE Online](https://eveonline.com) MMORPG.
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"]} [Integer,String] #{p["description"]}"
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
- signature_params << "#{p["name"]}:"
165
- param_tags << "# @param #{p["name"]} [#{p["type"].capitalize}] #{p["description"]}"
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
- if %w[delete get].include?(operation[:method])
169
- signature_params << "params: {}"
170
- param_tags << "# @param params [Hash] Additional query string parameters"
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 << if %w[delete get].include?(operation[:method])
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
- http_call = "query_string = URI.encode_www_form([#{operation[:query].map { |q| "['#{q["name"]}', #{q["name"]}]" }.join(", ")}])\n"
214
- http_call += "#{operation[:method]}(\"#{path}?\#{query_string}\", #{http_call_params.join(", ")})"
215
- else
216
- http_call = "#{operation[:method]}(\"#{path}\", #{http_call_params.join(", ")})"
217
- end
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,36 @@ 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
- a << <<~METHOD_DEFINITION
230
- #{description}
231
- def #{method_name}#{signature}
232
- #{http_call}
233
- end
234
- #{alias_methods}
235
- METHOD_DEFINITION
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
+ concat_responses(#{method_name}_raw#{raw_call})
248
+ end
249
+ #{alias_methods}
250
+
251
+ #{description}
252
+ def #{method_name}_raw#{signature}
253
+ #{params_merge}
254
+ #{http_call}
255
+ end
256
+ METHOD_DEFINITION
257
+ else
258
+ a << <<~METHOD_DEFINITION
259
+ #{description}
260
+ def #{method_name}#{signature}
261
+ #{method_name}_raw#{raw_call}.json
262
+ end
263
+ #{alias_methods}
264
+
265
+ #{description}
266
+ def #{method_name}_raw#{signature}
267
+ #{params_merge}
268
+ #{http_call}
269
+ end
270
+ METHOD_DEFINITION
271
+ end
236
272
  end
237
273
 
238
274
  lib_content = <<~MODULE_DEFINITION
@@ -269,11 +305,6 @@ task :generate do
269
305
  success_params = operation[:params].map { |p| "#{p["name"]}: \"1234567890\"" }
270
306
  success_params += operation[:query].map { |p| "#{p["name"]}: \"1234567890\"" }
271
307
 
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
308
  if operation[:body]
278
309
  body_param = operation[:body]
279
310
  body_name = body_param["name"]
@@ -287,12 +318,16 @@ task :generate do
287
318
  success_params << "#{body_name}: #{body_value}"
288
319
  end
289
320
 
321
+ with_query = operation[:query].any? ? ".with(query: { #{operation[:query].map { |p| "#{p["name"]}: \"1234567890\"" }.join(", ")} })" : ""
322
+
323
+ extra_headers = success_desc["headers"] && success_desc["headers"]["X-Pages"] ? ", 'X-Pages': '1'" : ""
324
+
290
325
  describe = " describe \"##{method_name}\" do\n"
291
326
  describe += " context \"when the response is #{success_code}\" do\n"
292
327
  describe += " let(:response) { #{success_response_body} }\n"
293
328
  describe += "\n"
294
329
  describe += " before do\n"
295
- describe += " stub_request(:#{operation[:method]}, \"https://esi.evetech.net/latest#{success_path}\").to_return(body: response.to_json)\n"
330
+ 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
331
  describe += " end\n"
297
332
  describe += "\n"
298
333
  describe += " it \"returns the response\" do\n"
@@ -303,13 +338,15 @@ task :generate do
303
338
  describe += "\n"
304
339
 
305
340
  error_contexts = operation[:errors].map do |(code, error)|
341
+ next if %w[502 503 504].include?(code)
342
+
306
343
  error_response_body = error["examples"]["application/json"].inspect
307
344
 
308
345
  context = " context \"when the response is #{code}\" do\n"
309
346
  context += " let(:response) { #{error_response_body} }\n"
310
347
  context += "\n"
311
348
  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"
349
+ 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
350
  context += " end\n"
314
351
  context += "\n"
315
352
  context += " it \"raises a #{error_mapping[code.to_i]} error\" do\n"
@@ -327,8 +364,8 @@ task :generate do
327
364
  spec_content = <<~SPEC_FILE
328
365
  # frozen_string_literal: true
329
366
 
330
- RSpec.describe ESI::Client::#{module_name} do
331
- subject(:client) { ESI::Client.new(user_agent: \"ESI SDK Tests/1.0; +(https://github.com/bokoboshahni/esi-sdk)\") }
367
+ RSpec.describe ESI::Client::#{module_name}, type: :stub do
368
+ subject(:client) { ESI::Client.new(user_agent: \"esi-sdk-ruby Tests/1.0; +(https://github.com/bokoboshahni/esi-sdk-ruby)\") }
332
369
 
333
370
  #{describe_blocks.join("\n\n")}
334
371
  end
data/bin/console CHANGED
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "bundler/setup"
5
- require "esi/sdk"
5
+ require "esi-sdk"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
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 "faraday", "~> 1.5"
30
- spec.add_dependency "faraday-http-cache", "~> 2.2"
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
@@ -13,7 +13,7 @@ module ESI
13
13
  # @esi_version v3
14
14
  # @esi_version v4
15
15
  #
16
- # @param alliance_id [Integer,String] An EVE alliance ID
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:, params: {}, headers: {})
29
- get("/alliances/#{alliance_id}/", headers: headers, params: params)
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,String] An EVE alliance ID
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:, params: {}, headers: {})
54
- get("/alliances/#{alliance_id}/corporations/", headers: headers, params: params)
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,String] An EVE alliance ID
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:, params: {}, headers: {})
76
- get("/alliances/#{alliance_id}/icons/", headers: headers, params: params)
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 get_alliances(params: {}, headers: {})
192
+ def get_alliances_raw(headers: {}, params: {})
100
193
  get("/alliances/", headers: headers, params: params)
101
194
  end
102
195
  end