steam_api_client 0.10.0 → 1.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/CHANGELOG.md +66 -8
- data/README.md +13 -47
- data/docs/USAGE.md +326 -0
- data/lib/steam_api_client/client.rb +58 -35
- data/lib/steam_api_client/configuration.rb +55 -0
- data/lib/steam_api_client/endpoint/param.rb +83 -0
- data/lib/steam_api_client/endpoint.rb +90 -0
- data/lib/steam_api_client/endpoints.rb +122 -0
- data/lib/steam_api_client/errors/api_error.rb +10 -8
- data/lib/steam_api_client/errors/connection_error.rb +7 -0
- data/lib/steam_api_client/errors/response_parse_error.rb +6 -6
- data/lib/steam_api_client/failure_handler.rb +1 -6
- data/lib/steam_api_client/model/field.rb +42 -0
- data/lib/steam_api_client/model/scalars.rb +59 -0
- data/lib/steam_api_client/model.rb +102 -0
- data/lib/steam_api_client/models/app_details.rb +118 -0
- data/lib/steam_api_client/models/friend.rb +11 -0
- data/lib/steam_api_client/models/game.rb +35 -0
- data/lib/steam_api_client/models/global_achievement.rb +10 -0
- data/lib/steam_api_client/models/news_item.rb +20 -0
- data/lib/steam_api_client/models/player_achievements.rb +19 -0
- data/lib/steam_api_client/models/player_game_stats.rb +25 -0
- data/lib/steam_api_client/models/player_summary.rb +37 -0
- data/lib/steam_api_client/request.rb +53 -59
- data/lib/steam_api_client/requestor.rb +42 -0
- data/lib/steam_api_client/response.rb +30 -22
- data/lib/steam_api_client/version.rb +1 -1
- data/lib/steam_api_client.rb +18 -57
- metadata +32 -86
- data/lib/steam_api_client/errors/url_error.rb +0 -5
- data/lib/steam_api_client/requestors/app_details.rb +0 -27
- data/lib/steam_api_client/requestors/app_global_achievements.rb +0 -19
- data/lib/steam_api_client/requestors/app_news.rb +0 -23
- data/lib/steam_api_client/requestors/base.rb +0 -32
- data/lib/steam_api_client/requestors/game_current_players.rb +0 -19
- data/lib/steam_api_client/requestors/player_achievements.rb +0 -21
- data/lib/steam_api_client/requestors/player_friends.rb +0 -21
- data/lib/steam_api_client/requestors/player_game_stats.rb +0 -21
- data/lib/steam_api_client/requestors/player_level.rb +0 -18
- data/lib/steam_api_client/requestors/player_owned_games.rb +0 -23
- data/lib/steam_api_client/requestors/player_recent_games.rb +0 -21
- data/lib/steam_api_client/requestors/player_steamid.rb +0 -19
- data/lib/steam_api_client/requestors/player_summaries.rb +0 -19
- data/lib/steam_api_client/structs/app_details/achievement.rb +0 -12
- data/lib/steam_api_client/structs/app_details/category.rb +0 -12
- data/lib/steam_api_client/structs/app_details/details.rb +0 -82
- data/lib/steam_api_client/structs/app_details/genre.rb +0 -12
- data/lib/steam_api_client/structs/app_details/movie.rb +0 -25
- data/lib/steam_api_client/structs/app_details/package_group.rb +0 -18
- data/lib/steam_api_client/structs/app_details/requirements.rb +0 -12
- data/lib/steam_api_client/structs/app_details/screenshot.rb +0 -13
- data/lib/steam_api_client/structs/app_details/sub.rb +0 -18
- data/lib/steam_api_client/structs/app_global_achievements.rb +0 -18
- data/lib/steam_api_client/structs/app_new.rb +0 -20
- data/lib/steam_api_client/structs/app_news.rb +0 -13
- data/lib/steam_api_client/structs/base.rb +0 -15
- data/lib/steam_api_client/structs/game_current_players.rb +0 -12
- data/lib/steam_api_client/structs/player_achievements.rb +0 -23
- data/lib/steam_api_client/structs/player_friends.rb +0 -17
- data/lib/steam_api_client/structs/player_game_stats.rb +0 -28
- data/lib/steam_api_client/structs/player_level.rb +0 -11
- data/lib/steam_api_client/structs/player_owned_games.rb +0 -31
- data/lib/steam_api_client/structs/player_recent_games.rb +0 -22
- data/lib/steam_api_client/structs/player_steamid.rb +0 -16
- data/lib/steam_api_client/structs/player_summaries.rb +0 -11
- data/lib/steam_api_client/structs/player_summary.rb +0 -46
- data/lib/steam_api_client/structs/requests/abstract.rb +0 -59
- data/lib/steam_api_client/structs/requests/get_app_details.rb +0 -48
- data/lib/steam_api_client/structs/requests/get_app_global_achievements.rb +0 -48
- data/lib/steam_api_client/structs/requests/get_app_news.rb +0 -56
- data/lib/steam_api_client/structs/requests/get_game_current_players.rb +0 -48
- data/lib/steam_api_client/structs/requests/get_player_achievements.rb +0 -48
- data/lib/steam_api_client/structs/requests/get_player_friends.rb +0 -51
- data/lib/steam_api_client/structs/requests/get_player_game_stats.rb +0 -48
- data/lib/steam_api_client/structs/requests/get_player_level.rb +0 -42
- data/lib/steam_api_client/structs/requests/get_player_owned_games.rb +0 -50
- data/lib/steam_api_client/structs/requests/get_player_recent_games.rb +0 -48
- data/lib/steam_api_client/structs/requests/get_player_steamid.rb +0 -42
- data/lib/steam_api_client/structs/requests/get_player_summaries.rb +0 -46
- data/lib/steam_api_client/structs/requests/storefront_abstract.rb +0 -58
- data/lib/steam_api_client/structs/types.rb +0 -23
|
@@ -5,17 +5,17 @@ module SteamApiClient
|
|
|
5
5
|
class Response
|
|
6
6
|
extend Forwardable
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# headers: the HTTP response headers (case-insensitive Faraday::Utils::Headers)
|
|
9
|
+
def_delegators :@raw_response, :success?, :body, :headers
|
|
9
10
|
attr_accessor :request
|
|
10
11
|
|
|
11
12
|
# Initialize a new instance
|
|
12
|
-
# @param [
|
|
13
|
-
# @param [SteamApiClient::
|
|
14
|
-
# build the response received from Api
|
|
13
|
+
# @param [Faraday::Response] raw_response
|
|
14
|
+
# @param [SteamApiClient::Endpoint] endpoint The endpoint called, which builds the result
|
|
15
15
|
# @param [SteamApiClient::Request] request The wrapper Request class
|
|
16
|
-
def initialize(raw_response:,
|
|
16
|
+
def initialize(raw_response:, endpoint:, request:)
|
|
17
17
|
@raw_response = raw_response
|
|
18
|
-
@
|
|
18
|
+
@endpoint = endpoint
|
|
19
19
|
@request = request
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -25,16 +25,10 @@ module SteamApiClient
|
|
|
25
25
|
!success?
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
# Returns the HTTP response headers (case-insensitive)
|
|
29
|
-
# @return [Typhoeus::Response::Header, nil]
|
|
30
|
-
def headers
|
|
31
|
-
raw_response.headers
|
|
32
|
-
end
|
|
33
|
-
|
|
34
28
|
# Returns the HTTP status code
|
|
35
29
|
# @return [Integer]
|
|
36
30
|
def status_code
|
|
37
|
-
raw_response.
|
|
31
|
+
raw_response.status
|
|
38
32
|
end
|
|
39
33
|
|
|
40
34
|
# Parses the response's json body as a Hash. If the response body isn't a json
|
|
@@ -46,22 +40,36 @@ module SteamApiClient
|
|
|
46
40
|
{}
|
|
47
41
|
end
|
|
48
42
|
|
|
49
|
-
#
|
|
50
|
-
# @return [
|
|
43
|
+
# Steam's JSON, untouched (keys symbolized)
|
|
44
|
+
# @return [Hash]
|
|
51
45
|
# @raise [SteamApiClient::Errors::ResponseParseError] if the body isn't a JSON object
|
|
52
|
-
|
|
46
|
+
def json
|
|
47
|
+
parse_body.tap do |json|
|
|
48
|
+
raise Model::Error, "expected a JSON object, got #{json.class}" unless json.is_a?(Hash)
|
|
49
|
+
end
|
|
50
|
+
rescue JSON::ParserError, Model::Error
|
|
51
|
+
raise Errors::ResponseParseError.new(self, endpoint)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# The endpoint's result, built from the JSON body
|
|
55
|
+
# @return [Data, Array, Integer, nil] see SteamApiClient::Endpoints
|
|
56
|
+
# @raise [SteamApiClient::Errors::ResponseParseError] if the body isn't a JSON object
|
|
57
|
+
# or doesn't match the endpoint's result
|
|
53
58
|
def result
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
endpoint.result(json)
|
|
60
|
+
rescue Model::Error
|
|
61
|
+
raise Errors::ResponseParseError.new(self, endpoint)
|
|
62
|
+
end
|
|
56
63
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
# Shows the status and the request, with the API token redacted
|
|
65
|
+
# @return [String]
|
|
66
|
+
def inspect
|
|
67
|
+
"#<#{self.class.name} status=#{status_code} request=#{request.inspect}>"
|
|
60
68
|
end
|
|
61
69
|
|
|
62
70
|
private
|
|
63
71
|
|
|
64
|
-
attr_accessor :raw_response, :
|
|
72
|
+
attr_accessor :raw_response, :endpoint
|
|
65
73
|
|
|
66
74
|
# json 3 rejects duplicate keys by default; keep json 2's behavior (last one wins)
|
|
67
75
|
# so a response parses the same whichever json version the app uses
|
data/lib/steam_api_client.rb
CHANGED
|
@@ -1,76 +1,37 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "dry-configurable"
|
|
4
|
-
require "dry-struct"
|
|
5
3
|
require "json"
|
|
6
4
|
require "time"
|
|
7
5
|
require "singleton"
|
|
8
|
-
require "
|
|
6
|
+
require "faraday"
|
|
9
7
|
|
|
10
8
|
require_relative "steam_api_client/version"
|
|
9
|
+
require_relative "steam_api_client/configuration"
|
|
10
|
+
require_relative "steam_api_client/model"
|
|
11
|
+
require_relative "steam_api_client/model/scalars"
|
|
12
|
+
require_relative "steam_api_client/model/field"
|
|
13
|
+
require_relative "steam_api_client/endpoint"
|
|
14
|
+
require_relative "steam_api_client/endpoint/param"
|
|
11
15
|
require_relative "steam_api_client/request"
|
|
16
|
+
require_relative "steam_api_client/requestor"
|
|
12
17
|
require_relative "steam_api_client/response"
|
|
13
18
|
require_relative "steam_api_client/failure_handler"
|
|
14
19
|
|
|
15
20
|
require_relative "steam_api_client/errors/api_error"
|
|
21
|
+
require_relative "steam_api_client/errors/connection_error"
|
|
16
22
|
require_relative "steam_api_client/errors/missing_api_token"
|
|
17
23
|
require_relative "steam_api_client/errors/response_parse_error"
|
|
18
|
-
require_relative "steam_api_client/errors/url_error"
|
|
19
24
|
|
|
20
|
-
require_relative "steam_api_client/
|
|
21
|
-
require_relative "steam_api_client/
|
|
22
|
-
require_relative "steam_api_client/
|
|
23
|
-
require_relative "steam_api_client/
|
|
24
|
-
require_relative "steam_api_client/
|
|
25
|
-
require_relative "steam_api_client/
|
|
26
|
-
require_relative "steam_api_client/
|
|
27
|
-
require_relative "steam_api_client/
|
|
28
|
-
require_relative "steam_api_client/requestors/player_level"
|
|
29
|
-
require_relative "steam_api_client/requestors/player_owned_games"
|
|
30
|
-
require_relative "steam_api_client/requestors/player_recent_games"
|
|
31
|
-
require_relative "steam_api_client/requestors/player_steamid"
|
|
32
|
-
require_relative "steam_api_client/requestors/player_summaries"
|
|
33
|
-
|
|
34
|
-
require_relative "steam_api_client/structs/types"
|
|
35
|
-
require_relative "steam_api_client/structs/base"
|
|
36
|
-
require_relative "steam_api_client/structs/app_details/achievement"
|
|
37
|
-
require_relative "steam_api_client/structs/app_details/category"
|
|
38
|
-
require_relative "steam_api_client/structs/app_details/genre"
|
|
39
|
-
require_relative "steam_api_client/structs/app_details/movie"
|
|
40
|
-
require_relative "steam_api_client/structs/app_details/sub"
|
|
41
|
-
require_relative "steam_api_client/structs/app_details/package_group"
|
|
42
|
-
require_relative "steam_api_client/structs/app_details/requirements"
|
|
43
|
-
require_relative "steam_api_client/structs/app_details/screenshot"
|
|
44
|
-
require_relative "steam_api_client/structs/app_details/details"
|
|
45
|
-
require_relative "steam_api_client/structs/app_global_achievements"
|
|
46
|
-
require_relative "steam_api_client/structs/app_new"
|
|
47
|
-
require_relative "steam_api_client/structs/app_news"
|
|
48
|
-
require_relative "steam_api_client/structs/game_current_players"
|
|
49
|
-
require_relative "steam_api_client/structs/player_summary"
|
|
50
|
-
require_relative "steam_api_client/structs/player_achievements"
|
|
51
|
-
require_relative "steam_api_client/structs/player_friends"
|
|
52
|
-
require_relative "steam_api_client/structs/player_game_stats"
|
|
53
|
-
require_relative "steam_api_client/structs/player_level"
|
|
54
|
-
require_relative "steam_api_client/structs/player_owned_games"
|
|
55
|
-
require_relative "steam_api_client/structs/player_recent_games"
|
|
56
|
-
require_relative "steam_api_client/structs/player_steamid"
|
|
57
|
-
require_relative "steam_api_client/structs/player_summaries"
|
|
58
|
-
|
|
59
|
-
require_relative "steam_api_client/structs/requests/abstract"
|
|
60
|
-
require_relative "steam_api_client/structs/requests/storefront_abstract"
|
|
61
|
-
require_relative "steam_api_client/structs/requests/get_app_details"
|
|
62
|
-
require_relative "steam_api_client/structs/requests/get_app_global_achievements"
|
|
63
|
-
require_relative "steam_api_client/structs/requests/get_app_news"
|
|
64
|
-
require_relative "steam_api_client/structs/requests/get_game_current_players"
|
|
65
|
-
require_relative "steam_api_client/structs/requests/get_player_achievements"
|
|
66
|
-
require_relative "steam_api_client/structs/requests/get_player_friends"
|
|
67
|
-
require_relative "steam_api_client/structs/requests/get_player_game_stats"
|
|
68
|
-
require_relative "steam_api_client/structs/requests/get_player_level"
|
|
69
|
-
require_relative "steam_api_client/structs/requests/get_player_owned_games"
|
|
70
|
-
require_relative "steam_api_client/structs/requests/get_player_recent_games"
|
|
71
|
-
require_relative "steam_api_client/structs/requests/get_player_steamid"
|
|
72
|
-
require_relative "steam_api_client/structs/requests/get_player_summaries"
|
|
25
|
+
require_relative "steam_api_client/models/player_summary"
|
|
26
|
+
require_relative "steam_api_client/models/friend"
|
|
27
|
+
require_relative "steam_api_client/models/game"
|
|
28
|
+
require_relative "steam_api_client/models/player_achievements"
|
|
29
|
+
require_relative "steam_api_client/models/player_game_stats"
|
|
30
|
+
require_relative "steam_api_client/models/news_item"
|
|
31
|
+
require_relative "steam_api_client/models/global_achievement"
|
|
32
|
+
require_relative "steam_api_client/models/app_details"
|
|
73
33
|
|
|
34
|
+
require_relative "steam_api_client/endpoints"
|
|
74
35
|
require_relative "steam_api_client/client"
|
|
75
36
|
|
|
76
37
|
# Main module
|
metadata
CHANGED
|
@@ -1,58 +1,34 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: steam_api_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- João Pedro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: faraday
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '2.0'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '1.6'
|
|
34
|
-
type: :runtime
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '1.6'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: typhoeus
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '1.4'
|
|
48
|
-
type: :runtime
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '1.4'
|
|
55
|
-
description:
|
|
26
|
+
version: '2.0'
|
|
27
|
+
description: A Ruby client for the Steam Web API (player summaries, friends, owned
|
|
28
|
+
and recent games, achievements, stats, levels, vanity URLs, app news, current players)
|
|
29
|
+
and the Storefront API (app details). Results come back as plain Ruby Data objects
|
|
30
|
+
with snake_case fields, and HTTP failures as specific error classes. Its only dependency
|
|
31
|
+
is Faraday.
|
|
56
32
|
email:
|
|
57
33
|
- pedrochaveslimas3@gmail.com
|
|
58
34
|
executables: []
|
|
@@ -62,72 +38,42 @@ files:
|
|
|
62
38
|
- CHANGELOG.md
|
|
63
39
|
- LICENSE
|
|
64
40
|
- README.md
|
|
41
|
+
- docs/USAGE.md
|
|
65
42
|
- lib/steam_api_client.rb
|
|
66
43
|
- lib/steam_api_client/client.rb
|
|
44
|
+
- lib/steam_api_client/configuration.rb
|
|
45
|
+
- lib/steam_api_client/endpoint.rb
|
|
46
|
+
- lib/steam_api_client/endpoint/param.rb
|
|
47
|
+
- lib/steam_api_client/endpoints.rb
|
|
67
48
|
- lib/steam_api_client/errors/api_error.rb
|
|
49
|
+
- lib/steam_api_client/errors/connection_error.rb
|
|
68
50
|
- lib/steam_api_client/errors/missing_api_token.rb
|
|
69
51
|
- lib/steam_api_client/errors/response_parse_error.rb
|
|
70
|
-
- lib/steam_api_client/errors/url_error.rb
|
|
71
52
|
- lib/steam_api_client/failure_handler.rb
|
|
53
|
+
- lib/steam_api_client/model.rb
|
|
54
|
+
- lib/steam_api_client/model/field.rb
|
|
55
|
+
- lib/steam_api_client/model/scalars.rb
|
|
56
|
+
- lib/steam_api_client/models/app_details.rb
|
|
57
|
+
- lib/steam_api_client/models/friend.rb
|
|
58
|
+
- lib/steam_api_client/models/game.rb
|
|
59
|
+
- lib/steam_api_client/models/global_achievement.rb
|
|
60
|
+
- lib/steam_api_client/models/news_item.rb
|
|
61
|
+
- lib/steam_api_client/models/player_achievements.rb
|
|
62
|
+
- lib/steam_api_client/models/player_game_stats.rb
|
|
63
|
+
- lib/steam_api_client/models/player_summary.rb
|
|
72
64
|
- lib/steam_api_client/request.rb
|
|
73
|
-
- lib/steam_api_client/
|
|
74
|
-
- lib/steam_api_client/requestors/app_global_achievements.rb
|
|
75
|
-
- lib/steam_api_client/requestors/app_news.rb
|
|
76
|
-
- lib/steam_api_client/requestors/base.rb
|
|
77
|
-
- lib/steam_api_client/requestors/game_current_players.rb
|
|
78
|
-
- lib/steam_api_client/requestors/player_achievements.rb
|
|
79
|
-
- lib/steam_api_client/requestors/player_friends.rb
|
|
80
|
-
- lib/steam_api_client/requestors/player_game_stats.rb
|
|
81
|
-
- lib/steam_api_client/requestors/player_level.rb
|
|
82
|
-
- lib/steam_api_client/requestors/player_owned_games.rb
|
|
83
|
-
- lib/steam_api_client/requestors/player_recent_games.rb
|
|
84
|
-
- lib/steam_api_client/requestors/player_steamid.rb
|
|
85
|
-
- lib/steam_api_client/requestors/player_summaries.rb
|
|
65
|
+
- lib/steam_api_client/requestor.rb
|
|
86
66
|
- lib/steam_api_client/response.rb
|
|
87
|
-
- lib/steam_api_client/structs/app_details/achievement.rb
|
|
88
|
-
- lib/steam_api_client/structs/app_details/category.rb
|
|
89
|
-
- lib/steam_api_client/structs/app_details/details.rb
|
|
90
|
-
- lib/steam_api_client/structs/app_details/genre.rb
|
|
91
|
-
- lib/steam_api_client/structs/app_details/movie.rb
|
|
92
|
-
- lib/steam_api_client/structs/app_details/package_group.rb
|
|
93
|
-
- lib/steam_api_client/structs/app_details/requirements.rb
|
|
94
|
-
- lib/steam_api_client/structs/app_details/screenshot.rb
|
|
95
|
-
- lib/steam_api_client/structs/app_details/sub.rb
|
|
96
|
-
- lib/steam_api_client/structs/app_global_achievements.rb
|
|
97
|
-
- lib/steam_api_client/structs/app_new.rb
|
|
98
|
-
- lib/steam_api_client/structs/app_news.rb
|
|
99
|
-
- lib/steam_api_client/structs/base.rb
|
|
100
|
-
- lib/steam_api_client/structs/game_current_players.rb
|
|
101
|
-
- lib/steam_api_client/structs/player_achievements.rb
|
|
102
|
-
- lib/steam_api_client/structs/player_friends.rb
|
|
103
|
-
- lib/steam_api_client/structs/player_game_stats.rb
|
|
104
|
-
- lib/steam_api_client/structs/player_level.rb
|
|
105
|
-
- lib/steam_api_client/structs/player_owned_games.rb
|
|
106
|
-
- lib/steam_api_client/structs/player_recent_games.rb
|
|
107
|
-
- lib/steam_api_client/structs/player_steamid.rb
|
|
108
|
-
- lib/steam_api_client/structs/player_summaries.rb
|
|
109
|
-
- lib/steam_api_client/structs/player_summary.rb
|
|
110
|
-
- lib/steam_api_client/structs/requests/abstract.rb
|
|
111
|
-
- lib/steam_api_client/structs/requests/get_app_details.rb
|
|
112
|
-
- lib/steam_api_client/structs/requests/get_app_global_achievements.rb
|
|
113
|
-
- lib/steam_api_client/structs/requests/get_app_news.rb
|
|
114
|
-
- lib/steam_api_client/structs/requests/get_game_current_players.rb
|
|
115
|
-
- lib/steam_api_client/structs/requests/get_player_achievements.rb
|
|
116
|
-
- lib/steam_api_client/structs/requests/get_player_friends.rb
|
|
117
|
-
- lib/steam_api_client/structs/requests/get_player_game_stats.rb
|
|
118
|
-
- lib/steam_api_client/structs/requests/get_player_level.rb
|
|
119
|
-
- lib/steam_api_client/structs/requests/get_player_owned_games.rb
|
|
120
|
-
- lib/steam_api_client/structs/requests/get_player_recent_games.rb
|
|
121
|
-
- lib/steam_api_client/structs/requests/get_player_steamid.rb
|
|
122
|
-
- lib/steam_api_client/structs/requests/get_player_summaries.rb
|
|
123
|
-
- lib/steam_api_client/structs/requests/storefront_abstract.rb
|
|
124
|
-
- lib/steam_api_client/structs/types.rb
|
|
125
67
|
- lib/steam_api_client/version.rb
|
|
126
68
|
homepage: https://github.com/jpechaves/steam_api
|
|
127
69
|
licenses:
|
|
128
70
|
- MIT
|
|
129
71
|
metadata:
|
|
130
72
|
homepage_uri: https://github.com/jpechaves/steam_api
|
|
73
|
+
source_code_uri: https://github.com/jpechaves/steam_api
|
|
74
|
+
changelog_uri: https://github.com/jpechaves/steam_api/blob/main/CHANGELOG.md
|
|
75
|
+
bug_tracker_uri: https://github.com/jpechaves/steam_api/issues
|
|
76
|
+
documentation_uri: https://rubydoc.info/gems/steam_api_client
|
|
131
77
|
rubygems_mfa_required: 'true'
|
|
132
78
|
post_install_message:
|
|
133
79
|
rdoc_options: []
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that expose the necessary method(s) to get the details of an
|
|
4
|
-
# app in the Steam Storefront Api.
|
|
5
|
-
class AppDetails < Base
|
|
6
|
-
# Get on the Api the details of an app.
|
|
7
|
-
# @param [Integer] appid The Steam app id
|
|
8
|
-
# @param [Array<Integer>] filters The Steam to filter field values
|
|
9
|
-
# @param [String] country_code Country code for method to return appropriate currency values.
|
|
10
|
-
# Defaults to 'US'.
|
|
11
|
-
# @param [String] locale Localized ISO 639-1 string.
|
|
12
|
-
# Defaults to 'en'.
|
|
13
|
-
# @return [SteamApiClient::Structs::AppDetails::Details] instance with the app details.
|
|
14
|
-
# When the app is unavailable, `response.success` is false and `response.data` is nil.
|
|
15
|
-
def retrieve(appid:, filters: [], country_code: "US", locale: "en")
|
|
16
|
-
build_request_and_run(
|
|
17
|
-
SteamApiClient::Structs::Requests::GetAppDetails,
|
|
18
|
-
SteamApiClient::Structs::AppDetails::Details,
|
|
19
|
-
appid: appid,
|
|
20
|
-
filters: filters,
|
|
21
|
-
cc: country_code,
|
|
22
|
-
l: locale
|
|
23
|
-
)
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that expose the necessary method(s) to get the global achievements
|
|
4
|
-
# of an app in the Steam Web Api.
|
|
5
|
-
class AppGlobalAchievements < Base
|
|
6
|
-
# Get on the Api all global achievements info of an App in the Steam.
|
|
7
|
-
# @param [Integer] appid The Steam app id (sent to Steam as `gameid`)
|
|
8
|
-
# @return [SteamApiClient::Structs::AppGlobalAchievements] instance with the
|
|
9
|
-
# player summary details.
|
|
10
|
-
def retrieve(appid:)
|
|
11
|
-
build_request_and_run(
|
|
12
|
-
SteamApiClient::Structs::Requests::GetAppGlobalAchievements,
|
|
13
|
-
SteamApiClient::Structs::AppGlobalAchievements,
|
|
14
|
-
gameid: appid
|
|
15
|
-
)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that expose the necessary method(s) to get the news of an
|
|
4
|
-
# app in the Steam Web Api.
|
|
5
|
-
class AppNews < Base
|
|
6
|
-
# Get on the Api one or more news of an App in the Steam.
|
|
7
|
-
# @param [Integer] appid The Steam app id
|
|
8
|
-
# @param [Integer] count The number of wanted news
|
|
9
|
-
# @param [Integer] maxlength The max length of the news content
|
|
10
|
-
# @return [SteamApiClient::Structs::AppNews] instance with the
|
|
11
|
-
# player summary details.
|
|
12
|
-
def retrieve(appid:, count:, maxlength: 300)
|
|
13
|
-
build_request_and_run(
|
|
14
|
-
SteamApiClient::Structs::Requests::GetAppNews,
|
|
15
|
-
SteamApiClient::Structs::AppNews,
|
|
16
|
-
appid: appid,
|
|
17
|
-
count: count,
|
|
18
|
-
maxlength: maxlength
|
|
19
|
-
)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class responsible to expose the methods necessary to perform a request
|
|
4
|
-
# on the Steam Web Api.
|
|
5
|
-
# @abstract class for the Requestors
|
|
6
|
-
class Base
|
|
7
|
-
# Initialize the class
|
|
8
|
-
# @param [SteamApiClient::Client] the client object.
|
|
9
|
-
def initialize(client)
|
|
10
|
-
@client = client
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
protected
|
|
14
|
-
|
|
15
|
-
# Build an Request and executes it
|
|
16
|
-
def build_request_and_run(request_struct_class, response_struct_class, **params)
|
|
17
|
-
request_struct = request_struct_class.build_from_params(params)
|
|
18
|
-
|
|
19
|
-
response = build_request(request_struct, response_struct_class).run
|
|
20
|
-
response.result
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
attr_accessor :client
|
|
24
|
-
|
|
25
|
-
private
|
|
26
|
-
|
|
27
|
-
def build_request(request_struct, response_struct_class)
|
|
28
|
-
Request.new(request_struct: request_struct, response_struct: response_struct_class, client: client)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that expose the necessary method(s) to get number of current players
|
|
4
|
-
# for a game in the Steam Web Api.
|
|
5
|
-
class GameCurrentPlayers < Base
|
|
6
|
-
# Get the number of current players for a game.
|
|
7
|
-
# @param [Integer] appid The Steam app id
|
|
8
|
-
# @return [SteamApiClient::Structs::GameCurrentPlayers] instance with the
|
|
9
|
-
# game current players count.
|
|
10
|
-
def retrieve(appid:)
|
|
11
|
-
build_request_and_run(
|
|
12
|
-
SteamApiClient::Structs::Requests::GetGameCurrentPlayers,
|
|
13
|
-
SteamApiClient::Structs::GameCurrentPlayers,
|
|
14
|
-
appid: appid
|
|
15
|
-
)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that exposes the necessary method(s) to get the achievements of a
|
|
4
|
-
# player for a given app.
|
|
5
|
-
class PlayerAchievements < Base
|
|
6
|
-
# Returns a list of achievements for a user by app id.
|
|
7
|
-
# @param [Integer] appid The Steam app id
|
|
8
|
-
# @param [Integer] steamid The Steam user id
|
|
9
|
-
# @return [SteamApiClient::Structs::PlayerAchievements] instance with the
|
|
10
|
-
# player summary details.
|
|
11
|
-
def retrieve(appid:, steamid:)
|
|
12
|
-
build_request_and_run(
|
|
13
|
-
SteamApiClient::Structs::Requests::GetPlayerAchievements,
|
|
14
|
-
SteamApiClient::Structs::PlayerAchievements,
|
|
15
|
-
appid: appid,
|
|
16
|
-
steamid: steamid
|
|
17
|
-
)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that expose the necessary method(s) to get an User
|
|
4
|
-
# friend list in the Steam Web Api.
|
|
5
|
-
class PlayerFriends < Base
|
|
6
|
-
# Get an User complete friend list, if public.
|
|
7
|
-
# @param [Integer] steamid The Steam user id
|
|
8
|
-
# @param [String] relationship Relationship filter. Possibles values: 'all', 'friend'.
|
|
9
|
-
# @return [SteamApiClient::Structs::PlayerFriends] instance with the
|
|
10
|
-
# player friends list.
|
|
11
|
-
def retrieve(steamid:, relationship: "all")
|
|
12
|
-
build_request_and_run(
|
|
13
|
-
SteamApiClient::Structs::Requests::GetPlayerFriends,
|
|
14
|
-
SteamApiClient::Structs::PlayerFriends,
|
|
15
|
-
steamid: steamid,
|
|
16
|
-
relationship: relationship
|
|
17
|
-
)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that exposes the necessary method(s) to get the stats of a
|
|
4
|
-
# player for a given game/appid.
|
|
5
|
-
class PlayerGameStats < Base
|
|
6
|
-
# Returns a list of stats for a user for a given game/appid.
|
|
7
|
-
# @param [Integer] appid The Steam app id
|
|
8
|
-
# @param [Integer] steamid The Steam user id
|
|
9
|
-
# @return [SteamApiClient::Structs::PlayerGameStats] instance with the
|
|
10
|
-
# player summary details.
|
|
11
|
-
def retrieve(appid:, steamid:)
|
|
12
|
-
build_request_and_run(
|
|
13
|
-
SteamApiClient::Structs::Requests::GetPlayerGameStats,
|
|
14
|
-
SteamApiClient::Structs::PlayerGameStats,
|
|
15
|
-
appid: appid,
|
|
16
|
-
steamid: steamid
|
|
17
|
-
)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that exposes the necessary method(s) to get level of an user.
|
|
4
|
-
class PlayerLevel < Base
|
|
5
|
-
# Returns the user current level on Steam.
|
|
6
|
-
# @param [Integer] steamid The Steam user id
|
|
7
|
-
# @return [SteamApiClient::Structs::PlayerLevel] instance with the
|
|
8
|
-
# player level.
|
|
9
|
-
def retrieve(steamid:)
|
|
10
|
-
build_request_and_run(
|
|
11
|
-
SteamApiClient::Structs::Requests::GetPlayerLevel,
|
|
12
|
-
SteamApiClient::Structs::PlayerLevel,
|
|
13
|
-
steamid: steamid
|
|
14
|
-
)
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that exposes the necessary method(s) to get a list of
|
|
4
|
-
# the player owned games, if public.
|
|
5
|
-
class PlayerOwnedGames < Base
|
|
6
|
-
# Returns a list of all games owned by the user.
|
|
7
|
-
# @param [Integer] steamid The Steam user id
|
|
8
|
-
# @param [Boolean] include_appinfo Flag to include all game related information
|
|
9
|
-
# @param [Boolean] include_played_free_games Flag to include free games
|
|
10
|
-
# @return [SteamApiClient::Structs::PlayerOwnedGames] instance with the
|
|
11
|
-
# player owned games details.
|
|
12
|
-
def retrieve(steamid:, include_appinfo: false, include_played_free_games: false)
|
|
13
|
-
build_request_and_run(
|
|
14
|
-
SteamApiClient::Structs::Requests::GetPlayerOwnedGames,
|
|
15
|
-
SteamApiClient::Structs::PlayerOwnedGames,
|
|
16
|
-
steamid: steamid,
|
|
17
|
-
include_appinfo: include_appinfo,
|
|
18
|
-
include_played_free_games: include_played_free_games
|
|
19
|
-
)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that exposes the necessary method(s) to get a list of
|
|
4
|
-
# recently played games for a user.
|
|
5
|
-
class PlayerRecentGames < Base
|
|
6
|
-
# Returns a list of recently played games for a user.
|
|
7
|
-
# @param [Integer] steamid - The Steam user id
|
|
8
|
-
# @param [Integer] count - The number of games that should return
|
|
9
|
-
# @return [SteamApiClient::Structs::PlayerRecentGames] instance with the
|
|
10
|
-
# player summary details.
|
|
11
|
-
def retrieve(steamid:, count: 5)
|
|
12
|
-
build_request_and_run(
|
|
13
|
-
SteamApiClient::Structs::Requests::GetPlayerRecentGames,
|
|
14
|
-
SteamApiClient::Structs::PlayerRecentGames,
|
|
15
|
-
steamid: steamid,
|
|
16
|
-
count: count
|
|
17
|
-
)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that exposes the necessary method(s) to get The 64 bit Steam ID
|
|
4
|
-
# the vanity URL resolves to.
|
|
5
|
-
class PlayerSteamId < Base
|
|
6
|
-
# Returns the 64 bit Steam ID the vanity URL resolves to.
|
|
7
|
-
# @param [String] vanityurl - The Steam user short url
|
|
8
|
-
# @return [SteamApiClient::Structs::PlayerSteamId] instance with the
|
|
9
|
-
# player SteamId.
|
|
10
|
-
def retrieve(vanityurl:)
|
|
11
|
-
build_request_and_run(
|
|
12
|
-
SteamApiClient::Structs::Requests::GetPlayerSteamId,
|
|
13
|
-
SteamApiClient::Structs::PlayerSteamId,
|
|
14
|
-
vanityurl: vanityurl
|
|
15
|
-
)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module SteamApiClient
|
|
2
|
-
module Requestors
|
|
3
|
-
# Class that expose the necessary method(s) to get the summary of a
|
|
4
|
-
# player profile in the Steam Web Api.
|
|
5
|
-
class PlayerSummaries < Base
|
|
6
|
-
# Get on the Api the summary of a player profile.
|
|
7
|
-
# @param [Array<Integer>] steamids - The Steam order's id
|
|
8
|
-
# @return [SteamApiClient::Structs::PlayerSummaries] instance with the
|
|
9
|
-
# player summary details.
|
|
10
|
-
def retrieve(steamids:)
|
|
11
|
-
build_request_and_run(
|
|
12
|
-
SteamApiClient::Structs::Requests::GetPlayerSummaries,
|
|
13
|
-
SteamApiClient::Structs::PlayerSummaries,
|
|
14
|
-
steamids: steamids
|
|
15
|
-
)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|