reso_api 0.5.9 → 1.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reso_api/app/models/reso/api/client.rb +8 -15
- data/lib/reso_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64179669c8f73aa664bf2b2815e3e29408c889c9a1b666feea5c72d085e66883
|
4
|
+
data.tar.gz: e8a5487613760ab0639f531c795c6fb53a384b5b24cc89713fa0e4c367aef50f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '085e6a8cb6ca3c2888d730159bc1725f9fce37caa51ac5c5463fd49c435212e9a22b9f90c85baf54da25d3abc3b4e31b5bfb59312d400a2ef95702e1bd7a1d28'
|
7
|
+
data.tar.gz: 450cbebaa917b8a222de34348befcc83953886ed411fa2095ec792628c111f3ae319bf852dbe683eb184234ae3a8c7c629e2d1d1d3bb4c18e486649deca5f5ab
|
@@ -51,7 +51,6 @@ module RESO
|
|
51
51
|
hash = args.first.is_a?(Hash) ? args.first : {}
|
52
52
|
endpoint = FILTERABLE_ENDPOINTS[method_name]
|
53
53
|
response = {}
|
54
|
-
threads = []
|
55
54
|
params = {
|
56
55
|
"$select": hash[:select],
|
57
56
|
"$filter": hash[:filter],
|
@@ -68,25 +67,15 @@ module RESO
|
|
68
67
|
response = perform_call(endpoint, params)
|
69
68
|
|
70
69
|
if response["value"].class.eql?(Array)
|
71
|
-
|
72
|
-
hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
|
73
|
-
end
|
70
|
+
hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
|
74
71
|
end
|
75
72
|
|
76
73
|
while (next_link = response["@odata.nextLink"]).present?
|
77
|
-
|
78
|
-
response = perform_call(next_link, nil)
|
79
|
-
end
|
80
|
-
|
81
|
-
threads.each(&:join)
|
82
|
-
|
74
|
+
response = perform_call(next_link, nil)
|
83
75
|
if response["value"].class.eql?(Array)
|
84
|
-
|
85
|
-
hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
|
86
|
-
end
|
76
|
+
hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
|
87
77
|
end
|
88
78
|
end
|
89
|
-
threads.each(&:join)
|
90
79
|
else
|
91
80
|
return perform_call(endpoint, params)
|
92
81
|
end
|
@@ -137,7 +126,7 @@ module RESO
|
|
137
126
|
end
|
138
127
|
|
139
128
|
def oauth2_token_path
|
140
|
-
File.join(Dir.tmpdir, [base_url.parameterize, "
|
129
|
+
File.join(Dir.tmpdir, [base_url.parameterize, client_id, "oauth-token.json"].join("-"))
|
141
130
|
end
|
142
131
|
|
143
132
|
def oauth2_payload
|
@@ -175,13 +164,17 @@ module RESO
|
|
175
164
|
end
|
176
165
|
response = JSON(res.body) rescue res.body
|
177
166
|
if response.is_a?(String) && response.include?('Bad Gateway')
|
167
|
+
puts "Error: Bad Gateway."
|
178
168
|
raise StandardError
|
179
169
|
elsif response.is_a?(String) && response.include?('Unauthorized')
|
170
|
+
puts "Error: Unauthorized."
|
180
171
|
fresh_oauth2_payload
|
181
172
|
raise StandardError
|
182
173
|
elsif response.is_a?(Hash) && response.has_key?("error")
|
174
|
+
puts "Error."
|
183
175
|
raise StandardError
|
184
176
|
elsif response.is_a?(Hash) && response.has_key?("retry-after")
|
177
|
+
puts "Error: Retrying in #{response["retry-after"].to_i}} seconds."
|
185
178
|
sleep response["retry-after"].to_i
|
186
179
|
raise StandardError
|
187
180
|
end
|
data/lib/reso_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reso_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.5.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Edlund
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|