verifalia 1.2.0 → 2.1.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/Gemfile +5 -5
- data/LICENSE +3 -4
- data/README.md +415 -82
- data/Rakefile +4 -0
- data/lib/verifalia/client.rb +89 -0
- data/lib/verifalia/credits/balance.rb +59 -0
- data/lib/verifalia/credits/client.rb +54 -0
- data/lib/verifalia/email_validation/client.rb +237 -0
- data/lib/verifalia/email_validation/completion_callback.rb +44 -0
- data/lib/verifalia/email_validation/entry.rb +124 -0
- data/lib/verifalia/email_validation/entry_classification.rb +49 -0
- data/lib/verifalia/email_validation/entry_status.rb +181 -0
- data/lib/verifalia/email_validation/exported_entries_format.rb +46 -0
- data/lib/verifalia/email_validation/job.rb +107 -0
- data/lib/verifalia/email_validation/job_status.rb +49 -0
- data/lib/verifalia/email_validation/overview.rb +108 -0
- data/lib/verifalia/email_validation/progress.rb +48 -0
- data/lib/verifalia/email_validation/request.rb +48 -0
- data/lib/verifalia/email_validation/request_entry.rb +43 -0
- data/lib/verifalia/email_validation/wait_options.rb +82 -0
- data/lib/verifalia/rest/client.rb +111 -0
- data/lib/verifalia/security/certificate_authenticator.rb +50 -0
- data/lib/verifalia/security/username_password_authenticator.rb +51 -0
- data/lib/verifalia.rb +49 -21
- data/sig/completion_callback.rbs +5 -0
- data/sig/verifalia/client.rbs +11 -0
- data/sig/verifalia/credits/balance.rbs +11 -0
- data/sig/verifalia/credits/client.rbs +7 -0
- data/sig/verifalia/email_validations/client.rbs +24 -0
- data/sig/verifalia/email_validations/entry.rbs +24 -0
- data/sig/verifalia/email_validations/entry_classification.rbs +10 -0
- data/sig/verifalia/email_validations/entry_status.rbs +50 -0
- data/sig/verifalia/email_validations/exported_entries_format.rbs +9 -0
- data/sig/verifalia/email_validations/job.rbs +13 -0
- data/sig/verifalia/email_validations/job_status.rbs +10 -0
- data/sig/verifalia/email_validations/overview.rbs +20 -0
- data/sig/verifalia/email_validations/progress.rbs +8 -0
- data/sig/verifalia/email_validations/request.rbs +13 -0
- data/sig/verifalia/email_validations/request_entry.rbs +8 -0
- data/sig/verifalia/email_validations/wait_options.rbs +20 -0
- data/sig/verifalia/rest/client.rbs +12 -0
- data/sig/verifalia/rest.rbs +6 -0
- data/sig/verifalia/security/certificate_authenticator.rbs +8 -0
- data/sig/verifalia/security/username_password_authenticator.rbs +10 -0
- data/verifalia.gemspec +27 -18
- metadata +72 -64
- data/.gitignore +0 -24
- data/lib/rest/account_balance.rb +0 -93
- data/lib/rest/client.rb +0 -83
- data/lib/rest/email_validations.rb +0 -195
- data/lib/verifalia/util/configuration.rb +0 -7
- data/lib/verifalia/version.rb +0 -3
- data/spec/rest/account_balance_spec.rb +0 -93
- data/spec/rest/client_spec.rb +0 -105
- data/spec/rest/email_validations_spec.rb +0 -322
- data/spec/spec_helper.rb +0 -21
- data/spec/util/configuration_spec.rb +0 -15
- data/spec/verifalia_spec.rb +0 -17
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Verifalia - Email list cleaning and real-time email verification service
|
4
|
+
# https://verifalia.com/
|
5
|
+
# support@verifalia.com
|
6
|
+
#
|
7
|
+
# Copyright (c) 2005-2024 Cobisi Research
|
8
|
+
#
|
9
|
+
# Cobisi Research
|
10
|
+
# Via Della Costituzione, 31
|
11
|
+
# 35010 Vigonza
|
12
|
+
# Italy - European Union
|
13
|
+
#
|
14
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
15
|
+
# of this software and associated documentation files (the "Software"), to deal
|
16
|
+
# in the Software without restriction, including without limitation the rights
|
17
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
18
|
+
# copies of the Software, and to permit persons to whom the Software is
|
19
|
+
# furnished to do so, subject to the following conditions:
|
20
|
+
#
|
21
|
+
# The above copyright notice and this permission notice shall be included in
|
22
|
+
# all copies or substantial portions of the Software.
|
23
|
+
#
|
24
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
25
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
26
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
27
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
28
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
29
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
30
|
+
# THE SOFTWARE.
|
31
|
+
|
32
|
+
module Verifalia
|
33
|
+
module EmailValidations
|
34
|
+
class WaitOptions
|
35
|
+
@@default = nil
|
36
|
+
@@no_wait = nil
|
37
|
+
|
38
|
+
attr_reader :submission_wait_time, :poll_wait_time, :progress
|
39
|
+
|
40
|
+
def initialize(submission_wait_time, poll_wait_time, progress: nil)
|
41
|
+
@submission_wait_time = submission_wait_time
|
42
|
+
@poll_wait_time = poll_wait_time
|
43
|
+
@progress = progress
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.default
|
47
|
+
@@default = WaitOptions.new 30 * 1000, 30 * 1000 if @@default.nil?
|
48
|
+
@@default
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.no_wait
|
52
|
+
@@no_wait = WaitOptions.new 0, 0 if @@no_wait.nil?
|
53
|
+
@@no_wait
|
54
|
+
end
|
55
|
+
|
56
|
+
def wait_for_next_poll(job)
|
57
|
+
# Observe the ETA if we have one, otherwise a delay given the following formula:
|
58
|
+
# delay = max(0.5, min(30, 2^(log(noOfEntries, 10) - 1)))
|
59
|
+
|
60
|
+
if !job.overview.progress.nil? && !job.overview.progress.estimated_time_remaining.nil?
|
61
|
+
# Convert the ETA format (dd.)HH:mm:ss into the number of remaining seconds
|
62
|
+
|
63
|
+
eta_match = /((\d*)\.)?(\d{1,2}):(\d{1,2}):(\d{1,2})/.match(job.overview.progress.estimated_time_remaining)
|
64
|
+
|
65
|
+
days = (eta_match[2] || '0').to_i
|
66
|
+
hours = eta_match[3].to_i
|
67
|
+
minutes = eta_match[4].to_i
|
68
|
+
seconds = eta_match[5].to_i
|
69
|
+
|
70
|
+
delay = days * 24 * 60 * 60 +
|
71
|
+
hours * 60 * 60 +
|
72
|
+
minutes * 60 +
|
73
|
+
seconds
|
74
|
+
else
|
75
|
+
delay = [0.5, [30, 2**(Math.log10(job.overview.no_of_entries) - 1)].min].max
|
76
|
+
end
|
77
|
+
|
78
|
+
sleep(delay)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Verifalia - Email list cleaning and real-time email verification service
|
4
|
+
# https://verifalia.com/
|
5
|
+
# support@verifalia.com
|
6
|
+
#
|
7
|
+
# Copyright (c) 2005-2024 Cobisi Research
|
8
|
+
#
|
9
|
+
# Cobisi Research
|
10
|
+
# Via Della Costituzione, 31
|
11
|
+
# 35010 Vigonza
|
12
|
+
# Italy - European Union
|
13
|
+
#
|
14
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
15
|
+
# of this software and associated documentation files (the "Software"), to deal
|
16
|
+
# in the Software without restriction, including without limitation the rights
|
17
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
18
|
+
# copies of the Software, and to permit persons to whom the Software is
|
19
|
+
# furnished to do so, subject to the following conditions:
|
20
|
+
#
|
21
|
+
# The above copyright notice and this permission notice shall be included in
|
22
|
+
# all copies or substantial portions of the Software.
|
23
|
+
#
|
24
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
25
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
26
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
27
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
28
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
29
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
30
|
+
# THE SOFTWARE.
|
31
|
+
|
32
|
+
require 'faraday'
|
33
|
+
require 'json'
|
34
|
+
|
35
|
+
module Verifalia
|
36
|
+
module Rest
|
37
|
+
BASE_URLS = %w[https://api-1.verifalia.com/v2.5 https://api-2.verifalia.com/v2.5 https://api-3.verifalia.com/v2.5].freeze
|
38
|
+
BASE_CCA_URLS = %w[https://api-cca-1.verifalia.com/v2.5 https://api-cca-2.verifalia.com/v2.5 https://api-cca-3.verifalia.com/v2.5].freeze
|
39
|
+
|
40
|
+
class Client
|
41
|
+
# Optional debug logger
|
42
|
+
attr_writer :logger
|
43
|
+
|
44
|
+
def initialize(authenticator, user_agent, base_urls)
|
45
|
+
@authenticator = authenticator
|
46
|
+
@user_agent = user_agent
|
47
|
+
@base_urls = base_urls.shuffle
|
48
|
+
|
49
|
+
@current_base_url_idx = 0
|
50
|
+
end
|
51
|
+
|
52
|
+
def invoke(method, resource, options = nil)
|
53
|
+
errors = []
|
54
|
+
|
55
|
+
# Performs a maximum of as many attempts as the number of configured base API endpoints, keeping track
|
56
|
+
# of the last used endpoint after each call, in order to try to distribute the load evenly across the
|
57
|
+
# available endpoints.
|
58
|
+
|
59
|
+
(0...@base_urls.length).each {
|
60
|
+
base_url = @base_urls[@current_base_url_idx % @base_urls.length]
|
61
|
+
@current_base_url_idx += 1
|
62
|
+
|
63
|
+
# Build the final URL
|
64
|
+
|
65
|
+
final_url = "#{base_url}/#{resource}"
|
66
|
+
|
67
|
+
@logger&.info("Invoking #{method.upcase} #{final_url}")
|
68
|
+
|
69
|
+
# Init the HTTP request
|
70
|
+
|
71
|
+
connection = Faraday.new(
|
72
|
+
headers: { 'User-Agent' => @user_agent }
|
73
|
+
)
|
74
|
+
|
75
|
+
request = connection.build_request(method)
|
76
|
+
request.url(final_url)
|
77
|
+
|
78
|
+
# Options
|
79
|
+
|
80
|
+
unless options.nil?
|
81
|
+
request.body = options[:body] unless options[:body].nil?
|
82
|
+
request.headers = request.headers.merge(options[:headers]) unless options[:headers].nil?
|
83
|
+
end
|
84
|
+
|
85
|
+
# Authenticate the underlying client, if needed
|
86
|
+
|
87
|
+
@authenticator.authenticate connection, request
|
88
|
+
|
89
|
+
begin
|
90
|
+
# Send the request to the Verifalia servers
|
91
|
+
|
92
|
+
connection.builder.build_response(connection, request).on_complete do |response|
|
93
|
+
if (500...599).include?(response.status)
|
94
|
+
raise "Server error (HTTP status #{response.status}) while invoking #{final_url}"
|
95
|
+
end
|
96
|
+
|
97
|
+
return response
|
98
|
+
end
|
99
|
+
rescue => e
|
100
|
+
@logger&.warn("Error while invoking #{method.upcase} #{final_url}. #{e.to_s}")
|
101
|
+
errors.append(e)
|
102
|
+
end
|
103
|
+
}
|
104
|
+
|
105
|
+
# Generate an error out of the potentially multiple invocation errors
|
106
|
+
|
107
|
+
raise "All the base URIs are unreachable:\n#{errors.map { |error| error.to_s }.join("\n")}"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Verifalia - Email list cleaning and real-time email verification service
|
4
|
+
# https://verifalia.com/
|
5
|
+
# support@verifalia.com
|
6
|
+
#
|
7
|
+
# Copyright (c) 2005-2024 Cobisi Research
|
8
|
+
#
|
9
|
+
# Cobisi Research
|
10
|
+
# Via Della Costituzione, 31
|
11
|
+
# 35010 Vigonza
|
12
|
+
# Italy - European Union
|
13
|
+
#
|
14
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
15
|
+
# of this software and associated documentation files (the "Software"), to deal
|
16
|
+
# in the Software without restriction, including without limitation the rights
|
17
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
18
|
+
# copies of the Software, and to permit persons to whom the Software is
|
19
|
+
# furnished to do so, subject to the following conditions:
|
20
|
+
#
|
21
|
+
# The above copyright notice and this permission notice shall be included in
|
22
|
+
# all copies or substantial portions of the Software.
|
23
|
+
#
|
24
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
25
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
26
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
27
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
28
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
29
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
30
|
+
# THE SOFTWARE.
|
31
|
+
|
32
|
+
module Verifalia
|
33
|
+
module Security
|
34
|
+
# Allows to authenticate to Verifalia with a client certificate.
|
35
|
+
class CertificateAuthenticator
|
36
|
+
def initialize(ssl_client_cert, ssl_client_key)
|
37
|
+
ssl_client_cert = OpenSSL::X509::Certificate.new(File.read(ssl_client_cert)) if ssl_client_cert.is_a?(String)
|
38
|
+
ssl_client_key = OpenSSL::PKey::RSA.new(File.read(ssl_client_key)) if ssl_client_key.is_a?(String) && !ssl_client_key.nil?
|
39
|
+
|
40
|
+
@ssl_client_cert = ssl_client_cert
|
41
|
+
@ssl_client_key = ssl_client_key
|
42
|
+
end
|
43
|
+
|
44
|
+
def authenticate(connection, request)
|
45
|
+
connection.ssl.client_cert = @ssl_client_cert
|
46
|
+
connection.ssl.client_key = @ssl_client_key
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Verifalia - Email list cleaning and real-time email verification service
|
4
|
+
# https://verifalia.com/
|
5
|
+
# support@verifalia.com
|
6
|
+
#
|
7
|
+
# Copyright (c) 2005-2024 Cobisi Research
|
8
|
+
#
|
9
|
+
# Cobisi Research
|
10
|
+
# Via Della Costituzione, 31
|
11
|
+
# 35010 Vigonza
|
12
|
+
# Italy - European Union
|
13
|
+
#
|
14
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
15
|
+
# of this software and associated documentation files (the "Software"), to deal
|
16
|
+
# in the Software without restriction, including without limitation the rights
|
17
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
18
|
+
# copies of the Software, and to permit persons to whom the Software is
|
19
|
+
# furnished to do so, subject to the following conditions:
|
20
|
+
#
|
21
|
+
# The above copyright notice and this permission notice shall be included in
|
22
|
+
# all copies or substantial portions of the Software.
|
23
|
+
#
|
24
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
25
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
26
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
27
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
28
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
29
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
30
|
+
# THE SOFTWARE.
|
31
|
+
|
32
|
+
module Verifalia
|
33
|
+
module Security
|
34
|
+
# Allows to authenticate to Verifalia with a username and password pair.
|
35
|
+
class UsernamePasswordAuthenticator
|
36
|
+
def initialize(username, password = nil)
|
37
|
+
if username.nil? || username.strip.length == 0
|
38
|
+
raise ArgumentError, 'username is nil or empty: please visit https://verifalia.com/client-area to set up a new user, if you don\'t have one.'
|
39
|
+
end
|
40
|
+
|
41
|
+
@username = username
|
42
|
+
@password = password || ''
|
43
|
+
end
|
44
|
+
|
45
|
+
def authenticate(connection, request)
|
46
|
+
header = Faraday::Utils.basic_header_from(@username, @password)
|
47
|
+
request.headers[Faraday::Request::Authorization::KEY] = header
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/verifalia.rb
CHANGED
@@ -1,27 +1,55 @@
|
|
1
|
-
|
2
|
-
require 'forwardable'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
# Verifalia - Email list cleaning and real-time email verification service
|
4
|
+
# https://verifalia.com/
|
5
|
+
# support@verifalia.com
|
6
|
+
#
|
7
|
+
# Copyright (c) 2005-2024 Cobisi Research
|
8
|
+
#
|
9
|
+
# Cobisi Research
|
10
|
+
# Via Della Costituzione, 31
|
11
|
+
# 35010 Vigonza
|
12
|
+
# Italy - European Union
|
13
|
+
#
|
14
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
15
|
+
# of this software and associated documentation files (the "Software"), to deal
|
16
|
+
# in the Software without restriction, including without limitation the rights
|
17
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
18
|
+
# copies of the Software, and to permit persons to whom the Software is
|
19
|
+
# furnished to do so, subject to the following conditions:
|
20
|
+
#
|
21
|
+
# The above copyright notice and this permission notice shall be included in
|
22
|
+
# all copies or substantial portions of the Software.
|
23
|
+
#
|
24
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
25
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
26
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
27
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
28
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
29
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
30
|
+
# THE SOFTWARE.
|
6
31
|
|
7
|
-
|
32
|
+
require_relative 'verifalia/client'
|
8
33
|
|
9
|
-
|
10
|
-
|
34
|
+
require_relative 'verifalia/credits/balance'
|
35
|
+
require_relative 'verifalia/credits/client'
|
11
36
|
|
12
|
-
|
37
|
+
require_relative 'verifalia/email_validation/client'
|
38
|
+
require_relative 'verifalia/email_validation/completion_callback'
|
39
|
+
require_relative 'verifalia/email_validation/entry'
|
40
|
+
require_relative 'verifalia/email_validation/entry_classification'
|
41
|
+
require_relative 'verifalia/email_validation/entry_status'
|
42
|
+
require_relative 'verifalia/email_validation/exported_entries_format'
|
43
|
+
require_relative 'verifalia/email_validation/job'
|
44
|
+
require_relative 'verifalia/email_validation/job_status'
|
45
|
+
require_relative 'verifalia/email_validation/overview'
|
46
|
+
require_relative 'verifalia/email_validation/progress'
|
47
|
+
require_relative 'verifalia/email_validation/request'
|
48
|
+
require_relative 'verifalia/email_validation/request_entry'
|
49
|
+
require_relative 'verifalia/email_validation/wait_options'
|
13
50
|
|
14
|
-
|
15
|
-
|
16
|
-
# pass them to various initializers each time.
|
17
|
-
def self.configure(&block)
|
18
|
-
yield configuration
|
19
|
-
end
|
51
|
+
require_relative 'verifalia/security/username_password_authenticator'
|
52
|
+
require_relative 'verifalia/security/certificate_authenticator'
|
20
53
|
|
21
|
-
|
22
|
-
|
23
|
-
def self.configuration
|
24
|
-
@configuration ||= Util::Configuration.new
|
25
|
-
end
|
26
|
-
private_class_method :configuration
|
27
|
-
end
|
54
|
+
module Verifalia
|
55
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Verifalia
|
2
|
+
module Credits
|
3
|
+
class Balance
|
4
|
+
def self.from_json: (Hash[String, untyped]) -> Balance
|
5
|
+
|
6
|
+
attr_reader credit_packs: BigDecimal
|
7
|
+
attr_reader free_credits: BigDecimal | nil
|
8
|
+
attr_reader free_credits_reset_in: String | nil
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Verifalia
|
2
|
+
module EmailValidations
|
3
|
+
class Client
|
4
|
+
@rest_client: Rest::Client
|
5
|
+
|
6
|
+
def delete: (String) -> void
|
7
|
+
def export: (String, String) -> String
|
8
|
+
def get: (String, wait_options: WaitOptions) -> (Job | nil)
|
9
|
+
def submit: ((String | Array[String] | Array[RequestEntry] | Array[Hash[String, untyped]] | RequestEntry | Request),
|
10
|
+
quality: String,
|
11
|
+
priority: (Integer | nil),
|
12
|
+
deduplication: String,
|
13
|
+
name: String,
|
14
|
+
retention: String,
|
15
|
+
completion_callback: CompletionCallback | Hash[String, untyped] | nil,
|
16
|
+
wait_options: WaitOptions) -> (Job | nil)
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def build_job: -> Job
|
21
|
+
def wait_for_completion: (Job, WaitOptions) -> (Job | nil)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Verifalia
|
2
|
+
module EmailValidations
|
3
|
+
class Entry
|
4
|
+
attr_reader ascii_email_address_domain_part: String | nil
|
5
|
+
attr_reader completed_on: DateTime
|
6
|
+
attr_reader custom: String | nil
|
7
|
+
attr_reader duplicate_of: Integer | nil
|
8
|
+
attr_reader email_address: String | nil
|
9
|
+
attr_reader email_address_domain_part: String | nil
|
10
|
+
attr_reader email_address_local_part: String | nil
|
11
|
+
attr_reader has_international_domain_name: bool | nil
|
12
|
+
attr_reader has_international_mailbox_name: bool | nil
|
13
|
+
attr_reader index: Integer
|
14
|
+
attr_reader input_data: String
|
15
|
+
attr_reader classification: String
|
16
|
+
attr_reader is_disposable_email_address: bool | nil
|
17
|
+
attr_reader is_free_email_address: bool | nil
|
18
|
+
attr_reader is_role_account: bool | nil
|
19
|
+
attr_reader status: String
|
20
|
+
attr_reader suggestions: [String]
|
21
|
+
attr_reader syntax_failure_index: Integer | nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Verifalia
|
2
|
+
module EmailValidations
|
3
|
+
module EntryStatus
|
4
|
+
AT_SIGN_NOT_FOUND: String
|
5
|
+
CATCH_ALL_CONNECTION_FAILURE: String
|
6
|
+
CATCH_ALL_VALIDATION_TIMEOUT: String
|
7
|
+
DNS_CONNECTION_FAILURE: String
|
8
|
+
DNS_QUERY_TIMEOUT: String
|
9
|
+
DOMAIN_DOES_NOT_EXIST: String
|
10
|
+
DOMAIN_HAS_NULL_MX: String
|
11
|
+
DOMAIN_IS_MISCONFIGURED: String
|
12
|
+
DOMAIN_IS_WELL_KNOWN_DEA: String
|
13
|
+
DOMAIN_PART_COMPLIANCY_FAILURE: String
|
14
|
+
DOUBLE_DOT_SEQUENCE: String
|
15
|
+
DUPLICATE: String
|
16
|
+
INVALID_ADDRESS_LENGTH: String
|
17
|
+
INVALID_CHARACTER_IN_SEQUENCE: String
|
18
|
+
INVALID_EMPTY_QUOTED_WORD: String
|
19
|
+
INVALID_FOLDING_WHITE_SPACE_SEQUENCE: String
|
20
|
+
INVALID_LOCAL_PART_LENGTH: String
|
21
|
+
INVALID_WORD_BOUNDARY_START: String
|
22
|
+
ISP_SPECIFIC_SYNTAX_FAILURE: String
|
23
|
+
LOCAL_END_POINT_REJECTED: String
|
24
|
+
LOCAL_PART_IS_WELL_KNOWN_ROLE_ACCOUNT: String
|
25
|
+
LOCAL_SENDER_ADDRESS_REJECTED: String
|
26
|
+
MAILBOX_CONNECTION_FAILURE: String
|
27
|
+
MAILBOX_DOES_NOT_EXIST: String
|
28
|
+
MAILBOX_HAS_INSUFFICIENT_STORAGE: String
|
29
|
+
MAILBOX_IS_DEA: String
|
30
|
+
MAILBOX_TEMPORARILY_UNAVAILABLE: String
|
31
|
+
MAILBOX_VALIDATION_TIMEOUT: String
|
32
|
+
MAIL_EXCHANGER_IS_HONEYPOT: String
|
33
|
+
MAIL_EXCHANGER_IS_PARKED: String
|
34
|
+
MAIL_EXCHANGER_IS_WELL_KNOWN_DEA: String
|
35
|
+
OVERRIDE_MATCH: String
|
36
|
+
SERVER_DOES_NOT_SUPPORT_INTERNATIONAL_MAILBOXES: String
|
37
|
+
SERVER_IS_CATCH_ALL: String
|
38
|
+
SERVER_TEMPORARILY_UNAVAILABLE: String
|
39
|
+
SMTP_CONNECTION_FAILURE: String
|
40
|
+
SMTP_CONNECTION_TIMEOUT: String
|
41
|
+
SMTP_DIALOG_ERROR: String
|
42
|
+
SUCCESS: String
|
43
|
+
UNACCEPTABLE_DOMAIN_LITERAL: String
|
44
|
+
UNBALANCED_COMMENT_PARENTHESIS: String
|
45
|
+
UNEXPECTED_QUOTED_PAIR_SEQUENCE: String
|
46
|
+
UNHANDLED_EXCEPTION: String
|
47
|
+
UNMATCHED_QUOTED_PAIR: String
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Verifalia
|
2
|
+
module EmailValidations
|
3
|
+
class Overview
|
4
|
+
attr_reader client_ip: IPAddr
|
5
|
+
attr_reader completed_on: (DateTime | nil)
|
6
|
+
attr_reader created_on: DateTime
|
7
|
+
attr_reader deduplication: String
|
8
|
+
attr_reader id: String
|
9
|
+
attr_reader name: String
|
10
|
+
attr_reader no_of_entries: Integer
|
11
|
+
attr_reader owner: String
|
12
|
+
attr_reader priority: (Integer | nil)
|
13
|
+
attr_reader progress: (Progress | nil)
|
14
|
+
attr_reader quality: String
|
15
|
+
attr_reader retention: String
|
16
|
+
attr_reader status: String
|
17
|
+
attr_reader submitted_on: DateTime
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Verifalia
|
2
|
+
module EmailValidations
|
3
|
+
class Request
|
4
|
+
attr_accessor callback: CompletionCallback | nil
|
5
|
+
attr_accessor deduplication: String | nil
|
6
|
+
attr_accessor entries: Array[RequestEntry]
|
7
|
+
attr_accessor name: String | nil
|
8
|
+
attr_accessor priority: Integer | nil
|
9
|
+
attr_accessor quality: String | nil
|
10
|
+
attr_accessor retention: String | nil
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Verifalia
|
2
|
+
module EmailValidations
|
3
|
+
class WaitOptions
|
4
|
+
@@default: WaitOptions
|
5
|
+
@@no_wait: WaitOptions
|
6
|
+
@submission_wait_time: Integer
|
7
|
+
@poll_wait_time: Integer
|
8
|
+
|
9
|
+
def self.default: -> WaitOptions
|
10
|
+
def self.no_wait: -> WaitOptions
|
11
|
+
|
12
|
+
attr_reader poll_wait_time: Integer
|
13
|
+
attr_reader progress: (^(Overview) -> void) | nil
|
14
|
+
attr_reader submission_wait_time: Integer
|
15
|
+
|
16
|
+
def initialize: (Integer, Integer) -> WaitOptions
|
17
|
+
def wait_for_next_poll: (Job) -> void
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|