nymeria 2.0.0 → 2.0.3
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 +4 -4
- data/lib/nymeria.rb +54 -4
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 839c67bea33a0df68637eb52dac24fc62c344ffd02584a40bf431b2dc5471080
|
|
4
|
+
data.tar.gz: 2d4884cb22c403f3d8cb9ea5148e6917f7dee20875415ad5318a041252afa23c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e637f6532093b7d2c4cfb4925a4901e0ecfe954667f0bfc7a2813db34b7d868c4b64e57922bbfdd51fa6711f981cdeb43ef2e1e14037154e98fd79b4a6cfa64
|
|
7
|
+
data.tar.gz: bc39a6e9c23d040c652e15187429cc1a906e5910aacac1317ce49542bf7ae5ee45638666e296fb9d23b1471624d248382a8b4fa56dd7c17fce0c7b59e2aa54b5
|
data/lib/nymeria.rb
CHANGED
|
@@ -33,7 +33,6 @@ module Nymeria
|
|
|
33
33
|
|
|
34
34
|
response = JSON.parse(res.body)
|
|
35
35
|
|
|
36
|
-
# Use an open struct here?
|
|
37
36
|
OpenStruct.new(
|
|
38
37
|
success?: response['status'] == 'success',
|
|
39
38
|
error: response['developer_message']
|
|
@@ -56,7 +55,6 @@ module Nymeria
|
|
|
56
55
|
|
|
57
56
|
response = JSON.parse(res.body)
|
|
58
57
|
|
|
59
|
-
# Use an open struct here?
|
|
60
58
|
OpenStruct.new(
|
|
61
59
|
success?: response['status'] == 'success',
|
|
62
60
|
usage: OpenStruct.new(response['usage']),
|
|
@@ -78,7 +76,7 @@ module Nymeria
|
|
|
78
76
|
)
|
|
79
77
|
end
|
|
80
78
|
|
|
81
|
-
valid_keys = [:url, :identifier, :email, :custom]
|
|
79
|
+
valid_keys = [:url, :identifier, :email, :custom, :filter, :require]
|
|
82
80
|
|
|
83
81
|
valid_args = args.select do |arg|
|
|
84
82
|
arg.is_a?(Hash) && valid_keys.any? { |k| arg.keys.include?(k) }
|
|
@@ -142,7 +140,6 @@ module Nymeria
|
|
|
142
140
|
|
|
143
141
|
response = JSON.parse(res.body)
|
|
144
142
|
|
|
145
|
-
# Use an open struct here?
|
|
146
143
|
OpenStruct.new(
|
|
147
144
|
success?: response['status'] == 'success',
|
|
148
145
|
error: response['error'],
|
|
@@ -157,4 +154,57 @@ module Nymeria
|
|
|
157
154
|
end
|
|
158
155
|
end
|
|
159
156
|
end
|
|
157
|
+
|
|
158
|
+
def self.people(query)
|
|
159
|
+
begin
|
|
160
|
+
uri = URI("#{BASE_URL}/people")
|
|
161
|
+
uri.query = URI.encode_www_form(query)
|
|
162
|
+
|
|
163
|
+
req = request(Net::HTTP::Get.new(uri))
|
|
164
|
+
|
|
165
|
+
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
|
166
|
+
http.request(req)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
response = JSON.parse(res.body)
|
|
170
|
+
|
|
171
|
+
OpenStruct.new(
|
|
172
|
+
success?: response['status'] == 'success',
|
|
173
|
+
error: response['error'],
|
|
174
|
+
usage: OpenStruct.new(response['usage']),
|
|
175
|
+
data: response.fetch('data', []).map { |data| OpenStruct.new(data) }
|
|
176
|
+
)
|
|
177
|
+
rescue => e
|
|
178
|
+
OpenStruct.new(
|
|
179
|
+
success?: false,
|
|
180
|
+
error: "#{e}"
|
|
181
|
+
)
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def self.reveal(uuids)
|
|
186
|
+
begin
|
|
187
|
+
uri = URI("#{BASE_URL}/people")
|
|
188
|
+
req = request(Net::HTTP::Post.new(uri))
|
|
189
|
+
req.body = JSON.dump({ uuids: uuids })
|
|
190
|
+
|
|
191
|
+
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
|
192
|
+
http.request(req)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
response = JSON.parse(res.body)
|
|
196
|
+
|
|
197
|
+
OpenStruct.new(
|
|
198
|
+
success?: response['status'] == 'success',
|
|
199
|
+
error: response['error'],
|
|
200
|
+
usage: OpenStruct.new(response['usage']),
|
|
201
|
+
data: response.fetch('data', []).map { |data| OpenStruct.new(data) }
|
|
202
|
+
)
|
|
203
|
+
rescue => e
|
|
204
|
+
OpenStruct.new(
|
|
205
|
+
success?: false,
|
|
206
|
+
error: "#{e}"
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
end
|
|
160
210
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nymeria
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nymeria, LLC
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-07-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Nymeria enables people to easily discover and connect with people. This
|
|
14
14
|
gem is a light weight wrapper around Nymeria's API. With this gem you can easily
|
|
@@ -22,8 +22,9 @@ files:
|
|
|
22
22
|
homepage: https://www.nymeria.io
|
|
23
23
|
licenses:
|
|
24
24
|
- MIT
|
|
25
|
-
metadata:
|
|
26
|
-
|
|
25
|
+
metadata:
|
|
26
|
+
source_code_uri: https://git.nymeria.io/nymeria.rb
|
|
27
|
+
post_install_message:
|
|
27
28
|
rdoc_options: []
|
|
28
29
|
require_paths:
|
|
29
30
|
- lib
|
|
@@ -38,8 +39,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
38
39
|
- !ruby/object:Gem::Version
|
|
39
40
|
version: '0'
|
|
40
41
|
requirements: []
|
|
41
|
-
rubygems_version: 3.2.
|
|
42
|
-
signing_key:
|
|
42
|
+
rubygems_version: 3.2.5
|
|
43
|
+
signing_key:
|
|
43
44
|
specification_version: 4
|
|
44
45
|
summary: Easily interact with Nymeria's API to find and verify people's contact information.
|
|
45
46
|
test_files: []
|