neverbounce-api 1.1.0 → 1.2.0
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 +5 -5
- data/lib/never_bounce/api/request/base.rb +1 -1
- data/lib/never_bounce/api/request/jobs_create.rb +21 -0
- data/lib/never_bounce/api/request/jobs_start.rb +7 -0
- data/lib/never_bounce/api/response/feature/job_status_fields.rb +1 -0
- data/lib/never_bounce/api/version.rb +1 -1
- data/spec/lib/never_bounce/api/request/account_info_spec.rb +1 -1
- data/spec/lib/never_bounce/api/request/jobs_create_spec.rb +49 -2
- data/spec/lib/never_bounce/api/request/jobs_delete_spec.rb +1 -1
- data/spec/lib/never_bounce/api/request/jobs_download_spec.rb +1 -1
- data/spec/lib/never_bounce/api/request/jobs_parse_spec.rb +1 -1
- data/spec/lib/never_bounce/api/request/jobs_results_spec.rb +1 -1
- data/spec/lib/never_bounce/api/request/jobs_search_spec.rb +1 -1
- data/spec/lib/never_bounce/api/request/jobs_start_spec.rb +30 -6
- data/spec/lib/never_bounce/api/request/jobs_status_spec.rb +1 -1
- data/spec/lib/never_bounce/api/request/poe_confirm_spec.rb +1 -1
- data/spec/lib/never_bounce/api/request/single_check_spec.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2f9d774a33fd7d97b58da965a0aaa4479ecd2051121d94b103eb9b79dea2b840
|
4
|
+
data.tar.gz: 9a25032152f3cd29bf9f1a35e59a41f6a7c3f52e56829f2c5449953e925683e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6675271c6f4aec84f635a0b6c0f20207f217e4be96cfc64957feae519f1ad0c6fb5d6d15cd80f63d73a8de842917399bb0230afae444ff0ea4203dcf5396ce0
|
7
|
+
data.tar.gz: 73b51b37c0a7ed257c3b7548cd2b3b771483261a2a9cb61a818e91b3442a378f096c0b229d83f703b064b911e8b8f6a913c3fa4a3bcc436333a3e0e0be136bbc
|
@@ -26,6 +26,15 @@ module NeverBounce; module API; module Request
|
|
26
26
|
# @return [Boolean]
|
27
27
|
attr_accessor :historical
|
28
28
|
|
29
|
+
# @return [Boolean]
|
30
|
+
attr_accessor :allow_manual_review
|
31
|
+
|
32
|
+
# @return [String]
|
33
|
+
attr_accessor :callback_url
|
34
|
+
|
35
|
+
# @return [Hash]
|
36
|
+
attr_accessor :callback_headers
|
37
|
+
|
29
38
|
def leverage_historical
|
30
39
|
defined?(@historical) ? @historical : true
|
31
40
|
end
|
@@ -61,6 +70,18 @@ module NeverBounce; module API; module Request
|
|
61
70
|
_[:run_sample] = v
|
62
71
|
end
|
63
72
|
|
73
|
+
unless (v = allow_manual_review).nil?
|
74
|
+
_[:allow_manual_review] = v
|
75
|
+
end
|
76
|
+
|
77
|
+
unless (v = callback_url).nil?
|
78
|
+
_[:callback_url] = v
|
79
|
+
end
|
80
|
+
|
81
|
+
unless (v = callback_headers).nil?
|
82
|
+
_[:callback_headers] = v
|
83
|
+
end
|
84
|
+
|
64
85
|
unless historical.nil?
|
65
86
|
_[:request_meta_data] = {leverage_historical_data: leverage_historical}
|
66
87
|
end
|
@@ -11,6 +11,9 @@ module NeverBounce; module API; module Request
|
|
11
11
|
# @return [Boolean]
|
12
12
|
attr_accessor :run_sample
|
13
13
|
|
14
|
+
# @return [Boolean]
|
15
|
+
attr_accessor :allow_manual_review
|
16
|
+
|
14
17
|
# @return [Symbol]
|
15
18
|
def self.http_method
|
16
19
|
:post
|
@@ -33,6 +36,10 @@ module NeverBounce; module API; module Request
|
|
33
36
|
unless (v = run_sample).nil?
|
34
37
|
_[:run_sample] = v
|
35
38
|
end
|
39
|
+
|
40
|
+
unless (v = allow_manual_review).nil?
|
41
|
+
_[:allow_manual_review] = v
|
42
|
+
end
|
36
43
|
end
|
37
44
|
end
|
38
45
|
|
@@ -19,7 +19,7 @@ module NeverBounce; module API; module Request
|
|
19
19
|
expect(res).to be_a Array
|
20
20
|
method, url, data = res
|
21
21
|
expect(method).to eq :get
|
22
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
22
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/account/info"
|
23
23
|
expect(data).to include(:body, :headers)
|
24
24
|
expect(data.fetch(:body)).to eq "{\"key\":\"api_key\"}"
|
25
25
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -9,7 +9,7 @@ module NeverBounce; module API; module Request
|
|
9
9
|
it "generally works" do
|
10
10
|
r = newo()
|
11
11
|
expect(r.mode_h).to eq({})
|
12
|
-
r = newo(auto_start: nil, auto_parse: nil, run_sample: nil)
|
12
|
+
r = newo(auto_start: nil, auto_parse: nil, run_sample: nil, allow_manual_review: nil)
|
13
13
|
expect(r.mode_h).to eq({})
|
14
14
|
r = newo(auto_start: false, auto_parse: false, run_sample: false)
|
15
15
|
expect(r.mode_h).to eq({auto_start: false, auto_parse: false, run_sample: false})
|
@@ -19,6 +19,10 @@ module NeverBounce; module API; module Request
|
|
19
19
|
expect(r.mode_h).to eq({request_meta_data: {leverage_historical_data: true}})
|
20
20
|
r = newo(historical: false)
|
21
21
|
expect(r.mode_h).to eq({request_meta_data: {leverage_historical_data: false}})
|
22
|
+
r = newo(allow_manual_review: true, callback_url: "http://test.com", callback_headers: {:Authorization => "Basic test"})
|
23
|
+
expect(r.mode_h).to eq({allow_manual_review: true, callback_url: "http://test.com", callback_headers: {:Authorization => "Basic test"}})
|
24
|
+
r = newo(allow_manual_review: false, callback_url: nil, callback_headers: nil)
|
25
|
+
expect(r.mode_h).to eq({allow_manual_review: false})
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
@@ -83,7 +87,7 @@ module NeverBounce; module API; module Request
|
|
83
87
|
expect(res).to be_a Array
|
84
88
|
method, url, data = res
|
85
89
|
expect(method).to eq :post
|
86
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
90
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/jobs/create"
|
87
91
|
expect(data).to include(:body, :headers)
|
88
92
|
expect(data.fetch(:body)).to eq "{\"input\":\"input\",\"input_location\":\"remote_url\",\"filename\":\"filename\",\"key\":\"api_key\"}"
|
89
93
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -116,6 +120,49 @@ module NeverBounce; module API; module Request
|
|
116
120
|
method, url, data = res
|
117
121
|
expect(data.fetch(:body)).to eq "{\"input\":\"input\",\"input_location\":\"remote_url\",\"filename\":\"filename\",\"key\":\"api_key\",\"request_meta_data\":{\"leverage_historical_data\":true}}"
|
118
122
|
end
|
123
|
+
|
124
|
+
it "allows allow manual review parameter to be enabled" do
|
125
|
+
r = newo
|
126
|
+
r.input = "input"
|
127
|
+
r.input_location = "remote_url"
|
128
|
+
r.filename = "filename"
|
129
|
+
r.api_key = "api_key"
|
130
|
+
r.allow_manual_review = true
|
131
|
+
|
132
|
+
res = r.to_httparty
|
133
|
+
expect(res).to be_a Array
|
134
|
+
method, url, data = res
|
135
|
+
expect(data.fetch(:body)).to eq "{\"input\":\"input\",\"input_location\":\"remote_url\",\"filename\":\"filename\",\"key\":\"api_key\",\"allow_manual_review\":true}"
|
136
|
+
end
|
137
|
+
|
138
|
+
it "allows allow manual review parameter to be disabled" do
|
139
|
+
r = newo
|
140
|
+
r.input = "input"
|
141
|
+
r.input_location = "remote_url"
|
142
|
+
r.filename = "filename"
|
143
|
+
r.api_key = "api_key"
|
144
|
+
r.allow_manual_review = false
|
145
|
+
|
146
|
+
res = r.to_httparty
|
147
|
+
expect(res).to be_a Array
|
148
|
+
method, url, data = res
|
149
|
+
expect(data.fetch(:body)).to eq "{\"input\":\"input\",\"input_location\":\"remote_url\",\"filename\":\"filename\",\"key\":\"api_key\",\"allow_manual_review\":false}"
|
150
|
+
end
|
151
|
+
|
152
|
+
it "allows callback url and headers" do
|
153
|
+
r = newo
|
154
|
+
r.input = "input"
|
155
|
+
r.input_location = "remote_url"
|
156
|
+
r.filename = "filename"
|
157
|
+
r.api_key = "api_key"
|
158
|
+
r.callback_url = "http://test.com"
|
159
|
+
r.callback_headers = {:Authorization => "Basic test"}
|
160
|
+
|
161
|
+
res = r.to_httparty
|
162
|
+
expect(res).to be_a Array
|
163
|
+
method, url, data = res
|
164
|
+
expect(data.fetch(:body)).to eq "{\"input\":\"input\",\"input_location\":\"remote_url\",\"filename\":\"filename\",\"key\":\"api_key\",\"callback_url\":\"http://test.com\",\"callback_headers\":{\"Authorization\":\"Basic test\"}}"
|
165
|
+
end
|
119
166
|
end
|
120
167
|
end
|
121
168
|
end; end; end
|
@@ -21,7 +21,7 @@ module NeverBounce; module API; module Request
|
|
21
21
|
expect(res).to be_a Array
|
22
22
|
method, url, data = res
|
23
23
|
expect(method).to eq :post
|
24
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
24
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/jobs/delete"
|
25
25
|
expect(data).to include(:body, :headers)
|
26
26
|
expect(data.fetch(:body)).to eq("{\"job_id\":\"123\",\"key\":\"api_key\"}")
|
27
27
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -21,7 +21,7 @@ module NeverBounce; module API; module Request
|
|
21
21
|
expect(res).to be_a Array
|
22
22
|
method, url, data = res
|
23
23
|
expect(method).to eq :get
|
24
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
24
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/jobs/download"
|
25
25
|
expect(data).to include(:body, :headers)
|
26
26
|
expect(data.fetch(:body)).to eq("{\"job_id\":\"123\",\"key\":\"api_key\"}")
|
27
27
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -34,7 +34,7 @@ module NeverBounce; module API; module Request
|
|
34
34
|
expect(res).to be_a Array
|
35
35
|
method, url, data = res
|
36
36
|
expect(method).to eq :post
|
37
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
37
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/jobs/parse"
|
38
38
|
expect(data).to include(:body, :headers)
|
39
39
|
expect(data.fetch(:body)).to eq("{\"job_id\":\"123\",\"key\":\"api_key\"}")
|
40
40
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -32,7 +32,7 @@ module NeverBounce; module API; module Request
|
|
32
32
|
expect(res).to be_a Array
|
33
33
|
method, url, data = res
|
34
34
|
expect(method).to eq :get
|
35
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
35
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/jobs/results"
|
36
36
|
expect(data).to include(:body, :headers)
|
37
37
|
expect(data.fetch(:body)).to eq "{\"job_id\":\"123\",\"key\":\"api_key\"}"
|
38
38
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -30,7 +30,7 @@ module NeverBounce; module API; module Request
|
|
30
30
|
expect(res).to be_a Array
|
31
31
|
method, url, data = res
|
32
32
|
expect(method).to eq :get
|
33
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
33
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/jobs/search"
|
34
34
|
expect(data).to include(:body, :headers)
|
35
35
|
expect(data.fetch(:body)).to eq "{\"key\":\"api_key\",\"job_id\":\"abc\",\"page\":12,\"items_per_page\":34}"
|
36
36
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -9,12 +9,12 @@ module NeverBounce; module API; module Request
|
|
9
9
|
it "generally works" do
|
10
10
|
r = newo()
|
11
11
|
expect(r.mode_h).to eq({})
|
12
|
-
r = newo(run_sample: nil)
|
12
|
+
r = newo(run_sample: nil, allow_manual_review: nil)
|
13
13
|
expect(r.mode_h).to eq({})
|
14
|
-
r = newo(run_sample: false)
|
15
|
-
expect(r.mode_h).to eq({run_sample: false})
|
16
|
-
r = newo(run_sample: true)
|
17
|
-
expect(r.mode_h).to eq({run_sample: true})
|
14
|
+
r = newo(run_sample: false, allow_manual_review: false)
|
15
|
+
expect(r.mode_h).to eq({run_sample: false, allow_manual_review: false})
|
16
|
+
r = newo(run_sample: true, allow_manual_review: true)
|
17
|
+
expect(r.mode_h).to eq({run_sample: true, allow_manual_review: true})
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -34,11 +34,35 @@ module NeverBounce; module API; module Request
|
|
34
34
|
expect(res).to be_a Array
|
35
35
|
method, url, data = res
|
36
36
|
expect(method).to eq :post
|
37
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
37
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/jobs/start"
|
38
38
|
expect(data).to include(:body, :headers)
|
39
39
|
expect(data.fetch(:body)).to eq("{\"job_id\":\"123\",\"key\":\"api_key\"}")
|
40
40
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
41
41
|
end
|
42
|
+
|
43
|
+
it "allows allow manual review parameter to be enabled" do
|
44
|
+
r = newo
|
45
|
+
r.job_id = "123"
|
46
|
+
r.api_key = "api_key"
|
47
|
+
r.allow_manual_review = true
|
48
|
+
|
49
|
+
res = r.to_httparty
|
50
|
+
expect(res).to be_a Array
|
51
|
+
method, url, data = res
|
52
|
+
expect(data.fetch(:body)).to eq "{\"job_id\":\"123\",\"key\":\"api_key\",\"allow_manual_review\":true}"
|
53
|
+
end
|
54
|
+
|
55
|
+
it "allows allow manual review parameter to be disabled" do
|
56
|
+
r = newo
|
57
|
+
r.job_id = "123"
|
58
|
+
r.api_key = "api_key"
|
59
|
+
r.allow_manual_review = false
|
60
|
+
|
61
|
+
res = r.to_httparty
|
62
|
+
expect(res).to be_a Array
|
63
|
+
method, url, data = res
|
64
|
+
expect(data.fetch(:body)).to eq "{\"job_id\":\"123\",\"key\":\"api_key\",\"allow_manual_review\":false}"
|
65
|
+
end
|
42
66
|
end
|
43
67
|
end
|
44
68
|
end; end; end
|
@@ -21,7 +21,7 @@ module NeverBounce; module API; module Request
|
|
21
21
|
expect(res).to be_a Array
|
22
22
|
method, url, data = res
|
23
23
|
expect(method).to eq :get
|
24
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
24
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/jobs/status"
|
25
25
|
expect(data).to include(:body, :headers)
|
26
26
|
expect(data.fetch(:body)).to eq "{\"job_id\":\"123\",\"key\":\"api_key\"}"
|
27
27
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -27,7 +27,7 @@ module NeverBounce; module API; module Request
|
|
27
27
|
expect(res).to be_a Array
|
28
28
|
method, url, data = res
|
29
29
|
expect(method).to eq :get
|
30
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
30
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/poe/confirm"
|
31
31
|
expect(data).to include(:body, :headers)
|
32
32
|
expect(data.fetch(:body)).to eq "{\"email\":\"email\",\"transaction_id\":\"NBTRNS-abcdefg\",\"confirmation_token\":\"abcdefg123456\",\"result\":\"valid\",\"key\":\"api_key\"}"
|
33
33
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
@@ -38,7 +38,7 @@ module NeverBounce; module API; module Request
|
|
38
38
|
expect(res).to be_a Array
|
39
39
|
method, url, data = res
|
40
40
|
expect(method).to eq :get
|
41
|
-
expect(url).to eq "https://api.neverbounce.com/v4.
|
41
|
+
expect(url).to eq "https://api.neverbounce.com/v4.2/single/check"
|
42
42
|
expect(data).to include(:body, :headers)
|
43
43
|
expect(data.fetch(:body)).to eq "{\"email\":\"email\",\"key\":\"api_key\",\"address_info\":true,\"credits_info\":true,\"timeout\":12}"
|
44
44
|
expect(data.fetch(:headers)).to include("Content-Type", "User-Agent")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neverbounce-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NeverBounce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -159,8 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
|
163
|
-
rubygems_version: 2.6.10
|
162
|
+
rubygems_version: 3.0.3
|
164
163
|
signing_key:
|
165
164
|
specification_version: 4
|
166
165
|
summary: The official NeverBounce API library for Ruby
|