api_six_client 1.2.12 → 1.3.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/Gemfile.lock +5 -25
- data/api_six_client.gemspec +1 -1
- data/lib/api_six_client/base.rb +6 -37
- data/lib/api_six_client/base_int.rb +4 -6
- data/lib/api_six_client/base_v2.rb +4 -3
- data/lib/api_six_client/config.rb +0 -2
- data/lib/api_six_client/errors.rb +0 -1
- data/lib/api_six_client/version.rb +1 -1
- data/lib/api_six_client.rb +9 -22
- metadata +4 -6
- data/lib/api_six_client/base_hidden.rb +0 -15
- data/lib/api_six_client/base_v2_int.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd36ec4d129e75145e125183cc544adc31692f3dc24d4d03262b232d75e2040e
|
4
|
+
data.tar.gz: b78b1b6d2e482e2cd6fc4a524dcb4b748ed5014b508eb43ae61d110ac3c17f3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 300c27ce6399958c58707ec63b08b3c0228d254a117b619e811a7bc1e7ff879216d703e48b6b1bb22aaec19b90da21c229808e3b4297700783d4d7f450d3a76e
|
7
|
+
data.tar.gz: 28cafdda86f08a0882c4c4cf15a08fe4be9ce4c65ab33c4bb7cbac8b828c4e66c4a16d47b534e0cc52878d9bee569ebdd37a85b2a313457193dceb4e7c686f6e
|
data/Gemfile.lock
CHANGED
@@ -1,36 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
api_six_client (1.
|
5
|
-
faraday (~>
|
4
|
+
api_six_client (1.3.0)
|
5
|
+
faraday (~> 2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
faraday (
|
11
|
-
faraday-
|
12
|
-
faraday-em_synchrony (~> 1.0)
|
13
|
-
faraday-excon (~> 1.1)
|
14
|
-
faraday-httpclient (~> 1.0)
|
15
|
-
faraday-multipart (~> 1.0)
|
16
|
-
faraday-net_http (~> 1.0)
|
17
|
-
faraday-net_http_persistent (~> 1.0)
|
18
|
-
faraday-patron (~> 1.0)
|
19
|
-
faraday-rack (~> 1.0)
|
20
|
-
faraday-retry (~> 1.0)
|
10
|
+
faraday (2.7.6)
|
11
|
+
faraday-net_http (>= 2.0, < 3.1)
|
21
12
|
ruby2_keywords (>= 0.0.4)
|
22
|
-
faraday-
|
23
|
-
faraday-em_synchrony (1.0.0)
|
24
|
-
faraday-excon (1.1.0)
|
25
|
-
faraday-httpclient (1.0.1)
|
26
|
-
faraday-multipart (1.0.4)
|
27
|
-
multipart-post (~> 2)
|
28
|
-
faraday-net_http (1.0.1)
|
29
|
-
faraday-net_http_persistent (1.2.0)
|
30
|
-
faraday-patron (1.0.0)
|
31
|
-
faraday-rack (1.0.0)
|
32
|
-
faraday-retry (1.0.3)
|
33
|
-
multipart-post (2.3.0)
|
13
|
+
faraday-net_http (3.0.2)
|
34
14
|
rake (13.0.6)
|
35
15
|
ruby2_keywords (0.0.5)
|
36
16
|
|
data/api_six_client.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.add_dependency 'faraday', '~>
|
32
|
+
spec.add_dependency 'faraday', '~> 2'
|
33
33
|
|
34
34
|
# For more information and examples about making a new gem, checkout our
|
35
35
|
# guide at: https://bundler.io/guides/creating_gem.html
|
data/lib/api_six_client/base.rb
CHANGED
@@ -7,13 +7,12 @@ module ApiSixClient
|
|
7
7
|
class Base
|
8
8
|
attr_reader :endpoint
|
9
9
|
|
10
|
-
def initialize(endpoint: nil, auth_token: nil
|
11
|
-
@endpoint = endpoint
|
12
|
-
@auth_token = auth_token
|
13
|
-
@debug_mode = debug_mode || dm
|
10
|
+
def initialize(endpoint: nil, auth_token: nil)
|
11
|
+
@endpoint = endpoint || ApiSixClient.config.endpoint
|
12
|
+
@auth_token = auth_token || ApiSixClient.config.auth_token
|
14
13
|
|
15
|
-
|
16
|
-
|
14
|
+
raise Errors::EndpointIsEmpty unless @endpoint
|
15
|
+
raise Errors::AuthTokenIsEmpty unless @auth_token
|
17
16
|
end
|
18
17
|
|
19
18
|
def post(path, params = {}, headers = {})
|
@@ -36,42 +35,14 @@ module ApiSixClient
|
|
36
35
|
request __method__, path, params, headers
|
37
36
|
end
|
38
37
|
|
39
|
-
protected
|
40
|
-
|
41
|
-
def deprecation_msg
|
42
|
-
Rails.logger.warn("#{self.class} is deprecated") if defined?(Rails)
|
43
|
-
end
|
44
|
-
|
45
|
-
def override_defaults
|
46
|
-
@endpoint ||= ApiSixClient.config.endpoint
|
47
|
-
@auth_token ||= ApiSixClient.config.auth_token
|
48
|
-
end
|
49
|
-
|
50
38
|
private
|
51
39
|
|
52
|
-
def validate_config!
|
53
|
-
raise Errors::EndpointIsEmpty unless @endpoint
|
54
|
-
raise Errors::AuthTokenIsEmpty unless @auth_token
|
55
|
-
end
|
56
|
-
|
57
40
|
def service_path
|
58
41
|
self.class.name.demodulize.underscore
|
59
42
|
end
|
60
43
|
|
61
44
|
def request(method, path, params = {}, headers = {})
|
62
|
-
|
63
|
-
|
64
|
-
response = nil
|
65
|
-
begin
|
66
|
-
response = connection.run_request(method, "#{endpoint}/#{service_path}/#{path}", params.to_json, headers)
|
67
|
-
rescue Faraday::Error => e
|
68
|
-
if defined?(Rails)
|
69
|
-
Rails.logger.error "Message: #{e.message}, caused by: #{self.class.name}##{path}"
|
70
|
-
end
|
71
|
-
|
72
|
-
raise e
|
73
|
-
end
|
74
|
-
|
45
|
+
response = connection.run_request(method, "#{endpoint}/#{service_path}/#{path}", params.to_json, headers)
|
75
46
|
res = JSON.parse(response.body)
|
76
47
|
|
77
48
|
return res.with_indifferent_access if res.is_a?(Hash)
|
@@ -90,8 +61,6 @@ module ApiSixClient
|
|
90
61
|
|
91
62
|
faraday.request :url_encoded
|
92
63
|
faraday.adapter :net_http
|
93
|
-
|
94
|
-
faraday.response :logger, ::Logger.new(STDOUT), bodies: true if @debug_mode
|
95
64
|
end
|
96
65
|
end
|
97
66
|
end
|
@@ -2,14 +2,12 @@
|
|
2
2
|
|
3
3
|
module ApiSixClient
|
4
4
|
class BaseInt < Base
|
5
|
-
|
6
|
-
|
7
|
-
def deprecation_msg
|
8
|
-
end
|
9
|
-
|
10
|
-
def override_defaults
|
5
|
+
def initialize(endpoint: nil, auth_token: nil)
|
11
6
|
@endpoint = ApiSixClient.config.endpoint_int
|
12
7
|
@auth_token = ApiSixClient.config.auth_token_int
|
8
|
+
|
9
|
+
raise Errors::EndpointIsEmpty unless @endpoint
|
10
|
+
raise Errors::AuthTokenIsEmpty unless @auth_token
|
13
11
|
end
|
14
12
|
end
|
15
13
|
end
|
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
module ApiSixClient
|
4
4
|
class BaseV2 < Base
|
5
|
-
|
6
|
-
|
7
|
-
def override_defaults
|
5
|
+
def initialize(endpoint: nil, auth_token: nil)
|
8
6
|
@endpoint = ApiSixClient.config.endpoint_v2
|
9
7
|
@auth_token = ApiSixClient.config.auth_token_v2
|
8
|
+
|
9
|
+
raise Errors::EndpointIsEmpty unless @endpoint
|
10
|
+
raise Errors::AuthTokenIsEmpty unless @auth_token
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
data/lib/api_six_client.rb
CHANGED
@@ -5,8 +5,6 @@ require 'api_six_client/config'
|
|
5
5
|
require 'api_six_client/base'
|
6
6
|
require 'api_six_client/base_v2'
|
7
7
|
require 'api_six_client/base_int'
|
8
|
-
require 'api_six_client/base_hidden'
|
9
|
-
require 'api_six_client/base_v2_int'
|
10
8
|
require 'api_six_client/errors'
|
11
9
|
|
12
10
|
module ApiSixClient
|
@@ -19,31 +17,20 @@ module ApiSixClient
|
|
19
17
|
end
|
20
18
|
|
21
19
|
class Brg < Base; end
|
20
|
+
class Brg_P3 < Base; end
|
22
21
|
class Gbk < Base; end
|
22
|
+
class Kms < Base; end
|
23
|
+
class Lyr < Base; end
|
23
24
|
class Mat < Base; end
|
25
|
+
class Val < Base; end
|
24
26
|
class Prj < Base; end
|
27
|
+
class Prj_P3 < Base; end
|
25
28
|
class Fin < Base; end
|
26
29
|
class Olc < Base; end
|
30
|
+
class Eno < Base; end
|
31
|
+
class Uas < Base; end
|
27
32
|
|
28
|
-
class
|
29
|
-
class
|
30
|
-
class Eno < BaseV2; end
|
31
|
-
class Uas < BaseV2; end
|
32
|
-
|
33
|
-
class OlcInt < BaseHidden; end
|
34
|
-
class AuthInt < BaseHidden; end
|
35
|
-
|
36
|
-
class PrjInt < BaseInt; end
|
33
|
+
class AuthInt < BaseInt; end
|
34
|
+
class OlcInt < BaseInt; end
|
37
35
|
class UasInt < BaseInt; end
|
38
|
-
class BrgInt < BaseInt; end
|
39
|
-
class CadInt < BaseInt; end
|
40
|
-
class NtfInt < BaseInt; end
|
41
|
-
class MatInt < BaseInt; end
|
42
|
-
class FinnInt < BaseInt; end
|
43
|
-
class LyrInt < BaseInt; end
|
44
|
-
class GbkInt < BaseInt; end
|
45
|
-
class Val < BaseInt; end
|
46
|
-
class StataInt < BaseInt; end
|
47
36
|
end
|
48
|
-
|
49
|
-
A6C = ApiSixClient
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_six_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Dobrorodnov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2'
|
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: '
|
26
|
+
version: '2'
|
27
27
|
description: ApiSix is a Ruby gem that provides access to various Lytics services.
|
28
28
|
email:
|
29
29
|
- ei.dobrorodnov@gmail.com
|
@@ -42,10 +42,8 @@ files:
|
|
42
42
|
- bin/setup
|
43
43
|
- lib/api_six_client.rb
|
44
44
|
- lib/api_six_client/base.rb
|
45
|
-
- lib/api_six_client/base_hidden.rb
|
46
45
|
- lib/api_six_client/base_int.rb
|
47
46
|
- lib/api_six_client/base_v2.rb
|
48
|
-
- lib/api_six_client/base_v2_int.rb
|
49
47
|
- lib/api_six_client/config.rb
|
50
48
|
- lib/api_six_client/errors.rb
|
51
49
|
- lib/api_six_client/version.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ApiSixClient
|
4
|
-
class BaseHidden < Base
|
5
|
-
protected
|
6
|
-
|
7
|
-
def deprecation_msg
|
8
|
-
end
|
9
|
-
|
10
|
-
def override_defaults
|
11
|
-
@endpoint = ApiSixClient.config.endpoint_int
|
12
|
-
@auth_token = ApiSixClient.config.auth_token_hidden
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|