esi-sdk 1.1.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile.lock +7 -1
  4. data/README.md +15 -0
  5. data/Rakefile +30 -26
  6. data/esi-sdk.gemspec +1 -0
  7. data/lib/esi/client.rb +66 -44
  8. data/lib/esi/client/alliance.rb +7 -7
  9. data/lib/esi/client/assets.rb +20 -16
  10. data/lib/esi/client/bookmarks.rb +8 -8
  11. data/lib/esi/client/calendar.rb +15 -14
  12. data/lib/esi/client/character.rb +31 -29
  13. data/lib/esi/client/clones.rb +4 -4
  14. data/lib/esi/client/contacts.rb +26 -24
  15. data/lib/esi/client/contracts.rb +22 -22
  16. data/lib/esi/client/corporation.rb +46 -46
  17. data/lib/esi/client/dogma.rb +9 -9
  18. data/lib/esi/client/faction_warfare.rb +10 -10
  19. data/lib/esi/client/fittings.rb +9 -8
  20. data/lib/esi/client/fleets.rb +49 -42
  21. data/lib/esi/client/incursions.rb +1 -1
  22. data/lib/esi/client/industry.rb +19 -19
  23. data/lib/esi/client/insurance.rb +1 -1
  24. data/lib/esi/client/killmails.rb +7 -7
  25. data/lib/esi/client/location.rb +6 -6
  26. data/lib/esi/client/loyalty.rb +4 -4
  27. data/lib/esi/client/mail.rb +26 -23
  28. data/lib/esi/client/market.rb +25 -25
  29. data/lib/esi/client/opportunities.rb +8 -8
  30. data/lib/esi/client/planetary_interaction.rb +9 -9
  31. data/lib/esi/client/routes.rb +6 -6
  32. data/lib/esi/client/search.rb +7 -7
  33. data/lib/esi/client/skills.rb +6 -6
  34. data/lib/esi/client/sovereignty.rb +3 -3
  35. data/lib/esi/client/status.rb +1 -1
  36. data/lib/esi/client/universe.rb +51 -49
  37. data/lib/esi/client/user_interface.rb +19 -14
  38. data/lib/esi/client/wallet.rb +18 -18
  39. data/lib/esi/client/wars.rb +7 -7
  40. data/lib/esi/errors.rb +11 -0
  41. data/lib/esi/version.rb +1 -1
  42. metadata +16 -2
@@ -15,7 +15,7 @@ module ESI
15
15
  # @esi_version legacy
16
16
  # @esi_version v1
17
17
  #
18
- # @param character_id [Integer,String] An EVE character ID
18
+ # @param character_id [Integer] An EVE character ID
19
19
  # @param params [Hash] Additional query string parameters
20
20
  # @param headers [Hash] Additional headers
21
21
  #
@@ -28,7 +28,7 @@ module ESI
28
28
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
29
29
  #
30
30
  # @see https://esi.evetech.net/ui/#/Wallet/get_characters_character_id_wallet
31
- def get_character_wallet(character_id:, params: {}, headers: {})
31
+ def get_character_wallet(character_id:, headers: {}, params: {})
32
32
  get("/characters/#{character_id}/wallet/", headers: headers, params: params)
33
33
  end
34
34
  alias get_characters_character_id_wallet get_character_wallet
@@ -44,7 +44,7 @@ module ESI
44
44
  # @esi_version dev
45
45
  # @esi_version v6
46
46
  #
47
- # @param character_id [Integer,String] An EVE character ID
47
+ # @param character_id [Integer] An EVE character ID
48
48
  # @param params [Hash] Additional query string parameters
49
49
  # @param headers [Hash] Additional headers
50
50
  #
@@ -57,7 +57,7 @@ module ESI
57
57
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
58
58
  #
59
59
  # @see https://esi.evetech.net/ui/#/Wallet/get_characters_character_id_wallet_journal
60
- def get_character_wallet_journal(character_id:, params: {}, headers: {})
60
+ def get_character_wallet_journal(character_id:, headers: {}, params: {})
61
61
  get("/characters/#{character_id}/wallet/journal/", headers: headers, params: params)
62
62
  end
63
63
  alias get_characters_character_id_wallet_journal get_character_wallet_journal
