reso_api 2.0.0 → 2.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a24486d919c84b2bd716ce37c8b37ee62fca566624f3434acb475dfd2de462b
4
- data.tar.gz: 0e0cdc536424944953720bfe4947b99dc2333c672aab55c6d4cb42908785e7a7
3
+ metadata.gz: f5624dabe91c3a3bd78ddcc2d97739ab10d59d57e4783c73dc47bbdb9c5375f7
4
+ data.tar.gz: cbba6150b14e931a7dec5e452aa58f9eff62714c0975b76b62017ff7e1f2e9db
5
5
  SHA512:
6
- metadata.gz: 56c4522468e00c7891a244ae8efa9de68ea5b7575d72a61c373bd01e616c17a3cac7de8f84912cbd349e1bcb07e397b08c05db81ae34c6136fd07e3156c60385
7
- data.tar.gz: 32c65364cce709339eaabe46a0e165efdfcbc54d7cca45d2cdd99e858af63df1b69adc5813c63fc4980ceb647821648186fcb41df20f8f0465313fc006a656da
6
+ metadata.gz: 0f8a79709def240a5b99ac99afaa3aab9fc716d3c4a81a1a46d8bbb33309f204867a15128ce0cfa3c2ec757b212f66cfb1692aa9139a233e6a94ea99e714c7f8
7
+ data.tar.gz: 00a6bc23609386cad5c943ba6b78b389d7c9309f320504818371e4faf5b9235719ca04266eb85cbfea317a3ef74a79f108939e1c44929bde642cd22a31e11cec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reso_api (2.0.0)
4
+ reso_api (2.0.1)
5
5
  activesupport
6
6
  jwt
7
7
  oauth2
@@ -9,53 +9,79 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (7.0.3)
13
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ activesupport (8.1.2)
13
+ base64
14
+ bigdecimal
15
+ concurrent-ruby (~> 1.0, >= 1.3.1)
16
+ connection_pool (>= 2.2.5)
17
+ drb
14
18
  i18n (>= 1.6, < 2)
19
+ json
20
+ logger (>= 1.4.2)
15
21
  minitest (>= 5.1)
16
- tzinfo (~> 2.0)
22
+ securerandom (>= 0.3)
23
+ tzinfo (~> 2.0, >= 2.0.5)
24
+ uri (>= 0.13.1)
17
25
  base64 (0.3.0)
18
26
  benchmark (0.5.0)
19
27
  bigdecimal (4.0.1)
20
- concurrent-ruby (1.1.10)
21
- diff-lcs (1.5.0)
28
+ concurrent-ruby (1.3.6)
29
+ connection_pool (3.0.2)
30
+ diff-lcs (1.6.2)
22
31
  drb (2.2.3)
23
- faraday (2.3.0)
24
- faraday-net_http (~> 2.0)
25
- ruby2_keywords (>= 0.0.4)
26
- faraday-net_http (2.0.3)
27
- i18n (1.10.0)
32
+ faraday (2.14.1)
33
+ faraday-net_http (>= 2.0, < 3.5)
34
+ json
35
+ logger
36
+ faraday-net_http (3.4.2)
37
+ net-http (~> 0.5)
38
+ hashie (5.1.0)
39
+ logger
40
+ i18n (1.14.8)
28
41
  concurrent-ruby (~> 1.0)
29
- jwt (2.3.0)
42
+ json (2.18.1)
43
+ jwt (3.1.2)
44
+ base64
30
45
  logger (1.7.0)
31
- minitest (5.15.0)
32
- multi_json (1.15.0)
33
- multi_xml (0.6.0)
46
+ minitest (6.0.1)
47
+ prism (~> 1.5)
48
+ multi_xml (0.8.1)
49
+ bigdecimal (>= 3.1, < 5)
34
50
  mutex_m (0.3.0)
35
- oauth2 (1.4.9)
36
- faraday (>= 0.17.3, < 3.0)
37
- jwt (>= 1.0, < 3.0)
38
- multi_json (~> 1.3)
51
+ net-http (0.9.1)
52
+ uri (>= 0.11.1)
53
+ oauth2 (2.0.18)
54
+ faraday (>= 0.17.3, < 4.0)
55
+ jwt (>= 1.0, < 4.0)
56
+ logger (~> 1.2)
39
57
  multi_xml (~> 0.5)
40
- rack (>= 1.2, < 3)
41
- rack (2.2.3.1)
42
- rake (13.0.6)
43
- rspec (3.11.0)
44
- rspec-core (~> 3.11.0)
45
- rspec-expectations (~> 3.11.0)
46
- rspec-mocks (~> 3.11.0)
47
- rspec-core (3.11.0)
48
- rspec-support (~> 3.11.0)
49
- rspec-expectations (3.11.0)
58
+ rack (>= 1.2, < 4)
59
+ snaky_hash (~> 2.0, >= 2.0.3)
60
+ version_gem (~> 1.1, >= 1.1.9)
61
+ prism (1.9.0)
62
+ rack (3.2.4)
63
+ rake (13.3.1)
64
+ rspec (3.13.2)
65
+ rspec-core (~> 3.13.0)
66
+ rspec-expectations (~> 3.13.0)
67
+ rspec-mocks (~> 3.13.0)
68
+ rspec-core (3.13.6)
69
+ rspec-support (~> 3.13.0)
70
+ rspec-expectations (3.13.5)
50
71
  diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.11.0)
