realogy 0.5.4 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile.lock +70 -0
- data/README.md +8 -7
- data/lib/realogy/app/models/data_sync.rb +12 -12
- data/lib/realogy/app/models/realogy/agent.rb +1 -1
- data/lib/realogy/app/models/realogy/company.rb +1 -1
- data/lib/realogy/app/models/realogy/listing.rb +1 -1
- data/lib/realogy/app/models/realogy/office.rb +1 -1
- data/lib/realogy/app/models/realogy/team.rb +1 -1
- data/lib/realogy/version.rb +1 -1
- data/realogy.gemspec +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12d8e93945c23e56e01fbe630bec8fdbe5ce249bd3b005a86d4a6912d9784db4
|
4
|
+
data.tar.gz: 4d10e4f50b4966dc5c9ba7f3b520db7d521f9406799822bd80cf9f422c4589a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd20fd303e29928de9b4f087dca56ccaf4c42934bb17d1e71439bf343b02add61d9c449a0fa94b9bfe6fc959273006bb987cdcd7381dc7542134b844fef18a6b
|
7
|
+
data.tar.gz: ba898e4b69cd3db029e63db391117a337f10d66a2770a7ba932eb85885f44d8708c6c5dc2474688fef4cfed5123f388fa676675ed6ad67098ed5d6020074b94f
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
realogy (0.5.9)
|
5
|
+
activerecord (>= 5.0)
|
6
|
+
oauth2
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activemodel (7.0.2.3)
|
12
|
+
activesupport (= 7.0.2.3)
|
13
|
+
activerecord (7.0.2.3)
|
14
|
+
activemodel (= 7.0.2.3)
|
15
|
+
activesupport (= 7.0.2.3)
|
16
|
+
activesupport (7.0.2.3)
|
17
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
+
i18n (>= 1.6, < 2)
|
19
|
+
minitest (>= 5.1)
|
20
|
+
tzinfo (~> 2.0)
|
21
|
+
concurrent-ruby (1.1.9)
|
22
|
+
diff-lcs (1.5.0)
|
23
|
+
faraday (2.2.0)
|
24
|
+
faraday-net_http (~> 2.0)
|
25
|
+
ruby2_keywords (>= 0.0.4)
|
26
|
+
faraday-net_http (2.0.1)
|
27
|
+
i18n (1.10.0)
|
28
|
+
concurrent-ruby (~> 1.0)
|
29
|
+
jwt (2.3.0)
|
30
|
+
minitest (5.15.0)
|
31
|
+
multi_json (1.15.0)
|
32
|
+
multi_xml (0.6.0)
|
33
|
+
oauth2 (1.4.9)
|
34
|
+
faraday (>= 0.17.3, < 3.0)
|
35
|
+
jwt (>= 1.0, < 3.0)
|
36
|
+
multi_json (~> 1.3)
|
37
|
+
multi_xml (~> 0.5)
|
38
|
+
rack (>= 1.2, < 3)
|
39
|
+
rack (2.2.3)
|
40
|
+
rake (13.0.6)
|
41
|
+
rspec (3.11.0)
|
42
|
+
rspec-core (~> 3.11.0)
|
43
|
+
rspec-expectations (~> 3.11.0)
|
44
|
+
rspec-mocks (~> 3.11.0)
|
45
|
+
rspec-core (3.11.0)
|
46
|
+
rspec-support (~> 3.11.0)
|
47
|
+
rspec-expectations (3.11.0)
|
48
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
+
rspec-support (~> 3.11.0)
|
50
|
+
rspec-mocks (3.11.0)
|
51
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
52
|
+
rspec-support (~> 3.11.0)
|
53
|
+
rspec-support (3.11.0)
|
54
|
+
ruby2_keywords (0.0.5)
|
55
|
+
sqlite3 (1.4.2)
|
56
|
+
tzinfo (2.0.4)
|
57
|
+
concurrent-ruby (~> 1.0)
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
arm64-darwin-21
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
bundler (~> 2.3)
|
64
|
+
rake (>= 12.3.3)
|
65
|
+
realogy!
|
66
|
+
rspec (~> 3.0)
|
67
|
+
sqlite3
|
68
|
+
|
69
|
+
BUNDLED WITH
|
70
|
+
2.3.7
|
data/README.md
CHANGED
@@ -31,15 +31,16 @@ Set up for usage by creating Realogy's migration and running it.
|
|
31
31
|
rails g realogy:install
|
32
32
|
rails db:migrate
|
33
33
|
|
34
|
-
Realogy is expecting these
|
34
|
+
Realogy is expecting these encrypted credentials to be present to be able to function:
|
35
35
|
|
36
36
|
```
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
realogy:
|
38
|
+
client_id:
|
39
|
+
client_secret:
|
40
|
+
token_url:
|
41
|
+
scope:
|
42
|
+
subscription_key:
|
43
|
+
api_base_url:
|
43
44
|
```
|
44
45
|
|
45
46
|
### Available Rake Tasks
|
@@ -4,13 +4,13 @@ module Realogy
|
|
4
4
|
require 'net/http'
|
5
5
|
require 'oauth2'
|
6
6
|
require 'json'
|
7
|
-
|
7
|
+
|
8
8
|
@@instance = Realogy::DataSync.new
|
9
9
|
|
10
10
|
def self.client
|
11
11
|
return @@instance
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
private_class_method :new
|
15
15
|
|
16
16
|
# API endpoints by type
|
@@ -81,13 +81,13 @@ module Realogy
|
|
81
81
|
# Utility
|
82
82
|
|
83
83
|
def uri_for_endpoint endpoint
|
84
|
-
return URI([
|
84
|
+
return URI([Rails.application.credentials.dig(:realogy, :api_base_url), endpoint].join("/"))
|
85
85
|
end
|
86
86
|
|
87
87
|
def perform_simple_call(url)
|
88
88
|
uri = URI(url)
|
89
89
|
request = Net::HTTP::Get.new(uri)
|
90
|
-
request['Ocp-Apim-Subscription-Key'] =
|
90
|
+
request['Ocp-Apim-Subscription-Key'] = Rails.application.credentials.dig(:realogy, :subscription_key)
|
91
91
|
request['Authorization'] = "Bearer #{auth_token}"
|
92
92
|
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
|
93
93
|
http.max_retries = 10
|
@@ -101,7 +101,7 @@ module Realogy
|
|
101
101
|
uri = uri_for_endpoint(endpoint)
|
102
102
|
uri.query && uri.query.length > 0 ? uri.query += '&' + query : uri.query = query
|
103
103
|
request = Net::HTTP::Get.new(uri.request_uri)
|
104
|
-
request['Ocp-Apim-Subscription-Key'] =
|
104
|
+
request['Ocp-Apim-Subscription-Key'] = Rails.application.credentials.dig(:realogy, :subscription_key)
|
105
105
|
request['Authorization'] = "Bearer #{auth_token}"
|
106
106
|
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
|
107
107
|
http.max_retries = 10
|
@@ -112,10 +112,10 @@ module Realogy
|
|
112
112
|
|
113
113
|
def auth_token
|
114
114
|
oauth2_client_credentials_token(
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
115
|
+
Rails.application.credentials.dig(:realogy, :client_id),
|
116
|
+
Rails.application.credentials.dig(:realogy, :client_secret),
|
117
|
+
Rails.application.credentials.dig(:realogy, :token_url),
|
118
|
+
Rails.application.credentials.dig(:realogy, :scope)
|
119
119
|
)
|
120
120
|
end
|
121
121
|
|
@@ -148,9 +148,9 @@ OAuth2::AccessToken.class_eval do
|
|
148
148
|
data = nil
|
149
149
|
token = nil
|
150
150
|
client = OAuth2::Client.new(
|
151
|
-
|
152
|
-
|
153
|
-
token_url:
|
151
|
+
Rails.application.credentials.dig(:realogy, :client_id),
|
152
|
+
Rails.application.credentials.dig(:realogy, :client_secret),
|
153
|
+
token_url: Rails.application.credentials.dig(:realogy, :token_url)
|
154
154
|
)
|
155
155
|
if File.exists?(path)
|
156
156
|
File.open(path) do |f|
|
@@ -58,7 +58,7 @@ class Realogy::Company < Realogy::Entity
|
|
58
58
|
# lastUpdateOn : DateTime
|
59
59
|
# The date/time that the Company record was last updated in the system (UTC)
|
60
60
|
|
61
|
-
def
|
61
|
+
def last_updated
|
62
62
|
self.dig_for_datetime("companySummary", "lastUpdateOn")
|
63
63
|
end
|
64
64
|
|
@@ -887,7 +887,7 @@ class Realogy::Listing < Realogy::Entity
|
|
887
887
|
# lastUpdateOn : DateTime
|
888
888
|
# Timestamp when the listing was last updated at Realogy system
|
889
889
|
|
890
|
-
def
|
890
|
+
def last_updated
|
891
891
|
self.dig_for_datetime("listingSummary", "lastUpdateOn")
|
892
892
|
end
|
893
893
|
|
data/lib/realogy/version.rb
CHANGED
data/realogy.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler", "~>
|
25
|
+
spec.add_development_dependency "bundler", "~> 2.3"
|
26
26
|
spec.add_development_dependency "rake", ">= 12.3.3"
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
28
28
|
spec.add_development_dependency 'sqlite3'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: realogy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Edlund
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.3'
|
20
20
|
type: :development
|
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.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- ".travis.yml"
|
108
108
|
- CODE_OF_CONDUCT.md
|
109
109
|
- Gemfile
|
110
|
+
- Gemfile.lock
|
110
111
|
- LICENSE.txt
|
111
112
|
- README.md
|
112
113
|
- Rakefile
|
@@ -134,7 +135,7 @@ homepage: https://github.com/arcticleo/realogy
|
|
134
135
|
licenses:
|
135
136
|
- MIT
|
136
137
|
metadata: {}
|
137
|
-
post_install_message:
|
138
|
+
post_install_message:
|
138
139
|
rdoc_options: []
|
139
140
|
require_paths:
|
140
141
|
- lib
|
@@ -149,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
150
|
- !ruby/object:Gem::Version
|
150
151
|
version: '0'
|
151
152
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
153
|
-
signing_key:
|
153
|
+
rubygems_version: 3.3.7
|
154
|
+
signing_key:
|
154
155
|
specification_version: 4
|
155
156
|
summary: Encapsulation of Realogy's DataSync API.
|
156
157
|
test_files: []
|