@@ -74,7 +74,7 @@ module ESI
74
74
  # @esi_version legacy
75
75
  # @esi_version v1
76
76
  #
77
- # @param character_id [Integer,String] An EVE character ID
77
+ # @param character_id [Integer] An EVE character ID
78
78
  # @param from_id [Integer] Only show transactions happened before the one referenced by this id
79
79
  # @param params [Hash] Additional query string parameters
80
80
  # @param headers [Hash] Additional headers
@@ -88,9 +88,9 @@ module ESI
88
88
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
89
89
  #
90
90
  # @see https://esi.evetech.net/ui/#/Wallet/get_characters_character_id_wallet_transactions
91
- def get_character_wallet_transactions(character_id:, from_id:, params: {}, headers: {})
92
- query_string = URI.encode_www_form([["from_id", from_id]])
93
- get("/characters/#{character_id}/wallet/transactions/?#{query_string}", headers: headers, params: params)
91
+ def get_character_wallet_transactions(character_id:, from_id: nil, headers: {}, params: {})
92
+ params.merge!("from_id" => from_id)
93
+ get("/characters/#{character_id}/wallet/transactions/", headers: headers, params: params)
94
94
  end
95
95
  alias get_characters_character_id_wallet_transactions get_character_wallet_transactions
96
96
 
@@ -106,7 +106,7 @@ module ESI
106
106
  # @esi_version legacy
107
107
  # @esi_version v1
108
108
  #
109
- # @param corporation_id [Integer,String] An EVE corporation ID
109
+ # @param corporation_id [Integer] An EVE corporation ID
110
110
  # @param params [Hash] Additional query string parameters
111
111
  # @param headers [Hash] Additional headers
112
112
  #
@@ -119,7 +119,7 @@ module ESI
119
119
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
120
120
  #
121
121
  # @see https://esi.evetech.net/ui/#/Wallet/get_corporations_corporation_id_wallets
122
- def get_corporation_wallets(corporation_id:, params: {}, headers: {})
122
+ def get_corporation_wallets(corporation_id:, headers: {}, params: {})
123
123
  get("/corporations/#{corporation_id}/wallets/", headers: headers, params: params)
124
124
  end
125
125
  alias get_corporations_corporation_id_wallets get_corporation_wallets
@@ -135,8 +135,8 @@ module ESI
135
135
  # @esi_version dev
136
136
  # @esi_version v4
137
137
  #
138
- # @param corporation_id [Integer,String] An EVE corporation ID
139
- # @param division [Integer,String] Wallet key of the division to fetch journals from
138
+ # @param corporation_id [Integer] An EVE corporation ID
139
+ # @param division [Integer] Wallet key of the division to fetch journals from
140
140
  # @param params [Hash] Additional query string parameters
141
141
  # @param headers [Hash] Additional headers
142
142
  #
@@ -149,7 +149,7 @@ module ESI
149
149
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
150
150
  #
151
151
  # @see https://esi.evetech.net/ui/#/Wallet/get_corporations_corporation_id_wallets_division_journal
152
- def get_corporation_wallets_division_journal(corporation_id:, division:, params: {}, headers: {})
152
+ def get_corporation_wallets_division_journal(corporation_id:, division:, headers: {}, params: {})
153
153
  get("/corporations/#{corporation_id}/wallets/#{division}/journal/", headers: headers, params: params)
154
154
  end
155
155
  alias get_corporations_corporation_id_wallets_division_journal get_corporation_wallets_division_journal
@@ -166,8 +166,8 @@ module ESI
166
166
  # @esi_version legacy
167
167
  # @esi_version v1
168
168
  #
169
- # @param corporation_id [Integer,String] An EVE corporation ID
170
- # @param division [Integer,String] Wallet key of the division to fetch journals from
169
+ # @param corporation_id [Integer] An EVE corporation ID
170
+ # @param division [Integer] Wallet key of the division to fetch journals from
171
171
  # @param from_id [Integer] Only show journal entries happened before the transaction referenced by this id
172
172
  # @param params [Hash] Additional query string parameters
173
173
  # @param headers [Hash] Additional headers
@@ -181,9 +181,9 @@ module ESI
181
181
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
182
182
  #