52
- rspec-mocks (3.11.1)
72
+ rspec-support (~> 3.13.0)
73
+ rspec-mocks (3.13.7)
53
74
  diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.11.0)
55
- rspec-support (3.11.0)
56
- ruby2_keywords (0.0.5)
57
- tzinfo (2.0.4)
75
+ rspec-support (~> 3.13.0)
76
+ rspec-support (3.13.7)
77
+ securerandom (0.4.1)
78
+ snaky_hash (2.0.3)
79
+ hashie (>= 0.1.0, < 6)
80
+ version_gem (>= 1.1.8, < 3)
81
+ tzinfo (2.0.6)
58
82
  concurrent-ruby (~> 1.0)
83
+ uri (1.1.1)
84
+ version_gem (1.1.9)
59
85
 
60
86
  PLATFORMS
61
87
  arm64-darwin-21
data/README.md CHANGED
@@ -72,6 +72,14 @@ You pass these two pieces of information to create an instance of an API client:
72
72
  client = RESO::API::Client.new(access_token: access_token, base_url: base_url)
73
73
  ```
74
74
 
75
+ #### Base URL for Replication
76
+
77
+ Some systems, like Bridge Interactive, provide replication endpoints that differ from the ones for normal search requests by including an additional path segment *following* the resource segment. For example:
78
+
79
+ https://api.bridgedataoutput.com/api/v2/OData/{dataset_id}/Property/replication
80
+
81
+ To accommodate this, the `base_url` parameter may contain a `/$resource$` segment which will be replaced for each API call with the appropriate resource segment.
82
+
75
83
 
76
84
  ### Resources
77
85
 
@@ -365,9 +373,17 @@ For servers that support it, `$ignorenulls` omits empty keys from the response t
365
373
  client.properties(ignorenulls: true)
366
374
  ```
367
375
 
376
+ #### $ignorecase
377
+
378
+ For servers that support it, `$ignorecase` performs case-insensitive filtering. Note that this is not a standard OData parameter and may only be supported by certain providers (e.g. Constellation1).
379
+
380
+ ```ruby
381
+ client.members(filter: "MemberLastName eq 'Smith'", ignorecase: true)
382
+ ```
383
+
368
384
  #### Automatically iterate over all results
369
385
 
370
- By passing a block to Media, Member, Office, and Property resource calls, subsequent paginated calls will automatically be made until the whole result set has been traversed. The block provided is executed for each returned object hash. The `batch` option can be used to return the full array of results.
386
+ By passing a block to Media, Member, Office, and Property resource calls, subsequent paginated calls will automatically be made until the whole result set has been traversed. The block provided is executed for each returned object hash. The `batch` option can be used to return the full array of results.
371
387
 
372
388
  Here are a couple of examples of how that can be used:
373
389
 
@@ -64,8 +64,8 @@ module RESO
64
64
 
65
65
  hash = args.first.is_a?(Hash) ? args.first : {}
66
66
 
67
- filter = hash[:filter].to_s
68
- if !filter.include?('OriginatingSystemName') && osn.present?
67
+ filter = hash[:filter]
68
+ if !filter.to_s.include?('OriginatingSystemName') && osn.present?
69
69
  osn_filter = format("OriginatingSystemName eq '%s'", osn.to_s)
70
70
  filter = [filter.presence, osn_filter].compact.join(' and ')
71
71
  end
@@ -82,6 +82,7 @@ module RESO
82
82
  "$expand": hash[:expand],
83
83
  "$count": hash[:count].to_s.presence,
84
84
  "$ignorenulls": hash[:ignorenulls].to_s.presence,
85
+ "$ignorecase": hash[:ignorecase].to_s.presence,
85
86
  "$debug": hash[:debug]
86
87
  }.compact
87
88
  if !block.nil?
@@ -232,7 +233,12 @@ module RESO
232
233
  end
233
234
 
234
235
  def uri_for_endpoint endpoint
235
- return URI(endpoint).host ? URI(endpoint) : URI([base_url, endpoint].join)
236
+ uri = URI(endpoint)
237
+ return uri if uri.host
238
+ uri = URI(base_url)
239
+ path = uri.path
240
+ uri.path = path.include?("/$resource$") ? path.sub("/$resource$", endpoint) : [path, endpoint].join
241
+ return uri
236
242
  end
237
243
 
238
244
  def perform_call(endpoint, params, max_retries = 5, debug = false)
@@ -275,7 +281,7 @@ module RESO
275
281
  fresh_oauth2_payload
276
282
  raise StandardError
277
283
  elsif response.is_a?(Hash) && response.has_key?("error")
278
- error_msg = response.inspect
284
+ error_msg = "#{@last_request_url} => #{response.inspect}"
279
285
  puts "Error: #{error_msg}" if debug
280
286
  raise StandardError, error_msg
281
287
  elsif response.is_a?(Hash) && response.has_key?("retry-after")
@@ -1,3 +1,3 @@
1
1
  module ResoApi
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reso_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Edlund