veryfi 1.0.4 → 2.0.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 +4 -4
- data/.github/workflows/release.yml +0 -2
- data/Gemfile.lock +53 -31
- data/lib/veryfi/error.rb +13 -44
- data/lib/veryfi/version.rb +1 -1
- data/veryfi.gemspec +2 -0
- metadata +30 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d280de38639eaaeb484040824fcf42c349c6b6390d864c5724fed22aec5a77c3
|
|
4
|
+
data.tar.gz: cb1d308624e3f46e1fbc68df6aa6d638b498d633ccd1040f3528b171b89b1b30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d893497e1423f04858a3c5195659fa8a9d49195877ae41b4c64eff05d9ea529ac9b5c9719953d1353d283e6a70194f06a967e072b50ff0738f8ed77b4db57d01
|
|
7
|
+
data.tar.gz: 88302d51b112d6ecfff260d9fd1508bf09c02478b0c267cd168f8fdd3f8a68d6b60c68dc5a2f6d901eaa9bf34ad1debfb309226f427cd296d22709edf59383a5
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
veryfi (
|
|
4
|
+
veryfi (2.0.0)
|
|
5
5
|
base64 (~> 0.1)
|
|
6
6
|
faraday (>= 1.7, < 3.0)
|
|
7
7
|
openssl (>= 2.2, < 3.1)
|
|
@@ -9,53 +9,68 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
|
|
12
|
+
activesupport (6.1.7.8)
|
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
14
|
+
i18n (>= 1.6, < 2)
|
|
15
|
+
minitest (>= 5.1)
|
|
16
|
+
tzinfo (~> 2.0)
|
|
17
|
+
zeitwerk (~> 2.3)
|
|
18
|
+
addressable (2.8.6)
|
|
13
19
|
public_suffix (>= 2.0.2, < 6.0)
|
|
14
20
|
ast (2.4.2)
|
|
15
21
|
base64 (0.2.0)
|
|
22
|
+
bigdecimal (3.1.8)
|
|
16
23
|
bundler-audit (0.9.1)
|
|
17
24
|
bundler (>= 1.2.0, < 3)
|
|
18
25
|
thor (~> 1.0)
|
|
19
26
|
coderay (1.1.3)
|
|
20
|
-
|
|
27
|
+
concurrent-ruby (1.3.3)
|
|
28
|
+
crack (1.0.0)
|
|
29
|
+
bigdecimal
|
|
21
30
|
rexml
|
|
22
|
-
diff-lcs (1.5.
|
|
31
|
+
diff-lcs (1.5.1)
|
|
23
32
|
docile (1.4.0)
|
|
24
|
-
faraday (2.
|
|
33
|
+
faraday (2.8.1)
|
|
25
34
|
base64
|
|
26
35
|
faraday-net_http (>= 2.0, < 3.1)
|
|
27
36
|
ruby2_keywords (>= 0.0.4)
|
|
28
37
|
faraday-net_http (3.0.2)
|
|
29
|
-
hashdiff (1.0
|
|
30
|
-
|
|
38
|
+
hashdiff (1.1.0)
|
|
39
|
+
i18n (1.14.5)
|
|
40
|
+
concurrent-ruby (~> 1.0)
|
|
41
|
+
method_source (1.1.0)
|
|
42
|
+
minitest (5.23.1)
|
|
31
43
|
openssl (3.0.2)
|
|
32
|
-
parallel (1.
|
|
33
|
-
parser (3.2.0
|
|
44
|
+
parallel (1.24.0)
|
|
45
|
+
parser (3.3.2.0)
|
|
34
46
|
ast (~> 2.4.1)
|
|
35
|
-
|
|
47
|
+
racc
|
|
48
|
+
pry (0.14.2)
|
|
36
49
|
coderay (~> 1.1)
|
|
37
50
|
method_source (~> 1.0)
|
|
38
|
-
public_suffix (5.0.
|
|
51
|
+
public_suffix (5.0.5)
|
|
52
|
+
racc (1.8.0)
|
|
39
53
|
rainbow (3.1.1)
|
|
40
|
-
rake (13.
|
|
41
|
-
regexp_parser (2.
|
|
42
|
-
rexml (3.2.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
rspec-
|
|
46
|
-
rspec-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
rake (13.2.1)
|
|
55
|
+
regexp_parser (2.9.2)
|
|
56
|
+
rexml (3.2.9)
|
|
57
|
+
strscan
|
|
58
|
+
rspec (3.13.0)
|
|
59
|
+
rspec-core (~> 3.13.0)
|
|
60
|
+
rspec-expectations (~> 3.13.0)
|
|
61
|
+
rspec-mocks (~> 3.13.0)
|
|
62
|
+
rspec-core (3.13.0)
|
|
63
|
+
rspec-support (~> 3.13.0)
|
|
64
|
+
rspec-expectations (3.13.0)
|
|
50
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
51
|
-
rspec-support (~> 3.
|
|
66
|
+
rspec-support (~> 3.13.0)
|
|
52
67
|
rspec-its (1.3.0)
|
|
53
68
|
rspec-core (>= 3.0.0)
|
|
54
69
|
rspec-expectations (>= 3.0.0)
|
|
55
|
-
rspec-mocks (3.
|
|
70
|
+
rspec-mocks (3.13.1)
|
|
56
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
57
|
-
rspec-support (~> 3.
|
|
58
|
-
rspec-support (3.
|
|
72
|
+
rspec-support (~> 3.13.0)
|
|
73
|
+
rspec-support (3.13.1)
|
|
59
74
|
rubocop (0.93.1)
|
|
60
75
|
parallel (~> 1.10)
|
|
61
76
|
parser (>= 2.7.1.5)
|
|
@@ -65,12 +80,12 @@ GEM
|
|
|
65
80
|
rubocop-ast (>= 0.6.0)
|
|
66
81
|
ruby-progressbar (~> 1.7)
|
|
67
82
|
unicode-display_width (>= 1.4.0, < 2.0)
|
|
68
|
-
rubocop-ast (1.
|
|
69
|
-
parser (>= 3.
|
|
83
|
+
rubocop-ast (1.30.0)
|
|
84
|
+
parser (>= 3.2.1.0)
|
|
70
85
|
rubocop-rspec (1.44.1)
|
|
71
86
|
rubocop (~> 0.87)
|
|
72
87
|
rubocop-ast (>= 0.7.1)
|
|
73
|
-
ruby-progressbar (1.
|
|
88
|
+
ruby-progressbar (1.13.0)
|
|
74
89
|
ruby2_keywords (0.0.5)
|
|
75
90
|
simplecov (0.22.0)
|
|
76
91
|
docile (~> 1.1)
|
|
@@ -79,24 +94,31 @@ GEM
|
|
|
79
94
|
simplecov-badge (2.0.2)
|
|
80
95
|
simplecov-html (0.12.3)
|
|
81
96
|
simplecov_json_formatter (0.1.4)
|
|
82
|
-
|
|
97
|
+
strscan (3.1.0)
|
|
98
|
+
thor (1.3.1)
|
|
99
|
+
tzinfo (2.0.6)
|
|
100
|
+
concurrent-ruby (~> 1.0)
|
|
83
101
|
unicode-display_width (1.8.0)
|
|
84
102
|
vcr (6.1.0)
|
|
85
|
-
webmock (3.
|
|
103
|
+
webmock (3.23.1)
|
|
86
104
|
addressable (>= 2.8.0)
|
|
87
105
|
crack (>= 0.3.2)
|
|
88
106
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
107
|
+
zeitwerk (2.6.15)
|
|
89
108
|
|
|
90
109
|
PLATFORMS
|
|
110
|
+
arm64-darwin-23
|
|
91
111
|
ruby
|
|
92
112
|
x86_64-darwin-19
|
|
93
113
|
x86_64-linux
|
|
94
114
|
|
|
95
115
|
DEPENDENCIES
|
|
116
|
+
activesupport (~> 6.0)
|
|
96
117
|
bundler (~> 2.2)
|
|
97
118
|
bundler-audit (~> 0.9)
|
|
98
119
|
pry (~> 0.14)
|
|
99
120
|
rake (~> 13.0)
|
|
121
|
+
rexml (~> 3.2.7)
|
|
100
122
|
rspec (~> 3.9)
|
|
101
123
|
rspec-its (~> 1.3)
|
|
102
124
|
rubocop (~> 0.82)
|
|
@@ -108,4 +130,4 @@ DEPENDENCIES
|
|
|
108
130
|
webmock (~> 3.14)
|
|
109
131
|
|
|
110
132
|
BUNDLED WITH
|
|
111
|
-
2.2.
|
|
133
|
+
2.2.26
|
data/lib/veryfi/error.rb
CHANGED
|
@@ -1,63 +1,32 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
3
5
|
module Veryfi
|
|
4
6
|
class Error
|
|
5
7
|
def self.from_response(status, response)
|
|
6
8
|
if response.empty?
|
|
7
9
|
VeryfiError.new(format("%<code>d", code: status))
|
|
8
10
|
else
|
|
9
|
-
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def self.get_error(status, response)
|
|
14
|
-
case status
|
|
15
|
-
when 400 then BadRequest
|
|
16
|
-
when 401 then UnauthorizedAccessToken
|
|
17
|
-
when 404 then ResourceNotFound
|
|
18
|
-
when 405 then UnexpectedHTTPMethod
|
|
19
|
-
when 409 then AccessLimitReached
|
|
20
|
-
when 500 then InternalError
|
|
21
|
-
else VeryfiError.new(format("%<code>d, %<message>s", code: status, message: response["error"]))
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
class BadRequest < StandardError
|
|
25
|
-
def to_s
|
|
26
|
-
"400, Bad Request"
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
class UnauthorizedAccessToken < StandardError
|
|
31
|
-
def to_s
|
|
32
|
-
"401, Unauthorized Access Token"
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
class ResourceNotFound < StandardError
|
|
37
|
-
def to_s
|
|
38
|
-
"404, Resource not found"
|
|
11
|
+
VeryfiError.new(format("%<code>d, %<message>s", code: status, message: response["error"]), response)
|
|
39
12
|
end
|
|
40
13
|
end
|
|
41
14
|
|
|
42
|
-
class
|
|
43
|
-
|
|
44
|
-
"405, Unexpected HTTP Method"
|
|
45
|
-
end
|
|
46
|
-
end
|
|
15
|
+
class VeryfiError < StandardError
|
|
16
|
+
attr_reader :message
|
|
47
17
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
def initialize(message = "An error occurred", response = {})
|
|
19
|
+
@message = if response.empty?
|
|
20
|
+
message
|
|
21
|
+
else
|
|
22
|
+
JSON.pretty_generate(response)
|
|
23
|
+
end
|
|
24
|
+
super(message)
|
|
51
25
|
end
|
|
52
|
-
end
|
|
53
26
|
|
|
54
|
-
class InternalError < StandardError
|
|
55
27
|
def to_s
|
|
56
|
-
|
|
28
|
+
message
|
|
57
29
|
end
|
|
58
30
|
end
|
|
59
|
-
|
|
60
|
-
class VeryfiError < StandardError
|
|
61
|
-
end
|
|
62
31
|
end
|
|
63
32
|
end
|
data/lib/veryfi/version.rb
CHANGED
data/veryfi.gemspec
CHANGED
|
@@ -82,4 +82,6 @@ Gem::Specification.new do |spec|
|
|
|
82
82
|
spec.add_development_dependency "simplecov-badge", "~> 2.0"
|
|
83
83
|
spec.add_development_dependency "vcr", "~> 6.0"
|
|
84
84
|
spec.add_development_dependency "webmock", "~> 3.14"
|
|
85
|
+
spec.add_development_dependency "rexml", "~> 3.2.7"
|
|
86
|
+
spec.add_development_dependency "activesupport", "~> 6.0"
|
|
85
87
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: veryfi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Veryfi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -232,6 +232,34 @@ dependencies:
|
|
|
232
232
|
- - "~>"
|
|
233
233
|
- !ruby/object:Gem::Version
|
|
234
234
|
version: '3.14'
|
|
235
|
+
- !ruby/object:Gem::Dependency
|
|
236
|
+
name: rexml
|
|
237
|
+
requirement: !ruby/object:Gem::Requirement
|
|
238
|
+
requirements:
|
|
239
|
+
- - "~>"
|
|
240
|
+
- !ruby/object:Gem::Version
|
|
241
|
+
version: 3.2.7
|
|
242
|
+
type: :development
|
|
243
|
+
prerelease: false
|
|
244
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
245
|
+
requirements:
|
|
246
|
+
- - "~>"
|
|
247
|
+
- !ruby/object:Gem::Version
|
|
248
|
+
version: 3.2.7
|
|
249
|
+
- !ruby/object:Gem::Dependency
|
|
250
|
+
name: activesupport
|
|
251
|
+
requirement: !ruby/object:Gem::Requirement
|
|
252
|
+
requirements:
|
|
253
|
+
- - "~>"
|
|
254
|
+
- !ruby/object:Gem::Version
|
|
255
|
+
version: '6.0'
|
|
256
|
+
type: :development
|
|
257
|
+
prerelease: false
|
|
258
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
259
|
+
requirements:
|
|
260
|
+
- - "~>"
|
|
261
|
+
- !ruby/object:Gem::Version
|
|
262
|
+
version: '6.0'
|
|
235
263
|
description:
|
|
236
264
|
email:
|
|
237
265
|
- support@veryfi.com
|