183
183
  # @see https://esi.evetech.net/ui/#/Wallet/get_corporations_corporation_id_wallets_division_transactions
184
- def get_corporation_wallets_division_transactions(corporation_id:, division:, from_id:, params: {}, headers: {})
185
- query_string = URI.encode_www_form([["from_id", from_id]])
186
- get("/corporations/#{corporation_id}/wallets/#{division}/transactions/?#{query_string}", headers: headers, params: params)
184
+ def get_corporation_wallets_division_transactions(corporation_id:, division:, from_id: nil, headers: {}, params: {})
185
+ params.merge!("from_id" => from_id)
186
+ get("/corporations/#{corporation_id}/wallets/#{division}/transactions/", headers: headers, params: params)
187
187
  end
188
188
  alias get_corporations_corporation_id_wallets_division_transactions get_corporation_wallets_division_transactions
189
189
  end
@@ -12,7 +12,7 @@ module ESI
12
12
  # @esi_version legacy
13
13
  # @esi_version v1
14
14
  #
15
- # @param war_id [Integer,String] ID for a war
15
+ # @param war_id [Integer] ID for a war
16
16
  # @param params [Hash] Additional query string parameters
17
17
  # @param headers [Hash] Additional headers
18
18
  #
@@ -24,7 +24,7 @@ module ESI
24
24
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
25
25
  #
26
26
  # @see https://esi.evetech.net/ui/#/Wars/get_wars_war_id
27
- def get_war(war_id:, params: {}, headers: {})
27
+ def get_war(war_id:, headers: {}, params: {})
28
28
  get("/wars/#{war_id}/", headers: headers, params: params)
29
29
  end
30
30
  alias get_wars_war_id get_war
@@ -37,7 +37,7 @@ module ESI
37
37
  # @esi_version legacy
38
38
  # @esi_version v1
39
39
  #
40
- # @param war_id [Integer,String] A valid war ID
40
+ # @param war_id [Integer] A valid war ID
41
41
  # @param params [Hash] Additional query string parameters
42
42
  # @param headers [Hash] Additional headers
43
43
  #
@@ -49,7 +49,7 @@ module ESI
49
49
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
50
50
  #
51
51
  # @see https://esi.evetech.net/ui/#/Wars/get_wars_war_id_killmails
52
- def get_war_killmails(war_id:, params: {}, headers: {})
52
+ def get_war_killmails(war_id:, headers: {}, params: {})
53
53
  get("/wars/#{war_id}/killmails/", headers: headers, params: params)
54
54
  end
55
55
  alias get_wars_war_id_killmails get_war_killmails
@@ -73,9 +73,9 @@ module ESI
73
73
  # @raise [ESI::Errors::GatewayTimeoutError] Gateway timeout
74
74
  #
75
75
  # @see https://esi.evetech.net/ui/#/Wars/get_wars
76
- def get_wars(max_war_id:, params: {}, headers: {})
77
- query_string = URI.encode_www_form([["max_war_id", max_war_id]])
78
- get("/wars/?#{query_string}", headers: headers, params: params)
76
+ def get_wars(max_war_id: nil, headers: {}, params: {})
77
+ params.merge!("max_war_id" => max_war_id)
78
+ get("/wars/", headers: headers, params: params)
79
79
  end
80
80
  end
81
81
  end
data/lib/esi/errors.rb CHANGED
@@ -18,6 +18,17 @@ module ESI
18
18
  end
19
19
  end
20
20
 
21
+ # ESI pagination error.
22
+ class PaginationError < ClientError
23
+ attr_reader :responses
24
+
25
+ def initialize(msg, response:, responses:)
26
+ super(msg, response: response)
27
+
28
+ @responses = responses
29
+ end
30
+ end
31
+
21
32
  # ESI unauthorized error.
22
33
  class UnauthorizedError < ClientError; end
23
34
 
data/lib/esi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ESI
4
- VERSION = "1.1.3"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esi-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bokobo Shahni
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: typhoeus
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.4'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.4'
55
69
  description: ESI SDK is a Ruby API client for the EVE Swagger Interface (ESI), the
56
70
  official API for the EVE Online MMORPG.
57
71
  email: