reso_transport 1.5.18 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +20 -16
- data/bin/rake +1 -2
- data/lib/reso_transport/authentication/fetch_token_auth.rb +3 -9
- data/lib/reso_transport/client.rb +4 -5
- data/lib/reso_transport/query.rb +2 -4
- data/lib/reso_transport/resource.rb +7 -0
- data/lib/reso_transport/version.rb +1 -1
- data/reso_transport.gemspec +6 -6
- data/sample_secrets.yml +9 -0
- metadata +38 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4547e1ef30f00936864556de5a3ec0ac71b3f200ba9deabb4d3444b9aaa8eec6
|
4
|
+
data.tar.gz: 6cb4e2800b0bd1ac913936e7d741f7aa454ec174d45ec93fd904a40ef76287fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91f915be12b5ff4392079e001732341bdb4911b18d0bf525ef05e8ab6a0a21401f7695dcc9810bd22f87d50b738acd4ae07c64eee1c037bed95c74e354cbcf98
|
7
|
+
data.tar.gz: 42f5362c361eea674fba3b4b490aad0e73dd203f531b4621597a4cf24feae16b31691e26ddab8c021f01f45ad210ecccb08b413e007987297c2ea743bfbbeddd
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.1.2
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,37 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
reso_transport (1.5.
|
5
|
-
faraday (~>
|
4
|
+
reso_transport (1.5.19)
|
5
|
+
faraday (~> 2)
|
6
|
+
rexml
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
|
-
byebug (11.
|
11
|
-
faraday (
|
12
|
-
|
13
|
-
|
11
|
+
byebug (11.1.3)
|
12
|
+
faraday (2.7.7)
|
13
|
+
faraday-net_http (>= 2.0, < 3.1)
|
14
|
+
ruby2_keywords (>= 0.0.4)
|
15
|
+
faraday-net_http (3.0.2)
|
16
|
+
minitest (5.18.1)
|
14
17
|
minitest-rg (5.2.0)
|
15
18
|
minitest (~> 5.0)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
rake (13.0.6)
|
20
|
+
rexml (3.2.5)
|
21
|
+
ruby2_keywords (0.0.5)
|
22
|
+
vcr (6.1.0)
|
19
23
|
|
20
24
|
PLATFORMS
|
21
|
-
|
25
|
+
arm64-darwin-22
|
22
26
|
|
23
27
|
DEPENDENCIES
|
24
28
|
bundler (~> 2)
|
25
|
-
byebug
|
26
|
-
minitest
|
27
|
-
minitest-rg
|
28
|
-
rake
|
29
|
+
byebug
|
30
|
+
minitest
|
31
|
+
minitest-rg
|
32
|
+
rake
|
29
33
|
reso_transport!
|
30
|
-
vcr
|
34
|
+
vcr
|
31
35
|
|
32
36
|
BUNDLED WITH
|
33
|
-
2.
|
37
|
+
2.4.12
|
data/bin/rake
CHANGED
@@ -9,8 +9,7 @@
|
|
9
9
|
#
|
10
10
|
|
11
11
|
require "pathname"
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
-
Pathname.new(__FILE__).realpath)
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
14
13
|
|
15
14
|
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
15
|
|
@@ -1,13 +1,7 @@
|
|
1
1
|
module ResoTransport
|
2
2
|
module Authentication
|
3
3
|
class FetchTokenAuth < AuthStrategy
|
4
|
-
attr_reader :endpoint,
|
5
|
-
:client_id,
|
6
|
-
:client_secret,
|
7
|
-
:grant_type,
|
8
|
-
:scope,
|
9
|
-
:username,
|
10
|
-
:password
|
4
|
+
attr_reader :endpoint, :client_id, :client_secret, :grant_type, :scope, :username, :password
|
11
5
|
|
12
6
|
def initialize(options)
|
13
7
|
super()
|
@@ -24,10 +18,10 @@ module ResoTransport
|
|
24
18
|
|
25
19
|
def connection
|
26
20
|
@connection ||= Faraday.new(@endpoint) do |faraday|
|
27
|
-
faraday.request
|
21
|
+
faraday.request :url_encoded
|
22
|
+
faraday.request :authorization, :basic, client_id, client_secret
|
28
23
|
faraday.response :logger, ResoTransport.configuration.logger if ResoTransport.configuration.logger
|
29
24
|
faraday.adapter Faraday.default_adapter
|
30
|
-
faraday.basic_auth client_id, client_secret
|
31
25
|
end
|
32
26
|
end
|
33
27
|
|
@@ -1,17 +1,16 @@
|
|
1
1
|
module ResoTransport
|
2
2
|
class Client
|
3
|
-
attr_reader :connection, :uid, :vendor, :endpoint, :authentication, :md_file, :md_cache, :ds_file, :ds_cache,
|
4
|
-
:use_replication_endpoint
|
3
|
+
attr_reader :connection, :uid, :vendor, :endpoint, :authentication, :md_file, :md_cache, :ds_file, :ds_cache, :use_replication_endpoint
|
5
4
|
|
6
5
|
def initialize(options)
|
7
6
|
@use_replication_endpoint = options.fetch(:use_replication_endpoint, false)
|
8
7
|
@endpoint = options.fetch(:endpoint)
|
9
|
-
@md_file = options.fetch(:md_file, nil)
|
10
|
-
@ds_file = options.fetch(:ds_file, nil)
|
11
8
|
@authentication = ensure_valid_auth_strategy(options.fetch(:authentication))
|
12
9
|
@vendor = options.fetch(:vendor, {})
|
13
10
|
@faraday_options = options.fetch(:faraday_options, {})
|
14
11
|
@logger = options.fetch(:logger, nil)
|
12
|
+
@md_file = options.fetch(:md_file, nil)
|
13
|
+
@ds_file = options.fetch(:ds_file, nil)
|
15
14
|
@md_cache = options.fetch(:md_cache, ResoTransport::MetadataCache)
|
16
15
|
@ds_cache = options.fetch(:ds_cache, ResoTransport::MetadataCache)
|
17
16
|
@connection = establish_connection(@endpoint)
|
@@ -22,7 +21,7 @@ module ResoTransport
|
|
22
21
|
faraday.request :url_encoded
|
23
22
|
faraday.response :logger, @logger || ResoTransport.configuration.logger
|
24
23
|
faraday.use Authentication::Middleware, @authentication
|
25
|
-
faraday.adapter Faraday.default_adapter
|
24
|
+
faraday.adapter Faraday.default_adapter
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
data/lib/reso_transport/query.rb
CHANGED
@@ -91,15 +91,13 @@ module ResoTransport
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def response
|
94
|
-
|
95
|
-
|
96
|
-
resource.get(next_link_or_params)
|
94
|
+
use_next_link? ? resource.get_next_link_results(next_link) : resource.get(compile_params)
|
97
95
|
rescue Faraday::ConnectionFailed
|
98
96
|
raise NoResponse.new(resource.request, nil, resource)
|
99
97
|
end
|
100
98
|
|
101
99
|
def use_next_link?
|
102
|
-
compile_params[:replication] && next_link.
|
100
|
+
compile_params[:replication] && !next_link.nil?
|
103
101
|
end
|
104
102
|
|
105
103
|
def handle_response(response)
|
@@ -43,6 +43,13 @@ module ResoTransport
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
+
def get_next_link_results(next_link)
|
47
|
+
client.connection.get(next_link) do |req|
|
48
|
+
req.headers['Accept'] = 'application/json'
|
49
|
+
@request = req
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
46
53
|
def url
|
47
54
|
return local['ResourcePath'].gsub(%r{^/}, '') if local
|
48
55
|
|
data/reso_transport.gemspec
CHANGED
@@ -24,12 +24,12 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
-
spec.add_dependency 'faraday', '~>
|
27
|
+
spec.add_dependency 'faraday', '~> 2'
|
28
|
+
spec.add_dependency 'rexml'
|
28
29
|
|
29
30
|
spec.add_development_dependency 'bundler', '~> 2'
|
30
|
-
spec.add_development_dependency 'byebug'
|
31
|
-
spec.add_development_dependency 'minitest'
|
32
|
-
spec.add_development_dependency 'minitest-rg'
|
33
|
-
spec.add_development_dependency 'rake'
|
34
|
-
spec.add_development_dependency 'vcr', '~> 6.0'
|
31
|
+
spec.add_development_dependency 'byebug'
|
32
|
+
spec.add_development_dependency 'minitest'
|
33
|
+
spec.add_development_dependency 'minitest-rg'
|
34
|
+
spec.add_development_dependency 'rake'
|
35
35
|
end
|
data/sample_secrets.yml
CHANGED
@@ -16,6 +16,15 @@
|
|
16
16
|
:client_id: CLIENT_ID_HERE
|
17
17
|
:client_secret: CLIENT_SECRET_HERE
|
18
18
|
|
19
|
+
:rapattoni:
|
20
|
+
:vendor:
|
21
|
+
:name: rapattoni
|
22
|
+
:endpoint: ENDPOINT_URL_HERE
|
23
|
+
:authentication:
|
24
|
+
:endpoint: AUTH_ENDPOINT_HERE
|
25
|
+
:client_id: CLIENT_ID_HERE
|
26
|
+
:client_secret: CLIENT_SECRET_HERE
|
27
|
+
|
19
28
|
:spark:
|
20
29
|
:md_file: PATH_TO_METADATA_FILE
|
21
30
|
:vendor:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reso_transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Druse
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,98 +16,98 @@ 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
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rexml
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
type: :
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: byebug
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: minitest
|
70
|
+
name: minitest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: minitest-rg
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0'
|
111
111
|
description: Supports Trestle, Spark, Bridge Interactive, MLS Grid
|
112
112
|
email:
|
113
113
|
- jon@wrstudios.com
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- ".rubocop.yml"
|
121
121
|
- ".ruby-version"
|
122
122
|
- ".travis.yml"
|
123
|
+
- CHANGELOG.md
|
123
124
|
- CODE_OF_CONDUCT.md
|
124
125
|
- Gemfile
|
125
126
|
- Gemfile.lock
|
@@ -159,7 +160,7 @@ homepage: http://github.com/wrstudios/reso_transport
|
|
159
160
|
licenses:
|
160
161
|
- MIT
|
161
162
|
metadata: {}
|
162
|
-
post_install_message:
|
163
|
+
post_install_message:
|
163
164
|
rdoc_options: []
|
164
165
|
require_paths:
|
165
166
|
- lib
|
@@ -174,8 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
175
|
- !ruby/object:Gem::Version
|
175
176
|
version: '0'
|
176
177
|
requirements: []
|
177
|
-
rubygems_version: 3.
|
178
|
-
signing_key:
|
178
|
+
rubygems_version: 3.3.7
|
179
|
+
signing_key:
|
179
180
|
specification_version: 4
|
180
181
|
summary: A utility for consuming RESO Web API connections
|
181
182
|
test_files: []
|