reso_api 0.4.9 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +26 -43
- data/lib/reso_api/app/models/reso/api/client.rb +16 -4
- data/lib/reso_api/version.rb +1 -1
- data/license.md +21 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb4efcbd6e142b91dc5db82ab6391f768acfe72018c3a6a1f28f94add767aeb6
|
4
|
+
data.tar.gz: 196b5b3ae73192acb4c6d30f974c6a232487115ba4eaa146c2c9b5d1a610328f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53f38b2ab327a82f32ab5296ffad4698f8f3e304557becda120c3010ab40e52a4db923d49ef26e914366e0d210d749baa84b7f3a1b7300d0bedfb43d8c7ca8e2
|
7
|
+
data.tar.gz: 3ab0add11e6b7b6adbf25c8cebe4203cead5e74b5276f83fe121df34d100224aefb05ababbcb5f9eb7c20a1f64c38e0ee669b908ce90b24cd446081a5d74c07c
|
data/Gemfile.lock
CHANGED
@@ -1,74 +1,57 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
reso_api (0.
|
4
|
+
reso_api (0.5.0)
|
5
5
|
activesupport
|
6
6
|
oauth2
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (
|
11
|
+
activesupport (7.0.3)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
13
|
i18n (>= 1.6, < 2)
|
14
14
|
minitest (>= 5.1)
|
15
15
|
tzinfo (~> 2.0)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
faraday-em_http (~> 1.0)
|
21
|
-
faraday-em_synchrony (~> 1.0)
|
22
|
-
faraday-excon (~> 1.1)
|
23
|
-
faraday-httpclient (~> 1.0.1)
|
24
|
-
faraday-net_http (~> 1.0)
|
25
|
-
faraday-net_http_persistent (~> 1.1)
|
26
|
-
faraday-patron (~> 1.0)
|
27
|
-
faraday-rack (~> 1.0)
|
28
|
-
multipart-post (>= 1.2, < 3)
|
16
|
+
concurrent-ruby (1.1.10)
|
17
|
+
diff-lcs (1.5.0)
|
18
|
+
faraday (2.3.0)
|
19
|
+
faraday-net_http (~> 2.0)
|
29
20
|
ruby2_keywords (>= 0.0.4)
|
30
|
-
faraday-
|
31
|
-
|
32
|
-
faraday-excon (1.1.0)
|
33
|
-
faraday-httpclient (1.0.1)
|
34
|
-
faraday-net_http (1.0.1)
|
35
|
-
faraday-net_http_persistent (1.2.0)
|
36
|
-
faraday-patron (1.0.0)
|
37
|
-
faraday-rack (1.0.0)
|
38
|
-
i18n (1.8.10)
|
21
|
+
faraday-net_http (2.0.3)
|
22
|
+
i18n (1.10.0)
|
39
23
|
concurrent-ruby (~> 1.0)
|
40
|
-
jwt (2.
|
41
|
-
minitest (5.
|
24
|
+
jwt (2.3.0)
|
25
|
+
minitest (5.15.0)
|
42
26
|
multi_json (1.15.0)
|
43
27
|
multi_xml (0.6.0)
|
44
|
-
|
45
|
-
|
46
|
-
faraday (>= 0.8, < 2.0)
|
28
|
+
oauth2 (1.4.9)
|
29
|
+
faraday (>= 0.17.3, < 3.0)
|
47
30
|
jwt (>= 1.0, < 3.0)
|
48
31
|
multi_json (~> 1.3)
|
49
32
|
multi_xml (~> 0.5)
|
50
33
|
rack (>= 1.2, < 3)
|
51
|
-
rack (2.2.3)
|
34
|
+
rack (2.2.3.1)
|
52
35
|
rake (13.0.6)
|
53
|
-
rspec (3.
|
54
|
-
rspec-core (~> 3.
|
55
|
-
rspec-expectations (~> 3.
|
56
|
-
rspec-mocks (~> 3.
|
57
|
-
rspec-core (3.
|
58
|
-
rspec-support (~> 3.
|
59
|
-
rspec-expectations (3.
|
36
|
+
rspec (3.11.0)
|
37
|
+
rspec-core (~> 3.11.0)
|
38
|
+
rspec-expectations (~> 3.11.0)
|
39
|
+
rspec-mocks (~> 3.11.0)
|
40
|
+
rspec-core (3.11.0)
|
41
|
+
rspec-support (~> 3.11.0)
|
42
|
+
rspec-expectations (3.11.0)
|
60
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
61
|
-
rspec-support (~> 3.
|
62
|
-
rspec-mocks (3.
|
44
|
+
rspec-support (~> 3.11.0)
|
45
|
+
rspec-mocks (3.11.1)
|
63
46
|
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
-
rspec-support (~> 3.
|
65
|
-
rspec-support (3.
|
47
|
+
rspec-support (~> 3.11.0)
|
48
|
+
rspec-support (3.11.0)
|
66
49
|
ruby2_keywords (0.0.5)
|
67
50
|
tzinfo (2.0.4)
|
68
51
|
concurrent-ruby (~> 1.0)
|
69
|
-
zeitwerk (2.4.2)
|
70
52
|
|
71
53
|
PLATFORMS
|
54
|
+
arm64-darwin-21
|
72
55
|
x86_64-linux
|
73
56
|
|
74
57
|
DEPENDENCIES
|
@@ -78,4 +61,4 @@ DEPENDENCIES
|
|
78
61
|
rspec (~> 3.0)
|
79
62
|
|
80
63
|
BUNDLED WITH
|
81
|
-
2.
|
64
|
+
2.3.7
|
@@ -51,6 +51,7 @@ module RESO
|
|
51
51
|
hash = args.first.is_a?(Hash) ? args.first : {}
|
52
52
|
endpoint = FILTERABLE_ENDPOINTS[method_name]
|
53
53
|
response = {}
|
54
|
+
threads = []
|
54
55
|
params = {
|
55
56
|
"$select": hash[:select],
|
56
57
|
"$filter": hash[:filter],
|
@@ -66,14 +67,22 @@ module RESO
|
|
66
67
|
response = perform_call(endpoint, params)
|
67
68
|
|
68
69
|
if response["value"].class.eql?(Array)
|
69
|
-
|
70
|
+
threads << Thread.new do
|
71
|
+
hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
|
72
|
+
end
|
70
73
|
end
|
71
74
|
|
72
75
|
while (next_link = response["@odata.nextLink"]).present?
|
73
|
-
|
74
|
-
|
76
|
+
threads << Thread.new do
|
77
|
+
response = perform_call(next_link, nil)
|
78
|
+
end
|
79
|
+
|
80
|
+
threads.each(&:join)
|
81
|
+
|
75
82
|
if response["value"].class.eql?(Array)
|
76
|
-
|
83
|
+
threads << Thread.new do
|
84
|
+
hash[:batch] ? block.call(response["value"]) : response["value"].each{|hash| block.call(hash)}
|
85
|
+
end
|
77
86
|
end
|
78
87
|
end
|
79
88
|
else
|
@@ -170,6 +179,9 @@ module RESO
|
|
170
179
|
raise StandardError
|
171
180
|
elsif response.is_a?(Hash) && response.has_key?("error")
|
172
181
|
raise StandardError
|
182
|
+
elsif response.is_a?(Hash) && response.has_key?("retry-after")
|
183
|
+
sleep response["retry-after"].to_i
|
184
|
+
raise StandardError
|
173
185
|
end
|
174
186
|
rescue Net::ReadTimeout, StandardError
|
175
187
|
if (retries += 1) <= 5
|
data/lib/reso_api/version.rb
CHANGED
data/license.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 Michael Edlund
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
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: 0.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Edlund
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- lib/reso_api/app/models/reso/api/client.rb
|
104
104
|
- lib/reso_api/config/inflections.rb
|
105
105
|
- lib/reso_api/version.rb
|
106
|
+
- license.md
|
106
107
|
- reso_api.gemspec
|
107
108
|
homepage: https://github.com/arcticleo/reso_api
|
108
109
|
licenses: []
|