ruby_hubspot_api 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/Gemfile.lock +10 -10
- data/README.md +2 -2
- data/lib/hubspot/resource.rb +11 -8
- data/lib/hubspot/version.rb +1 -1
- data/ruby_hubspot_api.gemspec +10 -10
- metadata +35 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05532440bdcacffba3a53b549a863f9f5ff651df0623f78e0d386de48a637c25
|
4
|
+
data.tar.gz: 7e11d3872e45db1c46353ab28377246fbd3b3559b1257ea56b9bb98d6583c822
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f3c88cc59ee0940ef863bdaebf53ea789aa0e3e1338b5529a2973ce2e454e8b9b8c82111de71123c6d12f8a6268e48f8de049c3dcd369b0e1834d824b86f136
|
7
|
+
data.tar.gz: 87d904150778d77e4c73abd0906646c776438a7944b7e7f1e89e9af5f8454ac455df018f2ae4f39746ceeabf23acf50d47c3e538abe2bb1770b316000f103ef4
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
## v0.1.1
|
2
3
|
|
3
4
|
- initial setup
|
4
5
|
- Setup the configuration block
|
@@ -41,3 +42,13 @@
|
|
41
42
|
- Test that we only get the properties we ask for or the defaults
|
42
43
|
- Flatten the properties array into a comma separated list
|
43
44
|
- Improve the intialiser
|
45
|
+
- Update the changeling and link in gem spec
|
46
|
+
- adds the version numbers to the gemspec
|
47
|
+
- Fix dependencies
|
48
|
+
- bump version
|
49
|
+
|
50
|
+
## v0.1.0
|
51
|
+
|
52
|
+
- adds the version numbers to the gemspec
|
53
|
+
- Fix dependencies
|
54
|
+
- bump version
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby_hubspot_api (0.1.
|
5
|
-
bundler (
|
6
|
-
dotenv (
|
7
|
-
httparty (
|
8
|
-
pry (
|
9
|
-
pry-byebug (
|
10
|
-
rspec (
|
11
|
-
simplecov (
|
12
|
-
vcr (
|
13
|
-
webmock (
|
4
|
+
ruby_hubspot_api (0.1.1)
|
5
|
+
bundler (>= 2.0)
|
6
|
+
dotenv (>= 2.0)
|
7
|
+
httparty (>= 0.1, < 1.0)
|
8
|
+
pry (>= 0.1)
|
9
|
+
pry-byebug (>= 3.0)
|
10
|
+
rspec (>= 3.0)
|
11
|
+
simplecov (>= 0.22, < 1.0)
|
12
|
+
vcr (>= 6.0)
|
13
|
+
webmock (>= 3.0)
|
14
14
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
data/README.md
CHANGED
@@ -137,14 +137,14 @@ contacts.each do |contact|
|
|
137
137
|
end
|
138
138
|
|
139
139
|
# Search for companies with number of employees greater than or equal to 100
|
140
|
-
companies = Hubspot::Company.search(number_of_employees_gte: 100)
|
140
|
+
companies = Hubspot::Company.search(query: { number_of_employees_gte: 100 })
|
141
141
|
|
142
142
|
companies.each do |company|
|
143
143
|
puts "Found: #{company.name}, Employees: #{company.number_of_employees}"
|
144
144
|
end
|
145
145
|
|
146
146
|
# Search for contacts with email in a specific list (IN operator)
|
147
|
-
contacts = Hubspot::Contact.search(email_in: ['user1@example.com', 'user2@example.com'])
|
147
|
+
contacts = Hubspot::Contact.search(query: { email_in: ['user1@example.com', 'user2@example.com'] })
|
148
148
|
|
149
149
|
contacts.each do |contact|
|
150
150
|
puts "Found: #{contact.email}"
|
data/lib/hubspot/resource.rb
CHANGED
@@ -134,12 +134,10 @@ module Hubspot
|
|
134
134
|
filter_groups = [{ filters: [] }]
|
135
135
|
|
136
136
|
filters.each do |key, value|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
value: value
|
142
|
-
}
|
137
|
+
filter = extract_property_and_operator(key)
|
138
|
+
value_key = value.is_a?(Array) ? :values : :value
|
139
|
+
filter[value_key] = value
|
140
|
+
filter_groups.first[:filters] << filter
|
143
141
|
end
|
144
142
|
|
145
143
|
filter_groups
|
@@ -148,11 +146,16 @@ module Hubspot
|
|
148
146
|
# Extract property name and operator from the key
|
149
147
|
def extract_property_and_operator(key)
|
150
148
|
OPERATOR_MAP.each do |suffix, hubspot_operator|
|
151
|
-
|
149
|
+
if key.to_s.end_with?(suffix)
|
150
|
+
return {
|
151
|
+
propertyName: key.to_s.sub(suffix, ''),
|
152
|
+
operator: hubspot_operator
|
153
|
+
}
|
154
|
+
end
|
152
155
|
end
|
153
156
|
|
154
157
|
# Default to 'EQ' operator if no suffix is found
|
155
|
-
|
158
|
+
{ propertyName: key.to_s, operator: 'EQ' }
|
156
159
|
end
|
157
160
|
end
|
158
161
|
|
data/lib/hubspot/version.rb
CHANGED
data/ruby_hubspot_api.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
26
26
|
|
27
27
|
spec.metadata['homepage_uri'] = spec.homepage
|
28
|
-
spec.metadata['changelog_uri'] = "#{spec.homepage}/CHANGELOG.md"
|
28
|
+
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
29
29
|
end
|
30
30
|
|
31
31
|
# Specify which files should be added to the gem when it is released.
|
@@ -40,16 +40,16 @@ Gem::Specification.new do |spec|
|
|
40
40
|
# Define development dependencies
|
41
41
|
spec.add_development_dependency 'rake', '>= 11.0', '< 14.0'
|
42
42
|
|
43
|
-
spec.add_dependency 'bundler', '
|
44
|
-
spec.add_dependency 'dotenv', '
|
45
|
-
spec.add_dependency 'pry', '
|
46
|
-
spec.add_dependency 'pry-byebug', '
|
47
|
-
spec.add_dependency 'rspec', '
|
48
|
-
spec.add_dependency 'simplecov', '
|
49
|
-
spec.add_dependency 'vcr', '
|
50
|
-
spec.add_dependency 'webmock', '
|
43
|
+
spec.add_dependency 'bundler', '>= 2.0'
|
44
|
+
spec.add_dependency 'dotenv', '>= 2.0'
|
45
|
+
spec.add_dependency 'pry', '>= 0.1'
|
46
|
+
spec.add_dependency 'pry-byebug', '>= 3.0'
|
47
|
+
spec.add_dependency 'rspec', '>= 3.0'
|
48
|
+
spec.add_dependency 'simplecov', '>= 0.22', '< 1.0'
|
49
|
+
spec.add_dependency 'vcr', '>= 6.0'
|
50
|
+
spec.add_dependency 'webmock', '>= 3.0'
|
51
51
|
|
52
52
|
# Define runtime dependencies
|
53
|
-
spec.add_runtime_dependency 'httparty', '
|
53
|
+
spec.add_runtime_dependency 'httparty', '>= 0.1', '< 1.0'
|
54
54
|
end
|
55
55
|
# rubocop:enable Metrics/BlockLength
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_hubspot_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Brook
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -34,107 +34,77 @@ dependencies:
|
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '2.3'
|
40
|
-
- - "<"
|
37
|
+
- - ">="
|
41
38
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
39
|
+
version: '2.0'
|
43
40
|
type: :runtime
|
44
41
|
prerelease: false
|
45
42
|
version_requirements: !ruby/object:Gem::Requirement
|
46
43
|
requirements:
|
47
|
-
- - "
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '2.3'
|
50
|
-
- - "<"
|
44
|
+
- - ">="
|
51
45
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
46
|
+
version: '2.0'
|
53
47
|
- !ruby/object:Gem::Dependency
|
54
48
|
name: dotenv
|
55
49
|
requirement: !ruby/object:Gem::Requirement
|
56
50
|
requirements:
|
57
|
-
- - "
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '2.8'
|
60
|
-
- - "<"
|
51
|
+
- - ">="
|
61
52
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
53
|
+
version: '2.0'
|
63
54
|
type: :runtime
|
64
55
|
prerelease: false
|
65
56
|
version_requirements: !ruby/object:Gem::Requirement
|
66
57
|
requirements:
|
67
|
-
- - "
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '2.8'
|
70
|
-
- - "<"
|
58
|
+
- - ">="
|
71
59
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
60
|
+
version: '2.0'
|
73
61
|
- !ruby/object:Gem::Dependency
|
74
62
|
name: pry
|
75
63
|
requirement: !ruby/object:Gem::Requirement
|
76
64
|
requirements:
|
77
|
-
- - "
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '0.13'
|
80
|
-
- - "<"
|
65
|
+
- - ">="
|
81
66
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1
|
67
|
+
version: '0.1'
|
83
68
|
type: :runtime
|
84
69
|
prerelease: false
|
85
70
|
version_requirements: !ruby/object:Gem::Requirement
|
86
71
|
requirements:
|
87
|
-
- - "
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0.13'
|
90
|
-
- - "<"
|
72
|
+
- - ">="
|
91
73
|
- !ruby/object:Gem::Version
|
92
|
-
version: '1
|
74
|
+
version: '0.1'
|
93
75
|
- !ruby/object:Gem::Dependency
|
94
76
|
name: pry-byebug
|
95
77
|
requirement: !ruby/object:Gem::Requirement
|
96
78
|
requirements:
|
97
|
-
- - "
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: '3.9'
|
100
|
-
- - "<"
|
79
|
+
- - ">="
|
101
80
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
81
|
+
version: '3.0'
|
103
82
|
type: :runtime
|
104
83
|
prerelease: false
|
105
84
|
version_requirements: !ruby/object:Gem::Requirement
|
106
85
|
requirements:
|
107
|
-
- - "
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '3.9'
|
110
|
-
- - "<"
|
86
|
+
- - ">="
|
111
87
|
- !ruby/object:Gem::Version
|
112
|
-
version: '
|
88
|
+
version: '3.0'
|
113
89
|
- !ruby/object:Gem::Dependency
|
114
90
|
name: rspec
|
115
91
|
requirement: !ruby/object:Gem::Requirement
|
116
92
|
requirements:
|
117
|
-
- - "
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '3.13'
|
120
|
-
- - "<"
|
93
|
+
- - ">="
|
121
94
|
- !ruby/object:Gem::Version
|
122
|
-
version: '
|
95
|
+
version: '3.0'
|
123
96
|
type: :runtime
|
124
97
|
prerelease: false
|
125
98
|
version_requirements: !ruby/object:Gem::Requirement
|
126
99
|
requirements:
|
127
|
-
- - "
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version: '3.13'
|
130
|
-
- - "<"
|
100
|
+
- - ">="
|
131
101
|
- !ruby/object:Gem::Version
|
132
|
-
version: '
|
102
|
+
version: '3.0'
|
133
103
|
- !ruby/object:Gem::Dependency
|
134
104
|
name: simplecov
|
135
105
|
requirement: !ruby/object:Gem::Requirement
|
136
106
|
requirements:
|
137
|
-
- - "
|
107
|
+
- - ">="
|
138
108
|
- !ruby/object:Gem::Version
|
139
109
|
version: '0.22'
|
140
110
|
- - "<"
|
@@ -144,7 +114,7 @@ dependencies:
|
|
144
114
|
prerelease: false
|
145
115
|
version_requirements: !ruby/object:Gem::Requirement
|
146
116
|
requirements:
|
147
|
-
- - "
|
117
|
+
- - ">="
|
148
118
|
- !ruby/object:Gem::Version
|
149
119
|
version: '0.22'
|
150
120
|
- - "<"
|
@@ -154,49 +124,37 @@ dependencies:
|
|
154
124
|
name: vcr
|
155
125
|
requirement: !ruby/object:Gem::Requirement
|
156
126
|
requirements:
|
157
|
-
- - "
|
127
|
+
- - ">="
|
158
128
|
- !ruby/object:Gem::Version
|
159
129
|
version: '6.0'
|
160
|
-
- - "<"
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: '7.0'
|
163
130
|
type: :runtime
|
164
131
|
prerelease: false
|
165
132
|
version_requirements: !ruby/object:Gem::Requirement
|
166
133
|
requirements:
|
167
|
-
- - "
|
134
|
+
- - ">="
|
168
135
|
- !ruby/object:Gem::Version
|
169
136
|
version: '6.0'
|
170
|
-
- - "<"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '7.0'
|
173
137
|
- !ruby/object:Gem::Dependency
|
174
138
|
name: webmock
|
175
139
|
requirement: !ruby/object:Gem::Requirement
|
176
140
|
requirements:
|
177
|
-
- - "
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '3.23'
|
180
|
-
- - "<"
|
141
|
+
- - ">="
|
181
142
|
- !ruby/object:Gem::Version
|
182
|
-
version: '
|
143
|
+
version: '3.0'
|
183
144
|
type: :runtime
|
184
145
|
prerelease: false
|
185
146
|
version_requirements: !ruby/object:Gem::Requirement
|
186
147
|
requirements:
|
187
|
-
- - "
|
188
|
-
- !ruby/object:Gem::Version
|
189
|
-
version: '3.23'
|
190
|
-
- - "<"
|
148
|
+
- - ">="
|
191
149
|
- !ruby/object:Gem::Version
|
192
|
-
version: '
|
150
|
+
version: '3.0'
|
193
151
|
- !ruby/object:Gem::Dependency
|
194
152
|
name: httparty
|
195
153
|
requirement: !ruby/object:Gem::Requirement
|
196
154
|
requirements:
|
197
|
-
- - "
|
155
|
+
- - ">="
|
198
156
|
- !ruby/object:Gem::Version
|
199
|
-
version: '0.
|
157
|
+
version: '0.1'
|
200
158
|
- - "<"
|
201
159
|
- !ruby/object:Gem::Version
|
202
160
|
version: '1.0'
|
@@ -204,9 +162,9 @@ dependencies:
|
|
204
162
|
prerelease: false
|
205
163
|
version_requirements: !ruby/object:Gem::Requirement
|
206
164
|
requirements:
|
207
|
-
- - "
|
165
|
+
- - ">="
|
208
166
|
- !ruby/object:Gem::Version
|
209
|
-
version: '0.
|
167
|
+
version: '0.1'
|
210
168
|
- - "<"
|
211
169
|
- !ruby/object:Gem::Version
|
212
170
|
version: '1.0'
|
@@ -248,7 +206,7 @@ licenses:
|
|
248
206
|
- MIT
|
249
207
|
metadata:
|
250
208
|
homepage_uri: https://github.com/sensadrome/ruby_hubspot_api
|
251
|
-
changelog_uri: https://github.com/sensadrome/ruby_hubspot_api/CHANGELOG.md
|
209
|
+
changelog_uri: https://github.com/sensadrome/ruby_hubspot_api/blob/main/CHANGELOG.md
|
252
210
|
post_install_message:
|
253
211
|
rdoc_options: []
|
254
212
|
require_paths:
|